universal-ast-mapper 1.28.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/BLUEPRINT.md +230 -230
  2. package/CHANGELOG.md +466 -338
  3. package/README.md +878 -878
  4. package/package.json +48 -47
  5. package/scripts/install-skill.mjs +187 -187
  6. package/dist/analysis.js +0 -134
  7. package/dist/callgraph.js +0 -467
  8. package/dist/check.js +0 -112
  9. package/dist/cli.js +0 -1275
  10. package/dist/complexity.js +0 -98
  11. package/dist/config.js +0 -53
  12. package/dist/contextpack.js +0 -79
  13. package/dist/coupling.js +0 -35
  14. package/dist/crosslang.js +0 -425
  15. package/dist/diskcache.js +0 -97
  16. package/dist/explorer.js +0 -123
  17. package/dist/extractors/c.js +0 -204
  18. package/dist/extractors/common.js +0 -56
  19. package/dist/extractors/cpp.js +0 -272
  20. package/dist/extractors/csharp.js +0 -209
  21. package/dist/extractors/go.js +0 -212
  22. package/dist/extractors/java.js +0 -152
  23. package/dist/extractors/kotlin.js +0 -159
  24. package/dist/extractors/php.js +0 -208
  25. package/dist/extractors/python.js +0 -153
  26. package/dist/extractors/ruby.js +0 -146
  27. package/dist/extractors/rust.js +0 -249
  28. package/dist/extractors/swift.js +0 -192
  29. package/dist/extractors/typescript.js +0 -577
  30. package/dist/gitdiff.js +0 -178
  31. package/dist/graph-analysis.js +0 -279
  32. package/dist/graph.js +0 -165
  33. package/dist/html.js +0 -326
  34. package/dist/index.js +0 -1408
  35. package/dist/layers.js +0 -36
  36. package/dist/modulecoupling.js +0 -0
  37. package/dist/parser.js +0 -84
  38. package/dist/pool.js +0 -114
  39. package/dist/prompts.js +0 -67
  40. package/dist/registry.js +0 -87
  41. package/dist/report.js +0 -232
  42. package/dist/resolver.js +0 -222
  43. package/dist/roots.js +0 -47
  44. package/dist/search.js +0 -68
  45. package/dist/semantic.js +0 -365
  46. package/dist/sfc.js +0 -27
  47. package/dist/skeleton.js +0 -132
  48. package/dist/sourcemap.js +0 -60
  49. package/dist/testmap.js +0 -167
  50. package/dist/tsconfig.js +0 -212
  51. package/dist/typeflow.js +0 -124
  52. package/dist/types.js +0 -5
  53. package/dist/unused-params.js +0 -127
  54. package/dist/worker.js +0 -27
  55. package/dist/workspace.js +0 -330
package/CHANGELOG.md CHANGED
@@ -1,338 +1,466 @@
1
- # Changelog
2
-
3
- All notable changes to **universal-ast-mapper** (AST-MCP). Format based on
4
- [Keep a Changelog](https://keepachangelog.com/); this project follows semver and,
5
- since 1.0.0, guarantees a stable MCP tool / CLI surface across the 1.x line.
6
-
7
- ---
8
-
9
- ## [1.28.0] — 2026-06-11 · Test coverage in the dashboard
10
- - The health dashboard (`ast-map report` / `get_codebase_report`) now surfaces
11
- v1.27's structural test coverage:
12
- - **Test coverage card** coverage bar (tested/total sources, % colored
13
- green ≥ 70 / amber ≥ 40 / red below) + the **untested sources ranked by
14
- risk** (fan-in Ca, then symbol count), capped at 12 with a "+N more" note.
15
- - **Test coverage stat tile** in the header grid.
16
- - **Root fallback**reporting on `src/` only (no test files in the scanned
17
- dir)? Test files are pulled in from the project root automatically and the
18
- card notes "(from project root)".
19
- - **Health score** now includes a structural-coverage penalty (capped at 8
20
- points, proportional to the untested share).
21
- - `ReportData` gains `testCoverage` (testFiles, sourceFiles, testedSources,
22
- coverageRatio, untestedCount, untested[], rootFallback) — additive.
23
- - CLI `ast-map report` summary line now shows `tests N%`.
24
- - Tests: +6 checks in `test/analysis.mjs` (159 total).
25
-
26
- ## [1.27.0] 2026-06-11 · Test-coverage mapping
27
- - **New MCP tool `get_test_coverage`** + **CLI `ast-map tests [dir]`** (alias
28
- `coverage`)structural test coverage with zero instrumentation: which source
29
- files have tests at all, and which have **none**.
30
- - Two pairing signals:
31
- - **import** — a test file imports the source file (graph edge; definitive).
32
- - **name**conventions: `auth.test.ts` `auth.ts`, `auth_test.go`,
33
- `test_utils.py` `utils.py`, `AuthTest.java` `Auth.java`,
34
- `foo-smoke.mjs` `foo.*`, and bare `test/<name>.*` `<name>.*`;
35
- ambiguity resolved by longest shared path prefix.
36
- - Test files detected by directory (`test/`, `tests/`, `__tests__/`, `spec/`, `e2e/`)
37
- or basename pattern; **fixtures/mocks/testdata dirs excluded from both sides**.
38
- - Output: coverage ratio, test→source `links` (with `via`), `tested`,
39
- **`untested` ranked by risk** (fan-in Ca, then symbol count — load-bearing
40
- files with no tests first), and `orphanTests` (no source matched; usually
41
- integration/e2e).
42
- - CLI: `-u/--untested`, `--links`, `-n/--top`, `--json`.
43
- - New module `testmap` (`mapTestCoverage`, `isTestFile`, `testNameTarget`,
44
- `isFixtureFile`) + `test/fixtures/testmap/` fixture tree. Tests: +9 checks
45
- in `test/analysis.mjs` (153 total). **30 MCP tools / 32 CLI commands.**
46
-
47
- ## [1.26.0] — 2026-06-11 · Coupling overlay in the explorer
48
- - **`ast-map explore` color modes** — new toolbar dropdown: `color: folder`
49
- (existing per-directory hues) or **`color: coupling`** nodes shaded by
50
- **instability** I = Ce/(Ca+Ce) on a green (0, stable) → yellow → red
51
- (1, volatile) scale; orphan files stay gray.
52
- - **Legend** (bottom-left, shown in coupling mode) explains the scale; the hover
53
- tooltip and the detail sidebar now show **Ca / Ce / I** per file.
54
- - Explorer nodes carry `ca` / `ce` / `inst` computed from the deduped file-level
55
- import edgessame definition as `get_coupling` (Robert C. Martin metrics).
56
- - Still a single self-contained HTML file, dark-mode aware, zero dependencies.
57
- - Tests: +5 checks in `test/analysis.mjs` (144 total).
58
-
59
- ## [1.25.0] 2026-06-11 · Semantic symbol search
60
- - **New MCP tool `semantic_search`** + **CLI `ast-map find <query> [dir]`** — find
61
- symbols by *meaning*, not exact name: "remove expired cache entries" →
62
- `clearDiskCache`, "find unused exported code" `findDeadExports`.
63
- - Pure lexical semantics **no embeddings, no network, no model downloads**:
64
- - **Identifier tokenization**: camelCase / PascalCase / snake_case / kebab-case /
65
- digit and acronym boundaries (`getHTTPServerByID` → `get http server by id`).
66
- - **Programming thesaurus**: 60 synonym groups (`fetch≈get≈load≈retrieve`,
67
- `remove≈delete≈clear`, `unused≈dead`, `auth≈login≈session`, …).
68
- - **Light stemming** (plural/gerund/past: `users`→`user`) + **fuzzy matching**
69
- (edit distance 1 on tokens 4 chars).
70
- - **BM25-style ranking**: corpus IDF (rare tokens weigh more), field weights
71
- (name > doc > signature 1.5× > path/kind 1×), match-type weights
72
- (direct > synonym > fuzzy), coverage bonus, and length normalization so
73
- focused names (`login`) outrank composites (`handleLogin`).
74
- - Results include a normalized `score` (0–1) and `matchedTerms` explaining each hit
75
- (`unused≈dead` = synonym, `cach~cache` = fuzzy).
76
- - Options: `limit` (default 20), `kind` filter, `exportedOnly`.
77
- - New module `semantic` (`semanticSearch`, `splitIdentifier`, `stem`). Tests: +8
78
- checks in `test/analysis.mjs` (139 total). **29 MCP tools / 31 CLI commands.**
79
-
80
- ## [1.24.0] 2026-06-10 · TS path-alias resolution
81
- - Bare imports like `@/components/Button` now resolve through **`tsconfig.json` /
82
- `jsconfig.json` `compilerOptions.paths`** (+ `baseUrl`): nearest-config lookup above
83
- the importing file (monorepo-safe, per-process cached), relative `extends` chains
84
- (child `paths` replace the parent's, per TS semantics), longest-prefix pattern
85
- matching, candidate probing with the usual extension/index logic.
86
- - **String-aware JSONC parser** comments/trailing commas are stripped with a
87
- character walk, not regex (naive stripping corrupts Next.js configs where `"@/*"`
88
- pairs with the `*/` inside `"**/*.ts"` include globs).
89
- - Wired into `resolve_imports` (aliased imports report `importKind: "relative"` +
90
- resolved file), `build_symbol_graph` (alias edges before workspace-package fallback),
91
- and the call graph (callee origin + reverse `calledBy`).
92
- - Real-world effect (Next.js app, 186 files): import graph 31 **324 edges**;
93
- dead exports 210 153; god nodes now reflect true usage.
94
- - New module `tsconfig` (`aliasCandidates`, `clearAliasCaches`) + `resolveAliasedImport`
95
- in the resolver. Tests: new `test/tsalias-smoke.mjs` (15 checks), wired into `npm test`.
96
-
97
- ## [1.23.0]2026-06-10 · Configurable root boundary (multi-root + unlocked)
98
- - **`AST_MAP_ROOT` accepts multiple roots**, separated by the OS path delimiter
99
- (`;` Windows / `:` POSIX). The first root is primary; absolute paths inside any
100
- listed root are allowed.
101
- - **`AST_MAP_UNLOCKED=1`** opt-in: the MCP server analyzes **any existing absolute
102
- path** the client asks for. Default behavior is unchanged (locked to the root list).
103
- - Every tool now computes rel-paths and graph roots against the **matched** root, so
104
- reports/graphs on outside-root projects come out correct.
105
- - Clearer boundary error message (suggests both escape hatches).
106
- - New module `roots` (`parseRootsFromEnv`, `resolvePathInRoots`); CLI shares the parser.
107
- - Tests: new `test/roots-smoke.mjs` (13 checks) + end-to-end verified over MCP stdio
108
- (locked rejects / unlocked analyzes an outside project).
109
-
110
- ## [1.22.1] — 2026-06-10 · Docs
111
- - README refreshed to match v1.20–1.22: 28 tools / 30 commands, PHP+Ruby capability
112
- columns, `cache`/`check` CLI + config + env-var docs, `check_quality_gate` reference,
113
- Action `mode: check` example, new Performance section. No code changes.
114
-
115
- ## [1.22.0] — 2026-06-10 · PHP & Ruby support
116
- - **PHP** (`.php`): classes/interfaces/traits/enums, methods with visibility modifiers,
117
- class consts + properties, namespaces; imports from `use` (incl. grouped `use A\{B, C}`
118
- and aliases) and `require`/`include` (side-effect).
119
- - **Ruby** (`.rb`, `.rake`): classes, modules (→ namespace), methods, `self.` singleton
120
- methods, constants; **section-style visibility** (`private`/`protected`/`public`);
121
- imports from `require` / `require_relative`.
122
- - **web-tree-sitter 0.20.8 0.21.0** unblocks the Ruby grammar (external-scanner
123
- crash on the old runtime); no API change, all grammars + suites re-verified.
124
- - Tests: `Sample.php` + `sample.rb` fixtures, 30 new smoke assertions. **16 languages.**
125
-
126
- ## [1.21.0]2026-06-10 · Quality gate (`ast-map check`)
127
- - **`ast-map check [dir]`** CI quality gate with two mechanisms: a **baseline ratchet**
128
- (vs a committed `.ast-map.baseline.json`; fails when cycles, dead exports, SDP violations,
129
- very-high-complexity functions rise or the health score drops; `--update-baseline`
130
- re-anchors) and **absolute thresholds** (CLI flags or `.ast-map.config.json` `"check"`).
131
- Non-zero exit on failure; `--json` for tooling.
132
- - New MCP tool **`check_quality_gate`** (28 tools) — same gate for agents.
133
- - **GitHub Action**: `mode: validate | check | both` + `check-args` inputs.
134
- - New module `check` (`runQualityGate`, `metricsFromReport`); `AstMapConfig.check`.
135
- - Tests: new `test/check-smoke.mjs` (13 checks), wired into `npm test`.
136
-
137
- ## [1.20.0] — 2026-06-10 · Incremental cache + parallel parsing
138
- - **Persistent parse cache**: skeletons are cached on disk under `<root>/.ast-map/cache`,
139
- keyed by content hash + detail + schema/grammar versions — never stale by construction,
140
- survives across processes (warm hits on large files ~60× faster than a re-parse).
141
- On by default; disable with `AST_MAP_NO_CACHE=1` or `"cache": false` in config.
142
- - **Parallel parsing**: bulk scans distribute work over a worker-thread pool
143
- (auto-sized, engages at 64 files, `AST_MAP_WORKERS` override, sequential fallback
144
- on any worker failure). `report` computes per-file complexity in the workers too.
145
- - New CLI command `ast-map cache [stats|clear]`.
146
- - New modules `diskcache` and `pool` (`buildSkeletonsBulk`); `AstMapConfig.cache`.
147
- - Tests: new `test/cache-smoke.mjs` (18 checks), wired into `npm test`.
148
-
149
- ## [1.19.0] 2026-06-09 · Dashboard: coupling + SDP
150
- - The health dashboard (`ast-map report` / `get_codebase_report`) now surfaces the
151
- v1.14–1.16 architecture metrics: a **Module coupling** card (per-directory instability
152
- bars with Ca/Ce) and a **Layer violations** card (stable→volatile SDP inversions),
153
- plus an **SDP violations** stat tile.
154
- - SDP violations now factor into the health score (small capped penalty), so a codebase
155
- that systematically depends "uphill" on the stability gradient scores lower.
156
- - `ReportData` gains `layerViolations` and `modules`; purely additive.
157
- - Tests: 4 new assertions (131 total) — report carries the new data and the HTML renders
158
- both cards.
159
-
160
- ## [1.18.0]2026-06-09 · Vue & Svelte SFC support
161
- - `.vue` and `.svelte` **single-file components** are now first-class inputs. The
162
- `<script>` / `<script setup>` block is lifted out and parsed with the TS/JS extractor
163
- (grammar chosen from `lang="ts"`), so component symbols and imports are extracted and
164
- wired into the dependency graph including edges from a component into a plain `.ts`
165
- module, and into other components.
166
- - Offsets are preserved: everything outside the script is blank-padded, so every symbol
167
- range still points at the exact line/column in the original SFC.
168
- - New languages `vue` and `svelte` (extensions `.vue`, `.svelte`); resolver now resolves
169
- imports of `.vue` / `.svelte` files. **14 languages.**
170
- - Tests: 8 new assertions (127 total) + Vue/Svelte fixtures — symbol extraction, import
171
- capture, and cross-file graph edges for both.
172
-
173
- ## [1.17.0] 2026-06-09 · MCP prompts
174
- - The server now registers **MCP prompts** — named, parameterized workflows a client
175
- can invoke from its prompt/slash menu, each returning a ready-to-run instruction that
176
- chains the right tools: `architecture_audit` (dir?), `safe_refactor` (file, symbol),
177
- `dead_code_cleanup` (dir?), `health_check` (dir?), `onboard_codebase` (dir?).
178
- - The Cookbook recipes become first-class, discoverable, and one call away — no pasting.
179
- - New `test/prompts-smoke.mjs` (12 checks): `prompts/list` returns all 5, argument
180
- interpolation works, and rendered prompts reference real tools. Wired into CI.
181
-
182
- ## [1.16.0] 2026-06-09 · Module coupling
183
- - **`get_module_coupling`** + **`ast-map modules`** (alias `mods`): aggregates the
184
- file-level import graph up to the **directory/module level** per-module afferent
185
- (Ca) / efferent (Ce) coupling and instability, plus the weighted inter-module edges.
186
- Intra-module imports (files importing siblings in the same directory) are ignored;
187
- only cross-module dependencies count. The architectural view above per-file coupling.
188
- - Tests: 5 new assertions (119 total) a three-module ui→api→core gradient with the
189
- expected stability ordering and edge count.
190
-
191
- ## [1.15.0]2026-06-09 · Layer-violation detection
192
- - **`get_layer_violations`** + **`ast-map layers`** (alias `sdp`): detect violations of
193
- Robert C. Martin's **Stable Dependencies Principle** a stable file (low instability)
194
- that imports a more volatile one (high instability). Such dependencies point "uphill"
195
- on the stability gradient and drag stable code along every time the volatile file churns.
196
- Sorted by severity (the instability gap crossed). `minGap` filters small gaps.
197
- - Builds directly on the v1.14.0 coupling metrics.
198
- - Tests: 5 new assertions (114 total) clean fixture yields none, a synthetic
199
- stable→volatile graph yields exactly one with the correct severity.
200
-
201
- ## [1.14.0] 2026-06-09 · Coupling metrics
202
- - **`get_coupling`** + **`ast-map coupling [dir]`**: Robert C. Martin's per-file
203
- coupling metrics afferent coupling (Ca, fan-in), efferent coupling (Ce,
204
- fan-out), and instability I = Ce/(Ca+Ce). High-Ca files are load-bearing (break
205
- carefully); high-instability files change freely. Derived from the import graph.
206
- - Tests: 4 new assertions (109 total) verifying stable/unstable/middle files and
207
- the [0,1] instability bound.
208
-
209
- ## [1.13.0] 2026-06-08 · Context-pack
210
- - **`pack_context`** + **`ast-map pack <file> [symbol]`**: the minimal context to
211
- work on a symbol — its source, the signatures it depends on, and its dependents
212
- with a token estimate, instead of reading whole files.
213
-
214
- ## [1.12.0]2026-06-08 · Git-aware analysis
215
- - **`ast-map diff [base]`** + **`get_diff`**: changed symbols since a git ref,
216
- breaking changes (removed / signature-changed exports), and blast radius.
217
- - **`ast-map risk`** + **`get_risk_map`**: rank files by churn × complexity.
218
-
219
- ## [1.11.0] 2026-06-01 · Code-health dashboard
220
- - **`ast-map report`** writes a premium self-contained HTML dashboard: health
221
- grade (A–F), stats, language breakdown, complexity hotspots, god nodes, dead
222
- code, and cycles. **`get_codebase_report`** MCP tool returns the same as JSON.
223
-
224
- ## [1.10.0] — 2026-06-01 · Source maps
225
- - **`read_source_map`** MCP tool + **`ast-map sourcemap <file>`** CLI: trace a
226
- compiled JS/CSS file (inline `data:` or external `.map`) back to its original
227
- sources; honors `sourceRoot` and reports embedded `sourcesContent`.
228
- - Ruby re-investigated and confirmed blocked (external-scanner grammar needs
229
- web-tree-sitter ≥0.22; engine upgrade would risk the 12 working languages).
230
-
231
- ## [1.9.0] 2026-06-01 · Watch mode
232
- - **`ast-map watch [dir]`** debounced, coalesced rebuild of the dependency
233
- analysis (files · dead exports · cycles) on every source change; `-o file.html`
234
- regenerates the live explorer too.
235
- - Explorer debug readout hidden by default (toggle with `d`).
236
-
237
- ## [1.8.0] — 2026-06-01 · Explorer detail sidebar
238
- - Click a file in `ast-map explore` for a side panel: language, symbol count,
239
- symbols, **Imports** and **Imported by** (each clickable to navigate the graph).
240
- - **1.8.1–1.8.3 (fixes):** explorer now reliably centers/fills the viewport
241
- separated orphan files into a tidy grid, clamped the force layout to stop nodes
242
- being flung to huge coordinates, and sized the canvas from `innerWidth/innerHeight`.
243
-
244
- ## [1.7.0] 2026-06-01 · Web UI graph explorer
245
- - **`ast-map explore [dir]`** writes a self-contained, dependency-free interactive
246
- HTML: a force-directed file dependency graph (drag / zoom / pan / click-to-
247
- highlight / name filter). Opens in any browser, no build step.
248
- - **1.7.1–1.7.3 (fixes):** auto-fit and layout tuning.
249
-
250
- ## [1.6.0]2026-06-01 · MCP resource endpoints
251
- - Browseable resources: **`ast://languages`**, **`ast://skeleton/{path}`**
252
- (templated, one per file via `resources/list`), **`ast://graph`**. Agents can
253
- list/read codebase structure as resources, not just call tools.
254
-
255
- ## [1.5.0] — 2026-06-01 · `.d.ts` / ambient declarations
256
- - Extract `declare function/const/class`, `declare module "x"`, and
257
- `declare namespace` (plus plain `namespace`); a `.d.ts` used to yield 0 symbols.
258
- - New `namespace` symbol kind.
259
-
260
- ## [1.4.0]2026-06-01 · Dynamic import tracking
261
- - Capture dynamic `import("...")` and CommonJS `require("...")` with an
262
- `isDynamic` flag; relative ones resolve and draw graph edges like static imports.
263
-
264
- ## [1.3.0] — 2026-06-01 · TS/JS decorators
265
- - Class and method symbols carry a `decorators` field (`@Component`, `@Get(...)`),
266
- in skeletons and `get_call_graph`. Extends the Python decorator support to TS/JS.
267
-
268
- ## [1.2.0] 2026-06-01 · File-level cross-package resolution
269
- - In a monorepo, bare imports of a workspace package (`@org/utils`, `@org/utils/sub`)
270
- resolve to the real source file (prefers `src/` over `dist/`), so `resolve_imports`
271
- marks them in-project and `build_symbol_graph` draws cross-package edges.
272
-
273
- ## [1.1.0] 2026-06-01 · Monorepo support
274
- - **`analyze_workspace`** tool + **`ast-map workspace`** CLI: discover packages
275
- (npm/yarn `workspaces`, `pnpm-workspace.yaml`, `lerna.json`), map internal
276
- package dependencies, and detect circular package deps.
277
-
278
- ## [1.0.0] 2026-06-01 · Stable release 🎉
279
- - Locked public API (MCP tool names + schemas, CLI surface) for the 1.x line.
280
- - Bundled **GitHub Action** (`action.yml`) running `ast-map validate` as a CI gate,
281
- plus a project CI workflow.
282
- - 12 languages · 18 MCP tools / 17 CLI commands at release.
283
-
284
- ## [0.9.0] 2026-05-31 · Scoped type-flow tracing
285
- - **`trace_type`** tool + **`ast-map trace-type`** CLI: follow a named type through
286
- function params, return types, typed variables, and class fields. Completes the
287
- deeper-analysis suite.
288
-
289
- ## [0.8.7] 2026-05-31 · Python decorators
290
- - `decorators` field on Python symbols + `get_call_graph`; traces
291
- `@router.get(...)` handler and stacked decorators.
292
-
293
- ## [0.8.6] 2026-05-31 · Unused parameter detection
294
- - **`find_unused_params`** tool + **`ast-map unused-params`** CLI: named functions
295
- whose params are never referenced (low false-positive; counts object shorthand).
296
-
297
- ## [0.8.5] 2026-05-31 · Cyclomatic complexity
298
- - **`get_complexity`** tool + **`ast-map complexity`** CLI: per-function score with
299
- low/moderate/high/very-high ratings and directory hotspots.
300
-
301
- ## [0.8.4] — 2026-05-31 · Duplicate symbol detection
302
- - **`find_duplicate_symbols`** tool + **`ast-map duplicates`** CLI: exported names
303
- declared in 2+ files.
304
-
305
- ## [0.8.3] 2026-05-31 · TSX/React component props
306
- - Component symbols carry `propsType` + `props[]`; detects `React.FC<P>` and
307
- JSX-returning PascalCase functions. MCP server version now read from package.json.
308
-
309
- ## [0.8.2] — 2026-05-30 · Swift cross-file wiring
310
- - `import <Module>` that module's files (`Sources/<Module>/`). Completes
311
- cross-file graph/resolver support for all four v0.8.0 languages.
312
-
313
- ## [0.8.1] 2026-05-30 · Kotlin + C/C++ cross-file wiring
314
- - Kotlin FQCN/package index; C/C++ `#include` resolution with header↔impl pairing.
315
- - Fixes: parse-cache rel-path leak; Kotlin call-graph extraction.
316
-
317
- ---
318
-
319
- ## Earlier (pre-session history)
320
-
321
- - **0.8.0** +4 languages: C · C++ · Kotlin · Swift (symbol extraction + imports).
322
- - **0.7.0** Go full module resolution; C# reverse `calledBy`; 4-suite test harness.
323
- - **0.6.0** +3 languages: Rust · Java · C#; cross-language resolver.
324
- - **0.5.x** `/ast-map` skill auto-install; iterative DFS; barrel re-exports; parse cache; call-graph aliases; `.ast-map.config.json`.
325
- - **0.4.0** `search_symbol`, `get_file_deps`, `get_top_symbols`, dead-code tiers.
326
- - **0.3.0**CLI; `find_dead_code`, `find_circular_deps`, `get_change_impact`, `get_call_graph`.
327
- - **0.2.0** import extraction; `resolve_imports`; `build_symbol_graph`.
328
- - **0.1.0** — `get_skeleton_json`, `generate_skeleton`, `get_symbol_context`, `validate_architecture`.
329
-
330
- [1.13.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.13.0
331
- [1.12.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.12.0
332
- [1.11.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.11.0
333
- [1.10.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.10.0
334
- [1.9.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.9.0
335
- [1.8.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.8.0
336
- [1.7.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.7.0
337
- [1.6.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.6.0
338
- [1.5.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.5.0
1
+ # Changelog
2
+
3
+ All notable changes to **universal-ast-mapper** (AST-MCP). Format based on
4
+ [Keep a Changelog](https://keepachangelog.com/); this project follows semver and,
5
+ since 1.0.0, guarantees a stable MCP tool / CLI surface across the 1.x line.
6
+
7
+ ---
8
+
9
+ ## [2.0.0] — 2026-06-20 · persistent index, live reload, TF-IDF rerank, auto-patch, arch rules, doc gen
10
+
11
+ ### Breaking
12
+ - CLI version bumped to 2.0.0; MCP protocol surface is additive (backward-compatible).
13
+
14
+ ### New CLI commands
15
+ - `ast-map index [dir]` build/refresh `.ast-map/index.json` persistent skeleton cache (hash-based incremental rebuild, 10-100× faster on warm runs)
16
+ - `ast-map arch [dir]` enforce architecture import rules from `.ast-map.json` `arch.rules`; exits non-zero on errors (CI-friendly)
17
+ - `ast-map patch [dir]` interactive auto-patch: collects smells + security issues, calls Claude, shows colored unified diff, applies with `y/N` per issue (`-y` auto-accepts)
18
+ - `ast-map doc [dir]` — generate Markdown or HTML API reference from skeletons (`--html`, `--ai` with Claude descriptions, `--exported-only`)
19
+ - `find` command gains `--rerank` flag — TF-IDF cosine pre-ranking + Claude API re-ranking for better semantic search
20
+
21
+ ### Enhanced
22
+ - `gatherSkeletons()` automatically reads from `.ast-map/index.json` when present and fresh (hash-verified) — all CLI commands benefit
23
+ - `ast-map serve` gains `--watch` option for SSE-based live reload (`/events` endpoint)
24
+ - Web UI (`ast-map serve`) auto-reconnects to SSE stream and refreshes on file changes
25
+
26
+ ### New MCP tools (3 added)
27
+ - `build_index` build or refresh the persistent skeleton index
28
+ - `check_arch_rules` — enforce `.ast-map.json` architecture rules, return structured violations
29
+ - `generate_docs` produce Markdown or HTML API docs, optionally enhanced with Claude
30
+
31
+ ### New source modules
32
+ - `src/indexstore.ts``buildIndex()`, `loadIndex()`, `saveIndex()`, `isIndexFresh()`, `getSkeletons()`
33
+ - `src/arch-rules.ts` `checkArchRules()`, `loadArchRules()`, manual `globToRegex()` (no dependencies)
34
+ - `src/patch.ts` `generatePatch()`, `interactivePatch()`, colored unified diff, readline y/N prompt
35
+ - `src/docgen.ts` `buildDocOutput()`, `renderMarkdown()`, `renderDocHtml()`, `aiEnhanceDocs()`
36
+ - `src/embeddings.ts` `buildTfIdfVectors()`, `cosineSearch()`, `rerankWithClaude()`
37
+
38
+ ### Modified source modules
39
+ - `src/config.ts` `AstMapConfig` gains `arch?: { rules: ArchRule[] }` field
40
+ - `src/serve.ts` `ServeOptions` gains `watch?: boolean`; SSE `/events` endpoint added
41
+ - `src/webapp.ts` — EventSource client for live reload with auto-reconnect
42
+ - `src/ai-refactor.ts` `callClaude` is now exported for reuse
43
+
44
+ ### Tests
45
+ - 364 tests total (up from 296); 5 new test sections: Index Store, Arch Rules, Doc Generation, Embeddings/TF-IDF, Patch
46
+
47
+ ---
48
+
49
+ ## [1.35.0] — 2026-06-20 · explain, similar, incremental, coverage merge, plugins, web UI
50
+
51
+ ### New CLI commands
52
+ - `ast-map explain <file> <symbol>` structural explanation of any symbol: purpose, callers, deps, smells, change risk; `--ai` adds Claude prose explanation
53
+ - `ast-map similar [dir]` find structurally similar/duplicate functions via AST fingerprinting (no AI)
54
+ - `ast-map serve [dir]` interactive web SPA at `http://localhost:7337` dark theme dashboard, D3 dependency graph, all analysis pages
55
+ - `ast-map covmerge <report>` merge structural coverage map with actual Istanbul/lcov/Clover/Cobertura report
56
+ - `ast-map plugins [dir]` run custom JS lint plugins from `.ast-map/plugins/`
57
+ - `--changed-since <ref>` flag on `smells` and `security` — incremental analysis via git diff
58
+
59
+ ### New MCP tools (4 added)
60
+ - `explain_symbol` structural + optional AI explanation of any symbol
61
+ - `find_similar` AST fingerprint groups across a directory
62
+ - `merge_coverage` Istanbul/lcov/Clover/Cobertura report merged with structural map
63
+ - `run_plugins`load and run `.ast-map/plugins/*.mjs` custom rules
64
+
65
+ ### New source modules
66
+ - `src/explain.ts` `buildExplainResult()` + `aiExplain()` (Claude via node:https)
67
+ - `src/similar.ts` `findSimilar()` with 7-component structural fingerprint
68
+ - `src/incremental.ts` content-hash state + `filterToGitChanged()` + `detectChanges()`
69
+ - `src/covmerge.ts` 4-format coverage parser + `mergeCoverage()` merger
70
+ - `src/plugins.ts` `loadPlugins()` / `runPlugins()` / `EXAMPLE_PLUGIN` scaffold
71
+ - `src/serve.ts` `startServe()` HTTP server with 10 REST endpoints + 5 s cache
72
+ - `src/webapp.ts` self-contained SPA template (D3.js from CDN, dark theme, 8 pages)
73
+
74
+ ### Other changes
75
+ - `ast-map init` now scaffolds `.ast-map/plugins/example.mjs` alongside the config
76
+ - 296 tests (up from 242), 0 failures
77
+
78
+ ## [1.34.0] 2026-06-20 · MCP tools, AI refactor, LSP server, PR comments, ast-map init
79
+
80
+ ### New MCP tools (7 added)
81
+ - `detect_code_smells` scan file/dir for 6 smell patterns; returns structured list
82
+ - `scan_security` static scan with 12 rules; filterable by `min_severity`
83
+ - `generate_diagram` Mermaid class/deps/modules diagram from any directory
84
+ - `get_fix_suggestions` prioritised fix suggestions (P1–P3) from dead exports + smells + security
85
+ - `generate_tests` test stubs for a single file (all 6 frameworks)
86
+ - `generate_tests_ai` — AI-enhanced tests via Claude API; falls back to stubs gracefully
87
+ - `ai_refactor` sends smells/security to Claude; returns before/after code + explanation
88
+
89
+ ### AI refactor (`src/ai-refactor.ts`)
90
+ - `ast-map fix --ai` sends detected issues to Claude and returns concrete refactored code
91
+ - Structured `<before>/<after>/<explanation>` XML response format
92
+ - `aiRefactorBatch()` runs one API call per issue; failures degrade gracefully with `error` field
93
+ - `--limit <n>` caps API calls per run (default 3)
94
+
95
+ ### LSP server (`src/lsp.ts`, binary `ast-map-lsp`)
96
+ - Full JSON-RPC 2.0 over stdio — no external LSP library, zero new npm deps
97
+ - `textDocument/publishDiagnostics`dead exports (Warning), security issues (Error/Warning), smells (Warning/Information)
98
+ - `textDocument/codeLens` cyclomatic complexity above every function/class (🔴 ≥20, 🟡 ≥10)
99
+ - VS Code extension updated to start LSP client (`vscode-languageclient`) on activation, falling back to on-save polling
100
+
101
+ ### GitHub Actions PR comment (`action.yml`)
102
+ - New `mode: pr-comment` posts/updates a health score comment on every PR
103
+ - Shows: score with delta (↑/↓/→), grade, files/symbols/dead/cycles/complexity/coverage table
104
+ - `github-token` input; automatically updates existing comment rather than posting duplicates
105
+
106
+ ### `ast-map init` (new CLI command)
107
+ - Interactive wizard (readline) or `--defaults` for non-interactive
108
+ - Writes `.ast-map.json` with thresholds, smell limits, security min-severity, ignore patterns
109
+ - `--json` flag emits defaults without writing any file
110
+
111
+ ### Tests
112
+ - `test/analysis.mjs` +10 checks (AI refactor + LSP file existence); 242 total, 0 failed
113
+
114
+ ## [1.33.0] — 2026-06-20 · AI testgen + VS Code extension
115
+
116
+ ### AI-powered test generation (`src/ai-testgen.ts`)
117
+ - New `--ai` flag for `ast-map testgen` sends source code + generated stubs to Claude API and
118
+ returns tests with **real assertions** instead of TODO placeholders.
119
+ - Uses `node:https` (no new npm dep) to call `POST /v1/messages` on `api.anthropic.com`.
120
+ - Auto-reads `ANTHROPIC_API_KEY`; `--api-key` and `--model` flags override per invocation.
121
+ - `tryAiEnhanceTests()` never throws — falls back silently to stubs when key is absent.
122
+ - Terminal output appended with `[AI]` tag; JSON output includes `aiEnhanced: boolean`.
123
+
124
+ ### VS Code Extension (`vscode-ext/`)
125
+ - New standalone VS Code extension project (`@ast-map/vscode`):
126
+ - **Complexity Code Lens** cyclomatic score shown above every function/class; yellow ≥10, red ≥20.
127
+ - **Dead-export diagnostics**high-confidence dead exports underlined as `Warning`.
128
+ - **Security diagnostics** critical/high issues shown as `Error`, medium/low as `Warning`.
129
+ - **Issues Tree View** sidebar panel listing smells and security issues across the workspace.
130
+ - **Commands**: Generate Tests, Generate Tests (AI), Run Smells, Scan Security, Show Diagram, Open Report.
131
+ - **Status Bar** shows live health score `AST B 82`; opens report on click.
132
+ - Configuration: `astMap.cliPath`, `astMap.enableCodeLens`, `astMap.enableDiagnostics`, `astMap.anthropicApiKey`.
133
+
134
+ ### Tests
135
+ - `test/analysis.mjs` — +9 checks for `ai-testgen.ts` (graceful fallback, shape, 232 total, 0 failed).
136
+
137
+ ## [1.28.0] — 2026-06-11 · Test coverage in the dashboard
138
+ - The health dashboard (`ast-map report` / `get_codebase_report`) now surfaces
139
+ v1.27's structural test coverage:
140
+ - **Test coverage card** coverage bar (tested/total sources, % colored
141
+ green 70 / amber 40 / red below) + the **untested sources ranked by
142
+ risk** (fan-in Ca, then symbol count), capped at 12 with a "+N more" note.
143
+ - **Test coverage stat tile** in the header grid.
144
+ - **Root fallback** reporting on `src/` only (no test files in the scanned
145
+ dir)? Test files are pulled in from the project root automatically and the
146
+ card notes "(from project root)".
147
+ - **Health score** now includes a structural-coverage penalty (capped at 8
148
+ points, proportional to the untested share).
149
+ - `ReportData` gains `testCoverage` (testFiles, sourceFiles, testedSources,
150
+ coverageRatio, untestedCount, untested[], rootFallback) additive.
151
+ - CLI `ast-map report` summary line now shows `tests N%`.
152
+ - Tests: +6 checks in `test/analysis.mjs` (159 total).
153
+
154
+ ## [1.27.0] 2026-06-11 · Test-coverage mapping
155
+ - **New MCP tool `get_test_coverage`** + **CLI `ast-map tests [dir]`** (alias
156
+ `coverage`) structural test coverage with zero instrumentation: which source
157
+ files have tests at all, and which have **none**.
158
+ - Two pairing signals:
159
+ - **import** — a test file imports the source file (graph edge; definitive).
160
+ - **name**conventions: `auth.test.ts` `auth.ts`, `auth_test.go`,
161
+ `test_utils.py` `utils.py`, `AuthTest.java` `Auth.java`,
162
+ `foo-smoke.mjs` `foo.*`, and bare `test/<name>.*` `<name>.*`;
163
+ ambiguity resolved by longest shared path prefix.
164
+ - Test files detected by directory (`test/`, `tests/`, `__tests__/`, `spec/`, `e2e/`)
165
+ or basename pattern; **fixtures/mocks/testdata dirs excluded from both sides**.
166
+ - Output: coverage ratio, test→source `links` (with `via`), `tested`,
167
+ **`untested` ranked by risk** (fan-in Ca, then symbol count load-bearing
168
+ files with no tests first), and `orphanTests` (no source matched; usually
169
+ integration/e2e).
170
+ - CLI: `-u/--untested`, `--links`, `-n/--top`, `--json`.
171
+ - New module `testmap` (`mapTestCoverage`, `isTestFile`, `testNameTarget`,
172
+ `isFixtureFile`) + `test/fixtures/testmap/` fixture tree. Tests: +9 checks
173
+ in `test/analysis.mjs` (153 total). **30 MCP tools / 32 CLI commands.**
174
+
175
+ ## [1.26.0] 2026-06-11 · Coupling overlay in the explorer
176
+ - **`ast-map explore` color modes** — new toolbar dropdown: `color: folder`
177
+ (existing per-directory hues) or **`color: coupling`** — nodes shaded by
178
+ **instability** I = Ce/(Ca+Ce) on a green (0, stable) yellow red
179
+ (1, volatile) scale; orphan files stay gray.
180
+ - **Legend** (bottom-left, shown in coupling mode) explains the scale; the hover
181
+ tooltip and the detail sidebar now show **Ca / Ce / I** per file.
182
+ - Explorer nodes carry `ca` / `ce` / `inst` computed from the deduped file-level
183
+ import edges same definition as `get_coupling` (Robert C. Martin metrics).
184
+ - Still a single self-contained HTML file, dark-mode aware, zero dependencies.
185
+ - Tests: +5 checks in `test/analysis.mjs` (144 total).
186
+
187
+ ## [1.25.0] 2026-06-11 · Semantic symbol search
188
+ - **New MCP tool `semantic_search`** + **CLI `ast-map find <query> [dir]`** find
189
+ symbols by *meaning*, not exact name: "remove expired cache entries" →
190
+ `clearDiskCache`, "find unused exported code" → `findDeadExports`.
191
+ - Pure lexical semantics **no embeddings, no network, no model downloads**:
192
+ - **Identifier tokenization**: camelCase / PascalCase / snake_case / kebab-case /
193
+ digit and acronym boundaries (`getHTTPServerByID` `get http server by id`).
194
+ - **Programming thesaurus**: 60 synonym groups (`fetch≈get≈load≈retrieve`,
195
+ `remove≈delete≈clear`, `unused≈dead`, `auth≈login≈session`, …).
196
+ - **Light stemming** (plural/gerund/past: `users`→`user`) + **fuzzy matching**
197
+ (edit distance 1 on tokens 4 chars).
198
+ - **BM25-style ranking**: corpus IDF (rare tokens weigh more), field weights
199
+ (name > doc > signature 1.5× > path/kind 1×), match-type weights
200
+ (direct > synonym > fuzzy), coverage bonus, and length normalization so
201
+ focused names (`login`) outrank composites (`handleLogin`).
202
+ - Results include a normalized `score` (0–1) and `matchedTerms` explaining each hit
203
+ (`unused≈dead` = synonym, `cach~cache` = fuzzy).
204
+ - Options: `limit` (default 20), `kind` filter, `exportedOnly`.
205
+ - New module `semantic` (`semanticSearch`, `splitIdentifier`, `stem`). Tests: +8
206
+ checks in `test/analysis.mjs` (139 total). **29 MCP tools / 31 CLI commands.**
207
+
208
+ ## [1.24.0] — 2026-06-10 · TS path-alias resolution
209
+ - Bare imports like `@/components/Button` now resolve through **`tsconfig.json` /
210
+ `jsconfig.json` `compilerOptions.paths`** (+ `baseUrl`): nearest-config lookup above
211
+ the importing file (monorepo-safe, per-process cached), relative `extends` chains
212
+ (child `paths` replace the parent's, per TS semantics), longest-prefix pattern
213
+ matching, candidate probing with the usual extension/index logic.
214
+ - **String-aware JSONC parser** comments/trailing commas are stripped with a
215
+ character walk, not regex (naive stripping corrupts Next.js configs where `"@/*"`
216
+ pairs with the `*/` inside `"**/*.ts"` include globs).
217
+ - Wired into `resolve_imports` (aliased imports report `importKind: "relative"` +
218
+ resolved file), `build_symbol_graph` (alias edges before workspace-package fallback),
219
+ and the call graph (callee origin + reverse `calledBy`).
220
+ - Real-world effect (Next.js app, 186 files): import graph 31 → **324 edges**;
221
+ dead exports 210 153; god nodes now reflect true usage.
222
+ - New module `tsconfig` (`aliasCandidates`, `clearAliasCaches`) + `resolveAliasedImport`
223
+ in the resolver. Tests: new `test/tsalias-smoke.mjs` (15 checks), wired into `npm test`.
224
+
225
+ ## [1.23.0] 2026-06-10 · Configurable root boundary (multi-root + unlocked)
226
+ - **`AST_MAP_ROOT` accepts multiple roots**, separated by the OS path delimiter
227
+ (`;` Windows / `:` POSIX). The first root is primary; absolute paths inside any
228
+ listed root are allowed.
229
+ - **`AST_MAP_UNLOCKED=1`** opt-in: the MCP server analyzes **any existing absolute
230
+ path** the client asks for. Default behavior is unchanged (locked to the root list).
231
+ - Every tool now computes rel-paths and graph roots against the **matched** root, so
232
+ reports/graphs on outside-root projects come out correct.
233
+ - Clearer boundary error message (suggests both escape hatches).
234
+ - New module `roots` (`parseRootsFromEnv`, `resolvePathInRoots`); CLI shares the parser.
235
+ - Tests: new `test/roots-smoke.mjs` (13 checks) + end-to-end verified over MCP stdio
236
+ (locked rejects / unlocked analyzes an outside project).
237
+
238
+ ## [1.22.1] 2026-06-10 · Docs
239
+ - README refreshed to match v1.20–1.22: 28 tools / 30 commands, PHP+Ruby capability
240
+ columns, `cache`/`check` CLI + config + env-var docs, `check_quality_gate` reference,
241
+ Action `mode: check` example, new Performance section. No code changes.
242
+
243
+ ## [1.22.0] — 2026-06-10 · PHP & Ruby support
244
+ - **PHP** (`.php`): classes/interfaces/traits/enums, methods with visibility modifiers,
245
+ class consts + properties, namespaces; imports from `use` (incl. grouped `use A\{B, C}`
246
+ and aliases) and `require`/`include` (side-effect).
247
+ - **Ruby** (`.rb`, `.rake`): classes, modules (→ namespace), methods, `self.` singleton
248
+ methods, constants; **section-style visibility** (`private`/`protected`/`public`);
249
+ imports from `require` / `require_relative`.
250
+ - **web-tree-sitter 0.20.8 → 0.21.0**unblocks the Ruby grammar (external-scanner
251
+ crash on the old runtime); no API change, all grammars + suites re-verified.
252
+ - Tests: `Sample.php` + `sample.rb` fixtures, 30 new smoke assertions. **16 languages.**
253
+
254
+ ## [1.21.0] — 2026-06-10 · Quality gate (`ast-map check`)
255
+ - **`ast-map check [dir]`**CI quality gate with two mechanisms: a **baseline ratchet**
256
+ (vs a committed `.ast-map.baseline.json`; fails when cycles, dead exports, SDP violations,
257
+ very-high-complexity functions rise or the health score drops; `--update-baseline`
258
+ re-anchors) and **absolute thresholds** (CLI flags or `.ast-map.config.json` `"check"`).
259
+ Non-zero exit on failure; `--json` for tooling.
260
+ - New MCP tool **`check_quality_gate`** (28 tools) same gate for agents.
261
+ - **GitHub Action**: `mode: validate | check | both` + `check-args` inputs.
262
+ - New module `check` (`runQualityGate`, `metricsFromReport`); `AstMapConfig.check`.
263
+ - Tests: new `test/check-smoke.mjs` (13 checks), wired into `npm test`.
264
+
265
+ ## [1.20.0] 2026-06-10 · Incremental cache + parallel parsing
266
+ - **Persistent parse cache**: skeletons are cached on disk under `<root>/.ast-map/cache`,
267
+ keyed by content hash + detail + schema/grammar versions — never stale by construction,
268
+ survives across processes (warm hits on large files ~60× faster than a re-parse).
269
+ On by default; disable with `AST_MAP_NO_CACHE=1` or `"cache": false` in config.
270
+ - **Parallel parsing**: bulk scans distribute work over a worker-thread pool
271
+ (auto-sized, engages at 64 files, `AST_MAP_WORKERS` override, sequential fallback
272
+ on any worker failure). `report` computes per-file complexity in the workers too.
273
+ - New CLI command `ast-map cache [stats|clear]`.
274
+ - New modules `diskcache` and `pool` (`buildSkeletonsBulk`); `AstMapConfig.cache`.
275
+ - Tests: new `test/cache-smoke.mjs` (18 checks), wired into `npm test`.
276
+
277
+ ## [1.19.0] — 2026-06-09 · Dashboard: coupling + SDP
278
+ - The health dashboard (`ast-map report` / `get_codebase_report`) now surfaces the
279
+ v1.14–1.16 architecture metrics: a **Module coupling** card (per-directory instability
280
+ bars with Ca/Ce) and a **Layer violations** card (stable→volatile SDP inversions),
281
+ plus an **SDP violations** stat tile.
282
+ - SDP violations now factor into the health score (small capped penalty), so a codebase
283
+ that systematically depends "uphill" on the stability gradient scores lower.
284
+ - `ReportData` gains `layerViolations` and `modules`; purely additive.
285
+ - Tests: 4 new assertions (131 total) report carries the new data and the HTML renders
286
+ both cards.
287
+
288
+ ## [1.18.0] — 2026-06-09 · Vue & Svelte SFC support
289
+ - `.vue` and `.svelte` **single-file components** are now first-class inputs. The
290
+ `<script>` / `<script setup>` block is lifted out and parsed with the TS/JS extractor
291
+ (grammar chosen from `lang="ts"`), so component symbols and imports are extracted and
292
+ wired into the dependency graph — including edges from a component into a plain `.ts`
293
+ module, and into other components.
294
+ - Offsets are preserved: everything outside the script is blank-padded, so every symbol
295
+ range still points at the exact line/column in the original SFC.
296
+ - New languages `vue` and `svelte` (extensions `.vue`, `.svelte`); resolver now resolves
297
+ imports of `.vue` / `.svelte` files. **14 languages.**
298
+ - Tests: 8 new assertions (127 total) + Vue/Svelte fixtures symbol extraction, import
299
+ capture, and cross-file graph edges for both.
300
+
301
+ ## [1.17.0] — 2026-06-09 · MCP prompts
302
+ - The server now registers **MCP prompts** named, parameterized workflows a client
303
+ can invoke from its prompt/slash menu, each returning a ready-to-run instruction that
304
+ chains the right tools: `architecture_audit` (dir?), `safe_refactor` (file, symbol),
305
+ `dead_code_cleanup` (dir?), `health_check` (dir?), `onboard_codebase` (dir?).
306
+ - The Cookbook recipes become first-class, discoverable, and one call away — no pasting.
307
+ - New `test/prompts-smoke.mjs` (12 checks): `prompts/list` returns all 5, argument
308
+ interpolation works, and rendered prompts reference real tools. Wired into CI.
309
+
310
+ ## [1.16.0] 2026-06-09 · Module coupling
311
+ - **`get_module_coupling`** + **`ast-map modules`** (alias `mods`): aggregates the
312
+ file-level import graph up to the **directory/module level** — per-module afferent
313
+ (Ca) / efferent (Ce) coupling and instability, plus the weighted inter-module edges.
314
+ Intra-module imports (files importing siblings in the same directory) are ignored;
315
+ only cross-module dependencies count. The architectural view above per-file coupling.
316
+ - Tests: 5 new assertions (119 total) — a three-module ui→api→core gradient with the
317
+ expected stability ordering and edge count.
318
+
319
+ ## [1.15.0] — 2026-06-09 · Layer-violation detection
320
+ - **`get_layer_violations`** + **`ast-map layers`** (alias `sdp`): detect violations of
321
+ Robert C. Martin's **Stable Dependencies Principle** a stable file (low instability)
322
+ that imports a more volatile one (high instability). Such dependencies point "uphill"
323
+ on the stability gradient and drag stable code along every time the volatile file churns.
324
+ Sorted by severity (the instability gap crossed). `minGap` filters small gaps.
325
+ - Builds directly on the v1.14.0 coupling metrics.
326
+ - Tests: 5 new assertions (114 total) clean fixture yields none, a synthetic
327
+ stable→volatile graph yields exactly one with the correct severity.
328
+
329
+ ## [1.14.0] — 2026-06-09 · Coupling metrics
330
+ - **`get_coupling`** + **`ast-map coupling [dir]`**: Robert C. Martin's per-file
331
+ coupling metrics — afferent coupling (Ca, fan-in), efferent coupling (Ce,
332
+ fan-out), and instability I = Ce/(Ca+Ce). High-Ca files are load-bearing (break
333
+ carefully); high-instability files change freely. Derived from the import graph.
334
+ - Tests: 4 new assertions (109 total) verifying stable/unstable/middle files and
335
+ the [0,1] instability bound.
336
+
337
+ ## [1.13.0] — 2026-06-08 · Context-pack
338
+ - **`pack_context`** + **`ast-map pack <file> [symbol]`**: the minimal context to
339
+ work on a symbol — its source, the signatures it depends on, and its dependents
340
+ — with a token estimate, instead of reading whole files.
341
+
342
+ ## [1.12.0] — 2026-06-08 · Git-aware analysis
343
+ - **`ast-map diff [base]`** + **`get_diff`**: changed symbols since a git ref,
344
+ breaking changes (removed / signature-changed exports), and blast radius.
345
+ - **`ast-map risk`** + **`get_risk_map`**: rank files by churn × complexity.
346
+
347
+ ## [1.11.0] — 2026-06-01 · Code-health dashboard
348
+ - **`ast-map report`** writes a premium self-contained HTML dashboard: health
349
+ grade (A–F), stats, language breakdown, complexity hotspots, god nodes, dead
350
+ code, and cycles. **`get_codebase_report`** MCP tool returns the same as JSON.
351
+
352
+ ## [1.10.0] — 2026-06-01 · Source maps
353
+ - **`read_source_map`** MCP tool + **`ast-map sourcemap <file>`** CLI: trace a
354
+ compiled JS/CSS file (inline `data:` or external `.map`) back to its original
355
+ sources; honors `sourceRoot` and reports embedded `sourcesContent`.
356
+ - Ruby re-investigated and confirmed blocked (external-scanner grammar needs
357
+ web-tree-sitter ≥0.22; engine upgrade would risk the 12 working languages).
358
+
359
+ ## [1.9.0] — 2026-06-01 · Watch mode
360
+ - **`ast-map watch [dir]`** — debounced, coalesced rebuild of the dependency
361
+ analysis (files · dead exports · cycles) on every source change; `-o file.html`
362
+ regenerates the live explorer too.
363
+ - Explorer debug readout hidden by default (toggle with `d`).
364
+
365
+ ## [1.8.0] — 2026-06-01 · Explorer detail sidebar
366
+ - Click a file in `ast-map explore` for a side panel: language, symbol count,
367
+ symbols, **Imports** and **Imported by** (each clickable to navigate the graph).
368
+ - **1.8.1–1.8.3 (fixes):** explorer now reliably centers/fills the viewport —
369
+ separated orphan files into a tidy grid, clamped the force layout to stop nodes
370
+ being flung to huge coordinates, and sized the canvas from `innerWidth/innerHeight`.
371
+
372
+ ## [1.7.0] — 2026-06-01 · Web UI graph explorer
373
+ - **`ast-map explore [dir]`** writes a self-contained, dependency-free interactive
374
+ HTML: a force-directed file dependency graph (drag / zoom / pan / click-to-
375
+ highlight / name filter). Opens in any browser, no build step.
376
+ - **1.7.1–1.7.3 (fixes):** auto-fit and layout tuning.
377
+
378
+ ## [1.6.0] — 2026-06-01 · MCP resource endpoints
379
+ - Browseable resources: **`ast://languages`**, **`ast://skeleton/{path}`**
380
+ (templated, one per file via `resources/list`), **`ast://graph`**. Agents can
381
+ list/read codebase structure as resources, not just call tools.
382
+
383
+ ## [1.5.0] — 2026-06-01 · `.d.ts` / ambient declarations
384
+ - Extract `declare function/const/class`, `declare module "x"`, and
385
+ `declare namespace` (plus plain `namespace`); a `.d.ts` used to yield 0 symbols.
386
+ - New `namespace` symbol kind.
387
+
388
+ ## [1.4.0] — 2026-06-01 · Dynamic import tracking
389
+ - Capture dynamic `import("...")` and CommonJS `require("...")` with an
390
+ `isDynamic` flag; relative ones resolve and draw graph edges like static imports.
391
+
392
+ ## [1.3.0] — 2026-06-01 · TS/JS decorators
393
+ - Class and method symbols carry a `decorators` field (`@Component`, `@Get(...)`),
394
+ in skeletons and `get_call_graph`. Extends the Python decorator support to TS/JS.
395
+
396
+ ## [1.2.0] — 2026-06-01 · File-level cross-package resolution
397
+ - In a monorepo, bare imports of a workspace package (`@org/utils`, `@org/utils/sub`)
398
+ resolve to the real source file (prefers `src/` over `dist/`), so `resolve_imports`
399
+ marks them in-project and `build_symbol_graph` draws cross-package edges.
400
+
401
+ ## [1.1.0] — 2026-06-01 · Monorepo support
402
+ - **`analyze_workspace`** tool + **`ast-map workspace`** CLI: discover packages
403
+ (npm/yarn `workspaces`, `pnpm-workspace.yaml`, `lerna.json`), map internal
404
+ package dependencies, and detect circular package deps.
405
+
406
+ ## [1.0.0] — 2026-06-01 · Stable release 🎉
407
+ - Locked public API (MCP tool names + schemas, CLI surface) for the 1.x line.
408
+ - Bundled **GitHub Action** (`action.yml`) running `ast-map validate` as a CI gate,
409
+ plus a project CI workflow.
410
+ - 12 languages · 18 MCP tools / 17 CLI commands at release.
411
+
412
+ ## [0.9.0] — 2026-05-31 · Scoped type-flow tracing
413
+ - **`trace_type`** tool + **`ast-map trace-type`** CLI: follow a named type through
414
+ function params, return types, typed variables, and class fields. Completes the
415
+ deeper-analysis suite.
416
+
417
+ ## [0.8.7] — 2026-05-31 · Python decorators
418
+ - `decorators` field on Python symbols + `get_call_graph`; traces
419
+ `@router.get(...)` → handler and stacked decorators.
420
+
421
+ ## [0.8.6] — 2026-05-31 · Unused parameter detection
422
+ - **`find_unused_params`** tool + **`ast-map unused-params`** CLI: named functions
423
+ whose params are never referenced (low false-positive; counts object shorthand).
424
+
425
+ ## [0.8.5] — 2026-05-31 · Cyclomatic complexity
426
+ - **`get_complexity`** tool + **`ast-map complexity`** CLI: per-function score with
427
+ low/moderate/high/very-high ratings and directory hotspots.
428
+
429
+ ## [0.8.4] — 2026-05-31 · Duplicate symbol detection
430
+ - **`find_duplicate_symbols`** tool + **`ast-map duplicates`** CLI: exported names
431
+ declared in 2+ files.
432
+
433
+ ## [0.8.3] — 2026-05-31 · TSX/React component props
434
+ - Component symbols carry `propsType` + `props[]`; detects `React.FC<P>` and
435
+ JSX-returning PascalCase functions. MCP server version now read from package.json.
436
+
437
+ ## [0.8.2] — 2026-05-30 · Swift cross-file wiring
438
+ - `import <Module>` → that module's files (`Sources/<Module>/`). Completes
439
+ cross-file graph/resolver support for all four v0.8.0 languages.
440
+
441
+ ## [0.8.1] — 2026-05-30 · Kotlin + C/C++ cross-file wiring
442
+ - Kotlin FQCN/package index; C/C++ `#include` resolution with header↔impl pairing.
443
+ - Fixes: parse-cache rel-path leak; Kotlin call-graph extraction.
444
+
445
+ ---
446
+
447
+ ## Earlier (pre-session history)
448
+
449
+ - **0.8.0** — +4 languages: C · C++ · Kotlin · Swift (symbol extraction + imports).
450
+ - **0.7.0** — Go full module resolution; C# reverse `calledBy`; 4-suite test harness.
451
+ - **0.6.0** — +3 languages: Rust · Java · C#; cross-language resolver.
452
+ - **0.5.x** — `/ast-map` skill auto-install; iterative DFS; barrel re-exports; parse cache; call-graph aliases; `.ast-map.config.json`.
453
+ - **0.4.0** — `search_symbol`, `get_file_deps`, `get_top_symbols`, dead-code tiers.
454
+ - **0.3.0** — CLI; `find_dead_code`, `find_circular_deps`, `get_change_impact`, `get_call_graph`.
455
+ - **0.2.0** — import extraction; `resolve_imports`; `build_symbol_graph`.
456
+ - **0.1.0** — `get_skeleton_json`, `generate_skeleton`, `get_symbol_context`, `validate_architecture`.
457
+
458
+ [1.13.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.13.0
459
+ [1.12.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.12.0
460
+ [1.11.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.11.0
461
+ [1.10.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.10.0
462
+ [1.9.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.9.0
463
+ [1.8.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.8.0
464
+ [1.7.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.7.0
465
+ [1.6.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.6.0
466
+ [1.5.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.5.0