checkwright 0.23.0 → 0.25.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 +175 -13
- package/lib/common/lock.sh +7 -0
- package/lib/common/recipe.sh +1 -1
- package/lib/diff.sh +2 -0
- package/lib/init.sh +40 -16
- package/lib/uninstall.sh +2 -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 +2 -0
- package/payload/canon-kit/SPEC.md +454 -28
- package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
- package/payload/canon-kit/checks/check-amendment-update-target.gate +3 -0
- package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
- package/payload/canon-kit/checks/check-unmarked-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-amendment-update-target/bad/SPEC-thing.md +26 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/expect.txt +8 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +47 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +82 -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 +1 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
- package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
- 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-unmarked-claim/bad/SPEC.md +11 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +18 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +85 -0
- package/payload/canon-kit/lib/spec.sh +16 -0
- package/payload/canon-kit/smoke/install.sh +3 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +17 -2
- package/payload/context-kit/README.md +6 -4
- package/payload/context-kit/SPEC.md +256 -76
- package/payload/context-kit/bin/always-loaded.sh +5 -21
- package/payload/context-kit/bin/env-probe.sh +2 -17
- 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-pins.test.sh +70 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +5 -5
- package/payload/context-kit/index-tests/toolfloor-cases.sh +5 -5
- package/payload/context-kit/lib/context.sh +56 -0
- package/payload/context-kit/lib/toolfloor.sh +1 -1
- package/payload/context-kit/smoke/agents-md.sh +16 -4
- package/payload/context-kit/smoke/install.sh +3 -2
- package/payload/context-kit/templates/session-context.sh +5 -5
- package/payload/delegation-kit/README.md +11 -1
- package/payload/delegation-kit/SPEC.md +652 -11
- package/payload/delegation-kit/bin/wait-probe.sh +184 -0
- 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/gate-tests/subagent-stop-liveness.test.sh +99 -0
- package/payload/delegation-kit/smoke/install.sh +21 -1
- package/payload/delegation-kit/templates/agent-execution.md +88 -4
- package/payload/delegation-kit/templates/subagent-stop-liveness.sh +56 -0
- package/payload/doctrine-kit/SPEC.md +1 -1
- package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -3
- package/payload/doctrine-kit/smoke/install.sh +17 -4
- package/payload/drift-kit/README.md +2 -2
- package/payload/drift-kit/SPEC.md +71 -7
- 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 +21 -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 +42 -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 +17 -9
- package/payload/gate-sdk/SPEC.md +4680 -295
- package/payload/gate-sdk/bin/build-native.sh +66 -1
- package/payload/gate-sdk/bin/install-hooks.sh +14 -2
- package/payload/gate-sdk/bin/port-blockers.sh +37 -9
- package/payload/gate-sdk/bin/run-gate-tests.sh +1 -2
- package/payload/gate-sdk/bin/run-gates.sh +137 -13
- package/payload/gate-sdk/bin/upgrade-smoke.sh +21 -16
- package/payload/gate-sdk/checks/check-action-run-shell.sh +2 -1
- 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 +1 -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.gate +3 -0
- 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 +132 -15
- 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 +1 -0
- package/payload/gate-sdk/checks/check-kit-enum.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 +1 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-tree-terms.gate +3 -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-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/bad/expect.txt +5 -1
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +22 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-count.sh +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-extra.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-zero.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +27 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-qux.sh +13 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +117 -0
- 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.test.sh +4 -5
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +9 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kit-spec.md +6 -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-nospec.sh +4 -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/check-ungrounded.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +6 -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/kit-spec.md +12 -0
- 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 +5 -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 +49 -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-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-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-tree-terms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/multi.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/second-leak.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/worktrees/vendored-note.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +94 -0
- 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 +94 -1
- package/payload/gate-sdk/lib/gate.sh +232 -25
- package/payload/gate-sdk/smoke/install.sh +28 -1
- package/payload/guard-kit/README.md +4 -3
- package/payload/guard-kit/SPEC.md +578 -47
- package/payload/guard-kit/bin/compare-settings-allow.sh +36 -12
- package/payload/guard-kit/bin/run-guard-tests.sh +27 -4
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +46 -1
- package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
- package/payload/guard-kit/guard-tests/background-cases.tsv +14 -0
- package/payload/guard-kit/guard-tests/cases.tsv +67 -9
- package/payload/guard-kit/lib/guard.sh +361 -18
- package/payload/guard-kit/templates/bash-guard.sh +2 -0
- package/payload/guard-kit/templates/close-triage.md +10 -3
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/lifecycle-kit/README.md +3 -2
- package/payload/lifecycle-kit/SPEC.md +509 -77
- package/payload/lifecycle-kit/bin/enter-stage.sh +72 -33
- package/payload/lifecycle-kit/bin/file-gap.sh +2 -2
- package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.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 +1 -1
- 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 +22 -22
- 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 +120 -10
- package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +11 -11
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
- package/payload/lifecycle-kit/lib/stages.sh +5 -0
- package/payload/lifecycle-kit/smoke/install.sh +29 -15
- package/payload/lifecycle-kit/templates/lead.md +32 -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 +20 -6
- package/payload/lifecycle-kit/templates/stages/scope.md +20 -1
- package/payload/lifecycle-kit/templates/stages/spec.md +1 -1
- package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +1 -1
- package/payload/queue-kit/README.md +10 -10
- package/payload/queue-kit/SPEC.md +379 -84
- package/payload/queue-kit/bin/queue-counts.sh +1 -1
- package/payload/queue-kit/checks/check-queue-entry-budget.gate +1 -1
- package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.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 +1 -1
- package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
- package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
- package/payload/queue-kit/lib/queue.sh +0 -49
- package/payload/queue-kit/smoke/install.sh +1 -1
- package/payload/site-kit/SPEC.md +41 -2
- package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -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/payload/canon-kit/checks/check-amendment-queue.sh +0 -117
- package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -79
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -240
- package/payload/canon-kit/checks/check-prose-tells.sh +0 -208
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -134
- package/payload/context-kit/bin/footprint.sh +0 -144
- package/payload/context-kit/checks/check-brevity.sh +0 -124
- package/payload/context-kit/checks/check-footprint-fresh.sh +0 -39
- package/payload/context-kit/checks/check-memory-off.sh +0 -113
- package/payload/context-kit/checks/check-settings-paths.sh +0 -94
- package/payload/context-kit/checks/check-settings-pins.sh +0 -111
- package/payload/context-kit/gate-tests/check-memory-off/bad/args +0 -1
- package/payload/context-kit/gate-tests/check-memory-off/good/args +0 -1
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -62
- package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -140
- package/payload/delegation-kit/checks/check-rule-citation.sh +0 -77
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -246
- package/payload/drift-kit/bin/trajectory.sh +0 -242
- package/payload/evidence-kit/checks/check-battery-roster.sh +0 -87
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -104
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -105
- 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 -273
- package/payload/gate-sdk/checks/check-commit-msg.sh +0 -51
- package/payload/gate-sdk/checks/check-commit-subject.sh +0 -44
- package/payload/gate-sdk/checks/check-core-files.sh +0 -76
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -38
- package/payload/gate-sdk/checks/check-exec-bit.sh +0 -96
- package/payload/gate-sdk/checks/check-gate-assertions.sh +0 -148
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -107
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -106
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -85
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -93
- package/payload/gate-sdk/checks/check-gate-output.sh +0 -103
- package/payload/gate-sdk/checks/check-graph.sh +0 -632
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -46
- package/payload/gate-sdk/checks/check-identity.sh +0 -135
- package/payload/gate-sdk/checks/check-kit-enum.sh +0 -95
- package/payload/gate-sdk/checks/check-readme-roster.sh +0 -108
- package/payload/gate-sdk/checks/check-reads-couples.sh +0 -200
- package/payload/gate-sdk/checks/check-root-tiering.sh +0 -67
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -127
- package/payload/gate-sdk/checks/check-tree-terms.sh +0 -66
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -85
- 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 -64
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -198
- 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-prose-precondition.sh +0 -64
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -111
- package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -81
- /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
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — the kit→surface→class map emitted from the class registries; the emitted page owns the enforcement-class taxonomy
|
|
3
|
-
# usage: enforcement-map.sh [--emit]
|
|
4
|
-
# bare: an advisory header plus the page; --emit: the page only, for the committed docs/enforcement.md projection.
|
|
5
|
-
# advisory by construction: never joins gates.list; a healthy run exits 0 whatever registries are absent, a set-but-missing registry knob exits 2 fail-closed before any stdout; the freshness gate (check-enforcement-fresh) blocks a stale emission.
|
|
6
|
-
set -uo pipefail
|
|
7
|
-
|
|
8
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
9
|
-
# shellcheck source=../lib/gate.sh
|
|
10
|
-
source "$SDK/lib/gate.sh"
|
|
11
|
-
|
|
12
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — every registry defaults to this repo's layout and reads through the owning kit's knob, so a consumer relocates each surface without touching the emitter; the := expansion erases set-ness, so each knob's explicit value is captured first (adopted-but-broken refuses where not-adopted degrades)
|
|
13
|
-
GATES_DIR="$(gate_sdk_gates_dir)"
|
|
14
|
-
LIST="$GATES_DIR/gates.list"
|
|
15
|
-
set_kpis="${DRIFT_KIT_KPIS_FILE:-}"
|
|
16
|
-
set_settings="${CONTEXT_KIT_SETTINGS_FILE:-}"
|
|
17
|
-
set_evidence="${EVIDENCE_KIT_CONFIG_FILE:-}"
|
|
18
|
-
set_scan="${GATE_SDK_ENFORCE_SCAN_DIR:-}"
|
|
19
|
-
: "${DRIFT_KIT_KPIS_FILE:=$GATES_DIR/kpis.list}"
|
|
20
|
-
: "${CONTEXT_KIT_SETTINGS_FILE:=.claude/settings.json}"
|
|
21
|
-
: "${EVIDENCE_KIT_CONFIG_FILE:=$GATES_DIR/evidence-config.sh}"
|
|
22
|
-
: "${GATE_SDK_ENFORCE_SCAN_DIR:=.}"
|
|
23
|
-
|
|
24
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — check-before-emit: every explicitly set registry knob is verified before the first stdout byte in both modes, stderr naming the knob and exit 2 on a missing path (for the settings knob, also a set file jq refuses to parse; jq absence is a toolchain gap and keeps degrading), so a misconfigured --emit regen leaves an empty projection and a nonzero exit, never a plausible partial page
|
|
25
|
-
preflight_knobs() {
|
|
26
|
-
local bad=0
|
|
27
|
-
[[ -n "$set_kpis" && ! -f "$DRIFT_KIT_KPIS_FILE" ]] &&
|
|
28
|
-
{ echo "enforcement-map: DRIFT_KIT_KPIS_FILE not found: $DRIFT_KIT_KPIS_FILE" >&2; bad=1; }
|
|
29
|
-
[[ -n "$set_evidence" && ! -f "$EVIDENCE_KIT_CONFIG_FILE" ]] &&
|
|
30
|
-
{ echo "enforcement-map: EVIDENCE_KIT_CONFIG_FILE not found: $EVIDENCE_KIT_CONFIG_FILE" >&2; bad=1; }
|
|
31
|
-
[[ -n "$set_scan" && ! -d "$GATE_SDK_ENFORCE_SCAN_DIR" ]] &&
|
|
32
|
-
{ echo "enforcement-map: GATE_SDK_ENFORCE_SCAN_DIR not found: $GATE_SDK_ENFORCE_SCAN_DIR" >&2; bad=1; }
|
|
33
|
-
if [[ -n "$set_settings" ]]; then
|
|
34
|
-
if [[ ! -f "$CONTEXT_KIT_SETTINGS_FILE" ]]; then
|
|
35
|
-
echo "enforcement-map: CONTEXT_KIT_SETTINGS_FILE not found: $CONTEXT_KIT_SETTINGS_FILE" >&2; bad=1
|
|
36
|
-
elif command -v jq >/dev/null 2>&1 && ! jq -e . "$CONTEXT_KIT_SETTINGS_FILE" >/dev/null 2>&1; then
|
|
37
|
-
echo "enforcement-map: CONTEXT_KIT_SETTINGS_FILE unparseable: $CONTEXT_KIT_SETTINGS_FILE" >&2; bad=1
|
|
38
|
-
fi
|
|
39
|
-
fi
|
|
40
|
-
return "$bad"
|
|
41
|
-
}
|
|
42
|
-
# spec: canon-kit/SPEC.md §check-md-refs — the reference-link ref knob (owned by canon-kit); the page's owner-section citations pin to the same ref check-md-refs' self-repo pass validates, so a link the emitter writes is a link the blocker resolves
|
|
43
|
-
: "${CANON_KIT_DOCS_BLOB_REF:=master}"
|
|
44
|
-
SELF_REPO_PREFIX="$(gate_self_repo_prefix "$CANON_KIT_DOCS_BLOB_REF")"
|
|
45
|
-
|
|
46
|
-
emit=0
|
|
47
|
-
[[ "${1:-}" == "--emit" ]] && emit=1
|
|
48
|
-
|
|
49
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — attribute a path to its owning kit label by the first kit segment (paths arrive absolute from gate_kit_roots or relative from a hook command); a surface under no kit groups as (consumer)
|
|
50
|
-
attribute_kit() {
|
|
51
|
-
local seg
|
|
52
|
-
local IFS=/
|
|
53
|
-
local -a segs
|
|
54
|
-
read -ra segs <<< "${1#./}"
|
|
55
|
-
for seg in "${segs[@]}"; do
|
|
56
|
-
case "$seg" in
|
|
57
|
-
gate-sdk|*-kit) printf '%s\n' "$seg"; return 0 ;;
|
|
58
|
-
esac
|
|
59
|
-
done
|
|
60
|
-
printf '%s\n' "(consumer)"
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — the first slash-bearing token of a hook/suite command is the enforcing script, whose dir attributes the row
|
|
64
|
-
command_path() {
|
|
65
|
-
local tok
|
|
66
|
-
for tok in $1; do
|
|
67
|
-
[[ "$tok" == */* ]] && { printf '%s\n' "$tok"; return 0; }
|
|
68
|
-
done
|
|
69
|
-
printf '%s\n' "$1"
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — the kit column links each kit's docs page (`<kit>/index.md`, relative to the emitted page under the docs root); the (consumer) group owns no kit page and stays plain text
|
|
73
|
-
kit_cell() {
|
|
74
|
-
case "$1" in
|
|
75
|
-
'(consumer)') printf '%s' "$1" ;;
|
|
76
|
-
*) printf '[%s](%s/index.md)' "$1" "$1" ;;
|
|
77
|
-
esac
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — cite a class's owner section through the reference-link grammar (canon-kit/SPEC.md §The reference-link grammar): a self-repo blob link when the identity is known and the SPEC is git-tracked, degrading to the bare `<path> §<title>` when a consumer has not vendored that kit or a clone has no origin
|
|
81
|
-
owner_ref() { # $1=path $2=anchor $3=section-title
|
|
82
|
-
if [[ -n "$SELF_REPO_PREFIX" ]] && git ls-files --error-unmatch -- "$1" >/dev/null 2>&1; then
|
|
83
|
-
printf '[`%s` §%s](%s%s#%s)' "$1" "$3" "$SELF_REPO_PREFIX" "$1" "$2"
|
|
84
|
-
else
|
|
85
|
-
printf '`%s` §%s' "$1" "$3"
|
|
86
|
-
fi
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
mapfile -t CHECK_DIRS < <(gate_check_dirs)
|
|
90
|
-
mapfile -t KIT_ROOTS < <(gate_kit_roots)
|
|
91
|
-
|
|
92
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — Blocking gates: gates.list membership, tier read from each gate's `# graph:` line, kit from the resolution dir; grouped by tier (precommit, commit-msg, align-only), gates.list order within a tier
|
|
93
|
-
gate_rows() {
|
|
94
|
-
[[ -f "$LIST" ]] || return 0
|
|
95
|
-
local -a pre=() msg=() align=()
|
|
96
|
-
local c src tier kit row
|
|
97
|
-
while IFS= read -r c; do
|
|
98
|
-
src="$(gate_resolve "$c" "${CHECK_DIRS[@]}" 2>/dev/null || true)"
|
|
99
|
-
[[ -n "$src" ]] || continue
|
|
100
|
-
tier="$(sed -n 's/^# graph:.*[[:space:]]tier=\([a-z-]*\).*/\1/p' "$src" | head -1)"
|
|
101
|
-
[[ -n "$tier" ]] || tier="?"
|
|
102
|
-
kit="$(attribute_kit "$src")"
|
|
103
|
-
row="| $(kit_cell "$kit") | $c | $tier |"
|
|
104
|
-
case "$tier" in
|
|
105
|
-
precommit) pre+=("$row") ;;
|
|
106
|
-
commit-msg) msg+=("$row") ;;
|
|
107
|
-
*) align+=("$row") ;;
|
|
108
|
-
esac
|
|
109
|
-
done < <(gates_list_members "$LIST")
|
|
110
|
-
[[ ${#pre[@]} -eq 0 && ${#msg[@]} -eq 0 && ${#align[@]} -eq 0 ]] && return 0
|
|
111
|
-
printf '## Blocking gates\n\n'
|
|
112
|
-
printf '| kit | gate | tier |\n| --- | --- | --- |\n'
|
|
113
|
-
printf '%s\n' "${pre[@]+"${pre[@]}"}" "${msg[@]+"${msg[@]}"}" "${align[@]+"${align[@]}"}"
|
|
114
|
-
printf '\n'
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — Advisory KPIs: the drift-kit KPI registry, kit from where each plugin resolves (scripts/ then each kit's kpis/)
|
|
118
|
-
kpi_rows() {
|
|
119
|
-
[[ -f "$DRIFT_KIT_KPIS_FILE" ]] || return 0
|
|
120
|
-
local -a rows=()
|
|
121
|
-
local name src d
|
|
122
|
-
while IFS= read -r name; do
|
|
123
|
-
src=""
|
|
124
|
-
[[ -f "$GATES_DIR/$name.sh" ]] && src="$GATES_DIR/$name.sh"
|
|
125
|
-
if [[ -z "$src" ]]; then
|
|
126
|
-
for d in "${KIT_ROOTS[@]}"; do
|
|
127
|
-
[[ -f "$d/kpis/$name.sh" ]] && { src="$d/kpis/$name.sh"; break; }
|
|
128
|
-
done
|
|
129
|
-
fi
|
|
130
|
-
[[ -n "$src" ]] || src="$GATES_DIR/$name.sh"
|
|
131
|
-
rows+=("| $(kit_cell "$(attribute_kit "$src")") | $name |")
|
|
132
|
-
done < <(gates_list_members "$DRIFT_KIT_KPIS_FILE")
|
|
133
|
-
[[ ${#rows[@]} -eq 0 ]] && return 0
|
|
134
|
-
printf '## Advisory KPIs\n\n'
|
|
135
|
-
printf '| kit | KPI |\n| --- | --- |\n'
|
|
136
|
-
printf '%s\n' "${rows[@]}"
|
|
137
|
-
printf '\n'
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — Guards and Session warnings: PreToolUse / SessionStart command hooks in the tracked harness settings file, kit from the enforcing script's dir
|
|
141
|
-
hook_rows() {
|
|
142
|
-
local kind="$1" jqpath="$2"
|
|
143
|
-
command -v jq >/dev/null 2>&1 || return 0
|
|
144
|
-
[[ -f "$CONTEXT_KIT_SETTINGS_FILE" ]] || return 0
|
|
145
|
-
jq -e . "$CONTEXT_KIT_SETTINGS_FILE" >/dev/null 2>&1 || return 0
|
|
146
|
-
local -a rows=()
|
|
147
|
-
local line cmd matcher path
|
|
148
|
-
while IFS=$'\t' read -r cmd matcher; do
|
|
149
|
-
[[ -n "$cmd" ]] || continue
|
|
150
|
-
path="$(command_path "$cmd")"
|
|
151
|
-
if [[ "$kind" == guard ]]; then
|
|
152
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — an alternation matcher is the harness's own spelling, and a bare '|' inside a cell opens a fourth column: escape it so the emitted row survives the rendered page as one row of three
|
|
153
|
-
rows+=("| $(kit_cell "$(attribute_kit "$path")") | $path | ${matcher//|/\\|} |")
|
|
154
|
-
else
|
|
155
|
-
rows+=("| $(kit_cell "$(attribute_kit "$path")") | $path |")
|
|
156
|
-
fi
|
|
157
|
-
done < <(jq -r "$jqpath" "$CONTEXT_KIT_SETTINGS_FILE" 2>/dev/null)
|
|
158
|
-
[[ ${#rows[@]} -eq 0 ]] && return 0
|
|
159
|
-
if [[ "$kind" == guard ]]; then
|
|
160
|
-
printf '## Guards\n\n'
|
|
161
|
-
printf '| kit | surface | intercepts |\n| --- | --- | --- |\n'
|
|
162
|
-
else
|
|
163
|
-
printf '## Session warnings\n\n'
|
|
164
|
-
printf '| kit | surface |\n| --- | --- |\n'
|
|
165
|
-
fi
|
|
166
|
-
printf '%s\n' "${rows[@]}"
|
|
167
|
-
printf '\n'
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — Validate suites: evidence-kit's suite registry (the config's suite list + per-suite run command), kit from the run command's script
|
|
171
|
-
suite_rows() {
|
|
172
|
-
[[ -f "$EVIDENCE_KIT_CONFIG_FILE" ]] || return 0
|
|
173
|
-
local -a suites=()
|
|
174
|
-
local cmd var
|
|
175
|
-
# shellcheck disable=SC1090 # consumer-supplied evidence config, path is config
|
|
176
|
-
source "$EVIDENCE_KIT_CONFIG_FILE"
|
|
177
|
-
declare -p EVIDENCE_KIT_SUITES &>/dev/null || return 0
|
|
178
|
-
suites=("${EVIDENCE_KIT_SUITES[@]}")
|
|
179
|
-
[[ ${#suites[@]} -eq 0 ]] && return 0
|
|
180
|
-
printf '## Validate suites\n\n'
|
|
181
|
-
printf '| kit | suite |\n| --- | --- |\n'
|
|
182
|
-
local s
|
|
183
|
-
for s in "${suites[@]}"; do
|
|
184
|
-
var="EVIDENCE_KIT_RUN_$s"
|
|
185
|
-
cmd="${!var-}"
|
|
186
|
-
printf '| %s | %s |\n' "$(kit_cell "$(attribute_kit "$(command_path "$cmd")")")" "$s"
|
|
187
|
-
done
|
|
188
|
-
printf '\n'
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — Monitors: the one class with no parseable registry, so a non-gate surface declares itself with a line-start `# enforce: class=monitor <free-text>` marker the emitter greps; a marker is dormant in a template/fixture (an inert copy-source) and activates only where a consumer copies the file into a live path, so the walk prunes templates/ (grep -v, the sibling-finder idiom) atop the gate-tests exclusion GATE_GREP_EXCLUDES already carries; sorted for a stable projection
|
|
192
|
-
monitor_rows() {
|
|
193
|
-
local -a rows=()
|
|
194
|
-
local line file rest surface
|
|
195
|
-
while IFS= read -r line; do
|
|
196
|
-
[[ -n "$line" ]] || continue
|
|
197
|
-
file="${line%%:*}"; rest="${line#*:}"; rest="${rest#*:}"
|
|
198
|
-
surface="$(printf '%s' "$rest" | sed -E 's/^[[:space:]]*#[[:space:]]*enforce:[[:space:]]+class=monitor[[:space:]]+//; s/[[:space:]]+$//')"
|
|
199
|
-
rows+=("| $(kit_cell "$(attribute_kit "$file")") | $surface |")
|
|
200
|
-
done < <(grep -rHnI "${GATE_GREP_EXCLUDES[@]}" -E '^[[:space:]]*#[[:space:]]*enforce:[[:space:]]+class=monitor[[:space:]]' "$GATE_SDK_ENFORCE_SCAN_DIR" 2>/dev/null | grep -v '/templates/' | sort)
|
|
201
|
-
[[ ${#rows[@]} -eq 0 ]] && return 0
|
|
202
|
-
printf '## Monitors\n\n'
|
|
203
|
-
printf '| kit | surface |\n| --- | --- |\n'
|
|
204
|
-
printf '%s\n' "${rows[@]}"
|
|
205
|
-
printf '\n'
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
# spec: gate-sdk/SPEC.md §enforcement-map — the enforcement-class taxonomy, ordered hardest to softest; this page owns the prose and each class cites its mechanism owner through the reference-link grammar
|
|
209
|
-
class_roster() {
|
|
210
|
-
local gate kpi guard warn suite monitor
|
|
211
|
-
gate="$(owner_ref gate-sdk/SPEC.md enforcement-tiers 'Enforcement tiers')"
|
|
212
|
-
kpi="$(owner_ref drift-kit/SPEC.md the-kpi-plugin-contract 'The KPI plugin contract')"
|
|
213
|
-
guard="$(owner_ref guard-kit/SPEC.md the-guard-framework-libguardsh 'The guard framework')"
|
|
214
|
-
warn="$(owner_ref context-kit/SPEC.md the-session-context-hook-template 'The session-context hook')"
|
|
215
|
-
suite="$(owner_ref evidence-kit/SPEC.md baseline-manifest 'Baseline manifest')"
|
|
216
|
-
monitor="$(owner_ref site-kit/SPEC.md the-monitor-boundary 'The monitor boundary')"
|
|
217
|
-
cat <<CLASSES
|
|
218
|
-
- A **blocking gate** fails the commit (or, at the \`align-only\` tier, the
|
|
219
|
-
consistency audit) — the pre-commit hook is its local reach, the CI workflow
|
|
220
|
-
its server-side backstop. Owner: $gate.
|
|
221
|
-
- An **advisory KPI** never blocks; it reports a drift trend into the
|
|
222
|
-
session-context line. Owner: $kpi.
|
|
223
|
-
- A **guard** intercepts a tool call before it runs. Owner: $guard.
|
|
224
|
-
- A **session warning** surfaces context when a session opens. Owner: $warn.
|
|
225
|
-
- A **validate suite** holds a test baseline that a per-run evidence manifest
|
|
226
|
-
attests. Owner: $suite.
|
|
227
|
-
- A **monitor** watches deployment truth rather than tree truth, so it reds a
|
|
228
|
-
scheduled run, never a merge. Owner: $monitor.
|
|
229
|
-
CLASSES
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
emit_page() {
|
|
233
|
-
cat <<'PREAMBLE'
|
|
234
|
-
---
|
|
235
|
-
title: Enforcement map
|
|
236
|
-
nav_parent: value
|
|
237
|
-
nav_child_order: 1
|
|
238
|
-
---
|
|
239
|
-
# Enforcement map
|
|
240
|
-
|
|
241
|
-
_Generated by `bash gate-sdk/bin/enforcement-map.sh --emit`; do not hand-edit —
|
|
242
|
-
`check-enforcement-fresh` byte-compares this page against the emitter._
|
|
243
|
-
|
|
244
|
-
Every governed surface in this repo is held by one enforcement class, ordered
|
|
245
|
-
here from hardest to softest:
|
|
246
|
-
|
|
247
|
-
PREAMBLE
|
|
248
|
-
class_roster
|
|
249
|
-
cat <<'PREAMBLE'
|
|
250
|
-
|
|
251
|
-
The rows below derive from the class registries — the gate registry, the KPI
|
|
252
|
-
registry, the harness settings hooks, the evidence-suite config, and the
|
|
253
|
-
`# enforce:` markers a non-gate surface declares itself with — so this map
|
|
254
|
-
cannot drift from what actually runs. A registry a consumer has not adopted
|
|
255
|
-
leaves its section absent.
|
|
256
|
-
|
|
257
|
-
PREAMBLE
|
|
258
|
-
gate_rows
|
|
259
|
-
kpi_rows
|
|
260
|
-
hook_rows guard '.hooks.PreToolUse // [] | .[] | (.matcher // "*") as $m | (.hooks // [])[] | select(.type == "command") | "\(.command)\t\($m)"'
|
|
261
|
-
hook_rows warning '.hooks.SessionStart // [] | .[] | (.hooks // [])[] | select(.type == "command") | "\(.command)\t"'
|
|
262
|
-
suite_rows
|
|
263
|
-
monitor_rows
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
preflight_knobs || exit 2
|
|
267
|
-
|
|
268
|
-
if [[ "$emit" -eq 0 ]]; then
|
|
269
|
-
echo "=== Enforcement map (advisory — regenerate the committed page with --emit) ==="
|
|
270
|
-
echo
|
|
271
|
-
fi
|
|
272
|
-
emit_page
|
|
273
|
-
exit 0
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=scripts/msg-patterns.list dir=one valve=none tier=commit-msg
|
|
3
|
-
# install: zero-config
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-commit-msg — the commit message matches no banned pattern (the leak guard for the message surface the pre-commit hook never sees)
|
|
5
|
-
#
|
|
6
|
-
# usage: check-commit-msg.sh <message-file> [pattern-file...]
|
|
7
|
-
# message-file: the commit-msg hook's $1. pattern-file args (grep -E, one per
|
|
8
|
-
# line) override GATE_SDK_MSG_PATTERN_FILES (+ _LOCAL); default when absent.
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
# shellcheck source=../lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
|
|
15
|
-
# spec: gate-sdk/SPEC.md §check-commit-msg — no-arg is a clean skip: the message is not a whole-tree surface and a history scan is deferred
|
|
16
|
-
if [[ $# -eq 0 ]]; then
|
|
17
|
-
echo "COMMIT-MSG: clean (no message file argument — the commit-msg hook surface is not a whole-tree target; skipped)"
|
|
18
|
-
exit 0
|
|
19
|
-
fi
|
|
20
|
-
MSG="$1"
|
|
21
|
-
[[ -f "$MSG" ]] || { echo "check-commit-msg: message file not found: $MSG" >&2; exit 2; }
|
|
22
|
-
shift
|
|
23
|
-
|
|
24
|
-
pat_list="$(gate_msg_pattern_files "$@")"; st=$?
|
|
25
|
-
fail_closed "$st" COMMIT-MSG pattern-files
|
|
26
|
-
mapfile -t PATS < <(printf '%s' "$pat_list")
|
|
27
|
-
|
|
28
|
-
patterns="$(grep -hEv '^[[:space:]]*(#|$)' "${PATS[@]+"${PATS[@]}"}")"; gst=$?
|
|
29
|
-
[[ "$gst" -le 1 ]] || fail_closed "$gst" COMMIT-MSG grep-patterns
|
|
30
|
-
|
|
31
|
-
npat=0
|
|
32
|
-
[[ -n "$patterns" ]] && npat="$(grep -c '' <<<"$patterns")"
|
|
33
|
-
if [[ "$npat" -eq 0 ]]; then
|
|
34
|
-
echo "COMMIT-MSG: clean (0 banned pattern(s) configured; message unchecked)"
|
|
35
|
-
exit 0
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
hits="$(grep -EnHf <(printf '%s\n' "$patterns") "$MSG")"; hst=$?
|
|
39
|
-
[[ "$hst" -le 1 ]] || fail_closed "$hst" COMMIT-MSG grep
|
|
40
|
-
|
|
41
|
-
if [[ -n "$hits" ]]; then
|
|
42
|
-
echo "check-commit-msg: commit message matches a banned pattern (leaked local/private term):"
|
|
43
|
-
echo "$hits"
|
|
44
|
-
echo " help: rewrite the message to remove the leaked term; the pattern set is"
|
|
45
|
-
echo " GATE_SDK_MSG_PATTERN_FILES (+ the local list). The Co-Authored-By"
|
|
46
|
-
echo " trailer is a footer convention, not a leak — do not ban it."
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
echo "COMMIT-MSG: clean (message matches none of $npat banned pattern(s))"
|
|
51
|
-
exit 0
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=gate-sdk/lib/gate.sh dir=one valve=none tier=commit-msg
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-commit-subject — the subject line parses as <type>(<scope>)?!?: <summary> with <type> in the shared roster, or matches a git-generated carve-out (the parse guarantee under trajectory.sh's feat/debt column)
|
|
5
|
-
#
|
|
6
|
-
# usage: check-commit-subject.sh <message-file>
|
|
7
|
-
# message-file: the commit-msg hook's $1. Roster is GATE_SDK_COMMIT_TYPES
|
|
8
|
-
# (gate_commit_types, lib/gate.sh); no positional roster override.
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
# shellcheck source=../lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
|
|
15
|
-
# spec: gate-sdk/SPEC.md §check-commit-subject — no-arg is a clean skip: the message is not a whole-tree surface
|
|
16
|
-
if [[ $# -eq 0 ]]; then
|
|
17
|
-
echo "COMMIT-SUBJECT: clean (no message file argument — the commit-msg hook surface is not a whole-tree target; skipped)"
|
|
18
|
-
exit 0
|
|
19
|
-
fi
|
|
20
|
-
MSG="$1"
|
|
21
|
-
[[ -f "$MSG" ]] || { echo "check-commit-subject: message file not found: $MSG" >&2; exit 2; }
|
|
22
|
-
|
|
23
|
-
roster="$(gate_commit_types)"; st=$?
|
|
24
|
-
fail_closed "$st" COMMIT-SUBJECT roster
|
|
25
|
-
types="$(printf '%s' "$roster" | tr ' ' '|')"
|
|
26
|
-
|
|
27
|
-
subject="$(sed -n '1p' "$MSG")"; sst=$?
|
|
28
|
-
fail_closed "$sst" COMMIT-SUBJECT subject
|
|
29
|
-
|
|
30
|
-
# spec: gate-sdk/SPEC.md §check-commit-subject — conventional grammar (roster type, optional (scope) with token [a-z0-9./-]+, optional ! break marker, ': ' then non-empty summary) OR a git-generated carve-out (Merge/Revert + the fixup!/squash! autosquash forms)
|
|
31
|
-
if [[ "$subject" =~ ^($types)(\([a-z0-9./-]+\))?!?:\ .+$ ]] \
|
|
32
|
-
|| [[ "$subject" =~ ^(Merge|Revert)\ ]] \
|
|
33
|
-
|| [[ "$subject" =~ ^(fixup|squash)!\ ]]; then
|
|
34
|
-
echo "COMMIT-SUBJECT: clean (subject parses against the ${roster// /, } roster or a git-generated carve-out)"
|
|
35
|
-
exit 0
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
echo "check-commit-subject: subject line does not parse as <type>(<scope>)?!?: <summary>:"
|
|
39
|
-
echo " $subject"
|
|
40
|
-
echo " help: open the subject with a roster type followed by ': ' and a summary"
|
|
41
|
-
echo " (e.g. 'feat(scope): …'); the roster is GATE_SDK_COMMIT_TYPES"
|
|
42
|
-
echo " (default: $roster). git's own Merge/Revert/fixup!/squash! forms are"
|
|
43
|
-
echo " carve-outs — do not reword them."
|
|
44
|
-
exit 1
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=scripts/core-files.list,kit:SPEC.md,kit:README.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-core-files — every path in the core-files manifest exists in the worktree and is tracked
|
|
5
|
-
#
|
|
6
|
-
# usage: check-core-files.sh [manifest]
|
|
7
|
-
# default: GATE_SDK_CORE_FILES_FILE (<gates-dir>/core-files.list)
|
|
8
|
-
set -uo pipefail
|
|
9
|
-
|
|
10
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
# shellcheck source=../lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
|
|
14
|
-
MANIFEST="${1:-${GATE_SDK_CORE_FILES_FILE:-$(gate_sdk_gates_dir)/core-files.list}}"
|
|
15
|
-
|
|
16
|
-
if [[ ! -e "$MANIFEST" ]]; then
|
|
17
|
-
echo "CORE-FILES: clean (no manifest at $MANIFEST — optional consumer config absent)"
|
|
18
|
-
exit 0
|
|
19
|
-
fi
|
|
20
|
-
[[ -r "$MANIFEST" ]] || { echo "check-core-files: manifest not readable: $MANIFEST" >&2; exit 2; }
|
|
21
|
-
|
|
22
|
-
mapfile -t lines < <(gates_list_members "$MANIFEST")
|
|
23
|
-
if [[ ${#lines[@]} -eq 0 ]]; then
|
|
24
|
-
echo "CORE-FILES: clean (manifest $MANIFEST lists no paths)"
|
|
25
|
-
exit 0
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
# spec: gate-sdk/SPEC.md §check-core-files — a kit: line derives one path per kit root; the
|
|
29
|
-
# wildcard refusal is fail-closed because this reader requires each expanded path to exist,
|
|
30
|
-
# which is a different invariant from the glob match a couples= field performs
|
|
31
|
-
paths=(); _cf_expanded=""
|
|
32
|
-
for line in "${lines[@]}"; do
|
|
33
|
-
if [[ "$line" == kit:* ]]; then
|
|
34
|
-
case "${line#kit:}" in
|
|
35
|
-
*'*'* | *'?'* | *'['*)
|
|
36
|
-
echo "check-core-files: kit: token carries a wildcard in $MANIFEST: $line" >&2
|
|
37
|
-
echo " help: this manifest requires every expanded path to exist and be tracked," >&2
|
|
38
|
-
echo " which a wildcard cannot express — name an exact per-kit basename" >&2
|
|
39
|
-
echo " (e.g. kit:SPEC.md), or hand-list the paths." >&2
|
|
40
|
-
exit 2
|
|
41
|
-
;;
|
|
42
|
-
esac
|
|
43
|
-
gate_expand_couples_var _cf_expanded "$line"
|
|
44
|
-
IFS=',' read -ra _cf_parts <<<"$_cf_expanded"
|
|
45
|
-
paths+=("${_cf_parts[@]}")
|
|
46
|
-
else
|
|
47
|
-
paths+=("$line")
|
|
48
|
-
fi
|
|
49
|
-
done
|
|
50
|
-
|
|
51
|
-
git rev-parse --git-dir >/dev/null 2>&1 || {
|
|
52
|
-
echo "check-core-files: not a git repository — cannot verify tracked status" >&2; exit 2; }
|
|
53
|
-
|
|
54
|
-
missing=(); untracked=(); present=0
|
|
55
|
-
for p in "${paths[@]}"; do
|
|
56
|
-
if [[ ! -e "$p" ]]; then
|
|
57
|
-
missing+=("$p")
|
|
58
|
-
elif git ls-files --error-unmatch -- "$p" >/dev/null 2>&1; then
|
|
59
|
-
present=$((present + 1))
|
|
60
|
-
else
|
|
61
|
-
untracked+=("$p")
|
|
62
|
-
fi
|
|
63
|
-
done
|
|
64
|
-
|
|
65
|
-
if [[ ${#missing[@]} -gt 0 || ${#untracked[@]} -gt 0 ]]; then
|
|
66
|
-
echo "check-core-files: core file(s) listed in $MANIFEST but missing or untracked"
|
|
67
|
-
echo "(the silent-deletion class downstream gates catch only incidentally):"
|
|
68
|
-
for p in "${missing[@]}"; do echo " missing: $p"; done
|
|
69
|
-
for p in "${untracked[@]}"; do echo " untracked: $p"; done
|
|
70
|
-
echo " help: restore the file (git checkout / git add), or — if the removal is"
|
|
71
|
-
echo " intentional — delete its line from $MANIFEST in the same commit."
|
|
72
|
-
exit 1
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
echo "CORE-FILES: clean ($present manifest path(s) present and tracked in $MANIFEST)"
|
|
76
|
-
exit 0
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=docs/enforcement.md,scripts/gates.list,scripts/*.sh,kit:*.sh,scripts/kpis.list,.claude/settings.json,.github/workflows/*.yml dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-enforcement-fresh — docs/enforcement.md is the byte-fresh projection of enforcement-map.sh --emit
|
|
5
|
-
#
|
|
6
|
-
# usage: check-enforcement-fresh.sh [projection-file] [emit-file]
|
|
7
|
-
# bare: compare docs/enforcement.md against `enforcement-map.sh --emit`.
|
|
8
|
-
# two args: compare projection-file to a pre-baked emit-file (hermetic fixture).
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
# shellcheck source=../lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
|
|
15
|
-
PROJECTION="${1:-docs/enforcement.md}"
|
|
16
|
-
EMIT_SRC="${2:-}"
|
|
17
|
-
|
|
18
|
-
[[ -f "$PROJECTION" ]] || { echo "check-enforcement-fresh: projection not found: $PROJECTION" >&2; exit 2; }
|
|
19
|
-
|
|
20
|
-
if [[ -n "$EMIT_SRC" ]]; then
|
|
21
|
-
[[ -f "$EMIT_SRC" ]] || { echo "check-enforcement-fresh: emit source not found: $EMIT_SRC" >&2; exit 2; }
|
|
22
|
-
emitted="$(cat "$EMIT_SRC")"; st=$?
|
|
23
|
-
fail_closed "$st" check-enforcement-fresh cat
|
|
24
|
-
else
|
|
25
|
-
EMITTER="$SDK/bin/enforcement-map.sh"
|
|
26
|
-
[[ -x "$EMITTER" ]] || { echo "check-enforcement-fresh: emitter not found: $EMITTER" >&2; exit 2; }
|
|
27
|
-
emitted="$(bash "$EMITTER" --emit)"; st=$?
|
|
28
|
-
fail_closed "$st" check-enforcement-fresh enforcement-map
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
if [[ "$emitted" != "$(cat "$PROJECTION")" ]]; then
|
|
32
|
-
echo "check-enforcement-fresh: $PROJECTION is stale vs the enforcement-map emitter:"
|
|
33
|
-
diff <(printf '%s\n' "$emitted") "$PROJECTION" | head -20 || true
|
|
34
|
-
echo " help: regenerate — bash gate-sdk/bin/enforcement-map.sh --emit > docs/enforcement.md"
|
|
35
|
-
exit 1
|
|
36
|
-
fi
|
|
37
|
-
echo "ENFORCEMENT-FRESH: clean ($PROJECTION byte-matches the enforcement-map emitter)"
|
|
38
|
-
exit 0
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:checks/*.sh,kit:kpis/*.sh,kit:bin/*.sh,scripts/check-*.sh,scripts/kpi-*.sh dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-exec-bit — every tracked *.sh matching an exec-glob carries git index mode 100755, or a by-path-invoked kit script degrades silently to a skipped check / failed plugin in a fresh clone
|
|
5
|
-
#
|
|
6
|
-
# usage: check-exec-bit.sh [ls-files-dump]
|
|
7
|
-
# No argument: reads `git ls-files -s` from the repo root (the index mode a
|
|
8
|
-
# clone gets). With an argument: lints that canned dump (hermetic fixtures).
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
# shellcheck source=../lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
|
|
15
|
-
if [[ -n "${GATE_SDK_EXEC_GLOBS:-}" ]]; then
|
|
16
|
-
read -r -a EXEC_GLOBS <<<"$GATE_SDK_EXEC_GLOBS"
|
|
17
|
-
else
|
|
18
|
-
gd="$(gate_sdk_gates_dir)"
|
|
19
|
-
EXEC_GLOBS=('*/checks/*.sh' '*/kpis/*.sh' '*/bin/*.sh' "$gd/check-*.sh" "$gd/kpi-*.sh")
|
|
20
|
-
fi
|
|
21
|
-
if [[ -n "${GATE_SDK_EXEC_PRUNE:-}" ]]; then
|
|
22
|
-
read -r -a EXEC_PRUNE <<<"$GATE_SDK_EXEC_PRUNE"
|
|
23
|
-
else
|
|
24
|
-
EXEC_PRUNE=(gate-tests fixtures templates smoke)
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
if [[ $# -gt 0 ]]; then
|
|
28
|
-
[[ -r "$1" ]] || { echo "check-exec-bit: ls-files dump not readable: $1" >&2; exit 2; }
|
|
29
|
-
listing="$(cat -- "$1")"; st=$?
|
|
30
|
-
fail_closed "$st" EXEC-BIT cat
|
|
31
|
-
else
|
|
32
|
-
git rev-parse --git-dir >/dev/null 2>&1 || {
|
|
33
|
-
echo "check-exec-bit: not a git repository — cannot read index modes" >&2; exit 2; }
|
|
34
|
-
listing="$(git ls-files -s)"; st=$?
|
|
35
|
-
fail_closed "$st" EXEC-BIT git-ls-files
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
is_pruned() {
|
|
39
|
-
local p="$1" seg pr
|
|
40
|
-
local -a segs
|
|
41
|
-
IFS='/' read -ra segs <<<"$p"
|
|
42
|
-
for seg in "${segs[@]}"; do
|
|
43
|
-
for pr in "${EXEC_PRUNE[@]}"; do
|
|
44
|
-
[[ "$seg" == "$pr" ]] && return 0
|
|
45
|
-
done
|
|
46
|
-
done
|
|
47
|
-
return 1
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
bad=(); count=0
|
|
51
|
-
notexec=(); dcount=0
|
|
52
|
-
while IFS= read -r line; do
|
|
53
|
-
[[ -n "$line" ]] || continue
|
|
54
|
-
mode="${line%% *}"
|
|
55
|
-
path="${line#*$'\t'}"
|
|
56
|
-
# assertion: a .gate descriptor is data — never sourced, never run — so it
|
|
57
|
-
# must be committed non-executable; stated so "not executable" cannot read
|
|
58
|
-
# as "not covered" (gate-sdk/SPEC.md §check-exec-bit)
|
|
59
|
-
if [[ "$path" == *.gate ]]; then
|
|
60
|
-
is_pruned "$path" && continue
|
|
61
|
-
dcount=$((dcount + 1))
|
|
62
|
-
[[ "$mode" == 100644 ]] || notexec+=("$path (index mode $mode)")
|
|
63
|
-
continue
|
|
64
|
-
fi
|
|
65
|
-
[[ "$path" == *.sh ]] || continue
|
|
66
|
-
matched=0
|
|
67
|
-
for g in "${EXEC_GLOBS[@]}"; do
|
|
68
|
-
# shellcheck disable=SC2053 # g is the glob, deliberately unquoted
|
|
69
|
-
[[ "$path" == $g ]] && { matched=1; break; }
|
|
70
|
-
done
|
|
71
|
-
[[ "$matched" == 1 ]] || continue
|
|
72
|
-
is_pruned "$path" && continue
|
|
73
|
-
count=$((count + 1))
|
|
74
|
-
[[ "$mode" == 100755 ]] || bad+=("$path (index mode $mode)")
|
|
75
|
-
done <<< "$listing"
|
|
76
|
-
|
|
77
|
-
if [[ ${#bad[@]} -gt 0 ]]; then
|
|
78
|
-
echo "check-exec-bit: by-path-invoked script(s) not committed executable (mode 100755) — a"
|
|
79
|
-
echo "100644 script degrades silently in a fresh clone (a KPI plugin to 'n/a (plugin"
|
|
80
|
-
echo "failed)', a runner-invoked preflight to a skipped check):"
|
|
81
|
-
printf ' %s\n' "${bad[@]}"
|
|
82
|
-
echo " help: git update-index --chmod=+x <path> (and chmod +x locally), then recommit."
|
|
83
|
-
exit 1
|
|
84
|
-
fi
|
|
85
|
-
|
|
86
|
-
if [[ ${#notexec[@]} -gt 0 ]]; then
|
|
87
|
-
echo "check-exec-bit: .gate descriptor(s) committed executable — a descriptor is data"
|
|
88
|
-
echo "carrying a manifest and directives, never sourced and never run; an executable one"
|
|
89
|
-
echo "invites a reader to run a file with no interpreter line:"
|
|
90
|
-
printf ' %s\n' "${notexec[@]}"
|
|
91
|
-
echo " help: git update-index --chmod=-x <path> (and chmod -x locally), then recommit."
|
|
92
|
-
exit 1
|
|
93
|
-
fi
|
|
94
|
-
|
|
95
|
-
echo "EXEC-BIT: clean ($count by-path-invoked script(s) at index mode 100755; $dcount .gate descriptor(s) non-executable)"
|
|
96
|
-
exit 0
|