checkwright 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/README.md +1013 -50
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +40 -0
  4. package/lib/common/profile.sh +33 -0
  5. package/lib/common/recipe.sh +56 -43
  6. package/lib/diff.sh +64 -0
  7. package/lib/doctor.sh +81 -7
  8. package/lib/init.sh +167 -52
  9. package/lib/uninstall.sh +212 -0
  10. package/lib/update.sh +34 -0
  11. package/package.json +2 -2
  12. package/payload/artifact/targets.list +30 -0
  13. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  14. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  15. package/payload/canon-kit/README.md +2 -0
  16. package/payload/canon-kit/SPEC.md +666 -59
  17. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
  18. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  19. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  20. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  21. package/payload/canon-kit/checks/check-docs-link-convention.sh +12 -4
  22. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  23. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  24. package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
  25. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  26. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  27. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  28. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  29. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  30. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  31. package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
  32. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  33. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
  35. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  36. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  37. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  38. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  39. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  51. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  63. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  64. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  68. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  69. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  70. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  71. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  72. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +32 -8
  73. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  74. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  75. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  76. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  77. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  78. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  79. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  80. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  81. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  82. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  83. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  84. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  85. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  86. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  87. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  88. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  89. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  90. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  91. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  92. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  93. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
  94. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  95. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  96. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  97. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  98. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
  99. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  100. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  101. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  102. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  103. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  104. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  105. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  106. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  107. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  108. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  109. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  110. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  111. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  112. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  113. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  114. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  115. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  116. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  117. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  118. package/payload/canon-kit/lib/spec.sh +109 -70
  119. package/payload/canon-kit/smoke/install.sh +21 -1
  120. package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
  121. package/payload/context-kit/README.md +4 -1
  122. package/payload/context-kit/SPEC.md +166 -9
  123. package/payload/context-kit/bin/env-probe.sh +19 -6
  124. package/payload/context-kit/checks/check-brevity.sh +1 -0
  125. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  126. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  127. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  128. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  129. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  130. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  131. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  132. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  133. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  134. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  135. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  136. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  137. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  138. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  139. package/payload/context-kit/lib/toolfloor.sh +15 -4
  140. package/payload/context-kit/smoke/agents-md.sh +12 -1
  141. package/payload/context-kit/smoke/install.sh +4 -1
  142. package/payload/delegation-kit/README.md +3 -3
  143. package/payload/delegation-kit/SPEC.md +499 -26
  144. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  145. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  146. package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
  147. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  148. package/payload/delegation-kit/lib/delegation.sh +1 -0
  149. package/payload/delegation-kit/smoke/install.sh +2 -1
  150. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  151. package/payload/delegation-kit/templates/agent-execution.md +127 -12
  152. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  153. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  154. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  155. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  156. package/payload/doctrine-kit/DOCTRINE.md +112 -11
  157. package/payload/doctrine-kit/README.md +12 -3
  158. package/payload/doctrine-kit/SPEC.md +163 -11
  159. package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
  160. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  161. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  162. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  163. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  164. package/payload/doctrine-kit/smoke/install.sh +167 -1
  165. package/payload/drift-kit/README.md +3 -2
  166. package/payload/drift-kit/SPEC.md +264 -22
  167. package/payload/drift-kit/bin/kfric.sh +21 -2
  168. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  169. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  170. package/payload/drift-kit/smoke/install.sh +183 -1
  171. package/payload/drift-kit/templates/economics.md +9 -0
  172. package/payload/drift-kit/templates/kpis.list +6 -1
  173. package/payload/evidence-kit/README.md +20 -6
  174. package/payload/evidence-kit/SPEC.md +355 -17
  175. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  176. package/payload/evidence-kit/checks/check-battery-roster.sh +87 -0
  177. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  178. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  179. package/payload/evidence-kit/checks/check-producer-liveness.sh +35 -0
  180. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  181. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  186. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  187. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  188. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  189. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  190. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  191. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  192. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  193. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  194. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  195. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  196. package/payload/evidence-kit/lib/evidence.sh +18 -0
  197. package/payload/evidence-kit/smoke/install.sh +17 -3
  198. package/payload/gate-sdk/README.md +17 -1
  199. package/payload/gate-sdk/SPEC.md +4427 -92
  200. package/payload/gate-sdk/bin/build-native.sh +38 -0
  201. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  202. package/payload/gate-sdk/bin/gen-pre-commit.sh +32 -2
  203. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  204. package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
  205. package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
  206. package/payload/gate-sdk/bin/run-gates.sh +37 -2
  207. package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
  208. package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
  209. package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
  210. package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
  211. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  212. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  213. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  214. package/payload/gate-sdk/checks/check-core-files.sh +28 -4
  215. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  216. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  217. package/payload/gate-sdk/checks/check-exec-bit.sh +21 -1
  218. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  219. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
  220. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
  221. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  222. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  223. package/payload/gate-sdk/checks/check-gate-output.sh +41 -3
  224. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
  225. package/payload/gate-sdk/checks/check-graph.sh +5 -5
  226. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  227. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  228. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  229. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  230. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  231. package/payload/gate-sdk/checks/check-readme-roster.sh +6 -0
  232. package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
  233. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  234. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  235. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  236. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  237. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  238. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  239. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  240. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  241. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  242. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  243. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  244. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  245. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  246. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  247. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  248. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  249. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  250. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  251. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  252. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  253. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  254. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  255. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  256. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  257. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  258. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  259. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  260. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  261. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  262. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  263. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  264. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  265. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  266. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  267. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  268. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  269. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  270. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  271. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  272. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  273. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  274. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  275. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  276. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  277. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  278. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  279. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  280. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  281. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  282. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  283. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  284. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  285. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  286. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  287. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  288. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  289. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  290. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  291. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  292. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  293. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  294. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  295. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  296. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  297. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  298. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  299. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  300. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  301. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  302. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  303. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  304. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  305. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  306. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  307. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  308. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  309. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  310. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  311. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  312. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
  313. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  314. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  315. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  316. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  317. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  318. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  319. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  320. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  321. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  322. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  323. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  324. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  325. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  326. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  327. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  328. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  329. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  330. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  331. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  332. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  333. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  334. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  335. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  336. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  337. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  338. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  339. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  340. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  341. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  342. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  343. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  344. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  345. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  346. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  347. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
  348. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  349. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  350. package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
  351. package/payload/gate-sdk/lib/gate.sh +208 -9
  352. package/payload/gate-sdk/lib/inject.sh +46 -1
  353. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  354. package/payload/gate-sdk/smoke/install.sh +61 -1
  355. package/payload/guard-kit/README.md +18 -14
  356. package/payload/guard-kit/SPEC.md +366 -72
  357. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  358. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  359. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  360. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  361. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  362. package/payload/guard-kit/lib/guard.sh +277 -54
  363. package/payload/guard-kit/templates/close-triage.md +38 -10
  364. package/payload/guard-kit/templates/guard-config.sh +3 -0
  365. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  366. package/payload/lifecycle-kit/README.md +12 -1
  367. package/payload/lifecycle-kit/SPEC.md +991 -41
  368. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  369. package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
  370. package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
  371. package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
  372. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  373. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  374. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  375. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  376. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  377. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  378. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  379. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  380. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  381. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  382. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  383. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  384. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  385. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  386. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  387. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  388. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  389. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  390. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  391. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  392. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  393. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  394. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  395. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -3
  396. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  397. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  398. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  399. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  400. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  401. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  402. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  403. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  404. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  405. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  406. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  407. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  408. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  409. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  410. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  411. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  412. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
  413. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
  414. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  415. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  416. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  417. package/payload/lifecycle-kit/lib/stages.sh +12 -2
  418. package/payload/lifecycle-kit/smoke/install.sh +83 -4
  419. package/payload/lifecycle-kit/templates/consult.md +73 -0
  420. package/payload/lifecycle-kit/templates/lead.md +139 -7
  421. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  422. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  423. package/payload/lifecycle-kit/templates/stages/close.md +45 -5
  424. package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
  425. package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
  426. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  427. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  428. package/payload/queue-kit/README.md +6 -1
  429. package/payload/queue-kit/SPEC.md +350 -6
  430. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  431. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  432. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  433. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  434. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  435. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  436. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  437. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  438. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  439. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  440. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  441. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  442. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  443. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  444. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  445. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  446. package/payload/queue-kit/lib/queue.sh +4 -19
  447. package/payload/queue-kit/smoke/install.sh +4 -1
  448. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  449. package/payload/site-kit/SPEC.md +64 -27
  450. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  451. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  452. package/payload/site-kit/smoke/install.sh +9 -1
  453. package/profiles.list +36 -8
  454. package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
  455. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  456. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  457. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  458. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  459. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  460. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  461. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  462. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  463. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  464. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  465. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  466. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -180
  467. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  468. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  469. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  470. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
  471. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  472. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  473. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  474. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  475. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  476. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  477. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  478. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  479. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  480. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  481. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  482. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -104
  483. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  484. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  485. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  486. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  487. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  488. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  489. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ # spec: lifecycle-kit/SPEC.md §The survey record — the two enter-stage.sh halves end-to-end through a sandboxed entry: an ordinary stage entry prints the record's headings and never its findings, and the iteration-boundary entry truncates the record to its contract header, names it in the truncated set, and does not refuse on a non-empty record the way the gap inbox one line above does
3
+ set -uo pipefail
4
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
5
+
6
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # lifecycle-kit/
7
+ ENTER="$DIR/bin/enter-stage.sh"
8
+ SANDBOX="$(mktemp -d)"
9
+ trap 'rm -rf "$SANDBOX"' EXIT
10
+
11
+ fails=0
12
+ note() { echo " FAIL [$1]: $2"; fails=$((fails + 1)); }
13
+
14
+ seed() { # $1=sandbox subdir; a boundary-ready consumer carrying two filed surveys
15
+ local sb="$1"
16
+ mkdir -p "$sb/.workflow" "$sb/scratch"
17
+ cat >"$sb/TASK-QUEUE.md" <<'EOF'
18
+ # TASK-QUEUE.md
19
+
20
+ ## Iteration: demo-iteration
21
+
22
+ ---
23
+
24
+ ## New Features
25
+
26
+ ## Technical Debt
27
+
28
+ ## Done
29
+ EOF
30
+ cat >"$sb/.workflow/WORKFLOW-STATE.txt" <<'EOF'
31
+ # contract: lifecycle-kit/SPEC.md §check-stage-evidence
32
+
33
+ ---
34
+
35
+ demo-iteration scope aaaaaaaa 2026-06-01
36
+ demo-iteration build bbbbbbbb 2026-06-02
37
+ demo-iteration validate cccccccc 2026-06-03
38
+ demo-iteration close dddddddd 2026-06-04
39
+ EOF
40
+ cat >"$sb/.workflow/survey-record.md" <<'EOF'
41
+ # contract: lifecycle-kit/SPEC.md §The survey record — carried surveys.
42
+
43
+ ## 2026-06-01 scope — which gates meet every port criterion?
44
+ - corpus: checks/
45
+ - oracle: bash run-gates.sh
46
+ - rev: 0123456789abcdef0123456789abcdef01234567
47
+ - finding: FINDING-BODY-MUST-NOT-BE-PRINTED
48
+
49
+ ## 2026-06-02 build — which specs cite the retired knob?
50
+ - corpus: */SPEC.md
51
+ - oracle: none
52
+ - rev: 89abcdef0123456789abcdef0123456789abcdef
53
+ - finding: SECOND-FINDING-BODY
54
+ EOF
55
+ }
56
+
57
+ run_enter() { # $1=sandbox subdir $2=stage
58
+ ( cd "$1" && env GATE_SDK_TMP_DIR=scratch \
59
+ LIFECYCLE_KIT_SESSION_ID=deadbeef02 \
60
+ bash "$ENTER" "$2" 2>&1 )
61
+ }
62
+
63
+ # --- an ordinary stage entry: the read trigger prints questions, never findings ---
64
+ ord="$SANDBOX/ordinary"
65
+ seed "$ord"
66
+ before="$(cat "$ord/.workflow/survey-record.md")"
67
+ out="$(run_enter "$ord" build)"; rc=$?
68
+ [[ "$rc" -eq 0 ]] || note ordinary-entry "want exit 0, got $rc -- $out"
69
+ grep -qF 'which gates meet every port criterion?' <<<"$out" \
70
+ || note read-trigger "the entry report names no survey heading: $out"
71
+ grep -qF 'which specs cite the retired knob?' <<<"$out" \
72
+ || note read-trigger-second "the entry report names only one of two headings: $out"
73
+ grep -qF 'FINDING-BODY-MUST-NOT-BE-PRINTED' <<<"$out" \
74
+ && note read-trigger-findings "the entry report printed a finding body ahead of its witness: $out"
75
+ [[ "$before" == "$(cat "$ord/.workflow/survey-record.md")" ]] \
76
+ || note ordinary-write "an ordinary stage entry modified the survey record"
77
+
78
+ # --- the iteration-boundary entry truncates it, names it, and does not refuse ---
79
+ bnd="$SANDBOX/boundary"
80
+ seed "$bnd"
81
+ out="$(run_enter "$bnd" scope)"; rc=$?
82
+ [[ "$rc" -eq 0 ]] || note boundary-entry "a non-empty survey record refused the boundary (exit $rc) -- $out"
83
+ body="$(grep -v '^#' "$bnd/.workflow/survey-record.md" | grep -c '[^[:space:]]')"
84
+ [[ "$body" -eq 0 ]] || note boundary-truncate "the boundary left $body body line(s) in the survey record"
85
+ head -n1 "$bnd/.workflow/survey-record.md" | grep -q '^# contract: ' \
86
+ || note boundary-header "the boundary truncate did not keep the contract header"
87
+ grep -qF '.workflow/survey-record.md' <<<"$out" \
88
+ || note boundary-report "the boundary report does not name the truncated record: $out"
89
+ grep -qF 'which gates meet every port criterion?' <<<"$out" \
90
+ && note boundary-headings "the boundary entry printed headings it had just discarded: $out"
91
+
92
+ # --- the gap inbox still refuses, so the asymmetry is real and not an accident ---
93
+ gap="$SANDBOX/gap"
94
+ seed "$gap"
95
+ printf '# contract: lifecycle-kit/SPEC.md §The committed gap inbox\n- 2026-06-05 — an untriaged gap\n' \
96
+ >"$gap/.workflow/gap-inbox.md"
97
+ out="$(run_enter "$gap" scope)"; rc=$?
98
+ [[ "$rc" -eq 1 ]] || note gap-refusal "want the gap inbox to refuse the boundary (exit 1), got $rc -- $out"
99
+
100
+ [[ "$fails" -eq 0 ]] || { echo "survey-record-entry.test: $fails assertion(s) failed"; exit 1; }
101
+ echo "survey-record-entry.test: clean (ordinary entry prints headings and no findings and writes nothing; boundary entry truncates to the header, names it, and never refuses, while the gap inbox beside it still does)"
102
+ exit 0
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env bash
2
+ # Behavioral test of templates/workflow-state-guard.sh: it blocks a Write/Edit
3
+ # whose target resolves to the lifecycle state file and falls through on
4
+ # everything else. The path-equality cases are the point — a textual comparison
5
+ # passes the first and fails the rest, and that is exactly how this guard is
6
+ # defeated in the field.
7
+ #
8
+ # Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
9
+ set -uo pipefail
10
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
11
+
12
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # lifecycle-kit/
13
+ GUARD="$DIR/templates/workflow-state-guard.sh"
14
+ LIB="$DIR/../guard-kit/lib/guard.sh"
15
+ command -v jq >/dev/null 2>&1 || { echo "workflow-state-guard.test: jq not found on PATH" >&2; exit 2; }
16
+
17
+ SANDBOX="$(mktemp -d)"
18
+ trap 'rm -rf "$SANDBOX"' EXIT
19
+ mkdir -p "$SANDBOX/.workflow" "$SANDBOX/docs"
20
+ printf '# contract\n\n---\n\niter build abc 2026-01-01\n' >"$SANDBOX/.workflow/WORKFLOW-STATE.txt"
21
+ printf 'ordinary\n' >"$SANDBOX/docs/page.md"
22
+ # a symlinked route to the same directory: same file, different spelling
23
+ ln -s .workflow "$SANDBOX/wf-link"
24
+
25
+ fails=0
26
+ checks=0
27
+
28
+ verdict() { # $1=json-payload -> "block" | "pass" | "advise"
29
+ local out rc
30
+ out="$(cd "$SANDBOX" && printf '%s' "$1" | GUARD_KIT_LIB="$LIB" bash "$GUARD" 2>/dev/null)"; rc=$?
31
+ if [[ "$rc" -eq 2 ]]; then echo block; return; fi
32
+ if grep -q '"additionalContext"' <<<"$out"; then echo advise; return; fi
33
+ if [[ "$rc" -eq 0 ]]; then echo pass; return; fi
34
+ echo "exit$rc"
35
+ }
36
+
37
+ want() { # $1=label $2=file_path $3=expected-verdict
38
+ local got
39
+ checks=$((checks + 1))
40
+ got="$(verdict "$(jq -nc --arg p "$2" '{tool_name:"Write",tool_input:{file_path:$p,content:"x"}}')")"
41
+ [[ "$got" == "$3" ]] || { echo " FAIL [$1]: '$2' -> $got, want $3"; fails=$((fails + 1)); }
42
+ }
43
+
44
+ # the plain spelling
45
+ want "relative" ".workflow/WORKFLOW-STATE.txt" block
46
+ # the three spellings a textual comparison misses
47
+ want "dot-slash" "./.workflow/WORKFLOW-STATE.txt" block
48
+ want "absolute" "$SANDBOX/.workflow/WORKFLOW-STATE.txt" block
49
+ want "through-symlink" "wf-link/WORKFLOW-STATE.txt" block
50
+ want "dot-dot" ".workflow/../.workflow/WORKFLOW-STATE.txt" block
51
+
52
+ # ordinary files are untouched — the guard must not become a general write block
53
+ want "ordinary-file" "docs/page.md" pass
54
+ want "sibling-in-dir" ".workflow/gap-inbox.md" pass
55
+ # a name that merely contains the target's is not the target
56
+ want "prefix-collision" ".workflow/WORKFLOW-STATE.txt.bak" pass
57
+
58
+ # a call with no file_path falls through rather than blocking
59
+ checks=$((checks + 1))
60
+ got="$(verdict '{"tool_name":"Bash","tool_input":{"command":"ls"}}')"
61
+ [[ "$got" == pass ]] || { echo " FAIL [no-file_path]: got $got, want pass"; fails=$((fails + 1)); }
62
+
63
+ # an Edit payload is judged the same way as a Write — the matcher covers both
64
+ checks=$((checks + 1))
65
+ got="$(verdict "$(jq -nc --arg p ".workflow/WORKFLOW-STATE.txt" \
66
+ '{tool_name:"Edit",tool_input:{file_path:$p,old_string:"a",new_string:"b"}}')")"
67
+ [[ "$got" == block ]] || { echo " FAIL [edit-payload]: got $got, want block"; fails=$((fails + 1)); }
68
+
69
+ # the relocation knob is honored: a consumer who moved the workflow dir gets a
70
+ # guard that follows it, and the old path stops being the state file
71
+ checks=$((checks + 1))
72
+ mkdir -p "$SANDBOX/wf2"; printf 'x\n' >"$SANDBOX/wf2/WORKFLOW-STATE.txt"
73
+ out="$(cd "$SANDBOX" && jq -nc '{tool_name:"Write",tool_input:{file_path:"wf2/WORKFLOW-STATE.txt",content:"x"}}' \
74
+ | GATE_SDK_WORKFLOW_DIR=wf2 GUARD_KIT_LIB="$LIB" bash "$GUARD" 2>/dev/null)"; rc=$?
75
+ [[ "$rc" -eq 2 ]] || { echo " FAIL [relocated-dir]: got exit $rc, want 2 ($out)"; fails=$((fails + 1)); }
76
+
77
+ # fail-open-but-loud: with the rule unenforceable the call is allowed and the
78
+ # advisory names the rule, rather than passing silently or wedging every write
79
+ checks=$((checks + 1))
80
+ # PATH is emptied of jq and readlink; bash is invoked by its absolute path so the
81
+ # stripped PATH cannot be mistaken for the interpreter itself going missing.
82
+ mkdir -p "$SANDBOX/nojq"
83
+ BASH_ABS="$(command -v bash)"
84
+ out="$(cd "$SANDBOX" && jq -nc '{tool_name:"Write",tool_input:{file_path:".workflow/WORKFLOW-STATE.txt",content:"x"}}' \
85
+ | PATH="$SANDBOX/nojq" GUARD_KIT_LIB="$LIB" "$BASH_ABS" "$GUARD" 2>/dev/null)"; rc=$?
86
+ { [[ "$rc" -eq 0 ]] && grep -q '"additionalContext"' <<<"$out"; } \
87
+ || { echo " FAIL [jq-absent]: want exit 0 with an advisory, got exit $rc: $out"; fails=$((fails + 1)); }
88
+
89
+ # an absent guard-kit lib is a clean fall-through, never a wedge
90
+ checks=$((checks + 1))
91
+ ( cd "$SANDBOX" && printf '%s' '{"tool_input":{"file_path":".workflow/WORKFLOW-STATE.txt"}}' \
92
+ | GUARD_KIT_LIB="$SANDBOX/nope.sh" bash "$GUARD" >/dev/null 2>&1 )
93
+ [[ "$?" -eq 0 ]] || { echo " FAIL [absent-lib]: expected a fall-through exit 0"; fails=$((fails + 1)); }
94
+
95
+ if [[ "$fails" -gt 0 ]]; then
96
+ echo "workflow-state-guard.test: $fails of $checks assertion(s) failed"
97
+ exit 1
98
+ fi
99
+ echo "workflow-state-guard.test: ok ($checks assertions; resolved path equality across four spellings, Write and Edit, the relocation knob, and both degradation postures)"
100
+ exit 0
@@ -51,9 +51,16 @@ declare -p LIFECYCLE_KIT_SHIM_DEDUP_CORPUS &>/dev/null || LIFECYCLE_KIT_SHIM_DED
51
51
  [[ -v LIFECYCLE_KIT_STATE_FILE ]] || LIFECYCLE_KIT_STATE_FILE="${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt"
52
52
  [[ -v LIFECYCLE_KIT_LESSON_EVIDENCE_FILE ]] || LIFECYCLE_KIT_LESSON_EVIDENCE_FILE="${GATE_SDK_WORKFLOW_DIR:-.workflow}/lesson-evidence.txt"
53
53
  [[ -v LIFECYCLE_KIT_GAP_INBOX_FILE ]] || LIFECYCLE_KIT_GAP_INBOX_FILE="${GATE_SDK_WORKFLOW_DIR:-.workflow}/gap-inbox.md"
54
+ [[ -v LIFECYCLE_KIT_SURVEY_RECORD_FILE ]] || LIFECYCLE_KIT_SURVEY_RECORD_FILE="${GATE_SDK_WORKFLOW_DIR:-.workflow}/survey-record.md"
55
+
56
+ [[ -v LIFECYCLE_KIT_RECURRENCE_THRESHOLD ]] || LIFECYCLE_KIT_RECURRENCE_THRESHOLD=2
54
57
 
55
58
  declare -p LIFECYCLE_KIT_CLOSE_SURFACE_GLOBS &>/dev/null || LIFECYCLE_KIT_CLOSE_SURFACE_GLOBS=("*/SPEC.md")
56
59
 
60
+ # spec: lifecycle-kit/SPEC.md §The survey record — the surfaces held to the no-retrieval-pointer rule; the queue file alone by default because it is the one permanent surface this kit owns and where both attested firings landed, so the default is non-vacuous in every consumer and over-reaches in none
61
+ declare -p LIFECYCLE_KIT_PERMANENT_SURFACE_GLOBS &>/dev/null \
62
+ || LIFECYCLE_KIT_PERMANENT_SURFACE_GLOBS=("$LIFECYCLE_KIT_QUEUE_FILE")
63
+
57
64
  declare -p LIFECYCLE_KIT_BOUNDARY_TRUNCATE &>/dev/null || LIFECYCLE_KIT_BOUNDARY_TRUNCATE=()
58
65
 
59
66
  declare -p LIFECYCLE_KIT_BOUNDARY_REQUIRE &>/dev/null || LIFECYCLE_KIT_BOUNDARY_REQUIRE=()
@@ -88,9 +95,9 @@ lifecycle_stage_known() {
88
95
  return 1
89
96
  }
90
97
 
91
- # spec: lifecycle-kit/SPEC.md §Multi-operator semantics — the iteration-scoped supersede set: exactly the surfaces enter-stage.sh truncates at the iteration boundary (the state file, the kit-owned lesson-evidence file, and every LIFECYCLE_KIT_BOUNDARY_TRUNCATE member). Derived here so the installer's .gitattributes block and check-merge-attrs's parity check read one set and cannot drift.
98
+ # spec: lifecycle-kit/SPEC.md §Multi-operator semantics — the iteration-scoped supersede set: exactly the surfaces enter-stage.sh truncates at the iteration boundary (the state file, the two kit-owned built-ins, and every LIFECYCLE_KIT_BOUNDARY_TRUNCATE member). Derived here so the installer's .gitattributes block and check-merge-attrs's parity check read one set and cannot drift.
92
99
  lifecycle_supersede_set() {
93
- printf '%s\n' "$LIFECYCLE_KIT_STATE_FILE" "$LIFECYCLE_KIT_LESSON_EVIDENCE_FILE"
100
+ printf '%s\n' "$LIFECYCLE_KIT_STATE_FILE" "$LIFECYCLE_KIT_LESSON_EVIDENCE_FILE" "$LIFECYCLE_KIT_SURVEY_RECORD_FILE"
94
101
  local m
95
102
  for m in ${LIFECYCLE_KIT_BOUNDARY_TRUNCATE[@]+"${LIFECYCLE_KIT_BOUNDARY_TRUNCATE[@]}"}; do
96
103
  printf '%s\n' "$m"
@@ -134,8 +141,11 @@ _lc_errs=()
134
141
  [[ -n "$LIFECYCLE_KIT_SKILLS_DIR" ]] || _lc_errs+=("LIFECYCLE_KIT_SKILLS_DIR is empty")
135
142
  [[ -n "$LIFECYCLE_KIT_LESSON_EVIDENCE_FILE" ]] || _lc_errs+=("LIFECYCLE_KIT_LESSON_EVIDENCE_FILE is empty")
136
143
  [[ -n "$LIFECYCLE_KIT_GAP_INBOX_FILE" ]] || _lc_errs+=("LIFECYCLE_KIT_GAP_INBOX_FILE is empty")
144
+ [[ -n "$LIFECYCLE_KIT_SURVEY_RECORD_FILE" ]] || _lc_errs+=("LIFECYCLE_KIT_SURVEY_RECORD_FILE is empty")
137
145
  [[ "$LIFECYCLE_KIT_SHIM_NGRAM" =~ ^[1-9][0-9]*$ ]] \
138
146
  || _lc_errs+=("LIFECYCLE_KIT_SHIM_NGRAM '$LIFECYCLE_KIT_SHIM_NGRAM' is not a positive integer")
147
+ [[ "$LIFECYCLE_KIT_RECURRENCE_THRESHOLD" =~ ^[1-9][0-9]*$ ]] \
148
+ || _lc_errs+=("LIFECYCLE_KIT_RECURRENCE_THRESHOLD '$LIFECYCLE_KIT_RECURRENCE_THRESHOLD' is not a positive integer")
139
149
  [[ "$LIFECYCLE_KIT_SESSION_BOUNDARY" == stage || "$LIFECYCLE_KIT_SESSION_BOUNDARY" == iteration ]] \
140
150
  || _lc_errs+=("LIFECYCLE_KIT_SESSION_BOUNDARY '$LIFECYCLE_KIT_SESSION_BOUNDARY' is neither 'stage' nor 'iteration'")
141
151
  lifecycle_stage_known "$LIFECYCLE_KIT_FIRST_STAGE" \
@@ -4,11 +4,36 @@
4
4
  set -euo pipefail
5
5
  : "${SMOKE_KIT_ROOT:?run via run-consumer-smoke.sh}"
6
6
  SDK="$SMOKE_KIT_ROOT/../gate-sdk" # the vendored gate-sdk beside this kit
7
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — the smoke resolves a kit gate through gate_command, the way
8
+ # a consumer's own battery does: this is the one context where a ported member's `.sh` is genuinely
9
+ # absent, and an absent binary is exit 2 — never a skip, never a pass, never an invented fallback.
10
+ # shellcheck source=../../gate-sdk/lib/gate.sh
11
+ source "$SDK/lib/gate.sh"
12
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — the binary pinned absolute off its own default spelling,
13
+ # because two of the dispatches below run from a sandbox cwd where the knob's repo-relative
14
+ # default resolves to nothing (the rule lib/test-hermetic.sh already applies in the test lane)
15
+ smoke_bin="$(gate_native_bin)"
16
+ [[ "$smoke_bin" == /* ]] || export GATE_SDK_NATIVE_BIN="$PWD/$smoke_bin"
17
+ unset smoke_bin
18
+
19
+ kit_gate() { # $1=gate-name $2.. = gate args — dispatch a vendored lifecycle-kit gate by name
20
+ local g="$1"; shift
21
+ local -a argv=()
22
+ mapfile -t argv < <(gate_command "$g" "$SMOKE_KIT_ROOT/checks")
23
+ [[ ${#argv[@]} -gt 0 ]] || return 2
24
+ "${argv[@]}" "$@"
25
+ }
7
26
 
8
27
  cat >> scripts/gates.list <<'EOF'
9
28
  # lifecycle-kit
10
29
  check-stage-evidence
11
30
  check-stage-entry
31
+ check-close-surfaces
32
+ check-merge-attrs
33
+ check-lifecycle-registration
34
+ check-survey-record
35
+ check-gap-inbox-neutrality
36
+ check-scratch-citation
12
37
  EOF
13
38
 
14
39
  if [[ ! -f TASK-QUEUE.md ]]; then
@@ -38,8 +63,20 @@ cat > .workflow/WORKFLOW-STATE.txt <<EOF
38
63
  — scope smoke001 $(date +%F)
39
64
  EOF
40
65
 
66
+ # spec: lifecycle-kit/SPEC.md §check-survey-record — file a real block off the seed commit so the
67
+ # gate's registration exercises its actual grammar + rev-existence assertions, not the absent-record
68
+ # inert pass (the optional-surface case that gate is designed never to redden on)
69
+ bash "$SMOKE_KIT_ROOT/bin/file-survey.sh" \
70
+ "smoke: does a freshly vendored install leave a survey record check-survey-record can parse" \
71
+ ".workflow/survey-record.md" \
72
+ "bash gate-sdk/bin/run-gates.sh --for .workflow/survey-record.md" \
73
+ "yes — a filed block naming the seed commit parses clean" >/dev/null
74
+
75
+ # spec: lifecycle-kit/README.md §Install — step 4 points the consumer's own always-loaded agent file at the machine; run it on the consumer, not only on a scratch copy, or check-lifecycle-registration has nothing to hold
76
+ bash "$SMOKE_KIT_ROOT/bin/install-lifecycle.sh" >/dev/null
77
+
41
78
  bash "$SDK/bin/gen-pre-commit.sh" --write >/dev/null
42
- bash "$SDK/checks/check-graph.sh" --emit > .workflow/CHECK-GRAPH.html
79
+ bash "$SDK/checks/check-graph.sh" --emit > scripts/CHECK-GRAPH.html
43
80
 
44
81
  # spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — exercise enter-stage end-to-end under .tmp (advisory tool, no fixture pair)
45
82
  es="$PWD/.tmp/enter-stage-smoke"
@@ -165,6 +202,48 @@ fi
165
202
  cmp -s "$es/s.before" "$ess" || { echo "smoke(enter-stage): --simulate wrote state" >&2; exit 1; }
166
203
  cmp -s "$es/q.before" "$esq" || { echo "smoke(enter-stage): --simulate wrote queue" >&2; exit 1; }
167
204
 
205
+ # spec: gate-sdk/SPEC.md §The bin/-tool contract — behavioral coverage, one member at a time: help on stdout at exit 0, an unrecognized leading '-' refused on stderr at exit 2, and the capture members' durable surface byte-unchanged after both (a test reading exit codes alone passes the bug)
206
+ av="$es/argv"; mkdir -p "$av"
207
+ printf '# contract: seeded\n- 2026-01-01 — a real bullet\n' > "$av/inbox.md"
208
+ printf '# contract: seeded\n\n## 2026-01-01 scope — a seeded survey\n- corpus: x\n- oracle: y\n- rev: z\n- finding: w\n' > "$av/record.md"
209
+ cp "$av/inbox.md" "$av/inbox.before"; cp "$av/record.md" "$av/record.before"
210
+
211
+ av_run() {
212
+ local tool="$1"; shift
213
+ env LIFECYCLE_KIT_GAP_INBOX_FILE="$av/inbox.md" \
214
+ LIFECYCLE_KIT_SURVEY_RECORD_FILE="$av/record.md" \
215
+ bash "$SMOKE_KIT_ROOT/bin/$tool" "$@"
216
+ }
217
+
218
+ for t in file-gap.sh file-survey.sh cite-survey.sh enter-stage.sh; do
219
+ out="$(av_run "$t" --help 2>/dev/null)" \
220
+ || { echo "smoke(argv): $t --help should exit 0" >&2; exit 1; }
221
+ grep -q '^usage: ' <<<"$out" \
222
+ || { echo "smoke(argv): $t --help wrote no usage to stdout: $out" >&2; exit 1; }
223
+ out="$(av_run "$t" -h 2>/dev/null)" || { echo "smoke(argv): $t -h should exit 0" >&2; exit 1; }
224
+ grep -q '^usage: ' <<<"$out" || { echo "smoke(argv): $t -h wrote no usage to stdout" >&2; exit 1; }
225
+ done
226
+
227
+ # spec: gate-sdk/SPEC.md §The bin/-tool contract — enter-stage is exempt from the refusal half (its positionals are membership-validated), the three free-text members are not; file-survey.sh's refusal scans every positional because four slots make arity no protection
228
+ for t in file-gap.sh file-survey.sh cite-survey.sh; do
229
+ rc=0; av_run "$t" --list >/dev/null 2>&1 || rc=$?
230
+ [[ "$rc" -eq 2 ]] || { echo "smoke(argv): $t refused --list with exit $rc, want 2" >&2; exit 1; }
231
+ so="$(av_run "$t" --list 2>/dev/null)" || true
232
+ [[ -z "$so" ]] || { echo "smoke(argv): $t wrote usage to stdout on a refusal: $so" >&2; exit 1; }
233
+ done
234
+ rc=0; av_run file-survey.sh q c o --finding >/dev/null 2>&1 || rc=$?
235
+ [[ "$rc" -eq 2 ]] || { echo "smoke(argv): file-survey.sh took a flag in its fourth slot (exit $rc)" >&2; exit 1; }
236
+
237
+ cmp -s "$av/inbox.before" "$av/inbox.md" \
238
+ || { echo "smoke(argv): file-gap.sh wrote the gap inbox on a help or refusal path" >&2; exit 1; }
239
+ cmp -s "$av/record.before" "$av/record.md" \
240
+ || { echo "smoke(argv): file-survey.sh wrote the survey record on a help or refusal path" >&2; exit 1; }
241
+
242
+ # spec: gate-sdk/SPEC.md §The bin/-tool contract — '--' ends option processing, so the refusal never makes a legitimate filing unfileable
243
+ av_run file-gap.sh -- "--list is captured at exit 0" >/dev/null
244
+ grep -q -- '— --list is captured at exit 0$' "$av/inbox.md" \
245
+ || { echo "smoke(argv): file-gap.sh -- did not file prose beginning with a dash" >&2; exit 1; }
246
+
168
247
  # spec: lifecycle-kit/SPEC.md §bin/install-lifecycle.sh — exercise the injector + check-lifecycle-registration end-to-end under .tmp (advisory tool, no fixture pair)
169
248
  il="$es/agent"; mkdir -p "$il"
170
249
  cat > "$il/CLAUDE.md" <<'EOF'
@@ -173,7 +252,7 @@ cat > "$il/CLAUDE.md" <<'EOF'
173
252
  Resident context the consumer keeps.
174
253
  EOF
175
254
  il_run() { LIFECYCLE_KIT_AGENT_FILE="$il/CLAUDE.md" bash "$SMOKE_KIT_ROOT/bin/install-lifecycle.sh" "$@"; }
176
- il_gate() { LIFECYCLE_KIT_AGENT_FILE="$il/CLAUDE.md" bash "$SMOKE_KIT_ROOT/checks/check-lifecycle-registration.sh" "$@"; }
255
+ il_gate() { ( export LIFECYCLE_KIT_AGENT_FILE="$il/CLAUDE.md"; kit_gate check-lifecycle-registration "$@" ); }
177
256
 
178
257
  il_run >/dev/null
179
258
  grep -q "<!-- lifecycle-kit:begin -->" "$il/CLAUDE.md" || { echo "smoke(install-lifecycle): block not injected" >&2; exit 1; }
@@ -194,14 +273,14 @@ printf '# Scratch agent file\n' > "$ma/CLAUDE.md"
194
273
  grep -q "^# lifecycle-kit:merge:begin\$" "$ma/.gitattributes" || { echo "smoke(install-lifecycle): merge-attribute block not injected into .gitattributes" >&2; exit 1; }
195
274
  grep -q "^\.workflow/WORKFLOW-STATE.txt merge=iteration-scoped\$" "$ma/.gitattributes" || { echo "smoke(install-lifecycle): state-file merge attribute missing" >&2; exit 1; }
196
275
  [[ "$(git -C "$ma" config --get merge.iteration-scoped.driver)" == "true" ]] || { echo "smoke(install-lifecycle): keep-ours driver not registered in git config" >&2; exit 1; }
197
- ( cd "$ma" && bash "$SMOKE_KIT_ROOT/checks/check-merge-attrs.sh" >/dev/null ) || { echo "smoke(install-lifecycle): a freshly installed .gitattributes should pass the parity gate" >&2; exit 1; }
276
+ ( cd "$ma" && kit_gate check-merge-attrs >/dev/null ) || { echo "smoke(install-lifecycle): a freshly installed .gitattributes should pass the parity gate" >&2; exit 1; }
198
277
 
199
278
  cp "$ma/.gitattributes" "$ma/before"
200
279
  ( cd "$ma" && bash "$SMOKE_KIT_ROOT/bin/install-lifecycle.sh" >/dev/null )
201
280
  cmp -s "$ma/before" "$ma/.gitattributes" || { echo "smoke(install-lifecycle): merge-attribute re-run was not idempotent" >&2; exit 1; }
202
281
 
203
282
  printf 'README.md merge=iteration-scoped\n' >> "$ma/.gitattributes" # smuggled reverse-edge line
204
- if ( cd "$ma" && bash "$SMOKE_KIT_ROOT/checks/check-merge-attrs.sh" >/dev/null 2>&1 ); then
283
+ if ( cd "$ma" && kit_gate check-merge-attrs >/dev/null 2>&1 ); then
205
284
  echo "smoke(install-lifecycle): a smuggled out-of-set merge attribute should redden the parity gate" >&2; exit 1
206
285
  fi
207
286
 
@@ -0,0 +1,73 @@
1
+ The `consult` skill — an operator strategy session whose conclusions leave the
2
+ transcript. Not an iteration stage: it invokes no `enter-stage.sh`, stamps no
3
+ `WORKFLOW-STATE.txt`, and holds no cursor, so it may run before an iteration
4
+ opens, between stages, or across an iteration boundary. Exit condition:
5
+ every ruling the operator closed in the session has landed in a governed
6
+ surface, every alternative refused along the way is recorded with the grounds it
7
+ was refused on, and every always-loaded surface those rulings stale is
8
+ corrected, flagged, or filed as work.
9
+
10
+ A consultation that ends with its rulings still in the transcript has not
11
+ exited. That is the failure this skill exists to stop — a strategy session whose
12
+ conclusions the next session re-derives from memory, or never recovers at all.
13
+
14
+ The write authority this skill leans on is **not** the skill's to grant: it
15
+ belongs to the ruling record itself, which states who may record a ruling there
16
+ and under what condition. What this skill adds on top of that authority is
17
+ **obligation**. Any session that closes a ruling with the operator is permitted
18
+ to record it; a consultation has not finished until it has.
19
+
20
+ ## Session ritual
21
+
22
+ 1. **Read in before proposing anything.** *<entry-reading: the surfaces a
23
+ consultation reads on entry — name paths, not topics. Typically the record of
24
+ closed direction, the work queue, and any context this consumer keeps outside
25
+ the tree; a consultation that skips the last of those re-opens what is
26
+ already settled.>*
27
+
28
+ 2. **Land each ruling the moment it closes, never at exit.** The landing target
29
+ is chosen by what the ruling is about, from *<landing-surfaces: the surfaces a
30
+ closed ruling may land on, each with the ruling class it takes — direction and
31
+ refusals, work items, and the contract surfaces a ruling about mechanism
32
+ belongs in. Say which one takes a ruling that fits none of them.>* Landing at
33
+ exit instead is the failure mode itself, one step later: a session that
34
+ batches its rulings to the end loses all of them together when it is
35
+ interrupted.
36
+
37
+ 3. **Record a refused alternative beside the ruling that refused it, with its
38
+ grounds.** A refusal recorded without grounds is re-proposed by the next
39
+ session at full cost; a refusal recorded with them is already costed when that
40
+ session reaches for it. Deletion is not disposition — an alternative weighed
41
+ and rejected is *kept*, marked as rejected.
42
+
43
+ 4. **Name what the rulings stale.** A ruling that contradicts an always-loaded
44
+ surface leaves that surface teaching the superseded shape to every later
45
+ session, at per-session cost. Correct it in the same session where the edit is
46
+ small and unambiguous; where it is neither, file it as work with the ruling
47
+ cited, so the correction is owed rather than remembered.
48
+
49
+ 5. **Journal in flight, and treat a held index as latency rather than loss.**
50
+ Durability is the obligation and this session discharges it by whichever means
51
+ is available — the rule and its two discharge paths are
52
+ `delegation-kit/templates/agent-execution.md`'s **Findings you will act on are
53
+ durable before you act on them** bullet, which reaches this session directly.
54
+ When another session holds the shared index, journal each ruling as it closes
55
+ and commit when the index frees. Waiting is safe only because the finding is
56
+ already durable; waiting without the journal is the transcript failure again,
57
+ wearing a different cause.
58
+
59
+ 6. **Dispatch by the delegation protocol, and select the tier every time.** The
60
+ protocol is `delegation-kit/templates/agent-execution.md`, cited and never
61
+ copied — a copy is a second tier of the same content, drifting from the day it
62
+ is written. Tier selection needs its own attention here: an unselected
63
+ dispatch inherits *this* session's tier, and a consultation runs at the
64
+ judgment tier while most of what it dispatches is read-only research, so an
65
+ unselected fan-out buys the most expensive tier for the cheapest work. Name
66
+ the tier in the dispatch, downward by default, and reserve the judgment tier
67
+ for a dispatch that actually rules.
68
+
69
+ The two named slots are where this consumer's own governance layout lives — what
70
+ a consultation reads, and where its rulings land. The kit ships the shape and
71
+ never the surfaces: a consultation has an entry read-set and an exit
72
+ landing-set, and every closed ruling reaches the landing set before the session
73
+ ends.