checkwright 0.21.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 +1013 -50
- package/lib/common/digest.sh +18 -0
- package/lib/common/lock.sh +40 -0
- package/lib/common/profile.sh +33 -0
- package/lib/common/recipe.sh +56 -43
- package/lib/diff.sh +64 -0
- package/lib/doctor.sh +81 -7
- package/lib/init.sh +167 -52
- package/lib/uninstall.sh +212 -0
- package/lib/update.sh +34 -0
- package/package.json +2 -2
- package/payload/artifact/targets.list +30 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
- package/payload/canon-kit/README.md +2 -0
- package/payload/canon-kit/SPEC.md +666 -59
- 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 +12 -4
- 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/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
- 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 +32 -8
- 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-payload-claim/bad/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
- 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 +4 -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/bad/widget.sh +1 -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-spec-pointer/good/widget.sh +1 -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 +109 -70
- package/payload/canon-kit/smoke/install.sh +21 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
- package/payload/context-kit/README.md +4 -1
- package/payload/context-kit/SPEC.md +166 -9
- 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 +4 -1
- package/payload/delegation-kit/README.md +3 -3
- package/payload/delegation-kit/SPEC.md +499 -26
- package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
- package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
- package/payload/delegation-kit/lib/delegation.sh +1 -0
- package/payload/delegation-kit/smoke/install.sh +2 -1
- package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
- package/payload/delegation-kit/templates/agent-execution.md +127 -12
- package/payload/delegation-kit/templates/delegation-config.sh +4 -0
- package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
- package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
- package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
- package/payload/doctrine-kit/DOCTRINE.md +112 -11
- package/payload/doctrine-kit/README.md +12 -3
- package/payload/doctrine-kit/SPEC.md +163 -11
- package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
- 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 +167 -1
- package/payload/drift-kit/README.md +3 -2
- package/payload/drift-kit/SPEC.md +264 -22
- package/payload/drift-kit/bin/kfric.sh +21 -2
- package/payload/drift-kit/bin/stage-economics.sh +157 -3
- package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
- package/payload/drift-kit/smoke/install.sh +183 -1
- package/payload/drift-kit/templates/economics.md +9 -0
- package/payload/drift-kit/templates/kpis.list +6 -1
- package/payload/evidence-kit/README.md +20 -6
- package/payload/evidence-kit/SPEC.md +355 -17
- package/payload/evidence-kit/bin/run-validate.sh +51 -9
- package/payload/evidence-kit/checks/check-battery-roster.sh +87 -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 +35 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
- package/payload/evidence-kit/lib/evidence.sh +18 -0
- package/payload/evidence-kit/smoke/install.sh +17 -3
- package/payload/gate-sdk/README.md +17 -1
- package/payload/gate-sdk/SPEC.md +4427 -92
- 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 +32 -2
- package/payload/gate-sdk/bin/port-blockers.sh +445 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
- package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
- package/payload/gate-sdk/bin/run-gates.sh +37 -2
- package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
- package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
- package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
- 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 +28 -4
- 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 +21 -1
- package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
- 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 +41 -3
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
- package/payload/gate-sdk/checks/check-graph.sh +5 -5
- 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 +6 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
- 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-action-run-shell.test.sh +16 -1
- package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
- 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-binary-fresh/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -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/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +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/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
- package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
- package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
- package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
- package/payload/gate-sdk/lib/gate.sh +208 -9
- package/payload/gate-sdk/lib/inject.sh +46 -1
- package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
- package/payload/gate-sdk/smoke/install.sh +61 -1
- package/payload/guard-kit/README.md +18 -14
- package/payload/guard-kit/SPEC.md +366 -72
- package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
- package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -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 +277 -54
- package/payload/guard-kit/templates/close-triage.md +38 -10
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/guard-kit/templates/settings-hooks.json +7 -1
- package/payload/lifecycle-kit/README.md +12 -1
- package/payload/lifecycle-kit/SPEC.md +991 -41
- package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
- package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
- package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
- 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/bad/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -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/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
- package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
- package/payload/lifecycle-kit/lib/stages.sh +12 -2
- package/payload/lifecycle-kit/smoke/install.sh +83 -4
- package/payload/lifecycle-kit/templates/consult.md +73 -0
- package/payload/lifecycle-kit/templates/lead.md +139 -7
- package/payload/lifecycle-kit/templates/stages/align.md +12 -0
- package/payload/lifecycle-kit/templates/stages/build.md +8 -0
- package/payload/lifecycle-kit/templates/stages/close.md +45 -5
- package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
- package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
- package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
- package/payload/queue-kit/README.md +6 -1
- package/payload/queue-kit/SPEC.md +350 -6
- package/payload/queue-kit/bin/queue-counts.sh +35 -0
- package/payload/queue-kit/bin/queue-edges.sh +78 -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/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
- package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
- package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -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/queue-kit/smoke/install.sh +4 -1
- package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
- package/payload/site-kit/SPEC.md +64 -27
- 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/payload/site-kit/smoke/install.sh +9 -1
- package/profiles.list +36 -8
- package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
- 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-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 -180
- 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-action-gh-repo.sh +0 -321
- package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
- 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-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/queue-kit/checks/check-queue-entry-budget.sh +0 -104
- 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,321 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=.github/workflows/*.yml,.github/workflows/*.yaml,.github/ISSUE_TEMPLATE/*.yml,docs/_config.yml,kit:templates/*.yml,kit:templates/*.yaml dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — a job whose run: bodies invoke gh establishes a repository context: a checkout before the first call, GH_REPO in scope, or --repo on every call
|
|
4
|
-
#
|
|
5
|
-
# usage: check-action-gh-repo.sh [scan-root]
|
|
6
|
-
# scan-root: the walked tree (default '.'). Requires GNU awk (3-arg match).
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
# shellcheck source=../lib/gate.sh
|
|
11
|
-
source "$SDK/lib/gate.sh"
|
|
12
|
-
|
|
13
|
-
SCANROOT="${1:-.}"
|
|
14
|
-
[[ -d "$SCANROOT" ]] || { echo "check-action-gh-repo: scan root not found: $SCANROOT" >&2; exit 2; }
|
|
15
|
-
|
|
16
|
-
listing="$(gate_find "$SCANROOT" -type f \( -name '*.yml' -o -name '*.yaml' \))"; st=$?
|
|
17
|
-
fail_closed "$st" ACTION-GH-REPO gate_find
|
|
18
|
-
mapfile -t files < <(printf '%s' "$listing")
|
|
19
|
-
|
|
20
|
-
if [[ ${#files[@]} -eq 0 ]]; then
|
|
21
|
-
echo "ACTION-GH-REPO: clean (no YAML under $SCANROOT — 0 job(s) to check)"
|
|
22
|
-
exit 0
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
WALK='
|
|
26
|
-
function ind(s, n) { n = match(s, /[^ ]/); return (n == 0) ? -1 : n - 1 }
|
|
27
|
-
|
|
28
|
-
function keyof(s, t) {
|
|
29
|
-
t = s
|
|
30
|
-
sub(/^[ ]*/, "", t)
|
|
31
|
-
if (t !~ /^[^ :]+[ ]*:/) return ""
|
|
32
|
-
sub(/[ ]*:.*$/, "", t)
|
|
33
|
-
return t
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — the trigger and the --repo arm share one detector, so the arm is universally quantified over the detected set rather than satisfied by a witness
|
|
37
|
-
function scanlogical(s, ln, t, n, i, c, prefix, w, ok, ext, j, cut, hasrepo) {
|
|
38
|
-
t = s
|
|
39
|
-
sub(/^[ \t]+/, "", t)
|
|
40
|
-
if (substr(t, 1, 1) == "#") return
|
|
41
|
-
n = length(s)
|
|
42
|
-
for (i = 1; i < n; i++) {
|
|
43
|
-
if (substr(s, i, 2) != "gh") continue
|
|
44
|
-
c = substr(s, i + 2, 1)
|
|
45
|
-
if (c ~ /[A-Za-z0-9_.-]/) continue
|
|
46
|
-
prefix = substr(s, 1, i - 1)
|
|
47
|
-
sub(/[ \t]+$/, "", prefix)
|
|
48
|
-
ok = 0
|
|
49
|
-
if (prefix == "") ok = 1
|
|
50
|
-
else {
|
|
51
|
-
c = substr(prefix, length(prefix))
|
|
52
|
-
if (index("|&;(`!{", c) > 0) ok = 1
|
|
53
|
-
else {
|
|
54
|
-
w = prefix
|
|
55
|
-
sub(/^.*[ \t]/, "", w)
|
|
56
|
-
if (w == "then" || w == "else" || w == "do" || w == "elif") ok = 1
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (!ok) continue
|
|
60
|
-
ext = substr(s, i + 2)
|
|
61
|
-
cut = length(ext)
|
|
62
|
-
for (j = 1; j <= length(ext); j++) {
|
|
63
|
-
c = substr(ext, j, 1)
|
|
64
|
-
if (c == ";" || c == "|" || c == "&") { cut = j - 1; break }
|
|
65
|
-
}
|
|
66
|
-
ext = substr(ext, 1, cut)
|
|
67
|
-
hasrepo = (ext ~ /(^|[ \t])--repo([ \t=]|$)/) ? 1 : 0
|
|
68
|
-
printf "G\t%d\t%d\n", ln, hasrepo
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — backslash continuations are joined before matching, so a call split across lines is one unit and its --repo is found wherever on the call it sits
|
|
73
|
-
function endrun( i, s, acc, accln) {
|
|
74
|
-
inrun = 0
|
|
75
|
-
acc = ""; accln = 0
|
|
76
|
-
for (i = 0; i < rn; i++) {
|
|
77
|
-
s = rbuf[i]
|
|
78
|
-
if (acc == "") accln = rln[i]
|
|
79
|
-
if (s ~ /\\$/) { sub(/\\$/, "", s); acc = acc s " "; continue }
|
|
80
|
-
scanlogical(acc s, accln)
|
|
81
|
-
acc = ""
|
|
82
|
-
}
|
|
83
|
-
if (acc != "") scanlogical(acc, accln)
|
|
84
|
-
rn = 0
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — the marker binds by its own indentation: at or left of the job-id column it precedes a job, at the step dash column it precedes a step, inside a step it binds that step
|
|
88
|
-
function marker(line, ln, c, r) {
|
|
89
|
-
if (line !~ /gh-repo-exempt/) return
|
|
90
|
-
r = ""
|
|
91
|
-
if (line ~ /gh-repo-exempt[ \t]*:/) {
|
|
92
|
-
r = line
|
|
93
|
-
sub(/^.*gh-repo-exempt[ \t]*:[ \t]*/, "", r)
|
|
94
|
-
sub(/[ \t]+$/, "", r)
|
|
95
|
-
}
|
|
96
|
-
if (r == "") { printf "XBAD\t%d\n", ln; return }
|
|
97
|
-
if (!injobs) return
|
|
98
|
-
c = ind(line)
|
|
99
|
-
if (jobcol >= 0 && c <= jobcol) { pendjob = r; return }
|
|
100
|
-
if (curjob == "") { pendjob = r; return }
|
|
101
|
-
if (insteps) {
|
|
102
|
-
if (stepdashcol < 0 || c <= stepdashcol) { pendstep = r; return }
|
|
103
|
-
if (stepcol >= 0) { printf "SX\t%s\n", r; return }
|
|
104
|
-
pendstep = r
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
printf "JX\t%s\n", r
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function stepkey(rest, col, ln, k, v, u) {
|
|
111
|
-
k = keyof(rest)
|
|
112
|
-
if (k == "") return
|
|
113
|
-
v = rest
|
|
114
|
-
sub(/^[^:]*:[ \t]*/, "", v)
|
|
115
|
-
sub(/[ \t]+$/, "", v)
|
|
116
|
-
if (k == "uses") {
|
|
117
|
-
gsub(/^["\047]+|["\047]+$/, "", v)
|
|
118
|
-
sub(/[ \t].*$/, "", v)
|
|
119
|
-
u = v
|
|
120
|
-
sub(/@.*$/, "", u)
|
|
121
|
-
if (u == "actions/checkout") printf "C\t%d\n", ln
|
|
122
|
-
return
|
|
123
|
-
}
|
|
124
|
-
if (k == "env") { envscope = "step"; envcol = col; return }
|
|
125
|
-
if (k != "run") return
|
|
126
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — a folded body is scanned line-wise like a literal one, and a plain scalar as a single logical line: both over-detect, the stated safe direction
|
|
127
|
-
if (v ~ /^[|>][-+]?[0-9]*$/) { inrun = 1; runkeycol = col; rbi = -1; rn = 0; return }
|
|
128
|
-
if (v != "") scanlogical(v, ln)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
BEGIN { jobcol = -1; jobkeycol = -1; stepcol = -1; stepdashcol = -1; envscope = ""; curjob = ""; pendjob = ""; pendstep = ""; inrun = 0; injobs = 0; insteps = 0 }
|
|
132
|
-
|
|
133
|
-
{
|
|
134
|
-
line = $0
|
|
135
|
-
sub(/\r$/, "", line)
|
|
136
|
-
|
|
137
|
-
if (inrun) {
|
|
138
|
-
if (line ~ /^[ \t]*$/) { rbuf[rn] = ""; rln[rn] = FNR; rn++; next }
|
|
139
|
-
c = ind(line)
|
|
140
|
-
if (c > runkeycol) {
|
|
141
|
-
if (rbi < 0) rbi = c
|
|
142
|
-
rbuf[rn] = substr(line, rbi + 1); rln[rn] = FNR; rn++
|
|
143
|
-
next
|
|
144
|
-
}
|
|
145
|
-
endrun()
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (line ~ /^[ \t]*$/) next
|
|
149
|
-
if (line ~ /^[ ]*#/) { marker(line, FNR); next }
|
|
150
|
-
|
|
151
|
-
c = ind(line)
|
|
152
|
-
|
|
153
|
-
if (envscope != "") {
|
|
154
|
-
if (c > envcol) {
|
|
155
|
-
if (line ~ /^[ ]*GH_REPO[ ]*:/) print (envscope == "workflow" ? "W" : (envscope == "job" ? "JE" : "SE"))
|
|
156
|
-
next
|
|
157
|
-
}
|
|
158
|
-
envscope = ""
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (c == 0) {
|
|
162
|
-
topkey = keyof(line)
|
|
163
|
-
injobs = (topkey == "jobs")
|
|
164
|
-
curjob = ""; stepcol = -1; insteps = 0
|
|
165
|
-
if (topkey == "env") { envscope = "workflow"; envcol = 0 }
|
|
166
|
-
next
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (!injobs) next
|
|
170
|
-
if (jobcol < 0) jobcol = c
|
|
171
|
-
|
|
172
|
-
if (c == jobcol) {
|
|
173
|
-
curjob = keyof(line)
|
|
174
|
-
if (curjob == "") next
|
|
175
|
-
printf "J\t%s\t%d\n", curjob, FNR
|
|
176
|
-
if (pendjob != "") { printf "JX\t%s\n", pendjob }
|
|
177
|
-
pendjob = ""; pendstep = ""
|
|
178
|
-
jobkeycol = -1; stepcol = -1; stepdashcol = -1; insteps = 0
|
|
179
|
-
next
|
|
180
|
-
}
|
|
181
|
-
if (curjob == "") next
|
|
182
|
-
if (jobkeycol < 0) jobkeycol = c
|
|
183
|
-
|
|
184
|
-
if (c == jobkeycol) {
|
|
185
|
-
stepcol = -1
|
|
186
|
-
k = keyof(line)
|
|
187
|
-
insteps = (k == "steps")
|
|
188
|
-
if (k == "env") { envscope = "job"; envcol = c }
|
|
189
|
-
next
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (!insteps) next
|
|
193
|
-
|
|
194
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — a new step is a dash at the step-list column alone, so a nested list under with:/strategy: is not read as a step
|
|
195
|
-
if (match(line, /^[ ]*-[ ]+/)) {
|
|
196
|
-
if (stepdashcol < 0) stepdashcol = c
|
|
197
|
-
if (c == stepdashcol) {
|
|
198
|
-
stepcol = RLENGTH
|
|
199
|
-
printf "S\t%d\n", FNR
|
|
200
|
-
if (pendstep != "") { printf "SX\t%s\n", pendstep }
|
|
201
|
-
pendstep = ""
|
|
202
|
-
stepkey(substr(line, stepcol + 1), stepcol, FNR)
|
|
203
|
-
next
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
if (stepcol >= 0 && c == stepcol) stepkey(substr(line, c + 1), c, FNR)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
END { if (inrun) endrun() }
|
|
210
|
-
'
|
|
211
|
-
|
|
212
|
-
walked=0; subject=0; composite=0; outside=0
|
|
213
|
-
armed=0; inert=0; exempt=0; calls=0
|
|
214
|
-
findings=(); bare=()
|
|
215
|
-
|
|
216
|
-
curfile=""; wenv=0
|
|
217
|
-
job=""; jobline=0; jexempt=0; jenv=0
|
|
218
|
-
checkouts=(); iln=(); irepo=(); ienv=()
|
|
219
|
-
senv=0; sexempt=0; sln=(); srepo=()
|
|
220
|
-
have_job=0; have_step=0
|
|
221
|
-
|
|
222
|
-
finish_step() {
|
|
223
|
-
(( have_step )) || return 0
|
|
224
|
-
have_step=0
|
|
225
|
-
local i
|
|
226
|
-
if (( sexempt == 0 && ${#sln[@]} > 0 )); then
|
|
227
|
-
for i in "${!sln[@]}"; do
|
|
228
|
-
iln+=("${sln[$i]}"); irepo+=("${srepo[$i]}")
|
|
229
|
-
if (( wenv || jenv || senv )); then ienv+=(1); else ienv+=(0); fi
|
|
230
|
-
done
|
|
231
|
-
fi
|
|
232
|
-
senv=0; sexempt=0; sln=(); srepo=()
|
|
233
|
-
return 0
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — the three arms are disjoined per job and each is universally quantified over the job's detected set
|
|
237
|
-
finish_job() {
|
|
238
|
-
(( have_job )) || return 0
|
|
239
|
-
finish_step
|
|
240
|
-
have_job=0
|
|
241
|
-
if (( jexempt )); then exempt=$((exempt + 1)); return 0; fi
|
|
242
|
-
if (( ${#iln[@]} == 0 )); then inert=$((inert + 1)); return 0; fi
|
|
243
|
-
armed=$((armed + 1)); calls=$((calls + ${#iln[@]}))
|
|
244
|
-
local first="${iln[0]}" i allenv=1 allrepo=1
|
|
245
|
-
for i in "${iln[@]}"; do (( i < first )) && first="$i"; done
|
|
246
|
-
if (( ${#checkouts[@]} > 0 )); then
|
|
247
|
-
for i in "${checkouts[@]}"; do (( i < first )) && return 0; done
|
|
248
|
-
fi
|
|
249
|
-
for i in "${ienv[@]}"; do (( i )) || allenv=0; done
|
|
250
|
-
for i in "${irepo[@]}"; do (( i )) || allrepo=0; done
|
|
251
|
-
(( allenv || allrepo )) && return 0
|
|
252
|
-
findings+=("$curfile:$jobline: job '$job' first invokes gh at line $first with no repository context")
|
|
253
|
-
return 0
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
for f in "${files[@]}"; do
|
|
257
|
-
[[ -n "$f" ]] || continue
|
|
258
|
-
walked=$((walked + 1))
|
|
259
|
-
# spec: gate-sdk/SPEC.md §check-action-gh-repo — the Actions-shape predicate is split in two: the gate's unit is a job under jobs:, and a runs:-shaped composite action inherits its caller's repository context
|
|
260
|
-
if grep -qE '^jobs:' "$f"; then
|
|
261
|
-
subject=$((subject + 1))
|
|
262
|
-
elif grep -qE '^runs:' "$f"; then
|
|
263
|
-
composite=$((composite + 1))
|
|
264
|
-
continue
|
|
265
|
-
else
|
|
266
|
-
outside=$((outside + 1))
|
|
267
|
-
continue
|
|
268
|
-
fi
|
|
269
|
-
|
|
270
|
-
stream="$(awk "$WALK" "$f")"; st=$?
|
|
271
|
-
fail_closed "$st" ACTION-GH-REPO "awk walk($f)"
|
|
272
|
-
|
|
273
|
-
curfile="$f"
|
|
274
|
-
wenv=0
|
|
275
|
-
grep -qx 'W' <<< "$stream" && wenv=1
|
|
276
|
-
|
|
277
|
-
while IFS=$'\t' read -r kind a b; do
|
|
278
|
-
case "$kind" in
|
|
279
|
-
J) finish_job
|
|
280
|
-
job="$a"; jobline="$b"; jexempt=0; jenv=0
|
|
281
|
-
checkouts=(); iln=(); irepo=(); ienv=(); have_job=1 ;;
|
|
282
|
-
JE) jenv=1 ;;
|
|
283
|
-
JX) jexempt=1 ;;
|
|
284
|
-
S) finish_step; have_step=1 ;;
|
|
285
|
-
SE) senv=1 ;;
|
|
286
|
-
SX) sexempt=1 ;;
|
|
287
|
-
C) checkouts+=("$a") ;;
|
|
288
|
-
G) sln+=("$a"); srepo+=("$b"); have_step=1 ;;
|
|
289
|
-
XBAD) bare+=("$f:$a: a gh-repo-exempt marker with no reason") ;;
|
|
290
|
-
esac
|
|
291
|
-
done <<< "$stream"
|
|
292
|
-
finish_job
|
|
293
|
-
done
|
|
294
|
-
|
|
295
|
-
red=0
|
|
296
|
-
|
|
297
|
-
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
298
|
-
red=1
|
|
299
|
-
echo "check-action-gh-repo: a job invokes gh with no way to resolve a target"
|
|
300
|
-
echo "repository, so every call in it dies before its first request — on a tag,"
|
|
301
|
-
echo "where nothing else in the battery runs:"
|
|
302
|
-
printf ' %s\n' "${findings[@]}"
|
|
303
|
-
echo " help: add an actions/checkout step before the first gh call, or set"
|
|
304
|
-
echo " GH_REPO: \${{ github.repository }} on the workflow, the job, or the"
|
|
305
|
-
echo " invoking step's env:, or pass --repo on every gh call in the job."
|
|
306
|
-
echo " A job standing outside all three takes '# gh-repo-exempt: <reason>'."
|
|
307
|
-
fi
|
|
308
|
-
|
|
309
|
-
if [[ ${#bare[@]} -gt 0 ]]; then
|
|
310
|
-
red=1
|
|
311
|
-
echo "check-action-gh-repo: a gh-repo-exempt marker carries no reason, so it records"
|
|
312
|
-
echo "that an arm was stood outside of without saying which one or why:"
|
|
313
|
-
printf ' %s\n' "${bare[@]}"
|
|
314
|
-
echo " help: write the marker as '# gh-repo-exempt: <reason>' naming the arm the"
|
|
315
|
-
echo " job stands outside of, or delete it and satisfy an arm."
|
|
316
|
-
fi
|
|
317
|
-
|
|
318
|
-
[[ "$red" -eq 1 ]] && exit 1
|
|
319
|
-
|
|
320
|
-
echo "ACTION-GH-REPO: clean ($armed job(s) invoking gh across $subject Actions-shaped file(s) of $walked walked, all resolving a repository; $calls invocation(s) detected, $inert job(s) invoking none, $exempt exempt, $composite composite-action file(s) and $outside non-Actions file(s) skipped)"
|
|
321
|
-
exit 0
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=.github/workflows/*.yml,.github/workflows/*.yaml,.github/ISSUE_TEMPLATE/*.yml,docs/_config.yml,kit:templates/*.yml,kit:templates/*.yaml dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-action-pinning — every `uses:` ref in a scanned YAML file is immutable: a full 40-hex commit SHA, or a repo-local ./ path git pins at checkout
|
|
4
|
-
#
|
|
5
|
-
# usage: check-action-pinning.sh [scan-root]
|
|
6
|
-
# scan-root: the walked tree (default '.').
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
# shellcheck source=../lib/gate.sh
|
|
11
|
-
source "$SDK/lib/gate.sh"
|
|
12
|
-
|
|
13
|
-
SCANROOT="${1:-.}"
|
|
14
|
-
[[ -d "$SCANROOT" ]] || { echo "check-action-pinning: scan root not found: $SCANROOT" >&2; exit 2; }
|
|
15
|
-
|
|
16
|
-
listing="$(gate_find "$SCANROOT" -type f \( -name '*.yml' -o -name '*.yaml' \))"; st=$?
|
|
17
|
-
fail_closed "$st" ACTION-PINNING gate_find
|
|
18
|
-
mapfile -t files < <(printf '%s' "$listing")
|
|
19
|
-
|
|
20
|
-
if [[ ${#files[@]} -eq 0 ]]; then
|
|
21
|
-
echo "ACTION-PINNING: clean (no YAML under $SCANROOT — 0 uses: refs to pin)"
|
|
22
|
-
exit 0
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
scan="$(awk '
|
|
26
|
-
match($0, /^[[:space:]]*(#[[:space:]]*)?(-[[:space:]]+)?uses:[[:space:]]*/) {
|
|
27
|
-
v = substr($0, RSTART + RLENGTH)
|
|
28
|
-
sub(/[[:space:]].*$/, "", v)
|
|
29
|
-
gsub(/^[\047"]+|[\047"]+$/, "", v)
|
|
30
|
-
if (v != "") printf "%s:%d\t%s\n", FILENAME, FNR, v
|
|
31
|
-
}
|
|
32
|
-
' "${files[@]}")"; st=$?
|
|
33
|
-
fail_closed "$st" ACTION-PINNING awk
|
|
34
|
-
|
|
35
|
-
refs=0; stray=()
|
|
36
|
-
while IFS=$'\t' read -r loc ref || [[ -n "$loc" ]]; do
|
|
37
|
-
[[ -n "$ref" ]] || continue
|
|
38
|
-
refs=$((refs + 1))
|
|
39
|
-
[[ "$ref" == ./* ]] && continue
|
|
40
|
-
[[ "$ref" =~ @[0-9a-f]{40}$ ]] && continue
|
|
41
|
-
stray+=("$loc: $ref")
|
|
42
|
-
done <<< "$scan"
|
|
43
|
-
|
|
44
|
-
if [[ ${#stray[@]} -gt 0 ]]; then
|
|
45
|
-
echo "check-action-pinning: mutable action ref — a tag or branch is repointable by"
|
|
46
|
-
echo "whoever owns it, so the code a run executes is not the code that was reviewed:"
|
|
47
|
-
printf ' %s\n' "${stray[@]}"
|
|
48
|
-
echo " help: replace the ref with the full 40-hex commit SHA the tag resolves to,"
|
|
49
|
-
echo " keeping the tag as a trailing comment (uses: owner/repo@<sha> # v1.2.3)."
|
|
50
|
-
echo " A repo-local ./ action needs no pin — the checkout already pins it."
|
|
51
|
-
exit 1
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
echo "ACTION-PINNING: clean ($refs uses: ref(s) across ${#files[@]} YAML file(s) under $SCANROOT, all immutable)"
|
|
55
|
-
exit 0
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:smoke/*.sh,kit:gate-tests/*.test.sh,kit:bin/*.sh dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-assertion-strength — a guard over a call to a script whose declared `# exit:` header binds a verdict token to one non-zero code must not name that token in its failure message while comparing no status to that token's code
|
|
4
|
-
#
|
|
5
|
-
# usage: check-assertion-strength.sh [dir...] scan the named smoke/gate-tests dir(s)
|
|
6
|
-
# (no args) each kit's smoke/ and gate-tests/
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
# shellcheck source=../lib/gate.sh
|
|
11
|
-
source "$SDK/lib/gate.sh"
|
|
12
|
-
|
|
13
|
-
WINDOW=8
|
|
14
|
-
|
|
15
|
-
# spec: gate-sdk/SPEC.md §check-assertion-strength — the token->code grammar: each uppercase token binds to the nearest preceding integer on the line; a token bound to several codes or to code 0 is not discriminable and is dropped, which is what keeps an honest `did not verdict OK` message off the finding list
|
|
16
|
-
exit_map() {
|
|
17
|
-
awk '
|
|
18
|
-
/^#[[:space:]]*exit:/ {
|
|
19
|
-
sub(/^#[[:space:]]*exit:/, "")
|
|
20
|
-
code = -1
|
|
21
|
-
n = split($0, part, /[^A-Za-z0-9_-]+/)
|
|
22
|
-
for (i = 1; i <= n; i++) {
|
|
23
|
-
t = part[i]
|
|
24
|
-
if (t == "") continue
|
|
25
|
-
if (t ~ /^[0-9]+$/) { code = t + 0; continue }
|
|
26
|
-
if (code < 0) continue
|
|
27
|
-
if (t !~ /^[A-Z][A-Z0-9]*(-[A-Z0-9]+)*$/) continue
|
|
28
|
-
if (length(t) < 2) continue
|
|
29
|
-
if (t in code_of) { if (code_of[t] != code) dup[t] = 1 }
|
|
30
|
-
else code_of[t] = code
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
END { for (t in code_of) if (!(t in dup) && code_of[t] != 0) print t, code_of[t] }
|
|
34
|
-
' "$1"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
fail=0
|
|
38
|
-
scanned=0
|
|
39
|
-
declaring=0
|
|
40
|
-
declare -a findings=()
|
|
41
|
-
|
|
42
|
-
scan_file() {
|
|
43
|
-
local f="$1" kitroot="$2"
|
|
44
|
-
local -a L=()
|
|
45
|
-
mapfile -t L < "$f"
|
|
46
|
-
local n=${#L[@]} i j
|
|
47
|
-
|
|
48
|
-
local -a inv=()
|
|
49
|
-
for (( i = 0; i < n; i++ )); do
|
|
50
|
-
[[ "${L[i]}" =~ bin/([A-Za-z0-9._-]+\.sh) ]] || continue
|
|
51
|
-
[[ -r "$kitroot/bin/${BASH_REMATCH[1]}" ]] || continue
|
|
52
|
-
inv+=("$i")
|
|
53
|
-
done
|
|
54
|
-
[[ ${#inv[@]} -gt 0 ]] || return 0
|
|
55
|
-
|
|
56
|
-
local k callee name map tok code wtext gtext line stop cbstart
|
|
57
|
-
for (( k = 0; k < ${#inv[@]}; k++ )); do
|
|
58
|
-
i="${inv[k]}"
|
|
59
|
-
[[ "${L[i]}" =~ bin/([A-Za-z0-9._-]+\.sh) ]] || continue
|
|
60
|
-
name="${BASH_REMATCH[1]}"
|
|
61
|
-
callee="$kitroot/bin/$name"
|
|
62
|
-
map="$(exit_map "$callee")"; st=$?
|
|
63
|
-
fail_closed "$st" check-assertion-strength awk
|
|
64
|
-
[[ -n "$map" ]] || continue
|
|
65
|
-
declaring=$((declaring + 1))
|
|
66
|
-
|
|
67
|
-
[[ "${L[i]}" == *'||'*|| "${L[i]}" == *'&&'* || "${L[i]}" =~ ^[[:space:]]*if[[:space:]] || "${L[i]}" == *'; then'* ]] || continue
|
|
68
|
-
|
|
69
|
-
stop=$(( i + WINDOW ))
|
|
70
|
-
(( stop > n - 1 )) && stop=$(( n - 1 ))
|
|
71
|
-
(( k + 1 < ${#inv[@]} && inv[k+1] - 1 < stop )) && stop=$(( inv[k+1] - 1 ))
|
|
72
|
-
|
|
73
|
-
cbstart="$i"
|
|
74
|
-
while (( cbstart > 0 )) && [[ "${L[cbstart-1]}" =~ ^[[:space:]]*# ]]; do cbstart=$(( cbstart - 1 )); done
|
|
75
|
-
gtext=""
|
|
76
|
-
for (( j = cbstart; j <= stop; j++ )); do gtext+="${L[j]}"$'\n'; done
|
|
77
|
-
[[ "$gtext" =~ ^\ *#.*assertion-strength-exempt: || "$gtext" == *'assertion-strength-exempt:'* ]] && continue
|
|
78
|
-
|
|
79
|
-
wtext=""
|
|
80
|
-
for (( j = i; j <= stop; j++ )); do
|
|
81
|
-
line="${L[j]}"
|
|
82
|
-
[[ "$line" == *echo* || "$line" == *printf* ]] && wtext+="$line"$'\n'
|
|
83
|
-
done
|
|
84
|
-
[[ -n "$wtext" ]] || continue
|
|
85
|
-
|
|
86
|
-
while read -r tok code; do
|
|
87
|
-
[[ -n "$tok" ]] || continue
|
|
88
|
-
[[ "$wtext" =~ (^|[^A-Za-z0-9_-])"$tok"([^A-Za-z0-9_-]|$) ]] || continue
|
|
89
|
-
[[ "$gtext" =~ (-eq|-ne|==|!=)[[:space:]]*\"?"$code"\"? ]] && continue
|
|
90
|
-
[[ "$gtext" =~ (^|[^A-Za-z0-9_-])"$code"\) ]] && continue
|
|
91
|
-
findings+=("$f:$(( i + 1 )): message names $tok (exit $code of $name) but the guard compares no status to $code")
|
|
92
|
-
fail=1
|
|
93
|
-
done <<<"$map"
|
|
94
|
-
done
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
declare -a scan_dirs=()
|
|
98
|
-
if [[ $# -gt 0 ]]; then
|
|
99
|
-
scan_dirs=("$@")
|
|
100
|
-
else
|
|
101
|
-
while IFS= read -r k; do
|
|
102
|
-
[[ -d "$k/smoke" ]] && scan_dirs+=("$k/smoke")
|
|
103
|
-
[[ -d "$k/gate-tests" ]] && scan_dirs+=("$k/gate-tests")
|
|
104
|
-
done < <(gate_kit_roots)
|
|
105
|
-
fi
|
|
106
|
-
|
|
107
|
-
shopt -s nullglob
|
|
108
|
-
for d in "${scan_dirs[@]}"; do
|
|
109
|
-
[[ -d "$d" ]] || { echo "check-assertion-strength: not a directory: $d" >&2; exit 2; }
|
|
110
|
-
kitroot="$(cd "$d/.." && pwd)"
|
|
111
|
-
for f in "$d"/*.sh; do
|
|
112
|
-
[[ -r "$f" ]] || { echo "check-assertion-strength: unreadable script: $f" >&2; exit 2; }
|
|
113
|
-
scanned=$((scanned + 1))
|
|
114
|
-
scan_file "$f" "$kitroot"
|
|
115
|
-
done
|
|
116
|
-
done
|
|
117
|
-
shopt -u nullglob
|
|
118
|
-
|
|
119
|
-
if [[ "$fail" -ne 0 ]]; then
|
|
120
|
-
echo "check-assertion-strength: guard(s) whose failure message is more specific than the"
|
|
121
|
-
echo "guard behind it — the message names a verdict token the callee's declared '# exit:'"
|
|
122
|
-
echo "header binds to one non-zero code, but the guard discriminates only zero from"
|
|
123
|
-
echo "non-zero, so a different failure mode reports itself under the wrong name"
|
|
124
|
-
echo "(gate-sdk/SPEC.md §check-assertion-strength):"
|
|
125
|
-
for m in "${findings[@]}"; do echo " $m"; done
|
|
126
|
-
echo " help: capture the status and compare it to the code the message claims —"
|
|
127
|
-
echo " cmd && rc=0 || rc=\$? then if [[ \"\$rc\" -ne <code> ]]; then …"
|
|
128
|
-
echo " (report the observed status in the message), OR reword the message to claim only"
|
|
129
|
-
echo " what truthiness establishes, OR add a '# assertion-strength-exempt: <reason>' line"
|
|
130
|
-
echo " on a guard that establishes the outcome by other means."
|
|
131
|
-
exit 1
|
|
132
|
-
fi
|
|
133
|
-
echo "ASSERTION-STRENGTH: clean ($scanned script(s) scanned; $declaring call(s) to a script with a declared exit contract)"
|
|
134
|
-
exit 0
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=README.md,kit:gate-tests/* dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-kit-registration — every gate_kit_roots kit is registered in the human-facing docs: a registry-doc row linking into each root, and a fixture-runner line for each root that ships gate-tests
|
|
4
|
-
#
|
|
5
|
-
# usage: check-kit-registration.sh [registry-doc [runner-doc]]
|
|
6
|
-
# docs resolve relative to the git toplevel; defaults README.md / README.md,
|
|
7
|
-
# overridable via GATE_SDK_REGISTRY_DOC / GATE_SDK_RUNNER_DOC.
|
|
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
|
-
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
|
|
15
|
-
|| { echo "check-kit-registration: not a git repository — cannot test tracked kit files" >&2; exit 2; }
|
|
16
|
-
|
|
17
|
-
REGISTRY_DOC="${1:-${GATE_SDK_REGISTRY_DOC:-README.md}}"
|
|
18
|
-
RUNNER_DOC="${2:-${GATE_SDK_RUNNER_DOC:-README.md}}"
|
|
19
|
-
[[ "$REGISTRY_DOC" == /* ]] || REGISTRY_DOC="$REPO_ROOT/$REGISTRY_DOC"
|
|
20
|
-
[[ "$RUNNER_DOC" == /* ]] || RUNNER_DOC="$REPO_ROOT/$RUNNER_DOC"
|
|
21
|
-
[[ -f "$REGISTRY_DOC" ]] || { echo "check-kit-registration: registry doc not found: $REGISTRY_DOC" >&2; exit 2; }
|
|
22
|
-
[[ -f "$RUNNER_DOC" ]] || { echo "check-kit-registration: runner doc not found: $RUNNER_DOC" >&2; exit 2; }
|
|
23
|
-
|
|
24
|
-
mapfile -t KIT_ROOTS < <(gate_kit_roots_rel)
|
|
25
|
-
[[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-kit-registration: no kit roots enumerated" >&2; exit 2; }
|
|
26
|
-
|
|
27
|
-
root_ships_gate_tests() {
|
|
28
|
-
local root="$1" out st
|
|
29
|
-
out="$(git -C "$REPO_ROOT" ls-files -- "${root%/}/gate-tests/" 2>/dev/null)"; st=$?
|
|
30
|
-
fail_closed "$st" check-kit-registration "git ls-files"
|
|
31
|
-
[[ -n "$out" ]]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
missing_row=()
|
|
35
|
-
missing_runner=()
|
|
36
|
-
runner_owed=0
|
|
37
|
-
for r in "${KIT_ROOTS[@]}"; do
|
|
38
|
-
r="${r%/}"
|
|
39
|
-
# assertion A: registry row — a '](<kit>/…' link into the root in the registry doc
|
|
40
|
-
grep -qF -- "]($r/" "$REGISTRY_DOC" || missing_row+=("$r")
|
|
41
|
-
# assertion B: fixture-runner line — a '<kit>/gate-tests' line for each root shipping gate-tests
|
|
42
|
-
if root_ships_gate_tests "$r"; then
|
|
43
|
-
runner_owed=$((runner_owed + 1))
|
|
44
|
-
grep -qF -- "$r/gate-tests" "$RUNNER_DOC" || missing_runner+=("$r")
|
|
45
|
-
fi
|
|
46
|
-
done
|
|
47
|
-
|
|
48
|
-
if [[ ${#missing_row[@]} -gt 0 || ${#missing_runner[@]} -gt 0 ]]; then
|
|
49
|
-
if [[ ${#missing_row[@]} -gt 0 ]]; then
|
|
50
|
-
echo "check-kit-registration: kit root(s) not registered in the registry doc"
|
|
51
|
-
echo "($REGISTRY_DOC has no '](<kit>/' link row):"
|
|
52
|
-
for r in "${missing_row[@]}"; do echo " $r"; done
|
|
53
|
-
fi
|
|
54
|
-
if [[ ${#missing_runner[@]} -gt 0 ]]; then
|
|
55
|
-
[[ ${#missing_row[@]} -gt 0 ]] && echo ""
|
|
56
|
-
echo "check-kit-registration: kit root(s) shipping gate-tests but absent from the"
|
|
57
|
-
echo "fixture-runner battery ($RUNNER_DOC names no '<kit>/gate-tests' line):"
|
|
58
|
-
for r in "${missing_runner[@]}"; do echo " $r"; done
|
|
59
|
-
fi
|
|
60
|
-
echo " help: add the kit's registry row to $REGISTRY_DOC (a '](<kit>/' link — bare"
|
|
61
|
-
echo " dir or a page under it, e.g. '](<kit>/index.md)') and,"
|
|
62
|
-
echo " for a kit that ships gate-tests, its 'run-gate-tests.sh <kit>/gate-tests'"
|
|
63
|
-
echo " line to $RUNNER_DOC, so a landed kit cannot fall out of the docs."
|
|
64
|
-
exit 1
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
echo "KIT-REGISTRATION: clean (${#KIT_ROOTS[@]} kit root(s) each carry a registry row; ${runner_owed} shipping gate-tests each name a fixture-runner line)"
|
|
68
|
-
exit 0
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:smoke/install.sh,kit:smoke/violation.sh dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-smoke-entry-guard — every mutating smoke script (install.sh, violation.sh) carries the ${SMOKE_KIT_ROOT:?} entry-point guard so a bare run refuses instead of mutating the caller's tree
|
|
4
|
-
#
|
|
5
|
-
# usage: check-smoke-entry-guard.sh [root]
|
|
6
|
-
# bare: sweep gate_kit_roots against the git toplevel; root: resolve relative
|
|
7
|
-
# kit roots against a fixture tree (the case dir's gate-sdk-config.sh names them).
|
|
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
|
-
ROOT="${1:-}"
|
|
15
|
-
if [[ -z "$ROOT" ]]; then
|
|
16
|
-
ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
|
|
17
|
-
|| { echo "check-smoke-entry-guard: not a git repository and no root argument" >&2; exit 2; }
|
|
18
|
-
fi
|
|
19
|
-
[[ -d "$ROOT" ]] || { echo "check-smoke-entry-guard: root not found: $ROOT" >&2; exit 2; }
|
|
20
|
-
|
|
21
|
-
GUARD='${SMOKE_KIT_ROOT:?'
|
|
22
|
-
|
|
23
|
-
mapfile -t KIT_ROOTS < <(gate_kit_roots)
|
|
24
|
-
[[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-smoke-entry-guard: no kit roots enumerated" >&2; exit 2; }
|
|
25
|
-
|
|
26
|
-
findings=()
|
|
27
|
-
swept=0
|
|
28
|
-
for r in "${KIT_ROOTS[@]}"; do
|
|
29
|
-
r="${r%/}"
|
|
30
|
-
abs="$r"
|
|
31
|
-
[[ "$abs" == /* ]] || abs="$ROOT/$r"
|
|
32
|
-
kit="${r##*/}"
|
|
33
|
-
[[ -d "$abs/smoke" ]] || continue
|
|
34
|
-
for name in install.sh violation.sh; do
|
|
35
|
-
f="$abs/smoke/$name"
|
|
36
|
-
[[ -e "$f" ]] || continue
|
|
37
|
-
[[ -r "$f" ]] || { echo "check-smoke-entry-guard: unreadable smoke script: $kit/smoke/$name" >&2; exit 2; }
|
|
38
|
-
swept=$((swept + 1))
|
|
39
|
-
grep -qF -- "$GUARD" "$f" || findings+=("$kit/smoke/$name: no \${SMOKE_KIT_ROOT:?…} entry-point guard")
|
|
40
|
-
done
|
|
41
|
-
done
|
|
42
|
-
|
|
43
|
-
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
44
|
-
echo "check-smoke-entry-guard: mutating smoke script(s) missing the entry-point guard:"
|
|
45
|
-
for f in "${findings[@]}"; do echo " $f"; done
|
|
46
|
-
echo " help: add ': \"\${SMOKE_KIT_ROOT:?run via run-consumer-smoke.sh}\"' right after"
|
|
47
|
-
echo " 'set -euo pipefail' and before the first mutating command, so a bare run"
|
|
48
|
-
echo " refuses instead of writing into the caller's repo (gate-sdk/SPEC.md §Consumer smoke)."
|
|
49
|
-
exit 1
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
echo "SMOKE-ENTRY-GUARD: clean ($swept mutating smoke script(s) carry the entry-point guard)"
|
|
53
|
-
exit 0
|