universal-ast-mapper 1.28.0 → 2.0.1

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