Uh oh!
There was an error while loading. Please reload this page.
fix(pm): fail closed when the tree under test co-edits the generator the provenance exception trusts - #11283
Merged
Conversation
…the provenance exception trusts The #9866 exception's recompute necessarily runs the PR's own scripts/docs-audit/** (the derivation must reflect the PR's docs), so a diff editing the generator and hand-editing the workflow artifact together could construct a splice that byte-equals its own hand edit. In --test, before consulting provenance: any scripts/docs-audit/** path in the submitted list skips the recompute and keeps the path governed with the reason stated. Narrows the ruled exception only — a pure regeneration with an untouched generator lifts exactly as before. Fixes#11084
os-zhuang
marked this pull request as ready for review
August 23, 2026 08:54
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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#11084
The #9866 provenance exception recomputes from the tree under test — it must, since the derivation has to reflect the PR's own docs.
recomputeDocsAuditProvenancetherefore executes the PR's ownscripts/docs-audit/affected-docs.mjsand imports the PR's owncheck-audit-scope.mjsreplaceBlock. A diff that edits the generator and hand-edits.claude/workflows/docs-accuracy-audit.jstogether can in principle construct a splice that byte-equals its own hand edit: the tree certifies itself.What changed
One conditional in
--test, consulted before provenance: if the submitted path list contains anyscripts/docs-audit/**path, the recompute is skipped entirely (no git, no generator exec) and the path stays governed with the reason stated.TRUSTED_GENERATOR_PREFIX— the directory the recompute actually runs from.generatorCoEditProvenance(paths)— pure, so--self-testpins both directions offline. Returns a fail-closed provenance verdict on a co-edit, ornullwhen the generator is untouched.nullis the only branch that goes on to recompute, and there is no branch that lifts anything, so no spelling it fails to recognise can open the fence.This narrows the ruled exception and widens nothing: verdicts only ever move toward governed, and the pure-regeneration path with an untouched generator lifts exactly as before. The four ruled constraints, the mixed-diff rule, and every other governed-surface judgment are character-for-character unchanged.
Verification (all at
04371a39)--self-testassertions: 119 before → 129 after, verdict line:Both directions, end-to-end against the real tree (not fixtures):
--test .claude/workflows/docs-accuracy-audit.js scripts/docs-audit/affected-docs.mjs3generated-surface exception (#9866) did NOT lift …: the tree under test modifies the generator this exception trusts — the path stays governed (co-edited here: scripts/docs-audit/affected-docs.mjs)--test .claude/workflows/docs-accuracy-audit.js content/docs/some-new-page.mdx0PURE REGENERATION — byte-equal to \node scripts/docs-audit/check-audit-scope.mjs --write` recomputed on THIS tree`Reverse-verification — the fence neutered to
return nullunconditionally, run from the committed state, mutation confirmed on disk by anchor/inject grep counts (anchor=1 inject=0→anchor=0 inject=1), restored by anEXIT INT TERMtrap and re-confirmed green afterwards:Gates derived with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstackon the actual change set (1 path), all green at04371a39:check:cross-package-test-inputs,check:entry-guard,check:parse-guard,check:pm-governed-merges,check:pnpm-filter-targets,check-ci-filter-parity.mjs,check-cross-package-test-inputs.mjs.No changeset: PM tooling only, nothing user-visible ships —
skip-changeset.This PR's own file list is not governed by the register (
--test scripts/pm/check-governed-merges.mjs→ 0 of 1 hit, exit 0). Left as draft; PM decides landing at ACCEPT.Generated by Claude Code
Generated by Claude Code