checkwright 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/README.md +1013 -50
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +40 -0
  4. package/lib/common/profile.sh +33 -0
  5. package/lib/common/recipe.sh +56 -43
  6. package/lib/diff.sh +64 -0
  7. package/lib/doctor.sh +81 -7
  8. package/lib/init.sh +167 -52
  9. package/lib/uninstall.sh +212 -0
  10. package/lib/update.sh +34 -0
  11. package/package.json +2 -2
  12. package/payload/artifact/targets.list +30 -0
  13. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  14. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  15. package/payload/canon-kit/README.md +2 -0
  16. package/payload/canon-kit/SPEC.md +666 -59
  17. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
  18. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  19. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  20. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  21. package/payload/canon-kit/checks/check-docs-link-convention.sh +12 -4
  22. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  23. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  24. package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
  25. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  26. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  27. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  28. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  29. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  30. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  31. package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
  32. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  33. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
  35. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  36. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  37. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  38. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  39. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  51. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  63. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  64. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  68. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  69. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  70. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  71. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  72. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +32 -8
  73. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  74. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  75. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  76. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  77. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  78. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  79. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  80. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  81. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  82. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  83. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  84. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  85. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  86. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  87. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  88. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  89. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  90. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  91. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  92. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  93. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
  94. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  95. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  96. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  97. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  98. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
  99. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  100. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  101. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  102. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  103. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  104. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  105. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  106. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  107. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  108. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  109. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  110. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  111. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  112. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  113. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  114. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  115. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  116. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  117. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  118. package/payload/canon-kit/lib/spec.sh +109 -70
  119. package/payload/canon-kit/smoke/install.sh +21 -1
  120. package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
  121. package/payload/context-kit/README.md +4 -1
  122. package/payload/context-kit/SPEC.md +166 -9
  123. package/payload/context-kit/bin/env-probe.sh +19 -6
  124. package/payload/context-kit/checks/check-brevity.sh +1 -0
  125. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  126. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  127. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  128. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  129. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  130. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  131. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  132. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  133. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  134. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  135. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  136. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  137. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  138. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  139. package/payload/context-kit/lib/toolfloor.sh +15 -4
  140. package/payload/context-kit/smoke/agents-md.sh +12 -1
  141. package/payload/context-kit/smoke/install.sh +4 -1
  142. package/payload/delegation-kit/README.md +3 -3
  143. package/payload/delegation-kit/SPEC.md +499 -26
  144. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  145. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  146. package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
  147. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  148. package/payload/delegation-kit/lib/delegation.sh +1 -0
  149. package/payload/delegation-kit/smoke/install.sh +2 -1
  150. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  151. package/payload/delegation-kit/templates/agent-execution.md +127 -12
  152. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  153. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  154. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  155. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  156. package/payload/doctrine-kit/DOCTRINE.md +112 -11
  157. package/payload/doctrine-kit/README.md +12 -3
  158. package/payload/doctrine-kit/SPEC.md +163 -11
  159. package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
  160. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  161. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  162. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  163. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  164. package/payload/doctrine-kit/smoke/install.sh +167 -1
  165. package/payload/drift-kit/README.md +3 -2
  166. package/payload/drift-kit/SPEC.md +264 -22
  167. package/payload/drift-kit/bin/kfric.sh +21 -2
  168. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  169. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  170. package/payload/drift-kit/smoke/install.sh +183 -1
  171. package/payload/drift-kit/templates/economics.md +9 -0
  172. package/payload/drift-kit/templates/kpis.list +6 -1
  173. package/payload/evidence-kit/README.md +20 -6
  174. package/payload/evidence-kit/SPEC.md +355 -17
  175. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  176. package/payload/evidence-kit/checks/check-battery-roster.sh +87 -0
  177. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  178. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  179. package/payload/evidence-kit/checks/check-producer-liveness.sh +35 -0
  180. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  181. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  186. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  187. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  188. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  189. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  190. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  191. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  192. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  193. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  194. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  195. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  196. package/payload/evidence-kit/lib/evidence.sh +18 -0
  197. package/payload/evidence-kit/smoke/install.sh +17 -3
  198. package/payload/gate-sdk/README.md +17 -1
  199. package/payload/gate-sdk/SPEC.md +4427 -92
  200. package/payload/gate-sdk/bin/build-native.sh +38 -0
  201. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  202. package/payload/gate-sdk/bin/gen-pre-commit.sh +32 -2
  203. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  204. package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
  205. package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
  206. package/payload/gate-sdk/bin/run-gates.sh +37 -2
  207. package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
  208. package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
  209. package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
  210. package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
  211. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  212. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  213. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  214. package/payload/gate-sdk/checks/check-core-files.sh +28 -4
  215. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  216. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  217. package/payload/gate-sdk/checks/check-exec-bit.sh +21 -1
  218. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  219. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
  220. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
  221. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  222. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  223. package/payload/gate-sdk/checks/check-gate-output.sh +41 -3
  224. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
  225. package/payload/gate-sdk/checks/check-graph.sh +5 -5
  226. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  227. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  228. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  229. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  230. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  231. package/payload/gate-sdk/checks/check-readme-roster.sh +6 -0
  232. package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
  233. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  234. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  235. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  236. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  237. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  238. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  239. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  240. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  241. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  242. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  243. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  244. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  245. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  246. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  247. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  248. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  249. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  250. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  251. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  252. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  253. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  254. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  255. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  256. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  257. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  258. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  259. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  260. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  261. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  262. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  263. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  264. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  265. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  266. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  267. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  268. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  269. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  270. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  271. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  272. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  273. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  274. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  275. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  276. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  277. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  278. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  279. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  280. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  281. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  282. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  283. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  284. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  285. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  286. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  287. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  288. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  289. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  290. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  291. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  292. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  293. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  294. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  295. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  296. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  297. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  298. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  299. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  300. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  301. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  302. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  303. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  304. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  305. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  306. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  307. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  308. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  309. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  310. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  311. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  312. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
  313. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  314. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  315. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  316. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  317. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  318. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  319. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  320. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  321. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  322. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  323. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  324. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  325. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  326. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  327. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  328. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  329. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  330. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  331. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  332. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  333. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  334. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  335. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  336. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  337. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  338. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  339. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  340. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  341. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  342. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  343. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  344. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  345. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  346. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  347. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
  348. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  349. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  350. package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
  351. package/payload/gate-sdk/lib/gate.sh +208 -9
  352. package/payload/gate-sdk/lib/inject.sh +46 -1
  353. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  354. package/payload/gate-sdk/smoke/install.sh +61 -1
  355. package/payload/guard-kit/README.md +18 -14
  356. package/payload/guard-kit/SPEC.md +366 -72
  357. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  358. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  359. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  360. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  361. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  362. package/payload/guard-kit/lib/guard.sh +277 -54
  363. package/payload/guard-kit/templates/close-triage.md +38 -10
  364. package/payload/guard-kit/templates/guard-config.sh +3 -0
  365. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  366. package/payload/lifecycle-kit/README.md +12 -1
  367. package/payload/lifecycle-kit/SPEC.md +991 -41
  368. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  369. package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
  370. package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
  371. package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
  372. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  373. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  374. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  375. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  376. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  377. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  378. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  379. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  380. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  381. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  382. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  383. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  384. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  385. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  386. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  387. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  388. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  389. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  390. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  391. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  392. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  393. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  394. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  395. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -3
  396. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  397. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  398. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  399. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  400. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  401. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  402. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  403. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  404. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  405. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  406. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  407. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  408. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  409. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  410. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  411. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  412. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
  413. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
  414. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  415. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  416. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  417. package/payload/lifecycle-kit/lib/stages.sh +12 -2
  418. package/payload/lifecycle-kit/smoke/install.sh +83 -4
  419. package/payload/lifecycle-kit/templates/consult.md +73 -0
  420. package/payload/lifecycle-kit/templates/lead.md +139 -7
  421. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  422. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  423. package/payload/lifecycle-kit/templates/stages/close.md +45 -5
  424. package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
  425. package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
  426. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  427. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  428. package/payload/queue-kit/README.md +6 -1
  429. package/payload/queue-kit/SPEC.md +350 -6
  430. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  431. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  432. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  433. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  434. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  435. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  436. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  437. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  438. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  439. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  440. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  441. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  442. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  443. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  444. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  445. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  446. package/payload/queue-kit/lib/queue.sh +4 -19
  447. package/payload/queue-kit/smoke/install.sh +4 -1
  448. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  449. package/payload/site-kit/SPEC.md +64 -27
  450. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  451. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  452. package/payload/site-kit/smoke/install.sh +9 -1
  453. package/profiles.list +36 -8
  454. package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
  455. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  456. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  457. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  458. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  459. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  460. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  461. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  462. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  463. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  464. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  465. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  466. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -180
  467. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  468. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  469. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  470. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
  471. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  472. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  473. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  474. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  475. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  476. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  477. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  478. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  479. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  480. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  481. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  482. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -104
  483. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  484. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  485. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  486. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  487. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  488. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  489. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -0,0 +1,18 @@
1
+ # shellcheck shell=bash
2
+ # spec: installer/README.md §The gate binary — sourceable owner of the artifact digest mechanism: which hasher this host has and how a SHA-256 is taken with it. Deliberately not lock.sh's, because the two hashes answer different questions — the manifest's git hash-object is change detection over files init wrote, this one is an integrity claim against a value published outside the payload
3
+
4
+ # spec: installer/README.md §The gate binary — sha256sum first, then shasum -a 256, because stock macOS ships the second and not the first; an absent hasher is not a refusal, it is what selects the digest-unverifiable omission
5
+ digest_hasher() { # -> the resolved hasher's name, empty when neither is on PATH
6
+ if command -v sha256sum >/dev/null 2>&1; then
7
+ printf 'sha256sum'
8
+ elif command -v shasum >/dev/null 2>&1; then
9
+ printf 'shasum'
10
+ fi
11
+ }
12
+
13
+ digest_of() { # $1 = file -> its SHA-256 in hex, empty when no hasher resolved
14
+ case "$(digest_hasher)" in
15
+ sha256sum) sha256sum -- "$1" 2>/dev/null | cut -d' ' -f1 ;;
16
+ shasum) shasum -a 256 -- "$1" 2>/dev/null | cut -d' ' -f1 ;;
17
+ esac
18
+ }
@@ -22,7 +22,47 @@ lock_field() { # $1 = manifest path, $2 = field name -> its value, arrays spac
22
22
  ' "$1" 2>/dev/null
23
23
  }
24
24
 
25
+ # spec: installer/README.md §The manifest — the fields whose wire type is an array rather than a string, which is knowledge only the schema owner has: lock_emit space-splits exactly these, the inverse of lock_field's space-join on read, so one file holds both halves of the shell<->wire representation and a caller needs no second grammar to pass one
26
+ CHECKWRIGHT_LOCK_ARRAY_FIELDS="kits"
27
+
28
+ # spec: installer/README.md §The manifest — the single writer of the wire shape, so a second writing verb cannot drift from the first: keys are sorted at every nesting level, and an identity field or the artifact key is present exactly when the caller supplied it — never a null or an empty placeholder standing in for an omission. `jq -S` is the implementation that satisfies the sort property, not the definition of it
29
+ lock_emit() { # $@ = key=value identity fields and an optional '--artifact <target> <digest>'; '<path><TAB><hash>' lines on stdin -> the manifest object
30
+ local target="" digest="" with_artifact=0
31
+ local -a idents=()
32
+ while [[ $# -gt 0 ]]; do
33
+ case "$1" in
34
+ --artifact)
35
+ [[ $# -ge 3 ]] || { echo "lock_emit: --artifact takes a target and a digest" >&2; return 2; }
36
+ target="$2"; digest="$3"; with_artifact=1; shift 3 ;;
37
+ *=*) idents+=("$1"); shift ;;
38
+ *) echo "lock_emit: not a key=value field: $1" >&2; return 2 ;;
39
+ esac
40
+ done
41
+ jq -R -s -S \
42
+ --arg schema "$CHECKWRIGHT_LOCK_SCHEMA" \
43
+ --arg arrays "$CHECKWRIGHT_LOCK_ARRAY_FIELDS" \
44
+ --arg target "$target" \
45
+ --arg digest "$digest" \
46
+ --argjson with_artifact "$with_artifact" '
47
+ ($arrays | split(" ")) as $arr
48
+ | ( split("\n") | map(select(length > 0))
49
+ | map(split("\t") | {(.[0]): (.[1] // "")}) | add // {} ) as $files
50
+ | ( $ARGS.positional
51
+ | map( (index("=")) as $i
52
+ | { key: .[:$i], value: .[$i + 1:] }
53
+ | if (.key | IN($arr[])) then .value |= (split(" ") | map(select(length > 0))) else . end )
54
+ | from_entries ) as $ident
55
+ | { schema: $schema } + $ident + { files: $files }
56
+ + ( if $with_artifact == 1 then { artifact: { target: $target, digest: $digest } } else {} end )
57
+ ' --args ${idents[@]+"${idents[@]}"}
58
+ }
59
+
25
60
  # spec: installer/README.md §The manifest — git's object hash, never sha256sum: macOS ships shasum instead, and git is already a floor-contract member, so the manifest's integrity story stays inside the toolchain the contract asserts
26
61
  lock_hash() { # $1 = file -> the content hash a files[] entry records
27
62
  git hash-object -- "$1"
28
63
  }
64
+
65
+ # spec: installer/README.md §The manifest — resolve one of the consumer's *own* seam files out of files[] by asking whether the manifest records that exact path, which is what files[] already holds: the repo-relative path init wrote. The question a caller has is "is this path one init owns", and an exact key lookup answers it outright. A tail match cannot: the vendored kits carry fixture trees with their own scripts/gates.list, so a suffix picks whichever sorts first, and no predicate over the *recorded kit set* repairs it — files[] outlives kits by design, so a narrowed re-run leaves the dropped kits' fixture paths on the roster and unexcluded, and a residual manifest carries no kits at all
66
+ lock_own_file() { # $1 = manifest path, $2 = the repo-relative path init writes -> that path when the manifest records it, empty when it does not
67
+ jq -r --arg p "$2" '(.files // {}) | if has($p) then $p else "" end' "$1" 2>/dev/null
68
+ }
@@ -1,6 +1,10 @@
1
1
  # shellcheck shell=bash
2
2
  # spec: installer/README.md §Profiles — sourceable owner of the profile rosters: it parses profiles.list, derives `full` from the payload rather than reading a row, and is the one place a profile name resolves to a kit set
3
3
 
4
+ # spec: installer/README.md §Profiles — the per-profile gate set is a union over per-kit recipes, so this module reaches the one that owns them rather than leaving the dependency to whichever verb happens to source both: a caller holding only this module would otherwise get an empty union where it should get an error
5
+ # shellcheck source=./recipe.sh
6
+ source "$(dirname "${BASH_SOURCE[0]}")/recipe.sh"
7
+
4
8
  # spec: installer/README.md §Profiles — the derived profile is never a row in profiles.list; a hand-maintained "all the kits" roster is drift the day a kit lands
5
9
  PROFILE_DERIVED=full
6
10
 
@@ -56,3 +60,32 @@ profile_known() { # $1 = installer root, $2 = profile -> 0 iff it is selectabl
56
60
  while IFS= read -r n; do [[ "$n" == "$2" ]] && return 0; done < <(profile_names "$1")
57
61
  return 1
58
62
  }
63
+
64
+ # spec: installer/README.md §Profiles — the order is derived from set inclusion over the kit rosters and never declared beside them: a declared parent and the kit sets could disagree, and then two surfaces would assert the containment again. The profiles form a lattice rather than a chain, so a pair comparing in neither direction is legitimate and simply absent from this output
65
+ profile_order() { # $1 = installer root -> one '<a><TAB><b>' line per ordered pair of distinct profiles whose kit set is contained in the other's
66
+ local root="$1" a b sub sup k ok
67
+ local -a names
68
+ mapfile -t names < <(profile_names "$root")
69
+ for a in "${names[@]}"; do
70
+ sub="$(profile_kits "$root" "$a")"
71
+ for b in "${names[@]}"; do
72
+ [[ "$a" == "$b" ]] && continue
73
+ sup="$(profile_kits "$root" "$b")"
74
+ ok=1
75
+ while IFS= read -r k; do
76
+ [[ -n "$k" ]] || continue
77
+ grep -qxF "$k" <<<"$sup" || { ok=0; break; }
78
+ done <<<"$sub"
79
+ (( ok )) && printf '%s\t%s\n' "$a" "$b"
80
+ done
81
+ done
82
+ }
83
+
84
+ # spec: installer/README.md §Profiles — what an adopter meets is the battery, not the directory list, so the profile's gate set is a derivation in its own right: one function answers it for the registry init writes and for the smoke's monotonicity assertion, rather than each unioning the per-kit recipes itself and the two drifting apart the day an arm varies by profile
85
+ profile_gates() { # $1 = installer root, $2 = profile -> the sorted, de-duplicated union of the gates its kits register in a fresh consumer
86
+ local root="$1" profile="$2" kit
87
+ while IFS= read -r kit; do
88
+ [[ -n "$kit" ]] || continue
89
+ recipe_gates "$root/payload/$kit" "$profile"
90
+ done < <(profile_kits "$root" "$profile") | LC_ALL=C sort -u
91
+ }
@@ -1,70 +1,82 @@
1
1
  # shellcheck shell=bash
2
- # spec: installer/README.md §What init seeds — sourceable owner of the per-kit install recipe: the starting gate roster a kit registers in a fresh consumer, and the seam surfaces it needs before those gates can run. Every function here prints one repo-relative path per file it wrote, which is what the manifest's files[] is built from
2
+ # spec: installer/README.md §What init seeds — sourceable owner of the per-kit install recipe: the starting gate roster a kit registers in a fresh consumer, and the seam surfaces it needs before those gates can run. Two output channels, and the difference is who writes the file: a bare repo-relative path is one this module seeded itself and init need only claim for the roster, while a '<src>\t<dest>' pair is a plan init performs through copy_in. Both feed the manifest's files[]
3
3
 
4
- # spec: installer/README.md §What init seeds — the config seam is derived, never listed: a kit's consumer config is whatever `templates/*-config.sh` it ships, and the destination is always the gates dir under the file's own name
5
- recipe_config_seam() { # $1 = kit payload dir, $2 = consumer root, $3 = gates dir
6
- local t base dest
4
+ # shellcheck disable=SC2034 # QUEUE_FILE is read by this module's callers, not by the module
5
+ # spec: installer/README.md §What init seeds — the consumer-layout names init writes against; they are gate-sdk's and canon-kit's own defaults, so a tree init made is the zero-config tree those kits expect. They live here rather than in one verb because uninstall must trim the doctrine span out of the same agent file init wrote it into: doctrine-kit's own DOCTRINE_KIT_AGENT_FILE knob cannot answer that, since an adopter override would not change the path init actually used, so the name needs one writer both verbs read
6
+ GATES_DIR="scripts"
7
+ AGENT_FILE="CLAUDE.md"
8
+ QUEUE_FILE="TASK-QUEUE.md"
9
+
10
+ # spec: installer/README.md §What init seeds — the config seam is derived, never listed: a kit's consumer config is whatever `templates/*-config.sh` it ships, and the destination is always the gates dir under the file's own name. It plans and writes nothing, because the seam is rewritten on every run and is the file class whose whole purpose is to be edited: a copy landing before claim() hashes the tree destroys the very evidence the refusal is computed from, so the write belongs to copy_in
11
+ recipe_config_seam_plan() { # $1 = kit payload dir, $2 = gates dir -> one '<src><TAB><dest>' line per config template
12
+ local t base
7
13
  shopt -s nullglob
8
14
  for t in "$1"/templates/*-config.sh; do
9
15
  base="${t##*/}"
10
- dest="$3/$base"
11
- cp "$t" "$2/$dest" || return 1
12
- printf '%s\n' "$dest"
16
+ printf '%s\t%s/%s\n' "$t" "$2" "$base"
13
17
  done
14
18
  shopt -u nullglob
15
19
  }
16
20
 
21
+ # spec: gate-sdk/SPEC.md §The install disposition — the gate is the one place that knows whether it can run on a tree init just made, so this reads the declaration off each shipped gate instead of carrying a second copy of it. A kit that adds a zero-config gate is picked up with no edit here, which is the exposure this replaces: a roster maintained here could never learn about it
22
+ recipe_install_disposition() { # $1 = gate file -> the disposition its header declares, empty when it declares none
23
+ awk 'sub(/^# install:[[:space:]]+/, "") { print $1; exit }' "$1"
24
+ }
25
+
17
26
  # spec: installer/README.md §What init seeds — the starting roster is the subset a fresh consumer begins with, not the kit's full roster: a gate whose subject the adopter has not authored yet (a glossary, a skills directory, a docs host) would exit 2 on their tree, so it is registered when that surface exists rather than at install
18
- recipe_gates() { # $1 = kit name -> the gates it registers in a fresh consumer, none for a kit that ships no zero-config gate
19
- case "$1" in
20
- gate-sdk)
21
- printf '%s\n' check-shellcheck check-gate-output check-gate-fail-closed \
22
- check-gate-fixture-coverage check-gate-exemption-tasks \
23
- check-gate-assertions check-graph check-commit-msg check-tree-terms ;;
24
- canon-kit)
25
- printf '%s\n' check-amendment-queue check-spec-dod-singleton \
26
- check-spec-derivable-section check-spec-embedded-source ;;
27
- context-kit) printf '%s\n' check-brevity ;;
28
- delegation-kit) printf '%s\n' check-gate-tamper ;;
29
- doctrine-kit) printf '%s\n' check-doctrine-registration ;;
30
- evidence-kit) printf '%s\n' check-evidence-baseline check-evidence-manifest ;;
31
- # spec: installer/README.md §What init seeds — lifecycle-kit registers nothing at install: its gates read an attestation only a stage session can write, so they arm at the adopter's first stamp
32
- lifecycle-kit) : ;;
33
- queue-kit)
34
- printf '%s\n' check-queue-hygiene check-queue-wrap check-tag-lead-line \
35
- check-task-names check-task-conservation check-queue-prose-precondition ;;
36
- *) : ;;
37
- esac
27
+ # spec: installer/README.md §Profiles — the roster is keyed by profile as well as by kit, so a roster that varies by profile becomes a change to one arm rather than a change to this signature and to every caller reading it. No disposition varies on it today; the parameter is the seam, and its reader is profile_gates
28
+ # spec: gate-sdk/SPEC.md §Consumer payload — both declaration spellings are scanned, because a ported gate is still a gate a kit ships and its descriptor rides the payload on the same terms as a shell implementation
29
+ recipe_gates() { # $1 = kit payload dir, $2 = profile -> the gates it registers in a fresh consumer, none for a kit that ships no zero-config gate
30
+ local pay="$1" f name
31
+ [[ -d "$pay/checks" ]] || return 0
32
+ shopt -s nullglob
33
+ for f in "$pay"/checks/check-*.sh "$pay"/checks/check-*.gate; do
34
+ name="${f##*/}"
35
+ [[ "$(recipe_install_disposition "$f")" == zero-config ]] && printf '%s\n' "${name%.*}"
36
+ done | LC_ALL=C sort -u
37
+ shopt -u nullglob
38
38
  }
39
39
 
40
40
  recipe_needs_queue() { # $1 = kit name -> 0 iff one of its starting gates reads the queue file
41
41
  case "$1" in canon-kit|lifecycle-kit|queue-kit) return 0 ;; *) return 1 ;; esac
42
42
  }
43
43
 
44
+ # spec: installer/README.md §What init seeds — the queue source is resolved once over the profile's whole kit set, never inside a per-kit call that cannot see the other kits: a kit declares itself the queue format's owner by shipping templates/TASK-QUEUE.md, so the selection reads that fact off the payload and needs no second surface to state it
45
+ recipe_queue_source() { # $1 = payload root, $2.. = the profile's resolved kit set -> the template to seed from, '-' for the inline fallback, nothing when no kit in the set reads the queue file
46
+ local pay="$1" kit tpl="" needs=1
47
+ shift
48
+ for kit in "$@"; do
49
+ recipe_needs_queue "$kit" && needs=0
50
+ [[ -z "$tpl" && -f "$pay/$kit/templates/TASK-QUEUE.md" ]] && tpl="$pay/$kit/templates/TASK-QUEUE.md"
51
+ done
52
+ (( needs )) && return 0
53
+ printf '%s\n' "${tpl:--}"
54
+ }
55
+
56
+ # spec: installer/README.md §What init seeds — the fallback carries every QUEUE_KIT_REQUIRED_SECTIONS heading at that knob's default because it is a path a shipping profile takes rather than defensive symmetry: the section floor is not registered at install, so a skeleton missing a heading would pass open here and red on the adopter's own file the day they register it
57
+ recipe_write_queue() { # $1 = the source recipe_queue_source resolved, $2 = consumer root, $3 = queue file
58
+ if [[ "$1" != - ]]; then
59
+ cp "$1" "$2/$3"
60
+ return
61
+ fi
62
+ printf '%s\n' "# $3" "" "## Iteration: —" "" "---" "" \
63
+ "## New Features" "" "## Technical Debt" "" "## Deferred" "" "## Done" "" "## Lessons Learned" \
64
+ > "$2/$3"
65
+ }
66
+
67
+ # spec: installer/README.md §What init seeds — this asks whether the agent file must *exist* for a kit's starting gates, which is a narrower question than which kit writes into it: a kit answering yes here and shipping no seed arm is the ordinary case, and reading this membership as the seeding roster is the conflation the section's rule exists to settle
44
68
  recipe_needs_agent_file() { # $1 = kit name -> 0 iff one of its starting gates reads the always-loaded agent file
45
69
  case "$1" in context-kit|doctrine-kit) return 0 ;; *) return 1 ;; esac
46
70
  }
47
71
 
48
- # spec: installer/README.md §What init seeds — a seam surface is written only when it is absent: init owns what it created, never what the adopter authored, which is what keeps a re-run non-destructive on a tree that has grown since
49
- recipe_seed() { # $1 = kit name, $2 = kit payload dir, $3 = consumer root, $4 = queue file
50
- local kit="$1" pay="$2" root="$3" queue="$4"
51
-
52
- if recipe_needs_queue "$kit" && [[ ! -f "$root/$queue" ]]; then
53
- if [[ -f "$pay/templates/TASK-QUEUE.md" ]]; then
54
- cp "$pay/templates/TASK-QUEUE.md" "$root/$queue" || return 1
55
- else
56
- printf '%s\n' "# $queue" "" "## Iteration: —" "" "---" "" \
57
- "## New Features" "" "## Technical Debt" "" "## Deferred" "" "## Done" \
58
- > "$root/$queue" || return 1
59
- fi
60
- printf '%s\n' "$queue"
61
- fi
72
+ # spec: installer/README.md §What init seeds — seed what is absent, plan what must be claimed. A surface init creates once and then leaves alone is written here only when it is absent, which is what keeps a re-run non-destructive on a tree that has grown since; a surface init rewrites on every run is never written here at all but planned for copy_in, because only claim() can compare the adopter's content before the overwrite lands. The two disciplines are not interchangeable and each arm below takes the one its surface needs
73
+ recipe_seed() { # $1 = kit name, $2 = kit payload dir, $3 = consumer root; prints seeded paths and '<src><TAB><dest>' plans
74
+ local kit="$1" pay="$2" root="$3"
62
75
 
63
76
  case "$kit" in
64
77
  gate-sdk)
65
78
  [[ -f "$pay/templates/msg-patterns.list" ]] || return 0
66
- cp "$pay/templates/msg-patterns.list" "$root/$GATES_DIR/msg-patterns.list" || return 1
67
- printf '%s\n' "$GATES_DIR/msg-patterns.list" ;;
79
+ printf '%s\t%s/msg-patterns.list\n' "$pay/templates/msg-patterns.list" "$GATES_DIR" ;;
68
80
  evidence-kit)
69
81
  mkdir -p "$root/.workflow" || return 1
70
82
  if [[ ! -f "$root/.workflow/validate-baseline.txt" ]]; then
@@ -85,6 +97,7 @@ recipe_seed() { # $1 = kit name, $2 = kit payload dir, $3 = consumer root, $4
85
97
  "" "---" "" > "$root/.workflow/WORKFLOW-STATE.txt" || return 1
86
98
  printf '%s\n' ".workflow/WORKFLOW-STATE.txt" ;;
87
99
  doctrine-kit)
100
+ # spec: installer/README.md §What init seeds — this kit has an arm because a gate init registers reads the block it writes; that is the whole test, and it is why no lifecycle-kit arm sits beside this one
88
101
  # spec: doctrine-kit/SPEC.md §install-doctrine — the reference block is the kit's own installer's to write, so init calls it rather than restating the block it emits
89
102
  ( cd "$root" && bash "$pay/bin/install-doctrine.sh" "$AGENT_FILE" "doctrine-kit/DOCTRINE.md" ) >/dev/null || return 1
90
103
  printf '%s\n' "$AGENT_FILE" ;;
package/lib/diff.sh ADDED
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env bash
2
+ # spec: installer/README.md §diff — classifies every files[] entry against the tree using lock_hash, the same comparison claim() makes: unchanged is counted only, changed and missing are each named apart because a deletion and an edit have different remedies. Exit status is the verdict: 0 every recorded entry matches, 1 at least one is changed or missing
3
+ #
4
+ # usage: checkwright diff
5
+ # No --dry-run: diff writes nothing, so it has no mutating form to guard.
6
+ set -uo pipefail
7
+
8
+ INSTALLER="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
+ # shellcheck source=./common/lock.sh
10
+ source "$INSTALLER/lib/common/lock.sh"
11
+
12
+ case "${1:-}" in
13
+ '') ;;
14
+ -h|--help)
15
+ printf 'usage: checkwright diff\n\n'
16
+ printf 'Compares the tree against what init recorded in %s, using the same\n' "$CHECKWRIGHT_LOCK_FILE"
17
+ printf 'hash comparison claim() makes. Exit status is the verdict: 0 every\n'
18
+ printf 'recorded file matches, 1 at least one has changed or gone missing.\n'
19
+ exit 0 ;;
20
+ *) printf 'checkwright diff: unknown argument: %s\n' "$1" >&2; exit 2 ;;
21
+ esac
22
+
23
+ die() { printf 'checkwright diff: %s\n' "$1" >&2; [[ -n "${2:-}" ]] && printf ' help: %s\n' "$2" >&2; exit "${3:-2}"; }
24
+
25
+ # spec: installer/README.md §init — every precondition refuses rather than warns, and is checked before anything is compared: diff's subject is exactly the roster init recorded, so it needs the repository that roster is in
26
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
27
+ || die "not inside a git work tree" \
28
+ "diff compares the tree against the manifest init committed there, so it needs the repository that manifest is in."
29
+
30
+ LOCK="$(lock_path "$ROOT")"
31
+ [[ -f "$LOCK" ]] || die "no $CHECKWRIGHT_LOCK_FILE at $ROOT" \
32
+ "init is the verb that makes an install, and the manifest it writes is what diff compares against. Without one there is nothing here to compare."
33
+ lock_schema_ok "$LOCK" || die "$CHECKWRIGHT_LOCK_FILE carries a schema this build does not know" \
34
+ "this manifest was written by a different Checkwright release. Upgrade the installer rather than letting it guess at a shape it was not built for."
35
+
36
+ # spec: installer/README.md §diff — a recorded path already off the tree is reported apart from one whose content differs: init's roster exit rule means the next init would silently drop a missing path and rewrite it fresh, which is worth a warning before it happens rather than after
37
+ CHANGED=(); MISSING=(); SAME=0
38
+ while IFS=$'\t' read -r p h; do
39
+ [[ -n "$p" ]] || continue
40
+ if [[ ! -f "$ROOT/$p" ]]; then
41
+ MISSING+=("$p")
42
+ elif [[ "$(lock_hash "$ROOT/$p")" == "$h" ]]; then
43
+ SAME=$(( SAME + 1 ))
44
+ else
45
+ CHANGED+=("$p")
46
+ fi
47
+ done < <(jq -r 'if (.files | type) == "object" then (.files | to_entries[] | "\(.key)\t\(.value)") else empty end' "$LOCK")
48
+
49
+ printf 'checking %s against the tree\n' "$CHECKWRIGHT_LOCK_FILE"
50
+ if [[ ${#CHANGED[@]} -gt 0 ]]; then
51
+ printf '\nchanged (%d) — content differs from what init wrote:\n' "${#CHANGED[@]}"
52
+ printf ' %s\n' "${CHANGED[@]}"
53
+ fi
54
+ if [[ ${#MISSING[@]} -gt 0 ]]; then
55
+ printf '\nmissing (%d) — recorded by init but no longer on disk; the next init will silently drop these from the roster and rewrite them fresh:\n' "${#MISSING[@]}"
56
+ printf ' %s\n' "${MISSING[@]}"
57
+ fi
58
+
59
+ if [[ ${#CHANGED[@]} -eq 0 && ${#MISSING[@]} -eq 0 ]]; then
60
+ printf '\nDIFF: clean — %d file(s) match what init wrote.\n' "$SAME"
61
+ exit 0
62
+ fi
63
+ printf '\nDIFF: %d changed, %d missing, %d unchanged\n' "${#CHANGED[@]}" "${#MISSING[@]}" "$SAME"
64
+ exit 1
package/lib/doctor.sh CHANGED
@@ -12,8 +12,9 @@ case "${1:-}" in
12
12
  '') ;;
13
13
  -h|--help)
14
14
  printf 'usage: checkwright doctor\n\n'
15
- printf 'Reports whether this machine meets the toolchain contract, and — when run\n'
16
- printf 'inside a repository that has been vendored into — what is installed there.\n'
15
+ printf 'Reports whether this machine meets the toolchain contract it needs as a\n'
16
+ printf 'consumer, and — when run inside a repository that has been vendored\n'
17
+ printf 'into — what is installed there.\n'
17
18
  printf 'Exit status is the verdict: 0 meets the contract, 1 below it.\n'
18
19
  exit 0 ;;
19
20
  *) printf 'checkwright doctor: unknown argument: %s\n' "$1" >&2; exit 2 ;;
@@ -28,6 +29,11 @@ esac
28
29
  source "$FLOOR"
29
30
  # shellcheck source=./common/lock.sh
30
31
  source "$INSTALLER/lib/common/lock.sh"
32
+ # spec: installer/README.md §What init seeds — sourced for the consumer-layout names, so the seam files this verb resolves are the ones init wrote rather than a second spelling of the path
33
+ # shellcheck source=./common/recipe.sh
34
+ source "$INSTALLER/lib/common/recipe.sh"
35
+ # shellcheck source=./common/digest.sh
36
+ source "$INSTALLER/lib/common/digest.sh"
31
37
 
32
38
  # spec: context-kit/SPEC.md §bin/env-probe — both version probes read from /dev/null, and `-V` is only the fallback: a tool rejecting `--version` would otherwise reach a `-V` that reads inherited stdin and hangs
33
39
  probe_banner() { # $1 = tool -> its raw version banner, empty when the tool is absent
@@ -53,8 +59,11 @@ render() { # $1 = tool, $2 = verdict words -> one report line; sets FAILED whe
53
59
  }
54
60
 
55
61
  FAILED=0
62
+ ARTIFACT_FINDING=""
56
63
  printf 'toolchain\n'
57
64
  for elem in "${PROBE_SET[@]}"; do
65
+ # spec: installer/README.md §doctor — a contributor-audience member is skipped outright rather than rendered as informational: doctor is the adopter's verb, and showing an adopter a tool the install path never reaches is an invitation to install it
66
+ tool_floor_consumer_side "$elem" || continue
58
67
  tool_floor_parse "$elem"
59
68
  banner="$(probe_banner "$TOOL_FLOOR_NAME")"
60
69
  FOUND_VERSION="$(tool_floor_version "$banner")"
@@ -74,11 +83,70 @@ elif ! lock_schema_ok "$LOCK"; then
74
83
  printf ' help: this manifest was written by a different Checkwright release. Upgrade the installer rather than letting it guess at a shape it was not built for.\n' >&2
75
84
  exit 2
76
85
  else
77
- printf '\ninstalled\n'
78
- printf ' %-12s %s\n' version "$(lock_field "$LOCK" version)"
79
- printf ' %-12s %s\n' commit "$(lock_field "$LOCK" commit)"
80
- printf ' %-12s %s\n' profile "$(lock_field "$LOCK" profile)"
81
- printf ' %-12s %s\n' kits "$(lock_field "$LOCK" kits)"
86
+ version="$(lock_field "$LOCK" version)"
87
+ # spec: installer/README.md §doctor — a manifest carrying `files` and no `version` is a residue rather than an install: `version` is the field an install always has and a residue never does, so its absence is the discriminator. This guards the whole installed block rather than sitting beside it — the identity lines, the artifact check and the omitted-gates block are per-install readings with nothing to compute once there is no install, and printing them beside the residue message would be the same mixed-verdict shape doctor's own exit-status carve-out already refuses
88
+ if [[ -z "$version" ]]; then
89
+ n="$(jq -r '.files | length' "$LOCK" 2>/dev/null)"; [[ -n "$n" ]] || n=0
90
+ printf '\nno install here — %d file(s) remain that a previous install wrote and you have since edited. They are yours, and a future init will still protect them.\n' \
91
+ "$n"
92
+ else
93
+ printf '\ninstalled\n'
94
+ printf ' %-12s %s\n' version "$version"
95
+ printf ' %-12s %s\n' commit "$(lock_field "$LOCK" commit)"
96
+ printf ' %-12s %s\n' profile "$(lock_field "$LOCK" profile)"
97
+ printf ' %-12s %s\n' kits "$(lock_field "$LOCK" kits)"
98
+
99
+ # spec: installer/README.md §doctor — the registry this tree's battery runs from is named rather than left implicit: it is the one install fact an adopter cannot read off the identity fields, and a report that resolved the wrong file would otherwise say nothing at all about which one it inspected
100
+ list="$(lock_own_file "$LOCK" "$GATES_DIR/gates.list")"
101
+ if [[ -n "$list" ]]; then
102
+ printf ' %-12s %s%s\n' registry "$list" \
103
+ "$([[ -f "$ROOT/$list" ]] || printf ' — recorded, but not on disk; re-run init')"
104
+ else
105
+ printf ' %-12s none recorded — re-run init\n' registry
106
+ fi
107
+
108
+ # spec: installer/README.md §The gate binary — the recorded digest's second reader: re-verifying the binary in place is the only thing standing between a consumer and one swapped after install, and the path is resolved from the knob that owns it rather than from a copy the manifest would otherwise have to store
109
+ artifact_target="$(jq -r '.artifact.target // ""' "$LOCK" 2>/dev/null)"
110
+ artifact_digest="$(jq -r '.artifact.digest // ""' "$LOCK" 2>/dev/null)"
111
+ if [[ -n "$artifact_target" ]]; then
112
+ seam="$(lock_own_file "$LOCK" "$GATES_DIR/gate-sdk-config.sh")"
113
+ bin=""
114
+ [[ -n "$seam" && -f "$ROOT/$seam" ]] \
115
+ && bin="$(sed -n 's/^GATE_SDK_NATIVE_BIN=//p' "$ROOT/$seam" | head -n1)"
116
+ # spec: installer/README.md §doctor — an artifact finding reports without setting the verdict, and that is deliberate rather than lenient: the exit status is the toolchain contract init gates on, so failing it here would block the re-run that is this finding's own remedy
117
+ if [[ -z "$bin" || ! -f "$ROOT/$bin" ]]; then
118
+ printf ' %-12s %s — recorded, but nothing at the path GATE_SDK_NATIVE_BIN names; re-run init\n' \
119
+ artifact "$artifact_target"
120
+ ARTIFACT_FINDING="the recorded gate binary is not on disk"
121
+ elif [[ "$(digest_of "$ROOT/$bin")" == "$artifact_digest" ]]; then
122
+ printf ' %-12s %s (verified in place)\n' artifact "$artifact_target"
123
+ else
124
+ printf ' %-12s %s — DIGEST MISMATCH, %s differs from what init wrote; re-run init\n' \
125
+ artifact "$artifact_target" "$bin"
126
+ ARTIFACT_FINDING="the installed gate binary does not match its recorded digest"
127
+ fi
128
+ fi
129
+
130
+ # spec: installer/README.md §The gate binary — the omitted-member record's second reader, reported against the reason that caused it because a remedy is what an adopter comes here for
131
+ if [[ -n "$list" && -f "$ROOT/$list" ]]; then
132
+ while read -r count reason; do
133
+ [[ -n "$reason" ]] || continue
134
+ case "$reason" in
135
+ substrate-unavailable)
136
+ printf ' %-12s %d gate(s), %s — no prebuilt binary is published for this platform\n' \
137
+ omitted "$count" "$reason" ;;
138
+ digest-unverifiable)
139
+ printf ' %-12s %d gate(s), %s — install sha256sum or shasum, then re-run init\n' \
140
+ omitted "$count" "$reason" ;;
141
+ *)
142
+ printf ' %-12s %d gate(s), %s\n' omitted "$count" "$reason" ;;
143
+ esac
144
+ done < <(awk '$1 == "#" && $2 == "omitted:" { print $4 }' "$ROOT/$list" | sort | uniq -c)
145
+ fi
146
+ fi
147
+
148
+ # spec: installer/README.md §doctor — doctor's own report stops at the toolchain and identity fields; per-file divergence is a separate question with a separate verb, on both the install and the residue path, so DOCTOR: clean is never read as a claim about the tree's contents
149
+ printf '\nrun checkwright diff to see which files, if any, have changed since.\n'
82
150
  fi
83
151
 
84
152
  if (( FAILED )); then
@@ -86,5 +154,11 @@ if (( FAILED )); then
86
154
  printf ' help: install or upgrade each tool reported above; the floors are the ones the gate battery needs to run, not preferences.\n'
87
155
  exit 1
88
156
  fi
157
+ # spec: installer/README.md §doctor — the verdict line names an artifact finding rather than swallowing it: the exit status stays the toolchain contract, but a run that reported a digest mismatch must not sign off as plainly clean
158
+ if [[ -n "$ARTIFACT_FINDING" ]]; then
159
+ printf '\nDOCTOR: toolchain clean, 1 artifact finding — %s\n' "$ARTIFACT_FINDING"
160
+ printf ' help: re-run init; it re-verifies the published digest and rewrites the binary.\n'
161
+ exit 0
162
+ fi
89
163
  printf '\nDOCTOR: clean\n'
90
164
  exit 0