feat(agents): pr-reviewer role + ready-for-review semantic review loop #70

Merged
navigator merged 1 commit from feat/pr-reviewer-role into main 2026-05-25 19:39:45 -03:00
Owner

Summary

pr-approver is rule-based (CI status + label triage) and never reads PR diffs. Three recent Chisel skeleton PRs (#63, #64, #65) merged with inconsistent package declarations — exactly the kind of finding a semantic review catches at PR time instead of retrospectively (filed under #68).

This PR adds a fifth swarm role that polls ready-for-review PRs lacking a review:* label, fetches the diff plus any SPEC files touched by the diff, and invokes claude -p against a project-specific system prompt. The review is posted as a PR comment and labelled review:pass or review:findings.

A follow-up PR will gate pr-approver on review:pass so unreviewed PRs cannot reach auto-merge.

What's in this PR

  • roles/pr-reviewer.sh — long-running poller, one review per cycle (default 120 s) to bound claude usage.
  • roles/prompts/pr-reviewer.md — system prompt: SPDX rules, no AI/Claude attribution, ADR-017 off-limits paths, package consistency (canonical: pop), SPEC interface compliance, fabricated-claim ban, scope discipline. Strict **VERDICT:** PASS|FINDINGS first-line contract so the shell driver can detect outcome.
  • units/fluidpop-pr-reviewer.service — Type=simple, Restart=always.
  • install-swarm.sh — adds state dir + starts the new service.
  • Labels review:pass / review:findings already created in the repo.

Test plan

  • bash -n roles/pr-reviewer.sh (passes)
  • After merge: run bash infra/ops/agents/install-swarm.sh to wire the unit + start the service.
  • Wait one poll cycle and confirm a review comment + label lands on the open ready-for-review PRs (#69 is the natural test target).
  • Follow-up PR: gate pr-approver on review:pass.

Notes

  • Off-limits per ADR-017 (infra/ops/agents/**) — manually merged by navigator after CI green.
## Summary `pr-approver` is rule-based (CI status + label triage) and never reads PR diffs. Three recent Chisel skeleton PRs (#63, #64, #65) merged with inconsistent `package` declarations — exactly the kind of finding a semantic review catches at PR time instead of retrospectively (filed under #68). This PR adds a fifth swarm role that polls `ready-for-review` PRs lacking a `review:*` label, fetches the diff plus any SPEC files touched by the diff, and invokes `claude -p` against a project-specific system prompt. The review is posted as a PR comment and labelled `review:pass` or `review:findings`. A follow-up PR will gate `pr-approver` on `review:pass` so unreviewed PRs cannot reach auto-merge. ## What's in this PR - `roles/pr-reviewer.sh` — long-running poller, one review per cycle (default 120 s) to bound claude usage. - `roles/prompts/pr-reviewer.md` — system prompt: SPDX rules, no AI/Claude attribution, ADR-017 off-limits paths, package consistency (canonical: `pop`), SPEC interface compliance, fabricated-claim ban, scope discipline. Strict `**VERDICT:** PASS|FINDINGS` first-line contract so the shell driver can detect outcome. - `units/fluidpop-pr-reviewer.service` — Type=simple, Restart=always. - `install-swarm.sh` — adds state dir + starts the new service. - Labels `review:pass` / `review:findings` already created in the repo. ## Test plan - [x] `bash -n roles/pr-reviewer.sh` (passes) - [ ] After merge: run `bash infra/ops/agents/install-swarm.sh` to wire the unit + start the service. - [ ] Wait one poll cycle and confirm a review comment + label lands on the open `ready-for-review` PRs (#69 is the natural test target). - [ ] Follow-up PR: gate `pr-approver` on `review:pass`. ## Notes - Off-limits per ADR-017 (`infra/ops/agents/**`) — manually merged by navigator after CI green.
feat(agents): pr-reviewer role + ready-for-review semantic review loop
All checks were successful
build / scalafmt-check (pull_request) Successful in 3s
build / sbt-compile (pull_request) Successful in 3s
build / shell-lint (pull_request) Successful in 18s
0c364a6d9e
Adds a fifth swarm role that polls open PRs labelled `ready-for-review`
which have not yet been reviewed (no `review:pass` / `review:findings`),
fetches the diff plus any SPEC files touched by the diff, and invokes
`claude -p` against a project-specific system prompt to produce a
plain-markdown review. The review is posted as a PR comment and the PR
is labelled `review:pass` or `review:findings` accordingly.

This role does NOT merge. A follow-up PR will gate `pr-approver` on the
`review:pass` label so unreviewed PRs cannot reach auto-merge.

Pieces shipped here:

- `roles/pr-reviewer.sh` — long-running poller, reviews one PR per
  cycle (default 120 s) to keep claude usage bounded.
- `roles/prompts/pr-reviewer.md` — system prompt enumerating the
  project's license / package / SPEC / off-limits / scope rules, with
  a strict `**VERDICT:** PASS|FINDINGS` first-line contract so the
  shell driver can detect the outcome without parsing freeform text.
- `units/fluidpop-pr-reviewer.service` — systemd user unit, Type=simple,
  Restart=always, polling interval driven by env.
- `install-swarm.sh` — adds the state dir and starts the new service.

Rationale: `pr-approver` is rule-based (CI + label triage) and never
reads PR diffs. Three Chisel skeletons (#63, #64, #65) recently merged
with inconsistent package names — exactly the class of finding a
semantic review catches at PR time instead of retrospectively.

Off-limits paths (`infra/ops/agents/**`) per ADR-017 — this PR must be
merged by the human operator, not by the swarm itself.
fluidpop-bot approved these changes 2026-05-25 19:39:20 -03:00
Dismissed
fluidpop-bot left a comment
Collaborator

CI green (head 0c364a6d9e), auto-approving

CI green (head 0c364a6d9e278988d0e4421901c187dfef7c2aed), auto-approving
navigator force-pushed feat/pr-reviewer-role from 0c364a6d9e
All checks were successful
build / scalafmt-check (pull_request) Successful in 3s
build / sbt-compile (pull_request) Successful in 3s
build / shell-lint (pull_request) Successful in 18s
to 82926a2aa1
All checks were successful
build / scalafmt-check (pull_request) Successful in 2s
build / sbt-compile (pull_request) Successful in 3s
build / shell-lint (pull_request) Successful in 11s
2026-05-25 19:39:23 -03:00
Compare
fluidpop-bot left a comment
Collaborator

CI green (head 82926a2aa1), auto-approving

CI green (head 82926a2aa1b1558be3e791043eeb659ec5643b58), auto-approving
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Fluid/fluidpop-v1!70
No description provided.