Skip to content

feat(agents): add PR review closure templates#3151

Closed
stone16 wants to merge 1 commit into
multica-ai:mainfrom
stone16:agent/erdong/sto-136
Closed

feat(agents): add PR review closure templates#3151
stone16 wants to merge 1 commit into
multica-ai:mainfrom
stone16:agent/erdong/sto-136

Conversation

@stone16
Copy link
Copy Markdown

@stone16 stone16 commented May 24, 2026

Summary

Adds a PR review closure architecture spec and two prompt-only curated agent templates: PR Review Orchestrator and PR Review Worker. The shipped MVP lets one Multica issue own a review window while per-PR workers run in separate sessions and report four-state comment outcomes.

Why

STO-136 is about reducing human touchpoints before PRs are ready. The current GitHub integration mirrors PR metadata and check state, but not review comments, so this starts with a reversible template-based workflow that uses runtime GitHub access and one Multica issue summary instead of adding schema prematurely.

Approach

Implemented cp-01 by adding docs/pr-review-closure-architecture.md, covering the orchestrator/worker boundary, runtime flow, data model, observability, security, alternatives, and checkpoint verification commands.

Implemented cp-02 by adding prompt-only templates under server/internal/agenttmpl/templates/. The orchestrator template owns PR discovery, one-PR-per-worker delegation, no-self-review routing, and the final summary contract. The worker template owns checkout-at-head-SHA, four-state review comment resolution, scoped fixes, and verification evidence. Rejected a first-class GitHub review-comment schema for the MVP because the existing product only mirrors PR metadata/check suites; the template path is reversible and faster to validate.

How I Tested

End-to-end test case table:

Case Coverage Evidence
Template registry loads embedded templates New JSON templates are valid and load through the production embed path server/internal/agenttmpl/loader_test.go:14
Squad leader claim still receives briefing Existing coordination path remains available for orchestrator use server/internal/handler/squad_briefing_test.go:279
Squad assignment and mention routing still work Existing per-PR worker delegation mechanisms are unchanged server/internal/handler/squad_assign_trigger_test.go:13, server/internal/handler/squad_comment_trigger_test.go:545

Verbatim test output:

$ cd server && go test ./internal/agenttmpl
ok  	github.com/multica-ai/multica/server/internal/agenttmpl	0.379s

$ cd server && go test ./internal/handler -run 'TestClaimTask_LeaderGetsBriefing|TestCreateIssue_AssignedToSquadEnqueuesLeader|TestSquadMentionTriggersLeader'
ok  	github.com/multica-ai/multica/server/internal/handler	0.455s

$ rg -n "^TODO_DECISION:" docs/pr-review-closure-architecture.md server/internal/agenttmpl/templates/pr-review-*.json
<no output; exit 1>

Rollback Plan

Revert this PR. Blast radius is zero data integrity risk: it only adds documentation and static template JSON. Time to rollback is one revert commit.

Out of Scope

  • Persisting GitHub review comments in Multica tables.
  • Building a dedicated PR review summary UI.
  • Posting automated summaries back to GitHub PR comments.
  • Changing squad routing, task queue semantics, or GitHub webhook behavior.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@stone16 is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@stone16 stone16 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant