fix(lint): hold the partof gate's cited contract to the file it cites - #16774
Merged
Conversation
RELATION_CONTRACT presented itself as a verbatim quotation of the agent rules and carried a second sentence that file does not have. The sentence was true on the facts — the squash really is assembled from the commit messages — but it was written here, not quoted from there, and every red RULE 2 run printed it to an agent as the ruling's own words. Adding a sentence to a citation is the same failure as translating one. Trim the quotation to the sentence the rules file actually carries. The squash fact stays as the gate's own prose, where it already was twice: the RULE 2 header section and the printed finding both state it in the gate's own words, so it is not restated a third time. The self-test's existing case compares the printed finding with this file's own constant, so both sides moved together and the added sentence passed a check that already claimed to verify the citation. Three new cases read .claude/agents/os-dev.md and hold every sentence between the corner brackets to it verbatim, refusing a vacuous extraction and an unreadable source rather than passing quietly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P58euzUXCVJNwmhuPC9DXY
This was referenced Sep 8, 2026
hotlong
marked this pull request as ready for review
September 8, 2026 05:12
hotlong
enabled auto-merge
September 8, 2026 05:12
This was referenced Sep 8, 2026
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.
Fixes #16747
What was wrong
RELATION_CONTRACTinscripts/check-partof-closing-keyword.mjspresents itself as a verbatim quotation of this repo's agent rules — corner brackets, a docblock saying "Quoted verbatim, in its own language", and a self-test case namedthe finding CITES the contract rather than restating it in its own words. It carried two sentences. The rules file carries one.Measured on
cf33adbd8, the base of this branch:The second sentence exists in the gate and nowhere else in the tree. It is true on the facts — the squash really is assembled from the commit messages — so the defect is the attribution, not the content. AGENTS.md's Communication section binds it directly: 「引用中文裁决时保持原文、不翻译——改写引文就是改写裁决」. A citation that ADDS a sentence is that rule's failure in the other direction: it attributes to the ruling a claim the ruling does not make, and every red RULE 2 run printed that addition to an agent as the ruling's own words.
What changed
RELATION_CONTRACTis trimmed to the sentence.claude/agents/os-dev.mdline 281 actually carries.Why the existing self-test did not catch it
named.includes(RELATION_CONTRACT)compares the printed finding with this file's own constant. Both sides move together whenever the constant is edited, so a sentence that was never in the rules file passes it — which is exactly how the added sentence survived a case whose name claims to check the citation.The new cases read
.claude/agents/os-dev.mdthroughAGENT_RULES_SOURCEand require every sentence between the corner brackets to appear in it verbatim. Two silent-green shapes are refused explicitly rather than left implicit: an unreadable rules file, and an extraction that finds zero sentences (which would make the whole pin vacuous).AGENT_RULES_SOURCEis a quoted path literal on purpose, unlike the paths the header names unquoted: the derivation turns a quoted path in this file into a watch hint, and this hint tells the truth — editing that sentence at the other end breaks the pin here, so a card touching that file really does want this gate run.Ablation — proof the new pin can fail
Fix committed first (
cd09dbd68), then the second sentence put back inside the brackets, on disk, with a trap-restore:The failing case names the offending sentence rather than printing a bare false, so the next author is told which sentence is not in the source.
Gates
Derived in the worktree with no paths passed —
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack— 31 families, identical to the set the dispatch carried. All 31 run, every one exit 0, reconciled against the record:The two judgment lines that matter here, quoted from the gates themselves:
pnpm check:pm-dispatch-gateswas run detached with its output redirected and waited on in the foreground (it runs past the shell's timeout);check-dispatch-gates.mjsexits with the self-test's status, and that verdict line is printed only on the zero-failure path.Governance:
node scripts/pm/check-governed-merges.mjs --test scripts/check-partof-closing-keyword.mjs— exit 0,✅ NOT governed, derived from the register rather than recalled.skip-changeset
Nothing published moves. Repo-root
scripts/belongs to the private root package (private: true, nofiles[]), and afiles[]entry is package-relative, so no workspace package can ship this path.Merge reading
Base
cf33adbd8.origin/mainis8b37a0973at the time of writing — one commit ahead, touchingAGENTS.mdonly, no overlap with this diff and none with the derived family. A driver-freemerge-treefrom a throwaway bare clone sharing the object store: exit 0, no conflicted paths.验收备注
check:declaration-mirrorspair for this quotation) stays on [finding]check-partof-closing-keyword's RELATION_CONTRACT presents as a verbatim citation of the os-dev agent rules but carries a second sentence that file does not have #16747 for triage. The pin added here covers this one citation and does not generalise to other cited text in other scripts..claude/agents/os-dev.md) is a governed-surface ruling change and is deliberately not taken here — this PR corrects a text, it does not amend a ruling.Generated by Claude Code