Repository navigation
fix(drift): anthropic deprecation drift actually runs, and an unclassifiable skip is not a quiet day - #356
Merged
Conversation
commit: |
…ur coverage `detectDeprecatedFamiliesForSync` refused to diff a live `/models` listing carrying fewer RAW IDS than the number of distinct FAMILIES aimock mocks for that provider. That is a unit mismatch, and the rationale written next to it — "a healthy listing returns many more raw ids than distinct families, because every dated snapshot multiplies one family into several ids" — only holds for a provider whose listing is inflated by ids we exclude. openai excludes 44 families plus every `-preview`; gemini 24. Anthropic excludes three legacy tokens and serves roughly one id per family. So anthropic's floor was 20 against a live listing of 11, and its entire deprecation half was abandoned on 12 of 12 `Fix Drift` runs with surviving artifacts (2026-07-24 -> 2026-08-05) — every one of them green, silent, and byte-identical to a genuinely quiet day. It was never reachable rather than unlucky: this repo's own frozen HEALTHY anthropic wave is 16 ids, already under 20, and the floor ratcheted up by one with every family classified (19 -> 20 in an ordinary "classify claude-opus-5" commit) while the supply side could only shrink as Anthropic retired models. A coverage floor conflates "the listing is broken" with "we mock more than the provider still serves" — and the second is exactly the condition this detector exists to report. The floor is now an explicit per-provider raw-id count, `MIN_LISTING_SIZE`, set below the smallest healthy listing there is evidence for and never above what is OBSERVED to clear: openai 20 (cleared 40 on 12/12 runs, frozen wave 59), anthropic 8 (live 11, frozen wave 16), gemini 8 (only direct evidence is that it cleared 9, so it is not set from its 52-id fixture). One copy, in deprecation-detector.ts, consumed by both mirrors so they cannot diverge. Raising a number here switches a provider's deprecation detection off silently, which is the same one-line silencing edit FORWARD_LOOKING_FAMILIES is pinned against, so MIN_LISTING_SIZE is checksum-pinned in logic-pin.test.ts too. RED, watched, against the real `runDriftSyncCore` with the recorded listing shape: `[skipped] anthropic: live /models listing too short to trust for anthropic (11 raw id(s), need >= 20 ...)`, `unchecked-providers=` EMPTY, `reason=ok-no-churn`, exit 0 — and the same for the frozen healthy 16-id wave. GREEN: anthropic is CHECKED, and surfaces the retired claude-3.x families. Both mutations bound — restoring `classified.size` reds four of the five new cases, and deleting the floor outright reds the fifth (the fail-closed control) plus four pre-existing ones.
…ot a quiet day Ported from fd867dc on drift/348-followup, with the one hunk that described the floor as a family count rewritten to match this branch's MIN_LISTING_SIZE. The stale-key preflight in fix-drift.yml is keyed on a machine line (`unchecked-providers=<csv>`) and fails closed on an absent or unreadable one — but the line was BUILT from an allowlist of the two skip classes someone had thought of: a missing key, and an `infra error (status 40[123])`. Everything else returned false, i.e. "this provider was checked and nothing drifted". There is a third class. `detectDeprecatedFamiliesForSync` abandons the entire deprecation half for a provider whose live `/models` listing comes back too short to trust, and pushes that onto `outcome.skipped`. The allowlist did not name it, so `unchecked-providers=` came back EMPTY, the workflow read the run as a quiet day, and deprecations for that provider stopped being checked at all: green, no alert, every morning, for as long as it lasted. The core loop's own `?? "live listing unavailable"` fallback fell through the same hole. Inverted rather than extended by one case, because extending an allowlist of faults leaves the NEXT class invisible in exactly the same way. TRANSIENT is now the allowlist (a 429 or a 5xx — those resolve on their own and must never red an unattended cron) and every other reason, including one a later change adds, counts as unchecked. An UNKNOWN must not collapse into the answer that passes. RED, watched on this base, EXECUTED against the real sync step body with the machine line built by the real emitter and the skip reason taken from the real producer: the step republished reason=ok-no-churn and exited 0. GREEN: it publishes provider-unchecked, exits 1 and names openai. Three mutations bound — always-checked reds 5 cases, always-unchecked reds the transient negative control (4), and dropping the 5xx arm reds the classifier agreement test. This is the half that keeps the class self-reporting. It ships WITH the floor fix and not without it: on its own, anthropic is under the floor on every run, so it would publish unchecked-providers=anthropic and red the daily cron every morning — OBSERVED by reverting the floor and re-running the recorded shape. The two workflow messages and DRIFT.md no longer promise that the cause is a credential to rotate; they point at the per-provider `[skipped]` reason in the drift-sync-log artifact instead.
…r applied `includeFamilies` membership is checksum-pinned in `logic-pin.test.ts`, and gate-2 re-runs that whole file over the tree the sync just edited. So a persisted mechanical removal always reds its OWN gate: pin-check-failed -> revertFiles([...touchedFiles]) -> the registry edit AND every needs-human note written that run are wiped -> reason=gate-failed, no PR of any class. OBSERVED by driving the real runDriftSyncCore, the real evaluateSyncCheck and the real runPinCheck against this repo's own frozen healthy 16-id anthropic wave: `removed anthropic/claude-opus-5` took three legitimate still-referenced notes down with it and delivered nothing. drift-sync cannot repair that itself — drift-sync-check's changed-file allowlist is model-registry.ts + drift-proposals/ only, so it is forbidden from touching the pin, and the pin reserves the re-pin for a deliberate, reviewed human decision. Attempting an edit that can never be kept, at the cost of the run's other findings, is strictly worse than not attempting it. So the removal is still mechanically DETERMINED — the AST probe still runs, and still distinguishes a well-formed removal from a locator miss — but it is delivered as a note naming the exact two-file edit (the literal, and its DATA_FROZEN pin) for one reviewed commit. The registry is never mutated by a deprecation, so the gate is never consulted and the notes always survive. Also: the floor's anti-ratchet invariant probed at `includeFamilies.size - 1`, which re-introduced the coupling it forbids, pointing the other way — gemini mocks 9 families against a floor of 8, so a single legitimate gemini retirement would have redded it and blamed a coverage-tracking floor that is a constant. It now probes the smallest listing each provider is EVIDENCED to return, with the size relation asserted separately and accurately.
… carries A zero-reference deprecation is a needs-human note now, not a mechanical removal, so the step's `::error::` line and the PR body both understated what the run found: they named only the still-referenced deprecation. A reader who opened the PR on the strength of that line would have been told the wrong thing about the note in front of them. Text only — no gating, no expression, no `run:` body logic changed.
jpr5
force-pushed
the
drift/anthropic-threshold
branch
from
August 6, 2026 03:01
7e88436 to
25cd7f0
Compare
jpr5
marked this pull request as ready for review
August 6, 2026 03:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anthropic deprecation drift has never once run. It was skipped on 12 of 12
Fix Driftruns with surviving artifacts (2026-07-24 -> 2026-08-05), and every one of those runs was green and silent. Two changes, and they only work together.1. The floor was measuring the wrong thing
detectDeprecatedFamiliesForSyncrefused to diff a live/modelslisting carrying fewer raw ids than the number of distinct families aimock mocks for that provider. That is a unit mismatch. The rationale written next to it — "a healthy listing returns many more raw ids than distinct families, because every dated snapshot multiplies one family into several ids" — holds only for a provider whose listing is inflated by ids we exclude. openai excludes 44 families plus every-preview; gemini 24. Anthropic excludes three legacy tokens and serves roughly one id per family.So anthropic's floor was 20 against a live listing of 11:
It was never reachable rather than unlucky. This repo's own frozen healthy anthropic wave (
models.drift.ts, 2026-07-16) is 16 ids, already under 20 — a perfect day would have skipped too. And the floor ratcheted up by one with every family classified (19 -> 20 in an ordinary "classify one more family" commit) while the supply side could only shrink as Anthropic retired models. A coverage floor conflates "the listing is broken" with "we mock more than the provider still serves", and the second is exactly the condition this detector exists to report.The floor is now an explicit per-provider raw-id count,
MIN_LISTING_SIZE, one copy indeprecation-detector.tsconsumed by both mirrors.The rule behind all three is never raise a floor above what has been proven to clear — the discipline whose absence created this bug. A new behavioural invariant enforces that the floor can never again track our own coverage, and
MIN_LISTING_SIZEis checksum-pinned inlogic-pin.test.ts, because raising a number there is a one-line way to switch a provider's deprecation detection off.2. A skip we cannot classify is not a quiet day
Ported from
fd867dcondrift/348-followup(its parent6f74e1b, another slot's region, was not taken). The stale-key preflight builtunchecked-providers=<csv>from an allowlist of the two skip classes someone had thought of — a missing key, andinfra error (status 40[123]). Everything else returned "checked fine", and the too-short-listing skip was a third class nobody had named. It is now inverted: TRANSIENT (429 / 5xx) is the allowlist, and every other reason — including one a later change adds — counts as unchecked. An UNKNOWN must not collapse into the answer that passes.They ship together, and here is why
unchecked-providers=empty, no false alertunchecked-providers=anthropic->provider-unchecked-> the daily cron reds every morning, foreverunchecked-providers=is empty again and the next skip class is silent, exactly as this one wasRed -> green, watched
Half 1, driven through the real
runDriftSyncCoreand the exact log sequencerunDriftSyncCliemits, with only the network fetch replaced by the recorded shape. RED: the skip line above, byte-matching run 30983699726, plusreason=ok-no-churnand exit 0 — and the same for the frozen healthy 16-id wave. GREEN: no skip at all; anthropic is checked. Mutations bound: restoringclassified.sizereds 4 of the 5 new cases, and deleting the floor outright reds the 5th (the fail-closed control) plus 4 pre-existing ones.Half 2, executed against the real
syncstep body with the machine line built by the real emitter and the skip reason taken from the real producer. RED:expected 'ok-no-churn' not to be 'ok-no-churn', step exit 0. GREEN: publishesprovider-unchecked, exits non-zero, namesopenai. Three mutations bound — always-checked reds 5, always-unchecked reds 4 (including the transient negative control), dropping the 5xx arm reds the classifier-agreement test.A defect was found and fixed mid-flight: the first draft of the new tests pasted real anthropic family ids into
drift-sync-core.test.ts, which sits inside the treeisFamilyStillReferencedscans. That moved all nine zero-referenced anthropic families into "still referenced" — a test fixture changing production classification. Every fixture now uses ids that match no family, and the reference scan is byte-identical to its pre-change state.What the first run after merge will do
Expect one needs-human PR. That is the point, not a regression — it is eight weeks of invisible retirements arriving at once. Observed against the recorded shape:
drift-proposals/*.mdnotes, allneeds-human-still-referenced, so the registry is not touched:claude-3-opus,claude-3-sonnet,claude-3-haiku,claude-3-5-sonnet,claude-3-5-haiku,claude-3-7-sonnet(the six with published Anthropic retirement dates before today), plusclaude-opus-4andclaude-haiku-4.needs-human.One thing to watch.
claude-opus-5is zero-referenced in aimock's source, so if it is genuinely absent from Anthropic's live listing the run will mechanically remove it fromincludeFamiliesrather than route it to a note. Nine anthropic families are in that position (the modern 4.x/5 point releases). Whether the real listing contains them is inferred, not observed — no provider API was called here. The same mechanism already governs 26 zero-referenced openai families and 6 gemini ones, and neither provider has ever produced a removal across all 12 retained runs, which is direct evidence their listings do contain them. Either way nothing ships unreviewed: a removal passesdrift-sync-checkand lands as a PR that is never auto-merged.Gates
pnpm build0 (before tests) ·pnpm test0 (5033 passed, 171 files; 5030 onmain) ·pnpm test:drift0 (119 passed / 66 skipped) ·tsc --noEmit0 ·pnpm lint0 ·prettier --check .0 ·pnpm test:exports0 ·actionlint0 ·zizmor --persona=regular0 findings ·bash -non all 16run:bodies, 0 failures. No flakes.Consumes no version — no
package.json,CHANGELOG.md,.claude-plugin/*,charts/*,packages/aimock-pytest/*orpnpm-lock.yamlchange. The mirror-equivalence guard stays green, including the documented forward-looking divergence. No live provider API was called and no credential was read.