Skip to content

feat(code-intel): rank explore exact matches first, drop std-method noise from query, check why brain returns unrelated vector hits, group arch below the top directory #717

Closed

Description

@ajianaz

What problem does this solve?

Measured on tole (8c05cd1) and by an agent doing a real task around web.rs and tool_roster.rs:

  • cora explore fetch returns 50 symbols, mostly noise matched on a common word (openai::fetch_context_window, systemone::fetch, gitea::fetch, verify_package::fetch). cora explore WebFetchTool finds the struct and its env constants, but also returns up to 50 results with no ordering rule and no count of what was cut. For finding a registration site or an outline, grep was faster and had no noise.
  • cora query "dispatch -> *" lists 50 callees, including std method names (context, current_dir, as_deref) that are never the answer.
  • cora brain "how does web_search pick its backend and read env" returned 20 results, all signals=vector and none relevant (commit, is_at_eof, tzif, test constants such as KEY). Either the vector index is missing or poor for code, or the scoring over-weights short symbols.
  • cora arch shows two modules, crates (5,514 symbols) and evals (48): the top directory is the only grouping, so it says nothing about the structure of a multi-crate workspace.
  • cora routes found nothing on tole, which is correct (hand-written routing), but the output could say which frameworks it looked for.

Proposed solution

  1. explore: order by exact name, then prefix, then substring, then FTS rank; print "showing 50 of N"; --kind filter; do not match on common words inside doc comments unless --docs.
  2. query: hide std and core method names by default (--include-std to show them), mark edges by confidence.
  3. brain: print which signals contributed and warn when the vector index is empty or was built with a text-only model; evaluate a code embedding model and the RRF weights on a small fixed question set (add the tole questions as a regression set).
  4. arch: group by crate, then module path, with edge counts between groups and the biggest hotspots.
  5. routes: list the frameworks that were searched, and the count of files scanned.

Alternatives considered

Leave them as they are and treat them as a rough pointer. Real usage showed that they cost more time than they save on a codebase this size.

Are you willing to contribute the implementation?

Yes, I can do it

Tracking issue: codecoradev/tole#669.

Before submitting

  • I searched existing issues and didn't find a duplicate

Activity

  1. added
    enhancement
    scope:code-intel
    epic:code-intelligence
    on Nov 13, 2026
  2. ajianaz commented on Nov 16, 2026

    @ajianaz
    CollaboratorAuthor

    Done on develop:

    The remaining part (evaluating a code embedding model and tuning the RRF weights on a fixed question set) needs a real embedding provider and is tracked in #746. Closing this one.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic:code-intelligencepriority:mediumscope:code-intel

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions