Skip to content

Commit ba81735

Browse files
committed
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)
1 parent 22bccc1 commit ba81735

File tree

7 files changed

+23
-126
lines changed

7 files changed

+23
-126
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
- Null-pointer crash in GenericAnalyzer when chunk content is undefined.
6464
- Tree-sitter symbol extraction now treats node offsets as UTF-8 byte ranges and evicts cached parsers on failures/timeouts.
65+
- **Post-merge integration gaps** (v1.8 audit): Removed orphaned `get_component_usage` source file, deleted phantom allowlist entry, removed dead guidance strings referencing the deleted tool. Added fallback decision card when `intelligence.json` is absent during edit-intent searches, now returns `ready: false` with actionable guidance instead of silently skipping.
6566

6667
## [1.6.2] - 2026-02-17
6768

internal-docs

src/core/search-quality.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function assessSearchQuality(
3030
nextSteps: [
3131
'Try a narrower query with one concrete symbol, route, or file hint.',
3232
'Apply search filters (framework/language/componentType/layer).',
33-
'Use get_component_usage for dependency or wiring lookups.'
33+
'Use get_symbol_references to find where a specific symbol is used across the codebase.'
3434
]
3535
};
3636
}
@@ -76,7 +76,7 @@ export function assessSearchQuality(
7676
nextSteps: [
7777
'Add one or two concrete symbols, routes, or file hints to the query.',
7878
'Apply filters (framework/language/componentType/layer) to narrow candidates.',
79-
'Use get_component_usage when the question is about wiring or usages.'
79+
'Use get_symbol_references when the question is about where a symbol or function is used.'
8080
]
8181
})
8282
};

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ const LEGACY_PATHS = {
8484
export const INDEX_CONSUMING_TOOL_NAMES = [
8585
'search_codebase',
8686
'get_symbol_references',
87-
'get_component_usage',
8887
'detect_circular_dependencies',
8988
'get_team_patterns',
9089
'get_codebase_metadata'

src/tools/get-component-usage.ts

Lines changed: 0 additions & 108 deletions
This file was deleted.

src/tools/search-codebase.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,18 @@ export async function handle(
439439
// Compose preflight card for edit/refactor/migrate intents
440440
let preflight: any = undefined;
441441
const preflightIntents = ['edit', 'refactor', 'migrate'];
442-
if (intent && preflightIntents.includes(intent) && intelligence) {
443-
try {
444-
// --- Avoid / Prefer patterns ---
445-
const avoidPatternsList: any[] = [];
446-
const preferredPatternsList: any[] = [];
447-
const patterns = intelligence.patterns || {};
442+
if (intent && preflightIntents.includes(intent)) {
443+
if (!intelligence) {
444+
preflight = {
445+
ready: false,
446+
nextAction: 'Run a full index rebuild to generate pattern intelligence before editing.'
447+
};
448+
} else {
449+
try {
450+
// --- Avoid / Prefer patterns ---
451+
const avoidPatternsList: any[] = [];
452+
const preferredPatternsList: any[] = [];
453+
const patterns = intelligence.patterns || {};
448454
for (const [category, data] of Object.entries<any>(patterns)) {
449455
// Primary pattern = preferred if Rising or Stable
450456
if (data.primary) {
@@ -658,8 +664,9 @@ export async function handle(
658664
}
659665

660666
preflight = decisionCard;
661-
} catch {
662-
// Preflight construction failed — skip preflight, don't fail the search
667+
} catch {
668+
// Preflight construction failed — skip preflight, don't fail the search
669+
}
663670
}
664671
}
665672

tests/index-versioning-migration.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,11 @@ describe('index-consuming allowlist enforcement', () => {
461461
? { query: 'test' }
462462
: toolName === 'get_symbol_references'
463463
? { symbol: 'alpha' }
464-
: toolName === 'get_component_usage'
465-
? { name: 'x' }
466-
: toolName === 'detect_circular_dependencies'
464+
: toolName === 'detect_circular_dependencies'
465+
? {}
466+
: toolName === 'get_team_patterns'
467467
? {}
468-
: toolName === 'get_team_patterns'
469-
? {}
470-
: {}
468+
: {}
471469
}
472470
});
473471

0 commit comments

Comments
 (0)