`verdictFromReviewerText` regex gaps cause false-positive APPROVED verdicts
Summary
verdictFromReviewerText in src/daemon/runner/verdict.ts (dist: dist/daemon/runner/verdict.js) extracts an approve / request-changes / null verdict from each reviewer's English answer. The current regex set and tail-first matching strategy let real "request changes" reviews be classified as APPROVED. Observed in production with simple-review-style review_only chats where both reviewers wrote substantive rejections that ended with a conditional-approval kicker.
Code under discussion
const negatives = /\b(request changes|requesting changes|disagree|reject(?:ed|ing)?|blocker|(?:do not|don['’]?t) (?:approve|merge)|(?:cannot|can['’]?t) (?:approve|merge)|nack)\b/;
const positives = /\b(approve(?:d|s)?|lgtm|looks good to me|no concerns|ship it|ack)\b/;
const tail = stripped.slice(-400).toLowerCase();
if (negatives.test(tail)) return false;
if (positives.test(tail)) return true;
const whole = stripped.toLowerCase();
if (negatives.test(whole)) return false;
if (positives.test(whole)) return true;
return null;
Concrete leak cases
Each of the following reviewer outputs is currently classified APPROVED but is a real rejection:
-
Third-person
requestsform.\brequest\band\brequesting\bare covered;\brequests\bis not. So a reviewer ending with:"This change requests changes before merge. I'd approve a revised version."
Tail-pass: negatives miss (no
requests changesin the regex), positives matchapprove→ returns true. -
Phrasings outside the negatives vocabulary combined with a positive token in the tail:
"Several changes are needed before this can ship. I'll approve after the fixes are in."
changes needed,needs work,not ready,changes requiredare not in negatives. Tail'sapprove→ returns true. -
Tail-first beats body. When the rejection is in the body but the conclusion contains an
approve(d|s)token:"Request changes. … [400+ chars of substantive critique] … Happy to approve once these are addressed."
The
Request changesline falls outside the last 400 chars; tail contains onlyapprove→ returns true. The whole-text fallback never runs because the tail already resolved.
Reproduce
- Run any review template (
review_onlyshows it most clearly) where the reviewer prompt elicits substantive critique (e.g. xhigh-effort Claude or Codex reviewers). - Reviewer writes a real rejection that ends with a phrase containing the bare word
approve("I'll approve once …", "would approve a revised version", etc.). - Chat completes with
verdict: 'approved'even though both reviewers requested changes.
Why it matters
wait_for_chat and get_chat_status return only {status, verdict, reviewerSummary}. The orchestrating agent gets a misleading top-line answer unless it ALSO reads each ~/.chorus/chats/<chatId>/round-<N>/reviewer-<lineage>/answer.md and re-evaluates. That defeats the point of automated verdict aggregation.
Suggested fixes (any of, in increasing order of invasiveness)
-
Expand the negatives vocabulary. Cover the missing forms:
request(?:s|ed|ing)? changeschanges (?:are )?(?:needed|required|requested)not (?:approved|ready|ok|merging)needs (?:work|changes|fixes)would (?:not |n't )approveapprove (?:after|once|when|conditional)→ reframe conditional approvals as negative
-
Weight negatives over positives globally, not just within the tail pass. A reviewer that writes ANY explicit rejection phrase ANYWHERE should not flip to APPROVED just because the conclusion has a polite "I'd approve once …" kicker.
-
Ask reviewers for a structured verdict line. The reviewer prompt (
prompt-builder.ts:288-290) already says "Do you approve? Answer: approve or request changes, end with: ## DONE" — could be tightened to require a single-line "VERDICT: approve" / "VERDICT: request_changes" on the line immediately before## DONE, parsed deterministically. This eliminates the entire heuristic-regex problem at the cost of one extra line in the reviewer template.
(3) is the most robust; (1) is the smallest patch.
Related
Companion to #49 (also opened today): the iterate.onDisagreement: 'accept-doer' enum value is similarly exposed in the schema + cockpit UI but unimplemented in the runner.