checkwright 0.31.0 → 0.32.1

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 (496) hide show
  1. package/README.md +8 -7
  2. package/bin/checkwright.ps1 +3 -3
  3. package/bin/checkwright.sh +5 -1
  4. package/package.json +10 -3
  5. package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
  6. package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
  7. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
  8. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  9. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  11. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
  12. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  13. package/payload/artifact/targets.list +5 -5
  14. package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
  15. package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
  16. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
  17. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  18. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  19. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  20. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
  21. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  22. package/payload/canon-kit/README.md +8 -4
  23. package/payload/canon-kit/checks/check-amendment-queue.gate +1 -1
  24. package/payload/canon-kit/checks/check-comment-tier.gate +2 -2
  25. package/payload/canon-kit/checks/check-delta-agreement.gate +4 -0
  26. package/payload/canon-kit/checks/check-deprecation-task.gate +1 -1
  27. package/payload/canon-kit/checks/check-docs-page-length.gate +4 -0
  28. package/payload/canon-kit/checks/check-docs-page-repeat.gate +2 -2
  29. package/payload/canon-kit/checks/check-fence-command-head.gate +1 -1
  30. package/payload/canon-kit/checks/check-fence-paste-unit.gate +4 -0
  31. package/payload/canon-kit/checks/check-knob-default-coupling.gate +1 -1
  32. package/payload/canon-kit/checks/check-manifest-count.gate +3 -3
  33. package/payload/canon-kit/checks/check-manifest-temporal.gate +1 -1
  34. package/payload/canon-kit/checks/check-pendency-contradiction.gate +3 -0
  35. package/payload/canon-kit/checks/check-prose-tells.gate +1 -1
  36. package/payload/canon-kit/checks/check-spec-derivable-section.gate +1 -1
  37. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +1 -1
  38. package/payload/canon-kit/checks/check-spec-embedded-source.gate +1 -1
  39. package/payload/canon-kit/checks/check-spec-pointer.gate +1 -1
  40. package/payload/canon-kit/checks/check-todo-task-liveness.gate +1 -1
  41. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
  42. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/SPEC-widget.md +7 -0
  43. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +7 -0
  44. package/payload/canon-kit/gate-tests/check-citation-link/bad/expect.txt +1 -0
  45. package/payload/canon-kit/gate-tests/check-citation-link/bad/site/unclosed.md +4 -0
  46. package/payload/canon-kit/gate-tests/check-citation-link/good/site/page.md +10 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/bad/scripts/canon-config.knobs +4 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +2 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/scripts/canon-config.knobs +4 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +9 -1
  51. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/expect.txt +3 -0
  52. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/scripts/canon-config.knobs +14 -0
  53. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/base/notes/spec.md +9 -0
  54. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/one/deltas/notes/spec.md +7 -0
  55. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/two/deltas/cli/spec.md +3 -0
  56. package/payload/canon-kit/gate-tests/check-delta-agreement/good/expect.txt +1 -0
  57. package/payload/canon-kit/gate-tests/check-delta-agreement/good/scripts/canon-config.knobs +14 -0
  58. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/base/notes/spec.md +9 -0
  59. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/one/deltas/notes/spec.md +19 -0
  60. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/two/deltas/cli/spec.md +3 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.knobs +4 -0
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.knobs +4 -0
  63. package/payload/canon-kit/gate-tests/check-docs-cmd.test.sh +20 -4
  64. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/expect.txt +5 -0
  65. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/scripts/canon-config.knobs +3 -0
  66. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/item.md +5 -0
  67. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/nested.md +7 -0
  68. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/page.md +13 -0
  69. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/short.md +3 -0
  70. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/unclosed.md +4 -0
  71. package/payload/canon-kit/gate-tests/check-docs-page-length/good/expect.txt +1 -0
  72. package/payload/canon-kit/gate-tests/check-docs-page-length/good/scripts/canon-config.knobs +4 -0
  73. package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/generated.md +3 -0
  74. package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/page.md +15 -0
  75. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/expect.txt +3 -0
  76. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/scripts/canon-config.knobs +2 -1
  77. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/_chrome/footer.html +4 -0
  78. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/page.md +4 -0
  79. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/unclosed.md +6 -0
  80. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/expect.txt +2 -1
  81. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/scripts/canon-config.knobs +2 -1
  82. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/_chrome/layout.html +8 -0
  83. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/page.md +13 -0
  84. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/expect.txt +1 -0
  85. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/kit/index.md +4 -0
  86. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/doc.md +10 -0
  87. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/expect.txt +2 -0
  88. package/payload/canon-kit/gate-tests/check-fence-command-head/good/doc.md +6 -0
  89. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/expect.txt +3 -0
  90. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/scripts/canon-config.knobs +2 -0
  91. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/site/page.md +17 -0
  92. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/expect.txt +1 -0
  93. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/scripts/canon-config.knobs +2 -0
  94. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/site/page.md +39 -0
  95. package/payload/canon-kit/gate-tests/check-fence-run/good/doc.md +8 -0
  96. package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +4 -0
  97. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +14 -0
  98. package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +2 -0
  99. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +27 -0
  100. package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -1
  101. package/payload/canon-kit/gate-tests/check-manifest-count/good/posts/note.md +7 -0
  102. package/payload/canon-kit/gate-tests/check-manifest-count/good/scripts/canon-config.knobs +4 -0
  103. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +7 -0
  104. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +17 -1
  105. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/dotted.md +10 -0
  106. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/expect.txt +1 -0
  107. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/dotted.md +6 -0
  108. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/expect.txt +1 -1
  109. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +6 -0
  110. package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/SPEC.md +14 -0
  111. package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/expect.txt +1 -0
  112. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/README.md +3 -0
  113. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/SPEC.md +16 -0
  114. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/expect.txt +1 -0
  115. package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence-unclosed.md +8 -0
  116. package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence.md +13 -0
  117. package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +4 -0
  118. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.knobs +5 -1
  119. package/payload/canon-kit/gate-tests/check-prose-tells/good/absence.md +17 -0
  120. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +6 -0
  121. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.knobs +4 -1
  122. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +9 -0
  123. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +2 -1
  124. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +14 -0
  125. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
  126. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
  127. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +2 -1
  128. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/long.md +7 -0
  129. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +13 -0
  130. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.knobs +7 -1
  131. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +8 -0
  132. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-repeat.md +11 -0
  133. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.knobs +6 -0
  134. package/payload/canon-kit/gate-tests/check-task-label-resolution/good/work/tasks.md +6 -0
  135. package/payload/canon-kit/gate-tests/check-task-path-claim/good/work/tasks.md +6 -0
  136. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/scripts/canon-config.knobs +4 -0
  137. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/scripts/canon-config.knobs +4 -0
  138. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
  139. package/payload/context-kit/README.md +5 -7
  140. package/payload/context-kit/checks/check-brevity.gate +1 -1
  141. package/payload/context-kit/gate-tests/check-brevity.test.sh +1 -0
  142. package/payload/context-kit/gate-tests/check-memory-off.test.sh +25 -1
  143. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  144. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +16 -0
  145. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/checkwright-gates +2 -0
  146. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +2 -2
  147. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  148. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/checkwright-gates +2 -0
  149. package/payload/context-kit/gate-tests/session-context-spawn.test.sh +52 -0
  150. package/payload/context-kit/templates/nudge-delegation.txt +4 -0
  151. package/payload/context-kit/templates/settings-sessionstart.json +2 -2
  152. package/payload/delegation-kit/README.md +14 -8
  153. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +1 -0
  154. package/payload/delegation-kit/checks/check-gate-tamper.gate +1 -1
  155. package/payload/delegation-kit/close-surfaces.txt +3 -0
  156. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale-effort.md +10 -0
  157. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale.md +9 -0
  158. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/unbound.md +8 -0
  159. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +3 -0
  160. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/scripts/delegation-config.knobs +3 -0
  161. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +3 -1
  162. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-paired.md +10 -0
  163. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -1
  164. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/scripts/delegation-config.knobs +3 -0
  165. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/exception-arrays.sh +44 -0
  166. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +12 -0
  167. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +12 -0
  168. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/exception-arrays.sh +44 -0
  169. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +1 -0
  170. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +22 -1
  171. package/payload/delegation-kit/templates/agent-execution.md +7 -6
  172. package/payload/delegation-kit/templates/delegation-config.knobs +32 -0
  173. package/payload/delegation-kit/usage-tests/cases.tsv +35 -25
  174. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +12 -3
  175. package/payload/doctrine-kit/DOCTRINE.md +109 -25
  176. package/payload/doctrine-kit/README.md +2 -2
  177. package/payload/drift-kit/README.md +15 -6
  178. package/payload/drift-kit/close-surfaces.txt +2 -0
  179. package/payload/drift-kit/templates/economics.md +7 -3
  180. package/payload/drift-kit/templates/kpis.list +1 -0
  181. package/payload/evidence-kit/README.md +3 -3
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +2 -1
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.knobs +3 -1
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +1 -0
  186. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.knobs +3 -1
  187. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +18 -2
  188. package/payload/evidence-kit/gate-tests/diff-baseline-status.test.sh +2 -3
  189. package/payload/evidence-kit/gate-tests/run-member-door.test.sh +50 -0
  190. package/payload/gate-sdk/README.md +9 -13
  191. package/payload/gate-sdk/bin/build-native.sh +11 -14
  192. package/payload/gate-sdk/bin/run-gates.ps1 +149 -24
  193. package/payload/gate-sdk/bin/run-gates.sh +57 -14
  194. package/payload/gate-sdk/checks/check-commit-msg.gate +1 -1
  195. package/payload/gate-sdk/checks/check-gate-substrate-parity.gate +1 -1
  196. package/payload/gate-sdk/checks/check-graph.gate +2 -2
  197. package/payload/gate-sdk/checks/check-install-disposition.gate +1 -1
  198. package/payload/gate-sdk/checks/check-path-dialect.gate +1 -1
  199. package/payload/gate-sdk/checks/check-psscriptanalyzer.gate +4 -0
  200. package/payload/gate-sdk/checks/check-shellcheck.gate +1 -1
  201. package/payload/gate-sdk/checks/check-template-copy-parity.gate +1 -1
  202. package/payload/gate-sdk/checks/check-tree-terms.gate +1 -1
  203. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/args +2 -1
  204. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/expect.txt +2 -0
  205. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/tree/workflows/shapes.yml +29 -0
  206. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/args +2 -1
  207. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/expect.txt +2 -0
  208. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/tree/workflows/shapes.yml +22 -0
  209. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/demo-kit/index.md +3 -0
  210. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +17 -1
  211. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +12 -1
  212. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-array-axes.sh +44 -0
  213. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +2 -0
  214. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +2 -1
  215. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-array-axes.sh +46 -0
  216. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +2 -0
  217. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
  218. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.gate +3 -0
  219. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.ps1 +1 -0
  220. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/gates.list +1 -0
  221. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
  222. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/scripts/gates.list +3 -1
  223. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  224. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +4 -2
  225. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +5 -0
  226. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.gate +2 -0
  227. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.ps1 +1 -0
  228. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-climb.gate +2 -0
  229. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-direxec.gate +2 -0
  230. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twoexec.gate +3 -0
  231. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.gate +2 -0
  232. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.txt +1 -0
  233. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  234. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.gate +3 -0
  235. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.ps1 +1 -0
  236. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-rsgood.gate +3 -0
  237. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  238. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +42 -5
  239. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +1 -0
  240. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +9 -1
  241. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +2 -2
  242. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +15 -29
  243. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  244. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -1
  245. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/expect.txt +1 -0
  246. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/portability-patterns.notes.list +1 -0
  247. package/payload/gate-sdk/gate-tests/check-portability-floor/good/args +1 -1
  248. package/payload/gate-sdk/gate-tests/check-portability-floor/good/scripts/gate-sdk-config.knobs +1 -0
  249. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/demo-kit/templates/portability-patterns.list +5 -0
  250. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/rosters/constructs.list +6 -0
  251. package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +15 -2
  252. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/expect.txt +2 -0
  253. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/noisy.ps1 +1 -0
  254. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/pwsh +8 -0
  255. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/scripts/gate-sdk-config.knobs +1 -0
  256. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/clean.ps1 +1 -0
  257. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/expect.txt +1 -0
  258. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/pwsh +7 -0
  259. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/scripts/gate-sdk-config.knobs +2 -0
  260. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/{warn.sh → alpha-kit/gate-tests/kit-warn.sh} +1 -1
  261. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +2 -0
  262. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-sdk-config.knobs +2 -0
  263. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-tests/tests-warn.sh +5 -0
  264. package/payload/gate-sdk/gate-tests/check-shellcheck/good/{ok.sh → alpha-kit/gate-tests/kit-ok.sh} +1 -1
  265. package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -1
  266. package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-sdk-config.knobs +2 -0
  267. package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-tests/tests-ok.sh +4 -0
  268. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +2 -0
  269. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/gate-sdk-config.knobs +1 -0
  270. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +4 -1
  271. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/gate-sdk-config.knobs +1 -0
  272. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/stray/templates/session-note.sh +4 -0
  273. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +6 -2
  274. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/drift-kit/templates/kpis.list +1 -0
  275. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/drift-kit/templates/kpis.list +1 -0
  276. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  277. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/msg-patterns.old.list +1 -0
  278. package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -2
  279. package/payload/gate-sdk/gate-tests/check-tree-terms/good/scripts/gate-sdk-config.knobs +1 -0
  280. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/demo-kit/templates/msg-patterns.list +2 -0
  281. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/rosters/extra.list +2 -0
  282. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +1 -0
  283. package/payload/gate-sdk/gate-tests/emit-arm-shape.test.sh +1 -1
  284. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +10 -2
  285. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +29 -3
  286. package/payload/gate-sdk/gate-tests/lib-test-hermetic.test.sh +24 -0
  287. package/payload/gate-sdk/gate-tests/native-git-hooks.test.sh +261 -0
  288. package/payload/gate-sdk/gate-tests/native-rustflags.test.sh +20 -0
  289. package/payload/gate-sdk/gate-tests/run-arm-contract.test.sh +11 -4
  290. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +2 -1
  291. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +11 -1
  292. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +64 -4
  293. package/payload/gate-sdk/lib/gate.sh +46 -6
  294. package/payload/gate-sdk/lib/test-hermetic.sh +16 -8
  295. package/payload/gate-sdk/templates/adopt.md +1 -1
  296. package/payload/gate-sdk/templates/msg-patterns.list +1 -1
  297. package/payload/gate-sdk/templates/portability-patterns.list +1 -1
  298. package/payload/guard-kit/README.md +12 -7
  299. package/payload/guard-kit/close-surfaces.txt +3 -0
  300. package/payload/guard-kit/gate-tests/check-door-binding/bad/alpha-kit/README.md +1 -1
  301. package/payload/guard-kit/gate-tests/check-door-binding/bad/expect.txt +1 -0
  302. package/payload/guard-kit/gate-tests/check-door-binding/bad/scripts/guard-config.knobs +2 -1
  303. package/payload/guard-kit/gate-tests/check-door-binding/bad/src/remedy.rs +3 -0
  304. package/payload/guard-kit/gate-tests/check-door-binding/good/expect.txt +1 -0
  305. package/payload/guard-kit/gate-tests/check-door-binding/good/scripts/guard-config.knobs +2 -1
  306. package/payload/guard-kit/gate-tests/check-door-binding/good/site/register.md +8 -0
  307. package/payload/guard-kit/gate-tests/check-door-binding/good/src/remedy.rs +13 -0
  308. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +0 -1
  309. package/payload/guard-kit/gate-tests/consumer-rules.test.sh +105 -3
  310. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +64 -2
  311. package/payload/guard-kit/gate-tests/guard-config-knobs.test.sh +18 -5
  312. package/payload/guard-kit/gate-tests/guard-verdict.test.sh +74 -0
  313. package/payload/guard-kit/gate-tests/worktree-confinement.test.sh +49 -5
  314. package/payload/guard-kit/guard-tests/background-cases.tsv +103 -1
  315. package/payload/guard-kit/guard-tests/cases.tsv +834 -64
  316. package/payload/guard-kit/guard-tests/powershell-cases.tsv +51 -2
  317. package/payload/guard-kit/guard-tests/variant-limits.tsv +14 -0
  318. package/payload/guard-kit/templates/close-triage.md +2 -2
  319. package/payload/guard-kit/templates/guard-config.knobs +9 -0
  320. package/payload/guard-kit/templates/settings-allow.json +1 -1
  321. package/payload/guard-kit/templates/settings-hooks.json +4 -4
  322. package/payload/lifecycle-kit/README.md +11 -6
  323. package/payload/lifecycle-kit/checks/check-disposed-findings.gate +3 -0
  324. package/payload/lifecycle-kit/checks/check-skill-binding.gate +1 -1
  325. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +1 -1
  326. package/payload/lifecycle-kit/close-surfaces.txt +2 -0
  327. package/payload/lifecycle-kit/gate-tests/boundary-set-record.test.sh +82 -0
  328. package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +11 -2
  329. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +11 -1
  330. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/args +2 -0
  331. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/disposed-findings.txt +5 -0
  332. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/expect.txt +5 -0
  333. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/args +2 -0
  334. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/disposed-findings.txt +3 -0
  335. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/expect.txt +1 -0
  336. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +1 -0
  337. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +1 -1
  338. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +27 -2
  339. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +6 -0
  340. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +34 -2
  341. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +3 -0
  342. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
  343. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/scripts/lifecycle-config.knobs +3 -0
  344. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +3 -0
  345. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
  346. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/scripts/lifecycle-config.knobs +2 -0
  347. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage.test.sh +22 -2
  348. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +9 -2
  349. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +27 -1
  350. package/payload/lifecycle-kit/gate-tests/journal-arm.test.sh +251 -0
  351. package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +46 -5
  352. package/payload/lifecycle-kit/gate-tests/stamp-before-write.test.sh +16 -2
  353. package/payload/lifecycle-kit/templates/consult.md +9 -5
  354. package/payload/lifecycle-kit/templates/frames/project-critique.md +18 -0
  355. package/payload/lifecycle-kit/templates/frames/stage-contract-sweep.md +18 -0
  356. package/payload/lifecycle-kit/templates/frames/stage-contract.md +15 -0
  357. package/payload/lifecycle-kit/templates/host-protocol.md +10 -0
  358. package/payload/lifecycle-kit/templates/lead.md +30 -25
  359. package/payload/lifecycle-kit/templates/stages/align.md +4 -0
  360. package/payload/lifecycle-kit/templates/stages/build.md +5 -3
  361. package/payload/lifecycle-kit/templates/stages/close.md +8 -6
  362. package/payload/lifecycle-kit/templates/stages/scope.md +6 -2
  363. package/payload/lifecycle-kit/templates/stages/spec.md +4 -0
  364. package/payload/lifecycle-kit/templates/stages/validate.md +4 -2
  365. package/payload/lifecycle-kit/templates/upgrade.md +1 -1
  366. package/payload/queue-kit/README.md +3 -2
  367. package/payload/queue-kit/close-surfaces.txt +3 -0
  368. package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
  369. package/payload/queue-kit/gate-tests/check-queue-sections/bad/scripts/queue-config.knobs +2 -0
  370. package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +1 -1
  371. package/payload/queue-kit/gate-tests/check-queue-sections/good/scripts/queue-config.knobs +2 -0
  372. package/payload/queue-kit/gate-tests/check-queue-sections.test.sh +65 -0
  373. package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +10 -1
  374. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +4 -0
  375. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +4 -0
  376. package/payload/queue-kit/gate-tests/check-task-conservation.test.sh +38 -0
  377. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +3 -0
  378. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +3 -0
  379. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +8 -0
  380. package/payload/queue-kit/gate-tests/roadmap-lag.test.sh +137 -0
  381. package/payload/site-kit/README.md +3 -3
  382. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/docs/unclosed.md +8 -0
  383. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/expect.txt +1 -0
  384. package/payload/site-kit/gate-tests/check-docs-collapsible/good/docs/regions.md +7 -0
  385. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/docs/dotted.md +9 -0
  386. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/expect.txt +1 -0
  387. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/dotted.md +7 -0
  388. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/expect.txt +1 -1
  389. package/payload/site-kit/gate-tests/site-health-probe.test.sh +219 -0
  390. package/payload/site-kit/templates/site-health.yml +181 -132
  391. package/profiles.list +11 -10
  392. package/recipes/openspec/canon-config.knobs +5 -0
  393. package/recipes/openspec-overlap/canon-config.knobs +12 -0
  394. package/recipes/openspec-overlap/unregister.list +1 -0
  395. package/payload/context-kit/checks/check-footprint-fresh.gate +0 -4
  396. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +0 -4
  397. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +0 -12
  398. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +0 -1
  399. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +0 -11
  400. package/payload/context-kit/gate-tests/check-footprint-fresh/good/CLAUDE.md +0 -6
  401. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/SPEC.md +0 -3
  402. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/templates/guide.md +0 -3
  403. package/payload/context-kit/gate-tests/check-footprint-fresh/good/docs/footprint.md +0 -32
  404. package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +0 -1
  405. package/payload/context-kit/templates/session-context.sh +0 -148
  406. package/payload/delegation-kit/checks/check-rule-citation.gate +0 -3
  407. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +0 -1
  408. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +0 -1
  409. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +0 -9
  410. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +0 -4
  411. package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +0 -1
  412. package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +0 -1
  413. package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +0 -20
  414. package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +0 -5
  415. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +0 -54
  416. package/payload/gate-sdk/checks/check-crate-arms.gate +0 -3
  417. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +0 -3
  418. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +0 -3
  419. package/payload/gate-sdk/checks/check-kit-roots-dialect.gate +0 -3
  420. package/payload/gate-sdk/checks/check-packed-links.gate +0 -3
  421. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +0 -7
  422. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +0 -12
  423. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +0 -5
  424. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.knobs +0 -3
  425. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +0 -7
  426. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +0 -11
  427. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +0 -2
  428. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.knobs +0 -3
  429. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +0 -2
  430. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +0 -5
  431. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +0 -2
  432. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +0 -2
  433. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.knobs +0 -2
  434. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +0 -4
  435. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +0 -1
  436. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +0 -6
  437. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +0 -2
  438. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +0 -5
  439. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +0 -2
  440. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +0 -2
  441. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.knobs +0 -2
  442. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +0 -4
  443. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +0 -1
  444. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +0 -5
  445. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +0 -97
  446. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +0 -1
  447. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +0 -1
  448. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +0 -2
  449. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +0 -1
  450. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +0 -1
  451. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +0 -2
  452. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/args +0 -5
  453. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/expect.txt +0 -1
  454. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/checks/placeholder.txt +0 -3
  455. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
  456. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/lib/alpha.sh +0 -3
  457. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/checks/placeholder.txt +0 -3
  458. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/gate-tests/beta.test.sh +0 -3
  459. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/lib/beta.sh +0 -3
  460. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/checks/placeholder.txt +0 -3
  461. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/lib/gate.sh +0 -3
  462. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gate-sdk-config.knobs +0 -7
  463. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gates.list +0 -3
  464. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/args +0 -7
  465. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/expect.txt +0 -1
  466. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/checks/placeholder.txt +0 -3
  467. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
  468. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/lib/alpha.sh +0 -3
  469. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/checks/placeholder.txt +0 -3
  470. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/gate-tests/beta.test.sh +0 -3
  471. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/lib/beta.sh +0 -3
  472. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/checks/placeholder.txt +0 -3
  473. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/lib/gate.sh +0 -3
  474. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/scripts/gates.list +0 -3
  475. package/payload/gate-sdk/gate-tests/check-packed-links/bad/alpha-kit/README.md +0 -5
  476. package/payload/gate-sdk/gate-tests/check-packed-links/bad/args +0 -5
  477. package/payload/gate-sdk/gate-tests/check-packed-links/bad/beta-kit/README.md +0 -5
  478. package/payload/gate-sdk/gate-tests/check-packed-links/bad/expect.txt +0 -2
  479. package/payload/gate-sdk/gate-tests/check-packed-links/bad/scripts/gate-sdk-config.knobs +0 -4
  480. package/payload/gate-sdk/gate-tests/check-packed-links/good/alpha-kit/README.md +0 -5
  481. package/payload/gate-sdk/gate-tests/check-packed-links/good/args +0 -8
  482. package/payload/gate-sdk/gate-tests/check-packed-links/good/beta-kit/README.md +0 -9
  483. package/payload/gate-sdk/gate-tests/check-packed-links/good/expect.txt +0 -1
  484. package/payload/gate-sdk/gate-tests/check-packed-links/good/gamma-kit/SPEC.md +0 -4
  485. package/payload/gate-sdk/gate-tests/check-packed-links/good/scripts/gate-sdk-config.knobs +0 -6
  486. package/payload/gate-sdk/gate-tests/check-portability-floor/good/patterns.list +0 -5
  487. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/portability-patterns.list +0 -5
  488. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +0 -2
  489. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +0 -3
  490. /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/bad/args +0 -0
  491. /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/good/args +0 -0
  492. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
  493. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
  494. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/delegation-config.sh +0 -0
  495. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/session-note.sh +0 -0
  496. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/usage-poller.sh +0 -0
@@ -7,6 +7,9 @@
7
7
  # rule `cd_compound` — cd in a compound command
8
8
  block cd deploy && ls
9
9
  fallthrough cd deploy
10
+ # under bash the command word comes through the command read: by value, by path and past a wrapper
11
+ block ls && \cd deploy
12
+ block ls; FOO=1 cd deploy
10
13
 
11
14
  # rule `git_c_root` — a prefix spelling that falls off the match path: (a) git -C <repo-root>
12
15
  # when cwd is the root, (b) a git -c config override among git's global
@@ -18,10 +21,17 @@ block git -c core.pager=cat log --oneline -3
18
21
  block git --no-pager -c color.ui=never diff
19
22
  fallthrough git log --oneline -3
20
23
  fallthrough git commit -m 'drop git -c core.pager=cat'
24
+ # arm (b) reads the git read (rule `git_mutation_under_producer`), so a quoted command word is git
25
+ block 'git' -c core.pager=cat log --oneline -3
21
26
  block /usr/bin/time -f %e make build
22
27
  block make lint && /usr/bin/nice -n 5 make build
23
28
  fallthrough time make build
24
29
  fallthrough file /usr/bin/time
30
+ # arms (a) and (c) read words by value too
31
+ block git \-C @ROOT@ status --short
32
+ block command '/usr/bin/nohup' make build
33
+ # a heredoc beside the call leaves its words read by value
34
+ block 'git' -c core.pager=cat log --oneline -3 <<'EOF'@NL@x@NL@EOF
25
35
 
26
36
  # rule `git_c_root`'s arm (d) — an export, leading assignment or env prefix setting a kit
27
37
  # knob to the value it already resolves to. The sandbox exports the
@@ -33,10 +43,26 @@ block env GATE_SDK_WORKFLOW_DIR=.workflow make build
33
43
  fallthrough GATE_SDK_WORKFLOW_DIR=elsewhere make build
34
44
  fallthrough GATE_SDK_JOBS=1 make build
35
45
  fallthrough FOO=bar make build
46
+ # arm (d) reads the export or env word by value past a leading `command`; a quoted value falls through
47
+ block command \env GATE_SDK_WORKFLOW_DIR=.workflow make build
48
+ block 'export' GATE_SDK_WORKFLOW_DIR=.workflow && make build
49
+ fallthrough env GATE_SDK_WORKFLOW_DIR='.workflow' make build
36
50
 
37
51
  # rule `scratch_redirect` — bare-name scratch redirect
38
52
  block some-runner 2> op.err
39
53
  fallthrough some-runner 2> .tmp/op.err
54
+ # `>&` onto a named file is the same write, glued or apart
55
+ block some-runner >& op.err
56
+ block some-runner >&op.log
57
+ fallthrough some-runner >& .tmp/op.err
58
+ fallthrough some-runner > .tmp/op.err 2>&1
59
+ # under bash a target is also read by its value, so a quoted or glued one is the plain name, and a
60
+ # carriage return is a character of it
61
+ block some-runner 2>'op.err'
62
+ block some-runner > op@CR@.log
63
+ fallthrough some-runner 2> '.tmp/op.err'
64
+ # a heredoc beside the call leaves its targets read by value
65
+ block some-runner 2>'op.err' <<'EOF'@NL@x@NL@EOF
40
66
 
41
67
  # rule `abs_script` — absolute-path read-only repo script (rewrite) vs other script (block).
42
68
  # The rewrite emits allow, so it attaches only when the rewritten command
@@ -45,6 +71,34 @@ fallthrough some-runner 2> .tmp/op.err
45
71
  # unallowlisted scratch script and for a runner glob reached past its slot
46
72
  rewrite bash @ROOT@/scripts/check-foo.sh
47
73
  rewrite @ROOT@/scripts/check-env.sh --list
74
+ # a redirect naming a file withholds the grant, an ignored target included, since the
75
+ # allow match reaches it through a trailing star; an fd-dup and /dev/null are no file
76
+ block @ROOT@/scripts/check-env.sh --list>tracked.md
77
+ block @ROOT@/scripts/check-env.sh --list > .tmp/out.txt
78
+ rewrite @ROOT@/scripts/check-env.sh --list 2>&1
79
+ rewrite @ROOT@/scripts/check-env.sh --list >/dev/null
80
+ # a quoted or escaped call fails the literal test (guard-kit/SPEC.md §The generic ruleset),
81
+ # so the corrective block fires whatever the target names: a quoted or escaped /dev/null,
82
+ # a quoted name that only opens with it and a quoted file alike
83
+ block @ROOT@/scripts/check-env.sh --list >"/dev/null"
84
+ block @ROOT@/scripts/check-env.sh --list 2>'/dev/null'
85
+ block @ROOT@/scripts/check-env.sh --list > /dev/"null" 2>&1
86
+ block @ROOT@/scripts/check-env.sh --list >\/dev/null
87
+ block @ROOT@/scripts/check-env.sh --list >"/dev/null x"
88
+ block @ROOT@/scripts/check-env.sh --list >'/dev/nullified.md'
89
+ block @ROOT@/scripts/check-env.sh --list >"tracked.md"
90
+ block @ROOT@/scripts/check-env.sh --list >"/dev/null">tracked.md
91
+ # a word carrying a second operator counts as a file, its two targets inert or not
92
+ block @ROOT@/scripts/check-env.sh --list >/dev/null&>/dev/null
93
+ # a carriage return is a word character, as bash reads it, so a descriptor glued to one or
94
+ # behind one names a file
95
+ block @ROOT@/scripts/check-env.sh --list >&2@CR@tracked.md
96
+ block @ROOT@/scripts/check-env.sh --list >&@CR@2
97
+ # the noclobber operator truncates the word after it, which the split reads as a granted
98
+ # second segment: spaced, glued and under a descriptor, the grant is withheld
99
+ block @ROOT@/scripts/check-env.sh --list >| scripts/check-env.sh --list
100
+ block @ROOT@/scripts/check-env.sh --list>|scripts/check-env.sh --list
101
+ block @ROOT@/scripts/check-env.sh --list 2>| scripts/check-env.sh --list
48
102
  block bash @ROOT@/scripts/gen-configs.sh
49
103
  block bash @ROOT@/.tmp/check-evil.sh
50
104
  block bash @ROOT@/../evil/checks/check-x.sh
@@ -56,21 +110,25 @@ block python3 @ROOT@/tools/report.py
56
110
  fallthrough python3 /other/repo/tools/report.py
57
111
  fallthrough printf '%s' 'the path @ROOT@/tools/report.py is steered'
58
112
  fallthrough printf '%s' "the path @ROOT@/tools/report.py is steered"
59
- # The heredoc row lands on `allow` rather than `fallthrough` because
60
- # rule `append_scratch`'s create grant reaches it fourteen rules later; a rule `abs_prefix`
61
- # regression would still read `block`, which is what this row asserts.
62
- allow cat <<'EOF' > .tmp/note.md@NL@the path @ROOT@/tools/report.py is steered@NL@EOF
113
+ # The heredoc row falls through, since a heredoc opener fails the literal test every grant
114
+ # takes (guard-kit/SPEC.md §The generic ruleset); a rule `abs_prefix` regression would
115
+ # read `block`, which is what this row asserts.
116
+ fallthrough cat <<'EOF' > .tmp/note.md@NL@the path @ROOT@/tools/report.py is steered@NL@EOF
63
117
 
64
118
  # rule `expansion` — shell expansion / assignment; single-quoted $ stays literal.
65
119
  # 'sq' only: a double-quoted "$x" expands, and so does an
66
120
  # unquoted-delimiter heredoc body — the stated bound on the hd class.
67
121
  block echo $(pwd)
68
122
  block P=/tmp/x
123
+ # a heredoc opener riding an assignment is no command after it, so the assignment stands alone
124
+ block P=/tmp/x <<'EOF'@NL@x@NL@EOF
125
+ # a pass row falls through rather than being granted: its quote or heredoc opener fails the literal
126
+ # test every grant takes (guard-kit/SPEC.md §The generic ruleset)
69
127
  fallthrough awk '$1' data.txt
70
128
  # 'hdq': an unquoted delimiter expands, so its body stays live; a quoted one
71
129
  # cannot expand, and the shell is what guarantees that — so its body is inert
72
130
  block cat <<EOF > .tmp/n.md@NL@value is $(date)@NL@EOF
73
- allow cat <<'EOF' > .tmp/n.md@NL@value is $(date)@NL@EOF
131
+ fallthrough cat <<'EOF' > .tmp/n.md@NL@value is $(date)@NL@EOF
74
132
  # reaches rule `git_rewrite`'s advisory, which is the correct verdict for a commit -F; the
75
133
  # point is that rule `expansion` no longer blocks it before rule `git_rewrite` is ever consulted
76
134
  advise git commit -F - <<'MSG'@NL@names a $(cmd) in the body@NL@MSG
@@ -82,42 +140,69 @@ advise git commit -F - <<'MSG'@NL@names a $(cmd) in the body@NL@MSG
82
140
  # The placeholder rewrite emits allow, so it attaches only when the
83
141
  # rewritten command is allowlisted and stays inside rule `grant_path_slot`'s path slots;
84
142
  # an unallowlisted and an unbounded placeholder block with the quoted-
85
- # spelling corrective instead
143
+ # spelling corrective instead, and so does a placeholder call failing the
144
+ # literal test (guard-kit/SPEC.md §The generic ruleset): `\;` is a backslash.
145
+ # A pass row carrying a quote or a heredoc falls through on that test
86
146
  block find . -exec rm {} \;
87
147
  block ls | xargs -I{} rm {}
88
148
  rewrite find .tmp/x -exec cat {} +
89
149
  block find .tmp/../x -exec cat {} +
150
+ # a placeholder command behind the noclobber operator is a write's target, not a segment
151
+ block printf x >| find .tmp/x -exec cat {} +
152
+ block printf x>|find .tmp/x -exec cat {} +
153
+ block printf x 2>| find .tmp/x -exec cat {} +
154
+ # rule `abs_script`'s redirect test, a carriage return a word character in it
155
+ block find .tmp/x -exec cat {} + >&2@CR@tracked.md
156
+ block find .tmp/x -exec cat {} + >&@CR@2
90
157
  block git log @{u}..
91
158
  block echo {1..5}
92
159
  block mkdir -p a/{b,c}
93
160
  fallthrough awk '{print $1}'
94
- fallthrough find . -exec grep foo '{}' +
95
- allow grep -rnE "^[a-z]{2,}" src
96
- allow cat <<'EOF' > .tmp/note.md@NL@a brace {a,b} in prose@NL@EOF
161
+ block find . -exec grep foo '{}' +
162
+ fallthrough grep -rnE "^[a-z]{2,}" src
163
+ fallthrough cat <<'EOF' > .tmp/note.md@NL@a brace {a,b} in prose@NL@EOF
97
164
  block cat <<'EOF' > a/{b,c}/note.md@NL@prose@NL@EOF
98
165
 
99
- # rule `sed_file` — sed or awk reading a file, or sed rewriting one; a piped-into sed is a
100
- # filter. awk fires on two read shapes, each with one file operand and no
101
- # pipe into the segment — a line range (steered to Read) and a markdown
102
- # heading range (steered to the section extractor); a transform, a
103
- # single-regex filter, a program file, a non-.md range, a second operand
104
- # and a piped-into awk all pass. perl fires on an in-place bundle with at
166
+ # rule `sed_file` — sed or awk reading a file or a stream's line range, or sed rewriting one; a
167
+ # piped-into sed is a filter unless its script is a bare range print
168
+ # (steered to head and tail). awk fires on two read shapes — a line range
169
+ # with one file operand and no pipe into the segment (steered to Read),
170
+ # and the same range piped into with no operand (steered to head and
171
+ # tail); a transform, a regex filter or range, a program file, a second
172
+ # operand and a piped-into awk with an action all pass, an unquoted program
173
+ # granted by rule `ro_pipeline`'s program check and a quoted one falling
174
+ # through on the literal test every grant takes (guard-kit/SPEC.md §The
175
+ # generic ruleset). perl fires on an in-place bundle with at
105
176
  # least one file operand, a sweep or a glob included; perl -pi reading
106
177
  # stdin, an xargs-led perl, an unmodelled perl option and a perl without
107
178
  # the in-place flag all pass, and so does the --rewrite arm both steer to
108
179
  block sed -n '1,60p' TASK-QUEUE.md
109
180
  block sed -i 's/a/b/' notes.md
181
+ # an option is read by its word's value: a quoted one is the option it is
182
+ block sed -'n' '1,60p' TASK-QUEUE.md
183
+ block sed '-n' '1,60p' TASK-QUEUE.md
184
+ block sed -'i' 's/a/b/' notes.md
185
+ # under bash the tool and its words come through the command read: by value, by path and
186
+ # past a wrapper other than xargs, in a pipe member as at a statement's head
187
+ block \perl -'pi' -e 's/a/b/' notes.md
188
+ block grep -n x tracked.md | command sed \-n '5,10p'
189
+ block nohup \awk 'NR<=5' notes.txt
190
+ fallthrough sed -'l' 5 '1,60p' TASK-QUEUE.md
110
191
  fallthrough sed -E 's/a/b/'
111
- fallthrough grep foo file | sed -e s/a/b/
192
+ allow grep foo file | sed -e s/a/b/
193
+ block grep -n x tracked.md | sed -n '5,10p'
194
+ block grep -n x tracked.md | awk 'NR>=5 && NR<=10'
195
+ allow grep -n x tracked.md | head -n 10 | tail -n +5
112
196
  block awk 'NR>=10 && NR<=40' TASK-QUEUE.md
113
197
  block awk -F: 'NR==5,NR==9 { print $0 }' notes.txt
114
- block awk '/^## Layout/,/^## Testing/' SPEC.md
198
+ fallthrough awk '/^## Layout/,/^## Testing/' SPEC.md
115
199
  block awk 'NR<=5' notes.txt | head -3
116
200
  fallthrough awk 'NR>=10 && NR<=40 {print $2}' notes.txt
117
201
  fallthrough awk '/needle/' notes.txt
118
202
  fallthrough awk '/^## Layout/,/^## Testing/' notes.txt
119
203
  fallthrough awk -f prog.awk notes.txt
120
204
  fallthrough awk 'NR<=5' a.txt b.txt
205
+ block awk 'NR<=5' my\ notes.txt
121
206
  fallthrough grep -n foo notes.txt | awk 'NR<=5' notes.txt
122
207
  fallthrough awk -W posix 'NR<=5' notes.txt
123
208
  block perl -pi -e 's/a/b/' notes.md
@@ -130,18 +215,30 @@ fallthrough perl -pi -e 's/a/b/'
130
215
  fallthrough perl -I lib -pi -e 's/a/b/' notes.md
131
216
  fallthrough perl -ne 'print if /x/' notes.md
132
217
  fallthrough bash gate-sdk/bin/run-gates.sh --rewrite --regex 'a|b' 'c' notes.md
218
+ # a heredoc beside the call leaves its options read by value
219
+ block sed -'n' '1,60p' TASK-QUEUE.md <<'EOF'@NL@x@NL@EOF
133
220
  # rule `sed_file`'s python arm — an inline body (a quoted heredoc feeding stdin, or a -c argument) that is a
134
221
  # literal rewrite; a computed replacement, an import, a read-only body, a '$' in an
135
222
  # unquoted-delimiter body and a module run all pass
136
223
  block python3 - <<'PY'@NL@p = 'notes.md'@NL@s = open(p).read()@NL@assert s.count('old') == 1@NL@s = s.replace('old', 'new')@NL@open(p, 'w').write(s)@NL@PY
137
224
  block python3 - <<'PY'@NL@def sub(p, o, n):@NL@ s = open(p).read()@NL@ assert s.count(o) == 1@NL@ open(p, 'w').write(s.replace(o, n))@NL@sub('a.md', 'x', 'y')@NL@PY
138
225
  block python3 -c "p='notes.md'; s=open(p).read(); open(p,'w').write(s.replace('a', 'b'))"
226
+ # a heredoc beside a -c body is the body's stdin, and the body is read off the word read
227
+ block python3 -c "p='notes.md'; s=open(p).read(); open(p,'w').write(s.replace('a', 'b'))" <<'EOF'@NL@x@NL@EOF
139
228
  fallthrough python3 - <<'PY'@NL@p = 'notes.md'@NL@s = open(p).read()@NL@open(p, 'w').write(s.replace('a', f'{p}'))@NL@PY
140
229
  fallthrough python3 - <<'PY'@NL@s = open('n.md').read()@NL@open('n.md', 'w').write(re.sub('a', 'b', s).replace('c', 'd'))@NL@PY
141
230
  fallthrough python3 - <<'PY'@NL@import json@NL@s = open('n.md').read()@NL@open('n.md', 'w').write(s.replace('a', 'b'))@NL@PY
142
231
  fallthrough python3 - <<'PY'@NL@s = open('n.md').read()@NL@print(s.replace('a', 'b'))@NL@PY
143
232
  fallthrough python3 - <<PY@NL@s = open('n.md').read()@NL@open('n.md', 'w').write(s.replace('cost $5', 'b'))@NL@PY
144
233
  fallthrough python3 -m json.tool notes.json
234
+ # the discriminator is the body alone: a literal rewrite looping over several files blocks as one
235
+ # over a single file does, and a command following the body, a read or a build, moves neither
236
+ # verdict; a body carrying a computed-text construct passes whatever follows it
237
+ block python3 - <<'PY'@NL@for p in ['a.md', 'b.md', 'c.md', 'd.md']:@NL@ s = open(p).read()@NL@ open(p, 'w').write(s.replace('old', 'new'))@NL@PY
238
+ block python3 - <<'PY'@NL@for p in ['a.md', 'b.md', 'c.md', 'd.md']:@NL@ s = open(p).read()@NL@ open(p, 'w').write(s.replace('old', 'new'))@NL@PY@NL@grep -n new a.md
239
+ block python3 - <<'PY'@NL@p = 'notes.md'@NL@s = open(p).read()@NL@open(p, 'w').write(s.replace('old', 'new'))@NL@PY@NL@make build
240
+ block python3 -c "p='notes.md'; s=open(p).read(); open(p,'w').write(s.replace('a', 'b'))" && make build
241
+ fallthrough python3 - <<'PY'@NL@import re@NL@for p in ['a.md', 'b.md']:@NL@ s = open(p).read()@NL@ open(p, 'w').write(re.sub('old', 'new', s).replace('c', 'd'))@NL@PY@NL@make build
145
242
 
146
243
  # rule `find_glob` — listing-only find steered to Glob, alone or as a ';'-batch of listings
147
244
  # (a literal banner between them is fine); action-predicate / piped /
@@ -150,21 +247,75 @@ block find lib -type f
150
247
  block find lib -name '*.sh'
151
248
  block find lib -type f; find lib -type d
152
249
  block find lib -type f; echo ===; find lib -type d
250
+ # the command words come through the command read, a banner's included: by value, by path, past a wrapper
251
+ block \find lib -type f; 'echo' ===; command find lib -type d
252
+ # a heredoc feeds a stdin find never reads, so it composes nothing: its opener and residue are read
253
+ # past, and any other redirect beside it still composes
254
+ block find lib -type f <<'EOF'@NL@x@NL@EOF
255
+ block find lib -type f; find lib -type d <<'EOF'@NL@x@NL@EOF
256
+ fallthrough find . -type f > listing.txt <<'EOF'@NL@x@NL@EOF
153
257
  fallthrough find lib -type f; find lib -delete
154
258
  fallthrough find . -name '*.tmp' -delete
155
- fallthrough find src -type f -exec grep -q foo '{}' ';'
156
259
  allow find . -type f | head
157
260
  fallthrough find . -type f > listing.txt
158
261
 
262
+ # rule `find_exec` — a read-only roster command under one find -exec is steered to
263
+ # find -print0 | xargs -0; another action, a command off the roster or in
264
+ # one of its write forms, and a second -exec all pass
265
+ block find . -name '*.md' -exec grep -l x '{}' +
266
+ block find src -type f -exec grep -q foo '{}' ';'
267
+ block find src -type f -exec grep -q foo '{}' \;
268
+ fallthrough find src -type f -exec grep -q foo '{}' \; -print
269
+ # an even backslash run is a literal backslash operand and a real break, so no terminator
270
+ fallthrough find src -type f -exec grep -q foo '{}' \\;
271
+ # the terminator and the command word are read by value: a quoted backslash-semicolon is a literal
272
+ # operand and ends nothing, and an escaped command word is the command it names
273
+ fallthrough find src -type f -exec cat '{}' '\;'
274
+ block find src -type f -exec \cat '{}' \;
275
+ block find . -name \*.md -exec cat a\ b '{}' \;
276
+ # a heredoc feeds a stdin no executed read takes, unless a word names it
277
+ block find src -type f -exec grep -q foo '{}' \; <<'EOF'@NL@x@NL@EOF
278
+ fallthrough find src -type f -exec grep -f - '{}' \; <<'EOF'@NL@x@NL@EOF
279
+ # a quoted read no rule steers takes no grant either: the literal test (guard-kit/SPEC.md §The
280
+ # generic ruleset) refuses its quote
281
+ fallthrough find . -name '*.md' -print0 | xargs -0 grep -l x
282
+ fallthrough find . -name '*.tsv' -delete
283
+ fallthrough find . -exec md5sum '{}' +
284
+ fallthrough find . -exec sort -o out.txt '{}' +
285
+ fallthrough find . -exec grep x '{}' + -exec grep y '{}' +
286
+ # the executed program is read by its words' values, so a quoted backslash ahead of a dash is
287
+ # program text the check clears
288
+ block find . -name x -exec sed -n '\-x-p' '{}' +
289
+
159
290
  # rule `cat_file` — bare single-file cat steered to Read, alone or as a ';'-batch of reads
160
291
  # (a literal echo/printf banner between reads is fine); multi-file, piped,
161
292
  # redirected, &&-chained, mixed, and banner-only forms are composition and pass
162
293
  block cat TASK-QUEUE.md
163
294
  block cat -n guard-kit/SPEC.md
295
+ # an option is read by its value, so a quoted or escaped one is no second operand; a quoted pass row
296
+ # falls through on the literal test every grant takes (guard-kit/SPEC.md §The generic ruleset)
297
+ block cat \-n guard-kit/SPEC.md
298
+ block cat '-n' guard-kit/SPEC.md
299
+ block cat "-n" guard-kit/SPEC.md
300
+ fallthrough cat '-n' one.md two.md
301
+ # `--` ends the options, so a dash-led word behind it is a file: two of them concatenate, and one
302
+ # is the lone read
303
+ fallthrough cat -- '-n' tracked.md
304
+ allow cat -- -n tracked.md
305
+ block cat -- -n
306
+ block cat -n -- tracked.md
164
307
  block cat a.md; cat b.md
165
308
  block cat a.md; echo ===; cat b.md
166
- fallthrough cat a.md; find lib -type f
167
- fallthrough cat a.md && cat b.md
309
+ # the command words come through the command read, a banner's included: by value, by path, past a wrapper
310
+ block \cat a.md; "printf" ===; /bin/cat b.md
311
+ # a heredoc feeds a stdin a one-file cat never reads, so it composes nothing; a heredoc-fed cat
312
+ # names no file, or names stdin, and passes
313
+ block cat TASK-QUEUE.md <<'EOF'@NL@x@NL@EOF
314
+ block cat a.md; cat b.md <<'EOF'@NL@x@NL@EOF
315
+ fallthrough cat -- - <<'EOF'@NL@x@NL@EOF
316
+ fallthrough cat /dev/stdin <<'EOF'@NL@x@NL@EOF
317
+ fallthrough cat a.md; make build
318
+ fallthrough cat a.md && make build
168
319
  fallthrough echo a; echo b
169
320
  allow cat one.md two.md
170
321
  allow cat notes.md | wc -l
@@ -177,34 +328,64 @@ block git grep -i TODO
177
328
  block git grep needle -- src
178
329
  fallthrough git grep foo HEAD
179
330
  fallthrough git grep --cached foo
331
+ # the words come through the git read (rule `git_mutation_under_producer`): an escape inside a word,
332
+ # a path-spelled command word and a global option are the plain spelling's, a global
333
+ # option that moves the repository names another tree, and one quoted word is no subcommand
334
+ block git gr\ep foo
335
+ block /usr/bin/git grep foo
336
+ block git --no-pager grep foo
337
+ # a heredoc feeds a stdin git grep reads only where a word names it
338
+ block git grep foo <<'EOF'@NL@x@NL@EOF
339
+ fallthrough git grep -f - <<'EOF'@NL@x@NL@EOF
340
+ fallthrough git -C sub grep foo
341
+ fallthrough git 'grep foo'
180
342
 
181
343
  # rule `pgrep_self_match` — self-matching process-liveness predicate: a `pgrep -f` pattern that
182
344
  # matches the command's own text can never go false, since `-f` scans the
183
345
  # harness wrapper's argv, which carries the whole command. A `pgrep`
184
346
  # without `-f`, `-x`/`-v`, and a pattern that does not match its own
185
347
  # text pass.
186
- block bash run-smoke.sh & until ! pgrep -f run-smoke.sh; do sleep 5; done
187
- block pkill -f run-smoke.sh; bash run-smoke.sh
188
- block pgrep -f run-smoke.sh
348
+ block bash gate-sdk/bin/run-gates.sh --installer-smoke & until ! pgrep -f installer-smoke; do sleep 5; done
349
+ block pkill -f installer-smoke; bash gate-sdk/bin/run-gates.sh --installer-smoke
350
+ block pgrep -f installer-smoke
351
+ # the words are read by value too, so a wrapper-led, quoted or escaped spelling self-matches, while a
352
+ # partly quoted pattern finds no copy of itself in the raw text
353
+ block nohup \pgrep "-f" installer-smoke
354
+ fallthrough pgrep -f install'er-smoke'
189
355
  block while pgrep -f 'checkwright-gates --run-validate'; do sleep 5; done
190
356
  block if pgrep -f worker; then echo up; fi
357
+ block while pgrep -f run-validate >/dev/null; do sleep 10; done
358
+ block while pgrep -f "run-validate" > /dev/null 2>&1; do sleep 15; done; echo finished
191
359
  block bash run.sh; pgrep -if 'R[U]N'
192
360
  fallthrough bash run.sh; pgrep -f 'R[U]N'
193
- fallthrough pgrep run-smoke.sh; bash run-smoke.sh
194
- fallthrough until ! pgrep -f '[r]un-smoke.sh'; do sleep 5; done
195
- fallthrough pgrep -xf run-smoke.sh
361
+ fallthrough pgrep installer-smoke; bash gate-sdk/bin/run-gates.sh --installer-smoke
362
+ fallthrough until ! pgrep -f '[i]nstaller-smoke'; do sleep 5; done
363
+ fallthrough pgrep -xf installer-smoke
196
364
 
197
365
  # rule `bare_sleep` — bare foreground sleep steered to a condition wait. The non-firing
198
366
  # cases are the load-bearing ones: a sleep inside an `until … do … done`
199
- # loop *is* the sanctioned form, and a quoted mention is inert. Both
200
- # are `allow` rather than `fallthrough` because a later auto-allow
201
- # grants them outright — rule `append_scratch` the append, rule `bounded_wait` the wait — and
202
- # each still proves rule `bare_sleep` inert, since a block exits 2 at rule `bare_sleep` and
203
- # never reaches an auto-allow six rules later.
367
+ # loop *is* the sanctioned form, and a quoted mention is inert. The loop
368
+ # is `allow` rather than `fallthrough` because rule `bounded_wait` grants
369
+ # it later in the table, and the quoted mention falls through, its quote
370
+ # failing the literal test every grant takes (guard-kit/SPEC.md §The
371
+ # generic ruleset). Each still proves rule `bare_sleep` inert, since a
372
+ # block exits 2 at rule `bare_sleep`.
204
373
  block sleep 30
205
374
  block sleep 180; echo waited
375
+ # a keyword spelled as an argument opens and closes no span
376
+ block sleep 5; echo done
377
+ # a redirect operator ends the word it is glued to
378
+ block sleep>/dev/null 5
379
+ # the command word also comes through the command read, at the loop depth of its segment: by value,
380
+ # by path and past a wrapper, while a quoted sleep in a loop body stays the sanctioned form
381
+ block echo start; \sleep 30
382
+ block nohup /bin/sleep 30
383
+ fallthrough until [ -f .tmp/marker ]; do \sleep 5; done
384
+ # and its target is no command position, behind `>&` as behind `>`
385
+ block sleep 5 >& done
386
+ fallthrough make waited >& sleep 5
206
387
  allow until grep -q DONE .tmp/smoke.log; do sleep 5; done
207
- allow printf 'sleep 5' >> .tmp/note.txt
388
+ fallthrough printf 'sleep 5' >> .tmp/note.txt
208
389
 
209
390
  # rule `git_mutation_under_producer` — tracked-tree mutation under a live producer. The sandbox's only
210
391
  # `*.run` record names a dead pid and a non-record file sits beside
@@ -213,7 +394,7 @@ allow printf 'sleep 5' >> .tmp/note.txt
213
394
  # all. The block arm needs a pid the test owns and lives in
214
395
  # gate-tests/git-mutation-under-producer.test.sh.
215
396
  fallthrough git add tracked.md
216
- fallthrough git stash
397
+ fallthrough git restore --staged tracked.md
217
398
  fallthrough git -C . commit -m done
218
399
  fallthrough git rev-parse HEAD
219
400
 
@@ -227,12 +408,134 @@ fallthrough bash worker.sh & printf 'pid=1 run=worker\n' > .tmp/worker.run
227
408
  # through a member's own option owns work a commit could corrupt
228
409
  block grep -rn foo src | sort -o out.txt &
229
410
  fallthrough grep -rn foo src | head &
411
+ # a member glued to a redirect still owes the record by its write form, in a lone statement as
412
+ # behind a loop's statement-ending '&'
413
+ block sort>/dev/null -o out.txt tracked.md &
414
+ block until [ -f x ]; do sleep 1; done & sort>/dev/null -o out.txt tracked.md
415
+ # and its inert targets: a carriage return is a word character, so a descriptor glued to one names a file
416
+ block grep -rn foo src >&2@CR@tracked.md &
417
+ # a bare `&` glued to the next word ends its statement as a spaced one does, so the read ahead
418
+ # of it is no read-only pipeline; `&&`, `&>`, `>&`, `<&` and `|&` end none
419
+ block ls &touch x
420
+ block ls&touch x
421
+ block grep -rn foo src &sort -o out.txt tracked.md
422
+ fallthrough grep -rn foo src &grep -c x tracked.md
423
+ allow grep -c x tracked.md <&0 2>&1 |& head
424
+ allow grep -c x tracked.md <& 0
425
+ allow grep -c x tracked.md &>/dev/null
426
+ block grep -rn foo src >&@CR@2 &
427
+ # an escaped or quoted '&' is a character of its word and ends no statement; after an even
428
+ # backslash run it is bare again. A read carrying the escape or the quote falls through rather than
429
+ # being granted, on the literal test every grant takes (guard-kit/SPEC.md §The generic ruleset)
430
+ fallthrough grep -c x\&y tracked.md
431
+ fallthrough grep -c 'x&y' tracked.md
432
+ block grep -c x\\&y tracked.md
433
+ # an escaped '|', '>', '<' or '&' is a character of its word too, so a bare '&' behind one ends
434
+ # its statement and the operator it would have formed is none
435
+ block wc -l tracked.md\|&touch tracked.md
436
+ block wc -l tracked.md\>&touch tracked.md
437
+ block wc -l tracked.md\<&touch tracked.md
438
+ block wc -l tracked.md\&&touch tracked.md
439
+ fallthrough wc -l tracked.md\|touch tracked.md
440
+ fallthrough grep -c x tracked.md\\|& head
230
441
  # '|&' pipes stderr too and backgrounds nothing
231
442
  fallthrough make build |& tail -5
232
443
 
444
+ # rule `commit_only_paths` — a `git add` then a commit of the whole index (no path, or -a/-i) is
445
+ # steered to the only-paths form; a commit naming its paths, a quoted mention
446
+ # and a lone commit or add pass
447
+ block git add tracked.md && git commit -m x
448
+ block git add -A; git commit -m x
449
+ block git add tracked.md && git commit -am x
450
+ block git add tracked.md && git commit -i tracked.md -m x
451
+ block git add tracked.md && git commit -m fix\ it
452
+ fallthrough git add scratch.txt && git commit -o scratch.txt tracked.md -m x
453
+ fallthrough git add scratch.txt && git commit scratch.txt -m x
454
+ fallthrough git add tracked.md && git commit -m 'git commit -a' -- tracked.md
455
+ fallthrough git commit -m x
456
+ # the words come through the git read (rule `git_mutation_under_producer`)
457
+ block git add tracked.md && git comm\it -m x
458
+
459
+ # rule `git_stash` — a stash that rewrites the working tree or the index is blocked on the main
460
+ # checkout, which the sandbox is; the forms that leave the tree as it is, a verb the
461
+ # walk does not know and a global option that moves the repository pass. The linked
462
+ # worktree's pass lives in gate-tests/worktree-confinement.test.sh. Each word is read
463
+ # by its value through the git read (rule `git_mutation_under_producer`), so a quoted
464
+ # or escaped spelling is the plain one; a redirect is no word, and a quoted `>` is
465
+ # one. The command word is git by its path and behind a wrapper the matcher strips,
466
+ # and a second program that runs git is not read.
467
+ block git stash
468
+ block git stash -u
469
+ block git stash push -m x
470
+ block git stash pop
471
+ block git stash apply
472
+ block git --no-pager stash
473
+ block git stash 2>&1
474
+ block git status; git stash pop
475
+ block git 'stash' push
476
+ block git stash 'push'
477
+ block git "stash" pop
478
+ block git stash "pop"
479
+ block git 'stash'
480
+ block git $'st\x61sh'
481
+ block git st\ash
482
+ block git stash '-u'
483
+ block git '--no-pager' stash
484
+ block 'git' stash
485
+ block "git" stash
486
+ block \git stash
487
+ block g'it' stash
488
+ block git stash &>/dev/null
489
+ block if git stash>.tmp/o; then ls; fi
490
+ # a word glued ahead of a redirect keeps its value, and a separated `>&` takes its target
491
+ block git 'stash'>/dev/null push
492
+ block git stash 'pop'>/dev/null
493
+ block git st\ash>/dev/null push
494
+ block git stash 2>& 1 pop
495
+ block echo "a@NL@b"; git stash
496
+ fallthrough git stash list
497
+ fallthrough git stash show -p
498
+ fallthrough git stash drop
499
+ fallthrough git stash frobnicate
500
+ fallthrough git -C sub stash
501
+ block /usr/bin/git stash
502
+ block nohup git stash
503
+ block FOO=1 git stash
504
+ fallthrough env git stash
505
+ fallthrough sudo git stash
506
+ fallthrough echo 'git stash'
507
+ fallthrough git stash 'list'
508
+ fallthrough git 'stash' drop
509
+ fallthrough git '-C' sub stash
510
+ fallthrough git 'stash push'
511
+ fallthrough git stash '>'
512
+ fallthrough git stash2>.tmp/o
513
+ # a heredoc beside the call leaves its words read by value
514
+ block git 'stash' <<'EOF'@NL@x@NL@EOF
515
+
233
516
  # rule `truncate_scratch` — `: > file` truncation auto-allowed iff every target is gitignored
234
517
  allow : > scratch.txt
235
518
  fallthrough : > tracked.txt
519
+ # `>&` onto a named file is the truncation `>` is, bounded by the same target test; an fd-dup is
520
+ # no gitignored target
521
+ allow : >& scratch.txt
522
+ allow : >&scratch.txt
523
+ fallthrough : >& tracked.txt
524
+ fallthrough : > scratch.txt 2>&1
525
+ # a second redirect glued to a target is a redirect of its own, never part of an ignored name: a
526
+ # target under the ignored directory is granted, and the same target with a write to a tracked
527
+ # file glued on is not, a digit ahead of the glued operator being the target's own character
528
+ allow : > .tmp/a
529
+ fallthrough : > .tmp/a>tracked.md
530
+ fallthrough : >.tmp/a>tracked.md
531
+ fallthrough : >& .tmp/a>tracked.md
532
+ fallthrough : > .tmp/a>>tracked.md
533
+ fallthrough : > .tmp/a2>tracked.md
534
+ # a carriage return is a word character: a descriptor glued to one names a file, and one ending an
535
+ # ignored target fails the literal test (guard-kit/SPEC.md §The generic ruleset)
536
+ fallthrough : >&2@CR@tracked.md
537
+ fallthrough : > scratch.txt >&@CR@2
538
+ fallthrough : > .tmp/a@CR@
236
539
 
237
540
  # rule `append_scratch` — a write to gitignored targets auto-allowed, create and append alike.
238
541
  # The clauses each get their refusing case, because each is what keeps
@@ -243,45 +546,241 @@ fallthrough : > tracked.txt
243
546
  # heredoc residue must never be confused with.
244
547
  # Targets are relative, as rules `scratch_redirect` and `truncate_scratch`'s are: the runner drives the
245
548
  # guard from inside the sandbox, and an `@ROOT@`-absolute target would
246
- # meet rule `abs_prefix`'s repo-root-prefix block nine rules earlier.
549
+ # meet rule `abs_prefix`'s repo-root-prefix block first.
247
550
  # A refused write still reaching rule `emitter_write` reads `block` there rather than
248
551
  # `fallthrough`: what these rows assert is that rule `append_scratch` did not grant.
249
- allow cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF
250
- allow cat > .tmp/journal.md <<'EOF'@NL@line@NL@EOF
552
+ # A call failing the literal test (guard-kit/SPEC.md §The generic ruleset) takes no
553
+ # grant, so a quote, a backslash, a `$` and a heredoc or herestring opener each fall
554
+ # through, the heredoc journal append among them, and the grant's rows are literal
555
+ # spellings.
556
+ fallthrough cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF
557
+ fallthrough cat > .tmp/journal.md <<'EOF'@NL@line@NL@EOF
251
558
  block cat >> tracked.md <<'EOF'@NL@line@NL@EOF
252
- fallthrough rm -rf .tmp/x >> .tmp/journal.md
253
- block printf x >> .tmp/journal.md@NL@rm -rf .tmp/x
254
- # (d)'s region test is `hdq`, not the raw command: a backtick in a QUOTED
255
- # delimiter's body cannot substitute, so the grant reaches the shape the mandated
256
- # journal append is always spelled in; an UNQUOTED delimiter leaves the body live
257
- # and the decline still fires. Nothing else distinguishes the two at the grant
258
- # boundary, so these two rows are the whole holder of the asymmetry.
259
- allow cat >> .tmp/journal.md <<'EOF'@NL@a `slug` in prose@NL@EOF
559
+ fallthrough rm -rf scratch.txt >> .tmp/journal.md
560
+ block printf x >> .tmp/journal.md@NL@rm -rf scratch.txt
561
+ # a heredoc takes no grant whatever its delimiter's quoting; (d)'s `hdq` region test is held by the
562
+ # rows of rule `emitter_write`, which reads it on the same view
563
+ fallthrough cat >> .tmp/journal.md <<'EOF'@NL@a `slug` in prose@NL@EOF
260
564
  fallthrough cat >> .tmp/journal.md <<EOF@NL@a `slug` in prose@NL@EOF
261
565
  # the create half rests on rule `truncate_scratch`: `: > f` and then `cat >> f` are each already
262
566
  # granted, so a create adds one permission decision and no capability. Every
263
567
  # other clause still holds — a tracked target refuses on the per-target ignore
264
568
  # test the append case takes, which is the row that would catch an over-wide grant
265
- allow printf 'x' > .tmp/note.txt
569
+ allow printf x > .tmp/note.txt
570
+ fallthrough printf 'x' > .tmp/note.txt
266
571
  block cat > tracked.md <<'EOF'@NL@line@NL@EOF
267
572
  # the two inert targets are exempt from (a) and (b): neither is a file the
268
573
  # append-only split protects, and neither is a path git check-ignore can answer
269
- allow printf 'x@NL@' >> .tmp/journal.md 2>/dev/null
574
+ allow printf x >> .tmp/journal.md 2>/dev/null
575
+ fallthrough printf 'x@NL@' >> .tmp/journal.md 2>/dev/null
270
576
  allow cat >> .tmp/journal.md 2>&1
577
+ # a quoted target fails the literal test, an ignored one and a quoted /dev/null beside one alike
578
+ fallthrough printf x >> ".tmp/j.md"
579
+ fallthrough printf x >> .tmp/j.md 2>"/dev/null"
580
+ # a quoted target spelling a descriptor is a file of that name git does not ignore, beside a
581
+ # heredoc too: the grant withholds and rule `emitter_write` blocks
582
+ block printf x >> .tmp/j.md > '&1'
583
+ block printf x >> .tmp/j.md 2>"&1"
584
+ block cat >> .tmp/j.md > '&1' <<'EOF'@NL@x@NL@EOF
585
+ # a heredoc-bearing call falls through on the same test, whatever its delimiter's quoting
586
+ fallthrough cat >> ".tmp/j.md" <<'EOF'@NL@x@NL@EOF
587
+ fallthrough cat >> .tmp/j.md 2>"/dev/null" <<'EOF'@NL@x@NL@EOF
588
+ fallthrough cat >> ".tmp/j.md" << "EOF"@NL@x@NL@EOF
589
+ fallthrough cat >> ".tmp/j.md" <<'E"F'@NL@x@NL@E"F
590
+ # an ANSI-C quoted word is read by its resolved value, so a target spelling one names the file it
591
+ # resolves to (`$'\056\056'` is `..`, out of the scratch dir) and rule `emitter_write` blocks, beside a
592
+ # heredoc too; a span the read cannot resolve exactly leaves the target unread, and a resolvable
593
+ # one into scratch falls through on the literal test
594
+ block cat >> ".tmp/"$'\056\056/tracked.md'
595
+ block cat >> ".tmp/"$'\056\056/tracked.md' <<'EOF'@NL@x@NL@EOF
596
+ fallthrough printf x > .tmp/$'x'
597
+ fallthrough printf $'x\n' >> .tmp/j.md
598
+ block printf x > .tmp/$'\e'
599
+ # a locale-translated word (`$"…"`) is unread as an ANSI-C one is, the catalog that translates it
600
+ # being out of the guard's sight, so a target spelling one is no gitignored target either, and a
601
+ # write carrying one into scratch falls through on the literal test
602
+ block cat >> ".tmp/"$"../tracked.md"
603
+ block cat >> ".tmp/"$"../tracked.md" <<'EOF'@NL@x@NL@EOF
604
+ block printf x > .tmp/$"x"
605
+ fallthrough printf $"x" >> .tmp/j.md
606
+ # a carriage return is a word character, so a descriptor glued to one or behind one names a file
607
+ block cat >> .tmp/journal.md >&2@CR@tracked.md <<'EOF'@NL@line@NL@EOF
608
+ block cat >> .tmp/journal.md >&@CR@2 <<'EOF'@NL@line@NL@EOF
609
+ # `>&` onto a named file is the write `>` is, granted on an ignored target
610
+ allow printf x >& .tmp/note.txt
611
+ fallthrough printf 'x' >& .tmp/note.txt
612
+ # a continued line's backslash fails the literal test, and a continued heredoc opener puts what
613
+ # follows on the command line, ahead of the body, which the residue test refuses too
614
+ fallthrough printf x \@NL@>> .tmp/j.md
615
+ fallthrough cat >> .tmp/j.md <<'EOF' \@NL@; touch x@NL@EOF
271
616
 
272
- # rule `ro_pipeline` — read-only pipeline auto-allow; a non-roster segment falls through
617
+ # rule `ro_pipeline` — read-only pipeline auto-allow; a non-roster segment falls through, and so
618
+ # does a call failing the literal test (guard-kit/SPEC.md §The generic ruleset): a quote,
619
+ # a backslash or a `$` anywhere in it, so the value-read rows below each pin that refusal
273
620
  allow grep -rn foo src | head
274
621
  fallthrough grep foo file | awk '{print}'
622
+ fallthrough grep foo file | md5sum
623
+ # a read redirected to a named file is a write, behind `>&` as behind `>`: glued or apart, under a
624
+ # descriptor, in a later pipe segment, and onto a word that only opens with a digit. An fd-dup
625
+ # spelled apart, a closed descriptor and `/dev/null` stay inert
626
+ fallthrough grep -rn foo src > found.txt
627
+ fallthrough grep -rn foo src >& found.txt
628
+ fallthrough grep -rn foo src >&found.txt
629
+ fallthrough grep -rn foo src 1>& found.txt
630
+ fallthrough grep -rn foo src | head >& found.txt
631
+ fallthrough grep -rn foo src >&2x
632
+ allow grep -rn foo src 2>& 1
633
+ allow grep -rn foo src >&-
634
+ allow grep -rn foo src >& /dev/null
635
+ # a quoted target fails the literal test, a quoted /dev/null as a quoted file
636
+ fallthrough grep -rn foo src 2>"/dev/null"
637
+ fallthrough grep -rn foo src 2>'/dev/null'
638
+ fallthrough grep -rn foo src 2>"out.txt"
639
+ # a quoted target spelling a descriptor is a file of that name, since only a live '>&' dups
640
+ fallthrough grep -rn foo src > '&1'
641
+ fallthrough grep -rn foo src 2>"&2"
642
+ # a carriage return is a word character, as bash reads it: a descriptor glued to one or behind one
643
+ # names a file, and a redirect onto one alone writes a file of that name
644
+ fallthrough grep -rn foo src >&2@CR@tracked.md
645
+ fallthrough grep -rn foo src >&@CR@2
646
+ fallthrough grep -rn foo src >@CR@| head
647
+ # the noclobber operator writes the word after it, which the split reads as a second roster
648
+ # segment: spaced, glued and under a descriptor it withholds, and a quoted one is text. Behind an
649
+ # allowlisted lead the withheld grant leaves rule `allowlist_chain`'s block
650
+ fallthrough grep -rn foo src >| sort
651
+ fallthrough grep -rn foo src>|sort
652
+ fallthrough grep -rn foo src 2>| sort
653
+ fallthrough cat tracked.md >| head -5
654
+ block git status >| head
655
+ fallthrough grep -n '>|' tracked.md
656
+ # a compound is read statement by statement whatever joins it: each separator, a banner
657
+ # statement, and the widened lead opening a later statement (rule `allowlist_chain` would block
658
+ # it otherwise); a statement off the roster, a write form or a write in a later statement, and
659
+ # the backgrounding '&' still refuse
660
+ allow grep -c x tracked.md; wc -l tracked.md
661
+ allow grep -q x tracked.md && head -1 tracked.md
662
+ allow grep -q x tracked.md || echo none
663
+ allow echo ---; grep -c x tracked.md
664
+ allow git status; grep -c x tracked.md
665
+ allow git status && ls
666
+ allow cat a.md; find lib -type f
667
+ fallthrough grep -c x tracked.md; md5sum tracked.md
668
+ fallthrough grep -c x tracked.md; sort -o out.txt tracked.md
669
+ fallthrough grep -c x tracked.md; touch tracked.md
670
+ fallthrough grep -c x tracked.md & wc -l tracked.md
671
+ # the split keeps an escaped ';' in its word, so the call is one read, whose backslash fails the
672
+ # literal test; an even backslash run is a real break, and its second statement 'b' is off the roster
673
+ fallthrough grep foo a\;b
674
+ fallthrough grep foo a\\;b
675
+ # an escaped '|' and a backslash-newline are no break either, so each call below is one read, its
676
+ # backslash failing the literal test; an
677
+ # even run is a literal backslash and then a real break, here before a segment off the roster. The
678
+ # dequoted view reads a quoted backslash as an escape the skeleton never carries, so the declared-forms
679
+ # reader withholds on the split-count mismatch
680
+ fallthrough grep foo a \| b
681
+ fallthrough grep foo a \\| md5sum
682
+ fallthrough grep -c foo tracked.md \@NL@scratch.txt
683
+ fallthrough grep -c foo tracked.md \\@NL@md5sum scratch.txt
684
+ # the continued line's words are read whole, so a write form on its second line still withholds
685
+ fallthrough sort a.txt \@NL@-o out.txt
686
+ fallthrough grep foo 'a\' | sort -o out.txt
687
+ # the declared forms key on the member as the command read gives it, so a member glued to a
688
+ # redirect is still the member and its write form withholds
689
+ fallthrough sort>/dev/null -o tracked.md scratch.txt
690
+ allow sort>/dev/null tracked.md
691
+ # an ANSI-C quoted word is read by its value, so a write form spelled with one withholds the grant as
692
+ # the plain spelling does, and a read-only call so spelled falls through on the literal test; a
693
+ # locale-translated word is unread, so a write form spelled with one withholds too
694
+ fallthrough sort $'-o' tracked.md scratch.txt
695
+ fallthrough sort $"-o" tracked.md scratch.txt
696
+ fallthrough sort $'-\157' tracked.md scratch.txt
697
+ fallthrough grep $'a\tb' tracked.md
698
+ fallthrough head -5 $'tracked.md'
699
+ fallthrough echo $'a\nb' | wc -l
700
+ fallthrough sort $'a\n-o' tracked.md
701
+ fallthrough grep $'\q' tracked.md
702
+ # an ANSI-C span ends where bash ends it, at the first quote no backslash escapes, so an escaped quote
703
+ # is a character of its value and the text after it is live to every skeleton reader
704
+ fallthrough grep $'it\'s' tracked.md
705
+ block git status $'\'' ; git stash ; echo ''
706
+ block ls $'\'' ; rm tracked.md ; ls 'a'
707
+ # bash removes a backslash-newline before it reads a word, so a continuation between a '$' and its
708
+ # quote, or inside a '$' run, opens the span as the joined spelling does; the write behind the span
709
+ # is a literal one, so the arm (a) of rule `emitter_write` reads it
710
+ block printf $'\'' ; touch tracked.md ; printf x >> .tmp/j ; ls 'a'
711
+ block printf $\@NL@'\'' ; touch tracked.md ; printf x >> .tmp/j ; ls 'a'
712
+ block ls $\@NL@'\'' ; rm tracked.md ; ls 'a'
713
+ block ls $\@NL@\@NL@'\'' ; rm tracked.md ; ls 'a'
714
+ block ls $$\@NL@$'\'' ; rm tracked.md ; ls 'a'
715
+ fallthrough grep $\@NL@'it\'s' tracked.md
716
+ # a span the read cannot resolve exactly leaves the call unread: a control, a byte above ASCII,
717
+ # a NUL
718
+ fallthrough grep $'\cA' tracked.md
719
+ fallthrough grep $'\U000000e9' tracked.md
720
+ fallthrough grep $'\x80' tracked.md
721
+ fallthrough grep $'a\0b' tracked.md
722
+ fallthrough grep $"a" tracked.md
723
+ # the sed and awk program discriminator: a program the static check clears is read-only; an output
724
+ # redirect, a written file, a system() call, a command piped into getline and a program file
725
+ # withhold. A quoted program falls through on the literal test whatever the check finds
726
+ allow grep -n x tracked.md | sed s/a/b/
727
+ fallthrough grep -n x tracked.md | sed 's/a/b/'
728
+ fallthrough grep -c x tracked.md | awk '{s+=$1} END {print s}'
729
+ fallthrough awk '{print "a > b | c"}' tracked.md
730
+ fallthrough grep x tracked.md | awk '{print > "out.txt"}'
731
+ fallthrough grep x tracked.md | sed 's/a/b/w out.txt'
732
+ fallthrough awk 'BEGIN {system("ls")}'
733
+ fallthrough grep x tracked.md | awk '{"date" | getline d; print d}'
734
+ fallthrough grep x tracked.md | sed -f prog.sed
735
+ # an option the shell passes from behind an escape withholds, since the walker would read it as the
736
+ # program
737
+ fallthrough awk \-f prog.awk notes.txt
738
+ fallthrough grep x tracked.md | awk \-f prog.awk
739
+ fallthrough awk \-W posix 'NR<=5' notes.txt
740
+ fallthrough grep x tracked.md | xargs awk \-f prog.awk
741
+ # the test reads the word's value, so a quoted backslash ahead of a dash is program text, here a
742
+ # print under an address delimited by '-', where the same word unquoted is an option; the quote
743
+ # fails the literal test either way
744
+ fallthrough grep x tracked.md | sed -n '\-x-p'
745
+ fallthrough grep x tracked.md | xargs sed -n '\-x-p'
746
+ fallthrough grep x tracked.md | sed -n \-x-p
747
+ fallthrough grep x tracked.md | sed -n '\-x-w out.txt'
748
+ fallthrough grep x tracked.md | sed -l 5 s/a/b/
749
+ # the discriminator and the xargs arm read the dequoted view, which holds an ANSI-C quoted word by its
750
+ # value, so a segment carrying one is read as its plain spelling: an escape spelling a write or execute
751
+ # form withholds, and a program or an xargs run the plain spelling clears falls through on the literal
752
+ # test
753
+ fallthrough awk $'BEGIN { \x73ystem("printf pwned > tracked.md") }'
754
+ fallthrough grep x tracked.md | sed $'s/a/b/\x77 out.txt'
755
+ fallthrough awk $'{print}' tracked.md
756
+ fallthrough grep -l x tracked.md | xargs sort $'-o' tracked.md
757
+ fallthrough grep -l x tracked.md | xargs sort $'-\157' tracked.md
758
+ fallthrough grep -l x tracked.md | xargs awk $'BEGIN { \x73ystem("ls") }'
759
+ fallthrough grep -l x tracked.md | xargs grep $'a\tb'
760
+ fallthrough until awk $'BEGIN { \x73ystem("ls") }' tracked.md; do sleep 1; done
761
+ fallthrough grep $'a\tb' tracked.md | awk '{print}'
762
+ # a value carrying a line feed is held unresolved, as no aligned span holds one, so a segment
763
+ # carrying it withholds, as its plain spelling's newline-bearing span does
764
+ fallthrough awk $'{print}\n' tracked.md
765
+ fallthrough grep -l x tracked.md | xargs grep $'a\nb'
766
+ # the declared forms read every line of the values, so a value carrying a line feed hides no word
767
+ # after it from them
768
+ fallthrough find . -name $'*.md\n' -delete
769
+ fallthrough find . -name $'\n' -o -name 'tracked.md' -delete
770
+ fallthrough sort $'a\n' -o out.txt tracked.md
771
+ fallthrough grep -c $'a\nb' tracked.md
275
772
  # banner tolerance (rules `find_glob` and `cat_file`'s): a literal echo/printf
276
773
  # segment is skipped, but at least one roster read must remain
277
774
  allow echo === | grep foo src
278
775
  fallthrough echo a | echo b
279
776
  # widened lead: the bare form of a committed allow entry may lead, since it was reviewed —
280
777
  # but only where something decorates it, so the undecorated form (rule `allowlist_chain`'s
281
- # 'fallthrough git status' below) is still never intercepted here
778
+ # 'fallthrough git status' below) is still never intercepted here. A quoted tail fails the literal
779
+ # test, so no grant is taken and the decorated lead meets rule `allowlist_chain`'s block
282
780
  allow git status | head
283
781
  allow git status | head -20
284
782
  block git status | awk '{print}'
783
+ block git status | md5sum
285
784
  # xargs is on the roster but executes rather than filters, so it is granted only
286
785
  # when the command it runs is itself a roster binary. The refusing cases are the
287
786
  # point of the discriminator: each is a write, and each is silently granted
@@ -312,6 +811,20 @@ fallthrough rg --pre=cat foo src | head
312
811
  allow rg foo src | head
313
812
  fallthrough find . -type f | xargs sort -o out.txt
314
813
  fallthrough find . -name '*.txt' | xargs uniq
814
+ # a member's command word is its value off the word read, compared whole; a quoted, escaped or
815
+ # part-quoted roster binary and an escaped quote in an operand fail the literal test, while a path,
816
+ # a write form, the command a quoted xargs runs and a leading keyword withhold; a quoted path to cat
817
+ # stays rule `cat_file`'s block ahead of the band
818
+ fallthrough 'grep' -rn foo src | head
819
+ fallthrough "grep" foo f
820
+ fallthrough \grep foo f
821
+ fallthrough g'rep' foo f
822
+ fallthrough grep it\'s f
823
+ fallthrough '/bin/grep' foo f
824
+ block '/bin/cat' f
825
+ fallthrough 'sort' -o out.txt f
826
+ fallthrough 'xargs' rm
827
+ fallthrough ! grep -q x f
315
828
 
316
829
  # rule `bounded_wait` — a sanctioned wait auto-allowed. Arm (A), the bounded in-turn wait: the
317
830
  # grant rows are the two of the four measured calls it is shaped to
@@ -326,10 +839,38 @@ allow until grep -q DONE .tmp/smoke.log 2>/dev/null; do sleep 30; done; grep -n
326
839
  allow while kill -0 2147483646 2>/dev/null; do sleep 5; done
327
840
  allow until ! kill -0 2147483646 2>/dev/null; do sleep 5; done
328
841
  allow until [ -f .tmp/marker ]; do sleep 10; done
842
+ # a quoted target fails the literal test (guard-kit/SPEC.md §The generic ruleset), a quoted
843
+ # /dev/null as a quoted descriptor
844
+ fallthrough until [ -f .tmp/x ]; do sleep 5; done 2>"/dev/null"
845
+ # a quoted target spelling a descriptor is a file of that name, and the loop writes it
846
+ fallthrough until [ -f .tmp/x ]; do sleep 5; done > '&1'
847
+ # clause (a) counts the span's keywords in command position, so `done` as an argument is no second span
848
+ allow until grep -q done .tmp/smoke.log; do sleep 5; done; echo done
849
+ # and cuts the loop at the walk's keywords, so a blank around one is not asked
850
+ allow until grep -q DONE .tmp/smoke.log;do sleep 5;done
329
851
  # clause (0) — a statement-ending `&` is a launch, not a wait, whatever else the
330
852
  # command does. Rule `background_no_record` exempts the wait loop, so this row reaches rule `bounded_wait` and
331
853
  # is refused there rather than by an earlier rule's ordering
332
854
  fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done &
855
+ # the loop's own closing `&` is the wait backgrounded whole; a loop that works, or a producer
856
+ # after the wait, is a launch rule `background_no_record` holds to its record
857
+ block while true; do make build; done &
858
+ block until grep -q DONE .tmp/smoke.log; do sleep 5; done & make build
859
+ # the loop's own `&` is found past its inert redirects; a redirect to a named file there is a
860
+ # write, and a producer behind that `&` still a launch
861
+ fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done 2>/dev/null &
862
+ fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done >/dev/null 2>&1 &
863
+ block until grep -q DONE .tmp/smoke.log; do sleep 5; done > out.txt &
864
+ block until grep -q DONE .tmp/smoke.log; do sleep 5; done 2>/dev/null & make build
865
+ # a statement ahead of the wait takes the tail's test: a producer there is a launch, a banner is not
866
+ block make build; until grep -q DONE .tmp/smoke.log; do sleep 5; done &
867
+ fallthrough echo start; until grep -q DONE .tmp/smoke.log; do sleep 5; done &
868
+ # the same shell form over a file test is rule `wait_no_producer`'s block, the sandbox's one
869
+ # record naming a dead pid
870
+ block until [ -f .tmp/marker ]; do sleep 5; done &
871
+ # and behind a banner, the lead rule `background_no_record`'s exemption admits
872
+ block echo start; until [ -f .tmp/marker ]; do sleep 5; done &
873
+ block until [ -f .tmp/marker ]; do sleep 5; done 2>/dev/null &
333
874
  # clause (a) — the first statement is not the loop
334
875
  fallthrough echo start; until grep -q DONE .tmp/smoke.log; do sleep 5; done
335
876
  # clause (b) — the body runs something besides sleep
@@ -340,25 +881,50 @@ fallthrough while pgrep worker >/dev/null 2>&1; do sleep 20; done; echo waited
340
881
  fallthrough until gh run view 12 --json status 2>/dev/null | grep -q completed; do sleep 30; done
341
882
  # clause (d) — a tail statement rule `ro_pipeline` would not have granted standing alone
342
883
  fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done; git commit -m done
884
+ # clause (d) holds a reader the loop is piped into as it holds a statement, behind `|` or `|&`
885
+ # and with no blank around the pipe; a piped writer or a redirecting reader is withheld
886
+ allow until [ -f marker ]; do sleep 5; done | cat
887
+ allow until [ -f marker ]; do sleep 5; done|cat
888
+ allow until [ -f marker ]; do sleep 5; done |& cat
889
+ fallthrough until [ -f marker ]; do sleep 5; done | tee out.txt
890
+ fallthrough until [ -f marker ]; do sleep 5; done|rm -rf x
891
+ fallthrough until [ -f marker ]; do sleep 5; done | cat > out.txt
892
+ # the noclobber operator is no pipe: the loop's output, and a tail statement's, is written to the
893
+ # word after it
894
+ fallthrough until [ -f marker ]; do sleep 5; done >| cat
895
+ fallthrough until [ -f marker ]; do sleep 5; done 2>| cat
896
+ fallthrough until [ -f marker ]; do sleep 5; done; ls >| cat
343
897
  # clause (e) — a backtick anywhere in the raw command; the `$(…)` spelling is
344
898
  # deliberately not a row, since rule `expansion` blocks it first and the row would pin
345
899
  # another rule's verdict
346
900
  fallthrough until grep -q DONE `cat .tmp/f`; do sleep 5; done
347
901
  # a non-inert redirect on the loop itself is a write, and a grant may not bless one
348
902
  fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done > out.txt
903
+ # `>&` onto a named file is that write in its fd-dup spelling, in a condition as in a tail
904
+ fallthrough until grep -q DONE .tmp/smoke.log >& out.txt; do sleep 5; done
905
+ fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done; grep -n ERR .tmp/smoke.log >& out.txt
906
+ # a carriage return is a word character, so a descriptor glued to one or behind one names a file
907
+ fallthrough until grep -q DONE .tmp/smoke.log >&2@CR@tracked.md; do sleep 5; done
908
+ fallthrough until grep -q DONE .tmp/smoke.log >&@CR@2; do sleep 5; done
909
+ fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done; grep -n ERR .tmp/smoke.log >&2@CR@tracked.md
349
910
  # clauses (c) and (d) take rule `ro_pipeline`'s declared forms over the whole call, so a
350
911
  # condition or a tail writing through a roster member's own option is refused
351
912
  fallthrough while sort -c -o out.txt data.txt; do sleep 5; done
352
913
  fallthrough until grep -q DONE .tmp/smoke.log; do sleep 5; done; sort -o out.txt .tmp/smoke.log
353
914
  # arm (B) — the launch-record-wait spelling rule `background_no_record`'s corrective names, granted for an
354
915
  # allowlisted, bounded launch writing only gitignored targets, with and without the
355
- # trailing retraction
916
+ # trailing retraction. The record statement, matched byte for byte, is the literal test's one
917
+ # exemption, and the rest of the call takes the test, so a quoted launch target falls through
356
918
  allow bash scripts/check-foo.sh > .tmp/foo.log 2>&1 & echo "pid=$! run=foo" > .tmp/foo.run; wait; rm -f .tmp/foo.run
357
919
  allow scripts/check-foo.sh --all > .tmp/foo.log & echo "pid=$! run=foo" > .tmp/foo.run; wait
358
- # a target spelling a placeholder's letters is read as written; a quoted target is a real
359
- # placeholder, whose path the grant never read
920
+ fallthrough scripts/check-foo.sh --all > .tmp/foo.log & echo "pid=$! run=foo" > .tmp/foo.run; wait
921
+ fallthrough scripts/check-foo.sh --all > .tmp/foo.log & echo "pid=$! run=foo" >.tmp/foo.run; wait
922
+ # a target spelling a placeholder's letters is read as written; a quoted target fails the literal
923
+ # test, ignored or tracked
360
924
  allow bash scripts/check-foo.sh > .tmp/DQ.log 2>&1 & echo "pid=$! run=foo" > .tmp/foo.run; wait; rm -f .tmp/foo.run
361
925
  fallthrough bash scripts/check-foo.sh > ".tmp/foo.log" 2>&1 & echo "pid=$! run=foo" > .tmp/foo.run; wait; rm -f .tmp/foo.run
926
+ fallthrough bash scripts/check-foo.sh > "tracked.md" 2>&1 & echo "pid=$! run=foo" > .tmp/foo.run; wait; rm -f .tmp/foo.run
927
+ fallthrough bash scripts/check-foo.sh > '&1' 2>&1 & echo "pid=$! run=foo" > .tmp/foo.run; wait; rm -f .tmp/foo.run
362
928
  # (B0) the shape: a record whose filename does not carry its key, and no wait
363
929
  fallthrough bash scripts/check-foo.sh > .tmp/foo.log 2>&1 & echo "pid=$! run=foo" > .tmp/bar.run; wait
364
930
  fallthrough bash scripts/check-foo.sh > .tmp/foo.log 2>&1 & echo "pid=$! run=foo" > .tmp/foo.run
@@ -376,23 +942,123 @@ fallthrough bash scripts/check-foo.sh > tracked.md & echo "pid=$! run=foo" > .tm
376
942
  fallthrough bash scripts/check-foo.sh &> tracked.md & echo "pid=$! run=foo" > .tmp/foo.run; wait
377
943
  fallthrough bash scripts/check-foo.sh &>> tracked.md & echo "pid=$! run=foo" > .tmp/foo.run; wait
378
944
  fallthrough bash scripts/check-foo.sh <> tracked.md & echo "pid=$! run=foo" > .tmp/foo.run; wait
945
+ fallthrough bash scripts/check-foo.sh >& tracked.md & echo "pid=$! run=foo" > .tmp/foo.run; wait
946
+ # (B1) an fd-dup onto a named file withholds whatever its target, glued or apart
947
+ fallthrough bash scripts/check-foo.sh >& .tmp/foo.log & echo "pid=$! run=foo" > .tmp/foo.run; wait
948
+ fallthrough bash scripts/check-foo.sh >&.tmp/foo.log & echo "pid=$! run=foo" > .tmp/foo.run; wait
949
+ # and a carriage return is a word character, so a descriptor glued to one or behind one names a file
950
+ fallthrough bash scripts/check-foo.sh > .tmp/foo.log >&2@CR@tracked.md & echo "pid=$! run=foo" > .tmp/foo.run; wait
951
+ fallthrough bash scripts/check-foo.sh > .tmp/foo.log >&@CR@2 & echo "pid=$! run=foo" > .tmp/foo.run; wait
379
952
  # (B3) an expansion besides the record's own; rule `grant_path_slot`'s predicate declines a live '$'
380
953
  # in the launch too, so this row pins the verdict rather than the clause alone
381
954
  fallthrough scripts/check-foo.sh $1 > .tmp/foo.log & echo "pid=$! run=foo" > .tmp/foo.run; wait
382
955
 
956
+ # rule `bounded_write` — a write whose every target lies strictly inside a scratch dir, gitignored,
957
+ # holding no tracked path, is granted; the write-utility kind, then a granted command
958
+ # redirected to a bounded target (rule `allowlist_chain` blocks it otherwise), then a
959
+ # compound of the three kinds, a removal or a granted command beside an emitter's
960
+ # append (rule `emitter_write` blocks them otherwise), two removals inside the slot
961
+ # of the sandbox's 'rm -rf .tmp/*' grant, and a sandbox record naming a dead PID,
962
+ # which the live-record clause passes
963
+ allow mkdir -p .tmp/out
964
+ allow touch .tmp/a.txt
965
+ allow rm -rf .tmp/old
966
+ allow mv .tmp/a.txt .tmp/b.txt
967
+ allow cp tracked.md .tmp/copy.md
968
+ allow grep -n x tracked.md | tee .tmp/hits.txt
969
+ # a glob, a quote and a backslash each fail the literal test (guard-kit/SPEC.md §The generic
970
+ # ruleset), so the bounds test never reads a globbed target or a quoted program; the allowlisted
971
+ # `ls` so redirected then meets rule `allowlist_chain`'s block
972
+ fallthrough rm -f .tmp/*.log
973
+ fallthrough touch .tmp/o*
974
+ block ls > .tmp/o*
975
+ fallthrough find .tmp/old -name '*.txt' -delete
976
+ # a destination naming an existing directory withholds, `-T` or not, and so do the options naming a
977
+ # directory to write into; the sandbox's `.tmp/held/` is that directory, and a path under it is a
978
+ # file the bounds test reads
979
+ allow cp tracked.md .tmp/held/copy.md
980
+ fallthrough cp tracked.md .tmp/held
981
+ fallthrough cp -T tracked.md .tmp/held
982
+ fallthrough mv .tmp/notes.txt .tmp/held
983
+ fallthrough cp -t .tmp/held tracked.md
984
+ fallthrough mv --target-directory=.tmp/held .tmp/notes.txt
985
+ fallthrough cp --parents tracked.md .tmp/held/x
986
+ # an ANSI-C quoted word's '$' is its piece's own, so the expansion decline reads past it, and the
987
+ # literal test refuses its quote; a pid, a held value and a span the read refuses withhold too
988
+ fallthrough find .tmp/old -name $'*.txt' -delete
989
+ fallthrough rm -rf .tmp/$'old'
990
+ fallthrough printf x > .tmp/$'a\x2etxt'
991
+ block rm -rf .tmp/$'\x2e\x2e'/tracked.md
992
+ fallthrough find .tmp/old -name $$'*.txt' -delete
993
+ fallthrough touch .tmp/$'a\nb'
994
+ fallthrough find .tmp/old -name $'*\e.txt' -delete
995
+ allow git status > .tmp/status.txt 2>&1
996
+ allow mkdir -p .tmp/d; git status > .tmp/d/s.txt; wc -l .tmp/d/s.txt
997
+ allow rm -rf .tmp/x >> .tmp/journal.md
998
+ allow printf x >> .tmp/journal.md@NL@rm -rf .tmp/x
999
+ allow printf x >> .tmp/journal.md && git status
1000
+ allow rm -rf .tmp/x .tmp/y
1001
+ # an escaped blank fails the literal test
1002
+ fallthrough rm -rf .tmp/x\ y
1003
+ fallthrough touch .tmp/a\ b
1004
+ allow rm -f .tmp/dead-producer.run
1005
+ # a backslash the word's quoting keeps is part of its value, so the target sits under a directory
1006
+ # named '\.tmp', outside every scratch dir, whether a write utility or a redirect names it; one an
1007
+ # unquoted word consumes is no part of the value, and fails the literal test
1008
+ fallthrough touch '\.tmp/a'
1009
+ fallthrough touch "\.tmp/a"
1010
+ fallthrough touch $'\\.tmp/a'
1011
+ fallthrough mkdir -p '\.tmp/x'
1012
+ block printf x > '\.tmp/a'
1013
+ fallthrough touch \.tmp/a
1014
+ # a read redirected to a bounded target is this rule's grant, not rule `ro_pipeline`'s, and a target
1015
+ # outside every scratch dir is neither's
1016
+ allow grep -c x tracked.md > .tmp/n.txt; wc -l .tmp/n.txt
1017
+ fallthrough grep -c x tracked.md > out.txt
1018
+ # an fd-dup onto a named file withholds even on a bounded target
1019
+ fallthrough mkdir -p .tmp/out >& .tmp/n.txt
1020
+ # a quoted target spelling a descriptor is a file of that name, beside a bounded write as alone
1021
+ fallthrough mkdir -p .tmp/d > '&1'
1022
+ fallthrough grep -c x tracked.md > .tmp/o 2>"&1"
1023
+ # an operator glued to a redirect target withholds as one inside a word does: the shell reads a
1024
+ # second redirect, so the bounded word is not all the call writes
1025
+ fallthrough grep -c x tracked.md > .tmp/n.txt>tracked.md
1026
+ fallthrough mkdir -p .tmp/out >.tmp/n.txt>>tracked.md
1027
+ # one refusing row per clause: the scratch member itself and a path outside every member (b); a
1028
+ # '..' component and a rooted path (a); a tracked destination (c, d); the operand grammar's
1029
+ # withheld forms; an xargs running a write utility (d); a backgrounded write, which rule
1030
+ # `background_no_record` blocks first; and a command neither read nor granted (a)
1031
+ fallthrough rm -rf .tmp
1032
+ fallthrough mkdir -p .tmp
1033
+ fallthrough rm -f scratch.txt
1034
+ fallthrough touch .tmp/../x.txt
1035
+ fallthrough touch /tmp/x.txt
1036
+ fallthrough cp .tmp/a.txt tracked.md
1037
+ fallthrough rmdir -p .tmp/a/b
1038
+ fallthrough rm --no-preserve-root -rf .tmp/x
1039
+ fallthrough find -L .tmp -delete
1040
+ fallthrough find .tmp | xargs rm
1041
+ block rm .tmp/x &
1042
+ fallthrough make build > .tmp/b.log
1043
+
383
1044
  # rule `allowlist_chain` — decorated allowlisted bare lead with an unmatched segment blocked;
384
- # chaining steer, redirect steer, and the untouched non-firing cases
1045
+ # chaining steer, redirect steer, and the untouched non-firing cases; a compound of
1046
+ # allowlisted segments ends in a script glob off the read roster, since rule
1047
+ # `ro_pipeline` grants an allowlisted lead beside roster reads first
385
1048
  block git status && rm -rf tmp
386
1049
  block git status 2>&1
1050
+ # a lead is read by value too, past a wrapper
1051
+ block \git 'status' && rm -rf tmp
1052
+ block FOO=1 git status; make build
387
1053
  fallthrough git status
388
1054
  fallthrough frobnicate && git status
389
- fallthrough git status && ls
390
- fallthrough git status && printf done
1055
+ fallthrough git status && ls && bash scripts/check-x.sh
1056
+ fallthrough git status && printf done && bash scripts/check-x.sh
391
1057
  # a segment the allowlist glob matches but a backgrounding '&' ends is not granted — the harness
392
1058
  # grants no backgrounded call — so it is the unmatched segment; printf's word-bounded ':*' matches
393
1059
  # the bare 'printf' the harness also grants
394
1060
  block git status && printf done &
395
- fallthrough git status && printf
1061
+ fallthrough git status && printf && bash scripts/check-x.sh
396
1062
  # the bare head of an entry whose only '*' is a closing ' *' is a bare lead ('git rm -q *');
397
1063
  # a lead carrying an argument is not
398
1064
  block git rm -q; make build
@@ -406,6 +1072,14 @@ advise git commit -F .git/COMMIT_EDITMSG
406
1072
  advise git reset --soft HEAD~1
407
1073
  fallthrough git commit -m done
408
1074
  fallthrough git reset --hard HEAD~1
1075
+ # the words come through the git read (rule `git_mutation_under_producer`), one segment at a time: an
1076
+ # option word in another statement is not the commit's
1077
+ advise git comm\it --amend
1078
+ advise git --no-pager commit --amend
1079
+ fallthrough echo --amend; git commit -m x
1080
+ # a heredoc beside the call leaves its words read by value, and its body stays a mark no rule reads
1081
+ advise git 'commit' --amend -F - <<'EOF'@NL@msg@NL@EOF
1082
+ advise git commit -F - <<'MSG'@NL@git stash; rm tracked.md@NL@MSG
409
1083
 
410
1084
  # rule `rm_tracked` — bare rm of a tracked path steers to 'git rm -q'; untracked,
411
1085
  # gitignored, and the already-correct git rm form pass
@@ -415,9 +1089,38 @@ block rm tracked.md; ls
415
1089
  fallthrough rm scratch.txt
416
1090
  fallthrough rm untracked-nowhere.md
417
1091
  fallthrough git rm -q tracked.md
1092
+ # each operand is tested as the shell passes it: a quoted or escaped one literally, the sandbox's
1093
+ # blank-bearing tracked file included, and a bare glob as the shell expands it
1094
+ block rm 'tracked.md'
1095
+ block rm "tracked.md"
1096
+ block rm two\ words.md
1097
+ block rm 'two words.md'
1098
+ block rm $'tracked.md'
1099
+ block rm -f "two words.md" scratch.txt
1100
+ block rm *.md
1101
+ block rm track?d.md
1102
+ fallthrough rm 'scratch.txt'
1103
+ fallthrough rm *.txt
1104
+ # a quoted glob character names no file the steer's 'git rm' would read literally, and a word
1105
+ # mixing a quoted span or an escape with a bare glob character is skipped
1106
+ fallthrough rm '*.md'
1107
+ fallthrough rm 'track'*.md
1108
+ fallthrough rm two\ *.md
1109
+ # the command word comes through the command read: by its value, by its path, and behind a wrapper
1110
+ # the matcher strips, read by its value; a redirect is no operand
1111
+ block \rm tracked.md
1112
+ block /bin/rm tracked.md
1113
+ block time rm tracked.md
1114
+ block FOO=1 rm tracked.md
1115
+ block if rm tracked.md; then ls; fi
1116
+ block rm tracked.md 2>/dev/null
1117
+ block 'nohup' rm tracked.md
1118
+ # a heredoc beside the call leaves its operands read by value
1119
+ block rm 'tracked.md' <<'EOF'@NL@x@NL@EOF
418
1120
  # rule `rm_tracked`'s force arm — a 'git rm' carrying its force flag is blocked whether or
419
1121
  # not a grant matches: standalone, in a short cluster, long, abbreviated
420
- # as git's option parser accepts it, behind a global option, and quoted.
1122
+ # as git's option parser accepts it, behind a global option, and quoted or
1123
+ # escaped, the words read through the git read (rule `git_mutation_under_producer`).
421
1124
  # A word after '--' is a path, and '--cached' keeps the file
422
1125
  block git rm -q -f tracked.md
423
1126
  block git rm -qf tracked.md
@@ -425,6 +1128,7 @@ block git rm --force tracked.md
425
1128
  block git rm --forc tracked.md
426
1129
  block git -C . rm -rf sub
427
1130
  block git rm -q '-f' tracked.md
1131
+ block git \rm -q -f tracked.md
428
1132
  fallthrough git rm -q -- -f
429
1133
  fallthrough git rm --cached tracked.md
430
1134
 
@@ -432,7 +1136,7 @@ fallthrough git rm --cached tracked.md
432
1136
  # The firing rows are delta 3's probe table promoted from evidence into
433
1137
  # fixtures: one per body source, both arms. Targets are relative, as
434
1138
  # rules `scratch_redirect`, `truncate_scratch` and `append_scratch`'s are — an `@ROOT@`-absolute one would meet rule `abs_prefix`
435
- # eighteen rules earlier.
1139
+ # first.
436
1140
  # arm (a), bash/sh: the operand form is the steer this rule inherited from a
437
1141
  # consumer rule, and the stdin form is the widening the re-key buys it
438
1142
  block bash .tmp/x.sh
@@ -468,48 +1172,114 @@ block pwsh .tmp/x.ps1
468
1172
  block powershell.exe -f .tmp/x.ps1
469
1173
  fallthrough pwsh -File tools/x.ps1
470
1174
  fallthrough pwsh -c 'Get-Date'
1175
+ # under Bash each pipe member's words come through the command read, so a quoted or escaped
1176
+ # interpreter or body source, one behind a wrapper the matcher strips, a source glued to its '<'
1177
+ # and a quoted producer operand are the plain spelling's; a redirect is no body operand, and a
1178
+ # herestring's words stay its body
1179
+ block \bash .tmp/x.sh
1180
+ block nohup python3 '.tmp/x.py'
1181
+ block if bash .tmp/x.sh 2>&1; then ls; fi
1182
+ block python3 -<'.tmp/x.py'
1183
+ block cat ".tmp/x.py" | python3
1184
+ fallthrough bash <<< '.tmp/x.sh'
1185
+ # a carriage return glued to the '<' is part of bash's word, so the body is a file named with it in
1186
+ # the working directory: the word read takes bash's blank, and so does the skeleton's scan on a call
1187
+ # the read refuses, a quoted newline say
1188
+ fallthrough bash <@CR@.tmp/x.sh
1189
+ fallthrough bash <@CR@.tmp/x.sh; cat <<'EOF'@NL@x@NL@EOF
1190
+ fallthrough bash <@CR@.tmp/x.sh; echo 'a@NL@b'
1191
+ block bash < .tmp/x.sh; echo 'a@NL@b'
1192
+ block bash < .tmp/x.sh; cat <<'EOF'@NL@x@NL@EOF
1193
+ # a heredoc beside the call leaves its command word read by value
1194
+ block \bash .tmp/x.sh <<'EOF'@NL@x@NL@EOF
471
1195
 
472
1196
  # rule `grant_path_slot` — a committed grant matched only by reaching past its path slot. The
473
1197
  # sandbox carries a scratch 'rm -rf .tmp/*' grant and a
474
1198
  # '*/checks/check-*.sh' runner glob: a '..' component, an absolute path,
475
1199
  # a second operand outside the slot and a reach behind a stripped wrapper
476
1200
  # each block, while a clean slot, a dropped redirect and a declined
477
- # backtick fall through. Targets are untracked, so rule `rm_tracked` never answers
1201
+ # backtick fall through. Targets are untracked, so rule `rm_tracked` never answers. A
1202
+ # clean slot's rows carry a statement nothing grants, since rule `bounded_write` grants
1203
+ # a lone bounded removal first
478
1204
  block rm -rf .tmp/../scratch.txt
479
1205
  block rm -rf .tmp/x scratch.txt
1206
+ block rm -rf .tmp/x\ y scratch.txt
1207
+ block rm -rf .tmp/x\\ y
480
1208
  block bash ../../evil/checks/check-x.sh
481
1209
  block bash /elsewhere/checks/check-x.sh
482
1210
  block bash C:/elsewhere/checks/check-x.sh
483
1211
  block timeout 5 rm -rf .tmp/../scratch.txt
484
- fallthrough rm -rf .tmp/x .tmp/y
485
- fallthrough rm -rf .tmp/x 2>/dev/null
1212
+ block \timeout 5 rm -rf .tmp/../scratch.txt
1213
+ # a heredoc-bearing call is declined, its dequoted view unaligned: the stated limit
1214
+ fallthrough rm -rf .tmp/../scratch.txt <<'EOF'@NL@x@NL@EOF
1215
+ fallthrough rm -rf .tmp/x .tmp/y; make build
1216
+ fallthrough rm -rf .tmp/x 2>/dev/null; make build
486
1217
  fallthrough bash guard-kit/checks/check-x.sh
487
1218
  fallthrough rm -rf .tmp/`printf x`/y
488
1219
 
489
1220
  # rule `emitter_write` — an emitter write the harness cannot grant. Arm (a): a write rule `append_scratch`
490
1221
  # grants alone, compounded with another statement, blocks; the same write
491
- # alone is rule `append_scratch`'s grant. Arm (b): a lone write to a target git does not
1222
+ # alone is rule `append_scratch`'s grant. A write failing the literal test
1223
+ # (guard-kit/SPEC.md §The generic ruleset), a heredoc's among them, takes no
1224
+ # grant alone, so compounded it fires no arm (a) and reaches the harness's
1225
+ # own path, and alone it falls through. Arm (b): a lone write to a target git does not
492
1226
  # ignore blocks, while a lead off the emitter roster, a device target and
493
1227
  # a backgrounded launch writing its record do not fire. Arm (c): a
494
1228
  # compounded write to a target git does not ignore, in or outside the
495
1229
  # repository, blocks; a compounded write to a device target does not fire
496
- block cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF@NL@git status
497
- block printf x >> .tmp/journal.md && git status
498
- allow cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF
1230
+ fallthrough cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF@NL@git status
1231
+ block printf x >> .tmp/journal.md && make build
1232
+ fallthrough cat >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF
499
1233
  block printf x >> tracked.md; git status
1234
+ # where the skeleton's lead is no emitter, the lead is read by value: quoted, escaped, glued to its
1235
+ # redirect or behind a wrapper; rule `append_scratch` still reads the skeleton's lead alone. A quoted
1236
+ # or escaped write to an ignored target fails the literal test, so it fires no arm (a)
1237
+ block \cat>> tracked.md
1238
+ fallthrough nohup "printf" x >> .tmp/journal.md && make build
1239
+ block nohup printf x >> .tmp/journal.md && make build
1240
+ # and beside a heredoc, off the command read
1241
+ block \cat>> tracked.md <<'EOF'@NL@x@NL@EOF
1242
+ fallthrough nohup "printf" x >> .tmp/journal.md && make build <<'EOF'@NL@x@NL@EOF
1243
+ fallthrough 'cat' >> .tmp/journal.md <<'EOF'@NL@line@NL@EOF
500
1244
  block mkdir -p docs && cat > docs/x.md <<'EOF'@NL@line@NL@EOF
501
1245
  block make build && echo x > /tmp/x.txt
502
1246
  fallthrough make build; echo x > /dev/stderr
503
1247
  block cat >> tracked.md
1248
+ # clause (d)'s region test reads `hdq`: a backtick in a quoted delimiter's body cannot substitute, so
1249
+ # the write is read and blocks, while an unquoted delimiter leaves the body live and the rule
1250
+ # declines; these two rows are the whole holder of the asymmetry
1251
+ block cat >> tracked.md <<'EOF'@NL@a `slug` in prose@NL@EOF
1252
+ fallthrough cat >> tracked.md <<EOF@NL@a `slug` in prose@NL@EOF
1253
+ # `>&` onto a named file is the write `>` is, alone and beside an ignored target
1254
+ block echo x >& tracked.md
1255
+ block printf x >> .tmp/journal.md >& tracked.md
1256
+ # a second redirect glued to an ignored target is the write the spaced spelling is: no grant above
1257
+ # reads the glued word as one ignored name, so the tracked target reaches this rule
1258
+ block echo x >> .tmp/a>tracked.md
1259
+ block echo x >> .tmp/a>>tracked.md
1260
+ block echo x > .tmp/a2>tracked.md
1261
+ block echo x >.tmp/a&>tracked.md
504
1262
  fallthrough bash gate-sdk/bin/run-gates.sh --emit trajectory > docs/x.md
505
1263
  fallthrough echo x > /dev/stderr
506
1264
  fallthrough make build > .tmp/b.log 2>&1 & echo "pid=$! run=b" > .tmp/b.run; wait; rm -f .tmp/b.run
1265
+ # a target is read by its value: a quoted /dev/null is no write, and a quoted tracked target blocks
1266
+ fallthrough echo x 2>"/dev/null"
1267
+ block echo x > "README.md"
1268
+ block printf x >> 'README.md'
1269
+ # a quoted target spelling a descriptor is a file of that name git does not ignore
1270
+ block echo x > '&1'
1271
+ # a heredoc-bearing call's quoted target is read by its value too, and the steer names it
1272
+ block cat >> "README.md" <<'EOF'@NL@x@NL@EOF
1273
+ fallthrough echo x 2>"/dev/null" <<'EOF'@NL@x@NL@EOF
507
1274
 
508
1275
  # rule `shell_wrapper` — a bash -c or sh -c wrapper blocks; a wrapper behind another command
509
1276
  # word, and the scratch runner taking a script path, do not fire
510
1277
  block bash -c 'git status'
511
1278
  block sh -c 'ls'
512
1279
  block make x; bash -c 'ls'
1280
+ # each word is read by value, by path and past a leading keyword or `command`
1281
+ block /bin/sh '-c' 'ls'
1282
+ block if \bash -c 'ls'; then echo up; fi
513
1283
  fallthrough xargs bash -c 'x'
514
1284
  fallthrough timeout 5 bash -c 'x'
515
1285
  fallthrough bash gate-sdk/bin/run-gates.sh --scratch-run .tmp/x.sh