Repository navigation
v1.92.37.0 fix: review briefs check template slots before pasting reviewer text (GST-797) - #3797
Merged
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…7 adversarial) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…sourced count Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t quote no slot name Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…GST-797) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changed
renderBrief(lib/review-brief.ts) now holds reviewer-written findings and learnings out of the render, behind a per-render token, while it fills the template's own slots and checks for unfilled ones. Then it puts them back exactly as written. A finding that quotesorigin/<base>,<diff-base>or<exclude>now renders as written. Before, it failed withBRIEF_RENDER_FAILED: red-team: unfilled placeholder <base>, or its<diff-base>was silently rewritten to the diff-base sha. A slot the template itself leaves unfilled still fails.Rendering the Red Team brief with a finding that quotes
origin/<base>: main refuses, this branch renders it verbatim (image capture failed on this machine, so the text version follows: PR_SHOTS_RENDER_FAILED).Before/after as text: Rendering the Red Team brief with a finding that quotes origin/base: main refuses, this branch renders it verbatim
Why
#3795 (GST-774, base resolution) stopped /ship's Red Team because a specialist finding quoted the code's
origin/<base>. The adversarial pass and the outside voice wait on the Red Team, so they stopped too. GStack Minder chose to fix the renderer rather than drop a reviewer on gate code (GST-797): "Decision: B. I'm not dropping a reviewer on gate code. Open the renderer fix as its own small PR now".Proof
test/review-dispatch.test.tsuses the CLI to render a red-team findings file and a specialist learnings file that quote all three slots. On main it failed withBRIEF_RENDER_FAILED: red-team: unfilled placeholder <exclude>, <base>.<base>or<exclude>open still throws.test/review-packets-removed.test.tspins all six briefs byte for byte, and it passes unchanged. A comparison against main's renderer over 350 renders found no byte differences except on the quoted-slot inputs, which is intended. Those renders covered 7 roles and blank, multi-line and$-pattern inputs.Blast radius
renderBriefhas two callers,bin/gstack-review-dispatchrender andlib/review-pass.ts, and both take its output unchanged. A brief whose findings and learnings quote no slot name keeps the same bytes:test/review-packets-removed.test.tspins all six briefs and passes unchanged, and a script compared this renderer with main's over 350 renders (7 roles; blank, multi-line and$-pattern inputs) at 873f69b with 0 byte differences (log:~/.capy/work/gst797-bytes.logon the lane machine). The token carries a random nonce per render, so no diff or hunk text can name it (test: "reviewer text is put back only where the render held it").Approvals
Summary
A reviewer quoting the code it reviews shouldn't stop the review. The renderer checked for unfilled slots after the reviewers' text was already pasted in, so quoted slot names looked like holes in the template. Now the check sees only the template, and reviewer text goes in last, untouched. The adversarial pass then found that the first version's put-back token had a fixed value, so a diff carrying those bytes could pull the project's learnings into the outside voice's brief. That's fixed with a per-render nonce.
Test Coverage
All new code paths have test coverage. Coverage: deterministic (each of 1 changed runtime files has a changed test naming it; no audit reader).
test/review-dispatch.test.ts"findings and learnings that quote slot names render verbatim" renders, through the CLI, a red-team findings file and a specialist learnings file that quote all three slots. On main it failed withBRIEF_RENDER_FAILED: red-team: unfilled placeholder <exclude>, <base>.<base>or<exclude>open still throwsBriefError, with quoted findings present or not.SECRET-LEARN.Tests ran: focused 338
Pre-Landing Review
Two findings, both fixed:
.gitattributes-crafted diff could splice learnings into the outside voice's brief or crash its render with a TypeError. Fixed with a per-renderrandomUUID()token and exact split/join; reproduced first, and a regression test was added.The specialist reader (testing, security, state-machines, red-team checklists), the exploratory QA smoke (3 probes, no defects), the pass 2 red-team reader and three fix-checks found nothing. Every brief printed
BRIEF_SENTmatch, andgstack-review-dispatch verifyis clean on every ledger.REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=0 fixed=2 scope=frozen fix_checks=3 dispatches=2
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: not dispatched (the review plan skips the outside voice for a code-class diff with no numeric claims).
Exploratory QA
Smoke passed, no defects (3 of 12 probes): the red-team CLI render with findings that quote
origin/<base>,<diff-base>,$&and$1; the specialist CLI render with padded learnings quoting<exclude>,<diff-base>and{STACK}; andbun test test/review-dispatch.test.ts. No plan checks (no plan is bound to this branch). Browser checks: not applicable (library and CLI change).Eval Results
evals: none run for this PR. The selector maps
lib/review-brief.tsto every dependent gate case (264), but the rendered prompt bytes are unchanged for every input that doesn't quote a slot name, so no prompt that evals read moved. The train's full gate covers the rest.TODOS
No TODO items completed in this PR.
Documentation
Status: updated. One factual edit to the reference for /ship's verbatim brief rendering, matching the GST-797 fix.
Scope: base 8cef24c to head 854adb2 (3 committed files:
lib/review-brief.ts,test/review-dispatch.test.ts,changelog.d/capy-review-briefs-check-template.md); no staged, unstaged or new files. I checked the docs that cover review dispatch (docs/review-policy.md), the changelog fragment and its README, and the top-level instruction docs.Documentation health:
docs/review-policy.md: Updated (Verbatim dispatch, item 1: an unfilled slot also refuses the render, except for fix-check and the outside voice; findings and learnings go in after that check and reach the reader as written, so a quotedorigin/<base>neither fails the render nor gets filled, GST-797)changelog.d/capy-review-briefs-check-template.md: Current (fragment left untouched)changelog.d/README.md: CurrentAGENTS.md: CurrentCoverage: all shipped features have adequate documentation. The change fixes internal render behavior and adds no new public surface; the reference now states the contract. No architecture diagram drift.
Debt:
docs/review-policy.mdis reachable only through other docs, not directly from README.md or CLAUDE.md (this predates the PR).Test plan
bun teston review-dispatch, review-packets-removed, review-dispatch-origin-base, review-pass, review-targeted, ship-budget-reader-drift, ship-driver, prose-voice-floor, spawnsync-timeout-tripwire, module-size-ratchet, parity-suite, review-depth, review-loop-budget-wording, autoplan-token-efficiency: 338 pass, 0 fail (ship lanefocused)bun run typecheck: 0 errors