Skip to content

fix(cache): report allowlist entries a model revision left stale - #1348

Merged
Gajesh2007 merged 1 commit into
masterfrom
fix/cache-allowlist-stale-artifact
Oct 5, 2026
Merged

Gajesh2007 merged 1 commit into
masterfrom
fix/cache-allowlist-stale-artifact

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

OpenRouter reports a 0% cache-hit rate for nvidia-nemotron-3.5-lightning while other models keep theirs. The cause is operational: new Nemotron weights were published under the same model ID on 2026-10-04 21:48 UTC, which changed the model's cache-routing tuple, and the coordinator's exact-artifact allowlist still names the previous one. Every Nemotron request is therefore planned as ineligible and served without cache routing. Nothing reports that state today.

This PR makes the coordinator report it: a stale_models count in GET /v1/cache/status with matching gauges, and one log warning per stale artifact that carries the exact tuple to append. Routing behaviour and the allowlist's exact-match rule are unchanged, so this does not restore Nemotron's hits by itself. That needs the allowlist change under "Production fix" below.

Linked issue

None.

Root cause

PlanCacheRouteWithResult only plans a request whose (model_id, model_aggregate_sha256, prompt_contract_id) is in EIGENINFERENCE_CACHE_ROUTING_ALLOWED_ARTIFACTS. A revision changes the tuple, and promotion does not update the list (step 5 of docs/operations/model-revisions.md).

Previous revision 2026-09-09-r1 Live revision 2026-09-30-r1
model_aggregate_sha256 be622ff6ae88… 366d9285ec36…
Prompt-contract files earlier template, tokenizer and config new chat_template.jinja, config.json, generation_config.json
Published 2026-09-09 2026-10-04 21:48:39 UTC

Evidence, all from public read-only endpoints on 2026-10-05 between 05:26 and 05:35 UTC:

  • GET /v1/models/catalog and the Nemotron manifest show the live revision and hashes above.
  • GET /v1/cache/status shows the allowlist is configured (count: 26) and cache routing is healthy overall since the 00:18 UTC restart: 719,958 requests evaluated, 631,034 planned, 73,262 SSD hits. That is consistent with one model being excluded and inconsistent with a fleet-wide fault.
  • GET /health shows build 5b7a675c, so none of the code merged after it is involved.

I could not read the production allowlist, so the missing entry is inferred, not observed. One read confirms it (see "Production fix").

None of the PRs merged on 2026-10-04 changes this gate. The revised weights case in TestCacheArtifactAllowlistRejectsBeforeActivationAndSidecar shows the decline is the intended behaviour.

Production fix

Confirm, then append the live tuple and restart through the approved procedure:

sudo docker exec coordinator printenv EIGENINFERENCE_CACHE_ROUTING_ALLOWED_ARTIFACTS \
  | jq '.[] | select(.model_id == "nvidia-nemotron-3.5-lightning")'
{"model_id":"nvidia-nemotron-3.5-lightning","model_aggregate_sha256":"366d9285ec367633c25b5c064ad94482e04be043c2a515a16e4fcf12c0a8f85b","prompt_contract_id":"bff76b44b69191cc1fdc8798da78efe1464d81828c030cf8109d6888d4c66717"}

The contract ID is the coordinator's own promptcontract.ContractID over the live manifest's tokenizer, template and config entries at normalization v8 and renderer v4. An independent reimplementation gives the same value, and the same reimplementation reproduces the runbook's recorded ternary-bonsai-2-27b contract ID (ce88a818…) at the versions in force when it was derived. Keep the previous tuple while providers converge.

What changed

  1. ArtifactAllowlist.StaleFor reports a live artifact whose model the list names only under other tuples. A model that was never listed is excluded on purpose and is not stale.
  2. Registry.MissingCacheRoutingAllowlistEntries applies that to the catalog's live artifacts and returns the tuples to append.
  3. ExactCacheStatusSnapshot counts them as artifact_allowlist.stale_models while routing is on. The public status still exposes no model IDs or hashes.
  4. warnNewlyMissingAllowlistEntries names each missing tuple in the coordinator log once, and again if it recurs after recovering.
  5. Gauges exact_cache_artifact_allowlist_stale_models and exact_cache.artifact_allowlist.stale_models.

The count reads the catalog's published identities, which exist before an artifact's files are fetched, so a catalog sync does not make it dip to zero or repeat the warning.

Before

flowchart TD
  P["Publish Nemotron revision 2026-09-30-r1<br/>same model ID, new hashes"] --> C["Catalog serves aggregate 366d9285"]
  C --> Q["PlanCacheRouteWithResult"]
  Q --> A{"ArtifactAllowlist.Allows<br/>list names be622ff6"}
  A -->|no match| I["Outcome ineligible<br/>no scope, no sidecar plan"]
  I --> Z["Nemotron cache hits 0%"]
  A -.->|nothing reports the mismatch| S["GET /v1/cache/status<br/>artifact_allowlist: configured, count"]
  classDef flow fill:#1e40af,color:#fff,stroke:#93c5fd;
  classDef bad fill:#991b1b,color:#fff,stroke:#fca5a5;
  classDef blind fill:#374151,color:#fff,stroke:#9ca3af;
  class P,C,Q,A flow;
  class I,Z bad;
  class S blind;
Loading

Blue is the unchanged planning path, red is the outcome and grey is the status that could not show it.

After

flowchart TD
  P["Publish Nemotron revision 2026-09-30-r1<br/>same model ID, new hashes"] --> C["Catalog serves aggregate 366d9285"]
  C --> Q["PlanCacheRouteWithResult"]
  Q --> A{"ArtifactAllowlist.Allows<br/>list names be622ff6"}
  A -->|no match| I["Outcome ineligible<br/>unchanged"]
  C --> T["missingAllowlistEntries<br/>ArtifactAllowlist.StaleFor"]
  T --> S["GET /v1/cache/status<br/>artifact_allowlist.stale_models: 1"]
  T --> L["Log warning, once<br/>model_id, aggregate, contract ID"]
  S --> O["Operator appends the logged tuple and restarts"]
  L --> O
  O --> H["Allows matches<br/>requests are planned again"]
  classDef flow fill:#1e40af,color:#fff,stroke:#93c5fd;
  classDef bad fill:#991b1b,color:#fff,stroke:#fca5a5;
  classDef added fill:#166534,color:#fff,stroke:#86efac;
  class P,C,Q,A flow;
  class I bad;
  class T,S,L,O,H added;
Loading

Green is new: the same decline, now counted and named.

Test plan

Pinned Go 1.25.0, -p 1, on the final combined version at base 8714e56d. The branch was then moved onto 55b5ad5a (#1253), which changes no file under coordinator/, go.mod, go.sum or the lint configuration, so the Go results carry over; the docs-impact check was rerun on the new base.

  • Reproduced with the production values through the real planner (a throwaway test, not committed). The coordinator's ContractID over the live manifest is bff76b44…. With the allowlist naming the previous revision and the catalog serving the live one, PlanCacheRouteWithResult returns ineligible and never calls the sidecar. With the live tuple appended, planning proceeds to the sidecar.
  • go test -count=1 ./... in coordinator/: 95 test packages pass, 0 fail, including the layout guard. PostgreSQL-backed tests are skipped (DATABASE_URL unset).
  • go test -race -count=1 ./tests/registry/ ./tests/api/inference/ ./tests/api/inference/contracts/: pass.
  • gofmt -l empty; go vet ./... clean; golangci-lint run v2.1.6 reports 0 issues; git diff --check clean.
  • make docs-impact-check BASE=origin/master: 18 changed files, coverage OK.
  • New tests, each confirmed to fail when its fix is undone (seven mutations, rerun on the final code):
    • TestCacheArtifactAllowlistMissingEntriesAreLiveArtifactsOfListedModels: unrestricted list, empty list, revisions of a listed model, appended revision.
    • TestExactCacheStatusCountsModelsListedOnlyUnderASupersededArtifact: seven cases including a never-listed model, previous weights, previous template and routing off. Asserts the status JSON contains no model ID or hash, and the gauge value.
    • TestStaleAllowlistCountDoesNotWaitForArtifactDownload.
    • TestStaleAllowlistWarningNamesTheMissingTupleOncePerOccurrence: one warning across repeated reads, none after the tuple is appended, one more on recurrence.
  • make docs-check: the six changed docs pass. The full run reports 7 broken links, all into the libs/mlx-swift-lm submodule, which is not initialized in my checkout. This relies on CI's Docs Lint.
  • Not verified against production: the allowlist itself (see "Production fix").

Refactor pass

A dedicated refactor subagent reviewed the first working version, as AGENTS.md requires. Its behaviour-preserving changes:

  • Renamed the registry and owner functions so the live tuple is "missing" and the list entry is "stale". The first version called the live artifact stale, which told an operator to append the wrong thing.
  • Made the lookup a pure query: the status snapshot now calls the query, then the warning, then sets the count, where the log write was previously hidden inside the count.
  • Corrected two doc statements (a weights-only revision keeps its prompt contract; the warning only exists for a model the list already names).

It kept the three-package split and found one robustness issue, which I then fixed: the first version only considered artifacts whose files were ready, so every catalog sync briefly reported zero and repeated the warning. The validation below ran on the combined final version.

Components touched

  • coordinator (Go)
  • provider (Rust, legacy)
  • provider-swift (Swift CLI)
  • console-ui (Next.js)
  • enclave (Swift)
  • infra / CI / release
  • docs

Protocol / interface changes

  • No protocol/interface changes
  • Yes — described above and matching side updated

GET /v1/cache/status gains the integer artifact_allowlist.stale_models. Existing fields are unchanged and nothing consumes the new one yet.

Documentation impact

  • Canonical documentation updated: docs/reference/api-contracts.md (field and gauges), docs/reference/telemetry-inventory.md (gauge), docs/operations/cache-routing-rollout.md (new "Stale entries after a model revision" section, a verification bullet, and a note that the September literal tuples no longer match a current build), docs/operations/model-revisions.md (step 5), docs/architecture/cache-aware-routing.md (mechanism and code map), docs/developer/navigation.md (ownership row), and CHANGELOG.md.
  • No documentation needed

Notes for reviewers

  • This is a signal, not a behaviour change. A revision still needs its tuple appended. Whether a weights-only revision with an unchanged prompt contract should inherit its predecessor's entry is a rollout-policy decision I left alone.
  • Second trigger. ContractID hashes the normalization and renderer versions, so a coordinator release that bumps either (as Fix Nemotron prompt parity and first-byte/cache regressions #962 did) makes every listed tuple stale at once. stale_models would then equal the number of listed models.
  • Convergence. Planning uses the catalog's current hash, so providers still on the previous weights cannot serve cached requests for the model even after the tuple is appended. Hits recover as providers switch.
  • Runbook literals. The two tuples in "Widen the plan gate and add Nemotron Lightning and Bonsai 2" were derived at normalization v6. I marked them as superseded and did not replace them, because a literal goes stale the same way.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Cache routing plans a request only when its exact artifact tuple is in
EIGENINFERENCE_CACHE_ROUTING_ALLOWED_ARTIFACTS. Publishing new weights or a
new template under the same model ID changes the tuple, so the model silently
lost cache routing until an operator appended the new one. Nothing reported
it; this is how nvidia-nemotron-3.5-lightning fell to 0% cache hits.

Count such models as artifact_allowlist.stale_models in GET /v1/cache/status,
with Prometheus and Datadog gauges, and name each live tuple once in the
coordinator log. The public status still exposes no model IDs or hashes.
Routing and the allowlist's exact-match rule are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 5, 2026 6:25am UTC
d-inference-console-ui-dev Ready Ready Preview Oct 5, 2026 6:25am UTC
d-inference-landing Ready Ready Preview Oct 5, 2026 6:25am UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 5, 2026 6:25am UTC

Request Review

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head a5e8f87934a6 against base 55b5ad5a6552.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Ten-PR pilot complete; maintainer evaluation required

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

@Gajesh2007

Copy link
Copy Markdown
Member

@codex review this

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T06:37:22.489341Z a5e8f87 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: a5e8f87934

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Gajesh2007
Gajesh2007 merged commit bf3dc67 into master Oct 5, 2026
34 of 35 checks passed
@Gajesh2007
Gajesh2007 deleted the fix/cache-allowlist-stale-artifact branch October 5, 2026 06:43
jonathan308 added a commit that referenced this pull request Oct 5, 2026
The base now contains master bf3dc67.

Four documentation pages conflicted with the allowlist stale-entry
reporting change (#1348) and the CI and provider-test notes on master:

- docs/developer/navigation.md: master's allowlist row and this
  branch's retained-byte budget row are both kept.
- docs/developer/test.md: master's new paragraphs and this branch's
  attempt-budget paragraph are both kept.
- docs/architecture/cache-aware-routing.md and
  docs/reference/telemetry-inventory.md: only the "Last updated"
  stamps conflicted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

4 active deployments
Preview – d-inference — a5e8f879 Deployed Oct 5, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — a5e8f879 Deployed Oct 5, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — a5e8f879 Deployed Oct 5, 2026 by vercel[bot]
Preview – d-inference-landing — a5e8f879 Deployed Oct 5, 2026 by vercel[bot]
benchmarks — a5e8f879 Deployed Oct 5, 2026 by jonathan308 via E2E Benchmarks #2279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants