feat: symbol ranking, smart snippets, and edit decision card#40
Merged
PatrickSys merged 1 commit intomasterfrom Feb 21, 2026
Merged
Conversation
Cleaned up the edit decision card and sharpened search ranking.
When you search for a symbol name, the file that defines it now ranks above files
that just use it. Snippets include a scope header (// ClassName.methodName) so you
see context without reading extra lines. And the preflight response for edit intent
is now lean and actionable: ready, nextAction, patterns to follow/avoid, caller
coverage ("3/5 callers in results" so you know what you haven't looked at), and
concrete next steps in whatWouldHelp when you need more evidence.
Removed the internal fields (evidenceLock, riskLevel, confidence) that leaked into
the output. The decision card is stable by design — agents can rely on field names
staying put.
- SEARCH-01: definition-first boost (+15%) for EXACT_NAME intent
- SEARCH-01: symbol-level dedup (keeps highest-scoring chunk per symbolPath)
- SEARCH-02: scope headers on symbol-aware snippets
- PREF-01-04: clean decision card with ready, nextAction, patterns, impact, whatWouldHelp
- PREF-02: caller coverage tracking ("X/Y callers in results")
- PREF-03: concrete next-step recommendations when evidence is thin
Documentation updated to match the new output shape. No any types. 219 tests pass.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile SummaryThis PR refactors the search and preflight systems to provide cleaner, more actionable output. The decision card now exposes only stable, user-facing fields ( Key changes:
Potential issue:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/core/search.ts | Adds definition-first boost (+15%) for EXACT_NAME intent and symbol-level deduplication to prevent duplicate methods from same class |
| src/preflight/evidence-lock.ts | Adds caller coverage gating (triggers epistemic stress when <40% coverage with >3 callers) and generates whatWouldHelp recommendations |
| src/tools/search-codebase.ts | Refactors preflight response to clean decision card shape, computes impact coverage, adds scope headers to snippets. Potential issue with caller coverage logic |
| docs/capabilities.md | Comprehensive update: adds retrieval pipeline steps for symbol ranking/dedup, rewrites preflight section with TypeScript interface and detailed field explanations |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Search Query] --> B[Dual Retrieval]
B --> C[RRF Fusion]
C --> D{Intent = EXACT_NAME?}
D -->|Yes| E[Definition-First Boost +15%]
D -->|No| F[Structure-Aware Boosting]
E --> F
F --> G[File-Level Deduplication]
G --> H[Symbol-Level Deduplication]
H --> I[Stage-2 Reranking]
I --> J[Build Decision Card]
J --> K{Ready to Edit?}
K -->|No| L[Generate whatWouldHelp]
K -->|Yes| M[Return Results]
L --> N[Check Caller Coverage]
N -->|<40% with >3 callers| O[Trigger Epistemic Stress]
N -->|Sufficient| M
O --> M
M --> P[Enrich with Scope Headers]
P --> Q[Final Response]
Last reviewed commit: 9efe5c5
5 tasks
PatrickSys
added a commit
that referenced
this pull request
Feb 22, 2026
Addresses 5 live code gaps left after PRs #39 and #40 merged: 1. Delete orphaned get-component-usage source file (already removed from dispatcher in PR #39, but file remained on disk causing confusion) 2. Remove 'get_component_usage' from INDEX_CONSUMING_TOOL_NAMES allowlist in src/index.ts. The dispatcher no longer routes to this tool, so the allowlist entry created a phantom entry that would be validated during test runs despite not being available. 3. Remove get_component_usage branch from args dispatch ternary in index-versioning-migration test. Now that the tool is removed, this branch is dead code and should not be validated. 4. Replace guidance strings in search-quality.ts that still directed agents to the removed get_component_usage tool. Both instances now point to get_symbol_references, which covers the same use case. 5. Add fallback decision card when intelligence.json is absent in search-codebase.ts. Previously, preflight would silently skip when intelligence was missing, leaving users without guidance. Now returns ready=false with actionable nextAction message. All changes verified: - Zero references to get_component_usage in src/ and tests/ - Index-versioning-migration test passes (5/5) - Full test suite: 231/234 passing (3 pre-existing timeouts)
PatrickSys
added a commit
that referenced
this pull request
Feb 22, 2026
* fix: close v1.8 post-merge integration gaps Addresses 5 live code gaps left after PRs #39 and #40 merged: 1. Delete orphaned get-component-usage source file (already removed from dispatcher in PR #39, but file remained on disk causing confusion) 2. Remove 'get_component_usage' from INDEX_CONSUMING_TOOL_NAMES allowlist in src/index.ts. The dispatcher no longer routes to this tool, so the allowlist entry created a phantom entry that would be validated during test runs despite not being available. 3. Remove get_component_usage branch from args dispatch ternary in index-versioning-migration test. Now that the tool is removed, this branch is dead code and should not be validated. 4. Replace guidance strings in search-quality.ts that still directed agents to the removed get_component_usage tool. Both instances now point to get_symbol_references, which covers the same use case. 5. Add fallback decision card when intelligence.json is absent in search-codebase.ts. Previously, preflight would silently skip when intelligence was missing, leaving users without guidance. Now returns ready=false with actionable nextAction message. All changes verified: - Zero references to get_component_usage in src/ and tests/ - Index-versioning-migration test passes (5/5) - Full test suite: 231/234 passing (3 pre-existing timeouts) * Fix formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleaned up the edit decision card and sharpened search ranking for symbol queries.
When searching for a specific symbol (like a class name), the file that defines it now ranks above files that just import it. Snippets include a scope header so you see context at a glance. And the preflight response for edit intent is now lean and actionable —
ready,nextAction, patterns to follow/avoid, caller coverage so you know which files you haven't looked at yet, and concrete next steps inwhatWouldHelpwhen you need more evidence.Removed the internal fields that used to leak (evidenceLock, riskLevel, confidence, intent, circularDependencies). The decision card is stable by design.
Changes
Search ranking (SEARCH-01):
Smart snippets (SEARCH-02):
includeSnippets: true, code chunks include a scope header comment (// ClassName.methodName) before the snippetClean decision card (PREF-01 to PREF-04):
{ ready, nextAction?, warnings?, patterns?, bestExample?, impact?, whatWouldHelp? }ready: boolean, whether evidence is sufficient to editnextAction: why evidence is thin (only when ready=false)warnings: failure memories (capped at 3)patterns: do/avoid patterns with adoption %, capped at 3 eachbestExample: top 1 golden file for the areaimpact: caller coverage ("X/Y callers in results") + top 3 files importing the resultswhatWouldHelp: concrete next steps when ready=false (max 4 items)Impact coverage (PREF-02):
whatWouldHelp recommendations (PREF-03):
Documentation
Testing
Guardrails
✅ TypeScript compilation passes
✅ Tests pass (219 passing)
✅ Preflight output is clean (no evidenceLock, riskLevel, confidence)
✅ ready is always present as boolean
✅ whatWouldHelp appears when ready=false
✅ Snippets include scope headers when metadata available
✅ Docs match actual output