@stacksjs/defaults 0.75.360 → 0.75.362

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 (209) hide show
  1. package/ai/skills/stacks-ai/SKILL.md +22 -0
  2. package/ai/skills/stacks-native/CATALOG.md +4 -4
  3. package/ai/skills/stacks-payments/SKILL.md +28 -0
  4. package/ai/skills/stacks-technical-diagrams/LICENSE +202 -22
  5. package/ai/skills/stacks-technical-diagrams/LICENSE-MIT +22 -0
  6. package/ai/skills/stacks-technical-diagrams/NOTICE +26 -0
  7. package/ai/skills/stacks-technical-diagrams/SKILL.md +106 -266
  8. package/ai/skills/stacks-technical-diagrams/THIRD_PARTY_NOTICES.md +11 -2
  9. package/ai/skills/stacks-technical-diagrams/UPSTREAM.json +12 -0
  10. package/ai/skills/stacks-technical-diagrams/agents/openai.yaml +2 -2
  11. package/ai/skills/stacks-technical-diagrams/assets/template.html +3655 -3798
  12. package/ai/skills/stacks-technical-diagrams/bin/archify.mjs +7290 -0
  13. package/ai/skills/stacks-technical-diagrams/bin/delivery-update.mjs +7 -0
  14. package/ai/skills/stacks-technical-diagrams/bin/diagrams +1 -0
  15. package/ai/skills/stacks-technical-diagrams/bin/finalize.mjs +1056 -0
  16. package/ai/skills/stacks-technical-diagrams/bin/open-artifact.mjs +72 -12
  17. package/ai/skills/stacks-technical-diagrams/bin/preview.mjs +348 -31
  18. package/ai/skills/stacks-technical-diagrams/bin/recover-output.mjs +41 -0
  19. package/ai/skills/stacks-technical-diagrams/bin/technical-diagrams.mjs +3 -2097
  20. package/ai/skills/stacks-technical-diagrams/bin/visual-check.mjs +2142 -157
  21. package/ai/skills/stacks-technical-diagrams/brand-marks/README.md +3 -3
  22. package/ai/skills/stacks-technical-diagrams/delta/architecture-delta.mjs +130 -33
  23. package/ai/skills/stacks-technical-diagrams/examples/agent-run.lifecycle.json +25 -30
  24. package/ai/skills/stacks-technical-diagrams/examples/agent-tool-call.workflow.json +0 -20
  25. package/ai/skills/stacks-technical-diagrams/examples/archify-dev-activity.timeline.json +176 -0
  26. package/ai/skills/stacks-technical-diagrams/examples/archify-repository.tree.json +197 -0
  27. package/ai/skills/stacks-technical-diagrams/examples/async-job-roundtrip.sequence.json +1 -6
  28. package/ai/skills/stacks-technical-diagrams/examples/brand-aware-delivery.architecture.json +3 -16
  29. package/ai/skills/stacks-technical-diagrams/examples/cache-miss-request.sequence.json +2 -7
  30. package/ai/skills/stacks-technical-diagrams/examples/checkout-platform.base.architecture.json +2 -1
  31. package/ai/skills/stacks-technical-diagrams/examples/checkout-platform.head.architecture.json +2 -1
  32. package/ai/skills/stacks-technical-diagrams/examples/checkout-request.waterfall.json +20 -0
  33. package/ai/skills/stacks-technical-diagrams/examples/class-payment-processors-rendered.html +14987 -0
  34. package/ai/skills/stacks-technical-diagrams/examples/class-payments-rendered.html +14787 -0
  35. package/ai/skills/stacks-technical-diagrams/examples/dataflow-product-analytics.html +14880 -0
  36. package/ai/skills/stacks-technical-diagrams/examples/delivery.explainer.json +155 -0
  37. package/ai/skills/stacks-technical-diagrams/examples/deployment-release.lifecycle.json +57 -34
  38. package/ai/skills/stacks-technical-diagrams/examples/erd-orders-rendered.html +15112 -0
  39. package/ai/skills/stacks-technical-diagrams/examples/event-stream.dataflow.json +1 -6
  40. package/ai/skills/stacks-technical-diagrams/examples/example-rebuild.waterfall.json +212 -0
  41. package/ai/skills/stacks-technical-diagrams/examples/holiday-planning.workflow.json +143 -0
  42. package/ai/skills/stacks-technical-diagrams/examples/incident-response.workflow.json +1 -6
  43. package/ai/skills/stacks-technical-diagrams/examples/lifecycle-agent-run.html +14892 -0
  44. package/ai/skills/stacks-technical-diagrams/examples/locales/de.json +463 -0
  45. package/ai/skills/stacks-technical-diagrams/examples/locales/fr.json +463 -0
  46. package/ai/skills/stacks-technical-diagrams/examples/locales/fr.partial.json +22 -0
  47. package/ai/skills/stacks-technical-diagrams/examples/locales/it.json +463 -0
  48. package/ai/skills/stacks-technical-diagrams/examples/locales/ja.json +463 -0
  49. package/ai/skills/stacks-technical-diagrams/examples/locales/pt.json +463 -0
  50. package/ai/skills/stacks-technical-diagrams/examples/locales/ru.json +463 -0
  51. package/ai/skills/stacks-technical-diagrams/examples/orders.erd.json +337 -0
  52. package/ai/skills/stacks-technical-diagrams/examples/payment-incident.timeline.json +24 -0
  53. package/ai/skills/stacks-technical-diagrams/examples/payment-platform.tree.json +22 -0
  54. package/ai/skills/stacks-technical-diagrams/examples/payment-processors.class.json +177 -0
  55. package/ai/skills/stacks-technical-diagrams/examples/payments.class.json +85 -0
  56. package/ai/skills/stacks-technical-diagrams/examples/product-analytics.dataflow.json +1 -6
  57. package/ai/skills/stacks-technical-diagrams/examples/production-deployment.architecture.json +3 -23
  58. package/ai/skills/stacks-technical-diagrams/examples/release-delivery.workflow.json +1 -6
  59. package/ai/skills/stacks-technical-diagrams/examples/sequence-cache-miss-request.html +14895 -0
  60. package/ai/skills/stacks-technical-diagrams/examples/subscription-billing-rendered.html +15369 -0
  61. package/ai/skills/stacks-technical-diagrams/examples/subscription-billing.erd.json +548 -0
  62. package/ai/skills/stacks-technical-diagrams/examples/timeline-archify-dev-activity-rendered.html +15002 -0
  63. package/ai/skills/stacks-technical-diagrams/examples/timeline-payment-incident-rendered.html +14772 -0
  64. package/ai/skills/stacks-technical-diagrams/examples/tree-archify-repository-rendered.html +15071 -0
  65. package/ai/skills/stacks-technical-diagrams/examples/tree-payment-platform-rendered.html +14810 -0
  66. package/ai/skills/stacks-technical-diagrams/examples/waterfall-checkout-request-rendered.html +14754 -0
  67. package/ai/skills/stacks-technical-diagrams/examples/waterfall-example-rebuild-rendered.html +14940 -0
  68. package/ai/skills/stacks-technical-diagrams/examples/web-app-rendered.html +14889 -0
  69. package/ai/skills/stacks-technical-diagrams/examples/web-app.architecture.json +1 -6
  70. package/ai/skills/stacks-technical-diagrams/examples/workflow-agent-tool-call-rendered.html +14907 -0
  71. package/ai/skills/stacks-technical-diagrams/explainer/browser-check.mjs +208 -0
  72. package/ai/skills/stacks-technical-diagrams/explainer/charts.mjs +70 -0
  73. package/ai/skills/stacks-technical-diagrams/explainer/check.mjs +168 -0
  74. package/ai/skills/stacks-technical-diagrams/explainer/diagrams.mjs +518 -0
  75. package/ai/skills/stacks-technical-diagrams/explainer/diff.mjs +124 -0
  76. package/ai/skills/stacks-technical-diagrams/explainer/inline.mjs +155 -0
  77. package/ai/skills/stacks-technical-diagrams/explainer/layout.mjs +35 -0
  78. package/ai/skills/stacks-technical-diagrams/explainer/page-bundle.mjs +16 -0
  79. package/ai/skills/stacks-technical-diagrams/explainer/parse.mjs +300 -0
  80. package/ai/skills/stacks-technical-diagrams/explainer/patch.mjs +117 -0
  81. package/ai/skills/stacks-technical-diagrams/explainer/prepare.mjs +131 -0
  82. package/ai/skills/stacks-technical-diagrams/explainer/reader.css +472 -0
  83. package/ai/skills/stacks-technical-diagrams/explainer/reader.js +667 -0
  84. package/ai/skills/stacks-technical-diagrams/explainer/render.mjs +224 -0
  85. package/ai/skills/stacks-technical-diagrams/explainer/revision.mjs +20 -0
  86. package/ai/skills/stacks-technical-diagrams/explainer/sources.mjs +318 -0
  87. package/ai/skills/stacks-technical-diagrams/explainer/validate.mjs +138 -0
  88. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/LICENSE +40 -0
  89. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/README.md +5 -0
  90. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/3DKXF73K.js +4 -0
  91. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/42UTT654.js +3 -0
  92. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/DKTLEL5E.js +1 -0
  93. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/EEIX5ZYH.js +2 -0
  94. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/EJ5KOXYD.js +25 -0
  95. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/GUJTEFZK.js +1 -0
  96. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/IZOKQ2GT.js +4 -0
  97. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/L4LY553T.js +3 -0
  98. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/MSKIJHB2.js +2 -0
  99. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/RVARI57O.js +1 -0
  100. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/UKSIWDDN.js +2 -0
  101. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/UPTXNAXN.js +2 -0
  102. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/XTDUIGUI.js +9 -0
  103. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/chunks/YAYTP6L5.js +9 -0
  104. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/core.js +1 -0
  105. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/pie.js +1 -0
  106. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/quadrantChart.js +1 -0
  107. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/radar.js +1 -0
  108. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/sankey.js +1 -0
  109. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/venn.js +1 -0
  110. package/ai/skills/stacks-technical-diagrams/explainer/vendor/pele/diagrams/xychart.js +1 -0
  111. package/ai/skills/stacks-technical-diagrams/explainer/writing.mjs +139 -0
  112. package/ai/skills/stacks-technical-diagrams/locales/README.md +40 -0
  113. package/ai/skills/stacks-technical-diagrams/locales/ar.json +488 -0
  114. package/ai/skills/stacks-technical-diagrams/locales/en.json +488 -0
  115. package/ai/skills/stacks-technical-diagrams/locales/es.json +488 -0
  116. package/ai/skills/stacks-technical-diagrams/locales/ko.json +488 -0
  117. package/ai/skills/stacks-technical-diagrams/locales/manifest.json +10 -0
  118. package/ai/skills/stacks-technical-diagrams/locales/zh-CN.json +488 -0
  119. package/ai/skills/stacks-technical-diagrams/locales/zh-TW.json +488 -0
  120. package/ai/skills/stacks-technical-diagrams/migrations/workflow-v2.mjs +1 -0
  121. package/ai/skills/stacks-technical-diagrams/recipes/scenarios.mjs +115 -51
  122. package/ai/skills/stacks-technical-diagrams/references/architecture-layout-repair.md +18 -0
  123. package/ai/skills/stacks-technical-diagrams/references/authoring-contract.md +453 -51
  124. package/ai/skills/stacks-technical-diagrams/references/authoring-defaults.md +57 -0
  125. package/ai/skills/stacks-technical-diagrams/references/brand-marks.md +57 -3
  126. package/ai/skills/stacks-technical-diagrams/references/delivery-contract.md +603 -58
  127. package/ai/skills/stacks-technical-diagrams/references/explainer-authoring.md +274 -0
  128. package/ai/skills/stacks-technical-diagrams/references/repository-authoring.md +126 -0
  129. package/ai/skills/stacks-technical-diagrams/references/update-awareness.md +13 -0
  130. package/ai/skills/stacks-technical-diagrams/references/viewer-runtime.md +18 -11
  131. package/ai/skills/stacks-technical-diagrams/renderers/architecture/grid.mjs +1 -1
  132. package/ai/skills/stacks-technical-diagrams/renderers/architecture/labels.mjs +2 -0
  133. package/ai/skills/stacks-technical-diagrams/renderers/architecture/render-architecture.mjs +550 -424
  134. package/ai/skills/stacks-technical-diagrams/renderers/architecture/routing.mjs +1469 -0
  135. package/ai/skills/stacks-technical-diagrams/renderers/class/README.md +129 -0
  136. package/ai/skills/stacks-technical-diagrams/renderers/class/render-class.mjs +1095 -0
  137. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/README.md +89 -17
  138. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/dataflow-compiler.mjs +1605 -0
  139. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/joint-label-routing.mjs +165 -0
  140. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/label-capacity.mjs +81 -0
  141. package/ai/skills/stacks-technical-diagrams/renderers/dataflow/render-dataflow.mjs +14 -474
  142. package/ai/skills/stacks-technical-diagrams/renderers/erd/README.md +246 -0
  143. package/ai/skills/stacks-technical-diagrams/renderers/erd/grid.mjs +150 -0
  144. package/ai/skills/stacks-technical-diagrams/renderers/erd/render-erd.mjs +1588 -0
  145. package/ai/skills/stacks-technical-diagrams/renderers/explainer/render-explainer.mjs +42 -0
  146. package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/README.md +83 -94
  147. package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/render-lifecycle.mjs +990 -417
  148. package/ai/skills/stacks-technical-diagrams/renderers/sequence/README.md +49 -17
  149. package/ai/skills/stacks-technical-diagrams/renderers/sequence/render-sequence.mjs +735 -94
  150. package/ai/skills/stacks-technical-diagrams/renderers/shared/atomic-output.mjs +1982 -0
  151. package/ai/skills/stacks-technical-diagrams/renderers/shared/automatic-labels.mjs +290 -0
  152. package/ai/skills/stacks-technical-diagrams/renderers/shared/brand-marks.mjs +169 -26
  153. package/ai/skills/stacks-technical-diagrams/renderers/shared/cli.mjs +266 -54
  154. package/ai/skills/stacks-technical-diagrams/renderers/shared/desktop-readability.mjs +106 -0
  155. package/ai/skills/stacks-technical-diagrams/renderers/shared/diagnostics.mjs +0 -0
  156. package/ai/skills/stacks-technical-diagrams/renderers/shared/generated-validators.mjs +268 -2
  157. package/ai/skills/stacks-technical-diagrams/renderers/shared/geometry.mjs +774 -124
  158. package/ai/skills/stacks-technical-diagrams/renderers/shared/i18n.mjs +289 -556
  159. package/ai/skills/stacks-technical-diagrams/renderers/shared/layout-report.mjs +18 -1
  160. package/ai/skills/stacks-technical-diagrams/renderers/shared/legend.mjs +16 -6
  161. package/ai/skills/stacks-technical-diagrams/renderers/shared/node-card-style.mjs +32 -0
  162. package/ai/skills/stacks-technical-diagrams/renderers/shared/output-path.mjs +329 -229
  163. package/ai/skills/stacks-technical-diagrams/renderers/shared/owned-temp-directory.mjs +82 -0
  164. package/ai/skills/stacks-technical-diagrams/renderers/shared/path-semantics.mjs +1017 -0
  165. package/ai/skills/stacks-technical-diagrams/renderers/shared/portable-path.mjs +408 -0
  166. package/ai/skills/stacks-technical-diagrams/renderers/shared/repository-evidence.mjs +235 -79
  167. package/ai/skills/stacks-technical-diagrams/renderers/shared/repository-location.mjs +17 -4
  168. package/ai/skills/stacks-technical-diagrams/renderers/shared/route-quality.mjs +670 -0
  169. package/ai/skills/stacks-technical-diagrams/renderers/shared/sidecar-path.mjs +38 -0
  170. package/ai/skills/stacks-technical-diagrams/renderers/shared/software-notices.mjs +6 -0
  171. package/ai/skills/stacks-technical-diagrams/renderers/shared/spatial-grid.mjs +66 -0
  172. package/ai/skills/stacks-technical-diagrams/renderers/shared/svg-path-analysis.mjs +135 -0
  173. package/ai/skills/stacks-technical-diagrams/renderers/shared/text-fit.mjs +59 -3
  174. package/ai/skills/stacks-technical-diagrams/renderers/shared/utils.mjs +63 -35
  175. package/ai/skills/stacks-technical-diagrams/renderers/shared/validator.mjs +2 -5
  176. package/ai/skills/stacks-technical-diagrams/renderers/timeline/README.md +76 -0
  177. package/ai/skills/stacks-technical-diagrams/renderers/timeline/render-timeline.mjs +576 -0
  178. package/ai/skills/stacks-technical-diagrams/renderers/tree/README.md +96 -0
  179. package/ai/skills/stacks-technical-diagrams/renderers/tree/render-tree.mjs +573 -0
  180. package/ai/skills/stacks-technical-diagrams/renderers/waterfall/README.md +73 -0
  181. package/ai/skills/stacks-technical-diagrams/renderers/waterfall/render-waterfall.mjs +413 -0
  182. package/ai/skills/stacks-technical-diagrams/renderers/workflow/README.md +137 -23
  183. package/ai/skills/stacks-technical-diagrams/renderers/workflow/render-workflow.mjs +18 -6
  184. package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-compiler.mjs +2230 -710
  185. package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-migration-geometry.mjs +17 -0
  186. package/ai/skills/stacks-technical-diagrams/renderers/workflow/workflow-placement-repair.mjs +94 -0
  187. package/ai/skills/stacks-technical-diagrams/schemas/README.md +87 -40
  188. package/ai/skills/stacks-technical-diagrams/schemas/architecture.schema.json +7 -33
  189. package/ai/skills/stacks-technical-diagrams/schemas/class.schema.json +345 -0
  190. package/ai/skills/stacks-technical-diagrams/schemas/common.schema.json +68 -2
  191. package/ai/skills/stacks-technical-diagrams/schemas/dataflow.schema.json +14 -3
  192. package/ai/skills/stacks-technical-diagrams/schemas/erd.schema.json +381 -0
  193. package/ai/skills/stacks-technical-diagrams/schemas/explainer.schema.json +927 -0
  194. package/ai/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json +23 -110
  195. package/ai/skills/stacks-technical-diagrams/schemas/sequence.schema.json +15 -4
  196. package/ai/skills/stacks-technical-diagrams/schemas/timeline.schema.json +160 -0
  197. package/ai/skills/stacks-technical-diagrams/schemas/tree.schema.json +141 -0
  198. package/ai/skills/stacks-technical-diagrams/schemas/waterfall.schema.json +147 -0
  199. package/ai/skills/stacks-technical-diagrams/schemas/workflow.schema.json +14 -3
  200. package/ai/skills/stacks-technical-diagrams/scripts/check-render-output.mjs +876 -243
  201. package/ai/skills/stacks-technical-diagrams/scripts/check-update.mjs +1717 -0
  202. package/ai/skills/stacks-technical-diagrams/scripts/delivery-update-child.mjs +26 -0
  203. package/ai/skills/stacks-technical-diagrams/scripts/generate-brand-marks.mjs +141 -0
  204. package/ai/skills/stacks-technical-diagrams/scripts/generate-validators.mjs +105 -0
  205. package/ai/skills/stacks-technical-diagrams/scripts/render-examples.mjs +11 -1
  206. package/ai/skills/stacks-technical-diagrams/scripts/update-contract.mjs +187 -0
  207. package/ai/skills/stacks-technical-diagrams/skill-release.json +10 -0
  208. package/ide/vscode/package.json +1 -1
  209. package/package.json +2 -2
@@ -1,22 +1,22 @@
1
1
  # Workflow Renderer
2
2
 
3
- Render `diagram_type: "workflow"` JSON files into the standalone technical diagram HTML
3
+ Render `diagram_type: "workflow"` JSON files into the standard Archify HTML
4
4
  template.
5
5
 
6
6
  ```bash
7
- node .claude/skills/stacks-technical-diagrams/renderers/workflow/render-workflow.mjs input.workflow.json output.html
7
+ node archify/renderers/workflow/render-workflow.mjs input.workflow.json output.html
8
8
  ```
9
9
 
10
- The renderer validates input against `.claude/skills/stacks-technical-diagrams/schemas/workflow.schema.json`
10
+ The renderer validates input against `archify/schemas/workflow.schema.json`
11
11
  with the bundled standalone validator. No dependency installation is required.
12
12
 
13
- If `output.html` is omitted, the renderer uses `meta.output` from the JSON file
14
- or falls back to `workflow.html` in the current working directory.
13
+ If `output.html` is omitted, the renderer uses the required `meta.output` value
14
+ from the JSON file.
15
15
 
16
16
  After rendering, run the artifact checker:
17
17
 
18
18
  ```bash
19
- .claude/skills/stacks-technical-diagrams/bin/diagrams check output.html
19
+ node archify/scripts/check-render-output.mjs output.html
20
20
  ```
21
21
 
22
22
  It catches final-SVG issues that are easiest to see in a browser: non-finite
@@ -32,7 +32,8 @@ Workflow JSON files must set:
32
32
  "schema_version": 2,
33
33
  "diagram_type": "workflow",
34
34
  "meta": {
35
- "title": "Agent Tool Call Workflow"
35
+ "title": "Agent Tool Call Workflow",
36
+ "output": "agent-tool-call.html"
36
37
  },
37
38
  "lanes": [],
38
39
  "phases": [],
@@ -53,13 +54,13 @@ reinterpreted as v2.
53
54
  Omit `meta.viewBox` for the common v2 case so the compiler can use intrinsic
54
55
  measured bounds. In v1, the omitted width remains fixed at 720 and height is
55
56
  derived from lane count. A complete worked example lives at
56
- `.claude/skills/stacks-technical-diagrams/examples/agent-tool-call.workflow.json`; its `schema_version` selects
57
+ `archify/examples/agent-tool-call.workflow.json`; its `schema_version` selects
57
58
  the applicable contract.
58
59
 
59
60
  The schema lives at:
60
61
 
61
62
  ```text
62
- .claude/skills/stacks-technical-diagrams/schemas/workflow.schema.json
63
+ archify/schemas/workflow.schema.json
63
64
  ```
64
65
 
65
66
  ## Migration and layout receipt
@@ -67,12 +68,23 @@ The schema lives at:
67
68
  Migrate an existing v1 source into a separate v2 file:
68
69
 
69
70
  ```bash
70
- .claude/skills/stacks-technical-diagrams/bin/diagrams migrate workflow old.json new.json --to-schema 2 --json
71
+ node archify/bin/archify.mjs migrate workflow old.json new.json --to-schema 2 --json
71
72
  ```
72
73
 
73
74
  Running the command again with its schema-v2 output as the new source is an
74
75
  idempotent verification pass: the destination bytes and geometry stay unchanged.
75
76
 
77
+ If a legacy v1 source is blocked solely because `meta.output` is missing or no
78
+ longer portable, supply its replacement for the separate v2 destination:
79
+
80
+ ```bash
81
+ node archify/bin/archify.mjs migrate workflow old.json new.json --to-schema 2 --output reports/workflow.html --json
82
+ ```
83
+
84
+ `--output` must itself be a portable POSIX-relative `.html` path. It updates
85
+ only the verified destination candidate; the source bytes remain unchanged and
86
+ all non-output schema and compiler diagnostics still block migration.
87
+
76
88
  The command never overwrites the source by default. It maps absolute
77
89
  `via[*][0]`, `labelAt[0]`, and `channelX` values from legacy to solved rank
78
90
  space, preserves y coordinates unless a reported vertical constraint needs
@@ -80,15 +92,28 @@ author input, expands an explicit viewBox only for an unambiguous containment
80
92
  repair, and writes the destination only after v2 compilation and artifact
81
93
  checks pass. Ambiguous explicit pins fail without producing the destination.
82
94
 
95
+ Migration preserves `semanticChecks` and validates those requirements against the
96
+ complete authored topology. Temporary layout planning may omit routed edges,
97
+ but authors do not need to remove or relax their contracts to use migration.
98
+ The complete migrated document must still satisfy every authored requirement.
99
+
83
100
  Inspect the stable author-facing v2 plan with:
84
101
 
85
102
  ```bash
86
- .claude/skills/stacks-technical-diagrams/bin/diagrams validate workflow input.workflow.json --layout-json
103
+ node archify/bin/archify.mjs validate workflow input.workflow.json --layout-json
87
104
  ```
88
105
 
89
106
  The receipt reports the selected contract, measured `viewBox` and
90
107
  `requiredViewBox`, solved columns, nodes, edges, labels, and causal diagnostics.
91
- It deliberately omits solver iterations and candidate scores.
108
+ It deliberately omits solver iterations and candidate scores. A complete plan
109
+ rejected by a late layout, canvas, or text check also includes this geometry with
110
+ `ok: false`; validation still exits non-zero and writes no HTML. Its `viewBox`
111
+ is the attempted frame at rejection, while `requiredViewBox` is the measured
112
+ footprint of that same rejected plan. Labels use their anchor coordinates,
113
+ not the top-left corner of the label mask. Early or incomplete failures retain
114
+ only the contract and causal diagnostics. Failed geometry is repair evidence,
115
+ not acceptance; migration failure reports may also gain measured canvas evidence
116
+ without accepting the rejected plan.
92
117
 
93
118
  ## Legend
94
119
 
@@ -104,10 +129,10 @@ backed by rendered nodes receive Semantic Legend controls.
104
129
 
105
130
  | Constant | Value |
106
131
  |----------|-------|
107
- | viewBox | default `[720, auto]` - auto height = 52 + lanes×104 + (lanes−1)×20 + 124 |
132
+ | viewBox | default `[720, auto]` — auto height = 52 + lanes×104 + (lanes−1)×20 + 124 |
108
133
  | Lane frame | x 40, width 640, height 104, gap 20; first lane top at y 52 |
109
134
  | Lane title strip | top 30px of each lane; node boxes must stay below it |
110
- | Column centers (`col` 0-5) | x = 88, 220, 300, 430, 500, 625 |
135
+ | Column centers (`col` 0–5) | x = 88, 220, 300, 430, 500, 625 |
111
136
  | Phase headers | Optional `phases[]` render above the first lane, spanning `fromCol..toCol` |
112
137
  | Lane groups | Optional `groups[]` frame parallel work or branch work inside one lane |
113
138
  | Exception lanes | Set `lane.variant: "exception"` for retry, denial, fallback, or failure paths |
@@ -133,6 +158,20 @@ a verified migration-to-v2 repair; v1 never falls through to adaptive layout.
133
158
  | Automatic route rhythm | direct segment ≥28px; endpoint stub ≥8px; interior turn segment ≥16px |
134
159
  | Implicit viewBox | intrinsic content bounds plus contract padding |
135
160
  | Explicit viewBox | containment capacity; too-small input reports exact `requiredViewBox` and contributors |
161
+ | Lane measurement | A same-column vertical stack (two or more distinct `yOffset` values) opts an implicit, unpinned workflow into per-lane measurement. Explicit `meta.viewBox`, `via`, `labelAt`, `channelX`, or `channelY`, and workflows without a stack retain shared-height v2 geometry for compatibility. |
162
+
163
+ Unpinned v2 drafts reserve 32px between overlapping same-lane nodes for routes,
164
+ and omitted node widths may grow from 92px to 200px to fit their text. Documents
165
+ with an explicit `meta.viewBox` or absolute `via`, `labelAt`, `channelX`, or
166
+ `channelY` pins retain the existing width defaults and 8px rank-clearance
167
+ constraint, in both compilation and migration planning. Authored widths remain
168
+ authoritative.
169
+
170
+ Automatic showcase canvases check sublabels against the desktop reading floor
171
+ without enlarging text beyond its existing 8px slot. If the canvas cannot keep
172
+ that slot readable, `workflow/sublabel-readability` reports the required font
173
+ and canvas width. Standard quality and explicit canvases retain their previous
174
+ text-fitting behavior and the existing composition/browser quality checks.
136
175
 
137
176
  The compiler applies constraints only to actual related or overlapping
138
177
  same-lane nodes, so a wide node in an unrelated lane does not expand every
@@ -144,18 +183,60 @@ growth with a legal channel instead of widening every downstream rank. Measured
144
183
  multi-row legends participate in intrinsic height and explicit viewBox
145
184
  capacity.
146
185
 
186
+ The Issue #250 shape already has a v2 representation without an authored lane
187
+ size. Keep the three stages in one grouped lane, omit `meta.viewBox`, and center
188
+ their offsets around zero:
189
+
190
+ ```json
191
+ {
192
+ "schema_version": 2,
193
+ "diagram_type": "workflow",
194
+ "meta": { "title": "stack", "output": "stack.html" },
195
+ "lanes": [{ "id": "cage", "label": "one cage" }],
196
+ "groups": [{ "id": "g", "label": "cage", "lane": "cage", "fromCol": 1, "toCol": 3 }],
197
+ "nodes": [
198
+ { "id": "a", "lane": "cage", "col": 2, "type": "security", "label": "stageA", "yOffset": -90 },
199
+ { "id": "b", "lane": "cage", "col": 2, "type": "security", "label": "stageB", "yOffset": 0 },
200
+ { "id": "c", "lane": "cage", "col": 2, "type": "security", "label": "stageC", "yOffset": 90 }
201
+ ],
202
+ "edges": [
203
+ { "from": "a", "to": "b", "fromSide": "bottom", "toSide": "top" },
204
+ { "from": "b", "to": "c", "fromSide": "bottom", "toSide": "top" }
205
+ ]
206
+ }
207
+ ```
208
+
209
+ An implicit readable-v2 vertical stack whose measured lane height exceeds the
210
+ 104px baseline declares `data-reader-fit="width-first"`, as does any implicit
211
+ readable-v2 canvas that would otherwise overflow the 1440×900 desktop page at
212
+ full width. The desktop Viewer uses
213
+ available reading width and normal page scrolling to keep tall stages readable,
214
+ with the existing 1.5× automatic enlargement cap. This changes only displayed
215
+ size: canonical SVG geometry and explicit `meta.viewBox` workflows retain their
216
+ authored contracts. Embed, Present, and print retain their existing fitting modes.
217
+ `visual-check` still checks readability, horizontal containment, and clipping;
218
+ the declaration does not weaken node or route validation.
219
+
147
220
  Authored `via`, `labelAt`, `channelX`, and `channelY` are absolute hard pins in
148
221
  v2; an infeasible pin returns `workflow/explicit-pin-conflict` rather than being
149
222
  silently moved. `fromSide` and `toSide` remain direction constraints. A route
150
223
  preset restricts the automatic candidate family but is not itself an absolute
151
224
  coordinate pin. When either endpoint side is omitted, the v2 compiler chooses
152
225
  a feasible side; an authored side restricts that endpoint to the named port.
226
+ An infeasible preset returns `workflow/route-preset-conflict` with the actual
227
+ rejected `evidence.invariant`. For node clearance it also identifies the node,
228
+ segment, endpoint role, and required clearance. Use that obstacle to revise
229
+ the connected placement or route constraints, then revalidate; minimum segment
230
+ lengths alone do not establish a clear path. Concrete alternatives for
231
+ `workflow/route-preset-conflict` are checked by replanning the complete workflow
232
+ at the active quality profile.
153
233
 
154
234
  ## Design Rules
155
235
 
156
236
  - Use lanes for ownership or runtime boundaries.
157
237
  - Use phase headers for high-level story beats such as Intake, Plan, Execute, and Report.
158
238
  - Use groups for parallel checks, branch handling, or bounded work within a lane; every group must contain at least one node.
239
+ - For sequential stages stacked inside one container, use one v2 lane and one group, keep the stages in one column, and omit `meta.viewBox`. `yOffset` is relative to the center of the lane's content area, so center a three-stage stack with `-90 / 0 / 90` rather than `0 / 90 / 180`. With compiler-owned routes and canvas, the compiler expands only that lane.
159
240
  - Use `lane.variant: "exception"` for human wait, denial, retry, fallback, and failure lanes instead of mixing those paths into the happy path.
160
241
  - Set `mainPath` when the diagram has a clear happy path; the renderer validates that consecutive ids have matching edges and move left-to-right.
161
242
  - Place nodes with lane IDs and `col` indexes in `0..5`, not raw SVG coordinates.
@@ -164,8 +245,8 @@ a feasible side; an authored side restricts that endpoint to the named port.
164
245
  instead of deleting meaning.
165
246
  - Use labels for decisions, approvals, protocols, async traces, return paths,
166
247
  and any other relationship meaning not fully implied by its endpoints.
167
- - Prefer route presets - `drop` (bend between lanes; `bias` 0-1 picks where),
168
- `outside-right`, `return-left`, `bottom-channel`, and `up-channel` - before
248
+ - Prefer route presets — `drop` (bend between lanes; `bias` 0–1 picks where),
249
+ `outside-right`, `return-left`, `bottom-channel`, and `up-channel` — before
169
250
  using raw `via` points. `straight` and the default `auto` cover the rest.
170
251
  - Keep workflow examples compact enough to render well in narrow chat/browser
171
252
  previews.
@@ -208,16 +289,49 @@ pass-through containers. Text width is estimated CJK-aware: fullwidth glyphs
208
289
  count as two units.
209
290
 
210
291
  Diagnostics are causal: a rank-capacity failure suppresses derivative short
211
- edge, endpoint-direction, and label-overlap findings. Every
212
- `supportedFixes[]` entry is verified by replanning the proposed edit, and a
213
- diagnostic never proposes removing a semantic label when label presence does
214
- not cause the failed invariant.
292
+ edge, endpoint-direction, and label-overlap findings. `supportedFixes[]` can
293
+ contain concrete edits checked by the compiler's fix search or general repair
294
+ guidance from shared composition checks. General guidance is not a verified
295
+ edit. After any edit, rerun the complete `finalize` command. A diagnostic never
296
+ proposes removing a semantic label when label presence does not cause the
297
+ failed invariant.
215
298
 
216
299
  Set `meta.quality_profile` to `showcase` for polished delivery. Unrelated proper
217
300
  X crossings then fail with `composition/proper-crossing`; default `standard`
218
301
  keeps them as artifact-receipt warnings. Collinear lane corridors are outside
219
302
  the proper-X rule, but a separate gate warns in `standard` and fails in
220
- `showcase` when unrelated edges overlap for at least 8px. Shared semantic
221
- endpoints, point touches, and shorter overlaps remain valid. Showcase also
303
+ `showcase` when unrelated edges overlap for at least 8px. V1 keeps its authored
304
+ shared-endpoint contract. V2 also checks shared endpoints, including explicitly
305
+ controlled routes: long or mixed-style trunks, counterflow, proper interior X
306
+ crossings and overlapping independent arrowheads are not exempt. Pins are
307
+ preserved, not silently repaired; unresolved v2 corridor/arrowhead collisions
308
+ warn in `standard` and fail in `showcase`.
309
+
310
+ V2 permits a same-direction shared terminal stub of at most 24 SVG units only
311
+ when both relationships share the actual source or target port, effective
312
+ variant, stroke width and role. A nonterminal overlap is never such a stub;
313
+ forward-collinear waypoints do not split a long trunk into permitted pieces.
314
+ Compatible short merges may share their terminal arrowhead. Automatic routes
315
+ consider separate ports, reserve absolute routes at contested nodes, and prefer
316
+ clear paths over shorter ambiguous ones. Crowded automatic corridors can use a
317
+ bounded local adjustment without moving nodes or changing explicit coordinates.
318
+
319
+ The SVG carries `data-layout-contract="readable-v2"` and each edge's role so
320
+ artifact checks apply the same classification to actual visible path geometry,
321
+ not stale composition-point metadata. These internal output attributes do not
322
+ add authoring schema fields. Other diagram types retain their existing rules.
323
+ V2 proper-crossing diagnostics retain the relationship IDs, intersection point,
324
+ and supported fixes in both compiler/layout-JSON receipts and final HTML checks;
325
+ `standard` reports warnings while `showcase` rejects the crossing. Both analyses
326
+ merge forward-collinear waypoints without rewriting authored paths; real bends
327
+ and reversals remain endpoint touches rather than being merged into an X.
328
+
329
+ The older per-edge `data-composition-routing="workflow-v2-auto"` marker remains
330
+ for compatibility with first-round exported HTML that has no root layout
331
+ contract and with older artifact checkers. Marker-only artifacts retain their
332
+ narrower automatic-pair crossing/counterflow policy; the root `readable-v2`
333
+ contract is authoritative when present and also checks explicit routes. Do not
334
+ remove the marker-only path as dead code without retiring that export format.
335
+ Showcase also
222
336
  rejects any route segment below 8px and any interior turn segment below 16px;
223
- ordinary 8-15px endpoint stubs remain valid for fixed lane gaps.
337
+ ordinary 8–15px endpoint stubs remain valid for fixed lane gaps.
@@ -1,20 +1,31 @@
1
1
  import path from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { loadDiagramWithBrandMarks, writeDiagram } from '../shared/cli.mjs';
4
- import { throwDiagnosticError } from '../shared/diagnostics.mjs';
4
+ import { recordDiagnostic, throwDiagnosticError, withIsolatedDiagnosticRecording } from '../shared/diagnostics.mjs';
5
5
  import { compileWorkflow } from './workflow-compiler.mjs';
6
6
 
7
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
- const { diagram: workflow, template, outPath } = await loadDiagramWithBrandMarks({
8
+ const { diagram: workflow, template, outPath, sourceEvidence } = await loadDiagramWithBrandMarks({
9
9
  rendererDir: __dirname,
10
10
  diagramType: 'workflow',
11
11
  defaultExample: 'agent-tool-call.workflow.json'
12
12
  });
13
13
 
14
- const compiled = compileWorkflow({
15
- workflow,
16
- qualityProfile: process.env.ARCHIFY_QUALITY_PROFILE || workflow.meta?.quality_profile,
17
- });
14
+ let compiled;
15
+ try {
16
+ compiled = withIsolatedDiagnosticRecording(() => compileWorkflow({
17
+ workflow,
18
+ qualityProfile: process.env.ARCHIFY_QUALITY_PROFILE || workflow.meta?.quality_profile,
19
+ sourceEvidence,
20
+ }));
21
+ } catch (error) {
22
+ // The scope has restored the caller's recording. Keep a typed escape visible
23
+ // alongside earlier failures without publishing abandoned compile attempts.
24
+ if (Array.isArray(error?.archifyDiagnostics)) {
25
+ for (const diagnostic of error.archifyDiagnostics) recordDiagnostic(diagnostic);
26
+ }
27
+ throw error;
28
+ }
18
29
 
19
30
  const layoutJson = process.argv.includes('--layout-json');
20
31
 
@@ -31,5 +42,6 @@ if (layoutJson) {
31
42
  meta: workflow.meta,
32
43
  svg: compiled.svg,
33
44
  cards: workflow.cards,
45
+ sourceEvidence,
34
46
  });
35
47
  }