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
package/lib/init.sh CHANGED
@@ -13,11 +13,8 @@ source "$INSTALLER/lib/common/lock.sh"
13
13
  source "$INSTALLER/lib/common/profile.sh"
14
14
  # shellcheck source=./common/recipe.sh
15
15
  source "$INSTALLER/lib/common/recipe.sh"
16
-
17
- # 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
18
- GATES_DIR="scripts"
19
- AGENT_FILE="CLAUDE.md"
20
- QUEUE_FILE="TASK-QUEUE.md"
16
+ # shellcheck source=./common/digest.sh
17
+ source "$INSTALLER/lib/common/digest.sh"
21
18
 
22
19
  PROFILE=""; DRY=0; FORCE=0; DO_COMMIT=1
23
20
  while [[ $# -gt 0 ]]; do
@@ -61,6 +58,8 @@ COMMIT="$(jq -r '.checkwright.commit // ""' "$PKG" 2>/dev/null)"
61
58
 
62
59
  LOCK="$(lock_path "$ROOT")"
63
60
  PRIOR_FILES=""
61
+ PRIOR_ARTIFACT_TARGET=""
62
+ PRIOR_ARTIFACT_DIGEST=""
64
63
  if [[ -f "$LOCK" ]]; then
65
64
  lock_schema_ok "$LOCK" || die "$CHECKWRIGHT_LOCK_FILE carries a schema this build does not know" \
66
65
  "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."
@@ -75,6 +74,8 @@ if [[ -f "$LOCK" ]]; then
75
74
  fi
76
75
  [[ -n "$PROFILE" ]] || PROFILE="$(lock_field "$LOCK" profile)"
77
76
  PRIOR_FILES="$(jq -r 'if (.files | type) == "object" then (.files | to_entries[] | "\(.key)\t\(.value)") else empty end' "$LOCK" 2>/dev/null)"
77
+ PRIOR_ARTIFACT_TARGET="$(jq -r '.artifact.target // ""' "$LOCK" 2>/dev/null)"
78
+ PRIOR_ARTIFACT_DIGEST="$(jq -r '.artifact.digest // ""' "$LOCK" 2>/dev/null)"
78
79
  fi
79
80
 
80
81
  PROFILE="${PROFILE:-starter}"
@@ -94,6 +95,60 @@ while IFS= read -r k; do [[ -n "$k" ]] && KITS+=("$k"); done < <(profile_kits "$
94
95
  [[ ${#KITS[@]} -gt 0 ]] || die "profile '$PROFILE' resolves to no kit in this payload" \
95
96
  "every kit a profile names must exist in the package payload; this one names none that do."
96
97
 
98
+ # spec: installer/README.md §The gate binary — the host answers what platform this is, so the answer stays a local and is never persisted: a stored copy is stale the first time a vendored tree moves between machines, which is the case that matters most. Two fields rather than `uname -a` because that is the smallest input answering the question and the one a PowerShell half can answer without parsing prose
99
+ target_of_host() { # -> the Rust target triple this host is, empty when it maps to none
100
+ case "$(uname -s 2>/dev/null)/$(uname -m 2>/dev/null)" in
101
+ Linux/x86_64) printf 'x86_64-unknown-linux-gnu' ;;
102
+ Linux/aarch64|Linux/arm64) printf 'aarch64-unknown-linux-gnu' ;;
103
+ Darwin/x86_64) printf 'x86_64-apple-darwin' ;;
104
+ Darwin/arm64) printf 'aarch64-apple-darwin' ;;
105
+ *) : ;;
106
+ esac
107
+ }
108
+
109
+ ARTIFACT_SRC=""; ARTIFACT_PATH=""; ARTIFACT_TARGET=""; ARTIFACT_DIGEST=""; OMIT_REASON=""
110
+
111
+ # spec: installer/README.md §The gate binary — selection has three outcomes and collapsing any two is the defect, which is why the payload's roster copy is read rather than a directory's presence inferred from: without it a platform that was never committed to and one whose artifact went missing look identical, and reading the second as the first turns a broken payload into a silently smaller green battery
112
+ select_artifact() {
113
+ local roster target src want got names
114
+ if [[ ! -d "$PAYLOAD/artifact" ]]; then
115
+ OMIT_REASON="substrate-unavailable"
116
+ return 0
117
+ fi
118
+ roster="$PAYLOAD/artifact/targets.list"
119
+ [[ -f "$roster" ]] || die "this payload carries prebuilt gate binaries but no target roster" \
120
+ "the roster is copied verbatim beside them at pack time; artifacts without one cannot be selected from and the payload is broken, not narrower."
121
+ target="$(target_of_host)"
122
+ if [[ -z "$target" ]] || ! grep -Ev '^[[:space:]]*(#|$)' "$roster" | grep -qxF "$target"; then
123
+ OMIT_REASON="substrate-unavailable"
124
+ return 0
125
+ fi
126
+ src="$PAYLOAD/artifact/$target"
127
+ mapfile -t names < <(find "$src" -maxdepth 1 -type f ! -name '*.sha256' -printf '%P\n' 2>/dev/null | sort)
128
+ [[ ${#names[@]} -eq 1 && -f "$src/${names[0]}.sha256" ]] \
129
+ || die "the payload declares $target but carries no complete artifact for it" \
130
+ "a declared target whose binary or .sha256 sidecar is missing is a publisher defect you cannot act on — refusing rather than installing a battery that silently shrank." 1
131
+ if [[ -z "$(digest_hasher)" ]]; then
132
+ OMIT_REASON="digest-unverifiable"
133
+ return 0
134
+ fi
135
+ want="$(awk 'NR==1{print $1}' "$src/${names[0]}.sha256")"
136
+ got="$(digest_of "$src/${names[0]}")"
137
+ [[ -n "$want" && "$want" == "$got" ]] \
138
+ || die "the prebuilt gate binary for $target does not match its published digest" \
139
+ "nothing unverified is ever written, so this refuses rather than warning. Re-download the package; a persistent mismatch means the artifact was altered after it was built." 1
140
+ ARTIFACT_SRC="$src/${names[0]}"
141
+ ARTIFACT_PATH="$GATES_DIR/${names[0]}"
142
+ ARTIFACT_TARGET="$target"
143
+ ARTIFACT_DIGEST="$got"
144
+ }
145
+ select_artifact
146
+
147
+ # spec: installer/README.md §What init seeds — a starting-roster member whose implementation is a binary subcommand is what an omission omits; the payload's own declaration decides, so nothing here maintains a second roster of which gates are ported
148
+ dispatches_to_binary() { # $1 = kit, $2 = gate name -> 0 iff the payload declares it as a binary subcommand
149
+ [[ -f "$PAYLOAD/$1/checks/$2.gate" && ! -f "$PAYLOAD/$1/checks/$2.sh" ]]
150
+ }
151
+
97
152
  prior_hash() { # $1 = repo-relative path -> the hash the manifest recorded for it, empty when unrecorded
98
153
  [[ -n "$PRIOR_FILES" ]] || return 0
99
154
  while IFS=$'\t' read -r p h; do
@@ -101,6 +156,15 @@ prior_hash() { # $1 = repo-relative path -> the hash the manifest recorded for
101
156
  done <<<"$PRIOR_FILES"
102
157
  }
103
158
 
159
+ WRITTEN=()
160
+ declare -A CARRIED=()
161
+ # spec: installer/README.md §The manifest — a recorded hash is what init last wrote at that path, so an entry init did not write this run — because it refused the write, or because this payload no longer ships the path — carries its hash forward verbatim instead of letting manifest() hash the tree at emit time: hashing the tree there would file the adopter's own content as init's, and the next run would find cur == want, claim the path and overwrite it silently
162
+ record() { # $1 = repo-relative path, $2 = the hash to emit for it; omitted, the tree is hashed at emit time
163
+ WRITTEN+=("$1")
164
+ [[ -n "${2:-}" ]] && CARRIED["$1"]="$2"
165
+ return 0
166
+ }
167
+
104
168
  # spec: installer/README.md §init — the non-destructive re-run: a file whose recorded hash still matches is init's to rewrite, one that has changed since is the adopter's and is reported rather than overwritten
105
169
  CHANGED=()
106
170
  claim() { # $1 = repo-relative path -> 0 iff init may write it
@@ -112,12 +176,11 @@ claim() { # $1 = repo-relative path -> 0 iff init may write it
112
176
  [[ "$cur" == "$want" ]] && return 0
113
177
  (( FORCE )) && return 0
114
178
  CHANGED+=("$1")
179
+ # spec: installer/README.md §The manifest — the carry-forward belongs to the refusal itself rather than to each caller, because this is the single point where the roster would otherwise lose the path and every call site refuses through it: absence of a key reads as "never installed" on the next run, which is the one reading that lets init overwrite the adopter with no report at all. Recording on the refusal is also what makes the exit condition below a strict subset — a live path is in WRITTEN either way, so only relinquished ones reach the carry-forward loop
180
+ record "$1" "$want"
115
181
  return 1
116
182
  }
117
183
 
118
- WRITTEN=()
119
- record() { WRITTEN+=("$1"); }
120
-
121
184
  copy_in() { # $1 = source file, $2 = repo-relative destination
122
185
  claim "$2" || return 0
123
186
  (( DRY )) || { mkdir -p "$ROOT/$(dirname "$2")" && cp "$1" "$ROOT/$2"; } || die "could not write $2"
@@ -135,14 +198,28 @@ done
135
198
  mkdir -p "$ROOT/$GATES_DIR" "$ROOT/.workflow" 2>/dev/null
136
199
  GATES_LIST="$GATES_DIR/gates.list"
137
200
  if claim "$GATES_LIST"; then
201
+ # spec: installer/README.md §The gate binary — an omitted member rides the registry rather than a new file: `# omitted: <name> <reason>` is a comment line the runner already strips from the live set, so the record sits in the consumer's tracked history where a reviewer reads it, and a re-run on a machine that has since gained a hasher converts it back into a live member with no hand edit
138
202
  plan_gates() {
203
+ local kit m
204
+ local -a g
205
+ local -A pending=()
139
206
  printf '%s\n' "# Checkwright gate registry — written by 'checkwright init' (profile: $PROFILE)." \
140
207
  "# Each kit's starting subset; its README names the full roster to grow into."
208
+ # spec: installer/README.md §Profiles — the profile's gate set is derived once, by the same function the smoke's monotonicity assertion reads, so the registry a consumer receives and the invariant asserted over it are not two derivations of one fact. The loop below only sections that set by kit, which the registry keeps because the omission is keyed by the kit shipping the member — and a member registered by more than one kit lands once, under the first of them
209
+ while IFS= read -r m; do [[ -n "$m" ]] && pending["$m"]=1; done < <(profile_gates "$INSTALLER" "$PROFILE")
141
210
  for kit in "${KITS[@]}"; do
142
- mapfile -t g < <(recipe_gates "$kit")
211
+ mapfile -t g < <(recipe_gates "$PAYLOAD/$kit" "$PROFILE")
143
212
  [[ ${#g[@]} -gt 0 ]] || continue
144
213
  printf '# %s\n' "$kit"
145
- printf '%s\n' "${g[@]}"
214
+ for m in "${g[@]}"; do
215
+ [[ -n "${pending[$m]:-}" ]] || continue
216
+ unset "pending[$m]"
217
+ if [[ -n "$OMIT_REASON" ]] && dispatches_to_binary "$kit" "$m"; then
218
+ printf '# omitted: %s %s\n' "$m" "$OMIT_REASON"
219
+ else
220
+ printf '%s\n' "$m"
221
+ fi
222
+ done
146
223
  done
147
224
  }
148
225
  (( DRY )) || plan_gates > "$ROOT/$GATES_LIST" || die "could not write $GATES_LIST"
@@ -150,20 +227,19 @@ if claim "$GATES_LIST"; then
150
227
  fi
151
228
 
152
229
  for kit in "${KITS[@]}"; do
230
+ # spec: installer/README.md §What init seeds — the recipe's plan channel is performed here, in the parent shell, and that is load-bearing rather than stylistic: the producer sits inside a process substitution, where every record() and CHANGED append would be discarded, so the plan may be produced in a subshell and the writes may not
153
231
  while IFS= read -r p; do
154
232
  [[ -n "$p" ]] || continue
155
- claim "$p" && record "$p"
233
+ if [[ "$p" == *$'\t'* ]]; then
234
+ IFS=$'\t' read -r seam_src seam_dest <<<"$p"
235
+ copy_in "$seam_src" "$seam_dest"
236
+ else
237
+ claim "$p" && record "$p"
238
+ fi
156
239
  done < <(
240
+ # spec: installer/README.md §init — --dry-run resolves the same seam plan the real run would, out of the same enumerator rather than a second spelling of the glob: copy_in already writes nothing under --dry-run, so the plan needs no dry variant and cannot drift from the run it predicts
241
+ recipe_config_seam_plan "$PAYLOAD/$kit" "$GATES_DIR"
157
242
  if (( DRY )); then
158
- # spec: installer/README.md §init — --dry-run resolves the same seam plan the real run would, by listing what each recipe would touch without letting it write
159
- recipe_config_seam_names() {
160
- local t
161
- shopt -s nullglob
162
- for t in "$PAYLOAD/$kit"/templates/*-config.sh; do printf '%s/%s\n' "$GATES_DIR" "${t##*/}"; done
163
- shopt -u nullglob
164
- }
165
- recipe_config_seam_names
166
- recipe_needs_queue "$kit" && [[ ! -f "$ROOT/$QUEUE_FILE" ]] && printf '%s\n' "$QUEUE_FILE"
167
243
  case "$kit" in
168
244
  gate-sdk) printf '%s/msg-patterns.list\n' "$GATES_DIR" ;;
169
245
  evidence-kit) printf '%s\n' .workflow/validate-baseline.txt .workflow/validate-evidence.txt ;;
@@ -171,7 +247,6 @@ for kit in "${KITS[@]}"; do
171
247
  doctrine-kit) printf '%s\n' "$AGENT_FILE" ;;
172
248
  esac
173
249
  else
174
- recipe_config_seam "$PAYLOAD/$kit" "$ROOT" "$GATES_DIR" || die "could not seed $kit's config seam"
175
250
  if recipe_needs_agent_file "$kit" && [[ ! -f "$ROOT/$AGENT_FILE" ]]; then
176
251
  # spec: installer/README.md §What init seeds — the seeded agent file carries the section heading context-kit's brevity gate reads by default, so the gate init registers has the surface it was pointed at from the first commit
177
252
  printf '%s\n' "# $AGENT_FILE" "" \
@@ -181,34 +256,67 @@ for kit in "${KITS[@]}"; do
181
256
  > "$ROOT/$AGENT_FILE" || die "could not seed $AGENT_FILE"
182
257
  printf '%s\n' "$AGENT_FILE"
183
258
  fi
184
- recipe_seed "$kit" "$PAYLOAD/$kit" "$ROOT" "$QUEUE_FILE" || die "could not seed $kit"
259
+ recipe_seed "$kit" "$PAYLOAD/$kit" "$ROOT" || die "could not seed $kit"
185
260
  fi
186
261
  )
187
262
  done
188
263
 
189
- # spec: installer/README.md §What init seeds — a guarded seed is written once and kept thereafter, so a re-run must re-claim it: dropping it from the manifest would disown a file init created, and an uninstall that reads this roster would then leave it behind
190
- under_kit() { # $1 = repo-relative path -> 0 iff it lies inside one of this profile's kit directories
191
- local k
192
- for k in "${KITS[@]}"; do [[ "$1" == "$k/"* ]] && return 0; done
193
- return 1
194
- }
264
+ # spec: installer/README.md §What init seeds — the queue seed runs here, once, over the resolved kit set: inside the loop above the first kit reached decided the source before any kit shipping a template got a turn. It runs in the parent shell for the reason that loop's own directive gives — a record() inside the process substitution is discarded — and the resolver below is the single predicate the dry plan and the run share, so the prediction cannot drift from the write it predicts
265
+ QUEUE_SRC="$(recipe_queue_source "$PAYLOAD" "${KITS[@]}")"
266
+ if [[ -n "$QUEUE_SRC" && ! -f "$ROOT/$QUEUE_FILE" ]]; then
267
+ (( DRY )) || recipe_write_queue "$QUEUE_SRC" "$ROOT" "$QUEUE_FILE" || die "could not seed $QUEUE_FILE"
268
+ claim "$QUEUE_FILE" && record "$QUEUE_FILE"
269
+ fi
270
+
271
+ # spec: installer/README.md §The gate binary — the write comes after every config seam is in place and before the hook is generated, because the generator resolves each member's invocation argv and a `.gate` member resolves to this binary: the knob must name it and the file must be there, or the generator reports a dispatch it cannot make
272
+ SEAM="$GATES_DIR/gate-sdk-config.sh"
273
+ if [[ -n "$ARTIFACT_TARGET" ]]; then
274
+ if claim "$ARTIFACT_PATH"; then
275
+ if (( ! DRY )); then
276
+ # spec: installer/README.md §The manifest — an on-disk artifact that still verifies against the recorded digest is not rewritten, which is what makes a bare re-run leave the tree byte-identical
277
+ if [[ "$PRIOR_ARTIFACT_TARGET" != "$ARTIFACT_TARGET" \
278
+ || "$PRIOR_ARTIFACT_DIGEST" != "$ARTIFACT_DIGEST" \
279
+ || ! -f "$ROOT/$ARTIFACT_PATH" \
280
+ || "$(digest_of "$ROOT/$ARTIFACT_PATH")" != "$ARTIFACT_DIGEST" ]]; then
281
+ cp "$ARTIFACT_SRC" "$ROOT/$ARTIFACT_PATH" && chmod +x "$ROOT/$ARTIFACT_PATH" \
282
+ || die "could not write $ARTIFACT_PATH"
283
+ fi
284
+ fi
285
+ record "$ARTIFACT_PATH"
286
+ fi
287
+ # spec: gate-sdk/SPEC.md §Layout and configuration — the install location has one owner and it is this knob, which is why the lock records no path: a consumer's binary sits in their gates directory while the knob's default names the crate's build output, and only the seam can say so without relocating it for every existing reader
288
+ if claim "$SEAM"; then
289
+ if (( ! DRY )); then
290
+ {
291
+ # spec: gate-sdk/SPEC.md §Layout and configuration — the seam is a sourced shell file, so it carries the same two directives every kit's shipped config template carries: without them the consumer's own check-shellcheck reds on the file init just wrote them
292
+ [[ -f "$ROOT/$SEAM" ]] || printf '%s\n' \
293
+ "# shellcheck shell=bash" \
294
+ "# shellcheck disable=SC2034 # consumed by gate-sdk/lib/gate.sh after sourcing"
295
+ [[ -f "$ROOT/$SEAM" ]] && grep -v '^GATE_SDK_NATIVE_BIN=' "$ROOT/$SEAM"
296
+ printf 'GATE_SDK_NATIVE_BIN=%s\n' "$ARTIFACT_PATH"
297
+ } > "$ROOT/$SEAM.tmp" \
298
+ && mv "$ROOT/$SEAM.tmp" "$ROOT/$SEAM" || die "could not write $SEAM"
299
+ fi
300
+ printf '%s\n' "${WRITTEN[@]}" | grep -qxF "$SEAM" || record "$SEAM"
301
+ fi
302
+ fi
303
+
304
+ # spec: installer/README.md §The manifest — the roster's exit condition, and it is the whole rule: init owns a path because it wrote the file there, so ownership ends when the file leaves the tree and at no other moment. Dropping an entry would disown a file init created, and an uninstall reading this roster would then leave it behind. A payload that stops shipping a path is not that moment either — the file is still on disk, it may carry the adopter's edits, and disowning it is precisely what lets a later payload re-adding the same path write straight through them. So membership and existence are the only tests: every path this payload still ships has already reached claim(), which records it on the write and on the refusal alike, leaving exactly the paths no copy_in visited this run to reach here
195
305
  if [[ -n "$PRIOR_FILES" ]]; then
196
306
  while IFS=$'\t' read -r p h; do
197
307
  [[ -n "$p" ]] || continue
198
- under_kit "$p" && continue
199
308
  printf '%s\n' "${WRITTEN[@]}" | grep -qxF "$p" && continue
200
309
  [[ -f "$ROOT/$p" ]] || continue
201
- [[ "$(lock_hash "$ROOT/$p")" == "$h" ]] || continue
202
- record "$p"
310
+ record "$p" "$h"
203
311
  done <<<"$PRIOR_FILES"
204
312
  fi
205
313
 
206
314
  # spec: installer/README.md §init — the generated projections are produced by the vendored tools themselves, never restated by the installer: the hook generator and the graph emitter are gate-sdk's, so a consumer's artifacts are the ones their own gate-sdk makes
207
- GENERATED=("$GATES_DIR/git-hooks/pre-commit" ".workflow/CHECK-GRAPH.html")
315
+ GENERATED=("$GATES_DIR/git-hooks/pre-commit" "$GATES_DIR/CHECK-GRAPH.html")
208
316
  if (( ! DRY )); then
209
317
  ( cd "$ROOT" && bash "$ROOT/gate-sdk/bin/gen-pre-commit.sh" --write ) >/dev/null \
210
318
  || die "gate-sdk's hook generator failed"
211
- ( cd "$ROOT" && bash "$ROOT/gate-sdk/checks/check-graph.sh" --emit ) > "$ROOT/.workflow/CHECK-GRAPH.html" \
319
+ ( cd "$ROOT" && bash "$ROOT/gate-sdk/checks/check-graph.sh" --emit ) > "$ROOT/$GATES_DIR/CHECK-GRAPH.html" \
212
320
  || die "gate-sdk's graph emitter failed"
213
321
  fi
214
322
  [[ -f "$ROOT/$GATES_DIR/git-hooks/commit-msg" ]] && GENERATED+=("$GATES_DIR/git-hooks/commit-msg")
@@ -217,33 +325,39 @@ for g in "${GENERATED[@]}"; do
217
325
  record "$g"
218
326
  done
219
327
 
328
+ # spec: installer/README.md §The manifest — what init wrote this run is a subset of the roster it records, because a path left alone for the adopter and a path this payload no longer ships are both carried forward rather than written; the two part company here so every reader downstream takes the one it means, and staging takes the written set: folding an adopter's file into the vendoring commit is what the clean-worktree precondition exists to prevent
329
+ STAGE=()
330
+ for f in "${WRITTEN[@]}"; do [[ -n "${CARRIED[$f]:-}" ]] || STAGE+=("$f"); done
331
+
332
+ files_hash() { # $1 = repo-relative path -> the hash its files[] entry carries
333
+ [[ -n "${CARRIED[$1]:-}" ]] && { printf '%s' "${CARRIED[$1]}"; return 0; }
334
+ (( DRY )) && [[ ! -f "$ROOT/$1" ]] && { printf '(pending)'; return 0; }
335
+ lock_hash "$ROOT/$1"
336
+ }
337
+
338
+ # spec: installer/README.md §The manifest — the wire shape has one writer and it is lock.sh's lock_emit; what stays here is init's own rule about which hash an entry carries, which is not the schema's business
220
339
  manifest() {
221
340
  local f
222
- {
223
- printf '{"schema":%s,"version":%s,"commit":%s,"profile":%s,"kits":' \
224
- "$(jq -Rn --arg v "$CHECKWRIGHT_LOCK_SCHEMA" '$v')" \
225
- "$(jq -Rn --arg v "$VERSION" '$v')" \
226
- "$(jq -Rn --arg v "$COMMIT" '$v')" \
227
- "$(jq -Rn --arg v "$PROFILE" '$v')"
228
- printf '%s\n' "${KITS[@]}" | jq -Rn '[inputs]'
229
- printf ',"files":{'
230
- local first=1
231
- for f in "${WRITTEN[@]}"; do
232
- (( first )) || printf ','
233
- first=0
234
- printf '%s:%s' "$(jq -Rn --arg v "$f" '$v')" \
235
- "$(jq -Rn --arg v "$( (( DRY )) && [[ ! -f "$ROOT/$f" ]] && printf '(pending)' || lock_hash "$ROOT/$f")" '$v')"
236
- done
237
- printf '}}'
238
- } | jq -S .
341
+ # spec: installer/README.md §The manifest — the binary is neither vendored nor generated, so it joins as its own key rather than a files[] row: a files[] entry means hashed with git hash-object and rewritten when unmodified, and this one is hashed with SHA-256 against a published value and rewritten on a different rule. Its absence on a run that omitted the artifact is the omission's machine-readable form, which is why the flag is passed only when a target was selected
342
+ local -a args=(version="$VERSION" commit="$COMMIT" profile="$PROFILE" kits="${KITS[*]}")
343
+ [[ -n "$ARTIFACT_TARGET" ]] && args+=(--artifact "$ARTIFACT_TARGET" "$ARTIFACT_DIGEST")
344
+ for f in "${WRITTEN[@]}"; do
345
+ printf '%s\t%s\n' "$f" "$(files_hash "$f")"
346
+ done | lock_emit "${args[@]}"
239
347
  }
240
348
 
241
349
  if (( DRY )); then
242
350
  printf 'checkwright init --dry-run (profile: %s, version: %s)\n\n' "$PROFILE" "$VERSION"
243
351
  printf 'would vendor %d kit(s): %s\n' "${#KITS[@]}" "${KITS[*]}"
244
- printf 'would write %d file(s), including:\n' "$(( ${#WRITTEN[@]} + 1 ))"
352
+ printf 'would write %d file(s), including:\n' "$(( ${#STAGE[@]} + 1 ))"
245
353
  printf ' %s\n' "$GATES_LIST" "$CHECKWRIGHT_LOCK_FILE"
246
354
  for kit in "${KITS[@]}"; do printf ' %s/ (%d files)\n' "$kit" "$(find "$PAYLOAD/$kit" -type f | wc -l)"; done
355
+ if [[ -n "$ARTIFACT_TARGET" ]]; then
356
+ printf '\nwould place the %s gate binary at %s (digest verified against the payload sidecar)\n' \
357
+ "$ARTIFACT_TARGET" "$ARTIFACT_PATH"
358
+ else
359
+ printf '\nwould omit the prebuilt gate binary (%s) and declare it in %s\n' "$OMIT_REASON" "$GATES_LIST"
360
+ fi
247
361
  if [[ ${#CHANGED[@]} -gt 0 ]]; then
248
362
  printf '\nwould leave %d changed file(s) alone (--force to overwrite):\n' "${#CHANGED[@]}"
249
363
  printf ' %s\n' "${CHANGED[@]}"
@@ -256,6 +370,7 @@ fi
256
370
 
257
371
  manifest > "$LOCK" || die "could not write $CHECKWRIGHT_LOCK_FILE"
258
372
  WRITTEN+=("$CHECKWRIGHT_LOCK_FILE")
373
+ STAGE+=("$CHECKWRIGHT_LOCK_FILE")
259
374
 
260
375
  if [[ ${#CHANGED[@]} -gt 0 ]]; then
261
376
  printf '\n%d file(s) have changed since init wrote them and were left alone:\n' "${#CHANGED[@]}"
@@ -263,7 +378,7 @@ if [[ ${#CHANGED[@]} -gt 0 ]]; then
263
378
  printf ' help: review the differences; re-run with --force to take the packaged version.\n\n'
264
379
  fi
265
380
 
266
- git -C "$ROOT" add -- "${WRITTEN[@]}" || die "could not stage the vendored files"
381
+ git -C "$ROOT" add -- "${STAGE[@]}" || die "could not stage the vendored files"
267
382
 
268
383
  # spec: installer/README.md §init — idempotence is a property of the tree, so a re-run that changed nothing reports and exits clean rather than failing on an empty commit: "nothing to do" is the success case, not an error
269
384
  if git -C "$ROOT" diff --cached --quiet; then
@@ -0,0 +1,212 @@
1
+ #!/usr/bin/env bash
2
+ # spec: installer/README.md §uninstall — reverses an install against the roster init recorded and nothing else: an entry whose content is still what init wrote is removed, an entry you have edited since is kept and reported, and the manifest is narrowed over the survivors rather than deleted, so ownership of a file that is still on disk never lapses
3
+ #
4
+ # usage: checkwright uninstall [--dry-run] [--force] [--no-commit]
5
+ # Each flag is described by --help.
6
+ set -uo pipefail
7
+
8
+ INSTALLER="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
+ PAYLOAD="$INSTALLER/payload"
10
+ # shellcheck source=./common/lock.sh
11
+ source "$INSTALLER/lib/common/lock.sh"
12
+ # spec: installer/README.md §What init seeds — sourced for the consumer-layout names, so the agent file this verb trims is the one init wrote rather than a second spelling of the path
13
+ # shellcheck source=./common/recipe.sh
14
+ source "$INSTALLER/lib/common/recipe.sh"
15
+
16
+ DRY=0; FORCE=0; DO_COMMIT=1
17
+ while [[ $# -gt 0 ]]; do
18
+ case "$1" in
19
+ --dry-run) DRY=1; shift ;;
20
+ --force) FORCE=1; shift ;;
21
+ --no-commit) DO_COMMIT=0; shift ;;
22
+ -h|--help)
23
+ printf 'usage: checkwright uninstall [--dry-run] [--force] [--no-commit]\n\n'
24
+ printf 'Removes the files init recorded in %s and commits the removal.\n' "$CHECKWRIGHT_LOCK_FILE"
25
+ printf 'Nothing outside that roster is touched. A file you have edited since\n'
26
+ printf 'init wrote it is kept and reported; --force removes it anyway.\n'
27
+ exit 0 ;;
28
+ *) printf 'checkwright uninstall: unknown argument: %s\n' "$1" >&2; exit 2 ;;
29
+ esac
30
+ done
31
+
32
+ die() { printf 'checkwright uninstall: %s\n' "$1" >&2; [[ -n "${2:-}" ]] && printf ' help: %s\n' "$2" >&2; exit "${3:-2}"; }
33
+
34
+ # spec: installer/README.md §init — every precondition refuses rather than warns and all of them are checked before anything is removed, for init's own reason: a partial removal is the outcome none of them may produce
35
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
36
+ || die "not inside a git work tree" \
37
+ "uninstall stages and commits the removal the same way init committed the install, so it needs the repository it is reversing."
38
+
39
+ LOCK="$(lock_path "$ROOT")"
40
+ [[ -f "$LOCK" ]] || die "no $CHECKWRIGHT_LOCK_FILE at $ROOT" \
41
+ "init is the verb that makes an install, and the manifest it writes is the only record of which files are this installer's to remove. Without one there is nothing here to reverse."
42
+ lock_schema_ok "$LOCK" || die "$CHECKWRIGHT_LOCK_FILE carries a schema this build does not know" \
43
+ "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."
44
+
45
+ # spec: installer/README.md §init — the clean-worktree precondition is init's, on the same terms: one commit is made, and a dirty tree would fold your work into it; --no-commit is the same valve
46
+ if (( ! DRY )) && (( DO_COMMIT )) && [[ -n "$(git -C "$ROOT" status --porcelain)" ]]; then
47
+ die "the worktree is not clean" \
48
+ "uninstall makes one commit, and a dirty tree would fold your work into it — so a reviewer's diff would no longer be the whole of what was removed. Commit or stash first, or pass --no-commit to stage the removal yourself." 1
49
+ fi
50
+
51
+ PROFILE="$(lock_field "$LOCK" profile)"
52
+ VERSION="$(lock_field "$LOCK" version)"
53
+ KITS=()
54
+ read -r -a KITS <<<"$(lock_field "$LOCK" kits)"
55
+ GATES_LIST="$(lock_own_file "$LOCK" "$GATES_DIR/gates.list")"
56
+
57
+ kits_include() { # $1 = kit name -> 0 iff the manifest records it as vendored
58
+ local k
59
+ for k in ${KITS[@]+"${KITS[@]}"}; do [[ "$k" == "$1" ]] && return 0; done
60
+ return 1
61
+ }
62
+
63
+ # spec: installer/README.md §uninstall — the removal rule is claim() seen from the other side, and it needs no new data: init records each path at the hash it last wrote there, so a hash that still matches marks a file that is init's to remove and one that differs marks a file that is yours to keep. A recorded path already off the tree is a no-op rather than an error — it left the roster the moment it left the tree
64
+ REMOVE=(); KEEP=(); GONE=()
65
+ declare -A KEPT_HASH=(); declare -A ROSTER=()
66
+ while IFS=$'\t' read -r p h; do
67
+ [[ -n "$p" ]] || continue
68
+ ROSTER["$p"]=1
69
+ if [[ ! -f "$ROOT/$p" ]]; then GONE+=("$p"); continue; fi
70
+ if (( FORCE )) || [[ "$(lock_hash "$ROOT/$p")" == "$h" ]]; then
71
+ REMOVE+=("$p")
72
+ else
73
+ KEEP+=("$p"); KEPT_HASH["$p"]="$h"
74
+ fi
75
+ done < <(jq -r 'if (.files | type) == "object" then (.files | to_entries[] | "\(.key)\t\(.value)") else empty end' "$LOCK")
76
+
77
+ # spec: installer/README.md §uninstall — the agent file is the one entry that is a span rather than a file, so the branch where it is kept still owes the doctrine block a removal: the block is prose you did not write, in the file whose purpose is to steer agent sessions, pointing at a doctrine file this verb just removed. The trim is scoped to that span alone — a marker block init never wrote is never a files[] entry, so it is never this verb's to touch
78
+ TRIM_AGENT=0
79
+ DOCTRINE_REMOVER="$PAYLOAD/doctrine-kit/bin/install-doctrine.sh"
80
+ if [[ -n "${KEPT_HASH[$AGENT_FILE]:-}" ]] && kits_include doctrine-kit; then
81
+ TRIM_AGENT=1
82
+ [[ -f "$DOCTRINE_REMOVER" ]] || die "this package carries no payload copy of doctrine-kit's installer" \
83
+ "the doctrine block is trimmed through the kit's own installer so the removal path adds no second copy of the marker strings, and this run needs it because $AGENT_FILE is being kept. Run uninstall from an installed package rather than a source checkout."
84
+ fi
85
+
86
+ # spec: installer/README.md §uninstall — the hook opt-in is reported, not rewritten: git config is outside the ownership roster, and a core.hooksPath naming a directory that no longer exists is inert rather than breaking, so there is nothing to justify writing outside the contract. The resolver needs no kits guard: it asks the manifest for the exact path init writes, which a residual manifest simply does not record
87
+ HOOKS_LINE=""
88
+ hooks_path="$(git -C "$ROOT" config --get core.hooksPath 2>/dev/null)"
89
+ if [[ -n "$hooks_path" && -n "$GATES_LIST" && "$GATES_LIST" == */* ]]; then
90
+ gates_dir="${GATES_LIST%/*}"
91
+ rel="${hooks_path#"$ROOT"/}"
92
+ [[ "$rel" == "$gates_dir" || "$rel" == "$gates_dir"/* ]] \
93
+ && HOOKS_LINE="git config --unset core.hooksPath"
94
+ fi
95
+
96
+ # spec: installer/README.md §The manifest — the survivors carry the hash init recorded, never the tree's: an entry rewritten at your hash would read as unchanged on the next install and let it write straight through you, which is the one defect the residual manifest exists to prevent
97
+ residual() {
98
+ local p
99
+ for p in ${KEEP[@]+"${KEEP[@]}"}; do printf '%s\t%s\n' "$p" "${KEPT_HASH[$p]}"; done | lock_emit
100
+ }
101
+
102
+ ancestors() { # $1 = repo-relative path -> each of its directories, deepest first
103
+ local d="$1"
104
+ while [[ "$d" == */* ]]; do d="${d%/*}"; printf '%s\n' "$d"; done
105
+ }
106
+
107
+ # spec: installer/README.md §uninstall — a file you added inside a vendored directory is not on the roster, so it is never removed; the plan names it because a directory left behind holding only your own files is a surprise worth spending a line on before the run rather than after
108
+ adopter_added() {
109
+ local kit f
110
+ for kit in ${KITS[@]+"${KITS[@]}"}; do
111
+ [[ -d "$ROOT/$kit" ]] || continue
112
+ while IFS= read -r f; do
113
+ [[ -n "$f" && -z "${ROSTER[$f]:-}" ]] && printf '%s\n' "$f"
114
+ done < <(cd "$ROOT" && find "$kit" -type f | LC_ALL=C sort)
115
+ done
116
+ }
117
+
118
+ by_top_dir() { # repo-relative paths on stdin -> '<top-level dir or file> <count>' lines
119
+ awk -F/ '{ print (NF > 1 ? $1 "/" : $0) }' | LC_ALL=C sort | uniq -c \
120
+ | awk '{ printf " %-32s %d file(s)\n", $2, $1 }'
121
+ }
122
+
123
+ # spec: installer/README.md §uninstall — a run with nothing to remove says so and exits 0: the install is still there, so narrowing the manifest here would disown an install that has not ended
124
+ if [[ ${#REMOVE[@]} -eq 0 ]]; then
125
+ printf 'UNINSTALL: nothing to remove — of %d recorded file(s), %d have changed since init wrote them and %d are already gone.\n' \
126
+ "$(( ${#KEEP[@]} + ${#GONE[@]} ))" "${#KEEP[@]}" "${#GONE[@]}"
127
+ [[ ${#KEEP[@]} -gt 0 ]] && printf ' help: they are yours, so uninstall leaves them. Pass --force to remove them anyway.\n'
128
+ exit 0
129
+ fi
130
+
131
+ if (( DRY )); then
132
+ printf 'checkwright uninstall --dry-run (profile: %s, version: %s)\n\n' "$PROFILE" "$VERSION"
133
+ printf 'would remove %d file(s):\n' "${#REMOVE[@]}"
134
+ printf '%s\n' "${REMOVE[@]}" | by_top_dir
135
+ printf 'would then remove every directory those files empty.\n'
136
+ if [[ ${#KEEP[@]} -gt 0 ]]; then
137
+ printf '\nwould keep %d file(s) you have changed since init wrote them (--force to remove them anyway):\n' "${#KEEP[@]}"
138
+ printf ' %s\n' "${KEEP[@]}"
139
+ fi
140
+ [[ ${#GONE[@]} -gt 0 ]] && printf '\n%d recorded file(s) are already off the tree — nothing to do for them.\n' "${#GONE[@]}"
141
+ added="$(adopter_added)"
142
+ if [[ -n "$added" ]]; then
143
+ printf '\nwould leave %d file(s) you added inside a vendored directory:\n' "$(grep -c . <<<"$added")"
144
+ while IFS= read -r f; do printf ' %s\n' "$f"; done <<<"$added"
145
+ fi
146
+ (( TRIM_AGENT )) && printf '\nwould trim the doctrine block out of %s, which is being kept, and leave the rest of it alone.\n' "$AGENT_FILE"
147
+ if [[ ${#KEEP[@]} -eq 0 ]]; then
148
+ printf '\nwould delete %s — nothing recorded would survive.\n' "$CHECKWRIGHT_LOCK_FILE"
149
+ else
150
+ printf '\nwould rewrite %s over the %d kept file(s), at the hashes init recorded:\n' "$CHECKWRIGHT_LOCK_FILE" "${#KEEP[@]}"
151
+ residual
152
+ fi
153
+ [[ -n "$HOOKS_LINE" ]] && printf '\nwould print this for you to run yourself:\n %s\n' "$HOOKS_LINE"
154
+ printf '\nDRY RUN: nothing was written.\n'
155
+ exit 0
156
+ fi
157
+
158
+ for p in "${REMOVE[@]}"; do rm -f "$ROOT/$p" || die "could not remove $p"; done
159
+
160
+ # spec: installer/README.md §uninstall — pruning is bottom-up and only ever removes a directory that is now empty: uninstall removes files it owns, never directories it merely emptied around, so one left holding anything at all is left alone
161
+ while IFS= read -r d; do
162
+ rmdir "$ROOT/$d" 2>/dev/null
163
+ done < <(for p in "${REMOVE[@]}"; do ancestors "$p"; done | LC_ALL=C sort -ru)
164
+
165
+ TRIMMED=0
166
+ if (( TRIM_AGENT )); then
167
+ # spec: doctrine-kit/SPEC.md §install-doctrine — the trim runs through the payload's copy of the kit's own installer, exactly as init's injection does, so the marker strings keep their one writer and the removal works once the vendored kit is gone
168
+ trim_out="$( cd "$ROOT" && bash "$DOCTRINE_REMOVER" --remove "$AGENT_FILE" 2>&1 )" \
169
+ || die "the doctrine block could not be trimmed out of $AGENT_FILE: $trim_out"
170
+ TRIMMED=1
171
+ fi
172
+
173
+ if [[ ${#KEEP[@]} -eq 0 ]]; then
174
+ rm -f "$LOCK" || die "could not remove $CHECKWRIGHT_LOCK_FILE"
175
+ elif residual > "$LOCK.tmp"; then
176
+ mv "$LOCK.tmp" "$LOCK" || die "could not rewrite $CHECKWRIGHT_LOCK_FILE"
177
+ else
178
+ rm -f "$LOCK.tmp"
179
+ die "could not rewrite $CHECKWRIGHT_LOCK_FILE over the kept file(s)"
180
+ fi
181
+
182
+ # spec: installer/README.md §uninstall — the staged set is the removals and the manifest disposition, and a kept file is never among them: staging a file left for the adopter is the same defect init's written-set/roster split exists to prevent, and it stays one when the write is a removal
183
+ STAGE=()
184
+ while IFS= read -r -d '' p; do STAGE+=("$p"); done < <(git -C "$ROOT" ls-files -z -- "${REMOVE[@]}")
185
+ if [[ -f "$LOCK" ]] || git -C "$ROOT" ls-files --error-unmatch -- "$CHECKWRIGHT_LOCK_FILE" >/dev/null 2>&1; then
186
+ STAGE+=("$CHECKWRIGHT_LOCK_FILE")
187
+ fi
188
+ [[ ${#STAGE[@]} -gt 0 ]] && { git -C "$ROOT" add -- "${STAGE[@]}" || die "could not stage the removal"; }
189
+
190
+ if [[ ${#KEEP[@]} -gt 0 ]]; then
191
+ printf '\n%d file(s) have changed since init wrote them and were kept:\n' "${#KEEP[@]}"
192
+ printf ' %s\n' "${KEEP[@]}"
193
+ printf ' help: they are yours. %s now records those paths and nothing else, at the hashes init wrote, so a future init still protects them rather than writing through them.\n' \
194
+ "$CHECKWRIGHT_LOCK_FILE"
195
+ fi
196
+ (( TRIMMED )) && printf '\ntrimmed the doctrine block out of %s and left the change unstaged — the rest of that file is yours to review.\n' "$AGENT_FILE"
197
+
198
+ if git -C "$ROOT" diff --cached --quiet; then
199
+ printf '\nUNINSTALL: removed %d file(s), none of which this repository was tracking — nothing to commit.\n' "${#REMOVE[@]}"
200
+ else
201
+ if (( DO_COMMIT )); then
202
+ git -C "$ROOT" commit -q -m "chore: remove Checkwright kits ($PROFILE, v$VERSION)" \
203
+ || die "the commit failed — the removal is staged; commit it yourself to finish" "" 1
204
+ printf '\nUNINSTALL: removed %d file(s), kept %d, and committed the removal.\n' "${#REMOVE[@]}" "${#KEEP[@]}"
205
+ else
206
+ printf '\nUNINSTALL: removed %d file(s), kept %d and staged the removal — --no-commit, so the commit is yours.\n' \
207
+ "${#REMOVE[@]}" "${#KEEP[@]}"
208
+ fi
209
+ fi
210
+
211
+ [[ -n "$HOOKS_LINE" ]] && printf '\nthis clone still points at the hooks directory that was just removed. Undo that yourself with:\n %s\n' "$HOOKS_LINE"
212
+ exit 0
package/lib/update.sh ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ # spec: installer/README.md §update — update is init with one added precondition and its argv forwarded verbatim: checkwright.lock must already exist, so a verb named update can manage an install but never perform the first one. Every init flag stays valid, including --profile, --force, --no-commit and --dry-run, so the mutating-verb --dry-run obligation is discharged by delegation rather than a second implementation that could drift from it
3
+ #
4
+ # usage: checkwright update [--profile <name>] [--dry-run] [--force] [--no-commit]
5
+ # Every init flag stays valid; see 'checkwright init --help' for what each one does.
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
+ # spec: installer/README.md §init — -h/--help is intercepted first and answers on its own, outside any repository precondition, exactly as every other verb's --help does
13
+ for arg in "$@"; do
14
+ case "$arg" in
15
+ -h|--help)
16
+ printf 'usage: checkwright update [--profile <name>] [--dry-run] [--force] [--no-commit]\n\n'
17
+ printf 'Runs checkwright init with the same arguments, refusing when there is no\n'
18
+ printf 'existing install for it to update. Every init flag is valid here — see\n'
19
+ printf "'checkwright init --help' for what each one does.\n"
20
+ exit 0 ;;
21
+ esac
22
+ done
23
+
24
+ die() { printf 'checkwright update: %s\n' "$1" >&2; [[ -n "${2:-}" ]] && printf ' help: %s\n' "$2" >&2; exit "${3:-2}"; }
25
+
26
+ # spec: installer/README.md §update — the one added precondition, and the whole behavioral difference from init: checkwright.lock must already exist at the repository root, so a verb named update never performs a first install. It checks existence only and no more — a present-but-unreadable schema, a stale downgrade, a below-contract toolchain, and every other init precondition are init's own checks, one call away, and repeating any of them here would be a second copy that could drift from the original. Not being inside a git work tree at all is not this verb's precondition to own either: init's own "not inside a git work tree" refusal already exists and already names the accurate remedy, so an unresolvable root here just falls through to it rather than being reported as an absent manifest
27
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
28
+ if [[ -n "$ROOT" ]] && [[ ! -f "$(lock_path "$ROOT")" ]]; then
29
+ die "no $CHECKWRIGHT_LOCK_FILE at $ROOT" \
30
+ "update manages an install init already made; there isn't one yet. Run 'checkwright init' first."
31
+ fi
32
+
33
+ # spec: installer/README.md §init — everything else, including --dry-run, --force and --no-commit, is init's own contract, unrepeated here
34
+ exec bash "$INSTALLER/lib/init.sh" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "checkwright",
3
- "version": "0.21.0",
3
+ "version": "0.23.0",
4
4
  "description": "Vendors pinned Checkwright kit source into your repository and commits it — a coding-agent-assisted delivery methodology (gate SDK, evidence-stamped lifecycle, agent context economics).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -19,6 +19,6 @@
19
19
  "README.md"
20
20
  ],
21
21
  "checkwright": {
22
- "commit": "97b50392d51cd399deba4771f91d0e0937f6ef2f"
22
+ "commit": "aa518573c57fa0b036a1f6887444f5d334579c22"
23
23
  }
24
24
  }