@angular-modernizer/adapter-mcp 0.3.0 → 1.1.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 (298) hide show
  1. package/README.md +181 -282
  2. package/dist/cli.js +21 -13
  3. package/dist/core/project-analyzer.d.ts +3 -12
  4. package/dist/core/project-analyzer.js +3 -12
  5. package/dist/index.d.ts +122 -6
  6. package/dist/index.js +49 -5
  7. package/dist/mcp-watcher.d.ts +32 -7
  8. package/dist/mcp-watcher.js +16 -15
  9. package/dist/scan-host/scan-host.d.ts +119 -0
  10. package/dist/scan-host/scan-host.js +376 -0
  11. package/dist/scan-host/scan-protocol.d.ts +35 -0
  12. package/dist/scan-host/scan-protocol.js +6 -0
  13. package/dist/scan-host/scan-worker.d.ts +14 -0
  14. package/dist/scan-host/scan-worker.js +48 -0
  15. package/dist/server/limited-stdio-transport.d.ts +75 -0
  16. package/dist/server/limited-stdio-transport.js +115 -0
  17. package/dist/server/mcp-server.d.ts +20 -18
  18. package/dist/server/mcp-server.js +42 -79
  19. package/dist/server/package-version.d.ts +16 -0
  20. package/dist/server/package-version.js +37 -0
  21. package/dist/server/sdk-server.d.ts +71 -0
  22. package/dist/server/sdk-server.js +113 -0
  23. package/dist/server/tool-registry.d.ts +6 -9
  24. package/dist/server/tool-registry.js +6 -12
  25. package/dist/streaming/progress-store.d.ts +22 -5
  26. package/dist/streaming/progress-store.js +9 -5
  27. package/dist/tools/analyze-build-impact.d.ts +276 -35
  28. package/dist/tools/analyze-build-impact.js +175 -28
  29. package/dist/tools/analyze-core-to-shared.d.ts +176 -16
  30. package/dist/tools/analyze-core-to-shared.js +124 -19
  31. package/dist/tools/analyze-parser-performance.d.ts +209 -15
  32. package/dist/tools/analyze-parser-performance.js +119 -56
  33. package/dist/tools/analyze-project.d.ts +349 -17
  34. package/dist/tools/analyze-project.js +282 -97
  35. package/dist/tools/check-incremental-compatibility.d.ts +74 -12
  36. package/dist/tools/check-incremental-compatibility.js +69 -10
  37. package/dist/tools/collect-feedback.d.ts +225 -21
  38. package/dist/tools/collect-feedback.js +199 -118
  39. package/dist/tools/compare-health.d.ts +413 -0
  40. package/dist/tools/compare-health.js +479 -0
  41. package/dist/tools/extract-libraries.d.ts +200 -24
  42. package/dist/tools/extract-libraries.js +131 -27
  43. package/dist/tools/find-angular-symbol.d.ts +92 -24
  44. package/dist/tools/find-angular-symbol.js +70 -20
  45. package/dist/tools/find-component-hosts.d.ts +603 -27
  46. package/dist/tools/find-component-hosts.js +223 -19
  47. package/dist/tools/find-usages.d.ts +102 -22
  48. package/dist/tools/find-usages.js +81 -21
  49. package/dist/tools/get-bootstrap-execution.d.ts +183 -25
  50. package/dist/tools/get-bootstrap-execution.js +109 -25
  51. package/dist/tools/get-call-graph.d.ts +127 -12
  52. package/dist/tools/get-call-graph.js +84 -19
  53. package/dist/tools/get-operation-progress-tool.d.ts +126 -8
  54. package/dist/tools/get-operation-progress-tool.js +124 -12
  55. package/dist/tools/get-operation-progress.d.ts +27 -1
  56. package/dist/tools/get-operation-progress.js +5 -5
  57. package/dist/tools/helpers/analysis-output.d.ts +182 -0
  58. package/dist/tools/helpers/analysis-output.js +165 -0
  59. package/dist/tools/helpers/batch-kernel.d.ts +14 -0
  60. package/dist/tools/helpers/batch-kernel.js +12 -0
  61. package/dist/tools/helpers/build-schemas.d.ts +36 -0
  62. package/dist/tools/helpers/build-schemas.js +23 -0
  63. package/dist/tools/helpers/citation-file-source.d.ts +10 -0
  64. package/dist/tools/helpers/citation-file-source.js +82 -0
  65. package/dist/tools/helpers/compact-output.d.ts +2 -1
  66. package/dist/tools/helpers/compact-output.js +2 -1
  67. package/dist/tools/helpers/finding-window.d.ts +43 -0
  68. package/dist/tools/helpers/finding-window.js +64 -0
  69. package/dist/tools/helpers/health-delta.d.ts +99 -0
  70. package/dist/tools/helpers/health-delta.js +236 -0
  71. package/dist/tools/helpers/investigation-schemas.d.ts +93 -0
  72. package/dist/tools/helpers/investigation-schemas.js +48 -0
  73. package/dist/tools/helpers/library-imports.d.ts +57 -0
  74. package/dist/tools/helpers/library-imports.js +151 -0
  75. package/dist/tools/helpers/load-source-files.d.ts +30 -0
  76. package/dist/tools/helpers/load-source-files.js +34 -0
  77. package/dist/tools/helpers/output-contract.d.ts +32 -0
  78. package/dist/tools/helpers/output-contract.js +32 -0
  79. package/dist/tools/helpers/platform-root-resolver.d.ts +55 -25
  80. package/dist/tools/helpers/platform-root-resolver.js +75 -48
  81. package/dist/tools/helpers/process-output.d.ts +19 -0
  82. package/dist/tools/helpers/process-output.js +31 -0
  83. package/dist/tools/helpers/project-cache.d.ts +60 -37
  84. package/dist/tools/helpers/project-cache.js +54 -37
  85. package/dist/tools/helpers/project-decorators.d.ts +14 -0
  86. package/dist/tools/helpers/project-decorators.js +22 -0
  87. package/dist/tools/helpers/rule-matcher.js +5 -0
  88. package/dist/tools/helpers/rule-runner.d.ts +25 -13
  89. package/dist/tools/helpers/rule-runner.js +45 -24
  90. package/dist/tools/helpers/scan-cache.d.ts +22 -0
  91. package/dist/tools/helpers/scan-cache.js +34 -0
  92. package/dist/tools/helpers/scan-engine.d.ts +107 -0
  93. package/dist/tools/helpers/scan-engine.js +197 -0
  94. package/dist/tools/helpers/scan-plan.d.ts +5 -2
  95. package/dist/tools/helpers/scan-plan.js +18 -3
  96. package/dist/tools/helpers/scope-paths.d.ts +17 -0
  97. package/dist/tools/helpers/scope-paths.js +32 -0
  98. package/dist/tools/helpers/suggestion-generator.d.ts +9 -13
  99. package/dist/tools/helpers/suggestion-generator.js +0 -12
  100. package/dist/tools/helpers/tool-cache.d.ts +11 -0
  101. package/dist/tools/helpers/tool-cache.js +15 -0
  102. package/dist/tools/helpers/tool-context.d.ts +63 -0
  103. package/dist/tools/helpers/tool-context.js +79 -0
  104. package/dist/tools/helpers/transform-safety.d.ts +40 -0
  105. package/dist/tools/helpers/transform-safety.js +87 -0
  106. package/dist/tools/helpers/validation-output.d.ts +53 -0
  107. package/dist/tools/helpers/validation-output.js +48 -0
  108. package/dist/tools/inspect-form-group.d.ts +262 -24
  109. package/dist/tools/inspect-form-group.js +134 -13
  110. package/dist/tools/inspect-i18n.d.ts +410 -23
  111. package/dist/tools/inspect-i18n.js +213 -13
  112. package/dist/tools/inspect-template.d.ts +260 -22
  113. package/dist/tools/inspect-template.js +174 -13
  114. package/dist/tools/learn-patterns.d.ts +210 -13
  115. package/dist/tools/learn-patterns.js +113 -12
  116. package/dist/tools/list-imports.d.ts +152 -34
  117. package/dist/tools/list-imports.js +124 -18
  118. package/dist/tools/orchestrate-migration.d.ts +159 -14
  119. package/dist/tools/orchestrate-migration.js +147 -20
  120. package/dist/tools/parse-stack-trace.d.ts +78 -21
  121. package/dist/tools/parse-stack-trace.js +44 -7
  122. package/dist/tools/plan-migration.d.ts +395 -26
  123. package/dist/tools/plan-migration.js +173 -22
  124. package/dist/tools/resolve-type.d.ts +57 -9
  125. package/dist/tools/resolve-type.js +49 -12
  126. package/dist/tools/review-feedback.d.ts +214 -16
  127. package/dist/tools/review-feedback.js +142 -57
  128. package/dist/tools/rollback-changes.d.ts +88 -7
  129. package/dist/tools/rollback-changes.js +74 -19
  130. package/dist/tools/run-angular-cli.d.ts +57 -12
  131. package/dist/tools/run-angular-cli.js +76 -13
  132. package/dist/tools/run-build.d.ts +127 -13
  133. package/dist/tools/run-build.js +128 -16
  134. package/dist/tools/run-schematic.d.ts +82 -12
  135. package/dist/tools/run-schematic.js +115 -18
  136. package/dist/tools/scan-all.d.ts +88 -23
  137. package/dist/tools/scan-all.js +161 -220
  138. package/dist/tools/scan-angular.d.ts +60 -19
  139. package/dist/tools/scan-angular.js +100 -141
  140. package/dist/tools/scan-architecture.d.ts +92 -24
  141. package/dist/tools/scan-architecture.js +268 -211
  142. package/dist/tools/scan-solid.d.ts +59 -19
  143. package/dist/tools/scan-solid.js +98 -139
  144. package/dist/tools/search-codebase.d.ts +110 -23
  145. package/dist/tools/search-codebase.js +67 -11
  146. package/dist/tools/server-status.d.ts +392 -26
  147. package/dist/tools/server-status.js +260 -27
  148. package/dist/tools/suggest-improvements.d.ts +105 -10
  149. package/dist/tools/suggest-improvements.js +91 -51
  150. package/dist/tools/trace-output-flow.d.ts +713 -26
  151. package/dist/tools/trace-output-flow.js +396 -33
  152. package/dist/tools/transform-code-batch.d.ts +3 -0
  153. package/dist/tools/transform-code-batch.js +10 -5
  154. package/dist/tools/transform-code.d.ts +402 -18
  155. package/dist/tools/transform-code.js +708 -649
  156. package/dist/tools/validate-before-transform.d.ts +136 -7
  157. package/dist/tools/validate-before-transform.js +65 -9
  158. package/dist/tools/validate-project-compatibility.d.ts +82 -15
  159. package/dist/tools/validate-project-compatibility.js +84 -15
  160. package/dist/tools/validate-transformation.d.ts +243 -8
  161. package/dist/tools/validate-transformation.js +127 -23
  162. package/dist/tools/verify-citations.d.ts +202 -0
  163. package/dist/tools/verify-citations.js +221 -0
  164. package/dist/types.d.ts +78 -11
  165. package/dist/types.js +0 -5
  166. package/dist/utils/format-tool-response.d.ts +22 -59
  167. package/dist/utils/format-tool-response.js +25 -134
  168. package/package.json +31 -20
  169. package/dist/cli.d.ts.map +0 -1
  170. package/dist/cli.js.map +0 -1
  171. package/dist/core/project-analyzer.d.ts.map +0 -1
  172. package/dist/core/project-analyzer.js.map +0 -1
  173. package/dist/index.d.ts.map +0 -1
  174. package/dist/index.js.map +0 -1
  175. package/dist/mcp-watcher.d.ts.map +0 -1
  176. package/dist/mcp-watcher.js.map +0 -1
  177. package/dist/server/json-rpc-handler.d.ts +0 -98
  178. package/dist/server/json-rpc-handler.d.ts.map +0 -1
  179. package/dist/server/json-rpc-handler.js +0 -301
  180. package/dist/server/json-rpc-handler.js.map +0 -1
  181. package/dist/server/mcp-server.d.ts.map +0 -1
  182. package/dist/server/mcp-server.js.map +0 -1
  183. package/dist/server/stdio-guard.d.ts.map +0 -1
  184. package/dist/server/stdio-guard.js.map +0 -1
  185. package/dist/server/tool-registry.d.ts.map +0 -1
  186. package/dist/server/tool-registry.js.map +0 -1
  187. package/dist/streaming/progress-store.d.ts.map +0 -1
  188. package/dist/streaming/progress-store.js.map +0 -1
  189. package/dist/tools/analyze-build-impact.d.ts.map +0 -1
  190. package/dist/tools/analyze-build-impact.js.map +0 -1
  191. package/dist/tools/analyze-core-to-shared.d.ts.map +0 -1
  192. package/dist/tools/analyze-core-to-shared.js.map +0 -1
  193. package/dist/tools/analyze-parser-performance.d.ts.map +0 -1
  194. package/dist/tools/analyze-parser-performance.js.map +0 -1
  195. package/dist/tools/analyze-project.d.ts.map +0 -1
  196. package/dist/tools/analyze-project.js.map +0 -1
  197. package/dist/tools/check-incremental-compatibility.d.ts.map +0 -1
  198. package/dist/tools/check-incremental-compatibility.js.map +0 -1
  199. package/dist/tools/collect-feedback.d.ts.map +0 -1
  200. package/dist/tools/collect-feedback.js.map +0 -1
  201. package/dist/tools/extract-libraries.d.ts.map +0 -1
  202. package/dist/tools/extract-libraries.js.map +0 -1
  203. package/dist/tools/find-angular-symbol.d.ts.map +0 -1
  204. package/dist/tools/find-angular-symbol.js.map +0 -1
  205. package/dist/tools/find-component-hosts.d.ts.map +0 -1
  206. package/dist/tools/find-component-hosts.js.map +0 -1
  207. package/dist/tools/find-usages.d.ts.map +0 -1
  208. package/dist/tools/find-usages.js.map +0 -1
  209. package/dist/tools/get-bootstrap-execution.d.ts.map +0 -1
  210. package/dist/tools/get-bootstrap-execution.js.map +0 -1
  211. package/dist/tools/get-call-graph.d.ts.map +0 -1
  212. package/dist/tools/get-call-graph.js.map +0 -1
  213. package/dist/tools/get-operation-progress-tool.d.ts.map +0 -1
  214. package/dist/tools/get-operation-progress-tool.js.map +0 -1
  215. package/dist/tools/get-operation-progress.d.ts.map +0 -1
  216. package/dist/tools/get-operation-progress.js.map +0 -1
  217. package/dist/tools/helpers/compact-output.d.ts.map +0 -1
  218. package/dist/tools/helpers/compact-output.js.map +0 -1
  219. package/dist/tools/helpers/feedback-analyzer.d.ts.map +0 -1
  220. package/dist/tools/helpers/feedback-analyzer.js.map +0 -1
  221. package/dist/tools/helpers/find-ts-config.d.ts.map +0 -1
  222. package/dist/tools/helpers/find-ts-config.js.map +0 -1
  223. package/dist/tools/helpers/platform-root-resolver.d.ts.map +0 -1
  224. package/dist/tools/helpers/platform-root-resolver.js.map +0 -1
  225. package/dist/tools/helpers/project-cache.d.ts.map +0 -1
  226. package/dist/tools/helpers/project-cache.js.map +0 -1
  227. package/dist/tools/helpers/rule-matcher.d.ts.map +0 -1
  228. package/dist/tools/helpers/rule-matcher.js.map +0 -1
  229. package/dist/tools/helpers/rule-runner.d.ts.map +0 -1
  230. package/dist/tools/helpers/rule-runner.js.map +0 -1
  231. package/dist/tools/helpers/scan-plan.d.ts.map +0 -1
  232. package/dist/tools/helpers/scan-plan.js.map +0 -1
  233. package/dist/tools/helpers/stack-frame-file-index.d.ts.map +0 -1
  234. package/dist/tools/helpers/stack-frame-file-index.js.map +0 -1
  235. package/dist/tools/helpers/suggestion-generator.d.ts.map +0 -1
  236. package/dist/tools/helpers/suggestion-generator.js.map +0 -1
  237. package/dist/tools/inspect-form-group.d.ts.map +0 -1
  238. package/dist/tools/inspect-form-group.js.map +0 -1
  239. package/dist/tools/inspect-i18n.d.ts.map +0 -1
  240. package/dist/tools/inspect-i18n.js.map +0 -1
  241. package/dist/tools/inspect-template.d.ts.map +0 -1
  242. package/dist/tools/inspect-template.js.map +0 -1
  243. package/dist/tools/learn-patterns.d.ts.map +0 -1
  244. package/dist/tools/learn-patterns.js.map +0 -1
  245. package/dist/tools/list-imports.d.ts.map +0 -1
  246. package/dist/tools/list-imports.js.map +0 -1
  247. package/dist/tools/orchestrate-migration.d.ts.map +0 -1
  248. package/dist/tools/orchestrate-migration.js.map +0 -1
  249. package/dist/tools/parse-stack-trace.d.ts.map +0 -1
  250. package/dist/tools/parse-stack-trace.js.map +0 -1
  251. package/dist/tools/plan-migration.d.ts.map +0 -1
  252. package/dist/tools/plan-migration.js.map +0 -1
  253. package/dist/tools/resolve-type.d.ts.map +0 -1
  254. package/dist/tools/resolve-type.js.map +0 -1
  255. package/dist/tools/review-feedback.d.ts.map +0 -1
  256. package/dist/tools/review-feedback.js.map +0 -1
  257. package/dist/tools/rollback-changes.d.ts.map +0 -1
  258. package/dist/tools/rollback-changes.js.map +0 -1
  259. package/dist/tools/run-angular-cli.d.ts.map +0 -1
  260. package/dist/tools/run-angular-cli.js.map +0 -1
  261. package/dist/tools/run-build.d.ts.map +0 -1
  262. package/dist/tools/run-build.js.map +0 -1
  263. package/dist/tools/run-schematic.d.ts.map +0 -1
  264. package/dist/tools/run-schematic.js.map +0 -1
  265. package/dist/tools/scan-all.d.ts.map +0 -1
  266. package/dist/tools/scan-all.js.map +0 -1
  267. package/dist/tools/scan-angular.d.ts.map +0 -1
  268. package/dist/tools/scan-angular.js.map +0 -1
  269. package/dist/tools/scan-architecture.d.ts.map +0 -1
  270. package/dist/tools/scan-architecture.js.map +0 -1
  271. package/dist/tools/scan-solid.d.ts.map +0 -1
  272. package/dist/tools/scan-solid.js.map +0 -1
  273. package/dist/tools/search-codebase.d.ts.map +0 -1
  274. package/dist/tools/search-codebase.js.map +0 -1
  275. package/dist/tools/server-status.d.ts.map +0 -1
  276. package/dist/tools/server-status.js.map +0 -1
  277. package/dist/tools/shared/scan-types.d.ts +0 -200
  278. package/dist/tools/shared/scan-types.d.ts.map +0 -1
  279. package/dist/tools/shared/scan-types.js +0 -7
  280. package/dist/tools/shared/scan-types.js.map +0 -1
  281. package/dist/tools/suggest-improvements.d.ts.map +0 -1
  282. package/dist/tools/suggest-improvements.js.map +0 -1
  283. package/dist/tools/trace-output-flow.d.ts.map +0 -1
  284. package/dist/tools/trace-output-flow.js.map +0 -1
  285. package/dist/tools/transform-code-batch.d.ts.map +0 -1
  286. package/dist/tools/transform-code-batch.js.map +0 -1
  287. package/dist/tools/transform-code.d.ts.map +0 -1
  288. package/dist/tools/transform-code.js.map +0 -1
  289. package/dist/tools/validate-before-transform.d.ts.map +0 -1
  290. package/dist/tools/validate-before-transform.js.map +0 -1
  291. package/dist/tools/validate-project-compatibility.d.ts.map +0 -1
  292. package/dist/tools/validate-project-compatibility.js.map +0 -1
  293. package/dist/tools/validate-transformation.d.ts.map +0 -1
  294. package/dist/tools/validate-transformation.js.map +0 -1
  295. package/dist/types.d.ts.map +0 -1
  296. package/dist/types.js.map +0 -1
  297. package/dist/utils/format-tool-response.d.ts.map +0 -1
  298. package/dist/utils/format-tool-response.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @angular-modernizer/adapter-mcp
2
2
 
3
- MCP server that exposes Angular Modernizer capabilities as 39 structured tools for AI assistants.
3
+ MCP server that exposes Angular Modernizer capabilities as 41 structured tools for AI assistants.
4
4
 
5
5
  ---
6
6
 
@@ -17,35 +17,53 @@ Tools are designed for LLM consumption with structured I/O, pre-validation, auto
17
17
  ```
18
18
  AI Assistant (Claude/Copilot)
19
19
  |
20
- | JSON-RPC 2.0 (stdio)
20
+ | MCP over stdio (JSON-RPC 2.0, MCP TypeScript SDK)
21
+ | protocol eras 2025-06-18 / 2025-11-25 (initialize), 2026-07-28 (server/discover)
21
22
  v
22
23
  MCP Server (adapter-mcp)
23
- - 39 Tools (analysis, planning, transformation,
24
- build and validation, feedback, bug investigation)
25
- - Shared ts-morph ProjectCache
26
- - Real-time Progress Monitoring
27
- - Parameter Validation
28
- - Result Serialization
24
+ - 41 Tools (analysis, planning, transformation,
25
+ build and validation, rollback, feedback, bug investigation)
26
+ - Input validation against closed JSON schemas
27
+ - structuredContent validated against each outputSchema, plus a summary text
28
+ - Native MCP progress and cancellation
29
+ - Shared ts-morph ProjectCache (investigation tools, build impact, plan-migration)
30
+ | |
31
+ | Kernel per call | direct calls
32
+ | (scans, transform-code, ...) | (14 investigation tools)
33
+ v |
34
+ Core Platform (Kernel + Plugins) |
35
+ - Analysis rules (52) |
36
+ - Architecture: 17 |
37
+ - Angular: 28 |
38
+ - SOLID: 7 |
39
+ - Transformations (26 types via transform-code)
40
+ - Safety envelope: backup, type check, rollback
41
+ - Caching, worker parallelism, workflow engine
42
+ | |
43
+ | context.api |
44
+ v v
45
+ Public API (@angular-modernizer/api)
46
+ - Analysis and transformation building blocks
47
+ - Investigation: usages, call graph, types, templates, forms, i18n
29
48
  |
30
- | TypeScript API
49
+ | ts-morph AST, TypeScript type checker, @angular/compiler (templates)
31
50
  v
32
- Core Platform (Kernel + Plugins)
33
- - Analysis Rules (52 rules total)
34
- - Architecture: 17 rules
35
- - Angular: 28 rules
36
- - SOLID: 7 rules
37
- - Transformations (19 types via transform-code)
38
- - Caching
39
- - Orchestration
40
- |
41
- | ts-morph AST
42
- v
43
- TypeScript Project
44
- - Source Files
45
- - Type Checking
46
- - Semantic Analysis
51
+ TypeScript / Angular Project
52
+ - Source files and templates
53
+ - Type checking
54
+ - Semantic analysis
47
55
  ```
48
56
 
57
+ ### Protocol
58
+
59
+ The server runs on the official MCP TypeScript SDK (`@modelcontextprotocol/server`) over stdio and serves both protocol eras on one connection type: clients that open with `initialize` get the revision they ask for (2025-06-18, 2025-11-25), clients that open with `server/discover` get 2026-07-28. Tool results are identical in both eras. Only the `tools` capability is announced. A response above 4 MB is replaced by an error result that names the tool and how to narrow the request.
60
+
61
+ Arguments are validated against each tool's input schema (JSON Schema 2020-12) before the tool runs. Wrong types, missing required arguments and unknown argument names come back as an error result (`isError: true`) naming the offending argument. A tool that reports a failure in its result (`success: false` or `status: "failed"`, e.g. a build that exits with an error) also answers with `isError: true`; the result details stay in `structuredContent`.
62
+
63
+ Every tool has an output schema and answers with `structuredContent`: the result object, which always carries a `summary` string. The text content holds only that summary (repeating the JSON there made the answers 1.6 times as large; Claude Code shows the model `structuredContent`). `structuredContent` is validated against the output schema; a result that does not match comes back as an error result. Tools that run a command (run-angular-cli, run-build, run-schematic) keep the full output in the result and repeat only its last lines in the summary on failure. orchestrate-migration reports its step counts in `counts` and `workflowId` at the top level.
64
+
65
+ Set `ANGULAR_MODERNIZER_DEBUG=1` in the server environment for diagnostics: a debug log `./mcp-server.log` in the working directory and a health check on `http://localhost:9999/health` and `/status`. Both are off by default.
66
+
49
67
  ---
50
68
 
51
69
  ## Quick Start
@@ -72,12 +90,10 @@ Create `.angular-modernizer.json` in your project root. Only `build` is required
72
90
  },
73
91
  "tools": {
74
92
  "analyze-project": {
75
- "excludePatterns": ["**/node_modules/**", "**/dist/**"],
76
- "orchestration": { "parallel": true, "autoSelectMode": true }
93
+ "excludePatterns": ["**/node_modules/**", "**/dist/**"]
77
94
  },
78
95
  "scan-architecture": {
79
- "maxFiles": 500,
80
- "orchestration": { "parallel": true, "enableProgress": true }
96
+ "maxFiles": 500
81
97
  }
82
98
  }
83
99
  }
@@ -109,7 +125,8 @@ Or point a client at a local build, e.g. `.mcp.json` / `claude_desktop_config.js
109
125
  ```
110
126
 
111
127
  `--expose-gc` lets the ProjectCache collect garbage after evicting a project. `cli.js` also takes
112
- `--max-projects N` and `--max-heap-mb N` (defaults 3 and 2048). A running client keeps the old code in memory
128
+ `--max-projects N` and `--max-heap-mb N` (defaults 3 and 2048; the heap limit also applies to the scan worker) and
129
+ `--scan-worker 0` (scans on the main thread instead of a worker thread). A running client keeps the old code in memory
113
130
  after a rebuild; reconnect, or check `server-status` (`build.rebuiltSinceStart`).
114
131
 
115
132
  ---
@@ -125,10 +142,13 @@ after a rebuild; reconnect, or check `server-status` (`build.rebuiltSinceStart`)
125
142
  | scan-solid | SOLID principle violations | 7 | yes | 3-15s |
126
143
  | scan-angular | Angular best practices | 28 | yes | 5-20s |
127
144
  | scan-all | Combined analysis (all plugins) | 52 | yes | 10-45s |
145
+ | compare-health | Full scan compared with the previous run: new, fixed and unchanged violations per rule and file; answers with `structuredContent` | 52 | yes (scan-all cache) | scan-all time |
128
146
  | analyze-core-to-shared | Dependency violation analysis | - | yes | 3-10s |
129
147
  | analyze-parser-performance | Parser metrics from feedback sessions | - | no | varies |
130
148
  | extract-libraries | Library extraction candidates (shared folders, secondary entry points) | - | no | varies |
131
- | learn-patterns | ML-based pattern discovery | - | yes | 10-60s |
149
+ | learn-patterns | Pattern discovery with AST heuristics, stored in a knowledge base | - | yes | 10-60s |
150
+
151
+ The scans, analyze-project, analyze-core-to-shared and extract-libraries keep their numbers in `counts` (for the scans `totalViolations`, `analyzedFiles`, `bySeverity`, `byCategory`, `byRule`, always over all violations); `summary` is a short text with the totals, the largest rules and categories, the first five entries and the returned page. `violations` holds only the page set by `maxResults` and `resultOffset`, `pagination` says what was cut.
132
152
 
133
153
  #### analyze-project
134
154
 
@@ -150,8 +170,8 @@ Key features:
150
170
  - Up to 39x speedup with caching (202.8s to 5.2s measured)
151
171
  - Parallel execution with auto-selection
152
172
  - Time budget `maxDurationMs` (default 300000, `0` = off): checked between files; on overrun the scan returns what it has with `execution.incomplete`, `skippedFiles` and a note. `execution.ruleTimings` lists time per rule, slowest first. Note that `maxFiles` defaults to 100.
153
- - Pagination: `maxResults` (default 1000) and `resultOffset` page the violations; `summary` counts all of them, `pagination.hasMore` says whether to fetch the next page. Pass `rules` (exact rule ids such as `solid:circular-dependency`) for a focused scan.
154
- - `streaming` defaults to `true`: the call returns an `operationId`; poll `get-operation-progress` for the result, or pass `streaming: false`.
173
+ - Pagination: `maxResults` (default 1000) and `resultOffset` page the violations; `counts` cover all of them, `pagination.hasMore` says whether to fetch the next page. Pass `rules` (exact rule ids such as `solid:circular-dependency`) for a focused scan.
174
+ - Progress (`notifications/progress`, with a `progressToken`) and cancellation between files, see Progress and Cancellation. `streaming` (deprecated) defaults to `false`: the call returns the violations. With `streaming: true` it returns an `operationId` at once and `get-operation-progress` returns the result.
155
175
 
156
176
  #### scan-solid
157
177
 
@@ -176,14 +196,24 @@ Key features:
176
196
 
177
197
  #### scan-all
178
198
 
179
- Runs all 52 analysis rules (17 architecture + 7 SOLID + 28 Angular) with cross-cache reading for maximum efficiency.
199
+ Runs all 52 analysis rules (17 architecture + 7 SOLID + 28 Angular) with its own cache in `.angular-modernizer-cache/all/`.
180
200
 
181
201
  Key features:
182
202
  - Combines all plugin rules in single scan
183
- - Reads from fallback caches (architecture/solid/angular)
184
- - Up to 57% faster when individual scans run first
203
+ - Caches every analyzed file, also without findings, with its template findings and the template as dependency
204
+ - Reads and writes only its own cache; the caches of scan-architecture, scan-solid and scan-angular are not read
185
205
  - Comprehensive analysis in one execution
186
206
 
207
+ #### compare-health
208
+
209
+ Runs the scan-all scan over every violation (no result window), compares it with the snapshot of the previous run and stores the current run as the new snapshot.
210
+
211
+ Key features:
212
+ - Snapshot in `.angular-modernizer-cache/health/last-run.json` (`snapshotPath` overrides), git-ignored with the cache
213
+ - Violations match by rule, file and message with digits ignored, so moved lines stay unchanged
214
+ - `totals`, `byRule`, `byFile`, `newViolations`, `fixedViolations`, `rulesAdded`; `summaryOnly` and `maxResults` as in the investigation tools
215
+ - First run writes the baseline; a snapshot with other `rules` or patterns is reported as `scope-mismatch` and kept unless `updateSnapshot: true`; `updateSnapshot: false` compares without writing
216
+
187
217
  #### analyze-core-to-shared
188
218
 
189
219
  Detects when the core layer imports from the shared layer (architectural anti-pattern) with reverse dependency impact assessment.
@@ -204,13 +234,21 @@ Key features:
204
234
  - Generates custom analysis rules from patterns
205
235
  - Tracks pattern evolution across scans
206
236
 
237
+ ### Feedback Tools
238
+
239
+ | Tool | Purpose | Cache | Time |
240
+ |-|-|-|-|
241
+ | collect-feedback | Store the outcome of a transformation or a corrected analysis result | no | <1s |
242
+ | review-feedback | Patterns, quality trends and warnings from stored feedback | no | varies |
243
+ | suggest-improvements | Rule adjustment suggestions from feedback patterns | no | varies |
244
+
207
245
  #### collect-feedback
208
246
 
209
247
  Manually collect transformation feedback for AI learning with privacy-first design.
210
248
 
211
249
  Key features:
212
250
  - Privacy-first: hashed file paths, no code snippets, bucketed metrics
213
- - Dual-location storage (project + platform root)
251
+ - Stored in `<projectRoot>/.claude-feedback`; a second, platform-wide store only when `ANGULAR_MODERNIZER_PLATFORM_ROOT` is set
214
252
  - Automated validation (6 checks) and quality scoring
215
253
  - Outlier detection (4 types) for anomaly handling
216
254
  - Learning extraction from transformation outcomes
@@ -238,6 +276,8 @@ Usage:
238
276
  }
239
277
  ```
240
278
 
279
+ Storage: feedback always goes to `<projectRoot>/.claude-feedback/sessions/`. `both` (default) adds the platform store only when `ANGULAR_MODERNIZER_PLATFORM_ROOT` is set; `platform` requires that variable and fails without it. The server never derives a platform location from its own install path (installed from npm that would be the workspace root or a `node_modules` / npx cache).
280
+
241
281
  Returns:
242
282
  - `feedbackId`: unique identifier for this feedback
243
283
  - `sessionId`: session this feedback belongs to
@@ -273,7 +313,7 @@ Returns `kind`, `sessionId`, `stored`, `storageLocations` and per-record `record
273
313
  Review collected feedback and extract actionable insights for AI learning.
274
314
 
275
315
  Key features:
276
- - Reads from both project and platform locations (dual-source)
316
+ - Reads `<projectRoot>/.claude-feedback`, plus the platform store when `ANGULAR_MODERNIZER_PLATFORM_ROOT` is set (`sourcesRead` lists the folders)
277
317
  - Pattern detection: success patterns (>=3 occurrences, >=80% success rate)
278
318
  - Failure patterns (>=2 occurrences) for early warning
279
319
  - Quality trend analysis (improved/degraded/unchanged)
@@ -300,6 +340,7 @@ Returns:
300
340
  - `insights`: array of detected patterns with confidence scores
301
341
  - `qualityWarnings`: warnings about low-quality feedback
302
342
  - `sourcesRead`: locations where feedback was read from
343
+ - `analysisRecords`, `analysisInsights`: number of analysis records and the insights drawn from them
303
344
 
304
345
  #### suggest-improvements
305
346
 
@@ -329,19 +370,22 @@ Usage:
329
370
 
330
371
  Returns:
331
372
  - `ruleId`: rule these suggestions apply to
373
+ - `currentPerformance`: `successRate`, `avgDuration`, `qualityImprovement` of the rule
332
374
  - `suggestions`: array of suggestions sorted by confidence (descending)
333
- - `totalFeedback`: number of feedback records analyzed
334
- - `successRate`: current rule success rate
375
+ - `feedbackCount`: number of feedback records analyzed
376
+ - `analysisFeedbackCount`: number of analysis records for this tool
377
+ - `sourcesRead`: locations where feedback was read from
335
378
 
336
379
  Example suggestion:
337
380
 
338
381
  ```json
339
382
  {
340
383
  "type": "parameter-adjustment",
341
- "confidence": 0.85,
342
- "suggestion": "Lower confidence threshold from 0.95 to 0.85",
343
- "reasoning": "3 high-confidence failures detected, threshold too aggressive",
344
- "expectedImprovement": "Reduce false positives by 40%",
384
+ "description": "Lower confidence threshold for this rule",
385
+ "reasoning": "3 failures occurred with high confidence (>0.8), suggesting overconfidence in predictions",
386
+ "confidence": 0.8,
387
+ "expectedImprovement": "Reduce false positives by 21%",
388
+ "implementation": "Adjust rule confidence threshold from 0.8 to 0.9. Review decision-making logic to improve accuracy.",
345
389
  "requiresApproval": true
346
390
  }
347
391
  ```
@@ -367,12 +411,14 @@ Key features:
367
411
  - Team context integration (velocity, experience, availability)
368
412
  - Multi-phase roadmap generation (strategy templates when no file paths are given, `planSource: "template"`)
369
413
  - Identifies style-conflicting steps
414
+ - `summary` names strategy, roadmap and scan plan as text; the scan-based plan adds `warnings` when library imports do not resolve
415
+ - `scanResultFile` also accepts a saved MCP result (`structuredContent` of scan-architecture or scan-all)
370
416
 
371
417
  ### Transformation Tools
372
418
 
373
419
  | Tool | Purpose | Cache | Time |
374
420
  |-|-|-|-|
375
- | transform-code | 19 transformation types | no | varies |
421
+ | transform-code | 26 transformation types | no | varies |
376
422
  | run-schematic | Angular schematic execution | no | varies |
377
423
  | run-angular-cli | CLI command execution | no | varies |
378
424
  | run-build | Multi-build system support | no | varies |
@@ -381,7 +427,7 @@ Key features:
381
427
 
382
428
  Applies surgical code transformations with pre-validation, backup, build validation, and automatic rollback.
383
429
 
384
- 19 transformation types:
430
+ 26 transformation types:
385
431
  1. constructor-to-inject
386
432
  2. interface-extraction
387
433
  3. standalone-migration
@@ -401,23 +447,34 @@ Applies surgical code transformations with pre-validation, backup, build validat
401
447
  17. subscription-transform
402
448
  18. missing-output-transform
403
449
  19. library-extraction
404
-
405
- Safety features:
406
- - Pre-transformation validation (syntax, types, schema)
407
- - Automatic file backup before changes
408
- - Build validation (ensures code compiles)
409
- - Auto-rollback on build failure (prevents broken code)
410
- - Post-transformation validation (lint, tests)
411
- - Batch mode with all-or-nothing strategy
412
-
413
- Build validation parameters:
414
- - `validateBuild: boolean` - run build after transformation (default: true)
415
- - `rollbackOnBuildFailure: boolean` - auto-rollback on build errors (default: true)
450
+ 20. service-bag-transform
451
+ 21. any-to-interface
452
+ 22. dto-object-literal
453
+ 23. interface-duplication
454
+ 24. static-class-to-functions
455
+ 25. extract-static-from-stateful
456
+ 26. type-safety
457
+
458
+ plugin-angular transform rules run only for the requested type: transform-code passes `transformationType` and the call's `options` under the `'@angular-modernizer/plugin-angular'` config key.
459
+
460
+ Safety features (single file, batch and streaming alike):
461
+ - Pre-transformation validation (syntax, types, schema) on the same kernel load as the transformation
462
+ - Backup in `<projectRoot>/.angular-modernizer-backups` (`backupDir` overrides): a copy per file with a metadata file next to it, plus a git snapshot (`git stash create`, working tree and stash list untouched) inside a git repository (`backup.gitSnapshot`)
463
+ - Type check of the transformed file: only errors the transformation introduced count (`validation.introducedTypeErrors`)
464
+ - Build validation (`validateBuild`), project lint only on request (`validateLint`)
465
+ - Automatic rollback when validation fails (`autoRollback`)
466
+ - Batch mode backs up all files first and applies `rollbackStrategy` (`all-or-nothing`, `selective`, `none`)
467
+ - `rollback-changes` restores the same backups later (`strategy`: `auto`, `file-backup`, `git-stash`)
468
+
469
+ Validation parameters:
470
+ - `validateBuild: boolean` - run the project build after transformation (default: false; the transformed file is type-checked either way); `buildValidation` is reported only when it ran
471
+ - `validateLint: boolean` - run the project's lint script (default: false; it lints the whole project)
416
472
  - `buildTimeout: number` - build timeout in ms (default: 300000 = 5 min)
417
- - `projectRoot: string` - project root for build execution
473
+ - `projectRoot: string` - project root for backups and build execution
418
474
 
419
- Diff format parameters:
420
- - `diffFormat: 'unified' | 'structured' | 'both'` - diff output format in streaming mode (default: 'structured')
475
+ Build validation (`validateBuild`) runs `build.command` of `.angular-modernizer.json`, else the detected build system (`npx ng build`, `npx nx build`, `npx vite build`), else the `build` script of `package.json`; without one the build is skipped with a warning. A cancelled call restores the backup (see Progress and Cancellation).
476
+
477
+ Streaming (deprecated): `streaming` defaults to `false`. With `streaming: true` the call returns an `operationId` at once, runs the same path in the background and `get-operation-progress` returns the result. `diffFormat` has no effect.
421
478
  - `unified`: traditional git-style diff (human-readable, backward compatible)
422
479
  - `structured`: machine-first JSON diff with semantic annotations (AI-optimized)
423
480
  - `both`: include both formats (useful for debugging, higher overhead)
@@ -441,7 +498,7 @@ Supported build systems: Angular CLI, Nx, Vite, Webpack, npm
441
498
  | check-incremental-compatibility | Whether a project supports incremental build validation | no | varies |
442
499
  | validate-project-compatibility | Parser compatibility before transformations | no | varies |
443
500
  | analyze-build-impact | Changed files -> value, type-only and template dependents, affected modules, strategy | ProjectCache | ~1s warm |
444
- | get-operation-progress | Progress and result of a streaming operation | no | <1s |
501
+ | get-operation-progress | Deprecated: progress and result of a streaming operation | no | <1s |
445
502
 
446
503
  #### analyze-build-impact
447
504
 
@@ -452,71 +509,65 @@ names they re-export; past the first importer only exports whose type surface (a
452
509
  `@NgModule` exports) names a changed binding propagate, so using a class inside a method body or a decorator stops
453
510
  there. `symbols` narrows the impact to consumers of given exports (`symbolImpacts`). `.html` files map
454
511
  to their component (`mappedFiles`), which counts as changed without its dependents. `summaryOnly` / `maxResults`
455
- shorten the lists; `counts` always describe the full result.
512
+ shorten the lists; `counts` always describe the full result. `summary` repeats the recommendation and the counts as
513
+ text; `warnings` reports library imports that do not resolve, dependents can then be missing.
456
514
 
457
515
  ### Bug Investigation Tools
458
516
 
459
517
  Read-only tools over the shared ProjectCache: a workspace is parsed once per server and re-read per changed file.
460
- All list-heavy tools take `summaryOnly` and `maxResults`.
518
+ All list-heavy tools take `summaryOnly` and `maxResults`. All answer with `structuredContent` and a `summary` string.
519
+ When packages declared in the project's `package.json` do not resolve (no or incomplete `node_modules`), the tools that
520
+ load the program add `warnings` with the number of unresolved library imports: library types are then `any` and hosts,
521
+ callers and handlers can be missing from the result. The check runs once per loaded project (about 50 ms on 4000 files).
461
522
 
462
523
  | Tool | Answers |
463
524
  |-|-|
464
525
  | parse-stack-trace | Structured frames from Node.js / Angular / Zone.js / browser stacks, browser URLs and bare file names mapped onto project files |
465
526
  | find-usages | Every reference to a symbol, classified (declaration, read, write, call, template, unresolved) |
466
- | get-call-graph | Callers and callees of a method or function, incl. template callers; `maxNodes` caps the tree |
527
+ | get-call-graph | Callers and callees of a method or function, incl. template callers (own and inheriting subclass templates); `maxNodes` caps the tree |
467
528
  | resolve-type | TypeScript type at file:line:col (nullable, async, generics, declaration) |
468
529
  | find-angular-symbol | Components, directives, pipes, services, ... by selector, pipe name or class, incl. library classes from `.d.ts` |
469
530
  | search-codebase | Text, regex or declaration search, incl. `.html` and files outside the program |
470
- | list-imports | Imports and re-exports of a file with resolved targets (aliases, barrels) |
531
+ | list-imports | Imports and re-exports of a file with resolved targets (aliases, barrels); `counts` per kind |
471
532
  | inspect-template | Template structure: elements, bindings, matched components/directives/pipes, control flow, i18n keys |
472
533
  | find-component-hosts | Every template host of a component or directive with bound, unbound and missing required inputs/outputs; components created in code (dialogs, `createComponent`, routes) |
473
- | trace-output-flow | Payload of an `@Output` across the template boundary, and dialog data in / results out |
534
+ | trace-output-flow | Payload of an `@Output` across the template boundary and into subscriptions in code (`ref.instance.x.subscribe`), and dialog data in / results out |
474
535
  | get-bootstrap-execution | What runs at startup (initializers, bootstrap, interceptors, provider factories) and where a watched expression is touched |
475
536
  | inspect-form-group | Reactive Forms structure and every enable/disable/validator change per control |
476
537
  | inspect-i18n | Translation keys: definitions per language and overlay, usages in templates and code, missing and undefined keys |
538
+ | verify-citations | Whether the `path:line` citations of Markdown plans still point at the named code: ok, unverified, moved (new lines), anchor-missing, out-of-range, missing-file (similar files), ambiguous |
477
539
 
478
540
  ### Server
479
541
 
480
542
  | Tool | Purpose |
481
543
  |-|-|
482
- | server-status | pid, uptime, memory, cached projects, response sizes, and whether the dist was rebuilt since start |
544
+ | server-status | server version, pid, uptime, memory, cached projects, response sizes, and whether the dist was rebuilt since start |
483
545
 
484
546
  ---
485
547
 
486
548
  ## Advanced Features
487
549
 
488
- ### Cross-Cache Reading System
489
-
490
- `scan-all` reads from individual plugin caches written by `scan-architecture`, `scan-solid`, and `scan-angular`. When those tools have run first, `scan-all` avoids re-analyzing files it already has results for.
491
-
492
- Performance impact:
550
+ ### scan-all Cache
493
551
 
494
- ```
495
- Workflow: scan-architecture -> scan-solid -> scan-angular -> scan-all
496
-
497
- Without cross-cache: scan-all analyzes all 450 files
498
- With cross-cache: scan-all reads cached results (up to 57% reduction)
499
- ```
552
+ `scan-all` reads and writes only its own cache, `.angular-modernizer-cache/all/`. It does not read the caches written by `scan-architecture`, `scan-solid` and `scan-angular`. An earlier version did ("cross-cache reading"), but it opened them with its own cache version `scan-all-2`, so their entries never matched and were invalidated (deleted) on every scan-all run; a hit would also have returned only one plugin's findings. The individual scans keep writing and reading their own caches.
500
553
 
501
- Cache statistics example:
554
+ Cache statistics example (second run, nothing changed):
502
555
 
503
556
  ```json
504
557
  {
505
- "hitRate": 0.0,
558
+ "hitRate": 100,
506
559
  "hitsBySource": {
507
- "architecture": 150,
508
- "solid": 150,
509
- "angular": 150
560
+ "all": 450
510
561
  }
511
562
  }
512
563
  ```
513
564
 
514
- A `hitRate` of 0% with non-zero `hitsBySource` is correct: it means the primary cache (scan-all's own) is empty on the first run, but fallback caches from the other tools are being read successfully. The second `scan-all` run will have `hitRate > 0%`.
515
-
516
- Best practice: run individual scans first, then `scan-all` for maximum cache benefit.
565
+ `hitRate` and `hitsBySource` refer to the own cache (`all`) only. `hitRate` is a percentage. The first run has 0%; later runs analyze only changed files.
517
566
 
518
567
  ### Intelligent Mode Selection
519
568
 
569
+ > **Deprecated in 1.1:** `parallel` and `incremental` of analyze-project and scan-architecture select the old WorkerPool path, which will be removed in 2.0. On a large app (371 files) it was no faster than the default path (10.8-12.1 vs 10.3-13.1 s), blocked the server for up to 10.7 s and took about four times the memory; before 1.1 the automatic mode selection could fail with `Not implemented yet`. The default path runs the analysis in a scan worker. Leave these options unset; the text below describes the old path.
570
+
520
571
  The orchestration system automatically selects between Promise-based and worker thread parallelism based on project complexity score:
521
572
 
522
573
  ```
@@ -571,46 +622,38 @@ Example evolution output:
571
622
 
572
623
  ### Tool-Specific Configuration
573
624
 
574
- Create `.angular-modernizer.json`:
625
+ Per-tool defaults go under `tools` in `.angular-modernizer.json`; arguments of a call override them. The schema lists
626
+ the configurable tools (scan-architecture, scan-all, scan-angular, scan-solid, analyze-project, transform-code,
627
+ transform-code-batch, run-build, validate-transformation, collect-feedback, review-feedback, suggest-improvements) and
628
+ their keys; `orchestration` takes a different set of keys per tool. Other tools, such as learn-patterns, take their
629
+ options per call only.
575
630
 
576
631
  ```json
577
632
  {
578
- "analyze-project": {
579
- "rootPath": ".",
580
- "excludePatterns": ["**/node_modules/**", "**/dist/**"],
581
- "maxResults": 1000,
582
- "orchestration": {
583
- "parallel": true,
584
- "autoSelectMode": true,
585
- "enableProgress": true
586
- }
633
+ "build": {
634
+ "command": "ng build",
635
+ "mode": "incremental"
587
636
  },
588
- "scan-architecture": {
589
- "rootPath": ".",
590
- "maxFiles": 500,
591
- "includeAutoFixes": true,
592
- "orchestration": {
593
- "parallel": true,
594
- "incremental": false,
595
- "autoSelectMode": true,
596
- "enableProgress": true,
597
- "timeout": 120000
637
+ "tools": {
638
+ "analyze-project": {
639
+ "excludePatterns": ["**/node_modules/**", "**/dist/**"],
640
+ "maxResults": 1000
641
+ },
642
+ "scan-architecture": {
643
+ "maxFiles": 500,
644
+ "includeAutoFixes": true
645
+ },
646
+ "review-feedback": {
647
+ "source": "both",
648
+ "minConfidence": 0.7
598
649
  }
599
- },
600
- "learn-patterns": {
601
- "targetPath": ".",
602
- "categories": ["all"],
603
- "minOccurrences": 3,
604
- "enableLearning": true,
605
- "generateStyleProfile": true,
606
- "respectCodebaseStyle": true
607
650
  }
608
651
  }
609
652
  ```
610
653
 
611
654
  ### Cache Configuration
612
655
 
613
- Caching is enabled by default for analysis tools:
656
+ The scan tools cache per file with these built-in settings (not configurable):
614
657
 
615
658
  ```typescript
616
659
  cacheConfig: {
@@ -626,6 +669,7 @@ Cache locations:
626
669
  - `architecture`: `.angular-modernizer-cache/architecture/`
627
670
  - `solid`: `.angular-modernizer-cache/solid/`
628
671
  - `angular`: `.angular-modernizer-cache/angular/`
672
+ - `all` (scan-all): `.angular-modernizer-cache/all/`
629
673
  - `patterns`: `.angular-modernizer-cache/pattern-knowledge.json`
630
674
 
631
675
  When to clear cache:
@@ -639,14 +683,15 @@ rm -rf .angular-modernizer-cache
639
683
 
640
684
  ### Orchestration Tuning
641
685
 
642
- For large projects (500+ files):
686
+ > **Deprecated in 1.1:** `parallel` and `incremental` of analyze-project and scan-architecture select the old WorkerPool path, which will be removed in 2.0. On a large app (371 files) it was no faster than the default path (10.8-12.1 vs 10.3-13.1 s), blocked the server for up to 10.7 s and took about four times the memory; before 1.1 the automatic mode selection could fail with `Not implemented yet`. The default path runs the analysis in a scan worker. Leave these options unset; the text below describes the old path.
687
+
688
+ For large projects (500+ files), in `tools.scan-architecture` (or per call as the `orchestration` argument):
643
689
 
644
690
  ```json
645
691
  {
646
692
  "orchestration": {
647
693
  "parallel": true,
648
694
  "autoSelectMode": true,
649
- "maxWorkers": 6,
650
695
  "enableProgress": true,
651
696
  "enableMonitoring": true,
652
697
  "resourceLimits": {
@@ -709,16 +754,16 @@ Weekly: Full scan + pattern evolution check
709
754
 
710
755
  ### Cache Optimization
711
756
 
712
- Run individual scans before `scan-all`:
757
+ Each scan tool keeps its own cache, so repeated runs of the same tool are fast. `scan-all` does not reuse the individual caches; run either the individual scans or `scan-all`, not both, for a full picture:
713
758
 
714
759
  ```bash
715
- # Step 1: Individual scans (write plugin-specific caches)
760
+ # Individual scans (write plugin-specific caches)
716
761
  scan-architecture # Writes: .cache/architecture/
717
762
  scan-solid # Writes: .cache/solid/
718
763
  scan-angular # Writes: .cache/angular/
719
764
 
720
- # Step 2: Combined scan (reads from fallback caches)
721
- scan-all # Reads from all above caches (up to 57% faster)
765
+ # Combined scan: own cache only, does not read the caches above
766
+ scan-all # Writes and reads: .cache/all/
722
767
  ```
723
768
 
724
769
  Second run performance:
@@ -750,169 +795,23 @@ Batch transformations:
750
795
 
751
796
  ---
752
797
 
753
- ## Streaming Progress
798
+ ## Progress and Cancellation
754
799
 
755
- The streaming progress feature provides real-time feedback during long-running transformations through a polling-based architecture. AI assistants can monitor progress, display diffs, and detect errors as they occur.
800
+ Long-running tools report progress through MCP `notifications/progress` when the request carries `_meta.progressToken`, and stop when the client sends `notifications/cancelled` (Esc in Claude Code). Without a token no progress notification is sent. Notifications are throttled: the first and the last value, at most one per 250 ms.
756
801
 
757
- Key capabilities:
758
- - Real-time progress (percentage, phase, and ETA updates)
759
- - Unified diffs (git-style diffs for every file transformation)
760
- - Syntax validation (lightweight error detection without compilation)
761
- - Memory tracking (continuous heap usage monitoring)
762
- - Incremental polling (fetch only new events since last poll)
763
- - Zero overhead (only active when explicitly used)
764
-
765
- ### Architecture
766
-
767
- ```
768
- AI Assistant -> Start Operation -> Background Execution
769
- | | |
770
- Poll Progress -> ProgressStore <- Stream Events
771
- | |
772
- Display Updates Transform Files
773
- ```
774
-
775
- Polling pattern:
776
- 1. Start transformation, receive `operationId`
777
- 2. Poll `get-operation-progress` with `operationId`
778
- 3. Display progress, diffs, errors to user
779
- 4. Continue polling until `status: 'completed'`
780
-
781
- ### Quick Start
782
-
783
- Start a streaming operation:
784
-
785
- ```typescript
786
- {
787
- "tool": "transform-code",
788
- "arguments": {
789
- "transformation": "standalone-migration",
790
- "files": ["src/app/home/home.component.ts", "src/app/user/user.component.ts"],
791
- "streaming": true
792
- }
793
- }
794
-
795
- // Response
796
- {
797
- "operationId": "transform-20251209-123456-abc",
798
- "status": "running",
799
- "message": "Transformation started in background"
800
- }
801
- ```
802
-
803
- Poll for progress:
804
-
805
- ```typescript
806
- {
807
- "tool": "get-operation-progress",
808
- "arguments": {
809
- "operationId": "transform-20251209-123456-abc"
810
- }
811
- }
812
-
813
- // Response
814
- {
815
- "operationId": "transform-20251209-123456-abc",
816
- "status": "running",
817
- "events": [
818
- {
819
- "phase": "transforming",
820
- "percentage": 50,
821
- "message": "Transforming home.component.ts",
822
- "timestamp": 1733750401000,
823
- "diff": {
824
- "filePath": "src/app/home/home.component.ts",
825
- "diff": "--- src/app/home/home.component.ts\n+++ ...",
826
- "linesAdded": 4,
827
- "linesRemoved": 1
828
- }
829
- }
830
- ],
831
- "totalEvents": 5,
832
- "elapsedTime": 2500,
833
- "eta": 2500
834
- }
835
- ```
836
-
837
- Incremental polling (recommended):
838
-
839
- ```typescript
840
- // First poll: get all events
841
- const poll1 = await getProgress({ operationId });
842
-
843
- // Subsequent polls: get only new events
844
- const poll2 = await getProgress({
845
- operationId,
846
- sinceTimestamp: poll1.events[poll1.events.length - 1].timestamp,
847
- });
848
- ```
849
-
850
- ### Event Structure
851
-
852
- ```typescript
853
- interface StreamingProgressEvent {
854
- phase: 'analyzing' | 'transforming' | 'validating' | 'building' | 'complete';
855
- percentage: number; // 0-100
856
- message: string;
857
- timestamp: number; // Unix timestamp (ms)
858
-
859
- currentFile?: string;
860
-
861
- diff?: {
862
- filePath: string;
863
- diff: string; // Unified diff
864
- linesAdded: number;
865
- linesRemoved: number;
866
- };
867
-
868
- syntaxErrors?: Array<{
869
- filePath: string;
870
- line: number;
871
- message: string;
872
- }>;
873
-
874
- memoryUsage?: {
875
- heapUsed: number;
876
- heapTotal: number;
877
- percentage: number; // 0-100
878
- };
879
- }
880
- ```
802
+ | Tool | Progress | On cancel |
803
+ |-|-|-|
804
+ | scan-architecture, scan-all, scan-solid, scan-angular, analyze-project | files (`n/N files, v violations`); worker paths of analyze-project forward the kernel progress, batched scan-architecture reports per batch | stops between files |
805
+ | compare-health | through scan-all | no comparison, snapshot not written |
806
+ | transform-code | single file: 3 steps (loaded, transformed, validated); batch: files | restores the backup (also with `autoRollback: false`); a batch restores every file |
807
+ | run-build, run-angular-cli, run-schematic, validate-transformation | none | ends the build with its process tree (SIGTERM, SIGKILL after 5 s) |
808
+ | orchestrate-migration | steps | passes the cancel to the running step, runs no further step |
881
809
 
882
- ### Progress Phases
810
+ A cancelled request gets no response (MCP spec). Scans also stop while they add their files to the project (checked per file). Only the kernel's own project load (`kernel.initialize()`) and transform-code's load of its file cannot be interrupted; the cancel takes effect right after them. Direct callers of a scan get the analyzed part with `execution.stopReason: 'cancelled'`.
883
811
 
884
- ```
885
- analyzing (0-10%) : Project setup, file discovery
886
- transforming (10-90%) : Per-file AST transformation
887
- validating (90-95%) : Syntax validation
888
- building (95-98%) : Optional compilation check
889
- complete (100%) : Final summary
890
- ```
812
+ ### Streaming (deprecated)
891
813
 
892
- ### Performance Impact
893
-
894
- | Configuration | Overhead | Use Case |
895
- |-|-|-|
896
- | No streaming | 0% | Automation, CI/CD |
897
- | Minimal streaming | ~2-3% | Progress tracking only |
898
- | Full streaming | ~8-16% | AI assistants (diffs + validation) |
899
-
900
- Overhead breakdown:
901
- - Event generation: ~2-3%
902
- - Diff generation: ~5-10% (only modified files)
903
- - Syntax detection: ~1-2%
904
- - Memory tracking: <1%
905
-
906
- When to use streaming:
907
- - Long-running operations (>10 seconds)
908
- - Large projects (>100 files)
909
- - AI assistants requiring feedback
910
- - User needs diff visibility
911
-
912
- When to use batch (non-streaming):
913
- - Short operations (<10 seconds)
914
- - Automation/CI/CD
915
- - Performance-critical scenarios
814
+ `streaming: true` (transform-code, scan-architecture) and `get-operation-progress` stay in 1.x but are deprecated; `streaming` defaults to `false`. With `streaming: true` the call returns an `operationId` at once and runs in the background: transform-code runs its regular path (same backup, validation and rollback) and emits no events, scan-architecture emits phase events (0, 10, 20, 30 %, every 10 files up to 90 %, 100 % on completion). `get-operation-progress` returns `status`, the events and, once completed, the tool result in `result`. Operations expire 5 minutes after they end (10 minutes when stuck running). There is no way to cancel a streaming operation over MCP; call the tools synchronously instead.
916
815
 
917
816
  ---
918
817
 
@@ -930,10 +829,10 @@ Solutions:
930
829
 
931
830
  ### "Cache hit rate 0% - is cache working?"
932
831
 
933
- Yes, this is normal for the first run or for `scan-all` using the cross-cache system.
832
+ Yes, this is normal for the first run.
934
833
 
935
- - `hitRate: 0%` means the primary cache (scan-all's own plugin cache) is empty
936
- - `hitsBySource: {...}` with non-zero values means fallback caches are working correctly
834
+ - `hitRate: 0%` means the tool's own cache is empty (for `scan-all`: `.angular-modernizer-cache/all/`)
835
+ - `scan-all` does not read the caches of the individual scans, so running them first does not raise its hit rate
937
836
  - The second run will have `hitRate > 0%`
938
837
 
939
838
  ### "Worker threads not available (offline mode)"