checkwright 0.20.0 → 0.22.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 (250) hide show
  1. package/README.md +385 -19
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +11 -0
  4. package/lib/common/recipe.sh +8 -11
  5. package/lib/doctor.sh +49 -0
  6. package/lib/init.sh +152 -29
  7. package/package.json +2 -2
  8. package/payload/artifact/targets.list +30 -0
  9. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  11. package/payload/canon-kit/README.md +1 -0
  12. package/payload/canon-kit/SPEC.md +281 -26
  13. package/payload/canon-kit/checks/check-comment-tier.sh +7 -2
  14. package/payload/canon-kit/checks/check-docs-link-convention.sh +11 -4
  15. package/payload/canon-kit/checks/check-md-refs.sh +22 -9
  16. package/payload/canon-kit/checks/check-payload-claim.sh +133 -0
  17. package/payload/canon-kit/checks/check-prose-enum.sh +1 -1
  18. package/payload/canon-kit/checks/check-spec-pointer.sh +15 -4
  19. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  20. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +26 -3
  21. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  22. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  23. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  24. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  25. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  26. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +5 -3
  27. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  28. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  29. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  30. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  31. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  32. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  33. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  34. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  35. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  36. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  37. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  38. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  39. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +24 -1
  40. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  41. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  42. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  43. package/payload/canon-kit/lib/spec.sh +22 -12
  44. package/payload/canon-kit/smoke/install.sh +20 -1
  45. package/payload/canon-kit/templates/SPEC-amendment.md +5 -1
  46. package/payload/context-kit/SPEC.md +38 -7
  47. package/payload/context-kit/lib/toolfloor.sh +1 -1
  48. package/payload/context-kit/smoke/install.sh +3 -1
  49. package/payload/delegation-kit/README.md +2 -1
  50. package/payload/delegation-kit/SPEC.md +590 -48
  51. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  52. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +61 -0
  53. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -1
  54. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/silent.md +7 -0
  55. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/args +1 -0
  56. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +1 -0
  57. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +7 -0
  58. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-inherit.md +8 -0
  59. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/args +1 -0
  60. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -0
  61. package/payload/delegation-kit/lib/delegation.sh +3 -0
  62. package/payload/delegation-kit/smoke/install.sh +3 -1
  63. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  64. package/payload/delegation-kit/templates/agent-execution.md +171 -15
  65. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  66. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  67. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  68. package/payload/doctrine-kit/DOCTRINE.md +27 -0
  69. package/payload/doctrine-kit/README.md +5 -0
  70. package/payload/doctrine-kit/SPEC.md +62 -3
  71. package/payload/doctrine-kit/bin/install-doctrine.sh +84 -4
  72. package/payload/doctrine-kit/smoke/install.sh +77 -1
  73. package/payload/drift-kit/README.md +3 -2
  74. package/payload/drift-kit/SPEC.md +253 -20
  75. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  76. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  77. package/payload/drift-kit/smoke/install.sh +155 -1
  78. package/payload/drift-kit/templates/economics.md +9 -0
  79. package/payload/drift-kit/templates/kpis.list +6 -1
  80. package/payload/evidence-kit/README.md +20 -6
  81. package/payload/evidence-kit/SPEC.md +355 -17
  82. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  83. package/payload/evidence-kit/checks/check-battery-roster.sh +86 -0
  84. package/payload/evidence-kit/checks/check-producer-liveness.sh +34 -0
  85. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  86. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  87. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  88. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  89. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  90. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  91. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  92. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  93. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  94. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  95. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  96. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  97. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  98. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  99. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  100. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  101. package/payload/evidence-kit/lib/evidence.sh +18 -0
  102. package/payload/evidence-kit/smoke/install.sh +17 -3
  103. package/payload/gate-sdk/README.md +4 -1
  104. package/payload/gate-sdk/SPEC.md +1955 -79
  105. package/payload/gate-sdk/bin/gen-pre-commit.sh +13 -3
  106. package/payload/gate-sdk/bin/run-consumer-smoke.sh +121 -1
  107. package/payload/gate-sdk/bin/run-gate-tests.sh +40 -9
  108. package/payload/gate-sdk/bin/run-gates.sh +32 -3
  109. package/payload/gate-sdk/bin/upgrade-smoke.sh +3 -3
  110. package/payload/gate-sdk/checks/check-action-gh-repo.gate +2 -0
  111. package/payload/gate-sdk/checks/check-action-pinning.gate +2 -0
  112. package/payload/gate-sdk/checks/check-action-run-shell.sh +3 -1
  113. package/payload/gate-sdk/checks/check-core-files.sh +27 -4
  114. package/payload/gate-sdk/checks/check-exec-bit.sh +20 -1
  115. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +106 -0
  116. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +6 -7
  117. package/payload/gate-sdk/checks/check-gate-output.sh +9 -1
  118. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +302 -0
  119. package/payload/gate-sdk/checks/check-graph.sh +7 -8
  120. package/payload/gate-sdk/checks/check-readme-roster.sh +5 -0
  121. package/payload/gate-sdk/checks/check-reads-couples.sh +73 -22
  122. package/payload/gate-sdk/checks/check-template-registry-parity.sh +81 -0
  123. package/payload/gate-sdk/checks/check-tree-terms.sh +11 -7
  124. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  125. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  126. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  127. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  128. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  129. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  130. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  131. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  132. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  133. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  134. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  135. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  136. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  137. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  138. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  139. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  140. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  141. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  142. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  143. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  144. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  145. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  146. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  147. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  148. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  149. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  150. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  154. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  155. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  156. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  157. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  158. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  159. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  160. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  161. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  162. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  163. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  164. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  165. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  166. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  167. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  168. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  169. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  170. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  171. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  172. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  173. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  174. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  175. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  176. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +123 -0
  177. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  178. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  179. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  180. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  181. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  182. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  183. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  184. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  185. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  186. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  187. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  188. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  189. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  190. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  191. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  192. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  193. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +41 -1
  194. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  195. package/payload/gate-sdk/lib/consumer-smoke.sh +26 -1
  196. package/payload/gate-sdk/lib/gate.sh +104 -13
  197. package/payload/gate-sdk/lib/inject.sh +21 -1
  198. package/payload/gate-sdk/smoke/install.sh +19 -1
  199. package/payload/guard-kit/README.md +4 -3
  200. package/payload/guard-kit/SPEC.md +88 -10
  201. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  202. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  203. package/payload/guard-kit/lib/guard.sh +1 -0
  204. package/payload/guard-kit/templates/close-triage.md +35 -7
  205. package/payload/guard-kit/templates/guard-config.sh +3 -0
  206. package/payload/lifecycle-kit/README.md +1 -0
  207. package/payload/lifecycle-kit/SPEC.md +589 -33
  208. package/payload/lifecycle-kit/bin/enter-stage.sh +13 -3
  209. package/payload/lifecycle-kit/bin/file-gap.sh +42 -1
  210. package/payload/lifecycle-kit/bin/file-survey.sh +50 -0
  211. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +1 -1
  212. package/payload/lifecycle-kit/checks/check-skill-binding.sh +1 -1
  213. package/payload/lifecycle-kit/checks/check-survey-record.sh +102 -0
  214. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  215. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  216. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +1 -0
  217. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  218. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  219. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  220. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  221. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  222. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  223. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +84 -0
  224. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +94 -0
  225. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  226. package/payload/lifecycle-kit/lib/stages.sh +8 -2
  227. package/payload/lifecycle-kit/smoke/install.sh +17 -1
  228. package/payload/lifecycle-kit/templates/consult.md +73 -0
  229. package/payload/lifecycle-kit/templates/lead.md +141 -10
  230. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  231. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  232. package/payload/lifecycle-kit/templates/stages/close.md +25 -4
  233. package/payload/lifecycle-kit/templates/stages/scope.md +34 -0
  234. package/payload/lifecycle-kit/templates/stages/spec.md +8 -0
  235. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  236. package/payload/queue-kit/README.md +4 -1
  237. package/payload/queue-kit/SPEC.md +230 -6
  238. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  239. package/payload/queue-kit/checks/check-queue-entry-budget.sh +5 -3
  240. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  241. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  242. package/payload/queue-kit/smoke/install.sh +4 -1
  243. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  244. package/payload/site-kit/SPEC.md +135 -29
  245. package/payload/site-kit/checks/check-docs-render-fidelity.sh +100 -27
  246. package/payload/site-kit/gate-tests/check-docs-render-fidelity-batch.test.sh +158 -0
  247. package/payload/site-kit/lib/site.sh +16 -2
  248. package/payload/site-kit/smoke/install.sh +9 -1
  249. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  250. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
@@ -174,11 +174,12 @@ fi
174
174
 
175
175
  if [[ "$first" == 1 ]]; then
176
176
  mv "$tmpstate" "$STATE"
177
- # spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — the kit-owned lesson-evidence file resets as a built-in member (kit owns this surface); LIFECYCLE_KIT_BOUNDARY_TRUNCATE stays reserved for files the kit does not own
178
- for bt in "$LIFECYCLE_KIT_LESSON_EVIDENCE_FILE" ${LIFECYCLE_KIT_BOUNDARY_TRUNCATE[@]+"${LIFECYCLE_KIT_BOUNDARY_TRUNCATE[@]}"}; do
177
+ # spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — the two kit-owned surfaces (lesson evidence, survey record) reset as built-in members (the kit owns them); LIFECYCLE_KIT_BOUNDARY_TRUNCATE stays reserved for files the kit does not own, and a defaulted array is replaced rather than merged when a consumer assigns it, so a built-in shipped as a default member would lose its reset in every configuring consumer
178
+ for bt in "$LIFECYCLE_KIT_LESSON_EVIDENCE_FILE" "$LIFECYCLE_KIT_SURVEY_RECORD_FILE" ${LIFECYCLE_KIT_BOUNDARY_TRUNCATE[@]+"${LIFECYCLE_KIT_BOUNDARY_TRUNCATE[@]}"}; do
179
179
  [[ -f "$bt" ]] || continue
180
180
  bttmp="$tmpdir/boundary-truncate.$$"
181
- awk 'drop { next } /^#/ || /^[[:space:]]*$/ { print; next } { drop = 1 }' "$bt" > "$bttmp"
181
+ # spec: lifecycle-kit/SPEC.md §bin/enter-stage.sh — the header run stops at a markdown '## ' section heading as well as at the first data line: on a markdown surface whose blocks are '## ' headings (the survey record) a bare /^#/ predicate reads the first block's heading as part of the header and carries it across the boundary
182
+ awk 'drop { next } /^[[:space:]]*$/ { print; next } /^#([^#]|$)/ { print; next } { drop = 1 }' "$bt" > "$bttmp"
182
183
  mv "$bttmp" "$bt"
183
184
  truncated+=("$bt")
184
185
  done
@@ -213,3 +214,12 @@ fi
213
214
  if [[ ${#wiped[@]} -gt 0 ]]; then
214
215
  echo " note: boundary-wiped from $tmpdir: ${wiped[*]}"
215
216
  fi
217
+
218
+ # spec: lifecycle-kit/SPEC.md §The survey record — the read trigger: the entry report prints the record's headings (the questions), never the findings, at the one moment a stage session is guaranteed to be looking. Findings stay behind the witness — printing them here would put a possibly-stale judgment into context ahead of the check that qualifies it. A non-empty record never refuses the boundary: unlike the gap inbox one line above, a survey owes nobody a disposition.
219
+ if [[ -f "$LIFECYCLE_KIT_SURVEY_RECORD_FILE" ]]; then
220
+ mapfile -t survey_qs < <(awk '/^##[[:space:]]/ { print }' "$LIFECYCLE_KIT_SURVEY_RECORD_FILE")
221
+ if [[ ${#survey_qs[@]} -gt 0 ]]; then
222
+ echo " note: $LIFECYCLE_KIT_SURVEY_RECORD_FILE carries ${#survey_qs[@]} survey(s) this iteration — before buying one of these again, run its witness (diff the corpus since its rev, re-run its oracle) and cite it if both hold:"
223
+ printf ' %s\n' "${survey_qs[@]}"
224
+ fi
225
+ fi
@@ -2,6 +2,7 @@
2
2
  # spec: lifecycle-kit/SPEC.md §The committed gap inbox — the capture affordance; stamps the bullet grammar, no caller-side redirect (the kfric.sh pattern)
3
3
  # usage: file-gap.sh "<gap prose>" (required, non-empty)
4
4
  # appends one dated bullet '- <YYYY-MM-DD> — <gap prose>' to the committed gap inbox; exit 2 on misuse
5
+ # a prose naming a live queue slug gains the recurrence marker: '- <date> — recurrence of `<slug>`: <prose>'
5
6
  set -uo pipefail
6
7
 
7
8
  KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
@@ -26,10 +27,50 @@ mkdir -p "$(dirname "$INBOX")" 2>/dev/null || true
26
27
  [[ -f "$INBOX" ]] \
27
28
  || printf '# contract: lifecycle-kit/SPEC.md §The committed gap inbox — append-only mid-iteration gap capture, close-drained; one bullet per gap below.\n' > "$INBOX"
28
29
 
29
- line="- $(date +%F) — $1"
30
+ # spec: lifecycle-kit/SPEC.md §The committed gap inbox — resolve the prose against the live slug set: every column-0 entry bullet outside the fixed-spelling Lessons section, which is active + deferred + configured icebox with done excluded by grammar (a bare-slug line) and Lessons by name (a lesson may be written in the entry shape); longest match wins, and this awk is lifecycle-kit's own rather than queue-kit's queue_live_slugs, which would close a cross-kit cycle
31
+ _fg_slug=""
32
+ if [[ -f "$LIFECYCLE_KIT_QUEUE_FILE" ]]; then
33
+ _fg_slug="$(awk -v prose="$1" '
34
+ function bounded(hay, needle, pos, off, before, after) {
35
+ off = 0
36
+ while ((pos = index(substr(hay, off + 1), needle)) > 0) {
37
+ pos += off
38
+ before = (pos == 1) ? "" : substr(hay, pos - 1, 1)
39
+ after = substr(hay, pos + length(needle), 1)
40
+ if (before !~ /[a-z0-9-]/ && after !~ /[a-z0-9-]/) return 1
41
+ off = pos
42
+ }
43
+ return 0
44
+ }
45
+ /^## Lessons Learned[[:space:]]*$/ { inl = 1; next }
46
+ /^## / { inl = 0 }
47
+ inl { next }
48
+ /^-[[:space:]]+\*\*[a-z0-9][a-z0-9-]*\*\*[[:space:]]/ {
49
+ match($0, /\*\*[a-z0-9][a-z0-9-]*\*\*/)
50
+ live[substr($0, RSTART + 2, RLENGTH - 4)] = 1
51
+ }
52
+ END {
53
+ hay = tolower(prose); best = ""
54
+ for (s in live)
55
+ if (length(s) > length(best) && bounded(hay, s)) best = s
56
+ if (best != "") print best
57
+ }
58
+ ' "$LIFECYCLE_KIT_QUEUE_FILE" 2>/dev/null)"
59
+ fi
60
+
61
+ if [[ -n "$_fg_slug" ]]; then
62
+ line="- $(date +%F) — recurrence of \`$_fg_slug\`: $1"
63
+ else
64
+ line="- $(date +%F) — $1"
65
+ fi
30
66
  printf '%s\n' "$line" >> "$INBOX"
31
67
  printf 'file-gap: %s\n' "$line"
32
68
 
69
+ if [[ -n "$_fg_slug" ]]; then
70
+ printf 'file-gap: this finding is already filed under `%s` — recorded as a recurrence; the closing stage'"'"'s drain stamps the date onto that entry.\n' \
71
+ "$_fg_slug" >&2
72
+ fi
73
+
33
74
  # spec: lifecycle-kit/SPEC.md §The committed gap inbox — warn at the point of
34
75
  # capture, while the filer can still act: after the iteration's last stage
35
76
  # stamps there is no drainer left in the machine.
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env bash
2
+ # spec: lifecycle-kit/SPEC.md §The survey record — the capture affordance; stamps the block grammar, no caller-side redirect (the file-gap.sh pattern)
3
+ # usage: file-survey.sh "<question>" "<corpus>" "<oracle>" "<finding>" (four, each non-empty)
4
+ # appends one block '## <YYYY-MM-DD> <stage> — <question>' plus its corpus/oracle/rev/finding
5
+ # lines to the committed survey record; exit 2 on misuse
6
+ set -uo pipefail
7
+
8
+ KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
+ # shellcheck source=../lib/stages.sh
10
+ source "$KIT/lib/stages.sh"
11
+
12
+ REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
13
+ cd "$REPO_ROOT" 2>/dev/null || exit 1
14
+
15
+ usage() {
16
+ printf 'usage: %s "<question>" "<corpus>" "<oracle>" "<finding>"\n' "$(basename "$0")" >&2
17
+ }
18
+
19
+ if [[ $# -ne 4 || -z "${1:-}" || -z "${2:-}" || -z "${3:-}" || -z "${4:-}" ]]; then
20
+ usage
21
+ exit 2
22
+ fi
23
+
24
+ # spec: lifecycle-kit/SPEC.md §The survey record — rev is machine-stamped because it is the field the whole re-use protocol turns on and the one an author gets wrong (a short sha, the rev they started at, or none at all); a tree with no HEAD cannot ground a witness, so it is a refusal rather than a blank field
25
+ if ! _fs_rev="$(git rev-parse HEAD 2>/dev/null)" || [[ ! "$_fs_rev" =~ ^[0-9a-f]{40}$ ]]; then
26
+ printf 'file-survey: no HEAD commit to stamp as the survey rev — the witness would have nothing to diff against; commit first.\n' >&2
27
+ exit 2
28
+ fi
29
+
30
+ RECORD="$LIFECYCLE_KIT_SURVEY_RECORD_FILE"
31
+ mkdir -p "$(dirname "$RECORD")" 2>/dev/null || true
32
+ # spec: lifecycle-kit/SPEC.md §The survey record — seed the contract header when the record does not yet exist (a fresh consumer's first filing); the iteration-boundary entry truncates back to this header
33
+ [[ -f "$RECORD" ]] \
34
+ || printf '# contract: lifecycle-kit/SPEC.md §The survey record — carried surveys, one block per survey; boundary-truncated, cited only behind a passing witness.\n' > "$RECORD"
35
+
36
+ # spec: lifecycle-kit/SPEC.md §The survey record — the stage is derived from the cursor rather than asked for; a tree with no cursor yet stamps the never-named form the queue header already uses
37
+ _fs_stage="$(lifecycle_current_stage)"
38
+ [[ -n "$_fs_stage" ]] || _fs_stage="—"
39
+
40
+ printf '\n## %s %s — %s\n- corpus: %s\n- oracle: %s\n- rev: %s\n- finding: %s\n' \
41
+ "$(date +%F)" "$_fs_stage" "$1" "$2" "$3" "$_fs_rev" "$4" >> "$RECORD"
42
+
43
+ printf 'file-survey: ## %s %s — %s (rev %s)\n' "$(date +%F)" "$_fs_stage" "$1" "$_fs_rev"
44
+
45
+ if [[ "$3" == "none" ]]; then
46
+ printf 'file-survey: oracle "none" — this block is a note, not a re-usable survey: a later stage may read it for orientation and must re-derive before relying on it.\n' >&2
47
+ else
48
+ printf 'file-survey: the witness a later stage runs — git diff --quiet %s..HEAD -- %s, then re-run: %s\n' \
49
+ "$_fs_rev" "$2" "$3" >&2
50
+ fi
@@ -59,7 +59,7 @@ if [[ -n "$missing" || -n "$extra" || -n "$union_missing" ]]; then
59
59
  while IFS= read -r p; do
60
60
  [[ -n "$p" ]] && echo " union-merge path with no merge=union attribute (a gap filed on either side of a concurrent merge would be silently dropped): $p"
61
61
  done <<<"$union_missing"
62
- echo " help: regenerate the marker block — bash lifecycle-kit/bin/install-lifecycle.sh — which writes one 'merge=iteration-scoped' line per boundary-truncated surface (LIFECYCLE_KIT_STATE_FILE, LIFECYCLE_KIT_LESSON_EVIDENCE_FILE, and each LIFECYCLE_KIT_BOUNDARY_TRUNCATE member) and one 'merge=union' line per union surface (LIFECYCLE_KIT_GAP_INBOX_FILE). Remove any hand-added merge=iteration-scoped attribute on a path outside the supersede set."
62
+ echo " help: regenerate the marker block — bash lifecycle-kit/bin/install-lifecycle.sh — which writes one 'merge=iteration-scoped' line per boundary-truncated surface (LIFECYCLE_KIT_STATE_FILE, LIFECYCLE_KIT_LESSON_EVIDENCE_FILE, LIFECYCLE_KIT_SURVEY_RECORD_FILE, and each LIFECYCLE_KIT_BOUNDARY_TRUNCATE member) and one 'merge=union' line per union surface (LIFECYCLE_KIT_GAP_INBOX_FILE). Remove any hand-added merge=iteration-scoped attribute on a path outside the supersede set."
63
63
  exit 1
64
64
  fi
65
65
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # graph: couples=.claude/commands/*.md,lifecycle-kit/templates/stages/*.md,lifecycle-kit/templates/lead.md,lifecycle-kit/templates/release-sweep.md,lifecycle-kit/templates/upgrade.md,delegation-kit/templates/agent-execution.md dir=one valve=none tier=precommit
2
+ # graph: couples=.claude/commands/*.md,lifecycle-kit/templates/stages/*.md,lifecycle-kit/templates/lead.md,lifecycle-kit/templates/release-sweep.md,lifecycle-kit/templates/upgrade.md,lifecycle-kit/templates/consult.md,delegation-kit/templates/agent-execution.md dir=one valve=none tier=precommit
3
3
  # spec: lifecycle-kit/SPEC.md §check-skill-binding — every binding-shim skill names an existing template and binds exactly that template's slot set
4
4
  #
5
5
  # usage: check-skill-binding.sh [skills-dir]
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ # graph: couples=.workflow/survey-record.md dir=one valve=none tier=precommit
3
+ # spec: lifecycle-kit/SPEC.md §check-survey-record — every survey block carries its whole witness: the four keys in order, a full-sha rev naming a real commit, a non-empty corpus and a non-empty oracle
4
+ #
5
+ # usage: check-survey-record.sh [record-file]
6
+ # bare drives LIFECYCLE_KIT_SURVEY_RECORD_FILE with the full assertion set (grammar + rev existence);
7
+ # an explicit file argument drives it hermetically — grammar only, since a fixture's rev names no
8
+ # commit in the tree the fixture was copied into (the check-lesson-disposition override precedent).
9
+ set -uo pipefail
10
+
11
+ KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
12
+ SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
13
+ # shellcheck source=../../gate-sdk/lib/gate.sh
14
+ source "$SDK/lib/gate.sh"
15
+ # shellcheck source=../lib/stages.sh
16
+ source "$KIT/lib/stages.sh"
17
+
18
+ if [[ -n "${1:-}" ]]; then
19
+ RECORD="$1"; probe_rev=0
20
+ [[ -f "$RECORD" ]] || { echo "check-survey-record: record file not found: $RECORD" >&2; exit 2; }
21
+ else
22
+ RECORD="$LIFECYCLE_KIT_SURVEY_RECORD_FILE"; probe_rev=1
23
+ # spec: lifecycle-kit/SPEC.md §check-survey-record — an absent record is clean and counted inert: the surface is optional, and a consumer that never files a survey must not carry a red gate
24
+ [[ -f "$RECORD" ]] || { echo "SURVEY-RECORD: clean (no record at $RECORD — no survey filed this iteration)"; exit 0; }
25
+ git rev-parse --git-dir >/dev/null 2>&1 || probe_rev=0
26
+ fi
27
+ [[ -r "$RECORD" ]] || { echo "check-survey-record: record file not readable: $RECORD" >&2; exit 2; }
28
+
29
+ parsed="$(awk '
30
+ BEGIN { n = split("corpus oracle rev finding", want, " ") }
31
+ function finish( i) {
32
+ if (!blk) return
33
+ for (i = 1; i <= n; i++) {
34
+ if (i > k) { print "BAD\t" blk "\tblock is missing its '\''- " want[i] ":'\'' line"; continue }
35
+ if (keys[i] != want[i])
36
+ print "BAD\t" lns[i] "\texpected the '\''- " want[i] ":'\'' line here, found '\''- " keys[i] ":'\''"
37
+ }
38
+ for (i = n + 1; i <= k; i++)
39
+ print "BAD\t" lns[i] "\tblock carries a fifth key '\''- " keys[i] ":'\'' — the grammar is exactly corpus/oracle/rev/finding"
40
+ blk = 0; k = 0
41
+ }
42
+ /^##[[:space:]]/ { finish(); blk = FNR; blocks++; next }
43
+ !blk { next }
44
+ /^[[:space:]]*$/ { next }
45
+ {
46
+ if ($0 !~ /^-[[:space:]]+[a-z]+:/) {
47
+ print "BAD\t" FNR "\tstray line inside a survey block (the grammar is one '\''- <key>: <value>'\'' line per key)"
48
+ next
49
+ }
50
+ key = $0; sub(/^-[[:space:]]+/, "", key); val = key
51
+ sub(/:.*$/, "", key); sub(/^[a-z]+:[[:space:]]*/, "", val)
52
+ sub(/[[:space:]]+$/, "", val)
53
+ k++; keys[k] = key; vals[k] = val; lns[k] = FNR
54
+ if (key == "corpus" && val == "")
55
+ print "BAD\t" FNR "\tempty corpus — the witness has no pathspec to diff"
56
+ if (key == "oracle" && val == "")
57
+ print "BAD\t" FNR "\tempty oracle — write the grounding command, or the literal '\''none'\'' (which marks the block a note, not a re-usable survey)"
58
+ if (key == "rev") {
59
+ if (val !~ /^[0-9a-f]{40}$/)
60
+ print "BAD\t" FNR "\trev is not a full 40-hex sha: '\''" val "'\''"
61
+ else
62
+ print "REV\t" FNR "\t" val
63
+ }
64
+ }
65
+ END { finish(); print "COUNT\t" blocks + 0 "\t" }
66
+ ' "$RECORD")"; st=$?
67
+ fail_closed "$st" SURVEY-RECORD awk
68
+
69
+ findings=(); revs=(); rev_lines=(); blocks=0
70
+ while IFS=$'\t' read -r kind where what; do
71
+ case "$kind" in
72
+ BAD) findings+=("$RECORD:$where: $what") ;;
73
+ REV) revs+=("$what"); rev_lines+=("$where") ;;
74
+ COUNT) blocks="$where" ;;
75
+ esac
76
+ done <<<"$parsed"
77
+
78
+ # spec: lifecycle-kit/SPEC.md §check-survey-record — the existence probe is the assertion that catches the wrong-rev case the 40-hex shape cannot: a sha the tree does not carry makes 'git diff <rev>..HEAD' fail rather than witness anything
79
+ probed=0
80
+ if [[ "$probe_rev" == 1 ]]; then
81
+ for i in "${!revs[@]}"; do
82
+ if git cat-file -e "${revs[$i]}^{commit}" 2>/dev/null; then
83
+ probed=$((probed + 1))
84
+ else
85
+ findings+=("$RECORD:${rev_lines[$i]}: rev names no commit in this repository: ${revs[$i]}")
86
+ fi
87
+ done
88
+ fi
89
+
90
+ if [[ ${#findings[@]} -gt 0 ]]; then
91
+ echo "check-survey-record: ${#findings[@]} malformed survey block(s) in $RECORD:"
92
+ printf ' %s\n' "${findings[@]}"
93
+ echo " help: each '## <date> <stage> — <question>' block carries exactly four lines — '- corpus:', '- oracle:', '- rev:', '- finding:' — in that order, with a non-empty corpus, a non-empty oracle (the literal 'none' is the honest form for a survey no oracle grounds), and a full 40-hex rev naming a real commit. File blocks with 'bash lifecycle-kit/bin/file-survey.sh \"<question>\" \"<corpus>\" \"<oracle>\" \"<finding>\"', which stamps the rev itself."
94
+ exit 1
95
+ fi
96
+
97
+ if [[ "$probe_rev" == 1 ]]; then
98
+ echo "SURVEY-RECORD: clean ($blocks block(s) in $RECORD; grammar holds and $probed rev(s) name a real commit)"
99
+ else
100
+ echo "SURVEY-RECORD: clean ($blocks block(s) in $RECORD; grammar holds — hermetic file argument, so no rev-existence probe)"
101
+ fi
102
+ exit 0
@@ -1,6 +1,7 @@
1
1
  # lifecycle-kit:merge:begin
2
2
  .workflow/WORKFLOW-STATE.txt merge=iteration-scoped
3
3
  .workflow/lesson-evidence.txt merge=iteration-scoped
4
+ .workflow/survey-record.md merge=iteration-scoped
4
5
  .workflow/gap-inbox.md merge=union
5
6
  # lifecycle-kit:merge:end
6
7
  README.md merge=iteration-scoped
@@ -1,5 +1,6 @@
1
1
  # lifecycle-kit:merge:begin
2
2
  .workflow/WORKFLOW-STATE.txt merge=iteration-scoped
3
3
  .workflow/lesson-evidence.txt merge=iteration-scoped
4
+ .workflow/survey-record.md merge=iteration-scoped
4
5
  .workflow/gap-inbox.md merge=union
5
6
  # lifecycle-kit:merge:end
@@ -63,6 +63,7 @@ mkdir -p "$uok"
63
63
  cat >"$uok/.gitattributes" <<'EOF'
64
64
  .workflow/WORKFLOW-STATE.txt merge=iteration-scoped
65
65
  .workflow/lesson-evidence.txt merge=iteration-scoped
66
+ .workflow/survey-record.md merge=iteration-scoped
66
67
  .workflow/gap-inbox.md merge=union
67
68
  CHANGELOG.md merge=union
68
69
  EOF
@@ -0,0 +1,2 @@
1
+ # hermetic override arg: the record file (grammar-only, no rev-existence probe)
2
+ record.md
@@ -0,0 +1,4 @@
1
+ rev is not a full 40-hex sha: '0123456'
2
+ empty oracle
3
+ expected the '- oracle:' line here, found '- rev:'
4
+ help:
@@ -0,0 +1,18 @@
1
+ # contract: lifecycle-kit/SPEC.md §The survey record — carried surveys, one block per survey; boundary-truncated, cited only behind a passing witness.
2
+
3
+ ## 2026-01-02 scope — which registered gates meet every port criterion?
4
+ - corpus: scripts/gates.list */checks/
5
+ - oracle: bash gate-sdk/bin/run-gates.sh check-gate-substrate-parity
6
+ - rev: 0123456
7
+ - finding: four gates meet all six criteria; the remaining eleven fail the pure-function criterion.
8
+
9
+ ## 2026-01-03 align — which specs still cite the retired section?
10
+ - corpus: */SPEC.md
11
+ - oracle:
12
+ - rev: 89abcdef0123456789abcdef0123456789abcdef
13
+ - finding: two specs still cite it.
14
+
15
+ ## 2026-01-04 build — which fixtures cover the new grammar?
16
+ - corpus: lifecycle-kit/gate-tests/
17
+ - rev: 3333333333333333333333333333333333333333
18
+ - finding: one pair covers it.
@@ -0,0 +1,2 @@
1
+ # hermetic override arg: the record file (grammar-only, no rev-existence probe)
2
+ record.md
@@ -0,0 +1 @@
1
+ SURVEY-RECORD: clean (2 block(s)
@@ -0,0 +1,13 @@
1
+ # contract: lifecycle-kit/SPEC.md §The survey record — carried surveys, one block per survey; boundary-truncated, cited only behind a passing witness.
2
+
3
+ ## 2026-01-02 scope — which registered gates meet every port criterion?
4
+ - corpus: scripts/gates.list */checks/
5
+ - oracle: bash gate-sdk/bin/run-gates.sh check-gate-substrate-parity
6
+ - rev: 0123456789abcdef0123456789abcdef01234567
7
+ - finding: four gates meet all six criteria; the remaining eleven fail the pure-function criterion.
8
+
9
+ ## 2026-01-03 spec — does any kit README still name the retired knob?
10
+ - corpus: */README.md
11
+ - oracle: none
12
+ - rev: 89abcdef0123456789abcdef0123456789abcdef
13
+ - finding: a reading of prose, so this block is a note — re-derive before relying on it.
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env bash
2
+ # Behavioral test of checks/check-survey-record.sh — the scenarios the one-pair
3
+ # good/bad harness cannot hold. The fixture pair drives the gate through its
4
+ # hermetic file argument, which asserts grammar only, because a fixture's rev
5
+ # names no commit in the tree the fixture was copied into. This file covers the
6
+ # other half: the bare (configured-record) mode in a real sandbox repo, where the
7
+ # rev-existence probe runs — a rev naming a real commit passes, a well-formed
8
+ # 40-hex rev naming nothing is the wrong-rev finding the shape check cannot make
9
+ # — plus the two inert shapes (no record at all, a header-only record).
10
+ #
11
+ # Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
12
+ set -uo pipefail
13
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
14
+
15
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # lifecycle-kit/
16
+ GATE="$DIR/checks/check-survey-record.sh"
17
+ SANDBOX="$(mktemp -d)"
18
+ trap 'rm -rf "$SANDBOX"' EXIT
19
+
20
+ fails=0
21
+
22
+ check_case() { # $1=label $2=dir $3=want-rc $4=want-substring
23
+ local out rc
24
+ out="$(cd "$2" && "$GATE" 2>&1)"; rc=$?
25
+ if [[ "$rc" -ne "$3" ]]; then
26
+ echo " FAIL [$1]: want exit $3, got $rc -- $out"; fails=$((fails + 1)); return
27
+ fi
28
+ if [[ -n "$4" ]] && ! grep -qF -- "$4" <<<"$out"; then
29
+ echo " FAIL [$1]: exit $rc OK but output lacks '$4':"; printf ' %s\n' "$out"
30
+ fails=$((fails + 1))
31
+ fi
32
+ }
33
+
34
+ seed_repo() { # $1=dir -> a one-commit git repo, printing its HEAD sha
35
+ git -C "$1" init -q
36
+ printf 'seed\n' >"$1/seed.txt"
37
+ git -C "$1" add -A
38
+ git -C "$1" -c user.email=t@t.invalid -c user.name=t commit -q -m base
39
+ git -C "$1" rev-parse HEAD
40
+ }
41
+
42
+ write_record() { # $1=dir $2=rev
43
+ mkdir -p "$1/.workflow"
44
+ cat >"$1/.workflow/survey-record.md" <<EOF
45
+ # contract: lifecycle-kit/SPEC.md §The survey record — carried surveys.
46
+
47
+ ## 2026-01-02 scope — which gates meet every port criterion?
48
+ - corpus: checks/
49
+ - oracle: bash run-gates.sh
50
+ - rev: $2
51
+ - finding: four of them.
52
+ EOF
53
+ }
54
+
55
+ # --- bare mode, rev naming a real commit: the probe runs and passes ---
56
+ live="$SANDBOX/live"; mkdir -p "$live"
57
+ head_sha="$(seed_repo "$live")"
58
+ write_record "$live" "$head_sha"
59
+ check_case "rev-exists" "$live" 0 "1 rev(s) name a real commit"
60
+
61
+ # --- bare mode, well-formed 40-hex rev naming nothing: the wrong-rev finding ---
62
+ ghost="$SANDBOX/ghost"; mkdir -p "$ghost"
63
+ seed_repo "$ghost" >/dev/null
64
+ write_record "$ghost" "0123456789abcdef0123456789abcdef01234567"
65
+ check_case "rev-unknown" "$ghost" 1 "rev names no commit in this repository"
66
+
67
+ # --- an absent record is clean and counted inert: the surface is optional ---
68
+ empty="$SANDBOX/empty"; mkdir -p "$empty"
69
+ seed_repo "$empty" >/dev/null
70
+ check_case "no-record" "$empty" 0 "no survey filed this iteration"
71
+
72
+ # --- a header-only record (the shape the iteration boundary leaves behind) ---
73
+ hdr="$SANDBOX/header-only"; mkdir -p "$hdr/.workflow"
74
+ seed_repo "$hdr" >/dev/null
75
+ printf '# contract: lifecycle-kit/SPEC.md §The survey record — carried surveys.\n' \
76
+ >"$hdr/.workflow/survey-record.md"
77
+ check_case "header-only" "$hdr" 0 "clean (0 block(s)"
78
+
79
+ if [[ "$fails" -gt 0 ]]; then
80
+ echo "check-survey-record.test.sh: $fails case(s) failed"
81
+ exit 1
82
+ fi
83
+ echo "check-survey-record.test.sh: clean (rev-exists + rev-unknown probe arms, absent-record and header-only inert shapes, 4 cases)"
84
+ exit 0
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env bash
2
+ # spec: lifecycle-kit/SPEC.md §The committed gap inbox — file-gap.sh's capture-time slug resolution: a live entry's slug in the prose stamps the recurrence marker and warns on stderr, a done slug and a Lessons-only slug do not, the longest live slug wins, a hyphen-embedded near-miss is not a match, and no run touches the queue file
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
+ TOOL="$DIR/bin/file-gap.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
+ cat >"$SANDBOX/TASK-QUEUE.md" <<'EOF'
15
+ # TASK-QUEUE.md
16
+
17
+ ## Iteration: demo-iteration
18
+
19
+ ---
20
+
21
+ ## New Features
22
+
23
+ - **fork-dispatch** — an active entry whose slug is a hyphen-prefix of a deferred one.
24
+
25
+ ## Technical Debt
26
+
27
+ ## Deferred
28
+
29
+ - **fork-dispatch-prohibition** [design-pending] — the deferred entry.
30
+ Cost while deferred: recovery is re-paid each time.
31
+ - **nested-subtask** — a sub-task, indented, deliberately out of the entry scan.
32
+
33
+ ## Icebox
34
+
35
+ - **iced-entry** — one line, still live work.
36
+
37
+ ## Done
38
+
39
+ - landed-and-fixed
40
+
41
+ ## Lessons Learned
42
+
43
+ - **lesson-shaped-slug** [attend] — a lesson written in the entry shape.
44
+ EOF
45
+
46
+ DATE="$(date +%F)"
47
+
48
+ filed() { # $1=prose -> prints "<stdout>|<stderr>" of one filing into a fresh inbox
49
+ local prose="$1" inbox="$SANDBOX/inbox-$RANDOM.md" o e
50
+ o="$(cd "$SANDBOX" && env LIFECYCLE_KIT_GAP_INBOX_FILE="$inbox" \
51
+ LIFECYCLE_KIT_QUEUE_FILE="$SANDBOX/TASK-QUEUE.md" \
52
+ bash "$TOOL" "$prose" 2>"$SANDBOX/err.txt")"
53
+ e="$(cat "$SANDBOX/err.txt")"
54
+ printf '%s|%s\n' "$o" "$e"
55
+ }
56
+
57
+ qbefore="$(cat "$SANDBOX/TASK-QUEUE.md")"
58
+
59
+ # --- a live deferred slug matches, and the longest match wins over its prefix ---
60
+ out="$(filed 'the fork-dispatch-prohibition failure mode fired again inside scope')"
61
+ grep -qF -- "- $DATE — recurrence of \`fork-dispatch-prohibition\`: " <<<"$out" \
62
+ || note live-match "no recurrence marker for a live deferred slug: $out"
63
+ grep -qF 'already filed under `fork-dispatch-prohibition`' <<<"$out" \
64
+ || note live-warn "no point-of-capture stderr warning: $out"
65
+
66
+ # --- an icebox entry is live too ---
67
+ out="$(filed 'iced-entry regressed')"
68
+ grep -qF 'recurrence of `iced-entry`' <<<"$out" || note icebox "an icebox entry did not resolve as live: $out"
69
+
70
+ # --- a done slug is a new defect, not a recurrence ---
71
+ out="$(filed 'landed-and-fixed broke again after its fix landed')"
72
+ grep -qF 'recurrence of' <<<"$out" && note done-slug "a done-section slug resolved as a recurrence: $out"
73
+ grep -qF -- "- $DATE — landed-and-fixed broke again" <<<"$out" \
74
+ || note done-plain "the plain bullet grammar was not written for a done slug: $out"
75
+
76
+ # --- a Lessons entry written in the entry shape is not a queue entry ---
77
+ out="$(filed 'lesson-shaped-slug came up once more')"
78
+ grep -qF 'recurrence of' <<<"$out" && note lesson "a Lessons lead line resolved as a live queue entry: $out"
79
+
80
+ # --- a sub-task is out of scope: the rule and its threshold are entry-scoped ---
81
+ out="$(filed 'nested-subtask surfaced again')"
82
+ grep -qF 'recurrence of' <<<"$out" && note subtask "an indented sub-task resolved as an entry: $out"
83
+
84
+ # --- a hyphen-embedded near-miss is not a match ---
85
+ out="$(filed 'the fork-dispatching helper is slow')"
86
+ grep -qF 'recurrence of' <<<"$out" && note boundary "a slug embedded in a longer hyphenated token matched: $out"
87
+
88
+ # --- no filing ever writes the queue ---
89
+ [[ "$qbefore" == "$(cat "$SANDBOX/TASK-QUEUE.md")" ]] \
90
+ || note no-queue-write "file-gap.sh modified the queue file — the constraint the gap inbox exists to hold"
91
+
92
+ [[ "$fails" -eq 0 ]] || { echo "file-gap-recurrence.test: $fails assertion(s) failed"; exit 1; }
93
+ echo "file-gap-recurrence.test: clean (live-slug resolution stamps the marker and warns, done/Lessons/sub-task slugs do not, longest match wins, and no filing writes the queue)"
94
+ exit 0
@@ -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