@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,120 +1,665 @@
1
1
  # Delivery contract
2
2
 
3
+ ## Failed finalize and candidate repair
4
+
5
+ `finalize` stops at the first non-passing gate. Use compact stdout or `evidence.summaryReceipt`; read its full sidecar only when the summary lacks evidence needed for a coherent repair. A receipt with four artifact checks is basic validation, not showcase acceptance: require all nine checks, zero composition errors, and zero warnings. Fix `meta.quality_profile` and schema errors before geometry. A dense full-schema ERD may keep `standard` for its first complete-field pass: require zero structural errors, no edge-through-node failures, complete field rows, and a readable grouped grid, and record composition warnings instead of spending unbounded time on them.
6
+
7
+ For a validation failure, edit the existing JSON in the connected neighborhood named by diagnostics before rerunning a command. Preserve requested semantics, meaningful labels, source evidence, and fixed or agreed topology. Several routes sharing nodes call for one placement repair; read [Architecture layout repair](architecture-layout-repair.md) for that case. Reflow a blocked main path rather than nudging unrelated labels. Keep unrelated geometry when its composition already reads clearly. Use `--layout-json` before editing only when compact evidence lacks needed measurements. Workflow v2 uses its stable compiler receipt, not solver internals, as authoring evidence.
8
+
9
+ Keep the best candidate that cleared route checks before a viewport repair. If that repair introduces new route collisions, restore the measured layout and address its remaining canvas or text constraint.
10
+
11
+ After the edit, rerun the complete `finalize` command with `--quality showcase` and, for repository-backed work, `--repo-root <repo-root>`. If the output path already has browser evidence from another candidate, use a fresh `--out-dir <output-stem>.review-<revision>` for both the new `finalize` and any `visual-check`. Omit an earlier `--candidate-sha256` after editing because it binds the previous candidate. Compare diagnostics by code, subject, stage, and evidence, never by declining error count alone. Track the repair limit per persistent issue, using that code, subject, stage, and evidence: a newly exposed issue starts its own repair sequence. If an issue survives two focused repairs, inspect measured geometry or the relevant contract; after one evidence-based retry, report the concrete gap.
12
+
13
+ Use standalone `validate` only for focused diagnosis, passing `--repo-root` for repository-backed work. Its passing receipt marks `candidateFrozen: true`; run `nextAction.arguments`, replacing only `<output.html>`, without editing, revalidating, or rereading the candidate. Retry later environmental or evidence failures against those frozen bytes. A measured reason to edit creates a new candidate and calls for the complete `finalize` without the old hash.
14
+
3
15
  ## Validate and deliver
4
16
 
5
- Use `validate` after every candidate edit. CLI HTML output paths must end in `.html`, including after symbolic-link resolution.
6
- Compare receipt paths must end in `.json`. Explicit CLI paths may be absolute or
7
- outside the current working directory; authored `meta.output` remains confined
8
- to that directory. A type mismatch fails before writing with
17
+ `render` and direct renderer entry points print classified authoring failures
18
+ to stderr as readable diagnostics and exit 1. Input read/JSON parse failures
19
+ use `input/read` or `input/json-parse`; output filesystem failures use
20
+ `output/write` and identify the output path. Schema and layout failures keep
21
+ their existing rule codes. Use the advertised `validate --json` or
22
+ `deliver --json` interface for a machine receipt; `render` has no `--json` flag.
23
+ Unexpected implementation failures retain debugging information in human
24
+ mode and remain `internal/unclassified` in machine receipts.
25
+
26
+ Each delivered output has two artifact-specific metadata paths. When an output
27
+ stem is too long for those derived filenames, Archify shortens it and appends a
28
+ stable hash:
29
+
30
+ - `<output-stem>.delivery.json` records the latest completed attempt.
31
+ - `<output-stem>.delivery-pending.json` is the recovery journal for an attempt
32
+ in progress.
33
+
34
+ For a literal artifact stem that already matches Archify's reserved bounded-name
35
+ marker, a pre-namespace raw provenance sidecar remains a read fallback when the
36
+ encoded sidecar is absent. A pre-namespace raw pending journal is an independent
37
+ fail-closed barrier: it blocks checks and redelivery even when an encoded pending
38
+ journal also exists, and neither journal is silently replaced.
39
+
40
+ One directory-wide `.archify-delivery-lock.json` serializes every delivery that
41
+ resolves into the same physical output directory. This deliberately prevents
42
+ case, Unicode-normalization, Windows short-name, and symbolic-link aliases from
43
+ creating independent owners for one filesystem location. The tradeoff is that
44
+ deliveries to different artifact names in one directory also run serially;
45
+ provenance and pending journals remain artifact-specific.
46
+
47
+ For migration safety, Archify also detects and preserves a legacy
48
+ `<output-stem>.delivery-lock.json` beside the requested artifact. An existing
49
+ legacy entry is a fail-closed recovery barrier. While a new delivery owns the
50
+ directory mutex, it also holds temporary legacy-format fences for the requested
51
+ spelling and an existing artifact's physical target spelling. It acquires the
52
+ directory lock first, then all required compatibility fences before writing a
53
+ journal or artifact, and removes the directory lock before those fences during
54
+ release. This blocks an older Archify binary using
55
+ either known spelling from entering the delivery. A legacy fence whose raw
56
+ HEAD-era filename exceeds the host component limit is omitted because the old
57
+ binary could not create that lock or deliver that artifact on the host either.
58
+
59
+ `deliver` acquires the lock by exclusive `open(..., "wx")` before creating or
60
+ replacing the recovery journal. A successful exclusive create yields an
61
+ internal opaque ownership capability bound to that attempt. Journal creation,
62
+ failed-provenance recording, pair commit, rollback, journal finalization, and
63
+ lock release each verify the current capability inside the operation that
64
+ would mutate shared state. A rejected contender does not create a journal or
65
+ write failed provenance.
66
+
67
+ An existing directory or legacy lock is handled without automatic recovery:
68
+
69
+ | Observed lock state | Required `deliver` result |
70
+ | --- | --- |
71
+ | No directory entry | Attempt exclusive creation; only its success grants ownership. |
72
+ | Valid schema-v1 lock whose PID is running, or whose death cannot be established | Exit 1 with `delivery/concurrent-attempt`; preserve every shared path. |
73
+ | Valid schema-v1 lock whose PID is known to have exited | Exit 1 with `delivery/lock-stale`; preserve the lock, artifact, journal, and current provenance exactly. |
74
+ | Unreadable, malformed, symlink, dangling symlink, directory, or other non-regular lock entry | Exit 1 with `delivery/lock-invalid`; preserve the entry and every other shared path. |
75
+ | An acquired capability no longer matches the current lock or journal | Exit 1 with `delivery/ownership-lost`; stop all shared-path mutation. |
76
+ | The matching owner cannot remove its lock | Exit 1 with `delivery/lock-release`; preserve the lock. |
77
+
78
+ A `delivery/lock-stale` diagnostic identifies the absolute output and lock
79
+ paths plus the original PID and receipt ID. Recovery is deliberately explicit
80
+ and serial: stop all delivery attempts for that physical output directory,
81
+ confirm that no active delivery owns it and that the reported stale entry has
82
+ not been replaced, remove only the reported lock, then rerun `deliver`. Do not
83
+ remove an artifact, current provenance, or pending journal as part of
84
+ stale-lock recovery.
85
+
86
+ The lock protocol targets Node.js 18 or later on a local filesystem with
87
+ cooperating Archify processes. PID, receipt, and file-identity comparisons are
88
+ defensive checks, not an atomic compare-and-swap. Compatibility fences cover
89
+ the requested spelling and an existing physical-target spelling; they cannot
90
+ enumerate arbitrary hard-link names or previously unknown filesystem aliases,
91
+ so mixed-version delivery through such aliases remains out of scope. This
92
+ contract does not claim distributed-lock correctness on NFS, SMB, or other
93
+ network filesystems, and it cannot prevent an external process that ignores
94
+ the protocol from replacing shared paths.
95
+
96
+ Every no-clobber HTML publisher (`render`, `deliver`, `compare`, and `preview`)
97
+ captures the requested directory entry, canonical write slot, physical parent,
98
+ and existing target type, device/inode identity, and mode before staging, then
99
+ revalidates that snapshot immediately before replacement. An existing write
100
+ target must be a regular file with exactly one hard-link name. A target with
101
+ multiple hard-link names fails closed with `output/target-hardlinked`: replacing
102
+ the requested name cannot update unknown sibling names as one publication.
103
+ Hard links remain supported for read identity and input/alias collision checks;
104
+ they are unsupported only as write targets. A symbolic link to a single-link regular
105
+ file remains supported: publication preserves the symbolic-link entry and
106
+ applies the same protocol to its resolved target. Directory, FIFO, socket,
107
+ device, changing mode, new claimant, and indeterminate identity cases fail
108
+ before replacement.
109
+
110
+ Publication is no-clobber and recoverable, not crash-atomic replacement of an
111
+ existing target. To avoid overwriting a claimant that appears after the last
112
+ identity check, Archify first retains the bound old file in a private recovery
113
+ backup, removes the public name through identity-bound quarantine, and then
114
+ creates the new public name with an exclusive hard link. A caught failure rolls
115
+ back when the public slot and recovery binding still permit it. A process
116
+ interruption between those namespace operations can instead leave the public
117
+ path absent while the verified previous bytes remain in an adjacent private
118
+ recovery backup. Single-artifact publication records the original slot/alias
119
+ identity and backup inode, mode, SHA-256, and byte count in private
120
+ `.archify-remove-*/publication-recovery-v1.json`, beside `previous`. To make a
121
+ specific interrupted publication visible again, stop concurrent writers and run:
122
+
123
+ ```bash
124
+ node bin/recover-output.mjs /absolute/path/to/.archify-remove-<id> --json
125
+ ```
126
+
127
+ This is explicit recovery, not a directory scanner. Before linking, the helper
128
+ checks for a changed parent or alias, an altered/hardlinked record or backup,
129
+ digest or inode mismatch, and any existing public target. It restores only by
130
+ no-clobber hard link, so a new claimant is preserved rather than overwritten;
131
+ it never recursively removes unknown entries. A completed recovery is
132
+ idempotent. The record is evidence to be independently verified, not an
133
+ authority to restore arbitrary private bytes: the helper accepts it only from
134
+ the recorded generated child of the original physical target parent, with the
135
+ same directory identity. Name the exact directory reported by the interrupted
136
+ process and inspect an uncertain record manually. A non-cooperating process can
137
+ still swap pathnames after those checks and before Node.js `linkSync`; Node does
138
+ not expose a descriptor-bound link operation. Post-link identity verification
139
+ then fails closed and retains recovery evidence, rather than claiming recovery
140
+ or deleting an uncertain name. If recovery itself is interrupted after the
141
+ link, the old public bytes and private backup can both remain; a later recovery
142
+ run preserves the public target and needs explicit operator resolution. The
143
+ record is fsynced before the old public name is retired on platforms supporting
144
+ directory sync, and the tested guarantee is recovery after a killed process;
145
+ this is not a claim of power-loss, storage-controller, NFS, or SMB durability.
146
+ Paired flows retain their backup in private transaction staging. For `deliver`,
147
+ the pending journal and lock keep strict checkers fail-closed. The portable
148
+ Node.js filesystem API has no pathname
149
+ compare-and-swap that both replaces an existing name atomically and refuses to
150
+ overwrite a late claimant: `rename` would close the visibility gap only by
151
+ overwriting that claimant.
152
+
153
+ After ownership is established, `deliver` creates the journal before rendering
154
+ and keeps it through the recoverable HTML/sidecar pair commit. It removes the
155
+ journal only after that commit completes. A validation, render, or pair-commit
156
+ failure, or a process interruption, may therefore leave a journal. The journal
157
+ is a safety barrier: `check`, `browser-check`, and `visual-check` fail closed when any directory
158
+ entry exists at the journal or lock path, including an unreadable file,
159
+ symlink, or dangling symlink. Run deliveries targeting the same physical output
160
+ directory serially; one attempt must finish or be recovered before another
161
+ begins.
162
+
163
+ A successful sidecar has `schemaVersion: 1`, `status: "current"`,
164
+ `command: "deliver"`, a unique `receiptId`, the diagram `type`, an absolute
165
+ `input` path, an absolute `output` path matching the inspected
166
+ artifact, and specification/artifact SHA-256 and byte counts. Checkers treat a
167
+ missing, malformed, unsupported, or inconsistent field as invalid. They also
168
+ reject a sidecar symlink, including a dangling one. A checker binds provenance
169
+ to the artifact bytes it actually checks and verifies that binding again before
170
+ reporting success; a concurrent byte change fails. The provenance directory
171
+ entry itself must be a single-link regular file: `deliver` and strict check fail
172
+ closed with `delivery/provenance-hardlink-unsupported` when it has another hard
173
+ link, without scanning for or guessing the sibling name.
174
+
175
+ If a currently verified owner fails after an older HTML exists, Archify writes
176
+ a new `status: "failed"` sidecar and leaves the journal until recovery is
177
+ complete. An unreadable old HTML does not prevent that marker; its artifact hash
178
+ and byte count may be absent. If the sidecar is locked or otherwise unwritable,
179
+ Archify keeps the prior sidecar rather than deleting evidence, and the journal
180
+ prevents checkers from trusting it. A rejected concurrent, stale, or invalid
181
+ lock attempt does not write failed provenance. If ownership is lost, Archify
182
+ reports `delivery/ownership-lost`, does not overwrite or remove the successor's
183
+ artifact, provenance, journal, or lock, and does not claim recorded failed
184
+ provenance; a failure receipt may report `provenance: "unrecorded"`. If every
185
+ metadata path is unavailable, the same unrecorded status applies; no tool can
186
+ preserve that fact across processes. Restore metadata-path access and complete
187
+ a successful `deliver` before trusting the output.
188
+
189
+ Artifacts with no sidecar, journal, or lock remain supported for backward
190
+ compatibility and for the lower-level `render` command. Their checker receipts
191
+ report `provenance: "unknown"`; use `--require-provenance` to turn that state
192
+ into a non-zero failure when the workflow requires a successfully delivered
193
+ artifact:
194
+
195
+ ```bash
196
+ node bin/archify.mjs check <output.html> --require-provenance
197
+ node bin/archify.mjs browser-check <output.html> --json --require-provenance
198
+ ```
199
+
200
+ ## Output path contracts
201
+
202
+ Archify intentionally separates durable authored paths from command-line paths:
203
+
204
+ - Required authored `meta.output` is a portable POSIX-relative path such as
205
+ `reports/diagram.html`. It uses `/`, ends in a non-empty `.html` basename,
206
+ and cannot contain an absolute or drive-relative prefix, URI, backslash,
207
+ empty or dot segment, control character, unpaired UTF-16 surrogate, Windows
208
+ alternate-data-stream separator or invalid filename character, trailing dot
209
+ or space, DOS device name, or a component over either the 255-byte UTF-8 or
210
+ 255-code-unit UTF-16 limit. It resolves from the current working directory
211
+ and must remain physically inside that directory, with an `.html` target,
212
+ after symbolic links are followed. The durable output/archive profile also
213
+ conservatively rejects a Windows 8.3 short-name shape such as `PROGRA~1`;
214
+ descriptive repo/Git POSIX paths use a separate profile and are exempt.
215
+ - Explicit CLI output arguments use the active host's native syntax. They may
216
+ be relative or absolute, use native separators, and resolve outside the
217
+ current working directory. On Windows, ordinary drive-absolute, UNC, and
218
+ relative paths (including ordinary `.` and `..` navigation) are supported.
219
+ A system-resolved 8.3 spelling of an existing file or directory is accepted
220
+ when Archify can prove its physical identity; this native alias support does
221
+ not relax the durable output/archive profile's 8.3-shaped-name rejection.
222
+ Extended-length paths are limited to raw backslash-only `\\?\C:\...` and
223
+ `\\?\UNC\server\share\...` forms without dot segments; device namespaces,
224
+ malformed roots, drive-relative paths such as `C:file.html`, current-drive
225
+ roots such as `\file.html`, alternate data streams, reserved device names,
226
+ invalid or trailing filename characters, and overlong components fail
227
+ closed. POSIX CLI paths retain POSIX filename rules rather than inheriting
228
+ Windows spelling restrictions. Every host rejects NUL, unpaired surrogates,
229
+ and components that exceed its supported bound.
230
+
231
+ These contracts are not interchangeable: an explicit CLI output does not hide
232
+ an invalid durable `meta.output` (including a missing value), and `validate`
233
+ checks the authored output even when it does not publish to that path. A
234
+ workflow v1-to-v2 migration may explicitly receive a portable durable
235
+ replacement through `migrate workflow old.json new.json --to-schema 2 --output
236
+ reports/diagram.html`; that value is written only to its separate verified v2
237
+ destination. This migration-candidate exception does not repair the source or
238
+ bypass any non-output schema or compiler error. For every other repair, add a
239
+ portable POSIX-relative `.html` path to `meta.output`; no schema-version change
240
+ is otherwise required.
241
+
242
+ Run `finalize` directly on a complete first candidate and after every repair edit. Its embedded validation checks the candidate before delivery; use standalone `validate` only for focused diagnosis. After an edit, omit any earlier `--candidate-sha256`, which binds the previous candidate. CLI HTML output paths must end in
243
+ `.html`, including after symbolic-link resolution. Compare receipt paths must
244
+ end in `.json`. A type mismatch fails before writing with
9
245
  `output/cli-extension` or `output/cli-resolved-extension`. These checks prevent
10
246
  accidental file-type overwrites; they do not sandbox explicit CLI directories
11
247
  or prevent replacement of an existing artifact of the expected type.
12
248
 
13
- Use final atomic delivery only after the candidate is frozen:
249
+ Use final verified delivery only after the candidate is frozen:
14
250
 
15
251
  ```bash
16
- .claude/skills/stacks-technical-diagrams/bin/diagrams deliver <type> <candidate.json> <output.html> --quality showcase --json
252
+ node bin/archify.mjs deliver <type> <candidate.json> <output.html> --quality showcase --json
17
253
  ```
18
254
 
19
- Deliver reads the specification once, writes those exact bytes to a private same-directory candidate snapshot, renders that snapshot, runs the complete artifact checker, and only replaces the target after all artifact checks pass. The JSON receipt includes SHA-256 and byte counts for both `specification` and `artifact`. Renderer, checker, receipt, or commit failure exits non-zero, removes private state, preserves the previous trusted artifact, and never invokes an opener.
255
+ Deliver reads the specification once, writes those exact bytes to a private same-directory candidate snapshot, renders that snapshot, runs the complete artifact checker, and only replaces the target after all artifact checks pass. The JSON receipt includes SHA-256 and byte counts for both `specification` and `artifact`.
20
256
 
21
- Run `visual-check` only after `deliver` exits zero for the current candidate. If
22
- delivery fails and the output path already exists, that path still names the
23
- previous trusted artifact; running `visual-check` then would measure and capture
24
- stale output, not the rejected candidate. Report the delivery diagnostics and
25
- repair the source before collecting new visual evidence.
257
+ For the ordinary agent handoff path, prefer the finalizer:
26
258
 
27
- The delivery interface exposes three separate claims:
259
+ ```bash
260
+ node bin/archify.mjs finalize <type> <candidate.json> <output.html> --quality showcase --json
261
+ ```
262
+
263
+ `finalize` invokes verified `deliver` once, reuses its embedded showcase
264
+ validation result, then runs strict `check --require-provenance` and
265
+ `browser-check --require-provenance`. It stops at the first failed or skipped stage
266
+ and preserves that stage's full receipt. Its stdout is one compact JSON
267
+ object with gate statuses, bounded actionable diagnostics, artifact identity,
268
+ and evidence paths. The same compact object is written atomically to
269
+ `<output-stem>.finalize-summary.json`; use that file for normal failure repair. When diagnostics are truncated, `diagnosticSummary.omittedByCode` counts the unshown entries by diagnostic code without replacing their full subject and repair evidence in the full receipt.
270
+ Complete stage receipts and timings remain available for auditing in
271
+ `<output-stem>.finalize.json`. With `--out-dir`, both files are written there (unless an explicit `--receipt` overrides the finalize receipt path; the artifact HTML stays at the requested output path);
272
+ `--receipt <path.json>` overrides the full receipt path and derives a distinct
273
+ `<path>-summary.json`. Read the full receipt only when the compact summary is
274
+ truncated and its shown subjects and evidence cannot identify a coherent local
275
+ repair, or when complete audit evidence was explicitly requested. The compact
276
+ receipt reports `visualReview: "not-requested"`; the automated gate does not create images or require a perceptual reviewer. A compact `visualReviewRecommendation` retains positive crossover and route-detour metrics from the strict check so the author can apply the review escalation below without reading the full receipt. A recommendation does not change the machine exit code or claim that review happened. Its `affectedRoutes` identifies crossing pairs and detours (up to eight of each, with a truncation flag); the full strict-check `composition.routeReview` retains all affected relationships. Use these IDs to trace the routes in the captured default viewport. Detours may include `directCorridorBlockers`, identifying nodes between aligned endpoints. These are geometric review clues, not new validation failures or inferred main-path semantics. For a blocked main path or several tangled routes, follow [Architecture layout repair](architecture-layout-repair.md) and reflow the connected scene before tuning individual sides or labels. Preserve every semantic fact; retain unrelated positions only when their surrounding composition is already accepted.
277
+
278
+ For a measured automatic Architecture with a large unused leading area, the
279
+ compact receipt may include `layoutReviewRecommendation`. Its
280
+ `composition.leadingSpace` evidence accounts for nodes, boundary titles,
281
+ routes and labels. Check whether that space is intentional; if not, reposition
282
+ the connected scene while preserving meaning and user-fixed geometry, then
283
+ finalize again. This suggestion changes no gate or exit status and requires
284
+ no screenshot. A fixed canvas or uncertain measurement receives no suggestion.
285
+
286
+ A passing finalizer receipt is sufficient evidence for all four gates. Merely
287
+ naming the gates or requiring each one to pass does not require replaying their
288
+ standalone commands. Replay an individual command only when the request
289
+ explicitly requires separate executions or focused failure diagnosis needs it.
290
+
291
+ The individual commands remain authoritative and backward compatible. Use
292
+ them directly for focused diagnosis, recovery, or when only one gate is
293
+ required. A finalize failure does not relax any gate and does not turn a
294
+ preserved older artifact into a current successful delivery.
295
+
296
+ `finalize` discovers and starts private Chrome only after delivery and strict
297
+ checking pass. Failed input, repository-evidence, delivery, or artifact checks
298
+ therefore do not launch a browser. It loads the artifact only after current
299
+ provenance is verified. The browser gate retains every viewport, theme, and
300
+ stability check; the browser closes at completion or a browser-stage failure.
301
+ Its full stage receipt records `execution: "in-process"` and the equivalent
302
+ standalone `command` for replay. Chrome startup no longer overlaps the earlier
303
+ stages, so successful runs may take slightly longer. This avoids unnecessary
304
+ startup on invalid candidates; it does not fix host sandbox restrictions on
305
+ Chrome startup or relax a browser gate.
306
+
307
+ The pair commit is recoverable, not a claim that two filesystem paths change
308
+ atomically or are durable across power loss. Journal finalization is part of
309
+ that commit: a caught failure while verifying or removing the journal rolls
310
+ back the replaced files when possible and while ownership remains current. If
311
+ ownership is lost, the old attempt immediately stops renaming, rolling back,
312
+ finalizing the journal, recording failure provenance, or cleaning up shared
313
+ paths. Any private staging or recoverable backups remain available and are
314
+ identified by the failure diagnostic. If restoration fails for another reason,
315
+ the failure receipt likewise identifies retained backups for recovery. A
316
+ process interruption can leave the journal, backups, or private staging behind;
317
+ checkers then fail closed. Follow the reported recovery evidence before rerunning
318
+ `deliver` serially on the same output. A failed attempt exits non-zero and never invokes an opener; it never
319
+ authorizes visual evidence collection.
320
+
321
+ If exclusive creation succeeds but lock initialization fails, Archify may
322
+ record failed provenance and remove the incomplete lock only while its
323
+ capability still identifies that exact entry. A replacement is preserved.
324
+ Filesystem and cleanup errors are reported separately from an active concurrent
325
+ delivery. An active, stale, unrecognized, or otherwise preserved lock
326
+ independently prevents checkers from accepting the prior artifact. Fix the
327
+ reported filesystem error before retrying, and use another physical output
328
+ directory if the lock path contains unrelated data.
329
+
330
+ Lock release is part of delivery completion. If the artifact/provenance pair
331
+ has committed and the journal has finalized but the matching lock cannot be
332
+ removed, `deliver` exits 1 with `delivery/lock-release`, preserves the lock,
333
+ does not print a success receipt, and does not invoke an opener. The preserved
334
+ lock keeps strict checkers fail-closed. Only after pair commit, journal
335
+ finalization, and lock release all succeed may `deliver` exit zero, print its
336
+ success receipt, or run `--open`.
337
+
338
+ Run strict `check` after `deliver` exits zero. Run `browser-check` or optional
339
+ `visual-check` only after that strict check exits zero. A failed marker,
340
+ recovery journal, or delivery lock makes every checker fail before accepting
341
+ the preserved HTML; report the diagnostics and complete a successful recovery
342
+ delivery before collecting new browser evidence.
343
+
344
+ Static `check` uses the same SVG path analysis for inspected relationships and
345
+ structural frames. It supports `M/L/H/V/Q/Z`, their lowercase relative forms,
346
+ repeated parameters, and finite numbers. Each `M` starts an independent subpath;
347
+ `Z` closes only the current subpath. Separate subpaths never create connecting
348
+ segments that are absent from the drawing. Straight segments separated by a
349
+ non-collinear `Q` also remain separate in route analysis; curve sample points
350
+ do not become micro-segments in straight-route budgets or rhythm checks.
351
+ Segment lengths and stretch are measured per continuous piece, while actual
352
+ bends are summed per relationship. A relationship exceeding a budget is counted
353
+ once, and internal piece boundaries do not receive the short shared-trunk
354
+ exception reserved for semantic endpoints.
355
+
356
+ This is not a promise of full SVG command support: `A/C/S/T` produce
357
+ `artifact/svg-path-unsupported`; missing parameters, invalid numbers, and other
358
+ syntax errors produce `artifact/svg-path-malformed`. The checker exits non-zero
359
+ instead of skipping a bad path or waiting indefinitely. Path failures append a
360
+ `svg_path_data` check; normal valid artifacts retain the existing nine checks.
361
+ Diagnostics carry the inspected `pathIndex`, `role`, available relationship/frame
362
+ `id`, parsing `tokenOffset`, available `command`, and `reason` so the generating
363
+ source can be located and repaired. `pathIndex` is one-based; `tokenOffset` is a
364
+ zero-based UTF-16 offset in `d` after numeric character references are decoded.
365
+ Apparent tags in comments, CDATA, and attribute text are ignored. Passing static
366
+ path checks does not establish browser or perceptual visual acceptance.
367
+
368
+ <details>
369
+ <summary>中文说明</summary>
370
+
371
+ 静态 `check` 对受检关系线和结构边界的 SVG 路径使用同一解析结果,支持
372
+ `M/L/H/V/Q/Z` 及其小写相对形式、重复参数和有限数值。每个 `M` 开始独立
373
+ 子路径,`Z` 只闭合当前子路径;子路径之间不会被拼接成图中不存在的线段。
374
+ 非共线 `Q` 前后的直线也保持分离,不会把曲线采样点计为直线路由预算或
375
+ 节奏检查中的微线段。线段长度和伸长率按连续片段测量,真实转弯数汇总到原关系;超预算关系
376
+ 只计一次,内部子路径断点不享有语义起终点的短共享线例外。
377
+ 这不是完整 SVG 命令集的支持承诺:`A/C/S/T` 返回
378
+ `artifact/svg-path-unsupported`;缺少参数、非法数值等格式错误返回
379
+ `artifact/svg-path-malformed`,检查以非零状态结束,不跳过坏路径或无限等待。
380
+ 路径失败时追加 `svg_path_data` 检查;普通有效产物仍保留原来的 9 项检查。
381
+ 诊断携带受检路径的 `pathIndex`、`role`、可用的关系/边界 `id`,以及解析位置
382
+ `tokenOffset`、可用的 `command` 和 `reason`,用于定位并修复生成路径的来源。
383
+ `pathIndex` 从 1 开始;`tokenOffset` 是数字字符引用解码后的 `d` 字符串中
384
+ 从 0 开始的 UTF-16 位置。注释、CDATA 和属性文本中的伪标签不参与检查。
385
+ 静态路径检查通过仍不代表浏览器或感知视觉验收通过。
386
+
387
+ </details>
388
+
389
+ The delivery interface exposes four separate claims:
28
390
 
29
391
  1. `deliver` proves deterministic artifact checks and byte identity.
30
- 2. `visual-check` collects automated browser evidence from the exact artifact.
31
- 3. Perceptual visual review records a human or image-capable reviewer's judgment.
392
+ 2. `browser-check` collects required automated browser evidence from the exact artifact without capturing images.
393
+ 3. `visual-check` optionally adds artifact-bound screenshots and a contact sheet.
394
+ 4. Perceptual visual review records a human or image-capable reviewer's judgment.
395
+
396
+ Passing one claim never implies the others. Never claim that the deterministic receipt includes browser or perceptual review evidence.
397
+
398
+ ## Recovering a failed comparison
399
+
400
+ `compare` commits an HTML artifact and its JSON receipt as a pair. If that commit
401
+ fails, it attempts to restore the previous files. A complete rollback removes
402
+ the temporary directory as usual.
32
403
 
33
- Passing one claim never implies either of the others. Never claim that the deterministic receipt includes visual review. It does not include browser evidence either.
404
+ If a previous file cannot be restored, compare exits non-zero with
405
+ `delta/commit-rollback-failed` and retains the recovery directory. In the JSON
406
+ failure receipt, `diagnostics[].evidence.recoveryDirectory` identifies that
407
+ directory and `recoveryFiles` lists `{ backup, target }` paths for the files whose
408
+ restoration failed. Human-readable diagnostics also print the recovery paths.
409
+
410
+ Resolve the filesystem error, inspect the current targets, and restore each
411
+ listed backup to its corresponding target before retrying. Keep the recovery
412
+ directory until both previous files have been recovered and verified; it can
413
+ also contain rejected candidate files, which must not be mistaken for backups.
414
+ Successful comparisons and failures before commit retain their normal cleanup.
34
415
 
35
416
  ## Automated browser evidence
36
417
 
37
- After delivery, inspect the exact trusted HTML without rerendering or modifying
38
- it:
418
+ `finalize` runs the required browser gate against the exact trusted HTML without
419
+ rerendering or modifying it. For focused diagnosis, the equivalent standalone
420
+ command is:
39
421
 
40
422
  ```bash
41
- .claude/skills/stacks-technical-diagrams/bin/diagrams visual-check <output.html> --json
423
+ node bin/archify.mjs browser-check <output.html> --json --require-provenance
42
424
  ```
43
425
 
44
- The zero-dependency command uses Chrome/Chromium through the DevTools pipe. It
426
+ The zero-dependency command uses Chrome/Chromium (or Microsoft Edge)
427
+ through the DevTools pipe. `ARCHIFY_CHROME` is authoritative when set, including
428
+ an invalid path: Archify does not silently fall back to another browser. Automatic
429
+ Windows discovery checks every Chrome/Chromium install location and PATH command
430
+ first, then Edge under `%ProgramFiles(x86)%`, `%ProgramFiles%`, and `%LocalAppData%`,
431
+ followed by `msedge` on PATH. On macOS and Linux, discovery also checks
432
+ Chrome/Chromium first, then the Edge application bundle (macOS) and
433
+ `microsoft-edge`/`microsoft-edge-stable` on PATH. It
45
434
  measures light-theme containment at 1440×900, 1600×1000, 1920×1080, and
46
- 2048×1320, then captures light/dark screenshots at 1440×900 and 2048×1320. It
47
- writes four PNG sidecars, one relative-path HTML contact sheet, and one JSON
48
- receipt beside the artifact. The receipt binds the source artifact SHA-256 and
49
- byte count, identifies `evidenceKind: "automated-browser"`, records READ plus
50
- Still runtime state, and always reports `visualReview: "pending"`; automated
51
- browser evidence cannot claim perceptual review.
52
-
53
- `browser_evidence` in the handoff records only the outcome of this automated command:
54
-
55
- - `passed` maps from exit 0 and receipt `status: "pass"` only after every required measurement and capture completes and passes.
56
- - `failed` maps from exit 1 and receipt `status: "fail"` when the inspection finds a defect, the command fails, or a runtime/capture error leaves the evidence incomplete.
57
- - `skipped` maps only from exit 2 and receipt `status: "skipped"` when Chrome/Chromium is unavailable and the inspection does not run.
58
-
59
- Runtime or capture failures leave incomplete evidence and must not be normalized to `skipped`. Failed or skipped capture runs remove stale
60
- image/contact-sheet sidecars rather than presenting prior evidence as current.
61
- They do not invalidate an already successful deterministic delivery, and they
62
- do not turn a perceptual visual review into passed or failed. Retry an
63
- environmental failure through the supported command in a browser-capable
64
- execution context when practical. Keep the packaged transport unchanged unless
65
- the failure reproduces through that seam in a capable environment.
435
+ 2048×1320, and verifies the requested light theme at all four viewports, the dark
436
+ theme at both endpoints, and READ/Still runtime states. A requested theme that
437
+ resolves to a different theme fails with measured evidence. It creates one
438
+ `<output-stem>.browser-check.json` receipt and no screenshots or contact sheet.
439
+ Pass `--out-dir <dir>` to place the receipt in a separate evidence directory.
440
+ The receipt binds the artifact SHA-256 and byte count, identifies
441
+ `evidenceKind: "automated-browser"`, and reports
442
+ `visualReview: "not-requested"`.
443
+
444
+ Horizontal overflow always fails. Normal document-level vertical scrolling is
445
+ accepted only with a renderer-declared contract and measured readable text.
446
+ Automatic canvases declare `data-reader-fit="intrinsic-height"` (height fitting)
447
+ or `data-reader-fit="width-first"` (Sequence and Waterfall reading width); their adaptive
448
+ Reader must reach its readable width and expose `data-reader-overflow="authored"`.
449
+ Architecture with an explicit `meta.viewBox` instead declares
450
+ `data-diagram-type="architecture"` and `data-reader-fit="authored-height"`:
451
+ its SVG coordinates, aspect ratio and existing Reader width behavior stay
452
+ unchanged. Its full SVG must remain inside the diagram panel without internal
453
+ scrolling or clipping, and the document must permit vertical scrolling.
454
+ The receipt records `verticalScrollAccepted: true` and
455
+ `overflowDisposition: "readable-vertical-scroll"`. Missing or unknown declarations,
456
+ explicit viewBoxes in other modes, unreadable text, horizontal overflow,
457
+ clipping and Viewer chrome collisions remain failures. Do not add an internal
458
+ diagram scroller or hide overflow.
459
+
460
+ `browser_evidence` in the handoff records only the outcome of this automated
461
+ command:
462
+
463
+ - `passed` maps from exit 0 and receipt `status: "pass"` after every required measurement completes and passes.
464
+ - `failed` maps from exit 1 and receipt `status: "fail"` when the inspection finds a defect, the command fails, or a runtime error leaves the evidence incomplete.
465
+ - `skipped` maps only from exit 2 and receipt `status: "skipped"` when no supported browser is available and the inspection does not run.
466
+
467
+ Runtime failures leave incomplete evidence and must not be normalized to
468
+ `skipped`. They do not invalidate an already successful deterministic delivery.
469
+ Retry an environmental failure in a browser-capable execution context when
470
+ practical. Keep the packaged transport unchanged unless the failure reproduces
471
+ through that seam in a capable environment.
472
+
473
+ On Windows, Chrome/Edge startup relaunches can lose the inherited DevTools
474
+ pipe before any response arrives. Archify removes a standalone
475
+ `__COMPAT_LAYER=DetectorsAppHealth` from the browser child's environment only
476
+ (case-insensitive name and value); the parent environment, unknown layers,
477
+ combined layers, and privilege-related compatibility settings are unchanged.
478
+ This targets the reported non-elevated Git Bash app-health case, not every
479
+ AppCompat mode. Elevated-shell relaunches remain unsupported: rerun from a
480
+ non-elevated PowerShell opened normally, outside an elevated or compatibility-mode
481
+ parent. Archify does not suppress browser de-elevation or disable the sandbox
482
+ as a relaunch workaround. A zero-response startup diagnostic suggests this
483
+ remedy without claiming that elevation or AppCompat caused every pipe failure.
484
+
485
+ A provenance failure exits before browser inspection and persists a failed
486
+ browser-check receipt bound to the attempted artifact. If the failure receipt
487
+ cannot be written, the diagnostic names that incomplete evidence.
488
+
489
+ Both browser commands inspect the exact delivered HTML without modifying or rerendering it.
490
+
491
+ ## Sequence width review
492
+
493
+ A passing `finalize` may report `layoutReviewRecommendation.action: "inspect-sequence-width"`. Its `evidence` measures the fixed participant columns' unused right-hand space after accounting for message labels, notes and segment titles. This advice adds no warning, failure, screenshot requirement or automatic geometry change.
494
+
495
+ A passing `validate --json`, `deliver`, or `finalize` receipt may carry `diagnostics[]` entries with `severity: "warning"` for Viewer locale fallbacks (`i18n/*`). They fail no gate. When the artifact should be fully localized, repair the listed keys from their `evidence` and rerun `finalize`.
496
+
497
+ Sequence canvases with omitted `meta.column_fit` use `spread`, whether or not `meta.viewBox` is supplied. An authored viewBox remains authoritative; infeasible participant capacity fails without silently enlarging it. Explicit `meta.column_fit: "fixed"` preserves historical fixed columns. For a candidate whose fixed-column width suggestion remains, first check whether the fixed geometry is intentional. Only when a change to that geometry is authorized, save the candidate, set only `meta.column_fit` to `"spread"`, and rerun the complete `finalize` once with `--out-dir <folder>/width-review`. Keep participant order, messages and their y positions, labels, notes, sources and canvas dimensions. If that attempt fails, restore the candidate and finalize it with `--out-dir <folder>/width-restore`; report the remaining layout suggestion rather than iterating. Preserve intentional fixed geometry and disclose the suggestion when a change is not authorized. To retain historical fixed coordinates for an older omitted-fit input, set `meta.column_fit: "fixed"` explicitly. This review is about horizontal composition; a passing receipt still does not claim perceptual approval.
498
+
499
+ ## Optional capture evidence
500
+
501
+ `visual-check` remains backward compatible for a requested or escalated
502
+ perceptual review:
503
+
504
+ ```bash
505
+ node bin/archify.mjs visual-check <output.html> --summary --require-provenance
506
+ ```
507
+
508
+ `--summary` returns compact JSON with all diagnostics and absolute paths to the complete receipt, contact sheet, and every screenshot. For a chosen visual review, inspect the relevant captures; capture success is not perceptual approval. `--json` retains the full receipt output for existing consumers. Both modes run the same checks and keep the same exit status. If cleanup fails after publication, the summary retains the final failure diagnostics and `publication` recovery details; the linked receipt records the earlier committed evidence.
509
+
510
+ It performs the same automated browser measurements, captures light/dark
511
+ screenshots at 1440×900 and 2048×1320, and writes four viewport PNG sidecars,
512
+ one relative-path HTML contact sheet, and one JSON receipt. `--out-dir <dir>` moves all of these sidecars together.
513
+ Open the HTML contact sheet in a browser or inspect the viewport PNGs with an image reader. Its receipt reports `visualReview: "pending"` because captures do not themselves
514
+ make a perceptual judgment. Capture and provenance failures follow the ownership rules below.
515
+
516
+ The receipt, contact sheet, and four PNGs form one owned evidence set. Before
517
+ capture, `visual-check` freezes every requested directory entry, its
518
+ canonical write slot and physical parent, and the target's absent/file state,
519
+ type, device/inode identity, and mode. Hard-linked evidence targets are not safe
520
+ write targets. All candidate files are created exclusively inside one random,
521
+ private staging directory beneath the physical evidence directory; the receipt
522
+ is published last. Each staged candidate must have exactly one hard-link name
523
+ before publication. The no-clobber publish link temporarily gives the staged
524
+ and final names a link count of two; unlinking the verified staged name must
525
+ leave the final entry with a link count of one. An unexpected external hard
526
+ link fails closed and its alias is never removed.
527
+
528
+ Chrome inspects one identity- and content-checked copy of the captured artifact
529
+ in a private local temporary directory, so browser file loading does not depend
530
+ on UNC or long-path support. The six publication candidates remain on the
531
+ evidence volume. Both temporary directories are cleaned without recursively
532
+ deleting unknown contents; retained entries include their recovery locations.
533
+
534
+ Immediately before committing anything, `visual-check` re-resolves and verifies
535
+ the complete six-path set. An absent-path claimant, existing-path replacement,
536
+ symbolic-link or dangling-link retarget, parent-topology change, hard link, or
537
+ indeterminate identity fails closed with `viewer/evidence-path-conflict`. The
538
+ claimant and every other final evidence path remain untouched. Cleanup removes
539
+ only this run's staged or published entries after rechecking their captured
540
+ identities; a changed or unknown entry is preserved.
541
+
542
+ An existing visual evidence set is replaceable only when a regular
543
+ `visual-check` receipt proves ownership of the same artifact and evidence
544
+ directory, and its exact sidecar manifest matches every existing contact-sheet
545
+ or PNG byte count and SHA-256 digest. A missing, malformed, unknown, mismatched,
546
+ or incomplete ownership record never authorizes deletion. Failed and skipped
547
+ runs retire prior screenshots/contact sheets only as part of the same verified
548
+ transaction when that ownership proof succeeds; otherwise they preserve all
549
+ unknown evidence and report `viewer/evidence-path-conflict`.
550
+
551
+ This rule also applies when Chrome is unavailable or provenance fails before
552
+ browser inspection: neither path may blindly delete stale-looking evidence. A
553
+ verified owned set may be recoverably retired before publishing a skipped or
554
+ failed receipt; unowned evidence remains intact. These outcomes do not invalidate an already
555
+ successful deterministic delivery and do not turn a perceptual visual review
556
+ into passed or failed. Retry an environmental failure through the supported
557
+ command in a browser-capable execution context when practical. Keep the
558
+ packaged transport unchanged unless the failure reproduces through that seam in
559
+ a capable environment.
560
+
561
+ `browser-check` applies the same private-snapshot, identity, ownership, and no-clobber rules to its single JSON receipt. Its namespace is separate from `visual-check`, so a browser-only rerun cannot remove capture evidence.
562
+
563
+ ## A new candidate at an existing output path
564
+
565
+ Browser evidence belongs to exact artifact bytes. After editing a candidate whose previous HTML already has browser evidence, choose a fresh evidence directory before running the next `finalize`; this preserves the old receipts and captures without an avoidable ownership-conflict retry. `--out-dir` relocates the new browser-check receipt and, by default, the finalize receipt and summary. An explicit `--receipt` overrides the finalize receipt path; its summary follows that path. Successful delivery still rewrites the requested HTML and its sibling `*.delivery.json`. Earlier browser or visual evidence remains bound to its original artifact bytes and must not be treated as evidence for changed HTML:
566
+
567
+ ```bash
568
+ node bin/archify.mjs finalize architecture candidate.json diagram.html --quality showcase --repo-root <root> --out-dir diagram.review-2 --json
569
+ node bin/archify.mjs visual-check diagram.html --out-dir diagram.review-2 --summary --require-provenance
570
+ ```
571
+
572
+ The evidence directory is not an archive of the HTML. Copying the HTML there alone does not rebind receipt paths or provenance. If a historical snapshot is needed, preserve the candidate and artifact separately before overwriting them; do not assume copied receipts validate a relocated artifact.
573
+
574
+ Keep the requested HTML path stable. Use a new revision directory for each changed candidate, and retain the same directory for retries of unchanged bytes. For a diagram without repository evidence, omit `--repo-root`. Let the commands create their output directory. A prior validation failure that produced no HTML or browser evidence needs no new directory. Never remove unknown evidence to make a retry pass.
66
575
 
67
576
  ## Optional opening
68
577
 
69
- Add `--open` only when the user wants an immediate local preview. It runs after that atomic commit, uses one argument-array OS opener with a five-second bound, and records `open.status`. Keep it off for CI, unattended agents, and non-interactive environments. Failure or unsupported opening does not invalidate delivery; its status proves only whether the local opener invocation succeeded.
578
+ Add `--open` only when the user wants an immediate local preview. It runs after
579
+ the verified pair commit has completed, its recovery journal has been removed,
580
+ and the delivery lock has been released successfully. It uses one argument-array
581
+ OS opener with a five-second bound on macOS and Linux, and a fifteen-second bound
582
+ for PowerShell startup on Windows. The receipt records `open.status`; failed or
583
+ unavailable launch attempts also include normalized `open.failure` details.
584
+ Keep it off for CI, unattended agents, and non-interactive environments.
585
+ Failure or unsupported opening does not invalidate delivery; its
586
+ status proves only whether the local opener invocation succeeded.
70
587
 
71
588
  ## Last-Good Live Preview
72
589
 
73
590
  For an active desktop authoring loop only:
74
591
 
75
592
  ```bash
76
- .claude/skills/stacks-technical-diagrams/bin/diagrams preview <type> <input>.json <output>.html --quality showcase
593
+ node bin/archify.mjs preview <type> <input>.json <output>.html --quality showcase
77
594
  ```
78
595
 
79
596
  Preview watches one explicit input on loopback, binds each stable digest to a private snapshot, and advances only after the existing verified delivery pipeline passes. Invalid, half-written, deleted, or superseded input leaves the previous verified revision on screen and on disk. Identical bytes do not rebuild or reload.
80
597
 
81
598
  The preview runtime ships inside the zero-dependency Skill ZIP and must work without `node_modules`.
82
599
 
83
- Never start it by default. Do not use it for CI, unattended agents, remote sharing, or mobile use. `--no-open` is only for a user who will open the printed local URL or for loop testing. Stop it with Ctrl-C before handoff. Server state, port, source path, diagnostics, error text, and reload tokens must never enter the generated artifact or any export.
600
+ Never start it by default. Do not use it for CI, unattended agents, remote sharing, or mobile use. `--no-open` is only for a user who will open the printed local URL or for loop testing. Stop it with Ctrl-C before handoff. The first Ctrl-C drains the active delivery without publishing it; a second Ctrl-C forces shutdown of both delivery processes and HTTP connections, including incomplete requests. Shutdown preserves the last verified artifact and removes only staging files whose ownership can be verified. If delivery is interrupted before its receipt reaches Preview, unconfirmed files and recovery material may remain in the private staging directory; shutdown does not recursively delete unknown contents. Server state, port, source path, diagnostics, error text, and reload tokens must never enter the generated artifact or any export.
84
601
 
85
- ## Perceptual delivery gate
602
+ ## Perceptual review
86
603
 
87
- Automated validation and browser evidence cannot prove visual polish. After deterministic delivery, inspect the actual HTML in a capable browser or render the evidence screenshots with an image reader. Check both themes when changed, the default READ view, line crossings/corridors, label masks, node/card fit, focus/search/passport closure, and export cleanliness.
604
+ The automated path ends with the deterministic browser gate and reports
605
+ `visual_review: not_requested`. Ordinary generation does not require screenshots
606
+ or an image-reading step, including newly authored or repositioned Architecture.
607
+ Perceptual review is optional; use it for an explicit request or a concrete visual
608
+ investigation. Possible reasons include:
88
609
 
89
- For the default standalone desktop viewer, measure 1440×900, 1600×1000, and 1920×1080. When the artifact is intended for a large desktop display, also measure 2048×1320. A first-screen pass requires `document.documentElement.scrollWidth <= window.innerWidth` and `scrollHeight <= window.innerHeight` at every checked size. At the largest checked viewport, inspect the rendered composition for a conspicuous empty lower band: the main panel and necessary conclusion cards should use the available height as a balanced whole, not collapse into a shallow strip. If a desktop viewport overflows, repair the authored composition by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. Do not hide overflow, clip content, introduce an internal diagram scroller, or reduce node/label typography to make the measurement pass. Narrow/mobile containment may retain vertical page scrolling.
610
+ - the compact finalizer includes `visualReviewRecommendation` for crossings or detours (advisory, not a delivery gate);
611
+ - the user explicitly requests an aesthetic or visual review;
612
+ - a template, renderer, or Viewer change needs visual regression evidence;
613
+ - a novel layout or browser diagnostic leaves low confidence;
614
+ - the run is selected for sampled audit or dogfood.
90
615
 
91
- A manual browser record is supplementary to the automated status. Reproducing the same coverage requires all four exact viewport measurements, both endpoint themes, and an artifact-bound record of the inspected SHA-256 and byte count. It never changes `browser_evidence`: when Chrome/Chromium is unavailable, that status remains `skipped` even when the manual browser record is complete and `visual_review: passed`; an automated `failed` result likewise remains `failed`. An unconstrained browser glance can support perceptual review only.
616
+ For the default standalone desktop viewer, measure 1440×900, 1600×1000, 1920×1080, and 2048×1320. Require `document.documentElement.scrollWidth <= window.innerWidth` at every checked size. Prefer `scrollHeight <= window.innerHeight`; accept page-level vertical scrolling only through the Reader-declared readable exception defined above. At the largest checked viewport, inspect the rendered composition for a conspicuous empty lower band: the main panel and necessary conclusion cards should use the available height as a balanced whole, not collapse into a shallow strip. For unexpected overflow, repair the authored composition by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. Do not hide overflow, clip content, introduce an internal diagram scroller, or reduce node/label typography to make the measurement pass. Narrow/mobile containment may retain vertical page scrolling.
92
617
 
93
- Report exactly one truthful status:
618
+ For an escalation, run `visual-check` on the current finalized artifact, inspect
619
+ its contact sheet with a capable image reader or human, and check both endpoint
620
+ themes, the default READ view, line crossings/corridors, label masks, node/card
621
+ fit, focus/search/passport closure, and export cleanliness. This review is
622
+ supplementary and never changes `browser_evidence`. An unconstrained browser
623
+ glance can support perceptual review only.
94
624
 
95
- - `visual_review: passed` - only after inspecting the rendered artifact.
96
- - `visual_review: skipped (image reader unavailable)` - when no capable visual surface exists.
97
- - `visual_review: failed` - with the concrete visible defect.
625
+ In a diagnostic or structured handoff, report one truthful optional-review
626
+ status:
98
627
 
99
- Use `correction_rounds: 0`, `correction_rounds: 1`, or `correction_rounds: 2`; never exceed a maximum of two focused correction rounds. Never report `visual_review: passed` without inspecting the artifact.
628
+ - `visual_review: not_requested` — no review trigger applies; this is not a visual acceptance claim.
629
+ - `visual_review: passed` — only after inspecting the rendered artifact.
630
+ - `visual_review: skipped (image reader unavailable)` — a requested or triggered review could not run.
631
+ - `visual_review: failed` — with the concrete visible defect.
100
632
 
101
- If visual review changes the candidate, validation and delivery must run again because the prior frozen specification receipt is no longer current.
633
+ For an escalated review, use `correction_rounds: 0`, `correction_rounds: 1`, or
634
+ `correction_rounds: 2`; never exceed two focused correction rounds. When review
635
+ is not requested, use `correction_rounds: 0`. Never report
636
+ `visual_review: passed` without inspecting the artifact. If perceptual review
637
+ changes the candidate, rerun `finalize` because the previous specification and
638
+ artifact receipts are no longer current.
102
639
 
103
640
  ## Handoff receipt
104
641
 
105
- Return:
642
+ For a requested diagnostic or structured handoff, derive the following details
643
+ from the existing receipts. Ordinary user-facing replies follow
644
+ [Output](../SKILL.md#output); this checklist is not a default chat response.
106
645
 
107
646
  ```text
108
- diagram_type: architecture|workflow|sequence|dataflow|lifecycle
647
+ diagram_type: <actual diagram type>
109
648
  output: /absolute/path/to/file.html
110
649
  specification_sha256: <receipt value>
111
650
  artifact_sha256: <receipt value>
112
- validation: 9/9 showcase, 0 errors, 0 warnings
651
+ validation: <actual quality profile, check counts, errors, and warnings>
113
652
  browser_evidence: passed|failed|skipped
114
- visual_review: passed|skipped (image reader unavailable)|failed
653
+ visual_review: not_requested|passed|skipped (image reader unavailable)|failed
115
654
  correction_rounds: 0|1|2
116
655
  ```
117
656
 
118
- Derive `browser_evidence` only from the latest artifact-bound `visual-check` receipt. Record any manual browser work separately with its artifact binding, viewport/theme scope, and observations; never use it or `visual_review` to overwrite the automated status.
657
+ Derive `browser_evidence` only from the latest artifact-bound `browser-check`
658
+ receipt, normally the stage embedded by `finalize`. Record optional capture or
659
+ manual browser work separately with its artifact binding, viewport/theme scope,
660
+ and observations; never use it or `visual_review` to overwrite the automated
661
+ status.
119
662
 
120
663
  Opening, preview status, Share Cards, and other viewer exports are not validation claims.
664
+
665
+ Finalize receipt publication uses the same identity-bound, no-clobber publisher and explicit recovery records described above. The full and summary receipts must be distinct from the candidate, artifact, delivery metadata, and browser receipt. Their targets must be absent or single-link regular files; symlink receipt entries and hardlinked targets fail closed. A later claimant or changed parent stops publication and remains untouched. Default receipt names share the physical artifact namespace and are bounded for the host filename limit. The two receipts are published individually, not as a crash-atomic pair; only a completed passing command is a successful handoff.