Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: colbymchenry/codegraph
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: kingkillery/codegraph
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 13 files changed
  • 1 contributor

Commits on Sep 23, 2026

  1. fix(explore): weight query terms by reach so a prose question's rare …

    …word is not drowned by its common ones
    
    On a 136k-node index, `codegraph_explore "how the task.eager setting
    influences subagent delegation in the system prompt"` rendered four wrong
    files and none of the answer. Three compounding causes, all in ranking:
    
    1. findRelevantContext's text channel searches each term on its own and
       merges by raw score. A flat exact-name bonus (+80) lifts a property
       called `system` (700+ nodes match `system*`) to ~100, the same as the
       `EAGER` enum, while `eagerTasks` (44 nodes match `eager*`) scores 45 —
       so the query's one discriminating word never survives the merged cut.
       Each term's hits are now weighted by how much of its match set the
       channel can see: `min(1, max(50, sqrt(N)) / reach)`. Absolute reach,
       not idf: on a 270-node payroll fixture `cycle` reaches 22% of nodes
       and IS the hand-written workflow the query asks for; a relative
       measure discounts it under the generated CRUD (explore-allocation-1500
       pins this). `CODEGRAPH_TERM_RARITY_SHARPNESS=0` restores the old rank.
    
    2. handleExplore's named-symbol seeding lets a bare word tier a file when
       a sibling query token is also a symbol there. Any file large enough —
       a 15k-line session class, a generated protobuf, a platform .d.ts —
       declares a `task`, a `model` and a `role`, so on "how subagent model
       routing picks a model role from the task difficulty" the session class
       was tiered above the routing module that scored 102 to its 50. The
       corroborating sibling must now be a precise token or a name declared
       in at most max(8, 0.25% of files) files (`countFilesDeclaringName`,
       via idx_nodes_lower_name).
    
    3. The `+e` stem the `-ing`/`-er` rules emit (`setting` -> `sette`) is not
       a substring of its base, so the co-occurrence re-rank counted it as a
       second concept and doubled `setText` on a query about settings —
       masked until (1) removed the noise around it. Root grouping is now
       `groupTermsByRoot` in query-utils (shared prefix of max(4, len-1)).
    
    Eight prose questions over that index, ground truth by grep:
      answer rendered 7/8 -> 8/8, answer first 4/8 -> 6/8,
      off-topic files 18 of 53 -> 6 of 44.
    
    Tests: context-term-rarity (weighting, both directions via env),
    explore-ambient-corroboration (guard, both directions via env + diag
    sidecar), query-term-root-groups (grouping contract). Full engine suite
    diffed against pristine HEAD: symmetric difference is only Windows
    spawn/sync flakes that flip both ways and pass on retry; the two
    pre-existing CRLF failures (explore-factory-closure, explore-oversize-
    member) are unchanged. scripts/probe-*.mjs are the tuning harness.
    kingkillery committed Sep 23, 2026
    Configuration menu
    Copy the full SHA
    da33657 View commit details
    Browse the repository at this point in the history
Loading