Repository navigation
Take citation from a required field, not from prose - #39
Merged
Merged
Conversation
53 files were attached and none appeared in the review. The last change asked the reviewer politely to cite the paths, and that ask either did not deploy or did not stick. Prompts are hopeful; schema fields are gates. filesReferenced is now a required array in every review. The reviewer commits to which attached paths it relied on. An empty array is an explicit commitment that none bore on the decision; it is no longer inferred from what the review happened not to name. The phone counts from that field, not from a text search over prose. A path in filesReferenced that was not among the packet's attachments is a fabrication and rejects the review with GATE_FABRICATED_PATH. The reviewer cannot claim to have read files it was not given, and belt and suspenders, the phone ignores any path that was not attached. The dashboard reads only the structured field. The previous heuristic missed a citation the reviewer wrote as `overlay.cpp` in a code fence and could not distinguish a partial citation from none, so the count it printed was not the count the reviewer had made. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxxEQsJEXq9hZmjpNH5PxY
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
You're right — I never fixed it. The last change asked the reviewer politely to cite paths, and this run is proof either the ask didn't deploy or the reviewer ignored it. Prompts are hopeful; schema fields are gates. This is the gate version.
Structural change:
filesReferencedis requiredThe output schema (both JSON and Zod) now requires a
filesReferenced: string[]field on every review. The reviewer commits to which attached paths it relied on — empty is a commitment that none bore on the decision, not something inferred from what the prose happened not to name.The count comes from that field, not from prose
fileEvidenceno longer text-searches. It reads the reviewer's own list, ignores duplicates, normalises leading./, and shows exactly what the reviewer committed to. The old heuristic could have missed a citation the reviewer wrote asoverlay.cppin a code fence, and it couldn't distinguish "partial citation" from "none".The gate rejects fabrication
A path in
filesReferencedthat was not among the packet's attachments is rejected asGATE_FABRICATED_PATHbefore release. The reviewer cannot claim to have read files it wasn't given. Backwards-safe: older packets without a recorded attachment list are not subjected to the check retroactively.What every layer now does
sandbox/review-schema.jsonfilesReferencedrequiredlib/types.ts(Zod)reviewandopaquevariantssandbox/*-policy.mdlib/gate.tsATTACHED FILES USED:, merges with attribution, rejects fabricated pathslib/sandbox-runtime.tslib/research.tsfileEvidencetakes the reviewer's list, not review textcomponents/dashboard/review-parsing.tscomponents/dashboard.tsxTests
./allowance verified)fileEvidencetakes only paths that were actually attached, handles duplicates, normalises./ATTACHED FILES USED:, that section survives onto the answered jobFILES READ | 2 of 2(green), card lists the referenced files122 tests (121 pass / 1 Windows-only skip), lint, build, e2e all clean.
Honest limits
Older reviews in your history keep their existing text — the card will read
Bob-Regressas no field found. Any reviewer that returns a review missingfilesReferencedwill now fail schema parse and be blocked withGATE_INVALID_SCHEMA— that's stricter than before, and intentional: it's what makes this a gate rather than an ask.Generated by Claude Code