Skip to content

Commit 033eca2

Browse files
committed
docs: add v0.8.5 release notes and update changeset
- Add v0.8.5 changelog entry to website - Update latest-version.ts with new release info - Update tools index with v0.8.5 marker - Update changeset to use patch bumps for all packages - Fix all v0.9.0 references to v0.8.5 - Document pattern analysis features and performance improvements
1 parent 957aa17 commit 033eca2

File tree

22 files changed

+505
-322
lines changed

22 files changed

+505
-322
lines changed
Lines changed: 69 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,87 @@
11
---
2+
"@lytics/dev-agent-core": patch
23
"@lytics/dev-agent-mcp": patch
34
"@lytics/dev-agent": patch
45
"@lytics/dev-agent-cli": patch
56
---
67

7-
Refactor: Rename dev_explore → dev_inspect with focused actions
8+
feat(mcp): refactor dev_inspect and optimize pattern analysis
89

9-
**BREAKING CHANGES:**
10+
**API Simplification:**
1011

11-
- `dev_explore` renamed to `dev_inspect`
12-
- Actions changed from `['pattern', 'similar', 'relationships']` to `['compare', 'validate']`
13-
- Removed `action: "pattern"` → Use `dev_search` instead
14-
- Removed `action: "relationships"` → Use `dev_refs` instead
15-
- Renamed `action: "similar"``action: "compare"`
12+
- `dev_inspect` simplified to single-purpose tool (action parameter streamlined)
13+
- Previously: `dev_inspect({ action: "compare", query: "file.ts" })`
14+
- Now: `dev_inspect({ query: "file.ts" })`
15+
- Existing usage continues to work with dynamic MCP schema discovery
1616

17-
**What's New:**
17+
**Major Features:**
1818

19-
- `dev_inspect` with `action: "compare"` finds similar code implementations
20-
- `dev_inspect` with `action: "validate"` checks pattern consistency (placeholder for future)
21-
- Clearer tool boundaries: search vs. inspect vs. refs
22-
- File-focused analysis (always takes file path, not search query)
19+
- Created `PatternAnalysisService` with 5 pattern extractors:
20+
- Import style (ESM, CJS, mixed, unknown)
21+
- Error handling (throw, result, callback, unknown)
22+
- Type coverage (full, partial, none)
23+
- Testing (co-located test files)
24+
- File size (lines vs similar files)
25+
- Batch scanning optimization (5-10x faster: 500-1000ms vs 2-3 seconds)
26+
- Embedding-based similarity search (no more false matches)
27+
- Extension filtering (`.ts` only compares with `.ts`)
28+
- Comprehensive pattern analysis (finds similar files + analyzes patterns)
29+
30+
**Performance:**
31+
32+
- One ts-morph initialization vs 6 separate scans
33+
- Batch scan all files in one pass
34+
- `searchByDocumentId()` for embedding-based similarity
35+
- Pattern analysis: 500-1000ms (down from 2-3 seconds)
36+
37+
**Bug Fixes:**
38+
39+
- Fixed `findSimilar` to use document embeddings instead of file paths
40+
- Fixed `--force` flag to properly clear old vector data
41+
- Fixed race condition in LanceDB table creation
42+
- Removed `outputSchema` from all 9 MCP adapters (Cursor/Claude compatibility)
43+
44+
**New Features:**
45+
46+
- Test utilities in `@lytics/dev-agent-core/utils`:
47+
- `isTestFile()` — Check if file is a test file
48+
- `findTestFile()` — Find co-located test files
49+
- Vector store `clear()` method
50+
- Vector store `searchByDocumentId()` method
51+
- Comprehensive pattern comparison with statistical analysis
2352

2453
**Migration Guide:**
2554

2655
```typescript
27-
// Before
28-
dev_explore { action: "similar", query: "src/auth.ts" }
29-
dev_explore { action: "pattern", query: "error handling" }
30-
dev_explore { action: "relationships", query: "src/auth.ts" }
31-
32-
// After
33-
dev_inspect { action: "compare", query: "src/auth.ts" }
34-
dev_search { query: "error handling" }
35-
dev_refs { name: "authenticateUser" }
56+
// Before (v0.8.4)
57+
dev_inspect({ action: "compare", query: "src/auth.ts" })
58+
dev_inspect({ action: "validate", query: "src/auth.ts" })
59+
60+
// After (v0.8.5) - Streamlined!
61+
dev_inspect({ query: "src/auth.ts" })
3662
```
3763

38-
**Why:**
64+
The tool now automatically finds similar files AND performs pattern analysis. No migration needed - MCP tools discover the new schema dynamically.
65+
66+
**Re-index Recommended:**
67+
68+
```bash
69+
dev index . --force
70+
```
71+
72+
This clears old data and rebuilds with improved embedding-based search.
73+
74+
**Documentation:**
75+
76+
- Complete rewrite of dev-inspect.mdx
77+
- Updated README.md with pattern categories
78+
- Updated CLAUDE.md with new descriptions
79+
- Added v0.8.5 changelog entry to website
80+
- Migration guide from dev_explore
3981

40-
- Eliminate tool duplication (`pattern` duplicated `dev_search`)
41-
- Clear single responsibility (file analysis only)
42-
- Better naming (`inspect` = deep file examination)
43-
- Reserve `dev_explore` for future external context (standards, examples, docs)
82+
**Tests:**
4483

84+
- All 1100+ tests passing
85+
- Added 10 new test-utils tests
86+
- Pattern analysis service fully tested
87+
- Integration tests for InspectAdapter

packages/cli/tsconfig.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,5 @@
1515
{ "path": "../logger" }
1616
],
1717
"include": ["src/**/*"],
18-
"exclude": [
19-
"node_modules",
20-
"dist",
21-
"**/*.test.ts",
22-
"**/*.spec.ts",
23-
"**/__tests__/**"
24-
]
18+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts", "**/__tests__/**"]
2519
}

packages/core/src/services/__fixtures__/modern-typescript.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
* - Explicit return types
99
*/
1010

11-
import { v4 as uuidv4 } from 'uuid';
11+
// Mock uuid for fixture purposes (not a real dependency)
12+
const uuidv4 = () => '00000000-0000-0000-0000-000000000000';
13+
1214
import type { User, ValidationError } from './types';
1315

1416
export type Result<T, E = Error> = { ok: true; value: T } | { ok: false; error: E };

packages/core/src/services/__tests__/search-service.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ describe('SearchService', () => {
139139

140140
const mockIndexer: RepositoryIndexer = {
141141
initialize: vi.fn().mockResolvedValue(undefined),
142-
search: vi
143-
.fn()
144-
.mockResolvedValueOnce([targetFile]) // First call to find the file
145-
.mockResolvedValueOnce(similarResults), // Second call to find similar
142+
getAll: vi.fn().mockResolvedValue([targetFile, ...similarResults]),
143+
searchByDocumentId: vi.fn().mockResolvedValue([targetFile, ...similarResults]),
146144
close: vi.fn().mockResolvedValue(undefined),
147145
} as unknown as RepositoryIndexer;
148146

@@ -154,15 +152,16 @@ describe('SearchService', () => {
154152
threshold: 0.8,
155153
});
156154

157-
expect(mockIndexer.search).toHaveBeenCalledTimes(2);
155+
expect(mockIndexer.getAll).toHaveBeenCalledOnce();
156+
expect(mockIndexer.searchByDocumentId).toHaveBeenCalledOnce();
158157
expect(results).toHaveLength(2); // Should exclude the original file
159158
expect(results.find((r) => r.metadata.path === 'src/payments/process.ts')).toBeUndefined();
160159
});
161160

162161
it('should return empty array when file not found', async () => {
163162
const mockIndexer: RepositoryIndexer = {
164163
initialize: vi.fn().mockResolvedValue(undefined),
165-
search: vi.fn().mockResolvedValue([]), // File not found
164+
getAll: vi.fn().mockResolvedValue([]), // File not found
166165
close: vi.fn().mockResolvedValue(undefined),
167166
} as unknown as RepositoryIndexer;
168167

packages/core/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
"**/__tests__/**",
1818
"**/__fixtures__/**"
1919
],
20-
"references": [
21-
{ "path": "../logger" },
22-
{ "path": "../types" }
23-
]
20+
"references": [{ "path": "../logger" }, { "path": "../types" }]
2421
}

packages/mcp-server/src/adapters/__tests__/github-adapter.test.ts

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import type { GitHubService } from '@lytics/dev-agent-core';
66
import type { GitHubDocument, GitHubSearchResult } from '@lytics/dev-agent-subagents';
77
import { beforeEach, describe, expect, it, vi } from 'vitest';
8-
import type { GitHubOutput } from '../../schemas/index.js';
98
import { GitHubAdapter } from '../built-in/github-adapter';
109
import type { ToolExecutionContext } from '../types';
1110

@@ -186,9 +185,9 @@ describe('GitHubAdapter', () => {
186185
);
187186

188187
expect(result.success).toBe(true);
189-
expect((result.data as GitHubOutput)?.content).toContain('GitHub Search Results');
190-
expect((result.data as GitHubOutput)?.content).toContain('#1');
191-
expect((result.data as GitHubOutput)?.content).toContain('Test Issue');
188+
expect(result.data).toContain('GitHub Search Results');
189+
expect(result.data).toContain('#1');
190+
expect(result.data).toContain('Test Issue');
192191
});
193192

194193
it('should search with filters', async () => {
@@ -236,7 +235,7 @@ describe('GitHubAdapter', () => {
236235
);
237236

238237
expect(result.success).toBe(true);
239-
expect((result.data as GitHubOutput)?.content).toContain('No matching issues or PRs found');
238+
expect(result.data).toContain('No matching issues or PRs found');
240239
});
241240

242241
it('should include token footer in search results', async () => {
@@ -260,7 +259,7 @@ describe('GitHubAdapter', () => {
260259
);
261260

262261
expect(result.success).toBe(true);
263-
const content = (result.data as GitHubOutput)?.content;
262+
const content = result.data;
264263
expect(content).toBeDefined();
265264
// Token info is now in metadata, not content
266265
expect(result.metadata).toHaveProperty('tokens');
@@ -283,9 +282,9 @@ describe('GitHubAdapter', () => {
283282
);
284283

285284
expect(result.success).toBe(true);
286-
expect((result.data as GitHubOutput)?.content).toContain('Issue #1');
287-
expect((result.data as GitHubOutput)?.content).toContain('Test Issue');
288-
expect((result.data as GitHubOutput)?.content).toContain('testuser');
285+
expect(result.data).toContain('Issue #1');
286+
expect(result.data).toContain('Test Issue');
287+
expect(result.data).toContain('testuser');
289288
});
290289

291290
it('should get issue context in verbose format', async () => {
@@ -302,10 +301,10 @@ describe('GitHubAdapter', () => {
302301
);
303302

304303
expect(result.success).toBe(true);
305-
expect((result.data as GitHubOutput)?.content).toContain('**Related Issues:** #2, #3');
306-
expect((result.data as GitHubOutput)?.content).toContain('**Related PRs:** #10');
307-
expect((result.data as GitHubOutput)?.content).toContain('**Linked Files:** `src/test.ts`');
308-
expect((result.data as GitHubOutput)?.content).toContain('**Mentions:** @developer1');
304+
expect(result.data).toContain('**Related Issues:** #2, #3');
305+
expect(result.data).toContain('**Related PRs:** #10');
306+
expect(result.data).toContain('**Linked Files:** `src/test.ts`');
307+
expect(result.data).toContain('**Mentions:** @developer1');
309308
});
310309

311310
it('should handle issue not found', async () => {
@@ -357,9 +356,9 @@ describe('GitHubAdapter', () => {
357356
);
358357

359358
expect(result.success).toBe(true);
360-
expect((result.data as GitHubOutput)?.content).toContain('Related Issues/PRs');
361-
expect((result.data as GitHubOutput)?.content).toContain('#2');
362-
expect((result.data as GitHubOutput)?.content).toContain('Related Issue');
359+
expect(result.data).toContain('Related Issues/PRs');
360+
expect(result.data).toContain('#2');
361+
expect(result.data).toContain('Related Issue');
363362
});
364363

365364
it('should handle no related items', async () => {
@@ -378,7 +377,7 @@ describe('GitHubAdapter', () => {
378377
);
379378

380379
expect(result.success).toBe(true);
381-
expect((result.data as GitHubOutput)?.content).toContain('No related issues or PRs found');
380+
expect(result.data).toContain('No related issues or PRs found');
382381
});
383382
});
384383

@@ -411,12 +410,11 @@ describe('GitHubAdapter', () => {
411410

412411
expect(result.success).toBe(true);
413412
if (result.success) {
414-
const output = result.data as GitHubOutput;
415-
expect(output.content).toContain('Related Issue 1');
416-
expect(output.content).toContain('Related Issue 2');
417-
expect(output.content).toContain('90% similar'); // Score shown as percentage
418-
expect(output.resultsTotal).toBe(2);
419-
expect(output.resultsReturned).toBe(2);
413+
expect(result.data).toContain('Related Issue 1');
414+
expect(result.data).toContain('Related Issue 2');
415+
expect(result.data).toContain('90% similar'); // Score shown as percentage
416+
expect(result.metadata?.results_total).toBe(2);
417+
expect(result.metadata?.results_returned).toBe(2);
420418
}
421419

422420
expect(mockGitHubService.getContext).toHaveBeenCalledWith(1);
@@ -437,8 +435,7 @@ describe('GitHubAdapter', () => {
437435

438436
expect(result.success).toBe(true);
439437
if (result.success) {
440-
const output = result.data as GitHubOutput;
441-
expect(output.content).toContain('No related issues or PRs found');
438+
expect(result.data).toContain('No related issues or PRs found');
442439
}
443440
});
444441
});

0 commit comments

Comments
 (0)