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
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# graph: couples=scripts/gates.list,kit:checks/*,gate-sdk/SPEC.md,native/*,.github/workflows/publish.yml dir=one valve=none tier=precommit
|
|
3
|
+
# install: on-surface
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — one declaration per member, descriptor/subcommand parity both ways, a recorded disposition for every substrate-sensitive member, no implementation source inside the vendoring set, and one owner for the target roster the artifact path derives from
|
|
5
|
+
#
|
|
6
|
+
# usage: check-gate-substrate-parity.sh [gates-dir] [conservation-doc]
|
|
7
|
+
# two args: steer onto hermetic fixture copies of each surface.
|
|
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
|
+
GATES_DIR="${1:-$(gate_sdk_gates_dir)}"
|
|
15
|
+
DOC="${2:-$SDK/SPEC.md}"
|
|
16
|
+
LIST="$GATES_DIR/gates.list"
|
|
17
|
+
SECTION="## Meta-gate conservation for the binary substrate"
|
|
18
|
+
|
|
19
|
+
[[ -f "$LIST" ]] || { echo "check-gate-substrate-parity: no registry at $LIST" >&2; exit 2; }
|
|
20
|
+
[[ -f "$DOC" ]] || { echo "check-gate-substrate-parity: conservation doc not found: $DOC" >&2; exit 2; }
|
|
21
|
+
|
|
22
|
+
mapfile -t MEMBERS < <(gates_list_members "$LIST")
|
|
23
|
+
[[ ${#MEMBERS[@]} -gt 0 ]] || { echo "check-gate-substrate-parity: $LIST names no gates" >&2; exit 2; }
|
|
24
|
+
|
|
25
|
+
RESOLVE_DIRS=("$GATES_DIR")
|
|
26
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — assertion B's roster half scopes to the
|
|
27
|
+
# kits this tree vendored, so the same walk that builds the resolve dirs records their names
|
|
28
|
+
KIT_NAMES=()
|
|
29
|
+
while IFS= read -r k; do
|
|
30
|
+
RESOLVE_DIRS+=("$k/checks")
|
|
31
|
+
k="${k%/}"
|
|
32
|
+
KIT_NAMES+=("${k##*/}")
|
|
33
|
+
done < <(gate_kit_roots_rel)
|
|
34
|
+
|
|
35
|
+
# spec: gate-sdk/SPEC.md §Meta-gate conservation for the binary substrate — the one
|
|
36
|
+
# disposition surface, read by assertion B's reference-only allowance and assertion C
|
|
37
|
+
section="$(awk -v s="$SECTION" '
|
|
38
|
+
$0 == s { inb = 1; next }
|
|
39
|
+
inb && /^## / { inb = 0 }
|
|
40
|
+
inb { print }
|
|
41
|
+
' "$DOC")"; st=$?
|
|
42
|
+
fail_closed "$st" check-gate-substrate-parity awk
|
|
43
|
+
[[ -n "$section" ]] || { echo "check-gate-substrate-parity: no '$SECTION' section in $DOC" >&2; exit 2; }
|
|
44
|
+
|
|
45
|
+
findings=()
|
|
46
|
+
|
|
47
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — assertion F's publishing-tree test: the
|
|
48
|
+
# crate's *tracked source* is here, step 1 of §check-gate-binary-fresh's source stamp reused rather
|
|
49
|
+
# than spelled twice — source, so build output under the crate root cannot read as a publisher
|
|
50
|
+
crate_source_here() {
|
|
51
|
+
[[ -d "$1" ]] || return 1
|
|
52
|
+
[[ -n "$(git -C "$1" ls-files 2>/dev/null)" ]]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# assertion A: each member resolves to exactly one declaration — a dir carrying
|
|
56
|
+
# both <name>.sh and <name>.gate is ambiguous dispatch, never resolved by order
|
|
57
|
+
declared=0
|
|
58
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — a descriptor on disk is a declaration;
|
|
59
|
+
# a registered member resolving to one is a dispatch, and only a dispatch makes the binary
|
|
60
|
+
# load-bearing. Derived here because assertion A already resolves every member.
|
|
61
|
+
dispatching=0
|
|
62
|
+
for m in "${MEMBERS[@]}"; do
|
|
63
|
+
for d in "${RESOLVE_DIRS[@]}"; do
|
|
64
|
+
if [[ -f "$d/$m.sh" && -f "$d/$m.gate" ]]; then
|
|
65
|
+
findings+=("ambiguous dispatch: $d carries both $m.sh and $m.gate")
|
|
66
|
+
fi
|
|
67
|
+
done
|
|
68
|
+
if ! src="$(gate_resolve "$m" "${RESOLVE_DIRS[@]}")"; then
|
|
69
|
+
findings+=("unresolvable member: $m declares in none of: ${RESOLVE_DIRS[*]}")
|
|
70
|
+
continue
|
|
71
|
+
fi
|
|
72
|
+
[[ "$src" == *.gate ]] && dispatching=$((dispatching + 1))
|
|
73
|
+
declared=$((declared + 1))
|
|
74
|
+
done
|
|
75
|
+
|
|
76
|
+
# assertion B: the .gate descriptors on disk and the binary's reported subcommand
|
|
77
|
+
# roster are the same set, with 'reference-only' the one dispositioned exception
|
|
78
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity
|
|
79
|
+
mapfile -t DESCRIPTORS < <(
|
|
80
|
+
for d in "${RESOLVE_DIRS[@]}"; do
|
|
81
|
+
[[ -d "$d" ]] || continue
|
|
82
|
+
for f in "$d"/*.gate; do
|
|
83
|
+
[[ -f "$f" ]] || continue
|
|
84
|
+
b="${f##*/}"; printf '%s\n' "${b%.gate}"
|
|
85
|
+
done
|
|
86
|
+
done | sort -u
|
|
87
|
+
)
|
|
88
|
+
BIN="$(gate_native_bin)"
|
|
89
|
+
subcommands=()
|
|
90
|
+
refonly=0
|
|
91
|
+
roster_read=0
|
|
92
|
+
in_scope=0
|
|
93
|
+
out_of_scope=0
|
|
94
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — the fallback state is printed as its own
|
|
95
|
+
# word: a binary predating the owner column cannot answer which kit owns a subcommand, and the
|
|
96
|
+
# honest verdict there is today's unrestricted equality, declared rather than assumed
|
|
97
|
+
owner_state=scoped
|
|
98
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — the fail-closed arm is on the corrected
|
|
99
|
+
# predicate: descriptors nothing registered dispatches to leave the binary not load-bearing
|
|
100
|
+
if [[ "$dispatching" -gt 0 && ! -x "$BIN" ]]; then
|
|
101
|
+
echo "check-gate-substrate-parity: $BIN is absent or not executable, but $dispatching registered member(s) dispatch to it — the check could not run; treating as failure (not clean)" >&2
|
|
102
|
+
echo " help: build it — bash gate-sdk/bin/build-native.sh" >&2
|
|
103
|
+
exit 2
|
|
104
|
+
fi
|
|
105
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — the roster half is gated on a
|
|
106
|
+
# readable binary, never on descriptor count
|
|
107
|
+
if [[ -x "$BIN" ]]; then
|
|
108
|
+
roster_read=1
|
|
109
|
+
listing="$("$BIN" --list)"; st=$?
|
|
110
|
+
fail_closed "$st" check-gate-substrate-parity "$BIN --list"
|
|
111
|
+
mapfile -t rows < <(printf '%s\n' "$listing" | grep -v '^$' | sort -u)
|
|
112
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — `<subcommand>\t<owning-kit>`; one
|
|
113
|
+
# row without the column drops the whole roster to the unrestricted equality, because a
|
|
114
|
+
# partly-scoped roster would speak for kits it could not place
|
|
115
|
+
owners=()
|
|
116
|
+
for row in "${rows[@]+"${rows[@]}"}"; do
|
|
117
|
+
subcommands+=("${row%%$'\t'*}")
|
|
118
|
+
if [[ "$row" == *$'\t'* ]]; then owners+=("${row#*$'\t'}"); else owners+=(""); owner_state=unavailable; fi
|
|
119
|
+
done
|
|
120
|
+
for g in "${DESCRIPTORS[@]+"${DESCRIPTORS[@]}"}"; do
|
|
121
|
+
printf '%s\n' "${subcommands[@]}" | grep -qx -- "$g" \
|
|
122
|
+
|| findings+=("descriptor names no subcommand: $g.gate declares a gate the binary does not carry")
|
|
123
|
+
done
|
|
124
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — the roster half speaks only for the
|
|
125
|
+
# kits this tree vendored: a subcommand whose owning kit is absent is neither dead code nor
|
|
126
|
+
# a half-finished port, it is out of scope, and it is counted rather than dropped silently
|
|
127
|
+
for i in "${!subcommands[@]}"; do
|
|
128
|
+
s="${subcommands[$i]}"
|
|
129
|
+
if [[ "$owner_state" == scoped ]] && ! printf '%s\n' "${KIT_NAMES[@]+"${KIT_NAMES[@]}"}" | grep -qx -- "${owners[$i]}"; then
|
|
130
|
+
out_of_scope=$((out_of_scope + 1))
|
|
131
|
+
continue
|
|
132
|
+
fi
|
|
133
|
+
in_scope=$((in_scope + 1))
|
|
134
|
+
printf '%s\n' "${DESCRIPTORS[@]+"${DESCRIPTORS[@]}"}" | grep -qx -- "$s" && continue
|
|
135
|
+
if grep -F -- "\`$s\`" <<<"$section" | grep -qi -- 'reference-only'; then
|
|
136
|
+
refonly=$((refonly + 1))
|
|
137
|
+
continue
|
|
138
|
+
fi
|
|
139
|
+
findings+=("subcommand nothing declares: the binary carries '$s' with no $s.gate descriptor and no reference-only disposition in $SECTION")
|
|
140
|
+
done
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
# assertion C: every derived substrate-sensitive member carries a disposition in
|
|
144
|
+
# the conservation section — the anti-vacuity assertion, so a new meta-gate over
|
|
145
|
+
# gate source reds until its disposition is recorded
|
|
146
|
+
mapfile -t DECLPATHS < <(
|
|
147
|
+
for m in "${MEMBERS[@]}"; do gate_resolve "$m" "${RESOLVE_DIRS[@]}" || true; done
|
|
148
|
+
)
|
|
149
|
+
sensitive=0
|
|
150
|
+
for m in "${MEMBERS[@]}"; do
|
|
151
|
+
src="$(gate_resolve "$m" "${RESOLVE_DIRS[@]}")" || continue
|
|
152
|
+
couples="$(gate_manifest_field "$src" couples)"
|
|
153
|
+
[[ -n "$couples" ]] || continue
|
|
154
|
+
gate_expand_couples_var couples "$couples"
|
|
155
|
+
IFS=',' read -ra globs <<<"$couples"
|
|
156
|
+
hit=0
|
|
157
|
+
for g in "${globs[@]}"; do
|
|
158
|
+
for p in "${DECLPATHS[@]}"; do
|
|
159
|
+
# shellcheck disable=SC2053
|
|
160
|
+
if [[ "$p" == $g ]]; then hit=1; break 2; fi
|
|
161
|
+
done
|
|
162
|
+
done
|
|
163
|
+
(( hit )) || continue
|
|
164
|
+
sensitive=$((sensitive + 1))
|
|
165
|
+
grep -qF -- "\`$m\`" <<<"$section" \
|
|
166
|
+
|| findings+=("no recorded disposition: $m is substrate-sensitive (its couples= covers a gate declaration path) but $SECTION does not name it")
|
|
167
|
+
done
|
|
168
|
+
|
|
169
|
+
# assertion D: manifest-class annotations live in the declaration only — a second
|
|
170
|
+
# writable copy in the implementation is an SSOT violation that drifts silently,
|
|
171
|
+
# and the manifest must stay readable with no build and no execution
|
|
172
|
+
IMPL_DIR="${GATE_SDK_NATIVE_SRC:-native/src}"
|
|
173
|
+
impl_scanned=0
|
|
174
|
+
if [[ -d "$IMPL_DIR" ]]; then
|
|
175
|
+
while IFS= read -r f; do
|
|
176
|
+
[[ -n "$f" ]] || continue
|
|
177
|
+
impl_scanned=$((impl_scanned + 1))
|
|
178
|
+
while IFS= read -r hit; do
|
|
179
|
+
[[ -n "$hit" ]] || continue
|
|
180
|
+
findings+=("manifest-class annotation in implementation source: $f:${hit%%:*} — the '# graph:' manifest belongs to the declaration path alone")
|
|
181
|
+
done < <(grep -nE '^[[:space:]]*(#|//|/\*)[[:space:]]*graph:[[:space:]]' "$f" || true)
|
|
182
|
+
done < <(gate_find "$IMPL_DIR" -type f)
|
|
183
|
+
fi
|
|
184
|
+
|
|
185
|
+
# assertion E: opacity is held by structure — a ported gate's implementation source
|
|
186
|
+
# may not reach the vendoring set, whose members are exactly the kit roots
|
|
187
|
+
# spec: gate-sdk/SPEC.md §Consumer payload
|
|
188
|
+
CRATE="$(gate_native_crate)"
|
|
189
|
+
declare -A DESCRIPTOR_SET=()
|
|
190
|
+
for g in "${DESCRIPTORS[@]+"${DESCRIPTORS[@]}"}"; do DESCRIPTOR_SET["$g"]=1; done
|
|
191
|
+
kit_scanned=0
|
|
192
|
+
while IFS= read -r root; do
|
|
193
|
+
root="${root%/}"
|
|
194
|
+
if [[ "$CRATE" == "$root" || "$CRATE" == "$root"/* ]]; then
|
|
195
|
+
findings+=("crate root inside the vendoring set: $CRATE sits under kit root $root — a kit root vendors whole, so the implementation source would ship with it")
|
|
196
|
+
fi
|
|
197
|
+
[[ ${#DESCRIPTOR_SET[@]} -gt 0 && -d "$root" ]] || continue
|
|
198
|
+
kit_scanned=$((kit_scanned + 1))
|
|
199
|
+
while IFS= read -r f; do
|
|
200
|
+
[[ -n "$f" ]] || continue
|
|
201
|
+
base="${f##*/}"
|
|
202
|
+
stem="${base%.*}"
|
|
203
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — an extensionless name is out of reach by contract, and .gate/.sh are owned by the descriptor itself and by assertion A
|
|
204
|
+
[[ "$stem" == "$base" ]] && continue
|
|
205
|
+
ext="${base##*.}"
|
|
206
|
+
[[ "$ext" == gate || "$ext" == sh ]] && continue
|
|
207
|
+
if [[ -n "${DESCRIPTOR_SET[$stem]:-}" ]]; then
|
|
208
|
+
findings+=("implementation sibling in the vendoring set: $f shares its name with the $stem.gate descriptor — a ported gate's implementation may not sit under a kit root")
|
|
209
|
+
fi
|
|
210
|
+
done < <(gate_find "$root" -type f)
|
|
211
|
+
done < <(gate_kit_roots_rel)
|
|
212
|
+
|
|
213
|
+
# assertion F: the target roster has one owner and the publish path derives from it
|
|
214
|
+
# — the roster is what asserts platform support, so a second spelling of it (a
|
|
215
|
+
# platform literal in the build matrix) or a second producer of a published digest
|
|
216
|
+
# is the failure this assertion exists to make impossible
|
|
217
|
+
# spec: gate-sdk/SPEC.md §Consumer payload
|
|
218
|
+
ROSTER="$(gate_native_targets_file)"
|
|
219
|
+
roster_targets=0
|
|
220
|
+
roster_state="absent"
|
|
221
|
+
if [[ -f "$ROSTER" ]]; then
|
|
222
|
+
roster_state="read"
|
|
223
|
+
mapfile -t TARGETS < <(gates_list_members "$ROSTER")
|
|
224
|
+
if [[ ${#TARGETS[@]} -eq 0 ]]; then
|
|
225
|
+
findings+=("empty target roster: $ROSTER declares no target — a roster asserting no platform support cannot be the surface that asserts it")
|
|
226
|
+
fi
|
|
227
|
+
for t in "${TARGETS[@]}"; do
|
|
228
|
+
roster_targets=$((roster_targets + 1))
|
|
229
|
+
[[ "$t" =~ ^[A-Za-z0-9_]+(-[A-Za-z0-9_.]+){2,3}$ ]] \
|
|
230
|
+
|| findings+=("malformed target triple: '$t' in $ROSTER is not <arch>-<vendor>-<os>[-<env>]")
|
|
231
|
+
done
|
|
232
|
+
elif [[ "$dispatching" -gt 0 ]] && crate_source_here "$CRATE"; then
|
|
233
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — assertion F rides the corrected
|
|
234
|
+
# predicate *and* the publishing-tree test: declaring platform support is the act of the tree
|
|
235
|
+
# that builds and publishes the artifact, and a consumer receives kit roots but never the crate
|
|
236
|
+
findings+=("no target roster: $ROSTER is absent, but $dispatching registered member(s) dispatch to the binary and $CRATE carries tracked source here — a tree that builds the artifact declares the platforms it carries one for")
|
|
237
|
+
fi
|
|
238
|
+
|
|
239
|
+
WORKFLOW="${GATE_SDK_NATIVE_PUBLISH_WORKFLOW:-.github/workflows/publish.yml}"
|
|
240
|
+
wf_state="absent"
|
|
241
|
+
wf_matrix=0
|
|
242
|
+
wf_jobs=0
|
|
243
|
+
if [[ -f "$WORKFLOW" ]]; then
|
|
244
|
+
wf_state="read"
|
|
245
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — assertion F, roster-derived matrix: every value in a matrix declaration is a GitHub expression, never a literal
|
|
246
|
+
matrix_lits="$(awk '
|
|
247
|
+
function ind(s, n) { n = match(s, /[^ ]/); return (n == 0) ? -1 : n - 1 }
|
|
248
|
+
inb {
|
|
249
|
+
if ($0 ~ /^[[:space:]]*$/) next
|
|
250
|
+
if (ind($0) > keycol) {
|
|
251
|
+
if ($0 !~ /^[[:space:]]*#/ && index($0, "${{") == 0)
|
|
252
|
+
printf "%d\t%s\n", FNR, $0
|
|
253
|
+
next
|
|
254
|
+
}
|
|
255
|
+
inb = 0
|
|
256
|
+
}
|
|
257
|
+
/^[[:space:]]*matrix:[[:space:]]*$/ { inb = 1; keycol = ind($0); n++; next }
|
|
258
|
+
/^[[:space:]]*matrix:[[:space:]]*[^[:space:]]/ {
|
|
259
|
+
n++
|
|
260
|
+
if (index($0, "${{") == 0) printf "%d\t%s\n", FNR, $0
|
|
261
|
+
}
|
|
262
|
+
END { printf "#\t%d\n", n }
|
|
263
|
+
' "$WORKFLOW")"; st=$?
|
|
264
|
+
fail_closed "$st" check-gate-substrate-parity "awk matrix($WORKFLOW)"
|
|
265
|
+
while IFS=$'\t' read -r ln text; do
|
|
266
|
+
[[ -n "$ln" ]] || continue
|
|
267
|
+
if [[ "$ln" == "#" ]]; then wf_matrix="$text"; continue; fi
|
|
268
|
+
text="${text#"${text%%[![:space:]]*}"}"
|
|
269
|
+
findings+=("matrix declaration not roster-derived: $WORKFLOW:$ln '$text' is a literal where an expression over $ROSTER belongs — a hand-written platform in a build matrix is a second spelling of the support commitment")
|
|
270
|
+
done <<<"$matrix_lits"
|
|
271
|
+
|
|
272
|
+
# spec: gate-sdk/SPEC.md §check-gate-substrate-parity — assertion F, one producer per digest: a job computes at most one, and a job that downloads a run artifact and uploads none computes none
|
|
273
|
+
digests="$(awk '
|
|
274
|
+
function emit() { if (job != "") printf "%s\t%d\t%d\t%d\n", job, d, dl, ul }
|
|
275
|
+
/^jobs:[[:space:]]*$/ { injobs = 1; next }
|
|
276
|
+
injobs && /^[^[:space:]#]/ { emit(); job = ""; injobs = 0 }
|
|
277
|
+
injobs && /^ [A-Za-z0-9_-]+:[[:space:]]*$/ {
|
|
278
|
+
emit()
|
|
279
|
+
job = $0; sub(/^ +/, "", job); sub(/:.*$/, "", job)
|
|
280
|
+
d = 0; dl = 0; ul = 0
|
|
281
|
+
next
|
|
282
|
+
}
|
|
283
|
+
job != "" {
|
|
284
|
+
if ($0 !~ /^[[:space:]]*#/ && $0 ~ /sha256sum/ && $0 !~ /sha256sum[[:space:]]+-c/) d++
|
|
285
|
+
if ($0 ~ /uses:[[:space:]]*[^[:space:]]*download-artifact/) dl = 1
|
|
286
|
+
if ($0 ~ /uses:[[:space:]]*[^[:space:]]*upload-artifact/) ul = 1
|
|
287
|
+
}
|
|
288
|
+
END { emit() }
|
|
289
|
+
' "$WORKFLOW")"; st=$?
|
|
290
|
+
fail_closed "$st" check-gate-substrate-parity "awk digests($WORKFLOW)"
|
|
291
|
+
while IFS=$'\t' read -r job d dl ul; do
|
|
292
|
+
[[ -n "$job" ]] || continue
|
|
293
|
+
wf_jobs=$((wf_jobs + 1))
|
|
294
|
+
if [[ "$d" -gt 1 ]]; then
|
|
295
|
+
findings+=("digest recomputed: job '$job' in $WORKFLOW computes $d digests — each is emitted once, where its bytes are produced, and moved thereafter")
|
|
296
|
+
elif [[ "$d" -gt 0 && "$dl" == 1 && "$ul" == 0 ]]; then
|
|
297
|
+
findings+=("digest computed by a consumer: job '$job' in $WORKFLOW downloads a run artifact, produces none, and still computes a digest — it must move the sidecar it received, never re-derive it")
|
|
298
|
+
fi
|
|
299
|
+
done <<<"$digests"
|
|
300
|
+
fi
|
|
301
|
+
|
|
302
|
+
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
303
|
+
echo "check-gate-substrate-parity: the gate substrate seam is not conserved:"
|
|
304
|
+
printf ' %s\n' "${findings[@]}"
|
|
305
|
+
echo " help: one declaration per member — delete the stale .sh or .gate where a dir"
|
|
306
|
+
echo " carries both. Keep the descriptor set and the binary's --list roster equal:"
|
|
307
|
+
echo " add the missing .gate, or drop the subcommand nothing declares — or,"
|
|
308
|
+
echo " for an implementation deliberately kept ahead of any live port, give it"
|
|
309
|
+
echo " a 'reference-only' disposition naming it in $SECTION."
|
|
310
|
+
echo " A substrate-sensitive member with no disposition is recorded in"
|
|
311
|
+
echo " $DOC $SECTION — say ported, retained, or retired with cause;"
|
|
312
|
+
echo " an unrecorded one silently stops asserting when a gate ports."
|
|
313
|
+
echo " help: delete a manifest-class annotation from implementation source — the"
|
|
314
|
+
echo " '# graph:' manifest has exactly one writable home, the declaration"
|
|
315
|
+
echo " path, so that every reader of it works with no build and no execution."
|
|
316
|
+
echo " help: move a ported gate's implementation out of every kit root, and keep the"
|
|
317
|
+
echo " crate root outside them too — a kit root vendors whole, so anything"
|
|
318
|
+
echo " under one ships, and the payload withholds the predicate by structure."
|
|
319
|
+
echo " help: the target roster is the one surface asserting platform support — keep"
|
|
320
|
+
echo " every live line a well-formed target triple, derive the publish"
|
|
321
|
+
echo " workflow's matrix from it rather than spelling a platform there, and"
|
|
322
|
+
echo " emit each artifact's digest in exactly one step, where its bytes are"
|
|
323
|
+
echo " produced. A runner mapping may name a platform; a matrix may not."
|
|
324
|
+
exit 1
|
|
325
|
+
fi
|
|
326
|
+
|
|
327
|
+
if [[ "$roster_read" == 1 ]]; then
|
|
328
|
+
roster="${#DESCRIPTORS[@]} descriptor(s) in parity with the ${#subcommands[@]}-subcommand roster ($in_scope in scope, $out_of_scope owned by a kit this tree did not vendor, owner column $owner_state), $refonly reference-only"
|
|
329
|
+
else
|
|
330
|
+
roster="${#DESCRIPTORS[@]} descriptor(s), no binary at $BIN so no subcommand roster to compare"
|
|
331
|
+
fi
|
|
332
|
+
echo "GATE-SUBSTRATE-PARITY: clean ($declared member(s) with one declaration each, $dispatching of them dispatching to the binary; $roster; $sensitive substrate-sensitive member(s) all dispositioned; $impl_scanned implementation source(s) free of manifest-class annotation; $kit_scanned kit root(s) scanned for an implementation sibling, crate root $CRATE outside every kit root; target roster $roster_state at $ROSTER with $roster_targets well-formed target(s); publish workflow $wf_state at $WORKFLOW, $wf_matrix matrix declaration(s) roster-derived across $wf_jobs job(s) with one producer per digest)"
|
|
333
|
+
exit 0
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=scripts/gates.list,scripts/*.sh,kit:*.sh,scripts/git-hooks/pre-commit
|
|
2
|
+
# graph: couples=scripts/gates.list,scripts/*.sh,kit:*.sh,scripts/git-hooks/pre-commit,scripts/CHECK-GRAPH.html,docs/check-graph.html,SPEC-*.md,*/SPEC-*.md dir=one valve=none tier=precommit
|
|
3
|
+
# install: zero-config
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-graph — manifest well-formedness, trigger parity, cycle valves, artifact drift, and amendment-body manifest validation (assertion G)
|
|
4
5
|
set -uo pipefail
|
|
5
6
|
|
|
@@ -9,7 +10,6 @@ source "$SDK/lib/gate.sh"
|
|
|
9
10
|
|
|
10
11
|
GATES_DIR="$(gate_sdk_gates_dir)"
|
|
11
12
|
LIST="$GATES_DIR/gates.list"
|
|
12
|
-
WORKFLOW_DIR="${GATE_SDK_WORKFLOW_DIR:-.workflow}"
|
|
13
13
|
HOOK="${GATE_SDK_HOOKS_DIR:-$GATES_DIR/git-hooks}/pre-commit"
|
|
14
14
|
GEN="$SDK/bin/gen-pre-commit.sh"
|
|
15
15
|
|
|
@@ -95,7 +95,7 @@ resolve_member() {
|
|
|
95
95
|
|
|
96
96
|
emit_graph() {
|
|
97
97
|
local checks
|
|
98
|
-
local resolved_artifact="${GATE_SDK_GRAPH_ARTIFACT:-$
|
|
98
|
+
local resolved_artifact="${GATE_SDK_GRAPH_ARTIFACT:-$GATES_DIR/CHECK-GRAPH.html}"
|
|
99
99
|
mapfile -t checks < <(gates_list_members "$LIST" | sort -u)
|
|
100
100
|
declare -A C_COUPLES C_DIR C_VALVE NODE_SEEN
|
|
101
101
|
local c src man kv couples dir valve s
|
|
@@ -586,9 +586,9 @@ if [[ "$has_msg_gate" -eq 1 ]]; then
|
|
|
586
586
|
fi
|
|
587
587
|
|
|
588
588
|
# assertion E: the coupling-graph artifact matches --emit; its path is the
|
|
589
|
-
# GATE_SDK_GRAPH_ARTIFACT knob (
|
|
589
|
+
# GATE_SDK_GRAPH_ARTIFACT knob (gates-dir default), so a consumer that
|
|
590
590
|
# republishes the artifact elsewhere gets its own path in every remedy line
|
|
591
|
-
ARTIFACT="${GATE_SDK_GRAPH_ARTIFACT:-$
|
|
591
|
+
ARTIFACT="${GATE_SDK_GRAPH_ARTIFACT:-$GATES_DIR/CHECK-GRAPH.html}"
|
|
592
592
|
ARTIFACT_DIR="$(dirname "$ARTIFACT")"
|
|
593
593
|
emitted="$(emit_graph)"
|
|
594
594
|
if [[ ! -f "$ARTIFACT" ]]; then
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=scripts/git-hooks/* dir=one valve=none tier=precommit
|
|
3
|
+
# install: on-surface
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-hook-exec-bit — every tracked file in the hooks dir carries index mode 100755, or a fresh clone silently skips a non-executable hook
|
|
4
5
|
#
|
|
5
6
|
# usage: check-hook-exec-bit.sh [hooks-dir]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=scripts/identity.conf dir=one valve=none tier=precommit
|
|
3
|
+
# install: on-surface
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-identity — every expectation in the identity manifest matches this clone's local git identity
|
|
4
5
|
#
|
|
5
6
|
# usage: check-identity.sh [--fixture <dir>] [manifest]
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# graph: couples=kit:checks/check-*.sh,kit:checks/check-*.gate,kit:smoke/install.sh,installer/lib/common/recipe.sh dir=one valve=none tier=precommit
|
|
3
|
+
# install: zero-config
|
|
4
|
+
# spec: gate-sdk/SPEC.md §check-install-disposition — every shipped gate declares one install disposition, every zero-config gate is registrable in its kit's smoke, and the installer keeps no second copy of the roster
|
|
5
|
+
#
|
|
6
|
+
# usage: check-install-disposition.sh [root]
|
|
7
|
+
# bare: sweep gate_kit_roots against the git toplevel; root: resolve relative
|
|
8
|
+
# kit roots against a fixture tree (the case dir's gate-sdk-config.sh names them).
|
|
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
|
+
ROOT="${1:-}"
|
|
16
|
+
if [[ -z "$ROOT" ]]; then
|
|
17
|
+
ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
|
|
18
|
+
|| { echo "check-install-disposition: not a git repository and no root argument" >&2; exit 2; }
|
|
19
|
+
fi
|
|
20
|
+
[[ -d "$ROOT" ]] || { echo "check-install-disposition: root not found: $ROOT" >&2; exit 2; }
|
|
21
|
+
|
|
22
|
+
# spec: gate-sdk/SPEC.md §The install disposition — the vocabulary is closed, so an unrecognised value is a finding rather than a pass-through: it names install-time reachability and nothing else
|
|
23
|
+
VOCAB='zero-config|on-surface|never'
|
|
24
|
+
RECIPE="installer/lib/common/recipe.sh"
|
|
25
|
+
|
|
26
|
+
mapfile -t KIT_ROOTS < <(gate_kit_roots)
|
|
27
|
+
[[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-install-disposition: no kit roots enumerated" >&2; exit 2; }
|
|
28
|
+
|
|
29
|
+
findings=()
|
|
30
|
+
declared=0
|
|
31
|
+
zeroconf=0
|
|
32
|
+
for r in "${KIT_ROOTS[@]}"; do
|
|
33
|
+
r="${r%/}"
|
|
34
|
+
abs="$r"
|
|
35
|
+
[[ "$abs" == /* ]] || abs="$ROOT/$r"
|
|
36
|
+
kit="${r##*/}"
|
|
37
|
+
[[ -d "$abs/checks" ]] || continue
|
|
38
|
+
smoke="$abs/smoke/install.sh"
|
|
39
|
+
shopt -s nullglob
|
|
40
|
+
for f in "$abs"/checks/check-*.sh "$abs"/checks/check-*.gate; do
|
|
41
|
+
name="${f##*/}"; name="${name%.*}"
|
|
42
|
+
[[ -r "$f" ]] || { echo "check-install-disposition: unreadable gate header: $kit/checks/${f##*/}" >&2; exit 2; }
|
|
43
|
+
mapfile -t lines < <(grep '^# install:' "$f")
|
|
44
|
+
if [[ ${#lines[@]} -ne 1 ]]; then
|
|
45
|
+
findings+=("$kit/checks/${f##*/}: ${#lines[@]} '# install:' line(s) where a gate declares exactly one")
|
|
46
|
+
continue
|
|
47
|
+
fi
|
|
48
|
+
value="$(awk 'sub(/^# install:[[:space:]]+/, "") { print $1; exit }' "$f")"; st=$?
|
|
49
|
+
fail_closed "$st" check-install-disposition awk
|
|
50
|
+
if [[ ! "$value" =~ ^($VOCAB)$ ]]; then
|
|
51
|
+
findings+=("$kit/checks/${f##*/}: install disposition '${value:-<empty>}' is outside the closed vocabulary")
|
|
52
|
+
continue
|
|
53
|
+
fi
|
|
54
|
+
declared=$((declared + 1))
|
|
55
|
+
[[ "$value" == zero-config ]] || continue
|
|
56
|
+
zeroconf=$((zeroconf + 1))
|
|
57
|
+
# spec: gate-sdk/SPEC.md §check-install-disposition — the direction is the census's finding made mechanical: the smoke's tree is a superset of the tree init makes, so a gate the installer registers must be registrable there too. The converse is deliberately not asserted
|
|
58
|
+
if [[ ! -f "$smoke" ]]; then
|
|
59
|
+
findings+=("$kit/checks/${f##*/}: declares zero-config where $kit ships no smoke/install.sh to register it")
|
|
60
|
+
elif ! grep -qxF "$name" "$smoke"; then
|
|
61
|
+
findings+=("$kit/checks/${f##*/}: declares zero-config but $kit/smoke/install.sh does not register it")
|
|
62
|
+
fi
|
|
63
|
+
done
|
|
64
|
+
shopt -u nullglob
|
|
65
|
+
done
|
|
66
|
+
[[ "$declared" -gt 0 || ${#findings[@]} -gt 0 ]] \
|
|
67
|
+
|| { echo "check-install-disposition: kit roots enumerated but no gate found under any checks/" >&2; exit 2; }
|
|
68
|
+
|
|
69
|
+
# spec: gate-sdk/SPEC.md §check-install-disposition — assertion C holds the de-literalization going forward rather than only at the commit that lands it; the file is absent in a vendored consumer, which has no installer, so its absence is a skip and never a finding. A §-prefixed occurrence is a spec-section citation rather than a roster member and is stripped before the match: a section reference registers nothing, which is the only thing this assertion is about
|
|
70
|
+
recipe_checked=no
|
|
71
|
+
if [[ -f "$ROOT/$RECIPE" ]]; then
|
|
72
|
+
recipe_checked=yes
|
|
73
|
+
literals="$(awk '{ l=$0; gsub(/§[A-Za-z0-9_-]+/, "", l); if (l ~ /check-[a-z0-9]+(-[a-z0-9]+)*/) print FNR }' "$ROOT/$RECIPE")"; st=$?
|
|
74
|
+
fail_closed "$st" check-install-disposition awk
|
|
75
|
+
while IFS= read -r hit; do
|
|
76
|
+
[[ -n "$hit" ]] || continue
|
|
77
|
+
findings+=("$RECIPE:$hit: literal gate name — the roster is derived from each gate's declaration, never listed here")
|
|
78
|
+
done <<<"$literals"
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
82
|
+
echo "check-install-disposition: install-disposition finding(s):"
|
|
83
|
+
for f in "${findings[@]}"; do echo " $f"; done
|
|
84
|
+
echo " help: give every gate exactly one '# install: <$VOCAB>' line beside its"
|
|
85
|
+
echo " '# graph:' directive; register each zero-config gate in its kit's"
|
|
86
|
+
echo " smoke/install.sh; and keep $RECIPE free of literal"
|
|
87
|
+
echo " gate names — it derives the roster (gate-sdk/SPEC.md §The install disposition)."
|
|
88
|
+
exit 1
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
echo "INSTALL-DISPOSITION: clean ($declared gate(s) declared, $zeroconf zero-config and registrable in their kit's smoke; recipe de-literalization checked: $recipe_checked)"
|
|
92
|
+
exit 0
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=scripts/gates.list,kit:checks/*.sh dir=one valve=none tier=precommit
|
|
3
|
+
# install: on-surface
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-kit-enum — a literal hand list of >=2 kit roots sharing a glob must name every kit root with matching tracked files; the fix is the kit:<glob> token, not a longer list
|
|
4
5
|
#
|
|
5
6
|
# usage: check-kit-enum.sh [gates-dir]
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# graph: couples=README.md,kit:gate-tests/* dir=one valve=none tier=precommit
|
|
2
|
+
# install: on-surface
|
|
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
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=kit:README.md,kit:checks/* dir=bi valve=none tier=precommit
|
|
3
|
+
# install: on-surface
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-readme-roster — every kit README's gate-roster marker block holds name-set parity with the kit's shipped checks/ basenames, both directions
|
|
4
5
|
#
|
|
5
6
|
# usage: check-readme-roster.sh [root]
|
|
@@ -37,12 +38,17 @@ for r in "${KIT_ROOTS[@]}"; do
|
|
|
37
38
|
[[ -d "$abs/checks" ]] || { skipped=$((skipped + 1)); continue; }
|
|
38
39
|
swept=$((swept + 1))
|
|
39
40
|
|
|
41
|
+
# spec: gate-sdk/SPEC.md §check-readme-roster — both declaration spellings
|
|
40
42
|
shipped=""
|
|
41
43
|
shopt -s nullglob
|
|
42
44
|
for f in "$abs/checks/"*.sh; do
|
|
43
45
|
bn="${f##*/}"
|
|
44
46
|
shipped+="${bn%.sh}"$'\n'
|
|
45
47
|
done
|
|
48
|
+
for f in "$abs/checks/"*.gate; do
|
|
49
|
+
bn="${f##*/}"
|
|
50
|
+
shipped+="${bn%.gate}"$'\n'
|
|
51
|
+
done
|
|
46
52
|
shopt -u nullglob
|
|
47
53
|
|
|
48
54
|
readme="$abs/README.md"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:checks/*.sh,scripts/*.sh,scripts/gates.list dir=one valve=none tier=precommit trigger=*
|
|
2
|
+
# graph: couples=kit:checks/*.sh,scripts/*.sh,scripts/gates.list,native/src/*.rs,native/src/gates/*.rs dir=one valve=none tier=precommit trigger=*
|
|
3
|
+
# install: on-surface
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-reads-couples — every statically resolvable recursive walk in a registered gate has its tracked read set covered by the gate's expanded couples; the undecidable remainder is skipped-and-counted
|
|
4
5
|
set -uo pipefail
|
|
5
6
|
|
|
@@ -83,6 +84,34 @@ path_matches_glob() {
|
|
|
83
84
|
return 0
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
# spec: gate-sdk/SPEC.md §check-reads-couples — the per-root coverage assertion, shared by
|
|
88
|
+
# both substrates: a root the shell parse resolved and a root the binary reported land here
|
|
89
|
+
# identically, so porting a gate changes where the root came from and nothing else.
|
|
90
|
+
cover_root() {
|
|
91
|
+
local root="$1" prune="$2" namepat="$3" gname="$4" where="$5"
|
|
92
|
+
local listing gst f covered g
|
|
93
|
+
if [[ "$root" == "." ]]; then
|
|
94
|
+
listing="$(git ls-files)"; gst=$?
|
|
95
|
+
else
|
|
96
|
+
listing="$(git ls-files -- "$root")"; gst=$?
|
|
97
|
+
fi
|
|
98
|
+
[[ "$gst" -eq 0 ]] || { echo "check-reads-couples: git ls-files failed for root '$root'" >&2; exit 2; }
|
|
99
|
+
while IFS= read -r f; do
|
|
100
|
+
[[ -n "$f" ]] || continue
|
|
101
|
+
[[ "$prune" == 1 ]] && gate_path_pruned "$f" && continue
|
|
102
|
+
if [[ -n "$namepat" ]]; then
|
|
103
|
+
# shellcheck disable=SC2053 # namepat is the glob, deliberately unquoted
|
|
104
|
+
[[ "${f##*/}" == $namepat ]] || continue
|
|
105
|
+
fi
|
|
106
|
+
covered=0
|
|
107
|
+
for g in "${COUPLE_GLOBS[@]}"; do
|
|
108
|
+
path_matches_glob "$f" "$g" && { covered=1; break; }
|
|
109
|
+
done
|
|
110
|
+
[[ "$covered" == 1 ]] || \
|
|
111
|
+
findings+=("$gname: $where reads tracked '$f' — no couple covers it (couples: $couples)")
|
|
112
|
+
done <<<"$listing"
|
|
113
|
+
}
|
|
114
|
+
|
|
86
115
|
sources=()
|
|
87
116
|
if [[ $# -gt 0 ]]; then
|
|
88
117
|
sources=("$@")
|
|
@@ -102,10 +131,49 @@ findings=()
|
|
|
102
131
|
|
|
103
132
|
for src in "${sources[@]+"${sources[@]}"}"; do
|
|
104
133
|
[[ -f "$src" ]] || continue
|
|
134
|
+
gname="$(basename "$src")"; gname="${gname%.sh}"; gname="${gname%.gate}"
|
|
105
135
|
couples=""
|
|
106
136
|
couples_field="$(gate_manifest_field "$src" couples)"
|
|
107
137
|
gate_expand_couples_var couples "$couples_field"
|
|
108
138
|
IFS=',' read -ra COUPLE_GLOBS <<<"$couples"
|
|
139
|
+
|
|
140
|
+
# spec: gate-sdk/SPEC.md §check-reads-couples — a .gate member's walks are unreadable to
|
|
141
|
+
# this shell parser, so the substrate reports them instead: `--reads` answers what the
|
|
142
|
+
# binary walks and the coverage assertion below is unchanged.
|
|
143
|
+
if [[ "$src" == *.gate ]]; then
|
|
144
|
+
bin="$(gate_native_bin)"
|
|
145
|
+
if [[ ! -x "$bin" ]]; then
|
|
146
|
+
echo "check-reads-couples: $src dispatches to the native binary, but $bin is absent" >&2
|
|
147
|
+
echo "or not executable — the declared read set cannot be read, so the coverage" >&2
|
|
148
|
+
echo "assertion could not run; treating as failure (not clean)." >&2
|
|
149
|
+
echo " help: build it (bash gate-sdk/bin/build-native.sh), or" >&2
|
|
150
|
+
echo " install the prebuilt artifact, then re-run." >&2
|
|
151
|
+
exit 2
|
|
152
|
+
fi
|
|
153
|
+
reads="$("$bin" --reads "$gname" 2>&1)"; rst=$?
|
|
154
|
+
if [[ "$rst" -ne 0 ]]; then
|
|
155
|
+
echo "check-reads-couples: '$bin --reads $gname' exited $rst — the gate's own read set" >&2
|
|
156
|
+
echo "is unavailable, so this check could not run; treating as failure (not clean)." >&2
|
|
157
|
+
printf ' %s\n' "$reads" >&2
|
|
158
|
+
echo " help: the binary must answer --reads for every subcommand a descriptor" >&2
|
|
159
|
+
echo " declares. There is deliberately no descriptor-level exemption: a port" >&2
|
|
160
|
+
echo " that could opt out of this in a sentence would end the assertion it" >&2
|
|
161
|
+
echo " must replace." >&2
|
|
162
|
+
exit 2
|
|
163
|
+
fi
|
|
164
|
+
while IFS= read -r root; do
|
|
165
|
+
[[ -n "$root" ]] || continue
|
|
166
|
+
# spec: gate-sdk/SPEC.md §check-reads-couples — '?' is the substrate's own honesty
|
|
167
|
+
# marker, counted by the same skip counter the shell arm's unresolvable roots use.
|
|
168
|
+
if [[ "$root" == '?' ]]; then
|
|
169
|
+
skipped=$((skipped + 1)); continue
|
|
170
|
+
fi
|
|
171
|
+
analyzed=$((analyzed + 1))
|
|
172
|
+
cover_root "$root" 1 "" "$gname" "declared read root '$root' (--reads)"
|
|
173
|
+
done <<<"$reads"
|
|
174
|
+
continue
|
|
175
|
+
fi
|
|
176
|
+
|
|
109
177
|
walks="$(extract_walks "$src")"; st=$?
|
|
110
178
|
fail_closed "$st" READS-COUPLES "awk walk-scan($src)"
|
|
111
179
|
[[ -n "$walks" ]] || continue
|
|
@@ -117,26 +185,8 @@ for src in "${sources[@]+"${sources[@]}"}"; do
|
|
|
117
185
|
fi
|
|
118
186
|
analyzed=$((analyzed + 1))
|
|
119
187
|
namepat="$(name_pattern "$rawline")"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
else
|
|
123
|
-
listing="$(git ls-files -- "$root")"; gst=$?
|
|
124
|
-
fi
|
|
125
|
-
[[ "$gst" -eq 0 ]] || { echo "check-reads-couples: git ls-files failed for root '$root'" >&2; exit 2; }
|
|
126
|
-
while IFS= read -r f; do
|
|
127
|
-
[[ -n "$f" ]] || continue
|
|
128
|
-
[[ "$cmd" == gate_find ]] && gate_path_pruned "$f" && continue
|
|
129
|
-
if [[ -n "$namepat" ]]; then
|
|
130
|
-
# shellcheck disable=SC2053 # namepat is the glob, deliberately unquoted
|
|
131
|
-
[[ "${f##*/}" == $namepat ]] || continue
|
|
132
|
-
fi
|
|
133
|
-
covered=0
|
|
134
|
-
for g in "${COUPLE_GLOBS[@]}"; do
|
|
135
|
-
path_matches_glob "$f" "$g" && { covered=1; break; }
|
|
136
|
-
done
|
|
137
|
-
[[ "$covered" == 1 ]] || \
|
|
138
|
-
findings+=("$(basename "$src" .sh): recursive walk over '$root' (line $lno) reads tracked '$f' — no couple covers it (couples: $couples)")
|
|
139
|
-
done <<<"$listing"
|
|
188
|
+
prune=0; [[ "$cmd" == gate_find ]] && prune=1
|
|
189
|
+
cover_root "$root" "$prune" "$namepat" "$gname" "recursive walk over '$root' (line $lno)"
|
|
140
190
|
done <<<"$walks"
|
|
141
191
|
done
|
|
142
192
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=scripts/root-allowlist.list dir=one valve=none tier=precommit
|
|
3
|
+
# install: on-surface
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-root-tiering — the repo root holds only allowlisted orientation entries; workflow machinery stays under the configured dirs
|
|
4
5
|
#
|
|
5
6
|
# usage: check-root-tiering.sh [allowlist-file] [scan-root]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=scripts/*.sh,kit:*.sh dir=one valve=none tier=precommit
|
|
3
|
+
# install: zero-config
|
|
3
4
|
# spec: gate-sdk/SPEC.md §check-shellcheck — ShellCheck lint of the gate family at -S warning (the self-lint contract)
|
|
4
5
|
#
|
|
5
6
|
# usage: check-shellcheck.sh [dir...]
|