Skip to content

feat(.cursor/agents): adversarial code-review orchestrator#179

Merged
tonyketcham merged 1 commit intomainfrom
toeknee/code-review-orchestrator-af84
May 8, 2026
Merged

feat(.cursor/agents): adversarial code-review orchestrator#179
tonyketcham merged 1 commit intomainfrom
toeknee/code-review-orchestrator-af84

Conversation

@tonyketcham
Copy link
Copy Markdown
Collaborator

Summary of changes

Adds .cursor/agents/flatbread-code-review-orchestrator.md — a system prompt that drives an adversarial code-review DAG over a Flatbread change diff using @flatbread/proof.

How it works:

  • Diff intake & chunking. Materializes the diff against origin/main and builds a chunk index (path:start-end per hunk) so all findings are addressable to specific lines, not just files.
  • Dynamic perspective selection (≤5). Walks the changed-file list against an 11-perspective catalog with trigger globs and selects up to five highest-impact reviewers for this diff. correctness-and-contracts and test-coverage-robustness are mandatory whenever any non-test source changes (the user's named priorities).
  • Single-rank parallel review. All chosen perspectives sit in rank 1 with depends_on: []; the runner topo-sorts them into one parallel batch. Reviewers are read-only so same-rank file-write safety is satisfied.
  • Rank-2 judge. Depends on every chosen perspective and merges their ## Chunks flagged / ## Coverage gaps outputs into chunk-bound structured feedback: per-chunk severity, consensus vs. disputed flagging, a consolidated ## Coverage plan (positive / negative / edge:), a verdict (APPROVE | COMMENT | REQUEST_CHANGES | BLOCK), and a reviewer scoreboard that downgrades reviewers whose findings were purely pedantic.
  • Anti-pedantry guardrails. Explicit drop-list (formatting, naming, "could be more DRY") vs. keep-list (contracts, coverage, determinism, error UX) baked into both the per-perspective template and the judge's hard rules.
  • Composable. Carries the ## Output Schema For DAG Handoff convention so the orchestrator itself can nest inside a parent DAG (e.g. a release-gate flow that reviews before publish).

Catalog of perspectives (orchestrator picks ≤5):

id trigger
correctness-and-contracts packages/*/src/**/*.ts (mandatory if matched)
test-coverage-robustness any non-test source change (mandatory)
codegen-and-generated-artifacts packages/codegen/**, generated TS/GraphQL
cli-and-runtime packages/flatbread/src/cli/** + server
plugin-contract packages/transformer-*/**, packages/source-*/**
config-and-public-api packages/config/**
dx-and-examples examples/**, READMEs
docs-and-positioning *.md, docs/**
release-discipline version bumps, scripts/publish.ts, changelog
perf-and-caching cache/hash/dependencyCheck + hot-path resolvers
proof-runtime-internals packages/proof/src/**

Closes #

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • I added doc comments to any new public exports, and inline comments to any hard-to-understand areas
  • My changes generate no new console errors locally
  • If applicable, try to include a test that fails without this PR but passes with it — N/A; this PR is a Markdown system-prompt artifact under .cursor/agents/, not executable code. Verification is pnpm lint (prettier passes) and structural cross-checks against existing agent files (flatbread-adversarial-reviewer.md, flatbread-architecture-planner.md) plus the proof skill (.cursor/skills/proof/SKILL.md).

Does this introduce any non-backwards compatible changes?

  • Yes
  • No

Does this include any user config changes?

  • Yes
  • No
Open in Web Open in Cursor 

…rompt

Adds a system prompt that drives an adversarial code-review DAG over a
Flatbread change diff via @flatbread/proof. The orchestrator picks up to
five reviewer perspectives dynamically based on the diff's changed paths
(catalog of 11, with mandatory-include rules for correctness and test
coverage), runs them as a single rank of parallel subagents, and merges
findings through a rank-2 judge that emits structured feedback bound to
specific diff chunks.

Reviewer prompts encode anti-pedantry guardrails (drop formatting/style/
naming nits, keep correctness, contracts, coverage, determinism, and
error-UX findings) so the output stays high-signal. The judge produces a
verdict (APPROVE | COMMENT | REQUEST_CHANGES | BLOCK), per-chunk
feedback with severity + minimal fix, a consolidated coverage plan
(positive/negative/edge), and a reviewer scoreboard so weak signal gets
visible.

Reuses the existing .cursor/agents/* convention (frontmatter + Output
Schema For DAG Handoff) so the orchestrator can itself nest inside a
parent DAG (e.g. release-gate).

Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
@tonyketcham tonyketcham marked this pull request as ready for review May 8, 2026 14:14
@tonyketcham tonyketcham merged commit 6b95828 into main May 8, 2026
19 checks passed
@tonyketcham tonyketcham deleted the toeknee/code-review-orchestrator-af84 branch May 8, 2026 14:15
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.

2 participants