checkwright 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +687 -90
  2. package/lib/common/lock.sh +38 -9
  3. package/lib/common/profile.sh +33 -0
  4. package/lib/common/recipe.sh +49 -33
  5. package/lib/diff.sh +64 -0
  6. package/lib/doctor.sh +67 -42
  7. package/lib/init.sh +23 -31
  8. package/lib/uninstall.sh +212 -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 +410 -58
  15. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -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.sh +1 -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.sh +1 -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.sh +1 -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.sh +1 -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-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +3 -2
  49. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  50. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  51. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  62. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  63. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  64. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +27 -5
  65. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  66. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  67. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  68. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  69. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  70. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  71. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  72. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  73. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +3 -3
  74. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  75. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  76. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  77. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  78. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +3 -0
  79. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  80. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  81. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  82. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  83. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  84. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  85. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  86. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  87. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  88. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  89. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  90. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  91. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  92. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  93. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  94. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  95. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  96. package/payload/canon-kit/lib/spec.sh +91 -62
  97. package/payload/canon-kit/smoke/install.sh +1 -0
  98. package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
  99. package/payload/context-kit/README.md +4 -1
  100. package/payload/context-kit/SPEC.md +143 -10
  101. package/payload/context-kit/bin/env-probe.sh +19 -6
  102. package/payload/context-kit/checks/check-brevity.sh +1 -0
  103. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  104. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  105. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  106. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  107. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  108. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  109. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  110. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  111. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  112. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  113. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  114. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  115. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  116. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  117. package/payload/context-kit/lib/toolfloor.sh +15 -4
  118. package/payload/context-kit/smoke/agents-md.sh +12 -1
  119. package/payload/context-kit/smoke/install.sh +1 -0
  120. package/payload/delegation-kit/README.md +3 -3
  121. package/payload/delegation-kit/SPEC.md +116 -13
  122. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  123. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -0
  124. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  125. package/payload/delegation-kit/templates/agent-execution.md +38 -14
  126. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  127. package/payload/doctrine-kit/DOCTRINE.md +86 -12
  128. package/payload/doctrine-kit/README.md +7 -3
  129. package/payload/doctrine-kit/SPEC.md +102 -9
  130. package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
  131. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  132. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  133. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  134. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  135. package/payload/doctrine-kit/smoke/install.sh +90 -0
  136. package/payload/drift-kit/SPEC.md +13 -4
  137. package/payload/drift-kit/bin/kfric.sh +21 -2
  138. package/payload/drift-kit/smoke/install.sh +28 -0
  139. package/payload/evidence-kit/checks/check-battery-roster.sh +1 -0
  140. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  141. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  142. package/payload/evidence-kit/checks/check-producer-liveness.sh +1 -0
  143. package/payload/gate-sdk/README.md +13 -0
  144. package/payload/gate-sdk/SPEC.md +2611 -151
  145. package/payload/gate-sdk/bin/build-native.sh +38 -0
  146. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  147. package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
  148. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  149. package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
  150. package/payload/gate-sdk/bin/run-gate-tests.sh +26 -5
  151. package/payload/gate-sdk/bin/run-gates.sh +8 -2
  152. package/payload/gate-sdk/bin/upgrade-smoke.sh +52 -4
  153. package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -0
  154. package/payload/gate-sdk/checks/check-action-pinning.gate +1 -0
  155. package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -0
  156. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  157. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  158. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  159. package/payload/gate-sdk/checks/check-core-files.sh +1 -0
  160. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  161. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  162. package/payload/gate-sdk/checks/check-exec-bit.sh +1 -0
  163. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  164. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +2 -1
  165. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +1 -0
  166. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  167. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  168. package/payload/gate-sdk/checks/check-gate-output.sh +33 -3
  169. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +36 -5
  170. package/payload/gate-sdk/checks/check-graph.sh +1 -0
  171. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  172. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  173. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  174. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  175. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  176. package/payload/gate-sdk/checks/check-readme-roster.sh +1 -0
  177. package/payload/gate-sdk/checks/check-reads-couples.sh +3 -2
  178. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  179. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  180. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  181. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  182. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  183. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  184. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  185. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  186. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  187. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  188. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  189. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  190. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  191. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  192. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  193. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  194. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  195. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  196. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  197. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  198. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  199. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  200. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  201. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -1
  202. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  203. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  204. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  205. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  206. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
  207. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +65 -4
  208. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  209. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  210. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  211. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  212. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  213. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  214. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  215. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  216. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  217. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  218. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  219. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  220. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  221. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  222. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  223. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  224. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  225. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  226. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +111 -1
  227. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  228. package/payload/gate-sdk/lib/consumer-smoke.sh +24 -12
  229. package/payload/gate-sdk/lib/gate.sh +135 -11
  230. package/payload/gate-sdk/lib/inject.sh +25 -0
  231. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  232. package/payload/gate-sdk/smoke/install.sh +42 -0
  233. package/payload/guard-kit/README.md +14 -11
  234. package/payload/guard-kit/SPEC.md +278 -62
  235. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  236. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  237. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  238. package/payload/guard-kit/lib/guard.sh +276 -54
  239. package/payload/guard-kit/templates/close-triage.md +5 -5
  240. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  241. package/payload/lifecycle-kit/README.md +11 -1
  242. package/payload/lifecycle-kit/SPEC.md +441 -37
  243. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  244. package/payload/lifecycle-kit/bin/enter-stage.sh +126 -10
  245. package/payload/lifecycle-kit/bin/file-gap.sh +27 -10
  246. package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
  247. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  248. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  249. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  250. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  251. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  252. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  253. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  254. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  255. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  256. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  257. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  258. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  259. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  260. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  261. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  262. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  263. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  264. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  265. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  266. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  267. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  268. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -3
  269. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  270. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  271. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  272. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  273. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  274. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  275. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  276. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  277. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  278. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  279. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -3
  280. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +54 -26
  281. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  282. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  283. package/payload/lifecycle-kit/lib/stages.sh +4 -0
  284. package/payload/lifecycle-kit/smoke/install.sh +67 -4
  285. package/payload/lifecycle-kit/templates/lead.md +36 -0
  286. package/payload/lifecycle-kit/templates/stages/close.md +30 -11
  287. package/payload/lifecycle-kit/templates/stages/scope.md +9 -4
  288. package/payload/lifecycle-kit/templates/stages/spec.md +5 -1
  289. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  290. package/payload/queue-kit/README.md +3 -1
  291. package/payload/queue-kit/SPEC.md +123 -3
  292. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  293. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  294. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  295. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  296. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  297. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  298. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  299. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  300. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  301. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  302. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  303. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  304. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  305. package/payload/queue-kit/lib/queue.sh +4 -19
  306. package/payload/site-kit/SPEC.md +23 -0
  307. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  308. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  309. package/profiles.list +36 -8
  310. package/payload/canon-kit/checks/check-comment-tier.sh +0 -216
  311. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  312. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  313. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  314. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  315. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  316. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  317. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  318. package/payload/canon-kit/checks/check-payload-claim.sh +0 -133
  319. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  320. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  321. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  322. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  323. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -187
  324. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  325. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  326. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  327. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  328. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  329. package/payload/gate-sdk/checks/check-template-registry-parity.sh +0 -81
  330. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  331. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  332. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  333. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  334. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  335. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  336. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  337. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  338. package/payload/lifecycle-kit/checks/check-survey-record.sh +0 -102
  339. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -106
  340. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  341. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  342. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  343. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  344. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  345. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  346. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -466,8 +466,17 @@ the clause's reader is a human or agent rather than a gate.
466
466
  declaration vocabulary is kit-owned and carries no consumer content; the roster
467
467
  is derived, never a kit literal — a kit shipping the *names* of a consumer's
468
468
  inbound surfaces would publish that consumer's private workflow.
469
+ - `LIFECYCLE_KIT_PERMANENT_SURFACE_GLOBS` — array of path globs for the surfaces
470
+ held to the no-retrieval-pointer rule (§check-scratch-citation); default the
471
+ queue file alone (`LIFECYCLE_KIT_QUEUE_FILE`). That default is the one permanent
472
+ surface this kit owns and where both attested firings landed, so it is
473
+ non-vacuous in every consumer and over-reaches in none. The roster is consumer
474
+ config and the forbidden targets are derived from the consumer's own truncate
475
+ configuration, so no kit literal names any surface a consumer happens to have.
469
476
  - `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` — extra files reset to their header at the
470
- iteration boundary; default empty.
477
+ iteration boundary; default empty. Adding a member also widens
478
+ `check-scratch-citation`'s forbidden-target set, because both read
479
+ `lifecycle_supersede_set`.
471
480
  - `LIFECYCLE_KIT_BOUNDARY_PRESERVE` — keep-list of scratch-dir **basenames** the
472
481
  iteration-boundary wipe spares (§bin/enter-stage.sh); default empty, so an
473
482
  unset-knob consumer gets a clean wipe of an already-disposable surface.
@@ -593,22 +602,35 @@ friction, and routes here.
593
602
  **The surface.** `.workflow/gap-inbox.md` (knob `LIFECYCLE_KIT_GAP_INBOX_FILE`,
594
603
  §Layout and configuration) is a committed, append-only capture buffer. Grammar:
595
604
  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
605
+ gap — **one shape for every filing**, with no structured slot between the date
606
+ and the prose. A slug named *inside* the prose takes queue-kit's existing
607
+ in-body citation form (queue-kit/SPEC.md §The tag algebra), single-backticked,
608
+ borrowed rather than re-spelled; it is a citation and never a field, which is
609
+ the whole distinction §check-gap-inbox-neutrality holds. Committed, not gitignored — a
600
610
  per-clone buffer fragments the backlog across
601
611
  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
612
+ What *append-only* means on this surface is a merge property, and
613
+ §Multi-operator semantics owns it: this is the kit's one `union`-driver surface.
614
+
615
+ **The affordance.** `bin/file-gap.sh [--] "<gap prose>"` (the `bin/kfric.sh`
616
+ pattern: repo-root cd, config-via-env, exit 2 on an empty argument) appends one
617
+ dated bullet, seeding the contract header when the inbox does not yet exist. Its
618
+ one positional is free text, so it validates that argument's **shape** to
619
+ gate-sdk/SPEC.md §The bin/-tool contract — help on stdout at exit 0, an
620
+ unrecognized leading `-` refused, `--` ending option processing — which is the
621
+ rule this capture affordance's own three attested firings bought. It is
606
622
  advisory tooling, not a gate — no fixture pair is owed; the raw append (a bullet
607
623
  line into the inbox) stays a legal fallback, the grammar being the surface's
608
624
  contract, not the writer.
609
625
 
610
626
  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
627
+ match, raises a stderr advisory that **asks** the filer: the prose names live
628
+ entry `<slug>` — if this bullet *re-files* that finding, say so in the prose and
629
+ say why; if it merely cites, corrects, or argues against that entry, say it is
630
+ *distinct* and why, because the closing stage's drain judges the recurrence and
631
+ reads what was written. The resolution buys a prompt and nothing else: it writes
632
+ no marker, and the bullet it accompanies is the same one shape every filing gets.
633
+ The
612
634
  live set is every column-0 `- **<slug>** —` entry bullet in the queue file
613
635
  *outside* the fixed-spelling `## Lessons Learned` section — that is exactly
614
636
  active, deferred, and a configured icebox — and it needs **no section knob of its
@@ -618,7 +640,7 @@ entry grammar queue-kit/SPEC.md §The queue format defines. Lessons is excluded
618
640
  name, and must be: a lesson lead line is outside that grammar for every *gate*,
619
641
  but it may legitimately be *written* in the entry shape (`- **slug** [tag] —
620
642
  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`
643
+ ask the filer about something that is not one. The `## Lessons Learned`
622
644
  literal is fixed spelling rather than config (queue-kit/SPEC.md §The tag algebra),
623
645
  and this kit already carries it — `bin/enter-stage.sh`'s boundary refusal and
624
646
  `check-lesson-disposition` both scan it.
@@ -632,6 +654,35 @@ that cannot depend on queue-kit re-implements the predicate and both ends cite t
632
654
  owner section), and drift-kit's `kpi-deferred-age` records the same accepted
633
655
  residual.
634
656
 
657
+ **Why the matcher prompts rather than decides, and why it survives at all.** A
658
+ recurrence is a claim about *what a finding is*, not about *what a string
659
+ contains*, and no syntactic tell separates "this recurred" from "this is about
660
+ that": a bullet can spell the denial out in words and still match. So the
661
+ predicate is not sharpened, it is **demoted** — its recall was never the defect,
662
+ its authority was. Deleting it would delete the only thing that can produce the
663
+ prompt, and the prompt is what reaches the one party who can answer cheaply: a
664
+ mid-build filer routinely has not read the queue, which is why the matcher
665
+ existed in the first place.
666
+
667
+ **Its honest limit.** A bullet describing a recurrence without spelling the slug
668
+ raises no advisory at all. That leaves no hole in this channel, because the drain
669
+ reads **every** bullet regardless of whether the matcher spoke — which is the
670
+ difference between a prompt and a gate, and the reason the judgment had to move
671
+ rather than the predicate get sharper.
672
+
673
+ **Three alternatives are refused, recorded so they are not re-drafted.** A
674
+ *required* recurrence-or-new argument on the affordance turns capture into an
675
+ interrogation, and refusing capture does not dissolve a finding — it pushes it
676
+ back into session context, the deferred-capture antipattern this inbox exists to
677
+ prevent; it is also asked of a party who has not read the queue. An *optional*
678
+ `--recurrence <slug>` flag invites the drain to trust a structured claim,
679
+ reinstating the same defect one layer up with a better provenance story. And
680
+ *narrowing the matcher* — anchoring the slug, exempting a bullet containing a
681
+ negation — institutionalizes the evasion: an affordance that must be phrased
682
+ around to stay accurate is miscalibrated, and the next filer does not know to
683
+ phrase around it. What all three trade against is prose, which the channel
684
+ already carries and a judge already reads.
685
+
635
686
  **The tool writes no queue file, and that is the load-bearing constraint on the
636
687
  whole channel.** This inbox exists precisely because a gap surfaced mid-stage has
637
688
  no committed place to land except the queue file a stage session is already
@@ -649,6 +700,28 @@ warning and not a refusal deliberately: refusing capture does not dissolve a
649
700
  real finding, it pushes it back into session context — the deferred-capture
650
701
  antipattern this inbox exists to prevent.
651
702
 
703
+ **The drain re-verifies; capture does not.** A bullet's prose is a claim made at
704
+ capture speed, and this channel is built to keep capture cheap, so nothing
705
+ upstream established it — a bullet can assert a mechanism its filer inferred
706
+ rather than ran, and a false premise is paid by whoever drains it. The drain
707
+ therefore names, per bullet, the claim its disposition turns on and the command
708
+ that establishes it, runs that command, and records in the same commit which
709
+ bullets were re-verified and what fell (§templates/stages/ carries the step). The
710
+ grounds are attested rather than argued: of the bullets re-verified at one
711
+ boundary, two were false at their central claim and each fell to a single
712
+ command, and a later bullet carried two false premises at once — one caught by
713
+ the filer re-reading the source before the drain, the other only by the draining
714
+ session's own probes. The step that reliably ran was the drain.
715
+
716
+ **Two capture-time shapes are refused, recorded so they are not re-drafted.** A
717
+ filing-time prompt for the establishing command, and a grammar separating
718
+ observed fact from inferred mechanism, both add friction at the moment this inbox
719
+ exists to keep cheap, and both bill it to the party least able to pay — the
720
+ mid-stage filer whose finding otherwise stays in session context. That is the
721
+ deferred-capture antipattern the channel was built against, and it is not traded
722
+ away to fix a different failure mode. The affordance gains no prompt and no
723
+ grammar; §check-gap-inbox-neutrality keeps the bullet's fields at two.
724
+
652
725
  **Merge semantics.** The inbox carries `merge=union` (git-native, so no per-clone
653
726
  driver registration), not the keep-ours `merge=iteration-scoped` the
654
727
  boundary-truncated surfaces carry: an iteration-scoped surface is per-iteration
@@ -687,27 +760,52 @@ fixed inline that session, or discarded with cause in the close commit message
687
760
  then truncates the inbox to its header; the boundary refusal reads emptiness at
688
761
  the next scope entry as the backstop.
689
762
 
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
763
+ **A `recurrence:` date records a session's judgment that a finding re-occurred,
764
+ made by reading the bullet's prose. A slug appearing in a bullet is an input to
765
+ that judgment and never a verdict; no mechanism produces the declaration.**
766
+
767
+ That drain step is the declaration's only **mechanized** producer
768
+ (queue-kit/SPEC.md §The tag algebra), and it is the stage that must not skip the
769
+ judgment: on a bullet it judges a recurrence it stamps the date onto that entry's
770
+ declaration — creating the line when absent, appending the date when present —
771
+ **in addition to** its ordinary disposition, never instead of it. It is reachable
772
+ at every close with no enabling config, since the drain is already mandatory and
773
+ the boundary refusal already forces it. It is *not* the only producer in fact: a
774
+ session that observes a recurrence outside the capture channel can stamp one
775
+ directly, and whether that path should be sanctioned, forbidden, or mechanized is
776
+ open. Stamping is **idempotent per (slug, date)** — two filings of one slug on
702
777
  one day record one date, the day being the only resolution the bullet's own
703
778
  grammar has, and inventing a finer one would claim precision this channel does not
704
779
  carry.
705
780
 
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.
781
+ **What the judgment rule costs, and what pays for it.** The property the rule
782
+ declines to offer is **re-derivability**: a date is *not* reproducible by
783
+ re-running any predicate over the queue, so a reader cannot audit the count
784
+ without trusting the session that stamped it, and claiming otherwise would be the
785
+ dishonest half of the trade. What
786
+ pays for it is **auditability by inspection** — the drain stamps the declaration
787
+ in the *same commit* that truncates the inbox, so the judgment and the prose it
788
+ was made from sit in one diff and a reader auditing a date reads that commit and
789
+ sees the bullet the judge read. That same-commit rule is therefore **load-bearing
790
+ rather than incidental**: it is the audit artifact. Re-running a matcher is
791
+ replaced by reading the grounds, which is the correct trade when the thing
792
+ recorded is a judgment.
793
+
794
+ **A provenance gate was drafted here and is refused, recorded so it is not
795
+ re-drafted.** Requiring every commit that adds a `recurrence:` date to co-stage
796
+ the inbox looks like the enforced replacement for re-derivability. It is not: a
797
+ back-test over this project's own history redded roughly one in three of the
798
+ commits that had ever stamped one, and it would foreclose the direct-stamp path
799
+ above by gating exactly the route that open question may want opened. A gate that
800
+ reds a third of the precedent it was derived from is measuring the rule, not the
801
+ tree.
802
+
803
+ Each bullet's two fields have named readers: the date feeds close's staleness
804
+ judgment and becomes the stamped recurrence date, and the prose is the
805
+ disposition body, the grounds the drain judges the recurrence from, the claim the
806
+ drain re-verifies, and — via the capture-time advisory on stderr — the field the
807
+ filer is asked to write the claim into. There is no third field, which is the point:
808
+ §check-gap-inbox-neutrality keeps it that way.
711
809
 
712
810
  ## The survey record
713
811
 
@@ -779,6 +877,12 @@ witness:
779
877
  2. **Oracle still?** Re-run `<oracle>` and compare its verdict to the one the
780
878
  finding was written against.
781
879
 
880
+ **The witness is four strings, and that is what makes a finding portable.** It is
881
+ not a property of the record file: the protocol's whole input is `corpus`,
882
+ `oracle`, `rev` and `finding`, each a short string, and both commands run from
883
+ HEAD. Copied onto another surface the witness is *more* durable than it is here,
884
+ because the copy is not truncated.
885
+
782
886
  Both hold → **cite the record; do not re-buy the survey.** Either moved →
783
887
  **dispatch only the delta**, the dispatch prompt naming the record block and the
784
888
  diff, so the child re-surveys what changed rather than the corpus. The
@@ -802,10 +906,13 @@ buys nothing the two-command witness does not. *Ruled out: auto-invalidating
802
906
  every block on any commit* — too coarse to leave the mechanism any use; the
803
907
  `corpus` pathspec exists precisely to make invalidation proportionate.
804
908
 
805
- **The affordance.** `bin/file-survey.sh "<question>" "<corpus>" "<oracle>"
909
+ **The affordance.** `bin/file-survey.sh [--] "<question>" "<corpus>" "<oracle>"
806
910
  "<finding>"` appends one block, seeding the contract header when the record does
807
911
  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
912
+ config-via-env, exit 2 on a missing or empty argument, and the free-text
913
+ argument-shape contract of gate-sdk/SPEC.md §The bin/-tool contract — whose
914
+ refusal here scans **every** positional, since four slots make arity no
915
+ protection at all. Advisory tooling, not a
809
916
  gate — the raw append stays a legal fallback, the grammar being the surface's
810
917
  contract rather than the writer.
811
918
 
@@ -824,6 +931,45 @@ prose routinely names queue slugs as its subject, and that resolver scans whole
824
931
  prose, so it would stamp a recurrence declaration onto the survey's subject.
825
932
  Adding no resolver here is a decision, not an omission.
826
933
 
934
+ **A permanent surface carries the finding, never a pointer into here.** A surface
935
+ outside the boundary-truncated set — a queue entry, a SPEC section — must not
936
+ promise a reader retrievable content in this record: the boundary reset below
937
+ empties it, so the pointer resolves to nothing one iteration after it is written,
938
+ and the finding survives only in the evicting commit. It inlines the finding
939
+ together with the block's four witness fields instead, which is what keeps the
940
+ finding *re-usable* rather than merely readable. Naming this record as a
941
+ **subject** is unaffected — "the survey record is per-iteration scratch" promises
942
+ nobody a retrieval — and that distinction is exactly what
943
+ §check-scratch-citation's red condition is calibrated against.
944
+
945
+ **Commit-pinning the citation is wrong by construction, not merely awkward**, and
946
+ it is the close a reader reaches for first. `bin/file-survey.sh` stamps `rev` as
947
+ HEAD *at filing time*, which precedes the commit that lands the block — so
948
+ `git show <rev>:<record>` reads a blob that does not contain the block being
949
+ cited, and it fails silently by printing a record without it. The sha a pin would
950
+ need is the *landing* commit, which no field carries and which is precisely the
951
+ class of value this section already rules an author gets wrong.
952
+
953
+ **The affordance that makes inlining one command.** `bin/cite-survey.sh [--]
954
+ "<heading-substring>"` selects the one block whose `## ` heading contains the
955
+ substring and writes it to stdout as an inline-ready snippet — the heading and all
956
+ four fields. It refuses (exit 2) on no match, on an ambiguous match, and on a
957
+ record with no blocks, rather than guessing: the author asked for one finding, and
958
+ a silently-chosen sibling would be pasted onto a permanent surface as if it were
959
+ the one they read. It follows `bin/file-survey.sh` exactly — repo-root cd,
960
+ config-via-env, exit 2 on a missing or empty argument, and — per
961
+ gate-sdk/SPEC.md §The bin/-tool contract — the shape contract for its one
962
+ free-text positional. It is advisory tooling,
963
+ not a gate, the same disposition its sibling carries. It is a census find rather
964
+ than a firing on that last point: it carries `file-gap.sh`'s exact single-argument
965
+ shape and has simply not been run with a flag yet, and while it writes nothing,
966
+ its help behavior was the same misleading error.
967
+
968
+ It deliberately does **not** rewrite the citing surface. The author chooses where
969
+ the finding belongs and how much of the `finding` prose to carry; a tool that
970
+ spliced would need a marker block, which would make a hand-written citation a
971
+ second-class form of the very thing this rule is trying to make ordinary.
972
+
827
973
  **How this differs from the gap inbox, which it sits beside.** The two are
828
974
  sibling committed per-iteration surfaces with deliberately *opposite* semantics
829
975
  on both axes, and a reader who meets them apart will assume symmetry and get
@@ -980,6 +1126,32 @@ triage attention and were ranked against each other by nothing — and the roste
980
1126
  answers it directly: both appear on one derived roster, with modes, which is what
981
1127
  "ranked against each other" needs. Merging the files was the proxy, not the thing.
982
1128
 
1129
+ ## Testing
1130
+
1131
+ Every gate ships the ordinary `good/`+`bad/` fixture pair, and the scenarios one
1132
+ pair cannot hold live in `gate-tests/*.test.sh` scenario runners. What departs
1133
+ from the plain fixture-pair default, and what no single gate's subsection below
1134
+ can own, is how those runners **reach** their gate.
1135
+
1136
+ A runner that drives a gate names that gate, never a substrate: it resolves through
1137
+ `gate_run <name> <checks-dir> <args>` (gate-sdk/SPEC.md §run-gate-tests), which
1138
+ dispatches through `gate_command` exactly as the fixture harness does. A member
1139
+ that ports to a compiled subcommand therefore leaves its scenario coverage
1140
+ running unchanged — the property a path-named runner does not have, since the
1141
+ `checks/<name>.sh` it holds stops existing in the motion that lands the
1142
+ descriptor. For a case that differs by a knob rather than by argv, `gate_env
1143
+ NAME=VALUE` sets that one case's environment in the caller's subshell;
1144
+ `check-stage-evidence`'s session-boundary posture cases are the worked instance.
1145
+
1146
+ Every gate-driving runner in this kit, including `check-close-surfaces` and
1147
+ `check-stage-entry` — whose gates themselves remain shell (`check-close-surfaces`
1148
+ unsized by any cohort, `check-stage-entry` held on shell — gate-sdk/SPEC.md
1149
+ §The first cohort, and the rule that selects the next) — now resolves through
1150
+ `gate_run` rather than a held `checks/<name>.sh` path.
1151
+
1152
+ The rest exercise `bin/` tools, which are advisory tooling with no gate to
1153
+ dispatch and so have nothing to say about reach.
1154
+
983
1155
  ## Per-component contracts
984
1156
 
985
1157
  ### lib/stages.sh
@@ -1018,7 +1190,11 @@ prints the derived union-merge set (the gap inbox — §The committed gap inbox)
1018
1190
  and `lifecycle_merge_attrs_block` renders the supersede set as
1019
1191
  `<path> merge=iteration-scoped` lines and the union set as `<path> merge=union`
1020
1192
  lines, so `bin/install-lifecycle.sh` (writer) and `check-merge-attrs` (asserter)
1021
- read one set (§Multi-operator semantics). Values and adapters only, never
1193
+ read one set (§Multi-operator semantics). `lifecycle_supersede_set` has a **third
1194
+ reader**, `check-scratch-citation`, which forbids a permanent surface pointing a
1195
+ retriever at any of its members — so a consumer adding a
1196
+ `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` member gets citation enforcement over it with no
1197
+ second roster to keep in step. Values and adapters only, never
1022
1198
  gate structure (gate-sdk's `lib/gate.sh` rule).
1023
1199
 
1024
1200
  ### bin/session-id.sh
@@ -1081,6 +1257,13 @@ The deterministic writer for a stage transition: `enter-stage.sh <stage>`
1081
1257
  appends the invocation stamp, reading `session-id.sh` for
1082
1258
  the id — never an argument, so the no-hand-picking rule rides into the tool.
1083
1259
  `<stage>` must be a configured stage; anything else is a usage error (exit 2).
1260
+ Its positionals are membership-validated rather than free text, so it owes no
1261
+ leading-`-` refusal (gate-sdk/SPEC.md §The bin/-tool contract) — but it owes the
1262
+ help half, and `-h`/`--help` as the first argument prints usage on stdout and
1263
+ exits 0. The measured cost of not owing it is in this tool's own history: a
1264
+ session hunting for the rename mode below ran `--help`, got
1265
+ `'--help' is not a lifecycle stage`, and worked around a contract for three
1266
+ sessions that the usage text would have settled in one command.
1084
1267
  An ordinary stage **writes the evidence file only** — the appended stamp *is*
1085
1268
  the transition, since the last stamp is the cursor, so the queue file is not
1086
1269
  touched and need not be committed. The first stage
@@ -1219,7 +1402,72 @@ a stamp. Exit 0 = the real entry would proceed (or no-op); exit 1 = it would
1219
1402
  refuse, with the refusing check's output relayed line-by-line; exit 2 =
1220
1403
  usage/config error, as a real entry. Not a gate — exercised in `smoke/`
1221
1404
  beside the existing enter-stage coverage (would-pass, would-refuse,
1222
- would-no-op, nothing written). **Idempotent:** if the
1405
+ would-no-op, nothing written).
1406
+
1407
+ **`--rename <name>` — the mechanized iteration rename.** Naming an iteration is
1408
+ a **two-surface** write — the queue header's placeholder and column 1 of the
1409
+ first stage's stamp — which `check-stage-evidence` requires to agree, so it rides
1410
+ this writer rather than a second tool. `[--simulate] --rename <name>` sets the
1411
+ header to `## Iteration: <name>` and rewrites column 1 of **every** data line in
1412
+ the state file. Every line rather than only the last is correct by the boundary
1413
+ invariant, not by convenience: the first-stage entry truncates the state file, so
1414
+ every line below the separator belongs to the current iteration by construction —
1415
+ which is exactly what `check-stage-evidence` asserts — and the whole-file rewrite
1416
+ therefore also heals a half-landed hand-rename. **It is not stage motion**: no
1417
+ stamp is appended and no stage token is written, so the cursor is untouched and
1418
+ "stage motion never writes the queue" is unweakened. The precedent for this tool
1419
+ writing the queue header at all is the boundary reset, which already does.
1420
+
1421
+ Before writing, the mode asserts its **columns-2-4 witness** — fields 2 through
1422
+ 4 of every data line (stage, session id, date) identical before and after. This
1423
+ is the content predicate applied by the **writer**, where it is cheap and exact,
1424
+ rather than by the `Write`/`Edit` guard: a `PreToolUse` hook sees only *proposed*
1425
+ content, so proving "no stage token moved" there means reconstructing the
1426
+ pre-edit file and diffing field-wise inside a hook — the same computation with
1427
+ less information and no way to refuse cleanly. **Pre-flight, the same contract as
1428
+ the stamp path:** the candidate header and candidate state file are built as
1429
+ temporaries, `check-stage-evidence` runs against them, and a non-zero exit
1430
+ refuses with the gate's output relayed and nothing written. That gate is
1431
+ resolved through gate-sdk's `gate_command` rather than named by script path, so
1432
+ the arm names a gate and never a substrate: the resolved argv is prefix-shaped,
1433
+ so the two positionals ride it unchanged, and an argv the bridge refused to build
1434
+ is exit 2 — the dispatcher's own verdict — never a rename pre-flighted by a check
1435
+ that did not run. The built-in `check-stage-entry` pre-flight above keeps its
1436
+ script path because that member is held on shell (gate-sdk/SPEC.md §The first
1437
+ cohort, and the rule that selects the next), so the two arms of this tool
1438
+ resolve differently and the difference is the member's substrate, not a
1439
+ convention gap. **Refusals** (exit 2,
1440
+ nothing written): `<name>` empty; `<name>` equal to the unnamed placeholder,
1441
+ which only the boundary reset may write — checked ahead of the grammar that would
1442
+ also reject it, so the message names the owning writer instead of reporting a
1443
+ malformed name; and `<name>` outside the queue slug grammar `[a-z0-9][a-z0-9-]*`,
1444
+ where whitespace is the corrupting case, since column 1 is whitespace-delimited
1445
+ and a two-word name silently shifts every field of every stamp.
1446
+ **Idempotent** in the stamp path's sense: a header and every column 1 already
1447
+ reading `<name>` reports and exits 0 without writing. `--simulate --rename`
1448
+ relays what would change, prefixed `enter-stage (simulate):`, and writes nothing.
1449
+ The report names both written files and says to commit them together, which makes
1450
+ the one-commit coupling a property of the writer instead of a line of prose in
1451
+ the calling stage template.
1452
+
1453
+ One reader is **invalidated** by a rename rather than served by it, and it is the
1454
+ reason the placeholder refusal exists: `LIFECYCLE_KIT_BOUNDARY_REQUIRE`'s check
1455
+ matches the closing iteration's name against the first token of a disposition
1456
+ line and reds on finding *none*, so a rename landing after the close stage has
1457
+ stamped its disposition reds the next boundary. Renaming an iteration that has
1458
+ already been dispositioned is a rename to redo at the disposition surface too;
1459
+ un-naming one is refused outright.
1460
+
1461
+ **Ruled out: a separate `rename-iteration.sh` tool.** It would add a second
1462
+ sanctioned writer of the state file, and one-writer is the property the
1463
+ `Write`/`Edit` guard's own block message asserts and the whole reason that guard
1464
+ exists. Advisory tooling like `--simulate`, so no fixture pair is owed; the
1465
+ hermetic cases — both surfaces rewritten, fields 2-4 proved unchanged, the
1466
+ half-landed heal, each refusal, the idempotent no-op, and `--simulate --rename`
1467
+ writing nothing — live in `gate-tests/`, because a rename cannot be exercised
1468
+ against a live checkout's own queue the way `smoke/` exercises the stamp path.
1469
+
1470
+ **Idempotent:** if the
1223
1471
  state file already ends with a stamp for the same `<iteration> <stage> <id>`,
1224
1472
  it reports and exits 0 without appending, so a crashed-and-resumed session
1225
1473
  re-runs its entry step safely. It reads the `lib/stages.sh` knobs
@@ -1228,7 +1476,18 @@ re-runs its entry step safely. It reads the `lib/stages.sh` knobs
1228
1476
  `LIFECYCLE_KIT_BOUNDARY_PRESERVE`,
1229
1477
  `LIFECYCLE_KIT_BOUNDARY_REQUIRE`, `LIFECYCLE_KIT_LESSON_EVIDENCE_FILE`,
1230
1478
  `LIFECYCLE_KIT_SURVEY_RECORD_FILE`, and
1231
- `LIFECYCLE_KIT_ENTRY_PREFLIGHT`). Advisory tooling,
1479
+ `LIFECYCLE_KIT_ENTRY_PREFLIGHT`).
1480
+
1481
+ **This tool depends on `gate-sdk/lib/gate.sh`, and the dependency is stated
1482
+ rather than absorbed.** It is sourced at load — from `GATE_SDK_ROOT`, defaulting
1483
+ to the sibling `../gate-sdk` — not inside the one arm that dispatches a gate,
1484
+ because a missing library that surfaces halfway through a rename is worse than
1485
+ one that surfaces before the tool does anything. The dependency is precedented
1486
+ inside the kit, where every `checks/` member sources exactly that library, but it
1487
+ is new in `bin/`: a tree that vendored lifecycle-kit without gate-sdk cannot run
1488
+ the stamp writer at all. The alternative — a second
1489
+ dispatch resolver written into `bin/` — is the duplicate the shared substrate
1490
+ exists to remove, so the dependency is taken. Advisory tooling,
1232
1491
  not a gate: no fixture pair is owed; it is exercised end-to-end in
1233
1492
  `smoke/install.sh` — including the boundary require-check scenarios (a member
1234
1493
  naming the closing iteration passes; a member missing the line, a member absent
@@ -1306,9 +1565,10 @@ declaration names a reclaim command**.
1306
1565
  Assertion B is shape-only, and resolution is somebody else's job already:
1307
1566
  `check-spec-pointer`'s prose pass resolves a `forced=` citation on any manifest
1308
1567
  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
1568
+ not a preference — canon-kit's heading resolver is defined *inside its own gate*
1569
+ rather than exported from a library, and the port to the binary substrate did not
1570
+ change that: it is a private function of the compiled member, so there is still
1571
+ no resolver a second gate could call. Reaching it would mean either copying
1312
1572
  the resolver, which canon-kit's own tiering rule bans, or making lifecycle-kit
1313
1573
  depend on canon-kit — the same ownership-cycle argument that rules out the log
1314
1574
  merge. The honest arrangement is a pair of gates independently reading one
@@ -1352,7 +1612,10 @@ owed (the enforcement-first weighing). The freshness posture is
1352
1612
 
1353
1613
  A missing block is a finding with the install remedy; a block present but out
1354
1614
  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
1615
+ exit 1). The stale-block report prints **every** hunk: the format and the
1616
+ uncapped contract are the crate renderer's, whose home is
1617
+ gate-sdk/SPEC.md §The diff renderer since it stopped being this gate's private
1618
+ mechanism, and this gate is its one live consumer. Resolution fails closed: a missing agent file, a begin marker without
1356
1619
  its end, or an errored awk capture is exit 2 — a half-written or unreadable
1357
1620
  target must not pass as clean. The gate satisfies the four gate-sdk contracts
1358
1621
  (gate-sdk/SPEC.md §The gate model): the single `LIFECYCLE-REGISTRATION: clean`
@@ -1430,6 +1693,37 @@ evidence manifest (a suite verdict per line) and, via the optional
1430
1693
  `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` integration, couples a close entry to
1431
1694
  the full green block.
1432
1695
 
1696
+ **The uncommitted window, and what closes it.** This gate — and every other one
1697
+ that would catch a hand-written stamp — fires at *commit*. The cursor, though, is
1698
+ the working tree's last stamp, and every reader reads the working tree. So a
1699
+ session that hand-edits the state file and simply never commits moves the stage
1700
+ cursor for its entire life and is caught by nothing. Content-based detection
1701
+ cannot help: a hand-written stamp is byte-identical to `bin/enter-stage.sh`'s by
1702
+ design.
1703
+
1704
+ `templates/workflow-state-guard.sh` closes the part of that window an agent
1705
+ tooling actually passes through. It is a `PreToolUse(Write|Edit)` hook (register
1706
+ it on the alternation matcher; guard-kit's wiring template carries the block) that
1707
+ refuses a write whose target **resolves** to the state file, naming
1708
+ `bin/enter-stage.sh` as the sanctioned writer. Resolved, not textual: an absolute
1709
+ path, a `./` prefix and a route through a symlinked directory are one file, and a
1710
+ textual comparison catches only the spelling it was written against. It reads the
1711
+ path through guard-kit's `guard_read_path` and rides `lib/guard.sh` on the
1712
+ `GUARD_KIT_LIB` indirection, so lifecycle-kit ships the rule and guard-kit ships
1713
+ the mechanism (guard-kit/SPEC.md §The guard framework). The
1714
+ `GATE_SDK_WORKFLOW_DIR` indirection is honored, so a consumer who relocated the
1715
+ workflow directory gets a guard that follows it. No knob is added: there is no
1716
+ value to configure.
1717
+
1718
+ The residual is stated because an unstated residual reads as a closed hole. The
1719
+ guard reaches agent `Write`/`Edit` tool calls and nothing else — not a `Bash`
1720
+ redirect, not `--no-verify` at the commit that would have caught the result, not a
1721
+ human editing the file outside the agent tooling, and not any future writer that
1722
+ is not one of those tool calls. It narrows the window to the writers the harness
1723
+ routes through a hook; it does not close it. And it is inert until wired: shipping
1724
+ the template without the settings block yields a file that enforces nothing while
1725
+ looking like it does.
1726
+
1433
1727
  ### check-stage-entry
1434
1728
 
1435
1729
  Invariant: the stage being *entered* re-verifies its prior stage's static
@@ -1714,6 +2008,116 @@ the class delegation-kit/SPEC.md §Operative residency rules no gate is owed for
1714
2008
  The entry report's read trigger (§bin/enter-stage.sh) is the affordance in place
1715
2009
  of an oracle there, and it is weaker than one by construction.
1716
2010
 
2011
+ ### check-scratch-citation
2012
+
2013
+ Invariant: no surface in `LIFECYCLE_KIT_PERMANENT_SURFACE_GLOBS` carries a
2014
+ **retrieval pointer** to a path in the derived boundary-truncated set. The rule
2015
+ and why inlining is the right close are §The survey record's; this section owns
2016
+ the red condition.
2017
+
2018
+ **The forbidden-target set is derived, never maintained** — it is
2019
+ `lifecycle_supersede_set` (§lib/stages.sh), already the single derivation behind
2020
+ the installer's `.gitattributes` block and `check-merge-attrs`'s parity check.
2021
+ This gate is its third reader, which is why a consumer widening its truncate
2022
+ configuration gets citation enforcement for free.
2023
+
2024
+ **Retrieval-pointer position, stated as the red condition.** A supersede-set path
2025
+ that is either **(a)** in markdown link-target position — the parenthesized half
2026
+ of a `[text]`-plus-parentheses pair — or **(b)** preceded
2027
+ by a colon and whitespace and followed by nothing but a closing quote, comma,
2028
+ period, bracket or end of paragraph — the attested form, *"Full finding and its
2029
+ two-command witness"* followed by the path. A bare path elsewhere in prose is a
2030
+ **mention** and is clean; that is the whole calibration, and it is why this is
2031
+ specified as a position rather than as a pattern.
2032
+
2033
+ **The scan joins a paragraph's wrapped continuation lines before testing (b), or
2034
+ it is blind on its own worked example.** A queue file wraps prose to a budget, so
2035
+ a colon and the path it introduces routinely land on different physical lines —
2036
+ which is exactly what the attested instance did. The join is
2037
+ `check-spec-pointer`'s prose-extraction shape (canon-kit/SPEC.md
2038
+ §check-spec-pointer), adopted rather
2039
+ than re-decided: concatenate a blank-line-delimited paragraph, match over the
2040
+ join, and map a hit back to its physical line through per-line start offsets. A
2041
+ scanner that is right on an unwrapped fixture and silently blind on the wrapped
2042
+ case it was written for is the failure this forecloses, which is why the `bad/`
2043
+ case carries a wrapped instance beside the single-line and markdown-link forms.
2044
+
2045
+ **Per-line escape hatch:** a `scratch-citation-exempt:` tag on the line above the
2046
+ hit, this repo's established opt-out shape, for a surface that must quote a dead
2047
+ citation verbatim in order to describe it. Its reader is this gate's scanner, at
2048
+ the transition where it has matched a pointer and is deciding whether to record a
2049
+ finding. *Stated so it is not mistaken for more than it is:* the class is real and
2050
+ permanent — any entry documenting a citation defect must quote one — but the tree
2051
+ carries no live user today, because the entry that motivated the tag completed and
2052
+ its prose left the queue with it. The `bad/`+`good/` fixture pair is where the
2053
+ hatch is exercised.
2054
+
2055
+ The gate satisfies the four gate-sdk contracts: the single
2056
+ `SCRATCH-CITATION: clean` line naming how many surfaces were scanned, and a
2057
+ `help:` remedy naming `bin/cite-survey.sh` and the exempt tag on the finding path
2058
+ (output); exit 2 on an empty derived target set and on a failed parse
2059
+ (fail-closed); a `good/`+`bad/` pair whose good case copies the mention forms live
2060
+ entries actually use — a path opening a wrapped line after a full stop, a
2061
+ prepositional mention, a colon-introduced pointer at a **non**-member path, and a
2062
+ tagged dead citation — because a rule that reds any of those is wrong and the
2063
+ fixture is what says so (fixture-pair); and registration in this repo's
2064
+ `gates.list`, where its surfaces are this repo's own queue and spec set
2065
+ (self-lint).
2066
+
2067
+ *Not gated:* whether an inlined finding is faithful to the block it came from.
2068
+ Nothing tracked relates the two once the record is truncated, and inventing a
2069
+ provenance field would re-open the per-iteration lifetime the record's design
2070
+ turns on.
2071
+
2072
+ ### check-gap-inbox-neutrality
2073
+
2074
+ Invariant: the gap inbox (§The committed gap inbox) records observations, not
2075
+ conclusions. Two assertions over every non-blank line below the `# contract:`
2076
+ header:
2077
+
2078
+ - **A — grammar.** Every line is `- <YYYY-MM-DD> — <prose>` with non-empty
2079
+ prose. Nothing gated this before, even though the raw append is an explicitly
2080
+ legal fallback, so a malformed bullet was found by the drain reading it an
2081
+ iteration later.
2082
+ - **B — no interposed verdict.** No bullet's prose opens with the retired
2083
+ ``recurrence of `<slug>`:`` form. This is the class assertion, and its value is
2084
+ that it catches a conclusion reaching the capture surface **by any producer** —
2085
+ a stale vendored affordance, a hand append copying an older bullet's shape —
2086
+ rather than only the affordance this kit ships. The `help:` line teaches the
2087
+ rule rather than the regex: say *why* you believe the bullet re-files an entry,
2088
+ in the prose, and let the drain judge.
2089
+
2090
+ An absent inbox is **clean, not fail-closed** — never having filed a gap is a
2091
+ legal state for a fresh consumer, unlike §check-lifecycle-registration's missing
2092
+ agent file, which is an install that did not finish. Fail-closed applies to the
2093
+ scanner's own exit status, per gate-sdk's contract.
2094
+
2095
+ **Bare drives the configured inbox; an explicit file argument drives it
2096
+ hermetically**, the §check-survey-record precedent, which is what lets the
2097
+ fixture pair run against a copied inbox.
2098
+
2099
+ **Why the tool-side contract is pinned separately.** This gate reads the surface
2100
+ and cannot see which producer wrote a line, so it cannot hold the affordance to
2101
+ its own contract. `gate-tests/file-gap-recurrence.test.sh` is what does that. The
2102
+ two together are the enforcement: the fixture-runner catches the producer
2103
+ regressing, the gate catches a verdict arriving by any other route.
2104
+
2105
+ The gate satisfies the four gate-sdk contracts (gate-sdk/SPEC.md §The gate
2106
+ model): the single `GAP-INBOX-NEUTRALITY: clean` line and a `help:` remedy on the
2107
+ finding path (output); exit 2 on an unreadable or explicitly-named-but-missing
2108
+ inbox and on a failed parse (fail-closed); a `good/`+`bad/` fixture pair under
2109
+ `gate-tests/` driven through the hermetic argument — the good case a record whose
2110
+ prose both re-files and disclaims an entry in words, the bad case a retired
2111
+ marker beside two broken bullets (fixture-pair); and registration in this repo's
2112
+ `gates.list`, where its scan target is this repo's own inbox (self-lint). Its
2113
+ `# graph:` couples the inbox at `tier=precommit`.
2114
+
2115
+ *Not gated, and stated so the gate is not mistaken for more than it is:* whether
2116
+ a bullet's prose states the recurrence claim **at all**, and whether the claim is
2117
+ **right**. Assertion B removes the one shape that pre-empts the judge; it cannot
2118
+ compel a filer to answer the advisory, and the judgment itself is the drain's
2119
+ (§templates/stages/), which is where the amendment deliberately put it.
2120
+
1717
2121
  ### templates/stages/
1718
2122
 
1719
2123
  The stage-skill templates (`scope`/`align`/`build`/`validate`/`close`) carry