checkwright 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (548) hide show
  1. package/README.md +855 -96
  2. package/lib/common/lock.sh +45 -9
  3. package/lib/common/profile.sh +33 -0
  4. package/lib/common/recipe.sh +50 -34
  5. package/lib/diff.sh +66 -0
  6. package/lib/doctor.sh +67 -42
  7. package/lib/init.sh +62 -46
  8. package/lib/uninstall.sh +214 -0
  9. package/lib/update.sh +34 -0
  10. package/package.json +2 -2
  11. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  12. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  13. package/payload/canon-kit/README.md +1 -0
  14. package/payload/canon-kit/SPEC.md +527 -63
  15. package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
  16. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  17. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  18. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  19. package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
  20. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  21. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  22. package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
  23. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  24. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  25. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  26. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  27. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  28. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  29. package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
  30. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  31. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  32. package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
  33. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  35. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  36. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  37. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  38. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-orphan.md +6 -0
  39. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +7 -2
  40. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +8 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +3 -0
  45. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +5 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  51. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  52. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  53. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +3 -2
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  63. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  64. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  65. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  66. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
  68. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  69. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
  70. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  71. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +27 -5
  72. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  73. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  74. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  75. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  76. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  77. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  78. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  79. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  80. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +3 -3
  81. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  82. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC-wire.md +18 -0
  83. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +3 -1
  84. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.proto +13 -0
  85. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC-wire.md +22 -0
  86. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +17 -0
  87. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.proto +13 -0
  88. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  89. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  90. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  91. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +3 -0
  92. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  93. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  94. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  95. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  96. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  97. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  98. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  99. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  100. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  101. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  102. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  103. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  104. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  105. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  106. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  107. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  108. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  109. package/payload/canon-kit/lib/spec.sh +91 -62
  110. package/payload/canon-kit/smoke/install.sh +2 -1
  111. package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
  112. package/payload/context-kit/README.md +10 -5
  113. package/payload/context-kit/SPEC.md +364 -62
  114. package/payload/context-kit/bin/always-loaded.sh +5 -21
  115. package/payload/context-kit/bin/env-probe.sh +21 -23
  116. package/payload/context-kit/checks/check-brevity.gate +3 -0
  117. package/payload/context-kit/checks/check-footprint-fresh.gate +3 -0
  118. package/payload/context-kit/checks/check-memory-off.gate +3 -0
  119. package/payload/context-kit/checks/check-settings-paths.gate +3 -0
  120. package/payload/context-kit/checks/check-settings-pins.gate +3 -0
  121. package/payload/context-kit/gate-tests/check-brevity.test.sh +3 -2
  122. package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/context-config.sh +4 -0
  123. package/payload/context-kit/gate-tests/check-memory-off/good/scripts/context-config.sh +4 -0
  124. package/payload/context-kit/gate-tests/check-memory-off.test.sh +18 -4
  125. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  126. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  127. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  128. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  129. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  130. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  131. package/payload/context-kit/gate-tests/check-settings-pins.test.sh +70 -0
  132. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  133. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  134. package/payload/context-kit/lib/context.sh +56 -0
  135. package/payload/context-kit/lib/toolfloor.sh +15 -4
  136. package/payload/context-kit/smoke/agents-md.sh +27 -4
  137. package/payload/context-kit/smoke/install.sh +4 -2
  138. package/payload/context-kit/templates/session-context.sh +5 -5
  139. package/payload/delegation-kit/README.md +3 -3
  140. package/payload/delegation-kit/SPEC.md +400 -22
  141. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +3 -0
  142. package/payload/delegation-kit/checks/check-gate-tamper.gate +3 -0
  143. package/payload/delegation-kit/checks/check-rule-citation.gate +3 -0
  144. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/added-exemptions +5 -0
  145. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +2 -0
  146. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +108 -0
  147. package/payload/delegation-kit/smoke/install.sh +1 -1
  148. package/payload/delegation-kit/templates/agent-execution.md +109 -18
  149. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  150. package/payload/doctrine-kit/DOCTRINE.md +86 -12
  151. package/payload/doctrine-kit/README.md +7 -3
  152. package/payload/doctrine-kit/SPEC.md +103 -10
  153. package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
  154. package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
  155. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  156. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  157. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +84 -5
  158. package/payload/doctrine-kit/smoke/install.sh +106 -3
  159. package/payload/drift-kit/README.md +2 -2
  160. package/payload/drift-kit/SPEC.md +84 -11
  161. package/payload/drift-kit/bin/kfric.sh +21 -2
  162. package/payload/drift-kit/bin/stage-economics.sh +1 -1
  163. package/payload/drift-kit/lib/drift.sh +43 -0
  164. package/payload/drift-kit/smoke/install.sh +49 -14
  165. package/payload/evidence-kit/README.md +3 -1
  166. package/payload/evidence-kit/SPEC.md +160 -19
  167. package/payload/evidence-kit/checks/check-battery-roster.gate +3 -0
  168. package/payload/evidence-kit/checks/check-evidence-baseline.gate +3 -0
  169. package/payload/evidence-kit/checks/check-evidence-manifest.gate +3 -0
  170. package/payload/evidence-kit/checks/check-producer-liveness.sh +43 -2
  171. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +4 -3
  172. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +8 -5
  173. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +1 -1
  174. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/evidence-config.sh +9 -0
  175. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +1 -1
  176. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/evidence-config.sh +9 -0
  177. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +6 -4
  178. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +42 -1
  179. package/payload/evidence-kit/lib/evidence.sh +2 -0
  180. package/payload/evidence-kit/smoke/install.sh +1 -1
  181. package/payload/gate-sdk/README.md +23 -7
  182. package/payload/gate-sdk/SPEC.md +6402 -291
  183. package/payload/gate-sdk/bin/build-native.sh +38 -0
  184. package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
  185. package/payload/gate-sdk/bin/install-hooks.sh +14 -2
  186. package/payload/gate-sdk/bin/port-blockers.sh +473 -0
  187. package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
  188. package/payload/gate-sdk/bin/run-gate-tests.sh +27 -7
  189. package/payload/gate-sdk/bin/run-gates.sh +30 -2
  190. package/payload/gate-sdk/bin/upgrade-smoke.sh +70 -17
  191. package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -0
  192. package/payload/gate-sdk/checks/check-action-pinning.gate +1 -0
  193. package/payload/gate-sdk/checks/check-action-run-shell.sh +2 -0
  194. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  195. package/payload/gate-sdk/checks/check-commit-msg.gate +3 -0
  196. package/payload/gate-sdk/checks/check-commit-subject.gate +3 -0
  197. package/payload/gate-sdk/checks/check-core-files.gate +3 -0
  198. package/payload/gate-sdk/checks/check-crate-arms.sh +62 -0
  199. package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -0
  200. package/payload/gate-sdk/checks/check-exec-bit.gate +3 -0
  201. package/payload/gate-sdk/checks/check-gate-assertions.sh +32 -6
  202. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +3 -0
  203. package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +3 -0
  204. package/payload/gate-sdk/checks/check-gate-fail-closed.gate +3 -0
  205. package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +3 -0
  206. package/payload/gate-sdk/checks/check-gate-output.gate +3 -0
  207. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +109 -14
  208. package/payload/gate-sdk/checks/check-graph.gate +3 -0
  209. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +3 -0
  210. package/payload/gate-sdk/checks/check-identity.gate +3 -0
  211. package/payload/gate-sdk/checks/check-install-disposition.sh +93 -0
  212. package/payload/gate-sdk/checks/check-kit-enum.gate +3 -0
  213. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  214. package/payload/gate-sdk/checks/check-readme-roster.gate +3 -0
  215. package/payload/gate-sdk/checks/check-reads-couples.gate +3 -0
  216. package/payload/gate-sdk/checks/check-root-tiering.gate +3 -0
  217. package/payload/gate-sdk/checks/check-shellcheck.sh +2 -0
  218. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  219. package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
  220. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  221. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  222. package/payload/gate-sdk/checks/check-tree-terms.sh +2 -0
  223. package/payload/gate-sdk/checks/check-workflow-tiering.gate +3 -0
  224. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +17 -12
  225. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +4 -5
  226. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  227. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  228. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  229. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  230. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  231. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  232. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  233. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  234. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +2 -1
  235. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +2 -1
  236. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +3 -0
  237. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -1
  238. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +3 -4
  239. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  240. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +26 -4
  241. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +6 -1
  242. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +2 -0
  243. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored-descriptor.gate +4 -0
  244. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored.sh +14 -0
  245. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +4 -0
  246. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-held.sh +8 -0
  247. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +8 -1
  248. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +3 -0
  249. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored-descriptor.gate +4 -0
  250. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored.sh +14 -0
  251. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +4 -0
  252. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-held.sh +8 -0
  253. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +77 -0
  254. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  255. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  256. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  257. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  258. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  259. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  260. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -1
  261. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  262. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  263. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  264. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +110 -0
  265. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +7 -0
  266. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +1 -0
  267. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-bare.sh +4 -0
  268. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-both.sh +5 -0
  269. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-heldtwice.sh +5 -0
  270. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +2 -0
  271. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twice.sh +5 -0
  272. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +4 -0
  273. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  274. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +1 -0
  275. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +4 -0
  276. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -0
  277. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +110 -4
  278. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +15 -5
  279. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +12 -0
  280. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +27 -5
  281. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +12 -0
  282. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +5 -4
  283. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +14 -12
  284. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +43 -17
  285. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +190 -0
  286. package/payload/gate-sdk/gate-tests/check-identity/bad/gh-hosts.yml +9 -0
  287. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -2
  288. package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/gate-sdk-config.sh +10 -0
  289. package/payload/gate-sdk/gate-tests/check-identity/good/gh-hosts.yml +11 -0
  290. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -1
  291. package/payload/gate-sdk/gate-tests/check-identity/good/scripts/gate-sdk-config.sh +10 -0
  292. package/payload/gate-sdk/gate-tests/check-identity.test.sh +114 -0
  293. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  294. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  295. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  296. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  297. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  298. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  299. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  300. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  301. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  302. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  303. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  304. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  305. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  306. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  307. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  308. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  309. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-native-sample.gate +3 -0
  310. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -1
  311. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-native-sample.gate +3 -0
  312. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  313. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +5 -2
  314. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  315. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +3 -1
  316. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/README.md +15 -0
  317. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-one.gate +2 -0
  318. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-two.sh +3 -0
  319. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +3 -1
  320. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +1 -1
  321. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +3 -1
  322. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/README.md +13 -0
  323. package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/checks/check-delta-one.gate +2 -0
  324. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/README.md +14 -0
  325. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-one.sh +3 -0
  326. package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-two.gate +2 -0
  327. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +1 -1
  328. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +87 -89
  329. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +4 -0
  330. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +56 -0
  331. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  332. package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +211 -0
  333. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +16 -15
  334. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +204 -1
  335. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  336. package/payload/gate-sdk/lib/consumer-smoke.sh +24 -12
  337. package/payload/gate-sdk/lib/gate.sh +353 -22
  338. package/payload/gate-sdk/lib/inject.sh +25 -0
  339. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  340. package/payload/gate-sdk/smoke/install.sh +47 -1
  341. package/payload/guard-kit/README.md +14 -11
  342. package/payload/guard-kit/SPEC.md +477 -82
  343. package/payload/guard-kit/bin/run-guard-tests.sh +7 -1
  344. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
  345. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  346. package/payload/guard-kit/guard-tests/cases.tsv +84 -14
  347. package/payload/guard-kit/lib/guard.sh +440 -54
  348. package/payload/guard-kit/templates/close-triage.md +5 -5
  349. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  350. package/payload/lifecycle-kit/README.md +14 -3
  351. package/payload/lifecycle-kit/SPEC.md +929 -93
  352. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  353. package/payload/lifecycle-kit/bin/enter-stage.sh +193 -38
  354. package/payload/lifecycle-kit/bin/file-gap.sh +29 -12
  355. package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
  356. package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
  357. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  358. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  359. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  360. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  361. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  362. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  363. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  364. package/payload/lifecycle-kit/checks/check-stage-entry.gate +3 -0
  365. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  366. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  367. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  368. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +4 -4
  369. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +2 -3
  370. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  371. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  372. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  373. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  374. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  375. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  376. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  377. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  378. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -3
  379. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  380. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  381. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  382. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  383. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  384. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  385. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  386. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  387. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +3 -3
  388. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +3 -3
  389. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +24 -25
  390. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +2 -2
  391. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +2 -2
  392. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +129 -15
  393. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -3
  394. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +54 -26
  395. package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
  396. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  397. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
  398. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  399. package/payload/lifecycle-kit/lib/stages.sh +9 -0
  400. package/payload/lifecycle-kit/smoke/install.sh +96 -19
  401. package/payload/lifecycle-kit/templates/lead.md +60 -0
  402. package/payload/lifecycle-kit/templates/stages/align.md +20 -2
  403. package/payload/lifecycle-kit/templates/stages/build.md +3 -3
  404. package/payload/lifecycle-kit/templates/stages/close.md +48 -15
  405. package/payload/lifecycle-kit/templates/stages/scope.md +29 -5
  406. package/payload/lifecycle-kit/templates/stages/spec.md +6 -2
  407. package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
  408. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  409. package/payload/queue-kit/README.md +12 -10
  410. package/payload/queue-kit/SPEC.md +411 -74
  411. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  412. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  413. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  414. package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
  415. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  416. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  417. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  418. package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -0
  419. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  420. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  421. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  422. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +15 -0
  423. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +2 -0
  424. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +7 -0
  425. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +4 -0
  426. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -1
  427. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  428. package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
  429. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  430. package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
  431. package/payload/queue-kit/lib/queue.sh +4 -68
  432. package/payload/queue-kit/smoke/install.sh +1 -1
  433. package/payload/site-kit/SPEC.md +52 -2
  434. package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
  435. package/payload/site-kit/checks/check-docs-render-fidelity.sh +2 -0
  436. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +5 -4
  437. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +6 -5
  438. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/checks/check-sample.gate +3 -0
  439. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -1
  440. package/payload/site-kit/smoke/install.sh +1 -1
  441. package/profiles.list +36 -8
  442. package/payload/canon-kit/checks/check-amendment-queue.sh +0 -116
  443. package/payload/canon-kit/checks/check-comment-tier.sh +0 -216
  444. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  445. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  446. package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -78
  447. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  448. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  449. package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -239
  450. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  451. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  452. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  453. package/payload/canon-kit/checks/check-payload-claim.sh +0 -133
  454. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  455. package/payload/canon-kit/checks/check-prose-tells.sh +0 -207
  456. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  457. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  458. package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -133
  459. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  460. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -187
  461. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  462. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  463. package/payload/context-kit/bin/footprint.sh +0 -144
  464. package/payload/context-kit/checks/check-brevity.sh +0 -123
  465. package/payload/context-kit/checks/check-footprint-fresh.sh +0 -38
  466. package/payload/context-kit/checks/check-memory-off.sh +0 -112
  467. package/payload/context-kit/checks/check-settings-pins.sh +0 -110
  468. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -61
  469. package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -139
  470. package/payload/delegation-kit/checks/check-rule-citation.sh +0 -76
  471. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -216
  472. package/payload/drift-kit/bin/trajectory.sh +0 -242
  473. package/payload/evidence-kit/checks/check-battery-roster.sh +0 -86
  474. package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -103
  475. package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -104
  476. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +0 -3
  477. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +0 -3
  478. package/payload/gate-sdk/bin/enforcement-map.sh +0 -272
  479. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  480. package/payload/gate-sdk/checks/check-commit-msg.sh +0 -50
  481. package/payload/gate-sdk/checks/check-commit-subject.sh +0 -43
  482. package/payload/gate-sdk/checks/check-core-files.sh +0 -75
  483. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -37
  484. package/payload/gate-sdk/checks/check-exec-bit.sh +0 -95
  485. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -106
  486. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -105
  487. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -84
  488. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -92
  489. package/payload/gate-sdk/checks/check-gate-output.sh +0 -73
  490. package/payload/gate-sdk/checks/check-graph.sh +0 -631
  491. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -45
  492. package/payload/gate-sdk/checks/check-identity.sh +0 -134
  493. package/payload/gate-sdk/checks/check-kit-enum.sh +0 -94
  494. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  495. package/payload/gate-sdk/checks/check-readme-roster.sh +0 -107
  496. package/payload/gate-sdk/checks/check-reads-couples.sh +0 -199
  497. package/payload/gate-sdk/checks/check-root-tiering.sh +0 -66
  498. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  499. package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -126
  500. package/payload/gate-sdk/checks/check-template-registry-parity.sh +0 -81
  501. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  502. package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -84
  503. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +0 -1
  504. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +0 -1
  505. package/payload/gate-sdk/gate-tests/check-identity/bad/args +0 -1
  506. package/payload/gate-sdk/gate-tests/check-identity/good/args +0 -1
  507. package/payload/lifecycle-kit/bin/close-surfaces.sh +0 -94
  508. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +0 -63
  509. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  510. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  511. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  512. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  513. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  514. package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -197
  515. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  516. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  517. package/payload/lifecycle-kit/checks/check-survey-record.sh +0 -102
  518. package/payload/queue-kit/bin/queue-index.sh +0 -182
  519. package/payload/queue-kit/bin/roadmap.sh +0 -76
  520. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -106
  521. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  522. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +0 -63
  523. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  524. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  525. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  526. package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -110
  527. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  528. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  529. package/payload/queue-kit/checks/check-task-names.sh +0 -128
  530. package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -80
  531. /package/payload/context-kit/gate-tests/{check-memory-off → check-settings-paths}/bad/args +0 -0
  532. /package/payload/context-kit/gate-tests/{check-memory-off → check-settings-paths}/good/args +0 -0
  533. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/{gates → scripts}/check-sample.sh +0 -0
  534. /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/{gates → scripts}/check-sample.sh +0 -0
  535. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{check-gamma.sh → scripts/check-gamma.sh} +0 -0
  536. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  537. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  538. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gates.list → scripts/gates.list} +0 -0
  539. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{check-beta.sh → scripts/check-beta.sh} +0 -0
  540. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
  541. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
  542. /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gates.list → scripts/gates.list} +0 -0
  543. /package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/{site-config.sh → scripts/site-config.sh} +0 -0
  544. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/CNAME +0 -0
  545. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/index.md +0 -0
  546. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/docs → docs}/posts/2026-01-01-legacy.md +0 -0
  547. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/pkg → pkg}/gate-tests/fixture.md +0 -0
  548. /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{site-config.sh → scripts/site-config.sh} +0 -0
@@ -28,12 +28,33 @@ Two governed surfaces, carrying **one axis each**:
28
28
  then a `---` separator, then one data line per stage-skill invocation:
29
29
 
30
30
  ```
31
- <iteration> <stage> <session-id> <YYYY-MM-DD>
31
+ <iteration> <stage> <session-id> <YYYY-MM-DD> <head>
32
32
  ```
33
33
 
34
34
  It carries the *fast* axis too: **the last data line's `<stage>` token is the
35
35
  cursor** — the single source for "which stage is this iteration in".
36
36
 
37
+ `<head>` is the abbreviated commit `bin/enter-stage.sh` read at the instant
38
+ it wrote the stamp, or the literal `none` where it found no git work tree and
39
+ no commit to name. It is **required**, and `none` is a value rather than an
40
+ omission: a permanently optional field is a permanent disarm switch for the
41
+ provenance assertion it exists to serve (§check-stage-evidence), which would
42
+ be enforcement-first inverted — the fix shipped beside its bypass. The field
43
+ is **appended** rather than inserted, so every positional reader of fields one
44
+ to four is unmoved.
45
+
46
+ **The five-field grammar is a breaking change to a shipped file format**, and
47
+ a consumer vendoring it mid-iteration reds until they rewrite their own
48
+ stamps: for each, `<head>` is the first parent of the commit that introduced
49
+ that stamp line, recoverable from history, and `none` where it is not — a
50
+ stamp whose introducing commit cannot be identified takes `none` rather than
51
+ a guess, because a guessed provenance value is indistinguishable from a real
52
+ one afterward. That rewrite is a **rewrite and not an introduction**, which is
53
+ what the migration clause of the newly-introduced test (§check-stage-evidence)
54
+ exists to say. The honest mitigation is the boundary: the first stage's reset
55
+ truncates this file, so a consumer upgrading at an iteration boundary pays
56
+ nothing.
57
+
37
58
  The header once carried a `[stage:]` field as well. It was a second copy of a
38
59
  derivable fact — every stage entry already stamps its `<stage>` — bought at one
39
60
  queue write per stage entry, and kept in sync only by an assertion that existed
@@ -136,8 +157,12 @@ see §check-stage-evidence).
136
157
  **Same-stage re-entry (N sibling sessions per stage).** Entering the
137
158
  currently-stamped stage from a *new* session is legal and appends a fresh
138
159
  stamp: `enter-stage.sh`'s idempotence guard keys on the full
139
- `(iteration, stage, session-id)` triple, so only the *same* session re-entering
140
- is a no-op, and `check-stage-entry` assertion A keys on the *predecessor* stamp,
160
+ `(iteration, stage, session-id, head)` tuple, so only the *same* session
161
+ re-entering **at the same commit** is a no-op — a re-entry after `HEAD` moved
162
+ appends a fresh stamp carrying the new head, which is what makes re-running the
163
+ tool the stated remedy for a stale recorded head rather than a reported no-op
164
+ that changes nothing (§check-stage-evidence). `check-stage-entry` assertion A
165
+ keys on the *predecessor* stamp,
141
166
  which the stage's first entry satisfied for every sibling. So N sessions may
142
167
  enter one stage — a multi-session build, or a lead's intra-stage batch split
143
168
  (§templates/lead.md) — serialized by the shared index/HEAD like any concurrent
@@ -466,8 +491,17 @@ the clause's reader is a human or agent rather than a gate.
466
491
  declaration vocabulary is kit-owned and carries no consumer content; the roster
467
492
  is derived, never a kit literal — a kit shipping the *names* of a consumer's
468
493
  inbound surfaces would publish that consumer's private workflow.
494
+ - `LIFECYCLE_KIT_PERMANENT_SURFACE_GLOBS` — array of path globs for the surfaces
495
+ held to the no-retrieval-pointer rule (§check-scratch-citation); default the
496
+ queue file alone (`LIFECYCLE_KIT_QUEUE_FILE`). That default is the one permanent
497
+ surface this kit owns and where both attested firings landed, so it is
498
+ non-vacuous in every consumer and over-reaches in none. The roster is consumer
499
+ config and the forbidden targets are derived from the consumer's own truncate
500
+ configuration, so no kit literal names any surface a consumer happens to have.
469
501
  - `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` — extra files reset to their header at the
470
- iteration boundary; default empty.
502
+ iteration boundary; default empty. Adding a member also widens
503
+ `check-scratch-citation`'s forbidden-target set, because both read
504
+ `lifecycle_supersede_set`.
471
505
  - `LIFECYCLE_KIT_BOUNDARY_PRESERVE` — keep-list of scratch-dir **basenames** the
472
506
  iteration-boundary wipe spares (§bin/enter-stage.sh); default empty, so an
473
507
  unset-knob consumer gets a clean wipe of an already-disposable surface.
@@ -593,22 +627,35 @@ friction, and routes here.
593
627
  **The surface.** `.workflow/gap-inbox.md` (knob `LIFECYCLE_KIT_GAP_INBOX_FILE`,
594
628
  §Layout and configuration) is a committed, append-only capture buffer. Grammar:
595
629
  a `# contract:` prose header, then one `- <YYYY-MM-DD> — <gap prose>` bullet per
596
- gap, optionally carrying a **recurrence marker** between the date and the prose:
597
- ``- <YYYY-MM-DD> — recurrence of `<slug>`: <gap prose>``. The single-backticked
598
- slug is queue-kit's existing in-body citation form (queue-kit/SPEC.md §The tag
599
- algebra), borrowed rather than re-spelled. Committed, not gitignored — a
630
+ gap — **one shape for every filing**, with no structured slot between the date
631
+ and the prose. A slug named *inside* the prose takes queue-kit's existing
632
+ in-body citation form (queue-kit/SPEC.md §The tag algebra), single-backticked,
633
+ borrowed rather than re-spelled; it is a citation and never a field, which is
634
+ the whole distinction §check-gap-inbox-neutrality holds. Committed, not gitignored — a
600
635
  per-clone buffer fragments the backlog across
601
636
  operators, the finding that rules the gitignored friction log out as the channel.
602
-
603
- **The affordance.** `bin/file-gap.sh "<gap prose>"` (the `bin/kfric.sh` pattern:
604
- repo-root cd, config-via-env, exit 2 on an empty argument) appends one dated
605
- bullet, seeding the contract header when the inbox does not yet exist. It is
637
+ What *append-only* means on this surface is a merge property, and
638
+ §Multi-operator semantics owns it: this is the kit's one `union`-driver surface.
639
+
640
+ **The affordance.** `bin/file-gap.sh [--] "<gap prose>"` (the `bin/kfric.sh`
641
+ pattern: repo-root cd, config-via-env, exit 2 on an empty argument) appends one
642
+ dated bullet, seeding the contract header when the inbox does not yet exist. Its
643
+ one positional is free text, so it validates that argument's **shape** to
644
+ gate-sdk/SPEC.md §The bin/-tool contract — help on stdout at exit 0, an
645
+ unrecognized leading `-` refused, `--` ending option processing — which is the
646
+ rule this capture affordance's own three attested firings bought. It is
606
647
  advisory tooling, not a gate — no fixture pair is owed; the raw append (a bullet
607
648
  line into the inbox) stays a legal fallback, the grammar being the surface's
608
649
  contract, not the writer.
609
650
 
610
651
  It also **resolves the prose against the live slug set** at capture and, on a
611
- match, stamps the recurrence marker into the bullet it was already writing. The
652
+ match, raises a stderr advisory that **asks** the filer: the prose names live
653
+ entry `<slug>` — if this bullet *re-files* that finding, say so in the prose and
654
+ say why; if it merely cites, corrects, or argues against that entry, say it is
655
+ *distinct* and why, because the closing stage's drain judges the recurrence and
656
+ reads what was written. The resolution buys a prompt and nothing else: it writes
657
+ no marker, and the bullet it accompanies is the same one shape every filing gets.
658
+ The
612
659
  live set is every column-0 `- **<slug>** —` entry bullet in the queue file
613
660
  *outside* the fixed-spelling `## Lessons Learned` section — that is exactly
614
661
  active, deferred, and a configured icebox — and it needs **no section knob of its
@@ -618,7 +665,7 @@ entry grammar queue-kit/SPEC.md §The queue format defines. Lessons is excluded
618
665
  name, and must be: a lesson lead line is outside that grammar for every *gate*,
619
666
  but it may legitimately be *written* in the entry shape (`- **slug** [tag] —
620
667
  prose`), so a grammar-only scan would resolve a live lesson as a queue entry and
621
- stamp a declaration onto something that is not one. The `## Lessons Learned`
668
+ ask the filer about something that is not one. The `## Lessons Learned`
622
669
  literal is fixed spelling rather than config (queue-kit/SPEC.md §The tag algebra),
623
670
  and this kit already carries it — `bin/enter-stage.sh`'s boundary refusal and
624
671
  `check-lesson-disposition` both scan it.
@@ -632,6 +679,63 @@ that cannot depend on queue-kit re-implements the predicate and both ends cite t
632
679
  owner section), and drift-kit's `kpi-deferred-age` records the same accepted
633
680
  residual.
634
681
 
682
+ **Why the matcher prompts rather than decides, and why it survives at all.** A
683
+ recurrence is a claim about *what a finding is*, not about *what a string
684
+ contains*, and no syntactic tell separates "this recurred" from "this is about
685
+ that": a bullet can spell the denial out in words and still match. So the
686
+ predicate is not sharpened, it is **demoted** — its recall was never the defect,
687
+ its authority was. Deleting it would delete the only thing that can produce the
688
+ prompt, and the prompt is what reaches the one party who can answer cheaply: a
689
+ mid-build filer routinely has not read the queue, which is why the matcher
690
+ existed in the first place.
691
+
692
+ **Its honest limit.** A bullet describing a recurrence without spelling the slug
693
+ raises no advisory at all. That leaves no hole in this channel, because the drain
694
+ reads **every** bullet regardless of whether the matcher spoke — which is the
695
+ difference between a prompt and a gate, and the reason the judgment had to move
696
+ rather than the predicate get sharper.
697
+
698
+ **Three alternatives are refused, recorded so they are not re-drafted.** A
699
+ *required* recurrence-or-new argument on the affordance turns capture into an
700
+ interrogation, and refusing capture does not dissolve a finding — it pushes it
701
+ back into session context, the deferred-capture antipattern this inbox exists to
702
+ prevent; it is also asked of a party who has not read the queue. An *optional*
703
+ `--recurrence <slug>` flag invites the drain to trust a structured claim,
704
+ reinstating the same defect one layer up with a better provenance story. And
705
+ *narrowing the matcher* — anchoring the slug, exempting a bullet containing a
706
+ negation — institutionalizes the evasion: an affordance that must be phrased
707
+ around to stay accurate is miscalibrated, and the next filer does not know to
708
+ phrase around it. What all three trade against is prose, which the channel
709
+ already carries and a judge already reads.
710
+
711
+ **A fourth shape is refused — deriving post-close-ness from git — recorded so it
712
+ is not re-drafted.** The proposal: rather than reading the cursor, ask "has the
713
+ inbox been truncated since the close stamp's commit?", which separates the cases
714
+ with no marker field. It is refused on evidence, on four independent grounds.
715
+
716
+ - **It is wrong on the case that matters.** The predicate assumes the drain and
717
+ the closing stamp are commensurable in commit order. Measured over this
718
+ project's four most recently closed iterations they are not: the truncation is
719
+ **never** in the stamp's commit and is **always** a later, separately authored
720
+ one. So "truncated since the close stamp" is true of every normally-closed
721
+ iteration, and the single case it does distinguish — a close that stamped and
722
+ then skipped its drain — it answers *close-skipped*, handing the entering
723
+ session a recovery naming a stage that is gone. The cursor read is right there,
724
+ because close did run.
725
+ - **It cannot answer the other case at all.** Where close was genuinely skipped
726
+ there is no close-stamp commit to anchor on, so the git predicate degenerates
727
+ into "is there a close stamp?" — which is the cursor read, obtained from a file
728
+ the tool already holds open.
729
+ - **It would be `bin/enter-stage.sh`'s first `git` invocation.** That tool shells
730
+ out to git nowhere: every decision it takes is a read of the queue and the
731
+ state file. Adding history-dependence to the state machine's only writer makes
732
+ the entry decision non-hermetic, and the branch's fixture would have to
733
+ construct commit history rather than three files.
734
+ - **Its stated virtue does not discriminate.** "Needs no marker field, so
735
+ §check-gap-inbox-neutrality's two-field bound stays intact" is equally true of
736
+ the cursor read, which writes nothing anywhere. The bound is untouched by both,
737
+ so it selects neither.
738
+
635
739
  **The tool writes no queue file, and that is the load-bearing constraint on the
636
740
  whole channel.** This inbox exists precisely because a gap surfaced mid-stage has
637
741
  no committed place to land except the queue file a stage session is already
@@ -649,6 +753,28 @@ warning and not a refusal deliberately: refusing capture does not dissolve a
649
753
  real finding, it pushes it back into session context — the deferred-capture
650
754
  antipattern this inbox exists to prevent.
651
755
 
756
+ **The drain re-verifies; capture does not.** A bullet's prose is a claim made at
757
+ capture speed, and this channel is built to keep capture cheap, so nothing
758
+ upstream established it — a bullet can assert a mechanism its filer inferred
759
+ rather than ran, and a false premise is paid by whoever drains it. The drain
760
+ therefore names, per bullet, the claim its disposition turns on and the command
761
+ that establishes it, runs that command, and records in the same commit which
762
+ bullets were re-verified and what fell (§templates/stages/ carries the step). The
763
+ grounds are attested rather than argued: of the bullets re-verified at one
764
+ boundary, two were false at their central claim and each fell to a single
765
+ command, and a later bullet carried two false premises at once — one caught by
766
+ the filer re-reading the source before the drain, the other only by the draining
767
+ session's own probes. The step that reliably ran was the drain.
768
+
769
+ **Two capture-time shapes are refused, recorded so they are not re-drafted.** A
770
+ filing-time prompt for the establishing command, and a grammar separating
771
+ observed fact from inferred mechanism, both add friction at the moment this inbox
772
+ exists to keep cheap, and both bill it to the party least able to pay — the
773
+ mid-stage filer whose finding otherwise stays in session context. That is the
774
+ deferred-capture antipattern the channel was built against, and it is not traded
775
+ away to fix a different failure mode. The affordance gains no prompt and no
776
+ grammar; §check-gap-inbox-neutrality keeps the bullet's fields at two.
777
+
652
778
  **Merge semantics.** The inbox carries `merge=union` (git-native, so no per-clone
653
779
  driver registration), not the keep-ours `merge=iteration-scoped` the
654
780
  boundary-truncated surfaces carry: an iteration-scoped surface is per-iteration
@@ -656,58 +782,207 @@ scratch superseded at the boundary, but a gap filed on either side of a
656
782
  concurrent merge must survive. The installer emits the line and
657
783
  `check-merge-attrs` verifies it (§bin/install-lifecycle.sh, §check-merge-attrs).
658
784
 
659
- **The boundary refusal.** `bin/enter-stage.sh`'s first-stage (iteration-boundary)
660
- entry refuses while the inbox holds bullets (exit 1, the untriaged bullets
661
- printed, nothing written — the same refusal contract as the non-empty Lessons
662
- section), so no gap outlives its iteration untriaged (the gap-disposition rule:
663
- costed and filed, never flagged-and-skipped).
664
-
665
- The refusal names **two** recoveries, because the drain and the filing window do
666
- not coincide. A bullet filed *during* the iteration is drained by the closing
667
- stage, and the refusal points there. A bullet filed *after* that stage has run
668
- has no drainer left in the machine — the detection is still right, and what
669
- would fail is a message describing a stage that is not coming back — so the
670
- refusal also tells the entering session to disposition the bullets itself:
671
- promote each directly to the deferred queue (or fix it), truncate the inbox,
672
- commit, re-run. Deleting a bullet without a disposition is not a drain. No
673
- second detector is added for the post-close window: the existing refusal already
674
- detects it, and what was missing was the message's actionability.
675
-
676
- That refusal is the inbox's
677
- forcing function, so the inbox declares itself on the close-surface roster
785
+ **The boundary check: one detector, two dispositions.**
786
+ `bin/enter-stage.sh`'s first-stage (iteration-boundary) entry is unchanged in
787
+ **detection** — it still fires on any `- ` bullet in the inbox — and
788
+ **discriminates** on which of two dispositions it takes, because the drain and
789
+ the filing window do not coincide.
790
+
791
+ - **Close-skipped** — the closing iteration's cursor never reached the last
792
+ configured stage. The entry **refuses** (exit 1, the untriaged bullets
793
+ printed, nothing written — the same refusal contract as the non-empty Lessons
794
+ section), with the one recovery that applies: run the closing stage's
795
+ gap-drain step, truncate the inbox, re-enter. A stage was skipped, so the
796
+ recovery is to run it, and no gap outlives its iteration untriaged (the
797
+ gap-disposition rule: costed and filed, never flagged-and-skipped).
798
+ - **Post-close** — the cursor sits at the last configured stage, so the closing
799
+ stage has run and none is coming back. The entry is **admitted**: the bullets
800
+ print on stderr as an advisory naming them this iteration's first-stage
801
+ intake, and the stamp proceeds. Deleting a bullet without a disposition is
802
+ still not a drain.
803
+
804
+ The discriminator is the cursor read `lifecycle_closing_stage_reached`
805
+ (§lib/stages.sh), the same predicate `bin/file-gap.sh` warns from at capture, so
806
+ a filer told "none is left to drain it" is told so by the very test that later
807
+ admits the bullet rather than by a lookalike. **Two edges take the post-close
808
+ disposition**, both following precedents the script already carries: a closing
809
+ iteration that was never named (the `—` placeholder) has no close to have
810
+ skipped — the guard `LIFECYCLE_KIT_BOUNDARY_REQUIRE` applies one block down for
811
+ the same reason — and an inbox holding bullets with no cursor at all, a fresh
812
+ consumer's first boundary, is that case too.
813
+
814
+ **No second detector is added for the post-close window**: the existing refusal
815
+ already detects it, and what was missing was the message's actionability. That
816
+ ruling is **kept and re-read** rather than retired — the two-disposition shape
817
+ satisfies it more exactly than the two-recovery message did, since one detector
818
+ still fires and what the discriminator picks is only what to do about it.
819
+
820
+ **Why admission, and not merely a better-worded refusal.** A refusal that picks
821
+ the right message still leaves the queue write where this project's own history
822
+ puts it: made **before any stamp exists, by a session that has entered no
823
+ stage**, and committed as though by a stage that has not started. Routing a
824
+ post-close finding into the first stage's ordinary intake is satisfiable only
825
+ *inside* that stage — the intake is its — so the entry has to succeed for the
826
+ finding to reach it. What the change buys is that the disposition becomes an
827
+ ordinary in-stage queue write in the stage that writes the queue anyway.
828
+
829
+ **What the admission costs, and why the loss is smaller than it looks.** The
830
+ invariant "no gap outlives its iteration untriaged" is not weakened, because a
831
+ post-close bullet never had a drainer in the iteration it was filed in — that is
832
+ the defect, and no message could have supplied one. On admission the bullet
833
+ stops being post-close: it becomes an ordinary mid-iteration bullet of the
834
+ **new** iteration, and it therefore acquires the drainer it never had, that
835
+ iteration's mandatory close drain. The first stage is directed to take it
836
+ earlier because it is writing the queue anyway; if it does not, close does. That
837
+ forcing function is the existing one rather than a new one.
838
+
839
+ **The honest limit, stated because it is real.** The finding's *disposition*
840
+ then lands in the next iteration's ledger, which cannot be repaired: the finding
841
+ postdates its own iteration's close, so no iteration-correct ledger position
842
+ exists for it. What is repaired is legibility — a promoted entry's provenance
843
+ sentence carries the bullet's own date and names the iteration whose close
844
+ generated it, so a reader sees where the finding came from even though its
845
+ disposition sits one iteration later. A record that is late and says so is
846
+ strictly better than one that is late and silent.
847
+
848
+ That check is the inbox's
849
+ forcing function — branch-conditional as of the two dispositions above, refusing
850
+ on the close-skipped branch and obliging an in-stage disposition on the other —
851
+ so the inbox declares itself on the close-surface roster
678
852
  (§The close-surface roster) here, where the forcing function is documented:
679
853
 
680
854
  close-surface: .workflow/gap-inbox.md forced=lifecycle-kit/SPEC.md §bin/enter-stage.sh
681
855
 
682
856
  **Producers and consumers.** Producer: any mid-iteration session (lead or stage)
683
857
  via `bin/file-gap.sh` — the knob default makes the channel live everywhere the
684
- kit is vendored. Consumers: the close skill's drain step (§templates/stages/)
685
- dispositions every bullet — promoted to a deferred `[design-pending]` entry,
686
- fixed inline that session, or discarded with cause in the close commit message —
687
- then truncates the inbox to its header; the boundary refusal reads emptiness at
688
- the next scope entry as the backstop.
689
-
690
- That drain step is also the **sole producer** of the `recurrence:` declaration
691
- (queue-kit/SPEC.md §The tag algebra): a bullet naming a live slug stamps a
692
- recurrence date onto that entry's declaration — creating the line when absent,
693
- appending the date when present — **in addition to** its ordinary disposition,
694
- never instead of it. It is reachable at every close with no enabling config,
695
- since the drain is already mandatory and the boundary refusal already forces it,
696
- and no mid-iteration path writes the declaration at all. The drain
697
- **re-resolves the prose itself** rather than trusting the capture-time marker,
698
- and that is what makes the channel whole: a raw append into the inbox stays a
699
- legal fallback, so a bullet filed without the tool carries no marker and must
700
- still be counted. The marker is a capture-time convenience; the drain is the
701
- channel. Stamping is **idempotent per (slug, date)** — two filings of one slug on
858
+ kit is vendored. Consumers, **two**, one per disposition of the boundary check.
859
+ The close skill's drain step (§templates/stages/) dispositions every bullet —
860
+ promoted to a deferred `[design-pending]` entry, fixed inline that session, or
861
+ discarded with cause in the close commit message — then truncates the inbox to
862
+ its header. The **first stage's intake step** (§templates/stages/) takes the
863
+ bullets the boundary carried, with the same disposition set and the same
864
+ truncate-in-the-same-commit rule, run after its stamp; it is reachable at every
865
+ boundary with no enabling config, and it exists because a post-close bullet has
866
+ no drainer in the iteration that filed it. The boundary check reads emptiness at
867
+ the next first-stage entry as the backstop for both.
868
+
869
+ **A `recurrence:` date records a session's judgment that a finding re-occurred,
870
+ made by reading the bullet's prose. A slug appearing in a bullet is an input to
871
+ that judgment and never a verdict; no mechanism produces the declaration.**
872
+
873
+ That drain step is the declaration's only **mechanized** producer
874
+ (queue-kit/SPEC.md §The tag algebra), and it is the stage that must not skip the
875
+ judgment: on a bullet it judges a recurrence it stamps the date onto that entry's
876
+ declaration — creating the line when absent, appending the date when present —
877
+ **in addition to** its ordinary disposition, never instead of it. It is reachable
878
+ at every close with no enabling config, since the drain is already mandatory and
879
+ the boundary refusal already forces it.
880
+
881
+ The drain is *not* the only producer, and that path is **ruled: sanctioned, and
882
+ obliged.** A session that observes a recurrence outside the capture channel
883
+ stamps one directly, in the commit it is already making. The obligation attaches
884
+ to the **judgment**, not to the channel the observation arrived through — the
885
+ failure the counter exists to end is a recurrence *seen and not recorded*, and a
886
+ merely permitted write is one a session under pressure correctly declines, which
887
+ would answer the question in form and leave it open in substance.
888
+
889
+ **A lead cannot discharge that obligation as written, and the channel already
890
+ supplies what it can.** §templates/lead.md forbids the lead every queue write, so
891
+ a lead that judges a recurrence has exactly one channel — this inbox — and a
892
+ lead's judgment is made at the boundary, which is precisely where the check above
893
+ stands. The discharge is therefore *stated* rather than invented: **a lead
894
+ discharges the obligation by filing the judgment and its grounds into the
895
+ bullet's prose**, and the stamp is made by the session that may write the queue,
896
+ judging from that prose. That is the shape the drain already has — the bullet's
897
+ prose is the grounds the judge reads — so no new authority and no new producer is
898
+ created. What the two dispositions above supply is the route's far end: a
899
+ boundary-filed lead judgment reaches a judge rather than a refusal.
900
+ This settles the **authority** half only; the **reach** half — stages that may
901
+ write the queue but never load this rule — is untouched here.
902
+
903
+ *Not forbidden*, on three independent grounds. It would strand a class by
904
+ construction: this drain runs once, early in close, while close's own later steps
905
+ — audits, lesson disposition, staleness reads, release disposition — necessarily
906
+ generate findings that postdate it, leaving the one stage downstream of every
907
+ drain no legal channel at all. It is already being obeyed at a recorded cost, and
908
+ a rule whose disciplined observance produces a known-wrong count is the wrong
909
+ rule. And it would red roughly a third of its own precedent — the ground on which
910
+ the provenance gate below is refused, a refusal made to keep this route open.
911
+
912
+ *Not mechanized*, which is foreclosed rather than weighed: **no mechanism
913
+ produces the declaration** is the ruling stated above, and mechanizing this path
914
+ reverses it. Independently, the only available mechanism is the capture-time
915
+ matcher, whose honest limit above runs in the **under-counting** direction, so
916
+ mechanizing on it would dress a known-lossy predicate as a count.
917
+
918
+ *Prospective only, operator-ruled 2026-08-17, and this is the ruling's own reach
919
+ rather than a narrowing of it.* No session backfills a date onto a judgment an
920
+ earlier session declined to stamp. The trade below is what forecloses it: this
921
+ rule concedes re-derivability and pays with **auditability by inspection**, so a
922
+ date is legible only because the prose it was judged from sits in the same diff —
923
+ and for a past decline the judging session is gone and no contemporaneous prose
924
+ can be put there. A backfilled date would carry neither property, which is
925
+ precisely the artifact this section refuses to ship. The counter-argument is
926
+ recorded rather than buried: refutation two above rests on the declines having
927
+ produced a known-wrong count, and that count stays wrong. A rule change fixes the
928
+ count forward by removing what produced the error; retro-scoring is a different
929
+ act on a worse evidence base. Stated here so the reach is read rather than
930
+ re-derived.
931
+
932
+ Stamping is **idempotent per (slug, date)** — two filings of one slug on
702
933
  one day record one date, the day being the only resolution the bullet's own
703
934
  grammar has, and inventing a finer one would claim precision this channel does not
704
935
  carry.
705
936
 
706
- Each bullet's three fields have named readers: the date feeds close's staleness
707
- judgment and becomes the stamped recurrence date, the prose is the disposition
708
- body and the drain's own resolution input, and the optional recurrence marker is
709
- read by the filer at capture (via stderr) and by the drain as a convenience it
710
- does not depend on.
937
+ **What the judgment rule costs, and what pays for it.** The property the rule
938
+ declines to offer is **re-derivability**: a date is *not* reproducible by
939
+ re-running any predicate over the queue, so a reader cannot audit the count
940
+ without trusting the session that stamped it, and claiming otherwise would be the
941
+ dishonest half of the trade. What
942
+ pays for it is **auditability by inspection** — the drain stamps the declaration
943
+ in the *same commit* that truncates the inbox, so the judgment and the prose it
944
+ was made from sit in one diff and a reader auditing a date reads that commit and
945
+ sees the bullet the judge read. That same-commit rule is therefore **load-bearing
946
+ rather than incidental**: it is the audit artifact. The **invariant** is the
947
+ judgment and its grounds landing in one commit; truncating the inbox is one way
948
+ of satisfying it and not the thing itself. A direct stamp truncates nothing, so
949
+ it discharges the same obligation the only way it can — **the observation is
950
+ written into the entry, beside the declaration, in the stamping commit** — and a
951
+ reader auditing a direct date finds the grounds there exactly as with a drained
952
+ one. The same-commit rule is also what makes the
953
+ stamp a **mandated write** in queue-kit's sense — the class
954
+ queue-kit/SPEC.md §check-queue-entry-budget defines, and the section a stamping
955
+ session reads for its relief when that gate's per-entry cap blocks the stamp;
956
+ that grounds write is the same mandated write as the date it accompanies, its
957
+ grounds half rather than a discretionary addition, so it claims the same relief.
958
+ Neither the class nor the relief is restated here; this section is only the
959
+ contract that mandates the write. Re-running a matcher is
960
+ replaced by reading the grounds, which is the correct trade when the thing
961
+ recorded is a judgment.
962
+
963
+ **What the sanction adds is judges.** It adds no *new* class of unverifiability —
964
+ re-derivability is conceded above for the drain's own stamps — but the population
965
+ that may stamp widens from one stage to every session, and some of those sessions
966
+ judge their own tool use, which is a session grading itself. No gate can hold
967
+ that and none is proposed; the counterweight is the grounds obligation above,
968
+ which makes a thin judgment visibly thin.
969
+
970
+ **A provenance gate was drafted here and is refused, recorded so it is not
971
+ re-drafted.** Requiring every commit that adds a `recurrence:` date to co-stage
972
+ the inbox looks like the enforced replacement for re-derivability. It is not: a
973
+ back-test over this project's own history redded roughly one in three of the
974
+ commits that had ever stamped one, and it would foreclose the direct-stamp path
975
+ above by gating exactly the route the ruling there opens — which makes this
976
+ refusal retrospectively correct rather than speculative. A gate that
977
+ reds a third of the precedent it was derived from is measuring the rule, not the
978
+ tree.
979
+
980
+ Each bullet's two fields have named readers: the date feeds close's staleness
981
+ judgment and becomes the stamped recurrence date, and the prose is the
982
+ disposition body, the grounds the drain judges the recurrence from, the claim the
983
+ drain re-verifies, and — via the capture-time advisory on stderr — the field the
984
+ filer is asked to write the claim into. There is no third field, which is the point:
985
+ §check-gap-inbox-neutrality keeps it that way.
711
986
 
712
987
  ## The survey record
713
988
 
@@ -779,6 +1054,12 @@ witness:
779
1054
  2. **Oracle still?** Re-run `<oracle>` and compare its verdict to the one the
780
1055
  finding was written against.
781
1056
 
1057
+ **The witness is four strings, and that is what makes a finding portable.** It is
1058
+ not a property of the record file: the protocol's whole input is `corpus`,
1059
+ `oracle`, `rev` and `finding`, each a short string, and both commands run from
1060
+ HEAD. Copied onto another surface the witness is *more* durable than it is here,
1061
+ because the copy is not truncated.
1062
+
782
1063
  Both hold → **cite the record; do not re-buy the survey.** Either moved →
783
1064
  **dispatch only the delta**, the dispatch prompt naming the record block and the
784
1065
  diff, so the child re-surveys what changed rather than the corpus. The
@@ -802,10 +1083,13 @@ buys nothing the two-command witness does not. *Ruled out: auto-invalidating
802
1083
  every block on any commit* — too coarse to leave the mechanism any use; the
803
1084
  `corpus` pathspec exists precisely to make invalidation proportionate.
804
1085
 
805
- **The affordance.** `bin/file-survey.sh "<question>" "<corpus>" "<oracle>"
1086
+ **The affordance.** `bin/file-survey.sh [--] "<question>" "<corpus>" "<oracle>"
806
1087
  "<finding>"` appends one block, seeding the contract header when the record does
807
1088
  not yet exist. It follows `bin/file-gap.sh` exactly: repo-root cd,
808
- config-via-env, exit 2 on a missing or empty argument. Advisory tooling, not a
1089
+ config-via-env, exit 2 on a missing or empty argument, and the free-text
1090
+ argument-shape contract of gate-sdk/SPEC.md §The bin/-tool contract — whose
1091
+ refusal here scans **every** positional, since four slots make arity no
1092
+ protection at all. Advisory tooling, not a
809
1093
  gate — the raw append stays a legal fallback, the grammar being the surface's
810
1094
  contract rather than the writer.
811
1095
 
@@ -824,6 +1108,45 @@ prose routinely names queue slugs as its subject, and that resolver scans whole
824
1108
  prose, so it would stamp a recurrence declaration onto the survey's subject.
825
1109
  Adding no resolver here is a decision, not an omission.
826
1110
 
1111
+ **A permanent surface carries the finding, never a pointer into here.** A surface
1112
+ outside the boundary-truncated set — a queue entry, a SPEC section — must not
1113
+ promise a reader retrievable content in this record: the boundary reset below
1114
+ empties it, so the pointer resolves to nothing one iteration after it is written,
1115
+ and the finding survives only in the evicting commit. It inlines the finding
1116
+ together with the block's four witness fields instead, which is what keeps the
1117
+ finding *re-usable* rather than merely readable. Naming this record as a
1118
+ **subject** is unaffected — "the survey record is per-iteration scratch" promises
1119
+ nobody a retrieval — and that distinction is exactly what
1120
+ §check-scratch-citation's red condition is calibrated against.
1121
+
1122
+ **Commit-pinning the citation is wrong by construction, not merely awkward**, and
1123
+ it is the close a reader reaches for first. `bin/file-survey.sh` stamps `rev` as
1124
+ HEAD *at filing time*, which precedes the commit that lands the block — so
1125
+ `git show <rev>:<record>` reads a blob that does not contain the block being
1126
+ cited, and it fails silently by printing a record without it. The sha a pin would
1127
+ need is the *landing* commit, which no field carries and which is precisely the
1128
+ class of value this section already rules an author gets wrong.
1129
+
1130
+ **The affordance that makes inlining one command.** `bin/cite-survey.sh [--]
1131
+ "<heading-substring>"` selects the one block whose `## ` heading contains the
1132
+ substring and writes it to stdout as an inline-ready snippet — the heading and all
1133
+ four fields. It refuses (exit 2) on no match, on an ambiguous match, and on a
1134
+ record with no blocks, rather than guessing: the author asked for one finding, and
1135
+ a silently-chosen sibling would be pasted onto a permanent surface as if it were
1136
+ the one they read. It follows `bin/file-survey.sh` exactly — repo-root cd,
1137
+ config-via-env, exit 2 on a missing or empty argument, and — per
1138
+ gate-sdk/SPEC.md §The bin/-tool contract — the shape contract for its one
1139
+ free-text positional. It is advisory tooling,
1140
+ not a gate, the same disposition its sibling carries. It is a census find rather
1141
+ than a firing on that last point: it carries `file-gap.sh`'s exact single-argument
1142
+ shape and has simply not been run with a flag yet, and while it writes nothing,
1143
+ its help behavior was the same misleading error.
1144
+
1145
+ It deliberately does **not** rewrite the citing surface. The author chooses where
1146
+ the finding belongs and how much of the `finding` prose to carry; a tool that
1147
+ spliced would need a marker block, which would make a hand-written citation a
1148
+ second-class form of the very thing this rule is trying to make ordinary.
1149
+
827
1150
  **How this differs from the gap inbox, which it sits beside.** The two are
828
1151
  sibling committed per-iteration surfaces with deliberately *opposite* semantics
829
1152
  on both axes, and a reader who meets them apart will assume symmetry and get
@@ -945,7 +1268,8 @@ the same seam — a `forced=` declaration authored outside the manifest set woul
945
1268
  carry an unresolved citation, and no gate here catches that, because the
946
1269
  resolver is canon-kit's and lifecycle-kit does not depend on canon-kit.
947
1270
 
948
- **The derivation** is `bin/close-surfaces.sh`, never a maintained registry. Two
1271
+ **The derivation** is the `close-surfaces` emit arm
1272
+ (§The close-surfaces emit arm), never a maintained registry. Two
949
1273
  sources, unioned: every `close-surface:` declaration across the resolved kit
950
1274
  roots and the consumer's configured declaration surfaces; and every **gitignored
951
1275
  member of the workflow directory** — capture-tier by definition (gate-sdk/SPEC.md
@@ -980,6 +1304,45 @@ triage attention and were ranked against each other by nothing — and the roste
980
1304
  answers it directly: both appear on one derived roster, with modes, which is what
981
1305
  "ranked against each other" needs. Merging the files was the proxy, not the thing.
982
1306
 
1307
+ ## Testing
1308
+
1309
+ Every gate ships the ordinary `good/`+`bad/` fixture pair, and the scenarios one
1310
+ pair cannot hold live in `gate-tests/*.test.sh` scenario runners. What departs
1311
+ from the plain fixture-pair default, and what no single gate's subsection below
1312
+ can own, is how those runners **reach** their gate.
1313
+
1314
+ A runner that drives a gate names that gate, never a substrate: it resolves through
1315
+ `gate_run <name> <checks-dir> <args>` (gate-sdk/SPEC.md §run-gate-tests), which
1316
+ dispatches through `gate_command` exactly as the fixture harness does. A member
1317
+ that ports to a compiled subcommand therefore leaves its scenario coverage
1318
+ running unchanged — the property a path-named runner does not have, since the
1319
+ `checks/<name>.sh` it holds stops existing in the motion that lands the
1320
+ descriptor. For a case that differs by a knob rather than by argv, `gate_env
1321
+ NAME=VALUE` sets that one case's environment in the caller's subshell;
1322
+ `check-stage-evidence`'s session-boundary posture cases are the worked instance.
1323
+
1324
+ Every gate-driving runner in this kit resolves through `gate_run` rather than a
1325
+ held `checks/<name>.sh` path, and the payoff has now been collected **twice**:
1326
+ `check-stage-entry`'s runner needed no edit when that gate ported, and
1327
+ `check-close-surfaces`' sandbox-repo runner needed none when this one did —
1328
+ each already named the gate. Two attestations rather than one exception, which
1329
+ is the stronger claim this rule was written to earn.
1330
+
1331
+ The rest exercise `bin/` tools, which are advisory tooling with no gate to
1332
+ dispatch and so have nothing to say about reach.
1333
+
1334
+ `gate-tests/gap-inbox-route.test.sh` is one of those, and it is named because it
1335
+ closes a hole rather than adding coverage to a covered path: the
1336
+ iteration-boundary gap-inbox check had **no fixture at all**, so both its refusal
1337
+ and its recovery text were unpinned while being the thing an entering session
1338
+ acts on. It drives `bin/enter-stage.sh` against a sandboxed queue, state file and
1339
+ inbox — the harness `gate-tests/boundary-scratch-wipe.test.sh` established — and
1340
+ pins the branch both ways: the close-skipped case refuses with the drain recovery
1341
+ and writes nothing, the post-close case stamps and carries the bullets with its
1342
+ advisory, the never-named and no-cursor edges take the post-close branch, and
1343
+ `--simulate` reports each branch with its recovery relayed and writes nothing. No
1344
+ fixture *pair* is owed: this is a `bin/` tool, not a gate.
1345
+
983
1346
  ## Per-component contracts
984
1347
 
985
1348
  ### lib/stages.sh
@@ -1005,6 +1368,22 @@ readers deliberately do *not* call this helper — each derives the cursor
1005
1368
  itself from a path it already configures, so no consumer kit gains a
1006
1369
  lifecycle-kit dependency.
1007
1370
 
1371
+ `lifecycle_closing_stage_reached [<state-file>]` is the **closing-stage
1372
+ predicate** built on that cursor: success when the cursor equals the last member
1373
+ of `LIFECYCLE_KIT_STAGES`, failure otherwise — including for both no-cursor
1374
+ shapes, since a cursor that does not exist has not reached anything. It is
1375
+ hoisted rather than spelled at each site because its **two callers must agree by
1376
+ construction**: `bin/file-gap.sh` reads it for the capture-time warning that
1377
+ tells a filer which consequence they are buying, and `bin/enter-stage.sh` reads
1378
+ it at the iteration-boundary gap-inbox check to choose between refusing and
1379
+ admitting (§The committed gap inbox). A filer warned that "none is left to drain
1380
+ it" is warned by the very test that later admits the bullet, rather than by a
1381
+ lookalike that can drift from it. **No knob is minted and none is possible**: the
1382
+ last configured stage is already `LIFECYCLE_KIT_STAGES`'s last member, so the
1383
+ predicate is config-derived in every consumer with nothing left to configure. It
1384
+ is a predicate over the cursor and must not acquire a third caller silently —
1385
+ `lifecycle_current_stage` remains the general reader.
1386
+
1008
1387
  The loader also owns `lifecycle_registration_block`,
1009
1388
  which renders the resident registration block (§bin/install-lifecycle.sh) from the
1010
1389
  live config so `bin/install-lifecycle.sh` and `check-lifecycle-registration`
@@ -1018,7 +1397,11 @@ prints the derived union-merge set (the gap inbox — §The committed gap inbox)
1018
1397
  and `lifecycle_merge_attrs_block` renders the supersede set as
1019
1398
  `<path> merge=iteration-scoped` lines and the union set as `<path> merge=union`
1020
1399
  lines, so `bin/install-lifecycle.sh` (writer) and `check-merge-attrs` (asserter)
1021
- read one set (§Multi-operator semantics). Values and adapters only, never
1400
+ read one set (§Multi-operator semantics). `lifecycle_supersede_set` has a **third
1401
+ reader**, `check-scratch-citation`, which forbids a permanent surface pointing a
1402
+ retriever at any of its members — so a consumer adding a
1403
+ `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` member gets citation enforcement over it with no
1404
+ second roster to keep in step. Values and adapters only, never
1022
1405
  gate structure (gate-sdk's `lib/gate.sh` rule).
1023
1406
 
1024
1407
  ### bin/session-id.sh
@@ -1080,7 +1463,20 @@ rather than calling it directly.
1080
1463
  The deterministic writer for a stage transition: `enter-stage.sh <stage>`
1081
1464
  appends the invocation stamp, reading `session-id.sh` for
1082
1465
  the id — never an argument, so the no-hand-picking rule rides into the tool.
1466
+ It is the **sole production writer of `<head>`** (§The state machine), read as
1467
+ `git rev-parse --short HEAD` in the state file's own work tree at the instant of
1468
+ the append, and `none` where that yields nothing — so the field is produced by
1469
+ the live path every stage template's first step already invokes rather than only
1470
+ under test. It takes no enabling knob: the field is unconditional, which is what
1471
+ refusing an optional spelling buys.
1083
1472
  `<stage>` must be a configured stage; anything else is a usage error (exit 2).
1473
+ Its positionals are membership-validated rather than free text, so it owes no
1474
+ leading-`-` refusal (gate-sdk/SPEC.md §The bin/-tool contract) — but it owes the
1475
+ help half, and `-h`/`--help` as the first argument prints usage on stdout and
1476
+ exits 0. The measured cost of not owing it is in this tool's own history: a
1477
+ session hunting for the rename mode below ran `--help`, got
1478
+ `'--help' is not a lifecycle stage`, and worked around a contract for three
1479
+ sessions that the usage text would have settled in one command.
1084
1480
  An ordinary stage **writes the evidence file only** — the appended stamp *is*
1085
1481
  the transition, since the last stamp is the cursor, so the queue file is not
1086
1482
  touched and need not be committed. The first stage
@@ -1099,6 +1495,13 @@ kit-owned surfaces — `LIFECYCLE_KIT_LESSON_EVIDENCE_FILE` and
1099
1495
  as **built-in members**: the kit owns those surfaces, so they do not ride the
1100
1496
  consumer knob (git history keeps the retired stamps and the retired surveys).
1101
1497
 
1498
+ That written-surface set is also the **source of the stamp-commit purity
1499
+ assertion's exemption** (§check-stage-evidence): the boundary reset is the one
1500
+ legitimate reason a stamp commit touches anything besides the state file, so the
1501
+ assertion reads the members this reset already resolves rather than a roster
1502
+ minted to describe it — which is why widening the reset cannot leave the
1503
+ assertion behind.
1504
+
1102
1505
  **What counts as the header, for the truncate.** The retained run is the
1103
1506
  member's leading blank and `#` **comment** lines, stopping at the first data
1104
1507
  line *or* at a markdown `## ` section heading, whichever comes first. The second
@@ -1160,11 +1563,16 @@ The boundary entry also
1160
1563
  **refuses outright when `## Lessons Learned` is non-empty** (exit 1, the
1161
1564
  untriaged entries printed, nothing written — the same refusal contract as the
1162
1565
  built-in pre-flight): an untriaged lesson must not cross into the next
1163
- iteration, so no `[attend]` injection (queue-kit §bin/queue-index.sh) can
1164
- outlive the iteration that filed it. It **likewise refuses while the gap inbox
1165
- (`LIFECYCLE_KIT_GAP_INBOX_FILE`) holds bullets** — the same refusal contract, so
1166
- a mid-iteration gap the close skill did not drain (§The committed gap inbox)
1167
- cannot cross the boundary untriaged; an absent inbox has no bullets and passes.
1566
+ iteration, so no `[attend]` injection (queue-kit §The queue-index arm) can
1567
+ outlive the iteration that filed it. Its **gap-inbox check
1568
+ (`LIFECYCLE_KIT_GAP_INBOX_FILE`) is one detector with two dispositions**
1569
+ (§The committed gap inbox owns the design): it fires on any bullet, then reads
1570
+ `lifecycle_closing_stage_reached` to choose. A **close-skipped** boundary
1571
+ refuses on the same contract as the Lessons check, so a mid-iteration gap the
1572
+ close skill did not drain cannot cross untriaged; a **post-close** one admits
1573
+ the entry and prints the bullets as a stderr advisory naming them the entering
1574
+ stage's intake, because no stage of the closing iteration is coming back for
1575
+ them. An absent inbox has no bullets and passes either way.
1168
1576
  **The survey record, its neighbour in the boundary reset, deliberately does
1169
1577
  not refuse** (§The survey record): it is truncated like any built-in member, and
1170
1578
  a non-empty one is never a blocker, because a survey owes nobody a disposition —
@@ -1207,19 +1615,111 @@ the compliant one). `LIFECYCLE_KIT_ENTRY_PREFLIGHT` is a generic per-stage hook
1207
1615
  — no consumer surface is named in the kit; a downstream kit whose gate is the
1208
1616
  real precondition for a stage wires itself here (as evidence-kit's manifest gate
1209
1617
  does for close entry), turning a would-be pre-commit deadlock into a loud
1210
- refusal at the entry. **`--simulate <stage>` — the read-only preflight mode:**
1618
+ refusal at the entry. **Each entry's `<command>` is split on whitespace and
1619
+ exec'd as argv with no interpreter word prepended**, so the configured path rides
1620
+ its own exec bit: a consumer wiring a gate here configures the gate's *invocation*
1621
+ and not its declaration file, and a configured path that stops being executable —
1622
+ a member ported to a binary substrate leaving a data-file descriptor behind — is
1623
+ a stage-entry breakage rather than a stale reference. **`--simulate <stage>` — the read-only preflight mode:**
1211
1624
  it runs everything a real entry runs up to the write — config load and stage
1212
1625
  validation, header parse, session-id derivation, the idempotence probe (a
1213
1626
  would-be no-op is reported as such and exits 0), the candidate-stamp temp
1214
1627
  state build, `check-stage-entry`, every matching `LIFECYCLE_KIT_ENTRY_PREFLIGHT`
1215
- entry, and the iteration-boundary Lessons check — then stops: no stamp, no
1216
- boundary truncation, the temp files removed. Every output
1628
+ entry, and — at an iteration boundary — the Lessons check, the gap-inbox check
1629
+ and every `LIFECYCLE_KIT_BOUNDARY_REQUIRE` member, in the order a real entry runs
1630
+ them; then it stops: no stamp, no boundary truncation, the temp files removed.
1631
+ That roster is stated in full because a roster that stops short of the refusals
1632
+ the code runs is read as a guarantee the mode does not give. Every output
1217
1633
  line is prefixed `enter-stage (simulate):` so a transcript can never read as
1218
1634
  a stamp. Exit 0 = the real entry would proceed (or no-op); exit 1 = it would
1219
1635
  refuse, with the refusing check's output relayed line-by-line; exit 2 =
1220
- usage/config error, as a real entry. Not a gate — exercised in `smoke/`
1636
+ usage/config error, as a real entry.
1637
+
1638
+ **Every refusal's recovery is relayed too, and that is the mode's contract
1639
+ rather than a courtesy.** A refusal's `help:` line is its actionable half — the
1640
+ real refusal's own design rests on that (§The committed gap inbox) — so each one
1641
+ prints under `--simulate` as well, prefixed like every other simulate line. The
1642
+ mode's designed consumer is the lead (§templates/lead.md), which gates an
1643
+ expensive dispatch on it rather than hand-deriving prior-stage completeness;
1644
+ relaying a verdict while withholding the one line that resolves it hands that
1645
+ consumer the refusal and keeps the recovery, which is measured rather than
1646
+ supposed — a lead reading a simulated boundary refusal escalated a question the
1647
+ withheld line answers verbatim. The **gap-inbox check's post-close disposition
1648
+ reports the branch it would take**: that the entry would proceed, naming how
1649
+ many bullets it would carry into the entering stage's intake, since "would
1650
+ refuse" and "would proceed carrying work" are different answers to the question
1651
+ the lead is asking. Not a gate — exercised in `smoke/`
1221
1652
  beside the existing enter-stage coverage (would-pass, would-refuse,
1222
- would-no-op, nothing written). **Idempotent:** if the
1653
+ would-no-op, nothing written).
1654
+
1655
+ **`--rename <name>` — the mechanized iteration rename.** Naming an iteration is
1656
+ a **two-surface** write — the queue header's placeholder and column 1 of the
1657
+ first stage's stamp — which `check-stage-evidence` requires to agree, so it rides
1658
+ this writer rather than a second tool. `[--simulate] --rename <name>` sets the
1659
+ header to `## Iteration: <name>` and rewrites column 1 of **every** data line in
1660
+ the state file. Every line rather than only the last is correct by the boundary
1661
+ invariant, not by convenience: the first-stage entry truncates the state file, so
1662
+ every line below the separator belongs to the current iteration by construction —
1663
+ which is exactly what `check-stage-evidence` asserts — and the whole-file rewrite
1664
+ therefore also heals a half-landed hand-rename. **It is not stage motion**: no
1665
+ stamp is appended and no stage token is written, so the cursor is untouched and
1666
+ "stage motion never writes the queue" is unweakened. The precedent for this tool
1667
+ writing the queue header at all is the boundary reset, which already does.
1668
+
1669
+ Before writing, the mode asserts its **columns-2-to-last witness** — fields 2
1670
+ through `NF` of every data line (stage, session id, date, head, and any field a
1671
+ later grammar appends) identical before and after. It reads to the end of the
1672
+ line rather than to a pinned column because a field riding *outside* the witness
1673
+ could be dropped or corrupted by the rename with neither the tool nor its test
1674
+ noticing, which is exactly what the four-field spelling did to `<head>` the
1675
+ moment that field landed; an explicit column-5 check was refused because it
1676
+ re-hardcodes the arity the gap came from. This
1677
+ is the content predicate applied by the **writer**, where it is cheap and exact,
1678
+ rather than by the `Write`/`Edit` guard: a `PreToolUse` hook sees only *proposed*
1679
+ content, so proving "no stage token moved" there means reconstructing the
1680
+ pre-edit file and diffing field-wise inside a hook — the same computation with
1681
+ less information and no way to refuse cleanly. **Pre-flight, the same contract as
1682
+ the stamp path:** the candidate header and candidate state file are built as
1683
+ temporaries, `check-stage-evidence` runs against them, and a non-zero exit
1684
+ refuses with the gate's output relayed and nothing written. That gate is
1685
+ resolved through gate-sdk's `gate_command` rather than named by script path, so
1686
+ the arm names a gate and never a substrate: the resolved argv is prefix-shaped,
1687
+ so the two positionals ride it unchanged, and an argv the bridge refused to build
1688
+ is exit 2 — the dispatcher's own verdict — never a rename pre-flighted by a check
1689
+ that did not run. The built-in `check-stage-entry` pre-flight above resolves the
1690
+ same way, so both arms of this tool name a gate and neither names a substrate.
1691
+ **Refusals** (exit 2,
1692
+ nothing written): `<name>` empty; `<name>` equal to the unnamed placeholder,
1693
+ which only the boundary reset may write — checked ahead of the grammar that would
1694
+ also reject it, so the message names the owning writer instead of reporting a
1695
+ malformed name; and `<name>` outside the queue slug grammar `[a-z0-9][a-z0-9-]*`,
1696
+ where whitespace is the corrupting case, since column 1 is whitespace-delimited
1697
+ and a two-word name silently shifts every field of every stamp.
1698
+ **Idempotent** in the stamp path's sense: a header and every column 1 already
1699
+ reading `<name>` reports and exits 0 without writing. `--simulate --rename`
1700
+ relays what would change, prefixed `enter-stage (simulate):`, and writes nothing.
1701
+ The report names both written files and says to commit them together, which makes
1702
+ the one-commit coupling a property of the writer instead of a line of prose in
1703
+ the calling stage template.
1704
+
1705
+ One reader is **invalidated** by a rename rather than served by it, and it is the
1706
+ reason the placeholder refusal exists: `LIFECYCLE_KIT_BOUNDARY_REQUIRE`'s check
1707
+ matches the closing iteration's name against the first token of a disposition
1708
+ line and reds on finding *none*, so a rename landing after the close stage has
1709
+ stamped its disposition reds the next boundary. Renaming an iteration that has
1710
+ already been dispositioned is a rename to redo at the disposition surface too;
1711
+ un-naming one is refused outright.
1712
+
1713
+ **Ruled out: a separate `rename-iteration.sh` tool.** It would add a second
1714
+ sanctioned writer of the state file, and one-writer is the property the
1715
+ `Write`/`Edit` guard's own block message asserts and the whole reason that guard
1716
+ exists. Advisory tooling like `--simulate`, so no fixture pair is owed; the
1717
+ hermetic cases — both surfaces rewritten, fields 2-4 proved unchanged, the
1718
+ half-landed heal, each refusal, the idempotent no-op, and `--simulate --rename`
1719
+ writing nothing — live in `gate-tests/`, because a rename cannot be exercised
1720
+ against a live checkout's own queue the way `smoke/` exercises the stamp path.
1721
+
1722
+ **Idempotent:** if the
1223
1723
  state file already ends with a stamp for the same `<iteration> <stage> <id>`,
1224
1724
  it reports and exits 0 without appending, so a crashed-and-resumed session
1225
1725
  re-runs its entry step safely. It reads the `lib/stages.sh` knobs
@@ -1228,7 +1728,18 @@ re-runs its entry step safely. It reads the `lib/stages.sh` knobs
1228
1728
  `LIFECYCLE_KIT_BOUNDARY_PRESERVE`,
1229
1729
  `LIFECYCLE_KIT_BOUNDARY_REQUIRE`, `LIFECYCLE_KIT_LESSON_EVIDENCE_FILE`,
1230
1730
  `LIFECYCLE_KIT_SURVEY_RECORD_FILE`, and
1231
- `LIFECYCLE_KIT_ENTRY_PREFLIGHT`). Advisory tooling,
1731
+ `LIFECYCLE_KIT_ENTRY_PREFLIGHT`).
1732
+
1733
+ **This tool depends on `gate-sdk/lib/gate.sh`, and the dependency is stated
1734
+ rather than absorbed.** It is sourced at load — from `GATE_SDK_ROOT`, defaulting
1735
+ to the sibling `../gate-sdk` — not inside the one arm that dispatches a gate,
1736
+ because a missing library that surfaces halfway through a rename is worse than
1737
+ one that surfaces before the tool does anything. The dependency is precedented
1738
+ inside the kit, where every `checks/` member sources exactly that library, but it
1739
+ is new in `bin/`: a tree that vendored lifecycle-kit without gate-sdk cannot run
1740
+ the stamp writer at all. The alternative — a second
1741
+ dispatch resolver written into `bin/` — is the duplicate the shared substrate
1742
+ exists to remove, so the dependency is taken. Advisory tooling,
1232
1743
  not a gate: no fixture pair is owed; it is exercised end-to-end in
1233
1744
  `smoke/install.sh` — including the boundary require-check scenarios (a member
1234
1745
  naming the closing iteration passes; a member missing the line, a member absent
@@ -1278,22 +1789,45 @@ line is live the moment `.gitattributes` carries it.
1278
1789
  Advisory tooling, not a gate: no fixture pair is owed; every step is exercised
1279
1790
  end-to-end in `smoke/install.sh`.
1280
1791
 
1281
- ### bin/close-surfaces.sh
1792
+ ### The close-surfaces emit arm
1282
1793
 
1283
1794
  Prints the derived close-surface roster (§The close-surface roster), one row per
1284
1795
  surface, tab-separated `<path> <mode> <reclaim> <owner>`, sorted by path. A
1285
1796
  field with nothing declared is `-`; an owner-less row is a capture surface source
1286
1797
  2 found with no declaration, whose mode reads `(undeclared)`. The mode is echoed
1287
1798
  verbatim — a malformed one is passed through for `check-close-surfaces` to rule
1288
- on, so the derivation never silently repairs what the gate exists to catch.
1799
+ on, so the derivation never silently repairs what the gate exists to catch. An
1800
+ empty roster prints nothing and succeeds: a resolved-empty derivation is an
1801
+ answer, never an error.
1802
+
1803
+ A **non-gate arm** (gate-sdk/SPEC.md §The non-gate arm), invoked as
1804
+ `bash gate-sdk/bin/run-gates.sh --emit close-surfaces [scan-root]` — the
1805
+ front-end that resolves the arm's bridged knobs in front of it. Its two callers
1806
+ are `check-close-surfaces`, which reaches the derivation **in process** rather
1807
+ than spawning anything, and close's own inbound-triage sweep. Nothing stores the
1808
+ roster and nothing must: its whole value is that it is recomputed at the moment
1809
+ close reads it, so a capture surface added yesterday appears today.
1289
1810
 
1290
1811
  The declaration surfaces are the resolved kit roots' `LIFECYCLE_KIT_ROSTER_BASENAME`
1291
1812
  files plus every `LIFECYCLE_KIT_CLOSE_SURFACE_GLOBS` match (gate-sdk's kit-root
1292
1813
  resolution, consumer-first with kit shadowing — the order every kit registry
1293
- already uses); duplicates collapse. Follows the affordance contract:
1294
- repo-root `cd`, config-via-env, exit 2 on a non-repo cwd, an unreadable
1295
- declaration surface, or a `git check-ignore` that could not decide. Advisory
1296
- tooling, no fixture pair owed — the gate below is what blocks.
1814
+ already uses); duplicates collapse. Follows the affordance contract, with the
1815
+ `cd` a compiled arm cannot take becoming a **computed base**: the scan-root
1816
+ argument, else the repo toplevel, with every path globbed, ignored and printed
1817
+ relative to it. Config-via-env across the bridge; and the three exit-2 causes —
1818
+ a non-repo base, an unreadable declaration surface, a `git check-ignore` that
1819
+ could not decide — become the arm's error return, which the front-end and the
1820
+ in-process caller both surface. Advisory tooling, no fixture pair owed — the
1821
+ gate below is what blocks, and §The non-gate arm is the second, now-structural
1822
+ ground for the same verdict: an arm returning a document has no pass and no
1823
+ fail to fixture.
1824
+
1825
+ The sort is by path, with the **whole row** as its tie-break, and that is
1826
+ observable rather than incidental: one path may be declared on two surfaces, a
1827
+ duplication the derivation deliberately does not collapse (it collapses
1828
+ duplicate *surfaces*, not duplicate declarations). A path-only sort would leave
1829
+ the tie order at the sorter's discretion and churn the gate's error order for no
1830
+ edit.
1297
1831
 
1298
1832
  ### check-close-surfaces
1299
1833
 
@@ -1306,25 +1840,44 @@ declaration names a reclaim command**.
1306
1840
  Assertion B is shape-only, and resolution is somebody else's job already:
1307
1841
  `check-spec-pointer`'s prose pass resolves a `forced=` citation on any manifest
1308
1842
  surface (§The close-surface roster). Taking the presence-and-shape half here is
1309
- not a preference — `heading_present` is defined *inside*
1310
- `canon-kit/checks/check-spec-pointer.sh`, not exported from a library, so there
1311
- is no resolver a second gate could call. Reaching it would mean either copying
1843
+ not a preference — canon-kit's heading resolver is defined *inside its own gate*
1844
+ rather than exported from a library, and the port to the binary substrate did not
1845
+ change that: it is a private function of the compiled member, so there is still
1846
+ no resolver a second gate could call. Reaching it would mean either copying
1312
1847
  the resolver, which canon-kit's own tiering rule bans, or making lifecycle-kit
1313
1848
  depend on canon-kit — the same ownership-cycle argument that rules out the log
1314
1849
  merge. The honest arrangement is a pair of gates independently reading one
1315
1850
  surface, each asserting what it owns.
1316
1851
 
1317
- The gate reads the roster by running the affordance, so a roster it could not
1318
- derive is fail-closed (exit 2), as is an unreadable declaration surface. An
1319
- optional scan-root argument (passed through to the affordance) is the fixture
1852
+ The gate reads the roster by **calling the derivation in process**
1853
+ (§The close-surfaces emit arm),
1854
+ so a roster it could not derive is fail-closed (exit
1855
+ 2), as is an unreadable declaration surface. The in-process call is the point
1856
+ rather than an optimization: it makes "the derivation and the gate can never
1857
+ disagree" structural instead of conventional. It also means the descriptor
1858
+ acquires a **source coupling** — the gate module and the emit module it reaches
1859
+ transitively join `couples=` beside the surfaces already named, or the gate
1860
+ stays registered, green, and never triggered on the edit that broke it.
1861
+
1862
+ An optional scan-root argument (passed through to the derivation as its base) is
1863
+ the fixture
1320
1864
  capability: `git check-ignore` never reports a *tracked* path, and a fixture file
1321
1865
  must be tracked to survive a clone, so a case dir cannot hold a capture-tier
1322
1866
  member. The `good/`+`bad/` pair therefore covers assertion B on a consumer-set
1323
1867
  `LIFECYCLE_KIT_CLOSE_SURFACE_GLOBS`, and the bespoke
1324
1868
  `gate-tests/check-close-surfaces.test.sh` builds sandbox repos with a real
1325
- `.gitignore` for assertions A and C — the `check-exec-bit` precedent. Tier
1326
- `precommit`; the `# graph:` manifest couples the workflow dir and the
1327
- declaration surfaces.
1869
+ `.gitignore` for assertions A and C — the `check-exec-bit` precedent. Both move
1870
+ with the member across a substrate change rather than being re-authored: the
1871
+ pair is keyed by gate *name*, and the scenario runner dispatches by name through
1872
+ `gate_run` (§Testing). Tier
1873
+ `precommit`; the `# graph:` manifest couples the workflow dir, the
1874
+ declaration surfaces and the two crate modules.
1875
+
1876
+ The three assertions carry `assertion A:` / `assertion B:` / `assertion C:`
1877
+ markers in the implementing member's own source, in whatever comment leader its
1878
+ substrate spells. That is not decoration: `check-gate-assertions` set-matches
1879
+ the enumeration above against those markers and reds on an **empty** set, so a
1880
+ port that drops them leaves the gate looking unasserted.
1328
1881
 
1329
1882
  Calibration and honest limit: the gate asserts the roster is **complete and
1330
1883
  moded**, never that close actually *read* a surface. Reading is a session act
@@ -1352,7 +1905,10 @@ owed (the enforcement-first weighing). The freshness posture is
1352
1905
 
1353
1906
  A missing block is a finding with the install remedy; a block present but out
1354
1907
  of lockstep is a finding printing the diff and the regenerate remedy (both
1355
- exit 1). Resolution fails closed: a missing agent file, a begin marker without
1908
+ exit 1). The stale-block report prints **every** hunk: the format and the
1909
+ uncapped contract are the crate renderer's, whose home is
1910
+ gate-sdk/SPEC.md §The diff renderer since it stopped being this gate's private
1911
+ mechanism, and this gate is its one live consumer. Resolution fails closed: a missing agent file, a begin marker without
1356
1912
  its end, or an errored awk capture is exit 2 — a half-written or unreadable
1357
1913
  target must not pass as clean. The gate satisfies the four gate-sdk contracts
1358
1914
  (gate-sdk/SPEC.md §The gate model): the single `LIFECYCLE-REGISTRATION: clean`
@@ -1389,9 +1945,11 @@ stage axis off the header, nothing else would have caught it (an empty file
1389
1945
  gives the grammar and staleness passes nothing to reject).
1390
1946
 
1391
1947
  The stamp file is additionally kept provably bounded: every data line
1392
- must be grammatically well-formed — exactly four fields, stage ∈ the
1948
+ must be grammatically well-formed — exactly five fields, stage ∈ the
1393
1949
  configured stage set plus the waiver token (a stamp token but never a header
1394
- stage), date `YYYY-MM-DD`; every data line's iteration must be the current
1950
+ stage), date `YYYY-MM-DD`, and `<head>` either the literal `none` or a
1951
+ lowercase hex abbreviation of 7 to 40 characters (§The state machine owns the
1952
+ field); every data line's iteration must be the current
1395
1953
  one, stale lines from a prior iteration are rejected; and the `—`
1396
1954
  unnamed-iteration sentinel may appear only while the header itself is unnamed.
1397
1955
  It also reads the `<session-id>` field (which it once ignored) for one
@@ -1421,7 +1979,91 @@ undetected, so the allowance is stage-scoped, not global. The data section
1421
1979
  begins after the first `---` separator; prose above it is not validated
1422
1980
  line-by-line. Argument mode `$1 $2` (queue, state) with configured defaults
1423
1981
  makes the gate fixture-capable; the sentinel-scoping interplay that exceeds
1424
- one good/bad pair is covered by `gate-tests/check-stage-evidence.test.sh`.
1982
+ one good/bad pair is covered by `gate-tests/check-stage-evidence.test.sh`, which
1983
+ is also where the two assertions below are exercised — each needs a real git
1984
+ history, which no static fixture pair can carry.
1985
+
1986
+ **The stamp-provenance assertion.** A stamp proves the stage skill was invoked;
1987
+ this assertion is what makes it prove the invocation came **first**. For every
1988
+ **newly introduced** stamp, inside a git work tree: **`<head>` must name
1989
+ `HEAD`** — the recorded abbreviation, at least seven characters, must be a
1990
+ prefix of the full `HEAD` sha, so a consumer's `core.abbrev` never enters the
1991
+ contract.
1992
+
1993
+ A stamp is **newly introduced** when no data line in `HEAD`'s version of the
1994
+ state file carries the same `<session-id> <head>` pair. Identity is that pair
1995
+ rather than the whole line because `bin/enter-stage.sh --rename` rewrites
1996
+ column 1 of every data line and must not read as re-introducing all of them.
1997
+ **The migration clause** applies that same reasoning to the one other bulk
1998
+ rewrite this format has: a `HEAD`-version data line carrying only **four**
1999
+ fields matches any working-tree line with the same `<session-id>`, so the
2000
+ one-time five-field migration (§The state machine) is a rewrite and not an
2001
+ introduction. Without it the migration commit — and every consumer's own
2002
+ rewrite, which that section names as the recovery — would red against an
2003
+ assertion no historical stamp can satisfy. The clause is self-retiring:
2004
+ four-field lines cease to exist once migrated, and the boundary reset truncates
2005
+ the file within one iteration.
2006
+
2007
+ What it catches, without a history walk and without a per-stage surface roster:
2008
+ a session that stamps first and commits the stamp *after* its work commits has
2009
+ moved `HEAD` between the write and the commit, so the recorded head is stale and
2010
+ the gate reds naming both commits. **Same-stage re-entry is in reach by shape
2011
+ rather than by exemption** — a second session's stamp records its own `HEAD` and
2012
+ is committed on it, and the assertion never compares two stamps to each other.
2013
+
2014
+ **Four inertness conditions, all stated, because an unstated one reads as
2015
+ coverage.** The assertion does not run when
2016
+
2017
+ - **(a)** the state file's directory lies in no git work tree, or in a different
2018
+ one from the configured surfaces — a vendored tree under test, a sandbox;
2019
+ - **(b)** the file handed to the gate is not *this* work tree's own configured
2020
+ state file — its repo-root-relative path is not `LIFECYCLE_KIT_STATE_FILE`.
2021
+ "Inside a work tree" alone is not the discriminator the amendment behind this
2022
+ section assumed it was: a `gate-tests/` fixture tree sits inside the repo like
2023
+ everything else, and firing there would assert a recorded head against a repo
2024
+ whose history the fixture's stamps were never taken in. That is also what
2025
+ keeps this gate's argument mode fixture-capable at no cost to the assertion;
2026
+ - **(c)** the state file is not tracked in `HEAD`, because there is then no
2027
+ prior version to diff against and "newly introduced" is unanswerable rather
2028
+ than false — a consumer's first state-file commit;
2029
+ - **(d)** no stamp is newly introduced, which is every battery run that stamps
2030
+ nothing.
2031
+
2032
+ On the live file, `none` on a newly introduced stamp is a **red**, and that is
2033
+ what keeps the inertness from being a disarm. The residual is `git rm --cached`
2034
+ of the state file, which would restore condition (c): the same class as
2035
+ `--no-verify`, and closed by neither.
2036
+
2037
+ **The stamp-commit purity assertion.** The provenance assertion alone is
2038
+ defeated by a session that writes the stamp and its work into **one** commit:
2039
+ `HEAD` has not moved, so the recorded head is current. The complement closes it.
2040
+ Where the state file is among the staged paths *and* introduces a stamp, the
2041
+ staged path set must contain **only**:
2042
+
2043
+ - the state file — for any stage's stamp; and additionally
2044
+ - the queue file, `LIFECYCLE_KIT_LESSON_EVIDENCE_FILE`,
2045
+ `LIFECYCLE_KIT_SURVEY_RECORD_FILE`, the members of
2046
+ `LIFECYCLE_KIT_BOUNDARY_TRUNCATE`, and `LIFECYCLE_KIT_GAP_INBOX_FILE` — for
2047
+ the **first stage**'s stamp only, because the iteration-boundary reset
2048
+ legitimately writes all of them in one motion (§bin/enter-stage.sh).
2049
+
2050
+ The exemption set is **derived from the configuration the boundary reset already
2051
+ reads**, so no roster is minted and none can rot; no knob is added. Widening the
2052
+ set can only remove violations and narrowing it can only add them, so a config
2053
+ change here is safe to reason about by inspection in both directions. Gating on
2054
+ the *staged* set rather than on the working tree is what keeps a sibling
2055
+ session's staged file out of this verdict: a stamp nothing is committing is not
2056
+ a stamp this commit introduces. It mechanizes a sentence every stage template
2057
+ already carries — *commit the stamp on its own* — which is enforcement-first
2058
+ applied to prose that had no gate behind it.
2059
+
2060
+ **The concurrent-session false fire is real and its remedy is cheap.** Where a
2061
+ repo shares its git index between sessions, a sibling committing between a
2062
+ stamp's write and its commit moves `HEAD` and reds the stamp. The remedy is to
2063
+ re-run `bin/enter-stage.sh`, which appends a fresh stamp at the current `HEAD` —
2064
+ a same-stage re-entry, in-contract, and cheaper than any weakening that would
2065
+ admit the case the assertion exists to catch. The tool's idempotence guard reads
2066
+ the head for exactly this reason (§The state machine).
1425
2067
 
1426
2068
  Honest limit: the stamp proves the stage skill was *invoked*, never that it
1427
2069
  produced its green result — a validate stamp says validate ran, not that the
@@ -1430,6 +2072,63 @@ evidence manifest (a suite verdict per line) and, via the optional
1430
2072
  `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` integration, couples a close entry to
1431
2073
  the full green block.
1432
2074
 
2075
+ **The one ordering case neither assertion above reaches**, and it is structural
2076
+ rather than a gap in their design: a session that does its work, commits it, and
2077
+ only *then* runs `bin/enter-stage.sh`. The stamp legitimately records the
2078
+ post-work `HEAD`, the stamp commit is pure, both assertions pass — and the work
2079
+ still preceded the mark. The interval between stage X-1's stamp and stage X's
2080
+ holds X-1's legitimate work and X's illegitimate pre-stamp work, and nothing in
2081
+ the tree separates them. Only a *declared* boundary can, and there are two
2082
+ candidates: a per-stage output-surface roster, refused because "a stage's own
2083
+ output surfaces" is not derivable from the tree — a build stage's are
2084
+ approximately everything — and a configured one false-fires when coarse and
2085
+ misses when narrow; or an **exit mark**, which this kit does not have and which
2086
+ no reading of an entry stamp can supply. Closing the remaining case is therefore
2087
+ a **composition** with a deliverable that mints an exit mark, not more work
2088
+ inside these assertions. Recording that is what stops the next reader
2089
+ re-deriving the refused roster.
2090
+
2091
+ What the assertions do close is the generalization that *every entry-time
2092
+ assertion is satisfiable retroactively*, which fails for this one: the recorded
2093
+ head is bound to a commit that already existed when the stamp was written, and a
2094
+ stamp introduced later is checked against the `HEAD` of its own introduction, so
2095
+ re-satisfying it means re-stamping — which is a fresh, honest stamp rather than
2096
+ a forged one.
2097
+
2098
+ **The uncommitted window, and what closes it.** This gate — and every other one
2099
+ that would catch a hand-written stamp — fires at *commit*. The cursor, though, is
2100
+ the working tree's last stamp, and every reader reads the working tree. So a
2101
+ session that hand-edits the state file and simply never commits moves the stage
2102
+ cursor for its entire life and is caught by nothing. Content-based detection
2103
+ narrows this and does not close it: the `<head>` field makes a hand-written stamp
2104
+ name the `HEAD` it claims to have been taken at, so it is not byte-identical to
2105
+ `bin/enter-stage.sh`'s for free — but a hand that reads `git rev-parse --short
2106
+ HEAD` writes an identical line, and a stamp that is never committed is never
2107
+ checked at all.
2108
+
2109
+ `templates/workflow-state-guard.sh` closes the part of that window an agent
2110
+ tooling actually passes through. It is a `PreToolUse(Write|Edit)` hook (register
2111
+ it on the alternation matcher; guard-kit's wiring template carries the block) that
2112
+ refuses a write whose target **resolves** to the state file, naming
2113
+ `bin/enter-stage.sh` as the sanctioned writer. Resolved, not textual: an absolute
2114
+ path, a `./` prefix and a route through a symlinked directory are one file, and a
2115
+ textual comparison catches only the spelling it was written against. It reads the
2116
+ path through guard-kit's `guard_read_path` and rides `lib/guard.sh` on the
2117
+ `GUARD_KIT_LIB` indirection, so lifecycle-kit ships the rule and guard-kit ships
2118
+ the mechanism (guard-kit/SPEC.md §The guard framework). The
2119
+ `GATE_SDK_WORKFLOW_DIR` indirection is honored, so a consumer who relocated the
2120
+ workflow directory gets a guard that follows it. No knob is added: there is no
2121
+ value to configure.
2122
+
2123
+ The residual is stated because an unstated residual reads as a closed hole. The
2124
+ guard reaches agent `Write`/`Edit` tool calls and nothing else — not a `Bash`
2125
+ redirect, not `--no-verify` at the commit that would have caught the result, not a
2126
+ human editing the file outside the agent tooling, and not any future writer that
2127
+ is not one of those tool calls. It narrows the window to the writers the harness
2128
+ routes through a hook; it does not close it. And it is inert until wired: shipping
2129
+ the template without the settings block yields a file that enforces nothing while
2130
+ looking like it does.
2131
+
1433
2132
  ### check-stage-entry
1434
2133
 
1435
2134
  Invariant: the stage being *entered* re-verifies its prior stage's static
@@ -1437,7 +2136,12 @@ exit, extending the invocation-stamp floor `check-stage-evidence` provides
1437
2136
  for the current stage one hop back (a shared surface, a distinct invariant:
1438
2137
  *stamp grammar + name-axis agreement* there, *prior-stage invoked +
1439
2138
  entered-stage static exit* here). It reads the entered stage from the **cursor**
1440
- — the state file's last stamp — and the iteration from the header. An empty
2139
+ — the state file's last stamp — and the iteration from the header, both through
2140
+ the shared `lifecycle_current_stage`/`header_iter` derivations, which take
2141
+ positional fields one to three. That is why the `<head>` field appended in
2142
+ §The state machine moved nothing here, and it is recorded rather than left
2143
+ unstated so the next grammar change knows this reader was checked and cleared
2144
+ rather than overlooked. An empty
1441
2145
  cursor is unreachable by construction here and stays a hard parse error rather
1442
2146
  than a disarm: `enter-stage.sh` hands the gate a temp state file that always
1443
2147
  carries the candidate stamp, and at commit time the entry commit stages that
@@ -1503,7 +2207,29 @@ approximates "changes ≥2 components' *contracts*" with "touches or names ≥2
1503
2207
  component surfaces" — it can over-demand (the cheap waiver valve absorbs
1504
2208
  that) and can under-detect a purely semantic cross-component impact; it
1505
2209
  converts a silent skip into a stamp, a recorded waiver, or a narrow
1506
- false-negative, strictly better than self-report. The good/bad pair covers
2210
+ false-negative, strictly better than self-report.
2211
+
2212
+ **The gate dispatches to the binary substrate** — `checks/check-stage-entry.gate`
2213
+ to `native/src/gates/stage_entry.rs`, the shell script deleted — and the port
2214
+ asserts nothing new: the three assertions, their calibration and assertion C's
2215
+ honest limit are exactly as stated above. The port was held on the config
2216
+ bridge's want of a key channel, since the predecessor map is read **by key**
2217
+ (gate-sdk/SPEC.md §lib/gate.sh, the keyed arm that retired the hold). Two
2218
+ consequences are worth stating where a reader of this gate will look for them.
2219
+ Its `couples=` **widens** to reach the amendment and roster corpora assertion C
2220
+ scans, which is correct coupling rather than a concession: an amendment landing
2221
+ anywhere genuinely changes what C sees, and the shell form's
2222
+ `# reads-couples-exempt:` markers were excusing that rather than expressing it.
2223
+ And its two whole-tree scans are declared to `--reads` as one root under two
2224
+ **filter-knob** names, `LIFECYCLE_KIT_ROSTER_BASENAME` and
2225
+ `LIFECYCLE_KIT_AMENDMENT_GLOB` — the channel gate-sdk/SPEC.md §check-reads-couples
2226
+ grew for it, so the port **answers** that assertion where the shell member was
2227
+ exempt from it. **Honest limit on the crate-side declaration:** neither fixture
2228
+ case reaches assertion C, so the crate's declared-roots unit test holds over an
2229
+ empty observation for this member and the scans' coverage rests on the
2230
+ behavioral test below and on the live battery.
2231
+
2232
+ The good/bad pair covers
1507
2233
  assertion A; `gate-tests/check-stage-entry.test.sh` covers B and C over nine
1508
2234
  sandbox scenarios (untagged residue red, tagged residue at drain entry green,
1509
2235
  empty-reason tag red, tagged residue at successor entry red; two-dir
@@ -1714,6 +2440,116 @@ the class delegation-kit/SPEC.md §Operative residency rules no gate is owed for
1714
2440
  The entry report's read trigger (§bin/enter-stage.sh) is the affordance in place
1715
2441
  of an oracle there, and it is weaker than one by construction.
1716
2442
 
2443
+ ### check-scratch-citation
2444
+
2445
+ Invariant: no surface in `LIFECYCLE_KIT_PERMANENT_SURFACE_GLOBS` carries a
2446
+ **retrieval pointer** to a path in the derived boundary-truncated set. The rule
2447
+ and why inlining is the right close are §The survey record's; this section owns
2448
+ the red condition.
2449
+
2450
+ **The forbidden-target set is derived, never maintained** — it is
2451
+ `lifecycle_supersede_set` (§lib/stages.sh), already the single derivation behind
2452
+ the installer's `.gitattributes` block and `check-merge-attrs`'s parity check.
2453
+ This gate is its third reader, which is why a consumer widening its truncate
2454
+ configuration gets citation enforcement for free.
2455
+
2456
+ **Retrieval-pointer position, stated as the red condition.** A supersede-set path
2457
+ that is either **(a)** in markdown link-target position — the parenthesized half
2458
+ of a `[text]`-plus-parentheses pair — or **(b)** preceded
2459
+ by a colon and whitespace and followed by nothing but a closing quote, comma,
2460
+ period, bracket or end of paragraph — the attested form, *"Full finding and its
2461
+ two-command witness"* followed by the path. A bare path elsewhere in prose is a
2462
+ **mention** and is clean; that is the whole calibration, and it is why this is
2463
+ specified as a position rather than as a pattern.
2464
+
2465
+ **The scan joins a paragraph's wrapped continuation lines before testing (b), or
2466
+ it is blind on its own worked example.** A queue file wraps prose to a budget, so
2467
+ a colon and the path it introduces routinely land on different physical lines —
2468
+ which is exactly what the attested instance did. The join is
2469
+ `check-spec-pointer`'s prose-extraction shape (canon-kit/SPEC.md
2470
+ §check-spec-pointer), adopted rather
2471
+ than re-decided: concatenate a blank-line-delimited paragraph, match over the
2472
+ join, and map a hit back to its physical line through per-line start offsets. A
2473
+ scanner that is right on an unwrapped fixture and silently blind on the wrapped
2474
+ case it was written for is the failure this forecloses, which is why the `bad/`
2475
+ case carries a wrapped instance beside the single-line and markdown-link forms.
2476
+
2477
+ **Per-line escape hatch:** a `scratch-citation-exempt:` tag on the line above the
2478
+ hit, this repo's established opt-out shape, for a surface that must quote a dead
2479
+ citation verbatim in order to describe it. Its reader is this gate's scanner, at
2480
+ the transition where it has matched a pointer and is deciding whether to record a
2481
+ finding. *Stated so it is not mistaken for more than it is:* the class is real and
2482
+ permanent — any entry documenting a citation defect must quote one — but the tree
2483
+ carries no live user today, because the entry that motivated the tag completed and
2484
+ its prose left the queue with it. The `bad/`+`good/` fixture pair is where the
2485
+ hatch is exercised.
2486
+
2487
+ The gate satisfies the four gate-sdk contracts: the single
2488
+ `SCRATCH-CITATION: clean` line naming how many surfaces were scanned, and a
2489
+ `help:` remedy naming `bin/cite-survey.sh` and the exempt tag on the finding path
2490
+ (output); exit 2 on an empty derived target set and on a failed parse
2491
+ (fail-closed); a `good/`+`bad/` pair whose good case copies the mention forms live
2492
+ entries actually use — a path opening a wrapped line after a full stop, a
2493
+ prepositional mention, a colon-introduced pointer at a **non**-member path, and a
2494
+ tagged dead citation — because a rule that reds any of those is wrong and the
2495
+ fixture is what says so (fixture-pair); and registration in this repo's
2496
+ `gates.list`, where its surfaces are this repo's own queue and spec set
2497
+ (self-lint).
2498
+
2499
+ *Not gated:* whether an inlined finding is faithful to the block it came from.
2500
+ Nothing tracked relates the two once the record is truncated, and inventing a
2501
+ provenance field would re-open the per-iteration lifetime the record's design
2502
+ turns on.
2503
+
2504
+ ### check-gap-inbox-neutrality
2505
+
2506
+ Invariant: the gap inbox (§The committed gap inbox) records observations, not
2507
+ conclusions. Two assertions over every non-blank line below the `# contract:`
2508
+ header:
2509
+
2510
+ - **A — grammar.** Every line is `- <YYYY-MM-DD> — <prose>` with non-empty
2511
+ prose. Nothing gated this before, even though the raw append is an explicitly
2512
+ legal fallback, so a malformed bullet was found by the drain reading it an
2513
+ iteration later.
2514
+ - **B — no interposed verdict.** No bullet's prose opens with the retired
2515
+ ``recurrence of `<slug>`:`` form. This is the class assertion, and its value is
2516
+ that it catches a conclusion reaching the capture surface **by any producer** —
2517
+ a stale vendored affordance, a hand append copying an older bullet's shape —
2518
+ rather than only the affordance this kit ships. The `help:` line teaches the
2519
+ rule rather than the regex: say *why* you believe the bullet re-files an entry,
2520
+ in the prose, and let the drain judge.
2521
+
2522
+ An absent inbox is **clean, not fail-closed** — never having filed a gap is a
2523
+ legal state for a fresh consumer, unlike §check-lifecycle-registration's missing
2524
+ agent file, which is an install that did not finish. Fail-closed applies to the
2525
+ scanner's own exit status, per gate-sdk's contract.
2526
+
2527
+ **Bare drives the configured inbox; an explicit file argument drives it
2528
+ hermetically**, the §check-survey-record precedent, which is what lets the
2529
+ fixture pair run against a copied inbox.
2530
+
2531
+ **Why the tool-side contract is pinned separately.** This gate reads the surface
2532
+ and cannot see which producer wrote a line, so it cannot hold the affordance to
2533
+ its own contract. `gate-tests/file-gap-recurrence.test.sh` is what does that. The
2534
+ two together are the enforcement: the fixture-runner catches the producer
2535
+ regressing, the gate catches a verdict arriving by any other route.
2536
+
2537
+ The gate satisfies the four gate-sdk contracts (gate-sdk/SPEC.md §The gate
2538
+ model): the single `GAP-INBOX-NEUTRALITY: clean` line and a `help:` remedy on the
2539
+ finding path (output); exit 2 on an unreadable or explicitly-named-but-missing
2540
+ inbox and on a failed parse (fail-closed); a `good/`+`bad/` fixture pair under
2541
+ `gate-tests/` driven through the hermetic argument — the good case a record whose
2542
+ prose both re-files and disclaims an entry in words, the bad case a retired
2543
+ marker beside two broken bullets (fixture-pair); and registration in this repo's
2544
+ `gates.list`, where its scan target is this repo's own inbox (self-lint). Its
2545
+ `# graph:` couples the inbox at `tier=precommit`.
2546
+
2547
+ *Not gated, and stated so the gate is not mistaken for more than it is:* whether
2548
+ a bullet's prose states the recurrence claim **at all**, and whether the claim is
2549
+ **right**. Assertion B removes the one shape that pre-empts the judge; it cannot
2550
+ compel a filer to answer the advisory, and the judgment itself is the drain's
2551
+ (§templates/stages/), which is where the amendment deliberately put it.
2552
+
1717
2553
  ### templates/stages/
1718
2554
 
1719
2555
  The stage-skill templates (`scope`/`align`/`build`/`validate`/`close`) carry
@@ -1833,7 +2669,7 @@ and one that genuinely has not been consumed *should* keep firing.
1833
2669
  A consumer deriving that outstanding set reads the disposition file as
1834
2670
  **history ∪ live** — not replacement, not fallback — the same reader
1835
2671
  drift-kit/SPEC.md §The stage-economics meter applies to the stage stamps and
1836
- `drift-kit/bin/trajectory.sh` already ships. The file is typically a `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` member,
2672
+ drift-kit's `trajectory` emit arm already ships. The file is typically a `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` member,
1837
2673
  so a carrying line survives only in committed history and a live-only reader sees
1838
2674
  nothing; conversely a history-only reader is blind at exactly the moment that
1839
2675
  matters most for a precommit gate — the pre-commit of the very close commit