checkwright 0.23.0 → 0.25.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 (375) hide show
  1. package/README.md +175 -13
  2. package/lib/common/lock.sh +7 -0
  3. package/lib/common/recipe.sh +1 -1
  4. package/lib/diff.sh +2 -0
  5. package/lib/init.sh +40 -16
  6. package/lib/uninstall.sh +2 -0
  7. package/package.json +2 -2
  8. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  9. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  10. package/payload/canon-kit/README.md +2 -0
  11. package/payload/canon-kit/SPEC.md +454 -28
  12. package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
  13. package/payload/canon-kit/checks/check-amendment-update-target.gate +3 -0
  14. package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
  15. package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
  16. package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
  17. package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
  18. package/payload/canon-kit/checks/check-unmarked-claim.gate +3 -0
  19. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-orphan.md +6 -0
  20. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +7 -2
  21. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +8 -0
  22. package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/SPEC-thing.md +26 -0
  23. package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/expect.txt +8 -0
  24. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +47 -0
  25. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/expect.txt +1 -0
  26. package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +82 -0
  27. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +3 -0
  28. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
  29. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  30. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
  31. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
  32. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC-wire.md +18 -0
  33. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +3 -1
  34. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.proto +13 -0
  35. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC-wire.md +22 -0
  36. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +17 -0
  37. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.proto +13 -0
  38. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/SPEC.md +11 -0
  39. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +3 -0
  40. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +6 -0
  41. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +18 -0
  42. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/expect.txt +1 -0
  43. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +6 -0
  44. package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +85 -0
  45. package/payload/canon-kit/lib/spec.sh +16 -0
  46. package/payload/canon-kit/smoke/install.sh +3 -1
  47. package/payload/canon-kit/templates/SPEC-amendment.md +17 -2
  48. package/payload/context-kit/README.md +6 -4
  49. package/payload/context-kit/SPEC.md +256 -76
  50. package/payload/context-kit/bin/always-loaded.sh +5 -21
  51. package/payload/context-kit/bin/env-probe.sh +2 -17
  52. package/payload/context-kit/checks/check-brevity.gate +3 -0
  53. package/payload/context-kit/checks/check-footprint-fresh.gate +3 -0
  54. package/payload/context-kit/checks/check-memory-off.gate +3 -0
  55. package/payload/context-kit/checks/check-settings-paths.gate +3 -0
  56. package/payload/context-kit/checks/check-settings-pins.gate +3 -0
  57. package/payload/context-kit/gate-tests/check-brevity.test.sh +3 -2
  58. package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/context-config.sh +4 -0
  59. package/payload/context-kit/gate-tests/check-memory-off/good/scripts/context-config.sh +4 -0
  60. package/payload/context-kit/gate-tests/check-memory-off.test.sh +18 -4
  61. package/payload/context-kit/gate-tests/check-settings-pins.test.sh +70 -0
  62. package/payload/context-kit/index-tests/expected/toolfloor.txt +5 -5
  63. package/payload/context-kit/index-tests/toolfloor-cases.sh +5 -5
  64. package/payload/context-kit/lib/context.sh +56 -0
  65. package/payload/context-kit/lib/toolfloor.sh +1 -1
  66. package/payload/context-kit/smoke/agents-md.sh +16 -4
  67. package/payload/context-kit/smoke/install.sh +3 -2
  68. package/payload/context-kit/templates/session-context.sh +5 -5
  69. package/payload/delegation-kit/README.md +11 -1
  70. package/payload/delegation-kit/SPEC.md +652 -11
  71. package/payload/delegation-kit/bin/wait-probe.sh +184 -0
  72. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +3 -0
  73. package/payload/delegation-kit/checks/check-gate-tamper.gate +3 -0
  74. package/payload/delegation-kit/checks/check-rule-citation.gate +3 -0
  75. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/added-exemptions +5 -0
  76. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +2 -0
  77. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +108 -0
  78. package/payload/delegation-kit/gate-tests/subagent-stop-liveness.test.sh +99 -0
  79. package/payload/delegation-kit/smoke/install.sh +21 -1
  80. package/payload/delegation-kit/templates/agent-execution.md +88 -4
  81. package/payload/delegation-kit/templates/subagent-stop-liveness.sh +56 -0
  82. package/payload/doctrine-kit/SPEC.md +1 -1
  83. package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
  84. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -3
  85. package/payload/doctrine-kit/smoke/install.sh +17 -4
  86. package/payload/drift-kit/README.md +2 -2
  87. package/payload/drift-kit/SPEC.md +71 -7
  88. package/payload/drift-kit/bin/stage-economics.sh +1 -1
  89. package/payload/drift-kit/lib/drift.sh +43 -0
  90. package/payload/drift-kit/smoke/install.sh +21 -14
  91. package/payload/evidence-kit/README.md +3 -1
  92. package/payload/evidence-kit/SPEC.md +160 -19
  93. package/payload/evidence-kit/checks/check-battery-roster.gate +3 -0
  94. package/payload/evidence-kit/checks/check-evidence-baseline.gate +3 -0
  95. package/payload/evidence-kit/checks/check-evidence-manifest.gate +3 -0
  96. package/payload/evidence-kit/checks/check-producer-liveness.sh +42 -2
  97. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +4 -3
  98. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +8 -5
  99. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +1 -1
  100. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/evidence-config.sh +9 -0
  101. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +1 -1
  102. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/evidence-config.sh +9 -0
  103. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +6 -4
  104. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +42 -1
  105. package/payload/evidence-kit/lib/evidence.sh +2 -0
  106. package/payload/evidence-kit/smoke/install.sh +1 -1
  107. package/payload/gate-sdk/README.md +17 -9
  108. package/payload/gate-sdk/SPEC.md +4680 -295
  109. package/payload/gate-sdk/bin/build-native.sh +66 -1
  110. package/payload/gate-sdk/bin/install-hooks.sh +14 -2
  111. package/payload/gate-sdk/bin/port-blockers.sh +37 -9
  112. package/payload/gate-sdk/bin/run-gate-tests.sh +1 -2
  113. package/payload/gate-sdk/bin/run-gates.sh +137 -13
  114. package/payload/gate-sdk/bin/upgrade-smoke.sh +21 -16
  115. package/payload/gate-sdk/checks/check-action-run-shell.sh +2 -1
  116. package/payload/gate-sdk/checks/check-commit-msg.gate +3 -0
  117. package/payload/gate-sdk/checks/check-commit-subject.gate +3 -0
  118. package/payload/gate-sdk/checks/check-core-files.gate +3 -0
  119. package/payload/gate-sdk/checks/check-crate-arms.sh +1 -0
  120. package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -0
  121. package/payload/gate-sdk/checks/check-exec-bit.gate +3 -0
  122. package/payload/gate-sdk/checks/check-gate-assertions.gate +3 -0
  123. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +3 -0
  124. package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +3 -0
  125. package/payload/gate-sdk/checks/check-gate-fail-closed.gate +3 -0
  126. package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +3 -0
  127. package/payload/gate-sdk/checks/check-gate-output.gate +3 -0
  128. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +132 -15
  129. package/payload/gate-sdk/checks/check-graph.gate +3 -0
  130. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +3 -0
  131. package/payload/gate-sdk/checks/check-identity.gate +3 -0
  132. package/payload/gate-sdk/checks/check-install-disposition.sh +1 -0
  133. package/payload/gate-sdk/checks/check-kit-enum.gate +3 -0
  134. package/payload/gate-sdk/checks/check-readme-roster.gate +3 -0
  135. package/payload/gate-sdk/checks/check-reads-couples.gate +3 -0
  136. package/payload/gate-sdk/checks/check-root-tiering.gate +3 -0
  137. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  138. package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
  139. package/payload/gate-sdk/checks/check-tree-terms.gate +3 -0
  140. package/payload/gate-sdk/checks/check-workflow-tiering.gate +3 -0
  141. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +17 -12
  142. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +4 -5
  143. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +2 -1
  144. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +2 -1
  145. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +3 -0
  146. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -1
  147. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +3 -4
  148. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +5 -1
  149. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +22 -0
  150. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-count.sh +11 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-extra.sh +14 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-zero.sh +7 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  154. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +27 -0
  155. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-qux.sh +13 -0
  156. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +117 -0
  157. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +26 -4
  158. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +6 -1
  159. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +2 -0
  160. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored-descriptor.gate +4 -0
  161. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored.sh +14 -0
  162. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +4 -0
  163. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-held.sh +8 -0
  164. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +8 -1
  165. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +3 -0
  166. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored-descriptor.gate +4 -0
  167. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored.sh +14 -0
  168. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +4 -0
  169. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-held.sh +8 -0
  170. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +77 -0
  171. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +4 -5
  172. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +9 -0
  173. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kit-spec.md +6 -0
  174. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +1 -0
  175. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-bare.sh +4 -0
  176. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-both.sh +5 -0
  177. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-heldtwice.sh +5 -0
  178. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-nospec.sh +4 -0
  179. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +2 -0
  180. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twice.sh +5 -0
  181. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-ungrounded.sh +5 -0
  182. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +6 -0
  183. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  184. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kit-spec.md +12 -0
  185. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +1 -0
  186. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +5 -0
  187. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -0
  188. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +49 -4
  189. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +15 -5
  190. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +12 -0
  191. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +27 -5
  192. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +12 -0
  193. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +5 -4
  194. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +14 -12
  195. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +43 -17
  196. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +190 -0
  197. package/payload/gate-sdk/gate-tests/check-identity/bad/gh-hosts.yml +9 -0
  198. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -2
  199. package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/gate-sdk-config.sh +10 -0
  200. package/payload/gate-sdk/gate-tests/check-identity/good/gh-hosts.yml +11 -0
  201. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -1
  202. package/payload/gate-sdk/gate-tests/check-identity/good/scripts/gate-sdk-config.sh +10 -0
  203. package/payload/gate-sdk/gate-tests/check-identity.test.sh +114 -0
  204. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-native-sample.gate +3 -0
  205. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -1
  206. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-native-sample.gate +3 -0
  207. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  208. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +5 -2
  209. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +3 -1
  210. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/README.md +15 -0
  211. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-one.gate +2 -0
  212. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-two.sh +3 -0
  213. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +3 -1
  214. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +1 -1
  215. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +3 -1
  216. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/README.md +13 -0
  217. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/checks/check-delta-one.gate +2 -0
  218. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/README.md +14 -0
  219. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-one.sh +3 -0
  220. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-two.gate +2 -0
  221. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +1 -1
  222. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +87 -89
  223. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +4 -0
  224. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +56 -0
  225. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +5 -0
  226. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/multi.txt +4 -0
  227. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/second-leak.txt +2 -0
  228. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
  229. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
  230. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +4 -0
  231. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +2 -0
  232. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +3 -0
  233. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/worktrees/vendored-note.txt +3 -0
  234. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +94 -0
  235. package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +211 -0
  236. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +16 -15
  237. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +94 -1
  238. package/payload/gate-sdk/lib/gate.sh +232 -25
  239. package/payload/gate-sdk/smoke/install.sh +28 -1
  240. package/payload/guard-kit/README.md +4 -3
  241. package/payload/guard-kit/SPEC.md +578 -47
  242. package/payload/guard-kit/bin/compare-settings-allow.sh +36 -12
  243. package/payload/guard-kit/bin/run-guard-tests.sh +27 -4
  244. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +46 -1
  245. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
  246. package/payload/guard-kit/guard-tests/background-cases.tsv +14 -0
  247. package/payload/guard-kit/guard-tests/cases.tsv +67 -9
  248. package/payload/guard-kit/lib/guard.sh +361 -18
  249. package/payload/guard-kit/templates/bash-guard.sh +2 -0
  250. package/payload/guard-kit/templates/close-triage.md +10 -3
  251. package/payload/guard-kit/templates/guard-config.sh +3 -0
  252. package/payload/lifecycle-kit/README.md +3 -2
  253. package/payload/lifecycle-kit/SPEC.md +509 -77
  254. package/payload/lifecycle-kit/bin/enter-stage.sh +72 -33
  255. package/payload/lifecycle-kit/bin/file-gap.sh +2 -2
  256. package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
  257. package/payload/lifecycle-kit/checks/check-stage-entry.gate +3 -0
  258. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +4 -4
  259. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -1
  260. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +3 -3
  261. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +3 -3
  262. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +22 -22
  263. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +2 -2
  264. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +2 -2
  265. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +120 -10
  266. package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
  267. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +11 -11
  268. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
  269. package/payload/lifecycle-kit/lib/stages.sh +5 -0
  270. package/payload/lifecycle-kit/smoke/install.sh +29 -15
  271. package/payload/lifecycle-kit/templates/lead.md +32 -0
  272. package/payload/lifecycle-kit/templates/stages/align.md +20 -2
  273. package/payload/lifecycle-kit/templates/stages/build.md +3 -3
  274. package/payload/lifecycle-kit/templates/stages/close.md +20 -6
  275. package/payload/lifecycle-kit/templates/stages/scope.md +20 -1
  276. package/payload/lifecycle-kit/templates/stages/spec.md +1 -1
  277. package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
  278. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +1 -1
  279. package/payload/queue-kit/README.md +10 -10
  280. package/payload/queue-kit/SPEC.md +379 -84
  281. package/payload/queue-kit/bin/queue-counts.sh +1 -1
  282. package/payload/queue-kit/checks/check-queue-entry-budget.gate +1 -1
  283. package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
  284. package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -0
  285. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +15 -0
  286. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +2 -0
  287. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +7 -0
  288. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +4 -0
  289. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -1
  290. package/payload/queue-kit/gate-tests/queue-counts.test.sh +1 -1
  291. package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
  292. package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
  293. package/payload/queue-kit/lib/queue.sh +0 -49
  294. package/payload/queue-kit/smoke/install.sh +1 -1
  295. package/payload/site-kit/SPEC.md +41 -2
  296. package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
  297. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  298. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +5 -4
  299. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +6 -5
  300. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/checks/check-sample.gate +3 -0
  301. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -1
  302. package/payload/site-kit/smoke/install.sh +1 -1
  303. package/payload/canon-kit/checks/check-amendment-queue.sh +0 -117
  304. package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -79
  305. package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -240
  306. package/payload/canon-kit/checks/check-prose-tells.sh +0 -208
  307. package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -134
  308. package/payload/context-kit/bin/footprint.sh +0 -144
  309. package/payload/context-kit/checks/check-brevity.sh +0 -124
  310. package/payload/context-kit/checks/check-footprint-fresh.sh +0 -39
  311. package/payload/context-kit/checks/check-memory-off.sh +0 -113
  312. package/payload/context-kit/checks/check-settings-paths.sh +0 -94
  313. package/payload/context-kit/checks/check-settings-pins.sh +0 -111
  314. package/payload/context-kit/gate-tests/check-memory-off/bad/args +0 -1
  315. package/payload/context-kit/gate-tests/check-memory-off/good/args +0 -1
  316. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -62
  317. package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -140
  318. package/payload/delegation-kit/checks/check-rule-citation.sh +0 -77
  319. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -246
  320. package/payload/drift-kit/bin/trajectory.sh +0 -242
  321. package/payload/evidence-kit/checks/check-battery-roster.sh +0 -87
  322. package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -104
  323. package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -105
  324. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +0 -3
  325. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +0 -3
  326. package/payload/gate-sdk/bin/enforcement-map.sh +0 -273
  327. package/payload/gate-sdk/checks/check-commit-msg.sh +0 -51
  328. package/payload/gate-sdk/checks/check-commit-subject.sh +0 -44
  329. package/payload/gate-sdk/checks/check-core-files.sh +0 -76
  330. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -38
  331. package/payload/gate-sdk/checks/check-exec-bit.sh +0 -96
  332. package/payload/gate-sdk/checks/check-gate-assertions.sh +0 -148
  333. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -107
  334. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -106
  335. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -85
  336. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -93
  337. package/payload/gate-sdk/checks/check-gate-output.sh +0 -103
  338. package/payload/gate-sdk/checks/check-graph.sh +0 -632
  339. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -46
  340. package/payload/gate-sdk/checks/check-identity.sh +0 -135
  341. package/payload/gate-sdk/checks/check-kit-enum.sh +0 -95
  342. package/payload/gate-sdk/checks/check-readme-roster.sh +0 -108
  343. package/payload/gate-sdk/checks/check-reads-couples.sh +0 -200
  344. package/payload/gate-sdk/checks/check-root-tiering.sh +0 -67
  345. package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -127
  346. package/payload/gate-sdk/checks/check-tree-terms.sh +0 -66
  347. package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -85
  348. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +0 -1
  349. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +0 -1
  350. package/payload/gate-sdk/gate-tests/check-identity/bad/args +0 -1
  351. package/payload/gate-sdk/gate-tests/check-identity/good/args +0 -1
  352. package/payload/lifecycle-kit/bin/close-surfaces.sh +0 -94
  353. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +0 -64
  354. package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -198
  355. package/payload/queue-kit/bin/queue-index.sh +0 -182
  356. package/payload/queue-kit/bin/roadmap.sh +0 -76
  357. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +0 -64
  358. package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -111
  359. package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -81
  360. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/{gates → scripts}/check-sample.sh +0 -0
  361. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/{gates → scripts}/check-sample.sh +0 -0
  362. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{check-gamma.sh → scripts/check-gamma.sh} +0 -0
  363. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  364. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  365. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gates.list → scripts/gates.list} +0 -0
  366. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{check-beta.sh → scripts/check-beta.sh} +0 -0
  367. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  368. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  369. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gates.list → scripts/gates.list} +0 -0
  370. /package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/{site-config.sh → scripts/site-config.sh} +0 -0
  371. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/CNAME +0 -0
  372. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/index.md +0 -0
  373. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/docs → docs}/posts/2026-01-01-legacy.md +0 -0
  374. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/pkg → pkg}/gate-tests/fixture.md +0 -0
  375. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{site-config.sh → scripts/site-config.sh} +0 -0
@@ -1,148 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=kit:SPEC.md,scripts/*.sh,kit:*.sh,native/src/gates/*.rs dir=bi valve=none tier=align-only
3
- # install: zero-config
4
- # spec: gate-sdk/SPEC.md §check-gate-assertions — couple each §<gate> enumerated-assertion span+count to the gate code's `# assertion` markers
5
- #
6
- # usage: check-gate-assertions.sh [spec [scripts-dir]] (defaults: kit SPEC.md set; kit checks/ dirs)
7
- # requires GNU awk (3-arg match)
8
- set -uo pipefail
9
-
10
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11
- # shellcheck source=../lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
-
14
- GATES_DIR="$(gate_sdk_gates_dir)"
15
- SPECS=()
16
- if [[ $# -gt 0 ]]; then
17
- SPECS=("$1")
18
- else
19
- [[ -f "$GATES_DIR/SPEC.md" ]] && SPECS+=("$GATES_DIR/SPEC.md")
20
- while IFS= read -r k; do
21
- [[ -f "$k/SPEC.md" ]] && SPECS+=("$k/SPEC.md")
22
- done < <(gate_kit_roots)
23
- fi
24
- SCRIPTS_DIR="${2:-}"
25
- [[ ${#SPECS[@]} -gt 0 ]] || { echo "check-gate-assertions: no SPEC.md found (run from repo root)" >&2; exit 2; }
26
- for s in "${SPECS[@]}"; do
27
- [[ -f "$s" ]] || { echo "check-gate-assertions: not found: $s (run from repo root)" >&2; exit 2; }
28
- done
29
-
30
- extract_contracts() { awk '
31
- function wn(w) {
32
- if (w=="two")return 2; if (w=="three")return 3; if (w=="four")return 4
33
- if (w=="five")return 5; if (w=="six")return 6; if (w=="seven")return 7
34
- if (w=="eight")return 8; if (w=="nine")return 9; return 0
35
- }
36
- /^### / { if (h!="") emit(); h=$0; sub(/^### /,"",h); p=""; started=0; done=0; next }
37
- /^## / { if (h!="") { emit(); h="" } next }
38
- {
39
- if (h=="" || done) next
40
- if (!started) { if ($0 ~ /^[[:space:]]*$/) next; started=1; p=$0; next }
41
- if ($0 ~ /^[[:space:]]*$/) { done=1; next }
42
- p = p " " $0
43
- }
44
- END { if (h!="") emit() }
45
- function emit( low,rx,arr,lab,after,ns,nl,n,cnt,csv,i,labs) {
46
- low = tolower(p)
47
- rx = "(^|[^a-z])(two|three|four|five|six|seven|eight|nine)[[:space:]]+([a-z]+[[:space:]]+)?(assertion|assertions|axes|axis|checks)([^a-z]|$)"
48
- if (!match(low, rx)) return
49
- ns = RSTART; nl = RLENGTH
50
- if (match(substr(low, ns, nl), /(two|three|four|five|six|seven|eight|nine)/, arr)) n = wn(arr[1])
51
- after = substr(p, ns + nl - 1)
52
- if (match(after, /\([^)]*\)/, arr)) {
53
- if (arr[0] !~ /^\([A-Za-z0-9]\)$/) return
54
- } else return
55
- delete seen; cnt = 0; csv = ""
56
- while (match(after, /\(([A-Za-z0-9])\)/, arr)) {
57
- lab = arr[1]
58
- if (!(lab in seen)) { seen[lab]=1; cnt++; csv = (csv==""?lab:csv","lab) }
59
- after = substr(after, RSTART + RLENGTH)
60
- }
61
- if (cnt >= 2) printf "%s|%d|%s\n", h, n, csv
62
- }
63
- ' "$1"; }
64
-
65
- # spec: gate-sdk/SPEC.md §check-gate-assertions — a `.gate`-declared member carries its rule in
66
- # the implementation module, so the markers are looked for there: the same follow-the-rule-to-the-
67
- # module resolution §check-gate-output already owns, arriving here with the kit-roots cohort
68
- # spec: gate-sdk/SPEC.md §check-gate-assertions — crate presence is the manifest, never the directory, for the reason §check-gate-output states: a build artifact creates the directory. Exit 3 means the member declares a compiled rule this tree does not carry — a vendored consumer's normal state, since no consumer receives the crate — and is skipped-and-counted rather than red, because a marker set that is not in the tree is not one this gate can assert over.
69
- CRATE_MANIFEST="$(gate_native_crate)/Cargo.toml"
70
- resolve_gate_file() {
71
- if [[ -n "$SCRIPTS_DIR" ]]; then
72
- [[ -f "$SCRIPTS_DIR/$1.sh" ]] && { printf '%s\n' "$SCRIPTS_DIR/$1.sh"; return 0; }
73
- return 1
74
- fi
75
- local -a dirs
76
- local decl
77
- mapfile -t dirs < <(gate_check_dirs)
78
- decl="$(gate_resolve "$1" "${dirs[@]}")" || return 1
79
- if [[ "$decl" == *.gate ]]; then
80
- [[ -f "$CRATE_MANIFEST" ]] || return 3
81
- decl="$(gate_native_module "$1")"
82
- fi
83
- [[ -f "$decl" ]] || return 1
84
- printf '%s\n' "$decl"
85
- }
86
-
87
- findings=()
88
- out_of_reach=()
89
- coupled=0
90
- for spec in "${SPECS[@]}"; do
91
- contracts="$(extract_contracts "$spec")"; st=$?
92
- fail_closed "$st" check-gate-assertions awk
93
-
94
- while IFS='|' read -r gate n labels; do
95
- [[ -z "$gate" ]] && continue
96
- coupled=$((coupled + 1))
97
-
98
- lcount="$(awk -F, '{print NF}' <<< "$labels")"
99
- if [[ "$lcount" -ne "$n" ]]; then
100
- findings+=("$spec §$gate: count-word says $n but the (X) span enumerates $lcount label(s) [$labels] — the contract is internally inconsistent")
101
- fi
102
-
103
- file="$(resolve_gate_file "$gate")"; rst=$?
104
- if [[ "$rst" -eq 3 ]]; then
105
- out_of_reach+=("$gate")
106
- continue
107
- fi
108
- if [[ "$rst" -ne 0 ]]; then
109
- findings+=("$spec §$gate: enumerated contract but no gate code resolves for '$gate' (heading must name the script)")
110
- continue
111
- fi
112
-
113
- # spec: gate-sdk/SPEC.md §check-gate-assertions — the comment leader is the substrate's,
114
- # so both spellings are read: a marker is a code marker either way
115
- markers="$(grep -oE '(#|//)[[:space:]]*assertion[[:space:]]+[A-Za-z0-9]+:' "$file" \
116
- | sed -E 's/^.*assertion[[:space:]]+([A-Za-z0-9]+):$/\1/' | sort -u | paste -sd, -)"
117
-
118
- if [[ -z "$markers" ]]; then
119
- findings+=("$spec §$gate: contract enumerates [$labels] but $file carries zero \`# assertion\` markers (retrofit obligation)")
120
- continue
121
- fi
122
-
123
- want="$(tr ',' '\n' <<< "$labels" | sort -u | paste -sd, -)"
124
- have="$markers"
125
- if [[ "$want" != "$have" ]]; then
126
- missing="$(comm -23 <(tr ',' '\n' <<< "$want") <(tr ',' '\n' <<< "$have") | paste -sd, -)"
127
- extra="$(comm -13 <(tr ',' '\n' <<< "$want") <(tr ',' '\n' <<< "$have") | paste -sd, -)"
128
- msg="$spec §$gate: marker set [$have] != contract span [$want]"
129
- [[ -n "$missing" ]] && msg="$msg; missing marker(s): $missing"
130
- [[ -n "$extra" ]] && msg="$msg; extra marker(s): $extra"
131
- findings+=("$msg")
132
- fi
133
- done <<< "$contracts"
134
- done
135
-
136
- if [[ ${#findings[@]} -gt 0 ]]; then
137
- echo "check-gate-assertions: §<gate> assertion enumeration ↔ gate-code marker mismatch:"
138
- for f in "${findings[@]}"; do echo " $f"; done
139
- echo " help: add/align a '# assertion <label>: <tag>' marker per enumerated assertion in the gate code so its label set matches the §<gate> contract span (and the count-word), or fix the contract's enumeration"
140
- exit 1
141
- fi
142
-
143
- declared=""
144
- if [[ ${#out_of_reach[@]} -gt 0 ]]; then
145
- declared=", ${#out_of_reach[@]} declared out of reach with no crate at $CRATE_MANIFEST — ${out_of_reach[*]}"
146
- fi
147
- echo "GATE-ASSERTIONS: clean ($((coupled - ${#out_of_reach[@]})) of $coupled enumerated contract(s) coupled$declared)"
148
- exit 0
@@ -1,107 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=kit:checks/*.gate,scripts/gates.list,native/* dir=one valve=none tier=precommit
3
- # install: never
4
- # spec: gate-sdk/SPEC.md §check-gate-binary-fresh — whenever a registered member resolving to a .gate descriptor makes the binary load-bearing, the binary was built from the source now in the tree
5
- #
6
- # usage: check-gate-binary-fresh.sh [gates-dir] [tree-stamp-file]
7
- # No second argument: computes the tree-side stamp from the crate's tracked
8
- # source with git. With one: reads it from that file (hermetic fixtures).
9
- set -uo pipefail
10
-
11
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
12
- # shellcheck source=../lib/gate.sh
13
- source "$SDK/lib/gate.sh"
14
-
15
- GATES_DIR="${1:-$(gate_sdk_gates_dir)}"
16
- STAMP_FILE="${2:-}"
17
- LIST="$GATES_DIR/gates.list"
18
- BIN="$(gate_native_bin)"
19
- CRATE="$(gate_native_crate)"
20
- REBUILD="bash gate-sdk/bin/build-native.sh"
21
-
22
- RESOLVE_DIRS=("$GATES_DIR")
23
- while IFS= read -r k; do RESOLVE_DIRS+=("$k/checks"); done < <(gate_kit_roots_rel)
24
-
25
- # spec: gate-sdk/SPEC.md §check-gate-binary-fresh — the descriptor set is the trigger, derived over the resolve dirs as check-gate-substrate-parity assertion B already derives it
26
- mapfile -t DESCRIPTORS < <(
27
- for d in "${RESOLVE_DIRS[@]}"; do
28
- [[ -d "$d" ]] || continue
29
- for f in "$d"/*.gate; do
30
- [[ -f "$f" ]] || continue
31
- b="${f##*/}"; printf '%s\n' "${b%.gate}"
32
- done
33
- done | sort -u
34
- )
35
-
36
- # spec: gate-sdk/SPEC.md §check-gate-binary-fresh — a descriptor on disk is a declaration; a
37
- # registered member resolving to one is a dispatch, and only a dispatch makes the binary
38
- # load-bearing. The live registry is therefore an input, and an absent one is "cannot verify".
39
- [[ -f "$LIST" ]] || {
40
- echo "check-gate-binary-fresh: no gate registry at $LIST — the live member set is what decides whether the binary is load-bearing, so the check could not run; treating as failure (not clean)" >&2
41
- echo " help: pass the gates dir carrying gates.list as the first argument, or set GATE_SDK_GATES_DIR." >&2
42
- exit 2
43
- }
44
- mapfile -t DISPATCHING < <(
45
- while IFS= read -r m; do
46
- [[ -n "$m" ]] || continue
47
- src="$(gate_resolve "$m" "${RESOLVE_DIRS[@]}")" || continue
48
- [[ "$src" == *.gate ]] && printf '%s\n' "$m"
49
- done < <(gates_list_members "$LIST")
50
- )
51
-
52
- # spec: gate-sdk/SPEC.md §check-gate-binary-fresh — nothing dispatching is a clean report, not a
53
- # skipped assertion: no gate dispatches to the binary, so nothing can run stale. Both counts are
54
- # named, so a reader can tell "no descriptors" from "descriptors nothing dispatches to".
55
- # Deliberately *not* the split-halves shape check-gate-substrate-parity assertion B uses, for
56
- # the reason that section states.
57
- if [[ ${#DISPATCHING[@]} -eq 0 ]]; then
58
- echo "GATE-BINARY-FRESH: clean (${#DESCRIPTORS[@]} .gate descriptor(s) across ${#RESOLVE_DIRS[@]} resolve dir(s), 0 dispatched to by a live member of $LIST, so nothing dispatches to $BIN and no build can be stale; crate $CRATE unread)"
59
- exit 0
60
- fi
61
-
62
- # spec: gate-sdk/SPEC.md §Fail-closed contract — with the binary load-bearing, an absent
63
- # or unreadable one is "cannot verify", which must not share an exit code with "verified fresh"
64
- if [[ ! -x "$BIN" ]]; then
65
- echo "check-gate-binary-fresh: $BIN is absent or not executable, but ${#DISPATCHING[@]} registered member(s) dispatch to it — the check could not run; treating as failure (not clean)" >&2
66
- echo " help: build it — $REBUILD" >&2
67
- exit 2
68
- fi
69
-
70
- baked="$("$BIN" --source-stamp 2>/dev/null)"; st=$?
71
- fail_closed "$st" check-gate-binary-fresh "$BIN --source-stamp"
72
- baked="${baked%%$'\n'*}"
73
- [[ -n "$baked" ]] || {
74
- echo "check-gate-binary-fresh: $BIN --source-stamp reported no stamp — the check could not run; treating as failure (not clean)" >&2
75
- echo " help: rebuild it — $REBUILD" >&2
76
- exit 2
77
- }
78
-
79
- if [[ -n "$STAMP_FILE" ]]; then
80
- [[ -r "$STAMP_FILE" ]] || { echo "check-gate-binary-fresh: tree-stamp file not readable: $STAMP_FILE" >&2; exit 2; }
81
- tree="$(cat -- "$STAMP_FILE")"; st=$?
82
- fail_closed "$st" check-gate-binary-fresh cat
83
- tree="${tree%%$'\n'*}"
84
- source_desc="$STAMP_FILE"
85
- else
86
- tree="$(gate_native_source_stamp)" || {
87
- echo "check-gate-binary-fresh: git could not hash the tracked source under $CRATE — the check could not run; treating as failure (not clean)" >&2
88
- echo " help: the stamp is git's content identity for the crate's tracked source set, so the crate root must be a tracked directory inside a git worktree." >&2
89
- exit 2
90
- }
91
- source_desc="$CRATE"
92
- fi
93
- [[ -n "$tree" ]] || { echo "check-gate-binary-fresh: no tree-side stamp from $source_desc" >&2; exit 2; }
94
-
95
- if [[ "$baked" != "$tree" ]]; then
96
- echo "check-gate-binary-fresh: the gate binary was not built from the source now in the tree:"
97
- echo " $BIN reports source stamp $baked"
98
- echo " $source_desc hashes to $tree"
99
- echo " ${#DISPATCHING[@]} descriptor(s) dispatch to that binary: ${DISPATCHING[*]}"
100
- echo " help: rebuild it — $REBUILD"
101
- echo " Until then the descriptor-named gate(s) above run the old implementation"
102
- echo " and pass on code that is not what is committed."
103
- exit 1
104
- fi
105
-
106
- echo "GATE-BINARY-FRESH: clean (${#DESCRIPTORS[@]} .gate descriptor(s) across ${#RESOLVE_DIRS[@]} resolve dir(s), ${#DISPATCHING[@]} dispatched to by a live member of $LIST; $BIN built from the source now in $source_desc, stamp $baked)"
107
- exit 0
@@ -1,106 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/*.sh,kit:*.sh,TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # install: zero-config
4
- # spec: gate-sdk/SPEC.md §check-gate-exemption-tasks — every exception-list element carries a live until: task or permanent: reason
5
- #
6
- # usage: check-gate-exemption-tasks.sh [queue-file [dir...]]
7
- # defaults: $GATE_SDK_QUEUE_FILE (TASK-QUEUE.md); gates dir + each kit's checks/
8
- set -uo pipefail
9
-
10
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11
- # shellcheck source=../lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
-
14
- QUEUE="${1:-${GATE_SDK_QUEUE_FILE:-TASK-QUEUE.md}}"
15
- if [[ $# -gt 1 ]]; then
16
- DIRS=("${@:2}")
17
- else
18
- mapfile -t DIRS < <(gate_check_dirs)
19
- fi
20
-
21
- declare -A IS_LIVE=()
22
- while IFS= read -r slug; do
23
- [[ -n "$slug" ]] && IS_LIVE["$slug"]=1
24
- done < <(awk '
25
- /^## New Features/ { s=1; next }
26
- /^## Technical Debt/ { s=1; next }
27
- /^## Deferred/ { s=1; next }
28
- /^## Done/ { s=0 }
29
- /^## Lessons Learned/{ s=0 }
30
- s && $0 ~ /^[[:space:]]*-[[:space:]]+\*\*[a-z0-9][a-z0-9-]*\*\*/ {
31
- match($0, /\*\*[a-z0-9][a-z0-9-]*\*\*/)
32
- print substr($0, RSTART+2, RLENGTH-4)
33
- }
34
- ' "$QUEUE" 2>/dev/null)
35
-
36
- parse_elements() {
37
- awk -v hl="$2" '
38
- function strip(x){ t=x; gsub(/#.*/,"",t); gsub(/"[^"]*"/,"",t); gsub(/\047[^\047]*\047/,"",t); return t }
39
- NR<=hl { next }
40
- asgn==0 && /^[[:space:]]*[A-Za-z_][A-Za-z0-9_]*=\(/ {
41
- asgn=NR
42
- open=$0; sub(/^[^(]*\(/,"",open); sub(/#.*/,"",open); gsub(/[)[:space:]]/,"",open)
43
- if (length(open)>0) print NR "\topen-line\t"
44
- }
45
- asgn==0 { next }
46
- {
47
- if (NR > asgn) {
48
- noc=$0; sub(/#.*/,"",noc)
49
- if (noc ~ /[^[:space:]()]/) {
50
- type="none"; payload=""
51
- if (match($0, /#[[:space:]]*until:[[:space:]]*[a-z0-9][a-z0-9-]*/)) {
52
- type="until"; payload=substr($0, RSTART, RLENGTH)
53
- sub(/.*until:[[:space:]]*/, "", payload)
54
- } else if ($0 ~ /#[[:space:]]*permanent:/) {
55
- type="permanent"
56
- }
57
- print NR "\t" type "\t" payload
58
- }
59
- }
60
- s2=strip($0); o=gsub(/\(/,"x",s2); c=gsub(/\)/,"x",s2)
61
- if (o>0) started=1
62
- bal += o - c
63
- if (started && bal<=0) exit
64
- }
65
- ' "$1"
66
- }
67
-
68
- errors=()
69
- arrays=0
70
- scan_files=()
71
- shopt -s nullglob
72
- for d in "${DIRS[@]}"; do
73
- # spec: gate-sdk/SPEC.md §Meta-gate conservation for the binary substrate
74
- scan_files+=("$d"/*.sh "$d"/*.gate)
75
- done
76
- shopt -u nullglob
77
-
78
- if [[ ${#scan_files[@]} -gt 0 ]]; then
79
- while IFS= read -r hdr; do
80
- [[ -z "$hdr" ]] && continue
81
- file="${hdr%%:*}"; rest="${hdr#*:}"; lineno="${rest%%:*}"
82
- arrays=$(( arrays + 1 ))
83
- while IFS=$'\t' read -r el etype slug; do
84
- [[ -z "$el" ]] && continue
85
- case "$etype" in
86
- permanent) : ;;
87
- until)
88
- if [[ -z "${IS_LIVE[$slug]:-}" ]]; then
89
- errors+=("$file:$el — # until: $slug does not resolve to a live task (moved to Done, or missing from $QUEUE)")
90
- fi ;;
91
- open-line)
92
- errors+=("$file:$el — exemption element(s) on the array's opening '=(' line cannot carry a per-element disposition; put each element on its own line with a # until:/# permanent: comment") ;;
93
- *) errors+=("$file:$el — exemption element carries neither # until: <slug> nor # permanent: <reason>") ;;
94
- esac
95
- done < <(parse_elements "$file" "$lineno")
96
- done < <(grep -nE '^[[:space:]]*# exception-list:' "${scan_files[@]}" /dev/null 2>/dev/null)
97
- fi
98
-
99
- if [[ ${#errors[@]} -gt 0 ]]; then
100
- echo "GATE-EXEMPTION-TASKS: ${#errors[@]} violation(s):"
101
- printf ' %s\n' "${errors[@]}"
102
- echo " help: annotate each exemption element '# until: <live-slug>' or '# permanent: <reason>'"
103
- exit 1
104
- fi
105
- echo "GATE-EXEMPTION-TASKS: clean ($arrays exemption array(s), ${#IS_LIVE[@]} live task slug(s); every element declares until-with-live-task or permanent-with-reason)"
106
- exit 0
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/*.sh,kit:*.sh dir=one valve=none tier=precommit
3
- # install: zero-config
4
- # spec: gate-sdk/SPEC.md §check-gate-fail-closed — every awk/jq capture in the gate family handles subprocess exit status
5
- #
6
- # usage: check-gate-fail-closed.sh [dir...]
7
- # Scans check-*.sh under each given dir. Default: the consumer gates dir plus
8
- # each vendored kit's checks/.
9
- set -uo pipefail
10
-
11
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
12
- # shellcheck source=../lib/gate.sh
13
- source "$SDK/lib/gate.sh"
14
-
15
- if [[ $# -gt 0 ]]; then
16
- DIRS=("$@")
17
- else
18
- mapfile -t DIRS < <(gate_check_dirs)
19
- fi
20
- gates=()
21
- shopt -s nullglob
22
- for d in "${DIRS[@]}"; do
23
- gates+=("$d"/check-*.sh)
24
- done
25
- shopt -u nullglob
26
- [[ ${#gates[@]} -gt 0 ]] || { echo "check-gate-fail-closed: no check-*.sh gates found under: ${DIRS[*]}" >&2; exit 2; }
27
-
28
- out="$(awk '
29
- BEGIN { Q = sprintf("%c", 39) }
30
- function isparser(line) { return (line ~ /(^|[^A-Za-z])(awk|jq)[[:space:]]/) }
31
- function sat(line) {
32
- if (line ~ /fail_closed/) return 1
33
- if (line ~ /=\$\?/) return 1
34
- if (line ~ /\|\|[[:space:]]*\{/) return 1
35
- if (line ~ /fail-closed-exempt/) return 1
36
- return 0
37
- }
38
- function nquote(line, n, t) { t = line; n = gsub(Q, "", t); return n }
39
- function close_if(line) {
40
- if (line ~ /\)"/ && qc % 2 == 0) {
41
- inblk = 0
42
- if (hasparser && !heredoc && !satisfied)
43
- printf " %s:%d: awk/jq capture branches on output without a fail-closed status check:\n %s\n", FILENAME, blkstart, opentext
44
- }
45
- }
46
- function scan(line) {
47
- qc += nquote(line)
48
- if (isparser(line)) hasparser = 1
49
- if (sat(line)) satisfied = 1
50
- if (line ~ /<<</) heredoc = 1
51
- close_if(line)
52
- }
53
- FNR == 1 { inblk = 0; pend = 0; qc = 0 }
54
- !inblk && /^[[:space:]]*#/ { if ($0 ~ /fail-closed-exempt/) pend = 1; next }
55
- !inblk && /^[[:space:]]*$/ { pend = 0; next }
56
- !inblk && /[A-Za-z_][A-Za-z0-9_]*="\$\(/ && $0 !~ /="\$\(\(/ {
57
- inblk = 1; blkstart = FNR; opentext = $0
58
- hasparser = 0; satisfied = 0; heredoc = 0; qc = 0
59
- if (pend) satisfied = 1
60
- pend = 0
61
- scan($0)
62
- next
63
- }
64
- inblk { scan($0); next }
65
- { pend = 0 }
66
- ' "${gates[@]}")"; st=$?
67
- fail_closed "$st" check-gate-fail-closed awk
68
-
69
- if [[ -n "$out" ]]; then
70
- echo "check-gate-fail-closed: gate(s) capture a parser's output but branch on"
71
- echo "emptiness without checking the subprocess status (gate-sdk/SPEC.md"
72
- echo "§Fail-closed contract — a crash would false-green as 'clean'):"
73
- echo ""
74
- echo "$out"
75
- echo ""
76
- echo " help: capture the status and route it through the shared helper —"
77
- echo " out=\"\$(awk '…' \"\$FILE\")\"; st=\$?"
78
- echo " fail_closed \"\$st\" check-<name> awk"
79
- echo " (source gate-sdk/lib/gate.sh near the top), or annotate a"
80
- echo " genuinely-safe capture with '# fail-closed-exempt: <reason>'."
81
- exit 1
82
- fi
83
-
84
- echo "GATE-FAIL-CLOSED: clean (every awk/jq capture in the gate family handles subprocess status)"
85
- exit 0
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/gates.list,scripts/*.sh,scripts/gate-tests/*,kit:*.sh dir=one valve=none tier=precommit
3
- # install: zero-config
4
- # spec: gate-sdk/SPEC.md §check-gate-fixture-coverage — every gates.list member has a fixture pair or a no-fixture opt-out
5
- #
6
- # usage: check-gate-fixture-coverage.sh [gates-dir [tests-dir...]]
7
- # default tests dirs: <gates-dir>/gate-tests + each kit's gate-tests/
8
- set -uo pipefail
9
-
10
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11
- # shellcheck source=../lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
-
14
- DIR="${1:-$(gate_sdk_gates_dir)}"
15
- if [[ $# -gt 1 ]]; then
16
- TESTS_DIRS=("${@:2}")
17
- else
18
- TESTS_DIRS=("${GATE_SDK_TESTS_DIR:-$DIR/gate-tests}")
19
- while IFS= read -r k; do TESTS_DIRS+=("$k/gate-tests"); done < <(gate_kit_roots)
20
- fi
21
- RESOLVE_DIRS=("$DIR")
22
- while IFS= read -r k; do RESOLVE_DIRS+=("$k/checks"); done < <(gate_kit_roots)
23
- LIST="$DIR/gates.list"
24
- [[ -f "$LIST" ]] || { echo "check-gate-fixture-coverage: no registry at $LIST" >&2; exit 2; }
25
-
26
- members="$(gates_list_members "$LIST")"
27
- [[ -n "$members" ]] || { echo "check-gate-fixture-coverage: no members parsed from $LIST" >&2; exit 2; }
28
-
29
- fixture_dir_for() {
30
- local m="$1" t
31
- for t in "${TESTS_DIRS[@]}"; do
32
- [[ -d "$t/$m" ]] && { printf '%s\n' "$t/$m"; return 0; }
33
- done
34
- return 1
35
- }
36
-
37
- neither=()
38
- halfpair=()
39
- fixtured=0
40
- optout=0
41
- total=0
42
- while IFS= read -r m; do
43
- [[ -n "$m" ]] || continue
44
- total=$((total + 1))
45
- if gd="$(fixture_dir_for "$m")"; then
46
- if [[ -d "$gd/good" && -d "$gd/bad" ]]; then
47
- fixtured=$((fixtured + 1))
48
- elif [[ -d "$gd/good" ]]; then
49
- halfpair+=("$m ($gd/ has good/ but no bad/)")
50
- else
51
- halfpair+=("$m ($gd/ has bad/ but no good/)")
52
- fi
53
- continue
54
- fi
55
- if ! src="$(gate_resolve "$m" "${RESOLVE_DIRS[@]}")"; then
56
- neither+=("$m (no fixture pair, and source resolves in none of: ${RESOLVE_DIRS[*]})")
57
- continue
58
- fi
59
- if grep -Eq '^# no-fixture:' "$src"; then
60
- optout=$((optout + 1))
61
- else
62
- neither+=("$m (no fixture pair under: ${TESTS_DIRS[*]}; no '# no-fixture:' opt-out)")
63
- fi
64
- done <<< "$members"
65
-
66
- if [[ ${#neither[@]} -gt 0 || ${#halfpair[@]} -gt 0 ]]; then
67
- if [[ ${#neither[@]} -gt 0 ]]; then
68
- echo "check-gate-fixture-coverage: gates.list member(s) with neither a fixture pair"
69
- echo "nor a '# no-fixture:' opt-out (gate-sdk/SPEC.md §Fixture-pair discipline — a"
70
- echo "gate ships a good/bad fixture pair on write):"
71
- echo ""
72
- for m in "${neither[@]}"; do echo " $m"; done
73
- echo ""
74
- echo " help: add <tests-dir>/<gate>/{good,bad}/ (run by run-gate-tests.sh), OR"
75
- echo " a '# no-fixture: <why>' header line for a whole-tree scanner with"
76
- echo " no synthetic-dir mode (stopgap on a fixture-capable gate -> file"
77
- echo " a fixture-backfill debt task and list it there)."
78
- fi
79
- if [[ ${#halfpair[@]} -gt 0 ]]; then
80
- [[ ${#neither[@]} -gt 0 ]] && echo ""
81
- echo "check-gate-fixture-coverage: gates.list member(s) with a half-built fixture dir"
82
- echo "(a pair needs both good/ and bad/):"
83
- echo ""
84
- for m in "${halfpair[@]}"; do echo " $m"; done
85
- echo ""
86
- echo " help: add the missing half under <tests-dir>/<gate>/, or remove"
87
- echo " the partial dir and add a '# no-fixture:' opt-out instead."
88
- fi
89
- exit 1
90
- fi
91
-
92
- echo "GATE-FIXTURE-COVERAGE: clean ($total members: $fixtured fixtured, $optout opted-out)"
93
- exit 0
@@ -1,103 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/gates.list,scripts/*.sh,kit:*.sh dir=one valve=none tier=precommit
3
- # install: zero-config
4
- # spec: gate-sdk/SPEC.md §check-gate-output — every gates.list member emits a machine-keyable success line and a help: remedy
5
- #
6
- # usage: check-gate-output.sh [gates-dir]
7
- set -uo pipefail
8
-
9
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
- # shellcheck source=../lib/gate.sh
11
- source "$SDK/lib/gate.sh"
12
-
13
- DIR="${1:-$(gate_sdk_gates_dir)}"
14
- LIST="$DIR/gates.list"
15
- [[ -f "$LIST" ]] || { echo "check-gate-output: no registry at $LIST" >&2; exit 2; }
16
-
17
- members="$(gates_list_members "$LIST")"
18
- [[ -n "$members" ]] || { echo "check-gate-output: no members parsed from $LIST" >&2; exit 2; }
19
-
20
- RESOLVE_DIRS=("$DIR")
21
- while IFS= read -r k; do RESOLVE_DIRS+=("$k/checks"); done < <(gate_kit_roots)
22
-
23
- CRATE="$(gate_native_crate)"
24
- # spec: gate-sdk/SPEC.md §check-gate-output — crate presence is the manifest, never the directory: anything that writes a build artifact under the crate path creates the directory, so a consumer holding only the binary would otherwise be read as carrying the crate
25
- CRATE_MANIFEST="$CRATE/Cargo.toml"
26
-
27
- missing=()
28
- no_help=()
29
- out_of_reach=()
30
- total=0
31
- runtime=0
32
- while IFS= read -r m; do
33
- [[ -n "$m" ]] || continue
34
- total=$((total + 1))
35
- if ! src="$(gate_resolve "$m" "${RESOLVE_DIRS[@]}")"; then
36
- missing+=("$m (source resolves in none of: ${RESOLVE_DIRS[*]})")
37
- continue
38
- fi
39
- # spec: gate-sdk/SPEC.md §Output contract — the source-grep is the oracle only
40
- # for a member no fixture case can reach; every fixtured member is asserted on
41
- # its real output by the runner (§run-gate-tests), which no substrate escapes
42
- if ! grep -q '^# no-fixture:' "$src"; then
43
- runtime=$((runtime + 1))
44
- continue
45
- fi
46
- # spec: gate-sdk/SPEC.md §check-gate-output — corpus and emitter alternation both
47
- # follow the declaration's substrate: a descriptor cannot hold the strings, and the
48
- # shell alternation matches nothing in a Rust module, so a fixed one passes vacuously
49
- corpus="$src"
50
- emit='(echo|printf)'
51
- if [[ "$src" == *.gate ]]; then
52
- corpus="$(gate_native_module "$m")"
53
- emit='(println!|eprintln!|print!|eprint!|writeln!|write!)'
54
- if [[ ! -f "$CRATE_MANIFEST" ]]; then
55
- out_of_reach+=("$m")
56
- continue
57
- fi
58
- if [[ ! -f "$corpus" ]]; then
59
- missing+=("$m (dispatches to a subcommand with no module at $corpus)")
60
- continue
61
- fi
62
- fi
63
- if ! grep -Eq "$emit.*: clean" "$corpus"; then
64
- missing+=("$m (no '<NAME>: clean (…)' success line)")
65
- fi
66
- if ! grep -Eq "$emit.*help:" "$corpus"; then
67
- no_help+=("$m (no 'help:' remedy line on the failure path)")
68
- fi
69
- done <<< "$members"
70
-
71
- if [[ ${#missing[@]} -gt 0 || ${#no_help[@]} -gt 0 ]]; then
72
- if [[ ${#missing[@]} -gt 0 ]]; then
73
- echo "check-gate-output: gates.list member(s) with no machine-keyable success line"
74
- echo "(gate-sdk/SPEC.md §Output contract — success is '^<NAME>: clean (<what>)'):"
75
- echo ""
76
- for m in "${missing[@]}"; do echo " $m"; done
77
- echo ""
78
- echo " help: emit exactly one success line on the exit-0 path —"
79
- echo " echo \"<NAME>: clean (<what was checked>)\""
80
- echo " where <NAME> is the gate's upper-token id (e.g. KIT-README)."
81
- fi
82
- if [[ ${#no_help[@]} -gt 0 ]]; then
83
- [[ ${#missing[@]} -gt 0 ]] && echo ""
84
- echo "check-gate-output: gates.list member(s) with no 'help:' remedy line"
85
- echo "(gate-sdk/SPEC.md §Output contract — every failure path names the fix):"
86
- echo ""
87
- for m in "${no_help[@]}"; do echo " $m"; done
88
- echo ""
89
- echo " help: add a remedy line on the failure path naming the concrete"
90
- echo " action — echo \" help: <do this to fix it>\" (one per failure class)."
91
- fi
92
- exit 1
93
- fi
94
-
95
- # spec: gate-sdk/SPEC.md §check-gate-output — an out-of-reach member is named in the
96
- # success line, never silently dropped from the accounting: a count that quietly shrank
97
- # is indistinguishable from a member that stopped being checked
98
- declared=""
99
- if [[ ${#out_of_reach[@]} -gt 0 ]]; then
100
- declared=", ${#out_of_reach[@]} declared out of reach with no crate at $CRATE_MANIFEST — ${out_of_reach[*]}"
101
- fi
102
- echo "GATE-OUTPUT: clean ($total gates.list member(s): $((total - runtime - ${#out_of_reach[@]})) source-grepped as no-fixture members, $runtime asserted on real output by run-gate-tests$declared)"
103
- exit 0