universal-ast-mapper 1.27.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 -321
  3. package/README.md +878 -877
  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 -1407
  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 -187
  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,321 +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.27.0] — 2026-06-11 · Test-coverage mapping
10
- - **New MCP tool `get_test_coverage`** + **CLI `ast-map tests [dir]`** (alias
11
- `coverage`) — structural test coverage with zero instrumentation: which source
12
- files have tests at all, and which have **none**.
13
- - Two pairing signals:
14
- - **import** a test file imports the source file (graph edge; definitive).
15
- - **name**conventions: `auth.test.ts` `auth.ts`, `auth_test.go`,
16
- `test_utils.py` `utils.py`, `AuthTest.java` `Auth.java`,
17
- `foo-smoke.mjs` `foo.*`, and bare `test/<name>.*` → `<name>.*`;
18
- ambiguity resolved by longest shared path prefix.
19
- - Test files detected by directory (`test/`, `tests/`, `__tests__/`, `spec/`, `e2e/`)
20
- or basename pattern; **fixtures/mocks/testdata dirs excluded from both sides**.
21
- - Output: coverage ratio, test→source `links` (with `via`), `tested`,
22
- **`untested` ranked by risk** (fan-in Ca, then symbol countload-bearing
23
- files with no tests first), and `orphanTests` (no source matched; usually
24
- integration/e2e).
25
- - CLI: `-u/--untested`, `--links`, `-n/--top`, `--json`.
26
- - New module `testmap` (`mapTestCoverage`, `isTestFile`, `testNameTarget`,
27
- `isFixtureFile`) + `test/fixtures/testmap/` fixture tree. Tests: +9 checks
28
- in `test/analysis.mjs` (153 total). **30 MCP tools / 32 CLI commands.**
29
-
30
- ## [1.26.0] — 2026-06-11 · Coupling overlay in the explorer
31
- - **`ast-map explore` color modes** — new toolbar dropdown: `color: folder`
32
- (existing per-directory hues) or **`color: coupling`** nodes shaded by
33
- **instability** I = Ce/(Ca+Ce) on a green (0, stable) → yellow → red
34
- (1, volatile) scale; orphan files stay gray.
35
- - **Legend** (bottom-left, shown in coupling mode) explains the scale; the hover
36
- tooltip and the detail sidebar now show **Ca / Ce / I** per file.
37
- - Explorer nodes carry `ca` / `ce` / `inst` computed from the deduped file-level
38
- import edges same definition as `get_coupling` (Robert C. Martin metrics).
39
- - Still a single self-contained HTML file, dark-mode aware, zero dependencies.
40
- - Tests: +5 checks in `test/analysis.mjs` (144 total).
41
-
42
- ## [1.25.0]2026-06-11 · Semantic symbol search
43
- - **New MCP tool `semantic_search`** + **CLI `ast-map find <query> [dir]`** — find
44
- symbols by *meaning*, not exact name: "remove expired cache entries" →
45
- `clearDiskCache`, "find unused exported code" `findDeadExports`.
46
- - Pure lexical semantics — **no embeddings, no network, no model downloads**:
47
- - **Identifier tokenization**: camelCase / PascalCase / snake_case / kebab-case /
48
- digit and acronym boundaries (`getHTTPServerByID` → `get http server by id`).
49
- - **Programming thesaurus**: 60 synonym groups (`fetch≈get≈load≈retrieve`,
50
- `remove≈delete≈clear`, `unused≈dead`, `auth≈login≈session`, …).
51
- - **Light stemming** (plural/gerund/past: `users`→`user`) + **fuzzy matching**
52
- (edit distance 1 on tokens 4 chars).
53
- - **BM25-style ranking**: corpus IDF (rare tokens weigh more), field weights
54
- (name > doc > signature 1.5× > path/kind 1×), match-type weights
55
- (direct > synonym > fuzzy), coverage bonus, and length normalization so
56
- focused names (`login`) outrank composites (`handleLogin`).
57
- - Results include a normalized `score` (0–1) and `matchedTerms` explaining each hit
58
- (`unused≈dead` = synonym, `cach~cache` = fuzzy).
59
- - Options: `limit` (default 20), `kind` filter, `exportedOnly`.
60
- - New module `semantic` (`semanticSearch`, `splitIdentifier`, `stem`). Tests: +8
61
- checks in `test/analysis.mjs` (139 total). **29 MCP tools / 31 CLI commands.**
62
-
63
- ## [1.24.0]2026-06-10 · TS path-alias resolution
64
- - Bare imports like `@/components/Button` now resolve through **`tsconfig.json` /
65
- `jsconfig.json` `compilerOptions.paths`** (+ `baseUrl`): nearest-config lookup above
66
- the importing file (monorepo-safe, per-process cached), relative `extends` chains
67
- (child `paths` replace the parent's, per TS semantics), longest-prefix pattern
68
- matching, candidate probing with the usual extension/index logic.
69
- - **String-aware JSONC parser** comments/trailing commas are stripped with a
70
- character walk, not regex (naive stripping corrupts Next.js configs where `"@/*"`
71
- pairs with the `*/` inside `"**/*.ts"` include globs).
72
- - Wired into `resolve_imports` (aliased imports report `importKind: "relative"` +
73
- resolved file), `build_symbol_graph` (alias edges before workspace-package fallback),
74
- and the call graph (callee origin + reverse `calledBy`).
75
- - Real-world effect (Next.js app, 186 files): import graph 31 → **324 edges**;
76
- dead exports 210 153; god nodes now reflect true usage.
77
- - New module `tsconfig` (`aliasCandidates`, `clearAliasCaches`) + `resolveAliasedImport`
78
- in the resolver. Tests: new `test/tsalias-smoke.mjs` (15 checks), wired into `npm test`.
79
-
80
- ## [1.23.0] 2026-06-10 · Configurable root boundary (multi-root + unlocked)
81
- - **`AST_MAP_ROOT` accepts multiple roots**, separated by the OS path delimiter
82
- (`;` Windows / `:` POSIX). The first root is primary; absolute paths inside any
83
- listed root are allowed.
84
- - **`AST_MAP_UNLOCKED=1`**opt-in: the MCP server analyzes **any existing absolute
85
- path** the client asks for. Default behavior is unchanged (locked to the root list).
86
- - Every tool now computes rel-paths and graph roots against the **matched** root, so
87
- reports/graphs on outside-root projects come out correct.
88
- - Clearer boundary error message (suggests both escape hatches).
89
- - New module `roots` (`parseRootsFromEnv`, `resolvePathInRoots`); CLI shares the parser.
90
- - Tests: new `test/roots-smoke.mjs` (13 checks) + end-to-end verified over MCP stdio
91
- (locked rejects / unlocked analyzes an outside project).
92
-
93
- ## [1.22.1] 2026-06-10 · Docs
94
- - README refreshed to match v1.20–1.22: 28 tools / 30 commands, PHP+Ruby capability
95
- columns, `cache`/`check` CLI + config + env-var docs, `check_quality_gate` reference,
96
- Action `mode: check` example, new Performance section. No code changes.
97
-
98
- ## [1.22.0]2026-06-10 · PHP & Ruby support
99
- - **PHP** (`.php`): classes/interfaces/traits/enums, methods with visibility modifiers,
100
- class consts + properties, namespaces; imports from `use` (incl. grouped `use A\{B, C}`
101
- and aliases) and `require`/`include` (side-effect).
102
- - **Ruby** (`.rb`, `.rake`): classes, modules (→ namespace), methods, `self.` singleton
103
- methods, constants; **section-style visibility** (`private`/`protected`/`public`);
104
- imports from `require` / `require_relative`.
105
- - **web-tree-sitter 0.20.8 → 0.21.0** — unblocks the Ruby grammar (external-scanner
106
- crash on the old runtime); no API change, all grammars + suites re-verified.
107
- - Tests: `Sample.php` + `sample.rb` fixtures, 30 new smoke assertions. **16 languages.**
108
-
109
- ## [1.21.0] 2026-06-10 · Quality gate (`ast-map check`)
110
- - **`ast-map check [dir]`** — CI quality gate with two mechanisms: a **baseline ratchet**
111
- (vs a committed `.ast-map.baseline.json`; fails when cycles, dead exports, SDP violations,
112
- very-high-complexity functions rise or the health score drops; `--update-baseline`
113
- re-anchors) and **absolute thresholds** (CLI flags or `.ast-map.config.json` → `"check"`).
114
- Non-zero exit on failure; `--json` for tooling.
115
- - New MCP tool **`check_quality_gate`** (28 tools) — same gate for agents.
116
- - **GitHub Action**: `mode: validate | check | both` + `check-args` inputs.
117
- - New module `check` (`runQualityGate`, `metricsFromReport`); `AstMapConfig.check`.
118
- - Tests: new `test/check-smoke.mjs` (13 checks), wired into `npm test`.
119
-
120
- ## [1.20.0] 2026-06-10 · Incremental cache + parallel parsing
121
- - **Persistent parse cache**: skeletons are cached on disk under `<root>/.ast-map/cache`,
122
- keyed by content hash + detail + schema/grammar versions never stale by construction,
123
- survives across processes (warm hits on large files ~60× faster than a re-parse).
124
- On by default; disable with `AST_MAP_NO_CACHE=1` or `"cache": false` in config.
125
- - **Parallel parsing**: bulk scans distribute work over a worker-thread pool
126
- (auto-sized, engages at 64 files, `AST_MAP_WORKERS` override, sequential fallback
127
- on any worker failure). `report` computes per-file complexity in the workers too.
128
- - New CLI command `ast-map cache [stats|clear]`.
129
- - New modules `diskcache` and `pool` (`buildSkeletonsBulk`); `AstMapConfig.cache`.
130
- - Tests: new `test/cache-smoke.mjs` (18 checks), wired into `npm test`.
131
-
132
- ## [1.19.0] — 2026-06-09 · Dashboard: coupling + SDP
133
- - The health dashboard (`ast-map report` / `get_codebase_report`) now surfaces the
134
- v1.14–1.16 architecture metrics: a **Module coupling** card (per-directory instability
135
- bars with Ca/Ce) and a **Layer violations** card (stable→volatile SDP inversions),
136
- plus an **SDP violations** stat tile.
137
- - SDP violations now factor into the health score (small capped penalty), so a codebase
138
- that systematically depends "uphill" on the stability gradient scores lower.
139
- - `ReportData` gains `layerViolations` and `modules`; purely additive.
140
- - Tests: 4 new assertions (131 total) report carries the new data and the HTML renders
141
- both cards.
142
-
143
- ## [1.18.0] 2026-06-09 · Vue & Svelte SFC support
144
- - `.vue` and `.svelte` **single-file components** are now first-class inputs. The
145
- `<script>` / `<script setup>` block is lifted out and parsed with the TS/JS extractor
146
- (grammar chosen from `lang="ts"`), so component symbols and imports are extracted and
147
- wired into the dependency graph — including edges from a component into a plain `.ts`
148
- module, and into other components.
149
- - Offsets are preserved: everything outside the script is blank-padded, so every symbol
150
- range still points at the exact line/column in the original SFC.
151
- - New languages `vue` and `svelte` (extensions `.vue`, `.svelte`); resolver now resolves
152
- imports of `.vue` / `.svelte` files. **14 languages.**
153
- - Tests: 8 new assertions (127 total) + Vue/Svelte fixtures — symbol extraction, import
154
- capture, and cross-file graph edges for both.
155
-
156
- ## [1.17.0] 2026-06-09 · MCP prompts
157
- - The server now registers **MCP prompts** — named, parameterized workflows a client
158
- can invoke from its prompt/slash menu, each returning a ready-to-run instruction that
159
- chains the right tools: `architecture_audit` (dir?), `safe_refactor` (file, symbol),
160
- `dead_code_cleanup` (dir?), `health_check` (dir?), `onboard_codebase` (dir?).
161
- - The Cookbook recipes become first-class, discoverable, and one call away — no pasting.
162
- - New `test/prompts-smoke.mjs` (12 checks): `prompts/list` returns all 5, argument
163
- interpolation works, and rendered prompts reference real tools. Wired into CI.
164
-
165
- ## [1.16.0] 2026-06-09 · Module coupling
166
- - **`get_module_coupling`** + **`ast-map modules`** (alias `mods`): aggregates the
167
- file-level import graph up to the **directory/module level**per-module afferent
168
- (Ca) / efferent (Ce) coupling and instability, plus the weighted inter-module edges.
169
- Intra-module imports (files importing siblings in the same directory) are ignored;
170
- only cross-module dependencies count. The architectural view above per-file coupling.
171
- - Tests: 5 new assertions (119 total) — a three-module ui→api→core gradient with the
172
- expected stability ordering and edge count.
173
-
174
- ## [1.15.0] — 2026-06-09 · Layer-violation detection
175
- - **`get_layer_violations`** + **`ast-map layers`** (alias `sdp`): detect violations of
176
- Robert C. Martin's **Stable Dependencies Principle** — a stable file (low instability)
177
- that imports a more volatile one (high instability). Such dependencies point "uphill"
178
- on the stability gradient and drag stable code along every time the volatile file churns.
179
- Sorted by severity (the instability gap crossed). `minGap` filters small gaps.
180
- - Builds directly on the v1.14.0 coupling metrics.
181
- - Tests: 5 new assertions (114 total) clean fixture yields none, a synthetic
182
- stable→volatile graph yields exactly one with the correct severity.
183
-
184
- ## [1.14.0] 2026-06-09 · Coupling metrics
185
- - **`get_coupling`** + **`ast-map coupling [dir]`**: Robert C. Martin's per-file
186
- coupling metrics — afferent coupling (Ca, fan-in), efferent coupling (Ce,
187
- fan-out), and instability I = Ce/(Ca+Ce). High-Ca files are load-bearing (break
188
- carefully); high-instability files change freely. Derived from the import graph.
189
- - Tests: 4 new assertions (109 total) verifying stable/unstable/middle files and
190
- the [0,1] instability bound.
191
-
192
- ## [1.13.0] 2026-06-08 · Context-pack
193
- - **`pack_context`** + **`ast-map pack <file> [symbol]`**: the minimal context to
194
- work on a symbol its source, the signatures it depends on, and its dependents
195
- with a token estimate, instead of reading whole files.
196
-
197
- ## [1.12.0] 2026-06-08 · Git-aware analysis
198
- - **`ast-map diff [base]`** + **`get_diff`**: changed symbols since a git ref,
199
- breaking changes (removed / signature-changed exports), and blast radius.
200
- - **`ast-map risk`** + **`get_risk_map`**: rank files by churn × complexity.
201
-
202
- ## [1.11.0] 2026-06-01 · Code-health dashboard
203
- - **`ast-map report`** writes a premium self-contained HTML dashboard: health
204
- grade (A–F), stats, language breakdown, complexity hotspots, god nodes, dead
205
- code, and cycles. **`get_codebase_report`** MCP tool returns the same as JSON.
206
-
207
- ## [1.10.0] — 2026-06-01 · Source maps
208
- - **`read_source_map`** MCP tool + **`ast-map sourcemap <file>`** CLI: trace a
209
- compiled JS/CSS file (inline `data:` or external `.map`) back to its original
210
- sources; honors `sourceRoot` and reports embedded `sourcesContent`.
211
- - Ruby re-investigated and confirmed blocked (external-scanner grammar needs
212
- web-tree-sitter ≥0.22; engine upgrade would risk the 12 working languages).
213
-
214
- ## [1.9.0]2026-06-01 · Watch mode
215
- - **`ast-map watch [dir]`** debounced, coalesced rebuild of the dependency
216
- analysis (files · dead exports · cycles) on every source change; `-o file.html`
217
- regenerates the live explorer too.
218
- - Explorer debug readout hidden by default (toggle with `d`).
219
-
220
- ## [1.8.0] 2026-06-01 · Explorer detail sidebar
221
- - Click a file in `ast-map explore` for a side panel: language, symbol count,
222
- symbols, **Imports** and **Imported by** (each clickable to navigate the graph).
223
- - **1.8.1–1.8.3 (fixes):** explorer now reliably centers/fills the viewport —
224
- separated orphan files into a tidy grid, clamped the force layout to stop nodes
225
- being flung to huge coordinates, and sized the canvas from `innerWidth/innerHeight`.
226
-
227
- ## [1.7.0] 2026-06-01 · Web UI graph explorer
228
- - **`ast-map explore [dir]`** writes a self-contained, dependency-free interactive
229
- HTML: a force-directed file dependency graph (drag / zoom / pan / click-to-
230
- highlight / name filter). Opens in any browser, no build step.
231
- - **1.7.1–1.7.3 (fixes):** auto-fit and layout tuning.
232
-
233
- ## [1.6.0] 2026-06-01 · MCP resource endpoints
234
- - Browseable resources: **`ast://languages`**, **`ast://skeleton/{path}`**
235
- (templated, one per file via `resources/list`), **`ast://graph`**. Agents can
236
- list/read codebase structure as resources, not just call tools.
237
-
238
- ## [1.5.0] — 2026-06-01 · `.d.ts` / ambient declarations
239
- - Extract `declare function/const/class`, `declare module "x"`, and
240
- `declare namespace` (plus plain `namespace`); a `.d.ts` used to yield 0 symbols.
241
- - New `namespace` symbol kind.
242
-
243
- ## [1.4.0] — 2026-06-01 · Dynamic import tracking
244
- - Capture dynamic `import("...")` and CommonJS `require("...")` with an
245
- `isDynamic` flag; relative ones resolve and draw graph edges like static imports.
246
-
247
- ## [1.3.0] 2026-06-01 · TS/JS decorators
248
- - Class and method symbols carry a `decorators` field (`@Component`, `@Get(...)`),
249
- in skeletons and `get_call_graph`. Extends the Python decorator support to TS/JS.
250
-
251
- ## [1.2.0] 2026-06-01 · File-level cross-package resolution
252
- - In a monorepo, bare imports of a workspace package (`@org/utils`, `@org/utils/sub`)
253
- resolve to the real source file (prefers `src/` over `dist/`), so `resolve_imports`
254
- marks them in-project and `build_symbol_graph` draws cross-package edges.
255
-
256
- ## [1.1.0] 2026-06-01 · Monorepo support
257
- - **`analyze_workspace`** tool + **`ast-map workspace`** CLI: discover packages
258
- (npm/yarn `workspaces`, `pnpm-workspace.yaml`, `lerna.json`), map internal
259
- package dependencies, and detect circular package deps.
260
-
261
- ## [1.0.0] 2026-06-01 · Stable release 🎉
262
- - Locked public API (MCP tool names + schemas, CLI surface) for the 1.x line.
263
- - Bundled **GitHub Action** (`action.yml`) running `ast-map validate` as a CI gate,
264
- plus a project CI workflow.
265
- - 12 languages · 18 MCP tools / 17 CLI commands at release.
266
-
267
- ## [0.9.0]2026-05-31 · Scoped type-flow tracing
268
- - **`trace_type`** tool + **`ast-map trace-type`** CLI: follow a named type through
269
- function params, return types, typed variables, and class fields. Completes the
270
- deeper-analysis suite.
271
-
272
- ## [0.8.7] 2026-05-31 · Python decorators
273
- - `decorators` field on Python symbols + `get_call_graph`; traces
274
- `@router.get(...)` handler and stacked decorators.
275
-
276
- ## [0.8.6] — 2026-05-31 · Unused parameter detection
277
- - **`find_unused_params`** tool + **`ast-map unused-params`** CLI: named functions
278
- whose params are never referenced (low false-positive; counts object shorthand).
279
-
280
- ## [0.8.5] 2026-05-31 · Cyclomatic complexity
281
- - **`get_complexity`** tool + **`ast-map complexity`** CLI: per-function score with
282
- low/moderate/high/very-high ratings and directory hotspots.
283
-
284
- ## [0.8.4] 2026-05-31 · Duplicate symbol detection
285
- - **`find_duplicate_symbols`** tool + **`ast-map duplicates`** CLI: exported names
286
- declared in 2+ files.
287
-
288
- ## [0.8.3] — 2026-05-31 · TSX/React component props
289
- - Component symbols carry `propsType` + `props[]`; detects `React.FC<P>` and
290
- JSX-returning PascalCase functions. MCP server version now read from package.json.
291
-
292
- ## [0.8.2]2026-05-30 · Swift cross-file wiring
293
- - `import <Module>` that module's files (`Sources/<Module>/`). Completes
294
- cross-file graph/resolver support for all four v0.8.0 languages.
295
-
296
- ## [0.8.1] 2026-05-30 · Kotlin + C/C++ cross-file wiring
297
- - Kotlin FQCN/package index; C/C++ `#include` resolution with header↔impl pairing.
298
- - Fixes: parse-cache rel-path leak; Kotlin call-graph extraction.
299
-
300
- ---
301
-
302
- ## Earlier (pre-session history)
303
-
304
- - **0.8.0** +4 languages: C · C++ · Kotlin · Swift (symbol extraction + imports).
305
- - **0.7.0** Go full module resolution; C# reverse `calledBy`; 4-suite test harness.
306
- - **0.6.0** +3 languages: Rust · Java · C#; cross-language resolver.
307
- - **0.5.x** — `/ast-map` skill auto-install; iterative DFS; barrel re-exports; parse cache; call-graph aliases; `.ast-map.config.json`.
308
- - **0.4.0** `search_symbol`, `get_file_deps`, `get_top_symbols`, dead-code tiers.
309
- - **0.3.0** — CLI; `find_dead_code`, `find_circular_deps`, `get_change_impact`, `get_call_graph`.
310
- - **0.2.0**import extraction; `resolve_imports`; `build_symbol_graph`.
311
- - **0.1.0** `get_skeleton_json`, `generate_skeleton`, `get_symbol_context`, `validate_architecture`.
312
-
313
- [1.13.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.13.0
314
- [1.12.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.12.0
315
- [1.11.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.11.0
316
- [1.10.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.10.0
317
- [1.9.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.9.0
318
- [1.8.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.8.0
319
- [1.7.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.7.0
320
- [1.6.0]: https://github.com/6ixthxense/AST-MCP/releases/tag/v1.6.0
321
- [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 2× > 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