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
@@ -46,6 +46,10 @@ Knobs, this repo's surface names as defaults:
46
46
  - `EVIDENCE_KIT_BASELINE_FILE` (default `.workflow/validate-baseline.txt`),
47
47
  `EVIDENCE_KIT_MANIFEST_FILE` (default `.workflow/validate-evidence.txt`),
48
48
  `EVIDENCE_KIT_SKIP_FILE` (default `.workflow/validate-skips.txt`).
49
+ - `EVIDENCE_KIT_LOCK_FILE` — the producer-liveness lock (§The producer-liveness
50
+ lock), default `run-validate.lock` under `EVIDENCE_KIT_TMP_DIR`. It resolves
51
+ *through* the scratch knob rather than beside it, so a consumer that moves the
52
+ scratch dir moves the lock with it and never has to keep two paths in step.
49
53
  - `EVIDENCE_KIT_QUEUE_FILE` / `EVIDENCE_KIT_STATE_FILE` — the lifecycle surfaces
50
54
  read for the manifest's optional close-entry and stamp-coupling assertions;
51
55
  they default through gate-sdk's `GATE_SDK_QUEUE_FILE` / `GATE_SDK_WORKFLOW_DIR`.
@@ -55,15 +59,26 @@ Knobs, this repo's surface names as defaults:
55
59
  regen, container teardown) kept on the consumer side of the spine.
56
60
  - `EVIDENCE_KIT_PERMANENT_SLUGS` — blocking slugs that satisfy baseline liveness
57
61
  without a live queue task.
62
+ - `EVIDENCE_KIT_RUNNER_DOC` (default `README.md`, resolved against the git
63
+ toplevel) — the doc whose battery-roster block `check-battery-roster` holds
64
+ against the suite roster. It is gate-local: nothing in the validate run path
65
+ reads it, so the loader fills no default for it and the gate carries its own.
66
+ The name mirrors gate-sdk's `GATE_SDK_RUNNER_DOC` deliberately — in a tree
67
+ vendoring both kits the two name the same physical doc for two different
68
+ assertions, and a reader who has met one should not have to learn a second
69
+ vocabulary for the other.
58
70
 
59
71
  ## Per-component contracts
60
72
 
61
73
  ### lib/evidence.sh
62
74
 
63
75
  The sourced config loader: consumer config first, kit defaults fill what it
64
- left unset, then validation. It also owns the shared adapters — `ek_parse` (the
76
+ left unset, then validation. It also owns the shared adapters — `ek_suite_cmd`
77
+ (a suite's configured run command, `EVIDENCE_KIT_RUN_<suite>`), `ek_parser_for`
78
+ (the per-suite parser resolution, detailed below), `ek_parse` (the
65
79
  parser dispatch), `ek_diff` (the per-scenario baseline diff, §bin/diff-baseline.sh),
66
- `ek_data_lines`, and the self-contained `ek_queue_iteration` / `ek_run_key`
80
+ `ek_data_lines`, the `ek_pid_alive` / `ek_lock_read` lock adapters
81
+ (§The producer-liveness lock), and the self-contained `ek_queue_iteration` / `ek_run_key`
67
82
  header readers plus the `ek_state_stage` cursor reader that let the kit read
68
83
  lifecycle state without a lifecycle-kit dependency. The two axes come from two
69
84
  surfaces: the queue header names the iteration, the state file's **last data
@@ -130,16 +145,40 @@ absent from the baseline falls under the classification-cost rule.
130
145
 
131
146
  ### Evidence manifest
132
147
 
133
- Committed, append-per-run. The file header is a `# contract: evidence-manifest v1`
148
+ Committed, written once per run. The file header is a `# contract: evidence-manifest v1`
134
149
  line — the versioned wire format the deferred hosted-attestation service consumes
135
150
  as its attestation payload. Each data line is
136
151
  `<iteration> <suite> sha256=<log-hash> pass=<n> fail=<n> ignore=<n>
137
- verdict=<clean|new-failures> <date>`, and a re-run of a suite within the same
138
- iteration supersedes that iteration's prior line for the suite. The captured log
152
+ verdict=<clean|new-failures> <date>`, and a run supersedes that iteration's
153
+ prior line for every suite it ran. The captured log
139
154
  stays uncommitted under the tmp dir; its digest pins which run produced the
140
155
  counts. The iteration key scopes the line so the boundary-truncate knob can
141
156
  clear the manifest at the start of the next iteration.
142
157
 
158
+ **The spine touches this file only after its last suite has run**, and that is
159
+ contract rather than implementation detail. `run-validate` accumulates its rows
160
+ under the tmp dir and folds them in as a single write, dropping this iteration's
161
+ prior line for each suite the run covered and re-appending the batch in
162
+ configured-suite order.
163
+
164
+ What that buys is a suite free to sit anywhere in the roster even when its own
165
+ precondition is a clean worktree. A spine writing per suite dirties the tree
166
+ before such a suite's turn, so every full run reddens it for no reason but
167
+ roster position — a collision the writer manufactures and no suite can defend
168
+ itself against. Pinning it to the front of the roster is mitigation, not a fix:
169
+ nothing asserts the position, so a second such suite re-breaks it silently.
170
+ Under one fold nothing pins any suite anywhere.
171
+
172
+ Line order follows the configured roster rather than run history, so a repeat
173
+ run rewrites this iteration's rows where they already were instead of relocating
174
+ each to the end — a run whose counts and date are unchanged leaves the file
175
+ byte-identical, and a concurrent or repeated producer stops surfacing as a diff
176
+ with no content behind it. An aborted run writes nothing: it leaves the manifest
177
+ as it found it, which is what the abort's own diagnostic already claims. The
178
+ partial manifest that used to survive such an abort was never admissible anyway —
179
+ §check-evidence-manifest's close-entry assertion wants a clean line for every
180
+ configured suite.
181
+
143
182
  The header is a wire-format version marker, not a doc pointer —
144
183
  gate-sdk/SPEC.md §The workflow directory rules that as one of the two payload
145
184
  forms a checked projection may carry, and this section is the statement that
@@ -149,15 +188,155 @@ form requires. `check-evidence-manifest` owns it (asserts the first line is
149
188
  (`CANON_KIT_COMMENT_WHITELIST`), since a version marker resolves as no path; the
150
189
  baseline is pointer-form and needs no whitelist entry.
151
190
 
191
+ ### The producer-liveness lock
192
+
193
+ Uncommitted, under `EVIDENCE_KIT_LOCK_FILE`. A stage stamp proves invocation and
194
+ an evidence line proves a green result, but neither can say a producer is *still
195
+ running* — a file read at an instant cannot carry that, and the manifest's own
196
+ guarantees do not reach it: §check-evidence-manifest's assertion A already
197
+ asserts suite-roster completeness at a close cursor, and the spine's single fold
198
+ means a torn read is unreachable. The gap is liveness alone, and the lock is the
199
+ artifact that closes it.
200
+
201
+ The record is one line, `pid=<n> run=<key>`, where `<key>` is the evidence-line
202
+ key `ek_run_key` yields. Both fields have named readers and nothing else is
203
+ carried: a start timestamp was considered and removed, because once the stale
204
+ policy is PID-liveness rather than age it has no reader, and a field with no
205
+ reader is removed rather than kept for plausibility.
206
+
207
+ **The lock is held if and only if the recorded PID is alive**, which makes a
208
+ leaked lock self-invalidating — the shape this methodology already relies on for
209
+ the session-role marker, whose id match means a stale marker self-invalidates.
210
+ An **age-based TTL is rejected outright**: a long validate run outlives any
211
+ honest TTL, and a long run is precisely the case the lock exists for, so a TTL
212
+ tuned short enough to reclaim a crashed run promptly is guaranteed to declare a
213
+ healthy long run dead — restoring the false-green the lock removes.
214
+
215
+ `ek_pid_alive` is the one predicate all three readers share, and its two legs are
216
+ a ruling rather than belt-and-braces. `kill -0` is the cheap same-uid answer, but
217
+ it conflates *no such process* with *not yours*: against a producer running under
218
+ another uid it reports the live process as dead, which is a false **free**
219
+ reading — the one direction this design may not take. `ps -p` answers existence
220
+ without needing the permission to signal, so it runs as the fallback and any
221
+ evidence of existence means held. Reading `/proc` to confirm process *identity*
222
+ is rejected separately: it is unportable, and the OS-reach objective makes a
223
+ Linux-only predicate a cost rather than a refinement.
224
+
225
+ **PID reuse is a named, accepted residual.** A recycled PID yields a false
226
+ *held* reading, which refuses a stage entry that could have proceeded — a
227
+ fail-closed direction costing one file deletion to clear, against a defect that
228
+ would otherwise cost the next session an evidence file changing underneath it.
229
+ The same direction reaches the writer's own refusal, which reads the identical
230
+ predicate: a recycled PID makes `run-validate` over-refuse by the same
231
+ mechanism. One cause, one direction, one clearance — a restated instance of the
232
+ residual, not a second one to weigh.
233
+
234
+ **The claim is atomic create-exclusive, never check-then-write**, and the
235
+ asserted property is two-part: it succeeds for exactly one producer, *and* the
236
+ record publishes whole. The idiom is the one the spine already uses to publish
237
+ the manifest — build the record in a temp file under the same scratch dir, then
238
+ `ln` it into place, which fails if the target exists. `mkdir` and a `set -C`
239
+ redirect are atomic on the first half only: each leaves a window where the lock
240
+ exists and its record does not, which every reader would then have to parse
241
+ around. Because the record publishes whole, a reader never has to interpret a
242
+ partial lock or decide what an empty one means, so an unparseable lock is
243
+ corruption and fails closed rather than reading free.
244
+
245
+ The atomicity is *required* rather than careful, and what makes it so is the
246
+ writer-side refusal (§bin/run-validate.sh). An unconditional claim has no
247
+ predicate and so no time-of-check window; adding the refusal adds one, and a
248
+ naive read-then-claim would let two producers both observe a clear lock and both
249
+ claim, the second's record overwriting the first's. That reintroduces exactly
250
+ the two-producer case the refusal exists to close, and defeats conditional
251
+ release with it — "still ours" cannot be answered from a record another producer
252
+ overwrote. The claim's success *is* the check, so there is no interval between
253
+ them to lose.
254
+
255
+ **The release is conditional — remove only if the lock is still ours.** The
256
+ `EXIT` trap compares the recorded PID against the running shell's and removes
257
+ nothing on a mismatch. An unconditional `rm -f` reproduces this artifact's own
258
+ defect inside its own mechanism: the lock is single-holder, so with an
259
+ unconditional claim *and* an unconditional release whichever producer exits
260
+ first deletes the survivor's lock, after which a preflight reads free with a
261
+ producer still live. Atomicity does not make the condition redundant, and the
262
+ residual it closes is **not** the `EXIT`-trap race it first suggests: a trap runs
263
+ synchronously as part of its process's own exit and completes before that
264
+ process reads as dead, and the one exception — `SIGKILL` — skips the trap
265
+ entirely rather than deferring it. So a producer correctly identified as stale
266
+ cannot later run its trap. The case that remains is a lock removed by some path
267
+ *other than* the reclaim below — an operator deleting an apparently-stuck lock,
268
+ or a future code path: producer A is still alive and unaware, producer B claims
269
+ the freed slot, and A's unconditional release would delete B's live lock.
270
+ Atomicity is what makes "still ours" *answerable*; conditional release is what
271
+ acts on the answer.
272
+
273
+ The reclaim path a runtime artifact owes is three layers, and all three are
274
+ asserted: the `EXIT` trap, which covers every exit path the spine has; the
275
+ readers' PID-liveness predicate, which makes a leaked file inert; and the
276
+ consumer's scratch-boundary wipe, which removes it. No close-surface declaration
277
+ is owed — that obligation attaches to capture-tier members of the workflow
278
+ directory, and this lock lives in the scratch tier.
279
+
280
+ **evidence-kit owns the lock at both ends; lifecycle-kit contributes only the
281
+ hook it already ships.** The lock is a property of the *producer's run*, and this
282
+ kit owns the producer and the scratch directory it lives under. The reader need
283
+ not live in lifecycle-kit: `LIFECYCLE_KIT_ENTRY_PREFLIGHT` is already a generic
284
+ per-stage hook naming no evidence surface, so a second evidence-kit gate on that
285
+ roster adds no new cross-kit dependency at all — the consumer wires it exactly as
286
+ it already wires the manifest gate (§lifecycle-kit integration). The rejected
287
+ alternative is worth recording: a lock held by lifecycle-kit would force that kit
288
+ to know this one's scratch knob — a downward dependency onto one specific
289
+ producer kit — and would generalize wrongly, since lifecycle-kit would then have
290
+ to model every possible producer's lock rather than one hook any producer's gate
291
+ can hang from.
292
+
152
293
  ### bin/run-validate.sh
153
294
 
154
- The codified spine: the optional per-suite pre-hook, then each suite run
295
+ The codified spine, bounded by the producer-liveness lock: the guards, the
296
+ claim, then the optional per-suite pre-hook and each suite run
155
297
  foreground, parsed, diffed against the baseline's suite slice per-scenario, and
156
- recorded as one appended evidence line whose verdict is `clean` unless the diff
157
- finds a new failure. It never edits the baseline, never retries, and surfaces a
298
+ recorded as one evidence line whose verdict is `clean` unless the diff
299
+ finds a new failure. The lines batch under the tmp dir and reach the manifest in
300
+ the single fold §Evidence manifest rules, so a suite never runs against a tree
301
+ the spine has already written to. It never edits the baseline, never retries, and surfaces a
158
302
  non-zero suite exit verbatim. A log with no parseable result is a run failure,
159
- not an empty diff. Its own exit is non-zero when any suite records
160
- `new-failures`. Not a gate — a `bin/` tool exercised end-to-end in `smoke/`.
303
+ not an empty diff. Not a gate — a `bin/` tool exercised end-to-end in `smoke/`,
304
+ with the lock's own behavior pinned by `gate-tests/producer-lock.test.sh`.
305
+
306
+ **The claim's placement is asserted, not left to the implementer**: after the
307
+ preflight guards and the scratch `mkdir` — a run that refuses to start must not
308
+ claim — and before the batch file is created, so no evidence work happens
309
+ outside the lock's cover. Release is the `EXIT` trap, conditional on the record
310
+ still being ours (§The producer-liveness lock owns both properties and the
311
+ reasons they are load-bearing). A trap rather than a tail line, because the
312
+ script exits from many guard and fail-closed sites besides its terminal exit, and
313
+ a tail-line release would leak the lock on every failure path — the population
314
+ that matters most, since a crashed run is exactly when a stale lock appears. The
315
+ idiom precedent is `lifecycle-kit/bin/enter-stage.sh`, which claims temp files
316
+ under a scratch dir with an `EXIT` trap.
317
+
318
+ **It refuses to start while a live lock is held**, and the refusal falls out of
319
+ the atomic claim rather than being a second mechanism: the claim either succeeds
320
+ — in which case no holder existed — or fails, and the failure branch is the
321
+ refusal. On a failed claim it reads the existing lock; a **live** PID refuses
322
+ immediately, naming the blocking run key, with no reclaim attempted. A **dead**
323
+ PID (or a lock that has vanished since the claim failed) is reclaimed by removing
324
+ the lock and retrying **exactly once**; a second failure refuses rather than
325
+ looping, which resolves the two-contender stale case without an unbounded retry —
326
+ both contenders may remove and relink, exactly one `ln` succeeds, and the loser's
327
+ re-read finds a live PID. A lock that does not parse refuses outright.
328
+
329
+ This is why the tool has **two** non-zero exits with different meanings: exit 1
330
+ when a suite records `new-failures` — the verdict — and the guards' exit 2 when
331
+ the run cannot start at all, which a held or unclaimable lock now joins. The
332
+ refusal is a start-time verdict about the world, not a result, so it takes the
333
+ guards' code and not the verdict's.
334
+
335
+ The reason a producer that never enters a stage is worth guarding is that the
336
+ entry-side reader cannot see it: a session can run this tool without entering a
337
+ stage, so an entry-side red alone would leave two producers able to race the
338
+ manifest with every stage entry green. A lock the producer itself does not check
339
+ is not a mutex.
161
340
 
162
341
  ### bin/diff-baseline.sh
163
342
 
@@ -206,6 +385,119 @@ Argument mode `$1 $2 $3` (manifest, queue, state) makes it fixture-capable; the
206
385
  close-entry and stamp-coupling assertions are covered by
207
386
  `gate-tests/check-evidence-manifest.test.sh`.
208
387
 
388
+ ### check-battery-roster
389
+
390
+ Invariant: the configured runner doc's battery-roster block holds name-set
391
+ parity with `EVIDENCE_KIT_SUITES`, both directions. The suite roster is
392
+ machine-owned and the doc block is a hand copy of it — the
393
+ `check-readme-roster` fork (gate-sdk/SPEC.md §check-readme-roster) applied to
394
+ the validate battery: the register stays a human-read list carrying per-line
395
+ annotation prose an emitter would have to invent, and a gate holds it honest
396
+ rather than generating it.
397
+
398
+ Marker vocabulary follows that gate verbatim in shape: the doc wraps its
399
+ register in `<!-- battery-roster:begin -->` / `<!-- battery-roster:end -->`
400
+ markers, which may carry leading indentation (the scan trims surrounding
401
+ whitespace before matching, since a README nests the block inside a list item).
402
+ Inside the markers a **roster line** is a line whose content begins with a bare
403
+ lowercase command word (`bash …`, `cargo …`) — the interpreter is not part of
404
+ the grammar, so a suite whose runner is not a shell script is rosterable without
405
+ widening a literal each time; the fenced-block delimiters and any prose fail the
406
+ match by not starting with a lowercase letter. A trailing `#` annotation clause
407
+ is prose the gate never reads.
408
+ Outside the markers nothing is scanned, so the same command appearing elsewhere
409
+ in the doc for a different rhetorical job neither satisfies nor violates the
410
+ gate — which is why the block, not the whole doc, is the unit.
411
+
412
+ A suite's **documented invocation** is `EVIDENCE_KIT_RUN_<suite>` normalized by
413
+ stripping a leading `env` token and any leading `VAR=value` assignments, with
414
+ or without that token: the run environment is a validate-harness concern (this
415
+ repo's `gates` suite runs under gate-sdk's `GATE_SDK_VERBOSE` knob, whose value
416
+ that kit's SPEC owns, to emit the per-gate tails its parser reads) and not
417
+ something a contributor types. What remains is
418
+ compared as an exact string, whitespace-collapsed on both sides so the block's
419
+ annotation alignment carries no meaning.
420
+
421
+ Two assertions over the suite set versus the roster set:
422
+
423
+ - **(A) every suite is documented** — a member of `EVIDENCE_KIT_SUITES` whose
424
+ normalized invocation matches no roster line is red;
425
+ - **(B) every roster line resolves to a suite** — a roster line whose command
426
+ matches no suite's normalized invocation is red, so a retired suite cannot
427
+ leave a stale line telling a contributor to run a command that is not a
428
+ configured suite.
429
+
430
+ Each finding names the suite (A) or the command and its line (B), and the doc.
431
+ A suite with no `EVIDENCE_KIT_RUN_<suite>` configured has no documented
432
+ invocation to compare and is passed over: `bin/run-validate.sh` already exits 2
433
+ on it, and reporting it here would send the reader to the doc to fix a config
434
+ bug.
435
+
436
+ The overlap with `check-kit-registration` assertion B (gate-sdk/SPEC.md
437
+ §check-kit-registration) is deliberate. That assertion requires every kit root
438
+ with tracked `gate-tests/` files to have a runner-doc line naming
439
+ `<kit>/gate-tests`; because this repo's config derives exactly those roots into
440
+ `EVIDENCE_KIT_SUITES` through `gate_fixture_suites`, assertion (A) here is a
441
+ superset of that arm for a consumer running both kits. It is kept rather than
442
+ retired on a dependency direction: a gate-sdk gate may not require this kit's
443
+ config — gate-sdk's `bin/enforcement-map.sh` reads the suite roster where a
444
+ consumer has one, but an assertion cannot, having no honest verdict when it is
445
+ absent. So B is the arm that survives a gate-sdk-only adoption, which is the
446
+ more common shape. Both sections say so, each naming the other, so the next
447
+ reader who notices the redundancy finds the reason instead of re-deriving it.
448
+ One omission reported from both sides is a duplicate finding, not a
449
+ contradiction — the two name different sets (a kit root, a suite) in their
450
+ output.
451
+
452
+ Config: `EVIDENCE_KIT_RUNNER_DOC` (§Layout and configuration); positional form
453
+ `check-battery-roster.sh [runner-doc]` overrides it against a hermetic fixture
454
+ tree, the sibling meta-gates' shape. Fail-closed: a configured doc that does not
455
+ exist, a doc carrying no marker block, an empty suite roster, or a non-repo cwd
456
+ with no positional argument is a misconfiguration (exit 2), never a false clean.
457
+ There is no empty-knob valve — a consumer keeping no runner doc opts out by not
458
+ registering the gate in its `gates.list`, gate-sdk's registry opt-out shape. The
459
+ fail-closed branches and the normalization arms beyond the one good/bad pair are
460
+ covered by `gate-tests/check-battery-roster.test.sh`.
461
+
462
+ ### check-producer-liveness
463
+
464
+ Invariant: no stage entry while the evidence producer is still running. It reads
465
+ `EVIDENCE_KIT_LOCK_FILE` and is green when the lock is absent or names a dead
466
+ PID, red when it names a live one — printing the blocking run key, so the
467
+ operator can tell *wait for that run* from *reclaim a lock whose owner is gone*.
468
+ A lock that does not parse is exit 2: the claim publishes the record whole
469
+ (§The producer-liveness lock), so an unparseable lock is corruption and never a
470
+ free reading.
471
+
472
+ This is a new gate rather than a fourth assertion on `check-evidence-manifest`,
473
+ because that gate's charter is manifest *content* — the close-entry green block,
474
+ the grammar, the stamp coupling — and liveness is a different class. A separate
475
+ gate also earns its own fixture pair instead of widening an existing gate's
476
+ charter.
477
+
478
+ Argument mode `check-producer-liveness.sh [lock-file]` makes it fixture-capable
479
+ and is how the entry hook points it at the lock (§lifecycle-kit integration);
480
+ extra arguments are ignored, so the hook's trailing `<queue> <state>` argv passes
481
+ through harmlessly.
482
+
483
+ **It belongs on the entry hook and not in a `gates.list` battery**, and the
484
+ reason is structural rather than a matter of taste. Its subject is a transition —
485
+ *is a producer in flight right now* — where every battery member's subject is
486
+ tree state. A consumer whose validate roster includes its own gate battery (this
487
+ repo's does: the `gates` suite *is* the battery) would have `run-validate` invoke
488
+ this gate while holding the lock it just claimed, reddening every validate run
489
+ against its own record. The kit therefore ships the gate registered nowhere and
490
+ wired at the entry, which is also the honest reading of its argument mode: it
491
+ takes the lock path because its caller is a stage entry, not a whole-tree sweep.
492
+
493
+ The fixture pair carries the two static verdicts — a dead PID and a live one.
494
+ Its `bad/` case names PID 1, the one PID a checked-in fixture can assert the
495
+ liveness of on every platform, which is exactly what `ek_pid_alive`'s `ps -p`
496
+ leg makes reliable: under `kill -0` alone, an unprivileged run reads init as
497
+ dead and the case would silently invert. Everything the pair cannot hold — a
498
+ live PID the test itself owns, the unparseable-lock exit, and the writer-side
499
+ behavior — is covered by `gate-tests/producer-lock.test.sh`.
500
+
209
501
  ## lifecycle-kit integration
210
502
 
211
503
  Integration is two generic knobs on lifecycle-kit's side of the seam, each
@@ -219,19 +511,43 @@ iteration starts with a manifest carrying only its contract header — which is
219
511
  what makes assertion (B)'s foreign-iteration test able to catch a skipped
220
512
  truncation.
221
513
 
222
- `LIFECYCLE_KIT_ENTRY_PREFLIGHT` runs this gate as a close-entry pre-flight: a
223
- consumer sets `close=…/check-evidence-manifest.sh <manifest>`, and
224
- `bin/enter-stage.sh` runs it against the candidate temp state file (the
225
- prospective close stamp appended) and the live queue, so assertion (A)'s
226
- close-entry green-block check fires *before* the stamp is
227
- written — the missing evidence becomes a refusal at the entry (pointing at
228
- run-validate) instead of a self-referential deadlock at pre-commit, where the
514
+ `LIFECYCLE_KIT_ENTRY_PREFLIGHT` carries **both** of this kit's entry-side gates,
515
+ at three stage keys between them. `bin/enter-stage.sh` runs each matching entry
516
+ against the candidate temp state file (the prospective stamp appended) and the
517
+ live queue, appending that `<queue> <state>` argv to whatever the entry names, and
518
+ a non-zero exit refuses the entry with nothing written.
519
+
520
+ `check-evidence-manifest` is wired at `close=`, its command naming the manifest
521
+ (`close=…/check-evidence-manifest.sh <manifest>`),
522
+ so assertion (A)'s close-entry green-block check fires *before* the
523
+ stamp is written — the missing evidence becomes a refusal at the entry (pointing
524
+ at run-validate) instead of a self-referential deadlock at pre-commit, where the
229
525
  `gates` suite that would produce the evidence re-runs this same red gate
230
526
  against the already-stamped cursor. Belt-and-braces behind the validate
231
527
  skill's run-validate wiring, not a replacement for it; for a consumer that
232
528
  wires it, assertion (A)'s enforcement point moves one step earlier, from
233
529
  commit to entry.
234
530
 
531
+ `check-producer-liveness` is wired at `close=` **and** `validate=`
532
+ (`<stage>=…/check-producer-liveness.sh <lock-file>`). `close=` is the case the
533
+ gate was filed for — a lead dispatching close into a still-running producer.
534
+ `validate=` is added because this roster is an exact per-stage match, and a
535
+ second validate batch entering while a first batch's `run-validate` is live is
536
+ the same hazard with a worse outcome: two producers folding the same manifest.
537
+ Which keys a consumer wires is config, not asserted kit behavior — a consumer
538
+ whose producer runs at another stage wires its own.
539
+
540
+ The **read-only `--simulate` mode inherits this gate with no extra wiring**, and
541
+ that is the highest-value consumer rather than a bookkeeping detail: it runs
542
+ every matching preflight entry, so a lead gating an expensive dispatch with a
543
+ simulated entry stops being blind to a live producer. It does **not** make a
544
+ dispatch rule redundant, and the boundary has to be stated or the pair reads as
545
+ over-built: a simulated entry remains an instantaneous read, so a producer that
546
+ starts a second later is still unseen, and the gate covers only producers that
547
+ claim this lock. A lead dispatching on artifact state is still dispatching on
548
+ artifact state — it merely has one more artifact. A dispatch rule governs what
549
+ the lead waits *for*; this gate narrows what survives being wrong about it.
550
+
235
551
  The validate stage records evidence on a commit later than the entry stamp
236
552
  (assertion C's re-arm scoping): the stamp proves invocation at entry, the
237
553
  evidence line proves the green result once the suites have run.
@@ -243,6 +559,28 @@ evidence line proves the green result once the suites have run.
243
559
  forward, by the hosted-attestation payload. Every field has a reader there:
244
560
  iteration (A/C scoping), suite + verdict + counts (A's green-block test),
245
561
  sha256 (audit pinning of the producing log), date (A's stamp-ordering floor).
562
+ - **Suite roster** (`EVIDENCE_KIT_SUITES` + `EVIDENCE_KIT_RUN_<suite>`) —
563
+ produced by consumer config, wholly or in part derived there; consumed by
564
+ `run-validate.sh` (what to run), by `check-evidence-manifest` (A's green
565
+ block), by `check-battery-roster` (the doc-parity compare), and — behind a
566
+ `declare -p` probe, so evidence-kit stays optional — by gate-sdk's
567
+ `bin/enforcement-map.sh`. Every one of them reads it by sourcing the config
568
+ through the loader rather than parsing the file, so a suite a derivation loop
569
+ adds is visible to all of them with no second parse to keep in step.
570
+ - **Producer-liveness lock** — produced by `run-validate.sh` at the claim point,
571
+ which sits on the ordinary path (the validate stage runs it, and it is the only
572
+ writer of the manifest); its enabling config carries a default in the loader, so
573
+ it resolves in every deployed configuration rather than only under a test
574
+ harness. Consumed by `check-producer-liveness` through the entry-preflight hook
575
+ and, inheriting it with no extra wiring, by that hook's read-only simulate mode.
576
+ Both fields have named readers at named transitions: `pid` at three — the gate
577
+ at the stage-entry transition, `run-validate` at run start on a failed claim
578
+ (the refusal), and its `EXIT` trap at release, compared against the running
579
+ shell to answer *is this still ours*; `run key` at the two transitions where a
580
+ refusal line is composed, whose reader is the operator standing at that refusal
581
+ choosing between waiting and reclaiming. Reclaimed by the `EXIT` trap, by the
582
+ readers' liveness predicate making a leak inert, and by the consumer's
583
+ scratch-boundary wipe.
246
584
  - **Baseline line** — produced by human commits (initial seed, promotions);
247
585
  consumed by `diff-baseline.sh` (the per-scenario diff) and
248
586
  `check-evidence-baseline` (grammar, liveness, coverage).
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # spec: evidence-kit/SPEC.md §bin/run-validate.sh — the codified validate spine: optional pre-hook, run each suite foreground, parse, diff the baseline slice per-scenario, append the evidence line. Never edits the baseline, never retries, surfaces a non-zero suite verbatim.
2
+ # spec: evidence-kit/SPEC.md §bin/run-validate.sh — the codified validate spine: optional pre-hook, run each suite foreground, parse, diff the baseline slice per-scenario, batch the evidence lines and fold them into the manifest once the whole roster has run. Never edits the baseline, never retries, surfaces a non-zero suite verbatim.
3
3
  set -uo pipefail
4
4
 
5
5
  KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
@@ -26,6 +26,44 @@ mkdir -p "$EVIDENCE_KIT_TMP_DIR"
26
26
  today="$(date +%F)"
27
27
  overall=0
28
28
 
29
+ # spec: evidence-kit/SPEC.md §The producer-liveness lock — release only if the lock is still ours: an out-of-band removal lets a second producer claim the freed slot, and an unconditional rm would delete that live holder's record
30
+ lock_release() {
31
+ local holder
32
+ holder="$(ek_lock_read "$EVIDENCE_KIT_LOCK_FILE")" || return 0
33
+ [[ "${holder%% *}" == "$$" ]] && rm -f "$EVIDENCE_KIT_LOCK_FILE"
34
+ return 0
35
+ }
36
+
37
+ lock_refuse() {
38
+ rm -f "$lock_tmp"
39
+ echo "run-validate: $1" >&2
40
+ exit 2
41
+ }
42
+
43
+ # spec: evidence-kit/SPEC.md §The producer-liveness lock — the claim sits after the guards and the scratch mkdir (a run that refuses to start must not claim) and before any evidence work; the record is built whole in a temp file and `ln`ed into place, so the claim is create-exclusive and the lock is never half-written
44
+ lock_tmp="$(mktemp "$EVIDENCE_KIT_TMP_DIR/run-validate-lock.XXXXXX")" || exit 2
45
+ printf 'pid=%s run=%s\n' "$$" "$key" >"$lock_tmp"
46
+ reclaimed=0
47
+ while ! ln "$lock_tmp" "$EVIDENCE_KIT_LOCK_FILE" 2>/dev/null; do
48
+ holder="$(ek_lock_read "$EVIDENCE_KIT_LOCK_FILE")"; hs=$?
49
+ if [[ "$hs" -eq 2 ]]; then
50
+ lock_refuse "the lock $EVIDENCE_KIT_LOCK_FILE carries no readable 'pid=<n> run=<key>' record — refusing to start; delete it if no producer is running"
51
+ fi
52
+ if [[ "$hs" -eq 0 ]] && ek_pid_alive "${holder%% *}"; then
53
+ lock_refuse "a producer is already running for run key '${holder#* }' (pid ${holder%% *}) — refusing to start; wait for that run to finish, or delete $EVIDENCE_KIT_LOCK_FILE once pid ${holder%% *} is gone"
54
+ fi
55
+ # spec: evidence-kit/SPEC.md §The producer-liveness lock — a dead or vanished holder is reclaimed exactly once; a second failed claim means the slot is not ours to take, so refusing beats looping
56
+ [[ "$reclaimed" -eq 0 ]] \
57
+ || lock_refuse "could not claim $EVIDENCE_KIT_LOCK_FILE after reclaiming a stale lock — refusing to start rather than retrying; another producer won the reclaim race, or that path is not writable"
58
+ reclaimed=1
59
+ rm -f "$EVIDENCE_KIT_LOCK_FILE"
60
+ done
61
+ rm -f "$lock_tmp"
62
+ trap lock_release EXIT
63
+
64
+ # spec: evidence-kit/SPEC.md §Evidence manifest — the run accumulates its rows here and touches the tracked manifest only after the last suite, so no suite runs against a tree the spine has already written to
65
+ batch="$(mktemp "$EVIDENCE_KIT_TMP_DIR/validate-evidence-batch.XXXXXX")" || exit 2
66
+
29
67
  for suite in "${EVIDENCE_KIT_SUITES[@]}"; do
30
68
  cmd="$(ek_suite_cmd "$suite")"
31
69
  if [[ -z "$cmd" ]]; then
@@ -67,16 +105,20 @@ for suite in "${EVIDENCE_KIT_SUITES[@]}"; do
67
105
 
68
106
  hash="$(sha256sum "$log" | awk '{print $1}')"; hs=$?
69
107
  fail_closed "$hs" run-validate sha256sum
70
- line="$key $suite sha256=$hash pass=$npass fail=$nfail ignore=$nignore verdict=$verdict $today"
71
-
72
- # spec: evidence-kit/SPEC.md §Evidence manifest — a re-run supersedes this iteration's prior line for the suite, then appends
73
- tmpm="$EVIDENCE_KIT_TMP_DIR/validate-evidence.$$"
74
- awk -v k="$key" -v s="$suite" '!($1 == k && $2 == s)' "$manifest" >"$tmpm"; as=$?
75
- fail_closed "$as" run-validate awk
76
- printf '%s\n' "$line" >>"$tmpm"
77
- mv "$tmpm" "$manifest"
108
+ printf '%s\n' "$key $suite sha256=$hash pass=$npass fail=$nfail ignore=$nignore verdict=$verdict $today" >>"$batch"
78
109
 
79
110
  echo "run-validate: $suite -> $verdict (pass=$npass fail=$nfail ignore=$nignore)"
80
111
  done
81
112
 
113
+ # spec: evidence-kit/SPEC.md §Evidence manifest — one fold, after the last suite: this iteration's prior line for every suite the run covered is superseded and the batch re-appended in roster order, so a repeated run leaves the line order unchanged
114
+ tmpm="$EVIDENCE_KIT_TMP_DIR/validate-evidence.$$"
115
+ awk -v k="$key" -v bf="$batch" '
116
+ FILENAME == bf { superseded[$2] = 1; next }
117
+ !($1 == k && ($2 in superseded))
118
+ ' "$batch" "$manifest" >"$tmpm"; as=$?
119
+ fail_closed "$as" run-validate awk
120
+ cat "$batch" >>"$tmpm"
121
+ mv "$tmpm" "$manifest"
122
+ rm -f "$batch"
123
+
82
124
  exit "$overall"
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env bash
2
+ # graph: couples=README.md,scripts/evidence-config.sh,gate-sdk/lib/gate.sh dir=bi valve=none tier=precommit
3
+ # install: on-surface
4
+ # spec: evidence-kit/SPEC.md §check-battery-roster — the runner doc's battery-roster block holds name-set parity with EVIDENCE_KIT_SUITES, both directions
5
+ #
6
+ # usage: check-battery-roster.sh [runner-doc]
7
+ # bare: EVIDENCE_KIT_RUNNER_DOC (default README.md) against the git toplevel;
8
+ # positional: taken as given, so a fixture tree can be pointed at.
9
+ set -uo pipefail
10
+
11
+ KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
12
+ # shellcheck source=../lib/evidence.sh
13
+ source "$KIT/lib/evidence.sh"
14
+
15
+ BEGIN="<!-- battery-roster:begin -->"
16
+ END="<!-- battery-roster:end -->"
17
+
18
+ DOC="${1:-}"
19
+ if [[ -z "$DOC" ]]; then
20
+ top="$(git rev-parse --show-toplevel)" \
21
+ || { echo "check-battery-roster: not a git repository and no runner-doc argument" >&2; exit 2; }
22
+ DOC="$top/${EVIDENCE_KIT_RUNNER_DOC:-README.md}"
23
+ fi
24
+ [[ -f "$DOC" ]] || { echo "check-battery-roster: runner doc not found: $DOC" >&2; exit 2; }
25
+ [[ ${#EVIDENCE_KIT_SUITES[@]} -gt 0 ]] \
26
+ || { echo "check-battery-roster: EVIDENCE_KIT_SUITES is empty — no suite roster to hold $DOC against" >&2; exit 2; }
27
+ grep -qF -- "$BEGIN" "$DOC" \
28
+ || { echo "check-battery-roster: no '$BEGIN' marker block in $DOC" >&2; exit 2; }
29
+
30
+ # spec: evidence-kit/SPEC.md §check-battery-roster — a suite's documented invocation is EVIDENCE_KIT_RUN_<suite> minus a leading 'env' and its VAR=value assignments, the validate harness's environment being no part of what a contributor types
31
+ normalize_invocation() {
32
+ local -a t=()
33
+ read -r -a t <<<"${1-}"
34
+ local out="" tok head=1
35
+ for tok in ${t[@]+"${t[@]}"}; do
36
+ if [[ "$head" -eq 1 ]]; then
37
+ [[ "$tok" == "env" || "$tok" =~ ^[A-Za-z_][A-Za-z0-9_]*= ]] && continue
38
+ head=0
39
+ fi
40
+ out+="${out:+ }$tok"
41
+ done
42
+ printf '%s\n' "$out"
43
+ }
44
+
45
+ roster="$(awk -v b="$BEGIN" -v e="$END" '
46
+ { line = $0; sub(/#.*$/, "", line); gsub(/^[ \t]+|[ \t\r]+$/, "", line); gsub(/[ \t]+/, " ", line) }
47
+ line == b { inb = 1; next }
48
+ line == e { inb = 0; next }
49
+ inb && line ~ /^[a-z][a-z0-9_-]* / { print FNR ":" line }
50
+ ' "$DOC")"; st=$?
51
+ fail_closed "$st" check-battery-roster awk
52
+
53
+ declare -A roster_line=()
54
+ while IFS= read -r r; do
55
+ [[ -n "$r" ]] || continue
56
+ roster_line["${r#*:}"]="${r%%:*}"
57
+ done <<<"$roster"
58
+
59
+ declare -A suite_of=()
60
+ for s in "${EVIDENCE_KIT_SUITES[@]}"; do
61
+ c="$(normalize_invocation "$(ek_suite_cmd "$s")")"
62
+ [[ -n "$c" ]] && suite_of["$c"]="$s"
63
+ done
64
+
65
+ findings=()
66
+ # assertion A: every configured suite's documented invocation is a roster line
67
+ for c in "${!suite_of[@]}"; do
68
+ [[ -n "${roster_line[$c]:-}" ]] \
69
+ || findings+=("$DOC: suite '${suite_of[$c]}' is absent from the battery-roster block — no line reads '$c'")
70
+ done
71
+ # assertion B: every roster line resolves to a configured suite
72
+ for c in "${!roster_line[@]}"; do
73
+ [[ -n "${suite_of[$c]:-}" ]] \
74
+ || findings+=("$DOC:${roster_line[$c]}: roster line runs no configured suite: '$c'")
75
+ done
76
+
77
+ if [[ ${#findings[@]} -gt 0 ]]; then
78
+ printf '%s\n' "check-battery-roster: the battery-roster block is out of parity with EVIDENCE_KIT_SUITES:"
79
+ printf ' %s\n' "${findings[@]}" | sort
80
+ echo " help: keep the block in name-set parity with the configured suites — add the"
81
+ echo " missing suite's documented invocation, or drop the line whose command"
82
+ echo " runs no configured suite (evidence-kit/SPEC.md §check-battery-roster)."
83
+ exit 1
84
+ fi
85
+
86
+ echo "BATTERY-ROSTER: clean (${#EVIDENCE_KIT_SUITES[@]} configured suite(s) in name-set parity with the battery-roster block in $DOC)"
87
+ exit 0
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # graph: couples=.workflow/validate-baseline.txt,TASK-QUEUE.md dir=one valve=none tier=precommit
3
+ # install: zero-config
3
4
  # spec: evidence-kit/SPEC.md §check-evidence-baseline — held-constant baseline grammar, blocking-slug liveness, and (when scenario globs are configured) manifest↔disk set equality
4
5
  set -uo pipefail
5
6
 
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # graph: couples=.workflow/validate-evidence.txt,TASK-QUEUE.md,.workflow/WORKFLOW-STATE.txt dir=one valve=none tier=precommit
3
+ # install: zero-config
3
4
  # spec: evidence-kit/SPEC.md §check-evidence-manifest — (B) manifest grammar + current-iteration scoping; with lifecycle configured also (A) close-entry green block and (C) validate-stamp↔evidence coupling
4
5
  set -uo pipefail
5
6