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): one finalize module for the result tail (should_block, severity, gate, debt, persist) #648
From the architecture audit (deep module / seam vocabulary). Part 1 of 6 of the "agent as reviewer" series (see the tracking list at the bottom).
Problem
The result-shaping tail of a review is re-implemented in 6 places and has already drifted:
commands/review.rs single path (~L260-355) and the chunked path (~L647-710) are copy-pasted; chunked review sums should_block across chunks and then recomputes it again.
commands/commit_cmd.rs filters severity from config only, computes no should_block, skips history persist.
mcp/tools.rs::handle_review_diff never reads its own min_severity param and evaluates the quality gate on unfiltered issues; no debt snapshot, no persist.
commands/scan.rs has its own should_block, its own persist with inline git rev-parse calls, no gate, no debt.
engine/review.rs recomputes should_block in the LLM-failure fallback and the main path. ReviewRecord, the gate_status string mapping, git context, token summing and DebtSnapshot::from_review are rebuilt by hand at each site.
Proposal
One finalize module: merged issues + options in, a Verdict out (filtered issues, should_block, gate result, exit code), with the best-effort side effects (debt snapshot, cora.db history) behind it. Review (single + chunked), commit, scan and MCP each make one call.
Done when
should_block, severity filtering, gate evaluation, exit code and persistence each exist once.
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): one finalize module for the result tail (#648)
refactor(review): one finalize module for the result tail (#648) (#650)