Repository navigation
fix(drift-sync): enforce the pin-file boundary in the checker, not the writer - #428
Merged
Merged
Conversation
…e writer Admitting `logic-pin.test.ts` to `drift-sync-check`'s changed-file allowlist moved the only constraint on that file out of the external gate and into the writer. Because `model-registry.ts` is allowlisted too, that combination was enough to silence a frozen surface: widen `isClassifiedFamily`, re-paste that surface's FROZEN checksum, and gate-1 (allowlist) and gate-2 (the pin test, whose oracle IS that file) both pass. Reproduced against the real tree — `drift-sync-check` returned `reason=ok` for a tree where `gpt-zeta` had been classified by fiat. * New `scripts/drift-pin-file.ts`, imported by BOTH the writer and the checker. `verifyPinFileEdit` states the property as a reconstruction: re-apply exactly the entitled membership re-pins to the pre-edit file and require the result to equal the post-edit file byte for byte. `drift-sync-check` gate-1b evaluates it over the git diff (HEAD vs working tree), keyed to `SYNC_REPINNABLE_KEYS`, and refuses with `pin-file-not-a-membership-repin` (exit 23). * `onlyPinsChanged` is no longer described, or used, as a guard. It masks EVERY `pin:` literal — the FROZEN logic checksums included — so it can tell neither which pin moved nor whether the sync may move it; it now only picks which of the refusal's two messages is true. * `updateDataFrozenPin` locates the entry through the TypeScript AST and rewrites its own pin literal span. The forward text scan it replaces refused only on an intervening QUOTED key, and three real DATA_FROZEN keys are unquoted — so a target entry with an unrecognisable pin landed the write on `knownVoiceModelFamilies`'s pin, reported `locatorMiss: false`, and passed the old pin-only guard. Reproduced against the real file. * The writer's own check now runs on WHAT LANDED, by reading the pin file back after writing it, and reverts both files on refusal. The version it replaces verified its own in-memory rewrite, so it could not return false from its only call site: mutating that call site to `if (false)` left the suite green. * A DECIDED voice/audio family absent from `knownVoiceModelFamilies` is routed to a human instead of half-applied. `excludeFamilies` and the voice seed set are deliberately disjoint and the sync writes only the first, so applying one half left ws-realtime.drift.ts reporting UNKNOWN_REALTIME_MODELS at critical severity: gate-3 refused, both files reverted, the note still said `Decision: exclude`, and the identical apply/fail/revert/alert repeated every night forever. Proven end to end on the real files with the real canary computation, in both directions — routed while the seed set lacks the family, auto-applied with a clean canary once it has it. * A re-pin refusal reports the classification as NOT APPLIED and leaves a deduped note. The refusals used to return with `action: "added"` for an edit that was never written, so the log, the commit body and `computeChangesetKey` all claimed work the run had not done. * `fix-drift.yml`'s automation-boundary comment no longer says the sync "only ever" edits `model-registry.ts`. Every guard above was mutation-proven: setting its condition to `if (false)` takes the suite red. The one branch that survived that test — the pin-only pre-cut — was demoted rather than kept, because a guard that cannot change a verdict is not a guard.
commit: |
Merged
jpr5
added a commit
that referenced
this pull request
Sep 11, 2026
Cuts the accumulated `[Unreleased]` work. **MINOR** — a new provider surface (BytePlus Ark video) and new endpoints, no breaking changes. **Prepared, not merged.** `publish-release.yml` fires on push-to-main, so merging this publishes to npm, tags `v1.41.0`, cuts the GitHub Release, dispatches the Docker build, and posts to Slack. Merge when you want it live. ## What ships Only **#424** (plus its follow-up **#429**, which fixes the same never-released BytePlus code) touches the published package. Verified against `package.json` `files` + `tsconfig` include/exclude: ``` git log v1.40.0..origin/main --oneline -- src/ ':(exclude)src/__tests__/' fixtures/ .claude-plugin/ skills/ CHANGELOG.md ``` …returns byteplus commits only. #422, #423, #425, #426, #427, #428 touch scripts/, .github/ and docs/ exclusively and are deliberately **not** in the CHANGELOG. ### Added - BytePlus Ark (Seedance) video record/replay — submit, poll and retrieve, stored as the raw Ark task envelope - `--provider-byteplus` flag ### Changed - `/api/v3` chat and image requests are attributed to the `byteplus` provider - `aimock-pytest` pin moves to 1.41.0 ### Fixed - Startup error when a BytePlus provider base already ends in `/api/v3` ## Version surfaces — seven, all bumped Found by grepping the tree for `1.40.0`, not from a checklist. **Zero occurrences of the old string remain** (excluding `CHANGELOG.md` history, `fixtures/` and `pnpm-lock.yaml`): | File | Field | 1.40.0 → 1.41.0 | | --- | --- | --- | | `package.json` | `version` | ✔ | | `charts/aimock/Chart.yaml` | `appVersion` (chart `version` stays `0.1.0`) | ✔ | | `.claude-plugin/plugin.json` | `version` | ✔ | | `.claude-plugin/marketplace.json` | `plugins[0].source.version` (`^1.41.0`) | ✔ | | `docs/index.html` | demo banner `aimock v…` | ✔ | | `packages/aimock-pytest/src/aimock_pytest/_version.py` | `AIMOCK_VERSION` npm pin | ✔ | | `packages/aimock-pytest/README.md` | `--aimock-version` default | ✔ | `AIMOCK_VERSION` **must** move this release: `/api/v3/contents/generations/tasks` is a new server route, so a default-download pytest user on the 1.40.0 pin would run a server without it. `packages/aimock-pytest/pyproject.toml` is deliberately untouched — that package versions on its own PyPI cadence. There is **no version constant in `src/cli.ts`** and **no `metadata.version` in `marketplace.json`** in this tree; both surfaces exist only in the release checklist, not in the repo. ## Drive-by: the npm description has been `<div align="center">` since the README got a centered header `npm view @copilotkit/[email protected] description` returns the literal string `<div align="center">`. Both README-subtitle extractors — the inline `node -e` in `publish-release.yml` and `syncDescriptionFromReadme()` in `scripts/drift-sync.ts` — skip `#`, `[`, ` https://claude.ai/code/session_01AvkmhXVLqSSEW6FvPQHSu5
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.
Follow-up to #423, from a four-reviewer retrospective review (all four
NOT-APPROVED, keep merged, fix forward). Every finding below was reproduced
against the real
model-registry.ts/logic-pin.test.tsbefore the fix, andevery guard was mutation-proven after it.
1. The gate boundary is back in the checker
Admitting
logic-pin.test.tstoALLOWED_EXACT_FILESmoved the only constrainton the pin file out of the external gate and into the writer.
model-registry.tsis allowlisted too, so the pair was sufficient to silence a frozen surface.
RED — widen
isClassifiedFamilyto classifygpt-zetaby fiat, thenre-paste that surface's FROZEN checksum:
GREEN — same tree, same command, after the fix:
onlyPinsChangedwas NOT the fix — it masks everypin:literal, FROZENchecksums included, so the silenced tree reads as pin-only to it (asserted in a
test). The predicate is a reconstruction: re-apply exactly the entitled re-pins
to the pre-edit file and require byte equality with the post-edit file.
drift-sync-checkgate-1b evaluates it over the git diff, keyed toSYNC_REPINNABLE_KEYS; the writer evaluates it over what LANDED on disk, keyedto the run's own re-pins.
2. The wrong-key pin rewrite
updateDataFrozenPin's adjacency check only matched QUOTED keys, and three realDATA_FROZENkeys are unquoted — one directly after"excludeFamilies.gemini".RED, against the real pin file, target entry's own pin unrecognisable:
GREEN — entry located through the TypeScript AST, pin replaced span-exactly
inside its own literal:
The "two independent guards" claim is gone from the comments: for a wrong-key
write it was one guard and a no-op. What is there now is one guard and one
external gate that does not trust it.
3. Exclude is complete, or it does not run
excludeFamiliesandknownVoiceModelFamiliesare deliberately disjoint and thesync writes only the first.
RED, real files, gate-3 modelled on the real
ws-realtime.drift.tscomputation:
GREEN, both directions:
The predicate keys on the voice SEED SET, not on the id's shape, and covers
includeas well — the canary reads the seed set, not the classification. Thenote template no longer advertises an auto-apply the sync will refuse.
4. Honest reporting
RED:
reason= needs-human | registry written? falsewhileoutcomes: ["added:openai/gpt-zeta"]and the commit body read- added openai/gpt-zeta. GREEN:outcomes: ["needs-human-repin:..."],empty commit body, and a deduped
-pin-repin-failure.mdnote.fix-drift.yml's "only ever editsmodel-registry.ts" comment is corrected.Mutation proof (
if (false)on every guard; baseline 152 passed)updateDataFrozenPinentry/pin refusalverifyPinFileEditreconstructionverifyPinFileEditallowed-key scopeA seventh branch — the
onlyPinsChangedpre-cut — survived, so it was demoted toa message selector rather than kept: a guard that cannot change a verdict is not
a guard.
Gates
prettier --check0 ·eslint .0 ·pnpm typecheck0 ·vitest run0(5791 passed / 46 skipped) ·
actionlint0 ·commitlint0.Does not touch
model-registry.ts's family lists (owned concurrently by thegpt-live-1classification, now on main and rebased under this).