Skip to content

feat(review): multi-call prompt decomposition roadmap (v0.7–v0.9) — dedicated prompts per pipeline stage, non-agentic #669

Description

@devops-thiago

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions