fix(agents): pr-reviewer label match — comma-separated, no anchored regex #78
No reviewers
Labels
No labels
adr
agent:blocked-ci
agent:blocked-human
agent:blocked-resolver
agent:done
agent:in-progress
agent:no-touch
agent:pinged
agent:pr-open
agent:queued
agent:wip
area:board
area:funding
area:infra
area:phy
area:poplink
area:rtl
area:software
area:supply-chain
area:verification
ci-failed
ci-timeout
docs
do-not-merge
human-approved
needs-human-approval
needs-rebase
needs-triage
phase:1
ready-for-review
review:findings
review:pass
risk:tripwire
swarm:quarantined
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Fluid/fluidpop-v1!78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/pr-reviewer-label-detect"
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?
Summary
After #70 landed,
pr-reviewerkept re-reviewing PR #77 every 120 s — four times in seven minutes, all producing the samereview:findingsverdict and posting the same comment. The PR was already labelledreview:findings, so the gate should have skipped it.Root cause:
needs_reviewdid anchored regex (grep '^review:pass$') against a labels string the main loop built fromjq '... | join("\n")'+awk 'gsub(/\n/, "\t", $2)'. The multi-line jq output broke the read loop's record framing — labels arrived split acrossreaditerations, so the variable contained one token at a time and the anchored regex didn't see what the function intended.Net: claude usage burned 4× on a PR with an already-filed verdict.
Change
jqjoins labels with,(single line per PR).needs_reviewdoes strictcasemembership against,labels,sentinel — no regex, no word-boundary surprises.Test plan
bash -ncleancasesmoke test against,ready-for-review,review:findings,correctly reportsskipreview:findings)Notes
Off-limits per ADR-017 (
infra/ops/agents/**) — manually merged.The earlier `needs_review` used `grep '^review:pass$'` against a labels string the main loop assembled from a jq `join("\n")` plus an awk `gsub(/\n/, "\t", $2)` round-trip. In practice the gsub did not see the embedded newlines as boundaries the way the regex assumed, and the multi-line jq output broke up records so the read loop saw labels split across iterations — leaving `labels` as a single token like `ready-for-review` even when the PR also carried `review:findings`. Net effect: pr-reviewer kept re-reviewing PR #77 every poll cycle even after labelling it `review:findings` four times — burning claude usage on a verdict that was already filed. Fix: jq now joins labels with `,`, the read loop drops the awk pass, and `needs_review` does strict shell case membership against `,labels,` sentinel — no regex anchors, no word-boundary surprises.CI green (head
786be7876c), auto-approving786be7876c19d4d0147eCI green (head
19d4d0147e), auto-approving