The code reviewer reads the diff, not the plan#87
Merged
Conversation
All seven build roles shared one header, so the reviewer arrived holding the plan, the acceptance criteria, every prior evaluation, and an order to treat the ticket as binding truth — and graded plan conformance, which is the evaluator's job it is told not to redo. The contract now lives in its own partial that the six contract-bearing roles include; the reviewer gets the workflow context and the SHAs, and is ordered to diff them and read every changed file end to end before it writes a finding. Its severity list gains out-of-scope edits at high — the one class only a reader of the diff can see — and loses the bullet that waved off style as long as the repo did not enforce it, which read as licence to ignore house style. SIM108 is ignored: it rewrites if/else into a ternary, and plain if/else is the house form.
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.
On PR #86 the reviewer approved with "cleanly delivers both payoff items … following the repo's existing idiom … and the plan's stated approach exactly" and filed zero findings, while the diff carried a redundant double-404, a flag standing in for an unnamed error path, and a test writing straight into DBOS's status table. Its own WHAT TO LOOK FOR list already names dead branches, foot-guns, reuse, and test shape. It never got that far: every clause of its verdict grades plan conformance, which is the evaluator's job and which this prompt explicitly forbids it from redoing.
It does that because of what it is handed. All seven roles include one
_header.md, which renders the plan markdown, every acceptance criterion, the ruled-out list, prior evaluations, human feedback, and a MANDATORY FIRST ACTION to fetch the ticket as binding truth. The diff appears only as two SHAs.The split
_contract.mdnow carries the ticket-fetch order, the plan, the acceptance criteria, the ruled-out approaches, prior evaluations, and human feedback. The six contract-bearing roles include it immediately after_header.md, so their prompts keep every section in the same order.review_code.mdincludes_header.mdalone — workflow context, workspace paths, verification,base_sha/head_sha— and gains one mandatory first action:git diff base..head, then read every changed file end to end, before any finding. It fetches the ticket when it needs scope to judge a finding and to file the follow-up sub-issue, rather than opening with it as a rubric.Review prompt changes
startswith→text[:3]rewrite insubprocess.pyis the live example; it is inmain.highseverity.Lint
ignore = ["SIM108"]. It rewritesif/elseinto a ternary; formatter-wrapped ternaries are banned here, so the lint gate was arguing against the house form.Tests
test_contract_context_is_omitted_only_from_code_reviewrenders all seven roles against a fully-populated journal and asserts the six carry every contract marker in order while the reviewer carries none of them and does carry the diff instruction.test_build_prompt_orders_the_ticket_fetchnow runs over_CONTRACT_TEMPLATES— the reviewer is deliberately outside that set.Note
The six roles are not byte-identical to
main: the ticket-fetch paragraph moved from the Workflow context bullets down into_contract.md, since the ticket is the contract. Section order and content are otherwise unchanged.uv run ruff check backend,uv run ruff format --check backend, andbackend/tests/test_build_prompts.py(23 passed) are green locally; the rest gates in CI.