Skip to content

refactor(review): one finalize module for the result tail (#648) - #650

Merged
ajianaz merged 1 commit into
developfrom
refactor/648-finalize
Oct 15, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/648-finalize

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #648. Part 1/6 of the agent-as-reviewer series (map in the issue comments).

What

New engine::finalize: shape/shape_issues (severity filter, should_block, quality gate, exit code), blocks, exit_code, save_debt, save_history. Review (single + chunked), commit, scan, MCP and the engine fallback call it instead of re-implementing the tail.

Why

The same result-shaping logic was copied in 6 places and had drifted: the MCP gate ignored severity, commit skipped history, chunked review recomputed should_block twice. This is the single tail the later judge seam (#649) plugs into.

Behavior

Unchanged for cora review and cora scan. Two intentional fixes:

  • MCP cora.review_diff honors min_severity and gates on the reported findings.
  • cora commit now saves its review to the history (command = commit).

Testing

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (1135 passed; 11 new finalize tests; the exit-code tests moved there).
  • Manual end to end with a real LLM on a sample diff and directory: review warn=0, block=2, --ci=2; scan default=0, block=2.

Replace six hand-copied versions of severity filtering, should_block,
quality gate, exit code, debt snapshot and review history (review single
and chunked, commit, scan, MCP, engine fallback) with engine::finalize.

MCP review_diff now honors min_severity and gates on the reported
findings; commit records its review in the history.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz force-pushed the refactor/648-finalize branch from 1f280f4 to 74d512d Compare October 15, 2026 05:06
@ajianaz
ajianaz merged commit 2b5bb05 into develop Oct 15, 2026
14 checks passed
@ajianaz
ajianaz deleted the refactor/648-finalize branch October 15, 2026 05:12
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.

refactor(review): one finalize module for the result tail (should_block, severity, gate, debt, persist)

1 participant