checkwright 0.21.0 → 0.23.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 (489) hide show
  1. package/README.md +1013 -50
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +40 -0
  4. package/lib/common/profile.sh +33 -0
  5. package/lib/common/recipe.sh +56 -43
  6. package/lib/diff.sh +64 -0
  7. package/lib/doctor.sh +81 -7
  8. package/lib/init.sh +167 -52
  9. package/lib/uninstall.sh +212 -0
  10. package/lib/update.sh +34 -0
  11. package/package.json +2 -2
  12. package/payload/artifact/targets.list +30 -0
  13. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  14. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  15. package/payload/canon-kit/README.md +2 -0
  16. package/payload/canon-kit/SPEC.md +666 -59
  17. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
  18. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  19. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  20. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  21. package/payload/canon-kit/checks/check-docs-link-convention.sh +12 -4
  22. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  23. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  24. package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
  25. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  26. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  27. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  28. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  29. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  30. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  31. package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
  32. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  33. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
  35. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  36. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  37. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  38. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  39. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  51. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  63. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  64. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  68. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  69. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  70. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  71. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  72. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +32 -8
  73. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  74. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  75. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  76. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  77. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  78. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  79. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  80. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  81. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  82. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  83. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  84. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  85. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  86. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  87. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  88. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  89. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  90. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  91. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  92. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  93. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
  94. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  95. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  96. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  97. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  98. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
  99. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  100. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  101. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  102. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  103. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  104. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  105. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  106. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  107. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  108. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  109. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  110. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  111. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  112. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  113. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  114. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  115. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  116. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  117. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  118. package/payload/canon-kit/lib/spec.sh +109 -70
  119. package/payload/canon-kit/smoke/install.sh +21 -1
  120. package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
  121. package/payload/context-kit/README.md +4 -1
  122. package/payload/context-kit/SPEC.md +166 -9
  123. package/payload/context-kit/bin/env-probe.sh +19 -6
  124. package/payload/context-kit/checks/check-brevity.sh +1 -0
  125. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  126. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  127. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  128. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  129. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  130. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  131. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  132. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  133. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  134. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  135. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  136. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  137. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  138. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  139. package/payload/context-kit/lib/toolfloor.sh +15 -4
  140. package/payload/context-kit/smoke/agents-md.sh +12 -1
  141. package/payload/context-kit/smoke/install.sh +4 -1
  142. package/payload/delegation-kit/README.md +3 -3
  143. package/payload/delegation-kit/SPEC.md +499 -26
  144. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  145. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  146. package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
  147. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  148. package/payload/delegation-kit/lib/delegation.sh +1 -0
  149. package/payload/delegation-kit/smoke/install.sh +2 -1
  150. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  151. package/payload/delegation-kit/templates/agent-execution.md +127 -12
  152. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  153. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  154. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  155. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  156. package/payload/doctrine-kit/DOCTRINE.md +112 -11
  157. package/payload/doctrine-kit/README.md +12 -3
  158. package/payload/doctrine-kit/SPEC.md +163 -11
  159. package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
  160. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  161. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  162. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  163. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  164. package/payload/doctrine-kit/smoke/install.sh +167 -1
  165. package/payload/drift-kit/README.md +3 -2
  166. package/payload/drift-kit/SPEC.md +264 -22
  167. package/payload/drift-kit/bin/kfric.sh +21 -2
  168. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  169. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  170. package/payload/drift-kit/smoke/install.sh +183 -1
  171. package/payload/drift-kit/templates/economics.md +9 -0
  172. package/payload/drift-kit/templates/kpis.list +6 -1
  173. package/payload/evidence-kit/README.md +20 -6
  174. package/payload/evidence-kit/SPEC.md +355 -17
  175. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  176. package/payload/evidence-kit/checks/check-battery-roster.sh +87 -0
  177. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  178. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  179. package/payload/evidence-kit/checks/check-producer-liveness.sh +35 -0
  180. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  181. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  186. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  187. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  188. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  189. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  190. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  191. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  192. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  193. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  194. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  195. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  196. package/payload/evidence-kit/lib/evidence.sh +18 -0
  197. package/payload/evidence-kit/smoke/install.sh +17 -3
  198. package/payload/gate-sdk/README.md +17 -1
  199. package/payload/gate-sdk/SPEC.md +4427 -92
  200. package/payload/gate-sdk/bin/build-native.sh +38 -0
  201. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  202. package/payload/gate-sdk/bin/gen-pre-commit.sh +32 -2
  203. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  204. package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
  205. package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
  206. package/payload/gate-sdk/bin/run-gates.sh +37 -2
  207. package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
  208. package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
  209. package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
  210. package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
  211. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  212. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  213. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  214. package/payload/gate-sdk/checks/check-core-files.sh +28 -4
  215. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  216. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  217. package/payload/gate-sdk/checks/check-exec-bit.sh +21 -1
  218. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  219. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
  220. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
  221. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  222. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  223. package/payload/gate-sdk/checks/check-gate-output.sh +41 -3
  224. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
  225. package/payload/gate-sdk/checks/check-graph.sh +5 -5
  226. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  227. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  228. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  229. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  230. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  231. package/payload/gate-sdk/checks/check-readme-roster.sh +6 -0
  232. package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
  233. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  234. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  235. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  236. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  237. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  238. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  239. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  240. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  241. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  242. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  243. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  244. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  245. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  246. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  247. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  248. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  249. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  250. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  251. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  252. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  253. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  254. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  255. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  256. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  257. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  258. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  259. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  260. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  261. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  262. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  263. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  264. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  265. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  266. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  267. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  268. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  269. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  270. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  271. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  272. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  273. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  274. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  275. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  276. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  277. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  278. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  279. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  280. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  281. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  282. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  283. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  284. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  285. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  286. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  287. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  288. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  289. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  290. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  291. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  292. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  293. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  294. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  295. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  296. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  297. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  298. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  299. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  300. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  301. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  302. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  303. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  304. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  305. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  306. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  307. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  308. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  309. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  310. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  311. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  312. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
  313. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  314. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  315. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  316. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  317. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  318. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  319. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  320. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  321. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  322. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  323. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  324. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  325. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  326. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  327. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  328. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  329. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  330. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  331. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  332. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  333. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  334. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  335. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  336. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  337. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  338. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  339. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  340. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  341. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  342. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  343. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  344. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  345. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  346. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  347. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
  348. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  349. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  350. package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
  351. package/payload/gate-sdk/lib/gate.sh +208 -9
  352. package/payload/gate-sdk/lib/inject.sh +46 -1
  353. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  354. package/payload/gate-sdk/smoke/install.sh +61 -1
  355. package/payload/guard-kit/README.md +18 -14
  356. package/payload/guard-kit/SPEC.md +366 -72
  357. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  358. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  359. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  360. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  361. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  362. package/payload/guard-kit/lib/guard.sh +277 -54
  363. package/payload/guard-kit/templates/close-triage.md +38 -10
  364. package/payload/guard-kit/templates/guard-config.sh +3 -0
  365. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  366. package/payload/lifecycle-kit/README.md +12 -1
  367. package/payload/lifecycle-kit/SPEC.md +991 -41
  368. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  369. package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
  370. package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
  371. package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
  372. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  373. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  374. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  375. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  376. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  377. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  378. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  379. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  380. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  381. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  382. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  383. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  384. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  385. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  386. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  387. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  388. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  389. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  390. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  391. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  392. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  393. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  394. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  395. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -3
  396. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  397. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  398. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  399. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  400. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  401. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  402. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  403. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  404. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  405. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  406. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  407. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  408. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  409. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  410. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  411. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  412. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
  413. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
  414. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  415. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  416. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  417. package/payload/lifecycle-kit/lib/stages.sh +12 -2
  418. package/payload/lifecycle-kit/smoke/install.sh +83 -4
  419. package/payload/lifecycle-kit/templates/consult.md +73 -0
  420. package/payload/lifecycle-kit/templates/lead.md +139 -7
  421. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  422. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  423. package/payload/lifecycle-kit/templates/stages/close.md +45 -5
  424. package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
  425. package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
  426. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  427. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  428. package/payload/queue-kit/README.md +6 -1
  429. package/payload/queue-kit/SPEC.md +350 -6
  430. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  431. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  432. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  433. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  434. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  435. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  436. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  437. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  438. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  439. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  440. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  441. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  442. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  443. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  444. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  445. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  446. package/payload/queue-kit/lib/queue.sh +4 -19
  447. package/payload/queue-kit/smoke/install.sh +4 -1
  448. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  449. package/payload/site-kit/SPEC.md +64 -27
  450. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  451. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  452. package/payload/site-kit/smoke/install.sh +9 -1
  453. package/profiles.list +36 -8
  454. package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
  455. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  456. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  457. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  458. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  459. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  460. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  461. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  462. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  463. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  464. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  465. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  466. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -180
  467. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  468. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  469. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  470. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
  471. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  472. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  473. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  474. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  475. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  476. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  477. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  478. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  479. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  480. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  481. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  482. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -104
  483. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  484. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  485. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  486. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  487. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  488. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  489. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -182,6 +182,211 @@ than left out — an omitted `model:` resolves to the literal `inherit`, so
182
182
  omission spells the dispatcher's tier rather than a neutral absence, and
183
183
  `check-agent-tier-explicit` is that clause's oracle over the tracked surface.
184
184
 
185
+ **Isolation's second purpose, and why the cost objection does not land.** The
186
+ template's **A read-only claim is made by isolation, not by sentence** rule
187
+ states the disposition and carries none of its grounds, which are these. "It has
188
+ no Edit tool" is not the safety property it reads as: every agent type available
189
+ for audit-shaped work carries write tools, or at least a shell that reaches
190
+ `git`, so a toolset is never narrowed by the brief describing it. And the
191
+ isolation is not purely a cost — the harness auto-cleans a worktree left
192
+ unchanged, so the worktree survives **iff** the agent was not in fact read-only,
193
+ which makes one mechanism both the confinement and its own detector. Gitignoring
194
+ the worktree path trades that free `git status` signal away, which is why the
195
+ rule's second cost sends the parent to an explicit `git worktree list` at the
196
+ reaping boundary instead.
197
+
198
+ **`worktree.baseRef` is vendor configuration, and choosing it is the consumer's
199
+ job.** The template's **Isolation charges three harness costs, and paying them
200
+ is the parent's job** rule names the knob and both of its values rather than a
201
+ choice, because a vendoring consumer inherits the template and never a settings
202
+ file. A consumer that dispatches isolated agents therefore sets the knob
203
+ deliberately instead of inheriting the default, and — where its harness config is
204
+ gated — pins it, through the general settings-pin mechanism (context-kit/SPEC.md
205
+ §check-settings-pins) rather than anything this kit ships. What is ruled is that
206
+ the value be *chosen*, never which value: a consumer wanting a clean tree per
207
+ dispatch is right to stay on the default. No knob joins delegation-kit's own
208
+ roster for it (§Layout and configuration) — this is harness configuration, not
209
+ kit configuration, and a kit knob shadowing a vendor setting would be a second
210
+ source for one value. Recorded so a later reader does not read the omission as an
211
+ oversight and close it.
212
+
213
+ **Why that cost names a knob and not a measurement.** "The worktree is cut at
214
+ the remote tracking ref, so staleness equals the unpushed backlog" describes the
215
+ `fresh` value alone; stated as universal it is false, and it reached shipped,
216
+ consumer-facing doctrine on seven attestations — every one taken under that
217
+ default, not one of them bearing on whether the behavior was configurable.
218
+ Repeated confirmation of a behavior is not evidence about its mutability, and
219
+ each re-confirmation made the mechanism feel more settled and so suppressed the
220
+ configuration probe that would have settled it. Hence the rule's shape: name the
221
+ knob and both values, and leave any measurement attributed to the configuration
222
+ it was taken under. It follows that no parent "owes the doubt back" for a
223
+ structural defect here — there is none, and the discipline below costs one line
224
+ in a prompt.
225
+
226
+ **The child-side rev discipline is kept as defence in depth, and the first
227
+ ground alone is sufficient.** The parent cannot read the child's *effective*
228
+ setting — `baseRef` resolves on the dispatching machine's merged settings,
229
+ nothing in the dispatch payload carries it and nothing returns it — so a parent
230
+ assuming either value is asserting an unverified premise about a third-party
231
+ tool, which is the move that produced the false doctrine above. Second, a
232
+ vendoring consumer inherits the template and not a settings file, so for every
233
+ consumer that has not set the knob the discipline is the whole protection. Third,
234
+ even a repo that pins the knob is not covered end to end: a managed tier and a
235
+ command-line override outrank a project settings file and lie outside any repo's
236
+ reach. It is also nearly free and self-verifying — one command whose output *is*
237
+ the evidence — so under a holding pin it degrades from load-bearing to a cheap
238
+ assertion rather than becoming dead weight.
239
+
240
+ **The untracked half reaches no configuration at all, and its disposition is
241
+ refusal.** An isolated child sees only committed state, so the third cost is a
242
+ ruling rather than a mitigation: no value of the knob helps and naming a rev does
243
+ not either. Attested twice — a sweep sent to triage an untracked capture log read
244
+ an empty file and reported its corpus absent, and a settings-overlay comparison
245
+ saw no overlay because the local settings file is uncommitted. Both returned a
246
+ confident "nothing there", indistinguishable in shape from a clean result, which
247
+ makes it the worse of the two failure modes. It binds *against* the read-only
248
+ rule rather than beside it: a read-only claim is made by isolation, and isolation
249
+ is what blinds the read, so a claimed-read-only sweep over an untracked corpus
250
+ has no correct form at all.
251
+
252
+ **The dispatch-shape rules are one mechanism, seen from several sides.** The template's **Never dispatch
253
+ a fork to narrow a child**, **A read-only claim is made by isolation, not by
254
+ sentence**, and **A child's only upward route is a durable artifact** rules are
255
+ one defect seen from three sides: each governs the *shape of a dispatch call*,
256
+ and each failed the same way — the prose did not reach the reader it binds.
257
+ One attested surface per rule: a fork dispatched as a read-only audit completed
258
+ a whole stage, commits included; four forks dispatched with prose-only
259
+ "read-only, no edits" briefs, one of which committed unreviewed on the shared
260
+ branch; and repeated fan-outs, across stages and across iterations, messaged the top-level
261
+ session instead of their dispatcher, which no prompt wording could have fixed.
262
+
263
+ **Why an oracle is owed here and not for the turn-ending rule.** §Operative
264
+ residency closes on the finding that a restated rule is reachable, not obeyed,
265
+ and owes no gate because no check can read a session's choice to end a turn —
266
+ the act leaves no tracked artifact. A dispatch leaves no tracked artifact
267
+ either, so the distinguishing axis is not durability but interception:
268
+
269
+ > Where a rule binds an act that leaves no tracked artifact, the enforcement
270
+ > question is whether the act passes a **chokepoint** — not whether it reaches
271
+ > the tree. A dispatch does. A turn-end does not.
272
+
273
+ **The chokepoint — what a `PreToolUse` hook can actually read.** The payload
274
+ carries `session_id`, `prompt_id`, `transcript_path`, `cwd`, `permission_mode`,
275
+ `hook_event_name`, `tool_name`, `tool_input`, and `tool_use_id`; and, **only
276
+ when the hook fires inside a subagent**, `agent_id` and `agent_type`. For the
277
+ dispatch tool, `tool_input` carries the dispatch's own parameters —
278
+ `subagent_type`, `isolation`, `model`, `description`, `prompt`. Three
279
+ consequences carry the guard below: the fork ban has an exact trigger
280
+ (`tool_input.subagent_type`), the read-only claim has an exact trigger
281
+ (`tool_input.isolation`), and depth has an exact, *documented* discriminator —
282
+ `agent_id` is present iff the dispatching session is itself a subagent, so its
283
+ presence means the call about to be made creates a grandchild.
284
+
285
+ **Honest limit on that roster.** It is sourced from the harness's own published
286
+ hook contract, fetched rather than recalled, and from nothing in this tree —
287
+ the same footing as `CLAUDE_CODE_CHILD_SESSION`'s "verified, not trusted"
288
+ treatment (lifecycle-kit/SPEC.md §bin/session-id.sh). A future harness revision
289
+ reshaping the payload is drift this SPEC cannot self-detect; only re-reading the
290
+ hook contract catches it.
291
+
292
+ **Two depth routes ruled out**, both being the obvious move.
293
+ `CLAUDE_CODE_CHILD_SESSION` is set in top-level sessions too, and
294
+ `CLAUDE_CODE_SESSION_ID` carries the *root* id for a child, so a depth-1 and a
295
+ depth-2 dispatcher are indistinguishable by environment alone — that route
296
+ ships a rule silently mis-firing at the top level. The meta record beside a
297
+ transcript does carry an exact spawn depth, and that route works and is
298
+ deliberately not taken: it couples a hook to an *uncontracted* harness artifact
299
+ to answer a question one *contracted* boolean already answers. The
300
+ stage-economics meter accepts that same coupling (drift-kit/SPEC.md §The
301
+ stage-economics meter, the fan-out row) because it needs the whole spawn forest
302
+ and no contracted field supplies it; a hook needs one bit and gets it under
303
+ contract. The axis is what the contract supplies, not appetite for risk.
304
+
305
+ `templates/agent-dispatch-guard.sh` is that oracle — a second `PreToolUse` hook
306
+ on matcher `Agent`, beside the budget guard, composed from
307
+ `guard-kit/lib/guard.sh` primitives. It reads the payload once and runs the
308
+ rules below, in order:
309
+
310
+ | # | rule | trigger | decision |
311
+ | --- | --- | --- | --- |
312
+ | D1 | fork ban | `tool_input.subagent_type` is `fork` | block |
313
+ | D2 | isolation claim | `tool_input.subagent_type` ∈ `DELEGATION_KIT_READONLY_TYPES` and `tool_input.isolation` is not `worktree` | block |
314
+ | D3 | depth advisory | payload carries `agent_id` | advise |
315
+
316
+ Order is load-bearing only between D1/D2 and D3 — a blocked dispatch needs no
317
+ advisory, so D3 runs last. D1 precedes D2 because the fork ban is unconditional
318
+ and its message is the more specific one for a dispatch violating both.
319
+
320
+ **Why a second guard rather than more rules in the budget guard.** Four
321
+ reasons, each independently sufficient: the budget guard blocks on a
322
+ **transient** condition and is deliberately knob-overridable, while these block
323
+ on a **permanent** doctrine violation that must not be per-dispatch
324
+ overridable; the budget guard reads no stdin at all; a consumer may want either
325
+ enforcement without the other, and hook registration is the only opt-in valve
326
+ there is; and their test lanes take different payload grammars. The harness
327
+ fires every hook registered on a matcher and any exit 2 blocks, so the two
328
+ compose with no dispatcher between them.
329
+
330
+ **D1 blocks unconditionally**, which the template's own boundary does not — a
331
+ fork stays correct where the child does the same job at the same authority, and
332
+ a hook cannot read intent. The block is ruled unconditional on the ground that
333
+ no sanctioned fork use exists in this doctrine, and the valve is **unwiring the
334
+ hook**, never a knob: a per-dispatch override is exactly the honour system
335
+ these rules exist to end, and a knob would restore it under a better
336
+ name. The block message names the two lawful alternatives, as guard-kit
337
+ requires of every block message.
338
+
339
+ **D2 is inert until configured**, by construction — the default roster is empty
340
+ and the kit ships no agent-type names. An inert D2 reports nothing; it is a
341
+ hook, not a gate, so there is no clean line to print. Stated here so a consumer
342
+ does not infer coverage it has not configured.
343
+
344
+ **D3 advises rather than blocks**, and both halves are deliberate. It cannot
345
+ block: a nested dispatch is legitimate and common — a stage session's own
346
+ read-only fan-out *is* a grandchild dispatch — so blocking would remove a
347
+ capability rather than confine one. It must not be silent: this is the one rule
348
+ whose bound reader provably never loads the protocol template (§One template, a
349
+ resident pointer), so the advisory is the *only* delivery of it, which is
350
+ §Operative residency's (a)–(c) shape applied at a hook instead of a doc. Ruled
351
+ out for D3: keying on whether the prompt text "names a path" — that fires on
352
+ the word and teaches dispatchers to game the wording, buying a green hook and
353
+ no channel. The `agent_id` trigger is exact and unforgeable; the message
354
+ carries the judgment the trigger cannot.
355
+
356
+ **Degradation — fail-open, but loud**, the posture guard-kit/SPEC.md §The guard
357
+ framework names for a deny-guard whose matcher proves the tool but whose rule
358
+ turns on a payload field:
359
+
360
+ | what is missing | behavior |
361
+ | --- | --- |
362
+ | `jq` absent | allow; one advisory naming the unenforced rules |
363
+ | payload unparseable, or `tool_input` absent | allow; same advisory |
364
+ | `subagent_type` absent from a parseable payload | D1 and D2 do not fire (nothing to match); D3 unaffected |
365
+ | `DELEGATION_KIT_READONLY_TYPES` unset or empty | D2 inert, and silently so; D1 and D3 unaffected |
366
+ | `DELEGATION_KIT_CONFIG_FILE` set but naming no file | allow; advisory naming D2 unenforced |
367
+ | `guard-kit/lib/guard.sh` not vendored | the guard exits 0 before sourcing, as both shipped guards already do |
368
+
369
+ Two implementation facts those rows force, recorded because the obvious build
370
+ gets each of them wrong:
371
+
372
+ - **The `jq`-absent arm cannot deliver through `guard_advise`.** That primitive
373
+ is itself jq-backed, and measuring it rather than assuming settles what
374
+ happens: with `jq` off `PATH` it writes an empty stdout and leaves a shell
375
+ "command not found" on stderr, which names none of the unenforced rules — the
376
+ silent success these rules exist to end, arriving inside the mechanism meant
377
+ to prevent it. The guard therefore emits the advisory envelope itself on that
378
+ arm, and every advisory literal it carries is kept free of the characters
379
+ JSON must escape, since that fallback carries no escaper.
380
+ - **The guard does not source delegation-kit's validating config loader**, only
381
+ the consumer config file, for the one array it reads. The loader exits 2 on
382
+ any malformed knob and a hook that exits 2 blocks, so routing the fork ban
383
+ through a validator for `DELEGATION_KIT_FAN_WIDTH` would let an unrelated
384
+ typo wedge every dispatch in the consumer whose primary token lever is
385
+ delegation — the fail-closed posture this guard is specified against,
386
+ arriving through the config door. The distinction the last two table rows
387
+ draw is this kit's standing one: a roster **configured to nothing** is
388
+ silent, a roster that **could not be read** is loud.
389
+
185
390
  ### One template, a resident pointer
186
391
 
187
392
  `templates/agent-execution.md` is the single source for the protocol — a
@@ -217,11 +422,112 @@ The consumer's CLAUDE.md carries no digest of the bullets, only a resident
217
422
  pointer: the pre-authorization sentence (consumer judgment on what delegation
218
423
  needs no ask) and `/agent-execution`. Rationale: a rule is resident only when it
219
424
  has no load trigger (the load-trigger-residency doctrine), and every protocol
220
- bullet triggers at `Agent` dispatch — which already has a mechanical seam, the
425
+ bullet triggers at `Agent` dispatch **for the role that dispatches** — which
426
+ already has a mechanical seam, the
221
427
  per-dispatch budget guard, whose block message names `/agent-execution`. The
222
- doctrine lives behind the trigger, not in the always-loaded file. Honest limit:
223
- the guard enforces budget mechanically, not protocol literacy — a session that
224
- dispatches without invoking the skill carries only the resident pointer.
428
+ doctrine lives behind the trigger, not in the always-loaded file. Honest limit,
429
+ tightened now that a second hook rides the same matcher: the guards enforce
430
+ mechanically exactly the rules that pass a chokepoint — the budget check, and
431
+ the dispatch-shape rules (§The delegation model) — and protocol literacy
432
+ beyond those stays unenforced. A session that dispatches without invoking the
433
+ skill still carries only the resident pointer for everything else.
434
+
435
+ **That role qualifier is load-bearing rather than hedging.** Stated without it,
436
+ the rationale is role-blind: a *dispatched* role fires no such trigger — it is
437
+ not dispatching at all, it is executing a stage, and no stage skill or stage
438
+ template loads this protocol — so for that reader the pointer posture leaves the
439
+ rule unreached, which is how a posture nobody disputes produced three incidents.
440
+ §Operative residency governs that case, and the bounded imperative it sanctions
441
+ in a consumer's always-loaded agent definition is this same doctrine applied at a
442
+ different reader, not an exception carved out of this paragraph.
443
+
444
+ ### Operative residency
445
+
446
+ A rule may be **restated as an imperative in a surface that does not own it**
447
+ when all three of these hold:
448
+
449
+ - **(a) Unreachable trigger.** The actor the rule binds never fires a trigger
450
+ that loads the rule's owning doc. This is a property of the *reader*, settled
451
+ by asking which triggers that reader actually fires.
452
+ - **(b) Imperative only.** What is restated is the instruction. The reasoning,
453
+ the failure analysis, and the mechanism stay with the owner.
454
+ - **(c) Adjacent citation.** The restatement names the owning surface beside
455
+ itself, so the owner stays the single place the rule is explained and changed.
456
+
457
+ Each condition has a reader at a transition rather than being self-evident: (a)
458
+ and (b) are read by whoever authors a restatement, at authoring, and again by a
459
+ reviewer or an authoring stage assessing an existing one; (c) is the pointer any
460
+ later reader — and any content-tiering check — follows back to the owner. The
461
+ reader the sanction exists for is the third and never inspects a condition at
462
+ all: the bound actor, which receives the imperative at the tier it always loads,
463
+ which is the whole point.
464
+
465
+ **The anti-licence clause is part of the rule, not commentary.** The sanction is
466
+ keyed on (a): a rule that the bound actor's own skill or template already loads
467
+ fails (a) and stays a pointer. Without that clause this reads as "duplicate when
468
+ it feels important", which is the failure content-tiering exists to prevent and
469
+ would cost more than the gap it closes.
470
+
471
+ **This is load-trigger residency's own logic, not an exception to it.** That
472
+ doctrine earns a rule a place in an always-loaded file only when no stage, skill,
473
+ or tool-call trigger exists to load it, and the decisive question is *exists for
474
+ whom*. A trigger that exists but that the bound actor never fires is, for that
475
+ actor, no trigger. The doctrine's stated justification — a rule a stage or a tool
476
+ call would load anyway costs nothing to defer and everything to keep resident —
477
+ does not merely fail for such an actor, it inverts: nothing loads it anyway, so
478
+ deferring costs everything.
479
+
480
+ **Content-tiering is satisfied by bounding what is copied, which is what (b) is
481
+ for.** The restatement is still a restatement, which is why it needs this
482
+ sanction rather than an argument; but its drift surface is one instruction rather
483
+ than a slab, and the place the rule is explained and changed stays single.
484
+
485
+ The attested subjects are the template's **Background + notification, never
486
+ poll** rule and its **Findings you will act on are durable before you act on
487
+ them** rule, both of which bind a dispatched session. Three such sessions read a
488
+ *descriptive* pointer to them at the always-loaded tier and derived no constraint
489
+ from it. The derivations were easy, which is what makes the failure instructive:
490
+ under load a descriptive sentence reads as background about one's situation
491
+ rather than as a constraint on the next action. The defect this rule names is
492
+ therefore pointer-versus-operative-statement, never absence.
493
+
494
+ **Operative is not obeyed, and a fourth firing is the attestation.** A dispatched
495
+ session ended its turn on work still running while the waiting rule sat in that
496
+ session's own agent definition as a bare imperative, restated under (a)–(c) —
497
+ the compliant form this sanction licenses. So the diagnosis above names a cause
498
+ *removed*, not the defect *closed*: residency makes a rule reachable at the point
499
+ of use, and reachable is not obeyed. Every restatement this sanction licenses is
500
+ a request delivered where it is read. Weigh it as one — worth its small drift
501
+ surface for the failure mode it does remove, and never a substitute for an
502
+ oracle where one is buildable. In the attested instance what caught the
503
+ consequence was the artifact-side oracle below, with the prose already in its
504
+ strengthened form.
505
+
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
508
+ checked against a sanctioned restatement rather than assumed inert, since a
509
+ sanction that required weakening a gate would be the wrong sanction:
510
+ `check-shim-restatement` scans binding shims under the skills directory against a
511
+ corpus of the consumer's always-loaded file plus kit templates, so a consumer's
512
+ agent definition is neither its scanned surface nor its corpus, and
513
+ `check-surface-duplication`'s predicate is a glossary term's definition on a
514
+ canonical SPEC surface, which reaches no agent definition either. The sanction
515
+ therefore ships with **no gate exemption** — and the honest converse ships with
516
+ 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).
520
+
521
+ **A case where an oracle *was* buildable now sits beside this one, and the two
522
+ are not each other's contradiction.** The dispatch-shape rules bind acts
523
+ that leave no tracked artifact either, yet they are gated. The axis that
524
+ 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
527
+ why neither rule gets a *gate* over the tree, and it is not by itself a reason
528
+ to stop looking for an oracle. Recorded here for the same reason §The
529
+ delegation model records the durability rule beside the read-only-fan-out
530
+ caveat: otherwise the next reader re-litigates one of the two paragraphs.
225
531
 
226
532
  ## Resume journal — agent writes, scratch reset sweeps
227
533
 
@@ -244,7 +550,7 @@ break when the supervisor deletes on its own schedule instead, and both appear
244
550
  only once a dispatched agent is **resumable** rather than one-shot: a resumed
245
551
  agent is still writing to the file, and a supervisor treating the journal as
246
552
  its **pull channel** (lifecycle-kit/templates/lead.md §Channel design)
247
- destroys at the first validated commit the channel it is supposed to keep
553
+ destroys at the first verified commit the channel it is supposed to keep
248
554
  reading. A one-shot sweep hides both, which is why an eager deletion chore
249
555
  read as correct for as long as it did.
250
556
 
@@ -266,7 +572,7 @@ file's last line**, since a session resumed past its own marker appends after
266
572
  it, and a mid-file `DONE` claims a completion the later content contradicts.
267
573
  Whether a *missing* marker signals interruption still turns on whether the
268
574
  supervisor consumed the agent's return. On the ordinary completion path it
269
- did, and that return plus its post-commit verification (§Validate after every
575
+ did, and that return plus its post-commit verification (§Verify after every
270
576
  agent commit) *is* the recovery contract, so the marker is redundant there.
271
577
  Only in a **cold read** — a journal found with no return ever consumed, the
272
578
  agent's session having died before returning (a background sandbox died, a
@@ -293,7 +599,25 @@ rule's duty falls on **the parent**, which has already demonstrated it can
293
599
  write, being the session that granted the path. The two are disjoint
294
600
  readings of one contract, not each other's contradiction.
295
601
 
296
- ## Validate after every agent commit
602
+ **Journalling is a discharge path, not a dispatched session's privilege.** The
603
+ template's durability rule turns on **capability, never role** — a session
604
+ journals when it cannot commit and commits when it can — and this section owns
605
+ why the earlier role-keyed reading failed. That reading granted the journal to a
606
+ dispatched session and denied it to a top-level one, on the premise that a
607
+ top-level session is by construction able to commit. The premise is false
608
+ whenever another session holds the shared index, which is the *normal* condition
609
+ while a work unit is in flight rather than an edge case: the supervising role
610
+ improvised scratch notes on three separate occasions in one iteration, each time
611
+ because a live dispatched session held the index. Improvised scratch is the
612
+ journal mechanism with none of its contract — no granted path inside the sweep's
613
+ reach, no inline landing, no marker — so the failure was silent and the
614
+ reconstruction cost was paid per occurrence. Widening by capability rather than
615
+ carving out a second surface per role is what keeps the reclaim story unchanged:
616
+ every discharge path still lands in the same scratch directory the consumer's
617
+ own work-unit boundary already sweeps, so no new lifetime, keep-list entry, or
618
+ inbound-triage surface is created by the widening.
619
+
620
+ ## Verify after every agent commit
297
621
 
298
622
  Re-run the relevant gates plus the consumer's validate battery (for this
299
623
  repo and any gate-sdk consumer: `bash gate-sdk/bin/run-gates.sh` and the
@@ -304,8 +628,49 @@ agent commit before accepting**: an agent blocked by a gate will weaken it
304
628
  (a false exemption) rather than fix the code — "the gate is in my way"
305
629
  almost always means the code doesn't fit the convention.
306
630
 
307
- `check-gate-tamper` is the mechanical floor under that duty. Two
308
- assertions, blocking the two attested tamper shapes:
631
+ **The act is `verify`; the artifact stays the `validate battery`.** The
632
+ discipline is an act a supervisor performs; the battery is the command set
633
+ that act runs. One word for both made *completing the act* read as completing
634
+ whatever else the consumer names with that word — attested where a consumer's
635
+ stage roster carries it, and the near-miss was a skipped stage. Renaming the
636
+ act rather than the artifact is the cheap side: the battery is a binding-slot
637
+ name every consumer's shim carries (§One template, a resident pointer, read by
638
+ `check-skill-binding`), while the act is named only in prose. The result reads
639
+ coherently — *you verify an agent's commit by re-running the relevant gates and
640
+ the consumer's validate battery* — and the act and the artifact having
641
+ different names is the distinction that was missing.
642
+
643
+ **A verify step never runs the producer of what it is verifying.** Re-running
644
+ is safe and idempotent exactly when the dispatched unit's output is *work* and
645
+ the check's output is *a verdict about that work*; it stops being safe the
646
+ moment those coincide. Where a unit's deliverable **is** an evidence artifact,
647
+ the verify is a **read of the committed artifact**, never a re-execution of
648
+ what wrote it: re-running the producer mutates or duplicates the very record
649
+ the check exists to confirm.
650
+
651
+ **The two wrong re-runs are not equally harmful, and a supervisor needs the
652
+ split.** A check that writes nothing the artifact depends on is *inert* on it —
653
+ misrouted and wasted work, with nothing lost. Re-running the artifact's **sole
654
+ writer** is *destructive*. The routing defect is the same in both; only the
655
+ second leaves evidence to restore, and the supervisor that has already run the
656
+ wrong one reads this split to learn which one it is holding. Collapsing them
657
+ would either overstate the harm of a wasteful re-run or understate the harm of
658
+ the destructive one.
659
+
660
+ **Honest limit — this rule installs no oracle**, and recurrence is what
661
+ establishes it matters rather than a projection: the misrouting fired in two
662
+ consecutive iterations and an operator caught it both times. The check class
663
+ that would catch it is a gate over a *supervisor's choice of command*, and no
664
+ scanner is buildable — the choice leaves no tracked artifact to read, the same
665
+ structural reason §Operative residency owes no gate. A consumer whose evidence
666
+ producer claims a liveness lock has a partial artifact-side proxy; its coverage
667
+ boundary is that consumer's own mechanism to state, not this section's. So
668
+ detection stays human, and it is stated here rather than left implicit because
669
+ an unstated limit reads as an oversight for a later session to close with a
670
+ gate that cannot exist.
671
+
672
+ `check-gate-tamper` is the mechanical floor under the diff-every-gate-change
673
+ duty. Two assertions, blocking the two attested tamper shapes:
309
674
 
310
675
  - **A — gate-edit isolation.** A commit that touches a gate file (the
311
676
  `DELEGATION_KIT_GATE_FILES` globs) may touch only meta-layer paths
@@ -379,7 +744,7 @@ three failure modes a raw percentage reading leaves open:
379
744
  percentage printing OK invites a dispatch the budget may not afford, which
380
745
  is what the reroute exists to prevent; a lagging *high* percentage
381
746
  suppressed into STALE waves that dispatch through, because STALE is
382
- advisory and never blocks (§The staleness contract). An unconditional
747
+ advisory and never blocks (§usage-verdict). An unconditional
383
748
  reroute closes the first and opens the second, so it must fire on the
384
749
  non-blocking outcome only: inside the window an at-or-over reading still
385
750
  exits 1 on whichever axis fired, and an under-threshold one still exits 2.
@@ -566,17 +931,9 @@ overridable via `DELEGATION_KIT_CRED_FILE` / `DELEGATION_KIT_ACCOUNT_CONFIG`).
566
931
  It ships no `tokens_in` / `tokens_out` producer: this harness's payload
567
932
  carries no cumulative token count, so under the dead-producer rule the keys
568
933
  stay defined here for third-party producers but no dead producer is shipped.
569
- Beyond the snapshot write it renders a status bar — model/effort, a context
570
- gauge, the 5h and 7d windows with reset countdowns, and an `iteration@stage`
571
- readout whose two halves come from two surfaces: the iteration from the queue
572
- header, the stage from the lifecycle evidence file's **last data line**. Both
573
- are repo-root-relative reads in the template's existing hardcode style — a
574
- consumer-owned template adds no knob. With no cursor to read (no evidence file,
575
- or one truncated to its preamble at an iteration boundary) the readout degrades
576
- to the iteration alone rather than printing a dangling separator or a partial
577
- parse — self-contained ANSI, no external asset
578
- (§Out of scope). The snapshot write is the contract; the bar is
579
- reference UX a consumer may restyle or discard. The source is pluggable
934
+ Beyond the snapshot write it renders a status bar (§The statusline template).
935
+ The snapshot write is the contract; the bar is reference UX a consumer may
936
+ restyle or discard. The source is pluggable
580
937
  (`DELEGATION_KIT_USAGE_FILE`), so no
581
938
  single-operator `CLAUDE_CONFIG_DIR` assumption is baked in.
582
939
 
@@ -639,6 +996,50 @@ append-only (the tmp-prune / boundary-truncate conventions own cleanup), and
639
996
  carries operator-local account identifiers, so it lives under the gitignored
640
997
  measurement dir and never reaches a tracked file.
641
998
 
999
+ ### The statusline template
1000
+
1001
+ `templates/statusline-usage.sh` renders model/effort, a context gauge, the 5h
1002
+ and 7d windows with reset countdowns, an `iteration@stage` readout, and a queue
1003
+ counter group. Self-contained ANSI, no external asset (§Out of scope).
1004
+
1005
+ The `iteration@stage` readout's two halves come from two surfaces: the iteration
1006
+ from the queue header, the stage from the lifecycle evidence file's **last data
1007
+ line**. Both are repo-root-relative reads in the template's existing hardcode
1008
+ style — a consumer-owned template adds no knob. With no cursor to read (no
1009
+ evidence file, or one truncated to its preamble at an iteration boundary) the
1010
+ readout degrades to the iteration alone rather than printing a dangling
1011
+ separator or a partial parse.
1012
+
1013
+ **The counter group** is a compact `N12 T3 D48 I7` tally of the queue's task
1014
+ sections, appended last. The template does not know how many sections exist,
1015
+ what they are called, or which tiers the set contains: it runs
1016
+ queue-kit's `bin/queue-counts.sh` and renders whatever
1017
+ `<section-name><TAB><count>` lines come back, labelling each with the initial of
1018
+ the name it was handed (queue-kit/SPEC.md §bin/queue-counts.sh). The section
1019
+ vocabulary therefore stays entirely inside the kit that owns it — there is
1020
+ nothing here for a later editor to hardcode. As soon as two returned names share
1021
+ an initial, **every** label widens to two characters, so a colliding pair stays
1022
+ distinguishable and the group stays aligned rather than only the collision
1023
+ changing width.
1024
+
1025
+ **It is a subprocess call, and that is the contract, not an implementation
1026
+ detail.** The counter's library exits 2 at *source* time on a malformed queue
1027
+ config; sourced into this shell it would take the whole status bar down — model,
1028
+ context gauge, both rate-limit gauges — over a component worth four characters.
1029
+ As a subprocess the same fault is a non-zero exit the render absorbs. An absent
1030
+ or non-executable counter, a non-zero exit, and empty output all drop the group
1031
+ and change nothing else about the bar, matching the two degradations the
1032
+ template already performs (an absent queue file drops the iteration; an absent
1033
+ evidence file drops the `@stage` suffix). The existence guard is kept even
1034
+ though every installer profile carrying this template also carries queue-kit,
1035
+ because a future profile pairing differently would otherwise turn a roster fact
1036
+ into a broken status bar.
1037
+
1038
+ The render cost is one subprocess per statusline fire, which is the kit's most
1039
+ frequent trigger by a wide margin (§The usage.txt contract). A full scan of a
1040
+ ~3,600-line queue measures in single-digit milliseconds, so the group needs no
1041
+ cache — recorded so a later session does not add one on suspicion.
1042
+
642
1043
  ## Trend reporter
643
1044
 
644
1045
  `bin/usage-trend.sh` reads the history log and reports how the footprint
@@ -680,9 +1081,12 @@ delegation-kit/
680
1081
  bin/usage-trend.sh # footprint trend reporter over the history log
681
1082
  bin/run-usage-tests.sh # verdict decision-table runner
682
1083
  bin/run-budget-guard-tests.sh # budget-guard decision-table runner
1084
+ bin/run-dispatch-guard-tests.sh # dispatch-guard decision-table runner (D1/D2/D3)
683
1085
  bin/run-trend-tests.sh # trend-reporter assertion runner
1086
+ lib/delegation.sh # shared helpers for the usage tools and the kit's gates
684
1087
  usage-tests/cases.tsv # expected-verdict <TAB> scenario knobs
685
1088
  usage-tests/budget-guard-cases.tsv # expected-action <TAB> scenario knobs
1089
+ usage-tests/dispatch-guard-cases.tsv # expected-outcome <TAB> scenario knobs
686
1090
  usage-tests/trend-history.log # fixture history for the trend runner
687
1091
  checks/check-gate-tamper.sh
688
1092
  checks/check-rule-citation.sh
@@ -693,7 +1097,8 @@ delegation-kit/
693
1097
  templates/agent-execution.md # full protocol, bound as a skill shim
694
1098
  templates/dispatch-checklists.md # deletion/rename/audit pre-flight, reached by a pointer
695
1099
  templates/agent-budget-guard.sh # PreToolUse(Agent) budget guard
696
- templates/statusline-usage.sh # push usage.txt producer (statusline hook) + status bar
1100
+ templates/agent-dispatch-guard.sh # PreToolUse(Agent) dispatch-shape guard (D1/D2/D3)
1101
+ templates/statusline-usage.sh # push usage.txt producer (statusline hook) + status bar incl. the queue counter group
697
1102
  templates/usage-poller.sh # poll usage.txt producer (timer-driven, fail-soft)
698
1103
  templates/delegation-config.sh # knob overrides (arrays live here)
699
1104
  smoke/install.sh
@@ -762,13 +1167,23 @@ layout as defaults):
762
1167
  reports its counted-inert clean line (§check-agent-tier-explicit).
763
1168
  - `DELEGATION_KIT_GATE_FILES` — globs naming gate files for tamper
764
1169
  assertion A; default
765
- `("${GATE_SDK_GATES_DIR:-scripts}/check-*.sh")` plus the gate-sdk lib and
766
- runners. A consumer declaration **replaces** this default outright rather
1170
+ `("${GATE_SDK_GATES_DIR:-scripts}/check-*.sh" "${GATE_SDK_GATES_DIR:-scripts}/check-*.gate")`
1171
+ plus the gate-sdk lib and
1172
+ runners. **Both declaration spellings are on the default**, because a gate's
1173
+ declaration path is `<name>.sh` *or* `<name>.gate`
1174
+ (gate-sdk/SPEC.md §The `# graph:` manifest)
1175
+ and a consumer on the default would otherwise receive a
1176
+ ported gate whose edits escape the isolation rule entirely — the widening the
1177
+ `check-gate-tamper` row of
1178
+ gate-sdk/SPEC.md §Meta-gate conservation for the binary substrate
1179
+ mandates, come due at the first live descriptor.
1180
+ A consumer declaration **replaces** this default outright rather
767
1181
  than extending it — the loader guards it with `declare -p … ||`, so the
768
1182
  default is the no-declaration fallback, not a base to append to. A consumer
769
1183
  adding kit-shipped globs must therefore restate any default glob it still
770
- wants covered (this repo's config names `*/checks/*.sh` **and**
771
- `scripts/check-*.sh`, because it has gates in both places). Contrast
1184
+ wants covered (this repo's config names `*/checks/*.sh` and `*/checks/*.gate`
1185
+ **and** their `scripts/check-*` counterparts, because it has gates in both
1186
+ places). Contrast
772
1187
  `DELEGATION_KIT_META_PATHS` below, whose kit-root union *is* additive — the
773
1188
  two knobs do not behave alike.
774
1189
  - `DELEGATION_KIT_META_PATHS` — prefixes counted as meta-layer for
@@ -782,6 +1197,23 @@ layout as defaults):
782
1197
  filter: a
783
1198
  prefix the consumer declared cannot be lost, and without `gate.sh` the config
784
1199
  is used exactly as written.
1200
+ - `DELEGATION_KIT_READONLY_TYPES` — agent-type names the consumer dispatches for
1201
+ read-only work; D2's only trigger (§The delegation model). Default empty, in
1202
+ which case D2 is inert by construction. Every entry is the consumer's own
1203
+ agent roster, never the kit's (CLAUDE.md §The provenance seam) — the same
1204
+ reasoning that ships `GUARD_KIT_BREADTH_PROBES` with no default probes.
1205
+ Deliberately not knobbed alongside it, each ruled out for a stated reason: a
1206
+ fork-type-name knob and an accepted-isolation-values knob — `fork` and
1207
+ `worktree` are the **harness's** dispatch vocabulary, and a guard template
1208
+ carries its harness's tool vocabulary as literals the same way
1209
+ `wakeup-guard.sh` matches `ScheduleWakeup`/`CronCreate` literally, so
1210
+ knobbing them would imply a portability the mechanism does not have; a
1211
+ warn-only or per-rule opt-out — a doctrine downgradable per session is the
1212
+ honour system these rules exist to end, so the valve stays the whole guard's
1213
+ registration, never a finer one; and accepting `isolation: remote` as
1214
+ satisfying D2 — plausibly correct (a remote agent cannot touch the local
1215
+ index) but unverified from here, and remote availability is gated, so it is
1216
+ excluded with its reason recorded rather than admitted on plausibility.
785
1217
 
786
1218
  `check-gate-tamper` registers in the consumer's `gates.list`
787
1219
  (tier: precommit) — in this repo's too; dogfooding is day-one, and agents
@@ -798,6 +1230,17 @@ its consumer session brief (`scripts/session-context.sh`) additionally prints
798
1230
  the verdict line at SessionStart for planning-time visibility — a consumer-side
799
1231
  edit; the context-kit template stays uncoupled from delegation-kit.
800
1232
 
1233
+ `agent-dispatch-guard.sh` is a second hook on that same matcher, registered the
1234
+ same way and **independently**: the harness fires every hook a matcher carries
1235
+ and any exit 2 blocks, so neither guard knows about the other and a consumer
1236
+ may wire either one alone (§The delegation model owns why they are two scripts
1237
+ rather than one). It resolves `guard-kit/lib/guard.sh` at its vendored path,
1238
+ overridable with `GUARD_KIT_LIB`, and reads the consumer's delegation config for
1239
+ D2's roster and nothing else. Registration is again the whole opt-in: unwired,
1240
+ it is inert — and an unwired dispatch guard is the exact failure shape it
1241
+ exists to catch, so wiring it is not optional dogfooding for a consumer that
1242
+ delegates.
1243
+
801
1244
  **An `OK` verdict is a floor, not a recommendation.** The guard answers one
802
1245
  question — is there headroom in the window *right now* — and blocks only on
803
1246
  `PAUSE`. Everything else a dispatch decision turns on sits outside its reach:
@@ -910,6 +1353,36 @@ its firing (PAUSE) and non-firing (the four advise cases) — the fixture-pair
910
1353
  discipline again — and every case asserts the live verdict text rides the
911
1354
  output so a memory-quoted percentage cannot be the acting source.
912
1355
 
1356
+ `agent-dispatch-guard.sh` takes its own decision-table lane rather than
1357
+ guard-kit's `guard-tests/` (keyed on a command, or a to+message — neither can
1358
+ express a dispatch's parameters, the same reason the budget guard has its own
1359
+ runner) or the budget guard's table (a different payload grammar again):
1360
+ `usage-tests/dispatch-guard-cases.tsv` pairs an expected outcome
1361
+ (`block`/`advise`/`fallthrough`) with `subagent_type isolation nested desc`,
1362
+ and `bin/run-dispatch-guard-tests.sh` drives the *template* with a built Agent
1363
+ hook payload — `tool_input.subagent_type`/`.isolation`, and, for a nested case,
1364
+ the top-level `agent_id`/`agent_type` the harness only sets inside a subagent —
1365
+ classifying block (exit 2) / advise (exit 0, `additionalContext` present) /
1366
+ fallthrough (exit 0, empty stdout). The table fixes one roster for its whole
1367
+ run, `DELEGATION_KIT_READONLY_TYPES=(ro-type)`, supplied through a generated
1368
+ config file and `DELEGATION_KIT_CONFIG_FILE`; a `subagent_type` prefixed
1369
+ `noroster:` runs instead with no config file at all (an empty declare),
1370
+ stripped before it reaches the guard — the row that proves D2 is inert on the
1371
+ roster's *absence*, not merely on this dispatch's type missing from a
1372
+ populated one. Every rule carries a firing and a non-firing case (the
1373
+ fixture-pair discipline, transplanted): D1 — a fork blocks, a typed dispatch
1374
+ under an empty roster does not; D2 — a rostered type without isolation blocks,
1375
+ the same type with `isolation: worktree` does not, an unrostered type under a
1376
+ populated roster does not, and the empty-roster case does not; D3 — a payload
1377
+ carrying `agent_id` advises, one without it falls through. The degradation
1378
+ posture gets its own case rather than being asserted only in prose: an
1379
+ unparseable payload (`subagent_type` `UNPARSEABLE`, sent as invalid JSON on
1380
+ stdin) advises rather than blocks — the assertion that makes delta 6's
1381
+ fail-open-but-loud posture testable, not merely stated, and the one case this
1382
+ lane must not drop for brevity. The runner strips ambient `DELEGATION_KIT_*` at
1383
+ every invocation, the discipline `run-budget-guard-tests.sh` already uses, so a
1384
+ consumer's live roster or config-file pointer cannot leak into the fixture.
1385
+
913
1386
  `smoke/install.sh` copies the templates and `bin/` tools into the scratch
914
1387
  consumer, registers the tamper gate, and drives one crafted snapshot
915
1388
  through `usage-verdict` asserting a verdict — self-verifying install. It opens