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
@@ -81,6 +81,185 @@ template names the channel a dispatched role *does* have: an in-turn wait on the
81
81
  work's own artifact. This is the case where the backgrounding rule and the
82
82
  liveness hazard meet and neither, alone, covered it.
83
83
 
84
+ The template's **Background + notification, never poll** rule now carries a
85
+ *which primitive* clause, and that clause's residency here is a calibration
86
+ history. The template first named the harness's waiting primitive in the
87
+ singular while the harness offers two forms with opposite reactivity, so a
88
+ session picking one unaided picked by shape. Naming a form teaches a spelling;
89
+ naming the property a wait must have and sorting the forms under it teaches the
90
+ discriminator — a bound that is correctness rather than preference, because it
91
+ is what survives a harness adding a third form.
92
+
93
+ **Two waitable things, and only one of them has a path.** The template splits
94
+ what a session waits *on* and carries that mechanism itself. What is added here
95
+ is that the split is *complete* rather than merely convenient, because the
96
+ attested failure had no third case — and that the artifact's home is the resume
97
+ journal's own scoping widened rather than a second rule, so the survivability
98
+ grounds are stated once and cited twice.
99
+
100
+ **The shell branch names its artifact, and the naming is the substance.** The
101
+ split above left that branch pointing at *an artifact the session placed* without
102
+ saying which, so a session that wanted to comply had nothing to write, and of the
103
+ long-running shell producers a session might background, most publish no record of
104
+ any kind. The artifact is a **launch-time liveness record**: the child's PID,
105
+ captured by the launcher at the moment it backgrounds the child. The obvious
106
+ repair — have the child touch a file when it finishes and wait on that — is
107
+ refused, and the attested failure is exactly why: a completion marker answers *is
108
+ it done* **to a live observer**, and the failure case is the one where the
109
+ observer is gone. A liveness record answers *is it still running* **to whoever
110
+ arrives next**, which is a question a dead session's successor can still ask.
111
+
112
+ **The record's producer is the launcher, and the alternative is recorded as
113
+ refused rather than merely not chosen.** The alternative is per-producer
114
+ self-claiming — the producer-liveness lock's shape generalized so every
115
+ long-running producer claims its own record — and it fails on three counts. It
116
+ reaches only producers the consumer's own tree owns, where most backgrounded work
117
+ is an ad-hoc command composed at the call site. It puts the record's production in
118
+ the one process whose death is the event being detected, so a producer that dies
119
+ before claiming is invisible in exactly the window that matters. And it bills a
120
+ program for a property that belongs to the *launch* rather than to the program:
121
+ the same script backgrounded is in this class and run in the foreground is not.
122
+ The launcher, by contrast, knows the PID of anything it started, is the party that
123
+ needs to read it back, and is the only one present at the moment the class is
124
+ entered.
125
+
126
+ **The liveness clause widened rather than acquiring an exception, and its own
127
+ premise is what falsified it.** The clause sanctioned a recorded-PID match *where
128
+ liveness genuinely is the condition — a producer this session did not start*, and
129
+ that exclusion rested on an assumption: a session that started the producer was
130
+ taken to have a better instrument, namely its own artifact. The better instrument
131
+ requires a live reader, and the failure being fixed is the loss of the reader. So
132
+ the subject widens to cover a producer the session started **and backgrounded**,
133
+ and the widening is on the subject alone, never on the predicate — pattern-matched
134
+ liveness stays refused, and the bracket trick stays refused as the sanctioned
135
+ form on the grounds below.
136
+
137
+ **The record's grammar is evidence-kit's, and that is what makes the second reader
138
+ free.** There are two readers, and they are different parties at different
139
+ transitions: the **launching session**, in-turn, as its wait condition; and
140
+ **whoever arrives next**, which is the case the attested failure is actually
141
+ about, where the launcher is gone and something else must be able to tell that a
142
+ producer is still mutating shared files. Written in the one-line `pid=<n>
143
+ run=<key>` grammar the producer-liveness lock already carries, the record is a
144
+ legal subject for `check-producer-liveness` **unchanged** — that gate already
145
+ takes a record path and already reports exactly *is the producer named here still
146
+ running*, on a ruled exit contract. No new gate, no new tool, no new grammar, and
147
+ a reader already specified, already fixture-covered and already wired. An inverted
148
+ grammar would have bought a second implementation of a decided thing, which is the
149
+ only argument this needs; it is recorded because *a launch record is not a lock,
150
+ so it should have its own shape* is the reading a later session will reach for,
151
+ and the answer is that the two records carry the same field, answer the same
152
+ question, and differ only in who wrote them. How a PID's liveness is *decided*
153
+ stays evidence-kit's — the predicate, the PID-reuse residual and the refused TTL
154
+ are ruled in evidence-kit/SPEC.md §The producer-liveness lock and are not
155
+ seconded here. delegation-kit owns *when a session waits and on what*.
156
+
157
+ **The record's name is a convention, and what the convention buys is a derivable
158
+ set.** It is written as `<scratch-dir>/<key>.run`, carrying the same `pid=<n>
159
+ run=<key>` line — the filename's `<key>` is that record's own `run=` value, not
160
+ a third field. The grammar is untouched; what was missing is not the record's
161
+ shape but its **discoverability**. Without a convention the record's path is
162
+ known only to the session that wrote it and to whoever it happens to tell, so
163
+ the second reader named above — *whoever arrives next*, where the launcher is
164
+ gone — can read a record only by guessing its name. A suffix makes the set a
165
+ glob, and every reader that must ask *is anything still running here* reads the
166
+ set rather than a path: `check-producer-liveness`'s set mode
167
+ (evidence-kit/SPEC.md §check-producer-liveness), the stage-entry preflight
168
+ behind it, and guard-kit rule 14.
169
+
170
+ **`.run` rather than `.lock`, and the distinction is load-bearing.** A lock is
171
+ claimed and released by one owner and its absence means *free*;
172
+ `EVIDENCE_KIT_LOCK_FILE` is one and keeps its name. A launch record is a
173
+ **statement of fact left behind** — it answers *is it still running* to whoever
174
+ arrives next, a question a dead session's successor can still ask — and its
175
+ absence means *nothing was recorded*, never *nothing is running*. Two meanings,
176
+ two suffixes; and a consumer's scratch reset carries no `*.run` on its keep-list,
177
+ because a record surviving a work-unit boundary names a producer from the
178
+ previous one, which is precisely the stale statement the sweep exists to remove.
179
+
180
+ **Both affordances are refused, and the refusal's cost is bounded rather than
181
+ denied.** A tool to write the record and a second one to read it are declined: the
182
+ write is a PID captured at launch and the read is a single liveness match, each a
183
+ shell builtin away and both already spelled in the template, and a script whose
184
+ body is one builtin is the clearest case of the script-interpreter surface this
185
+ methodology shrinks. The generic reading affordance that would genuinely earn its
186
+ place already exists and is `check-producer-liveness`, which the grammar reuse
187
+ reaches without adding anything. What the refusal costs is stated rather than
188
+ hidden: an affordance would make the record's grammar impossible to get wrong, and
189
+ a hand-written one can be malformed. That failure is bounded by the consumer,
190
+ which exits **2** on a record it cannot parse, so a malformed record reads as
191
+ *could not be established* and never as *nothing running*.
192
+
193
+ **What the naming does not claim.** No gate enforces it, and the reason is
194
+ structural rather than budgetary: the subject is *did a session record a PID
195
+ before backgrounding*, and a session that skips the rule writes nothing, so there
196
+ is no absence a check could have been told to expect. The artifact-side backstop
197
+ stays the one §Operative residency already names — `check-producer-liveness` at a
198
+ stage entry, covering the **concurrent** case, a producer still live when the next
199
+ entry is stamped. Widening what that backstop may be pointed at does not make the
200
+ rule itself checkable. What the naming removes is a different failure: a session
201
+ that **wanted** to comply had no named artifact and was carved out of the only
202
+ clause that fit.
203
+
204
+ **The enforcement-design question is now answered, and the answer is a
205
+ relocation rather than a reversal.** *Given that prose alone does not hold, what
206
+ does* stood open here while the ruling above — the write is structurally
207
+ uncheckable — stayed true. It still is. What changed is the subject: the
208
+ **harm** a missed wait causes is not the turn-end but a tracked-tree mutation
209
+ under a live producer, and that arrives as an ordinary tool call at a
210
+ `PreToolUse` chokepoint, which is precisely the class §Operative residency says
211
+ the interception axis admits. It is enforced there, as guard-kit rule 14
212
+ (guard-kit/SPEC.md §The generic ruleset). The chokepoint ruling is confirmed by
213
+ this, not weakened.
214
+
215
+ **The claim ships with its bound, because a claim without one is the failure
216
+ this rule keeps re-earning.** The enforcement holds only for **a session that
217
+ recorded**. The paragraph above rules that the record's write is structurally
218
+ uncheckable — a session that skips the rule writes nothing, so there is no
219
+ absence a check could have been told to expect — so a session that backgrounds
220
+ without recording is invisible to rule 14 and to the entry preflight alike,
221
+ exactly as it is today. This narrows the failure to that residue rather than
222
+ closing it.
223
+
224
+ **Enforcing the record's *write* at the launch chokepoint is designed, refused,
225
+ and filed** — recorded here so a later session finds a ruling rather than a
226
+ blank. The candidate is a rule firing on the backgrounding call itself and
227
+ refusing one that writes no record, and the two backgrounding forms differ in a
228
+ guard's reach. A shell `&` is in the command text, which every rule in that
229
+ ruleset already reads, so that arm is buildable today. A harness's
230
+ background-this parameter is **tool input, not command text**, and whether it
231
+ reaches the `PreToolUse` payload is an empirical question about one field rather
232
+ than about the mechanism — a guard that reads non-headline `tool_input` fields
233
+ by `jq` path is already an attested shape. **Building only the `&` arm is
234
+ refused as worse than not building it**: every attested firing used the harness
235
+ form, so a rule covering only the shell spelling would block the form nobody
236
+ uses and pass the one that fires — coverage in appearance, an assertion about
237
+ nothing in fact. The probe it waits on is one backgrounded call through a guard
238
+ that records its payload, and that probe needs **no** permission- or hook-surface
239
+ change, because the `PreToolUse` command matcher is already wired.
240
+
241
+ **The guard interaction that produced it resolves without touching the guard.**
242
+ The attested sequence: a session reached for the correct artifact wait, spelled
243
+ it against the harness's own scratchpad path, and the consumer's bash guard
244
+ refused it and steered to repo-local scratch. The guard was **right** and needed
245
+ no change. What was missing is that the doctrine never said where an awaited
246
+ artifact belongs, so the refusal read as a refusal of artifact-waiting itself and
247
+ pushed the session onto the process-liveness form that then broke. With the split
248
+ above, a session waiting on an `Agent` never reaches for a path at all, and a
249
+ session waiting on a shell child has a path the guard already sanctions.
250
+
251
+ **The bracket trick is refused as the sanctioned form, and the grounds are here
252
+ because the template defers them here.** The template carries the mechanism —
253
+ why a process-liveness predicate can never go false, and the two sanctioned
254
+ repairs — and sends here the one question it does not answer: why the third,
255
+ `pgrep -f '[r]un-smoke.sh'`, is refused rather than passed over. It is the first
256
+ thing a reader reaches for and it *works*, so what disqualifies it is not correctness
257
+ but its failure mode: a spelling that must be remembered, whose omission is
258
+ invisible at the call site and whose cost when omitted is silent and expensive.
259
+ A rule whose correct form differs from its incorrect form by one character is a
260
+ rule that will be got wrong, which is why the enforcement half is a guard rule
261
+ over the shape (guard-kit/SPEC.md §The generic ruleset) rather than more prose.
262
+
84
263
  The template's **Findings you will act on are durable before you act on them**
85
264
  rule rests on a near-loss rather than a loss: a close stage dispatched two
86
265
  audit sweeps and then hit the session wall. Both had already returned, which
@@ -503,8 +682,52 @@ oracle where one is buildable. In the attested instance what caught the
503
682
  consequence was the artifact-side oracle below, with the prose already in its
504
683
  strengthened form.
505
684
 
506
- **No gate is owed, and not for budget.** No check can read a session's choice to
507
- end a turn — the act leaves no tracked artifact. The anti-restatement gates were
685
+ **The propagate obligation has fired, and the record names what it cost.** The
686
+ waiting rule changed — the primitive named by its reactivity property, the
687
+ awaited artifact given a home — and the template's *when either rule changes
688
+ here, propagate* header sent that change to both of its restatements in this
689
+ consumer's `.claude/agents/` definitions: one a stage-session type, one a
690
+ read-only sweep type. They did not carry the rule alike. One cited the bullet by
691
+ name and restated its wait mechanics at length; the other carried a single
692
+ turn-end line with no citation, no primitive and no home. **The target is
693
+ symmetric even where the starting text is not**, so propagation into the second
694
+ was a genuine addition sized to that file's own voice rather than a paste of the
695
+ first's paragraph — and neither absorbed the rejected-alternative reasoning,
696
+ which is (b)'s line and stays with this section's owner. Recorded because the
697
+ sanction's cost is exactly this: every rule it licenses acquires N carriers that
698
+ a later change must find, and a restatement that drifted *unevenly* is harder to
699
+ spot than one that drifted at all.
700
+
701
+ **The obligation fired again, and the second firing found a carrier the roster
702
+ did not hold.** The waiting rule changed once more — the shell-child branch named
703
+ its artifact, and the liveness clause widened past *a producer this session did
704
+ not start* — and propagation reached both `.claude/agents/` definitions as before.
705
+ It also reached a **third** carrier sitting outside this section's roster
706
+ entirely: guard-kit's self-matching-`pgrep` rule states the same clause verbatim
707
+ in the corrective help text it prints when it blocks, mirrored in prose in that
708
+ kit's own SPEC. Left alone, a guard-blocked session would read advice that
709
+ undersells what it may now do with its own backgrounded child — a restatement
710
+ whose reader arrives at the worst possible moment, already stopped and looking for
711
+ the sanctioned form. Recorded because of what found it: the clause's own wording,
712
+ grepped across the tree, and not this section's list of known carriers. The
713
+ sanction's cost is N carriers a later change must find, and N is discovered by
714
+ grepping the rule's phrasing rather than by consulting the roster — a roster is a
715
+ record of the carriers someone noticed, never a proof of the set.
716
+
717
+ **No gate is owed *over the act*, and not for budget — but one is now owed over
718
+ its harm, and it exists.** No check can read a session's choice to end a turn:
719
+ the act leaves no tracked artifact and passes no chokepoint, and that ruling
720
+ stands unamended. What the ruling never licensed was stopping there. The harm
721
+ the turn-end causes does pass a chokepoint — a tracked-tree mutation while a
722
+ recorded producer is still writing arrives as an ordinary tool call — and it is
723
+ blocked there by guard-kit rule 14 (guard-kit/SPEC.md §The generic ruleset,
724
+ whose design §The delegation model owns). So the enforcement question this
725
+ section left open is answered **by relocating the subject from the act to its
726
+ consequence**, and the honest bound travels with the answer: it reaches only a
727
+ session that recorded, since the record's write is itself structurally
728
+ uncheckable.
729
+
730
+ **The anti-restatement gates were**
508
731
  checked against a sanctioned restatement rather than assumed inert, since a
509
732
  sanction that required weakening a gate would be the wrong sanction:
510
733
  `check-shim-restatement` scans binding shims under the skills directory against a
@@ -514,9 +737,15 @@ agent definition is neither its scanned surface nor its corpus, and
514
737
  canonical SPEC surface, which reaches no agent definition either. The sanction
515
738
  therefore ships with **no gate exemption** — and the honest converse ships with
516
739
  it: nothing in the battery would catch a *non*-compliant restatement, so (a)–(c)
517
- are review-enforced. The nearest buildable oracle detects a *consequence* rather
518
- than the act — `check-producer-liveness` reads a producer still running at the
519
- next stage's entry (evidence-kit/SPEC.md §check-producer-liveness).
740
+ are review-enforced. Both buildable oracles detect a *consequence* rather than
741
+ the act, and they sit at different distances from it: guard-kit rule 14
742
+ **prevents** the consequence at the tool call that would cause it, and
743
+ `check-producer-liveness` **detects** a producer still running at the next
744
+ stage's entry (evidence-kit/SPEC.md §check-producer-liveness). The second
745
+ detects late by construction — the turns between the firing and that entry are
746
+ already spent, and a firing at the last stage of an iteration has no entry after
747
+ it — which is what makes it the backstop behind the first rather than a
748
+ substitute for it.
520
749
 
521
750
  **A case where an oracle *was* buildable now sits beside this one, and the two
522
751
  are not each other's contradiction.** The dispatch-shape rules bind acts
@@ -529,6 +758,13 @@ to stop looking for an oracle. Recorded here for the same reason §The
529
758
  delegation model records the durability rule beside the read-only-fan-out
530
759
  caveat: otherwise the next reader re-litigates one of the two paragraphs.
531
760
 
761
+ **That last sentence was cashed rather than left standing.** The search it
762
+ licensed found one: the turn-end is still unreachable, but the mutation it
763
+ enables is a `PreToolUse` call, and rule 14 fires there. Recorded because a
764
+ sentence saying *keep looking* is cheap to write and easy to leave un-acted, and
765
+ the next reader should find the outcome beside the licence rather than have to
766
+ reconstruct whether anyone ever looked.
767
+
532
768
  ## Resume journal — agent writes, scratch reset sweeps
533
769
 
534
770
  **The contract, in four clauses.** A mutating agent journals to a repo-local
@@ -687,6 +923,30 @@ diff review of agent gate edits remains a supervisor duty. `--fixture <dir>`
687
923
  injects `staged-files` / `added-exemptions` lists (fixture-pair test
688
924
  capability); live mode reads `git diff --cached`.
689
925
 
926
+ `checks/check-gate-tamper.gate` (`precommit`, binary-dispatched). `--fixture`
927
+ **survives the port**: it selects the rule's own input corpus, which no knob
928
+ resolves, so it is not the arrives-too-late shape gate-sdk/SPEC.md §The non-gate
929
+ arm deletes — the invocation delegation-kit/README.md documents stays true.
930
+
931
+ **Criterion 4 binds on this gate as a property of the *consumer's* configured
932
+ globs, not of the gate.** Under the kit-shipped `DELEGATION_KIT_GATE_FILES`
933
+ default the corpus is the consumer's own gates directory, which holds no kit
934
+ declaration, and the criterion clears. Under a config widening the globs to
935
+ every kit's check dir — this repo's — the gate's own declaration falls inside
936
+ them, and staging it makes the gate read its own bytes. Reading the kit default,
937
+ which is the natural first stop, therefore gives the wrong answer for the tree
938
+ the port actually runs against; gate-sdk/SPEC.md §The port-candidate criteria
939
+ carries the instance class.
940
+
941
+ **Two behaviours changed with the port, and both are rulings rather than
942
+ drift.** Assertion B's report lines came out of the shell form in no
943
+ reproducible order once a commit added two matching exemptions; the
944
+ compiled form emits the same **set** byte-sorted, on the kit-roots cohort's
945
+ ruling that a compiled form implements set semantics rather than a shell's
946
+ incidental ordering. And a trailing `--fixture` with no directory after it
947
+ **hung** the shell form in its argument-parsing loop; the compiled form reads the
948
+ missing value as the empty directory name and refuses. A hang is not a verdict, so ending it costs no assertion.
949
+
690
950
  ## check-agent-tier-explicit
691
951
 
692
952
  Every agent definition under `DELEGATION_KIT_AGENT_DIR` declares a `model:`
@@ -1088,10 +1348,11 @@ delegation-kit/
1088
1348
  usage-tests/budget-guard-cases.tsv # expected-action <TAB> scenario knobs
1089
1349
  usage-tests/dispatch-guard-cases.tsv # expected-outcome <TAB> scenario knobs
1090
1350
  usage-tests/trend-history.log # fixture history for the trend runner
1091
- checks/check-gate-tamper.sh
1092
- checks/check-rule-citation.sh
1093
- checks/check-agent-tier-explicit.sh
1351
+ checks/check-gate-tamper.gate # binary-dispatched; live arm reads the index through git
1352
+ checks/check-rule-citation.gate # hermetic, binary-dispatched: every SPEC rule citation resolves to a template lead-in
1353
+ checks/check-agent-tier-explicit.gate # hermetic, binary-dispatched: every agent definition declares an explicit model:
1094
1354
  gate-tests/check-gate-tamper/{good,bad}/
1355
+ gate-tests/check-gate-tamper.test.sh # the live arm, over throwaway git repos
1095
1356
  gate-tests/check-rule-citation/{good,bad}/
1096
1357
  gate-tests/check-agent-tier-explicit/{good,bad}/
1097
1358
  templates/agent-execution.md # full protocol, bound as a skill shim
@@ -1259,7 +1520,21 @@ costs the work in flight.
1259
1520
  `check-gate-tamper` speaks the full gate contract (`GATE-TAMPER: clean
1260
1521
  (…)` / findings + `help:` lines / exit 0-1-2) and ships the standard
1261
1522
  `good/`+`bad/` fixture pair driven through `--fixture` by gate-sdk's
1262
- `run-gate-tests.sh`.
1523
+ `run-gate-tests.sh`. The pair reaches both assertions — the bad case carries a
1524
+ co-staged non-meta path *and* a newly added path exemption matching one of its
1525
+ own staged files, beside a bare token assertion B must pass over.
1526
+
1527
+ **The pair cannot reach the live arm, and that is a property of the injection
1528
+ rather than of the cases.** `--fixture` supplies both lists directly, so the
1529
+ function that derives them — reading each staged gate file's bytes out of the
1530
+ object store and diffing its exemption set against `HEAD`'s — runs in no fixture
1531
+ case. `gate-tests/check-gate-tamper.test.sh` is where it is exercised: each case
1532
+ builds a throwaway git repo, stages a commit shape into a real index, and runs
1533
+ the gate inside it. It holds the four verdicts the pair cannot — a HEAD-resident
1534
+ exemption is not "added" even when a co-staged file matches it, a newly appended
1535
+ one is, an added one matching nothing staged stays silent, and a staged
1536
+ *deletion* of a gate file reads as an empty exemption set rather than a failure
1537
+ to read.
1263
1538
 
1264
1539
  `check-rule-citation` speaks the same gate contract and ships the standard
1265
1540
  `good/`+`bad/` fixture pair (a citation resolving to a template lead-in vs one
@@ -0,0 +1,3 @@
1
+ # graph: couples=.claude/agents/*.md dir=one valve=none tier=precommit
2
+ # install: on-surface
3
+ # spec: delegation-kit/SPEC.md §check-agent-tier-explicit — every agent definition under the scanned directory declares a `model:` field in its frontmatter (an explicit `inherit` passes; only omission reds)
@@ -0,0 +1,3 @@
1
+ # graph: couples=kit:*.sh,native/src/gates/gate_tamper.rs dir=one valve=none tier=precommit
2
+ # install: zero-config
3
+ # spec: delegation-kit/SPEC.md §Verify after every agent commit — a gate-weakening commit is blocked by shape (A gate edits stay meta-isolated; B a new path-exemption can't excuse a co-staged file)
@@ -0,0 +1,3 @@
1
+ # graph: couples=delegation-kit/SPEC.md,delegation-kit/templates/agent-execution.md dir=one valve=none tier=precommit
2
+ # install: on-surface
3
+ # spec: delegation-kit/SPEC.md §One template, a resident pointer — every `the template's **<name>** rule` citation in SPEC §The delegation model resolves to a template bullet's bold lead-in (forward direction only)
@@ -0,0 +1,5 @@
1
+ # the second tamper shape, in the same commit as the first: a newly added path exemption that
2
+ # excuses a file staged beside it. `plain-token` is not path-shaped, so assertion B passes it
3
+ # over — the discrimination the one-violation case could not show.
4
+ call-service/src/*.rs
5
+ plain-token
@@ -1 +1,3 @@
1
1
  gate edit not isolated
2
+ self-serving exemption
3
+ call-service/src/*.rs -> call-service/src/lib.rs
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env bash
2
+ # Behavioral test of check-gate-tamper's LIVE arm — the one the good/bad pair cannot reach.
3
+ # The pair injects both lists through --fixture, so the function that reads a staged gate
4
+ # file's bytes out of the object store (`git show :<path>` against `git show HEAD:<path>`) is
5
+ # exercised by no fixture case at all, and assertion B's added-exemption derivation with it.
6
+ #
7
+ # Each case builds a throwaway git repo, stages a commit shape, and runs the gate inside it, so
8
+ # the corpus is a real index rather than an injected list.
9
+ #
10
+ # Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
11
+ set -uo pipefail
12
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
13
+
14
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # delegation-kit/
15
+ CHECKS="$DIR/checks"
16
+
17
+ fails=0
18
+ tmp="$(mktemp -d)"
19
+ trap 'rm -rf "$tmp"' EXIT
20
+
21
+ # new_repo <name> — a git repo whose HEAD carries one gate file with one exemption element
22
+ new_repo() {
23
+ local d="$tmp/$1"
24
+ mkdir -p "$d/scripts" "$d/product"
25
+ git -C "$d" init -q
26
+ git -C "$d" config user.email tamper@example.invalid
27
+ git -C "$d" config user.name tamper
28
+ printf '#!/usr/bin/env bash\n# exception-list: the gate this repo already had\nEXEMPT=(\n "product/*.txt"\n)\n' \
29
+ >"$d/scripts/check-sample.sh"
30
+ printf 'seed\n' >"$d/README.md"
31
+ git -C "$d" add -A
32
+ git -C "$d" commit -q -m seed
33
+ printf '%s\n' "$d"
34
+ }
35
+
36
+ # case_run <name> <want> <expect> — the repo's index is already staged by the caller
37
+ case_run() {
38
+ local d="$1" name="$2" want="$3" expect="$4" out rc
39
+ out="$( cd "$d" && gate_run check-gate-tamper "$CHECKS" 2>&1 )"; rc=$?
40
+ if [[ "$rc" -ne "$want" ]]; then
41
+ echo " FAIL: $name expected exit $want, got $rc: $out"; fails=$((fails + 1)); return
42
+ fi
43
+ if ! grep -qF -- "$expect" <<<"$out"; then
44
+ echo " FAIL: $name exit OK but output lacks '$expect': $out"; fails=$((fails + 1))
45
+ fi
46
+ }
47
+
48
+ # A — a gate file staged with meta-layer paths only is clean, and the exemption its HEAD
49
+ # version already carries is not "added" even though a co-staged file would match it.
50
+ d="$(new_repo head-resident)"
51
+ printf 'x\n' >"$d/product/thing.txt"
52
+ printf 'note\n' >"$d/scripts/note.md"
53
+ git -C "$d" add scripts/note.md
54
+ case_run "$d" head-resident-exemption-is-not-added 0 "GATE-TAMPER: clean"
55
+
56
+ # B — the same repo, now staging the product file the HEAD-resident exemption matches: the
57
+ # exemption is still not new, so assertion B stays silent and only assertion A speaks.
58
+ d="$(new_repo a-not-b)"
59
+ printf 'x\n' >"$d/product/thing.txt"
60
+ printf '# edited\n' >>"$d/scripts/check-sample.sh"
61
+ git -C "$d" add product/thing.txt scripts/check-sample.sh
62
+ out="$( cd "$d" && gate_run check-gate-tamper "$CHECKS" 2>&1 )"
63
+ if ! grep -qF "gate edit not isolated" <<<"$out"; then
64
+ echo " FAIL: a-not-b did not report the isolation violation: $out"; fails=$((fails + 1))
65
+ fi
66
+ if grep -qF "self-serving exemption" <<<"$out"; then
67
+ echo " FAIL: a-not-b reported a HEAD-resident exemption as newly added: $out"; fails=$((fails + 1))
68
+ fi
69
+
70
+ # C — the byte reader proper: a *new* element appended to the staged blob of a gate file,
71
+ # matching a file staged in the same commit. Only `git show :<path>` sees it.
72
+ d="$(new_repo self-serving)"
73
+ printf '#!/usr/bin/env bash\n# exception-list: the gate this repo already had\nEXEMPT=(\n "product/*.txt"\n "product/*.md"\n)\n' \
74
+ >"$d/scripts/check-sample.sh"
75
+ printf 'y\n' >"$d/product/excused.md"
76
+ git -C "$d" add scripts/check-sample.sh product/excused.md
77
+ case_run "$d" a-newly-added-exemption-excusing-a-co-staged-file 1 "product/*.md -> product/excused.md"
78
+
79
+ # D — the same added element with nothing co-staged that it matches: assertion B is silent, so
80
+ # the derivation is not simply reporting every element it can parse.
81
+ d="$(new_repo added-but-unmatched)"
82
+ printf '#!/usr/bin/env bash\n# exception-list: the gate this repo already had\nEXEMPT=(\n "product/*.txt"\n "nowhere/*.md"\n)\n' \
83
+ >"$d/scripts/check-sample.sh"
84
+ git -C "$d" add scripts/check-sample.sh
85
+ out="$( cd "$d" && gate_run check-gate-tamper "$CHECKS" 2>&1 )"
86
+ if grep -qF "self-serving exemption" <<<"$out"; then
87
+ echo " FAIL: added-but-unmatched fired on an exemption matching nothing staged: $out"
88
+ fails=$((fails + 1))
89
+ fi
90
+
91
+ # E — an index with no gate file staged: assertion A never opens, so a non-meta path is fine.
92
+ d="$(new_repo no-gate-file)"
93
+ printf 'z\n' >"$d/product/thing.txt"
94
+ git -C "$d" add product/thing.txt
95
+ case_run "$d" a-commit-touching-no-gate-file 0 "1 staged path(s)"
96
+
97
+ # F — a staged *deletion* of a gate file: the staged blob does not exist, and the reader must
98
+ # treat that as no exemptions rather than as a failure to read.
99
+ d="$(new_repo staged-deletion)"
100
+ git -C "$d" rm -q scripts/check-sample.sh
101
+ case_run "$d" a-staged-gate-file-deletion 0 "GATE-TAMPER: clean"
102
+
103
+ if [[ "$fails" -gt 0 ]]; then
104
+ echo "check-gate-tamper.test: $fails assertion(s) failed"
105
+ exit 1
106
+ fi
107
+ echo "check-gate-tamper.test: ok (live arm: HEAD-resident exemptions excluded, a newly added one excusing a co-staged file rejected, an unmatched one silent, a gate-file deletion read as empty)"
108
+ exit 0
@@ -60,4 +60,4 @@ cmp -s "$pp/usage.before" "$pp/usage.txt" || {
60
60
  rm -rf "$pp"
61
61
 
62
62
  bash "$SDK/bin/gen-pre-commit.sh" --write >/dev/null
63
- bash "$SDK/checks/check-graph.sh" --emit > scripts/CHECK-GRAPH.html
63
+ bash "$SDK/bin/run-gates.sh" --emit graph > scripts/CHECK-GRAPH.html
@@ -41,10 +41,61 @@ drift: do not delete it on sight, and when either rule changes here, propagate.
41
41
  ending the turn to wait for the completion notification — that is the one act
42
42
  that revokes the channel, which is how a *careful* reader reaches this
43
43
  failure. Wait **in-turn on a condition** instead: loop on the work's own
44
- artifact (evidence file, lock, exit marker) with the harness's waiting
45
- primitive. Never-poll governs waiting on an `Agent`'s completion notification,
46
- a channel a supervisor has; condition-waiting is the only one a dispatched
47
- role has.
44
+ artifact (evidence file, lock, exit marker). Never-poll governs waiting on an
45
+ `Agent`'s completion notification, a channel a supervisor has;
46
+ condition-waiting is the only one a dispatched role has.
47
+ **Which primitive — the one whose wait ends when the condition goes true, not
48
+ when a duration expires.** The harness offers two forms with opposite
49
+ reactivity, and the difference is exactly the wall-clock property this rule
50
+ exists to buy. **Background a command that *exits* on the condition** — a
51
+ `run_in_background` shell command wrapping `until <cond>; do sleep N; done` —
52
+ and it fires one notification the moment the condition holds, then ends: that
53
+ is the sanctioned form. The harness's **event-stream form**, armed with a
54
+ command and a deadline, emits one event per occurrence and **stays armed to
55
+ its deadline even after the event fires**, so used for a single completion it
56
+ converts a wait that should end in seconds into one that ends at the timeout —
57
+ the wrong tool for a completion, and named here because a reader told only
58
+ about the first form reaches for this one the next time the shape looks close.
59
+ Never a bare foreground `sleep`, which ends on neither.
60
+ **What you wait *on* splits two ways, and the split is what makes the artifact
61
+ reachable.** An **`Agent` dispatch** is awaited by its **completion
62
+ notification** — that record is the harness's, not the session's — so never go
63
+ looking for it on disk. A **shell child** has no notification channel of its
64
+ own, so it is awaited on an artifact *the session placed*, and that artifact is
65
+ named: **record the child's PID at launch**, one line in the form
66
+ `pid=<n> run=<key>`, in a file named **`<key>.run`** — the same `<key>`, so the
67
+ name carries no field the line does not — written where the **Resume journal —
68
+ agent writes, scratch reset sweeps** bullet below sends a journal, repo-local
69
+ gitignored scratch in the main checkout, on that bullet's stated survivability
70
+ grounds — widened here from the journal to any artifact a session waits on.
71
+ That record *is* the wait target: loop on its PID's liveness and the loop ends
72
+ when the PID stops answering. Write it at the launch, not after, and leave it
73
+ behind — a completion marker answers *is it done* to a live observer, and the
74
+ case this rule exists for is the one where the observer is gone, where a
75
+ liveness record still answers *is it still running* to whoever arrives next.
76
+ Whoever that is reads it with `check-producer-liveness <record>` — or, because
77
+ the `.run` suffix makes the set a glob rather than a path someone must be told,
78
+ `check-producer-liveness <scratch-dir>` over all of them at once — unchanged
79
+ and already wired (evidence-kit/SPEC.md §check-producer-liveness), which is why
80
+ the record is in that gate's grammar rather than a shape of your own.
81
+ **Delete the record when its producer is done, and never before.** While one
82
+ names a live PID, a guard blocks every `git` command that writes the index, the
83
+ worktree or a ref (guard-kit/SPEC.md §The generic ruleset, rule 14) — a commit
84
+ taken under a live producer dirties the tree it is measuring and costs that
85
+ run's whole verdict. Deleting a record whose producer has exited is not a way
86
+ around the block: it is a statement of fact that has become false being
87
+ retracted.
88
+ **And never by pattern-matching the process table.** `pgrep -f '<pattern>'`
89
+ matches the waiter's own argv — the harness's wrapper argv matches too — so
90
+ `until ! pgrep -f '<script>'; do …; done` can never go false and never exits,
91
+ reddening nothing while it burns the whole foreground cap. Where liveness *is*
92
+ the condition, match a **recorded PID** (`kill -0 "$pid"`) and never a pattern —
93
+ one rule, whoever started the producer, your own backgrounded child included: a
94
+ PID is an identity, a pattern is a guess about a process table that includes the
95
+ guesser. The
96
+ bracket-trick repair (`pgrep -f '[r]un-smoke.sh'`) is **not** the sanctioned
97
+ form, and its grounds for being refused are
98
+ delegation-kit/SPEC.md §The delegation model's.
48
99
  - **Serialize on shared files; ≤`DELEGATION_KIT_FAN_WIDTH`-wide otherwise.**
49
100
  Agents that edit a shared file (see the roster below) run one at a time —
50
101
  dispatch, await notification, verify, dispatch the next. Independent
@@ -197,6 +248,22 @@ drift: do not delete it on sight, and when either rule changes here, propagate.
197
248
  part that binds you: **a dispatcher handing out work that will need a mid-run
198
249
  channel grants a durable path with it**, and reads that path itself.
199
250
 
251
+ - **A finished child is addressed by the task-id its completion notification
252
+ carried, never by its name.** Resuming a returned agent to correct or extend
253
+ its work is the cheap alternative to a cold re-dispatch, and it is the one
254
+ that keeps the child's own reasoning instead of paying to rebuild it. The name
255
+ is not a durable address for that: measured here, a name live at dispatch
256
+ resolved to *no agent of that name is reachable* once the dispatching session
257
+ had been compacted, with the agent listing reporting none reachable at all,
258
+ while the task-id from the notification resumed the same child from its
259
+ transcript. Which of the two voids the name — the compaction, or the child
260
+ merely having finished — is untested; the task-id survived both, and the
261
+ notification states outright that it is the handle the child may notify under
262
+ again, so it is the address to hold. It is also the address to **write down**:
263
+ the notification lives in the context that dies, so a dispatcher who may want
264
+ that child later records the task-id under the durability rule below rather
265
+ than trusting the scroll to still be there.
266
+
200
267
  - **Findings you will act on are durable before you act on them.** A child's
201
268
  return value lives only in your context, and your context dies with your
202
269
  session. Before you *act* on a dispatched agent's findings — edit against
@@ -294,7 +294,7 @@ a sibling `*.test.sh` drives the extra-line, declared-trim, link-absent,
294
294
  craft-untagged, craft-malformed, and four fail-closed cases the one-pair harness
295
295
  cannot hold (fixture-pair); and registration in this repo's `gates.list` where
296
296
  its own always-loaded file is the scan target (self-lint). Positional form
297
- `check-doctrine-registration.sh [agent-file [doctrine-file]]` lets the fixtures
297
+ `check-doctrine-registration [agent-file [doctrine-file]]` lets the fixtures
298
298
  point at a synthetic agent and doctrine file.
299
299
 
300
300
  ## stage-rules
@@ -0,0 +1,3 @@
1
+ # graph: couples=CLAUDE.md,doctrine-kit/DOCTRINE.md dir=one valve=none tier=precommit
2
+ # install: zero-config
3
+ # spec: doctrine-kit/SPEC.md §check-doctrine-registration — the always-loaded agent file links the doctrine file and holds its methodology-rule digest in per-rule lockstep with DOCTRINE.md, fail-closed when a scanned file or section is missing
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # Behavioral test of checks/check-doctrine-registration.sh — the scenarios the
2
+ # Behavioral test of check-doctrine-registration — the scenarios the
3
3
  # one-pair good/bad harness cannot hold. The good/bad fixture pair covers the
4
4
  # lockstep-clean case and the digest-missing-a-rule case (assertion B); the
5
5
  # harness admits one bad/ dir, so this drives the digest-extra-line case
@@ -13,7 +13,6 @@ set -uo pipefail
13
13
  source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
14
14
 
15
15
  DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # doctrine-kit/
16
- GATE="$DIR/checks/check-doctrine-registration.sh"
17
16
  SANDBOX="$(mktemp -d)"
18
17
  trap 'rm -rf "$SANDBOX"' EXIT
19
18
 
@@ -21,7 +20,7 @@ fails=0
21
20
 
22
21
  check_case() { # $1=label $2=sandbox-dir $3=want-rc $4=want-substring
23
22
  local out rc
24
- out="$(cd "$2" && "$GATE" AGENT.md DOCTRINE.md 2>&1)"; rc=$?
23
+ out="$(cd "$2" && gate_run check-doctrine-registration "$DIR/checks" AGENT.md DOCTRINE.md 2>&1)"; rc=$?
25
24
  if [[ "$rc" -ne "$3" ]]; then
26
25
  echo " FAIL [$1]: want exit $3, got $rc -- $out"; fails=$((fails + 1)); return
27
26
  fi