You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(review): split review_diff_inner into prepare / judge / finalize with the LLM as the seam #649
From the architecture audit. Part 2 of 6. Depends on 1/6 (finalize).
Problem
engine/review.rs::review_diff_inner (~L79-384) does sanitize, deterministic scanners, context chain, language/profile/memory/brain context, cache, the LLM call, merge, path guard and postprocess in one function. valid_files and the deterministic report are computed and never returned, so nobody else can finalize a result. HttpTransport is built inline in review_diff, review_diff_stream, scan_files, chat_completion_raw; the Transport trait is pub(crate) with no injection point, so there is no end-to-end test of review. llm::review_diff also owns the spinner (terminal UI inside the LLM module).
Proposal
Split into three steps with the LLM as the seam:
prepare(diff|files, config) -> Packet: hardened system prompt, user prompt (fenced), valid_files, deterministic findings, diff chunks, response schema.
judge(Packet) -> Vec<ReviewIssue>: the seam. Adapters: HttpLlm (today's behavior, owns retry/stream/spinner), None (deterministic only), Agent (see 6/6).
Activity
ajianaz commentedon Oct 15, 2026
Series map (sequential, one PR each): 1/6 finalize #648 → 2/6 prepare/judge/finalize #649 → 3/6 untrusted judge output + cache #644 → 4/6 scan deterministic family #645 (can parallel 3/6) → 5/6 select_judge #646 → 6/6 MCP agent tools + skill #647.
refactor(review): prepare / judge / finalize with the LLM as the seam (…
refactor(review): prepare / judge / finalize with the LLM as the seam (…