checkwright 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +687 -90
  2. package/lib/common/lock.sh +38 -9
  3. package/lib/common/profile.sh +33 -0
  4. package/lib/common/recipe.sh +49 -33
  5. package/lib/diff.sh +64 -0
  6. package/lib/doctor.sh +67 -42
  7. package/lib/init.sh +23 -31
  8. package/lib/uninstall.sh +212 -0
  9. package/lib/update.sh +34 -0
  10. package/package.json +2 -2
  11. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  12. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  13. package/payload/canon-kit/README.md +1 -0
  14. package/payload/canon-kit/SPEC.md +410 -58
  15. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
  16. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  17. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  18. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  19. package/payload/canon-kit/checks/check-docs-link-convention.sh +1 -0
  20. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  21. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  22. package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
  23. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  24. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  25. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  26. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  27. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  28. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  29. package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
  30. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  31. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  32. package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
  33. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  35. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  36. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  37. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  38. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +3 -2
  49. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  50. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  51. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  62. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  63. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  64. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +27 -5
  65. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  66. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  67. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  68. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  69. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  70. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  71. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  72. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  73. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +3 -3
  74. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  75. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  76. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  77. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  78. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +3 -0
  79. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  80. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  81. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  82. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  83. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  84. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  85. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  86. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  87. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  88. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  89. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  90. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  91. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  92. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  93. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  94. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  95. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  96. package/payload/canon-kit/lib/spec.sh +91 -62
  97. package/payload/canon-kit/smoke/install.sh +1 -0
  98. package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
  99. package/payload/context-kit/README.md +4 -1
  100. package/payload/context-kit/SPEC.md +143 -10
  101. package/payload/context-kit/bin/env-probe.sh +19 -6
  102. package/payload/context-kit/checks/check-brevity.sh +1 -0
  103. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  104. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  105. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  106. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  107. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  108. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  109. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  110. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  111. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  112. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  113. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  114. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  115. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  116. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  117. package/payload/context-kit/lib/toolfloor.sh +15 -4
  118. package/payload/context-kit/smoke/agents-md.sh +12 -1
  119. package/payload/context-kit/smoke/install.sh +1 -0
  120. package/payload/delegation-kit/README.md +3 -3
  121. package/payload/delegation-kit/SPEC.md +116 -13
  122. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  123. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -0
  124. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  125. package/payload/delegation-kit/templates/agent-execution.md +38 -14
  126. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  127. package/payload/doctrine-kit/DOCTRINE.md +86 -12
  128. package/payload/doctrine-kit/README.md +7 -3
  129. package/payload/doctrine-kit/SPEC.md +102 -9
  130. package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
  131. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  132. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  133. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  134. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  135. package/payload/doctrine-kit/smoke/install.sh +90 -0
  136. package/payload/drift-kit/SPEC.md +13 -4
  137. package/payload/drift-kit/bin/kfric.sh +21 -2
  138. package/payload/drift-kit/smoke/install.sh +28 -0
  139. package/payload/evidence-kit/checks/check-battery-roster.sh +1 -0
  140. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  141. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  142. package/payload/evidence-kit/checks/check-producer-liveness.sh +1 -0
  143. package/payload/gate-sdk/README.md +13 -0
  144. package/payload/gate-sdk/SPEC.md +2611 -151
  145. package/payload/gate-sdk/bin/build-native.sh +38 -0
  146. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  147. package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
  148. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  149. package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
  150. package/payload/gate-sdk/bin/run-gate-tests.sh +26 -5
  151. package/payload/gate-sdk/bin/run-gates.sh +8 -2
  152. package/payload/gate-sdk/bin/upgrade-smoke.sh +52 -4
  153. package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -0
  154. package/payload/gate-sdk/checks/check-action-pinning.gate +1 -0
  155. package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -0
  156. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  157. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  158. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  159. package/payload/gate-sdk/checks/check-core-files.sh +1 -0
  160. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  161. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  162. package/payload/gate-sdk/checks/check-exec-bit.sh +1 -0
  163. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  164. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +2 -1
  165. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +1 -0
  166. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  167. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  168. package/payload/gate-sdk/checks/check-gate-output.sh +33 -3
  169. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +36 -5
  170. package/payload/gate-sdk/checks/check-graph.sh +1 -0
  171. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  172. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  173. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  174. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  175. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  176. package/payload/gate-sdk/checks/check-readme-roster.sh +1 -0
  177. package/payload/gate-sdk/checks/check-reads-couples.sh +3 -2
  178. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  179. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  180. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  181. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  182. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  183. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  184. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  185. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  186. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  187. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  188. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  189. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  190. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  191. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  192. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  193. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  194. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  195. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  196. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  197. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  198. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  199. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  200. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  201. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -1
  202. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  203. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  204. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  205. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  206. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
  207. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +65 -4
  208. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  209. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  210. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  211. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  212. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  213. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  214. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  215. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  216. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  217. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  218. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  219. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  220. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  221. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  222. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  223. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  224. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  225. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  226. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +111 -1
  227. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  228. package/payload/gate-sdk/lib/consumer-smoke.sh +24 -12
  229. package/payload/gate-sdk/lib/gate.sh +135 -11
  230. package/payload/gate-sdk/lib/inject.sh +25 -0
  231. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  232. package/payload/gate-sdk/smoke/install.sh +42 -0
  233. package/payload/guard-kit/README.md +14 -11
  234. package/payload/guard-kit/SPEC.md +278 -62
  235. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  236. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  237. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  238. package/payload/guard-kit/lib/guard.sh +276 -54
  239. package/payload/guard-kit/templates/close-triage.md +5 -5
  240. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  241. package/payload/lifecycle-kit/README.md +11 -1
  242. package/payload/lifecycle-kit/SPEC.md +441 -37
  243. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  244. package/payload/lifecycle-kit/bin/enter-stage.sh +126 -10
  245. package/payload/lifecycle-kit/bin/file-gap.sh +27 -10
  246. package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
  247. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  248. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  249. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  250. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  251. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  252. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  253. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  254. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  255. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  256. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  257. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  258. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  259. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  260. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  261. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  262. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  263. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  264. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  265. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  266. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  267. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  268. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -3
  269. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  270. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  271. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  272. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  273. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  274. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  275. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  276. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  277. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  278. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  279. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -3
  280. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +54 -26
  281. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  282. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  283. package/payload/lifecycle-kit/lib/stages.sh +4 -0
  284. package/payload/lifecycle-kit/smoke/install.sh +67 -4
  285. package/payload/lifecycle-kit/templates/lead.md +36 -0
  286. package/payload/lifecycle-kit/templates/stages/close.md +30 -11
  287. package/payload/lifecycle-kit/templates/stages/scope.md +9 -4
  288. package/payload/lifecycle-kit/templates/stages/spec.md +5 -1
  289. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  290. package/payload/queue-kit/README.md +3 -1
  291. package/payload/queue-kit/SPEC.md +123 -3
  292. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  293. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  294. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  295. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  296. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  297. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  298. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  299. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  300. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  301. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  302. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  303. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  304. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  305. package/payload/queue-kit/lib/queue.sh +4 -19
  306. package/payload/site-kit/SPEC.md +23 -0
  307. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  308. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  309. package/profiles.list +36 -8
  310. package/payload/canon-kit/checks/check-comment-tier.sh +0 -216
  311. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  312. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  313. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  314. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  315. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  316. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  317. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  318. package/payload/canon-kit/checks/check-payload-claim.sh +0 -133
  319. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  320. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  321. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  322. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  323. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -187
  324. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  325. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  326. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  327. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  328. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  329. package/payload/gate-sdk/checks/check-template-registry-parity.sh +0 -81
  330. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  331. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  332. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  333. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  334. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  335. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  336. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  337. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  338. package/payload/lifecycle-kit/checks/check-survey-record.sh +0 -102
  339. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -106
  340. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  341. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  342. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  343. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  344. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  345. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  346. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -1,44 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # spec: queue-kit/SPEC.md §check-queue-sections — the queue carries each required ## section heading exactly once, the fail-closed floor under every section-scoped scanner
4
- #
5
- # usage: check-queue-sections.sh [queue-file]
6
- # Defaults to the configured queue file (QUEUE_KIT_QUEUE_FILE).
7
- set -uo pipefail
8
-
9
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
11
- # shellcheck source=../../gate-sdk/lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
- # shellcheck source=../lib/queue.sh
14
- source "$KIT/lib/queue.sh"
15
-
16
- FILE="${1:-$QUEUE_KIT_QUEUE_FILE}"
17
- [[ -f "$FILE" ]] || { echo "check-queue-sections: file not found: $FILE" >&2; exit 2; }
18
-
19
- missing=(); dup=()
20
- for sec in "${QUEUE_KIT_REQUIRED_SECTIONS[@]}"; do
21
- if [[ "$sec" == *: ]]; then re="^## ${sec}"; else re="^## ${sec}[[:space:]]*\$"; fi
22
- n="$(grep -cE -- "$re" "$FILE")"; gst=$?
23
- if [[ "$gst" -ge 2 ]]; then
24
- echo "check-queue-sections: grep failed on '$re' (exit $gst) — cannot verify" >&2
25
- exit 2
26
- fi
27
- if [[ "$n" -eq 0 ]]; then missing+=("$sec")
28
- elif [[ "$n" -gt 1 ]]; then dup+=("$sec ($n occurrences)")
29
- fi
30
- done
31
-
32
- if [[ ${#missing[@]} -gt 0 || ${#dup[@]} -gt 0 ]]; then
33
- echo "check-queue-sections: required '##' section(s) not present exactly once in $FILE"
34
- echo "(every section-scoped scanner — amendment-queue, task-names, conservation, the"
35
- echo "session-context index — locates work by these headings and finds nothing when one drops):"
36
- for s in "${missing[@]}"; do echo " missing: ## $s"; done
37
- for s in "${dup[@]}"; do echo " duplicate: ## $s"; done
38
- echo " help: restore the heading (spelled exactly), or remove the duplicate. The"
39
- echo " required set is QUEUE_KIT_REQUIRED_SECTIONS (queue-config.sh)."
40
- exit 1
41
- fi
42
-
43
- echo "QUEUE-SECTIONS: clean (${#QUEUE_KIT_REQUIRED_SECTIONS[@]} required section(s) each present once in $FILE)"
44
- exit 0
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=TASK-QUEUE.md,scripts/*.sh dir=one valve=none tier=precommit
3
- # spec: queue-kit/SPEC.md §check-queue-slug-liveness — every slug-shaped bold-code token in a configured prose surface resolves against the queue's live slug set
4
- #
5
- # usage: check-queue-slug-liveness.sh [scan-root] (default '.')
6
- # Scans QUEUE_KIT_PROSE_SURFACE_GLOBS (empty default: no-op) under the root.
7
- set -uo pipefail
8
-
9
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
11
- # shellcheck source=../../gate-sdk/lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
- # shellcheck source=../lib/queue.sh
14
- source "$KIT/lib/queue.sh"
15
-
16
- ROOT="${1:-.}"
17
- [[ -d "$ROOT" ]] || { echo "check-queue-slug-liveness: not a directory: $ROOT" >&2; exit 2; }
18
-
19
- files=()
20
- if [[ ${#QUEUE_KIT_PROSE_SURFACE_GLOBS[@]} -gt 0 ]]; then
21
- shopt -s nullglob globstar
22
- for g in "${QUEUE_KIT_PROSE_SURFACE_GLOBS[@]}"; do
23
- for f in "$ROOT"/$g; do [[ -f "$f" ]] && files+=("$f"); done
24
- done
25
- shopt -u nullglob globstar
26
- fi
27
-
28
- if [[ ${#files[@]} -eq 0 ]]; then
29
- echo "QUEUE-SLUG-LIVENESS: clean (no prose surface configured in QUEUE_KIT_PROSE_SURFACE_GLOBS — nothing to resolve)"
30
- exit 0
31
- fi
32
-
33
- QUEUE="$QUEUE_KIT_QUEUE_FILE"
34
- [[ -f "$QUEUE" ]] || QUEUE="$ROOT/$QUEUE_KIT_QUEUE_FILE"
35
- [[ -f "$QUEUE" ]] || { echo "check-queue-slug-liveness: queue file not found: $QUEUE_KIT_QUEUE_FILE" >&2; exit 2; }
36
-
37
- live_str="$(queue_live_slugs "$QUEUE" | tr '\n' ' ')"; st=${PIPESTATUS[0]}
38
- fail_closed "$st" QUEUE-SLUG-LIVENESS queue_live_slugs
39
-
40
- out="$(awk -v live="$live_str" '
41
- BEGIN { n = split(live, a, " "); for (i = 1; i <= n; i++) L[a[i]] = 1 }
42
- {
43
- s = $0
44
- while (match(s, /\*\*`[a-z0-9][a-z0-9-]*`\*\*/)) {
45
- tok = substr(s, RSTART + 3, RLENGTH - 6)
46
- if (!(tok in L)) printf "%s:%d:%s\n", FILENAME, FNR, tok
47
- s = substr(s, RSTART + RLENGTH)
48
- }
49
- }
50
- ' "${files[@]}")"; st=$?
51
- fail_closed "$st" QUEUE-SLUG-LIVENESS awk
52
-
53
- if [[ -n "$out" ]]; then
54
- echo "check-queue-slug-liveness: bold-code token claims queue membership but names no live task:"
55
- while IFS= read -r line; do printf ' %s\n' "$line"; done <<< "$out"
56
- echo " help: a **\`slug\`** token claims the slug is a live queue task. If the task"
57
- echo " landed, drop the bold-code form and cite its owning SPEC; otherwise fix"
58
- echo " the slug or restore the task to the queue."
59
- exit 1
60
- fi
61
-
62
- echo "QUEUE-SLUG-LIVENESS: clean (${#files[@]} prose surface(s) scanned; every slug-shaped bold-code token resolves to a live task in $QUEUE)"
63
- exit 0
@@ -1,56 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # spec: queue-kit/SPEC.md §check-queue-wrap — no queue line exceeds the wrap budget (Unicode code points), so a runaway never reflows to column 0
4
- #
5
- # usage: check-queue-wrap.sh [queue-file]
6
- # Defaults to the configured queue file (QUEUE_KIT_QUEUE_FILE); the floor is
7
- # QUEUE_KIT_WRAP_BUDGET (default 100; the authoring target is ~80).
8
- set -uo pipefail
9
-
10
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
12
- # shellcheck source=../../gate-sdk/lib/gate.sh
13
- source "$SDK/lib/gate.sh"
14
- # shellcheck source=../lib/queue.sh
15
- source "$KIT/lib/queue.sh"
16
-
17
- FILE="${1:-$QUEUE_KIT_QUEUE_FILE}"
18
- [[ -f "$FILE" ]] || { echo "check-queue-wrap: file not found: $FILE" >&2; exit 2; }
19
-
20
- # comment-tier-exempt: the code-point width trick is below SPEC altitude
21
- # LC_ALL=C makes awk bytewise; cplen() subtracts UTF-8 continuation bytes (0x80–0xBF) to recover width.
22
- out="$(LC_ALL=C awk -v budget="$QUEUE_KIT_WRAP_BUDGET" '
23
- function cplen(s, t, cont) {
24
- t = s
25
- cont = gsub(/[\200-\277]/, "", t)
26
- return length(s) - cont
27
- }
28
- /^[[:space:]]*```/ { fence = !fence; next } # fenced-code delimiter: exempt, toggle
29
- fence { next } # inside a fenced block: exempt
30
- /^[[:space:]]*\|/ { next } # table row: exempt
31
- {
32
- w = cplen($0)
33
- if (w <= budget) next
34
- maxtok = 0
35
- n = split($0, T, /[[:space:]]+/)
36
- for (i = 1; i <= n; i++) { tl = cplen(T[i]); if (tl > maxtok) maxtok = tl }
37
- if (maxtok > budget) next # one unbreakable token (URL/path): no wrap helps
38
- printf "%d\t%d\t%s\n", FNR, w, $0
39
- }
40
- ' "$FILE")"; st=$?
41
- fail_closed "$st" QUEUE-WRAP awk
42
-
43
- if [[ -n "$out" ]]; then
44
- echo "check-queue-wrap: line(s) over the $QUEUE_KIT_WRAP_BUDGET-column budget (a runaway"
45
- echo "that reflows to column 0 corrupts the '- ' lead the tools key on):"
46
- while IFS=$'\t' read -r ln w text; do
47
- [[ -n "$ln" ]] || continue
48
- echo " $FILE:$ln: $w cols — $text"
49
- done <<< "$out"
50
- echo " help: hard-wrap the line at ~80 columns. Exempt already: table rows,"
51
- echo " fenced code, and a line over budget solely from one unbreakable token."
52
- exit 1
53
- fi
54
-
55
- echo "QUEUE-WRAP: clean (no line exceeds $QUEUE_KIT_WRAP_BUDGET columns in $FILE)"
56
- exit 0
@@ -1,70 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # spec: queue-kit/SPEC.md §check-tag-lead-line — every governed tag (blocked-by/spec/design-pending/drain-exempt/roadmap in the task sections, attend + configured lesson tags in Lessons) sits on its bullet's lead line, the only line the tag readers scan
4
- #
5
- # usage: check-tag-lead-line.sh [queue-file]
6
- # Defaults to the configured queue file (QUEUE_KIT_QUEUE_FILE).
7
- set -uo pipefail
8
-
9
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
11
- # shellcheck source=../../gate-sdk/lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
- # shellcheck source=../lib/queue.sh
14
- source "$KIT/lib/queue.sh"
15
-
16
- FILE="${1:-$QUEUE_KIT_QUEUE_FILE}"
17
- [[ -f "$FILE" ]] || { echo "check-tag-lead-line: file not found: $FILE" >&2; exit 2; }
18
-
19
- lessontags="${QUEUE_KIT_LESSON_TAGS[*]+"${QUEUE_KIT_LESSON_TAGS[*]}"}"
20
- out="$(awk -v taskre="$QUEUE_TASK_RE" -v lessonsre="$QUEUE_LESSONS_RE" \
21
- -v sectre="$QUEUE_SECTION_RE" -v lessontags="$lessontags" '
22
- # spec: queue-kit/SPEC.md §check-tag-lead-line — one class table, each entry the tag name plus its bracket terminator; the match literal and the arr[] key both come off it, and scripts/enum-sets.sh reads this same table
23
- BEGIN {
24
- ncls = split("blocked-by: spec: design-pending] attend] drain-exempt: roadmap:", cls, " ")
25
- nlt = split(lessontags, lt, " ")
26
- }
27
- function classes(line, arr, i, nm, term) {
28
- delete arr
29
- for (i = 1; i <= ncls; i++) {
30
- term = substr(cls[i], length(cls[i]))
31
- nm = substr(cls[i], 1, length(cls[i]) - 1)
32
- if (index(line, "[" nm term)) arr[nm] = 1
33
- }
34
- for (i = 1; i <= nlt; i++)
35
- if (index(line, "[" lt[i] "]")) arr[lt[i]] = 1
36
- }
37
- $0 ~ taskre { inscan = 1; leadfnr = 0; delete leadcls; next }
38
- $0 ~ lessonsre { inscan = 1; leadfnr = 0; delete leadcls; next }
39
- $0 ~ sectre { inscan = 0; leadfnr = 0; delete leadcls; next }
40
- !inscan { next }
41
- /^[[:space:]]*```/ { fence = !fence; next }
42
- fence { next }
43
- /^[[:space:]]*\|/ { next } # table row: exempt
44
- /^[[:space:]]*-[[:space:]]/ { # bullet lead line
45
- classes($0, leadcls); leadfnr = FNR; next
46
- }
47
- {
48
- if (leadfnr == 0) next # continuation with no owning bullet
49
- classes($0, cont)
50
- for (k in cont)
51
- if (!(k in leadcls))
52
- printf "%d\t%s\t%d\n", FNR, k, leadfnr
53
- }
54
- ' "$FILE")"; st=$?
55
- fail_closed "$st" TAG-LEAD-LINE awk
56
-
57
- if [[ -n "$out" ]]; then
58
- echo "check-tag-lead-line: tag(s) pushed off the bullet lead line (a tag reader"
59
- echo "scans only the lead; a tag on a continuation line silently stops counting):"
60
- while IFS=$'\t' read -r ln cls lead; do
61
- [[ -n "$ln" ]] || continue
62
- echo " $FILE:$ln: [$cls] on a continuation line; lead line $lead carries no [$cls]"
63
- done <<< "$out"
64
- echo " help: move the tag back onto the bullet's lead line (the '- ...' line). If a"
65
- echo " reflow pushed it there, re-wrap so the lead line carries the tag."
66
- exit 1
67
- fi
68
-
69
- echo "TAG-LEAD-LINE: clean (every governed tag in the task + Lessons sections is on its bullet lead line in $FILE)"
70
- exit 0
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # no-fixture: HEAD-vs-worktree diff — a committed fixture has HEAD == worktree, so the loss case (an uncommitted deletion) has no static-fixture representation (queue-kit/SPEC.md §check-task-conservation).
4
- # spec: queue-kit/SPEC.md §check-task-conservation — every live slug present at HEAD is still present (live or done) in the working tree
5
- #
6
- # usage: check-task-conservation.sh [queue-file]
7
- # Defaults to the configured queue file (QUEUE_KIT_QUEUE_FILE). Diffs
8
- # `git show HEAD:<queue>` against the worktree; no git baseline ⇒ clean exit.
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/queue.sh
16
- source "$KIT/lib/queue.sh"
17
-
18
- FILE="${1:-$QUEUE_KIT_QUEUE_FILE}"
19
-
20
- git rev-parse --git-dir >/dev/null 2>&1 || {
21
- echo "TASK-CONSERVATION: clean (no git repository — no HEAD baseline to compare)"; exit 0; }
22
-
23
- head_tmp="$(mktemp)"
24
- trap 'rm -f "$head_tmp"' EXIT
25
- if ! git show "HEAD:$FILE" >"$head_tmp" 2>/dev/null; then
26
- echo "TASK-CONSERVATION: clean ($FILE not at HEAD — no prior live slugs to conserve)"; exit 0
27
- fi
28
- [[ -f "$FILE" ]] || { echo "check-task-conservation: worktree file not found: $FILE" >&2; exit 2; }
29
-
30
- declare -A present=()
31
- while IFS= read -r s; do [[ -n "$s" ]] && present["$s"]=1; done < <(queue_live_slugs "$FILE")
32
- while IFS= read -r s; do [[ -n "$s" ]] && present["$s"]=1; done < <(queue_done_slugs "$FILE")
33
-
34
- lost=(); conserved=0
35
- while IFS= read -r s; do
36
- [[ -n "$s" ]] || continue
37
- if [[ -n "${present[$s]:-}" ]]; then conserved=$((conserved + 1)); else lost+=("$s"); fi
38
- done < <(queue_live_slugs "$head_tmp")
39
-
40
- if [[ ${#lost[@]} -gt 0 ]]; then
41
- echo "check-task-conservation: live slug(s) present at HEAD but gone from the working"
42
- echo "tree — neither live nor done (a lost task; the absence class diff-review misses):"
43
- printf ' %s\n' "${lost[@]}"
44
- echo " help: restore the entry, or move its slug to the done section if it completed."
45
- echo " A rename must move the old slug to done and sweep every [blocked-by:] ref."
46
- exit 1
47
- fi
48
-
49
- echo "TASK-CONSERVATION: clean ($conserved HEAD live slug(s) all still present in $FILE)"
50
- exit 0
@@ -1,128 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # spec: queue-kit/SPEC.md §check-task-names — task entries lead with a unique kebab slug, done entries are bare slugs, every blocked-by resolves to a live task
4
- #
5
- # usage: check-task-names.sh [queue-file]
6
- # Defaults to the configured queue file (QUEUE_KIT_QUEUE_FILE).
7
- set -uo pipefail
8
-
9
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
11
- # shellcheck source=../../gate-sdk/lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
- # shellcheck source=../lib/queue.sh
14
- source "$KIT/lib/queue.sh"
15
-
16
- FILE="${1:-$QUEUE_KIT_QUEUE_FILE}"
17
- [[ -f "$FILE" ]] || { echo "check-task-names: file not found: $FILE" >&2; exit 2; }
18
-
19
- out="$(awk -v taskre="$QUEUE_TASK_RE" -v donere="$QUEUE_DONE_RE" -v sectre="$QUEUE_SECTION_RE" '
20
- $0 ~ taskre { sec = "task"; next }
21
- $0 ~ donere { sec = "done"; next }
22
- $0 ~ sectre { sec = "other"; next }
23
-
24
- sec == "task" && $0 ~ /^[[:space:]]*-[[:space:]]/ {
25
- indent = match($0, /[^[:space:]]/) - 1
26
- isbold = ($0 ~ /^[[:space:]]*-[[:space:]]+\*\*/)
27
- if (indent == 0 || isbold) {
28
- if ($0 ~ /^[[:space:]]*-[[:space:]]+\*\*[a-z0-9][a-z0-9-]*\*\*/) {
29
- match($0, /\*\*[a-z0-9][a-z0-9-]*\*\*/)
30
- slug = substr($0, RSTART + 2, RLENGTH - 4)
31
- if (slug in live)
32
- printf "dup-slug\t%d\t%s (first seen at line %d)\n", FNR, slug, liveln[slug]
33
- else { live[slug] = 1; liveln[slug] = FNR }
34
- } else if (isbold) {
35
- if (match($0, /\*\*[^*]*\*\*/))
36
- printf "invalid-slug\t%d\t%s\n", FNR, substr($0, RSTART + 2, RLENGTH - 4)
37
- else
38
- printf "invalid-slug\t%d\t%s\n", FNR, "(unparsable bold lead-in)"
39
- } else {
40
- printf "missing-slug\t%d\t%s\n", FNR, $0
41
- }
42
- }
43
- s = $0
44
- while (match(s, /\[blocked-by:[[:space:]]*[a-z0-9][a-z0-9-]*/)) {
45
- ref = substr(s, RSTART, RLENGTH); sub(/\[blocked-by:[[:space:]]*/, "", ref)
46
- nb++; brefs[nb] = ref; breln[nb] = FNR
47
- s = substr(s, RSTART + RLENGTH)
48
- }
49
- next
50
- }
51
-
52
- sec == "done" && $0 ~ /^[[:space:]]*-[[:space:]]/ {
53
- if ($0 ~ /^[[:space:]]*-[[:space:]]+[a-z0-9][a-z0-9-]*[[:space:]]*$/) {
54
- d = $0; sub(/^[[:space:]]*-[[:space:]]+/, "", d); sub(/[[:space:]]*$/, "", d)
55
- done[d] = 1
56
- } else {
57
- printf "bad-done\t%d\t%s\n", FNR, $0
58
- }
59
- next
60
- }
61
-
62
- END {
63
- for (i = 1; i <= nb; i++) {
64
- r = brefs[i]
65
- if (r in live) continue
66
- else if (r in done) printf "stale-blocker\t%d\t%s\n", breln[i], r
67
- else printf "unresolved-blocker\t%d\t%s\n", breln[i], r
68
- }
69
- printf "count\t%d\t%d\n", length(live), length(done)
70
- }
71
- ' "$FILE")"; st=$?
72
- fail_closed "$st" TASK-NAMES awk
73
-
74
- missing=(); invalid=(); dup=(); baddone=(); unresolved=(); stale=(); nlive=0; ndone=0
75
- while IFS=$'\t' read -r class a b; do
76
- case "$class" in
77
- missing-slug) missing+=("$FILE:$a: $b") ;;
78
- invalid-slug) invalid+=("$FILE:$a: $b") ;;
79
- dup-slug) dup+=("$FILE:$a: $b") ;;
80
- bad-done) baddone+=("$FILE:$a: $b") ;;
81
- unresolved-blocker) unresolved+=("$FILE:$a: [blocked-by: $b]") ;;
82
- stale-blocker) stale+=("$FILE:$a: [blocked-by: $b]") ;;
83
- count) nlive="$a"; ndone="$b" ;;
84
- esac
85
- done <<< "$out"
86
-
87
- if (( ${#missing[@]} + ${#invalid[@]} + ${#dup[@]} + ${#baddone[@]} + ${#unresolved[@]} + ${#stale[@]} > 0 )); then
88
- sep=0
89
- emit() { # emit <header-line...> then indented findings then help; blank-separate blocks
90
- (( sep )) && echo ""; sep=1
91
- }
92
- if (( ${#missing[@]} > 0 )); then emit
93
- echo "check-task-names: task entry without a bold kebab-case slug:"
94
- printf ' %s\n' "${missing[@]}"
95
- echo " help: lead the entry with a slug — '- **the-slug** — <prose>'."
96
- fi
97
- if (( ${#invalid[@]} > 0 )); then emit
98
- echo "check-task-names: task entry whose bold lead-in is not a valid slug:"
99
- printf ' %s\n' "${invalid[@]}"
100
- echo " help: a slug matches [a-z0-9][a-z0-9-]* (lowercase kebab-case); for a"
101
- echo " non-task note, use a plain or italic indented bullet instead."
102
- fi
103
- if (( ${#dup[@]} > 0 )); then emit
104
- echo "check-task-names: duplicate slug (active + deferred + sub-tasks are one namespace):"
105
- printf ' %s\n' "${dup[@]}"
106
- echo " help: rename one — a slug is a task's stable handle for its whole life."
107
- fi
108
- if (( ${#baddone[@]} > 0 )); then emit
109
- echo "check-task-names: done entry that is not a bare slug:"
110
- printf ' %s\n' "${baddone[@]}"
111
- echo " help: a done entry is the bare slug only — '- the-slug'; the story lives in git."
112
- fi
113
- if (( ${#unresolved[@]} > 0 )); then emit
114
- echo "check-task-names: blocked-by pointing at no live task:"
115
- printf ' %s\n' "${unresolved[@]}"
116
- echo " help: name a live task (active or deferred); fix the slug or add the blocker."
117
- fi
118
- if (( ${#stale[@]} > 0 )); then emit
119
- echo "check-task-names: stale blocked-by pointing at a completed (done) task:"
120
- printf ' %s\n' "${stale[@]}"
121
- echo " help: the blocker is done — remove the now-stale [blocked-by:] tag (it alone"
122
- echo " keeps the entry unpickable)."
123
- fi
124
- exit 1
125
- fi
126
-
127
- echo "TASK-NAMES: clean ($nlive live slug(s) unique, $ndone done, all blockers resolve to live tasks in $FILE)"
128
- exit 0