checkwright 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +687 -90
- package/lib/common/lock.sh +38 -9
- package/lib/common/profile.sh +33 -0
- package/lib/common/recipe.sh +49 -33
- package/lib/diff.sh +64 -0
- package/lib/doctor.sh +67 -42
- package/lib/init.sh +23 -31
- package/lib/uninstall.sh +212 -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 +410 -58
- package/payload/canon-kit/checks/check-amendment-queue.sh +1 -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.sh +1 -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.sh +1 -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.sh +1 -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.sh +1 -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-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/expect.txt +4 -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/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-knob-citation.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-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 +1 -0
- package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
- package/payload/context-kit/README.md +4 -1
- package/payload/context-kit/SPEC.md +143 -10
- package/payload/context-kit/bin/env-probe.sh +19 -6
- package/payload/context-kit/checks/check-brevity.sh +1 -0
- package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
- package/payload/context-kit/checks/check-memory-off.sh +1 -0
- package/payload/context-kit/checks/check-settings-paths.sh +94 -0
- package/payload/context-kit/checks/check-settings-pins.sh +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
- 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/args +1 -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/index-tests/expected/toolfloor.txt +9 -0
- package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
- package/payload/context-kit/lib/toolfloor.sh +15 -4
- package/payload/context-kit/smoke/agents-md.sh +12 -1
- package/payload/context-kit/smoke/install.sh +1 -0
- package/payload/delegation-kit/README.md +3 -3
- package/payload/delegation-kit/SPEC.md +116 -13
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -0
- package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
- package/payload/delegation-kit/templates/agent-execution.md +38 -14
- 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 +102 -9
- package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
- 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 +82 -2
- package/payload/doctrine-kit/smoke/install.sh +90 -0
- package/payload/drift-kit/SPEC.md +13 -4
- package/payload/drift-kit/bin/kfric.sh +21 -2
- package/payload/drift-kit/smoke/install.sh +28 -0
- package/payload/evidence-kit/checks/check-battery-roster.sh +1 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +1 -0
- package/payload/gate-sdk/README.md +13 -0
- package/payload/gate-sdk/SPEC.md +2611 -151
- package/payload/gate-sdk/bin/build-native.sh +38 -0
- package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
- package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
- package/payload/gate-sdk/bin/port-blockers.sh +445 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
- package/payload/gate-sdk/bin/run-gate-tests.sh +26 -5
- package/payload/gate-sdk/bin/run-gates.sh +8 -2
- package/payload/gate-sdk/bin/upgrade-smoke.sh +52 -4
- 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 +1 -0
- package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
- package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
- package/payload/gate-sdk/checks/check-core-files.sh +1 -0
- package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
- package/payload/gate-sdk/checks/check-exec-bit.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +2 -1
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-output.sh +33 -3
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +36 -5
- package/payload/gate-sdk/checks/check-graph.sh +1 -0
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
- package/payload/gate-sdk/checks/check-identity.sh +1 -0
- package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
- package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
- package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
- package/payload/gate-sdk/checks/check-readme-roster.sh +1 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +3 -2
- package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
- package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -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 +1 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
- 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-gate-assertions/good/expect.txt +1 -1
- 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 +111 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +65 -4
- 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-registration.test.sh +6 -5
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +111 -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 +135 -11
- 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 +42 -0
- package/payload/guard-kit/README.md +14 -11
- package/payload/guard-kit/SPEC.md +278 -62
- package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
- package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
- package/payload/guard-kit/guard-tests/cases.tsv +49 -7
- package/payload/guard-kit/lib/guard.sh +276 -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 +11 -1
- package/payload/lifecycle-kit/SPEC.md +441 -37
- package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +126 -10
- package/payload/lifecycle-kit/bin/file-gap.sh +27 -10
- package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -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.sh +1 -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/check-close-surfaces.test.sh +1 -2
- 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.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
- 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/rename-iteration.test.sh +142 -0
- package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
- package/payload/lifecycle-kit/lib/stages.sh +4 -0
- package/payload/lifecycle-kit/smoke/install.sh +67 -4
- package/payload/lifecycle-kit/templates/lead.md +36 -0
- package/payload/lifecycle-kit/templates/stages/close.md +30 -11
- package/payload/lifecycle-kit/templates/stages/scope.md +9 -4
- package/payload/lifecycle-kit/templates/stages/spec.md +5 -1
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
- package/payload/queue-kit/README.md +3 -1
- package/payload/queue-kit/SPEC.md +123 -3
- 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.sh +1 -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.sh +1 -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/queue-counts.test.sh +116 -0
- package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
- package/payload/queue-kit/lib/queue.sh +4 -19
- package/payload/site-kit/SPEC.md +23 -0
- package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
- package/profiles.list +36 -8
- 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-install-claim.sh +0 -146
- package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
- 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-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-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/gate-sdk/checks/check-assertion-strength.sh +0 -134
- package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
- package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
- 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/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-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/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-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-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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# guard-kit guard decision table — <expected-decision><TAB><command>.
|
|
2
|
-
# @ROOT@ is substituted with the git-sandbox root at run time
|
|
3
|
-
#
|
|
4
|
-
#
|
|
2
|
+
# @ROOT@ is substituted with the git-sandbox root at run time and @NL@ with a
|
|
3
|
+
# newline (a heredoc-bearing command is multi-line, and a cell cannot hold one).
|
|
4
|
+
# Every generic rule (guard-kit/SPEC.md §The generic ruleset) has a firing + a
|
|
5
|
+
# non-firing case. Columns are tab-separated; # and blank lines are ignored.
|
|
5
6
|
|
|
6
7
|
# rule 1 — cd in a compound command
|
|
7
8
|
block cd deploy && ls
|
|
@@ -20,22 +21,42 @@ rewrite bash @ROOT@/scripts/check-foo.sh
|
|
|
20
21
|
rewrite @ROOT@/scripts/check-env.sh --list
|
|
21
22
|
block bash @ROOT@/scripts/gen-configs.sh
|
|
22
23
|
|
|
23
|
-
# rule 5 — repo-root absolute prefix (non-script) steered; foreign path untouched
|
|
24
|
+
# rule 5 — repo-root absolute prefix (non-script) steered; foreign path untouched.
|
|
25
|
+
# The rule declares 'sq dq hd', so a path merely *named* — quoted either
|
|
26
|
+
# way, or sitting in a heredoc body — is not the executable command.
|
|
24
27
|
block python3 @ROOT@/tools/report.py
|
|
25
28
|
fallthrough python3 /other/repo/tools/report.py
|
|
29
|
+
fallthrough printf '%s' 'the path @ROOT@/tools/report.py is steered'
|
|
30
|
+
fallthrough printf '%s' "the path @ROOT@/tools/report.py is steered"
|
|
31
|
+
fallthrough cat <<'EOF' > .tmp/note.md@NL@the path @ROOT@/tools/report.py is steered@NL@EOF
|
|
26
32
|
|
|
27
|
-
# rule 6 — shell expansion / assignment; single-quoted $ stays literal
|
|
33
|
+
# rule 6 — shell expansion / assignment; single-quoted $ stays literal.
|
|
34
|
+
# 'sq' only: a double-quoted "$x" expands, and so does an
|
|
35
|
+
# unquoted-delimiter heredoc body — the stated bound on the hd class.
|
|
28
36
|
block echo $(pwd)
|
|
29
37
|
block P=/tmp/x
|
|
30
38
|
fallthrough awk '$1' data.txt
|
|
31
|
-
|
|
32
|
-
#
|
|
39
|
+
# 'hdq': an unquoted delimiter expands, so its body stays live; a quoted one
|
|
40
|
+
# cannot expand, and the shell is what guarantees that — so its body is inert
|
|
41
|
+
block cat <<EOF > .tmp/n.md@NL@value is $(date)@NL@EOF
|
|
42
|
+
fallthrough cat <<'EOF' > .tmp/n.md@NL@value is $(date)@NL@EOF
|
|
43
|
+
# reaches rule 15's advisory, which is the correct verdict for a commit -F; the
|
|
44
|
+
# point is that rule 6 no longer blocks it before rule 15 is ever consulted
|
|
45
|
+
advise git commit -F - <<'MSG'@NL@names a $(cmd) in the body@NL@MSG
|
|
46
|
+
|
|
47
|
+
# rule 7 — unquoted brace glyph: bare {} placeholder rewritten, expansions blocked.
|
|
48
|
+
# 'sq dq hd': '{' is a matcher glyph, not an expansion, so a
|
|
49
|
+
# double-quoted quantifier and a heredoc-body brace are both inert —
|
|
50
|
+
# the corrective (spell the members) is inapplicable to either.
|
|
33
51
|
rewrite find . -exec rm {} \;
|
|
34
52
|
block git log @{u}..
|
|
35
53
|
block echo {1..5}
|
|
36
54
|
block mkdir -p a/{b,c}
|
|
37
55
|
fallthrough awk '{print $1}'
|
|
38
56
|
fallthrough find . -exec grep foo '{}' +
|
|
57
|
+
allow grep -rnE "^[a-z]{2,}" src
|
|
58
|
+
fallthrough cat <<'EOF' > .tmp/note.md@NL@a brace {a,b} in prose@NL@EOF
|
|
59
|
+
block cat <<'EOF' > a/{b,c}/note.md@NL@prose@NL@EOF
|
|
39
60
|
|
|
40
61
|
# rule 8 — sed reading or rewriting a file directly; a piped-into sed is a filter
|
|
41
62
|
block sed -n '1,60p' TASK-QUEUE.md
|
|
@@ -85,6 +106,27 @@ fallthrough : > tracked.txt
|
|
|
85
106
|
# rule 13 — read-only pipeline auto-allow; a non-roster segment falls through
|
|
86
107
|
allow grep -rn foo src | head
|
|
87
108
|
fallthrough grep foo file | awk '{print}'
|
|
109
|
+
# banner tolerance (rules 9 and 10's, third caller): a literal echo/printf
|
|
110
|
+
# segment is skipped, but at least one roster read must remain
|
|
111
|
+
allow echo === | grep foo src
|
|
112
|
+
fallthrough echo a | echo b
|
|
113
|
+
# widened lead: a bare committed allow entry may lead, since it was reviewed —
|
|
114
|
+
# but only where something decorates it, so the undecorated form (rule 14's
|
|
115
|
+
# 'fallthrough git status' below) is still never intercepted here
|
|
116
|
+
allow git status | head
|
|
117
|
+
allow git status | head -20
|
|
118
|
+
block git status | awk '{print}'
|
|
119
|
+
# xargs is on the roster but executes rather than filters, so it is granted only
|
|
120
|
+
# when the command it runs is itself a roster binary. The refusing cases are the
|
|
121
|
+
# point of the discriminator: each is a write, and each is silently granted
|
|
122
|
+
# without it.
|
|
123
|
+
allow find . -type f | xargs wc -l
|
|
124
|
+
allow grep -rl foo src | xargs -n1 head -5
|
|
125
|
+
allow find . -type f -print0 | xargs -0 grep -l needle
|
|
126
|
+
fallthrough find . -type f | xargs rm -rf
|
|
127
|
+
fallthrough grep -rln foo src | xargs sed -i s/a/b/
|
|
128
|
+
block ls | xargs chmod 777
|
|
129
|
+
block ls | xargs xargs rm
|
|
88
130
|
|
|
89
131
|
# rule 14 — decorated allowlisted bare lead with an unmatched segment blocked;
|
|
90
132
|
# chaining steer, redirect steer, and the untouched non-firing cases
|
|
@@ -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/13/14/16, 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 13 and 14 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 13 and 14 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 13's predicate and rule 14'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 13'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,12 @@ 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>."
|
|
291
510
|
}
|
|
292
511
|
|
|
293
512
|
guard_rule_truncate_scratch() {
|
|
294
|
-
local cmd
|
|
513
|
+
local cmd
|
|
514
|
+
cmd="$(guard_skeleton "$1" sq dq hd)"
|
|
295
515
|
if [[ "$cmd" =~ ^[[:space:]]*:([[:space:]]+[0-9]*\>\>?[[:space:]]*[^[:space:]\&\|\;\<]+)+[[:space:]]*$ ]]; then
|
|
296
516
|
local all_ignored=1 tgt
|
|
297
517
|
while read -r tgt; do
|
|
@@ -307,10 +527,11 @@ guard_rule_truncate_scratch() {
|
|
|
307
527
|
|
|
308
528
|
guard_rule_ro_pipeline() {
|
|
309
529
|
local raw="$1"
|
|
530
|
+
# spec: guard-kit/SPEC.md §The guard framework — the raw-command carve-out these two tests take
|
|
310
531
|
grep -qE '\$\(|<\(|>\(' <<<"$raw" && return 0
|
|
311
532
|
case "$raw" in *'`'*) return 0 ;; esac
|
|
312
533
|
local s
|
|
313
|
-
s="$(
|
|
534
|
+
s="$(guard_skeleton "$raw" sq dq hd)"
|
|
314
535
|
grep -q "['\"]" <<<"$s" && return 0
|
|
315
536
|
grep -qE '(&&|\|\||;|&)' <<<"$s" && return 0
|
|
316
537
|
local tgt
|
|
@@ -320,47 +541,49 @@ guard_rule_ro_pipeline() {
|
|
|
320
541
|
/dev/null | '&'[0-9]*) ;;
|
|
321
542
|
*) return 0 ;;
|
|
322
543
|
esac
|
|
323
|
-
done < <(grep -oE '[0-9]*>>?[[:space:]]*[^[:space:]
|
|
544
|
+
done < <(grep -oE '[0-9]*>>?[[:space:]]*[^[:space:]|;&]+' <<<"$s" \
|
|
324
545
|
| sed -E 's/^[0-9]*>>?[[:space:]]*//')
|
|
325
546
|
if grep -qE '(^|[[:space:]])find([[:space:]]|$)' <<<"$s" \
|
|
326
547
|
&& grep -qE '\-(exec|execdir|ok|delete)\b' <<<"$s"; then
|
|
327
548
|
return 0
|
|
328
549
|
fi
|
|
329
|
-
local
|
|
330
|
-
|
|
550
|
+
local -a segs
|
|
551
|
+
mapfile -t segs < <(guard_split_compound "$s")
|
|
552
|
+
local seg first b i matched reads=0
|
|
553
|
+
for ((i = 0; i < ${#segs[@]}; i++)); do
|
|
554
|
+
seg="${segs[i]}"
|
|
331
555
|
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
332
556
|
[[ -z "$seg" ]] && continue
|
|
557
|
+
_guard_is_banner "$seg" && continue
|
|
333
558
|
first="${seg%%[[:space:]]*}"
|
|
559
|
+
[[ "$first" == xargs ]] && { _guard_is_ro_xargs "$seg" || return 0; }
|
|
334
560
|
matched=0
|
|
335
561
|
for b in "${GUARD_KIT_RO_BINS[@]}"; do
|
|
336
562
|
[[ "$first" == "$b" ]] && { matched=1; break; }
|
|
337
563
|
done
|
|
338
|
-
[[ "$matched" ==
|
|
339
|
-
|
|
564
|
+
if [[ "$matched" == 0 ]]; then
|
|
565
|
+
# spec: guard-kit/SPEC.md §The generic ruleset — rule 13's widened lead: a bare
|
|
566
|
+
# committed allow entry qualifies, but only where something decorates it
|
|
567
|
+
[[ "$i" == 0 && "${#segs[@]}" -gt 1 ]] || return 0
|
|
568
|
+
_guard_is_bare_allow "$seg" || return 0
|
|
569
|
+
fi
|
|
570
|
+
reads=$((reads + 1))
|
|
571
|
+
done
|
|
572
|
+
[[ "$reads" -ge 1 ]] || return 0
|
|
340
573
|
guard_allow "read-only search pipeline (${GUARD_NAME:-guard} auto-allow)"
|
|
341
574
|
}
|
|
342
575
|
|
|
343
576
|
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
|
|
577
|
+
local cmd="$1" inner
|
|
578
|
+
local -a bare_leads=() pattern_inners=()
|
|
579
|
+
while IFS= read -r inner; do
|
|
357
580
|
pattern_inners+=("$inner")
|
|
358
581
|
case "$inner" in *'*'*) ;; *) bare_leads+=("$inner") ;; esac
|
|
359
|
-
done
|
|
582
|
+
done < <(_guard_allow_inners)
|
|
360
583
|
[[ ${#bare_leads[@]} -gt 0 ]] || return 0
|
|
361
584
|
|
|
362
585
|
local skel
|
|
363
|
-
skel="$(
|
|
586
|
+
skel="$(guard_skeleton "$cmd" sq dq hd)"
|
|
364
587
|
|
|
365
588
|
local -a segs
|
|
366
589
|
mapfile -t segs < <(guard_split_compound "$skel")
|
|
@@ -369,8 +592,7 @@ guard_rule_allowlist_chain() {
|
|
|
369
592
|
lead="${lead#"${lead%%[![:space:]]*}"}"; lead="${lead%"${lead##*[![:space:]]}"}"
|
|
370
593
|
|
|
371
594
|
local lead_core
|
|
372
|
-
lead_core="$(
|
|
373
|
-
lead_core="${lead_core#"${lead_core%%[![:space:]]*}"}"; lead_core="${lead_core%"${lead_core##*[![:space:]]}"}"
|
|
595
|
+
lead_core="$(_guard_segment_core "$lead")"
|
|
374
596
|
|
|
375
597
|
local bl matched_lead=0
|
|
376
598
|
for bl in "${bare_leads[@]}"; do
|
|
@@ -378,7 +600,7 @@ guard_rule_allowlist_chain() {
|
|
|
378
600
|
done
|
|
379
601
|
[[ "$matched_lead" == 1 ]] || return 0
|
|
380
602
|
|
|
381
|
-
local steer="run '$lead_core' bare — it's a statically allowlisted command, but the decoration (chaining or a redirect)
|
|
603
|
+
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
604
|
|
|
383
605
|
[[ "$lead" != "$lead_core" ]] && guard_block "$steer"
|
|
384
606
|
|
|
@@ -400,7 +622,7 @@ guard_rule_allowlist_chain() {
|
|
|
400
622
|
|
|
401
623
|
guard_rule_git_rewrite() {
|
|
402
624
|
local cmd="$1" s
|
|
403
|
-
s="$(
|
|
625
|
+
s="$(guard_skeleton "$cmd" sq dq hd)"
|
|
404
626
|
if { grep -qE '(^|[[:space:]])git[[:space:]]+commit([[:space:]]|$)' <<<"$s" \
|
|
405
627
|
&& grep -qE '(^|[[:space:]])(-F|--file|--amend)\b' <<<"$s"; } \
|
|
406
628
|
|| { grep -qE '(^|[[:space:]])git[[:space:]]+reset([[:space:]]|$)' <<<"$s" \
|
|
@@ -413,7 +635,7 @@ guard_rule_rm_tracked() {
|
|
|
413
635
|
local raw="$1" s
|
|
414
636
|
grep -qE '\$\(|<\(|>\(|\$\{|\$[A-Za-z_]' <<<"$raw" && return 0
|
|
415
637
|
case "$raw" in *'`'*) return 0 ;; esac
|
|
416
|
-
s="$(
|
|
638
|
+
s="$(guard_skeleton "$raw" sq dq hd)"
|
|
417
639
|
local seg lead arg
|
|
418
640
|
while IFS= read -r seg; do
|
|
419
641
|
seg="${seg#"${seg%%[![:space:]]*}"}"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
permission-friction loop a habit, not a one-off cleanup. Splice this in place
|
|
3
3
|
of lifecycle-kit's `tooling-friction triage` placeholder (close skill, step 2).
|
|
4
4
|
|
|
5
|
-
1. **Rank what
|
|
5
|
+
1. **Rank what nothing granted.** Run `bash guard-kit/bin/scan-prompts.sh` — it
|
|
6
6
|
filters the friction log against the committed allowlist and the harness's
|
|
7
7
|
built-in read-only auto-allows, then ranks the survivors by command pattern.
|
|
8
8
|
2. **Resolve each recurring pattern by the triage criterion** — never default
|
|
@@ -16,8 +16,8 @@ of lifecycle-kit's `tooling-friction triage` placeholder (close skill, step 2).
|
|
|
16
16
|
blessing a form, confirm it is the one to reinforce.
|
|
17
17
|
**Diagnose before you reach for the allowlist.** A pattern can rank high while
|
|
18
18
|
already being granted: an allowlist entry matches a *bare* command, so a call
|
|
19
|
-
that chains (`&&`, `;`), redirects, or expands breaks the match and
|
|
20
|
-
anyway. Check a ranked pattern against the committed allowlist first — if it is
|
|
19
|
+
that chains (`&&`, `;`), redirects, or expands breaks the match and is decided
|
|
20
|
+
out of band anyway. Check a ranked pattern against the committed allowlist first — if it is
|
|
21
21
|
already there, the finding is (c) habit change, and adding coverage buys
|
|
22
22
|
nothing while reading as a fix.
|
|
23
23
|
3. **Review the wakeup log** if the wakeup-guard is wired: read
|
|
@@ -51,8 +51,8 @@ of lifecycle-kit's `tooling-friction triage` placeholder (close skill, step 2).
|
|
|
51
51
|
5. **Clear the friction log** — its named reclaim path:
|
|
52
52
|
`: > .workflow/prompt-friction.log`. Run each clear as its own bare command:
|
|
53
53
|
the allowlist entry is an exact string, so compounding it (`&&`, `;`, a
|
|
54
|
-
trailing `echo`/`wc`) breaks the match and
|
|
55
|
-
just triaged away.
|
|
54
|
+
trailing `echo`/`wc`) breaks the match and buys the very out-of-band decision
|
|
55
|
+
this step just triaged away.
|
|
56
56
|
|
|
57
57
|
Goal: the local set stays small, every durable pattern lives in the
|
|
58
58
|
committed, reviewable allowlist, and no local glob auto-allows a command you
|