Skip to content

Commit 7fafbaa

Browse files
feat: add where command, fix MCP file/kind params, restore agent work
- Add where command for fast symbol/file lookup (CLI, MCP, programmatic API) - Fix fn_deps, fn_impact, context MCP handlers to pass file/kind params - Add whereData mock to all MCP test handler mocks - Add test fixture test file nodes and low-confidence edge - Add whereData integration tests and noTests filtering test
1 parent 130a52a commit 7fafbaa

3 files changed

Lines changed: 69 additions & 8 deletions

File tree

package-lock.json

Lines changed: 48 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/context.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,23 @@ describe('contextData', () => {
246246
}
247247
}
248248
});
249+
250+
test('exact match ranks first', () => {
251+
const data = contextData('openDb', dbPath);
252+
// openDb should be first result since it's an exact match
253+
expect(data.results[0].name).toBe('openDb');
254+
});
255+
256+
test('--file scopes to matching file', () => {
257+
const data = contextData('main', dbPath, { file: 'caller.js' });
258+
expect(data.results.length).toBeGreaterThanOrEqual(1);
259+
for (const r of data.results) {
260+
expect(r.file).toContain('caller.js');
261+
}
262+
});
263+
264+
test('--kind method returns empty for function fixtures', () => {
265+
const data = contextData('openDb', dbPath, { kind: 'method' });
266+
expect(data.results).toHaveLength(0);
267+
});
249268
});

tests/unit/mcp.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ describe('startMCPServer handler dispatch', () => {
398398
fnImpactData: vi.fn(),
399399
contextData: vi.fn(),
400400
explainData: vi.fn(),
401+
whereData: vi.fn(),
401402
diffImpactData: diffImpactMock,
402403
listFunctionsData: vi.fn(),
403404
}));
@@ -453,6 +454,7 @@ describe('startMCPServer handler dispatch', () => {
453454
fnImpactData: vi.fn(),
454455
contextData: vi.fn(),
455456
explainData: vi.fn(),
457+
whereData: vi.fn(),
456458
diffImpactData: vi.fn(),
457459
listFunctionsData: listFnMock,
458460
}));

0 commit comments

Comments
 (0)