Skip to content

feat(review): use the code model fully in review and scan, as agent reviewer and in CI - #766

Merged
ajianaz merged 3 commits into
developfrom
feat/review-model-context
Nov 16, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/review-model-context

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

What

Audit result: cora review, cora scan and the agent tools only read an index somebody had built, scan never found related code by meaning (it searched file:"<path>" through the brain), review searched by the bare symbol name instead of the text the code model embedded, and cora.scan_prepare gave the agent no code context at all. On a fresh CI runner that means no code intelligence and an unused model.

  • review.context_chain.auto_index (default true): before a review or scan with a judge builds its context, bring the project's index and vectors up to date (incremental; failures are only logged). Applies to cora review, cora scan, cora.review_prepare and cora.scan_prepare. A --no-llm run only reads an existing index, so its speed and findings do not change. One line says what the context is made of (Code index: N symbols; code model on, or code model off: keyword and call-graph context only).
  • Review: related code is searched from the indexed name signature of each changed definition, with the vector signal (natural-language mode); only the changed symbol itself is excluded (it excluded the whole file before).
  • Scan: lists the real symbols of the scanned files from the index, ranks them by impact, and finds code outside the scanned files that does a similar thing. cora.scan_prepare now passes the same context to the agent.
  • Skills (cora-code, cora-review): review the whole branch with cora as the reviewer before opening a PR, and suggest cora review --ci / the cora-review-action in the project's CI. The skill drift checks from chore(skills): keep the cora skills in step with the binary and refresh them on upgrade #764 validate every command and flag the new text names.
  • Docs (configuration, usage, examples: "Code intelligence in CI") and the changelog.

Why

The release binaries now carry the code embedding model (#761), and agents and CI are where code review happens; both should get the model's help without a manual cora index. Closes #765.

Testing

  • cargo fmt --all -- --check, cargo clippy --all-targets --features tree-sitter -- -D warnings clean; cargo test --features tree-sitter: 1528 passed, 0 failed.
  • New end-to-end tests (tests/review_context.rs, cora mcp over stdio, fresh data directory, tiny fixture model): review_prepare indexes the project itself and its prompt contains related code found by meaning (a network function related to a differently named one by the model alone); scan_prepare on a sub-tree gives the same context with "is similar to"; with auto_index: false nothing is indexed and the prompt has no code intelligence.
  • A first version refreshed for --no-llm scans too; the existing scoped_ignore test caught the new dead-code findings that caused, so deterministic-only runs stay read-only.
  • Not run here: a real LLM judge (no key in this environment); the CLI paths share the same helper as the MCP ones, which the tests above exercise.

Generated by Claude Code

cora review and scan with a judge, and the agent tools review_prepare and
scan_prepare, bring the index and vectors up to date before building their
context (context_chain.auto_index), so a fresh CI checkout gets code
intelligence and the code model is used. Related code is searched by the
indexed name and signature of each changed symbol; scan lists the real symbols
of its files and gives the judge the same context, including in scan_prepare.

Refs #765.
The skills tell the agent to review the whole branch with cora before opening
a pull request and to suggest cora review in the project's CI; the docs
describe auto_index and code intelligence in CI.

Refs #765.
@ajianaz
ajianaz merged commit bf86a3e into develop Nov 16, 2026
13 checks passed
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.

feat(review): make cora review and scan use the code model fully, as CLI, as agent reviewer and in CI

1 participant