You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 859de84
Browse filesBrowse the repository at this point in the historyBrowse files
feat(devx): pin the ported guard-main-checkout self-test, and stop --resync rewriting governed files (#7954)
`scripts/upstream-port-pin.json` covered only `scripts/`, so the verbatim
cross-repo ports under `.claude/hooks/**` — this repo's densest concentration of
copies from the same upstream, and the one directory whose drift history is four
separate human catches (#5459, #5712, #5789, #6042) — had no drift gate at all.
Two changes, in the order they have to happen:
1. `--resync` now REFUSES to rewrite a ported path on the governed surface
unless `--rewrite-governed-file` is passed, naming the path, the surface it
matched and the flag. The governed set is read from
`check-governed-queue-guard.mjs` rather than re-listed. The CHECK path is
untouched: a drifted governed port reds with no flag and no exemption.
2. `.claude/hooks/guard-main-checkout.selftest.sh` is registered against the
upstream blob the pin already names, with 14 declared divergences and a
one-sentence `why` each.
The wiring test's `pinned ⊆ patrol.paths` assertion silently encoded "the ledger
only pins the sweeper's unit". It is re-scoped to the patrol's own unit, and the
claim that matters for entries outside it is asserted directly: no pinned file
falls inside `lint.yml`'s ignore set, so the PR that drifts one is never the PR
on which the gate does not run.
Claude-Session: https://claude.ai/code/session_013uAaxiwgYDybsTNV9xwa1M
Co-authored-by: Claude <noreply@anthropic.com>
t('a NON-governed ported path is unchanged: it writes, and says nothing',plain.write===true&&plain.governed===false&&plain.reasons.length===0);
637
+
t('…and the flag does not change it either',JSON.stringify(resyncWriteVerdict('scripts/pm/check-half-states.mjs',{allowGoverned: true}))===JSON.stringify(plain));
638
+
// ⛔ The CHECK path is not governed by any of this. Drift in a governed port
639
+
// reds with no flag and no exemption — the refusal is about WRITING, and a
640
+
// gate that went quiet on the surface with the worst drift history would be
641
+
// this whole mechanism inverted.
642
+
constgovEntry={ ...ENTRY,ported: GOV};
643
+
t('checking a governed ported file is NOT gated: parity still holds',verifyFile(govEntry,PORTED).ok);
644
+
t('…and drift in one still REDS, with no flag involved',!verifyFile(govEntry,driftedOutside).ok);
645
+
646
+
// ── row 6: a malformed pin is REFUSED, never read as clean ─────────────────
0 commit comments