checkwright 0.23.0 → 0.24.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 (321) hide show
  1. package/README.md +172 -10
  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/SPEC.md +125 -13
  11. package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
  12. package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
  13. package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
  14. package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
  15. package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
  16. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-orphan.md +6 -0
  17. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +7 -2
  18. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +8 -0
  19. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +3 -0
  20. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
  21. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  22. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
  23. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
  24. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC-wire.md +18 -0
  25. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +3 -1
  26. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.proto +13 -0
  27. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC-wire.md +22 -0
  28. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +17 -0
  29. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.proto +13 -0
  30. package/payload/canon-kit/smoke/install.sh +1 -1
  31. package/payload/context-kit/README.md +6 -4
  32. package/payload/context-kit/SPEC.md +239 -70
  33. package/payload/context-kit/bin/always-loaded.sh +5 -21
  34. package/payload/context-kit/bin/env-probe.sh +2 -17
  35. package/payload/context-kit/checks/check-brevity.gate +3 -0
  36. package/payload/context-kit/checks/check-footprint-fresh.gate +3 -0
  37. package/payload/context-kit/checks/check-memory-off.gate +3 -0
  38. package/payload/context-kit/checks/check-settings-paths.gate +3 -0
  39. package/payload/context-kit/checks/check-settings-pins.gate +3 -0
  40. package/payload/context-kit/gate-tests/check-brevity.test.sh +3 -2
  41. package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/context-config.sh +4 -0
  42. package/payload/context-kit/gate-tests/check-memory-off/good/scripts/context-config.sh +4 -0
  43. package/payload/context-kit/gate-tests/check-memory-off.test.sh +18 -4
  44. package/payload/context-kit/gate-tests/check-settings-pins.test.sh +70 -0
  45. package/payload/context-kit/index-tests/expected/toolfloor.txt +5 -5
  46. package/payload/context-kit/index-tests/toolfloor-cases.sh +5 -5
  47. package/payload/context-kit/lib/context.sh +56 -0
  48. package/payload/context-kit/lib/toolfloor.sh +1 -1
  49. package/payload/context-kit/smoke/agents-md.sh +16 -4
  50. package/payload/context-kit/smoke/install.sh +3 -2
  51. package/payload/context-kit/templates/session-context.sh +5 -5
  52. package/payload/delegation-kit/SPEC.md +284 -9
  53. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +3 -0
  54. package/payload/delegation-kit/checks/check-gate-tamper.gate +3 -0
  55. package/payload/delegation-kit/checks/check-rule-citation.gate +3 -0
  56. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/added-exemptions +5 -0
  57. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +2 -0
  58. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +108 -0
  59. package/payload/delegation-kit/smoke/install.sh +1 -1
  60. package/payload/delegation-kit/templates/agent-execution.md +71 -4
  61. package/payload/doctrine-kit/SPEC.md +1 -1
  62. package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
  63. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -3
  64. package/payload/doctrine-kit/smoke/install.sh +17 -4
  65. package/payload/drift-kit/README.md +2 -2
  66. package/payload/drift-kit/SPEC.md +71 -7
  67. package/payload/drift-kit/bin/stage-economics.sh +1 -1
  68. package/payload/drift-kit/lib/drift.sh +43 -0
  69. package/payload/drift-kit/smoke/install.sh +21 -14
  70. package/payload/evidence-kit/README.md +3 -1
  71. package/payload/evidence-kit/SPEC.md +160 -19
  72. package/payload/evidence-kit/checks/check-battery-roster.gate +3 -0
  73. package/payload/evidence-kit/checks/check-evidence-baseline.gate +3 -0
  74. package/payload/evidence-kit/checks/check-evidence-manifest.gate +3 -0
  75. package/payload/evidence-kit/checks/check-producer-liveness.sh +42 -2
  76. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +4 -3
  77. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +8 -5
  78. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +1 -1
  79. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/evidence-config.sh +9 -0
  80. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +1 -1
  81. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/evidence-config.sh +9 -0
  82. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +6 -4
  83. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +42 -1
  84. package/payload/evidence-kit/lib/evidence.sh +2 -0
  85. package/payload/evidence-kit/smoke/install.sh +1 -1
  86. package/payload/gate-sdk/README.md +10 -7
  87. package/payload/gate-sdk/SPEC.md +3916 -265
  88. package/payload/gate-sdk/bin/install-hooks.sh +14 -2
  89. package/payload/gate-sdk/bin/port-blockers.sh +37 -9
  90. package/payload/gate-sdk/bin/run-gate-tests.sh +1 -2
  91. package/payload/gate-sdk/bin/run-gates.sh +22 -0
  92. package/payload/gate-sdk/bin/upgrade-smoke.sh +21 -16
  93. package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -0
  94. package/payload/gate-sdk/checks/check-commit-msg.gate +3 -0
  95. package/payload/gate-sdk/checks/check-commit-subject.gate +3 -0
  96. package/payload/gate-sdk/checks/check-core-files.gate +3 -0
  97. package/payload/gate-sdk/checks/check-crate-arms.sh +1 -0
  98. package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -0
  99. package/payload/gate-sdk/checks/check-exec-bit.gate +3 -0
  100. package/payload/gate-sdk/checks/check-gate-assertions.sh +1 -0
  101. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +3 -0
  102. package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +3 -0
  103. package/payload/gate-sdk/checks/check-gate-fail-closed.gate +3 -0
  104. package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +3 -0
  105. package/payload/gate-sdk/checks/check-gate-output.gate +3 -0
  106. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +78 -14
  107. package/payload/gate-sdk/checks/check-graph.gate +3 -0
  108. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +3 -0
  109. package/payload/gate-sdk/checks/check-identity.gate +3 -0
  110. package/payload/gate-sdk/checks/check-install-disposition.sh +1 -0
  111. package/payload/gate-sdk/checks/check-kit-enum.gate +3 -0
  112. package/payload/gate-sdk/checks/check-readme-roster.gate +3 -0
  113. package/payload/gate-sdk/checks/check-reads-couples.gate +3 -0
  114. package/payload/gate-sdk/checks/check-root-tiering.gate +3 -0
  115. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  116. package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
  117. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  118. package/payload/gate-sdk/checks/check-workflow-tiering.gate +3 -0
  119. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +17 -12
  120. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +4 -5
  121. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +2 -1
  122. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +2 -1
  123. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +3 -0
  124. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -1
  125. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +3 -4
  126. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +26 -4
  127. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +6 -1
  128. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +2 -0
  129. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored-descriptor.gate +4 -0
  130. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored.sh +14 -0
  131. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +4 -0
  132. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-held.sh +8 -0
  133. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +8 -1
  134. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +3 -0
  135. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored-descriptor.gate +4 -0
  136. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored.sh +14 -0
  137. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +4 -0
  138. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-held.sh +8 -0
  139. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +77 -0
  140. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +4 -5
  141. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +7 -0
  142. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +1 -0
  143. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-bare.sh +4 -0
  144. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-both.sh +5 -0
  145. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-heldtwice.sh +5 -0
  146. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +2 -0
  147. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twice.sh +5 -0
  148. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +4 -0
  149. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  150. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +1 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +4 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +49 -4
  154. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +15 -5
  155. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +12 -0
  156. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +27 -5
  157. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +12 -0
  158. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +5 -4
  159. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +14 -12
  160. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +43 -17
  161. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +190 -0
  162. package/payload/gate-sdk/gate-tests/check-identity/bad/gh-hosts.yml +9 -0
  163. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -2
  164. package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/gate-sdk-config.sh +10 -0
  165. package/payload/gate-sdk/gate-tests/check-identity/good/gh-hosts.yml +11 -0
  166. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -1
  167. package/payload/gate-sdk/gate-tests/check-identity/good/scripts/gate-sdk-config.sh +10 -0
  168. package/payload/gate-sdk/gate-tests/check-identity.test.sh +114 -0
  169. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-native-sample.gate +3 -0
  170. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -1
  171. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-native-sample.gate +3 -0
  172. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  173. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +5 -2
  174. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +3 -1
  175. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/README.md +15 -0
  176. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-one.gate +2 -0
  177. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-two.sh +3 -0
  178. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +3 -1
  179. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +1 -1
  180. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +3 -1
  181. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/README.md +13 -0
  182. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/checks/check-delta-one.gate +2 -0
  183. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/README.md +14 -0
  184. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-one.sh +3 -0
  185. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-two.gate +2 -0
  186. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +1 -1
  187. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +87 -89
  188. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +4 -0
  189. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +56 -0
  190. package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +211 -0
  191. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +16 -15
  192. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +94 -1
  193. package/payload/gate-sdk/lib/gate.sh +232 -25
  194. package/payload/gate-sdk/smoke/install.sh +5 -1
  195. package/payload/guard-kit/SPEC.md +207 -28
  196. package/payload/guard-kit/bin/run-guard-tests.sh +6 -1
  197. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
  198. package/payload/guard-kit/guard-tests/cases.tsv +37 -9
  199. package/payload/guard-kit/lib/guard.sh +170 -6
  200. package/payload/lifecycle-kit/README.md +3 -2
  201. package/payload/lifecycle-kit/SPEC.md +507 -75
  202. package/payload/lifecycle-kit/bin/enter-stage.sh +72 -33
  203. package/payload/lifecycle-kit/bin/file-gap.sh +2 -2
  204. package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
  205. package/payload/lifecycle-kit/checks/check-stage-entry.gate +3 -0
  206. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +4 -4
  207. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -1
  208. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +3 -3
  209. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +3 -3
  210. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +22 -22
  211. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +2 -2
  212. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +2 -2
  213. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +120 -10
  214. package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
  215. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +11 -11
  216. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
  217. package/payload/lifecycle-kit/lib/stages.sh +5 -0
  218. package/payload/lifecycle-kit/smoke/install.sh +29 -15
  219. package/payload/lifecycle-kit/templates/lead.md +24 -0
  220. package/payload/lifecycle-kit/templates/stages/align.md +20 -2
  221. package/payload/lifecycle-kit/templates/stages/build.md +3 -3
  222. package/payload/lifecycle-kit/templates/stages/close.md +20 -6
  223. package/payload/lifecycle-kit/templates/stages/scope.md +20 -1
  224. package/payload/lifecycle-kit/templates/stages/spec.md +1 -1
  225. package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
  226. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +1 -1
  227. package/payload/queue-kit/README.md +10 -10
  228. package/payload/queue-kit/SPEC.md +301 -84
  229. package/payload/queue-kit/bin/queue-counts.sh +1 -1
  230. package/payload/queue-kit/checks/check-queue-entry-budget.gate +1 -1
  231. package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
  232. package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -0
  233. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +15 -0
  234. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +2 -0
  235. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +7 -0
  236. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +4 -0
  237. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -1
  238. package/payload/queue-kit/gate-tests/queue-counts.test.sh +1 -1
  239. package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
  240. package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
  241. package/payload/queue-kit/lib/queue.sh +0 -49
  242. package/payload/queue-kit/smoke/install.sh +1 -1
  243. package/payload/site-kit/SPEC.md +29 -2
  244. package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
  245. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  246. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +5 -4
  247. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +6 -5
  248. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/checks/check-sample.gate +3 -0
  249. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -1
  250. package/payload/site-kit/smoke/install.sh +1 -1
  251. package/payload/canon-kit/checks/check-amendment-queue.sh +0 -117
  252. package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -79
  253. package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -240
  254. package/payload/canon-kit/checks/check-prose-tells.sh +0 -208
  255. package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -134
  256. package/payload/context-kit/bin/footprint.sh +0 -144
  257. package/payload/context-kit/checks/check-brevity.sh +0 -124
  258. package/payload/context-kit/checks/check-footprint-fresh.sh +0 -39
  259. package/payload/context-kit/checks/check-memory-off.sh +0 -113
  260. package/payload/context-kit/checks/check-settings-paths.sh +0 -94
  261. package/payload/context-kit/checks/check-settings-pins.sh +0 -111
  262. package/payload/context-kit/gate-tests/check-memory-off/bad/args +0 -1
  263. package/payload/context-kit/gate-tests/check-memory-off/good/args +0 -1
  264. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -62
  265. package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -140
  266. package/payload/delegation-kit/checks/check-rule-citation.sh +0 -77
  267. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -246
  268. package/payload/drift-kit/bin/trajectory.sh +0 -242
  269. package/payload/evidence-kit/checks/check-battery-roster.sh +0 -87
  270. package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -104
  271. package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -105
  272. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +0 -3
  273. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +0 -3
  274. package/payload/gate-sdk/bin/enforcement-map.sh +0 -273
  275. package/payload/gate-sdk/checks/check-commit-msg.sh +0 -51
  276. package/payload/gate-sdk/checks/check-commit-subject.sh +0 -44
  277. package/payload/gate-sdk/checks/check-core-files.sh +0 -76
  278. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -38
  279. package/payload/gate-sdk/checks/check-exec-bit.sh +0 -96
  280. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -107
  281. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -106
  282. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -85
  283. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -93
  284. package/payload/gate-sdk/checks/check-gate-output.sh +0 -103
  285. package/payload/gate-sdk/checks/check-graph.sh +0 -632
  286. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -46
  287. package/payload/gate-sdk/checks/check-identity.sh +0 -135
  288. package/payload/gate-sdk/checks/check-kit-enum.sh +0 -95
  289. package/payload/gate-sdk/checks/check-readme-roster.sh +0 -108
  290. package/payload/gate-sdk/checks/check-reads-couples.sh +0 -200
  291. package/payload/gate-sdk/checks/check-root-tiering.sh +0 -67
  292. package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -127
  293. package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -85
  294. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +0 -1
  295. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +0 -1
  296. package/payload/gate-sdk/gate-tests/check-identity/bad/args +0 -1
  297. package/payload/gate-sdk/gate-tests/check-identity/good/args +0 -1
  298. package/payload/lifecycle-kit/bin/close-surfaces.sh +0 -94
  299. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +0 -64
  300. package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -198
  301. package/payload/queue-kit/bin/queue-index.sh +0 -182
  302. package/payload/queue-kit/bin/roadmap.sh +0 -76
  303. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +0 -64
  304. package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -111
  305. package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -81
  306. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/{gates → scripts}/check-sample.sh +0 -0
  307. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/{gates → scripts}/check-sample.sh +0 -0
  308. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{check-gamma.sh → scripts/check-gamma.sh} +0 -0
  309. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  310. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  311. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gates.list → scripts/gates.list} +0 -0
  312. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{check-beta.sh → scripts/check-beta.sh} +0 -0
  313. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  314. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  315. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gates.list → scripts/gates.list} +0 -0
  316. /package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/{site-config.sh → scripts/site-config.sh} +0 -0
  317. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/CNAME +0 -0
  318. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/index.md +0 -0
  319. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/docs → docs}/posts/2026-01-01-legacy.md +0 -0
  320. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/pkg → pkg}/gate-tests/fixture.md +0 -0
  321. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{site-config.sh → scripts/site-config.sh} +0 -0
@@ -132,7 +132,7 @@ Primitives a consumer guard composes; each emits the harness's
132
132
  the string matches a committed allow pattern, with the harness `:*` prefix
133
133
  idiom (`Bash(printf:*)` ≡ any `printf …`) normalized to a trailing `*`. Not a
134
134
  hook primitive — a shared helper, one implementation behind
135
- compare-settings-allow's redundancy detection and rule 14's silent-grant
135
+ compare-settings-allow's redundancy detection and rule 17's silent-grant
136
136
  guard so the two never drift.
137
137
  - `guard_skeleton <cmd> <inert-class>…` — the context-aware normalizer, and the
138
138
  only place a rule learns what part of a command is live. It returns the command
@@ -151,7 +151,7 @@ Primitives a consumer guard composes; each emits the harness's
151
151
  - `guard_split_compound <skeleton>` — the compound splitter: emits one segment
152
152
  per line, splitting on the harness's statement separators (`;`, `&&`, `||`,
153
153
  `|`). Also not a hook primitive — the single implementation every consumer
154
- that reasons *per segment* shares (rules 8/13/14/16, the read-compound
154
+ that reasons *per segment* shares (rules 8/12/14/16/17/19, the read-compound
155
155
  carve-out of rules 9/10, and scan-prompts' `allowed()`), so the harness's
156
156
  per-segment matching surface is modelled in exactly one place and cannot drift
157
157
  between them. Fed a `guard_skeleton` view, so a separator inside a quoted
@@ -185,12 +185,22 @@ stays live, which is the conservative direction. And the normalizer models **quo
185
185
  shell semantics**: a construct that survives its scan and is not one of the three
186
186
  classes is treated as live, the fail-toward-matching direction and the one a
187
187
  guard should err in. That bound is why the command/process-substitution and
188
- backtick tests in rules 9, 10, 11, 13 and 16 read the **raw** command rather than
188
+ backtick tests in rules 9, 10, 11, 12, 13, 14, 16 and 19 read the **raw** command
189
+ rather than
189
190
  a skeleton and must keep doing so — a `"$(…)"` inside double quotes still
190
191
  executes, so a rule that declared `dq` inert for *that* test would hand an
191
192
  auto-allow to a command substitution it could not see. Those tests are
192
- conservative declines, not verdict matching; every rule that reaches a verdict
193
- reaches it off a skeleton.
193
+ conservative declines, not verdict matching.
194
+
195
+ **Rule 12 is the one rule that reaches its verdict off the raw command, and the
196
+ exception is forced rather than chosen.** Its predicate is *the pattern literal
197
+ `-f` will scan argv for*, and a skeleton replaces exactly that literal with a
198
+ placeholder — the quoted operand is the normal spelling — so a skeleton view
199
+ would blind the rule to the only thing it tests. It pays for the exception in the
200
+ same conservative direction every other clause takes: it declines outright on any
201
+ expansion, substitution or backtick (rule 6 blocks those shapes anyway), and a
202
+ pattern operand carrying a stray quote — the evidence that the compound split
203
+ landed *inside* a quoted span — declines rather than guesses at the operand.
194
204
 
195
205
  **The payload carries the live permission mode, and no accessor above reads it.**
196
206
  `PreToolUse` delivers `permission_mode` alongside the fields
@@ -255,11 +265,53 @@ and names none. What a project blocks or steers is its own toolchain knowledge
255
265
  and stays in its copy, which is why the copy legitimately diverges from the
256
266
  template here and why no rule content crosses into the kit.
257
267
 
268
+ **Placement is a verification decision before it is a seam one, and this is the
269
+ sentence that makes the contract usable.** The generic lane carries §Testing's
270
+ decision-table obligation — every rule there owes a firing and a non-firing case,
271
+ and the table is the only instrument that reads a *block* at all. The consumer
272
+ lane carries none: a rule in a consumer's copy is reachable by no table in this
273
+ kit, so it ships hand-verified and its narrowing cannot be measured. A rule that
274
+ qualifies for either lane therefore belongs in the generic one. That a consumer's
275
+ own rules have no verification lane at all is a real gap and a separate one; it
276
+ is named here rather than solved, since solving it designs a testing lane for
277
+ consumer copies.
278
+
258
279
  ## The generic ruleset
259
280
 
260
- Rules that encode **harness behavior**, not any project's toolchain —
261
- shipped as `lib/guard.sh` functions the template guard invokes. Order is
262
- load-bearing where noted.
281
+ Rules that encode **harness behavior, shell-substrate behavior, or behavior over
282
+ an artifact whose grammar a kit owns**, never any project's toolchain — shipped
283
+ as `lib/guard.sh` functions the template guard invokes. Order is load-bearing
284
+ where noted.
285
+
286
+ **The clause has taken two widenings, and each is recorded with the rule that
287
+ forced it, because a rule slipped in unremarked is what would rot it.**
288
+
289
+ - **The shell-substrate half was added for rule 12, and it admits nothing a
290
+ project owns.** A `-f` pattern match seeing the matcher's own argv is a
291
+ property of the shell substrate every consumer of this kit runs on — neither
292
+ harness behavior nor any project's toolchain — so the narrower sentence left
293
+ it in a gap it had no reason to leave.
294
+ - **The kit-artifact half was added for rule 14, and it takes the same form and
295
+ passes the same test.** Rule 14 is neither of the two earlier classes as they
296
+ were written: what it reads is evidence-kit's `pid=<n> run=<key>` record and
297
+ the OS's process table. It interprets **no project vocabulary at all** — it
298
+ reads a PID and asks whether it is alive — so the test rule 12's widening had
299
+ to pass is the test this one passes: **it admits nothing a project owns**. A
300
+ kit's own artifact grammar is shipped mechanism, which is exactly what
301
+ CLAUDE.md §The provenance seam distinguishes from private rule content.
302
+
303
+ A project's toolchain stays out on the same words as before, under both.
304
+
305
+ **Naming one harness's forms in a corrective costs portability, not privacy, and
306
+ the cost is recorded rather than pre-paid.** Rule 13's block message names a
307
+ backgrounded condition wait and the harness's event-stream form, because a
308
+ corrective that named neither would be unfollowable. A harness tool name is
309
+ public, documented, and shared by every consumer of that harness, so it is not
310
+ private rule content and the provenance seam — a privacy boundary over private
311
+ vocabularies (CLAUDE.md §The provenance seam) — does not reach it. What such a
312
+ literal does cost is portability: a second harness with different form names is
313
+ what would force these into a configurable slot, and building that slot before
314
+ that harness exists would be designing against no case.
263
315
 
264
316
  1. **`cd` in a compound command** — blocked: cwd drift, plus a compound the
265
317
  allowlist cannot match, so the call is decided out of band. Corrective form:
@@ -338,7 +390,7 @@ load-bearing where noted.
338
390
  so `-e`/`-f` consume their argument and the first bare operand is the script
339
391
  — a *second* bare operand is the file that fires the rule. **Placed before
340
392
  both auto-allow rules:** a consumer that widens `GUARD_KIT_RO_BINS` with
341
- `sed` would otherwise have rule 13 silently grant an in-place rewrite.
393
+ `sed` would otherwise have rule 16 silently grant an in-place rewrite.
342
394
  9. **Listing-only `find`** — a bare `find` that only lists is blocked with
343
395
  the steer to the harness's Glob tool (the same shape as rule 8's `sed`
344
396
  read-steer: a better tool exists, and Glob returns paths registered for a
@@ -351,7 +403,7 @@ load-bearing where noted.
351
403
  batch of independent listings, exactly what the Glob steer collapses into one
352
404
  call. A literal `echo`/`printf` banner segment between them is the natural
353
405
  separator of such a batch and is tolerated; at least one segment must be a
354
- listing. A piped `find` is a legitimate producer (rule 13 may still
406
+ listing. A piped `find` is a legitimate producer (rule 16 may still
355
407
  auto-allow it), an action-predicate `find` is an executor, a redirected
356
408
  `find` has a downstream reader, and a **mixed** compound (a segment that is
357
409
  neither a listing nor a banner) all pass untouched. **Placed before both
@@ -393,14 +445,132 @@ load-bearing where noted.
393
445
  this rule (the consumer disqualifies it). Conservative by construction: an
394
446
  unrecognized option-with-argument or a glued pattern flag biases toward
395
447
  passing, never a false steer of a history search.
396
- 12. **Auto-allow `: > file` truncation** — a leading `:` plus redirect
448
+ 12. **Self-matching process-liveness predicate** — a `pgrep`/`pkill -f` whose
449
+ pattern literal the command's own text repeats is **blocked**. `-f` matches
450
+ against full argv, and the waiter's own argv — the harness's wrapper included
451
+ — carries that literal, so `until ! pgrep -f '<script>'; do …; done` has a
452
+ permanently-true condition and never exits. It reds nothing: the work
453
+ completes correctly and the only symptom is the foreground cap absorbing an
454
+ unbounded loop, which reads from outside as a fixed cap-length wait. Fires on
455
+ the conjunction no allowlist glob expresses: a segment whose **command word**
456
+ is `pgrep` or `pkill` — read past a leading `until`/`while`/`if`/`!`, which do
457
+ not change which binary runs, so the loop-headed spelling the rule exists for
458
+ is reached — carrying `-f` (bare or bundled in a short cluster), whose pattern
459
+ operand is a literal occurring **elsewhere** in the same command. The
460
+ corrective names both sanctioned forms: wait on the work's own artifact, or
461
+ `kill -0` against a **recorded PID** where liveness genuinely is the condition
462
+ — whoever started that producer, a child the session backgrounded itself
463
+ included, whose PID it recorded at launch as a `<key>.run` record under its
464
+ scratch directory. That clause is owned by
465
+ delegation-kit/SPEC.md §The delegation model and this text carries it, the
466
+ record's naming convention included — rule 14 reads that same set, so a
467
+ corrective that named the PID but not where it lives would send a blocked
468
+ session to write the one artifact shape neither reader can find.
469
+ A PID is an identity; a pattern is a
470
+ guess about a process table that includes the guesser. The refusal of the
471
+ bracket-trick repair as the *sanctioned* form is delegation-kit's ruling and
472
+ its grounds live there (delegation-kit/SPEC.md §The delegation model); this
473
+ rule exists because a correct form one character from an incorrect one will be
474
+ got wrong. Conservative by construction, in this ruleset's established
475
+ directions: an expansion or substitution anywhere in the command declines
476
+ outright (rule 6 already blocks those shapes); a `pgrep` without `-f` matches
477
+ process **names** rather than argv and is untouched; an unrecognized option, an
478
+ option whose argument cannot be walked, or a second bare operand declines; and
479
+ a pattern occurring nowhere else in the command is a genuine query and passes.
480
+ Each biases toward passing rather than toward a false block. **Placed with the
481
+ read-steer rules and before both auto-allow rules**, on rule 8's stated
482
+ reasoning: `pgrep` is a plausible member of a widened `GUARD_KIT_RO_BINS` — it
483
+ is, after all, a read-only query — and a consumer who added it would otherwise
484
+ have rule 16 silently bless a waiter that can never exit.
485
+ 13. **Bare foreground `sleep`** — a `sleep` standing in for a wait is
486
+ **blocked**, and the discriminator is the whole rule: a blanket `sleep` block
487
+ is wrong and is refused. The sanctioned wait *is* a condition loop, and
488
+ `until <cond>; do sleep N; done` is expressly legitimate. So the rule fires on
489
+ exactly one shape — a bare foreground `sleep` in command position, outside
490
+ every loop wrapper — and never on a `sleep` inside a loop body. *The
491
+ discriminator is new territory:* no other rule in this ruleset parses shell
492
+ keywords. This one takes the skeleton view (so a `sleep` merely *named* in a
493
+ quoted span or a heredoc body is already inert), then walks it for `do … done`
494
+ spans and treats a `sleep` inside one as **inert** — structurally the carve-out
495
+ `_guard_is_banner` already performs for `echo`/`printf` segments in the batched-read
496
+ rules, applied to a keyword span instead of a segment. A `sleep` outside every
497
+ such span fires. Where the wrapper cannot be resolved — an unbalanced `do`/`done`,
498
+ or a span the rule cannot attribute — it **declines**, the direction every
499
+ other conservative clause here takes; a `sleep` that is an *argument* rather
500
+ than a command word never fires at all. **Blocks** rather than advises, on
501
+ rule 17's reasoning: no consumer allowlist is presumed to grant a bare
502
+ `sleep`, so the rule fires on a command that would be decided out of band
503
+ anyway and converts that decision into a durable steer at no extra cost. *The
504
+ corrective names the property and both forms* rather than one spelling: a wait
505
+ must end when its condition goes true, not when a duration expires; a
506
+ backgrounded command that *exits* on the condition fires one notification the
507
+ moment the condition holds, while the harness's event-stream form stays armed
508
+ to its deadline even after its event fires and is therefore the wrong tool for
509
+ a single completion. Naming one form teaches a spelling; naming the property
510
+ and sorting both under it teaches the rule — the discriminator is owned by
511
+ delegation-kit/SPEC.md §The delegation model. **Placed with rule 12, before both
512
+ auto-allow rules,** for the same reason: `sleep` is not on the default
513
+ read-only roster, but the placement argument is about what a consumer may add
514
+ and the whole family of steer rules already sits there.
515
+ 14. **Tracked-tree mutation under a live producer** — a `git` command that
516
+ writes the index, the worktree or a ref is **blocked** while a `*.run`
517
+ record under a `GUARD_KIT_SCRATCH_DIRS` member names a live PID. The record
518
+ is the launch-time liveness record a session writes when it backgrounds a
519
+ shell child (delegation-kit/SPEC.md §The delegation model owns that rule;
520
+ evidence-kit/SPEC.md §The producer-liveness lock owns the `pid=<n>
521
+ run=<key>` grammar and the PID predicate, and neither is re-decided here).
522
+ **The act set is bounded and named rather than gestured at**: `add`,
523
+ `commit`, `rm`, `mv`, `restore`, `checkout`, `switch`, `reset`, `stash`,
524
+ `merge`, `rebase`, `cherry-pick`, `revert`, `apply`, `am`, `clean`.
525
+ Read-only git — `status`, `log`, `diff`, `show`, `rev-parse`, `ls-files` —
526
+ passes, and so does every non-`git` command. **`Write`/`Edit` are
527
+ deliberately outside the rule**: a mutating session's mandated journal write
528
+ lands through them and the scratch directory is gitignored, so a rule
529
+ reaching them would refuse the very mechanic the resume-journal contract
530
+ requires *while a wait is in progress*.
531
+ **This is the enforcement half of the waiting rule, and it works by
532
+ relocation.** The turn-end itself passes no chokepoint and stays unreachable
533
+ (delegation-kit/SPEC.md §Operative residency); the **harm** it causes
534
+ arrives as an ordinary tool call at a chokepoint already wired, which is
535
+ what this rule fires on.
536
+ **Why the block is right even though it over-reaches, stated rather than
537
+ softened.** A read-only producer takes no harm from a commit, and the record
538
+ cannot say which kind it is. This ruleset's established direction is to bias
539
+ toward passing; that direction is **not** taken here, and the ground is that
540
+ the biased-toward-passing reading is what has failed every time this rule
541
+ fired. The corrective is cheap and names both exits: **wait for the producer
542
+ on its own artifact, or delete the record if the producer is done** — and
543
+ deleting a record whose producer has exited is not a workaround, it is the
544
+ statement of fact becoming false and being retracted.
545
+ **Conservative in this ruleset's other established directions**, which are
546
+ kept: an expansion or substitution anywhere in the command declines outright
547
+ (rule 6 already blocks those shapes); a record that does not parse declines
548
+ rather than blocks, because a guard is not the place a corruption verdict is
549
+ taken and `check-producer-liveness` already exits 2 on one; git's global
550
+ options are walked so `git -C <dir> commit` is reached, but an option the
551
+ walk does not recognize declines rather than guess which token is the
552
+ subcommand; and an unrecognized `git` subcommand declines. Each biases
553
+ toward passing rather than toward a false block, which is the calibration
554
+ the previous paragraph departs from **only** on the read-only producer.
555
+ **Placed with rules 12 and 13, before every auto-allow rule.** It is the
556
+ third member of the wait-discipline family and inherits their placement
557
+ argument (`git` is not on the default `GUARD_KIT_RO_BINS` roster, but a
558
+ consumer that widened it would otherwise have the read-only-pipeline rule
559
+ silently grant the mutation). **Two collisions make the placement necessary
560
+ rather than tidy**, and both are with rules that sit *after* the
561
+ auto-allows: rule 17 would block a chained `git commit` first and hand back
562
+ *run it bare* — a corrective that is wrong under a live producer and that
563
+ the session can follow; and rule 18 **advises** on `git commit --amend`, so
564
+ a rewrite under a live producer would proceed with a re-verification steer
565
+ instead of stopping.
566
+ 15. **Auto-allow `: > file` truncation** — a leading `:` plus redirect
397
567
  defeats the permission matcher, so it is always decided out of band. Granted
398
568
  silently when the command is *only* `:` followed by redirects and every target is
399
569
  gitignored (`git check-ignore`): truncating scratch is safe; a tracked
400
570
  file must still take that decision. The `git` subprocess is gated behind the rare
401
571
  `:`-redirect match; expansions (rule 6) and brace forms (rule 7) are
402
572
  already blocked, so a surviving target is a literal path.
403
- 13. **Auto-allow read-only pipeline** — granted silently when every pipe
573
+ 16. **Auto-allow read-only pipeline** — granted silently when every pipe
404
574
  segment leads with a roster binary (`GUARD_KIT_RO_BINS`, default the
405
575
  grep/head/cat/find/jq family) and every redirect target is `/dev/null`
406
576
  or an fd-dup. Declares `sq dq hd`. Conservative by construction:
@@ -428,7 +598,7 @@ load-bearing where noted.
428
598
  least one non-banner roster segment must remain, so a banner-only pipeline
429
599
  is not granted.
430
600
  - **The lead segment may instead be a bare committed allow entry** — an
431
- exact `Bash(<cmd>)` with no glob, on rule 14's own reasoning that a
601
+ exact `Bash(<cmd>)` with no glob, on rule 17's own reasoning that a
432
602
  glob-headed family coexists with allowlisted decorators and would admit
433
603
  far more than the reviewed command. The shape this repairs is an
434
604
  allowlisted script piped into `head`: the lead is statically allowlisted,
@@ -442,7 +612,7 @@ load-bearing where noted.
442
612
  exactly as it behaves without it. A grant that depends on a settings read
443
613
  must never turn a missing settings file into a grant, and declining is the
444
614
  only direction that cannot.
445
- 14. **Decorated allowlisted command** — the leading command exactly matches a
615
+ 17. **Decorated allowlisted command** — the leading command exactly matches a
446
616
  committed **bare** allow entry (a `Bash(<cmd>)` with no `:*`/`*` glob) but
447
617
  the command decorates it — `&&`/`;`/`|` chaining, a trailing redirect, or
448
618
  `2>&1` — which leaves a segment nothing grants, so the whole call falls off
@@ -462,17 +632,17 @@ load-bearing where noted.
462
632
  allow entry, reusing `guard_allow_match`'s shell-glob semantics. Reads
463
633
  `GUARD_KIT_SETTINGS`; **fail-open** — no `jq`, no settings file, or a
464
634
  parse error and the rule silently declines and falls through. Placed after
465
- the auto-allow rules (12, 13) so a silently granted read-only pipeline never
466
- reaches it — which is also **why the allowlisted-lead grant lives in rule 13
635
+ the auto-allow rules (15, 16) so a silently granted read-only pipeline never
636
+ reaches it — which is also **why the allowlisted-lead grant lives in rule 16
467
637
  and not here**. Grant, not fall-through, is what removes the friction of an
468
638
  allowlisted command decorated only by a read-only reduction of its own
469
639
  output, and this rule's own text refuses to grant, correctly: granting here
470
- would bless segments the allowlist never reviewed. Rule 13 is already the
640
+ would bless segments the allowlist never reviewed. Rule 16 is already the
471
641
  sanctioned place for a grant of exactly that shape and is already ordered
472
642
  ahead of this rule, so a granted pipeline never arrives and nothing
473
643
  ungranted becomes granted that either half would not have granted alone.
474
644
  Declares `sq dq hd`.
475
- 15. **Git history-rewrite advisory** — a `git commit` carrying `--amend`, `-F`,
645
+ 18. **Git history-rewrite advisory** — a `git commit` carrying `--amend`, `-F`,
476
646
  or `--file`, or a `git reset --soft`, gets a `guard_advise` steer carrying
477
647
  the checklist from DOCTRINE.md's *Re-verify volatile state before a git
478
648
  history rewrite* rule (verify HEAD before amend/squash; re-stage and verify
@@ -480,20 +650,22 @@ load-bearing where noted.
480
650
  this turn). Advisory, not a block: each is a legitimate command, so the rule
481
651
  injects the re-verification context and lets the command proceed. The
482
652
  DOCTRINE.md rule is cited by **name**, not number — the doctrine's craft
483
- rules renumber as it grows, and this ruleset carries its own rule 15, so a
484
- doc-qualified number would both rot on a renumber and read ambiguously
653
+ rules renumber as it grows, and this ruleset renumbers on its own account
654
+ too — this rule's own number moved when rules 12 and 13 were inserted ahead
655
+ of it, and again when rule 14 was — so a
656
+ doc-qualified number would rot on either renumber and read ambiguously
485
657
  against the local numbering. Placed
486
- after the auto-allow rules (12, 13) and the decorated-allowlist rule (14),
658
+ after the auto-allow rules (15, 16) and the decorated-allowlist rule (17),
487
659
  so it fires only on a bare rewrite command none of those claimed; a
488
- decorated form meets rule 14's block first and the advisory fires on the
660
+ decorated form meets rule 17's block first and the advisory fires on the
489
661
  re-issued bare command.
490
- 16. **Bare `rm` of a tracked path** — an `rm` statement naming a git-tracked
662
+ 19. **Bare `rm` of a tracked path** — an `rm` statement naming a git-tracked
491
663
  file (`git ls-files --error-unmatch`) is **blocked** with the steer to
492
664
  `git rm -q <path>`, which deletes and stages that one deletion in a single
493
665
  motion. The deletion is the point: a bare `rm` leaves it unstaged, so it
494
666
  lands only via a later `git add -A` — the form the shared-index discipline
495
667
  warns against, since it sweeps a concurrent session's foreign path into the
496
- commit. Block, not advise, on rule 14's reasoning: no consumer allowlist is
668
+ commit. Block, not advise, on rule 17's reasoning: no consumer allowlist is
497
669
  presumed to grant `rm`, so the rule fires on a command that would be decided
498
670
  out of band anyway and converts that decision into a durable steer. Fires per statement
499
671
  (`;`/`&&`/`||`/`|` split), so a decorated form steers on the same premise as
@@ -502,9 +674,16 @@ load-bearing where noted.
502
674
  tracked *directory* under `rm -r` does not match `--error-unmatch` — each
503
675
  biases toward passing rather than a false steer. An untracked or gitignored
504
676
  target never matches, so scratch deletion is untouched.
505
- 17. **Fall-through logging** — anything neither blocked nor auto-allowed is
677
+ 20. **Fall-through logging** — anything neither blocked nor auto-allowed is
506
678
  appended to the friction log. Always last; never affects the decision.
507
679
 
680
+ **Nothing above claims the sleep half was already enforced.** Before rule 13, no
681
+ rule in this ruleset enforced the never-poll rule's `sleep` half and rule 13 is
682
+ the first; whether a mechanism *outside* a consumer's tree blocks a foreground
683
+ `sleep` is an open question, unprobed as to cause, and no clause here rests a
684
+ coverage claim on one. The rule is built as though nothing outside the tree
685
+ enforced it — the only construction that is correct whichever way that resolves.
686
+
508
687
  ### Consumer rules
509
688
 
510
689
  Project rules — build-cache hygiene, container-build concurrency,
@@ -620,7 +799,7 @@ close-stage audit. A committed pattern subsumes a local entry when the
620
799
  local string matches it under shell-glob semantics; the harness `:*` prefix
621
800
  idiom (`Bash(printf:*)` ≡ any `printf …`) is normalized to a trailing `*`
622
801
  so one glob test covers both forms — the match core is `guard_allow_match`
623
- in `lib/guard.sh`, shared with rule 14. Read-only — reports candidates, never
802
+ in `lib/guard.sh`, shared with rule 17. Read-only — reports candidates, never
624
803
  mutates (the operator prunes). It is the detector, not the policy: a
625
804
  non-redundant local entry can still be one-off junk worth pruning by
626
805
  judgment.
@@ -790,9 +969,9 @@ repo's layout as defaults):
790
969
  consumer's vocabulary, never the kit's (CLAUDE.md §The provenance seam).
791
970
  - `GUARD_KIT_RO_SCRIPTS` — array of globs eligible for the
792
971
  absolute→relative rewrite (rule 4); default `("check-*.sh")`.
793
- - `GUARD_KIT_RO_BINS` — read-only pipeline roster (rule 13); default the
972
+ - `GUARD_KIT_RO_BINS` — read-only pipeline roster (rule 16); default the
794
973
  grep/head/cat/find/jq family, plus `xargs`, whose membership is qualified by
795
- rule 13's discriminator rather than granting on the leads-with test alone.
974
+ rule 16's discriminator rather than granting on the leads-with test alone.
796
975
  - `GUARD_KIT_SCRATCH_DIRS` — gitignored scratch dirs named in the
797
976
  rule-3 corrective message; default `(".tmp")`.
798
977
 
@@ -18,11 +18,16 @@ SANDBOX="$(mktemp -d)"
18
18
  trap 'rm -rf "$SANDBOX"' EXIT
19
19
  git -C "$SANDBOX" init -q
20
20
  printf 'scratch.txt\n.tmp/\nfriction.log\n' >"$SANDBOX/.gitignore"
21
- # spec: guard-kit/SPEC.md §The generic ruleset — rule 16 splits on tracked vs not, so the sandbox needs one of each
21
+ # spec: guard-kit/SPEC.md §The generic ruleset — rule 19 splits on tracked vs not, so the sandbox needs one of each
22
22
  printf 'tracked\n' >"$SANDBOX/tracked.md"
23
23
  printf 'scratch\n' >"$SANDBOX/scratch.txt"
24
24
  git -C "$SANDBOX" add tracked.md
25
25
 
26
+ # spec: guard-kit/SPEC.md §The generic ruleset — rule 14 reads '*.run' records under GUARD_KIT_SCRATCH_DIRS; the table's sandbox carries a dead-PID record and a non-record file beside it, so every mutating-git row below asserts the rule's decline arm rather than the vacuous absence of any record at all. The live arm needs a PID the test owns and lives in gate-tests/git-mutation-under-producer.test.sh.
27
+ mkdir -p "$SANDBOX/.tmp"
28
+ printf 'pid=2147483646 run=dead-producer\n' >"$SANDBOX/.tmp/dead-producer.run"
29
+ printf 'not a record\n' >"$SANDBOX/.tmp/notes.txt"
30
+
26
31
  mkdir -p "$SANDBOX/.claude"
27
32
  printf '%s\n' '{ "permissions": { "allow": ["Bash(git status)", "Bash(ls)", "Bash(printf:*)"] } }' \
28
33
  >"$SANDBOX/.claude/settings.json"
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env bash
2
+ # Direct unit test of lib/guard.sh's rule 14 — a tracked-tree mutation blocked
3
+ # while a recorded producer is still alive. The decision table cannot hold this
4
+ # rule's firing arm: its second conjunct is a *live* PID, and a sandbox carrying
5
+ # one would turn every other git row in that table into a block. The table keeps
6
+ # the decline arm (a dead record present); everything below needs a process the
7
+ # test itself owns.
8
+ #
9
+ # Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
10
+ set -uo pipefail
11
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
12
+
13
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # guard-kit/
14
+ # shellcheck source=../lib/guard.sh
15
+ source "$DIR/lib/guard.sh"
16
+
17
+ fails=0
18
+ checks=0
19
+ tmp="$(mktemp -d)"
20
+ live=""
21
+ cleanup() { [[ -n "$live" ]] && kill "$live" 2>/dev/null; rm -rf "$tmp"; }
22
+ trap cleanup EXIT
23
+
24
+ sleep 60 &
25
+ live=$!
26
+
27
+ mkdir -p "$tmp/scratch"
28
+ GUARD_KIT_SCRATCH_DIRS=("$tmp/scratch")
29
+
30
+ # guard_block exits 2, so each verdict is taken in a subshell: 2 = blocked,
31
+ # 0 = declined and fell through to the rules after it.
32
+ verdict() { ( guard_rule_git_mutation_under_producer "$1" ) >/dev/null 2>&1; echo $?; }
33
+
34
+ want() { # $1=label $2=command $3=want-rc
35
+ checks=$((checks + 1))
36
+ local got; got="$(verdict "$2")"
37
+ [[ "$got" == "$3" ]] || { echo " FAIL [$1]: '$2' gave rc=$got, want $3"; fails=$((fails + 1)); }
38
+ }
39
+
40
+ # --- no record at all: the rule is inert, whatever the command
41
+ want "empty-dir-commit" "git commit -m done" 0
42
+
43
+ # --- a record naming a dead pid is not a live producer
44
+ printf 'pid=2147483646 run=dead-run\n' >"$tmp/scratch/dead-run.run"
45
+ want "dead-record-commit" "git commit -m done" 0
46
+ want "dead-record-add" "git add -A" 0
47
+
48
+ # --- a live record: the whole named write set blocks
49
+ printf 'pid=%s run=validate-batch\n' "$live" >"$tmp/scratch/validate-batch.run"
50
+ for sub in add commit rm mv restore checkout switch reset stash merge rebase \
51
+ cherry-pick revert apply am clean; do
52
+ want "live-blocks-$sub" "git $sub" 2
53
+ done
54
+
55
+ # The corrective must name the blocking run so the reader can tell 'wait for
56
+ # that' from 'reclaim a record whose owner is gone'.
57
+ out="$( ( guard_rule_git_mutation_under_producer "git commit -m done" ) 2>&1 )"
58
+ checks=$((checks + 1))
59
+ if [[ "$out" != *"validate-batch"* || "$out" != *"$live"* ]]; then
60
+ echo " FAIL [names-the-run]: the block did not name the blocking run and pid: $out"
61
+ fails=$((fails + 1))
62
+ fi
63
+
64
+ # --- git's global options are walked, so a decorated invocation is still reached
65
+ want "global-C" "git -C . commit -m done" 2
66
+ want "global-c" "git -c user.name=x commit -m done" 2
67
+ want "global-no-pager" "git --no-pager stash" 2
68
+ want "global-glued" "git --git-dir=.git commit -m done" 2
69
+
70
+ # --- and a compound fires on the mutating segment wherever it sits
71
+ want "compound-tail" "make build; git commit -m done" 2
72
+
73
+ # --- read-only git passes: the harm is the mutation, not the producer's liveness
74
+ for sub in status log diff show rev-parse ls-files branch remote; do
75
+ want "readonly-$sub" "git $sub" 0
76
+ done
77
+ want "readonly-args" "git log --oneline -3" 0
78
+
79
+ # --- conservative in this ruleset's established directions
80
+ want "non-git" "make build" 0
81
+ want "unknown-subcmd" "git frobnicate --hard" 0
82
+ want "unknown-global" "git --frobnicate commit -m done" 0
83
+ want "expansion" "git commit -m \$MSG" 0
84
+ want "substitution" "git commit -m \$(date)" 0
85
+ want "backtick" 'git commit -m `date`' 0
86
+ # A mutating verb inside a quoted span is not a command: the skeleton view is
87
+ # what makes that true, and a rule reading the raw text would false-block here.
88
+ want "quoted-mention" "printf 'git commit -m x' >> notes.txt" 0
89
+
90
+ # --- a record that does not parse declines rather than blocks: a guard is not
91
+ # where a corruption verdict is taken (check-producer-liveness exits 2 on one)
92
+ rm -f "$tmp/scratch/validate-batch.run" "$tmp/scratch/dead-run.run"
93
+ printf 'garbage\n' >"$tmp/scratch/broken.run"
94
+ want "unparseable-record" "git commit -m done" 0
95
+
96
+ # --- and a file without the '.run' suffix is not a record at all
97
+ printf 'pid=%s run=not-a-record\n' "$live" >"$tmp/scratch/notes.txt"
98
+ want "suffix-bound" "git commit -m done" 0
99
+
100
+ if [[ "$fails" -gt 0 ]]; then
101
+ echo "git-mutation-under-producer.test: $fails of $checks assertion(s) failed"
102
+ exit 1
103
+ fi
104
+ echo "git-mutation-under-producer.test: ok ($checks assertions; the write set blocks under a live record, read-only git and every conservative direction decline)"
105
+ exit 0
@@ -40,8 +40,8 @@ fallthrough awk '$1' data.txt
40
40
  # cannot expand, and the shell is what guarantees that — so its body is inert
41
41
  block cat <<EOF > .tmp/n.md@NL@value is $(date)@NL@EOF
42
42
  fallthrough cat <<'EOF' > .tmp/n.md@NL@value is $(date)@NL@EOF
43
- # reaches rule 15's advisory, which is the correct verdict for a commit -F; the
44
- # point is that rule 6 no longer blocks it before rule 15 is ever consulted
43
+ # reaches rule 18's advisory, which is the correct verdict for a commit -F; the
44
+ # point is that rule 6 no longer blocks it before rule 18 is ever consulted
45
45
  advise git commit -F - <<'MSG'@NL@names a $(cmd) in the body@NL@MSG
46
46
 
47
47
  # rule 7 — unquoted brace glyph: bare {} placeholder rewritten, expansions blocked.
@@ -99,11 +99,39 @@ block git grep needle -- src
99
99
  fallthrough git grep foo HEAD
100
100
  fallthrough git grep --cached foo
101
101
 
102
- # rule 12 — `: > file` truncation auto-allowed iff every target is gitignored
102
+ # rule 12 — self-matching process-liveness predicate: a `pgrep -f` pattern the
103
+ # command's own text repeats can never go false, since `-f` scans the
104
+ # waiter's own argv. A lone query, a `pgrep` without `-f`, and a pattern
105
+ # occurring nowhere else are genuine queries and pass.
106
+ block bash run-smoke.sh & until ! pgrep -f run-smoke.sh; do sleep 5; done
107
+ block pkill -f run-smoke.sh; bash run-smoke.sh
108
+ fallthrough pgrep -f run-smoke.sh
109
+ fallthrough pgrep run-smoke.sh; bash run-smoke.sh
110
+
111
+ # rule 13 — bare foreground sleep steered to a condition wait. The non-firing
112
+ # cases are the load-bearing ones: a sleep inside an `until … do … done`
113
+ # loop *is* the sanctioned form, and a quoted mention is inert.
114
+ block sleep 30
115
+ block sleep 180; echo waited
116
+ fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done
117
+ fallthrough printf 'sleep 5' >> .tmp/note.txt
118
+
119
+ # rule 14 — tracked-tree mutation under a live producer. The sandbox's only
120
+ # `*.run` record names a dead pid and a non-record file sits beside
121
+ # it, so every mutating form below declines: the rule's second
122
+ # conjunct is a *live* record, and read-only git never reaches it at
123
+ # all. The block arm needs a pid the test owns and lives in
124
+ # gate-tests/git-mutation-under-producer.test.sh.
125
+ fallthrough git add tracked.md
126
+ fallthrough git stash
127
+ fallthrough git -C . commit -m done
128
+ fallthrough git rev-parse HEAD
129
+
130
+ # rule 15 — `: > file` truncation auto-allowed iff every target is gitignored
103
131
  allow : > scratch.txt
104
132
  fallthrough : > tracked.txt
105
133
 
106
- # rule 13 — read-only pipeline auto-allow; a non-roster segment falls through
134
+ # rule 16 — read-only pipeline auto-allow; a non-roster segment falls through
107
135
  allow grep -rn foo src | head
108
136
  fallthrough grep foo file | awk '{print}'
109
137
  # banner tolerance (rules 9 and 10's, third caller): a literal echo/printf
@@ -111,7 +139,7 @@ fallthrough grep foo file | awk '{print}'
111
139
  allow echo === | grep foo src
112
140
  fallthrough echo a | echo b
113
141
  # widened lead: a bare committed allow entry may lead, since it was reviewed —
114
- # but only where something decorates it, so the undecorated form (rule 14's
142
+ # but only where something decorates it, so the undecorated form (rule 17's
115
143
  # 'fallthrough git status' below) is still never intercepted here
116
144
  allow git status | head
117
145
  allow git status | head -20
@@ -128,7 +156,7 @@ fallthrough grep -rln foo src | xargs sed -i s/a/b/
128
156
  block ls | xargs chmod 777
129
157
  block ls | xargs xargs rm
130
158
 
131
- # rule 14 — decorated allowlisted bare lead with an unmatched segment blocked;
159
+ # rule 17 — decorated allowlisted bare lead with an unmatched segment blocked;
132
160
  # chaining steer, redirect steer, and the untouched non-firing cases
133
161
  block git status && rm -rf tmp
134
162
  block git status 2>&1
@@ -137,7 +165,7 @@ fallthrough frobnicate && git status
137
165
  fallthrough git status && ls
138
166
  fallthrough git status && printf done
139
167
 
140
- # rule 15 — git history-rewrite advisory: amend / commit -F / soft-reset steered;
168
+ # rule 18 — git history-rewrite advisory: amend / commit -F / soft-reset steered;
141
169
  # a plain commit and a non-soft reset pass
142
170
  advise git commit --amend
143
171
  advise git commit --amend --no-edit
@@ -146,7 +174,7 @@ advise git reset --soft HEAD~1
146
174
  fallthrough git commit -m done
147
175
  fallthrough git reset --hard HEAD~1
148
176
 
149
- # rule 16 — bare rm of a tracked path steers to 'git rm -q'; untracked,
177
+ # rule 19 — bare rm of a tracked path steers to 'git rm -q'; untracked,
150
178
  # gitignored, and the already-correct git rm form pass
151
179
  block rm tracked.md
152
180
  block rm -f tracked.md
@@ -155,5 +183,5 @@ fallthrough rm scratch.txt
155
183
  fallthrough rm untracked-nowhere.md
156
184
  fallthrough git rm -q tracked.md
157
185
 
158
- # rule 17 — anything else falls through to the friction log
186
+ # rule 20 — anything else falls through to the friction log
159
187
  fallthrough make build