test: pin the review directive's VERDICT/===BODY=== contract to review_parse_response #458
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Total time spent: 8 minutes 35 seconds
Due date
igor
8 minutes 35 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!458
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/457-test-pin-the-review-directive-s-verdict-body"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
bin/test-review-directive.sh, asserting only the handshake betweenbin/lib/review-directive.mdandreview_parse_responseinbin/tick.sh: every verdict token the directive advertises round-trips through the real parser (lifted viased, not reimplemented), undocumented tokens are rejected, a missing===BODY===sentinel or empty body is rejected, and each advertised verdict has a rubric entry in the directiveTest plan
make testpasses, including the new suite (bin/test-review-directive.sh: all checks passed)make shellcheckpasses clean on the new filejq(guarded skip-safe perbin/check-sync.sh's contract)Closes #457
🤖 Review —
REQUEST_CHANGES(automated)CI for
eb26224d: successAdds a single new test (
bin/test-review-directive.sh, 113 lines) pinning theVERDICT:/===BODY===handshake betweenbin/lib/review-directive.mdandreview_parse_responseinbin/tick.sh. Scope, framing, and checklist all match the diff — the one blocker is that I can't confirm the new suite actually runs undermake test.Blocking
bin/test-review-directive.shis added with mode 100644 (see thenew file modeline). Every other script underbin/in this repo is executable (make testinvokesbin/check-sync.shdirectly; check-sync itself hard-fails helpers that "exist but are not executable"). The portion ofcheck-sync.shthat discoversbin/test-*.shis truncated in what I was given, so there are two possibilities and neither is good enough to approve on:"$t"directly → the new suite can't execute, and the description's claimmake test passes, including the new suite (bin/test-review-directive.sh: all checks passed)isn't what CI proved; orGreen CI does not distinguish these from "runner uses
bash "$t"and the mode is merely inconsistent". Fix:chmod +x bin/test-review-directive.shso the diff shows100755, and (if you want to close the loop for the reviewer) paste thecheck-sync.shline that dispatchesbin/test-*.sh.Non-blocking observations
sed -n '/^review_parse_response() {$/,/^}$/p'andeval'd — correct approach per the issue, but it silently assumesreview_parse_responsecalls no othertick.shhelper. If that ever changes, the failure will surface as "parser REJECTED a verdict the directive advertises", i.e. a misleading message. A one-linecommand -v/declare -Fsanity note in the failure text would age better.- \*\*VERDICT\*\* --. A cosmetic reformat of the directive (em dash instead of--, or a different bullet) fails the suite with "parser accepts a verdict the directive never explains", which isn't what happened. Acceptable brittleness for a contract test, but worth knowing.eq "the format line lists three tokens" "3" ...hardcodes the count that the round-trip loop already derives from the file. A legitimate fourth verdict would fail here and in the round-trip loop; that's presumably intended, just noisy." ${ADVERTISED[*]} "underset -uerrors on bash < 4.4 if theVERDICT:line ever fails to parse (empty array). Low risk given CI's bash, but the empty-array path also silentlycontinues every undocumented-token check, so a malformed directive could turn that whole block into a no-op.Coverage — the four properties the issue asked for (advertised tokens round-trip, undocumented tokens rejected, missing sentinel rejected, empty body rejected) are all present, plus the inverse rubric-entry check scoped to the
## Verdict rubricsection. Thejqguard matches the skip-safety contract. No security surface, no CI-config changes, no unrelated edits.Independent review by the harness on
claude-opus-5(effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.🔧 Rework — round 1 (automated)
Addressed the review on
claude-opus-5at effort high — 1 new commit(s).🤖 Review —
APPROVE(automated)CI for
4523d600: successAdds one new test file (
bin/test-review-directive.sh, 139 lines) pinning theVERDICT:/===BODY===handshake betweenbin/lib/review-directive.mdandreview_parse_responseinbin/tick.sh. In scope for #457, test-only, CI green — approving.What I verified
sed-lifted parser (line 39), the advertised-token round-trip loop, the undocumented-token rejection loop, the missing-sentinel/empty-body cases, and the rubric-entry check. Thejqskip guard the issue demanded is present at the top and correctly justified (the lifted parser ends injq -n, so absentjqwould report a phantom mismatch), satisfyingcheck-sync.sh's skip-safe contract.sed -n '/^review_parse_response() {$/,/^}$/p'andeval'd, which is the one property the issue said the test exists to preserve.ADVERTISEDguard is the right call — without it the round-trip loop would iterate zero times and the undocumented-token loop wouldcontinueon every candidate, passing the whole section vacuously. Same for the extraction failure ofPARSER_SRC(bad → non-zero exit).awkrange on## Verdict rubric, which is what stops a whole-filegrepfrom passing on a deleted entry. The loose bullet/format regex is a deliberate and reasonable tolerance.evalis on text read from a repo-local file already trusted as the executable under test.Non-blocking notes (no action required)
eq "the format line lists three tokens" "3" "${#ADVERTISED[@]}"hard-codes the count, so a legitimate fourth verdict added to both directive and parser will still fail here. That's a defensible change-detector, but it means the test must be edited alongside any verdict-set change — worth a one-line comment saying so.LIFT_NOTEscan (_tick_fnsloop) matches onlyname() {-style definitions and does a loose word-grep of the parser body, so it can both missfunction name {definitions and produce a spurious name if the parser's comments happen to contain a helper's name. It only decorates a failure message, so the blast radius is zero.badbranch for undocumented verdicts prints'$v'while theokbranch prints'${v:-<empty>}'— the empty-token failure would render asundocumented verdict '' was accepted.Coverage note: I can't see
review_parse_responseitself in this diff, so the assertions about whitespace-only-body and missing-sentinel rejection are taken on the green CI signal rather than read off the source. That's exactly the coupling the test is meant to enforce, so it's the right dependency direction.Independent review by the harness on
claude-opus-5(effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.