checkwright 0.31.0 → 0.32.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 (495) hide show
  1. package/README.md +7 -6
  2. package/bin/checkwright.ps1 +3 -3
  3. package/package.json +10 -3
  4. package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
  5. package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
  6. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
  7. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  8. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
  9. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  10. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
  11. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  12. package/payload/artifact/targets.list +5 -5
  13. package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
  14. package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
  15. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
  16. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  17. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  18. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  19. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
  20. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  21. package/payload/canon-kit/README.md +8 -4
  22. package/payload/canon-kit/checks/check-amendment-queue.gate +1 -1
  23. package/payload/canon-kit/checks/check-comment-tier.gate +2 -2
  24. package/payload/canon-kit/checks/check-delta-agreement.gate +4 -0
  25. package/payload/canon-kit/checks/check-deprecation-task.gate +1 -1
  26. package/payload/canon-kit/checks/check-docs-page-length.gate +4 -0
  27. package/payload/canon-kit/checks/check-docs-page-repeat.gate +2 -2
  28. package/payload/canon-kit/checks/check-fence-command-head.gate +1 -1
  29. package/payload/canon-kit/checks/check-fence-paste-unit.gate +4 -0
  30. package/payload/canon-kit/checks/check-knob-default-coupling.gate +1 -1
  31. package/payload/canon-kit/checks/check-manifest-count.gate +3 -3
  32. package/payload/canon-kit/checks/check-manifest-temporal.gate +1 -1
  33. package/payload/canon-kit/checks/check-pendency-contradiction.gate +3 -0
  34. package/payload/canon-kit/checks/check-prose-tells.gate +1 -1
  35. package/payload/canon-kit/checks/check-spec-derivable-section.gate +1 -1
  36. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +1 -1
  37. package/payload/canon-kit/checks/check-spec-embedded-source.gate +1 -1
  38. package/payload/canon-kit/checks/check-spec-pointer.gate +1 -1
  39. package/payload/canon-kit/checks/check-todo-task-liveness.gate +1 -1
  40. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
  41. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/SPEC-widget.md +7 -0
  42. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +7 -0
  43. package/payload/canon-kit/gate-tests/check-citation-link/bad/expect.txt +1 -0
  44. package/payload/canon-kit/gate-tests/check-citation-link/bad/site/unclosed.md +4 -0
  45. package/payload/canon-kit/gate-tests/check-citation-link/good/site/page.md +10 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/bad/scripts/canon-config.knobs +4 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +2 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/scripts/canon-config.knobs +4 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +9 -1
  50. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/expect.txt +3 -0
  51. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/scripts/canon-config.knobs +14 -0
  52. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/base/notes/spec.md +9 -0
  53. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/one/deltas/notes/spec.md +7 -0
  54. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/two/deltas/cli/spec.md +3 -0
  55. package/payload/canon-kit/gate-tests/check-delta-agreement/good/expect.txt +1 -0
  56. package/payload/canon-kit/gate-tests/check-delta-agreement/good/scripts/canon-config.knobs +14 -0
  57. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/base/notes/spec.md +9 -0
  58. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/one/deltas/notes/spec.md +19 -0
  59. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/two/deltas/cli/spec.md +3 -0
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.knobs +4 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.knobs +4 -0
  62. package/payload/canon-kit/gate-tests/check-docs-cmd.test.sh +20 -4
  63. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/expect.txt +5 -0
  64. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/scripts/canon-config.knobs +3 -0
  65. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/item.md +5 -0
  66. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/nested.md +7 -0
  67. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/page.md +13 -0
  68. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/short.md +3 -0
  69. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/unclosed.md +4 -0
  70. package/payload/canon-kit/gate-tests/check-docs-page-length/good/expect.txt +1 -0
  71. package/payload/canon-kit/gate-tests/check-docs-page-length/good/scripts/canon-config.knobs +4 -0
  72. package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/generated.md +3 -0
  73. package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/page.md +15 -0
  74. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/expect.txt +3 -0
  75. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/scripts/canon-config.knobs +2 -1
  76. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/_chrome/footer.html +4 -0
  77. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/page.md +4 -0
  78. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/unclosed.md +6 -0
  79. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/expect.txt +2 -1
  80. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/scripts/canon-config.knobs +2 -1
  81. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/_chrome/layout.html +8 -0
  82. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/page.md +13 -0
  83. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/expect.txt +1 -0
  84. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/kit/index.md +4 -0
  85. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/doc.md +10 -0
  86. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/expect.txt +2 -0
  87. package/payload/canon-kit/gate-tests/check-fence-command-head/good/doc.md +6 -0
  88. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/expect.txt +3 -0
  89. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/scripts/canon-config.knobs +2 -0
  90. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/site/page.md +17 -0
  91. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/expect.txt +1 -0
  92. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/scripts/canon-config.knobs +2 -0
  93. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/site/page.md +39 -0
  94. package/payload/canon-kit/gate-tests/check-fence-run/good/doc.md +8 -0
  95. package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +4 -0
  96. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +14 -0
  97. package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +2 -0
  98. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +27 -0
  99. package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -1
  100. package/payload/canon-kit/gate-tests/check-manifest-count/good/posts/note.md +7 -0
  101. package/payload/canon-kit/gate-tests/check-manifest-count/good/scripts/canon-config.knobs +4 -0
  102. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +7 -0
  103. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +17 -1
  104. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/dotted.md +10 -0
  105. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/expect.txt +1 -0
  106. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/dotted.md +6 -0
  107. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/expect.txt +1 -1
  108. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +6 -0
  109. package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/SPEC.md +14 -0
  110. package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/expect.txt +1 -0
  111. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/README.md +3 -0
  112. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/SPEC.md +16 -0
  113. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/expect.txt +1 -0
  114. package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence-unclosed.md +8 -0
  115. package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence.md +13 -0
  116. package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +4 -0
  117. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.knobs +5 -1
  118. package/payload/canon-kit/gate-tests/check-prose-tells/good/absence.md +17 -0
  119. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +6 -0
  120. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.knobs +4 -1
  121. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +9 -0
  122. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +2 -1
  123. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +14 -0
  124. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
  125. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
  126. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +2 -1
  127. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/long.md +7 -0
  128. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +13 -0
  129. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.knobs +7 -1
  130. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +8 -0
  131. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-repeat.md +11 -0
  132. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.knobs +6 -0
  133. package/payload/canon-kit/gate-tests/check-task-label-resolution/good/work/tasks.md +6 -0
  134. package/payload/canon-kit/gate-tests/check-task-path-claim/good/work/tasks.md +6 -0
  135. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/scripts/canon-config.knobs +4 -0
  136. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/scripts/canon-config.knobs +4 -0
  137. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
  138. package/payload/context-kit/README.md +5 -7
  139. package/payload/context-kit/checks/check-brevity.gate +1 -1
  140. package/payload/context-kit/gate-tests/check-brevity.test.sh +1 -0
  141. package/payload/context-kit/gate-tests/check-memory-off.test.sh +25 -1
  142. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  143. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +16 -0
  144. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/checkwright-gates +2 -0
  145. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +2 -2
  146. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  147. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/checkwright-gates +2 -0
  148. package/payload/context-kit/gate-tests/session-context-spawn.test.sh +52 -0
  149. package/payload/context-kit/templates/nudge-delegation.txt +4 -0
  150. package/payload/context-kit/templates/settings-sessionstart.json +2 -2
  151. package/payload/delegation-kit/README.md +14 -8
  152. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +1 -0
  153. package/payload/delegation-kit/checks/check-gate-tamper.gate +1 -1
  154. package/payload/delegation-kit/close-surfaces.txt +3 -0
  155. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale-effort.md +10 -0
  156. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale.md +9 -0
  157. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/unbound.md +8 -0
  158. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +3 -0
  159. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/scripts/delegation-config.knobs +3 -0
  160. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +3 -1
  161. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-paired.md +10 -0
  162. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -1
  163. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/scripts/delegation-config.knobs +3 -0
  164. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/exception-arrays.sh +44 -0
  165. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +12 -0
  166. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +12 -0
  167. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/exception-arrays.sh +44 -0
  168. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +1 -0
  169. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +22 -1
  170. package/payload/delegation-kit/templates/agent-execution.md +7 -6
  171. package/payload/delegation-kit/templates/delegation-config.knobs +32 -0
  172. package/payload/delegation-kit/usage-tests/cases.tsv +35 -25
  173. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +12 -3
  174. package/payload/doctrine-kit/DOCTRINE.md +109 -25
  175. package/payload/doctrine-kit/README.md +2 -2
  176. package/payload/drift-kit/README.md +15 -6
  177. package/payload/drift-kit/close-surfaces.txt +2 -0
  178. package/payload/drift-kit/templates/economics.md +7 -3
  179. package/payload/drift-kit/templates/kpis.list +1 -0
  180. package/payload/evidence-kit/README.md +3 -3
  181. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +2 -1
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.knobs +3 -1
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +1 -0
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.knobs +3 -1
  186. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +18 -2
  187. package/payload/evidence-kit/gate-tests/diff-baseline-status.test.sh +2 -3
  188. package/payload/evidence-kit/gate-tests/run-member-door.test.sh +50 -0
  189. package/payload/gate-sdk/README.md +9 -13
  190. package/payload/gate-sdk/bin/build-native.sh +11 -14
  191. package/payload/gate-sdk/bin/run-gates.ps1 +149 -24
  192. package/payload/gate-sdk/bin/run-gates.sh +57 -14
  193. package/payload/gate-sdk/checks/check-commit-msg.gate +1 -1
  194. package/payload/gate-sdk/checks/check-gate-substrate-parity.gate +1 -1
  195. package/payload/gate-sdk/checks/check-graph.gate +2 -2
  196. package/payload/gate-sdk/checks/check-install-disposition.gate +1 -1
  197. package/payload/gate-sdk/checks/check-path-dialect.gate +1 -1
  198. package/payload/gate-sdk/checks/check-psscriptanalyzer.gate +4 -0
  199. package/payload/gate-sdk/checks/check-shellcheck.gate +1 -1
  200. package/payload/gate-sdk/checks/check-template-copy-parity.gate +1 -1
  201. package/payload/gate-sdk/checks/check-tree-terms.gate +1 -1
  202. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/args +2 -1
  203. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/expect.txt +2 -0
  204. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/tree/workflows/shapes.yml +29 -0
  205. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/args +2 -1
  206. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/expect.txt +2 -0
  207. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/tree/workflows/shapes.yml +22 -0
  208. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/demo-kit/index.md +3 -0
  209. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +17 -1
  210. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +12 -1
  211. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-array-axes.sh +44 -0
  212. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +2 -0
  213. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +2 -1
  214. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-array-axes.sh +46 -0
  215. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +2 -0
  216. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
  217. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.gate +3 -0
  218. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.ps1 +1 -0
  219. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/gates.list +1 -0
  220. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
  221. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/scripts/gates.list +3 -1
  222. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  223. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +4 -2
  224. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +5 -0
  225. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.gate +2 -0
  226. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.ps1 +1 -0
  227. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-climb.gate +2 -0
  228. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-direxec.gate +2 -0
  229. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twoexec.gate +3 -0
  230. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.gate +2 -0
  231. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.txt +1 -0
  232. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  233. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.gate +3 -0
  234. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.ps1 +1 -0
  235. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-rsgood.gate +3 -0
  236. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  237. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +42 -5
  238. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +1 -0
  239. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +9 -1
  240. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +2 -2
  241. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +15 -29
  242. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  243. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -1
  244. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/expect.txt +1 -0
  245. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/portability-patterns.notes.list +1 -0
  246. package/payload/gate-sdk/gate-tests/check-portability-floor/good/args +1 -1
  247. package/payload/gate-sdk/gate-tests/check-portability-floor/good/scripts/gate-sdk-config.knobs +1 -0
  248. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/demo-kit/templates/portability-patterns.list +5 -0
  249. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/rosters/constructs.list +6 -0
  250. package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +15 -2
  251. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/expect.txt +2 -0
  252. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/noisy.ps1 +1 -0
  253. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/pwsh +8 -0
  254. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/scripts/gate-sdk-config.knobs +1 -0
  255. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/clean.ps1 +1 -0
  256. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/expect.txt +1 -0
  257. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/pwsh +7 -0
  258. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/scripts/gate-sdk-config.knobs +2 -0
  259. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/{warn.sh → alpha-kit/gate-tests/kit-warn.sh} +1 -1
  260. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +2 -0
  261. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-sdk-config.knobs +2 -0
  262. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-tests/tests-warn.sh +5 -0
  263. package/payload/gate-sdk/gate-tests/check-shellcheck/good/{ok.sh → alpha-kit/gate-tests/kit-ok.sh} +1 -1
  264. package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -1
  265. package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-sdk-config.knobs +2 -0
  266. package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-tests/tests-ok.sh +4 -0
  267. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +2 -0
  268. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/gate-sdk-config.knobs +1 -0
  269. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +4 -1
  270. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/gate-sdk-config.knobs +1 -0
  271. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/stray/templates/session-note.sh +4 -0
  272. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +6 -2
  273. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/drift-kit/templates/kpis.list +1 -0
  274. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/drift-kit/templates/kpis.list +1 -0
  275. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  276. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/msg-patterns.old.list +1 -0
  277. package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -2
  278. package/payload/gate-sdk/gate-tests/check-tree-terms/good/scripts/gate-sdk-config.knobs +1 -0
  279. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/demo-kit/templates/msg-patterns.list +2 -0
  280. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/rosters/extra.list +2 -0
  281. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +1 -0
  282. package/payload/gate-sdk/gate-tests/emit-arm-shape.test.sh +1 -1
  283. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +10 -2
  284. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +29 -3
  285. package/payload/gate-sdk/gate-tests/lib-test-hermetic.test.sh +24 -0
  286. package/payload/gate-sdk/gate-tests/native-git-hooks.test.sh +261 -0
  287. package/payload/gate-sdk/gate-tests/native-rustflags.test.sh +20 -0
  288. package/payload/gate-sdk/gate-tests/run-arm-contract.test.sh +11 -4
  289. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +2 -1
  290. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +11 -1
  291. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +64 -4
  292. package/payload/gate-sdk/lib/gate.sh +46 -6
  293. package/payload/gate-sdk/lib/test-hermetic.sh +16 -8
  294. package/payload/gate-sdk/templates/adopt.md +1 -1
  295. package/payload/gate-sdk/templates/msg-patterns.list +1 -1
  296. package/payload/gate-sdk/templates/portability-patterns.list +1 -1
  297. package/payload/guard-kit/README.md +12 -7
  298. package/payload/guard-kit/close-surfaces.txt +3 -0
  299. package/payload/guard-kit/gate-tests/check-door-binding/bad/alpha-kit/README.md +1 -1
  300. package/payload/guard-kit/gate-tests/check-door-binding/bad/expect.txt +1 -0
  301. package/payload/guard-kit/gate-tests/check-door-binding/bad/scripts/guard-config.knobs +2 -1
  302. package/payload/guard-kit/gate-tests/check-door-binding/bad/src/remedy.rs +3 -0
  303. package/payload/guard-kit/gate-tests/check-door-binding/good/expect.txt +1 -0
  304. package/payload/guard-kit/gate-tests/check-door-binding/good/scripts/guard-config.knobs +2 -1
  305. package/payload/guard-kit/gate-tests/check-door-binding/good/site/register.md +8 -0
  306. package/payload/guard-kit/gate-tests/check-door-binding/good/src/remedy.rs +13 -0
  307. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +0 -1
  308. package/payload/guard-kit/gate-tests/consumer-rules.test.sh +105 -3
  309. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +64 -2
  310. package/payload/guard-kit/gate-tests/guard-config-knobs.test.sh +18 -5
  311. package/payload/guard-kit/gate-tests/guard-verdict.test.sh +74 -0
  312. package/payload/guard-kit/gate-tests/worktree-confinement.test.sh +49 -5
  313. package/payload/guard-kit/guard-tests/background-cases.tsv +103 -1
  314. package/payload/guard-kit/guard-tests/cases.tsv +834 -64
  315. package/payload/guard-kit/guard-tests/powershell-cases.tsv +51 -2
  316. package/payload/guard-kit/guard-tests/variant-limits.tsv +14 -0
  317. package/payload/guard-kit/templates/close-triage.md +2 -2
  318. package/payload/guard-kit/templates/guard-config.knobs +9 -0
  319. package/payload/guard-kit/templates/settings-allow.json +1 -1
  320. package/payload/guard-kit/templates/settings-hooks.json +4 -4
  321. package/payload/lifecycle-kit/README.md +11 -6
  322. package/payload/lifecycle-kit/checks/check-disposed-findings.gate +3 -0
  323. package/payload/lifecycle-kit/checks/check-skill-binding.gate +1 -1
  324. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +1 -1
  325. package/payload/lifecycle-kit/close-surfaces.txt +2 -0
  326. package/payload/lifecycle-kit/gate-tests/boundary-set-record.test.sh +82 -0
  327. package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +11 -2
  328. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +11 -1
  329. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/args +2 -0
  330. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/disposed-findings.txt +5 -0
  331. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/expect.txt +5 -0
  332. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/args +2 -0
  333. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/disposed-findings.txt +3 -0
  334. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/expect.txt +1 -0
  335. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +1 -0
  336. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +1 -1
  337. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +27 -2
  338. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +6 -0
  339. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +34 -2
  340. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +3 -0
  341. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
  342. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/scripts/lifecycle-config.knobs +3 -0
  343. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +3 -0
  344. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
  345. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/scripts/lifecycle-config.knobs +2 -0
  346. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage.test.sh +22 -2
  347. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +9 -2
  348. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +27 -1
  349. package/payload/lifecycle-kit/gate-tests/journal-arm.test.sh +251 -0
  350. package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +46 -5
  351. package/payload/lifecycle-kit/gate-tests/stamp-before-write.test.sh +16 -2
  352. package/payload/lifecycle-kit/templates/consult.md +9 -5
  353. package/payload/lifecycle-kit/templates/frames/project-critique.md +18 -0
  354. package/payload/lifecycle-kit/templates/frames/stage-contract-sweep.md +18 -0
  355. package/payload/lifecycle-kit/templates/frames/stage-contract.md +15 -0
  356. package/payload/lifecycle-kit/templates/host-protocol.md +10 -0
  357. package/payload/lifecycle-kit/templates/lead.md +30 -25
  358. package/payload/lifecycle-kit/templates/stages/align.md +4 -0
  359. package/payload/lifecycle-kit/templates/stages/build.md +5 -3
  360. package/payload/lifecycle-kit/templates/stages/close.md +8 -6
  361. package/payload/lifecycle-kit/templates/stages/scope.md +6 -2
  362. package/payload/lifecycle-kit/templates/stages/spec.md +4 -0
  363. package/payload/lifecycle-kit/templates/stages/validate.md +4 -2
  364. package/payload/lifecycle-kit/templates/upgrade.md +1 -1
  365. package/payload/queue-kit/README.md +3 -2
  366. package/payload/queue-kit/close-surfaces.txt +3 -0
  367. package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
  368. package/payload/queue-kit/gate-tests/check-queue-sections/bad/scripts/queue-config.knobs +2 -0
  369. package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +1 -1
  370. package/payload/queue-kit/gate-tests/check-queue-sections/good/scripts/queue-config.knobs +2 -0
  371. package/payload/queue-kit/gate-tests/check-queue-sections.test.sh +65 -0
  372. package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +10 -1
  373. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +4 -0
  374. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +4 -0
  375. package/payload/queue-kit/gate-tests/check-task-conservation.test.sh +38 -0
  376. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +3 -0
  377. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +3 -0
  378. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +8 -0
  379. package/payload/queue-kit/gate-tests/roadmap-lag.test.sh +137 -0
  380. package/payload/site-kit/README.md +3 -3
  381. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/docs/unclosed.md +8 -0
  382. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/expect.txt +1 -0
  383. package/payload/site-kit/gate-tests/check-docs-collapsible/good/docs/regions.md +7 -0
  384. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/docs/dotted.md +9 -0
  385. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/expect.txt +1 -0
  386. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/dotted.md +7 -0
  387. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/expect.txt +1 -1
  388. package/payload/site-kit/gate-tests/site-health-probe.test.sh +219 -0
  389. package/payload/site-kit/templates/site-health.yml +181 -132
  390. package/profiles.list +11 -10
  391. package/recipes/openspec/canon-config.knobs +5 -0
  392. package/recipes/openspec-overlap/canon-config.knobs +12 -0
  393. package/recipes/openspec-overlap/unregister.list +1 -0
  394. package/payload/context-kit/checks/check-footprint-fresh.gate +0 -4
  395. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +0 -4
  396. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +0 -12
  397. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +0 -1
  398. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +0 -11
  399. package/payload/context-kit/gate-tests/check-footprint-fresh/good/CLAUDE.md +0 -6
  400. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/SPEC.md +0 -3
  401. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/templates/guide.md +0 -3
  402. package/payload/context-kit/gate-tests/check-footprint-fresh/good/docs/footprint.md +0 -32
  403. package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +0 -1
  404. package/payload/context-kit/templates/session-context.sh +0 -148
  405. package/payload/delegation-kit/checks/check-rule-citation.gate +0 -3
  406. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +0 -1
  407. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +0 -1
  408. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +0 -9
  409. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +0 -4
  410. package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +0 -1
  411. package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +0 -1
  412. package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +0 -20
  413. package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +0 -5
  414. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +0 -54
  415. package/payload/gate-sdk/checks/check-crate-arms.gate +0 -3
  416. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +0 -3
  417. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +0 -3
  418. package/payload/gate-sdk/checks/check-kit-roots-dialect.gate +0 -3
  419. package/payload/gate-sdk/checks/check-packed-links.gate +0 -3
  420. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +0 -7
  421. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +0 -12
  422. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +0 -5
  423. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.knobs +0 -3
  424. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +0 -7
  425. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +0 -11
  426. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +0 -2
  427. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.knobs +0 -3
  428. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +0 -2
  429. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +0 -5
  430. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +0 -2
  431. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +0 -2
  432. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.knobs +0 -2
  433. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +0 -4
  434. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +0 -1
  435. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +0 -6
  436. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +0 -2
  437. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +0 -5
  438. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +0 -2
  439. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +0 -2
  440. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.knobs +0 -2
  441. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +0 -4
  442. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +0 -1
  443. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +0 -5
  444. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +0 -97
  445. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +0 -1
  446. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +0 -1
  447. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +0 -2
  448. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +0 -1
  449. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +0 -1
  450. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +0 -2
  451. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/args +0 -5
  452. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/expect.txt +0 -1
  453. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/checks/placeholder.txt +0 -3
  454. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
  455. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/lib/alpha.sh +0 -3
  456. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/checks/placeholder.txt +0 -3
  457. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/gate-tests/beta.test.sh +0 -3
  458. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/lib/beta.sh +0 -3
  459. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/checks/placeholder.txt +0 -3
  460. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/lib/gate.sh +0 -3
  461. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gate-sdk-config.knobs +0 -7
  462. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gates.list +0 -3
  463. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/args +0 -7
  464. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/expect.txt +0 -1
  465. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/checks/placeholder.txt +0 -3
  466. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
  467. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/lib/alpha.sh +0 -3
  468. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/checks/placeholder.txt +0 -3
  469. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/gate-tests/beta.test.sh +0 -3
  470. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/lib/beta.sh +0 -3
  471. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/checks/placeholder.txt +0 -3
  472. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/lib/gate.sh +0 -3
  473. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/scripts/gates.list +0 -3
  474. package/payload/gate-sdk/gate-tests/check-packed-links/bad/alpha-kit/README.md +0 -5
  475. package/payload/gate-sdk/gate-tests/check-packed-links/bad/args +0 -5
  476. package/payload/gate-sdk/gate-tests/check-packed-links/bad/beta-kit/README.md +0 -5
  477. package/payload/gate-sdk/gate-tests/check-packed-links/bad/expect.txt +0 -2
  478. package/payload/gate-sdk/gate-tests/check-packed-links/bad/scripts/gate-sdk-config.knobs +0 -4
  479. package/payload/gate-sdk/gate-tests/check-packed-links/good/alpha-kit/README.md +0 -5
  480. package/payload/gate-sdk/gate-tests/check-packed-links/good/args +0 -8
  481. package/payload/gate-sdk/gate-tests/check-packed-links/good/beta-kit/README.md +0 -9
  482. package/payload/gate-sdk/gate-tests/check-packed-links/good/expect.txt +0 -1
  483. package/payload/gate-sdk/gate-tests/check-packed-links/good/gamma-kit/SPEC.md +0 -4
  484. package/payload/gate-sdk/gate-tests/check-packed-links/good/scripts/gate-sdk-config.knobs +0 -6
  485. package/payload/gate-sdk/gate-tests/check-portability-floor/good/patterns.list +0 -5
  486. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/portability-patterns.list +0 -5
  487. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +0 -2
  488. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +0 -3
  489. /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/bad/args +0 -0
  490. /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/good/args +0 -0
  491. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
  492. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
  493. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/delegation-config.sh +0 -0
  494. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/session-note.sh +0 -0
  495. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/usage-poller.sh +0 -0
@@ -5,7 +5,8 @@
5
5
  # with no skill), the reverse direction (a skill invoking a retired stage), and
6
6
  # the executed-surface resolution the citation direction rests on: a bound
7
7
  # template is the surface read, and the finding names the template rather than
8
- # the shim that named it.
8
+ # the shim that named it. The same resolution carries the host-protocol
9
+ # direction for a bound stage, and a malformed binding exits 2.
9
10
  #
10
11
  # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
11
12
  set -uo pipefail
@@ -65,9 +66,28 @@ check_case "bound-template-clean" "$b" 0 "STAGE-SKILL-COVERAGE: clean"
65
66
  printf 'The build stage, with no last step at all.\n' >"$b/templates/build.md"
66
67
  check_case "bound-template-uncited" "$b" 1 "no journal step: templates/build.md"
67
68
 
69
+ # --- fourth direction: a bound stage's surface is the bound template too ---
70
+ HOST='lifecycle-kit/SPEC.md §The host protocol'
71
+ h="$SANDBOX/hosted"; seed "$h"
72
+ mkdir -p "$h/templates"
73
+ export LIFECYCLE_KIT_KNOB_FILE="$h/lifecycle-config.knobs" # past the hermetic pin: these cases bind a stage
74
+ printf 'LIFECYCLE_KIT_STAGE_EXECUTOR[] = build=demo\n' >"$h/lifecycle-config.knobs"
75
+ printf 'The build stage. Host (%s). Last step (%s).\n' "$HOST" "$CITE" >"$h/templates/build.md"
76
+ printf 'Execute the template at templates/build.md, applying the bindings below.\n\n## Bindings\n' \
77
+ >"$h/commands/build.md"
78
+ check_case "bound-stage-hosted" "$h" 0 "1 bound stage(s) read"
79
+
80
+ # --- and a bound stage whose template lacks the citation reds, naming template and adapter ---
81
+ printf 'The build stage. Last step (%s).\n' "$CITE" >"$h/templates/build.md"
82
+ check_case "bound-stage-unhosted" "$h" 1 "no host protocol: templates/build.md (stage 'build', bound to 'demo')"
83
+
84
+ # --- a malformed binding is config the gate refuses to judge under ---
85
+ printf 'LIFECYCLE_KIT_STAGE_EXECUTOR[] = polish=demo\n' >"$h/lifecycle-config.knobs"
86
+ check_case "bound-stage-unknown" "$h" 2 "stage key 'polish' is not in LIFECYCLE_KIT_STAGES"
87
+
68
88
  if [[ "$fails" -gt 0 ]]; then
69
89
  echo "check-stage-skill-coverage.test.sh: $fails case(s) failed"
70
90
  exit 1
71
91
  fi
72
- echo "check-stage-skill-coverage.test.sh: clean (missing-skill + orphan-skill + non-stage-skill + bound-template cited and uncited, 5 cases)"
92
+ echo "check-stage-skill-coverage.test.sh: clean (missing-skill + orphan-skill + non-stage-skill + bound-template cited and uncited + bound-stage hosted, unhosted and unknown, 8 cases)"
73
93
  exit 0
@@ -9,7 +9,8 @@
9
9
  # — plus the corpus-match probe (a pathspec matching a path at rev, and one
10
10
  # matching none), the widened arm over git-object-shaped tokens in the OTHER four
11
11
  # fields, which the hermetic pair cannot reach for the same reason, and its valve;
12
- # plus the two inert shapes (no record at all, a header-only record).
12
+ # plus the two inert shapes (no record at all, a header-only record), and a
13
+ # repository git refuses, which exits 2 rather than degrading to grammar only.
13
14
  #
14
15
  # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
15
16
  set -uo pipefail
@@ -134,9 +135,15 @@ write_token_record "$noreason" "$noreason_sha" "four of them, as of deadbeef1."
134
135
  check_case "valve-no-reason" "$noreason" 1 "valve carries no reason"
135
136
  check_case "valve-no-reason-still-probes" "$noreason" 1 "token names no object in this repository"
136
137
 
138
+ # --- bare mode in a repository git refuses: the crosser's refusal, never a grammar-only pass ---
139
+ refused="$SANDBOX/refused"; mkdir -p "$refused"
140
+ printf 'gitdir: %s/absent\n' "$refused" >"$refused/.git"
141
+ write_record "$refused" "$(printf 'a%.0s' {1..40})"
142
+ check_case "refused-repository" "$refused" 2 "marks a repository"
143
+
137
144
  if [[ "$fails" -gt 0 ]]; then
138
145
  echo "check-survey-record.test.sh: $fails case(s) failed"
139
146
  exit 1
140
147
  fi
141
- echo "check-survey-record.test.sh: clean (rev-exists + rev-unknown probe arms, the corpus-match probe matching and not, the widened non-rev token arm resolvable and not and over the inferred field, the valve and a reasonless valve that does not exempt, absent-record and header-only inert shapes, 12 cases)"
148
+ echo "check-survey-record.test.sh: clean (rev-exists + rev-unknown probe arms, the corpus-match probe matching and not, the widened non-rev token arm resolvable and not and over the inferred field, the valve and a reasonless valve that does not exempt, absent-record and header-only inert shapes, a refused repository, 13 cases)"
142
149
  exit 0
@@ -88,10 +88,36 @@ filed "$p"
88
88
  plain done-slug "$p"
89
89
  grep -qF "$ASKS" <<<"$ERR" && note done-ask "a done-section slug raised the recurrence advisory: $ERR"
90
90
 
91
+ # --- a disposed-findings record whose term the prose spells asks the filer; stdout stays the bullet alone ---
92
+ cat >"$SANDBOX/disposed.txt" <<'EOF'
93
+ # contract: lifecycle-kit/SPEC.md §The disposed-findings record — - <YYYY-MM-DD> — `<term>`[, `<term>`]… — <finding and ground>
94
+ - 2026-01-02 — `nightly-image` — the nightly runner image moves; discarded on the runner map's ride rule.
95
+ - 2026-01-03 — `stale-hook` —
96
+ EOF
97
+ disposed() { # $1=prose -> one filing into a fresh inbox with the record set
98
+ local inbox="$SANDBOX/inbox-$RANDOM.md"
99
+ OUT="$(env LIFECYCLE_KIT_GAP_INBOX_FILE="$inbox" \
100
+ LIFECYCLE_KIT_QUEUE_FILE="$SANDBOX/TASK-QUEUE.md" \
101
+ LIFECYCLE_KIT_DISPOSED_FILE="$SANDBOX/disposed.txt" \
102
+ bash "$SDK/bin/run-gates.sh" --emit file-gap "$1" 2>"$SANDBOX/err.txt")"
103
+ ERR="$(cat "$SANDBOX/err.txt")"
104
+ }
105
+ DISPOSED='matches the finding disposed'
106
+ p='the Nightly-Image label moved again this week'
107
+ disposed "$p"
108
+ grep -qxF -- "file-gap: - $DATE — $p" <<<"$OUT" \
109
+ || note disposed-stdout "stdout is not the filed bullet alone: $OUT"
110
+ grep -qF "$DISPOSED 2026-01-02 (\`nightly-image\`)" <<<"$ERR" \
111
+ || note disposed-ask "no advisory naming the record's date and term: $ERR"
112
+ disposed 'the nightly-image-arm label moved'
113
+ grep -qF "$DISPOSED" <<<"$ERR" && note disposed-hyphen "a term inside a longer hyphenated token raised the advisory: $ERR"
114
+ disposed 'the stale-hook finding again'
115
+ grep -qF "$DISPOSED" <<<"$ERR" && note disposed-malformed "a malformed record raised the advisory: $ERR"
116
+
91
117
  # --- no filing ever writes the queue ---
92
118
  [[ "$qbefore" == "$(cat "$SANDBOX/TASK-QUEUE.md")" ]] \
93
119
  || note no-queue-write "the arm modified the queue file — the constraint the gap inbox exists to hold"
94
120
 
95
121
  [[ "$fails" -eq 0 ]] || { echo "file-gap-recurrence.test: $fails assertion(s) failed"; exit 1; }
96
- echo "file-gap-recurrence.test: clean (the set knobs reach the arm, every filing writes the plain bullet and no verdict, a fresh inbox is seeded with the contract header, a live slug asks the filer while a done slug stays silent, and no filing writes the queue)"
122
+ echo "file-gap-recurrence.test: clean (the set knobs reach the arm, every filing writes the plain bullet and no verdict, a fresh inbox is seeded with the contract header, a live slug asks the filer while a done slug stays silent, a disposed record's word-bounded term asks the filer while a malformed record stays silent, and no filing writes the queue)"
97
123
  exit 0
@@ -0,0 +1,251 @@
1
+ #!/usr/bin/env bash
2
+ # spec: lifecycle-kit/SPEC.md §The journal arm — the arm end-to-end in a non-git sandbox: an operand and a standard input land in the journal of the caller's last-stamped stage and never the cursor's, a waiver line is no stage, every refusal exits 2 leaving each journal byte-identical, an absent journal and directory are created whatever the require switch, a retargeted pattern is followed, an absent state file is refused as an unstamped caller, standard input lands byte for byte, from a subdirectory of a repository every reader of the derivation names one file and the path the entry printed and the one the arm prints each take a raw append into it, and a derived id no stamp carries walks its own scan newest-first to the first stamped id, refusing when none is; and the lead form: an operand and a standard input land after an open heading with the one stdout line and no stamp read, an absent journal and a disposed last segment are refused naming the opener, a linked worktree is refused, and the separator admits a text that begins with the flag
3
+ set -uo pipefail
4
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
5
+
6
+ SANDBOX="$(mktemp -d)"
7
+ trap 'rm -rf "$SANDBOX"' EXIT
8
+
9
+ fails=0
10
+ note() { echo " FAIL [$1]: $2"; fails=$((fails + 1)); }
11
+
12
+ seed() { # $1=sandbox subdir $2..=stamp lines
13
+ local sb="$1"; shift
14
+ mkdir -p "$sb/state"
15
+ : >"$sb/lifecycle-config.knobs"
16
+ { printf '# contract: lifecycle-kit/SPEC.md §check-stage-evidence\n\n---\n\n'; printf '%s\n' "$@"; } >"$sb/state/stamps.txt"
17
+ }
18
+
19
+ arm() { # $1=sandbox $2=caller id $3..=the arm's argv; stdin is the caller's
20
+ local sb="$1" id="$2"; shift 2
21
+ ( cd "$sb" && gate_env LIFECYCLE_KIT_KNOB_FILE="$sb/lifecycle-config.knobs" \
22
+ LIFECYCLE_KIT_STATE_FILE=state/stamps.txt \
23
+ LIFECYCLE_KIT_STAGE_JOURNAL_PATTERN="${PATTERN:-scratch/<stage>-journal.md}" \
24
+ LIFECYCLE_KIT_STAGE_JOURNAL_REQUIRE="${REQUIRE:-0}" \
25
+ LIFECYCLE_KIT_SESSION_ID="$id" \
26
+ && gate_arm_run --emit-journal "$@" 2>&1 )
27
+ }
28
+
29
+ journals() { ( cd "$1" && find . -path ./state -prune -o -type f ! -name lifecycle-config.knobs -print | sort | while read -r f; do echo "== $f"; cat "$f"; done ); }
30
+
31
+ # --- an operand lands last under the opener's heading, and stdout is the one line ---
32
+ sb="$SANDBOX/operand"; seed "$sb" 'demo scope aaaaaaaa 2026-06-01 none' 'demo build deadbeef 2026-06-02 none'
33
+ mkdir -p "$sb/scratch"
34
+ heading='# stage-journal build — demo deadbeef 2026-06-02 none'
35
+ printf '%s\n' "$heading" >"$sb/scratch/build-journal.md"
36
+ out="$(arm "$sb" deadbeef01 "a confirmed finding")"; rc=$?
37
+ [[ "$rc" -eq 0 ]] || note operand-status "want exit 0, got $rc -- $out"
38
+ [[ "$out" == "journal: "*"scratch/build-journal.md build deadbeef" ]] || note operand-stdout "stdout is not the one line: $out"
39
+ [[ "$(cat "$sb/scratch/build-journal.md")" == "$heading"$'\n'"a confirmed finding" ]] \
40
+ || note operand-body "the operand did not land verbatim under the heading: $(cat "$sb/scratch/build-journal.md")"
41
+
42
+ # --- a multi-line standard input lands whole, and DONE as the operand is the last line ---
43
+ out="$(printf 'line one\nline two\n' | arm "$sb" deadbeef01)"; rc=$?
44
+ [[ "$rc" -eq 0 ]] || note stdin-status "want exit 0 on standard input, got $rc -- $out"
45
+ [[ "$(tail -n 2 "$sb/scratch/build-journal.md")" == $'line one\nline two' ]] \
46
+ || note stdin-body "the standard input did not land whole: $(cat "$sb/scratch/build-journal.md")"
47
+ out="$(arm "$sb" deadbeef01 DONE)"; rc=$?
48
+ [[ "$rc" -eq 0 && "$(tail -n 1 "$sb/scratch/build-journal.md")" == "DONE" ]] \
49
+ || note done-last "DONE is not the file's last line (exit $rc): $(tail -n 2 "$sb/scratch/build-journal.md")"
50
+ [[ "$(tail -c 5 "$sb/scratch/build-journal.md" | od -An -c | tr -d ' \n')" == 'DONE\n' ]] \
51
+ || note done-newline "the closing newline was doubled or dropped"
52
+
53
+ # --- the caller's own stage, never the cursor's ---
54
+ sb="$SANDBOX/superseded"; seed "$sb" 'demo build deadbeef 2026-06-02 none' 'demo validate cccccccc 2026-06-03 none'
55
+ out="$(arm "$sb" deadbeef01 "a late finding")"; rc=$?
56
+ [[ "$rc" -eq 0 && "$out" == "journal: "*"scratch/build-journal.md build deadbeef" ]] \
57
+ || note superseded "a caller the cursor left did not write its own stage's journal (exit $rc): $out"
58
+ [[ -e "$sb/scratch/validate-journal.md" ]] && note superseded-cursor "the arm wrote the cursor's journal"
59
+
60
+ # --- two stamps: the later one's stage; a waiver line carrying the id is no stage ---
61
+ sb="$SANDBOX/two-stamps"; seed "$sb" 'demo scope deadbeef 2026-06-01 none' 'demo build deadbeef 2026-06-02 none' 'demo align-waived deadbeef 2026-06-02 none'
62
+ out="$(arm "$sb" deadbeef01 "after two stamps")"; rc=$?
63
+ [[ "$rc" -eq 0 && "$out" == "journal: "*"scratch/build-journal.md build deadbeef" ]] \
64
+ || note two-stamps "the later stamp's stage was not taken, or the waiver line was read as one (exit $rc): $out"
65
+
66
+ # --- every refusal exits 2 and leaves every journal byte-identical ---
67
+ sb="$SANDBOX/refusals"; seed "$sb" 'demo build deadbeef 2026-06-02 none'
68
+ mkdir -p "$sb/scratch"; echo "kept" >"$sb/scratch/build-journal.md"
69
+ before="$(journals "$sb")"
70
+ refused() { # $1=label $2=caller id $3..=argv
71
+ local label="$1" id="$2" out rc; shift 2
72
+ out="$(arm "$sb" "$id" "$@" </dev/null)"; rc=$?
73
+ [[ "$rc" -eq 2 ]] || note "$label-status" "want exit 2, got $rc -- $out"
74
+ [[ "$(journals "$sb")" == "$before" ]] || note "$label-nowrite" "a refused call wrote a journal"
75
+ REFUSAL="$out"
76
+ }
77
+ refused unstamped 0badc0de01 "a finding"
78
+ grep -qF '0badc0de' <<<"$REFUSAL" || note unstamped-id "the refusal does not name the id: $REFUSAL"
79
+ grep -qF -- '--enter-stage <stage>' <<<"$REFUSAL" || note unstamped-remedy "the refusal does not name the remedy: $REFUSAL"
80
+ refused empty-operand deadbeef01 ""
81
+ refused empty-stdin deadbeef01
82
+ refused second-operand deadbeef01 one two
83
+ refused dash-led deadbeef01 -led
84
+ out="$(arm "$sb" deadbeef01 -- "-led text" </dev/null)"; rc=$?
85
+ [[ "$rc" -eq 0 && "$(tail -n 1 "$sb/scratch/build-journal.md")" == "-led text" ]] \
86
+ || note separator "the separator did not admit a dash-led text (exit $rc): $out"
87
+
88
+ # --- an absent journal and directory are created, whatever the require switch ---
89
+ for req in 0 1; do
90
+ sb="$SANDBOX/create-$req"; seed "$sb" 'demo build deadbeef 2026-06-02 none'
91
+ out="$(REQUIRE="$req" arm "$sb" deadbeef01 "first line")"; rc=$?
92
+ [[ "$rc" -eq 0 && "$(cat "$sb/scratch/build-journal.md" 2>/dev/null)" == "first line" ]] \
93
+ || note "create-$req" "the journal and its directory were not created (exit $rc): $out"
94
+ done
95
+
96
+ # --- a retargeted pattern is followed ---
97
+ sb="$SANDBOX/pattern"; seed "$sb" 'demo build deadbeef 2026-06-02 none'
98
+ out="$(PATTERN='notes/j/<stage>.log' arm "$sb" deadbeef01 "retargeted")"; rc=$?
99
+ [[ "$rc" -eq 0 && "$out" == "journal: "*"notes/j/build.log build deadbeef" && "$(cat "$sb/notes/j/build.log" 2>/dev/null)" == "retargeted" ]] \
100
+ || note pattern "a retargeted pattern was not followed (exit $rc): $out"
101
+
102
+ # --- an absent state file is the unstamped refusal, never an I/O failure ---
103
+ sb="$SANDBOX/no-state"; seed "$sb" 'demo build deadbeef 2026-06-02 none'
104
+ rm "$sb/state/stamps.txt"
105
+ out="$(arm "$sb" deadbeef01 "a finding")"; rc=$?
106
+ [[ "$rc" -eq 2 ]] || note no-state-status "want exit 2 with the state file absent, got $rc -- $out"
107
+ grep -qF 'deadbeef' <<<"$out" && grep -qF -- '--enter-stage <stage>' <<<"$out" \
108
+ || note no-state-refusal "the refusal does not name the id and the remedy: $out"
109
+ [[ -e "$sb/scratch" ]] && note no-state-nowrite "a refused call created the journal directory"
110
+
111
+ # --- a standard-input byte that is no UTF-8 lands as itself ---
112
+ sb="$SANDBOX/bytes"; seed "$sb" 'demo build deadbeef 2026-06-02 none'
113
+ out="$(printf 'a\377b\n' | arm "$sb" deadbeef01)"; rc=$?
114
+ [[ "$rc" -eq 0 && "$(od -An -b "$sb/scratch/build-journal.md" | tr -d ' \n')" == '141377142012' ]] \
115
+ || note bytes "the byte was replaced or dropped (exit $rc): $(od -An -b "$sb/scratch/build-journal.md" 2>&1)"
116
+
117
+ # --- from a subdirectory of a repository the opener, the entry assertion and the arm name one file ---
118
+ sb="$SANDBOX/subdir"; seed "$sb" 'demo scope aaaaaaaa 2026-06-01 none' 'demo build bbbbbbbb 2026-06-02 none'
119
+ mkdir -p "$sb/sub" "$sb/scratch"
120
+ printf '# TASK-QUEUE.md\n\n## Iteration: demo\n\n---\n\n## New Features\n\n## Technical Debt\n\n## Done\n' >"$sb/TASK-QUEUE.md"
121
+ echo "the predecessor's finding" >"$sb/scratch/build-journal.md"
122
+ git -C "$sb" init -q
123
+ git -C "$sb" add -A
124
+ git -C "$sb" -c user.email=t@t.invalid -c user.name=t -c commit.gpgsign=false commit -qm seed
125
+ from_sub() { # $1.. = the binary's argv, run from the subdirectory under absolute queue and state knobs
126
+ ( cd "$sb/sub" && gate_env LIFECYCLE_KIT_KNOB_FILE="$sb/lifecycle-config.knobs" \
127
+ GATE_SDK_TMP_DIR=scratch \
128
+ LIFECYCLE_KIT_QUEUE_FILE="$sb/TASK-QUEUE.md" \
129
+ LIFECYCLE_KIT_STATE_FILE="$sb/state/stamps.txt" \
130
+ LIFECYCLE_KIT_STAGE_JOURNAL_PATTERN='scratch/<stage>-journal.md' \
131
+ LIFECYCLE_KIT_STAGE_JOURNAL_REQUIRE=1 \
132
+ LIFECYCLE_KIT_SESSION_ID=deadbeef01 \
133
+ && gate_arm_run "$@" 2>&1 )
134
+ }
135
+ out="$(from_sub --enter-stage validate)"; rc=$?
136
+ [[ "$rc" -eq 0 ]] || note subdir-entry "the entry did not read the predecessor journal at the repository root (exit $rc): $out"
137
+ out="$(from_sub --emit-journal "from the subdirectory")"; rc=$?
138
+ [[ "$rc" -eq 0 ]] || note subdir-arm "the arm refused from a subdirectory (exit $rc): $out"
139
+ [[ "$(head -n 1 "$sb/scratch/validate-journal.md" 2>/dev/null)" == '# stage-journal validate — demo deadbeef '* \
140
+ && "$(tail -n 1 "$sb/scratch/validate-journal.md" 2>/dev/null)" == "from the subdirectory" ]] \
141
+ || note subdir-one-file "the opener and the arm did not write one file at the repository root: $(cat "$sb/scratch/validate-journal.md" 2>&1)"
142
+ [[ -e "$sb/sub/scratch/validate-journal.md" ]] && note subdir-second-file "a second journal was written under the working directory"
143
+
144
+ # --- the path the entry printed, and the one the arm prints, each take a raw append from the subdirectory into that one file ---
145
+ sb="$SANDBOX/printed"; seed "$sb" 'demo scope aaaaaaaa 2026-06-01 none' 'demo build bbbbbbbb 2026-06-02 none'
146
+ mkdir -p "$sb/sub" "$sb/scratch"
147
+ printf '# TASK-QUEUE.md\n\n## Iteration: demo\n\n---\n\n## New Features\n\n## Technical Debt\n\n## Done\n' >"$sb/TASK-QUEUE.md"
148
+ echo "the predecessor's finding" >"$sb/scratch/build-journal.md"
149
+ git -C "$sb" init -q
150
+ git -C "$sb" add -A
151
+ git -C "$sb" -c user.email=t@t.invalid -c user.name=t -c commit.gpgsign=false commit -qm seed
152
+ out="$(from_sub --enter-stage validate)"; rc=$?
153
+ printed="$(sed -n 's/.*resume journal opened at \(.*\) — append each finding.*/\1/p' <<<"$out")"
154
+ [[ "$rc" -eq 0 && -n "$printed" ]] || note printed-note "the entry printed no journal path (exit $rc): $out"
155
+ ( cd "$sb/sub" && printf 'by hand\n' >>"$printed" ) 2>/dev/null
156
+ [[ "$(tail -n 1 "$sb/scratch/validate-journal.md" 2>/dev/null)" == "by hand" ]] \
157
+ || note printed-append "a raw append to the printed path '$printed' from a subdirectory missed the journal: $(cat "$sb/scratch/validate-journal.md" 2>&1)"
158
+ [[ -e "$sb/sub/scratch/validate-journal.md" ]] && note printed-stray "the printed path named a file under the working directory"
159
+ out="$(from_sub --emit-journal "by the arm")"; rc=$?
160
+ printed="$(sed -n 's/^journal: \(.*\) validate deadbeef$/\1/p' <<<"$out")"
161
+ [[ "$rc" -eq 0 && -n "$printed" ]] || note arm-printed-line "the arm printed no journal path (exit $rc): $out"
162
+ ( cd "$sb/sub" && printf 'by hand again\n' >>"$printed" ) 2>/dev/null
163
+ [[ "$(tail -n 1 "$sb/scratch/validate-journal.md" 2>/dev/null)" == "by hand again" ]] \
164
+ || note arm-printed-append "a raw append to the arm's printed path '$printed' from a subdirectory missed the journal: $(cat "$sb/scratch/validate-journal.md" 2>&1)"
165
+ [[ -e "$sb/sub/scratch/validate-journal.md" ]] && note arm-printed-stray "the arm's printed path named a file under the working directory"
166
+
167
+ # --- a live child's newer transcript does not unseat the stamped caller, and no stamped candidate is the refusal ---
168
+ lead='11112222-3333-4444-5555-666677778888'
169
+ walk() { # $1=sandbox $2..=the binary's argv, the id derived from a narrowed transcript scan
170
+ local sb="$1"; shift
171
+ ( cd "$sb" && gate_env LIFECYCLE_KIT_KNOB_FILE="$sb/lifecycle-config.knobs" \
172
+ LIFECYCLE_KIT_STATE_FILE=state/stamps.txt \
173
+ LIFECYCLE_KIT_STAGE_JOURNAL_PATTERN='scratch/<stage>-journal.md' \
174
+ LIFECYCLE_KIT_SESSION_ID= \
175
+ LIFECYCLE_KIT_SESSIONS_DIR="$sb/sessions" \
176
+ CLAUDE_CODE_SESSION_ID="$lead" \
177
+ CLAUDE_CODE_CHILD_SESSION=1 \
178
+ && gate_arm_run "$@" 2>&1 )
179
+ }
180
+ transcripts() { # $1=sandbox — the stamped session's transcript, then its child's, newer
181
+ mkdir -p "$1/sessions/$lead/subagents"
182
+ : >"$1/sessions/$lead/subagents/agent-deadbeef0001.jsonl"; touch -t 202001010000 "$1/sessions/$lead/subagents/agent-deadbeef0001.jsonl"
183
+ : >"$1/sessions/$lead/subagents/agent-0badc0de0001.jsonl"; touch -t 202001020000 "$1/sessions/$lead/subagents/agent-0badc0de0001.jsonl"
184
+ }
185
+ sb="$SANDBOX/child"; seed "$sb" 'demo build deadbeef 2026-06-02 none'; transcripts "$sb"
186
+ out="$(walk "$sb" --emit-session-id)"
187
+ [[ "$out" == "0badc0de" ]] || note child-derived "the case is not built: the derivation did not answer the child's id: $out"
188
+ out="$(walk "$sb" --emit-journal "held while a child ran")"; rc=$?
189
+ [[ "$rc" -eq 0 && "$out" == "journal: "*"scratch/build-journal.md build deadbeef" ]] \
190
+ || note child-walk "the arm did not walk past the unstamped child to the stamped caller (exit $rc): $out"
191
+ [[ "$(cat "$sb/scratch/build-journal.md" 2>/dev/null)" == "held while a child ran" ]] || note child-body "the text did not land in the stamped caller's journal"
192
+ sb="$SANDBOX/child-none"; seed "$sb" 'demo build cccccccc 2026-06-02 none'; transcripts "$sb"
193
+ out="$(walk "$sb" --emit-journal "a finding")"; rc=$?
194
+ [[ "$rc" -eq 2 ]] || note child-none-status "want exit 2 with no stamped candidate in the scan, got $rc -- $out"
195
+ grep -qF '0badc0de' <<<"$out" || note child-none-id "the refusal does not name the derived id: $out"
196
+ [[ -e "$sb/scratch" ]] && note child-none-nowrite "a refused walk created the journal directory"
197
+
198
+ # --- the lead form: the knob names the file, no stamp is read, and the write is the stage form's ---
199
+ lead_arm() { # $1=sandbox $2..=the arm's argv after --lead; stdin is the caller's; no state file is named
200
+ local sb="$1"; shift
201
+ ( cd "${FROM:-$sb}" && gate_env LIFECYCLE_KIT_KNOB_FILE="$sb/lifecycle-config.knobs" \
202
+ GATE_SDK_TMP_DIR=scratch \
203
+ LIFECYCLE_KIT_STATE_FILE=state/absent.txt \
204
+ LIFECYCLE_KIT_LEAD_JOURNAL_FILE="${LEADFILE:-lead-journal.md}" \
205
+ LIFECYCLE_KIT_SESSION_ID=0badc0de01 \
206
+ && gate_arm_run --emit-journal --lead "$@" 2>&1 )
207
+ }
208
+ sb="$SANDBOX/lead"; mkdir -p "$sb/scratch"; : >"$sb/lifecycle-config.knobs"
209
+ opened='## lead-journal opened after build deadbeef 2026-06-02 none'
210
+ printf '## early\nDISPOSED\n\n%s\n' "$opened" >"$sb/scratch/lead-journal.md"
211
+ out="$(lead_arm "$sb" "a lead finding")"; rc=$?
212
+ [[ "$rc" -eq 0 && "$out" == "journal: "*"scratch/lead-journal.md lead" ]] || note lead-stdout "want exit 0 and the one line, got $rc -- $out"
213
+ [[ "$(tail -n 2 "$sb/scratch/lead-journal.md")" == "$opened"$'\n'"a lead finding" ]] \
214
+ || note lead-body "the operand did not land verbatim after the open heading: $(cat "$sb/scratch/lead-journal.md")"
215
+ out="$(printf 'line one\nline two\n' | lead_arm "$sb")"; rc=$?
216
+ [[ "$rc" -eq 0 && "$(tail -n 2 "$sb/scratch/lead-journal.md")" == $'line one\nline two' ]] \
217
+ || note lead-stdin "the standard input did not land whole (exit $rc): $out"
218
+ out="$(lead_arm "$sb" -- "--lead is where this text begins" </dev/null)"; rc=$?
219
+ [[ "$rc" -eq 0 && "$(tail -n 1 "$sb/scratch/lead-journal.md")" == "--lead is where this text begins" ]] \
220
+ || note lead-separator "the separator did not admit a text beginning with the flag (exit $rc): $out"
221
+ [[ -e "$sb/state" ]] && note lead-no-state "the lead form created or needed a state file"
222
+ before="$(cat "$sb/scratch/lead-journal.md")"
223
+ for argv in 'one two' '-led' ''; do
224
+ # shellcheck disable=SC2086
225
+ out="$(lead_arm "$sb" $argv </dev/null)"; rc=$?
226
+ [[ "$rc" -eq 2 && "$(cat "$sb/scratch/lead-journal.md")" == "$before" ]] || note "lead-argv[$argv]" "want exit 2 and no write, got $rc -- $out"
227
+ done
228
+ out="$(LEADFILE=other.md lead_arm "$sb" "a finding")"; rc=$?
229
+ [[ "$rc" -eq 2 && ! -e "$sb/scratch/other.md" ]] || note lead-absent "an absent lead journal was not refused without a write (exit $rc): $out"
230
+ grep -qF -- '--enter-stage --open-lead-journal' <<<"$out" || note lead-absent-remedy "the refusal does not name the opener: $out"
231
+ printf 'DISPOSED\n\n' >>"$sb/scratch/lead-journal.md"; before="$(cat "$sb/scratch/lead-journal.md")"
232
+ out="$(lead_arm "$sb" "after the mark")"; rc=$?
233
+ [[ "$rc" -eq 2 && "$(cat "$sb/scratch/lead-journal.md")" == "$before" ]] || note lead-disposed "a disposed last segment was not refused without a write (exit $rc): $out"
234
+ grep -qF -- '--enter-stage --open-lead-journal' <<<"$out" || note lead-disposed-remedy "the refusal does not name the opener: $out"
235
+
236
+ # --- a linked worktree is refused by both forms' shared check ---
237
+ sb="$SANDBOX/lead-wt"; mkdir -p "$sb/scratch"; : >"$sb/lifecycle-config.knobs"; echo seed >"$sb/seed"
238
+ git -C "$sb" init -q
239
+ git -C "$sb" add seed
240
+ git -C "$sb" -c user.email=t@t.invalid -c user.name=t -c commit.gpgsign=false commit -qm seed
241
+ git -C "$sb" worktree add -q "$SANDBOX/lead-wt-linked" 2>/dev/null
242
+ mkdir -p "$SANDBOX/lead-wt-linked/scratch"
243
+ printf '%s\n' "$opened" | tee "$sb/scratch/lead-journal.md" >"$SANDBOX/lead-wt-linked/scratch/lead-journal.md"
244
+ out="$(FROM="$SANDBOX/lead-wt-linked" lead_arm "$sb" "from a worktree")"; rc=$?
245
+ [[ "$rc" -eq 2 ]] || note lead-worktree "want exit 2 from a linked worktree, got $rc -- $out"
246
+ [[ "$(cat "$sb/scratch/lead-journal.md" "$SANDBOX/lead-wt-linked/scratch/lead-journal.md")" == "$opened"$'\n'"$opened" ]] \
247
+ || note lead-worktree-nowrite "a refused worktree call wrote a journal"
248
+
249
+ [[ "$fails" -eq 0 ]] || { echo "journal-arm.test: $fails assertion(s) failed"; exit 1; }
250
+ echo "journal-arm.test: clean (an operand and a standard input land in the caller's last-stamped stage's journal with the one stdout line, DONE stands last, the cursor's journal and a waiver line are not read, five refusals exit 2 writing nothing, the separator admits a dash-led text, an absent journal is created at either require value, a retargeted pattern is followed, an absent state file is the unstamped refusal, a non-UTF-8 byte lands as itself, from a subdirectory the opener, the entry assertion and the arm name one file, the path the entry printed and the one the arm prints each take a raw append there into that file, and an unstamped derived id walks its scan to the stamped caller or refuses naming itself; the lead form appends an operand, a standard input and a flag-led text behind the separator to the knob's file with no state file, and refuses its argv errors, an absent journal, a disposed last segment and a linked worktree writing nothing)"
251
+ exit 0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — --open-lead-journal end-to-end through a sandboxed enter-stage: the heading keyed on fields 2 through the last of the last stamp, creation with its directory, append after an undisposed segment, a disposed segment dropped, the idempotent no-op, --simulate writing nothing, the surplus refusal, the none key on a stampless state file, and no stamp ever appended
2
+ # spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — --open-lead-journal end-to-end through a sandboxed enter-stage: the heading keyed on fields 2 through the last of the last stamp, creation with its directory, append after an undisposed segment, a disposed segment dropped, the idempotent no-op, --simulate writing nothing, the surplus refusal, the none key on a stampless state file, the session-role marker (written, rewritten on the journal no-op, left alone when held, skipped where the id does not derive, simulated unwritten, never written on a refusal), and no stamp ever appended
3
3
  set -uo pipefail
4
4
  source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
5
5
 
@@ -32,6 +32,12 @@ run_open() { # $1=sandbox subdir, rest = argv after the tool name
32
32
  ( cd "$sb" && gate_env GATE_SDK_TMP_DIR="$sb/scratch" && gate_arm_run --enter-stage "$@" 2>&1 )
33
33
  }
34
34
 
35
+ run_as() { # $1=sandbox subdir $2=pinned session id, rest = argv after the tool name
36
+ local sb="$1" id="$2"; shift 2
37
+ ( cd "$sb" && gate_env GATE_SDK_TMP_DIR="$sb/scratch" LIFECYCLE_KIT_SESSION_ID="$id" \
38
+ && gate_arm_run --enter-stage "$@" 2>&1 )
39
+ }
40
+
35
41
  untracked_only() { # $1=sandbox subdir $2=assertion label
36
42
  cmp -s "$1/queue.before" "$1/TASK-QUEUE.md" || note "$2" "the queue was written"
37
43
  cmp -s "$1/state.before" "$1/.workflow/WORKFLOW-STATE.txt" || note "$2" "the state file was written"
@@ -40,18 +46,51 @@ untracked_only() { # $1=sandbox subdir $2=assertion label
40
46
  # --- creation, with its directory, under the cursor's key ---
41
47
  cr="$SANDBOX/create"
42
48
  seed "$cr" stamps
43
- out="$(run_open "$cr" --open-lead-journal)"; rc=$?
49
+ out="$(run_as "$cr" abcdef0123 --open-lead-journal)"; rc=$?
44
50
  [[ "$rc" -eq 0 ]] || note create "want exit 0, got $rc -- $out"
45
51
  [[ "$(cat "$cr/scratch/lead-journal.md" 2>/dev/null)" == "## lead-journal opened after $KEY" ]] \
46
52
  || note create-heading "the journal is not exactly the keyed heading: $(cat "$cr/scratch/lead-journal.md" 2>/dev/null)"
47
53
  untracked_only "$cr" create-untracked
54
+ [[ "$(cat "$cr/scratch/session-role" 2>/dev/null)" == "lead abcdef01" ]] \
55
+ || note marker-write "the marker is not exactly the pinned id's line: $(cat "$cr/scratch/session-role" 2>/dev/null)"
48
56
 
49
- # --- the idempotent no-op on a re-run at the same cursor ---
57
+ # --- the idempotent no-op on a re-run at the same cursor, the marker rewritten under a new id ---
50
58
  cp "$cr/scratch/lead-journal.md" "$cr/journal.before"
51
- out="$(run_open "$cr" --open-lead-journal)"; rc=$?
59
+ out="$(run_as "$cr" 12345678ab --open-lead-journal)"; rc=$?
52
60
  [[ "$rc" -eq 0 ]] || note noop "want exit 0, got $rc -- $out"
53
61
  cmp -s "$cr/journal.before" "$cr/scratch/lead-journal.md" || note noop-bytes "the re-run wrote the journal"
54
62
  grep -qF 'idempotent no-op' <<<"$out" || note noop-report "the re-run did not report a no-op: $out"
63
+ [[ "$(cat "$cr/scratch/session-role" 2>/dev/null)" == "lead 12345678" ]] \
64
+ || note marker-noop-rewrite "the journal no-op did not rewrite the marker: $(cat "$cr/scratch/session-role" 2>/dev/null)"
65
+
66
+ # --- a marker already holding the line is reported and left alone ---
67
+ cp "$cr/scratch/session-role" "$cr/marker.before"
68
+ out="$(run_as "$cr" 12345678ab --open-lead-journal)"; rc=$?
69
+ [[ "$rc" -eq 0 ]] || note marker-same "want exit 0, got $rc -- $out"
70
+ cmp -s "$cr/marker.before" "$cr/scratch/session-role" || note marker-same-bytes "a held marker was rewritten"
71
+ grep -qF 'already holds' <<<"$out" || note marker-same-report "a held marker was not reported: $out"
72
+
73
+ # --- an id that does not derive skips the marker at exit 0, the journal still opened ---
74
+ sk="$SANDBOX/skip"
75
+ seed "$sk" stamps
76
+ mkdir -p "$sk/sessions"
77
+ out="$( cd "$sk" && unset LIFECYCLE_KIT_SESSION_ID CLAUDE_CODE_SESSION_ID CLAUDE_CODE_CHILD_SESSION \
78
+ && gate_env GATE_SDK_TMP_DIR="$sk/scratch" LIFECYCLE_KIT_SESSIONS_DIR="$sk/sessions" \
79
+ && gate_arm_run --enter-stage --open-lead-journal 2>&1 )"; rc=$?
80
+ [[ "$rc" -eq 0 ]] || note marker-skip "want exit 0, got $rc -- $out"
81
+ [[ "$(cat "$sk/scratch/lead-journal.md" 2>/dev/null)" == "## lead-journal opened after $KEY" ]] \
82
+ || note marker-skip-journal "the skip did not leave the journal opened"
83
+ [[ -e "$sk/scratch/session-role" ]] && note marker-skip-file "an underived id wrote a marker"
84
+ grep -qF 'skipped the session-role marker' <<<"$out" || note marker-skip-report "the skip is not named: $out"
85
+
86
+ # --- --simulate relays the marker line and path under its prefix and writes no marker ---
87
+ ms="$SANDBOX/marker-simulate"
88
+ seed "$ms" stamps
89
+ out="$(run_as "$ms" abcdef0123 --simulate --open-lead-journal)"; rc=$?
90
+ [[ "$rc" -eq 0 ]] || note marker-simulate "want exit 0, got $rc -- $out"
91
+ grep -qE "^enter-stage \(simulate\): .*'lead abcdef01'.*$ms/scratch/session-role" <<<"$out" \
92
+ || note marker-simulate-relay "--simulate does not relay the marker line and path: $out"
93
+ [[ -e "$ms/scratch/session-role" ]] && note marker-simulate-file "--simulate wrote the marker"
55
94
 
56
95
  # --- append after an undisposed segment, keeping it byte for byte ---
57
96
  ap="$SANDBOX/append"
@@ -101,11 +140,13 @@ for surplus in extra --simulate; do
101
140
  out="$(run_open "$su" --open-lead-journal "$surplus")"; rc=$?
102
141
  [[ "$rc" -eq 2 ]] || note "surplus-$surplus" "want exit 2, got $rc -- $out"
103
142
  [[ -e "$su/scratch/lead-journal.md" ]] && note "surplus-$surplus-write" "a refused open wrote the journal"
143
+ [[ -e "$su/scratch/session-role" ]] && note "marker-surplus-$surplus" "a refused open wrote the marker"
104
144
  untracked_only "$su" "surplus-$surplus-untracked"
105
145
  done
106
146
  grep -qF -- '--enter-stage --simulate --open-lead-journal' <<<"$out" \
107
147
  || note surplus-spelling "a trailing --simulate is not told the flag-first spelling: $out"
108
148
 
149
+
109
150
  # --- a stampless state file keys the heading on none ---
110
151
  no="$SANDBOX/none"
111
152
  seed "$no" stampless
@@ -115,5 +156,5 @@ out="$(run_open "$no" --open-lead-journal)"; rc=$?
115
156
  || note none-heading "a stampless state file did not key on none: $(cat "$no/scratch/lead-journal.md" 2>/dev/null)"
116
157
 
117
158
  [[ "$fails" -eq 0 ]] || { echo "lead-journal-open.test: $fails assertion(s) failed"; exit 1; }
118
- echo "lead-journal-open.test: clean (--open-lead-journal creates its keyed heading, appends after an undisposed segment, drops a disposed one, no-ops at the same cursor, simulates read-only under its prefix, refuses a surplus argument with nothing written, keys on none without a stamp, and never stamps)"
159
+ echo "lead-journal-open.test: clean (--open-lead-journal creates its keyed heading, appends after an undisposed segment, drops a disposed one, no-ops at the same cursor, simulates read-only under its prefix, refuses a surplus argument with nothing written, keys on none without a stamp, writes the session-role marker, rewrites it on the no-op, leaves a held one alone, skips it at exit 0 where the id does not derive, simulates it unwritten, and never stamps)"
119
160
  exit 0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # spec: lifecycle-kit/SPEC.md §check-dispatch-entry — the workflow-state guard's stamp-before-write and superseded-stage rules end-to-end through a sandboxed --hook: a configured stage-session caller with no stamp is blocked, a caller whose stage the cursor has left is blocked outside the scratch dir and allowed inside it, a stamped one holding the cursor, a caller of another type and a top-level caller pass, an empty roster is inert, an unreadable state file declines through the advise envelope, and the state-file rule still blocks a stamped caller and follows a relocated LIFECYCLE_KIT_STATE_FILE
2
+ # spec: lifecycle-kit/SPEC.md §check-dispatch-entry — the workflow-state guard's stamp-before-write and superseded-stage rules end-to-end through a sandboxed --hook: a configured stage-session caller with no stamp is blocked, a caller whose stage the cursor has left is blocked outside the scratch dir and allowed inside it, a patch with every target inside it included, a stamped one holding the cursor, a caller of another type and a top-level caller pass, an empty roster is inert, an unreadable state file declines through the advise envelope, and the state-file rule still blocks a stamped caller and follows a relocated LIFECYCLE_KIT_STATE_FILE
3
3
  set -uo pipefail
4
4
  source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
5
5
 
@@ -11,6 +11,8 @@ note() { echo " FAIL [$1]: $2"; fails=$((fails + 1)); }
11
11
 
12
12
  sb="$SANDBOX/tree"
13
13
  mkdir -p "$sb/.workflow"
14
+ # spec: gate-sdk/SPEC.md §The harness-integration arm — the arm declines outside a repository, so the sandbox is one
15
+ git -C "$sb" init -q
14
16
  printf '# contract: lifecycle-kit/SPEC.md §check-stage-evidence\n\n---\n\ndemo scope aaaaaaaa 2026-06-01 none\ndemo build a94d72dc 2026-06-02 none\n' \
15
17
  >"$sb/.workflow/WORKFLOW-STATE.txt"
16
18
  printf 'LIFECYCLE_KIT_STAGE_SESSION_TYPES[] = stage-session\n' >"$sb/roster.knobs"
@@ -24,6 +26,13 @@ payload() { # $1=agent_type (or '-' for none) $2=agent_id $3=file_path
24
26
  fi
25
27
  }
26
28
 
29
+ patch_payload() { # $1=agent_id $2.. the patch's Add File targets
30
+ local id="$1" body='*** Begin Patch\n' t
31
+ shift
32
+ for t in "$@"; do body+="*** Add File: $t\\n+x\\n"; done
33
+ printf '{"hook_event_name":"PreToolUse","tool_name":"Edit","agent_type":"stage-session","agent_id":"%s","tool_input":{"command":"%s*** End Patch\\n"}}' "$id" "$body"
34
+ }
35
+
27
36
  hook() { # $1=knob file $2=payload; prints stdout+stderr, returns the hook's exit
28
37
  ( cd "$sb" && gate_env LIFECYCLE_KIT_KNOB_FILE="$sb/$1" && gate_arm_run --hook workflow-state-guard <<<"$2" 2>&1 )
29
38
  }
@@ -53,6 +62,11 @@ out="$(hook roster.knobs "$(payload stage-session aaaaaaaa00000000 "$sb/.tmp/jou
53
62
  [[ "$rc" -eq 0 && -z "$out" ]] || note superseded-scratch "want a silent exit 0 for a superseded caller writing under the scratch dir, got $rc -- $out"
54
63
  out="$(hook roster.knobs "$(payload stage-session aaaaaaaa00000000 "$sb/.tmp/../notes.md")")"; rc=$?
55
64
  [[ "$rc" -eq 2 ]] || note superseded-climb "want exit 2 for a superseded caller climbing out of the scratch dir, got $rc -- $out"
65
+ out="$(hook roster.knobs "$(patch_payload aaaaaaaa00000000 "$sb/.tmp/journal/a.md" "$sb/notes.md")")"; rc=$?
66
+ [[ "$rc" -eq 2 ]] || note superseded-patch "want exit 2 for a superseded caller's patch with one target outside the scratch dir, got $rc -- $out"
67
+ grep -qF "'$sb/notes.md'" <<<"$out" || note superseded-patch-target "the block does not name the target outside the scratch dir: $out"
68
+ out="$(hook roster.knobs "$(patch_payload aaaaaaaa00000000 "$sb/.tmp/journal/a.md" "$sb/.tmp/journal/b.md")")"; rc=$?
69
+ [[ "$rc" -eq 0 && -z "$out" ]] || note superseded-patch-scratch "want a silent exit 0 for a superseded caller's patch with every target under the scratch dir, got $rc -- $out"
56
70
  out="$(hook roster.knobs "$(payload stage-session a94d72dcd2db52dbf notes.md)")"; rc=$?
57
71
  [[ "$rc" -eq 0 && -z "$out" ]] || note cursor-holder "want a silent exit 0 for the caller holding the cursor, got $rc -- $out"
58
72
 
@@ -73,5 +87,5 @@ out="$(hook absent.knobs "$(payload stage-session b1b2b3b4c5c6c7c8d notes.md)")"
73
87
  grep -qF '"additionalContext"' <<<"$out" || note decline-envelope "the decline did not write the PreToolUse advise envelope: $out"
74
88
 
75
89
  [[ "$fails" -eq 0 ]] || { echo "stamp-before-write.test: $fails assertion(s) failed"; exit 1; }
76
- echo "stamp-before-write.test: clean (an unstamped stage-session caller is blocked naming its id and the remedy; a caller whose stage the cursor has left is blocked naming both stages, allowed under the scratch dir and blocked climbing out of it; a stamped one holding the cursor, another type, a top-level caller and an empty roster pass silently; an unreadable state file declines through the advise envelope; the state-file rule still blocks a stamped caller and follows a relocated LIFECYCLE_KIT_STATE_FILE)"
90
+ echo "stamp-before-write.test: clean (an unstamped stage-session caller is blocked naming its id and the remedy; a caller whose stage the cursor has left is blocked naming both stages, allowed under the scratch dir and blocked climbing out of it, its patch blocked on one target outside the scratch dir and allowed with every target inside it; a stamped one holding the cursor, another type, a top-level caller and an empty roster pass silently; an unreadable state file declines through the advise envelope; the state-file rule still blocks a stamped caller and follows a relocated LIFECYCLE_KIT_STATE_FILE)"
77
91
  exit 0
@@ -1,14 +1,16 @@
1
- The `consult` skill — an operator strategy session whose conclusions leave the transcript. Not an iteration stage: it invokes no `--enter-stage`, stamps no `WORKFLOW-STATE.txt`, and holds no cursor, so it may run before an iteration opens, between stages, or across an iteration boundary. Exit condition: every ruling the operator closed in the session has landed in a governed surface, every consult-inbox item the session took up is dispositioned, every alternative refused along the way is recorded with the grounds it was refused on, and every always-loaded surface those rulings stale is corrected, flagged, or filed as work.
1
+ The `consult` skill — a session that reconsiders a ruling with the operator or gives a judgment-tier recommendation on strategic direction, and whose conclusions leave the transcript. Not an iteration stage: it invokes no `--enter-stage`, stamps no `WORKFLOW-STATE.txt`, and holds no cursor, so it may run before an iteration opens, between stages, or across an iteration boundary. Exit condition: every ruling the operator closed in the session has landed in a governed surface, every consult-inbox item the session took up is dispositioned, every request for advice it took up is answered, every alternative refused along the way is recorded with the grounds it was refused on, and every always-loaded surface those rulings stale is corrected, flagged, or filed as work.
2
2
 
3
3
  The write authority this skill leans on is **not** the skill's to grant: it belongs to the ruling record itself, which states who may record a ruling there and under what condition. What this skill adds on top of that authority is **obligation**. Any session that closes a ruling with the operator is permitted to record it; a consultation has not finished until it has.
4
4
 
5
+ **First step — verify your tier.** A consultation runs on the class `--emit knob-values LIFECYCLE_KIT_CONSULT_CLASS` names. Run `--model-verdict --expect <that class>` on the gate binary `GATE_SDK_NATIVE_BIN` names (delegation-kit/SPEC.md §model-verdict; without delegation-kit, skip this). On exit 1, stop before reading in. Say that this session is below its floor, quoting the verdict line, so it is restarted on that class: to the operator, or, dispatched, to the lead in one escalation block. On exit 2 the tier is unverified and not refused: state the verdict line in your first message and proceed.
6
+
5
7
  ## Session ritual
6
8
 
7
9
  1. **Read in before proposing anything.** *<entry-reading: the surfaces a consultation reads on entry — name paths, not topics. Typically the record of closed direction, the work queue, and any context this consumer keeps outside the tree; a consultation that skips the last of those re-opens what is already settled.>*
8
10
 
9
- 2. **Drain the consult inbox (`LIFECYCLE_KIT_CONSULT_INBOX_FILE`) as you reach its items.** Give each item you take up one disposition: ruled, landed as step 3 lands a ruling; re-classed to the queue, filed with `--emit file-gap` or entered directly where the operator directs; or discarded, with the cause in the commit message. Remove its bullet in the commit that lands the disposition, and name the disposition in that message. An item the operator defers stays in the inbox.
11
+ 2. **Drain the consult inbox (`LIFECYCLE_KIT_CONSULT_INBOX_FILE`) as you reach its items.** Give each item you take up one disposition: ruled, landed as step 3 lands a ruling; answered, as step 3 answers a request for advice; re-classed to the queue, filed with `--emit file-gap` or entered directly where the operator directs; or discarded, with the cause in the commit message. Remove its bullet in the commit that lands the disposition, and name the disposition in that message. An item the operator defers stays in the inbox; where you spent a grant it carries, mark the spend on its line as the dispatched paragraph below says.
10
12
 
11
- 3. **Land each ruling the moment it closes, never at exit.** The landing target is chosen by what the ruling is about, from *<landing-surfaces: the surfaces a closed ruling may land on, each with the ruling class it takes — direction and refusals, work items, and the contract surfaces a ruling about mechanism belongs in. Say which one takes a ruling that fits none of them.>* Landing at exit instead is the failure mode itself, one step later: a session that batches its rulings to the end loses all of them together when it is interrupted.
13
+ 3. **Land each ruling and answer each request for advice the moment it closes, never at exit.** A request expecting a reply gets the reply. One expecting a tracked change lands it through the ordinary workflow, the deferred entry the operator names added, updated or removed or a gap bullet, stated as `operator direction, <date>, on consult advice` where the operator accepted it and `consult advice, <date>` where not. A ruling lands on the ruling record only where that workflow would otherwise challenge or reject the direction, an owner doc still stating what the direction reverses. The landing target is chosen by what the ruling is about, from *<landing-surfaces: the surfaces a closed ruling may land on, each with the ruling class it takes — direction and refusals, work items, and the contract surfaces a ruling about mechanism belongs in. Say which one takes a ruling that fits none of them.>* Landing at exit instead is the failure mode itself, one step later: a session that batches to the end loses everything together when it is interrupted.
12
14
 
13
15
  4. **Record a refused alternative beside the ruling that refused it, with its grounds.** A refusal recorded without grounds is re-proposed by the next session at full cost; a refusal recorded with them is already costed when that session reaches for it. Deletion is not disposition — an alternative weighed and rejected is *kept*, marked as rejected.
14
16
 
@@ -16,6 +18,8 @@ The write authority this skill leans on is **not** the skill's to grant: it belo
16
18
 
17
19
  6. **Journal in flight, and treat a held index as latency rather than loss.** Durability is the obligation and this session discharges it by whichever means is available — the rule and its two discharge paths are `delegation-kit/templates/agent-execution.md`'s **Findings you will act on are durable before you act on them** bullet, which reaches this session directly. When another session holds the shared index, journal each ruling as it closes and commit when the index frees. Waiting is safe only because the finding is already durable; waiting without the journal is the transcript failure again, wearing a different cause.
18
20
 
19
- 7. **Dispatch by the delegation protocol, and select the tier every time.** The protocol is `delegation-kit/templates/agent-execution.md`, cited and never copied — a copy is a second tier of the same content, drifting from the day it is written. Tier selection needs its own attention here: an unselected dispatch inherits *this* session's tier, and a consultation runs at the judgment tier while most of what it dispatches is read-only research, so an unselected fan-out buys the most expensive tier for the cheapest work. Name the tier in the dispatch, downward by default, and reserve the judgment tier for a dispatch that actually rules.
21
+ 7. **Dispatch by the delegation protocol, and select the tier every time.** The protocol is `delegation-kit/templates/agent-execution.md`, cited and never copied — a copy is a second tier of the same content, drifting from the day it is written. Tier selection needs its own attention here: an unselected dispatch inherits *this* session's tier, and a consultation runs at the judgment tier while most of what it dispatches is read-only research, so an unselected fan-out buys the most expensive tier for the cheapest work. Name the tier in the dispatch — the bound model of the class the work needs, where the consumer binds one — downward by default, and reserve the judgment tier for a dispatch that actually rules.
22
+
23
+ **An outside critique runs only when the operator asks for one in this session.** Where your request is to refresh the strategic assessment and `--emit knob-values LIFECYCLE_KIT_CRITIQUE_ADAPTER` names an adapter, offer one and wait. On a yes: copy `lifecycle-kit/templates/frames/project-critique.md` to a prompt file in the scratch dir and append the focus the operator gave. Append nothing read from a file the repository ignores unless the operator names it. Run it as an audit-mode `--foreign-run` on that adapter, or the one the operator names, with `--class <your consultation's class>`, under delegation-kit's foreign-run bullet (delegation-kit/templates/agent-execution.md): the budget read first, backgrounded with its liveness record. Put a clarifying question with `--foreign-resume` where the adapter resumes, and close the session when you are done. A report from an earlier run is read the same way, from the path the operator gives. Check each finding before you build on it, then land what survives as step 3 lands advice and record what you reject as step 4 records a refusal.
20
24
 
21
- **Dispatched by a lead, with no operator in the session**, take up consult-inbox items only. Re-class or discard an item alone, with the cause in the commit message. Escalate each item needing a ruling or an operator direction to the lead, one Question / Options / Recommendation / Evidence block per item, all in one turn end; it stays in the inbox until an answer lands. A relayed answer lands in the class the relay names, never as a ruling (lifecycle-kit/SPEC.md §The steering vocabulary), so an item needing one waits for the operator's own consultation.
25
+ **Dispatched by a lead, with no operator in the session**, take up consult-inbox items only and run no critique, except one an item carries as an operator grant the lead relays, which you spend on the item's own terms: read the item's line for a `Grant spent` mark first, and where the item stays after you spend it, append `Grant spent <YYYY-MM-DD>: <what it paid for>.` to its line in the commit landing the spend's result (lifecycle-kit/SPEC.md §The consult inbox). Re-class or discard a misfiled item alone, with the cause in the commit message. Answer a request for advice alone: land the change your recommendation calls for as step 3 says, marked `consult advice, <date>`, remove its bullet, and send the recommendation to the lead so the operator may accept it; an acceptance the lead relays back re-marks the change `operator direction, <date>, on consult advice`. Escalate each ruling to reconsider to the lead too, one Question / Options / Recommendation / Evidence block per item, all in one turn end. It stays in the inbox, since a relayed answer lands in the class the relay names, never as a ruling (lifecycle-kit/SPEC.md §The steering vocabulary), so it waits for the operator's own consultation.
@@ -0,0 +1,18 @@
1
+ You are reading a project on behalf of a delegating session that will check your work. You are in a clone of the repository at a committed revision: uncommitted and ignored content is absent from it.
2
+
3
+ **You write nothing**, and you run only commands that change nothing. Where your sandbox refuses a command, name it in your report. Never work around it.
4
+
5
+ **Critique the project's strategic position, not its defects.** Read its front door, its stated direction and its work queue, then the tree behind them. Report:
6
+
7
+ - what the project claims and where the tree does not back the claim;
8
+ - what a prospective adopter meets first, and where they would stop;
9
+ - what the project depends on that it does not control;
10
+ - what its stated direction needs that it has left unbuilt.
11
+
12
+ **Your report**, as your final output, in these parts and this order:
13
+
14
+ 1. **Findings** — each with the path or command that shows it, and whether you measured it or inferred it.
15
+ 2. **Not assessable from the tree** — what you would need that the clone does not carry.
16
+ 3. **First three** — the findings you would act on first, and why.
17
+
18
+ A later message may ask you to clarify a finding. Answer from the tree, and say where an answer is inference.
@@ -0,0 +1,18 @@
1
+ You are executing the stage contract printed below the separator line, on behalf of a delegating session that holds the commit path. You are in a clone of the repository at a committed revision: uncommitted and ignored content is absent from it.
2
+
3
+ **Your edits are your return.** Make the contract's changes to the repository's files in this clone's working tree. The delegating session takes your whole change as one patch, runs what it produces, and commits it. Never commit, and never stamp, journal, push or file anything. The contract's first step and its last step belong to the delegating session: skip both. Return as a proposal any write the contract makes through a command the clone lacks.
4
+
5
+ **Run only commands that change nothing outside this clone.** Where your sandbox refuses a command, or a command needs a built artifact the clone lacks, name that command in your report for the delegating session to run. Never work around it. Output the repository ignores stays out of your change; anything else you create joins it.
6
+
7
+ Where the contract names a template or another file by a repository-relative path, read it in the clone.
8
+
9
+ When the delegating session returns a failure, continue in this clone, where your change still stands, and fix what failed.
10
+
11
+ **Your report**, as your final output, in these parts and this order:
12
+
13
+ 1. **Changes** — each path you changed, what changed and the contract step it carries out.
14
+ 2. **Proposed writes** — each write you could not make in the clone, naming the surface it lands on and carrying its full text.
15
+ 3. **Commands to run** — each command the delegating session must run, the checks your change needs among them.
16
+ 4. **Questions** — each as Question / Options / Recommendation / Evidence.
17
+ 5. **Not done** — every step you did not carry out, and why.
18
+ 6. **Verdict** — whether the stage's exit condition holds for the work you were given, by your reading.