feat(review): configurable AO code review backend (V1) (#192)#197
feat(review): configurable AO code review backend (V1) (#192)#197neversettle17-101 wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Add per-project configurable code review of a worker's PR. A reviewer
agent runs one-shot over the worker's own worktree and posts its result
to the PR; the worker picks the feedback up through the existing SCM
observer review-nudge path.
- domain: ProjectConfig.reviewers (+ default reviewer harness), Review /
ReviewRun types and verdict/status vocab.
- storage: review + review_run tables (0011), sqlc queries, store methods.
- service/review: rewrite the in-memory stub as a persisted ReviewService
(Trigger/Submit/List) with a reviewer Runner over agent resolver +
runtime; ports.PRReviewPoster implemented on the GitHub adapter.
- http: session-scoped routes POST /sessions/{id}/reviews/trigger,
POST .../submit, GET .../reviews; regenerated OpenAPI + TS types.
- cli: ao review trigger|submit|list.
- frontend: adapt ReviewDashboard to the per-worker reviews API.
Closes #192
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
94fba4b to
7521377
Compare
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
…viewer to worker harness Per PR #197 review feedback: - Reviewer agent posts its review to the PR itself, so remove the ports.PRReviewPoster port, the GitHub review poster, the submit HTTP route + DTO, and the service Submit method (#1, #4, #7). - Trigger spawns the reviewer agent over the worker's worktree with its own review prompt, mirroring the session launch flow (resolve agent by harness -> argv -> runtime.Create) (#8, #9). - Default reviewer harness reuses the worker's harness when supported, falling back to claude-code; reviewer config stays independent of the worker override (#5, #6). - Drop the `ao review` CLI for this PR's scope (#2, #3). Regenerated OpenAPI + TS types. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Per maintainer request, bring back `ao review submit`. AO records the
reviewer's verdict and body on the review_run and marks the pass complete;
it does not post to GitHub — the reviewer agent posts its review to the PR
itself.
- storage: add review_run.body (0011), persist via Insert/UpdateReviewRunResult.
- service: restore Submit (no SCM poster) storing verdict + body.
- http: restore POST /sessions/{id}/reviews/submit + SubmitReviewInput.
- cli: ao review submit [worker] --verdict --body (worker from arg/--session/$AO_REVIEW_WORKER).
- runner: reviewer prompt instructs posting to GitHub and recording via ao review submit.
Regenerated OpenAPI + TS types.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Per maintainer request, restored |
…ompt Per PR #197 review: - Move the concrete reviewer runner out of the service layer into a new internal/review_runner package (package reviewrunner), beside other orchestration packages like session_manager. The service keeps only the Runner interface + RunSpec it depends on; the agent-resolver + runtime launch flow lives in review_runner. - Sharpen the reviewer prompt: tell the agent to diff against the PR base, focus on high-confidence findings, post via `gh pr review`, and record the result with `ao review submit`; review-only (no commits/edits). - Add unit tests for the runner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
…wer prompt Per PR #197 review: - review_run: status default 'running' (drop 'pending'), drop CHECK constraints on status/verdict, drop the updated_at column and the session/iteration index. Propagated through queries, domain, store, service, and tests. - Reviewer prompt no longer hardcodes GitHub/gh commands — it instructs the agent to use whatever review tooling the provider offers, keeping the flow extensible across SCM providers. Regenerated sqlc + OpenAPI/TS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Trigger now spawns the reviewer agent first and then writes the review_run with a status derived from the launch outcome (running on success, failed if it never started), instead of inserting a running row and correcting it to failed afterwards. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
…rnesses Reviewers are now their own pluggable adapter set, separate from the worker agent registry — adding a reviewer (claude-code today, greptile tomorrow) is a one-line registration that does not widen the worker harness vocabulary, and a worker harness does not automatically become a valid reviewer. - domain.ReviewerHarness: a distinct vocabulary (AllReviewerHarnesses) with its own IsKnown; ReviewerConfig/Review/ReviewRun use it. ResolveReviewerHarness reuses the worker harness only when it is itself a supported reviewer, else falls back to claude-code. - ports.Reviewer: a reviewer-specific contract (ReviewCommand → argv + env) that models one-shot / non-prompt CLIs natively instead of forcing every reviewer through the worker's interactive GetLaunchCommand(Prompt:...). - internal/adapters/reviewer: a separate registry + resolver (mirrors the worker agent registry) with the claude-code reviewer adapter, which owns the review prompt and reuses the worker claude-code launch construction. - review_runner resolves via the reviewer registry (not the worker AgentResolver) and merges AO_REVIEW_WORKER into the adapter's env. - daemon wires the reviewer resolver. Registry/domain parity is test-enforced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
neversettle17-101 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Summary
Implements configurable AO code review (V1) for issue #192. A worker's PR can be reviewed by a configured reviewer agent: the reviewer runs one-shot over the worker's own worktree, and the result is posted to GitHub. The worker picks the feedback up through AO's existing SCM observer → review-nudge path.
This folds in the V1 design comment (now reflected in the issue body), which supersedes the original HLD.
What changed
Domain / config
ProjectConfig.reviewers([]ReviewerConfig{ harness }), validated against known harnesses. Noenabledflag.claude-code) viaResolvedReviewers().domain.Review/domain.ReviewRunwith status (pending|complete|failed) and verdict (approved|changes_requested) vocab.Storage
0011_add_review_tables.sql:review(one per worker,session_idUNIQUE) +review_run(per pass).review_store.go(upsert-reuse, run insert/result, latest/list).Service
ReviewService(Trigger,Submit,List).Triggerreuses/creates the review row, records a pendingreview_run, and launches the reviewer over the worker's worktree (reusingAgentResolver+Runtime).Submitposts the verdict+body to the PR and marks the run complete (body is not persisted — it lives on GitHub).ports.PRReviewPoster, implemented on the GitHub adapter (POST /pulls/{n}/reviews).HTTP / CLI / Frontend
POST /sessions/{sessionId}/reviews/trigger,POST .../submit,GET .../reviews. Regenerated OpenAPI + TS types.ao review trigger|submit|list.ReviewDashboardto the per-worker reviews API.Out of V1 / later
Derived
in_reviewstatus; auto-trigger on PR HEAD SHA advance; Greptile no-workspace adapter; reviewer read-only permission mode; one-per-(session_id, pr_url)keying.Testing
go build ./... && go test ./... && go vet ./...— pass.golangci-lint runon changed packages — 0 issues.npm run sqlc/npm run api— no drift.tsccould not run in this environment (deps not installed);ReviewDashboard.tsxwas aligned to the regeneratedschema.tsand CI will run the real typecheck.Closes #192
🤖 Generated with Claude Code