checkwright 0.37.0 → 0.39.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 (213) hide show
  1. package/package.json +2 -2
  2. package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
  3. package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
  4. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
  5. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  6. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
  7. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  8. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
  9. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  10. package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
  11. package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
  12. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
  13. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  14. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  15. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  16. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
  17. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  18. package/payload/canon-kit/gate-tests/check-amendment-queue.test.sh +8 -3
  19. package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +3 -3
  20. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +9 -4
  21. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +3 -3
  22. package/payload/canon-kit/gate-tests/check-prose-bounds.test.sh +1 -1
  23. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +2 -2
  24. package/payload/canon-kit/gate-tests/check-provenance-seam/good/TASK-QUEUE.md +4 -0
  25. package/payload/canon-kit/gate-tests/check-provenance-seam/good/widget-toolkit/SPEC.md +1 -1
  26. package/payload/canon-kit/gate-tests/check-todo-task-liveness.test.sh +42 -0
  27. package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +7 -7
  28. package/payload/context-kit/gate-tests/check-surface-ratchet.test.sh +7 -6
  29. package/payload/delegation-kit/README.md +5 -2
  30. package/payload/delegation-kit/checks/check-brief-authority.gate +4 -0
  31. package/payload/delegation-kit/gate-tests/check-brief-authority/bad/args +1 -0
  32. package/payload/delegation-kit/gate-tests/check-brief-authority/bad/expect.txt +3 -0
  33. package/payload/delegation-kit/gate-tests/check-brief-authority/bad/grant.md +4 -0
  34. package/payload/delegation-kit/gate-tests/check-brief-authority/bad/rules.list +5 -0
  35. package/payload/delegation-kit/gate-tests/check-brief-authority/bad/scripts/delegation-config.knobs +2 -0
  36. package/payload/delegation-kit/gate-tests/check-brief-authority/bad/unquoted.md +2 -0
  37. package/payload/delegation-kit/gate-tests/check-brief-authority/good/args +1 -0
  38. package/payload/delegation-kit/gate-tests/check-brief-authority/good/brief.md +5 -0
  39. package/payload/delegation-kit/gate-tests/check-brief-authority/good/expect.txt +1 -0
  40. package/payload/delegation-kit/gate-tests/check-brief-authority/good/rules.list +5 -0
  41. package/payload/delegation-kit/gate-tests/check-brief-authority/good/scripts/delegation-config.knobs +2 -0
  42. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +90 -6
  43. package/payload/delegation-kit/templates/agent-execution.md +1 -1
  44. package/payload/delegation-kit/templates/brief-rules.list +20 -0
  45. package/payload/delegation-kit/templates/delegation-config.knobs +3 -0
  46. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -2
  47. package/payload/drift-kit/README.md +1 -1
  48. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +2 -2
  49. package/payload/evidence-kit/gate-tests/pre-hook.test.sh +5 -5
  50. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +7 -7
  51. package/payload/evidence-kit/gate-tests/statement-store.test.sh +5 -5
  52. package/payload/evidence-kit/gate-tests/verify-gate-run-strict.test.sh +5 -4
  53. package/payload/gate-sdk/README.md +7 -0
  54. package/payload/gate-sdk/bin/build-native.sh +5 -4
  55. package/payload/gate-sdk/bin/run-gates.ps1 +8 -7
  56. package/payload/gate-sdk/bin/run-gates.sh +10 -8
  57. package/payload/gate-sdk/checks/check-binary-strings.gate +4 -0
  58. package/payload/gate-sdk/checks/check-exec-write.gate +4 -0
  59. package/payload/gate-sdk/checks/check-migration-guard.gate +4 -0
  60. package/payload/gate-sdk/checks/check-path-names.gate +4 -0
  61. package/payload/gate-sdk/checks/check-pipefail-readers.gate +4 -0
  62. package/payload/gate-sdk/checks/check-script-preflight.gate +4 -0
  63. package/payload/gate-sdk/checks/check-site-count.gate +4 -0
  64. package/payload/gate-sdk/checks/check-tree-terms.gate +1 -1
  65. package/payload/gate-sdk/gate-tests/binary-only-recipe.test.sh +2 -2
  66. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +11 -11
  67. package/payload/gate-sdk/gate-tests/check-binary-strings/bad/expect.txt +4 -0
  68. package/payload/gate-sdk/gate-tests/check-binary-strings/bad/out/app.elf +0 -0
  69. package/payload/gate-sdk/gate-tests/check-binary-strings/bad/out/notes.bin +0 -0
  70. package/payload/gate-sdk/gate-tests/check-binary-strings/bad/scripts/gate-sdk-config.knobs +3 -0
  71. package/payload/gate-sdk/gate-tests/check-binary-strings/bad/shapes.list +2 -0
  72. package/payload/gate-sdk/gate-tests/check-binary-strings/bad/terms.list +2 -0
  73. package/payload/gate-sdk/gate-tests/check-binary-strings/good/expect.txt +1 -0
  74. package/payload/gate-sdk/gate-tests/check-binary-strings/good/out/app.elf +0 -0
  75. package/payload/gate-sdk/gate-tests/check-binary-strings/good/scripts/gate-sdk-config.knobs +3 -0
  76. package/payload/gate-sdk/gate-tests/check-binary-strings/good/shapes.list +2 -0
  77. package/payload/gate-sdk/gate-tests/check-binary-strings/good/terms.list +4 -0
  78. package/payload/gate-sdk/gate-tests/check-binary-strings.test.sh +74 -0
  79. package/payload/gate-sdk/gate-tests/check-exec-write/bad/expect.txt +13 -0
  80. package/payload/gate-sdk/gate-tests/check-exec-write/bad/scripts/gate-sdk-config.knobs +2 -0
  81. package/payload/gate-sdk/gate-tests/check-exec-write/bad/src/caller.rs +5 -0
  82. package/payload/gate-sdk/gate-tests/check-exec-write/bad/src/helper.rs +5 -0
  83. package/payload/gate-sdk/gate-tests/check-exec-write/bad/src/sites.rs +19 -0
  84. package/payload/gate-sdk/gate-tests/check-exec-write/good/expect.txt +1 -0
  85. package/payload/gate-sdk/gate-tests/check-exec-write/good/scripts/gate-sdk-config.knobs +2 -0
  86. package/payload/gate-sdk/gate-tests/check-exec-write/good/src/helper.rs +5 -0
  87. package/payload/gate-sdk/gate-tests/check-exec-write/good/src/main.rs +15 -0
  88. package/payload/gate-sdk/gate-tests/check-exec-write.test.sh +69 -0
  89. package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/args +1 -1
  90. package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/expect.txt +1 -1
  91. package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/agent-budget-guard.md +20 -0
  92. package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/agent-dispatch-guard.md +14 -0
  93. package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/escalation-guard.md +7 -0
  94. package/payload/gate-sdk/gate-tests/check-hook-knobs-fresh/good/hooks/wakeup-guard.md +9 -0
  95. package/payload/gate-sdk/gate-tests/check-identity.test.sh +2 -2
  96. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/args +2 -0
  97. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/base/0001_init.sql +1 -0
  98. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/base/0002_orders.sql +1 -0
  99. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/base/0003_audit.sql +1 -0
  100. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/destructive.list +4 -0
  101. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/expect.txt +7 -0
  102. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0001_init.sql +1 -0
  103. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0002_late.sql +1 -0
  104. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0003_audit_log.sql +1 -0
  105. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/migrations/0004_prune.sql +3 -0
  106. package/payload/gate-sdk/gate-tests/check-migration-guard/bad/scripts/gate-sdk-config.knobs +2 -0
  107. package/payload/gate-sdk/gate-tests/check-migration-guard/good/args +2 -0
  108. package/payload/gate-sdk/gate-tests/check-migration-guard/good/base/0001_init.sql +1 -0
  109. package/payload/gate-sdk/gate-tests/check-migration-guard/good/base/0002_legacy.sql +1 -0
  110. package/payload/gate-sdk/gate-tests/check-migration-guard/good/destructive.list +4 -0
  111. package/payload/gate-sdk/gate-tests/check-migration-guard/good/expect.txt +1 -0
  112. package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0001_init.sql +1 -0
  113. package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0002_legacy.sql +1 -0
  114. package/payload/gate-sdk/gate-tests/check-migration-guard/good/migrations/0003_retire_legacy.sql +6 -0
  115. package/payload/gate-sdk/gate-tests/check-migration-guard/good/scripts/gate-sdk-config.knobs +2 -0
  116. package/payload/gate-sdk/gate-tests/check-migration-guard.test.sh +136 -0
  117. package/payload/gate-sdk/gate-tests/check-path-names/bad/expect.txt +6 -0
  118. package/payload/gate-sdk/gate-tests/check-path-names/bad/scripts/gate-sdk-config.knobs +1 -0
  119. package/payload/gate-sdk/gate-tests/check-path-names/bad/terms.list +3 -0
  120. package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/ZePhYr.md +1 -0
  121. package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo/a.txt +1 -0
  122. package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo/zephyr.txt +1 -0
  123. package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo-cli.sh +1 -0
  124. package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo.rs +1 -0
  125. package/payload/gate-sdk/gate-tests/check-path-names/bad/tree/foo_x.txt +1 -0
  126. package/payload/gate-sdk/gate-tests/check-path-names/good/expect.txt +1 -0
  127. package/payload/gate-sdk/gate-tests/check-path-names/good/scripts/gate-sdk-config.knobs +1 -0
  128. package/payload/gate-sdk/gate-tests/check-path-names/good/terms.list +1 -0
  129. package/payload/gate-sdk/gate-tests/check-path-names/good/tree/foobar.rs +1 -0
  130. package/payload/gate-sdk/gate-tests/check-path-names/good/tree/food/a.txt +1 -0
  131. package/payload/gate-sdk/gate-tests/check-path-names/good/tree/xfoo.txt +1 -0
  132. package/payload/gate-sdk/gate-tests/check-path-names.test.sh +66 -0
  133. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/baseline.tsv +4 -0
  134. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/expect.txt +17 -0
  135. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/scripts/gate-sdk-config.knobs +2 -0
  136. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/over.sh +5 -0
  137. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/readers.sh +16 -0
  138. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/shared-lib.sh +3 -0
  139. package/payload/gate-sdk/gate-tests/check-pipefail-readers/bad/tree/stale.sh +4 -0
  140. package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/baseline.tsv +2 -0
  141. package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/expect.txt +1 -0
  142. package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/scripts/gate-sdk-config.knobs +2 -0
  143. package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/tree/clean.sh +17 -0
  144. package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/tree/lib/baselined-lib.sh +4 -0
  145. package/payload/gate-sdk/gate-tests/check-pipefail-readers/good/tree/no-pipefail.sh +4 -0
  146. package/payload/gate-sdk/gate-tests/check-pipefail-readers.test.sh +114 -0
  147. package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +1 -1
  148. package/payload/gate-sdk/gate-tests/check-script-preflight/bad/expect.txt +10 -0
  149. package/payload/gate-sdk/gate-tests/check-script-preflight/bad/rules.list +23 -0
  150. package/payload/gate-sdk/gate-tests/check-script-preflight/bad/scripts/gate-sdk-config.knobs +2 -0
  151. package/payload/gate-sdk/gate-tests/check-script-preflight/bad/tree/submit-job.sh +13 -0
  152. package/payload/gate-sdk/gate-tests/check-script-preflight/good/expect.txt +1 -0
  153. package/payload/gate-sdk/gate-tests/check-script-preflight/good/rules.list +23 -0
  154. package/payload/gate-sdk/gate-tests/check-script-preflight/good/scripts/gate-sdk-config.knobs +2 -0
  155. package/payload/gate-sdk/gate-tests/check-script-preflight/good/tree/submit-job.sh +17 -0
  156. package/payload/gate-sdk/gate-tests/check-script-preflight.test.sh +110 -0
  157. package/payload/gate-sdk/gate-tests/check-site-count/bad/expect.txt +4 -0
  158. package/payload/gate-sdk/gate-tests/check-site-count/bad/rules.list +5 -0
  159. package/payload/gate-sdk/gate-tests/check-site-count/bad/scripts/gate-sdk-config.knobs +1 -0
  160. package/payload/gate-sdk/gate-tests/check-site-count/bad/sites.tsv +3 -0
  161. package/payload/gate-sdk/gate-tests/check-site-count/bad/tree/new.txt +1 -0
  162. package/payload/gate-sdk/gate-tests/check-site-count/bad/tree/over.txt +3 -0
  163. package/payload/gate-sdk/gate-tests/check-site-count/bad/tree/under.txt +1 -0
  164. package/payload/gate-sdk/gate-tests/check-site-count/good/expect.txt +1 -0
  165. package/payload/gate-sdk/gate-tests/check-site-count/good/rules.list +5 -0
  166. package/payload/gate-sdk/gate-tests/check-site-count/good/scripts/gate-sdk-config.knobs +1 -0
  167. package/payload/gate-sdk/gate-tests/check-site-count/good/sites.tsv +2 -0
  168. package/payload/gate-sdk/gate-tests/check-site-count/good/tree/blob.bin +0 -0
  169. package/payload/gate-sdk/gate-tests/check-site-count/good/tree/pinned.txt +2 -0
  170. package/payload/gate-sdk/gate-tests/check-site-count/good/tree/plain.txt +1 -0
  171. package/payload/gate-sdk/gate-tests/check-site-count/good/tree/tests/helper.txt +2 -0
  172. package/payload/gate-sdk/gate-tests/check-site-count.test.sh +90 -0
  173. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +11 -8
  174. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +4 -1
  175. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/scripts/gate-sdk-config.knobs +1 -0
  176. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/terms.list +4 -0
  177. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/terms.txt +2 -0
  178. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
  179. package/payload/gate-sdk/gate-tests/check-tree-terms/good/scripts/gate-sdk-config.knobs +1 -0
  180. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/rosters/terms.list +2 -0
  181. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/words.txt +1 -0
  182. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +36 -16
  183. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +5 -6
  184. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +8 -8
  185. package/payload/gate-sdk/gate-tests/native-git-hooks.test.sh +7 -7
  186. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +4 -4
  187. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +3 -3
  188. package/payload/gate-sdk/gate-tests/run-gates-linked-worktree.test.sh +6 -6
  189. package/payload/gate-sdk/gate-tests/run-json.test.sh +52 -0
  190. package/payload/gate-sdk/gate-tests/verdict-store.test.sh +99 -0
  191. package/payload/gate-sdk/lib/gate.sh +12 -9
  192. package/payload/gate-sdk/lib/test-hermetic.sh +2 -2
  193. package/payload/gate-sdk/templates/check-skeleton.sh +2 -1
  194. package/payload/gate-sdk/templates/migration-destructive.list +10 -0
  195. package/payload/gate-sdk/templates/script-rules.list +39 -0
  196. package/payload/gate-sdk/templates/strings-shapes.list +15 -0
  197. package/payload/guard-kit/gate-tests/consumer-rules.test.sh +5 -5
  198. package/payload/guard-kit/gate-tests/door-binding-corpus.test.sh +2 -2
  199. package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +1 -1
  200. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry.test.sh +1 -1
  201. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +3 -3
  202. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +1 -1
  203. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -2
  204. package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +18 -2
  205. package/payload/lifecycle-kit/gate-tests/peer-channel.test.sh +35 -6
  206. package/payload/lifecycle-kit/gate-tests/preflight-valve.test.sh +4 -4
  207. package/payload/lifecycle-kit/templates/consult.md +1 -1
  208. package/payload/lifecycle-kit/templates/stages/scope.md +1 -1
  209. package/payload/queue-kit/README.md +1 -1
  210. package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +2 -2
  211. package/payload/queue-kit/gate-tests/check-task-conservation.test.sh +4 -4
  212. package/payload/site-kit/gate-tests/check-docs-liquid-parse-parser.test.sh +4 -4
  213. package/payload/site-kit/gate-tests/check-docs-render-fidelity-batch.test.sh +9 -9
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "checkwright-pwsh": "bin/checkwright.ps1"
5
5
  },
6
6
  "checkwright": {
7
- "commit": "d504ae4e87881881bf214e05521d475d1c874328",
7
+ "commit": "892e3205c56b5fc4d86189219d1d774a74fd1b06",
8
8
  "spec_base_url": "https://checkwright.dev"
9
9
  },
10
10
  "description": "Reproducible checks that catch unsupported claims in coding-agent delivery before merge: a task marked done with no recorded test run, a skipped lifecycle stage, a spec naming a file the tree lacks. They prove the evidence a claim rests on exists, not that the code is correct.",
@@ -30,5 +30,5 @@
30
30
  "type": "git",
31
31
  "url": "git+https://github.com/checkwright/checkwright.git"
32
32
  },
33
- "version": "0.37.0"
33
+ "version": "0.39.0"
34
34
  }
@@ -1 +1 @@
1
- a32df8289ae3f7b900d9497c110d40cb7baa78b3076b926373b6b3dae96c5557 checkwright-gates
1
+ 86e0016a79259df3d8d4858427c6cffc2b2019f8acd8303432cd2fb00fd1407e checkwright-gates
@@ -1 +1 @@
1
- fc003cff11bb93bd3819618f0535a1e0c3fa3ef5252d416fcba44b676846a4aa *checkwright-gates.exe
1
+ 6a1c469eff394cd85836f6f7fb54229d745ae2e1f5bba34ffa3cf1b903147e3c *checkwright-gates.exe
@@ -1 +1 @@
1
- 578dce6e505f7405b20ed41a7160341088d45fc4eff046cb5d9aa0faac88c93a checkwright-gates
1
+ 4a549a4b73980ad9e5dfdbaf2d50bbafd54a11f76cb9c894b24ffbfce1e55e13 checkwright-gates
@@ -1 +1 @@
1
- 945b49d305b822ae7f982c2eb63f9a017e7d983df83557d16c889ce139a1635d checkwright-gates
1
+ bfe700ee5b61391413ffc1413296c47f59bc574cb1139e658d8badb12eafc1b1 checkwright-gates
@@ -1 +1 @@
1
- 50ceec32d0fbe00b27884dbe25aba28d8f36f0c8c71bf0eb5637b8a18159bfbd checkwright-gates
1
+ 0397efb3d03bd967a535896b23c5f7dcb4350fcccaa205a581dc8231b07fbd94 checkwright-gates
@@ -1 +1 @@
1
- 03506ead66ccfcfea415195e4e0484f2681038139eb0fd4dd6b01dce148e0827 *checkwright-gates.exe
1
+ ad05dc0ad3a1d300192d3eb21d3c7bdf16fb02fed998a0cddfcf5631120735a7 *checkwright-gates.exe
@@ -1 +1 @@
1
- 855372d495c45ef05686187b7234dd49fe81c7dd96c83d42c51339626ef18622 checkwright-gates
1
+ 2079dd8e6489b397d0de8f5b67a27b0816e0a468e5d63af42fd8c62fc7232be1 checkwright-gates
@@ -1 +1 @@
1
- 44a607f52c4f6568af711b6e58d1b91ef0689661582e58ee7e7678d8b45fece4 checkwright-gates
1
+ f4b996865880fc42a5683cac7c8e7eddd44fff6b106925991c0e7537a689080b checkwright-gates
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # spec: canon-kit/SPEC.md §check-amendment-queue — the absent-queue clean and the wrong-kind refusal,
3
- # arms the pair cannot spell: its good/ holds a queue, and exit 2 has no pair spelling
3
+ # arms the pair cannot spell: its good/ holds a queue, and exit 3 has no pair spelling
4
4
  #
5
5
  # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
6
6
  set -uo pipefail
@@ -29,11 +29,16 @@ check_case() { # $1=label $2=want-rc $3=want-substring $4=queue path
29
29
  check_case "absent-queue-is-not-applicable" 0 "clean (not applicable: no queue file at" "$SANDBOX/TASK-QUEUE.md"
30
30
 
31
31
  mkdir -p "$SANDBOX/dirqueue"
32
- check_case "non-file-queue-fails-closed" 2 "not a file" "$SANDBOX/dirqueue"
32
+ check_case "non-file-queue-fails-closed" 3 "not a file" "$SANDBOX/dirqueue"
33
+
34
+ ln -s "$SANDBOX/gone.md" "$SANDBOX/danglingqueue" 2>/dev/null
35
+ if [[ -L "$SANDBOX/danglingqueue" ]]; then
36
+ check_case "dangling-link-queue-fails-closed" 3 "not a file" "$SANDBOX/danglingqueue"
37
+ fi
33
38
 
34
39
  if [[ "$fails" -gt 0 ]]; then
35
40
  echo "check-amendment-queue.test.sh: $fails case(s) failed"
36
41
  exit 1
37
42
  fi
38
- echo "check-amendment-queue.test.sh: clean (an absent queue is not applicable; a queue path naming a directory refuses)"
43
+ echo "check-amendment-queue.test.sh: clean (an absent queue is not applicable; a queue path naming a directory or a dangling link refuses)"
39
44
  exit 0
@@ -50,7 +50,7 @@ cat >"$SANDBOX/nowhat/SPEC-x.md" <<'EOF'
50
50
 
51
51
  - **component/SPEC.md** — an update target in an amendment with no deltas.
52
52
  EOF
53
- check_case "updated-without-what-changes-fails-closed" 2 "but no '## What changes'" "$SANDBOX/nowhat"
53
+ check_case "updated-without-what-changes-fails-closed" 3 "but no '## What changes'" "$SANDBOX/nowhat"
54
54
 
55
55
  # The two permission-shaped refusals. A tree where the sandbox owner can read
56
56
  # what it just made unreadable proves nothing, so each is probed before it is
@@ -61,7 +61,7 @@ chmod 000 "$SANDBOX/unread/SPEC-y.md"
61
61
  if cat "$SANDBOX/unread/SPEC-y.md" >/dev/null 2>&1; then
62
62
  echo " SKIP [unreadable-amendment-fails-closed]: this user reads a 0000 file"
63
63
  else
64
- check_case "unreadable-amendment-fails-closed" 2 "cannot read" "$SANDBOX/unread"
64
+ check_case "unreadable-amendment-fails-closed" 3 "cannot read" "$SANDBOX/unread"
65
65
  fi
66
66
 
67
67
  mkdir -p "$SANDBOX/unwalk/sub"
@@ -71,7 +71,7 @@ if ls "$SANDBOX/unwalk/sub" >/dev/null 2>&1; then
71
71
  else
72
72
  # The divergence from check-amendment-queue's best-effort finder, executable:
73
73
  # an empty amendment set hides every violation here, so the walk refuses.
74
- check_case "unwalkable-root-fails-closed" 2 "cannot read directory" "$SANDBOX/unwalk"
74
+ check_case "unwalkable-root-fails-closed" 3 "cannot read directory" "$SANDBOX/unwalk"
75
75
  fi
76
76
 
77
77
  if [[ "$fails" -gt 0 ]]; then
@@ -7,7 +7,7 @@
7
7
  # failure classes at once (stale done slug, absent slug, unbound marker); this
8
8
  # unit pins the paths that pair cannot: the empty-roster clean skip, that each
9
9
  # failure class is reported under its own heading with the right slug, and that
10
- # an unreadable queue is fail-closed.
10
+ # an absent queue is not applicable while a non-file queue path is fail-closed.
11
11
  #
12
12
  # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
13
13
  set -uo pipefail
@@ -89,13 +89,18 @@ if grep -qF -- "live-teardown" <<<"$out"; then
89
89
  fails=$((fails + 1))
90
90
  fi
91
91
 
92
- # An unreadable queue is a fail-closed harness error (exit 2), never a silent pass.
93
- check_case "queue-missing-fail-closed" 2 "queue file not found" \
92
+ # An absent queue is an absent subject: not applicable even with markers on the surface.
93
+ check_case "queue-absent-not-applicable" 0 "clean (not applicable: no queue file at" \
94
94
  CANON_KIT_KNOB_FILE="$SANDBOX/cfg.knobs" CANON_KIT_QUEUE_FILE="$SANDBOX/nope.md"
95
95
 
96
+ # A queue path naming anything but a file is a fail-closed harness error (exit 3).
97
+ mkdir -p "$SANDBOX/dirqueue"
98
+ check_case "queue-non-file-fail-closed" 3 "not a file" \
99
+ CANON_KIT_KNOB_FILE="$SANDBOX/cfg.knobs" CANON_KIT_QUEUE_FILE="$SANDBOX/dirqueue"
100
+
96
101
  if [[ "$fails" -gt 0 ]]; then
97
102
  echo "check-deprecation-task.test.sh: $fails case(s) failed"
98
103
  exit 1
99
104
  fi
100
- echo "check-deprecation-task.test.sh: clean (empty-roster skip + stale/absent/unbound classes + live-bound clean + missing-queue fail-closed)"
105
+ echo "check-deprecation-task.test.sh: clean (empty-roster skip + stale/absent/unbound classes + live-bound clean + absent-queue not-applicable + non-file-queue fail-closed)"
101
106
  exit 0
@@ -53,7 +53,7 @@ cat >"$SANDBOX/SPEC.md" <<'EOF'
53
53
  <!-- measured: gate-tally=7 -->
54
54
  The registry holds 7 gates today.
55
55
  EOF
56
- check_case "unknown-key-fails-closed" 2 "key 'gate-tally' is absent from the emitter's roster" cfg.knobs
56
+ check_case "unknown-key-fails-closed" 3 "key 'gate-tally' is absent from the emitter's roster" cfg.knobs
57
57
 
58
58
  # The authoring contract arm C prices: a bound claim carrying more than one
59
59
  # distinct cardinal is ambiguous, and the gate refuses to guess which one the
@@ -64,7 +64,7 @@ cat >"$SANDBOX/SPEC.md" <<'EOF'
64
64
  <!-- measured: gate-total=7 -->
65
65
  The registry holds 7 gates across 3 kits today.
66
66
  EOF
67
- check_case "ambiguous-claim-fails-closed" 2 "2 distinct cardinals" cfg.knobs
67
+ check_case "ambiguous-claim-fails-closed" 3 "2 distinct cardinals" cfg.knobs
68
68
 
69
69
  # A marker that does not parse is an authoring error, never a site to skip: a
70
70
  # skipped malformed marker is an unchecked claim that looks checked.
@@ -74,7 +74,7 @@ cat >"$SANDBOX/SPEC.md" <<'EOF'
74
74
  <!-- measured: gate-total -->
75
75
  The registry holds 7 gates today.
76
76
  EOF
77
- check_case "malformed-marker-fails-closed" 2 "marker does not parse" cfg.knobs
77
+ check_case "malformed-marker-fails-closed" 3 "marker does not parse" cfg.knobs
78
78
 
79
79
  # Inactive by default: with no oracle command the gate has nothing to check a
80
80
  # marker against, and reports clean rather than reddening every marker in a
@@ -81,7 +81,7 @@ check_case "below" 1 "lower the row to '2 a.md'" "$out" "$rc"
81
81
 
82
82
  ceiling "2 a.md" "1 b.md" "1 b.md"
83
83
  out="$(run)"; rc=$?
84
- check_case "duplicate-row" 2 "a second row for 'b.md'" "$out" "$rc"
84
+ check_case "duplicate-row" 3 "a second row for 'b.md'" "$out" "$rc"
85
85
 
86
86
  rm -f "$SANDBOX/ceiling.txt"
87
87
  out="$(run)"; rc=$?
@@ -44,14 +44,14 @@ CANON_KIT_ENUM_SETS_CMD[] = bash
44
44
  CANON_KIT_ENUM_SETS_CMD[] = -c
45
45
  CANON_KIT_ENUM_SETS_CMD[] = echo hi; exit 4
46
46
  EOF
47
- check_case "cmd-error-fail-closed" 2 "" CANON_KIT_KNOB_FILE="$SANDBOX/boom.knobs"
47
+ check_case "cmd-error-fail-closed" 3 "" CANON_KIT_KNOB_FILE="$SANDBOX/boom.knobs"
48
48
 
49
49
  # Fail-closed: an emitted line with no tab does not parse.
50
50
  cat >"$SANDBOX/notab.knobs" <<'EOF'
51
51
  CANON_KIT_ENUM_SETS_CMD[] = printf
52
52
  CANON_KIT_ENUM_SETS_CMD[] = sig-no-tab-here\n
53
53
  EOF
54
- check_case "cmd-unparsable-fail-closed" 2 "" CANON_KIT_KNOB_FILE="$SANDBOX/notab.knobs"
54
+ check_case "cmd-unparsable-fail-closed" 3 "" CANON_KIT_KNOB_FILE="$SANDBOX/notab.knobs"
55
55
 
56
56
  # Bracketed matching: the same member reads inside [alpha] tag syntax, so a
57
57
  # bracketed hand list that drops gamma trips just as a bare list does — the path
@@ -10,6 +10,10 @@ rework the sprocket.
10
10
 
11
11
  a unit named after the kit it mints.
12
12
 
13
+ ### close-surfaces
14
+
15
+ a unit named after the arm it mints.
16
+
13
17
  ## Done
14
18
 
15
19
  - finished-gearbox-unit
@@ -11,7 +11,7 @@ file from the configured one.
11
11
  A keyed pair such as `spec=scope` is one element. The wire's default pairs
12
12
  `build=scope` and `validate=build` are the kit's own.
13
13
 
14
- widget-toolkit ships one gate. The operator reads its report close-over-close.
14
+ widget-toolkit ships one gate, and the close-surfaces arm's contract sits under `docs/contracts/close-surfaces/v1/`. The operator reads its report close-over-close.
15
15
 
16
16
  The counter saturates at 2147483646, and a defaced widget is rebuilt.
17
17
 
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bash
2
+ # spec: canon-kit/SPEC.md §check-todo-task-liveness — the absent-queue clean, with a marker on the
3
+ # surface, and the wrong-kind refusal: arms the pair cannot spell, since its good/ holds a queue
4
+ # and exit 2 has no pair spelling
5
+ #
6
+ # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
7
+ set -uo pipefail
8
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
9
+
10
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11
+ SANDBOX="$(mktemp -d)"
12
+ trap 'rm -rf "$SANDBOX"' EXIT
13
+
14
+ fails=0
15
+
16
+ printf '#!/usr/bin/env bash\n# TODO(task: ghost-task) a marker no queue resolves\necho hi\n' >"$SANDBOX/src.sh"
17
+
18
+ check_case() { # $1=label $2=want-rc $3=want-substring $4=queue path
19
+ local label="$1" want="$2" sub="$3" queue="$4"
20
+ local out rc
21
+ out="$(cd "$SANDBOX" && gate_run check-todo-task-liveness "$DIR/checks" "$SANDBOX" "$queue" 2>&1)"
22
+ rc=$?
23
+ if [[ "$rc" -ne "$want" ]]; then
24
+ echo " FAIL [$label]: want exit $want, got $rc -- $out"; fails=$((fails + 1)); return
25
+ fi
26
+ if ! grep -qF -- "$sub" <<<"$out"; then
27
+ echo " FAIL [$label]: exit $rc OK but output lacks '$sub':"; printf ' %s\n' "$out"
28
+ fails=$((fails + 1))
29
+ fi
30
+ }
31
+
32
+ check_case "absent-queue-is-not-applicable" 0 "clean (not applicable: no queue file at" "$SANDBOX/TASK-QUEUE.md"
33
+
34
+ mkdir -p "$SANDBOX/dirqueue"
35
+ check_case "non-file-queue-fails-closed" 3 "not a file" "$SANDBOX/dirqueue"
36
+
37
+ if [[ "$fails" -gt 0 ]]; then
38
+ echo "check-todo-task-liveness.test.sh: $fails case(s) failed"
39
+ exit 1
40
+ fi
41
+ echo "check-todo-task-liveness.test.sh: clean (an absent queue is not applicable with a marker on the surface; a queue path naming a directory refuses)"
42
+ exit 0
@@ -55,21 +55,21 @@ check_case() { # $1=label $2=want-rc $3=want-substring $4=config
55
55
 
56
56
  # The configured baseline: with a class declared, the sentence above is red.
57
57
  # Every fail-closed case below differs from this one only in the vocabulary, so
58
- # a case that exits 2 proves the loader refused rather than that nothing matched.
58
+ # a case that exits 3 proves the loader refused rather than that nothing matched.
59
59
  check_case "declared-class-is-red" 1 "falls in claim class 'engine-substrate'" ok.knobs
60
60
 
61
61
  # Arm B, inherited whole from the shared command adapter: a roster that cannot be
62
62
  # read leaves the gate holding no class, and a gate holding no class must not
63
63
  # report the clean it did not earn.
64
- check_case "emitter-error-fails-closed" 2 "exited 3" err.knobs
65
- check_case "no-tab-fails-closed" 2 "line has no tab" notab.knobs
66
- check_case "non-slug-id-fails-closed" 2 "id is not slug-shaped" badid.knobs
67
- check_case "duplicate-id-fails-closed" 2 "duplicate id" dup.knobs
68
- check_case "extra-tab-fails-closed" 2 "extra tab in line" extratab.knobs
64
+ check_case "emitter-error-fails-closed" 3 "exited 3" err.knobs
65
+ check_case "no-tab-fails-closed" 3 "line has no tab" notab.knobs
66
+ check_case "non-slug-id-fails-closed" 3 "id is not slug-shaped" badid.knobs
67
+ check_case "duplicate-id-fails-closed" 3 "duplicate id" dup.knobs
68
+ check_case "extra-tab-fails-closed" 3 "extra tab in line" extratab.knobs
69
69
 
70
70
  # The pattern is consumer-authored, so an ERE that does not compile is the same
71
71
  # unreadable-roster failure one step later, and takes the same exit.
72
- check_case "uncompilable-ere-fails-closed" 2 "does not compile" uncompilable.knobs
72
+ check_case "uncompilable-ere-fails-closed" 3 "does not compile" uncompilable.knobs
73
73
 
74
74
  # The two clean skips a fixture pair cannot tell apart: no vocabulary configured
75
75
  # at all, and one configured that declared nothing. Both are green and they are
@@ -2,8 +2,9 @@
2
2
  # Behavioral test of the refusal axis the good/bad pair cannot hold: the pair
3
3
  # fixes the over-vs-under axis (exit 1 vs exit 0) and always supplies a
4
4
  # well-formed ceiling file, so neither case can express an absent file or an
5
- # unparsable row. Both are exit 2 — a ratchet with no readable ceilings is a
6
- # broken machine, not a clean tree — which run-gate-tests reads as a harness
5
+ # unparsable row. An absent file is exit 2 (the surface the consumer has not
6
+ # written) and an unparsable row exit 3 — a ratchet with no readable ceilings is
7
+ # a broken machine, not a clean tree — which run-gate-tests reads as a harness
7
8
  # error from a bad/ tree, so it lives here. The sandbox is outside any git
8
9
  # repository, so every case leaves CONTEXT_KIT_RATCHET_PATHS empty; the git arm
9
10
  # is what the pair exercises.
@@ -54,14 +55,14 @@ check_case "absent-ceiling-file-fails-closed" 2 "cannot read the ceiling file" a
54
55
 
55
56
  # A row the reader cannot parse is refused for the same reason one row down:
56
57
  # dropping it would leave exactly that surface silently ungoverned.
57
- check_case "unparsable-row-fails-closed" 2 "unparsable ceiling row" unparsable
58
+ check_case "unparsable-row-fails-closed" 3 "unparsable ceiling row" unparsable
58
59
 
59
60
  # A row in the retired line unit carries no code-point figure, so it is refused with the re-stamp
60
61
  # named rather than compared as if its number were code points.
61
- check_case "line-unit-row-fails-closed" 2 "--emit always-loaded --ceiling" legacy
62
+ check_case "line-unit-row-fails-closed" 3 "--emit always-loaded --ceiling" legacy
62
63
 
63
64
  # The floor the refusals sit on: a well-formed file over a surface at its
64
- # ceiling is clean, so the exit 2s above are the grammar failing and not the rule.
65
+ # ceiling is clean, so the refusals above are the grammar failing and not the rule.
65
66
  check_case "well-formed-ceiling-is-clean" 0 "SURFACE-RATCHET: clean (1 governed file" sized
66
67
 
67
68
  # A row whose file is gone is a narrowing, and a ratchet that redded on a
@@ -72,5 +73,5 @@ if [[ "$fails" -gt 0 ]]; then
72
73
  echo "check-surface-ratchet.test.sh: $fails case(s) failed"
73
74
  exit 1
74
75
  fi
75
- echo "check-surface-ratchet.test.sh: clean (absent file, unparsable row and line-unit row exit 2, well-formed file clean, stale row ignored, 5 cases)"
76
+ echo "check-surface-ratchet.test.sh: clean (absent file exit 2, unparsable row and line-unit row exit 3, well-formed file clean, stale row ignored, 5 cases)"
76
77
  exit 0
@@ -16,6 +16,7 @@ Vendor the kit beside [gate-sdk](../gate-sdk/) (required), then:
16
16
  ```
17
17
  check-gate-tamper
18
18
  check-agent-tier-explicit # every tracked agent definition states a model: tier
19
+ check-brief-authority # a brief names no forbidden grant and every required section
19
20
  ```
20
21
  <!-- gate-roster:end -->
21
22
 
@@ -53,9 +54,11 @@ gates="${GATE_SDK_NATIVE_BIN:-./scripts/checkwright-gates}"
53
54
  "$gates" --wait-probe report # classify the recorded trials and print the verdict (exit 1 when none are)
54
55
  ```
55
56
 
56
- With `DELEGATION_KIT_USAGE_HISTORY` set, `usage-verdict` logs one sample per call; `--emit usage-trend` reads that log and reports per-window footprint evolution and weekly headroom (advisory — exit 0/2, never a pause verdict).
57
+ With `DELEGATION_KIT_USAGE_HISTORY` set, `usage-verdict` logs one sample per call; `--emit usage-trend` reads that log and reports per-window footprint evolution and weekly headroom (advisory — exit 0, 2 or 3, never a pause verdict).
57
58
 
58
- `check-gate-tamper` runs from the pre-commit hook and the battery; invoke it directly with `--fixture <dir>` only for testing.
59
+ `check-gate-tamper` runs from the pre-commit hook and the battery. A supervisor checks a range of commits it received with `checkwright-gates check-gate-tamper --range <base>..<head>`; `--fixture <dir>` is for testing.
60
+
61
+ `check-brief-authority` reads only the briefs named as its operands, so the battery's run skips it. A dispatcher runs `checkwright-gates check-brief-authority <brief>…` on a brief before handing it over, with `templates/brief-rules.list` copied into the gates dir and named in `DELEGATION_KIT_BRIEF_RULES`.
59
62
 
60
63
  ## Test
61
64
 
@@ -0,0 +1,4 @@
1
+ # graph: couples=knob:GATE_SDK_GATES_DIR/brief-rules.list dir=one valve=none tier=precommit
2
+ # install: on-surface
3
+ # armed-by: content DELEGATION_KIT_BRIEF_RULES
4
+ # spec: delegation-kit/SPEC.md §check-brief-authority — a brief grants no forbidden authority and carries every required section
@@ -0,0 +1 @@
1
+ grant.md unquoted.md
@@ -0,0 +1,3 @@
1
+ grant.md:3: grants forbidden authority (forbid (^|[^[:alpha:]])[Pp]ush([^[:alpha:]]|$))
2
+ grant.md:4: grants forbidden authority (forbid npm[[:space:]]+install)
3
+ unquoted.md: lacks a required section (require ^>)
@@ -0,0 +1,4 @@
1
+ > Land the fix.
2
+
3
+ Commit the fix, then push the branch.
4
+ Run npm install before the build.
@@ -0,0 +1,5 @@
1
+ # spec: delegation-kit/SPEC.md §check-brief-authority — the case's rules: a push and an install forbidden, a prohibition excused, the quoted request required
2
+ forbid (^|[^[:alpha:]])[Pp]ush([^[:alpha:]]|$)
3
+ forbid npm[[:space:]]+install
4
+ unless (^|[^[:alpha:]])[Nn]ever[[:space:]]
5
+ require ^>
@@ -0,0 +1,2 @@
1
+ # spec: delegation-kit/SPEC.md §check-brief-authority — the case knob file names the fixture rule file
2
+ DELEGATION_KIT_BRIEF_RULES = rules.list
@@ -0,0 +1,2 @@
1
+ Land the fix and report back.
2
+ Never push the branch.
@@ -0,0 +1,5 @@
1
+ > Review the gate change and report what it reads.
2
+
3
+ Read the diff and run the battery.
4
+ Never push the branch; the lead pushes after review.
5
+ Report back with the findings.
@@ -0,0 +1 @@
1
+ BRIEF-AUTHORITY: clean (1 brief(s); 2 forbid, 1 unless, 1 require rule(s))
@@ -0,0 +1,5 @@
1
+ # spec: delegation-kit/SPEC.md §check-brief-authority — the case's rules: a push and an install forbidden, a prohibition excused, the quoted request required
2
+ forbid (^|[^[:alpha:]])[Pp]ush([^[:alpha:]]|$)
3
+ forbid npm[[:space:]]+install
4
+ unless (^|[^[:alpha:]])[Nn]ever[[:space:]]
5
+ require ^>
@@ -0,0 +1,2 @@
1
+ # spec: delegation-kit/SPEC.md §check-brief-authority — the case knob file names the fixture rule file
2
+ DELEGATION_KIT_BRIEF_RULES = rules.list
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env bash
2
- # Behavioral test of check-gate-tamper's LIVE arm — the one the good/bad pair cannot reach.
2
+ # Behavioral test of check-gate-tamper's LIVE and RANGE arms — the ones the good/bad pair cannot reach.
3
3
  # The pair injects both lists through --fixture, so the function that reads a staged gate
4
4
  # file's bytes out of the object store (`git show :<path>` against `git show HEAD:<path>`) is
5
5
  # exercised by no fixture case at all, and assertion B's added-exemption derivation with it.
6
6
  #
7
- # Each case builds a throwaway git repo, stages a commit shape, and runs the gate inside it, so
8
- # the corpus is a real index rather than an injected list.
7
+ # Each case builds a throwaway git repo, stages a commit shape (or commits a series and names it
8
+ # with --range), and runs the gate inside it, so the corpus is a real index or history rather than
9
+ # an injected list.
9
10
  #
10
11
  # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
11
12
  set -uo pipefail
@@ -33,10 +34,11 @@ new_repo() {
33
34
  printf '%s\n' "$d"
34
35
  }
35
36
 
36
- # case_run <name> <want> <expect> — the repo's index is already staged by the caller
37
+ # case_run <dir> <name> <want> <expect> [gate args…] — the repo's index or history is already built by the caller
37
38
  case_run() {
38
39
  local d="$1" name="$2" want="$3" expect="$4" out rc
39
- out="$( cd "$d" && gate_run check-gate-tamper "$CHECKS" 2>&1 )"; rc=$?
40
+ shift 4
41
+ out="$( cd "$d" && gate_run check-gate-tamper "$CHECKS" "$@" 2>&1 )"; rc=$?
40
42
  if [[ "$rc" -ne "$want" ]]; then
41
43
  echo " FAIL: $name expected exit $want, got $rc: $out"; fails=$((fails + 1)); return
42
44
  fi
@@ -156,9 +158,91 @@ case_run "$d" a-descriptor-exemption-excusing-a-co-staged-file 1 "product/*.md -
156
158
  d="$(descriptor_repo descriptor-unmatched 'nowhere/*.md')"
157
159
  case_run "$d" a-descriptor-exemption-matching-nothing-staged 0 "GATE-TAMPER: clean"
158
160
 
161
+ # J — the range arm judges each commit as its own pre-commit would: a gate-only commit beside a
162
+ # product-only commit is clean, where the same two changes in one commit red.
163
+ d="$(new_repo range-split)"
164
+ printf '# edited\n' >>"$d/scripts/check-sample.sh"
165
+ git -C "$d" commit -q -am gate-only
166
+ printf 'x\n' >"$d/product/thing.txt"
167
+ git -C "$d" add product/thing.txt
168
+ git -C "$d" commit -q -m product-only
169
+ case_run "$d" a-range-of-shape-holding-commits 0 "2 commit(s) in HEAD~2..HEAD; 0 merge(s) not judged" --range HEAD~2..HEAD
170
+
171
+ d="$(new_repo range-joined)"
172
+ printf '# edited\n' >>"$d/scripts/check-sample.sh"
173
+ printf 'x\n' >"$d/product/thing.txt"
174
+ git -C "$d" add -A
175
+ git -C "$d" commit -q -m joined
176
+ joined="$(git -C "$d" rev-parse --short HEAD)"
177
+ case_run "$d" the-same-changes-in-one-commit 1 "gate edit not isolated in commit $joined" --range HEAD~1..HEAD
178
+
179
+ # K — an exemption added beside the file it excuses reds, naming that commit and not its clean
180
+ # predecessor; a root commit is read against the empty tree, so its whole set is added.
181
+ d="$(new_repo range-self-serving)"
182
+ printf 'ok\n' >"$d/README.md"
183
+ git -C "$d" commit -q -am clean-first
184
+ printf '#!/usr/bin/env bash\n# exception-list: the gate this repo already had\nEXEMPT=(\n "product/*.txt"\n "product/*.md"\n)\n' \
185
+ >"$d/scripts/check-sample.sh"
186
+ printf 'y\n' >"$d/product/excused.md"
187
+ git -C "$d" add -A
188
+ git -C "$d" commit -q -m self-serving
189
+ bad="$(git -C "$d" rev-parse --short HEAD)"
190
+ case_run "$d" a-range-carrying-a-self-serving-exemption 1 "self-serving exemption in commit $bad" --range HEAD~2..HEAD
191
+ out="$( cd "$d" && gate_run check-gate-tamper "$CHECKS" --range HEAD~2..HEAD 2>&1 )"
192
+ if grep -qF "in commit $(git -C "$d" rev-parse --short HEAD~1)" <<<"$out"; then
193
+ echo " FAIL: range-self-serving named its clean predecessor: $out"; fails=$((fails + 1))
194
+ fi
195
+
196
+ d="$(new_repo range-root)"
197
+ seed="$(git -C "$d" rev-parse HEAD)"
198
+ git -C "$d" checkout -q --orphan unrelated
199
+ git -C "$d" rm -rfq .
200
+ mkdir -p "$d/scripts" "$d/product"
201
+ printf '#!/usr/bin/env bash\n# exception-list: seeded at the root\nEXEMPT=(\n "product/*.txt"\n)\n' >"$d/scripts/check-sample.sh"
202
+ printf 'x\n' >"$d/product/thing.txt"
203
+ git -C "$d" add -A
204
+ git -C "$d" commit -q -m root
205
+ case_run "$d" a-root-commit-read-against-the-empty-tree 1 "product/*.txt -> product/thing.txt" --range "$seed..unrelated"
206
+
207
+ # L — a merge is counted and not judged, and the commits it brings in are judged one by one.
208
+ d="$(new_repo range-merge)"
209
+ git -C "$d" checkout -q -b side
210
+ printf '# edited\n' >>"$d/scripts/check-sample.sh"
211
+ printf 'x\n' >"$d/product/side.txt"
212
+ git -C "$d" add -A
213
+ git -C "$d" commit -q -m side-joined
214
+ side="$(git -C "$d" rev-parse --short HEAD)"
215
+ git -C "$d" checkout -q -
216
+ mkdir -p "$d/product"
217
+ printf 'z\n' >"$d/product/main.txt"
218
+ git -C "$d" add -A
219
+ git -C "$d" commit -q -m main-product
220
+ git -C "$d" merge -q --no-edit side
221
+ case_run "$d" a-merge-brings-its-commits-in 1 "gate edit not isolated in commit $side" --range HEAD~1~1..HEAD
222
+
223
+ d="$(new_repo range-merge-clean)"
224
+ git -C "$d" checkout -q -b side
225
+ printf 'x\n' >"$d/product/side.txt"
226
+ git -C "$d" add -A
227
+ git -C "$d" commit -q -m side-product
228
+ git -C "$d" checkout -q -
229
+ printf '# edited\n' >>"$d/scripts/check-sample.sh"
230
+ git -C "$d" commit -q -am main-gate-only
231
+ git -C "$d" merge -q --no-edit side
232
+ case_run "$d" a-merge-of-two-clean-branches 0 "2 commit(s) in HEAD~1~1..HEAD; 1 merge(s) not judged" --range HEAD~1~1..HEAD
233
+
234
+ # M — the range spelling's refusals: a malformed range, an unknown revision, --range beside --fixture.
235
+ d="$(new_repo range-refusals)"
236
+ case_run "$d" a-bare-revision 2 "--range takes <base>..<head>" --range HEAD
237
+ case_run "$d" a-symmetric-range 2 "--range takes <base>..<head>" --range HEAD...HEAD
238
+ case_run "$d" an-empty-side 2 "--range takes <base>..<head>" --range ..HEAD
239
+ case_run "$d" an-unknown-revision 2 "'no-such-rev' names no commit" --range no-such-rev..HEAD
240
+ case_run "$d" range-beside-fixture 2 "give one, once" --range HEAD..HEAD --fixture "$tmp"
241
+ case_run "$d" an-empty-range 0 "0 commit(s) in HEAD..HEAD" --range HEAD..HEAD
242
+
159
243
  if [[ "$fails" -gt 0 ]]; then
160
244
  echo "check-gate-tamper.test: $fails assertion(s) failed"
161
245
  exit 1
162
246
  fi
163
- echo "check-gate-tamper.test: ok (live arm: HEAD-resident exemptions excluded, a newly added one excusing a co-staged file rejected, an unmatched one silent, a descriptor's # exception: element read alike, a gate-file deletion read as empty, a registered gate outside every glob covered, the toplevel install manifest meta-layer and a nested namesake not)"
247
+ echo "check-gate-tamper.test: ok (range arm: each commit judged as its own pre-commit, the offending commit named, a root commit read against the empty tree, a merge counted and its commits judged, the range spelling's refusals; live arm: HEAD-resident exemptions excluded, a newly added one excusing a co-staged file rejected, an unmatched one silent, a descriptor's # exception: element read alike, a gate-file deletion read as empty, a registered gate outside every glob covered, the toplevel install manifest meta-layer and a nested namesake not)"
164
248
  exit 0
@@ -18,7 +18,7 @@ Four passages below — the **Background + notification, never poll** and **Find
18
18
  - **A finished child is addressed by the task-id its completion notification carried, never by its name.** Resuming a returned agent to correct or extend its work is the cheap alternative to a cold re-dispatch, and it is the one that keeps the child's own reasoning instead of paying to rebuild it. A resumed isolated child runs in the main checkout, so resume it only to have it re-emit what it already holds, as isolation cost (5)'s recovery does; work that needs the tree again is a new isolated dispatch. The name is not a durable address for that: a name live at dispatch stops resolving once the dispatching session is compacted, while the task-id from the notification resumes the same child from its transcript and is the handle the notification states the child may notify under again. It is also the address to **write down**: the notification lives in the context that dies, so a dispatcher who may want that child later records the task-id under the durability rule below rather than trusting the scroll to still be there.
19
19
 
20
20
  - **Findings you will act on are durable before you act on them.** A child's return value lives only in your context, and your context dies with your session. Before you *act* on a dispatched agent's findings — edit against them, rule from them, plan the next wave on them — land them somewhere that survives you: a commit, or your own journal. The write is the parent's, discharged on receipt, not a chore delegated back to the child. This binds whoever holds findings they will act on, at any depth. It costs one write per returned child, not a running narration. The obligation is **durability**, and committing and journalling are two ways to discharge it — a session uses whichever is available to it. A dispatched session journals, to the path it was granted or its stage entry reported, because it cannot commit. A top-level session commits, because it can. A top-level session that *cannot* commit right now — another session is holding the shared index, the normal condition while an iteration is running — journals for as long as that holds, and discharges by committing when the index frees. Neither the supervising role nor a session running outside any dispatch is exempt: the axis is what the session can do at this moment, never what it is.
21
- - **Verify after every agent commit** — a sub-agent's "passed" claim is not trustworthy. Re-run the relevant gates (the sweep's own gate) and the consumer validate battery below — the act is `verify`, the artifact is the battery. **Never verify a unit by re-running the producer of what it delivered**: where the unit's deliverable *is* an evidence artifact, the verify is a **read** of the committed artifact, because re-running its sole writer overwrites or duplicates the record instead of checking it. Having already run the wrong check, read delegation-kit/SPEC.md §Verify after every agent commit for which of the two re-runs you are holding — only one of them leaves evidence to restore. **Diff every gate change in an agent commit before accepting** — a gate modification inside a feature commit is a supervisor-owned ruling; an agent blocked by a gate will weaken it (a false exemption) to make its commit pass instead of fixing the code. "The gate is in my way" almost always means the code doesn't fit the convention — fix the code. `check-gate-tamper` is the mechanical floor under this bullet — it blocks the two attested shapes (a gate edit co-staged with product code; a new path/glob exemption co-staged with the file it excuses) — but it does **not** catch semantic weakening inside a legitimate scripts-only commit, so the by-eye diff review remains your duty (delegation-kit/SPEC.md §Verify after every agent commit — the honest limit).
21
+ - **Verify after every agent commit** — a sub-agent's "passed" claim is not trustworthy. Re-run the relevant gates (the sweep's own gate) and the consumer validate battery below — the act is `verify`, the artifact is the battery. **Never verify a unit by re-running the producer of what it delivered**: where the unit's deliverable *is* an evidence artifact, the verify is a **read** of the committed artifact, because re-running its sole writer overwrites or duplicates the record instead of checking it. Having already run the wrong check, read delegation-kit/SPEC.md §Verify after every agent commit for which of the two re-runs you are holding — only one of them leaves evidence to restore. **Diff every gate change in an agent commit before accepting** — a gate modification inside a feature commit is a supervisor-owned ruling; an agent blocked by a gate will weaken it (a false exemption) to make its commit pass instead of fixing the code. "The gate is in my way" almost always means the code doesn't fit the convention — fix the code. `check-gate-tamper` is the mechanical floor under this bullet — it blocks the two attested shapes (a gate edit co-staged with product code; a new path/glob exemption co-staged with the file it excuses), and over the commits an agent hands back it judges them only through its range form (delegation-kit/README.md) — but it does **not** catch semantic weakening inside a legitimate scripts-only commit, so the by-eye diff review remains your duty (delegation-kit/SPEC.md §Verify after every agent commit — the honest limit).
22
22
  - **A child's citation is a pointer to verify, never evidence in itself.** A returned `file:line` is not checked by confirming the range resolves: that catches a wrong number and misses a wrong spelling, a moved passage, and a sibling instance the sweep never reported. **Re-read the passage** in the parent before acting on it. Quotation with attribution is precisely the signal a reader uses to decide a claim has already been checked, so an unverified one defeats normal trust rather than merely being wrong.
23
23
  - **A return you did not receive is not a finding, and an identifier you did not read is not a citation.** Two shapes, because the attested instances are not all one. **The relayed return:** a claim whose warrant is a dispatched agent's output is made only where that output was **received**. A monitor that timed out, a child that never reported, a notification never consumed — each leaves you holding no return, and a claim made anyway is fabrication however well you reasoned your way to it. All three attested instances of this shape sat in the dispatcher's own *reasoning* rather than in quoted child text, which is why a floor checking relayed quotations would have caught none of them. **The minted identifier:** a commit sha, a `file:line`, a count, a path — written to make a record read as precise, never actually read. The fourth attested instance is this, a fabricated short hash put into a survey record's corpus field. **The discharge is deliberately cheap: no new artifact and no running narration.** Where the return arrived, cite **where it is held** — the journal path you granted and read, or the commit you verified. Where it did not, either do not make the claim, or mark it **unheld in the same sentence**. Marking is admissible on purpose: what this closes is a claim that *looks* sourced, and a claim saying it is not sourced does not commit it. **Its boundary against the three bullets above, so the set does not read as four spellings of one rule:** each of those presupposes a return that arrived. *A child's citation is a pointer to verify* governs a citation that arrived and may be wrong; *Findings you will act on are durable before you act on them* governs a finding that arrived and must outlive the session; *Verify after every agent commit* governs work that landed. This one governs the case where **nothing arrived at all**, which none of them reaches.
24
24
  - **Budget-check before *each* dispatch in a fan-out**, not once at the start. Run `--usage-verdict` on the gate binary `GATE_SDK_NATIVE_BIN` names (verdict exit 0/1/2 from `usage.txt` — it folds in the reading-age and window-validity checks so a dead-window pct can't read stale-high; a PAUSE names its axis — a 5h wall clears in hours, a 7-day wall in days). If the verdict is PAUSE and the work is large, pause for reset. Width is the kill axis: the 5h wall fires mid-flight, and the agents that bank are the ones that *finished* — ≤`DELEGATION_KIT_FAN_WIDTH`-wide bounds the loss to the in-flight wave. **Project the next wave's burn from the last wave's, not just the current pct** — a read-heavy `DELEGATION_KIT_FAN_WIDTH`-wide sweep is far more window-expensive than its subagent-token total suggests, so size waves to leave the next one headroom, or accept one wave per window. **The projection reaches downward as well as forward.** The guard re-arms at every depth — a dispatched session's own dispatches fire it too — but each verdict prices **one call**, never the subtree that call opens. Nothing between a dispatch and its children's children ever sees the whole. So budget a dispatch you expect to fan out for its **subtree**, not its own turn, and read a child's fan-out as your spend even though its verdicts land in a context you never see. **Do not read live budget off the statusline while parked on a dispatch.** Observed: the harness statusline does not refresh while the main session waits on a background agent's completion notification, so its displayed budget freezes for the length of the dispatch — the longer the unit, the staler the number. Poll the verdict arm externally when you need a live reading mid-dispatch (a `watch -n 30` over the gate binary's `--usage-verdict` arm); this is the one sanctioned poll and it does not weaken the never-poll rule above, which governs waiting for *completion*. Enforcement is unaffected either way: the per-dispatch budget check reads a fresh verdict at dispatch time, so a pause/proceed decision is never made off the frozen display — only passive display is stale.
@@ -0,0 +1,20 @@
1
+ # brief-rules.list — starter rule list for check-brief-authority
2
+ # (delegation-kit/SPEC.md §check-brief-authority). Copy it into your gates dir,
3
+ # edit it and name the copy in DELEGATION_KIT_BRIEF_RULES. One directive and
4
+ # one POSIX ERE per line; '#' comments and blank lines are ignored.
5
+
6
+ # A push: the agent publishes its commits.
7
+ forbid (^|[^[:alpha:]])([Pp]ush|PUSH)([^[:alpha:]]|$)
8
+
9
+ # A forge post: a pull request, issue, comment or release made in the agent's name.
10
+ forbid (^|[^[:alpha:]])gh[[:space:]]+(pr|issue|release|api)([^[:alpha:]]|$)
11
+ forbid (^|[^[:alpha:]])([Pp]ost|[Oo]pen|[Ff]ile|[Cc]omment)[[:space:]]+(on[[:space:]]+)?(a|an|the)?[[:space:]]*(pull request|PR|issue|comment|release)
12
+
13
+ # A package install.
14
+ forbid (^|[^[:alpha:]])(npm|pnpm|yarn|pip3?|cargo|gem|go|brew|apt(-get)?)[[:space:]]+(install|add|get)([^[:alpha:]]|$)
15
+
16
+ # A line phrased as a prohibition.
17
+ unless (^|[^[:alpha:]])([Nn]ever|[Dd]o not|[Dd]on't|[Mm]ust not|NEVER|DO NOT)([^[:alpha:]]|$)
18
+
19
+ # The quoted request, as a blockquote. Name your own brief format's section.
20
+ # require ^>