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,135 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/identity.conf dir=one valve=none tier=precommit
3
- # install: on-surface
4
- # spec: gate-sdk/SPEC.md §check-identity — every expectation in the identity manifest matches this clone's local git identity
5
- #
6
- # usage: check-identity.sh [--fixture <dir>] [manifest]
7
- # default manifest: GATE_SDK_IDENTITY_FILE (<gates-dir>/identity.conf);
8
- # --fixture <dir> injects a clone's git identity for deterministic tests
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
- MODE=live
16
- FIXTURE_DIR=""
17
- MANIFEST=""
18
- while [[ $# -gt 0 ]]; do
19
- case "$1" in
20
- --fixture) MODE=fixture; FIXTURE_DIR="${2:-}"; shift 2 ;;
21
- -*) echo "check-identity: unknown argument: $1" >&2; exit 2 ;;
22
- *) MANIFEST="$1"; shift ;;
23
- esac
24
- done
25
-
26
- if [[ "$MODE" == fixture ]]; then
27
- [[ -d "$FIXTURE_DIR" ]] || { echo "check-identity: fixture dir not found: $FIXTURE_DIR" >&2; exit 2; }
28
- MANIFEST="${MANIFEST:-$FIXTURE_DIR/identity.conf}"
29
- else
30
- MANIFEST="${MANIFEST:-${GATE_SDK_IDENTITY_FILE:-$(gate_sdk_gates_dir)/identity.conf}}"
31
- fi
32
-
33
- if [[ ! -e "$MANIFEST" ]]; then
34
- echo "IDENTITY: clean (no manifest at $MANIFEST — optional consumer config absent)"
35
- exit 0
36
- fi
37
- [[ -r "$MANIFEST" ]] || { echo "check-identity: manifest not readable: $MANIFEST" >&2; exit 2; }
38
-
39
- if [[ "$MODE" == live ]]; then
40
- # spec: gate-sdk/SPEC.md §check-identity — CI is not a committing clone (no
41
- # local identity to misattribute a commit/push with), so the guard steps aside.
42
- if [[ -n "${CI:-}" ]]; then
43
- echo "IDENTITY: clean (CI context — not a committing clone; identity guard skipped)"
44
- exit 0
45
- fi
46
- git rev-parse --git-dir >/dev/null 2>&1 || {
47
- echo "check-identity: not a git repository — cannot verify identity" >&2; exit 2; }
48
- fi
49
-
50
- actual_email() {
51
- if [[ "$MODE" == fixture ]]; then
52
- [[ -f "$FIXTURE_DIR/git-config-email" ]] || return 0
53
- head -n1 "$FIXTURE_DIR/git-config-email"
54
- else
55
- git config user.email 2>/dev/null || true
56
- fi
57
- }
58
-
59
- # spec: gate-sdk/SPEC.md §check-identity — a configured remote absent from this
60
- # clone is red; return 1 signals the missing remote to the comparison below.
61
- actual_remote_url() {
62
- local remote="$1" r u _rest
63
- if [[ "$MODE" == fixture ]]; then
64
- [[ -f "$FIXTURE_DIR/git-remotes" ]] || return 1
65
- while read -r r u _rest; do
66
- [[ "$r" == "$remote" ]] && { printf '%s' "$u"; return 0; }
67
- done < <(gates_list_members "$FIXTURE_DIR/git-remotes")
68
- return 1
69
- fi
70
- git remote get-url "$remote" 2>/dev/null
71
- }
72
-
73
- # spec: gate-sdk/SPEC.md §check-identity — the host part is the SSH alias /
74
- # hostname that selects the identity; parse scp-like and scheme:// URL forms.
75
- extract_host() {
76
- local url="$1" h
77
- case "$url" in
78
- *://*)
79
- h="${url#*://}"; h="${h#*@}"; h="${h%%/*}"; h="${h%%:*}" ;;
80
- *:*)
81
- h="${url%%:*}"; h="${h#*@}" ;;
82
- *)
83
- h="" ;;
84
- esac
85
- printf '%s' "$h"
86
- }
87
-
88
- mapfile -t members < <(gates_list_members "$MANIFEST")
89
-
90
- malformed=(); mismatches=(); checked=0
91
- for line in "${members[@]}"; do
92
- read -r -a f <<<"$line"
93
- case "${f[0]}" in
94
- email)
95
- if [[ ${#f[@]} -ne 2 ]]; then malformed+=("$line"); continue; fi
96
- checked=$((checked + 1))
97
- act="$(actual_email)"
98
- [[ "$act" == "${f[1]}" ]] ||
99
- mismatches+=("email: manifest expects '${f[1]}', clone has '${act:-<unset>}'")
100
- ;;
101
- remote-host)
102
- if [[ ${#f[@]} -ne 3 ]]; then malformed+=("$line"); continue; fi
103
- checked=$((checked + 1))
104
- if url="$(actual_remote_url "${f[1]}")"; then
105
- host="$(extract_host "$url")"
106
- [[ "$host" == "${f[2]}" ]] ||
107
- mismatches+=("remote-host ${f[1]}: manifest expects '${f[2]}', clone has '${host:-<unparseable>}' (url: $url)")
108
- else
109
- mismatches+=("remote-host ${f[1]}: no such remote in this clone")
110
- fi
111
- ;;
112
- *)
113
- malformed+=("$line")
114
- ;;
115
- esac
116
- done
117
-
118
- if [[ ${#malformed[@]} -gt 0 ]]; then
119
- echo "check-identity: malformed line(s) in $MANIFEST (expected 'email <addr>' or 'remote-host <remote> <host>'):" >&2
120
- printf ' %s\n' "${malformed[@]}" >&2
121
- exit 2
122
- fi
123
-
124
- if [[ ${#mismatches[@]} -gt 0 ]]; then
125
- echo "check-identity: local git identity does not match $MANIFEST:"
126
- printf ' %s\n' "${mismatches[@]}"
127
- echo " help: this clone commits/pushes under the wrong identity — fix the git"
128
- echo " mapping (user.email via includeIf, the remote's SSH host alias via"
129
- echo " core.sshCommand/remote URL), or — if the expectation itself moved —"
130
- echo " update the matching line in $MANIFEST."
131
- exit 1
132
- fi
133
-
134
- echo "IDENTITY: clean ($checked expectation(s) match this clone's git identity in $MANIFEST)"
135
- exit 0
@@ -1,95 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/gates.list,kit:checks/*.sh dir=one valve=none tier=precommit
3
- # install: on-surface
4
- # spec: gate-sdk/SPEC.md §check-kit-enum — a literal hand list of >=2 kit roots sharing a glob must name every kit root with matching tracked files; the fix is the kit:<glob> token, not a longer list
5
- #
6
- # usage: check-kit-enum.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
- GATES_DIR="${1:-$(gate_sdk_gates_dir)}"
14
- LIST="$GATES_DIR/gates.list"
15
- [[ -f "$LIST" ]] || { echo "check-kit-enum: no registry at $LIST" >&2; exit 2; }
16
-
17
- REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
18
- || { echo "check-kit-enum: not a git repository — cannot test tracked kit files" >&2; exit 2; }
19
-
20
- mapfile -t KIT_ROOTS < <(gate_kit_roots_rel)
21
- [[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-kit-enum: no kit roots enumerated" >&2; exit 2; }
22
-
23
- RESOLVE_DIRS=("$GATES_DIR")
24
- while IFS= read -r k; do RESOLVE_DIRS+=("$k/checks"); done < <(gate_kit_roots)
25
-
26
- is_kit_root() {
27
- local c="$1" r
28
- for r in "${KIT_ROOTS[@]}"; do [[ "$c" == "${r%/}" ]] && return 0; done
29
- return 1
30
- }
31
-
32
- root_has_glob() {
33
- local root="$1" glob="$2" out st
34
- out="$(git -C "$REPO_ROOT" ls-files -- "${root%/}/$glob" 2>/dev/null)"; st=$?
35
- fail_closed "$st" check-kit-enum "git ls-files"
36
- [[ -n "$out" ]]
37
- }
38
-
39
- members="$(gates_list_members "$LIST")"
40
- [[ -n "$members" ]] || { echo "check-kit-enum: no members parsed from $LIST" >&2; exit 2; }
41
-
42
- violations=()
43
- groups_checked=0
44
- while IFS= read -r m; do
45
- [[ -n "$m" ]] || continue
46
- if ! src="$(gate_resolve "$m" "${RESOLVE_DIRS[@]}")"; then
47
- echo "check-kit-enum: $m in $LIST resolves in none of: ${RESOLVE_DIRS[*]}" >&2
48
- exit 2
49
- fi
50
- man="$(grep -m1 '^# graph: ' "$src" 2>/dev/null || true)"
51
- [[ -n "$man" ]] || continue # no manifest is check-graph's finding, not this gate's
52
-
53
- couples=""
54
- for kv in ${man#\# graph: }; do
55
- [[ "$kv" == couples=* ]] && { couples="${kv#couples=}"; break; }
56
- done
57
- [[ -n "$couples" ]] || continue
58
-
59
- declare -A named=()
60
- IFS=',' read -ra toks <<<"$couples"
61
- for t in "${toks[@]}"; do
62
- [[ "$t" == */* ]] || continue
63
- root="${t%%/*}"; glob="${t#*/}"
64
- is_kit_root "$root" || continue
65
- named["$glob"]+=" $root"
66
- done
67
-
68
- for glob in "${!named[@]}"; do
69
- read -ra have <<<"${named[$glob]}"
70
- [[ ${#have[@]} -ge 2 ]] || continue # a single named root is not a hand list
71
- groups_checked=$((groups_checked + 1))
72
- missing=()
73
- for r in "${KIT_ROOTS[@]}"; do
74
- r="${r%/}"
75
- root_has_glob "$r" "$glob" || continue
76
- found=0
77
- for h in "${have[@]}"; do [[ "$h" == "$r" ]] && { found=1; break; }; done
78
- [[ "$found" -eq 0 ]] && missing+=("$r")
79
- done
80
- [[ ${#missing[@]} -gt 0 ]] \
81
- && violations+=("$m couples a '$glob' hand list naming [${have[*]}] but omits [${missing[*]}]")
82
- done
83
- unset named
84
- done <<< "$members"
85
-
86
- if [[ ${#violations[@]} -gt 0 ]]; then
87
- echo "check-kit-enum: gate(s) hand-list kit roots incompletely — the kit set drifted:"
88
- for v in "${violations[@]}"; do echo " $v"; done
89
- echo " help: replace the per-kit hand list with the 'kit:<glob>' couples token"
90
- echo " (lib/gate.sh expands it to every gate_kit_roots member), so a kit"
91
- echo " added later cannot silently fall out of the coupling."
92
- exit 1
93
- fi
94
- echo "KIT-ENUM: clean (${groups_checked} multi-kit hand-list group(s) complete; kit:<glob> keeps them so)"
95
- exit 0
@@ -1,108 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=kit:README.md,kit:checks/* dir=bi valve=none tier=precommit
3
- # install: on-surface
4
- # spec: gate-sdk/SPEC.md §check-readme-roster — every kit README's gate-roster marker block holds name-set parity with the kit's shipped checks/ basenames, both directions
5
- #
6
- # usage: check-readme-roster.sh [root]
7
- # bare: sweep gate_kit_roots against the git toplevel; root: resolve relative
8
- # kit roots against a fixture tree (the case dir's gate-sdk-config.sh names them).
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
- ROOT="${1:-}"
16
- if [[ -z "$ROOT" ]]; then
17
- ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
18
- || { echo "check-readme-roster: not a git repository and no root argument" >&2; exit 2; }
19
- fi
20
- [[ -d "$ROOT" ]] || { echo "check-readme-roster: root not found: $ROOT" >&2; exit 2; }
21
-
22
- BEGIN="<!-- gate-roster:begin -->"
23
- END="<!-- gate-roster:end -->"
24
-
25
- mapfile -t KIT_ROOTS < <(gate_kit_roots)
26
- [[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-readme-roster: no kit roots enumerated" >&2; exit 2; }
27
-
28
- findings=()
29
- help_block=0
30
- help_parity=0
31
- swept=0
32
- skipped=0
33
- for r in "${KIT_ROOTS[@]}"; do
34
- r="${r%/}"
35
- abs="$r"
36
- [[ "$abs" == /* ]] || abs="$ROOT/$r"
37
- kit="${r##*/}"
38
- [[ -d "$abs/checks" ]] || { skipped=$((skipped + 1)); continue; }
39
- swept=$((swept + 1))
40
-
41
- # spec: gate-sdk/SPEC.md §check-readme-roster — both declaration spellings
42
- shipped=""
43
- shopt -s nullglob
44
- for f in "$abs/checks/"*.sh; do
45
- bn="${f##*/}"
46
- shipped+="${bn%.sh}"$'\n'
47
- done
48
- for f in "$abs/checks/"*.gate; do
49
- bn="${f##*/}"
50
- shipped+="${bn%.gate}"$'\n'
51
- done
52
- shopt -u nullglob
53
-
54
- readme="$abs/README.md"
55
- if [[ ! -f "$readme" || -z "$(grep -F -- "$BEGIN" "$readme" 2>/dev/null)" ]]; then
56
- findings+=("$kit: README.md has no gate-roster marker block beside checks/")
57
- help_block=1
58
- continue
59
- fi
60
-
61
- roster="$(awk -v b="$BEGIN" -v e="$END" '
62
- { line = $0; gsub(/^[ \t]+|[ \t\r]+$/, "", line) }
63
- line == b { inb = 1; next }
64
- line == e { inb = 0; next }
65
- inb {
66
- for (i = 1; i <= NF; i++)
67
- if ($i ~ /^check-/) {
68
- match($i, /^check-[[:alnum:]_-]+/)
69
- print substr($i, RSTART, RLENGTH)
70
- break
71
- }
72
- }
73
- ' "$readme")"; st=$?
74
- fail_closed "$st" check-readme-roster awk
75
-
76
- shipped_sorted="$(printf '%s' "$shipped" | sort -u)"
77
- roster_sorted="$(printf '%s\n' "$roster" | sort -u | grep -v '^$' || true)"
78
-
79
- # assertion A: every shipped check appears in the README's roster block
80
- missing="$(comm -23 <(printf '%s\n' "$shipped_sorted") <(printf '%s\n' "$roster_sorted"))"
81
- # assertion B: every roster name resolves to a shipped check
82
- extra="$(comm -13 <(printf '%s\n' "$shipped_sorted") <(printf '%s\n' "$roster_sorted"))"
83
- while IFS= read -r n; do
84
- [[ -n "$n" ]] && { findings+=("$kit: shipped check absent from the README roster: $n"); help_parity=1; }
85
- done <<<"$missing"
86
- while IFS= read -r n; do
87
- [[ -n "$n" ]] && { findings+=("$kit: roster names no shipped check: $n"); help_parity=1; }
88
- done <<<"$extra"
89
- done
90
-
91
- if [[ ${#findings[@]} -gt 0 ]]; then
92
- echo "check-readme-roster: kit README gate roster(s) out of parity with checks/:"
93
- for f in "${findings[@]}"; do echo " $f"; done
94
- [[ "$help_block" -eq 1 ]] && {
95
- echo " help: wrap the kit README's register-the-gates block in"
96
- echo " '$BEGIN' / '$END' markers — a kit"
97
- echo " shipping checks/ registers them (gate-sdk/SPEC.md §Consumer smoke)."
98
- }
99
- [[ "$help_parity" -eq 1 ]] && {
100
- echo " help: keep the marker block's check-* names in name-set parity with the"
101
- echo " kit's checks/ script basenames — add the missing roster line or drop"
102
- echo " the stale one."
103
- }
104
- exit 1
105
- fi
106
-
107
- echo "README-ROSTER: clean ($swept kit README roster(s) in name-set parity with checks/; $skipped root(s) without checks/ skipped)"
108
- exit 0
@@ -1,200 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=kit:checks/*.sh,scripts/*.sh,scripts/gates.list,native/src/*.rs,native/src/gates/*.rs dir=one valve=none tier=precommit trigger=*
3
- # install: on-surface
4
- # spec: gate-sdk/SPEC.md §check-reads-couples — every statically resolvable recursive walk in a registered gate has its tracked read set covered by the gate's expanded couples; the undecidable remainder is skipped-and-counted
5
- set -uo pipefail
6
-
7
- SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
8
- # shellcheck source=../lib/gate.sh
9
- source "$SDK/lib/gate.sh"
10
-
11
- GATES_DIR="$(gate_sdk_gates_dir)"
12
- LIST="$GATES_DIR/gates.list"
13
-
14
- # spec: gate-sdk/SPEC.md §check-reads-couples — per source, one record per
15
- # command-position recursive walk: "<lineno>\t<cmd>\t<exempt>\t<rawline>". A
16
- # leading-comment or trailing '# reads-couples-exempt:' marker sets <exempt>.
17
- extract_walks() {
18
- awk '
19
- function is_marker(s) { return (s ~ /reads-couples-exempt:/) }
20
- {
21
- cur = $0
22
- if (cur ~ /^[[:space:]]*#/) { prevmarker = is_marker(cur); next }
23
- cmd = ""
24
- if (match(cur, /(^|[|&;({`])[ \t]*gate_find[ \t]/)) cmd = "gate_find"
25
- else if (match(cur, /(^|[|&;({`])[ \t]*find[ \t]/)) cmd = "find"
26
- if (cmd != "") {
27
- ex = (prevmarker || is_marker(cur)) ? 1 : 0
28
- print FNR "\t" cmd "\t" ex "\t" cur
29
- }
30
- prevmarker = 0 # a trailing marker excuses only its own line, never the next walk
31
- }
32
- ' "$1"
33
- }
34
-
35
- # spec: gate-sdk/SPEC.md §check-reads-couples — the resolvable-root class; emits
36
- # the repo-relative root, or status 1 when the first argument is undecidable.
37
- resolve_root() {
38
- local cmd="$1" line="$2" src="$3" rest tok sub d1 kit
39
- rest="${line#*"$cmd" }"
40
- tok="${rest%%[[:space:]]*}"
41
- if [[ "$tok" == '"'*'"' && "$tok" != *'$'* ]]; then
42
- tok="${tok#\"}"; tok="${tok%\"}"; tok="${tok#./}"; tok="${tok%/}"
43
- printf '%s\n' "${tok:-.}"; return 0
44
- fi
45
- if [[ "$tok" == '"$KIT"'* ]]; then
46
- sub="${tok#'"$KIT"'}"; sub="${sub#/}"; sub="${sub%/}"
47
- d1="${src%/*}"; kit="${d1%/*}"
48
- [[ -n "$sub" ]] && printf '%s\n' "$kit/$sub" || printf '%s\n' "$kit"
49
- return 0
50
- fi
51
- if [[ "$tok" == '"$REPO_ROOT"'* ]]; then
52
- sub="${tok#'"$REPO_ROOT"'}"; sub="${sub#/}"; sub="${sub%/}"
53
- [[ -n "$sub" ]] && printf '%s\n' "$sub" || printf '%s\n' "."
54
- return 0
55
- fi
56
- return 1
57
- }
58
-
59
- # spec: gate-sdk/SPEC.md §check-reads-couples — the literal '-name <pat>' primary
60
- # when one is extractable from the same invocation (a variable pattern is not).
61
- name_pattern() {
62
- local line="$1" pat=""
63
- if [[ "$line" =~ -name[[:space:]]+\'([^\']*)\' ]]; then
64
- pat="${BASH_REMATCH[1]}"
65
- elif [[ "$line" =~ -name[[:space:]]+\"([^\"]*)\" ]]; then
66
- pat="${BASH_REMATCH[1]}"; [[ "$pat" == *'$'* ]] && pat=""
67
- fi
68
- printf '%s\n' "$pat"
69
- }
70
-
71
- # spec: gate-sdk/SPEC.md §check-reads-couples — couple glob semantics: segments
72
- # never cross '/', so path and glob must have equal segment count.
73
- path_matches_glob() {
74
- local path="$1" glob="$2" i
75
- [[ "$glob" == '*' ]] && return 0
76
- local -a ps gs
77
- IFS='/' read -ra ps <<<"$path"
78
- IFS='/' read -ra gs <<<"$glob"
79
- [[ ${#ps[@]} -eq ${#gs[@]} ]] || return 1
80
- for ((i = 0; i < ${#ps[@]}; i++)); do
81
- # shellcheck disable=SC2053 # gs[i] is the glob, deliberately unquoted
82
- [[ "${ps[i]}" == ${gs[i]} ]] || return 1
83
- done
84
- return 0
85
- }
86
-
87
- # spec: gate-sdk/SPEC.md §check-reads-couples — the per-root coverage assertion, shared by
88
- # both substrates: a root the shell parse resolved and a root the binary reported land here
89
- # identically, so porting a gate changes where the root came from and nothing else.
90
- cover_root() {
91
- local root="$1" prune="$2" namepat="$3" gname="$4" where="$5"
92
- local listing gst f covered g
93
- if [[ "$root" == "." ]]; then
94
- listing="$(git ls-files)"; gst=$?
95
- else
96
- listing="$(git ls-files -- "$root")"; gst=$?
97
- fi
98
- [[ "$gst" -eq 0 ]] || { echo "check-reads-couples: git ls-files failed for root '$root'" >&2; exit 2; }
99
- while IFS= read -r f; do
100
- [[ -n "$f" ]] || continue
101
- [[ "$prune" == 1 ]] && gate_path_pruned "$f" && continue
102
- if [[ -n "$namepat" ]]; then
103
- # shellcheck disable=SC2053 # namepat is the glob, deliberately unquoted
104
- [[ "${f##*/}" == $namepat ]] || continue
105
- fi
106
- covered=0
107
- for g in "${COUPLE_GLOBS[@]}"; do
108
- path_matches_glob "$f" "$g" && { covered=1; break; }
109
- done
110
- [[ "$covered" == 1 ]] || \
111
- findings+=("$gname: $where reads tracked '$f' — no couple covers it (couples: $couples)")
112
- done <<<"$listing"
113
- }
114
-
115
- sources=()
116
- if [[ $# -gt 0 ]]; then
117
- sources=("$@")
118
- else
119
- [[ -f "$LIST" ]] || { echo "check-reads-couples: no registry at $LIST" >&2; exit 2; }
120
- mapfile -t RESOLVE_DIRS < <(gate_check_dirs)
121
- while IFS= read -r c; do
122
- src="$(gate_resolve "$c" "${RESOLVE_DIRS[@]}" || true)"
123
- [[ -n "$src" ]] && sources+=("$src")
124
- done < <(gates_list_members "$LIST")
125
- fi
126
-
127
- analyzed=0
128
- skipped=0
129
- exempt=0
130
- findings=()
131
-
132
- for src in "${sources[@]+"${sources[@]}"}"; do
133
- [[ -f "$src" ]] || continue
134
- gname="$(basename "$src")"; gname="${gname%.sh}"; gname="${gname%.gate}"
135
- couples=""
136
- couples_field="$(gate_manifest_field "$src" couples)"
137
- gate_expand_couples_var couples "$couples_field"
138
- IFS=',' read -ra COUPLE_GLOBS <<<"$couples"
139
-
140
- # spec: gate-sdk/SPEC.md §check-reads-couples — a .gate member's walks are unreadable to
141
- # this shell parser, so the substrate reports them instead: `--reads` answers what the
142
- # binary walks and the coverage assertion below is unchanged.
143
- if [[ "$src" == *.gate ]]; then
144
- bin="$(gate_native_bin)"
145
- if [[ ! -x "$bin" ]]; then
146
- echo "check-reads-couples: $src dispatches to the native binary, but $bin is absent" >&2
147
- echo "or not executable — the declared read set cannot be read, so the coverage" >&2
148
- echo "assertion could not run; treating as failure (not clean)." >&2
149
- echo " help: build it (bash gate-sdk/bin/build-native.sh), or" >&2
150
- echo " install the prebuilt artifact, then re-run." >&2
151
- exit 2
152
- fi
153
- reads="$("$bin" --reads "$gname" 2>&1)"; rst=$?
154
- if [[ "$rst" -ne 0 ]]; then
155
- echo "check-reads-couples: '$bin --reads $gname' exited $rst — the gate's own read set" >&2
156
- echo "is unavailable, so this check could not run; treating as failure (not clean)." >&2
157
- printf ' %s\n' "$reads" >&2
158
- echo " help: the binary must answer --reads for every subcommand a descriptor" >&2
159
- echo " declares. There is deliberately no descriptor-level exemption: a port" >&2
160
- echo " that could opt out of this in a sentence would end the assertion it" >&2
161
- echo " must replace." >&2
162
- exit 2
163
- fi
164
- while IFS= read -r root; do
165
- [[ -n "$root" ]] || continue
166
- # spec: gate-sdk/SPEC.md §check-reads-couples — '?' is the substrate's own honesty
167
- # marker, counted by the same skip counter the shell arm's unresolvable roots use.
168
- if [[ "$root" == '?' ]]; then
169
- skipped=$((skipped + 1)); continue
170
- fi
171
- analyzed=$((analyzed + 1))
172
- cover_root "$root" 1 "" "$gname" "declared read root '$root' (--reads)"
173
- done <<<"$reads"
174
- continue
175
- fi
176
-
177
- walks="$(extract_walks "$src")"; st=$?
178
- fail_closed "$st" READS-COUPLES "awk walk-scan($src)"
179
- [[ -n "$walks" ]] || continue
180
- while IFS=$'\t' read -r lno cmd ex rawline; do
181
- [[ -n "$lno" ]] || continue
182
- if [[ "$ex" == 1 ]]; then exempt=$((exempt + 1)); continue; fi
183
- if ! root="$(resolve_root "$cmd" "$rawline" "$src")"; then
184
- skipped=$((skipped + 1)); continue
185
- fi
186
- analyzed=$((analyzed + 1))
187
- namepat="$(name_pattern "$rawline")"
188
- prune=0; [[ "$cmd" == gate_find ]] && prune=1
189
- cover_root "$root" "$prune" "$namepat" "$gname" "recursive walk over '$root' (line $lno)"
190
- done <<<"$walks"
191
- done
192
-
193
- if [[ ${#findings[@]} -gt 0 ]]; then
194
- echo "check-reads-couples: a resolvable recursive walk reads a tracked path its '# graph: couples=' does not cover:"
195
- printf ' %s\n' "${findings[@]}"
196
- echo " help: add the covering sibling glob to the gate's '# graph: couples=' — a '<dir>/<sub>/*.ext' that matches the deeper path (globs never cross '/', so a shallow one-level couple misses a file one level down), then regenerate the hook + graph artifacts; or mark the walk '# reads-couples-exempt: <reason>' (same line, or the line directly above) when the uncoupled read is deliberate. Never widen a glob to cross '/' to pass a near-miss."
197
- exit 1
198
- fi
199
- echo "READS-COUPLES: clean ($analyzed resolvable walk(s) covered; $skipped undecidable walk(s) skipped-and-counted; $exempt exempt; across ${#sources[@]} gate(s))"
200
- exit 0
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/root-allowlist.list dir=one valve=none tier=precommit
3
- # install: on-surface
4
- # spec: gate-sdk/SPEC.md §check-root-tiering — the repo root holds only allowlisted orientation entries; workflow machinery stays under the configured dirs
5
- #
6
- # usage: check-root-tiering.sh [allowlist-file] [scan-root]
7
- # allowlist-file: GATE_SDK_ROOT_ALLOWLIST (default root-allowlist.list; absent
8
- # → the built-in minimal set). scan-root: the checked tree (default '.').
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
- ALLOWFILE="${1:-${GATE_SDK_ROOT_ALLOWLIST:-$(gate_sdk_gates_dir)/root-allowlist.list}}"
16
- SCANROOT="${2:-.}"
17
-
18
- git rev-parse --git-dir >/dev/null 2>&1 || {
19
- echo "check-root-tiering: not a git repository — cannot enumerate tracked root entries" >&2; exit 2; }
20
-
21
- if [[ -f "$ALLOWFILE" ]]; then
22
- [[ -r "$ALLOWFILE" ]] || { echo "check-root-tiering: allowlist not readable: $ALLOWFILE" >&2; exit 2; }
23
- mapfile -t allow < <(gates_list_members "$ALLOWFILE")
24
- src="$ALLOWFILE"
25
- else
26
- allow=(README.md LICENSE "${GATE_SDK_QUEUE_FILE:-TASK-QUEUE.md}" "${GATE_SDK_AGENT_FILE:-CLAUDE.md}" .gitignore 'SPEC-*.md')
27
- src="built-in minimal orientation set"
28
- fi
29
-
30
- covered() {
31
- local e="$1" p
32
- for p in "${allow[@]}"; do
33
- # shellcheck disable=SC2053 # $p is the allowlist glob, matched unquoted on purpose
34
- [[ "$e" == $p ]] && return 0
35
- done
36
- return 1
37
- }
38
-
39
- prefix=""
40
- [[ "$SCANROOT" != "." ]] && prefix="${SCANROOT%/}/"
41
-
42
- listing="$(git ls-files -- "$SCANROOT")"; st=$?
43
- fail_closed "$st" ROOT-TIERING git-ls-files
44
-
45
- declare -A seen=()
46
- stray=(); count=0
47
- while IFS= read -r path; do
48
- [[ -n "$path" ]] || continue
49
- entry="${path#"$prefix"}"; entry="${entry%%/*}"
50
- [[ -n "${seen[$entry]:-}" ]] && continue
51
- seen[$entry]=1
52
- count=$((count + 1))
53
- covered "$entry" || stray+=("$entry")
54
- done <<< "$listing"
55
-
56
- if [[ ${#stray[@]} -gt 0 ]]; then
57
- echo "check-root-tiering: tracked top-level entry not in the allowlist ($src) —"
58
- echo "the repo root is the orientation surface; workflow machinery belongs under the"
59
- echo "configured workflow/gates dirs, not scattered at root:"
60
- printf ' %s\n' "${stray[@]}"
61
- echo " help: move the entry under an existing dir, or — if it is a deliberate new"
62
- echo " root surface — add it to $ALLOWFILE in the same commit."
63
- exit 1
64
- fi
65
-
66
- echo "ROOT-TIERING: clean ($count tracked top-level entr(y|ies) all allowlisted via $src)"
67
- exit 0