checkwright 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/bin/checkwright.ps1 +3 -3
- package/package.json +10 -3
- package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
- package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
- package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
- package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
- package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
- package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
- package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
- package/payload/artifact/targets.list +5 -5
- package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
- package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
- package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
- package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
- package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
- package/payload/canon-kit/README.md +8 -4
- package/payload/canon-kit/checks/check-amendment-queue.gate +1 -1
- package/payload/canon-kit/checks/check-comment-tier.gate +2 -2
- package/payload/canon-kit/checks/check-delta-agreement.gate +4 -0
- package/payload/canon-kit/checks/check-deprecation-task.gate +1 -1
- package/payload/canon-kit/checks/check-docs-page-length.gate +4 -0
- package/payload/canon-kit/checks/check-docs-page-repeat.gate +2 -2
- package/payload/canon-kit/checks/check-fence-command-head.gate +1 -1
- package/payload/canon-kit/checks/check-fence-paste-unit.gate +4 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.gate +1 -1
- package/payload/canon-kit/checks/check-manifest-count.gate +3 -3
- package/payload/canon-kit/checks/check-manifest-temporal.gate +1 -1
- package/payload/canon-kit/checks/check-pendency-contradiction.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.gate +1 -1
- package/payload/canon-kit/checks/check-spec-derivable-section.gate +1 -1
- package/payload/canon-kit/checks/check-spec-dod-singleton.gate +1 -1
- package/payload/canon-kit/checks/check-spec-embedded-source.gate +1 -1
- package/payload/canon-kit/checks/check-spec-pointer.gate +1 -1
- package/payload/canon-kit/checks/check-todo-task-liveness.gate +1 -1
- package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
- package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/SPEC-widget.md +7 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +7 -0
- package/payload/canon-kit/gate-tests/check-citation-link/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-citation-link/bad/site/unclosed.md +4 -0
- package/payload/canon-kit/gate-tests/check-citation-link/good/site/page.md +10 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +9 -1
- package/payload/canon-kit/gate-tests/check-delta-agreement/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/bad/scripts/canon-config.knobs +14 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/base/notes/spec.md +9 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/one/deltas/notes/spec.md +7 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/two/deltas/cli/spec.md +3 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/good/scripts/canon-config.knobs +14 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/base/notes/spec.md +9 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/one/deltas/notes/spec.md +19 -0
- package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/two/deltas/cli/spec.md +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd.test.sh +20 -4
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/expect.txt +5 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/scripts/canon-config.knobs +3 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/item.md +5 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/nested.md +7 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/page.md +13 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/short.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/unclosed.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/good/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/generated.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/page.md +15 -0
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/scripts/canon-config.knobs +2 -1
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/_chrome/footer.html +4 -0
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/page.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/unclosed.md +6 -0
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/expect.txt +2 -1
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/scripts/canon-config.knobs +2 -1
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/_chrome/layout.html +8 -0
- package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/page.md +13 -0
- package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/kit/index.md +4 -0
- package/payload/canon-kit/gate-tests/check-fence-command-head/bad/doc.md +10 -0
- package/payload/canon-kit/gate-tests/check-fence-command-head/bad/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-fence-command-head/good/doc.md +6 -0
- package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/scripts/canon-config.knobs +2 -0
- package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/site/page.md +17 -0
- package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/scripts/canon-config.knobs +2 -0
- package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/site/page.md +39 -0
- package/payload/canon-kit/gate-tests/check-fence-run/good/doc.md +8 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +4 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +14 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +27 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-manifest-count/good/posts/note.md +7 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/good/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +7 -0
- package/payload/canon-kit/gate-tests/check-md-refs.test.sh +17 -1
- package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/dotted.md +10 -0
- package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-md-unwrapped/good/dotted.md +6 -0
- package/payload/canon-kit/gate-tests/check-md-unwrapped/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +6 -0
- package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/SPEC.md +14 -0
- package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/README.md +3 -0
- package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/SPEC.md +16 -0
- package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence-unclosed.md +8 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence.md +13 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +4 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.knobs +5 -1
- package/payload/canon-kit/gate-tests/check-prose-tells/good/absence.md +17 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +6 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.knobs +4 -1
- package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +9 -0
- package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +2 -1
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +14 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +2 -1
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/long.md +7 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +13 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.knobs +7 -1
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +8 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-repeat.md +11 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.knobs +6 -0
- package/payload/canon-kit/gate-tests/check-task-label-resolution/good/work/tasks.md +6 -0
- package/payload/canon-kit/gate-tests/check-task-path-claim/good/work/tasks.md +6 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/scripts/canon-config.knobs +4 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
- package/payload/context-kit/README.md +5 -7
- package/payload/context-kit/checks/check-brevity.gate +1 -1
- package/payload/context-kit/gate-tests/check-brevity.test.sh +1 -0
- package/payload/context-kit/gate-tests/check-memory-off.test.sh +25 -1
- package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +16 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/checkwright-gates +2 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +2 -2
- package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/tools/checkwright-gates +2 -0
- package/payload/context-kit/gate-tests/session-context-spawn.test.sh +52 -0
- package/payload/context-kit/templates/nudge-delegation.txt +4 -0
- package/payload/context-kit/templates/settings-sessionstart.json +2 -2
- package/payload/delegation-kit/README.md +14 -8
- package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +1 -0
- package/payload/delegation-kit/checks/check-gate-tamper.gate +1 -1
- package/payload/delegation-kit/close-surfaces.txt +3 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale-effort.md +10 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale.md +9 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/unbound.md +8 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +3 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/scripts/delegation-config.knobs +3 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +3 -1
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-paired.md +10 -0
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -1
- package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/scripts/delegation-config.knobs +3 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/exception-arrays.sh +44 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +12 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +12 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/good/exception-arrays.sh +44 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +1 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +22 -1
- package/payload/delegation-kit/templates/agent-execution.md +7 -6
- package/payload/delegation-kit/templates/delegation-config.knobs +32 -0
- package/payload/delegation-kit/usage-tests/cases.tsv +35 -25
- package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +12 -3
- package/payload/doctrine-kit/DOCTRINE.md +109 -25
- package/payload/doctrine-kit/README.md +2 -2
- package/payload/drift-kit/README.md +15 -6
- package/payload/drift-kit/close-surfaces.txt +2 -0
- package/payload/drift-kit/templates/economics.md +7 -3
- package/payload/drift-kit/templates/kpis.list +1 -0
- package/payload/evidence-kit/README.md +3 -3
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +2 -1
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.knobs +3 -1
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.knobs +3 -1
- package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +18 -2
- package/payload/evidence-kit/gate-tests/diff-baseline-status.test.sh +2 -3
- package/payload/evidence-kit/gate-tests/run-member-door.test.sh +50 -0
- package/payload/gate-sdk/README.md +9 -13
- package/payload/gate-sdk/bin/build-native.sh +11 -14
- package/payload/gate-sdk/bin/run-gates.ps1 +149 -24
- package/payload/gate-sdk/bin/run-gates.sh +57 -14
- package/payload/gate-sdk/checks/check-commit-msg.gate +1 -1
- package/payload/gate-sdk/checks/check-gate-substrate-parity.gate +1 -1
- package/payload/gate-sdk/checks/check-graph.gate +2 -2
- package/payload/gate-sdk/checks/check-install-disposition.gate +1 -1
- package/payload/gate-sdk/checks/check-path-dialect.gate +1 -1
- package/payload/gate-sdk/checks/check-psscriptanalyzer.gate +4 -0
- package/payload/gate-sdk/checks/check-shellcheck.gate +1 -1
- package/payload/gate-sdk/checks/check-template-copy-parity.gate +1 -1
- package/payload/gate-sdk/checks/check-tree-terms.gate +1 -1
- package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/args +2 -1
- package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/tree/workflows/shapes.yml +29 -0
- package/payload/gate-sdk/gate-tests/check-action-permissions/bad/args +2 -1
- package/payload/gate-sdk/gate-tests/check-action-permissions/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-action-permissions/bad/tree/workflows/shapes.yml +22 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/demo-kit/index.md +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +17 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +12 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-array-axes.sh +44 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-array-axes.sh +46 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.ps1 +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/scripts/gates.list +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +4 -2
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.ps1 +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-climb.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-direxec.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twoexec.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.ps1 +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-rsgood.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +42 -5
- package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +1 -0
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +9 -1
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +2 -2
- package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +15 -29
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -1
- package/payload/gate-sdk/gate-tests/check-portability-floor/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/portability-patterns.notes.list +1 -0
- package/payload/gate-sdk/gate-tests/check-portability-floor/good/args +1 -1
- package/payload/gate-sdk/gate-tests/check-portability-floor/good/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/demo-kit/templates/portability-patterns.list +5 -0
- package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/rosters/constructs.list +6 -0
- package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +15 -2
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/noisy.ps1 +1 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/pwsh +8 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/clean.ps1 +1 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/pwsh +7 -0
- package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/{warn.sh → alpha-kit/gate-tests/kit-warn.sh} +1 -1
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-tests/tests-warn.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/{ok.sh → alpha-kit/gate-tests/kit-ok.sh} +1 -1
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-sdk-config.knobs +2 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-tests/tests-ok.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +4 -1
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/stray/templates/session-note.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +6 -2
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/drift-kit/templates/kpis.list +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/drift-kit/templates/kpis.list +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/msg-patterns.old.list +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -2
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/scripts/gate-sdk-config.knobs +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/demo-kit/templates/msg-patterns.list +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/rosters/extra.list +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +1 -0
- package/payload/gate-sdk/gate-tests/emit-arm-shape.test.sh +1 -1
- package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +10 -2
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +29 -3
- package/payload/gate-sdk/gate-tests/lib-test-hermetic.test.sh +24 -0
- package/payload/gate-sdk/gate-tests/native-git-hooks.test.sh +261 -0
- package/payload/gate-sdk/gate-tests/native-rustflags.test.sh +20 -0
- package/payload/gate-sdk/gate-tests/run-arm-contract.test.sh +11 -4
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +2 -1
- package/payload/gate-sdk/gate-tests/run-for-path.test.sh +11 -1
- package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +64 -4
- package/payload/gate-sdk/lib/gate.sh +46 -6
- package/payload/gate-sdk/lib/test-hermetic.sh +16 -8
- package/payload/gate-sdk/templates/adopt.md +1 -1
- package/payload/gate-sdk/templates/msg-patterns.list +1 -1
- package/payload/gate-sdk/templates/portability-patterns.list +1 -1
- package/payload/guard-kit/README.md +12 -7
- package/payload/guard-kit/close-surfaces.txt +3 -0
- package/payload/guard-kit/gate-tests/check-door-binding/bad/alpha-kit/README.md +1 -1
- package/payload/guard-kit/gate-tests/check-door-binding/bad/expect.txt +1 -0
- package/payload/guard-kit/gate-tests/check-door-binding/bad/scripts/guard-config.knobs +2 -1
- package/payload/guard-kit/gate-tests/check-door-binding/bad/src/remedy.rs +3 -0
- package/payload/guard-kit/gate-tests/check-door-binding/good/expect.txt +1 -0
- package/payload/guard-kit/gate-tests/check-door-binding/good/scripts/guard-config.knobs +2 -1
- package/payload/guard-kit/gate-tests/check-door-binding/good/site/register.md +8 -0
- package/payload/guard-kit/gate-tests/check-door-binding/good/src/remedy.rs +13 -0
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +0 -1
- package/payload/guard-kit/gate-tests/consumer-rules.test.sh +105 -3
- package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +64 -2
- package/payload/guard-kit/gate-tests/guard-config-knobs.test.sh +18 -5
- package/payload/guard-kit/gate-tests/guard-verdict.test.sh +74 -0
- package/payload/guard-kit/gate-tests/worktree-confinement.test.sh +49 -5
- package/payload/guard-kit/guard-tests/background-cases.tsv +103 -1
- package/payload/guard-kit/guard-tests/cases.tsv +834 -64
- package/payload/guard-kit/guard-tests/powershell-cases.tsv +51 -2
- package/payload/guard-kit/guard-tests/variant-limits.tsv +14 -0
- package/payload/guard-kit/templates/close-triage.md +2 -2
- package/payload/guard-kit/templates/guard-config.knobs +9 -0
- package/payload/guard-kit/templates/settings-allow.json +1 -1
- package/payload/guard-kit/templates/settings-hooks.json +4 -4
- package/payload/lifecycle-kit/README.md +11 -6
- package/payload/lifecycle-kit/checks/check-disposed-findings.gate +3 -0
- package/payload/lifecycle-kit/checks/check-skill-binding.gate +1 -1
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +1 -1
- package/payload/lifecycle-kit/close-surfaces.txt +2 -0
- package/payload/lifecycle-kit/gate-tests/boundary-set-record.test.sh +82 -0
- package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +11 -2
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +11 -1
- package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/disposed-findings.txt +5 -0
- package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/expect.txt +5 -0
- package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/disposed-findings.txt +3 -0
- package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +1 -1
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +27 -2
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +6 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +34 -2
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +3 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/scripts/lifecycle-config.knobs +3 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +3 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/scripts/lifecycle-config.knobs +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage.test.sh +22 -2
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +9 -2
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +27 -1
- package/payload/lifecycle-kit/gate-tests/journal-arm.test.sh +251 -0
- package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +46 -5
- package/payload/lifecycle-kit/gate-tests/stamp-before-write.test.sh +16 -2
- package/payload/lifecycle-kit/templates/consult.md +9 -5
- package/payload/lifecycle-kit/templates/frames/project-critique.md +18 -0
- package/payload/lifecycle-kit/templates/frames/stage-contract-sweep.md +18 -0
- package/payload/lifecycle-kit/templates/frames/stage-contract.md +15 -0
- package/payload/lifecycle-kit/templates/host-protocol.md +10 -0
- package/payload/lifecycle-kit/templates/lead.md +30 -25
- package/payload/lifecycle-kit/templates/stages/align.md +4 -0
- package/payload/lifecycle-kit/templates/stages/build.md +5 -3
- package/payload/lifecycle-kit/templates/stages/close.md +8 -6
- package/payload/lifecycle-kit/templates/stages/scope.md +6 -2
- package/payload/lifecycle-kit/templates/stages/spec.md +4 -0
- package/payload/lifecycle-kit/templates/stages/validate.md +4 -2
- package/payload/lifecycle-kit/templates/upgrade.md +1 -1
- package/payload/queue-kit/README.md +3 -2
- package/payload/queue-kit/close-surfaces.txt +3 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/bad/scripts/queue-config.knobs +2 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +1 -1
- package/payload/queue-kit/gate-tests/check-queue-sections/good/scripts/queue-config.knobs +2 -0
- package/payload/queue-kit/gate-tests/check-queue-sections.test.sh +65 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +10 -1
- package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +4 -0
- package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +4 -0
- package/payload/queue-kit/gate-tests/check-task-conservation.test.sh +38 -0
- package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +3 -0
- package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +3 -0
- package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +8 -0
- package/payload/queue-kit/gate-tests/roadmap-lag.test.sh +137 -0
- package/payload/site-kit/README.md +3 -3
- package/payload/site-kit/gate-tests/check-docs-collapsible/bad/docs/unclosed.md +8 -0
- package/payload/site-kit/gate-tests/check-docs-collapsible/bad/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-collapsible/good/docs/regions.md +7 -0
- package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/docs/dotted.md +9 -0
- package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/dotted.md +7 -0
- package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/expect.txt +1 -1
- package/payload/site-kit/gate-tests/site-health-probe.test.sh +219 -0
- package/payload/site-kit/templates/site-health.yml +181 -132
- package/profiles.list +11 -10
- package/recipes/openspec/canon-config.knobs +5 -0
- package/recipes/openspec-overlap/canon-config.knobs +12 -0
- package/recipes/openspec-overlap/unregister.list +1 -0
- package/payload/context-kit/checks/check-footprint-fresh.gate +0 -4
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +0 -4
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +0 -12
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +0 -1
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +0 -11
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/CLAUDE.md +0 -6
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/SPEC.md +0 -3
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/templates/guide.md +0 -3
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/docs/footprint.md +0 -32
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +0 -1
- package/payload/context-kit/templates/session-context.sh +0 -148
- package/payload/delegation-kit/checks/check-rule-citation.gate +0 -3
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +0 -1
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +0 -1
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +0 -9
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +0 -4
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +0 -1
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +0 -1
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +0 -20
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +0 -5
- package/payload/drift-kit/templates/kpi-deprecated-surface.sh +0 -54
- package/payload/gate-sdk/checks/check-crate-arms.gate +0 -3
- package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +0 -3
- package/payload/gate-sdk/checks/check-hook-exec-bit.gate +0 -3
- package/payload/gate-sdk/checks/check-kit-roots-dialect.gate +0 -3
- package/payload/gate-sdk/checks/check-packed-links.gate +0 -3
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +0 -7
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +0 -12
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +0 -5
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.knobs +0 -3
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +0 -7
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +0 -11
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +0 -2
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.knobs +0 -3
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +0 -5
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.knobs +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +0 -4
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +0 -6
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +0 -5
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.knobs +0 -2
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +0 -4
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +0 -5
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +0 -97
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +0 -1
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +0 -2
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +0 -1
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +0 -2
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/args +0 -5
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/expect.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/checks/placeholder.txt +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/lib/alpha.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/checks/placeholder.txt +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/gate-tests/beta.test.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/lib/beta.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/checks/placeholder.txt +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/lib/gate.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gate-sdk-config.knobs +0 -7
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gates.list +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/args +0 -7
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/expect.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/checks/placeholder.txt +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/lib/alpha.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/checks/placeholder.txt +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/gate-tests/beta.test.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/lib/beta.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/checks/placeholder.txt +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/lib/gate.sh +0 -3
- package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/scripts/gates.list +0 -3
- package/payload/gate-sdk/gate-tests/check-packed-links/bad/alpha-kit/README.md +0 -5
- package/payload/gate-sdk/gate-tests/check-packed-links/bad/args +0 -5
- package/payload/gate-sdk/gate-tests/check-packed-links/bad/beta-kit/README.md +0 -5
- package/payload/gate-sdk/gate-tests/check-packed-links/bad/expect.txt +0 -2
- package/payload/gate-sdk/gate-tests/check-packed-links/bad/scripts/gate-sdk-config.knobs +0 -4
- package/payload/gate-sdk/gate-tests/check-packed-links/good/alpha-kit/README.md +0 -5
- package/payload/gate-sdk/gate-tests/check-packed-links/good/args +0 -8
- package/payload/gate-sdk/gate-tests/check-packed-links/good/beta-kit/README.md +0 -9
- package/payload/gate-sdk/gate-tests/check-packed-links/good/expect.txt +0 -1
- package/payload/gate-sdk/gate-tests/check-packed-links/good/gamma-kit/SPEC.md +0 -4
- package/payload/gate-sdk/gate-tests/check-packed-links/good/scripts/gate-sdk-config.knobs +0 -6
- package/payload/gate-sdk/gate-tests/check-portability-floor/good/patterns.list +0 -5
- package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/portability-patterns.list +0 -5
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +0 -2
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +0 -3
- /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/bad/args +0 -0
- /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/good/args +0 -0
- /package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/delegation-config.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/session-note.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/usage-poller.sh +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# gate-sdk/SPEC.md §check-commit-msg. One grep -E pattern per line; '#' comments
|
|
3
3
|
# and blank lines are ignored. Copy to your gates dir as msg-patterns.list
|
|
4
4
|
# (tracked, generic) and keep private term lists in msg-patterns.local.list
|
|
5
|
-
# (gitignored).
|
|
5
|
+
# (gitignored). The pattern files this gate resolves are self-exempt.
|
|
6
6
|
|
|
7
7
|
# Absolute home paths — leak the local filesystem layout into a public surface.
|
|
8
8
|
/(home|Users)/[A-Za-z0-9._-]+
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# and blank lines are ignored. Copy to your gates dir as portability-patterns.list
|
|
4
4
|
# and point GATE_SDK_PORTABILITY_PATHS at the files your install path executes —
|
|
5
5
|
# the corpus is empty by default, so this roster asserts nothing until it is set.
|
|
6
|
-
#
|
|
6
|
+
# The pattern files this gate resolves are self-exempt.
|
|
7
7
|
#
|
|
8
8
|
# A live use of a construct named here is not a defect to delete: mark the site
|
|
9
9
|
# '# portability-declared: <reason>' on that line or the one above, naming the
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# guard-kit
|
|
2
2
|
|
|
3
|
-
Permission-friction reduction for coding-agent sessions. A
|
|
3
|
+
Permission-friction reduction for coding-agent sessions. A before-tool-call guard ([gate-sdk/SPEC.md §The hook contract](https://checkwright.dev/gate-sdk/SPEC#the-hook-contract)) decides at call time — **block** with a corrective message, **steer** to a better form, **rewrite** to the allowlisted spelling, **auto-allow** the provably safe, or log the fall-through — a scanner ranks what the allowlist failed to cover, a curation tool finds the redundant local overrides, and a close-stage triage step makes the whole loop a habit.
|
|
4
4
|
|
|
5
5
|
Why: a command no allowlist entry matches is decided **out of band** — by interrupting a human, or by a model asked to judge the call — and that decision is invisible to the agent either way, so it cannot notice, count, or fix the friction it causes. The cost is paid per call, out of the operator's attention or out of latency and tokens, and compounds as the command surface grows. The kit closes the loop by making the fall-through set — exactly the commands nothing granted — the one thing that *is* recorded. See [SPEC.md](https://checkwright.dev/guard-kit/SPEC) for the framework, the generic ruleset, what the steering buys, and the triage criterion.
|
|
6
6
|
|
|
7
|
-
This file ships in the installer payload; what that payload withholds, and where this page's `SPEC.md` links then resolve, is [gate-sdk/SPEC.md §Consumer payload](https://
|
|
7
|
+
This file ships in the installer payload; what that payload withholds, and where this page's `SPEC.md` links then resolve, is [gate-sdk/SPEC.md §Consumer payload](https://checkwright.dev/gate-sdk/SPEC#consumer-payload).
|
|
8
8
|
|
|
9
9
|
Most of what guard-kit ships is not a gate: its surfaces are hook members of the gate binary and templates. It registers exactly one, which holds the door binding its own steer messages and its settings templates depend on — and, over the surfaces `GUARD_KIT_DOOR_ROOTS` names, holds a door on your own pages to a declared audience.
|
|
10
10
|
|
|
@@ -28,19 +28,19 @@ Vendor the kit beside [gate-sdk](../gate-sdk/), then:
|
|
|
28
28
|
|
|
29
29
|
It resolves through gate-sdk's registry path (your gates dir first, then each kit's `checks/`), and the pre-commit hook runs it when its `# graph:` manifest triggers, read at commit.
|
|
30
30
|
|
|
31
|
-
No guard script is copied: the shell guard, the optional wakeup-guard and escalation-guard are binary arms, wired by pointing a hook's `command` field at `
|
|
31
|
+
No guard script is copied: the shell guard, the optional wakeup-guard and escalation-guard are binary arms, wired by pointing a hook's `command` field at the gate binary `GATE_SDK_NATIVE_BIN` names, under `<project-dir>`, with `--hook shell-guard` as its `args` (or `--hook wakeup-guard`, `--hook escalation-guard`). `<project-dir>` is your harness's project-directory variable, which `templates/settings-hooks.json` spells for Claude Code; the template carries the binary as a placeholder you replace at the merge, as its note says ([guard-kit/SPEC.md §The shell guard](https://checkwright.dev/guard-kit/SPEC#the-shell-guard)). Where the binary is absent the harness cannot start the hook, lets the call through, and the guard steers nothing.
|
|
32
32
|
|
|
33
33
|
Your project's own block/steer/allow rules are a command you write, named by `GUARD_KIT_CONSUMER_RULES_CMD` in `guard-config.knobs`: the shell guard runs it before the generic ruleset, on the harness's own hook protocol, and `--guard-json` on the gate binary is its toolkit ([guard-kit/SPEC.md §Consumer rules](https://checkwright.dev/guard-kit/SPEC#consumer-rules)).
|
|
34
34
|
|
|
35
|
-
2. Wire the hooks — merge `templates/settings-hooks.json` into
|
|
35
|
+
2. Wire the hooks — merge `templates/settings-hooks.json` into your harness settings file, `GUARD_KIT_SETTINGS` (the `shell-guard` on `PreToolUse(Bash|PowerShell)`; the optional `wakeup-guard` on `ScheduleWakeup|CronCreate`; and an optional third block showing the path-shaped shape a consumer kit's own guard registers under — lifecycle-kit's `workflow-state-guard` is the shipped instance). <!-- harness-binding: a wiring instruction an adopter pastes -->
|
|
36
36
|
|
|
37
|
-
Then review `templates/settings-allow.json` against [guard-kit/SPEC.md §The recommended allowlist](https://checkwright.dev/guard-kit/SPEC#the-recommended-allowlist), and union the entries you accept into
|
|
37
|
+
Then review `templates/settings-allow.json` against [guard-kit/SPEC.md §The recommended allowlist](https://checkwright.dev/guard-kit/SPEC#the-recommended-allowlist), and union the entries you accept into that file's `permissions.allow`. <!-- harness-binding: a wiring instruction an adopter pastes -->
|
|
38
38
|
|
|
39
39
|
3. Gitignore the two scratch logs (`.workflow/prompt-friction.log`, `.workflow/wakeup-attempts.log`) and their drain companions (`.workflow/*.drain`, `.workflow/*.drain.part`) — both logs are per-iteration, drained at close.
|
|
40
40
|
|
|
41
41
|
4. Splice `templates/close-triage.md` into your close-stage skill (it fills lifecycle-kit's `housekeeping` slot, close step 4).
|
|
42
42
|
|
|
43
|
-
Configuration is a knob file — override any knob in `guard-config.knobs`, one `NAME = value`, `NAME[] = element` or `NAME[key] = value` line each ([gate-sdk/SPEC.md §The knob file](https://
|
|
43
|
+
Configuration is a knob file — override any knob in `guard-config.knobs`, one `NAME = value`, `NAME[] = element` or `NAME[key] = value` line each ([gate-sdk/SPEC.md §The knob file](https://checkwright.dev/gate-sdk/SPEC#the-knob-file)). `--emit knob-roster` on the gate binary `GATE_SDK_NATIVE_BIN` names prints every default, and [guard-kit/SPEC.md §Layout and configuration](https://checkwright.dev/guard-kit/SPEC#layout-and-configuration) owns each. Defaults are this repo's layout; a knob whose contents are your project's vocabulary defaults to empty. Drop a tool from `GUARD_KIT_SEARCH_TOOLS` when your harness build does not carry it, so the `find` and `git grep` steers never name a tool that is not there. A member you add to `GUARD_KIT_RO_BINS` also takes a `GUARD_KIT_RO_FORMS` declaration of its write and execute forms ([guard-kit/SPEC.md §The generic ruleset](https://checkwright.dev/guard-kit/SPEC#the-generic-ruleset), rule `ro_pipeline`), or the read-only pipeline grant withholds it.
|
|
44
44
|
|
|
45
45
|
## Use
|
|
46
46
|
|
|
@@ -62,9 +62,14 @@ Run this arm the same way:
|
|
|
62
62
|
|
|
63
63
|
```sh
|
|
64
64
|
gates="${GATE_SDK_NATIVE_BIN:-./scripts/checkwright-gates}"
|
|
65
|
-
"$gates" --run-guard-tests # decision-table over the generic ruleset
|
|
65
|
+
"$gates" --run-guard-tests # decision-table over the generic ruleset, its bash and PowerShell rows' re-spellings and each bash row under an added write, then your own rules' table
|
|
66
|
+
"$gates" --guard-verdict [--sandbox] -- '<command>' # the decision the shell guard returns for one command
|
|
66
67
|
```
|
|
67
68
|
|
|
69
|
+
`--guard-verdict --sandbox --bin <binary>` asks another build, such as a release's binary from its per-target archive, the same question in the decision table's sandbox ([guard-kit/SPEC.md §guard-verdict](https://checkwright.dev/guard-kit/SPEC#guard-verdict)).
|
|
70
|
+
|
|
71
|
+
To test your own rules, name a table in `cases.tsv`'s grammar with `GUARD_KIT_CONSUMER_CASES`, a firing and a non-firing row per rule; the arm runs its rows against your rule command. Name a limits table with `GUARD_KIT_CONSUMER_VARIANT_LIMITS` to have those rows' re-spellings derived and held to it ([guard-kit/SPEC.md §Testing](https://checkwright.dev/guard-kit/SPEC#testing)).
|
|
72
|
+
|
|
68
73
|
## License
|
|
69
74
|
|
|
70
75
|
Licensed under Apache-2.0, with the text in `LICENSE` beside this file in an installed copy and at the repository root in the source tree.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Generated at pack time from this kit's spec; lifecycle-kit/SPEC.md §The close-surface roster.
|
|
2
|
+
close-surface: .workflow/wakeup-attempts.log advisory reclaim=bash gate-sdk/bin/run-gates.sh --emit capture-drain .workflow/wakeup-attempts.log
|
|
3
|
+
close-surface: .workflow/prompt-friction.log advisory reclaim=bash gate-sdk/bin/run-gates.sh --emit capture-drain .workflow/prompt-friction.log
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# alpha-kit
|
|
2
2
|
|
|
3
|
-
Regenerate the
|
|
3
|
+
Regenerate the graph: `bash gate-sdk/bin/run-gates.sh --emit graph`.
|
|
4
4
|
|
|
5
5
|
`run-gates.sh` runs gates, not tests — this subject-position mention stays, so a
|
|
6
6
|
red here names the door line above and not this one.
|
|
@@ -3,3 +3,4 @@ alpha-kit/templates/alpha-config.knobs:3: scripts/checkwright-gates
|
|
|
3
3
|
site/landing.md:7: bash gate-sdk/bin/run-gates.sh --run-demo
|
|
4
4
|
site/banner.md:8: _Generated by `bash gate-sdk/bin/run-gates.sh --emit footprint`; do not hand-edit._
|
|
5
5
|
site/banner.md:7: <!-- door-contributor: -->
|
|
6
|
+
src/remedy.rs:2: println!(" help: regenerate — bash gate-sdk/bin/run-gates.sh --emit graph");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
# spec: guard-kit/SPEC.md §check-door-binding — the same configured extra corpus as good/, so the
|
|
2
|
-
#
|
|
2
|
+
# C findings below are the only difference between the pair
|
|
3
3
|
GUARD_KIT_DOOR_ROOTS[] = site
|
|
4
|
+
GUARD_KIT_DOOR_ROOTS[] = src/remedy.rs
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
# spec: guard-kit/SPEC.md §check-door-binding — the fixture's configured extra corpus, so a green
|
|
2
|
-
# line proves assertion C's three declaration scopes rather than an unset knob
|
|
2
|
+
# line proves assertion C's three declaration scopes and its Rust reading rather than an unset knob
|
|
3
3
|
GUARD_KIT_DOOR_ROOTS[] = site
|
|
4
|
+
GUARD_KIT_DOOR_ROOTS[] = src/remedy.rs
|
|
@@ -22,3 +22,11 @@ The fail-open arms need no declaration anywhere, the exemption keying on the arm
|
|
|
22
22
|
|
|
23
23
|
And a subject-position mention is not a door at all: `run-gates.sh` runs gates,
|
|
24
24
|
not tests.
|
|
25
|
+
|
|
26
|
+
Fence scope reaches a block a list item opens, closed on its indented line:
|
|
27
|
+
|
|
28
|
+
<!-- door-contributor: the contributor battery register, as a list item -->
|
|
29
|
+
- ```bash
|
|
30
|
+
bash gate-sdk/bin/run-gates.sh --run-gate-tests beta-kit/gate-tests
|
|
31
|
+
bash gate-sdk/bin/run-gates.sh --run-guard-tests
|
|
32
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// spec: guard-kit/SPEC.md §check-door-binding — a comment naming bash gate-sdk/bin/run-gates.sh --emit graph is no output
|
|
2
|
+
pub fn help() {
|
|
3
|
+
// door-contributor: a contributor's regenerator, run from this repository's own checkout
|
|
4
|
+
println!(" help: regenerate — bash gate-sdk/bin/run-gates.sh --emit graph");
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
#[cfg(test)]
|
|
8
|
+
mod tests {
|
|
9
|
+
#[test]
|
|
10
|
+
fn a_test_literal_is_no_output() {
|
|
11
|
+
assert!("bash gate-sdk/bin/run-gates.sh --emit graph".contains("--emit"));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -4,7 +4,6 @@ set -uo pipefail
|
|
|
4
4
|
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
5
5
|
|
|
6
6
|
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)" || exit 2
|
|
7
|
-
ROOT="$(pwd -P)"
|
|
8
7
|
# The subject is the arm, reached through the shipped front-end a consumer invokes. No `jq`
|
|
9
8
|
# precondition rides along:
|
|
10
9
|
# the arm reads both allow lists in-crate, and the sandbox JSON below is written with printf, so
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Direct test of the shell guard's consumer stage
|
|
3
|
-
# command calls. Each stage case drives the shell-guard member from a scratch checkout under a
|
|
2
|
+
# Direct test of the shell guard's consumer stage, of --guard-json, the toolkit a consumer rule
|
|
3
|
+
# command calls, and of --run-guard-tests' consumer lane, its derivation and its limits-table read. Each stage case drives the shell-guard member from a scratch checkout under a
|
|
4
4
|
# sandbox knob file naming a scratch rule command, so the command's exit, stdout and stderr are the
|
|
5
5
|
# case's input and the member's relay of them is what is asserted.
|
|
6
6
|
#
|
|
@@ -171,6 +171,26 @@ eq "view-body-usage" "$?" 2
|
|
|
171
171
|
payload x | "$BIN" --guard-json view dq >/dev/null 2>&1
|
|
172
172
|
eq "view-unknown-usage" "$?" 2
|
|
173
173
|
|
|
174
|
+
# --- words: the word read's values, one line a segment, the words tab-separated
|
|
175
|
+
words() { # $1=command [$2=tool]
|
|
176
|
+
payload "$1" "${2:-Bash}" | "$BIN" --guard-json words
|
|
177
|
+
}
|
|
178
|
+
tab=$'\t'
|
|
179
|
+
eq "words-quoted" "$(words "git 'clean' -fd")" "git${tab}clean${tab}-fd"
|
|
180
|
+
eq "words-escaped" "$(words 'git \clean -fd')" "git${tab}clean${tab}-fd"
|
|
181
|
+
eq "words-split" "$(words "git cl'ea'n -fd")" "git${tab}clean${tab}-fd"
|
|
182
|
+
eq "words-segments" "$(words 'git commit -m x; echo --no-verify')" "$(printf 'git\tcommit\t-m\tx\necho\t--no-verify')"
|
|
183
|
+
eq "words-tab" "$(printf '%s' '{"tool_name":"Bash","tool_input":{"command":"echo '\''a\tb'\''"}}' | "$BIN" --guard-json words)" 'echo'"${tab}"'a\tb'
|
|
184
|
+
eq "words-newline" "$(words "echo \$'a\\nb'")" 'echo'"${tab}"'a\nb'
|
|
185
|
+
eq "words-ansi-c" "$(words "git \$'st\\x61sh'")" "git${tab}stash"
|
|
186
|
+
eq "words-backslash" "$(words "echo 'a\\b'")" 'echo'"${tab}"'a\\b'
|
|
187
|
+
eq "words-powershell" "$(words 'git `clean -X' PowerShell)" "git${tab}clean${tab}-X"
|
|
188
|
+
eq "words-here-string" "$(words $'git \'stash\' push; @\'\nx\n\'@ | Write-Output' PowerShell)" "$(printf 'git\tstash\tpush\nHD\nWrite-Output')"
|
|
189
|
+
eq "words-heredoc" "$(words $'git commit -F - <<\'MSG\'\nx\nMSG')" "$(printf 'git\tcommit\t-F\t-\t%s\nHD\nMSG' "<<'MSG'")"
|
|
190
|
+
eq "words-non-bash" "$(words 'echo "a"' Read | wc -c | tr -d ' ')" 0
|
|
191
|
+
payload x | "$BIN" --guard-json words sq >/dev/null 2>&1
|
|
192
|
+
eq "words-operand-usage" "$?" 2
|
|
193
|
+
|
|
174
194
|
# --- a raw control byte could forge the reader's own marks: the member blocks naming it, before any
|
|
175
195
|
# rule and with no fall-through, and view prints nothing
|
|
176
196
|
forged='{"tool_name":"Bash","tool_input":{"command":"make build \u0001 x"}}'
|
|
@@ -181,9 +201,91 @@ checks=$((checks + 1))
|
|
|
181
201
|
[[ ! -e "$tmp/friction.log" ]] || fail "control-byte-no-fallthrough" "a fall-through was logged: $(cat "$tmp/friction.log")"
|
|
182
202
|
eq "control-byte-view" "$(printf '%s' "$forged" | "$BIN" --guard-json view sq dq hd | wc -c | tr -d ' ')" 0
|
|
183
203
|
|
|
204
|
+
# --- the consumer lane of --run-guard-tests: the consumer's rows against its own command, spawned
|
|
205
|
+
# from the arm's working directory with the running binary exported; the kit tables are one
|
|
206
|
+
# inert row each, so the lane is what is measured
|
|
207
|
+
cat >"$tmp/lane-rule.sh" <<'EOF'
|
|
208
|
+
#!/usr/bin/env bash
|
|
209
|
+
cmd="$("$GATE_SDK_NATIVE_BIN" --guard-json field .tool_input.command)" || exit 3
|
|
210
|
+
case "$cmd" in
|
|
211
|
+
"at $(pwd -P)") exit 2 ;;
|
|
212
|
+
forbidden*) echo "lane: forbidden" >&2; exit 2 ;;
|
|
213
|
+
esac
|
|
214
|
+
exit 0
|
|
215
|
+
EOF
|
|
216
|
+
kit_rows="$tmp/kit-rows.tsv"
|
|
217
|
+
printf 'fallthrough\tmake build\n' >"$kit_rows"
|
|
218
|
+
printf 'fallthrough\tfalse\tmake build\n' >"$tmp/kit-bg-rows.tsv"
|
|
219
|
+
: >"$tmp/no-limits.tsv"
|
|
220
|
+
lane() { # $1=knob file [$2=limits table, default an empty one] — the arm from the scratch checkout, output to $tmp/out, the exit status echoed
|
|
221
|
+
(cd "$tmp/cwd" && env -u GATE_SDK_NATIVE_BIN GUARD_KIT_KNOB_FILE="$1" GATE_SDK_KIT_DIRS="$GATE_SDK_ROOT/../guard-kit" \
|
|
222
|
+
"$BIN" --run-guard-tests "$kit_rows" "$tmp/kit-bg-rows.tsv" "$kit_rows" "$tmp/kit-bg-rows.tsv" "${2:-$tmp/no-limits.tsv}" >"$tmp/out" 2>&1)
|
|
223
|
+
echo $?
|
|
224
|
+
}
|
|
225
|
+
printf 'GUARD_KIT_CONSUMER_RULES_CMD[] = bash\nGUARD_KIT_CONSUMER_RULES_CMD[] = %s\nGUARD_KIT_CONSUMER_CASES = lane.tsv\n' "$tmp/lane-rule.sh" >"$tmp/lane.knobs"
|
|
226
|
+
printf 'block\tforbidden x\nfallthrough\tmake build\nblock\tat @ROOT@\n' >"$tmp/cwd/lane.tsv"
|
|
227
|
+
eq "lane-green-status" "$(lane "$tmp/lane.knobs")" 0
|
|
228
|
+
has "lane-green-count" "$tmp/out" "3 consumer case(s) from lane.tsv"
|
|
229
|
+
has "lane-green-derived" "$tmp/out" "36 derived row(s) of the four tables under 0 limit row(s)"
|
|
230
|
+
lacks "lane-green-underived" "$tmp/out" "derived re-spelling(s)"
|
|
231
|
+
printf 'fallthrough\tforbidden x\nblock\tmake build\n' >"$tmp/cwd/lane.tsv"
|
|
232
|
+
eq "lane-mismatch-status" "$(lane "$tmp/lane.knobs")" 1
|
|
233
|
+
has "lane-mismatch-unblocked" "$tmp/out" "want 'fallthrough', got 'block' -- [consumer bash $tmp/lane-rule.sh] forbidden x"
|
|
234
|
+
has "lane-mismatch-blocked" "$tmp/out" "want 'block', got 'fallthrough' -- [consumer bash $tmp/lane-rule.sh] make build"
|
|
235
|
+
printf 'GUARD_KIT_CONSUMER_RULES_CMD[] = bash\nGUARD_KIT_CONSUMER_RULES_CMD[] = %s\n' "$tmp/lane-rule.sh" >"$tmp/lane-off.knobs"
|
|
236
|
+
eq "lane-off-status" "$(lane "$tmp/lane-off.knobs")" 0
|
|
237
|
+
lacks "lane-off-count" "$tmp/out" "consumer case"
|
|
238
|
+
printf 'GUARD_KIT_CONSUMER_CASES = lane.tsv\n' >"$tmp/lane-nocmd.knobs"
|
|
239
|
+
eq "lane-nocmd-status" "$(lane "$tmp/lane-nocmd.knobs")" 2
|
|
240
|
+
printf 'GUARD_KIT_CONSUMER_RULES_CMD[] = bash\nGUARD_KIT_CONSUMER_RULES_CMD[] = %s\nGUARD_KIT_CONSUMER_CASES = no-such.tsv\n' "$tmp/lane-rule.sh" >"$tmp/lane-nofile.knobs"
|
|
241
|
+
eq "lane-nofile-status" "$(lane "$tmp/lane-nofile.knobs")" 2
|
|
242
|
+
|
|
243
|
+
# --- the consumer lane's derivation: off where GUARD_KIT_CONSUMER_VARIANT_LIMITS is empty (above); a
|
|
244
|
+
# named table greens the re-spellings the consumer's command declines, reds one it does not
|
|
245
|
+
# declare and a row nothing needs, and the knob with no cases table or no readable table is a
|
|
246
|
+
# harness precondition
|
|
247
|
+
derive_knobs() { # $1=name $2=limits path, relative to the scratch checkout — a knob file naming it, its path echoed
|
|
248
|
+
printf 'GUARD_KIT_CONSUMER_RULES_CMD[] = bash\nGUARD_KIT_CONSUMER_RULES_CMD[] = %s\nGUARD_KIT_CONSUMER_CASES = lane.tsv\nGUARD_KIT_CONSUMER_VARIANT_LIMITS = %s\n' \
|
|
249
|
+
"$tmp/lane-rule.sh" "$2" >"$tmp/$1.knobs"
|
|
250
|
+
printf '%s' "$tmp/$1.knobs"
|
|
251
|
+
}
|
|
252
|
+
printf '# rule `cd_compound` — a section opener, its name the consumer'"'"'s own\nblock\tforbidden x\nfallthrough\tmake build\n' >"$tmp/cwd/lane.tsv"
|
|
253
|
+
printf 'fallthrough\tcd_compound\t%s\n' sq-lead dq-lead esc-lead part-lead wrap-command >"$tmp/cwd/lane-limits.tsv"
|
|
254
|
+
eq "derive-green-status" "$(lane "$(derive_knobs derive lane-limits.tsv)")" 0
|
|
255
|
+
has "derive-green-count" "$tmp/out" "2 consumer case(s) from lane.tsv with 14 derived re-spelling(s) under 5 limit row(s) from lane-limits.tsv"
|
|
256
|
+
: >"$tmp/cwd/lane-no-limits.tsv"
|
|
257
|
+
eq "derive-undeclared-status" "$(lane "$(derive_knobs undeclared lane-no-limits.tsv)")" 1
|
|
258
|
+
has "derive-undeclared-named" "$tmp/out" "want 'block', got 'fallthrough' -- [consumer bash $tmp/lane-rule.sh] [variant sq-lead of rule cd_compound, no limit row] 'forbidden' x"
|
|
259
|
+
printf 'fallthrough\tcd_compound\t%s\n' sq-lead dq-lead esc-lead part-lead wrap-command sq-arg >"$tmp/cwd/lane-stale-limits.tsv"
|
|
260
|
+
eq "derive-stale-status" "$(lane "$(derive_knobs stale lane-stale-limits.tsv)")" 1
|
|
261
|
+
has "derive-stale-named" "$tmp/out" "limit row 'cd_compound sq-arg' admits a re-spelling that no longer fails"
|
|
262
|
+
printf 'GUARD_KIT_CONSUMER_RULES_CMD[] = bash\nGUARD_KIT_CONSUMER_RULES_CMD[] = %s\nGUARD_KIT_CONSUMER_VARIANT_LIMITS = lane-limits.tsv\n' "$tmp/lane-rule.sh" >"$tmp/derive-nocases.knobs"
|
|
263
|
+
eq "derive-nocases-status" "$(lane "$tmp/derive-nocases.knobs")" 2
|
|
264
|
+
has "derive-nocases-named" "$tmp/out" "GUARD_KIT_CONSUMER_VARIANT_LIMITS"
|
|
265
|
+
eq "derive-nofile-status" "$(lane "$(derive_knobs nofile no-such-limits.tsv)")" 2
|
|
266
|
+
has "derive-nofile-named" "$tmp/out" "GUARD_KIT_CONSUMER_VARIANT_LIMITS"
|
|
267
|
+
printf 'block\tcd_compound\tsq-lead\n' >"$tmp/cwd/lane-bad-limits.tsv"
|
|
268
|
+
eq "derive-unreadable-status" "$(lane "$(derive_knobs unreadable lane-bad-limits.tsv)")" 2
|
|
269
|
+
has "derive-unreadable-named" "$tmp/out" "GUARD_KIT_CONSUMER_VARIANT_LIMITS"
|
|
270
|
+
|
|
271
|
+
# --- the variant lane reads the fifth positional: a limit row nothing needs is a mismatch, and a
|
|
272
|
+
# table it cannot read is a harness precondition
|
|
273
|
+
limits() { # $1=name $2..=rows — a limits table of those rows, its path echoed
|
|
274
|
+
local f="$tmp/$1.tsv"
|
|
275
|
+
shift
|
|
276
|
+
printf '%b\n' "$@" >"$f"
|
|
277
|
+
printf '%s' "$f"
|
|
278
|
+
}
|
|
279
|
+
eq "limits-stale-status" "$(lane "$tmp/lane-off.knobs" "$(limits stale 'fallthrough\tcd_compound\tsq-lead')")" 1
|
|
280
|
+
has "limits-stale-named" "$tmp/out" "limit row 'cd_compound sq-lead' admits a re-spelling that no longer fails"
|
|
281
|
+
eq "limits-floor-status" "$(lane "$tmp/lane-off.knobs" "$(limits floor 'block\tcd_compound\tsq-lead')")" 2
|
|
282
|
+
eq "limits-transform-status" "$(lane "$tmp/lane-off.knobs" "$(limits transform 'allow\tcd_compound\tsq')")" 2
|
|
283
|
+
eq "limits-twice-status" "$(lane "$tmp/lane-off.knobs" "$(limits twice 'allow\tcd_compound\tsq-lead' 'fallthrough\tcd_compound\tsq-lead')")" 2
|
|
284
|
+
eq "limits-missing-status" "$(lane "$tmp/lane-off.knobs" "$tmp/no-such-limits.tsv")" 2
|
|
285
|
+
|
|
184
286
|
if [[ "$fails" -gt 0 ]]; then
|
|
185
287
|
echo "consumer-rules.test: $fails of $checks assertion(s) failed"
|
|
186
288
|
exit 1
|
|
187
289
|
fi
|
|
188
|
-
echo "consumer-rules.test: ok ($checks assertions; the consumer command reads the payload bytes as received with the working directory and environment inherited, a block and a decision are relayed verbatim ahead of the generic ruleset, an empty result falls through to it, a fault — non-zero-non-2 exit, unparseable or non-object stdout, a command that cannot start — rides the ruleset's own answer and never silences it, an empty knob runs no stage; --guard-json field reads bytes verbatim
|
|
290
|
+
echo "consumer-rules.test: ok ($checks assertions; the consumer command reads the payload bytes as received with the working directory and environment inherited, a block and a decision are relayed verbatim ahead of the generic ruleset, an empty result falls through to it, a fault — non-zero-non-2 exit, unparseable or non-object stdout, a command that cannot start — rides the ruleset's own answer and never silences it, an empty knob runs no stage; --guard-json field reads bytes verbatim, view prints the named view through the tool's reader, nothing for a tool no reader serves, and words prints the word read's values a segment a line, nothing where the read answers nothing, and refuses an operand; a raw control byte is blocked by name before any rule; --run-guard-tests' consumer lane drives the consumer's rows against its command from the arm's working directory, reds a mismatch either way, is silent where no table is named, and refuses a table with no command or no file at exit 2, and derives its rows' re-spellings only under a named limits table, held from both sides and refused at exit 2 with no cases table or no readable table; its variant lane counts the four tables' derived rows, reds a limit row nothing needs and refuses a limits table it cannot read at exit 2)"
|
|
189
291
|
exit 0
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
# one would turn every other git row in that table into a block. The table keeps
|
|
6
6
|
# the decline arm (a dead record present); everything below needs a process the
|
|
7
7
|
# test itself owns. Each case runs the whole ruleset, so a case another rule
|
|
8
|
-
# decides first asserts that the block is not this rule's.
|
|
8
|
+
# decides first asserts that the block is not this rule's. Rule `wait_no_producer`'s
|
|
9
|
+
# record-set pair lives here on the same ground.
|
|
9
10
|
#
|
|
10
11
|
# Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
|
|
11
12
|
set -uo pipefail
|
|
@@ -55,13 +56,34 @@ want() { # $1=label $2=command $3=want-rc [$4=text the block must not carry] [$
|
|
|
55
56
|
fi
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
# rule `wait_no_producer` reads the same record set: 2 = blocked, allow = rule `bounded_wait`'s grant.
|
|
60
|
+
# A banner-led wait earns no grant, so its non-firing verdict is 0.
|
|
61
|
+
waits() { # $1=label $2=want (2|allow|0) [$3=lead]
|
|
62
|
+
checks=$((checks + 1))
|
|
63
|
+
local got
|
|
64
|
+
(cd "$tmp/cwd" && printf '{"tool_name":"Bash","tool_input":{"command":"%suntil [ -f marker ]; do sleep 30; done","run_in_background":true}}' "${3:-}" \
|
|
65
|
+
| GUARD_KIT_KNOB_FILE="$tmp/guard.knobs" GUARD_KIT_LOG="$tmp/friction.log" "$BIN" --hook shell-guard >"$tmp/out" 2>"$tmp/err")
|
|
66
|
+
got=$?
|
|
67
|
+
grep -qF '"permissionDecision":"allow"' "$tmp/out" && got=allow
|
|
68
|
+
if [[ "$got" != "$2" ]]; then
|
|
69
|
+
echo " FAIL [$1]: a backgrounded file-test wait gave $got, want $2 — $(cat "$tmp/err")"
|
|
70
|
+
fails=$((fails + 1))
|
|
71
|
+
elif [[ "$got" == 2 ]] && ! grep -qF "no liveness record names a live producer" "$tmp/err"; then
|
|
72
|
+
echo " FAIL [$1]: the block is not rule wait_no_producer's — $(cat "$tmp/err")"
|
|
73
|
+
fails=$((fails + 1))
|
|
74
|
+
fi
|
|
75
|
+
}
|
|
76
|
+
|
|
58
77
|
# --- no record at all: the rule is inert, whatever the command
|
|
59
78
|
want "empty-dir-commit" "git commit -m done" 0
|
|
79
|
+
waits "wait-empty-set" 2
|
|
80
|
+
waits "led-wait-empty-set" 2 "echo start; "
|
|
60
81
|
|
|
61
82
|
# --- a record naming a dead pid is not a live producer
|
|
62
83
|
printf 'pid=2147483646 run=dead-run\n' >"$tmp/scratch/dead-run.run"
|
|
63
84
|
want "dead-record-commit" "git commit -m done" 0
|
|
64
85
|
want "dead-record-add" "git add -A" 0
|
|
86
|
+
waits "wait-dead-record" 2
|
|
65
87
|
|
|
66
88
|
# --- a live record: the whole named write set blocks
|
|
67
89
|
printf 'pid=%s run=validate-batch\n' "$live" >"$tmp/scratch/validate-batch.run"
|
|
@@ -69,6 +91,8 @@ for sub in add commit rm mv restore checkout switch reset stash merge rebase \
|
|
|
69
91
|
cherry-pick revert apply am clean; do
|
|
70
92
|
want "live-blocks-$sub" "git $sub" 2
|
|
71
93
|
done
|
|
94
|
+
waits "wait-live-record" allow
|
|
95
|
+
waits "led-wait-live-record" 0 "echo start; "
|
|
72
96
|
|
|
73
97
|
# The corrective must name the blocking run so the reader can tell 'wait for
|
|
74
98
|
# that' from 'reclaim a record whose owner is gone'.
|
|
@@ -94,6 +118,22 @@ want "global-glued" "git --git-dir=.git commit -m done" 2
|
|
|
94
118
|
# --- and a compound fires on the mutating segment wherever it sits
|
|
95
119
|
want "compound-tail" "make build; git commit -m done" 2
|
|
96
120
|
|
|
121
|
+
# --- the words come through the git read: a quoted or escaped subcommand is the one the
|
|
122
|
+
# shell passes, and the command word is git by its value, by its path and behind a
|
|
123
|
+
# wrapper the matcher strips; a second program that runs git is not read
|
|
124
|
+
want "quoted-sub-sq" "git 'commit' -m done" 2
|
|
125
|
+
want "quoted-sub-dq" 'git "add" -A' 2
|
|
126
|
+
want "escaped-sub" 'git comm\it -m done' 2
|
|
127
|
+
want "part-quoted-sub" "git com'mit' -m done" 2
|
|
128
|
+
want "quoted-reset" "git 'reset' --hard" 2
|
|
129
|
+
want "quoted-git" "'git' commit -m done" 2
|
|
130
|
+
want "escaped-git" '\git commit -m done' 2
|
|
131
|
+
want "command-git" "command git commit -m done" 2
|
|
132
|
+
want "path-git" "/usr/bin/git commit -m done" 2
|
|
133
|
+
want "env-git" "env git commit -m done" 0
|
|
134
|
+
want "powershell-quoted-sub" "git 'commit' -m done" 2 "" PowerShell
|
|
135
|
+
want "powershell-escaped-sub" 'git com`mit -m done' 2 "" PowerShell
|
|
136
|
+
|
|
97
137
|
# --- read-only git passes: the harm is the mutation, not the producer's liveness
|
|
98
138
|
for sub in status log diff show rev-parse ls-files branch remote; do
|
|
99
139
|
want "readonly-$sub" "git $sub" 0
|
|
@@ -117,14 +157,36 @@ want "quoted-mention" "printf 'git commit -m x' >> notes.txt" 0
|
|
|
117
157
|
rm -f "$tmp/scratch/validate-batch.run" "$tmp/scratch/dead-run.run"
|
|
118
158
|
printf 'garbage\n' >"$tmp/scratch/broken.run"
|
|
119
159
|
want "unparseable-record" "git commit -m done" 0
|
|
160
|
+
waits "wait-unparseable-record" 2
|
|
120
161
|
|
|
121
162
|
# --- and a file without the '.run' suffix is not a record at all
|
|
122
163
|
printf 'pid=%s run=not-a-record\n' "$live" >"$tmp/scratch/notes.txt"
|
|
123
164
|
want "suffix-bound" "git commit -m done" 0
|
|
124
165
|
|
|
166
|
+
# --- rule `bounded_write`'s live-record clause: under a relative scratch member, a removal at or
|
|
167
|
+
# over a live record is withheld while a removal beside it is granted
|
|
168
|
+
printf '.tmp/\n' >>"$tmp/cwd/.gitignore"
|
|
169
|
+
mkdir -p "$tmp/cwd/.tmp"
|
|
170
|
+
printf 'pid=%s run=live-run\n' "$live" >"$tmp/cwd/.tmp/live-run.run"
|
|
171
|
+
printf 'GUARD_KIT_SCRATCH_DIRS[] = .tmp\n' >"$tmp/relative.knobs"
|
|
172
|
+
granted() { # $1=label $2=command $3=want (allow|withheld)
|
|
173
|
+
checks=$((checks + 1))
|
|
174
|
+
local got=withheld
|
|
175
|
+
(cd "$tmp/cwd" && payload "$2" | GUARD_KIT_KNOB_FILE="$tmp/relative.knobs" GUARD_KIT_LOG="$tmp/friction.log" "$BIN" --hook shell-guard >"$tmp/out" 2>"$tmp/err")
|
|
176
|
+
grep -qF '"permissionDecision":"allow"' "$tmp/out" && got=allow
|
|
177
|
+
[[ "$got" == "$3" ]] || {
|
|
178
|
+
echo " FAIL [$1]: '$2' was $got, want $3 — $(cat "$tmp/err")"
|
|
179
|
+
fails=$((fails + 1))
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
granted "write-live-record" "rm -f .tmp/live-run.run" withheld
|
|
183
|
+
granted "write-live-glob" "rm -f .tmp/*.run" withheld
|
|
184
|
+
granted "write-beside-live" "rm -f .tmp/old.txt" allow
|
|
185
|
+
granted "write-over-live" "touch .tmp/live-run.run" allow
|
|
186
|
+
|
|
125
187
|
if [[ "$fails" -gt 0 ]]; then
|
|
126
188
|
echo "git-mutation-under-producer.test: $fails of $checks assertion(s) failed"
|
|
127
189
|
exit 1
|
|
128
190
|
fi
|
|
129
|
-
echo "git-mutation-under-producer.test: ok ($checks assertions; the write set blocks under a live record on a Bash or a PowerShell call, read-only git and every conservative direction decline)"
|
|
191
|
+
echo "git-mutation-under-producer.test: ok ($checks assertions; the write set blocks under a live record on a Bash or a PowerShell call however git and its subcommand are spelled, read-only git and every conservative direction decline, rule \`bounded_write\` withholds a removal of a live record, and rule \`wait_no_producer\` blocks a backgrounded file-test wait, bare or behind a banner, until a record names a live pid)"
|
|
130
192
|
exit 0
|
|
@@ -31,7 +31,7 @@ payload() {
|
|
|
31
31
|
# One member call under a knob file, from a scratch checkout: stdout to $tmp/out, stderr to
|
|
32
32
|
# $tmp/err, the exit status echoed — 2 = blocked, 0 = anything else.
|
|
33
33
|
member() { # $1=config file $2=command
|
|
34
|
-
(cd "$tmp/cwd" && payload "$2" | GUARD_KIT_KNOB_FILE="$1" GUARD_KIT_LOG="$tmp/friction.log" "$BIN" --hook shell-guard >"$tmp/out" 2>"$tmp/err")
|
|
34
|
+
(cd "${CWD:-$tmp/cwd}" && payload "$2" | GUARD_KIT_KNOB_FILE="$1" GUARD_KIT_LOG="$tmp/friction.log" "$BIN" --hook shell-guard >"$tmp/out" 2>"$tmp/err")
|
|
35
35
|
echo $?
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -94,19 +94,19 @@ want "fallback-find" "$tmp/defaults.knobs" "find lib -type f" 2 "fin
|
|
|
94
94
|
want "fallback-git-grep" "$tmp/defaults.knobs" "git grep foo" 2 "grep -rn <pattern> <path>"
|
|
95
95
|
|
|
96
96
|
# --- rule `git_c_root`'s arm (d): a respelled path names the same file as the knob's resolved value and still
|
|
97
|
-
# fires
|
|
97
|
+
# fires with the same steer; a differing file falls through
|
|
98
98
|
printf 'GUARD_KIT_SETTINGS = %s/settings.json\n' "$tmp" >"$tmp/settings-path.knobs"
|
|
99
99
|
: >"$tmp/settings.json"
|
|
100
100
|
: >"$tmp/other.json"
|
|
101
101
|
k="$tmp/settings-path.knobs"
|
|
102
102
|
want "knob-echo-verbatim" "$k" "GUARD_KIT_SETTINGS=$tmp/settings.json make build" 2 "Run it without the prefix: make build"
|
|
103
|
-
want "knob-echo-same-file" "$k" "GUARD_KIT_SETTINGS=$tmp/./settings.json make build" 2 "
|
|
103
|
+
want "knob-echo-same-file" "$k" "GUARD_KIT_SETTINGS=$tmp/./settings.json make build" 2 "Run it without the prefix: make build"
|
|
104
104
|
want "knob-echo-other-file" "$k" "GUARD_KIT_SETTINGS=$tmp/other.json make build" 0
|
|
105
105
|
# a value spelling a placeholder's letters is read as written, so it is steered like any other
|
|
106
106
|
mkdir -p "$tmp/SQ"
|
|
107
107
|
: >"$tmp/SQ/settings.json"
|
|
108
108
|
printf 'GUARD_KIT_SETTINGS = %s/SQ/settings.json\n' "$tmp" >"$tmp/letters-path.knobs"
|
|
109
|
-
want "knob-echo-letters" "$tmp/letters-path.knobs" "GUARD_KIT_SETTINGS=$tmp/SQ/./settings.json make build" 2 "
|
|
109
|
+
want "knob-echo-letters" "$tmp/letters-path.knobs" "GUARD_KIT_SETTINGS=$tmp/SQ/./settings.json make build" 2 "Run it without the prefix: make build"
|
|
110
110
|
|
|
111
111
|
# --- rules `ro_pipeline` and `allowlist_chain` read an entry whose only '*' is a closing ' *' as granting its bare head, which
|
|
112
112
|
# the harness does: a decorated bare head takes rule `allowlist_chain`'s steer and a read-only tail rule `ro_pipeline`'s
|
|
@@ -140,6 +140,19 @@ TOOL=PowerShell want "ps-host-off" "$tmp/defaults.knobs" "& .tmp/x.ps1" 2 "GU
|
|
|
140
140
|
TOOL=PowerShell want "ps-host-off-bash-body" "$tmp/defaults.knobs" "& .tmp/x.ps1" 2 "Write the body as a bash script"
|
|
141
141
|
want "ps-host-refused" "$tmp/ps-bad.knobs" "git status" 2 "GUARD_KIT_SCRATCH_POWERSHELL must be empty, or name pwsh or powershell (got 'python3')"
|
|
142
142
|
|
|
143
|
+
# --- GUARD_KIT_WRITE_BINS: empty turns rule `bounded_write`'s write-utility kind off and leaves its
|
|
144
|
+
# redirect kind standing; a member the operand grammar has no row for is withheld
|
|
145
|
+
mkdir -p "$tmp/wcwd/.claude"
|
|
146
|
+
git -C "$tmp/wcwd" init -q
|
|
147
|
+
printf '.tmp/\n' >"$tmp/wcwd/.gitignore"
|
|
148
|
+
printf '{"permissions":{"allow":["Bash(git status)"]}}\n' >"$tmp/wcwd/.claude/settings.json"
|
|
149
|
+
printf 'GUARD_KIT_WRITE_BINS =\n' >"$tmp/no-write-bins.knobs"
|
|
150
|
+
printf 'GUARD_KIT_WRITE_BINS[] = shred\n' >"$tmp/shred.knobs"
|
|
151
|
+
CWD="$tmp/wcwd" grants "write-default" "$tmp/defaults.knobs" "rm -rf .tmp/old" allow
|
|
152
|
+
CWD="$tmp/wcwd" grants "write-empty-utility" "$tmp/no-write-bins.knobs" "rm -rf .tmp/old" withheld
|
|
153
|
+
CWD="$tmp/wcwd" grants "write-empty-redirect" "$tmp/no-write-bins.knobs" "git status > .tmp/s.txt" allow
|
|
154
|
+
CWD="$tmp/wcwd" grants "write-unknown-member" "$tmp/shred.knobs" "shred .tmp/x" withheld
|
|
155
|
+
|
|
143
156
|
# --- a refused config blocks with the refusal's own text, and no rule runs
|
|
144
157
|
printf 'GUARD_KIT_SEARCH_TOOLS\n' >"$tmp/malformed.knobs"
|
|
145
158
|
want "missing-knob-file" "$tmp/absent.knobs" "cat README.md" 2 "GUARD_KIT_KNOB_FILE names $tmp/absent.knobs"
|
|
@@ -166,5 +179,5 @@ if [[ "$fails" -gt 0 ]]; then
|
|
|
166
179
|
echo "guard-config-knobs.test: $fails of $checks assertion(s) failed"
|
|
167
180
|
exit 1
|
|
168
181
|
fi
|
|
169
|
-
echo "guard-config-knobs.test: ok ($checks assertions; GUARD_KIT_SEARCH_TOOLS fires rules \`find_glob\` and \`git_grep\` on its own member each and leaves them inert when empty, and each firing corrective names its bare fallback; GUARD_KIT_RO_FORMS grants an added roster member only once declared, and a consumer entry replaces the kit's declaration; rule \`git_c_root\`'s arm (d) fires on a respelled path naming the knob's resolved file and not on a differing one; GUARD_KIT_SCRATCH_POWERSHELL steers a PowerShell scratch body to the runner's PowerShell path when set, to a bash body when empty, and refuses a value naming no PowerShell host; the member blocks with the refusal on a missing or malformed knob file and runs no rule; the steer door is gate_native_bin_spelled's spelling)"
|
|
182
|
+
echo "guard-config-knobs.test: ok ($checks assertions; GUARD_KIT_SEARCH_TOOLS fires rules \`find_glob\` and \`git_grep\` on its own member each and leaves them inert when empty, and each firing corrective names its bare fallback; GUARD_KIT_RO_FORMS grants an added roster member only once declared, and a consumer entry replaces the kit's declaration; an empty GUARD_KIT_WRITE_BINS withholds the write utilities and keeps the bounded redirect, and a member the grammar lacks is withheld; rule \`git_c_root\`'s arm (d) fires on a respelled path naming the knob's resolved file and not on a differing one; GUARD_KIT_SCRATCH_POWERSHELL steers a PowerShell scratch body to the runner's PowerShell path when set, to a bash body when empty, and refuses a value naming no PowerShell host; the member blocks with the refusal on a missing or malformed knob file and runs no rule; the steer door is gate_native_bin_spelled's spelling)"
|
|
170
183
|
exit 0
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: guard-kit/SPEC.md §guard-verdict — the arm prints the decision class and the hook's own streams for one command, asked in the decision table's sandbox or in the tree, of the running binary or the one --bin names, and files nothing as friction. Every case is a property of the seam — argv, stdin, a real child and the scratch dir — which the crate's unit tests cannot see; the grammar, the stdin trim and the rendering are pinned in the module's own tests.
|
|
3
|
+
set -uo pipefail
|
|
4
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
5
|
+
|
|
6
|
+
fails=0
|
|
7
|
+
assert_rc() { [[ "$2" -eq "$3" ]] || { echo "FAIL [$1]: expected exit $3, got $2"; fails=$((fails + 1)); }; }
|
|
8
|
+
assert_first() { [[ "$(head -n 1 <<<"$3")" == "$2" ]] || { echo "FAIL [$1]: expected first line '$2', got: $3"; fails=$((fails + 1)); }; }
|
|
9
|
+
assert_has() { grep -qF -- "$2" <<<"$3" || { echo "FAIL [$1]: expected present: $2"; fails=$((fails + 1)); }; }
|
|
10
|
+
|
|
11
|
+
sandboxes=()
|
|
12
|
+
trap 'rm -rf "${sandboxes[@]}"' EXIT
|
|
13
|
+
|
|
14
|
+
# One case: a `git init` sandbox of its own, the scratch dir and the friction log pinned into it.
|
|
15
|
+
verdict() { # $1=case $2.. = the arm's argv; stdin passes through
|
|
16
|
+
local sb; sb="$(mktemp -d)"; sandboxes+=("$sb")
|
|
17
|
+
git -C "$sb" init -q
|
|
18
|
+
mkdir -p "$sb/.tmp"
|
|
19
|
+
printf 'seed\n' >"$sb/friction.log"
|
|
20
|
+
SB="$sb"
|
|
21
|
+
out="$(cd "$sb" && gate_env GATE_SDK_TMP_DIR="$sb/.tmp" GUARD_KIT_LOG="$sb/friction.log" && gate_arm_run --guard-verdict "${@:2}" 2>&1)"
|
|
22
|
+
rc=$?
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
verdict sandbox-block --sandbox -- 'cd deploy && ls'
|
|
26
|
+
assert_rc sandbox-block "$rc" 0
|
|
27
|
+
assert_first sandbox-block block "$out"
|
|
28
|
+
assert_has sandbox-block "don't use 'cd' in a compound command" "$out"
|
|
29
|
+
|
|
30
|
+
verdict sandbox-allow --sandbox -- 'touch .tmp/a.txt'
|
|
31
|
+
assert_rc sandbox-allow "$rc" 0
|
|
32
|
+
assert_first sandbox-allow allow "$out"
|
|
33
|
+
assert_has sandbox-allow '"permissionDecision":"allow"' "$out"
|
|
34
|
+
|
|
35
|
+
verdict sandbox-fallthrough --sandbox -- 'git status'
|
|
36
|
+
assert_rc sandbox-fallthrough "$rc" 0
|
|
37
|
+
[[ "$out" == fallthrough ]] || { echo "FAIL [sandbox-fallthrough]: expected 'fallthrough' alone, got: $out"; fails=$((fails + 1)); }
|
|
38
|
+
|
|
39
|
+
verdict stdin --sandbox --stdin <<<'cd deploy && ls'
|
|
40
|
+
assert_rc stdin "$rc" 0
|
|
41
|
+
assert_first stdin block "$out"
|
|
42
|
+
|
|
43
|
+
verdict substitution --sandbox -- 'bash @ROOT@/scripts/check-foo.sh'
|
|
44
|
+
assert_rc substitution "$rc" 0
|
|
45
|
+
assert_first substitution rewrite "$out"
|
|
46
|
+
|
|
47
|
+
verdict bin --sandbox --bin "$GATE_SDK_NATIVE_BIN" -- 'cd deploy && ls'
|
|
48
|
+
assert_rc bin "$rc" 0
|
|
49
|
+
assert_first bin block "$out"
|
|
50
|
+
printf 'not a binary\n' >"$SB/plain"
|
|
51
|
+
verdict bin-not-executable --sandbox --bin "$SB/plain" -- 'git status'
|
|
52
|
+
assert_rc bin-not-executable "$rc" 2
|
|
53
|
+
|
|
54
|
+
verdict in-tree-no-friction -- 'git status'
|
|
55
|
+
assert_rc in-tree-no-friction "$rc" 0
|
|
56
|
+
assert_first in-tree-no-friction fallthrough "$out"
|
|
57
|
+
[[ "$(cat "$SB/friction.log")" == seed ]] || { echo "FAIL [in-tree-no-friction]: the pinned friction log changed"; fails=$((fails + 1)); }
|
|
58
|
+
left="$(find "$SB/.tmp" -mindepth 1 2>/dev/null)"
|
|
59
|
+
[[ -z "$left" ]] || { echo "FAIL [in-tree-no-friction]: the arm left a file under the scratch dir: $left"; fails=$((fails + 1)); }
|
|
60
|
+
|
|
61
|
+
for refused in none surplus dash stdin-operand; do
|
|
62
|
+
case "$refused" in
|
|
63
|
+
none) verdict "refuse-$refused" ;;
|
|
64
|
+
surplus) verdict "refuse-$refused" a b ;;
|
|
65
|
+
dash) verdict "refuse-$refused" -x -- a ;;
|
|
66
|
+
stdin-operand) verdict "refuse-$refused" --stdin a </dev/null ;;
|
|
67
|
+
esac
|
|
68
|
+
assert_rc "refuse-$refused" "$rc" 2
|
|
69
|
+
assert_has "refuse-$refused" "usage: checkwright-gates --guard-verdict" "$out"
|
|
70
|
+
done
|
|
71
|
+
|
|
72
|
+
[[ "$fails" -eq 0 ]] || { echo "guard-verdict.test: $fails assertion(s) failed"; exit 1; }
|
|
73
|
+
echo "guard-verdict.test: clean (block, allow, fall-through and rewrite answered in the sandbox, from an operand and from stdin; --bin asks the named binary and refuses a non-executable; an in-tree fall-through leaves the friction log and the scratch dir untouched; four grammar refusals print the usage at exit 2)"
|
|
74
|
+
exit 0
|