checkwright 0.22.0 → 0.24.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 +855 -96
- package/lib/common/lock.sh +45 -9
- package/lib/common/profile.sh +33 -0
- package/lib/common/recipe.sh +50 -34
- package/lib/diff.sh +66 -0
- package/lib/doctor.sh +67 -42
- package/lib/init.sh +62 -46
- package/lib/uninstall.sh +214 -0
- package/lib/update.sh +34 -0
- package/package.json +2 -2
- 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/canon-kit/README.md +1 -0
- package/payload/canon-kit/SPEC.md +527 -63
- package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
- package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
- package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
- package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
- package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
- package/payload/canon-kit/checks/check-install-claim.gate +3 -0
- package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
- package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
- package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
- package/payload/canon-kit/checks/check-md-refs.gate +3 -0
- package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
- package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
- package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
- package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
- package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
- package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
- package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
- package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
- package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
- package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-orphan.md +6 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +7 -2
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +8 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +3 -2
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
- package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
- package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +27 -5
- package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +3 -3
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC-wire.md +18 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +3 -1
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.proto +13 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC-wire.md +22 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +17 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.proto +13 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
- package/payload/canon-kit/lib/spec.sh +91 -62
- package/payload/canon-kit/smoke/install.sh +2 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
- package/payload/context-kit/README.md +10 -5
- package/payload/context-kit/SPEC.md +364 -62
- package/payload/context-kit/bin/always-loaded.sh +5 -21
- package/payload/context-kit/bin/env-probe.sh +21 -23
- package/payload/context-kit/checks/check-brevity.gate +3 -0
- package/payload/context-kit/checks/check-footprint-fresh.gate +3 -0
- package/payload/context-kit/checks/check-memory-off.gate +3 -0
- package/payload/context-kit/checks/check-settings-paths.gate +3 -0
- package/payload/context-kit/checks/check-settings-pins.gate +3 -0
- package/payload/context-kit/gate-tests/check-brevity.test.sh +3 -2
- package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/context-config.sh +4 -0
- package/payload/context-kit/gate-tests/check-memory-off/good/scripts/context-config.sh +4 -0
- package/payload/context-kit/gate-tests/check-memory-off.test.sh +18 -4
- 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 +12 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
- 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/real-tool.sh +4 -0
- package/payload/context-kit/gate-tests/check-settings-pins.test.sh +70 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
- package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
- package/payload/context-kit/lib/context.sh +56 -0
- package/payload/context-kit/lib/toolfloor.sh +15 -4
- package/payload/context-kit/smoke/agents-md.sh +27 -4
- package/payload/context-kit/smoke/install.sh +4 -2
- package/payload/context-kit/templates/session-context.sh +5 -5
- package/payload/delegation-kit/README.md +3 -3
- package/payload/delegation-kit/SPEC.md +400 -22
- package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +3 -0
- package/payload/delegation-kit/checks/check-gate-tamper.gate +3 -0
- package/payload/delegation-kit/checks/check-rule-citation.gate +3 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/added-exemptions +5 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +2 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +108 -0
- package/payload/delegation-kit/smoke/install.sh +1 -1
- package/payload/delegation-kit/templates/agent-execution.md +109 -18
- package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
- package/payload/doctrine-kit/DOCTRINE.md +86 -12
- package/payload/doctrine-kit/README.md +7 -3
- package/payload/doctrine-kit/SPEC.md +103 -10
- package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
- package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +84 -5
- package/payload/doctrine-kit/smoke/install.sh +106 -3
- package/payload/drift-kit/README.md +2 -2
- package/payload/drift-kit/SPEC.md +84 -11
- package/payload/drift-kit/bin/kfric.sh +21 -2
- package/payload/drift-kit/bin/stage-economics.sh +1 -1
- package/payload/drift-kit/lib/drift.sh +43 -0
- package/payload/drift-kit/smoke/install.sh +49 -14
- package/payload/evidence-kit/README.md +3 -1
- package/payload/evidence-kit/SPEC.md +160 -19
- package/payload/evidence-kit/checks/check-battery-roster.gate +3 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.gate +3 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.gate +3 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +43 -2
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +4 -3
- package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +8 -5
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +1 -1
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/evidence-config.sh +9 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +1 -1
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/evidence-config.sh +9 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +6 -4
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +42 -1
- package/payload/evidence-kit/lib/evidence.sh +2 -0
- package/payload/evidence-kit/smoke/install.sh +1 -1
- package/payload/gate-sdk/README.md +23 -7
- package/payload/gate-sdk/SPEC.md +6402 -291
- package/payload/gate-sdk/bin/build-native.sh +38 -0
- package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
- package/payload/gate-sdk/bin/install-hooks.sh +14 -2
- package/payload/gate-sdk/bin/port-blockers.sh +473 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
- package/payload/gate-sdk/bin/run-gate-tests.sh +27 -7
- package/payload/gate-sdk/bin/run-gates.sh +30 -2
- package/payload/gate-sdk/bin/upgrade-smoke.sh +70 -17
- package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -0
- package/payload/gate-sdk/checks/check-action-pinning.gate +1 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +2 -0
- package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-msg.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-subject.gate +3 -0
- package/payload/gate-sdk/checks/check-core-files.gate +3 -0
- package/payload/gate-sdk/checks/check-crate-arms.sh +62 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -0
- package/payload/gate-sdk/checks/check-exec-bit.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-assertions.sh +32 -6
- package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-fail-closed.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-output.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +109 -14
- package/payload/gate-sdk/checks/check-graph.gate +3 -0
- package/payload/gate-sdk/checks/check-hook-exec-bit.gate +3 -0
- package/payload/gate-sdk/checks/check-identity.gate +3 -0
- package/payload/gate-sdk/checks/check-install-disposition.sh +93 -0
- package/payload/gate-sdk/checks/check-kit-enum.gate +3 -0
- package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
- package/payload/gate-sdk/checks/check-readme-roster.gate +3 -0
- package/payload/gate-sdk/checks/check-reads-couples.gate +3 -0
- package/payload/gate-sdk/checks/check-root-tiering.gate +3 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +2 -0
- package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
- package/payload/gate-sdk/checks/check-tree-terms.sh +2 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +17 -12
- package/payload/gate-sdk/gate-tests/check-core-files.test.sh +4 -5
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +3 -4
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +26 -4
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +6 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-held.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +8 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-held.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +77 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +110 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-bare.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-both.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-heldtwice.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twice.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +4 -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-alpha.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +110 -4
- package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +15 -5
- package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +12 -0
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +27 -5
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +12 -0
- package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +5 -4
- package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +14 -12
- package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +43 -17
- package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +190 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/gh-hosts.yml +9 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -2
- package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/gate-sdk-config.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/gh-hosts.yml +11 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -1
- package/payload/gate-sdk/gate-tests/check-identity/good/scripts/gate-sdk-config.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-identity.test.sh +114 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -1
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-native-sample.gate +3 -0
- 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 +5 -2
- package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +3 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/README.md +15 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-one.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +3 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +1 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +3 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/README.md +13 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/checks/check-delta-one.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/README.md +14 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-two.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +1 -1
- package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +87 -89
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +56 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
- package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +211 -0
- package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +16 -15
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +204 -1
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +24 -12
- package/payload/gate-sdk/lib/gate.sh +353 -22
- package/payload/gate-sdk/lib/inject.sh +25 -0
- package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
- package/payload/gate-sdk/smoke/install.sh +47 -1
- package/payload/guard-kit/README.md +14 -11
- package/payload/guard-kit/SPEC.md +477 -82
- package/payload/guard-kit/bin/run-guard-tests.sh +7 -1
- package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
- package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
- package/payload/guard-kit/guard-tests/cases.tsv +84 -14
- package/payload/guard-kit/lib/guard.sh +440 -54
- package/payload/guard-kit/templates/close-triage.md +5 -5
- package/payload/guard-kit/templates/settings-hooks.json +7 -1
- package/payload/lifecycle-kit/README.md +14 -3
- package/payload/lifecycle-kit/SPEC.md +929 -93
- package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +193 -38
- package/payload/lifecycle-kit/bin/file-gap.sh +29 -12
- package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
- package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
- package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
- package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
- package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
- package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
- package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
- package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
- package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +4 -4
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +3 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +3 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +24 -25
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +2 -2
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +2 -2
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +129 -15
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +54 -26
- package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
- package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
- package/payload/lifecycle-kit/lib/stages.sh +9 -0
- package/payload/lifecycle-kit/smoke/install.sh +96 -19
- package/payload/lifecycle-kit/templates/lead.md +60 -0
- package/payload/lifecycle-kit/templates/stages/align.md +20 -2
- package/payload/lifecycle-kit/templates/stages/build.md +3 -3
- package/payload/lifecycle-kit/templates/stages/close.md +48 -15
- package/payload/lifecycle-kit/templates/stages/scope.md +29 -5
- package/payload/lifecycle-kit/templates/stages/spec.md +6 -2
- package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
- package/payload/queue-kit/README.md +12 -10
- package/payload/queue-kit/SPEC.md +411 -74
- package/payload/queue-kit/bin/queue-counts.sh +35 -0
- package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
- package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
- package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
- package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
- package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
- package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -0
- package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
- package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
- package/payload/queue-kit/checks/check-task-names.gate +3 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +15 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +2 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +7 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +4 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -1
- package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
- package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
- package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
- package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
- package/payload/queue-kit/lib/queue.sh +4 -68
- package/payload/queue-kit/smoke/install.sh +1 -1
- package/payload/site-kit/SPEC.md +52 -2
- package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +2 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +5 -4
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +6 -5
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/checks/check-sample.gate +3 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -1
- package/payload/site-kit/smoke/install.sh +1 -1
- package/profiles.list +36 -8
- package/payload/canon-kit/checks/check-amendment-queue.sh +0 -116
- package/payload/canon-kit/checks/check-comment-tier.sh +0 -216
- package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
- package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
- package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -78
- package/payload/canon-kit/checks/check-install-claim.sh +0 -146
- package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -239
- package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
- package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
- package/payload/canon-kit/checks/check-md-refs.sh +0 -128
- package/payload/canon-kit/checks/check-payload-claim.sh +0 -133
- package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
- package/payload/canon-kit/checks/check-prose-tells.sh +0 -207
- package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
- package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -133
- package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
- package/payload/canon-kit/checks/check-spec-pointer.sh +0 -187
- package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
- package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
- package/payload/context-kit/bin/footprint.sh +0 -144
- package/payload/context-kit/checks/check-brevity.sh +0 -123
- package/payload/context-kit/checks/check-footprint-fresh.sh +0 -38
- package/payload/context-kit/checks/check-memory-off.sh +0 -112
- package/payload/context-kit/checks/check-settings-pins.sh +0 -110
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -61
- package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -139
- package/payload/delegation-kit/checks/check-rule-citation.sh +0 -76
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -216
- package/payload/drift-kit/bin/trajectory.sh +0 -242
- package/payload/evidence-kit/checks/check-battery-roster.sh +0 -86
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -103
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -104
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +0 -3
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +0 -3
- package/payload/gate-sdk/bin/enforcement-map.sh +0 -272
- package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
- package/payload/gate-sdk/checks/check-commit-msg.sh +0 -50
- package/payload/gate-sdk/checks/check-commit-subject.sh +0 -43
- package/payload/gate-sdk/checks/check-core-files.sh +0 -75
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -37
- package/payload/gate-sdk/checks/check-exec-bit.sh +0 -95
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -106
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -105
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -84
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -92
- package/payload/gate-sdk/checks/check-gate-output.sh +0 -73
- package/payload/gate-sdk/checks/check-graph.sh +0 -631
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -45
- package/payload/gate-sdk/checks/check-identity.sh +0 -134
- package/payload/gate-sdk/checks/check-kit-enum.sh +0 -94
- package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
- package/payload/gate-sdk/checks/check-readme-roster.sh +0 -107
- package/payload/gate-sdk/checks/check-reads-couples.sh +0 -199
- package/payload/gate-sdk/checks/check-root-tiering.sh +0 -66
- package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -126
- package/payload/gate-sdk/checks/check-template-registry-parity.sh +0 -81
- package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -84
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +0 -1
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +0 -1
- package/payload/gate-sdk/gate-tests/check-identity/bad/args +0 -1
- package/payload/gate-sdk/gate-tests/check-identity/good/args +0 -1
- package/payload/lifecycle-kit/bin/close-surfaces.sh +0 -94
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +0 -63
- package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
- package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
- package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
- package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -197
- package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
- package/payload/lifecycle-kit/checks/check-survey-record.sh +0 -102
- package/payload/queue-kit/bin/queue-index.sh +0 -182
- package/payload/queue-kit/bin/roadmap.sh +0 -76
- package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -106
- package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
- package/payload/queue-kit/checks/check-queue-prose-precondition.sh +0 -63
- package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
- package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
- package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -110
- package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
- package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
- package/payload/queue-kit/checks/check-task-names.sh +0 -128
- package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -80
- /package/payload/context-kit/gate-tests/{check-memory-off → check-settings-paths}/bad/args +0 -0
- /package/payload/context-kit/gate-tests/{check-memory-off → check-settings-paths}/good/args +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/{gates → scripts}/check-sample.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/{gates → scripts}/check-sample.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{check-gamma.sh → scripts/check-gamma.sh} +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gates.list → scripts/gates.list} +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{check-beta.sh → scripts/check-beta.sh} +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gates.list → scripts/gates.list} +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/{site-config.sh → scripts/site-config.sh} +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/CNAME +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/index.md +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/docs → docs}/posts/2026-01-01-legacy.md +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/pkg → pkg}/gate-tests/fixture.md +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{site-config.sh → scripts/site-config.sh} +0 -0
|
@@ -27,7 +27,7 @@ declare -p GUARD_KIT_BREADTH_PROBES >/dev/null 2>&1 || GUARD_KIT_BREADTH_PROBES=
|
|
|
27
27
|
declare -p GUARD_KIT_RO_SCRIPTS >/dev/null 2>&1 || GUARD_KIT_RO_SCRIPTS=("check-*.sh")
|
|
28
28
|
declare -p GUARD_KIT_SCRATCH_DIRS >/dev/null 2>&1 || GUARD_KIT_SCRATCH_DIRS=(".tmp")
|
|
29
29
|
declare -p GUARD_KIT_RO_BINS >/dev/null 2>&1 || GUARD_KIT_RO_BINS=(
|
|
30
|
-
grep egrep fgrep rg head tail cat wc sort uniq cut tr nl rev tac paste comm column diff jq find ls
|
|
30
|
+
grep egrep fgrep rg head tail cat wc sort uniq cut tr nl rev tac paste comm column diff jq find ls xargs
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
guard_read_command() {
|
|
@@ -38,6 +38,15 @@ guard_read_command() {
|
|
|
38
38
|
printf '%s' "$cmd"
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
# spec: guard-kit/SPEC.md §The guard framework — the path counterpart of guard_read_command; a call carrying no file_path returns non-zero so a matcher covering it falls through instead of blocking
|
|
42
|
+
guard_read_path() {
|
|
43
|
+
local input path
|
|
44
|
+
input="$(cat 2>/dev/null)" || return 1
|
|
45
|
+
path="$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty' 2>/dev/null)" || return 1
|
|
46
|
+
[[ -z "$path" ]] && return 1
|
|
47
|
+
printf '%s' "$path"
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
guard_block() {
|
|
42
51
|
printf '%s\n' "${GUARD_NAME:-guard}: $1" >&2
|
|
43
52
|
exit 2
|
|
@@ -72,35 +81,212 @@ guard_allow_match() {
|
|
|
72
81
|
[[ "$s" == $glob ]]
|
|
73
82
|
}
|
|
74
83
|
|
|
75
|
-
# spec: guard-kit/SPEC.md §The guard framework — one
|
|
84
|
+
# spec: guard-kit/SPEC.md §The guard framework — the one context-aware normalizer; a rule names the classes inert for it and every lexical view in the file comes from here
|
|
85
|
+
guard_skeleton() {
|
|
86
|
+
local cmd="$1"
|
|
87
|
+
shift
|
|
88
|
+
local c want_sq=0 want_dq=0 want_hd=0 want_hdq=0
|
|
89
|
+
for c in "$@"; do
|
|
90
|
+
case "$c" in
|
|
91
|
+
sq) want_sq=1 ;;
|
|
92
|
+
dq) want_dq=1 ;;
|
|
93
|
+
hd) want_hd=1 ;;
|
|
94
|
+
hdq) want_hdq=1 ;;
|
|
95
|
+
esac
|
|
96
|
+
done
|
|
97
|
+
|
|
98
|
+
# comment-tier-exempt: measured local fact — jumping between significant characters rather than stepping per character took a 355-char command from 2.3ms to 0.17ms, at fourteen call sites per guarded call
|
|
99
|
+
local nl=$'\n'
|
|
100
|
+
local live_class="[\"'\\\\<${nl}]*" dq_class="[\"\\\\]*"
|
|
101
|
+
local n=${#cmd} i=0 out='' span='' state=none ch rest chunk line term body quoted
|
|
102
|
+
local -a pending=() pending_q=()
|
|
103
|
+
while ((i < n)); do
|
|
104
|
+
rest="${cmd:i}"
|
|
105
|
+
if [[ "$state" == sq ]]; then
|
|
106
|
+
chunk="${rest%%\'*}"
|
|
107
|
+
if [[ "$chunk" == "$rest" ]]; then
|
|
108
|
+
span+="$rest"
|
|
109
|
+
i=$n
|
|
110
|
+
continue
|
|
111
|
+
fi
|
|
112
|
+
span+="$chunk'"
|
|
113
|
+
((i += ${#chunk} + 1))
|
|
114
|
+
if ((want_sq)); then out+='SQ'; else out+="$span"; fi
|
|
115
|
+
span=''
|
|
116
|
+
state=none
|
|
117
|
+
continue
|
|
118
|
+
fi
|
|
119
|
+
if [[ "$state" == dq ]]; then
|
|
120
|
+
chunk="${rest%%$dq_class}"
|
|
121
|
+
span+="$chunk"
|
|
122
|
+
((i += ${#chunk}))
|
|
123
|
+
if ((i >= n)); then continue; fi
|
|
124
|
+
if [[ "${cmd:i:1}" == '\' ]]; then
|
|
125
|
+
span+="${cmd:i:2}"
|
|
126
|
+
((i += 2))
|
|
127
|
+
continue
|
|
128
|
+
fi
|
|
129
|
+
span+='"'
|
|
130
|
+
((i++))
|
|
131
|
+
if ((want_dq)); then out+='DQ'; else out+="$span"; fi
|
|
132
|
+
span=''
|
|
133
|
+
state=none
|
|
134
|
+
continue
|
|
135
|
+
fi
|
|
136
|
+
chunk="${rest%%$live_class}"
|
|
137
|
+
if [[ -n "$chunk" ]]; then
|
|
138
|
+
out+="$chunk"
|
|
139
|
+
((i += ${#chunk}))
|
|
140
|
+
((i >= n)) && continue
|
|
141
|
+
fi
|
|
142
|
+
ch="${cmd:i:1}"
|
|
143
|
+
case "$ch" in
|
|
144
|
+
"'")
|
|
145
|
+
state=sq
|
|
146
|
+
span="'"
|
|
147
|
+
((i++))
|
|
148
|
+
continue ;;
|
|
149
|
+
'"')
|
|
150
|
+
state=dq
|
|
151
|
+
span='"'
|
|
152
|
+
((i++))
|
|
153
|
+
continue ;;
|
|
154
|
+
'\')
|
|
155
|
+
out+="${cmd:i:2}"
|
|
156
|
+
((i += 2))
|
|
157
|
+
continue ;;
|
|
158
|
+
'<')
|
|
159
|
+
if [[ "${cmd:i:3}" == '<<<' ]]; then
|
|
160
|
+
out+='<<<'
|
|
161
|
+
((i += 3))
|
|
162
|
+
continue
|
|
163
|
+
fi
|
|
164
|
+
if [[ "${cmd:i}" =~ ^\<\<-?[[:space:]]*(\"[^\"]*\"|\'[^\']*\'|[A-Za-z_][A-Za-z0-9_]*) ]]; then
|
|
165
|
+
out+="${BASH_REMATCH[0]}"
|
|
166
|
+
((i += ${#BASH_REMATCH[0]}))
|
|
167
|
+
term="${BASH_REMATCH[1]}"
|
|
168
|
+
case "$term" in
|
|
169
|
+
\"*\" | \'*\') pending_q+=(1) ;;
|
|
170
|
+
*) pending_q+=(0) ;;
|
|
171
|
+
esac
|
|
172
|
+
term="${term#[\"\']}"
|
|
173
|
+
term="${term%[\"\']}"
|
|
174
|
+
pending+=("$term")
|
|
175
|
+
continue
|
|
176
|
+
fi
|
|
177
|
+
;;
|
|
178
|
+
$'\n')
|
|
179
|
+
out+=$'\n'
|
|
180
|
+
((i++))
|
|
181
|
+
while ((${#pending[@]} > 0)); do
|
|
182
|
+
term="${pending[0]}"
|
|
183
|
+
quoted="${pending_q[0]}"
|
|
184
|
+
pending=("${pending[@]:1}")
|
|
185
|
+
pending_q=("${pending_q[@]:1}")
|
|
186
|
+
body=''
|
|
187
|
+
while ((i < n)); do
|
|
188
|
+
rest="${cmd:i}"
|
|
189
|
+
line="${rest%%$'\n'*}"
|
|
190
|
+
[[ "${line#"${line%%[![:space:]]*}"}" == "$term" ]] && break
|
|
191
|
+
body+="$line"$'\n'
|
|
192
|
+
((i += ${#line} + 1))
|
|
193
|
+
((i > n)) && i=$n
|
|
194
|
+
done
|
|
195
|
+
if [[ -n "$body" ]]; then
|
|
196
|
+
if ((want_hd)) || { ((want_hdq)) && ((quoted)); }; then
|
|
197
|
+
out+='HD'$'\n'
|
|
198
|
+
else
|
|
199
|
+
out+="$body"
|
|
200
|
+
fi
|
|
201
|
+
fi
|
|
202
|
+
if ((i < n)); then
|
|
203
|
+
rest="${cmd:i}"
|
|
204
|
+
line="${rest%%$'\n'*}"
|
|
205
|
+
out+="$line"
|
|
206
|
+
((i += ${#line}))
|
|
207
|
+
if ((i < n)); then
|
|
208
|
+
out+=$'\n'
|
|
209
|
+
((i++))
|
|
210
|
+
fi
|
|
211
|
+
fi
|
|
212
|
+
done
|
|
213
|
+
continue ;;
|
|
214
|
+
esac
|
|
215
|
+
out+="$ch"
|
|
216
|
+
((i++))
|
|
217
|
+
done
|
|
218
|
+
[[ -n "$span" ]] && out+="$span"
|
|
219
|
+
printf '%s' "$out"
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
# spec: guard-kit/SPEC.md §The guard framework — one splitter for every consumer that reasons per compound segment (rules 8/12/14/16/17/19, the read-compound carve-out, scan-prompts), fed a guard_skeleton view so the harness's per-segment boundary set never drifts
|
|
76
223
|
guard_split_compound() {
|
|
77
224
|
sed -E 's/\|\||&&|;|\|/\n/g' <<<"$1"
|
|
78
225
|
}
|
|
79
226
|
|
|
227
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — the committed Bash(...) allow inners, one per line; the fail-open read rules 16 and 17 share, so a missing jq or settings file emits nothing and every reader declines
|
|
228
|
+
_guard_allow_inners() {
|
|
229
|
+
command -v jq >/dev/null 2>&1 || return 0
|
|
230
|
+
[[ -f "$GUARD_KIT_SETTINGS" ]] || return 0
|
|
231
|
+
local e inner
|
|
232
|
+
while IFS= read -r e; do
|
|
233
|
+
case "$e" in
|
|
234
|
+
Bash\(*\)) inner="${e#Bash(}"; inner="${inner%)}" ;;
|
|
235
|
+
*) continue ;;
|
|
236
|
+
esac
|
|
237
|
+
[[ -n "$inner" ]] && printf '%s\n' "$inner"
|
|
238
|
+
done < <(jq -r '.permissions.allow[]?' "$GUARD_KIT_SETTINGS" 2>/dev/null)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — a segment with its redirects removed and trimmed: what rules 16 and 17 compare against a committed bare allow entry
|
|
242
|
+
_guard_segment_core() {
|
|
243
|
+
local seg
|
|
244
|
+
seg="$(sed -E 's/[[:space:]]*[0-9]*(>>?|<)[[:space:]]*(&?[0-9-]+|[^[:space:]]+)?//g' <<<"$1")"
|
|
245
|
+
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
246
|
+
seg="${seg%"${seg##*[![:space:]]}"}"
|
|
247
|
+
printf '%s' "$seg"
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — true when the segment exactly matches a committed *bare* allow entry (no glob): the reviewed-lead half of rule 16's predicate and rule 17's lead test
|
|
251
|
+
_guard_is_bare_allow() {
|
|
252
|
+
local core bl
|
|
253
|
+
core="$(_guard_segment_core "$1")"
|
|
254
|
+
[[ -n "$core" ]] || return 1
|
|
255
|
+
while IFS= read -r bl; do
|
|
256
|
+
case "$bl" in *'*'*) continue ;; esac
|
|
257
|
+
[[ "$core" == "$bl" ]] && return 0
|
|
258
|
+
done < <(_guard_allow_inners)
|
|
259
|
+
return 1
|
|
260
|
+
}
|
|
261
|
+
|
|
80
262
|
# spec: guard-kit/SPEC.md §The generic ruleset — the guard_rule_* run below; order is load-bearing
|
|
81
263
|
guard_rule_cd_compound() {
|
|
82
|
-
local cmd
|
|
264
|
+
local cmd
|
|
265
|
+
cmd="$(guard_skeleton "$1" sq dq hd)"
|
|
83
266
|
if grep -qE '(^|[;&|(])[[:space:]]*cd[[:space:]]' <<<"$cmd" && grep -qE '[;&|]' <<<"$cmd"; then
|
|
84
|
-
guard_block "don't use 'cd' in a compound command (
|
|
267
|
+
guard_block "don't use 'cd' in a compound command (cwd drift, and the allowlist can't match the compound — the call costs an out-of-band permission decision). Pass absolute paths, or 'git -C <dir>' for git."
|
|
85
268
|
fi
|
|
86
269
|
}
|
|
87
270
|
|
|
88
271
|
guard_rule_git_c_root() {
|
|
89
|
-
local cmd
|
|
272
|
+
local cmd
|
|
273
|
+
cmd="$(guard_skeleton "$1" sq dq hd)"
|
|
90
274
|
if grep -qF "git -C $PWD " <<<"$cmd"; then
|
|
91
|
-
guard_block "drop 'git -C $PWD ' — cwd is the repo root, so the bare 'git <subcommand>' form is allowlisted and
|
|
275
|
+
guard_block "drop 'git -C $PWD ' — cwd is the repo root, so the bare 'git <subcommand>' form is allowlisted and resolves on the match; the absolute '-C' spelling matches nothing and costs an out-of-band permission decision. Reserve 'git -C <dir>' for a different repo."
|
|
92
276
|
fi
|
|
93
277
|
}
|
|
94
278
|
|
|
95
279
|
guard_rule_scratch_redirect() {
|
|
96
|
-
local cmd
|
|
280
|
+
local cmd
|
|
281
|
+
cmd="$(guard_skeleton "$1" sq dq hd)"
|
|
97
282
|
if grep -qE '(^|[[:space:]])([0-9]*|&)>>?[[:space:]]*[^[:space:]/|&]+\.(err|out|log)([[:space:]]|$)' <<<"$cmd"; then
|
|
98
283
|
guard_block "don't redirect scratch to a bare repo-root filename (e.g. 2> op.err) — it pollutes cwd and risks a 'git add -A'. Send it to a gitignored scratch dir (e.g. ${GUARD_KIT_SCRATCH_DIRS[0]}/<name>.err)."
|
|
99
284
|
fi
|
|
100
285
|
}
|
|
101
286
|
|
|
102
287
|
guard_rule_abs_script() {
|
|
103
|
-
local
|
|
288
|
+
local raw="$1" cmd rest base g relcmd
|
|
289
|
+
cmd="$(guard_skeleton "$raw" sq dq hd)"
|
|
104
290
|
case "$cmd" in
|
|
105
291
|
"bash $PWD/"*) rest="${cmd#bash "$PWD/"}" ;;
|
|
106
292
|
"$PWD/"*) rest="${cmd#"$PWD/"}" ;;
|
|
@@ -109,39 +295,44 @@ guard_rule_abs_script() {
|
|
|
109
295
|
rest="${rest%%[[:space:]]*}" # first token = repo-relative script path
|
|
110
296
|
case "$rest" in *.sh) ;; *) return 0 ;; esac # only .sh scripts; rule 5 handles the rest
|
|
111
297
|
base="${rest##*/}"
|
|
112
|
-
relcmd="${
|
|
298
|
+
relcmd="${raw//"$PWD/"/}" # the rewrite carries the real command, not its skeleton
|
|
113
299
|
for g in "${GUARD_KIT_RO_SCRIPTS[@]}"; do
|
|
114
300
|
# shellcheck disable=SC2053 # intentional glob match: $g is a pattern, not a literal
|
|
115
301
|
if [[ "$base" == $g || "$rest" == $g ]]; then
|
|
116
302
|
guard_rewrite "$relcmd" "abs repo read-only script normalized to relative (${GUARD_NAME:-guard})"
|
|
117
303
|
fi
|
|
118
304
|
done
|
|
119
|
-
guard_block "use the repo-relative form '$rest' (cwd is the repo root) — it's allowlisted and
|
|
305
|
+
guard_block "use the repo-relative form '$rest' (cwd is the repo root) — it's allowlisted and resolves on the match; the absolute spelling matches nothing and costs an out-of-band permission decision. If you truly need the absolute path, run it yourself with !<command>."
|
|
120
306
|
}
|
|
121
307
|
|
|
122
308
|
guard_rule_abs_prefix() {
|
|
123
|
-
local cmd
|
|
309
|
+
local cmd
|
|
310
|
+
cmd="$(guard_skeleton "$1" sq dq hd)"
|
|
124
311
|
[[ "$cmd" == git\ * ]] && return 0
|
|
125
312
|
if grep -qF "$PWD/" <<<"$cmd"; then
|
|
126
|
-
guard_block "drop the repo-root absolute prefix '$PWD/' — cwd is the repo root, so the repo-relative path is allowlisted and
|
|
313
|
+
guard_block "drop the repo-root absolute prefix '$PWD/' — cwd is the repo root, so the repo-relative path is allowlisted and resolves on the match; the absolute spelling matches nothing and costs an out-of-band permission decision. If you truly need the absolute path, run it yourself with !<command>."
|
|
127
314
|
fi
|
|
128
315
|
}
|
|
129
316
|
|
|
130
317
|
guard_rule_expansion() {
|
|
131
318
|
local cmd="$1" sqexp expn
|
|
132
|
-
|
|
319
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — a double-quoted "$x" still expands, so 'dq'
|
|
320
|
+
# stays live; a quoted-delimiter heredoc body cannot, which is what 'hdq' names
|
|
321
|
+
sqexp="$(guard_skeleton "$cmd" sq hdq)"
|
|
133
322
|
if grep -qE '\$\{|\$\(|<\(|\$[A-Za-z_]' <<<"$sqexp"; then
|
|
134
|
-
guard_block "avoid shell variables/expansions (\$VAR, \${...}, \$(...), <(...)) — the harness
|
|
323
|
+
guard_block "avoid shell variables/expansions (\$VAR, \${...}, \$(...), <(...)) — the harness's matcher refuses every expansion, so no allowlist entry can match the command and it costs an out-of-band permission decision. Inline the literal path, use a relative path, or 'git -C <dir>'. If you genuinely need the expansion, run it yourself with !<command>."
|
|
135
324
|
fi
|
|
136
|
-
expn="$(
|
|
325
|
+
expn="$(guard_skeleton "$cmd" sq dq hdq)"
|
|
137
326
|
if grep -qE '(^|[;(]|&&|\|\|)[[:space:]]*[A-Za-z_][A-Za-z0-9_]*=[^[:space:];|&]*[[:space:]]*($|;)' <<<"$expn"; then
|
|
138
|
-
guard_block "avoid shell variable assignments (NAME=value; ... \$NAME) — they
|
|
327
|
+
guard_block "avoid shell variable assignments (NAME=value; ... \$NAME) — they defeat allowlist matching, so the call costs an out-of-band permission decision no allowlist entry can pre-empt. Inline the literal value/path at each use site, or 'git -C <dir>'. If you genuinely need it, run it yourself with !<command>."
|
|
139
328
|
fi
|
|
140
329
|
}
|
|
141
330
|
|
|
142
331
|
guard_rule_brace_glyph() {
|
|
143
332
|
local cmd="$1" sqstripped resid ph='{}' q="'{}'"
|
|
144
|
-
|
|
333
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — 'sq dq hd': '{' is a matcher glyph, not a
|
|
334
|
+
# shell expansion, so rule 6's reason to keep double-quoted spans live does not carry here.
|
|
335
|
+
sqstripped="$(guard_skeleton "$cmd" sq dq hd)"
|
|
145
336
|
case "$sqstripped" in *'{'*) ;; *) return 0 ;; esac
|
|
146
337
|
resid="${sqstripped//"$ph"/}"
|
|
147
338
|
case "$resid" in
|
|
@@ -150,12 +341,12 @@ guard_rule_brace_glyph() {
|
|
|
150
341
|
"bare {} placeholder single-quoted so the harness matcher passes it (${GUARD_NAME:-guard})" ;;
|
|
151
342
|
esac
|
|
152
343
|
if grep -qF '@{' <<<"$sqstripped"; then
|
|
153
|
-
guard_block "spell out the git-ref shorthand '@{...}' — the harness
|
|
344
|
+
guard_block "spell out the git-ref shorthand '@{...}' — the harness's matcher refuses the '{' glyph, so the call costs an out-of-band permission decision. Use 'origin/<branch>..HEAD' for '@{u}..', or the resolved ref/hash for a reflog form."
|
|
154
345
|
fi
|
|
155
346
|
if grep -qE '\{[^}]*(,|\.\.)[^}]*\}' <<<"$sqstripped"; then
|
|
156
|
-
guard_block "write out the brace expansion '{a,b}'/'{a..b}' — the harness
|
|
347
|
+
guard_block "write out the brace expansion '{a,b}'/'{a..b}' — the harness's matcher refuses the '{' glyph and no allowlist entry can match around it, so the call costs an out-of-band permission decision. Spell the members (e.g. 'mkdir -p a/b a/c') or use a loop for a long range."
|
|
157
348
|
fi
|
|
158
|
-
guard_block "
|
|
349
|
+
guard_block "quote the '{' if it's literal (an unquoted awk/sed program), or write it out if it expands — the harness's matcher refuses every bare '{' glyph before allowlist matching, so the call is decided out of band. A brace inside quotes of either kind, or in a heredoc body, is already inert and never reaches this block."
|
|
159
350
|
}
|
|
160
351
|
|
|
161
352
|
_guard_sed_segment() {
|
|
@@ -187,7 +378,7 @@ _guard_sed_segment() {
|
|
|
187
378
|
|
|
188
379
|
guard_rule_sed_file() {
|
|
189
380
|
local cmd="$1" s seg
|
|
190
|
-
s="$(
|
|
381
|
+
s="$(guard_skeleton "$cmd" sq dq hd)"
|
|
191
382
|
while IFS= read -r seg; do
|
|
192
383
|
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
193
384
|
case "$seg" in
|
|
@@ -215,6 +406,34 @@ _guard_is_cat_read() {
|
|
|
215
406
|
[[ "$operands" == 1 ]]
|
|
216
407
|
}
|
|
217
408
|
|
|
409
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 16's xargs discriminator: xargs runs a command rather than filtering text, so the segment is read-only only when the command it runs is itself on the roster
|
|
410
|
+
_guard_is_ro_xargs() {
|
|
411
|
+
local seg="${1#"${1%%[![:space:]]*}"}" tok want_arg=0 cmdtok='' b i n
|
|
412
|
+
local -a toks
|
|
413
|
+
read -ra toks <<<"$seg"
|
|
414
|
+
[[ "${toks[0]:-}" == xargs ]] || return 1
|
|
415
|
+
n=${#toks[@]}
|
|
416
|
+
for ((i = 1; i < n; i++)); do
|
|
417
|
+
tok="${toks[i]}"
|
|
418
|
+
if [[ "$want_arg" == 1 ]]; then want_arg=0; continue; fi
|
|
419
|
+
case "$tok" in
|
|
420
|
+
-0 | -t | -r | -x | -p | --null | --no-run-if-empty | --verbose | --exit | --interactive | --open-tty) ;;
|
|
421
|
+
-I | -L | -n | -P | -s | -E | -d | -a) want_arg=1 ;;
|
|
422
|
+
-[0ILnPsEdae]*) ;;
|
|
423
|
+
--*=*) ;;
|
|
424
|
+
-*) return 1 ;;
|
|
425
|
+
*) cmdtok="$tok"; break ;;
|
|
426
|
+
esac
|
|
427
|
+
done
|
|
428
|
+
[[ -z "$cmdtok" ]] && return 0
|
|
429
|
+
[[ "$cmdtok" == xargs ]] && return 1
|
|
430
|
+
case "$cmdtok" in echo | printf) return 0 ;; esac
|
|
431
|
+
for b in "${GUARD_KIT_RO_BINS[@]}"; do
|
|
432
|
+
[[ "$cmdtok" == "$b" ]] && return 0
|
|
433
|
+
done
|
|
434
|
+
return 1
|
|
435
|
+
}
|
|
436
|
+
|
|
218
437
|
# spec: guard-kit/SPEC.md §The generic ruleset — one segment is a bare find listing: leads with find, carries no action predicate
|
|
219
438
|
_guard_is_find_listing() {
|
|
220
439
|
local seg="${1#"${1%%[![:space:]]*}"}"
|
|
@@ -242,27 +461,27 @@ guard_rule_find_glob() {
|
|
|
242
461
|
local cmd="$1" s
|
|
243
462
|
grep -qE '\$\(|<\(|>\(' <<<"$cmd" && return 0
|
|
244
463
|
case "$cmd" in *'`'*) return 0 ;; esac
|
|
245
|
-
s="$(
|
|
464
|
+
s="$(guard_skeleton "$cmd" sq dq hd)"
|
|
246
465
|
grep -qE '(&&|\|\||\||&|<|>)' <<<"$s" && return 0
|
|
247
466
|
_guard_is_read_batch "$s" _guard_is_find_listing || return 0
|
|
248
|
-
guard_block "don't list files with a bare 'find' — use the Glob tool: it returns matching paths (registered for a later Read)
|
|
467
|
+
guard_block "don't list files with a bare 'find' — use the Glob tool: it returns matching paths (registered for a later Read) and needs no permission decision at all. This fires on a lone listing and on a ';'-sequence of them (a literal echo/printf banner between them is fine); a 'find' carrying an action predicate (-exec/-delete/…), piped into a consumer, or redirected is untouched. If you genuinely need find, run it yourself with !<command>."
|
|
249
468
|
}
|
|
250
469
|
|
|
251
470
|
guard_rule_cat_file() {
|
|
252
471
|
local cmd="$1" s
|
|
253
472
|
grep -qE '\$\(|<\(|>\(' <<<"$cmd" && return 0
|
|
254
473
|
case "$cmd" in *'`'*) return 0 ;; esac
|
|
255
|
-
s="$(
|
|
474
|
+
s="$(guard_skeleton "$cmd" sq dq hd)"
|
|
256
475
|
grep -qE '(&&|\|\||\||&|<|>)' <<<"$s" && return 0
|
|
257
476
|
_guard_is_read_batch "$s" _guard_is_cat_read || return 0
|
|
258
|
-
guard_block "don't read files with a bare 'cat' — use the Read tool: it returns numbered lines registered for a later Edit,
|
|
477
|
+
guard_block "don't read files with a bare 'cat' — use the Read tool: it returns numbered lines registered for a later Edit, and needs no permission decision at all. This fires on a lone 'cat <file>' and on a ';'-sequence of them (a literal echo/printf banner between reads is fine — batch them into one Read); a 'cat' feeding a pipe or heredoc, redirecting, or concatenating multiple files in one command is composition and untouched. If you genuinely need cat, run it yourself with !<command>."
|
|
259
478
|
}
|
|
260
479
|
|
|
261
480
|
guard_rule_git_grep() {
|
|
262
481
|
local cmd="$1" s tok i n positionals=0 want_arg=0 pat_opt=0 working_tree=0
|
|
263
482
|
grep -qE '\$\(|<\(|>\(' <<<"$cmd" && return 0
|
|
264
483
|
case "$cmd" in *'`'*) return 0 ;; esac
|
|
265
|
-
s="$(
|
|
484
|
+
s="$(guard_skeleton "$cmd" sq dq hd)"
|
|
266
485
|
grep -qE '(&&|\|\||;|\||&|<|>)' <<<"$s" && return 0
|
|
267
486
|
local -a toks
|
|
268
487
|
read -ra toks <<<"$s"
|
|
@@ -287,11 +506,173 @@ guard_rule_git_grep() {
|
|
|
287
506
|
[[ "$positionals" == 1 ]] && working_tree=1
|
|
288
507
|
fi
|
|
289
508
|
[[ "$working_tree" == 1 ]] || return 0
|
|
290
|
-
guard_block "don't search with 'git grep' over the working tree — use the Grep tool: it returns matching lines (files registered for a later Read)
|
|
509
|
+
guard_block "don't search with 'git grep' over the working tree — use the Grep tool: it returns matching lines (files registered for a later Read) and needs no permission decision at all. A 'git grep' naming a revision, searching the index (--cached), or piped into a consumer is untouched — those reach beyond the working tree the Grep tool sees. If you genuinely need git grep, run it yourself with !<command>."
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 12's lead test: a leading shell keyword or negation does not change which binary the segment runs, so the loop-headed spelling the rule exists for is reached
|
|
513
|
+
_guard_command_word() {
|
|
514
|
+
local seg="${1#"${1%%[![:space:]]*}"}" tok
|
|
515
|
+
while [[ -n "$seg" ]]; do
|
|
516
|
+
tok="${seg%%[[:space:]]*}"
|
|
517
|
+
case "$tok" in
|
|
518
|
+
'!' | until | while | if | then | else | elif | do) ;;
|
|
519
|
+
*) break ;;
|
|
520
|
+
esac
|
|
521
|
+
seg="${seg#"$tok"}"
|
|
522
|
+
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
523
|
+
done
|
|
524
|
+
printf '%s' "$seg"
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 12's pattern operand: the literal '-f' will scan argv for, or non-zero where the segment's options cannot be walked without guessing
|
|
528
|
+
_guard_pgrep_pattern() {
|
|
529
|
+
local seg="$1" tok rest k pat='' have_f=0 skip=0
|
|
530
|
+
local -a toks
|
|
531
|
+
read -ra toks <<<"$seg"
|
|
532
|
+
for tok in "${toks[@]:1}"; do
|
|
533
|
+
if [[ "$skip" == 1 ]]; then skip=0; continue; fi
|
|
534
|
+
case "$tok" in
|
|
535
|
+
--full) have_f=1 ;;
|
|
536
|
+
--exact | --inverse | --count | --newest | --oldest | --ignore-case | --list-name | --list-full | --lightweight) ;;
|
|
537
|
+
--signal | --parent | --pgroup | --group | --session | --terminal | --euid | --uid | --delimiter) skip=1 ;;
|
|
538
|
+
--*) return 1 ;;
|
|
539
|
+
-[0-9]*) ;;
|
|
540
|
+
-d | -P | -g | -G | -s | -t | -u | -U) skip=1 ;;
|
|
541
|
+
-*)
|
|
542
|
+
rest="${tok#-}"
|
|
543
|
+
for ((k = 0; k < ${#rest}; k++)); do
|
|
544
|
+
case "${rest:k:1}" in
|
|
545
|
+
f) have_f=1 ;;
|
|
546
|
+
a | c | i | l | n | o | v | x | w) ;;
|
|
547
|
+
*) return 1 ;;
|
|
548
|
+
esac
|
|
549
|
+
done ;;
|
|
550
|
+
*) [[ -z "$pat" ]] || return 1; pat="$tok" ;;
|
|
551
|
+
esac
|
|
552
|
+
done
|
|
553
|
+
[[ "$have_f" == 1 && -n "$pat" ]] || return 1
|
|
554
|
+
case "$pat" in
|
|
555
|
+
\'*\') pat="${pat#\'}"; pat="${pat%\'}" ;;
|
|
556
|
+
\"*\") pat="${pat#\"}"; pat="${pat%\"}" ;;
|
|
557
|
+
esac
|
|
558
|
+
[[ -n "$pat" ]] || return 1
|
|
559
|
+
case "$pat" in *\'* | *\"*) return 1 ;; esac
|
|
560
|
+
printf '%s' "$pat"
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
guard_rule_pgrep_self_match() {
|
|
564
|
+
local raw="$1" seg cmdseg pat occurrences
|
|
565
|
+
grep -qE '\$\(|<\(|>\(|\$\{|\$[A-Za-z_]' <<<"$raw" && return 0
|
|
566
|
+
case "$raw" in *'`'*) return 0 ;; esac
|
|
567
|
+
while IFS= read -r seg; do
|
|
568
|
+
cmdseg="$(_guard_command_word "$seg")"
|
|
569
|
+
case "${cmdseg%%[[:space:]]*}" in pgrep | pkill) ;; *) continue ;; esac
|
|
570
|
+
pat="$(_guard_pgrep_pattern "$cmdseg")" || continue
|
|
571
|
+
occurrences="$(grep -oF -- "$pat" <<<"$raw" | wc -l)"
|
|
572
|
+
[[ "$occurrences" -ge 2 ]] || continue
|
|
573
|
+
guard_block "don't wait on process liveness with 'pgrep -f $pat' — '-f' matches full argv, and this command's own argv (the harness's wrapper included) carries that same literal, so the predicate is permanently true and the loop never exits. Nothing reds: the work finishes and the only symptom is the foreground cap absorbing an unbounded wait. Wait on the work's own artifact instead (an evidence file, a lock, an exit marker the work itself writes), or — where liveness genuinely is the condition — 'kill -0 <pid>' against a PID you recorded, whoever started that producer: a child you backgrounded yourself counts, and its PID is the one you recorded at launch, one line 'pid=<n> run=<key>' in a '<key>.run' file under your gitignored scratch dir. A pattern is a guess about a process table that includes the guesser; a PID is an identity. If you genuinely need pgrep, run it yourself with !<command>."
|
|
574
|
+
done < <(guard_split_compound "$raw" | tr '&' '\n')
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 13's loop-wrapper span: 'until <cond>; do sleep N; done' is the sanctioned wait, so only a sleep outside every do…done span fires, and an unresolvable span declines
|
|
578
|
+
guard_rule_bare_sleep() {
|
|
579
|
+
local raw="$1" s tok depth=0 cmdpos=1 bare=0
|
|
580
|
+
grep -qE '\$\(|<\(|>\(|\$\{|\$[A-Za-z_]' <<<"$raw" && return 0
|
|
581
|
+
case "$raw" in *'`'*) return 0 ;; esac
|
|
582
|
+
s="$(guard_skeleton "$raw" sq dq hd)"
|
|
583
|
+
s="$(tr '\n' ';' <<<"$s" | sed -E 's/(\|\||&&|;|\||&|\(|\)|\{|\})/ \1 /g')"
|
|
584
|
+
local -a toks
|
|
585
|
+
read -ra toks <<<"$s"
|
|
586
|
+
for tok in "${toks[@]}"; do
|
|
587
|
+
case "$tok" in
|
|
588
|
+
';' | '|' | '||' | '&&' | '&' | '(' | ')' | '{' | '}') cmdpos=1 ;;
|
|
589
|
+
'!' | until | while | if | then | else | elif | for) cmdpos=1 ;;
|
|
590
|
+
do) depth=$((depth + 1)); cmdpos=1 ;;
|
|
591
|
+
done)
|
|
592
|
+
depth=$((depth - 1))
|
|
593
|
+
[[ "$depth" -lt 0 ]] && return 0
|
|
594
|
+
cmdpos=1 ;;
|
|
595
|
+
sleep)
|
|
596
|
+
[[ "$cmdpos" == 1 && "$depth" == 0 ]] && bare=1
|
|
597
|
+
cmdpos=0 ;;
|
|
598
|
+
*) cmdpos=0 ;;
|
|
599
|
+
esac
|
|
600
|
+
done
|
|
601
|
+
[[ "$depth" == 0 && "$bare" == 1 ]] || return 0
|
|
602
|
+
guard_block "don't wait by sleeping in the foreground — a wait must end when its condition goes true, not when a duration expires, and a foreground sleep spends a full-price turn doing nothing. Background a command that *exits* on the condition ('run_in_background' wrapping 'until <cond>; do sleep N; done') and take its completion notification: it fires the moment the condition holds and then ends. A dispatched agent is awaited by its own completion notification and never by a path on disk. The harness's event-stream form stays armed to its deadline even after its event fires, so it is the wrong tool for a single completion. A sleep inside a condition loop is untouched — that is the sanctioned form. If you genuinely need the settle, run it yourself with !<command>."
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 14's record reader: the one-line 'pid=<n> run=<key>' grammar is evidence-kit/SPEC.md §The producer-liveness lock's and is read rather than sourced, because a PreToolUse hook cannot depend on a sibling kit being vendored; a record that does not parse yields nothing, so the rule declines on one
|
|
606
|
+
_guard_live_run_records() {
|
|
607
|
+
local d rec line pid
|
|
608
|
+
for d in ${GUARD_KIT_SCRATCH_DIRS[@]+"${GUARD_KIT_SCRATCH_DIRS[@]}"}; do
|
|
609
|
+
[[ -d "$d" ]] || continue
|
|
610
|
+
for rec in "$d"/*.run; do
|
|
611
|
+
[[ -f "$rec" ]] || continue
|
|
612
|
+
IFS= read -r line <"$rec" || continue
|
|
613
|
+
[[ "$line" =~ ^pid=([1-9][0-9]*)[[:space:]]run=([^[:space:]]+)$ ]] || continue
|
|
614
|
+
pid="${BASH_REMATCH[1]}"
|
|
615
|
+
{ kill -0 "$pid" 2>/dev/null || ps -p "$pid" >/dev/null 2>&1; } \
|
|
616
|
+
&& printf "'%s' (pid %s, recorded in %s)\n" "${BASH_REMATCH[2]}" "$pid" "$rec"
|
|
617
|
+
done
|
|
618
|
+
done
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 14's subcommand walk: git's global options are consumed so 'git -C dir commit' is reached, and any option this list does not recognize returns non-zero so the segment declines rather than guessing which token is the subcommand
|
|
622
|
+
_guard_git_subcommand() {
|
|
623
|
+
local seg="$1" tok first=1 expect_arg=0
|
|
624
|
+
for tok in $seg; do
|
|
625
|
+
if [[ "$first" == 1 ]]; then
|
|
626
|
+
[[ "$tok" == git ]] || return 1
|
|
627
|
+
first=0
|
|
628
|
+
continue
|
|
629
|
+
fi
|
|
630
|
+
if [[ "$expect_arg" == 1 ]]; then expect_arg=0; continue; fi
|
|
631
|
+
case "$tok" in
|
|
632
|
+
-C | -c | --git-dir | --work-tree | --namespace | --exec-path | --config-env)
|
|
633
|
+
expect_arg=1 ;;
|
|
634
|
+
--git-dir=* | --work-tree=* | --namespace=* | --exec-path=* | --config-env=*) ;;
|
|
635
|
+
-p | -P | --paginate | --no-pager | --bare | --no-replace-objects | \
|
|
636
|
+
--literal-pathspecs | --no-literal-pathspecs | --glob-pathspecs | \
|
|
637
|
+
--noglob-pathspecs | --icase-pathspecs | --no-optional-locks) ;;
|
|
638
|
+
-*) return 1 ;;
|
|
639
|
+
*) printf '%s' "$tok"; return 0 ;;
|
|
640
|
+
esac
|
|
641
|
+
done
|
|
642
|
+
return 1
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
guard_rule_git_mutation_under_producer() {
|
|
646
|
+
local raw="$1" s seg cmdseg sub
|
|
647
|
+
case "$raw" in *git*) ;; *) return 0 ;; esac
|
|
648
|
+
grep -qE '\$\(|<\(|>\(|\$\{|\$[A-Za-z_]' <<<"$raw" && return 0
|
|
649
|
+
case "$raw" in *'`'*) return 0 ;; esac
|
|
650
|
+
s="$(guard_skeleton "$raw" sq dq hd)"
|
|
651
|
+
local -a writes=()
|
|
652
|
+
while IFS= read -r seg; do
|
|
653
|
+
cmdseg="$(_guard_command_word "$seg")"
|
|
654
|
+
sub="$(_guard_git_subcommand "$cmdseg")" || continue
|
|
655
|
+
case "$sub" in
|
|
656
|
+
add | commit | rm | mv | restore | checkout | switch | reset | stash | \
|
|
657
|
+
merge | rebase | cherry-pick | revert | apply | am | clean) ;;
|
|
658
|
+
*) continue ;;
|
|
659
|
+
esac
|
|
660
|
+
writes+=("git $sub")
|
|
661
|
+
done < <(guard_split_compound "$s")
|
|
662
|
+
[[ "${#writes[@]}" -gt 0 ]] || return 0
|
|
663
|
+
|
|
664
|
+
local -a runs=()
|
|
665
|
+
mapfile -t runs < <(_guard_live_run_records)
|
|
666
|
+
[[ "${#runs[@]}" -gt 0 ]] || return 0
|
|
667
|
+
|
|
668
|
+
local list
|
|
669
|
+
list="$(printf '%s; ' "${runs[@]}")"
|
|
670
|
+
guard_block "don't run '${writes[0]}' while a producer you recorded is still running — ${list%; } names a live pid, and a tracked-tree mutation under a live producer is what the wait rule exists to prevent: the run is still writing, so a commit taken now dirties the worktree underneath it and its verdict has to be discarded and re-run. Two exits, both cheap: wait for that producer on its own artifact (loop on the recorded pid's liveness, 'until ! kill -0 <pid> 2>/dev/null; do sleep 5; done', backgrounded so its completion notifies you), or — if the producer has already exited — delete its .run file, which is not a workaround but the statement of fact becoming false and being retracted. Read-only git ('status', 'log', 'diff', 'show') is untouched. If you genuinely need this mutation now, run it yourself with !<command>."
|
|
291
671
|
}
|
|
292
672
|
|
|
293
673
|
guard_rule_truncate_scratch() {
|
|
294
|
-
local cmd
|
|
674
|
+
local cmd
|
|
675
|
+
cmd="$(guard_skeleton "$1" sq dq hd)"
|
|
295
676
|
if [[ "$cmd" =~ ^[[:space:]]*:([[:space:]]+[0-9]*\>\>?[[:space:]]*[^[:space:]\&\|\;\<]+)+[[:space:]]*$ ]]; then
|
|
296
677
|
local all_ignored=1 tgt
|
|
297
678
|
while read -r tgt; do
|
|
@@ -307,10 +688,11 @@ guard_rule_truncate_scratch() {
|
|
|
307
688
|
|
|
308
689
|
guard_rule_ro_pipeline() {
|
|
309
690
|
local raw="$1"
|
|
691
|
+
# spec: guard-kit/SPEC.md §The guard framework — the raw-command carve-out these two tests take
|
|
310
692
|
grep -qE '\$\(|<\(|>\(' <<<"$raw" && return 0
|
|
311
693
|
case "$raw" in *'`'*) return 0 ;; esac
|
|
312
694
|
local s
|
|
313
|
-
s="$(
|
|
695
|
+
s="$(guard_skeleton "$raw" sq dq hd)"
|
|
314
696
|
grep -q "['\"]" <<<"$s" && return 0
|
|
315
697
|
grep -qE '(&&|\|\||;|&)' <<<"$s" && return 0
|
|
316
698
|
local tgt
|
|
@@ -320,47 +702,49 @@ guard_rule_ro_pipeline() {
|
|
|
320
702
|
/dev/null | '&'[0-9]*) ;;
|
|
321
703
|
*) return 0 ;;
|
|
322
704
|
esac
|
|
323
|
-
done < <(grep -oE '[0-9]*>>?[[:space:]]*[^[:space:]
|
|
705
|
+
done < <(grep -oE '[0-9]*>>?[[:space:]]*[^[:space:]|;&]+' <<<"$s" \
|
|
324
706
|
| sed -E 's/^[0-9]*>>?[[:space:]]*//')
|
|
325
707
|
if grep -qE '(^|[[:space:]])find([[:space:]]|$)' <<<"$s" \
|
|
326
708
|
&& grep -qE '\-(exec|execdir|ok|delete)\b' <<<"$s"; then
|
|
327
709
|
return 0
|
|
328
710
|
fi
|
|
329
|
-
local
|
|
330
|
-
|
|
711
|
+
local -a segs
|
|
712
|
+
mapfile -t segs < <(guard_split_compound "$s")
|
|
713
|
+
local seg first b i matched reads=0
|
|
714
|
+
for ((i = 0; i < ${#segs[@]}; i++)); do
|
|
715
|
+
seg="${segs[i]}"
|
|
331
716
|
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
332
717
|
[[ -z "$seg" ]] && continue
|
|
718
|
+
_guard_is_banner "$seg" && continue
|
|
333
719
|
first="${seg%%[[:space:]]*}"
|
|
720
|
+
[[ "$first" == xargs ]] && { _guard_is_ro_xargs "$seg" || return 0; }
|
|
334
721
|
matched=0
|
|
335
722
|
for b in "${GUARD_KIT_RO_BINS[@]}"; do
|
|
336
723
|
[[ "$first" == "$b" ]] && { matched=1; break; }
|
|
337
724
|
done
|
|
338
|
-
[[ "$matched" ==
|
|
339
|
-
|
|
725
|
+
if [[ "$matched" == 0 ]]; then
|
|
726
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 16's widened lead: a bare
|
|
727
|
+
# committed allow entry qualifies, but only where something decorates it
|
|
728
|
+
[[ "$i" == 0 && "${#segs[@]}" -gt 1 ]] || return 0
|
|
729
|
+
_guard_is_bare_allow "$seg" || return 0
|
|
730
|
+
fi
|
|
731
|
+
reads=$((reads + 1))
|
|
732
|
+
done
|
|
733
|
+
[[ "$reads" -ge 1 ]] || return 0
|
|
340
734
|
guard_allow "read-only search pipeline (${GUARD_NAME:-guard} auto-allow)"
|
|
341
735
|
}
|
|
342
736
|
|
|
343
737
|
guard_rule_allowlist_chain() {
|
|
344
|
-
local cmd="$1"
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
local -a allow_entries
|
|
349
|
-
mapfile -t allow_entries < <(jq -r '.permissions.allow[]?' "$GUARD_KIT_SETTINGS" 2>/dev/null) || return 0
|
|
350
|
-
[[ ${#allow_entries[@]} -gt 0 ]] || return 0
|
|
351
|
-
|
|
352
|
-
local e inner
|
|
353
|
-
local -a bare_leads pattern_inners
|
|
354
|
-
for e in "${allow_entries[@]}"; do
|
|
355
|
-
case "$e" in Bash\(*\)) inner="${e#Bash(}"; inner="${inner%)}" ;; *) continue ;; esac
|
|
356
|
-
[[ -z "$inner" ]] && continue
|
|
738
|
+
local cmd="$1" inner
|
|
739
|
+
local -a bare_leads=() pattern_inners=()
|
|
740
|
+
while IFS= read -r inner; do
|
|
357
741
|
pattern_inners+=("$inner")
|
|
358
742
|
case "$inner" in *'*'*) ;; *) bare_leads+=("$inner") ;; esac
|
|
359
|
-
done
|
|
743
|
+
done < <(_guard_allow_inners)
|
|
360
744
|
[[ ${#bare_leads[@]} -gt 0 ]] || return 0
|
|
361
745
|
|
|
362
746
|
local skel
|
|
363
|
-
skel="$(
|
|
747
|
+
skel="$(guard_skeleton "$cmd" sq dq hd)"
|
|
364
748
|
|
|
365
749
|
local -a segs
|
|
366
750
|
mapfile -t segs < <(guard_split_compound "$skel")
|
|
@@ -369,8 +753,7 @@ guard_rule_allowlist_chain() {
|
|
|
369
753
|
lead="${lead#"${lead%%[![:space:]]*}"}"; lead="${lead%"${lead##*[![:space:]]}"}"
|
|
370
754
|
|
|
371
755
|
local lead_core
|
|
372
|
-
lead_core="$(
|
|
373
|
-
lead_core="${lead_core#"${lead_core%%[![:space:]]*}"}"; lead_core="${lead_core%"${lead_core##*[![:space:]]}"}"
|
|
756
|
+
lead_core="$(_guard_segment_core "$lead")"
|
|
374
757
|
|
|
375
758
|
local bl matched_lead=0
|
|
376
759
|
for bl in "${bare_leads[@]}"; do
|
|
@@ -378,7 +761,7 @@ guard_rule_allowlist_chain() {
|
|
|
378
761
|
done
|
|
379
762
|
[[ "$matched_lead" == 1 ]] || return 0
|
|
380
763
|
|
|
381
|
-
local steer="run '$lead_core' bare — it's a statically allowlisted command, but the decoration (chaining or a redirect)
|
|
764
|
+
local steer="run '$lead_core' bare — it's a statically allowlisted command, but the decoration (chaining or a redirect) leaves a segment nothing grants, so the whole call falls off the match path and costs an out-of-band permission decision. Run the allowlisted command on its own; issue the rest as separate calls."
|
|
382
765
|
|
|
383
766
|
[[ "$lead" != "$lead_core" ]] && guard_block "$steer"
|
|
384
767
|
|
|
@@ -400,7 +783,7 @@ guard_rule_allowlist_chain() {
|
|
|
400
783
|
|
|
401
784
|
guard_rule_git_rewrite() {
|
|
402
785
|
local cmd="$1" s
|
|
403
|
-
s="$(
|
|
786
|
+
s="$(guard_skeleton "$cmd" sq dq hd)"
|
|
404
787
|
if { grep -qE '(^|[[:space:]])git[[:space:]]+commit([[:space:]]|$)' <<<"$s" \
|
|
405
788
|
&& grep -qE '(^|[[:space:]])(-F|--file|--amend)\b' <<<"$s"; } \
|
|
406
789
|
|| { grep -qE '(^|[[:space:]])git[[:space:]]+reset([[:space:]]|$)' <<<"$s" \
|
|
@@ -413,7 +796,7 @@ guard_rule_rm_tracked() {
|
|
|
413
796
|
local raw="$1" s
|
|
414
797
|
grep -qE '\$\(|<\(|>\(|\$\{|\$[A-Za-z_]' <<<"$raw" && return 0
|
|
415
798
|
case "$raw" in *'`'*) return 0 ;; esac
|
|
416
|
-
s="$(
|
|
799
|
+
s="$(guard_skeleton "$raw" sq dq hd)"
|
|
417
800
|
local seg lead arg
|
|
418
801
|
while IFS= read -r seg; do
|
|
419
802
|
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
@@ -441,6 +824,9 @@ guard_generic_rules() {
|
|
|
441
824
|
guard_rule_find_glob "$cmd"
|
|
442
825
|
guard_rule_cat_file "$cmd"
|
|
443
826
|
guard_rule_git_grep "$cmd"
|
|
827
|
+
guard_rule_pgrep_self_match "$cmd"
|
|
828
|
+
guard_rule_bare_sleep "$cmd"
|
|
829
|
+
guard_rule_git_mutation_under_producer "$cmd"
|
|
444
830
|
guard_rule_truncate_scratch "$cmd"
|
|
445
831
|
guard_rule_ro_pipeline "$cmd"
|
|
446
832
|
guard_rule_allowlist_chain "$cmd"
|