Repository navigation
feat(task-board): QA Agent + Code Reviewer review flow with ship-to-production - #5520
Merged
Merged
Conversation
…roduction Add two per-org automated reviewers that run on a task's PR once the Super Agent finishes, gated by org flags, plus a manual "ship to production" merge. - Reviewers: QA Agent (verifies the task solved the problem) and Code Reviewer (reviews the code with the repo's stack review skills). Enabled per-org via `qa_agent_enabled` / `code_reviewer_enabled` flags; both run as linked threads shown live on the card, delegated by the Super Agent. - Trigger is headless: fires from the projector's run-terminal hook when a Super Agent run finishes (no UI required); the modal's poll is a safety net. - Decision via `TASK_BOARD_REVIEW_DECISION` (request_changes hands back to the Super Agent with feedback + `gh pr checkout` to update the same PR; approve records the sign-off). Auto-merge (`auto_merge` flag) merges once every enabled reviewer approves; a manual "Ship to production" button + merge tool otherwise. - Merge is gated on CI: never ships on failing/pending checks (client + server). - PR card: live state, an expandable checks footer (Status API + Checks API, with each failing check's output markdown), and the deco deploy preview link (lifted from the deploy bot's PR comment). Concurrent GitHub reads + a loading skeleton. - Dev: dispatch defaults the sandbox target to the env-configured provider so background runs work under `--local-sandbox-provider`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…g-scoped merge conn Address blockers/important findings from the branch review: - Re-review never re-ran the reviewers: the thread-finish backstop advanced a task to In Review without recording a `status_changed` activity, so the reviewer cycle boundary (`lastInReviewAt`) went stale after a request_changes fix pushed to the same PR. Record the transition so reviewers re-run. - Preview-host match was an unanchored substring on attacker-writable PR-comment URLs (phishing button + a URL the autonomous QA agent opens). Replace with a strict hostname check (`isDecoPreviewHost`). - `resolveGithubConnection` resolved a linked connectionId without an org filter on a PR-merge (write) path — org-scope the lookup. - Add unit tests: `isDecoPreviewHost` (incl. the decoy), `reviewerHandledThisCycle` (incl. the re-review prior-cycle case). Co-Authored-By: Claude Opus 4.8 <[email protected]>
…tokens, dedup enqueue P1: - #4 double-enqueue race: per-(task,reviewer,cycle) claim table (INSERT ... ON CONFLICT DO NOTHING) gates each reviewer so a concurrent/duplicate trigger enqueues a reviewer at most once per cycle. - #5 reviewer identity forgery: each claim mints a reviewToken bound to the reviewer; TASK_BOARD_REVIEW_DECISION marks a decision `verified` only when the token resolves to a claim whose reviewer matches. Auto-merge gate requires every enabled reviewer's latest verdict to be a VERIFIED approve, so one agent can't forge the two-reviewer sign-off. P2: - #6 tests: shared review-cycle reducer + verifiedOnly anti-forgery gate, checks-status parsing/preview-host, reviewer re-review cycle. - #7 duplication: extract enqueueAgentRunForTask (thread create + link + persist-before-dispatch + enqueue) shared by the Super Agent and reviewer enqueues; reuse StudioContextFactory instead of a local copy. Co-Authored-By: Claude Opus 4.8 <[email protected]>
# Conflicts: # apps/api/src/storage/task-board.ts # packages/shared/src/organization/schema.ts # packages/shared/src/tools/tool-io.ts
…s integration assertion The studio-pack integration test pinned the Task Manager's selected_tools without TASK_BOARD_REVIEW_DECISION, which the review flow added to the manager. Align the expected list with the source (task-manager.ts) and the unit test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
# Conflicts: # apps/web/src/layouts/task-board/task-dialog.tsx
decocms Bot
pushed a commit
that referenced
this pull request
Jul 31, 2026
PR: #5520 feat(task-board): QA Agent + Code Reviewer review flow with ship-to-production Bump type: minor - decocms (apps/api/package.json): 4.157.0 -> 4.158.0 - @decocms/native (apps/native/package.json): 4.157.0 -> 4.158.0 - @decocms/shared (packages/shared/package.json): 0.11.2 -> 0.12.0 Deploy-Scope: both
This was referenced Jul 31, 2026
pedrofrxncx
added a commit
that referenced
this pull request
Aug 1, 2026
enqueueEnabledReviewers awaited each reviewer's claim+enqueue sequentially, even though QA and Code Reviewer are independent DB rows keyed by their own kind. This runs on TASK_BOARD_ITEM_PRS_GET's synchronous 10s-poll path, so with both reviewers enabled (shipped in #5520) the round-trip serialized two full claim+thread-create+dispatch chains back to back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two per-org automated reviewers that run on a task's PR once the Super Agent finishes, plus a ship-to-production merge flow. All reviewers are derived identities over the org's agent runtime (same pattern as the Super Agent) — no seeding.
Reviewers (org-flag gated)
qa_agent_enabled) — verifies the task actually solved the problem (exercises the feature).code_reviewer_enabled) — reviews the code using the repo's stack-appropriate review skills.Decision & merge
TASK_BOARD_REVIEW_DECISION { reviewer, decision, notes }:request_changes→ hands back to the Super Agent with the feedback +gh pr checkoutso it updates the same PR.approve→ records the sign-off.auto_mergeflag) merges once every enabled reviewer approves; otherwise a manual "Ship to production" button (+TASK_BOARD_PROMOTE_TO_PRODUCTION).failing/pendingchecks (client hides the button + servermergeLinkedPrrefuses).PR card
#123 ↗GitHub link, action row (Edit / preview / ship).GET_CHECK_RUN).cloudflare-workers-and-pages[bot]branch preview / deco.cxdecobot).Other
resolveGithubConnectionprefers the connection matching the PR's repo (or the broad org-level one) so multi-repo-scoped orgs resolve live state correctly.STUDIO_SANDBOX_PROVIDER) so background runs work under--local-sandbox-provider(prod unchanged).154adds thereview_*activity actions.Testing
bun run fmt, typecheck (shared/api/web),bun run lint(0 errors),bun run knip(0) all pass.Notes
🤖 Generated with Claude Code
Summary by cubic
Adds per‑org QA Agent and Code Reviewer that auto‑review a task’s PR after the Super Agent, with approve/request‑changes and CI‑gated ship‑to‑production. Hardens the flow with idempotent reviewer enqueue and token‑verified decisions.
New Features
qa_agent_enabled,code_reviewer_enabled) run as linked threads; triggered headlessly when the Super Agent run finishes.TASK_BOARD_REVIEW_DECISION: approve records sign‑off; request_changes hands back to the Super Agent with feedback to update the same PR.auto_mergeis on; otherwise manual "Ship to production" viaTASK_BOARD_PROMOTE_TO_PRODUCTION.154-task-board-qa-activity(review_* actions) and155-task-board-review-claims(per‑cycle review claims + tokens).Bug Fixes
status_changed → in_reviewactivity on backstop transitions resets the cycle boundary.TASK_BOARD_REVIEW_DECISION.Written for commit bdf0192. Summary will update on new commits.