Repository navigation
feat(policy): merge driver refuses an author-written verdict (review-on-done 1b.3) - #111
Merged
Merged
Conversation
…d can require an independent review Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
This was referenced Oct 3, 2026
androidand
added a commit
that referenced
this pull request
Oct 4, 2026
The reader shipped in abadec9 and enforces nothing: the record is a plain file in the author's working tree, and a model can write a file. This adds the two pieces that make it mean something, and is explicit about the piece it cannot fix. write() stamps the reviewer from the caller's own session identity, never from a model-supplied argument, so a model can record a verdict but cannot record one *as* somebody else. It validates against the reader's own closed schema before writing — a record rejected here would be rejected on read too, and the round trip would look like a review that never happened rather than a refused write — and renames into place so a reader never sees a truncated file. gate() supplies the authorSessionID that mayMerge was already asking for but that no caller passed, so #111 stops being inert. It carries the record's own base as mergeBase, letting the driver apply its own unrelated-histories rule rather than second-guessing it. Does NOT close the hole, and this is pinned as a test rather than left in a comment: a record forged by shell naming a real reviewer is still accepted. The gate compares two ids; it cannot tell a real review from a fabricated one. Deny the path to models is task 1b.2 and does not change this for bash. Only OS separation would, and nothing here claims it. That is why the surrounding controls are bounded claims rather than proof of authorship. Identity comes from ctx.sessionID — in-process, not parsed from a message — so this does not wait on callback confirmation, which is not merged. Mutation-checked, each failing only the test that owns it: dropping the author comparison, and having the writer skip validation. test/policy 166 pass / 8 skip / 0 fail, typecheck clean, fork:verify clean.
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.
mayMerge gains authorSessionID: the verdict must name a reviewer session and it must differ from the author's. Also requireIndependent, which refuses a same-model or unrecorded-independence review. toMergeEvidence now carries reviewer.sessionID; merge-run passes both options through.
Evidence: 5 new tests in drivers.test.ts; mutating the equality check turns the author-self-approval test red (1 fail). policy suite 157 pass. Not covered: no caller passes authorSessionID yet (the merge CLI is unwritten), merge-run passthrough has no test, 1b.1/1b.2/1b.4 remain.
🤖 Generated with Claude Code