Repository navigation
fix(pm): check-governed-merges hands the guard's readers a git that carries stdin - #37071
Conversation
…arries stdin git() spawned with stdin ignored and took no input, and --pr (pullRecordStage) and the sweep (readArmLanding) handed the guard's readers (argv) => git(root, argv), dropping the second argument. unexplainedPathsBetween feeds the moved paths to `git check-attr --stdin`, so it read nothing and every moved path read as a regeneration: regenCarry could carry a record past a hand edit in both readings. git() now takes an optional input (stdin piped only when one is given, 'ignore' otherwise), checkoutGitReader(root) is the (argv, input) reader both handoffs use, and readArmLanding's two wrappers forward input. Self-test: a new battery on a throwaway repo with real git, plus a seam pin at each handoff. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAm5Tp3iBkiJk6nMwa5
…mary line Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAm5Tp3iBkiJk6nMwa5
|
repo:objectstack#2 · huangyiirene · session_01J8VVAm5Tp3iBkiJk6nMwa5 Final green head for L1 and L2: |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf L1-a runs the isolated CONTRACT_REVIEW_TIER subagent on this head, in parallel with its L1 read. |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf Contract reviewServed-tier: PR #37071 for card #37038. One file in the diff, and it is the ① Derived judgments
② Semver levelNothing is published: the diff is one file under Clause-②: no. Declared on the PR body and on the card, and it holds: no published schema, no declared capability and no consumer-facing behaviour moves. What narrows is a fleet report's reading, made to agree with the rule the queue already enforces. ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Nits, none with any effect on correctness or the contract:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf The brief handed to the isolated CONTRACT_REVIEW_TIER subagent whose record is 7148249543 (verify-review-tier PASS: 24 assistant turns, every one at CONTRACT_REVIEW_TIER). The inputs it was given were the card, the PR and the head check-runs, plus read-only git and gh access. It got no L1 conclusions. Brief |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf L1 review · ACCEPTHead-sha: 席位核对
席位意见: ACCEPT (Tier H, hand to the seat). |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAm5Tp3iBkiJk6nMwa5 Final green head for the delta review: |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf Delta contract review of record 7148249543 after the merge of main. L1-a runs the isolated CONTRACT_REVIEW_TIER subagent. |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf Contract reviewServed-tier: Delta round on PR #37071 for card #37038. This head is a merge of ① Derived judgments
② Semver levelNothing is published: the diff is one file under Clause-②: no. Declared on the PR body and on the card, and it holds: no published schema, no declared capability and no consumer-facing behaviour moves. What narrows is a fleet report's reading, made to agree with the rule the queue already enforces. ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. What
Nits carried from 7148249543, unchanged because the file is unchanged; none has any effect on correctness or the contract:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf The brief handed to the isolated CONTRACT_REVIEW_TIER subagent whose delta record is 7148767275 (verify-review-tier PASS: 27 assistant turns, every one at CONTRACT_REVIEW_TIER). It got no L1 conclusions. Brief |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf 席位核对ACCEPT — PR #37071 re-accepted on the merge-main head (L1-a, delta of ACCEPT 7148271983). Head-sha:
|
|
repo:objectstack#2 · huangyiirene · session_01J8VVAm8Y73VGNq3PkTe3dc 维护者速读
Approval requested on head |
Requested by Irene · project thread
Fixes #37038
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
scripts/pm/check-governed-merges.mjsonly.git(root, args, input): takes an optionalinput. With one, git gets it on a piped stdin; without one, stdin stays'ignore'exactly as before, so every existing plain caller (tryGit, the enumeration reads) is unchanged. The options live ingitSpawnOptions(root, input)so the self-test can pin them.checkoutGitReader(root)returns(argv, input) => git(root, argv, input), the queue guard's ownrunGitshape. Both handoffs now use it:--printopullRecordStage: wassameCheckout ? (argv) => git(root, argv) : null.readArmLanding: was(argv) => git(root, argv).readArmLanding's two wrappers around that reader (armGit, and thegitwrapper inarmSettledWithoutUnread) forwardinputtoo. Neither carries a stdin read today, but both are git readers handed toguard.readLowRiskTier, so a later stdin read there would hit the same hole.Every
(argv) => git(root, argv)style handoff in this file, as grep finds it at the base938a48f1:runGit:in--prpullRecordStage→readLowRiskRecordStage→regenCarry→unexplainedPathsBetween(check-attr --stdin)runGit:in the sweep's arm legreadArmLanding→ record pair →regenCarry→unexplainedPathsBetweenarmGit/armSettledWithoutUnreadgitguard.readLowRiskTier(show, ls-tree, diff-tree)git:intoreadWorkflowDiff(--branchand--pr)ls-tree,showrun:(tryGit) intoderiveBranchPaths,pullWorkflowDiff,pullChangesetReading,pullCatalogReadingThe only stdin command across
record-recognisers.mjs,check-governed-queue-guard.mjsand this file isunexplainedPathsBetween'scheck-attr --stdin. The guard and the recognisers are not edited, and no regen-carry logic is restated here.Why
unexplainedPathsBetweenpasses the moved paths asrunGit's second argument togit check-attr --stdin. The handoffs dropped that argument andgit()ignored stdin, so check-attr read nothing and every moved path read as explained. That letregenCarryread a false carry in--pr's pre-landing reading and in the post-merge governed audit. The queue guard passes input itself, so the merge gate was never affected.Tests
Self-test, final head 4d8079f: 972 assertions, exit 0 (base 938a48f: 963)
bash scripts/pm/os-verify-lock.sh -c 'node scripts/pm/check-governed-merges.mjs --self-test'givesVERDICT command-exit 0,972 assertions. That is 9 new cases:⭐ the git reader handed to the guard's readers carries STDIN (check-attr --stdin), floor 6. The roster floor goes from 41 to 42. It runs offline, with real git, on a throwaway repo. The repo has.gitattributesroutinggen/out.jsontomerge=os-regen, and a branch that movesscripts/pm/x.mjsandgen/out.jsontogether, then the generated path alone.check-attr --stdinthroughcheckoutGitReaderanswersunspecifiedfor the hand path andos-regenfor the generated one.unexplainedPathsBetween, the moved non-regen path reads unexplained. This is the card's case that fails today.os-regenpath reads explained.gitSpawnOptionswith no input givesstdio[0] === 'ignore'and noinputkey.gitSpawnOptionswith input gives a piped stdin carrying it byte for byte.--pr.pullRecordStageis handedcheckoutGitReader(fixture), and the reader the guard'sreadLowRiskRecordStagereceives reads the moved non-regen path as unexplained.readArmLanding. First, every git reader it hands the guard (toreadLowRiskTierand the record pair given torecordVerdict) passes stdin through. Second, the sweep's checkout reader reaches real git through the landing's wrapper and reads the moved non-regen path as unexplained.Red before, green after: three ablations on committed head 4d8079f (blob aced0445)
Each leg goes through
node scripts/ablation-replace.mjs: the anchor hits once, the mutation lands with its blob moving, and the restore is verified as blob equal to HEAD with an emptygit diff HEAD.git()drops input, which is origin/main's spawner. Exit 1 with 5 failures: battery cases 1, 2 and 6, the--prpin, and the sweep real-git pin. Case 2 reads[]in place ofscripts/pm/x.mjs.(argv) => git(root, argv). Exit 1 with 4 failures: battery cases 1 and 2, the--prpin, and the sweep real-git pin.armGitdrops input. Exit 1 with 2 failures: the forward-through pin ({"state":"pass","arm":2,"pair":1}) and the sweep real-git pin.The card's repro on PR #36509's real trees
4342cf009..bf71994326, basee4e3bcfe, fetched into a scratch ref that has since been deleted. Run throughunexplainedPathsBetween:checkoutGitReader: 14 unexplainedThe 14 begin with
packages/spec/src/ui/component.zod.ts,scripts/sdui-manifest.record.jsonandsdui.manifest.json. This matches the card's measured 14 and 0.Acceptance notes
checkoutGitReader) through the realpullRecordStageandreadArmLanding. They do not run--pror the sweep end to end, because both read GitHub. The two call sites themselves are one token each. Ablation B shows that any reader with the old(argv) => git(root, argv)shape reds the battery.pnpm check:i18n-coverageis derived for this path, but it readspackages/cli/distand the examples' build closure, which are not built here. It exited 3 (PREREQUISITE NOT MET) locally, so it is NOT MEASURED; CI runs it.Verification
Read first, by risk:
git()/gitSpawnOptions: the no-input branch must stay'ignore'for every plain caller.runGit:handoffs (--pr, sweep arm leg), nowcheckoutGitReader(root).armGitand thearmSettledWithoutUnreadwrapper, which only forwardinput.Two-minute check:
node scripts/pm/check-governed-merges.mjs --self-testshould print✓ … 972 assertions, ending in the stdin clause.Local gates, head 4d8079f
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 63 families. Run reconciliation (--ran) printed✓ dispatch-gates --ran: 63 derived famil(ies) accounted for — 62 run, 1 NOT-MEASURED.pnpm check:i18n-coverage(exit 3, prerequisite not met, above). That includespnpm check:pm-governed-merges,pnpm check:pm-record-recognisers,node scripts/pm/check-governed-queue-guard.mjs --self-test,pnpm check:pm-dispatch-gates(fast tier, 2273 cases),pnpm check:commit-card-trailersandpnpm check:nul-bytes.ui/scripts/__tests__/check-governed-queue-guard.test.tsspawns this script and passes 10/10.npx eslint --no-inline-config scripts/pm/check-governed-merges.mjsexits 0. The repo-widepnpm lintis CI's.node scripts/pm/overlap-check.mjsreportsVERDICT clean exit 0.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintin CI).main, one pull request.scripts/pm), soskip-changeset; both declaration lines are above.packages/specnot touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01J8VVAm5Tp3iBkiJk6nMwa5