@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
@@ -0,0 +1,42 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { randomUUID, createHash } from 'node:crypto';
4
+ import { installRendererDiagnosticBoundary, throwDiagnosticError } from '../shared/diagnostics.mjs';
5
+ import { resolveOutputPath } from '../shared/output-path.mjs';
6
+ import { captureAtomicOutput, captureRegularFileBinding, publishRegularFileBinding, releaseRegularFileBinding, removeOwnedRegularFile } from '../shared/atomic-output.mjs';
7
+ import { prepareExplainer, readPreparedBundle, assertPreparedDependencies } from '../../explainer/prepare.mjs';
8
+ import { renderExplainer } from '../../explainer/render.mjs';
9
+ installRendererDiagnosticBoundary();
10
+ const inputPath = path.resolve(process.argv[2]);
11
+ const sourceText = fs.readFileSync(inputPath, 'utf8');
12
+ const bundle = process.env.ARCHIFY_EXPLAINER_PREPARED
13
+ ? readPreparedBundle(process.env.ARCHIFY_EXPLAINER_PREPARED, sourceText, inputPath, { expectedInputPath: process.env.ARCHIFY_EXPLAINER_SNAPSHOT_INPUT || inputPath })
14
+ : await prepareExplainer(sourceText, { inputPath, repoRoot: process.env.ARCHIFY_REPO_ROOT, quality: process.env.ARCHIFY_QUALITY_PROFILE });
15
+ const request = { requestedOutput: process.argv[3], authoredOutput: bundle.document.meta.output, defaultOutput: 'explainer.html', inputPaths: [inputPath, bundle.sourcePath] };
16
+ const { outputPath } = resolveOutputPath(request);
17
+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });
18
+ const capture = captureAtomicOutput(outputPath, { requestedEntryPolicy: 'regular-or-absent' });
19
+ if (capture.status !== 'captured') throwDiagnosticError('Could not capture explainer output safely.', [{code:'output/target-indeterminate',message:'Could not capture explainer output safely.',subject:{output:outputPath},evidence:{reason:capture.reason},supportedFixes:[]}]);
20
+ let html;
21
+ try { html = renderExplainer(bundle.document, { ...bundle, preparedBundle: bundle, pageDirectory: process.env.ARCHIFY_EXPLAINER_PAGE_DIR || path.dirname(outputPath) }); }
22
+ catch (error) { if (error.diagnostics) error.archifyDiagnostics = error.diagnostics; throw error; }
23
+ const bytes = Buffer.from(html);
24
+ const candidate = path.join(path.dirname(capture.commitPath), `.archify-explainer-${randomUUID()}.html`);
25
+ let binding;
26
+ let owned;
27
+ try {
28
+ fs.writeFileSync(candidate, bytes, { flag: 'wx', ...(capture.mode === null ? {} : {mode:capture.mode}) });
29
+ const stat = fs.lstatSync(candidate, {bigint:true});
30
+ owned = {device:stat.dev,inode:stat.ino};
31
+ if (capture.mode !== null) fs.chmodSync(candidate,capture.mode);
32
+ const staged = captureRegularFileBinding(candidate,{expectedIdentity:owned,expectedSha256:createHash('sha256').update(bytes).digest('hex'),expectedBytes:bytes.length});
33
+ if (staged.status !== 'captured') throw new Error('Could not bind explainer candidate.');
34
+ binding = staged.binding;
35
+ assertPreparedDependencies(bundle);
36
+ resolveOutputPath(request);
37
+ const result = publishRegularFileBinding(binding,candidate,capture.snapshot,{subject:'explainer-output'});
38
+ if (!['committed','committed-with-warning'].includes(result.status)) throw new Error(`Could not publish explainer output (${result.reason?.code || result.status}).`);
39
+ } finally {
40
+ if(binding) releaseRegularFileBinding(binding);
41
+ if(owned) removeOwnedRegularFile(candidate,owned,{subject:'explainer-output'});
42
+ }
@@ -1,115 +1,104 @@
1
1
  # Lifecycle Renderer
2
2
 
3
- Render `diagram_type: "lifecycle"` JSON files into the standalone technical diagram HTML
3
+ Render `diagram_type: "lifecycle"` JSON files into the standard Archify HTML
4
4
  template.
5
5
 
6
6
  ```bash
7
- node .claude/skills/stacks-technical-diagrams/renderers/lifecycle/render-lifecycle.mjs input.lifecycle.json output.html
7
+ node archify/renderers/lifecycle/render-lifecycle.mjs input.lifecycle.json output.html
8
8
  ```
9
9
 
10
- The renderer validates input against `.claude/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json`
10
+ The renderer validates input against `archify/schemas/lifecycle.schema.json`
11
11
  with the bundled standalone validator. No dependency installation is required.
12
-
13
- If `output.html` is omitted, the renderer uses `meta.output` from the JSON file
14
- or falls back to `lifecycle.html` in the current working directory.
12
+ If `output.html` is omitted, the renderer uses the required `meta.output` value
13
+ from the JSON file.
15
14
 
16
15
  ## Input
17
16
 
18
- Lifecycle JSON files must set:
19
-
20
17
  ```json
21
18
  {
22
- "schema_version": 1,
19
+ "schema_version": 3,
23
20
  "diagram_type": "lifecycle",
24
- "meta": {
25
- "title": "Agent Run Lifecycle",
26
- "viewBox": [980, 660]
27
- },
28
- "lanes": [],
21
+ "meta": { "title": "Deployment Release Lifecycle", "output": "deployment-release.html" },
22
+ "mainPath": ["queued", "building", "verifying", "ready", "live"],
29
23
  "states": [],
30
24
  "transitions": [],
31
25
  "cards": []
32
26
  }
33
27
  ```
34
28
 
35
- Lane ids are semantic and reserved: a lane with id `main` is required and maps
36
- to the top phase band; `terminal` maps to the bottom outcome band; every other
37
- lane id (up to 4 lanes total) shares the single middle event band. The three
38
- band headers render from your lane labels - the middle band joins the labels of
39
- all event lanes with a `+` separator. A complete worked example lives at
40
- `.claude/skills/stacks-technical-diagrams/examples/agent-run.lifecycle.json`.
41
-
42
- The schema lives at:
43
-
44
- ```text
45
- .claude/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json
46
- ```
47
-
48
- ## Legend
49
-
50
- The default legend derives kinds from `states[].type`. Supported
29
+ A complete example lives at `archify/examples/deployment-release.lifecycle.json`.
30
+
31
+ - `mainPath` is the happy path from the initial state. Every consecutive pair
32
+ needs a transition; the first such transition is drawn as the main row.
33
+ - `states[]` carry meaning only: `id`, `type`, `label`, optional `sublabel`,
34
+ `tag`, `step`, `icon`, `brand` and `sources`.
35
+ - `transitions[]` carry `from`, `to`, optional `id`, `label`, `note` and
36
+ `variant`. There are no routing or label-position controls.
37
+
38
+ ## Layout
39
+
40
+ The geometry follows from the structure alone:
41
+
42
+ | Element | Placement |
43
+ |---------|-----------|
44
+ | Main path | One left-to-right row. Each gap fits its transition label. The first state receives the UML initial marker. |
45
+ | Loops and skips | A transition between two non-consecutive main-path states (or back to an earlier one, or a self-transition) is an arc above the row. Shorter arcs nest inside longer ones; ports order so an outer riser never crosses an inner arc. |
46
+ | Other states | One row per distance from the main path. A state starts under the states it connects to in the row above; overlapping states pack side by side. |
47
+ | Between rows | Orthogonal routes through a shared gap. Horizontal runs take separate tracks, chosen to minimise crossings; near-vertical routes snap straight or widen to a readable jog. |
48
+ | Shared exits | A target with exactly one group of identical label, note and variant from at least two main-path phases shares an exit: consecutive phases receive a dashed composite frame, as in a UML superstate; non-consecutive phases share a bus with junction dots. Other exits keep separate connectors and their own labels. If several groups qualify for the same target, all exits stay separate. |
49
+ | Same lower row | Neighbours connect side to side, parallel transitions fanning out around the shared edge (at most five per pair of states). Dense parallel labels and notes increase their lane spacing and the height of that lower row to keep clear; other pairs loop under the row. |
50
+ | Labels | Above main-path arrows, on arc and loop runs, otherwise beside the segment next to the lower state. Every label keeps clear of other routes, states and labels; if one cannot, lower-row and route spacing grow and layout repeats, for at most five rounds. Main-path gaps stop growing before their minimum row width exceeds the text readability budget; gaps still fit their transition text. |
51
+
52
+ Every route carries a crossover halo, so an unavoidable crossing (for example,
53
+ two overlapping loops) stays legible. Lines are orthogonal with rounded corners.
54
+ Keep a distinct note on its original transition. Do not remove or copy notes to
55
+ make different exits qualify for sharing. The final width and label-clearance
56
+ checks still apply after layout retries.
57
+
58
+ ## Legend and state marks
59
+
60
+ State color follows `states[].type`: active and start are cyan, waiting amber,
61
+ decision purple, success green, failure rose, neutral and external slate. The
62
+ first main-path state carries the initial marker; a state with no outgoing
63
+ transition gets a double border as a final state. The default legend derives
64
+ kinds from the rendered states, always lists the initial marker, and adds a
65
+ non-interactive `final` entry when a final state exists. Supported
51
66
  `meta.legend.entries` keys, in stable order, are `start`, `active`, `waiting`,
52
- `decision`, `success`, `failure`, `neutral`, and `external`. Labels and
53
- visibility may be overridden through the shared legend contract; only kinds
54
- backed by rendered states receive Semantic Legend controls.
55
-
56
- ## Layout budget
57
-
58
- | Band | Lane id | Top y | Column centers | Default state |
59
- |------|---------|-------|----------------|---------------|
60
- | Phase | `main` (required) | 126 | `col` 0-4 → x = 94, 248, 402, 556, 710 | 118×62 |
61
- | Event | any other id | 278 | `col` 0-2 → x = 402, 556, 710 | 126×58 |
62
- | Outcome | `terminal` | 450 | `col` 0-2 → x = 402, 556, 710 | 118×58 |
63
-
64
- Event and terminal columns are intentionally offset from the main rail:
65
- event/terminal `col: N` uses the same x coordinate as main `col: N + 2`.
66
- For example, lower-band columns 0, 1, and 2 align beneath main columns 2, 3,
67
- and 4 respectively.
68
-
69
- | Constant | Value |
70
- |----------|-------|
71
- | viewBox | default `[980, 660]`; schema minimum `[420, 566]` |
72
- | State area | x within `[32, width − 32]`; state bottom at or above `height − 122` |
73
- | State spacing | ≥10px between any two states - checked across lanes, because all event lanes share one band; separate same-band states with `col` or `yOffset` |
74
- | Transition length | ≥32px between endpoints |
75
- | Legend row | final baseline y = height − 36; extra measured rows wrap upward |
76
-
77
- The primary lifecycle rail runs along the phase band and extends to the
78
- furthest occupied phase column. Route presets for transitions: `straight`,
79
- `drop` (bend at `channelY`, defaulting to the vertical midpoint),
80
- `bottom-channel`, `top-channel`, `right-channel`, `left-channel`, explicit
81
- `via` points, or the default `auto`. Multi-segment transitions get rounded
82
- corners; tune them with `cornerRadius` (default 10, `0` for sharp bends).
83
-
84
- ## Design Rules
85
-
86
- - Treat lifecycle diagrams as a phase map, not a dense state-transition graph.
87
- - Put the primary lifecycle on one horizontal rail using the `main` lane.
88
- - Use `step` labels for ordered phases, such as `01`, `02`, and `03`.
89
- - Use lower lanes only for interruptions, recovery, and terminal exits.
90
- - Keep transition labels out of the main SVG unless the label is essential;
91
- prefer node labels, tags, legend entries, and summary cards.
92
- - Avoid diagonal and crossing lines. Terminal exits should drop vertically from
93
- their source event whenever possible.
94
- - Use `success` for completion, `failure` for failure/terminal exits,
95
- `waiting` for pauses, and `decision` for quality gates.
96
-
97
- Schema violations exit non-zero with path-prefixed messages annotated with the
98
- element's id or label. The renderer additionally fails when it can detect
99
- layout problems, including a missing `main` lane, duplicate state IDs, unknown
100
- lanes, unknown transition endpoints, states outside the lifecycle area,
101
- overlapping states (including across lanes), labels colliding with states or
102
- other labels, labels wider than their state, unreadably short transitions, or
103
- transitions crossing unrelated states (2px Clean Flow clearance). Lifecycle
104
- bands remain intentional pass-through containers.
105
- Text width is estimated CJK-aware: fullwidth glyphs count as two units.
106
-
107
- Set `meta.quality_profile` to `showcase` for polished delivery. Unrelated proper
108
- X crossings then fail with `composition/proper-crossing`; default `standard`
109
- keeps them as artifact-receipt warnings. The final artifact check samples
110
- rounded `Q` corners. Collinear corridors remain outside the proper-X rule, but
111
- a separate gate warns in `standard` and fails in `showcase` when unrelated
112
- transitions overlap for at least 8px. Shared semantic endpoints, point touches,
113
- and shorter overlaps remain valid. Showcase also rejects any route segment
114
- below 8px and any interior turn segment below 16px; ordinary 8-15px endpoint
115
- stubs remain valid.
67
+ `decision`, `success`, `failure`, `neutral`, and `external`.
68
+
69
+ State decorations share one top rail: the type sigil and `step` on the left and
70
+ the brand mark at the right corner. Only states a reader should notice get a
71
+ default sigil: `waiting` (hourglass), `decision` (diamond), `success` (check),
72
+ `failure` (cross) and `external`; `start`, `active` and `neutral` states have
73
+ none unless `icon` sets one, except as a final state, which gets a stop sigil
74
+ so every outcome is marked. State width grows from 140px to 220px to fit its
75
+ text at the preferred size (12px label, 9px sublabel, 8px tag) before the text
76
+ shrinks.
77
+
78
+ ## Validation
79
+
80
+ Schema violations exit non-zero with path-prefixed messages. The renderer also
81
+ rejects duplicate state ids, unknown or repeated `mainPath` states, a
82
+ `mainPath` step without a transition, unknown transition endpoints, state text
83
+ that cannot fit the widest state, a canvas wider than its smallest text allows
84
+ on a desktop (`lifecycle/too-wide`), and a label that cannot be placed after the
85
+ spacing rounds (`lifecycle/label-unplaced`), and more than five parallel
86
+ transitions between two neighbouring states
87
+ (`lifecycle/crowded-side-transitions`). Each failure is a typed diagnostic
88
+ with supported fixes.
89
+
90
+ The final artifact check applies the shared composition gates (orthogonal
91
+ segments, crossings, corridors, label clearance and route rhythm). Routes of one
92
+ shared-exit bus declare `data-composition-junction`; they may share only that
93
+ horizontal bus, the identical first tick from the same source port, and, when
94
+ they end at the same state, the merged drop into it. Internal vertical runs
95
+ remain subject to the corridor check.
96
+
97
+ ## Design rules
98
+
99
+ - Treat the main path as the story: about six phases at most.
100
+ - Put interruptions, waits and exits off the main path; the renderer places them.
101
+ - Give an exit shared by several phases one label, such as “cancel”.
102
+ - A recoverable failure needs a real transition back.
103
+ - Use `success` for completion, `failure` for failure exits, `waiting` for
104
+ pauses, and `decision` for quality gates.