Skip to content

feat(code-intel): make brain answer questions and show which signals found what - #745

Merged
ajianaz merged 1 commit into
developfrom
feat/brain-signals
Nov 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/brain-signals

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • cora brain reduces a question to its content words (stop words dropped, snake_case split) and ranks a symbol by how many of them it matches, so a sentence now finds symbols by keyword. The MCP cora.brain_search tool uses the same handling.
  • Results are returned in rank order; they came back in table order, which lost the fused ranking.
  • A static text embedding counts for half in the fusion.
  • cora brain prints how many hits keyword, vector and graph found, and warns when the vector index is empty, built with other dimensions, or text-only. The warnings go to stderr, so --json stays a plain array.
  • A fixed question over a small fixture is kept as a regression test.

Why

A question such as "how does web_search pick its backend and read env" needed every word in one symbol name, so the keyword signal found nothing and only unrelated vector hits were left. Together with the lost ordering, the output looked arbitrary. Refs #717: this covers the brain item except the embedding-model evaluation, which needs a real provider and is not part of this change.

Testing

  • Tests for question reduction, the regression question (keyword hits, no unrelated symbols), plain mode finding nothing for a sentence, rank order of results, and the diagnostics and warnings. The new tests are registered (cargo test -- --list).
  • On this repository, cora brain "how does the review store prune findings" now returns prune, review_store, Findings and related symbols by keyword, with the signal counts and a static-embedding warning.
  • cargo fmt --all -- --check, cargo clippy --all-targets --features tree-sitter -- -D warnings, cargo test --features tree-sitter, cora review --base origin/develop: no issues.

…found what (#717)

A question such as "how does web_search pick its backend" needed every word in
one symbol name, so the keyword signal found nothing and only the vector hits
were left. cora brain now reduces the question to its content words (stop words
dropped, snake_case split) and ranks a symbol by how many of them it matches.

Results were also returned in table order instead of rank order; they are now
sorted by the fused score. A static text embedding counts for half in the
fusion. cora brain prints how many hits keyword, vector and graph found and
warns when the vector index is empty, built with other dimensions, or text-only.
The MCP brain tool uses the same question handling. A fixed question over a small
fixture is kept as a regression test.
@ajianaz
ajianaz merged commit 1d154b4 into develop Nov 16, 2026
16 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.

1 participant