checkwright 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/README.md +175 -13
  2. package/lib/common/lock.sh +7 -0
  3. package/lib/common/recipe.sh +1 -1
  4. package/lib/diff.sh +2 -0
  5. package/lib/init.sh +40 -16
  6. package/lib/uninstall.sh +2 -0
  7. package/package.json +2 -2
  8. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  9. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  10. package/payload/canon-kit/README.md +2 -0
  11. package/payload/canon-kit/SPEC.md +454 -28
  12. package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
  13. package/payload/canon-kit/checks/check-amendment-update-target.gate +3 -0
  14. package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
  15. package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
  16. package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
  17. package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
  18. package/payload/canon-kit/checks/check-unmarked-claim.gate +3 -0
  19. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-orphan.md +6 -0
  20. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +7 -2
  21. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +8 -0
  22. package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/SPEC-thing.md +26 -0
  23. package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/expect.txt +8 -0
  24. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +47 -0
  25. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/expect.txt +1 -0
  26. package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +82 -0
  27. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +3 -0
  28. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
  29. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  30. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
  31. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
  32. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC-wire.md +18 -0
  33. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +3 -1
  34. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.proto +13 -0
  35. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC-wire.md +22 -0
  36. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +17 -0
  37. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.proto +13 -0
  38. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/SPEC.md +11 -0
  39. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +3 -0
  40. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +6 -0
  41. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +18 -0
  42. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/expect.txt +1 -0
  43. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +6 -0
  44. package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +85 -0
  45. package/payload/canon-kit/lib/spec.sh +16 -0
  46. package/payload/canon-kit/smoke/install.sh +3 -1
  47. package/payload/canon-kit/templates/SPEC-amendment.md +17 -2
  48. package/payload/context-kit/README.md +6 -4
  49. package/payload/context-kit/SPEC.md +256 -76
  50. package/payload/context-kit/bin/always-loaded.sh +5 -21
  51. package/payload/context-kit/bin/env-probe.sh +2 -17
  52. package/payload/context-kit/checks/check-brevity.gate +3 -0
  53. package/payload/context-kit/checks/check-footprint-fresh.gate +3 -0
  54. package/payload/context-kit/checks/check-memory-off.gate +3 -0
  55. package/payload/context-kit/checks/check-settings-paths.gate +3 -0
  56. package/payload/context-kit/checks/check-settings-pins.gate +3 -0
  57. package/payload/context-kit/gate-tests/check-brevity.test.sh +3 -2
  58. package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/context-config.sh +4 -0
  59. package/payload/context-kit/gate-tests/check-memory-off/good/scripts/context-config.sh +4 -0
  60. package/payload/context-kit/gate-tests/check-memory-off.test.sh +18 -4
  61. package/payload/context-kit/gate-tests/check-settings-pins.test.sh +70 -0
  62. package/payload/context-kit/index-tests/expected/toolfloor.txt +5 -5
  63. package/payload/context-kit/index-tests/toolfloor-cases.sh +5 -5
  64. package/payload/context-kit/lib/context.sh +56 -0
  65. package/payload/context-kit/lib/toolfloor.sh +1 -1
  66. package/payload/context-kit/smoke/agents-md.sh +16 -4
  67. package/payload/context-kit/smoke/install.sh +3 -2
  68. package/payload/context-kit/templates/session-context.sh +5 -5
  69. package/payload/delegation-kit/README.md +11 -1
  70. package/payload/delegation-kit/SPEC.md +652 -11
  71. package/payload/delegation-kit/bin/wait-probe.sh +184 -0
  72. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +3 -0
  73. package/payload/delegation-kit/checks/check-gate-tamper.gate +3 -0
  74. package/payload/delegation-kit/checks/check-rule-citation.gate +3 -0
  75. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/added-exemptions +5 -0
  76. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +2 -0
  77. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +108 -0
  78. package/payload/delegation-kit/gate-tests/subagent-stop-liveness.test.sh +99 -0
  79. package/payload/delegation-kit/smoke/install.sh +21 -1
  80. package/payload/delegation-kit/templates/agent-execution.md +88 -4
  81. package/payload/delegation-kit/templates/subagent-stop-liveness.sh +56 -0
  82. package/payload/doctrine-kit/SPEC.md +1 -1
  83. package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
  84. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -3
  85. package/payload/doctrine-kit/smoke/install.sh +17 -4
  86. package/payload/drift-kit/README.md +2 -2
  87. package/payload/drift-kit/SPEC.md +71 -7
  88. package/payload/drift-kit/bin/stage-economics.sh +1 -1
  89. package/payload/drift-kit/lib/drift.sh +43 -0
  90. package/payload/drift-kit/smoke/install.sh +21 -14
  91. package/payload/evidence-kit/README.md +3 -1
  92. package/payload/evidence-kit/SPEC.md +160 -19
  93. package/payload/evidence-kit/checks/check-battery-roster.gate +3 -0
  94. package/payload/evidence-kit/checks/check-evidence-baseline.gate +3 -0
  95. package/payload/evidence-kit/checks/check-evidence-manifest.gate +3 -0
  96. package/payload/evidence-kit/checks/check-producer-liveness.sh +42 -2
  97. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +4 -3
  98. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +8 -5
  99. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +1 -1
  100. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/evidence-config.sh +9 -0
  101. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +1 -1
  102. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/evidence-config.sh +9 -0
  103. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +6 -4
  104. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +42 -1
  105. package/payload/evidence-kit/lib/evidence.sh +2 -0
  106. package/payload/evidence-kit/smoke/install.sh +1 -1
  107. package/payload/gate-sdk/README.md +17 -9
  108. package/payload/gate-sdk/SPEC.md +4680 -295
  109. package/payload/gate-sdk/bin/build-native.sh +66 -1
  110. package/payload/gate-sdk/bin/install-hooks.sh +14 -2
  111. package/payload/gate-sdk/bin/port-blockers.sh +37 -9
  112. package/payload/gate-sdk/bin/run-gate-tests.sh +1 -2
  113. package/payload/gate-sdk/bin/run-gates.sh +137 -13
  114. package/payload/gate-sdk/bin/upgrade-smoke.sh +21 -16
  115. package/payload/gate-sdk/checks/check-action-run-shell.sh +2 -1
  116. package/payload/gate-sdk/checks/check-commit-msg.gate +3 -0
  117. package/payload/gate-sdk/checks/check-commit-subject.gate +3 -0
  118. package/payload/gate-sdk/checks/check-core-files.gate +3 -0
  119. package/payload/gate-sdk/checks/check-crate-arms.sh +1 -0
  120. package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -0
  121. package/payload/gate-sdk/checks/check-exec-bit.gate +3 -0
  122. package/payload/gate-sdk/checks/check-gate-assertions.gate +3 -0
  123. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +3 -0
  124. package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +3 -0
  125. package/payload/gate-sdk/checks/check-gate-fail-closed.gate +3 -0
  126. package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +3 -0
  127. package/payload/gate-sdk/checks/check-gate-output.gate +3 -0
  128. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +132 -15
  129. package/payload/gate-sdk/checks/check-graph.gate +3 -0
  130. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +3 -0
  131. package/payload/gate-sdk/checks/check-identity.gate +3 -0
  132. package/payload/gate-sdk/checks/check-install-disposition.sh +1 -0
  133. package/payload/gate-sdk/checks/check-kit-enum.gate +3 -0
  134. package/payload/gate-sdk/checks/check-readme-roster.gate +3 -0
  135. package/payload/gate-sdk/checks/check-reads-couples.gate +3 -0
  136. package/payload/gate-sdk/checks/check-root-tiering.gate +3 -0
  137. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  138. package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
  139. package/payload/gate-sdk/checks/check-tree-terms.gate +3 -0
  140. package/payload/gate-sdk/checks/check-workflow-tiering.gate +3 -0
  141. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +17 -12
  142. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +4 -5
  143. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +2 -1
  144. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +2 -1
  145. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +3 -0
  146. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -1
  147. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +3 -4
  148. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +5 -1
  149. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +22 -0
  150. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-count.sh +11 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-extra.sh +14 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-zero.sh +7 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  154. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +27 -0
  155. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-qux.sh +13 -0
  156. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +117 -0
  157. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +26 -4
  158. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +6 -1
  159. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +2 -0
  160. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored-descriptor.gate +4 -0
  161. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored.sh +14 -0
  162. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +4 -0
  163. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-held.sh +8 -0
  164. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +8 -1
  165. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +3 -0
  166. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored-descriptor.gate +4 -0
  167. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored.sh +14 -0
  168. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +4 -0
  169. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-held.sh +8 -0
  170. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +77 -0
  171. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +4 -5
  172. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +9 -0
  173. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kit-spec.md +6 -0
  174. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +1 -0
  175. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-bare.sh +4 -0
  176. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-both.sh +5 -0
  177. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-heldtwice.sh +5 -0
  178. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-nospec.sh +4 -0
  179. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +2 -0
  180. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twice.sh +5 -0
  181. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-ungrounded.sh +5 -0
  182. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +6 -0
  183. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  184. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kit-spec.md +12 -0
  185. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +1 -0
  186. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +5 -0
  187. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -0
  188. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +49 -4
  189. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +15 -5
  190. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +12 -0
  191. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +27 -5
  192. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +12 -0
  193. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +5 -4
  194. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +14 -12
  195. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +43 -17
  196. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +190 -0
  197. package/payload/gate-sdk/gate-tests/check-identity/bad/gh-hosts.yml +9 -0
  198. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -2
  199. package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/gate-sdk-config.sh +10 -0
  200. package/payload/gate-sdk/gate-tests/check-identity/good/gh-hosts.yml +11 -0
  201. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -1
  202. package/payload/gate-sdk/gate-tests/check-identity/good/scripts/gate-sdk-config.sh +10 -0
  203. package/payload/gate-sdk/gate-tests/check-identity.test.sh +114 -0
  204. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-native-sample.gate +3 -0
  205. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -1
  206. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-native-sample.gate +3 -0
  207. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  208. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +5 -2
  209. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +3 -1
  210. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/README.md +15 -0
  211. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-one.gate +2 -0
  212. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-two.sh +3 -0
  213. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +3 -1
  214. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +1 -1
  215. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +3 -1
  216. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/README.md +13 -0
  217. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/checks/check-delta-one.gate +2 -0
  218. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/README.md +14 -0
  219. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-one.sh +3 -0
  220. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-two.gate +2 -0
  221. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +1 -1
  222. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +87 -89
  223. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +4 -0
  224. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +56 -0
  225. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +5 -0
  226. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/multi.txt +4 -0
  227. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/second-leak.txt +2 -0
  228. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
  229. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
  230. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +4 -0
  231. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +2 -0
  232. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +3 -0
  233. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/worktrees/vendored-note.txt +3 -0
  234. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +94 -0
  235. package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +211 -0
  236. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +16 -15
  237. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +94 -1
  238. package/payload/gate-sdk/lib/gate.sh +232 -25
  239. package/payload/gate-sdk/smoke/install.sh +28 -1
  240. package/payload/guard-kit/README.md +4 -3
  241. package/payload/guard-kit/SPEC.md +578 -47
  242. package/payload/guard-kit/bin/compare-settings-allow.sh +36 -12
  243. package/payload/guard-kit/bin/run-guard-tests.sh +27 -4
  244. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +46 -1
  245. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
  246. package/payload/guard-kit/guard-tests/background-cases.tsv +14 -0
  247. package/payload/guard-kit/guard-tests/cases.tsv +67 -9
  248. package/payload/guard-kit/lib/guard.sh +361 -18
  249. package/payload/guard-kit/templates/bash-guard.sh +2 -0
  250. package/payload/guard-kit/templates/close-triage.md +10 -3
  251. package/payload/guard-kit/templates/guard-config.sh +3 -0
  252. package/payload/lifecycle-kit/README.md +3 -2
  253. package/payload/lifecycle-kit/SPEC.md +509 -77
  254. package/payload/lifecycle-kit/bin/enter-stage.sh +72 -33
  255. package/payload/lifecycle-kit/bin/file-gap.sh +2 -2
  256. package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
  257. package/payload/lifecycle-kit/checks/check-stage-entry.gate +3 -0
  258. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +4 -4
  259. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -1
  260. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +3 -3
  261. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +3 -3
  262. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +22 -22
  263. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +2 -2
  264. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +2 -2
  265. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +120 -10
  266. package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
  267. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +11 -11
  268. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
  269. package/payload/lifecycle-kit/lib/stages.sh +5 -0
  270. package/payload/lifecycle-kit/smoke/install.sh +29 -15
  271. package/payload/lifecycle-kit/templates/lead.md +32 -0
  272. package/payload/lifecycle-kit/templates/stages/align.md +20 -2
  273. package/payload/lifecycle-kit/templates/stages/build.md +3 -3
  274. package/payload/lifecycle-kit/templates/stages/close.md +20 -6
  275. package/payload/lifecycle-kit/templates/stages/scope.md +20 -1
  276. package/payload/lifecycle-kit/templates/stages/spec.md +1 -1
  277. package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
  278. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +1 -1
  279. package/payload/queue-kit/README.md +10 -10
  280. package/payload/queue-kit/SPEC.md +379 -84
  281. package/payload/queue-kit/bin/queue-counts.sh +1 -1
  282. package/payload/queue-kit/checks/check-queue-entry-budget.gate +1 -1
  283. package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
  284. package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -0
  285. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +15 -0
  286. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +2 -0
  287. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +7 -0
  288. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +4 -0
  289. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -1
  290. package/payload/queue-kit/gate-tests/queue-counts.test.sh +1 -1
  291. package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
  292. package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
  293. package/payload/queue-kit/lib/queue.sh +0 -49
  294. package/payload/queue-kit/smoke/install.sh +1 -1
  295. package/payload/site-kit/SPEC.md +41 -2
  296. package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
  297. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  298. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +5 -4
  299. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +6 -5
  300. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/checks/check-sample.gate +3 -0
  301. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -1
  302. package/payload/site-kit/smoke/install.sh +1 -1
  303. package/payload/canon-kit/checks/check-amendment-queue.sh +0 -117
  304. package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -79
  305. package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -240
  306. package/payload/canon-kit/checks/check-prose-tells.sh +0 -208
  307. package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -134
  308. package/payload/context-kit/bin/footprint.sh +0 -144
  309. package/payload/context-kit/checks/check-brevity.sh +0 -124
  310. package/payload/context-kit/checks/check-footprint-fresh.sh +0 -39
  311. package/payload/context-kit/checks/check-memory-off.sh +0 -113
  312. package/payload/context-kit/checks/check-settings-paths.sh +0 -94
  313. package/payload/context-kit/checks/check-settings-pins.sh +0 -111
  314. package/payload/context-kit/gate-tests/check-memory-off/bad/args +0 -1
  315. package/payload/context-kit/gate-tests/check-memory-off/good/args +0 -1
  316. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -62
  317. package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -140
  318. package/payload/delegation-kit/checks/check-rule-citation.sh +0 -77
  319. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -246
  320. package/payload/drift-kit/bin/trajectory.sh +0 -242
  321. package/payload/evidence-kit/checks/check-battery-roster.sh +0 -87
  322. package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -104
  323. package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -105
  324. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +0 -3
  325. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +0 -3
  326. package/payload/gate-sdk/bin/enforcement-map.sh +0 -273
  327. package/payload/gate-sdk/checks/check-commit-msg.sh +0 -51
  328. package/payload/gate-sdk/checks/check-commit-subject.sh +0 -44
  329. package/payload/gate-sdk/checks/check-core-files.sh +0 -76
  330. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -38
  331. package/payload/gate-sdk/checks/check-exec-bit.sh +0 -96
  332. package/payload/gate-sdk/checks/check-gate-assertions.sh +0 -148
  333. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -107
  334. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -106
  335. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -85
  336. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -93
  337. package/payload/gate-sdk/checks/check-gate-output.sh +0 -103
  338. package/payload/gate-sdk/checks/check-graph.sh +0 -632
  339. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -46
  340. package/payload/gate-sdk/checks/check-identity.sh +0 -135
  341. package/payload/gate-sdk/checks/check-kit-enum.sh +0 -95
  342. package/payload/gate-sdk/checks/check-readme-roster.sh +0 -108
  343. package/payload/gate-sdk/checks/check-reads-couples.sh +0 -200
  344. package/payload/gate-sdk/checks/check-root-tiering.sh +0 -67
  345. package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -127
  346. package/payload/gate-sdk/checks/check-tree-terms.sh +0 -66
  347. package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -85
  348. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +0 -1
  349. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +0 -1
  350. package/payload/gate-sdk/gate-tests/check-identity/bad/args +0 -1
  351. package/payload/gate-sdk/gate-tests/check-identity/good/args +0 -1
  352. package/payload/lifecycle-kit/bin/close-surfaces.sh +0 -94
  353. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +0 -64
  354. package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -198
  355. package/payload/queue-kit/bin/queue-index.sh +0 -182
  356. package/payload/queue-kit/bin/roadmap.sh +0 -76
  357. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +0 -64
  358. package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -111
  359. package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -81
  360. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/{gates → scripts}/check-sample.sh +0 -0
  361. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/{gates → scripts}/check-sample.sh +0 -0
  362. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{check-gamma.sh → scripts/check-gamma.sh} +0 -0
  363. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  364. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  365. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gates.list → scripts/gates.list} +0 -0
  366. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{check-beta.sh → scripts/check-beta.sh} +0 -0
  367. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  368. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  369. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gates.list → scripts/gates.list} +0 -0
  370. /package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/{site-config.sh → scripts/site-config.sh} +0 -0
  371. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/CNAME +0 -0
  372. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/index.md +0 -0
  373. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/docs → docs}/posts/2026-01-01-legacy.md +0 -0
  374. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/pkg → pkg}/gate-tests/fixture.md +0 -0
  375. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{site-config.sh → scripts/site-config.sh} +0 -0
@@ -81,6 +81,187 @@ 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. It is
221
+ now **advised at the launch**, and still not refused. This narrows the failure to
222
+ that residue rather than closing it.
223
+
224
+ **The record's *write* is now reached at the launch chokepoint, and the refusal
225
+ that stood here is discharged.** The candidate was a rule firing on the
226
+ backgrounding call itself, held back on one empirical unknown: a shell `&` is in
227
+ the command text every rule already reads, but a harness's background-this
228
+ parameter is **tool input, not command text**, and whether it reaches the
229
+ `PreToolUse` payload was a question about one field. It does:
230
+ `.tool_input.run_in_background` is a JSON boolean `true` on a backgrounded Bash
231
+ call and absent on a foreground one (guard-kit/SPEC.md §The guard framework
232
+ records the payload's shape, so no session re-buys the probe). Both forms are
233
+ therefore reachable and **guard-kit rule 15 builds both arms in one rule**. The
234
+ judgment that held it back is kept rather than retired, because it is what made
235
+ the two-arm rule the right build rather than a bigger one: **building only the
236
+ `&` arm would have been worse than not building it** — every attested firing used
237
+ the harness form, so a rule covering only the shell spelling would have blocked
238
+ the form nobody uses and passed the one that fires, coverage in appearance and an
239
+ assertion about nothing in fact. What ships is an **advisory**, not a block, on
240
+ grounds guard-kit/SPEC.md §The generic ruleset states with the rule, and its
241
+ re-opening condition is named there.
242
+
243
+ **The guard interaction that produced it resolves without touching the guard.**
244
+ The attested sequence: a session reached for the correct artifact wait, spelled
245
+ it against the harness's own scratchpad path, and the consumer's bash guard
246
+ refused it and steered to repo-local scratch. The guard was **right** and needed
247
+ no change. What was missing is that the doctrine never said where an awaited
248
+ artifact belongs, so the refusal read as a refusal of artifact-waiting itself and
249
+ pushed the session onto the process-liveness form that then broke. With the split
250
+ above, a session waiting on an `Agent` never reaches for a path at all, and a
251
+ session waiting on a shell child has a path the guard already sanctions.
252
+
253
+ **The bracket trick is refused as the sanctioned form, and the grounds are here
254
+ because the template defers them here.** The template carries the mechanism —
255
+ why a process-liveness predicate can never go false, and the two sanctioned
256
+ repairs — and sends here the one question it does not answer: why the third,
257
+ `pgrep -f '[r]un-smoke.sh'`, is refused rather than passed over. It is the first
258
+ thing a reader reaches for and it *works*, so what disqualifies it is not correctness
259
+ but its failure mode: a spelling that must be remembered, whose omission is
260
+ invisible at the call site and whose cost when omitted is silent and expensive.
261
+ A rule whose correct form differs from its incorrect form by one character is a
262
+ rule that will be got wrong, which is why the enforcement half is a guard rule
263
+ over the shape (guard-kit/SPEC.md §The generic ruleset) rather than more prose.
264
+
84
265
  The template's **Findings you will act on are durable before you act on them**
85
266
  rule rests on a near-loss rather than a loss: a close stage dispatched two
86
267
  audit sweeps and then hit the session wall. Both had already returned, which
@@ -270,6 +451,17 @@ either, so the distinguishing axis is not durability but interception:
270
451
  > question is whether the act passes a **chokepoint** — not whether it reaches
271
452
  > the tree. A dispatch does. A turn-end does not.
272
453
 
454
+ **That second sentence was a claim about the harness, and it has now been
455
+ measured.** A `SubagentStop` hook *is* a chokepoint at the turn-end, so it is the
456
+ one candidate that could falsify the axis — and the decisive question was whether
457
+ the harness already defers a subagent's stop while a background child is live,
458
+ since a harness that deferred would dissolve the class this rule exists for. The
459
+ logging-only probe at §The turn-end liveness probe (template) put a live producer
460
+ under a deliberate turn-end and read `live=yes`: **the stop is not deferred**. So
461
+ the sentence stands as written for the `PreToolUse` axis it was said on, the
462
+ relocation to guard-kit rule 14 stands, and the turn-end's own event is reachable
463
+ but buys enforcement only through a blocking hook nobody has authorized.
464
+
273
465
  **The chokepoint — what a `PreToolUse` hook can actually read.** The payload
274
466
  carries `session_id`, `prompt_id`, `transcript_path`, `cwd`, `permission_mode`,
275
467
  `hook_event_name`, `tool_name`, `tool_input`, and `tool_use_id`; and, **only
@@ -503,8 +695,92 @@ oracle where one is buildable. In the attested instance what caught the
503
695
  consequence was the artifact-side oracle below, with the prose already in its
504
696
  strengthened form.
505
697
 
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
698
+ **The propagate obligation has fired, and the record names what it cost.** The
699
+ waiting rule changed — the primitive named by its reactivity property, the
700
+ awaited artifact given a home — and the template's *when either rule changes
701
+ here, propagate* header sent that change to both of its restatements in this
702
+ consumer's `.claude/agents/` definitions: one a stage-session type, one a
703
+ read-only sweep type. They did not carry the rule alike. One cited the bullet by
704
+ name and restated its wait mechanics at length; the other carried a single
705
+ turn-end line with no citation, no primitive and no home. **The target is
706
+ symmetric even where the starting text is not**, so propagation into the second
707
+ was a genuine addition sized to that file's own voice rather than a paste of the
708
+ first's paragraph — and neither absorbed the rejected-alternative reasoning,
709
+ which is (b)'s line and stays with this section's owner. Recorded because the
710
+ sanction's cost is exactly this: every rule it licenses acquires N carriers that
711
+ a later change must find, and a restatement that drifted *unevenly* is harder to
712
+ spot than one that drifted at all.
713
+
714
+ **The obligation fired again, and the second firing found a carrier the roster
715
+ did not hold.** The waiting rule changed once more — the shell-child branch named
716
+ its artifact, and the liveness clause widened past *a producer this session did
717
+ not start* — and propagation reached both `.claude/agents/` definitions as before.
718
+ It also reached a **third** carrier sitting outside this section's roster
719
+ entirely: guard-kit's self-matching-`pgrep` rule states the same clause verbatim
720
+ in the corrective help text it prints when it blocks, mirrored in prose in that
721
+ kit's own SPEC. Left alone, a guard-blocked session would read advice that
722
+ undersells what it may now do with its own backgrounded child — a restatement
723
+ whose reader arrives at the worst possible moment, already stopped and looking for
724
+ the sanctioned form. Recorded because of what found it: the clause's own wording,
725
+ grepped across the tree, and not this section's list of known carriers. The
726
+ sanction's cost is N carriers a later change must find, and N is discovered by
727
+ grepping the rule's phrasing rather than by consulting the roster — a roster is a
728
+ record of the carriers someone noticed, never a proof of the set.
729
+
730
+ **The rule's own attested counter-examples are now explained, and the explanation
731
+ indicted the wording rather than the primitive.** Four of one session's
732
+ backgrounded waiters had died before their conditions went true with their
733
+ producers verifiably alive, against an event-stream call that succeeded first try
734
+ — a standing case that the mandated primitive was the wrong one on this machine.
735
+ It was measured rather than argued (§bin/wait-probe): every trial on a
736
+ *completion-marker* predicate outlived its condition, on both harness forms and on
737
+ a detached shell child, at producer durations up to and including the longest
738
+ swept — so no form carries a wall-clock ceiling in that range. Every early exit
739
+ instead shared one property, and it was not the form: the loop tested the
740
+ producer's **liveness**, and it reproduced on the harness-uninvolved control in
741
+ milliseconds, which exonerates the harness and the primitive together.
742
+
743
+ **The cause is that the rule's two clauses compose into an inverted loop.** The
744
+ protocol mandates wrapping `until <cond>; do sleep N; done` *and* looping on the
745
+ recorded PID's liveness. `until` ends when its condition becomes **true** and
746
+ `kill -0` is true while the producer is **alive**, so the literal composition of
747
+ the two clauses exits at once, cleanly, with the producer running — which is
748
+ exactly the reported signature, down to the clean exit status. The wait's
749
+ condition must be its **continuation** condition: `until` takes a *done* predicate
750
+ and `while` takes a *still-running* one, and liveness is a still-running
751
+ predicate. So the ordering the template states stands **unchanged** and what
752
+ changed is the spelling every carrier shipped, propagated to all four. That the
753
+ correction is free at the guard was probed rather than assumed: rules 13 and 15
754
+ walk `do … done` spans without reading the loop keyword, so the `while` form is
755
+ exempt exactly as the `until` form is (guard-kit/SPEC.md §The generic ruleset).
756
+
757
+ **Recorded here because of what the near-miss was.** A rule whose attested
758
+ counter-examples stay unexplained is a rule its readers discount, and the
759
+ discounting was already under way — the counter-examples had been read as evidence
760
+ *against the primitive*, which would have inverted a correct ordering and left the
761
+ actual defect, one keyword, shipped in all four carriers. The fifth firing's own
762
+ lesson generalizes past this rule: an operative restatement propagates a rule's
763
+ **wording**, so a defect in the wording is propagated with it, and N carriers make
764
+ N copies of the bug rather than N chances to catch it.
765
+
766
+ **No gate is owed *over the act*, and not for budget — but one is now owed over
767
+ its harm, and it exists.** No check can read a session's choice to end a turn:
768
+ the act leaves no tracked artifact, and no `PreToolUse` chokepoint sees it. The
769
+ harness's own turn-end event does see it — measured, not assumed (§The turn-end
770
+ liveness probe (template)) — and seeing is not refusing: reading the act there
771
+ would take a blocking hook, which is a separate authorization and is not held. So
772
+ the relocation below is the enforcement, and it is that on the merits rather than
773
+ for want of an alternative. What the ruling never licensed was stopping there. The harm
774
+ the turn-end causes does pass a chokepoint — a tracked-tree mutation while a
775
+ recorded producer is still writing arrives as an ordinary tool call — and it is
776
+ blocked there by guard-kit rule 14 (guard-kit/SPEC.md §The generic ruleset,
777
+ whose design §The delegation model owns). So the enforcement question this
778
+ section left open is answered **by relocating the subject from the act to its
779
+ consequence**, and the honest bound travels with the answer: it reaches only a
780
+ session that recorded, since the record's write is itself structurally
781
+ uncheckable.
782
+
783
+ **The anti-restatement gates were**
508
784
  checked against a sanctioned restatement rather than assumed inert, since a
509
785
  sanction that required weakening a gate would be the wrong sanction:
510
786
  `check-shim-restatement` scans binding shims under the skills directory against a
@@ -514,21 +790,211 @@ agent definition is neither its scanned surface nor its corpus, and
514
790
  canonical SPEC surface, which reaches no agent definition either. The sanction
515
791
  therefore ships with **no gate exemption** — and the honest converse ships with
516
792
  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).
793
+ are review-enforced. Both buildable oracles detect a *consequence* rather than
794
+ the act, and they sit at different distances from it: guard-kit rule 14
795
+ **prevents** the consequence at the tool call that would cause it, and
796
+ `check-producer-liveness` **detects** a producer still running at the next
797
+ stage's entry (evidence-kit/SPEC.md §check-producer-liveness). The second
798
+ detects late by construction — the turns between the firing and that entry are
799
+ already spent, and a firing at the last stage of an iteration has no entry after
800
+ it — which is what makes it the backstop behind the first rather than a
801
+ substitute for it.
520
802
 
521
803
  **A case where an oracle *was* buildable now sits beside this one, and the two
522
804
  are not each other's contradiction.** The dispatch-shape rules bind acts
523
805
  that leave no tracked artifact either, yet they are gated. The axis that
524
806
  separates them is **interception, not durability**: a dispatch passes a
525
- chokepoint the harness fires a hook on, and a turn-end passes none (§The
526
- delegation model, which owns the generalization). So "no tracked artifact" is
807
+ chokepoint the harness fires a hook on, and a turn-end passes none the
808
+ dispatch-shape rules could have used (§The delegation model, which owns the
809
+ generalization, and §The turn-end liveness probe (template), which measured the
810
+ harness's own turn-end event and found it reachable). So "no tracked artifact" is
527
811
  why neither rule gets a *gate* over the tree, and it is not by itself a reason
528
812
  to stop looking for an oracle. Recorded here for the same reason §The
529
813
  delegation model records the durability rule beside the read-only-fan-out
530
814
  caveat: otherwise the next reader re-litigates one of the two paragraphs.
531
815
 
816
+ **That last sentence was cashed rather than left standing.** The search it
817
+ licensed found one: the turn-end is unreachable from the tool-call axis, but the
818
+ mutation it enables is a `PreToolUse` call, and rule 14 fires there. It then
819
+ found a second candidate on a different axis — the harness's own `SubagentStop`
820
+ event, which the probe above measured and found live. It is an oracle that
821
+ *observes* rather than one that refuses, and turning it into the second kind is a
822
+ separate authorization. Recorded because a
823
+ sentence saying *keep looking* is cheap to write and easy to leave un-acted, and
824
+ the next reader should find the outcome beside the licence rather than have to
825
+ reconstruct whether anyone ever looked.
826
+
827
+ ## The turn-end liveness probe (template)
828
+
829
+ `templates/subagent-stop-liveness.sh` is an opt-in `SubagentStop` hook, inert
830
+ until a consumer registers it, that answers one question the section above
831
+ leaves open: **does the harness already defer a subagent's stop while a
832
+ background child is live?** If it does, the whole class §The delegation model's
833
+ waiting rule exists for dissolves; if it does not, the axis holds at the turn-end
834
+ too and a blocking hook is the only lever left. It is a **probe with a durable
835
+ artifact, not an enforcement mechanism** — its deliverable is an answer, and *a
836
+ capped refusal buys nothing* is one of the answers it is entitled to return.
837
+
838
+ **The event is `SubagentStop`, never `Stop`.** A dispatched session is a
839
+ subagent, so its turn end fires `SubagentStop`, and every attested firing of the
840
+ waiting rule was a dispatched session. `Stop` is deliberately not registered:
841
+ the main-session turn end has no attested firing, so registering it would widen
842
+ the subject past what the evidence carries.
843
+
844
+ **Logging-only, and the variant boundary is part of the contract.** The hook
845
+ reads its payload from stdin, asks the liveness reader whether any launch record
846
+ under `${GATE_SDK_TMP_DIR:-.tmp}` names a live producer, appends one line to
847
+ `DELEGATION_KIT_STOP_LOG`, and **exits 0 unconditionally, emitting no hook JSON
848
+ at all**. A hook that blocks is a **separate authorization** and nothing here
849
+ implies one.
850
+
851
+ **Emitting nothing is the design, and it is what makes this variant buildable.**
852
+ guard-kit's framework hardcodes `hookEventName:"PreToolUse"` in each of its three
853
+ emitters, so a hook that had to *speak* at `SubagentStop` would need a primitive
854
+ guard-kit does not have and whose event scope its SPEC never states. Speaking
855
+ nothing needs no emitter, so this template **does not source guard-kit's lib** —
856
+ which also keeps delegation-kit from acquiring a dependency on guard-kit being
857
+ vendored. The two payload fields it does read cost a `cat` and a `jq -r`; the
858
+ blocking variant's emitter cost is stacked on its own authorization rather than
859
+ paid here.
860
+
861
+ **It never wedges a turn.** Every failure path — an unreadable payload, an absent
862
+ `jq`, an absent or hung liveness reader, an unwritable log — exits 0, recording
863
+ the failure in the line where the line can be written and silently where it
864
+ cannot. The reader is invoked under `timeout` where one is available, because a
865
+ reader that hung would refuse the turn end by accident and that is the blocking
866
+ variant arrived at sideways.
867
+
868
+ **The liveness reading reuses `check-producer-liveness` and copies no grammar.**
869
+ §The delegation model rules that the reading affordance which would genuinely
870
+ earn its place already exists and is that gate; a hook re-implementing the
871
+ `pid=<n> run=<key>` parse and the PID predicate would be a third copy of a
872
+ grammar evidence-kit owns. So the hook invokes the reader in **set mode** over
873
+ the scratch dir — which already quantifies the per-record verdict and already
874
+ resolves *exit 2 wins over red wins over green* (evidence-kit/SPEC.md
875
+ §check-producer-liveness) — and maps its exit class onto `verdict` and `live`.
876
+ Nothing about how a PID's liveness is decided is seconded here.
877
+
878
+ **The prerequisite is stated, not assumed.** A consumer that wires this hook with
879
+ no reader resolvable at `DELEGATION_KIT_LIVENESS_CMD` — evidence-kit unvendored,
880
+ or the knob deliberately emptied — gets `verdict=unavailable` on every line and a
881
+ probe that answers nothing. That is honest degradation and it is preferable to a
882
+ silent third parse that would work everywhere and drift from its owner.
883
+
884
+ **One line per firing**, appended, space-delimited `key=value` after a leading
885
+ timestamp:
886
+
887
+ ```
888
+ <UTC ISO-8601> event=<hook_event_name|-> session=<session_id|-> live=<yes|no> verdict=<green|red|corrupt|unavailable> records=<n> keys=<comma-separated top-level payload keys>
889
+ ```
890
+
891
+ Every field has a reader at a named transition, and no field is carried that this
892
+ list does not name one for:
893
+
894
+ - **timestamp** — read by the close-stage reader to order firings and to tell a
895
+ fresh line from a stale one.
896
+ - **`event`** — the payload's own `hook_event_name`. Read at the **first** firing,
897
+ to confirm the event fires at all for a dispatched session and that it is
898
+ spelled `SubagentStop`. The entry's whole correction turned on the event's
899
+ identity, which is what earns it a field.
900
+ - **`session`** — the payload's `session_id`, `-` otherwise. Read to separate the
901
+ firings of one top-level session from another's in a shared log. **It is not the
902
+ subagent's own id**, and the first firings settled that against the field's
903
+ original reader: a dispatched agent and its dispatcher log the *same*
904
+ `session_id`, and neither matches the identifier a stage stamp carries, so
905
+ attributing a firing to a stage session is not a reading this field supports.
906
+ The payload's `agent_id` is the discriminator that would, and logging it is a
907
+ grammar change this variant did not take.
908
+ - **`live`** — `yes` exactly when the reader reported a live producer. **The
909
+ decisive field**; the honest limit below is what bounds how it may be read.
910
+ - **`verdict`**, **`records`** — the reader's exit class and the number of `*.run`
911
+ records under the scratch dir. Read together: `records=0` makes a `live=no`
912
+ uninformative, while `records=2 live=no` says records existed and their
913
+ producers had exited. `verdict=corrupt` carries `live=no` because the field is
914
+ two-valued — the pair is the reading, never `live` alone.
915
+ - **`keys`** — the payload's top-level key set, nothing more. Read **once**, at
916
+ the first firing, to settle what a `SubagentStop` payload carries without
917
+ asserting anything about it in advance. **It returned against the advance
918
+ claim**, which is the whole reason the field logs the set rather than assuming
919
+ it: the payload carries a top-level `background_tasks`, so the pre-wiring premise
920
+ that it names no background task was wrong, and only the key read caught it.
921
+ Values stay unlogged on the ground that survives that correction — logging them
922
+ would put transcript paths and prompt ids into a file for no reader — so what
923
+ `background_tasks` actually carries is **unsettled**, and reading it is a change
924
+ to this privacy ruling rather than a free follow-up. The question is filed as
925
+ `subagent-stop-payload-background-tasks-read`.
926
+
927
+ **`records` is counted by the hook's own `*.run` glob, not parsed back out of the
928
+ reader**, and the reason is the reader's output contract rather than convenience:
929
+ `check-producer-liveness` publishes a count only on its green line, printing one
930
+ finding per blocking record on red and no total. Same directory, same glob, same
931
+ number — and the field stays meaningful when the reader is unavailable, which is
932
+ the case the prerequisite above makes reachable. For the same reason the reader's
933
+ first output line is **not** carried verbatim: over `verdict`, `records` and
934
+ `live` it adds only the blocking record paths, and a free-text field would break
935
+ the space-delimited parse the grammar above is for.
936
+
937
+ **The log is capture-tier** — gitignored, advisory, drained by a named reclaim
938
+ path (gate-sdk/SPEC.md §The workflow directory), which is what keeps
939
+ `check-workflow-tiering` green on a member that is neither tracked nor ignored,
940
+ and it declares itself on the close-surface roster (lifecycle-kit/SPEC.md §The
941
+ close-surface roster) naming its own clear as the reclaim path:
942
+
943
+ close-surface: .workflow/subagent-stop-liveness.log advisory reclaim=: > .workflow/subagent-stop-liveness.log
944
+
945
+ `advisory` rather than `forced`, on the reasoning guard-kit's friction log takes:
946
+ nothing refuses a close that skips it, and a visible skip is the honest mode for a
947
+ probe.
948
+
949
+ **No gate observes the wiring, and that is recorded rather than assumed.**
950
+ `check-settings-pins` asserts only the pinned paths in the consumer's pins file
951
+ (none under `hooks`), `check-settings-paths`'s subject is `permissions.allow[]`
952
+ alone and never `hooks[].hooks[].command`, and `check-memory-off` scans the memory
953
+ surface. So the registration reds nothing — and neither would a registration
954
+ naming a script that does not exist. A session decides this wiring by reading this
955
+ section, never by predicting a verdict.
956
+
957
+ ### The probe is asymmetric, and no reading may treat it otherwise
958
+
959
+ **A `live=yes` line proves the harness does not defer the stop.** One firing with
960
+ a live producer settles the unknown in that direction and the class stands.
961
+
962
+ **No accumulation of `live=no` lines proves that it does.** `live=no` is equally
963
+ consistent with *the harness deferred the stop*, *the session waited correctly*,
964
+ and *the session recorded nothing* — the last being the residue guard-kit rule 15
965
+ advises against and does not close. Passive accumulation therefore cannot return
966
+ the finding that would dissolve the class, and anyone waiting for it waits forever
967
+ and then reports the wrong thing.
968
+
969
+ **So the reading is bought by a deliberate firing, never by a wait.** A dispatched
970
+ session backgrounds a producer that runs long, writes its `<key>.run` record, and
971
+ then ends its turn. Both outcomes are results: the hook fires immediately with
972
+ `live=yes`, so the harness does not defer and §Operative residency's axis holds at
973
+ the turn-end too; or the hook does not fire until the child exits, so the harness
974
+ does defer, the class dissolves, and this template's remaining value is the
975
+ evidence for retiring it. The log is what makes that firing, and every later
976
+ accidental one, legible.
977
+
978
+ **The firing was bought, and it returned the first branch.** A dispatched agent
979
+ backgrounded a producer with a recorded PID and ended its turn without waiting;
980
+ the log took `live=yes verdict=red records=1` four seconds later, and again at
981
+ that agent's own stop, while the producer went on writing for another two and a
982
+ half minutes. **The harness does not defer the stop**, so the class the waiting
983
+ rule exists for does not dissolve, the relocation to guard-kit rule 14 stands, and
984
+ a blocking hook is the only lever left — which is a second authorization this
985
+ result does not grant.
986
+
987
+ **The same firings settled a second thing nothing could have settled before
988
+ wiring: `SubagentStop` is not the session-end event.** It fired seventeen times
989
+ inside one dispatched session that had ended no turn at all, spaced by assistant
990
+ steps rather than by the clock — a stretch spanning three long tool calls and no
991
+ assistant step produced no firing at all. A blocking variant would therefore
992
+ refuse at *every* intermediate step of a session rather than once at its return,
993
+ which is what a bounded run of blocks would actually be spent on. Recorded here
994
+ because it is a cost the blocking variant's authorization should be weighed
995
+ against, and because it is exactly the class of fact a logging-only probe exists
996
+ to buy.
997
+
532
998
  ## Resume journal — agent writes, scratch reset sweeps
533
999
 
534
1000
  **The contract, in four clauses.** A mutating agent journals to a repo-local
@@ -687,6 +1153,30 @@ diff review of agent gate edits remains a supervisor duty. `--fixture <dir>`
687
1153
  injects `staged-files` / `added-exemptions` lists (fixture-pair test
688
1154
  capability); live mode reads `git diff --cached`.
689
1155
 
1156
+ `checks/check-gate-tamper.gate` (`precommit`, binary-dispatched). `--fixture`
1157
+ **survives the port**: it selects the rule's own input corpus, which no knob
1158
+ resolves, so it is not the arrives-too-late shape gate-sdk/SPEC.md §The non-gate
1159
+ arm deletes — the invocation delegation-kit/README.md documents stays true.
1160
+
1161
+ **Criterion 4 binds on this gate as a property of the *consumer's* configured
1162
+ globs, not of the gate.** Under the kit-shipped `DELEGATION_KIT_GATE_FILES`
1163
+ default the corpus is the consumer's own gates directory, which holds no kit
1164
+ declaration, and the criterion clears. Under a config widening the globs to
1165
+ every kit's check dir — this repo's — the gate's own declaration falls inside
1166
+ them, and staging it makes the gate read its own bytes. Reading the kit default,
1167
+ which is the natural first stop, therefore gives the wrong answer for the tree
1168
+ the port actually runs against; gate-sdk/SPEC.md §The port-candidate criteria
1169
+ carries the instance class.
1170
+
1171
+ **Two behaviours changed with the port, and both are rulings rather than
1172
+ drift.** Assertion B's report lines came out of the shell form in no
1173
+ reproducible order once a commit added two matching exemptions; the
1174
+ compiled form emits the same **set** byte-sorted, on the kit-roots cohort's
1175
+ ruling that a compiled form implements set semantics rather than a shell's
1176
+ incidental ordering. And a trailing `--fixture` with no directory after it
1177
+ **hung** the shell form in its argument-parsing loop; the compiled form reads the
1178
+ missing value as the empty directory name and refuses. A hang is not a verdict, so ending it costs no assertion.
1179
+
690
1180
  ## check-agent-tier-explicit
691
1181
 
692
1182
  Every agent definition under `DELEGATION_KIT_AGENT_DIR` declares a `model:`
@@ -1073,6 +1563,107 @@ decreases.
1073
1563
  rotating operator reads one weekly trajectory per account rather than an
1074
1564
  interleaved stream.
1075
1565
 
1566
+ ## bin/wait-probe
1567
+
1568
+ `bin/wait-probe.sh` is the instrument behind §Operative residency's wait-primitive
1569
+ measurement: it stands a **known-duration producer** up and exercises candidate
1570
+ wait forms against it, recording one line per trial. Hand-invoked, no trigger,
1571
+ wired into **no** tier — it launches processes and sleeps for its declared
1572
+ durations, so a gate tier would put a multi-second sleep on every commit for a
1573
+ measurement bought once. Its precedent for existing at all is `demo/run-demo.sh`
1574
+ and `gate-sdk/bin/port-blockers.sh`, runnable artifacts a session invokes by hand.
1575
+ It writes nothing tracked: producers, markers and launch records go to
1576
+ `GATE_SDK_TMP_DIR`, trials to the capture-tier evidence file below, and it mints
1577
+ no knob of its own for either (§Layout and configuration owns why).
1578
+
1579
+ Exit **0** on a completed subcommand, **2** on misuse; `-h`/`--help` prints the
1580
+ subcommand roster on stdout and exits 0, the `bin/`-tool contract
1581
+ (gate-sdk/SPEC.md §The bin/-tool contract).
1582
+
1583
+ **One trial** is: launch a producer that sleeps a declared duration and then writes
1584
+ a completion marker; record its PID at launch in a `<key>.run` file exactly as
1585
+ `templates/agent-execution.md` mandates — the rule applies to the instrument that
1586
+ measures it, so the probe's own producers are visible to `check-producer-liveness`
1587
+ and to guard rule 14 like any other; arm the wait form under test; and record
1588
+ whether the waiter exited **before** the marker appeared. That before/after
1589
+ relation is the whole measurement: a waiter that outlives its condition is
1590
+ working, and one that exits early is the observed failure.
1591
+
1592
+ **The producer's duration is swept, not fixed**, because a single duration cannot
1593
+ distinguish the candidate causes. The probe reads no harness internals and asserts
1594
+ no ceiling; it varies the input and reports where the behavior changes.
1595
+
1596
+ **Two axes, and the second is what the instrument earns its keep on.** The *form*
1597
+ axis varies how the wait is armed. The *predicate* axis varies what the loop tests
1598
+ — a completion marker, or the producer's liveness. A form-only instrument can
1599
+ report that a form failed and can never report **why**, and the attested failures
1600
+ turned out to sit on the predicate axis, which a form-only sweep would have
1601
+ recorded as unexplained. Both axes are swept in the same run on identical
1602
+ producers, so no cell's result rests on a comparison with a differently-shaped
1603
+ trial, and every form arms the **same** wait body.
1604
+
1605
+ **The per-trial line.** Every field has a named reader and the field set is closed
1606
+ at these:
1607
+
1608
+ - **`form`** — which wait form the trial armed. Read at the comparison; the only
1609
+ field that distinguishes the candidates.
1610
+ - **`predicate`** — what the loop tested. Read at the classification, and it is
1611
+ what separates a failing *form* from a failing *condition*.
1612
+ - **`producer_ms`** — the producer's declared duration. Read at the sweep analysis:
1613
+ a ceiling shows as a threshold in this field.
1614
+ - **`waiter_exit`** — the waiter's exit status. Read at the classification, to
1615
+ separate a signal status from a clean zero with the marker absent.
1616
+ - **`marker_at_ms`**, **`waiter_at_ms`** — elapsed wall-clock at the marker's
1617
+ appearance and at the waiter's exit. Read **together and only together**: their
1618
+ *order* is the measurement and neither alone says anything.
1619
+ - **`producer_alive_at_exit`** — whether the recorded PID still answered `kill -0`
1620
+ when the waiter exited, establishing the *producer verifiably alive* condition —
1621
+ on the recorded PID and never a process-table pattern, which is the protocol's
1622
+ own rule.
1623
+ - **`class`** — `ok` on a clean trial; otherwise the cause, from the closed list
1624
+ below.
1625
+
1626
+ The producer's own PID is **not** logged: the `<key>.run` record already holds it
1627
+ for the lifetime the wait needs, and a second copy in an advisory log would be a
1628
+ PID with no reader once the trial ends.
1629
+
1630
+ **The candidate causes are enumerated before the run, not after it**, so a run
1631
+ returns a cause rather than an anecdote:
1632
+
1633
+ - **(i) `reaped`** — the harness or the session boundary killed the backgrounded
1634
+ shell. Tell: a signal exit status with the producer still alive.
1635
+ - **(ii) `ceiling`** — a wall-clock deadline the form carries. Tell: early exits
1636
+ cluster above one duration and short trials never fail.
1637
+ - **(iii) `predicate`** — the condition went true, or could not go false, for a
1638
+ reason unrelated to the producer. Tell: a clean **zero** exit with the marker
1639
+ absent, reproducing on a form the harness never touched.
1640
+ - **(iv) `unexplained`** — recorded as such and reported as such. A closed list
1641
+ that cannot say *I do not know* would force a wrong attribution, which is the
1642
+ failure the enumeration exists to avoid.
1643
+
1644
+ **The honest limit, and it is a division of labour rather than a defect.** Cause
1645
+ (ii)'s tell is a **threshold across the sweep**, so no single line can carry it:
1646
+ `record` classifies from the tells a trial can see on its own and the `report` arm
1647
+ is the only reader that sees the sweep whole and can name (ii). A reader taking a
1648
+ line's `class` for the run's verdict has read the wrong surface. The second limit
1649
+ is scope: the probe arms the forms a shell can arm and the *session* arms the
1650
+ harness's own, calling `record` for each — the tool cannot invoke a harness tool
1651
+ parameter, so a run that measures the harness forms is a session's run and `sweep`
1652
+ is the harness-uninvolved reproducer a second machine executes.
1653
+
1654
+ **The trials land in `.workflow/wait-primitive-evidence.txt`** — capture-tier,
1655
+ gitignored, advisory (gate-sdk/SPEC.md §The workflow directory), declared on the
1656
+ close-surface roster (lifecycle-kit/SPEC.md §The close-surface roster) naming its
1657
+ own clear as the reclaim path:
1658
+
1659
+ close-surface: .workflow/wait-primitive-evidence.txt advisory reclaim=: > .workflow/wait-primitive-evidence.txt
1660
+
1661
+ `advisory` rather than `forced`, on the reasoning §The turn-end liveness probe's
1662
+ log already takes: nothing refuses a close that skips it, and a visible skip is
1663
+ the honest mode for a probe. The **finding** — the branch the trials select and
1664
+ its grounds — lands in this SPEC, never in the log; the log is evidence, and
1665
+ evidence is not the record.
1666
+
1076
1667
  ## Layout and configuration
1077
1668
 
1078
1669
  ```
@@ -1083,15 +1674,17 @@ delegation-kit/
1083
1674
  bin/run-budget-guard-tests.sh # budget-guard decision-table runner
1084
1675
  bin/run-dispatch-guard-tests.sh # dispatch-guard decision-table runner (D1/D2/D3)
1085
1676
  bin/run-trend-tests.sh # trend-reporter assertion runner
1677
+ bin/wait-probe.sh # wait-primitive probe: hand-invoked, no trigger, wired into no tier
1086
1678
  lib/delegation.sh # shared helpers for the usage tools and the kit's gates
1087
1679
  usage-tests/cases.tsv # expected-verdict <TAB> scenario knobs
1088
1680
  usage-tests/budget-guard-cases.tsv # expected-action <TAB> scenario knobs
1089
1681
  usage-tests/dispatch-guard-cases.tsv # expected-outcome <TAB> scenario knobs
1090
1682
  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
1683
+ checks/check-gate-tamper.gate # binary-dispatched; live arm reads the index through git
1684
+ checks/check-rule-citation.gate # hermetic, binary-dispatched: every SPEC rule citation resolves to a template lead-in
1685
+ checks/check-agent-tier-explicit.gate # hermetic, binary-dispatched: every agent definition declares an explicit model:
1094
1686
  gate-tests/check-gate-tamper/{good,bad}/
1687
+ gate-tests/check-gate-tamper.test.sh # the live arm, over throwaway git repos
1095
1688
  gate-tests/check-rule-citation/{good,bad}/
1096
1689
  gate-tests/check-agent-tier-explicit/{good,bad}/
1097
1690
  templates/agent-execution.md # full protocol, bound as a skill shim
@@ -1100,6 +1693,7 @@ delegation-kit/
1100
1693
  templates/agent-dispatch-guard.sh # PreToolUse(Agent) dispatch-shape guard (D1/D2/D3)
1101
1694
  templates/statusline-usage.sh # push usage.txt producer (statusline hook) + status bar incl. the queue counter group
1102
1695
  templates/usage-poller.sh # poll usage.txt producer (timer-driven, fail-soft)
1696
+ templates/subagent-stop-liveness.sh # SubagentStop turn-end liveness probe (logging-only)
1103
1697
  templates/delegation-config.sh # knob overrides (arrays live here)
1104
1698
  smoke/install.sh
1105
1699
  smoke/violation.sh
@@ -1197,6 +1791,28 @@ layout as defaults):
1197
1791
  filter: a
1198
1792
  prefix the consumer declared cannot be lost, and without `gate.sh` the config
1199
1793
  is used exactly as written.
1794
+ - `DELEGATION_KIT_STOP_LOG` — the turn-end probe's log (§The turn-end liveness
1795
+ probe (template)); default
1796
+ `${GATE_SDK_WORKFLOW_DIR:-.workflow}/subagent-stop-liveness.log`, the same
1797
+ deferral guard-kit's two logs already take. No scratch-dir knob sits beside it:
1798
+ the launch record's home is `${GATE_SDK_TMP_DIR:-.tmp}`, the cross-kit deferral
1799
+ every kit reaching that directory already resolves it through, and a second
1800
+ name for it would be the duplication rather than the config. **The rule has
1801
+ since governed a second artifact and held**: `bin/wait-probe` (§bin/wait-probe)
1802
+ writes producers, markers and `<key>.run` records into that same directory and
1803
+ mints no knob of its own for it either. It mints none for its evidence log
1804
+ either, and there the reasoning is the narrower one this bullet's own knob does
1805
+ not meet: a knob needs a reader, and `DELEGATION_KIT_STOP_LOG` has one — a
1806
+ *second process*, the consumer-side hook, which must be told where to write.
1807
+ The probe both writes and reads its own log in one tool, so a knob there would
1808
+ be a name nothing reads, and the close stage reaches the file through the
1809
+ roster's literal rather than through a knob.
1810
+ - `DELEGATION_KIT_LIVENESS_CMD` — the liveness reader the probe invokes in set
1811
+ mode; default `evidence-kit/checks/check-producer-liveness.sh`. A knob rather
1812
+ than a literal because a consumer's evidence-kit may sit elsewhere, and because
1813
+ it is read through the **unset** form, so an explicitly empty value is the
1814
+ supported way to run the probe with no reader at all — the honest-degradation
1815
+ case the section states.
1200
1816
  - `DELEGATION_KIT_READONLY_TYPES` — agent-type names the consumer dispatches for
1201
1817
  read-only work; D2's only trigger (§The delegation model). Default empty, in
1202
1818
  which case D2 is inert by construction. Every entry is the consumer's own
@@ -1230,6 +1846,17 @@ its consumer session brief (`scripts/session-context.sh`) additionally prints
1230
1846
  the verdict line at SessionStart for planning-time visibility — a consumer-side
1231
1847
  edit; the context-kit template stays uncoupled from delegation-kit.
1232
1848
 
1849
+ `subagent-stop-liveness.sh` is a third hook, and the only one on a non-`PreToolUse`
1850
+ event. It registers under `SubagentStop` in the consumer's `.claude/settings.json`
1851
+ — an event that takes **no matcher**, so the entry carries a `hooks` array alone
1852
+ and is not tool-scoped, the shape a `SessionStart` entry already has. Copy the
1853
+ template into the gates dir and wire `bash scripts/subagent-stop-liveness.sh`; it
1854
+ sources no kit lib at all (§The turn-end liveness probe (template) owns why) and
1855
+ resolves its reader through `DELEGATION_KIT_LIVENESS_CMD`. Registration is again
1856
+ the whole opt-in, and here the opt-in is also the consent: the wiring is a
1857
+ permission-surface write, so it is the consumer's own act and never an agent
1858
+ session's.
1859
+
1233
1860
  `agent-dispatch-guard.sh` is a second hook on that same matcher, registered the
1234
1861
  same way and **independently**: the harness fires every hook a matcher carries
1235
1862
  and any exit 2 blocks, so neither guard knows about the other and a consumer
@@ -1259,7 +1886,21 @@ costs the work in flight.
1259
1886
  `check-gate-tamper` speaks the full gate contract (`GATE-TAMPER: clean
1260
1887
  (…)` / findings + `help:` lines / exit 0-1-2) and ships the standard
1261
1888
  `good/`+`bad/` fixture pair driven through `--fixture` by gate-sdk's
1262
- `run-gate-tests.sh`.
1889
+ `run-gate-tests.sh`. The pair reaches both assertions — the bad case carries a
1890
+ co-staged non-meta path *and* a newly added path exemption matching one of its
1891
+ own staged files, beside a bare token assertion B must pass over.
1892
+
1893
+ **The pair cannot reach the live arm, and that is a property of the injection
1894
+ rather than of the cases.** `--fixture` supplies both lists directly, so the
1895
+ function that derives them — reading each staged gate file's bytes out of the
1896
+ object store and diffing its exemption set against `HEAD`'s — runs in no fixture
1897
+ case. `gate-tests/check-gate-tamper.test.sh` is where it is exercised: each case
1898
+ builds a throwaway git repo, stages a commit shape into a real index, and runs
1899
+ the gate inside it. It holds the four verdicts the pair cannot — a HEAD-resident
1900
+ exemption is not "added" even when a co-staged file matches it, a newly appended
1901
+ one is, an added one matching nothing staged stays silent, and a staged
1902
+ *deletion* of a gate file reads as an empty exemption set rather than a failure
1903
+ to read.
1263
1904
 
1264
1905
  `check-rule-citation` speaks the same gate contract and ships the standard
1265
1906
  `good/`+`bad/` fixture pair (a citation resolving to a template lead-in vs one