Skip to content

feat(search): add opt-in TESTS-signal to graph-stage (E17) - #39

Merged
ManSio merged 1 commit into
mainfrom
feat/tests-signal-graph-stage
Sep 22, 2026
Merged

ManSio merged 1 commit into
mainfrom
feat/tests-signal-graph-stage

Conversation

@ManSio

@ManSio ManSio commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in TESTS-signal to symbol search (graph-stage): covering tests
(incoming TESTS edges from the dynamic-trace bootstrap) are appended to found
function definitions as a separate, lower-ranked result group.

Behind MSCODEBASE_TESTS_SIGNAL (env), off by default — production behavior
is unchanged.

What changed

  • SearchConfig.tests_signal (env flag, default false).
  • SymbolIndexAdapter.get_tests_for_symbol: resolves incoming TESTS edges for a
    function, capped (hub functions like safe_mkdir have 234 tests).
  • Searcher._append_tests_signal: appends up to 3 tests per function,
    graph_score = 0.4 (vs 1.0 for definitions), sentinel
    chunk_index = -(20_000_000 + line) to avoid RRF collisions.
  • 7 unit tests in tests/test_graph_stage_e4.py.
  • Reproducible harnesses shipped: e17_ab_tests_signal.py (narrow A/B),
    e17_wide_panel.py (35 queries + language coverage), e17_redteam.py (5 attacks).

Findings (measured, not predicted)

  • hit@1 unchanged (94.3% both arms, 35-query wide panel). The signal adds
    LLM context only — it does not improve retrieval ranking.
  • Language coverage is the critical limitation: Python 34.0% of functions
    covered by TESTS edges; Other (Go/Rust) 0%; TypeScript 0%. The dynamic
    trace is Python-only.
  • Red team: 5/5 repelled — concurrency (1000 calls, 0 errors), boundaries
    (234-test hub = 16.11ms), abuse (nonexistent symbol → empty), TOCTOU (graph
    closed mid-search → graceful), dependency failure (bad path → empty).

How to reproduce

python -X utf8 experiments/bootstrap/e17_wide_panel.py
python -X utf8 experiments/bootstrap/e17_redteam.py
python -X utf8 experiments/bootstrap/e17_ab_tests_signal.py

Notes

  • Article draft (full history Exp 7 → 16 → E17): docs/blog/bootstrap-pipeline.md.
  • graph_score = 0.4 is an empirical constant, unverified against reranker/BM25
    weight interactions — see "What Could Go Wrong" in the article.
  • Tests: 34 passed locally; ruff clean.
  • verified_from_clean_state: this PR is what enables the clean-state check.

Append covering tests to symbol-search results behind MSCODEBASE_TESTS_SIGNAL (off by default, production unchanged).

- SearchConfig.tests_signal (env flag, default false)

- SymbolIndexAdapter.get_tests_for_symbol: incoming TESTS edges of a function

- Searcher._append_tests_signal: up to 3 tests per function as separate rank (graph_score 0.4 vs 1.0), sentinel chunk_index -(20_000_000+line)

- 7 unit tests in test_graph_stage_e4.py

- Reproducible harnesses: e17_ab_tests_signal.py, e17_wide_panel.py (35 queries + language coverage), e17_redteam.py (5 attacks)

Findings: hit@1 unchanged (94.3% both arms) - signal adds LLM context only; TESTS coverage Python 34.0%, Other/TypeScript 0%; red team 5/5 repelled.

Article draft: docs/blog/bootstrap-pipeline.md
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 72629b36-52d0-47b6-98cc-b529bfd80aae


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ManSio
ManSio merged commit c1fb236 into main Sep 22, 2026
12 of 13 checks passed
ManSio pushed a commit that referenced this pull request Sep 22, 2026
- PR #39 merged (2026-09-22T09:13:51Z)

- v3.5.0 pushed to main (6 commits)

- E17 entry in EXPERIMENTS_LOG.md
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