Problem Statement
Post-v0.6.0 direction: move review efficiency forward by decomposing the review flow into more, smaller, dedicated-prompt LLM calls — deterministic orchestration, not agentic — so each call has a predictable size and a single concern.
The orchestration is already multi-call (FindingPipeline.runMultiCall: N batches + per-batch verifier + summary, capped by REVIEW_MAX_AI_CALLS), and FindingVerificationService is already a dedicated second-stage call. What is still "single-shot" is the review call itself: PrReviewPrompts.SYSTEM (~600 lines) makes one call handle 10 review dimensions, severity/confidence calibration, previous-findings reconciliation, suggestions, and the full summary object. Decomposing that mega-prompt — and bounding follow-up rounds by push size instead of PR size — is this roadmap.
Phases
v0.7 — slim the review call (priority)
v0.7 — verification correctness
The verification stage lacks the evidence to rule correctly; each ticket is committed to a single approach and they compose rather than overlap:
v0.8 — smarter context selection
v0.9 — predictable follow-up rounds
Opt-in / cross-cutting
Agentic directions (#63 parallel specialists, #57 agentic fix) are post-1.0, opt-in, not currently planned — this roadmap is the non-agentic path; #665 delivers the "dedicated prompt per concern" benefit without agents or tool-calling.
Related open issues, sequenced against this roadmap
Fix before/while landing the decomposition (they live in code these phases restructure):
Made more urgent by this roadmap:
Fed by this roadmap:
Constraints every stage must respect
- Every AI call goes through
ReviewTokenLedger.ensureCallAllowed with usage recorded (streaming via OtelObservabilityListener, blocking via Result.tokenUsage()), or REVIEW_MAX_TOKENS_PER_REVIEW silently breaks.
DiffBudgetPlanner.plan reserves calls out of REVIEW_MAX_AI_CALLS (currently exactly one, for the summary) — each new stage changes that accounting explicitly.
- Budget overhead estimation concatenates the actual prompt constants (
DiffBudgetPlanner.plan, FindingPipeline.clampOverview / budgetedFindingsJson) — every prompt split updates those sites or the budgets become fiction.
PrReviewPromptsContentTest pins the guidance that past issues fought for; the eval corpus (-Peval) is the recall regression gate. Prompt restructuring lands only with both green, and the risky splits ship behind config gates with the current behavior as fallback.
- Keep system-prompt prefixes byte-stable within a review so OpenAI-compatible prompt caching keeps paying for the multi-call fan-out.
Priority
Important
Problem Statement
Post-v0.6.0 direction: move review efficiency forward by decomposing the review flow into more, smaller, dedicated-prompt LLM calls — deterministic orchestration, not agentic — so each call has a predictable size and a single concern.
The orchestration is already multi-call (
FindingPipeline.runMultiCall: N batches + per-batch verifier + summary, capped byREVIEW_MAX_AI_CALLS), andFindingVerificationServiceis already a dedicated second-stage call. What is still "single-shot" is the review call itself:PrReviewPrompts.SYSTEM(~600 lines) makes one call handle 10 review dimensions, severity/confidence calibration, previous-findings reconciliation, suggestions, and the full summary object. Decomposing that mega-prompt — and bounding follow-up rounds by push size instead of PR size — is this roadmap.Phases
v0.7 — slim the review call (priority)
v0.7 — verification correctness
The verification stage lacks the evidence to rule correctly; each ticket is committed to a single approach and they compose rather than overlap:
path:line(quote-search-first) against the real file and hand the snippet to the verifier as established material. No model call.v0.8 — smarter context selection
v0.9 — predictable follow-up rounds
synchronize+ dedicated finding-resolution check call; prompt size bounded by push sizeOpt-in / cross-cutting
response_format: json_schema) behind a per-model capability flagAgentic directions (#63 parallel specialists, #57 agentic fix) are post-1.0, opt-in, not currently planned — this roadmap is the non-agentic path; #665 delivers the "dedicated prompt per concern" benefit without agents or tool-calling.
Related open issues, sequenced against this roadmap
Fix before/while landing the decomposition (they live in code these phases restructure):
pr_purpose/MarkdownSafe fix must land on the summary-call path, since feat(review): make the summary call universal and strip the summary object from the review prompt [v0.7] #664 movespr_purposethereMade more urgent by this roadmap:
Fed by this roadmap:
Constraints every stage must respect
ReviewTokenLedger.ensureCallAllowedwith usage recorded (streaming viaOtelObservabilityListener, blocking viaResult.tokenUsage()), orREVIEW_MAX_TOKENS_PER_REVIEWsilently breaks.DiffBudgetPlanner.planreserves calls out ofREVIEW_MAX_AI_CALLS(currently exactly one, for the summary) — each new stage changes that accounting explicitly.DiffBudgetPlanner.plan,FindingPipeline.clampOverview/budgetedFindingsJson) — every prompt split updates those sites or the budgets become fiction.PrReviewPromptsContentTestpins the guidance that past issues fought for; the eval corpus (-Peval) is the recall regression gate. Prompt restructuring lands only with both green, and the risky splits ship behind config gates with the current behavior as fallback.Priority
Important