@hexagen-monaco/sync 0.8.0 → 0.11.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 (198) hide show
  1. package/LICENSE +6 -0
  2. package/README.md +56 -8
  3. package/dist/application/ports/out/index.d.ts +1 -2
  4. package/dist/application/ports/out/index.d.ts.map +1 -1
  5. package/dist/application/ports/out/symbol-reference-index.port.d.ts +74 -0
  6. package/dist/application/ports/out/symbol-reference-index.port.d.ts.map +1 -0
  7. package/dist/application/use-cases/get-architecture-graph.use-case.d.ts +1 -1
  8. package/dist/application/use-cases/get-architecture-graph.use-case.d.ts.map +1 -1
  9. package/dist/application/use-cases/get-linter-report.use-case.d.ts +1 -1
  10. package/dist/application/use-cases/get-linter-report.use-case.d.ts.map +1 -1
  11. package/dist/application/use-cases/index.d.ts +0 -1
  12. package/dist/application/use-cases/index.d.ts.map +1 -1
  13. package/dist/application/use-cases/refactoring-impact.use-case.d.ts +24 -6
  14. package/dist/application/use-cases/refactoring-impact.use-case.d.ts.map +1 -1
  15. package/dist/arch-linter-bin.d.ts +19 -3
  16. package/dist/arch-linter-bin.d.ts.map +1 -1
  17. package/dist/cli.js +4430 -6205
  18. package/dist/cli.js.map +1 -1
  19. package/dist/commands/add/index.d.ts +6 -0
  20. package/dist/commands/add/index.d.ts.map +1 -1
  21. package/dist/commands/add/validate.d.ts.map +1 -1
  22. package/dist/commands/adopt/index.d.ts +24 -0
  23. package/dist/commands/adopt/index.d.ts.map +1 -0
  24. package/dist/commands/bootstrap/index.d.ts +41 -0
  25. package/dist/commands/bootstrap/index.d.ts.map +1 -0
  26. package/dist/commands/bootstrap.d.ts +30 -0
  27. package/dist/commands/bootstrap.d.ts.map +1 -0
  28. package/dist/commands/report/baseline-read.d.ts +12 -0
  29. package/dist/commands/report/baseline-read.d.ts.map +1 -0
  30. package/dist/commands/report/build-report.d.ts +13 -0
  31. package/dist/commands/report/build-report.d.ts.map +1 -0
  32. package/dist/commands/report/context-map.d.ts +9 -0
  33. package/dist/commands/report/context-map.d.ts.map +1 -0
  34. package/dist/commands/report/exec-git.d.ts +3 -0
  35. package/dist/commands/report/exec-git.d.ts.map +1 -0
  36. package/dist/commands/report/handoff.d.ts +3 -0
  37. package/dist/commands/report/handoff.d.ts.map +1 -0
  38. package/dist/commands/report/index.d.ts +14 -0
  39. package/dist/commands/report/index.d.ts.map +1 -0
  40. package/dist/commands/report/lint-collect.d.ts +4 -0
  41. package/dist/commands/report/lint-collect.d.ts.map +1 -0
  42. package/dist/commands/report/ratchet-trend.d.ts +3 -0
  43. package/dist/commands/report/ratchet-trend.d.ts.map +1 -0
  44. package/dist/commands/report/render-html.d.ts +3 -0
  45. package/dist/commands/report/render-html.d.ts.map +1 -0
  46. package/dist/commands/report/render-markdown.d.ts +3 -0
  47. package/dist/commands/report/render-markdown.d.ts.map +1 -0
  48. package/dist/commands/report/types.d.ts +52 -0
  49. package/dist/commands/report/types.d.ts.map +1 -0
  50. package/dist/commands/report/zip-store.d.ts +10 -0
  51. package/dist/commands/report/zip-store.d.ts.map +1 -0
  52. package/dist/commands/shared/detect-workspaces.d.ts +12 -0
  53. package/dist/commands/shared/detect-workspaces.d.ts.map +1 -0
  54. package/dist/commands/shared/index.d.ts +1 -1
  55. package/dist/commands/shared/index.d.ts.map +1 -1
  56. package/dist/commands/shared/project-root.d.ts +7 -0
  57. package/dist/commands/shared/project-root.d.ts.map +1 -1
  58. package/dist/domain/services/emission-plan-builder.d.ts +14 -3
  59. package/dist/domain/services/emission-plan-builder.d.ts.map +1 -1
  60. package/dist/domain/services/impact-analysis.types.d.ts +6 -1
  61. package/dist/domain/services/impact-analysis.types.d.ts.map +1 -1
  62. package/dist/domain/services/index.d.ts +2 -0
  63. package/dist/domain/services/index.d.ts.map +1 -1
  64. package/dist/domain/services/layer-classifier.d.ts +53 -2
  65. package/dist/domain/services/layer-classifier.d.ts.map +1 -1
  66. package/dist/domain/services/layer-dir-resolver.d.ts +63 -0
  67. package/dist/domain/services/layer-dir-resolver.d.ts.map +1 -0
  68. package/dist/domain/services/name-normalizer.d.ts +35 -0
  69. package/dist/domain/services/name-normalizer.d.ts.map +1 -0
  70. package/dist/domain/services/stub-template-resolver.d.ts +33 -2
  71. package/dist/domain/services/stub-template-resolver.d.ts.map +1 -1
  72. package/dist/generators/apps-framework-templates.d.ts.map +1 -1
  73. package/dist/generators/apps.d.ts.map +1 -1
  74. package/dist/generators/architecture-file-templates.d.ts +2 -2
  75. package/dist/generators/architecture-file-templates.d.ts.map +1 -1
  76. package/dist/generators/architecture-files.d.ts.map +1 -1
  77. package/dist/generators/cross-context.d.ts.map +1 -1
  78. package/dist/generators/eslint.d.ts +2 -0
  79. package/dist/generators/eslint.d.ts.map +1 -1
  80. package/dist/generators/layer-folders.d.ts.map +1 -1
  81. package/dist/generators/package-json.d.ts.map +1 -1
  82. package/dist/generators/root-file-templates.d.ts +1 -1
  83. package/dist/generators/root-file-templates.d.ts.map +1 -1
  84. package/dist/generators/root-files.d.ts.map +1 -1
  85. package/dist/generators/stubs.d.ts +4 -1
  86. package/dist/generators/stubs.d.ts.map +1 -1
  87. package/dist/index.d.ts +23 -3
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +1663 -5150
  90. package/dist/index.js.map +1 -1
  91. package/dist/infrastructure/adapters/index.d.ts +1 -0
  92. package/dist/infrastructure/adapters/index.d.ts.map +1 -1
  93. package/dist/infrastructure/adapters/ts-morph-symbol-index.adapter.d.ts +47 -0
  94. package/dist/infrastructure/adapters/ts-morph-symbol-index.adapter.d.ts.map +1 -0
  95. package/dist/infrastructure/config/layout-schema.d.ts +29 -0
  96. package/dist/infrastructure/config/layout-schema.d.ts.map +1 -0
  97. package/dist/infrastructure/config/load-layout-config.d.ts +8 -0
  98. package/dist/infrastructure/config/load-layout-config.d.ts.map +1 -0
  99. package/dist/linter.d.ts +24 -0
  100. package/dist/linter.d.ts.map +1 -1
  101. package/dist/manifest-service.d.ts.map +1 -1
  102. package/dist/refactoring/impact-analyzer.d.ts +7 -2
  103. package/dist/refactoring/impact-analyzer.d.ts.map +1 -1
  104. package/dist/sync-engine.d.ts.map +1 -1
  105. package/dist/templates/adobe-creative-production/files/src/domain/ports/out/creative-production.port.ts +2 -4
  106. package/dist/templates/adobe-creative-production/files/src/infrastructure/adobe/creative-production/creative-production.adapter.ts +8 -7
  107. package/dist/templates/adobe-express/files/src/domain/ports/out/express.port.ts +2 -4
  108. package/dist/templates/adobe-express/files/src/infrastructure/adobe/express/express.adapter.ts +9 -8
  109. package/dist/templates/adobe-firefly-composite/files/src/domain/ports/out/composite.port.ts +2 -4
  110. package/dist/templates/adobe-firefly-composite/files/src/infrastructure/adobe/composite/composite.adapter.ts +12 -12
  111. package/dist/templates/adobe-firefly-content-tagging/files/src/domain/ports/out/content-tagging.port.ts +2 -4
  112. package/dist/templates/adobe-firefly-content-tagging/files/src/infrastructure/adobe/content-tagging/content-tagging.adapter.ts +6 -5
  113. package/dist/templates/adobe-firefly-core/README.md +1 -1
  114. package/dist/templates/adobe-firefly-core/files/src/domain/errors/creative-service-error.ts +62 -0
  115. package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/errors/to-creative-service-error.ts +45 -0
  116. package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/index.ts +9 -0
  117. package/dist/templates/adobe-firefly-core/manifest.json +2 -0
  118. package/dist/templates/adobe-firefly-custom-models/files/src/domain/ports/out/custom-model.port.ts +5 -7
  119. package/dist/templates/adobe-firefly-custom-models/files/src/infrastructure/adobe/custom-models/firefly-custom-model.adapter.ts +16 -15
  120. package/dist/templates/adobe-firefly-generate/files/src/domain/ports/out/image-generation.port.ts +6 -8
  121. package/dist/templates/adobe-firefly-generate/files/src/infrastructure/adobe/generate/firefly-generate.adapter.ts +14 -16
  122. package/dist/templates/adobe-firefly-media/files/src/domain/ports/out/media-generation.port.ts +6 -8
  123. package/dist/templates/adobe-firefly-media/files/src/infrastructure/adobe/media/firefly-media.adapter.ts +11 -10
  124. package/dist/templates/adobe-firefly-upscale/files/src/domain/ports/out/upscale.port.ts +2 -4
  125. package/dist/templates/adobe-firefly-upscale/files/src/infrastructure/adobe/upscale/upscale.adapter.ts +13 -11
  126. package/dist/templates/adobe-illustrator/files/src/domain/ports/out/illustrator.port.ts +4 -6
  127. package/dist/templates/adobe-illustrator/files/src/infrastructure/adobe/illustrator/illustrator.adapter.ts +17 -15
  128. package/dist/templates/adobe-indesign/files/src/domain/ports/out/indesign.port.ts +4 -6
  129. package/dist/templates/adobe-indesign/files/src/infrastructure/adobe/indesign/indesign.adapter.ts +10 -9
  130. package/dist/templates/adobe-lightroom/files/src/domain/ports/out/lightroom.port.ts +4 -6
  131. package/dist/templates/adobe-lightroom/files/src/infrastructure/adobe/lightroom/lightroom.adapter.ts +10 -9
  132. package/dist/templates/adobe-photoshop/files/src/domain/ports/out/photoshop-automation.port.ts +6 -8
  133. package/dist/templates/adobe-photoshop/files/src/infrastructure/adobe/photoshop/photoshop-automation.adapter.ts +12 -11
  134. package/dist/templates/adobe-substance-3d/files/src/domain/ports/out/substance-3d.port.ts +4 -6
  135. package/dist/templates/adobe-substance-3d/files/src/infrastructure/adobe/substance-3d/substance-3d.adapter.ts +10 -9
  136. package/dist/templates/agents-md/files/.agents/tech-stack.md +3 -4
  137. package/dist/templates/agents-md/files/.agents/testing.md +9 -9
  138. package/dist/templates/agents-md/files/AGENTS.md +5 -5
  139. package/dist/templates/bedrock-agentcore-runtime/files/src/application/ports/agent-runtime.port.ts +25 -0
  140. package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/invocations.handler.ts +1 -1
  141. package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/server.ts +1 -1
  142. package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/runtime/payload.ts +5 -22
  143. package/dist/templates/bedrock-agentcore-runtime/manifest.json +1 -0
  144. package/dist/templates/ci-github-actions/README.md +13 -7
  145. package/dist/templates/ci-github-actions/files/.github/dependabot.yml +9 -2
  146. package/dist/templates/ci-github-actions/files/.github/workflows/ci.yml +18 -14
  147. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-fly.yml +12 -6
  148. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-railway.yml +14 -8
  149. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vercel.yml +29 -8
  150. package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vps.yml +14 -8
  151. package/dist/templates/ci-github-actions/files/.github/workflows/preview.yml +34 -18
  152. package/dist/templates/ci-github-actions/manifest.json +2 -2
  153. package/dist/templates/docker/README.md +3 -0
  154. package/dist/templates/docker/files/.github/workflows/docker-build.yml +15 -6
  155. package/dist/templates/docker/manifest.json +1 -0
  156. package/dist/templates/llm-adapter/files/src/domain/errors/llm-error.ts +35 -0
  157. package/dist/templates/llm-adapter/files/src/domain/ports/out/llm-client.port.ts +1 -1
  158. package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/anthropic-llm-client.adapter.ts +1 -1
  159. package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/azure-openai-llm-client.adapter.ts +1 -1
  160. package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/ollama-llm-client.adapter.ts +1 -1
  161. package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/openai-llm-client.adapter.ts +1 -1
  162. package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/xai-llm-client.adapter.ts +1 -1
  163. package/dist/templates/llm-adapter/files/src/infrastructure/llm/errors/llm-errors.ts +9 -23
  164. package/dist/templates/llm-adapter/files/src/infrastructure/llm/index.ts +4 -3
  165. package/dist/templates/llm-adapter/files/src/infrastructure/llm/router/llm-router.ts +1 -1
  166. package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/retry.ts +1 -1
  167. package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/structured-output.ts +1 -1
  168. package/dist/templates/llm-adapter/manifest.json +1 -0
  169. package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/adapters/bedrock-llm-client.adapter.ts +1 -1
  170. package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/errors/bedrock-errors.ts +1 -1
  171. package/dist/templates/mcp-server/README.md +1 -1
  172. package/dist/templates/mcp-server/files/src/infrastructure/mcp/registry/tool-registry.test.ts +1 -1
  173. package/dist/templates/mcp-server/files/src/infrastructure/mcp/tools/example.tool.test.ts +1 -1
  174. package/dist/templates/mcp-server-http/README.md +1 -1
  175. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/bearer.test.ts +1 -1
  176. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/auth/oauth.test.ts +1 -1
  177. package/dist/templates/mcp-server-http/files/src/infrastructure/mcp/guard.test.ts +1 -1
  178. package/dist/types/manifest/apps.d.ts +1 -1
  179. package/dist/types/manifest/apps.d.ts.map +1 -1
  180. package/package.json +6 -5
  181. package/dist/application/ports/out/project-configuration-read.port.d.ts +0 -9
  182. package/dist/application/ports/out/project-configuration-read.port.d.ts.map +0 -1
  183. package/dist/application/ports/out/symbol-reference-provider.port.d.ts +0 -10
  184. package/dist/application/ports/out/symbol-reference-provider.port.d.ts.map +0 -1
  185. package/dist/application/use-cases/get-manifest-resource.use-case.d.ts +0 -8
  186. package/dist/application/use-cases/get-manifest-resource.use-case.d.ts.map +0 -1
  187. package/dist/generators/validators/index.d.ts +0 -11
  188. package/dist/generators/validators/index.d.ts.map +0 -1
  189. package/dist/generators/validators/validate-dependencies.d.ts +0 -7
  190. package/dist/generators/validators/validate-dependencies.d.ts.map +0 -1
  191. package/dist/generators/validators/validate-manifest-sync.d.ts +0 -5
  192. package/dist/generators/validators/validate-manifest-sync.d.ts.map +0 -1
  193. package/dist/generators/validators/validate-port-adapter.d.ts +0 -5
  194. package/dist/generators/validators/validate-port-adapter.d.ts.map +0 -1
  195. package/dist/generators/validators/validation-types.d.ts +0 -20
  196. package/dist/generators/validators/validation-types.d.ts.map +0 -1
  197. package/dist/generators/validators.d.ts +0 -7
  198. package/dist/generators/validators.d.ts.map +0 -1
package/LICENSE CHANGED
@@ -1,3 +1,9 @@
1
+ This is the proprietary platform license for Hexagen-Monaco (the web
2
+ application, hosted services, and any package that does not carry its own
3
+ LICENSE file). The published wedge packages `@hexagen-monaco/sync` and
4
+ `@hexagen-monaco/arch-linter` are licensed separately; see the LICENSE file
5
+ in each package.
6
+
1
7
  KRAKOWSKI CLOUD SOLUTIONS LLC - SOURCE-AVAILABLE EVALUATION LICENSE
2
8
 
3
9
  Copyright (c) 2026 Krakowski Cloud Solutions, LLC
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @hexagen-monaco/sync
2
2
 
3
- > The HexaGen Monaco sync engine — a CLI that generates and maintains modular, Hexagonal-architecture monorepos from a single `manifest.yaml`.
3
+ > The Hexagen-Monaco sync engine — a CLI that generates and maintains modular, Hexagonal-architecture monorepos from a single `manifest.yaml`.
4
4
 
5
5
  ---
6
6
 
@@ -15,7 +15,7 @@ pnpm add @hexagen-monaco/sync
15
15
  ```
16
16
 
17
17
  `@hexagen-monaco/sync` ships as a self-contained ESM package with only two runtime
18
- dependencies (`commander`, `js-yaml`). All internal HexaGen packages
18
+ dependencies (`commander`, `js-yaml`). All internal Hexagen-Monaco packages
19
19
  (`@hexagen/governance`, `@hexagen/project-configuration`,
20
20
  `@hexagen/shared`, `@hexagen/visualization`) are bundled into the published
21
21
  artifact — consumers never see them in their `node_modules`.
@@ -56,13 +56,59 @@ Consult `npx hexagen arch --help` for the full list of manifest operations.
56
56
 
57
57
  ## Programmatic Usage
58
58
 
59
- The default export exposes the sync-engine surface used by the CLI. Types
60
- ship alongside the bundle.
59
+ > **The supported contract of this package is the `hexagen` binary.** The root
60
+ > barrel below is **provisional under 0.x** (ADR-0056): names may be withdrawn,
61
+ > and a withdrawal rides a **minor** — never a patch — and is listed by name in
62
+ > that release's `CHANGELOG.md` section. Programmatic use is permitted and
63
+ > unsupported. Prefer the CLI unless you are embedding the engine.
64
+ >
65
+ > _(Before 0.10.0 this section documented a `runSync` function. No such export
66
+ > has ever existed — the example was wrong for the life of the package.)_
61
67
 
62
- ```ts
63
- import { runSync } from "@hexagen-monaco/sync";
68
+ The barrel exposes the engine the CLI drives. Types ship alongside the bundle.
64
69
 
65
- await runSync({ mode: "external", workspaceRoot: process.cwd() });
70
+ ```ts
71
+ import { SyncEngine, type LoggerPort } from "@hexagen-monaco/sync";
72
+
73
+ const logger: LoggerPort = {
74
+ info: console.info,
75
+ warn: console.warn,
76
+ error: console.error,
77
+ debug: console.debug,
78
+ errorWithException: (err, message) => console.error(message, err),
79
+ };
80
+
81
+ const dryRun = false;
82
+
83
+ const engine = new SyncEngine(
84
+ {
85
+ mode: "external", // 'external' honours the workspace root you give it
86
+ dryRun,
87
+ force: false,
88
+ forceRoot: false,
89
+ allowDirty: false,
90
+ strict: false,
91
+ logger,
92
+ },
93
+ { targetRoot: process.cwd() },
94
+ );
95
+
96
+ const summary = await engine.run();
97
+
98
+ // `run()` RESOLVES when a generator fails soft — it does not throw. Check the
99
+ // count, or a partial tree reads as success.
100
+ if (summary.errors > 0) {
101
+ throw new Error(`sync finished with ${summary.errors} generator failure(s)`);
102
+ }
103
+
104
+ // Only needed if you set `dryRun: true`. A missing
105
+ // `.architecture/manifest.yaml` REJECTS `run()` on a real run, but a dry run
106
+ // tolerates it by synthesizing an empty manifest — which plans ops against
107
+ // nothing and still resolves with `errors: 0`. That is the same fact the CLI
108
+ // gates `--check` on.
109
+ if (dryRun && summary.manifestMissing) {
110
+ throw new Error("no .architecture/manifest.yaml in the target workspace");
111
+ }
66
112
  ```
67
113
 
68
114
  The package is ESM-only (`"type": "module"`). Consumers that still use
@@ -178,4 +224,6 @@ The source `packages/sync/package.json` is never mutated by this process.
178
224
 
179
225
  ## License
180
226
 
181
- Source-Available Evaluation License — proprietary to Krakowski Cloud Solutions, LLC. Free to read, run locally, and evaluate for internal/non-commercial use; **not** licensed for commercial production deployment. See [LICENSE](./LICENSE).
227
+ Licensed under the Source-Available Evaluation License. See [LICENSE](./LICENSE).
228
+
229
+ The Hexagen-Monaco name is a trademark of Krakowski Cloud Solutions, LLC.
@@ -1,9 +1,8 @@
1
1
  export * from "./ownership-registry.port.js";
2
2
  export * from "./generator-config.port.js";
3
- export * from "./project-configuration-read.port.js";
4
3
  export * from "./architecture-graph-provider.port.js";
5
4
  export * from "./linter-report-provider.port.js";
6
5
  export * from "./workspace-file-provider.port.js";
7
- export * from "./symbol-reference-provider.port.js";
6
+ export * from "./symbol-reference-index.port.js";
8
7
  export * from "./file-system.port.js";
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/out/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/out/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The refactoring analyser's view of a parsed workspace (HEX-013, item 5.7).
3
+ *
4
+ * WHY A PORT AT ALL. `RefactoringImpactUseCase` previously constructed a
5
+ * ts-morph `Project` itself and passed live `SourceFile` nodes to its
6
+ * collaborator. That made a concrete third-party parser — one that bundles its
7
+ * own TypeScript compiler, so its version is a semantic fact and not a detail
8
+ * (AUD-012) — a compile-time dependency of the application layer, in a package
9
+ * that is *published* and pointed at arbitrary consumer workspaces.
10
+ *
11
+ * WHY THIS SHAPE AND NOT A PARSER FACADE. The port is deliberately NOT a
12
+ * narrowed `SourceFile`. Everything the use case does with a parsed file is:
13
+ * - decide whether the file mentions the symbol at all, and
14
+ * - obtain a human-readable sentence saying how (`getModificationReason`),
15
+ * - read the file's path, to classify layer and package.
16
+ * Nothing else about the AST ever escapes: `classifyFiles` turns each hit into
17
+ * a `FileToModify` of four strings, and every step after that
18
+ * (`detectCrossPackageDependencies`, `assessArchitecturalImpact`,
19
+ * `generateWarnings`, `estimateChanges`) operates on those strings alone. So
20
+ * the port yields exactly those two fields and no node types. A port that
21
+ * mirrored `getInterfaces()` / `getClasses()` / `getImportDeclarations()`
22
+ * would have relocated the dependency without removing it — the caller would
23
+ * still be programming against ts-morph's object model under new names.
24
+ *
25
+ * WHY IT IS STATEFUL. The analyser loads packages and apps in separate
26
+ * recursive passes and then asks one question of the whole set, so the index
27
+ * accumulates across `indexFiles` calls and `findReferences` answers over
28
+ * everything indexed so far. That is the pre-existing semantics preserved
29
+ * exactly; collapsing it into one call would quietly change what a second
30
+ * `analyze()` on the same instance sees.
31
+ *
32
+ * EXTENSION POINT (RI-2). `SymbolReferenceDto` is a per-file RECORD rather
33
+ * than a bare `path -> reason` pair precisely so the known defect tracked as
34
+ * RI-2 in `docs/planning/2026-08-16-ratchet-and-parser-integrity-plan.md` —
35
+ * the analyser discards syntactic diagnostics, so an unparseable consumer file
36
+ * yields a confident, wrong report — can be fixed additively: an optional
37
+ * `diagnostics` field here, populated by the adapter, consumed by
38
+ * `generateWarnings`. No such field is added today, because a field no
39
+ * producer fills and no consumer reads is not a fix; the point is only that
40
+ * the shape leaves room for one.
41
+ */
42
+ /** One file that mentions the symbol under analysis. Plain data, no AST. */
43
+ export interface SymbolReferenceDto {
44
+ /**
45
+ * Absolute path to the file, slash-separated on every host.
46
+ *
47
+ * The dialect is part of the contract, not an accident of the
48
+ * implementation: `toWorkspaceRelativePosixPath` subtracts a *native*
49
+ * workspace root from this string, and the old literal-prefix strip was a
50
+ * no-op on Windows because the two dialects never matched (AUD-012).
51
+ */
52
+ readonly filePath: string;
53
+ /**
54
+ * Why this file appears in the impact report — e.g. `Declares interface
55
+ * OrderRepositoryPort`, `Imports OrderRepositoryPort`. Surfaced verbatim to
56
+ * the user as `FileToModify.reason`.
57
+ */
58
+ readonly reason: string;
59
+ }
60
+ /** A parsed, queryable index of workspace source files. */
61
+ export interface SymbolReferenceIndexPort {
62
+ /**
63
+ * Add source files to the index. Additive: files indexed by earlier calls
64
+ * remain queryable. Implementations may throw if a path cannot be read; the
65
+ * use case turns that into an error `Result`.
66
+ */
67
+ indexFiles(filePaths: readonly string[]): void;
68
+ /**
69
+ * Every indexed file that references `symbolName`, with the reason it does.
70
+ * Files that never mention the symbol are omitted entirely.
71
+ */
72
+ findReferences(symbolName: string): readonly SymbolReferenceDto[];
73
+ }
74
+ //# sourceMappingURL=symbol-reference-index.port.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbol-reference-index.port.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/out/symbol-reference-index.port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,2DAA2D;AAC3D,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,UAAU,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,kBAAkB,EAAE,CAAC;CACnE"}
@@ -1,4 +1,4 @@
1
- import { type ArchitectureGraph } from "@hexagen/visualization";
1
+ import type { ArchitectureGraph } from "@hexagen/visualization";
2
2
  import type { ArchitectureGraphProviderPort } from "../ports/out/architecture-graph-provider.port.js";
3
3
  export declare class GetArchitectureGraphUseCase {
4
4
  private readonly provider;
@@ -1 +1 @@
1
- {"version":3,"file":"get-architecture-graph.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/get-architecture-graph.use-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEtG,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,6BAA6B;IAE9D,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAQ7D"}
1
+ {"version":3,"file":"get-architecture-graph.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/get-architecture-graph.use-case.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEtG,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,6BAA6B;IAE9D,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAc7D"}
@@ -1,4 +1,4 @@
1
- import { type LinterReport } from "@hexagen/governance";
1
+ import type { LinterReport } from "@hexagen/governance";
2
2
  import type { LinterReportProviderPort } from "../ports/out/linter-report-provider.port.js";
3
3
  export declare class GetLinterReportUseCase {
4
4
  private readonly provider;
@@ -1 +1 @@
1
- {"version":3,"file":"get-linter-report.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/get-linter-report.use-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,wBAAwB;IAEzD,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;CAQvC"}
1
+ {"version":3,"file":"get-linter-report.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/get-linter-report.use-case.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,wBAAwB;IAEzD,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;CAavC"}
@@ -1,4 +1,3 @@
1
- export * from "./get-manifest-resource.use-case.js";
2
1
  export * from "./get-architecture-graph.use-case.js";
3
2
  export * from "./get-linter-report.use-case.js";
4
3
  export * from "./migrate-manifest.use-case.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { type Result } from "../../domain/result.js";
2
2
  import type { Manifest } from "../../types/manifest.js";
3
3
  import type { WorkspaceFileProviderPort } from "../ports/out/workspace-file-provider.port.js";
4
- import type { SymbolReferenceProviderPort } from "../ports/out/symbol-reference-provider.port.js";
4
+ import type { SymbolReferenceIndexPort } from "../ports/out/symbol-reference-index.port.js";
5
+ import { type LayoutConfig } from "../../domain/services/layer-classifier.js";
5
6
  import type { RefactoringType, ImpactAnalysisResult } from "../../domain/services/impact-analysis.types.js";
6
7
  export interface ImpactAnalysisRequest {
7
8
  type: RefactoringType;
@@ -9,17 +10,34 @@ export interface ImpactAnalysisRequest {
9
10
  newName?: string;
10
11
  newLocation?: string;
11
12
  }
13
+ /**
14
+ * Analyses what a proposed refactoring would touch.
15
+ *
16
+ * The TypeScript parser sits behind `SymbolReferenceIndexPort` (HEX-013, item
17
+ * 5.7): this use case no longer constructs a ts-morph `Project` and no AST node
18
+ * ever reaches it. What crosses the boundary is `SymbolReferenceDto` — a file
19
+ * path and a reason sentence — from which every downstream step
20
+ * (classification, cross-package detection, boundary assessment, warnings) is
21
+ * derived by string work alone. Enumerating which files to hand the index
22
+ * stays here, because that is exactly such string work and it is where the
23
+ * exclusions (`node_modules`, build output, `.d.ts`) are decided.
24
+ */
12
25
  export declare class RefactoringImpactUseCase {
13
26
  private readonly workspaceRoot;
14
27
  private readonly manifest;
15
28
  private readonly fileProvider;
16
- private readonly symbolProvider;
17
- private project;
18
- constructor(workspaceRoot: string, manifest: Manifest, fileProvider: WorkspaceFileProviderPort, symbolProvider: SymbolReferenceProviderPort);
29
+ private readonly symbolIndex;
30
+ private readonly layoutConfig?;
31
+ constructor(workspaceRoot: string, manifest: Manifest, fileProvider: WorkspaceFileProviderPort, symbolIndex: SymbolReferenceIndexPort, layoutConfig?: LayoutConfig | undefined);
19
32
  analyze(request: ImpactAnalysisRequest): Promise<Result<ImpactAnalysisResult, Error>>;
20
33
  private loadWorkspaceFiles;
21
- private addSourceFilesRecursively;
22
- private findSymbolReferences;
34
+ /**
35
+ * Which files are worth parsing at all. Pure string work on paths the
36
+ * workspace provider reported, so it belongs on this side of the port: the
37
+ * exclusions (vendored trees, build output, ambient declarations) are an
38
+ * analyser policy, not a parser capability.
39
+ */
40
+ private collectSourceFilesRecursively;
23
41
  private classifyFiles;
24
42
  private detectCrossPackageDependencies;
25
43
  private assessImpact;
@@ -1 +1 @@
1
- {"version":3,"file":"refactoring-impact.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/refactoring-impact.use-case.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAIlG,OAAO,KAAK,EAAE,eAAe,EAAoE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAE9K,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,wBAAwB;IAIjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc;IANjC,OAAO,CAAC,OAAO,CAAU;gBAGN,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,yBAAyB,EACvC,cAAc,EAAE,2BAA2B;IAYxD,OAAO,CACX,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;YAiCjC,kBAAkB;IA6BhC,OAAO,CAAC,yBAAyB;IAqBjC,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,8BAA8B;IAsCtC,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,gBAAgB;IAgCxB,OAAO,CAAC,eAAe;CAGxB"}
1
+ {"version":3,"file":"refactoring-impact.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/refactoring-impact.use-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EACV,eAAe,EAKf,oBAAoB,EACrB,MAAM,gDAAgD,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,wBAAwB;IAEjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAJb,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,yBAAyB,EACvC,WAAW,EAAE,wBAAwB,EACrC,YAAY,CAAC,EAAE,YAAY,YAAA;IAGxC,OAAO,CACX,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;YA2CjC,kBAAkB;IAiChC;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAqBrC,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,8BAA8B;IAsCtC,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,gBAAgB;IAwCxB,OAAO,CAAC,eAAe;CAGxB"}
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Resolve the installed `hexagen-lint` bin by walking up from `startDir` to the
3
- * nearest `node_modules/.bin/`.
2
+ * Resolve the installed `hexagen-lint` bin by walking up from `startDir`,
3
+ * preferring the `node_modules/.bin/` shim and falling back to the arch-linter
4
+ * package's own `bin` target at the same level.
4
5
  *
5
- * The bin name is scope-agnostic, so this resolves both in this monorepo
6
+ * The shim name is scope-agnostic, so it resolves both in this monorepo
6
7
  * (`@hexagen/arch-linter`) and in a generated project (the
7
8
  * `@hexagen-monaco/arch-linter` devDependency). Walking up matters because the
8
9
  * project root — where `.architecture/manifest.yaml` lives — isn't guaranteed to
@@ -15,6 +16,21 @@
15
16
  * path through a shell yields a generic "command not found" (exit 127), which is
16
17
  * indistinguishable from a real lint failure, so the missing-bin case is
17
18
  * reported separately ("arch-linter not installed", not "architecture invalid").
19
+ *
20
+ * The returned path may be a shell-executable shim OR a plain `.js` entrypoint;
21
+ * build the command with {@link archLinterCommand} rather than quoting it
22
+ * directly.
18
23
  */
19
24
  export declare function resolveArchLinterBin(startDir: string): string | null;
25
+ /**
26
+ * Build the shell command that runs a resolved arch-linter bin.
27
+ *
28
+ * A `node_modules/.bin/` shim is directly executable (posix symlink with a
29
+ * shebang, or a `.cmd` batch file on Windows), but the package-level fallback
30
+ * resolves to a raw `.js` module — which only runs by file association, if at
31
+ * all, on Windows. Launching those through the current interpreter keeps both
32
+ * resolution paths behaving identically on every platform. Quoted so an
33
+ * absolute path containing spaces survives the shell.
34
+ */
35
+ export declare function archLinterCommand(bin: string, execPath?: string): string;
20
36
  //# sourceMappingURL=arch-linter-bin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arch-linter-bin.d.ts","sourceRoot":"","sources":["../src/arch-linter-bin.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASpE"}
1
+ {"version":3,"file":"arch-linter-bin.d.ts","sourceRoot":"","sources":["../src/arch-linter-bin.ts"],"names":[],"mappings":"AA+DA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,MAAyB,GAClC,MAAM,CAER"}