checkwright 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +687 -90
- package/lib/common/lock.sh +38 -9
- package/lib/common/profile.sh +33 -0
- package/lib/common/recipe.sh +49 -33
- package/lib/diff.sh +64 -0
- package/lib/doctor.sh +67 -42
- package/lib/init.sh +23 -31
- package/lib/uninstall.sh +212 -0
- package/lib/update.sh +34 -0
- package/package.json +2 -2
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
- package/payload/canon-kit/README.md +1 -0
- package/payload/canon-kit/SPEC.md +410 -58
- package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
- package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
- package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
- package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
- package/payload/canon-kit/checks/check-docs-link-convention.sh +1 -0
- package/payload/canon-kit/checks/check-install-claim.gate +3 -0
- package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
- package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
- package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
- package/payload/canon-kit/checks/check-md-refs.gate +3 -0
- package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
- package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
- package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
- package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
- package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
- package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
- package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
- package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
- package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
- package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +3 -2
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
- package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
- package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +27 -5
- package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +3 -3
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
- package/payload/canon-kit/lib/spec.sh +91 -62
- package/payload/canon-kit/smoke/install.sh +1 -0
- package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
- package/payload/context-kit/README.md +4 -1
- package/payload/context-kit/SPEC.md +143 -10
- package/payload/context-kit/bin/env-probe.sh +19 -6
- package/payload/context-kit/checks/check-brevity.sh +1 -0
- package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
- package/payload/context-kit/checks/check-memory-off.sh +1 -0
- package/payload/context-kit/checks/check-settings-paths.sh +94 -0
- package/payload/context-kit/checks/check-settings-pins.sh +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
- package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
- package/payload/context-kit/lib/toolfloor.sh +15 -4
- package/payload/context-kit/smoke/agents-md.sh +12 -1
- package/payload/context-kit/smoke/install.sh +1 -0
- package/payload/delegation-kit/README.md +3 -3
- package/payload/delegation-kit/SPEC.md +116 -13
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -0
- package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
- package/payload/delegation-kit/templates/agent-execution.md +38 -14
- package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
- package/payload/doctrine-kit/DOCTRINE.md +86 -12
- package/payload/doctrine-kit/README.md +7 -3
- package/payload/doctrine-kit/SPEC.md +102 -9
- package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
- package/payload/doctrine-kit/smoke/install.sh +90 -0
- package/payload/drift-kit/SPEC.md +13 -4
- package/payload/drift-kit/bin/kfric.sh +21 -2
- package/payload/drift-kit/smoke/install.sh +28 -0
- package/payload/evidence-kit/checks/check-battery-roster.sh +1 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +1 -0
- package/payload/gate-sdk/README.md +13 -0
- package/payload/gate-sdk/SPEC.md +2611 -151
- package/payload/gate-sdk/bin/build-native.sh +38 -0
- package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
- package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
- package/payload/gate-sdk/bin/port-blockers.sh +445 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
- package/payload/gate-sdk/bin/run-gate-tests.sh +26 -5
- package/payload/gate-sdk/bin/run-gates.sh +8 -2
- package/payload/gate-sdk/bin/upgrade-smoke.sh +52 -4
- package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -0
- package/payload/gate-sdk/checks/check-action-pinning.gate +1 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -0
- package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
- package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
- package/payload/gate-sdk/checks/check-core-files.sh +1 -0
- package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
- package/payload/gate-sdk/checks/check-exec-bit.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +2 -1
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-output.sh +33 -3
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +36 -5
- package/payload/gate-sdk/checks/check-graph.sh +1 -0
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
- package/payload/gate-sdk/checks/check-identity.sh +1 -0
- package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
- package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
- package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
- package/payload/gate-sdk/checks/check-readme-roster.sh +1 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +3 -2
- package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
- package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
- package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
- package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +65 -4
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +111 -1
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +24 -12
- package/payload/gate-sdk/lib/gate.sh +135 -11
- package/payload/gate-sdk/lib/inject.sh +25 -0
- package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
- package/payload/gate-sdk/smoke/install.sh +42 -0
- package/payload/guard-kit/README.md +14 -11
- package/payload/guard-kit/SPEC.md +278 -62
- package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
- package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
- package/payload/guard-kit/guard-tests/cases.tsv +49 -7
- package/payload/guard-kit/lib/guard.sh +276 -54
- package/payload/guard-kit/templates/close-triage.md +5 -5
- package/payload/guard-kit/templates/settings-hooks.json +7 -1
- package/payload/lifecycle-kit/README.md +11 -1
- package/payload/lifecycle-kit/SPEC.md +441 -37
- package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +126 -10
- package/payload/lifecycle-kit/bin/file-gap.sh +27 -10
- package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
- package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
- package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
- package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
- package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
- package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
- package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
- package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +54 -26
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
- package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
- package/payload/lifecycle-kit/lib/stages.sh +4 -0
- package/payload/lifecycle-kit/smoke/install.sh +67 -4
- package/payload/lifecycle-kit/templates/lead.md +36 -0
- package/payload/lifecycle-kit/templates/stages/close.md +30 -11
- package/payload/lifecycle-kit/templates/stages/scope.md +9 -4
- package/payload/lifecycle-kit/templates/stages/spec.md +5 -1
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
- package/payload/queue-kit/README.md +3 -1
- package/payload/queue-kit/SPEC.md +123 -3
- package/payload/queue-kit/bin/queue-counts.sh +35 -0
- package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
- package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
- package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
- package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
- package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
- package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
- package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
- package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
- package/payload/queue-kit/checks/check-task-names.gate +3 -0
- package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
- package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
- package/payload/queue-kit/lib/queue.sh +4 -19
- package/payload/site-kit/SPEC.md +23 -0
- package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
- package/profiles.list +36 -8
- package/payload/canon-kit/checks/check-comment-tier.sh +0 -216
- package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
- package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
- package/payload/canon-kit/checks/check-install-claim.sh +0 -146
- package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
- package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
- package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
- package/payload/canon-kit/checks/check-md-refs.sh +0 -128
- package/payload/canon-kit/checks/check-payload-claim.sh +0 -133
- package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
- package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
- package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
- package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
- package/payload/canon-kit/checks/check-spec-pointer.sh +0 -187
- package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
- package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
- package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
- package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
- package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
- package/payload/gate-sdk/checks/check-template-registry-parity.sh +0 -81
- package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
- package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
- package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
- package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
- package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
- package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
- package/payload/lifecycle-kit/checks/check-survey-record.sh +0 -102
- package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -106
- package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
- package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
- package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
- package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
- package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
- package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
- package/payload/queue-kit/checks/check-task-names.sh +0 -128
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Direct unit test of check-test-hermetic
|
|
2
|
+
# Direct unit test of check-test-hermetic assertion (B) via the --smoke mode.
|
|
3
3
|
# The good/bad fixture pair stays on assertion (A) (the gate-tests bootstrap
|
|
4
4
|
# scan), so the smoke credential-pin rule needs its own test: a
|
|
5
5
|
# credential-managing smoke script whose own-kit bin call carries no *_CRED_FILE
|
|
@@ -12,7 +12,6 @@ set -uo pipefail
|
|
|
12
12
|
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
13
13
|
|
|
14
14
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # gate-sdk/
|
|
15
|
-
GATE="$DIR/checks/check-test-hermetic.sh"
|
|
16
15
|
|
|
17
16
|
fails=0
|
|
18
17
|
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
|
|
@@ -56,7 +55,7 @@ DEMO_KIT_CRED_FILE="$pp/creds.json" bash "$SMOKE_KIT_ROOT/bin/poller.sh"
|
|
|
56
55
|
bash "$SMOKE_KIT_ROOT/bin/verdict.sh" "$snap"
|
|
57
56
|
EOF
|
|
58
57
|
|
|
59
|
-
run() { out="$("$
|
|
58
|
+
run() { out="$(gate_run check-test-hermetic "$DIR/checks" --smoke "$1" 2>&1)"; rc=$?; }
|
|
60
59
|
|
|
61
60
|
run "$tmp/good"
|
|
62
61
|
[[ "$rc" -eq 0 ]] \
|
|
@@ -55,6 +55,30 @@ got="$(gate_find "$sandbox" -name '*.proto' | sed "s#^$sandbox/##" | sort | past
|
|
|
55
55
|
[[ "$got" == 'a.proto,sub/b.proto' ]] \
|
|
56
56
|
|| { echo " FAIL: gate_find returned '$got' (want 'a.proto,sub/b.proto')"; fails=$((fails + 1)); }
|
|
57
57
|
|
|
58
|
+
# --- a live agent worktree is out of the walk -------------------------------
|
|
59
|
+
# The default carries the leaf basename `worktrees`, not the path `.claude/worktrees`:
|
|
60
|
+
# a basename matcher cannot match a slash, so the path spelling would silently
|
|
61
|
+
# restore the second-copy-of-the-repo the member exists to exclude.
|
|
62
|
+
mkdir -p "$sandbox/.claude/worktrees/agent-x" "$sandbox/.claude/commands"
|
|
63
|
+
: >"$sandbox/.claude/worktrees/agent-x/f.proto"; : >"$sandbox/.claude/commands/g.proto"
|
|
64
|
+
got="$(gate_find "$sandbox" -name '*.proto' | sed "s#^$sandbox/##" | sort | paste -sd, -)"
|
|
65
|
+
[[ "$got" == '.claude/commands/g.proto,a.proto,sub/b.proto' ]] \
|
|
66
|
+
|| { echo " FAIL: worktree prune returned '$got' (want '.claude/commands/g.proto,a.proto,sub/b.proto')"; fails=$((fails + 1)); }
|
|
67
|
+
|
|
68
|
+
# --- GATE_SDK_PRUNE_EXTRA_DIRS appends to whichever set was resolved ---------
|
|
69
|
+
# Both branches, because the interaction with the replacing knob is the contract:
|
|
70
|
+
# an implementation appending only to the default passes the first case alone.
|
|
71
|
+
extra_probe() {
|
|
72
|
+
# shellcheck source=../lib/gate.sh
|
|
73
|
+
( source "$DIR/lib/gate.sh"; printf '%s\n' "${GATE_PRUNE_DIRS[@]}" | paste -sd, - )
|
|
74
|
+
}
|
|
75
|
+
got="$(GATE_SDK_PRUNE_EXTRA_DIRS='vendor' extra_probe)"
|
|
76
|
+
[[ ",$got," == *",target,"* && ",$got," == *",vendor,"* ]] \
|
|
77
|
+
|| { echo " FAIL: EXTRA_DIRS did not append to the default set (got '$got')"; fails=$((fails + 1)); }
|
|
78
|
+
got="$(GATE_SDK_PRUNE_DIRS='only' GATE_SDK_PRUNE_EXTRA_DIRS='vendor' extra_probe)"
|
|
79
|
+
[[ "$got" == 'only,vendor' ]] \
|
|
80
|
+
|| { echo " FAIL: EXTRA_DIRS did not append to an explicit PRUNE_DIRS (got '$got', want 'only,vendor')"; fails=$((fails + 1)); }
|
|
81
|
+
|
|
58
82
|
# --- registry + resolution (gate-sdk additions) -------------------------------
|
|
59
83
|
list="$sandbox/gates.list"
|
|
60
84
|
printf '# comment\n\ncheck-one\ncheck-two\n' > "$list"
|
|
@@ -110,9 +134,95 @@ got="$(GATE_SDK_NATIVE_BIN="$sandbox/fakebin" gate_command check-ported "$sandbo
|
|
|
110
134
|
[[ "$?" -eq 2 ]] \
|
|
111
135
|
|| { echo " FAIL: gate_command did not exit 2 on a non-executable native binary"; fails=$((fails + 1)); }
|
|
112
136
|
|
|
137
|
+
# --- the array-knob config bridge ---------------------------------------------
|
|
138
|
+
# A stand-in binary reporting whatever knob the case declares, and a stand-in kit
|
|
139
|
+
# whose library defines those knobs: the bridge's own refusals are unreachable
|
|
140
|
+
# through the live members, whose one knob is well formed by construction.
|
|
141
|
+
cat > "$sandbox/knobbin" <<'FAKE'
|
|
142
|
+
#!/usr/bin/env bash
|
|
143
|
+
[[ "$1" == --knobs ]] && { [[ -n "${PROBE_KNOB:-}" ]] && printf '%s\n' "$PROBE_KNOB"; exit 0; }
|
|
144
|
+
exit 0
|
|
145
|
+
FAKE
|
|
146
|
+
chmod +x "$sandbox/knobbin"
|
|
147
|
+
mkdir -p "$sandbox/probe-kit/lib" "$sandbox/probe-kit/checks"
|
|
148
|
+
cat > "$sandbox/probe-kit/lib/probe.sh" <<'PROBE'
|
|
149
|
+
# shellcheck shell=bash
|
|
150
|
+
PROBE_KIT_SPACED=(alpha "two words")
|
|
151
|
+
PROBE_KIT_SCALAR=solo
|
|
152
|
+
PROBE_KIT_TABBED=($'has\ttab')
|
|
153
|
+
PROBE_KIT_NEWLINED=($'has\nnewline')
|
|
154
|
+
PROBE
|
|
155
|
+
knob_argv() {
|
|
156
|
+
PROBE_KNOB="$1" GATE_SDK_KIT_DIRS="$sandbox/probe-kit" \
|
|
157
|
+
GATE_SDK_NATIVE_BIN="$sandbox/knobbin" \
|
|
158
|
+
gate_command check-ported "$sandbox/a" "$sandbox/b" 2>&1
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
# whitespace inside an element survives, which is the whole reason the serialization
|
|
162
|
+
# is tab-joined rather than the space-separated scalar shape it sits beside
|
|
163
|
+
got="$(knob_argv PROBE_KIT_SPACED | paste -sd'|' -)"
|
|
164
|
+
want="env|GATE_SDK_KNOB_PROBE_KIT_SPACED=alpha"$'\t'"two words|$sandbox/knobbin|check-ported"
|
|
165
|
+
[[ "$got" == "$want" ]] \
|
|
166
|
+
|| { echo " FAIL: bridged argv was '$got' (want '$want')"; fails=$((fails + 1)); }
|
|
167
|
+
|
|
168
|
+
# a scalar knob is a one-element array — the two cases share one grammar
|
|
169
|
+
got="$(knob_argv PROBE_KIT_SCALAR | paste -sd'|' -)"
|
|
170
|
+
[[ "$got" == "env|GATE_SDK_KNOB_PROBE_KIT_SCALAR=solo|$sandbox/knobbin|check-ported" ]] \
|
|
171
|
+
|| { echo " FAIL: scalar knob argv was '$got'"; fails=$((fails + 1)); }
|
|
172
|
+
|
|
173
|
+
# a member declaring no knob emits the two-element argv exactly as before the bridge
|
|
174
|
+
got="$(PROBE_KNOB="" GATE_SDK_KIT_DIRS="$sandbox/probe-kit" GATE_SDK_NATIVE_BIN="$sandbox/knobbin" \
|
|
175
|
+
gate_command check-ported "$sandbox/a" "$sandbox/b" | paste -sd'|' -)"
|
|
176
|
+
[[ "$got" == "$sandbox/knobbin|check-ported" ]] \
|
|
177
|
+
|| { echo " FAIL: knobless argv gained an env prefix: '$got'"; fails=$((fails + 1)); }
|
|
178
|
+
|
|
179
|
+
# a knob matching no kit's <KIT>_ prefix resolves to gate-sdk itself, the kit every
|
|
180
|
+
# .gate dispatch already runs inside — GATE_PRUNE_DIRS is exactly that case, and the
|
|
181
|
+
# expected value is read from this process rather than restated as a second literal
|
|
182
|
+
want_prune="$(IFS=$'\t'; printf '%s' "${GATE_PRUNE_DIRS[*]}")"
|
|
183
|
+
got="$(knob_argv GATE_PRUNE_DIRS | sed -n '2p')"
|
|
184
|
+
[[ "$got" == "GATE_SDK_KNOB_GATE_PRUNE_DIRS=$want_prune" ]] \
|
|
185
|
+
|| { echo " FAIL: prefixless knob did not fall back to gate-sdk: '$got'"; fails=$((fails + 1)); }
|
|
186
|
+
|
|
187
|
+
# the three refusals, each exit 2 naming the knob
|
|
188
|
+
for probe in TABBED:tab NEWLINED:newline; do
|
|
189
|
+
knob="PROBE_KIT_${probe%%:*}"; what="${probe##*:}"
|
|
190
|
+
out="$(knob_argv "$knob")"; rc=$?
|
|
191
|
+
[[ "$rc" -eq 2 ]] \
|
|
192
|
+
|| { echo " FAIL: a $what in a knob element exited $rc, want 2"; fails=$((fails + 1)); }
|
|
193
|
+
grep -qF -- "knob $knob" <<<"$out" \
|
|
194
|
+
|| { echo " FAIL: the $what refusal did not name $knob: $out"; fails=$((fails + 1)); }
|
|
195
|
+
done
|
|
196
|
+
out="$(knob_argv PROBE_KIT_ABSENT)"; rc=$?
|
|
197
|
+
[[ "$rc" -eq 2 ]] \
|
|
198
|
+
|| { echo " FAIL: a knob no kit library defines exited $rc, want 2"; fails=$((fails + 1)); }
|
|
199
|
+
grep -qF -- 'PROBE_KIT_ABSENT' <<<"$out" \
|
|
200
|
+
|| { echo " FAIL: the undeclared-knob refusal did not name the knob: $out"; fails=$((fails + 1)); }
|
|
201
|
+
|
|
202
|
+
# --- the knob-owner lookup drains its producer --------------------------------
|
|
203
|
+
# The candidate roots are read to EOF *before* the match loop, so an early prefix
|
|
204
|
+
# hit never leaves the producer writing into a closed pipe. The oracle is SIGPIPE
|
|
205
|
+
# *ignored* — the disposition a CI runner inherits from its supervisor — under
|
|
206
|
+
# which the abandoned write fails EPIPE and bash reports it on stderr. Under the
|
|
207
|
+
# default disposition the producer dies silently and the identical defect shows
|
|
208
|
+
# nothing, which is precisely why a green local battery could not see it; the
|
|
209
|
+
# `trap '' PIPE` is what makes this deterministic rather than environmental.
|
|
210
|
+
many="$sandbox/probe-kit"
|
|
211
|
+
for ((_i = 0; _i < 200; _i++)); do many="$many $sandbox/pad-kit"; done
|
|
212
|
+
owner_probe() {
|
|
213
|
+
( trap '' PIPE
|
|
214
|
+
GATE_SDK_KIT_DIRS="$many" _gate_knob_owning_kit PROBE_KIT_SPACED "$@" )
|
|
215
|
+
}
|
|
216
|
+
got="$(owner_probe 2>&1 1>/dev/null)"
|
|
217
|
+
[[ -z "$got" ]] \
|
|
218
|
+
|| { echo " FAIL: _gate_knob_owning_kit abandoned its producer: $got"; fails=$((fails + 1)); }
|
|
219
|
+
got="$(owner_probe 2>/dev/null)"
|
|
220
|
+
[[ "$got" == "$sandbox/probe-kit" ]] \
|
|
221
|
+
|| { echo " FAIL: knob owner was '$got' (want '$sandbox/probe-kit')"; fails=$((fails + 1)); }
|
|
222
|
+
|
|
113
223
|
if [[ "$fails" -gt 0 ]]; then
|
|
114
224
|
echo "lib-gate.test: $fails assertion(s) failed"
|
|
115
225
|
exit 1
|
|
116
226
|
fi
|
|
117
|
-
echo "lib-gate.test: ok (fail_closed branches; gate_path_pruned; GATE_GREP_EXCLUDES; gate_find prune; registry + resolution; .gate declaration/argv split + dispatch fail-closed)"
|
|
227
|
+
echo "lib-gate.test: ok (fail_closed branches; gate_path_pruned; GATE_GREP_EXCLUDES; gate_find prune incl. the worktrees leaf; PRUNE_EXTRA_DIRS append over both branches; registry + resolution; .gate declaration/argv split + dispatch fail-closed; the knob bridge's serialization, scalar/knobless/prefixless arms and its three refusals; the knob-owner lookup draining its producer on an early match under SIGPIPE-ignored)"
|
|
118
228
|
exit 0
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §run-gates — end-to-end lock-in for the dispatch
|
|
3
|
+
# capture's stream separation: `gate_command`'s stdout *is* the invocation argv,
|
|
4
|
+
# its stderr is diagnostic text, and a diagnostic written by a *successful* call
|
|
5
|
+
# must never become argv[0] and be exec'd. Both arms run over a hermetic scratch
|
|
6
|
+
# registry and are deterministic by construction — a stand-in kit library that
|
|
7
|
+
# writes to stderr while still resolving its knob reproduces the shape without
|
|
8
|
+
# reproducing the SIGPIPE-disposition accident that first exposed it.
|
|
9
|
+
# Run by run-gate-tests.sh.
|
|
10
|
+
set -uo pipefail
|
|
11
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
12
|
+
|
|
13
|
+
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
14
|
+
RUN="$ROOT/gate-sdk/bin/run-gates.sh"
|
|
15
|
+
[[ -x "$RUN" ]] || { echo "run-dispatch-streams.test: runner not found: $RUN"; exit 2; }
|
|
16
|
+
|
|
17
|
+
scratch="$(mktemp -d)"
|
|
18
|
+
trap 'rm -rf "$scratch"' EXIT
|
|
19
|
+
|
|
20
|
+
fails=0
|
|
21
|
+
assert_has() { grep -qF -- "$2" <<<"$3" || { echo "FAIL [$1]: expected present: $2"; fails=$((fails + 1)); }; }
|
|
22
|
+
assert_absent() { grep -qF -- "$2" <<<"$3" && { echo "FAIL [$1]: expected absent: $2"; fails=$((fails + 1)); }; return 0; }
|
|
23
|
+
|
|
24
|
+
# A .gate member dispatching to a stand-in binary that answers --knobs, then
|
|
25
|
+
# reports the bridged value so the argv is observed end to end.
|
|
26
|
+
printf '# graph: couples=cfg dir=one valve=none tier=precommit trigger=*\n' \
|
|
27
|
+
> "$scratch/check-noisy.gate"
|
|
28
|
+
cat > "$scratch/bin" <<'BIN'
|
|
29
|
+
#!/usr/bin/env bash
|
|
30
|
+
[[ "${1:-}" == --knobs ]] && { printf 'PROBE_KIT_VALUE\n'; exit 0; }
|
|
31
|
+
printf 'check-noisy ran knob=[%s]\n' "${GATE_SDK_KNOB_PROBE_KIT_VALUE:-}"
|
|
32
|
+
exit 0
|
|
33
|
+
BIN
|
|
34
|
+
chmod +x "$scratch/bin"
|
|
35
|
+
|
|
36
|
+
# The stand-in kit whose library resolves the knob *and* writes to stderr while
|
|
37
|
+
# doing it: a gate_command that exits 0 with non-empty stderr, which is exactly
|
|
38
|
+
# the shape a merged capture turns into argv[0].
|
|
39
|
+
mkdir -p "$scratch/probe-kit/lib" "$scratch/probe-kit/checks"
|
|
40
|
+
cat > "$scratch/probe-kit/lib/probe.sh" <<'PROBE'
|
|
41
|
+
# shellcheck shell=bash
|
|
42
|
+
printf 'probe-kit: a diagnostic on stderr, exit status still 0\n' >&2
|
|
43
|
+
PROBE_KIT_VALUE=resolved
|
|
44
|
+
PROBE
|
|
45
|
+
printf 'check-noisy\n' > "$scratch/gates.list"
|
|
46
|
+
|
|
47
|
+
run_battery() {
|
|
48
|
+
GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch/probe-kit" \
|
|
49
|
+
GATE_SDK_NATIVE_BIN="$1" GATE_SDK_TMP_DIR="$scratch/.tmp" \
|
|
50
|
+
GATE_SDK_VERBOSE=1 bash "$RUN" 2>&1
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# Arm 1 — stderr on a successful dispatch: argv comes from stdout alone, so the
|
|
54
|
+
# gate runs with its bridged knob and the diagnostic is not executed.
|
|
55
|
+
out="$(run_battery "$scratch/bin")"; rc=$?
|
|
56
|
+
assert_has stdout-argv 'check-noisy ran knob=[resolved]' "$out"
|
|
57
|
+
assert_has stdout-argv 'All 1 gates passed.' "$out"
|
|
58
|
+
assert_absent stdout-argv 'exit 127' "$out"
|
|
59
|
+
assert_absent stdout-argv 'FAIL: check-noisy' "$out"
|
|
60
|
+
[[ "$rc" -eq 0 ]] || { echo "FAIL [stdout-argv]: expected exit 0, got $rc"; fails=$((fails + 1)); }
|
|
61
|
+
|
|
62
|
+
# Arm 2 — the stderr the split must not discard: an absent binary is
|
|
63
|
+
# gate_command's exit 2, whose diagnostic body is stderr. Deleting the capture
|
|
64
|
+
# rather than splitting it would silently empty this report.
|
|
65
|
+
out="$(run_battery "$scratch/absent-bin")"; rc=$?
|
|
66
|
+
assert_has dispatch-err 'dispatch harness error, exit 2' "$out"
|
|
67
|
+
assert_has dispatch-err 'absent or not executable' "$out"
|
|
68
|
+
assert_has dispatch-err 'build-native.sh' "$out"
|
|
69
|
+
[[ "$rc" -eq 1 ]] || { echo "FAIL [dispatch-err]: expected exit 1, got $rc"; fails=$((fails + 1)); }
|
|
70
|
+
|
|
71
|
+
[[ "$fails" -eq 0 ]] || { echo "run-dispatch-streams.test: $fails assertion(s) failed"; exit 1; }
|
|
72
|
+
echo "run-dispatch-streams.test: clean (argv taken from stdout alone with stderr present on a successful dispatch; the exit-2 diagnostic body still reaches the report)"
|
|
73
|
+
exit 0
|
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
# shellcheck shell=bash
|
|
2
2
|
# spec: gate-sdk/SPEC.md §Consumer smoke — the shared scratch-consumer builder both smoke harnesses vendor through (run-consumer-smoke.sh and context-kit/smoke/agents-md.sh)
|
|
3
3
|
|
|
4
|
-
# spec: gate-sdk/SPEC.md §Consumer smoke —
|
|
5
|
-
|
|
6
|
-
local
|
|
7
|
-
host="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
8
|
-
bin="$(gate_native_bin)"
|
|
9
|
-
|
|
4
|
+
# spec: gate-sdk/SPEC.md §Consumer smoke — csmoke_gate_descriptors: the one derivation of whether a kit set needs the binary at all, so a caller that must produce one before it can name a source tree asks the same question the placement asks
|
|
5
|
+
csmoke_gate_descriptors() { # $@ = vendorable kit roots -> the number of .gate descriptors under them
|
|
6
|
+
local n=0 r
|
|
10
7
|
shopt -s nullglob
|
|
11
8
|
for r in "$@"; do
|
|
12
|
-
for _ in "$r"/checks/*.gate; do
|
|
9
|
+
for _ in "$r"/checks/*.gate; do n=$((n + 1)); done
|
|
13
10
|
done
|
|
14
11
|
shopt -u nullglob
|
|
12
|
+
printf '%s\n' "$n"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
# spec: gate-sdk/SPEC.md §Consumer smoke — csmoke_place_binary: the vendored kit roots' descriptor set decides whether the scratch consumer needs the gate binary, and the caller names the checkout whose artifact it receives — a library resolving that from its own location hands every caller the invoking tree's binary, which is the pairing defect that made upgrade-smoke run one ref's shell against another's binary. Derived, so a kit set with no ported gate asks for nothing.
|
|
16
|
+
csmoke_place_binary() { # $1 = the checkout whose native/ was built, $2.. = vendorable kit roots
|
|
17
|
+
local host="$1" bin descriptors
|
|
18
|
+
shift
|
|
19
|
+
bin="$(gate_native_bin)"
|
|
20
|
+
descriptors="$(csmoke_gate_descriptors "$@")"
|
|
15
21
|
[[ "$descriptors" -gt 0 ]] || return 0
|
|
16
22
|
|
|
23
|
+
[[ -n "$host" ]] || {
|
|
24
|
+
echo "csmoke: $descriptors vendored .gate descriptor(s) need the gate binary and the caller named no checkout to take one from" >&2
|
|
25
|
+
return 2
|
|
26
|
+
}
|
|
17
27
|
[[ -x "$host/$bin" ]] || {
|
|
18
28
|
echo "csmoke: $descriptors vendored .gate descriptor(s) need the gate binary, but $host/$bin is absent or not executable" >&2
|
|
19
|
-
echo " help: build it —
|
|
29
|
+
echo " help: build it — bash gate-sdk/bin/build-native.sh — then re-run." >&2
|
|
20
30
|
return 2
|
|
21
31
|
}
|
|
22
32
|
mkdir -p "$SCRATCH/${bin%/*}" || return 2
|
|
23
33
|
cp "$host/$bin" "$SCRATCH/$bin" || return 2
|
|
24
34
|
}
|
|
25
35
|
|
|
26
|
-
# spec: gate-sdk/SPEC.md §Consumer smoke — csmoke_vendor_and_install: from the kit roots (gate-sdk first) sets SCRATCH + CSMOKE_INSTALLED; returns 2 on an environment failure; the caller owns cleanup and every post-baseline assertion
|
|
27
|
-
csmoke_vendor_and_install() {
|
|
28
|
-
local
|
|
36
|
+
# spec: gate-sdk/SPEC.md §Consumer smoke — csmoke_vendor_and_install: from the binary's source checkout and the kit roots (gate-sdk first) sets SCRATCH + CSMOKE_INSTALLED; returns 2 on an environment failure; the caller owns cleanup and every post-baseline assertion
|
|
37
|
+
csmoke_vendor_and_install() { # $1 = the checkout whose native/ was built, $2.. = kit roots
|
|
38
|
+
local host="$1" roots r kit
|
|
39
|
+
shift
|
|
40
|
+
roots=("$@")
|
|
29
41
|
SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/consumer-smoke.XXXXXX")" || return 2
|
|
30
42
|
|
|
31
43
|
git -C "$SCRATCH" init -q
|
|
@@ -39,7 +51,7 @@ csmoke_vendor_and_install() {
|
|
|
39
51
|
cp -R "$r" "$SCRATCH/$(basename "$r")"
|
|
40
52
|
done
|
|
41
53
|
|
|
42
|
-
csmoke_place_binary "${roots[@]}" || return 2
|
|
54
|
+
csmoke_place_binary "$host" "${roots[@]}" || return 2
|
|
43
55
|
|
|
44
56
|
CSMOKE_INSTALLED=0
|
|
45
57
|
for r in "${roots[@]}"; do
|
|
@@ -32,8 +32,17 @@ fail_closed() {
|
|
|
32
32
|
if [[ -n "${GATE_SDK_PRUNE_DIRS:-}" ]]; then
|
|
33
33
|
read -r -a GATE_PRUNE_DIRS <<<"$GATE_SDK_PRUNE_DIRS"
|
|
34
34
|
else
|
|
35
|
-
GATE_PRUNE_DIRS=(target .git node_modules .tmp gate-tests)
|
|
35
|
+
GATE_PRUNE_DIRS=(target .git node_modules .tmp gate-tests worktrees)
|
|
36
36
|
fi
|
|
37
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — GATE_SDK_PRUNE_EXTRA_DIRS appends to the resolved set whichever branch produced it, so a consumer adds one directory without copying the default
|
|
38
|
+
for _gpx in ${GATE_SDK_PRUNE_EXTRA_DIRS:-}; do GATE_PRUNE_DIRS+=("$_gpx"); done
|
|
39
|
+
unset _gpx
|
|
40
|
+
|
|
41
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — check-kit-registration's two document knobs, resolved here rather than inline in the check so the config bridge can carry them: a knob the owning kit's library does not define is the bridge's third refusal, so a compiled member declaring either would fail-close on every invocation. Resolved under their own consumer names (the queue-kit shape) rather than renamed the way GATE_PRUNE_DIRS is: that rename exists because a whitespace scalar feeds an array and one name would mean two grammars, and these are scalars in and scalars out.
|
|
42
|
+
[[ -v GATE_SDK_REGISTRY_DOC ]] || GATE_SDK_REGISTRY_DOC="README.md"
|
|
43
|
+
[[ -v GATE_SDK_RUNNER_DOC ]] || GATE_SDK_RUNNER_DOC="README.md"
|
|
44
|
+
# spec: gate-sdk/SPEC.md §The workflow directory — the same resolution for the workflow directory, and for the same reason: the governed-comment corpus takes its tracked tier, so a compiled member reading that corpus declares this knob and the bridge can only carry a value some kit library defines
|
|
45
|
+
[[ -v GATE_SDK_WORKFLOW_DIR ]] || GATE_SDK_WORKFLOW_DIR=".workflow"
|
|
37
46
|
|
|
38
47
|
gate_find() {
|
|
39
48
|
local prune=() d
|
|
@@ -47,6 +56,12 @@ GATE_GREP_EXCLUDES=()
|
|
|
47
56
|
for _gpd in "${GATE_PRUNE_DIRS[@]}"; do GATE_GREP_EXCLUDES+=(--exclude-dir="$_gpd"); done
|
|
48
57
|
unset _gpd
|
|
49
58
|
|
|
59
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the programs the payload is entitled to assume present, so a command-position word in this set is not a criterion-7 requirement; git is on it because §The port-candidate criteria already rules it the one sanctioned exception, "because it is the floor"
|
|
60
|
+
declare -p GATE_SDK_PROGRAM_FLOOR &>/dev/null \
|
|
61
|
+
|| GATE_SDK_PROGRAM_FLOOR=(awk basename bash cat cd chmod cmp comm cp cut date diff dirname
|
|
62
|
+
env find git grep head ln ls mkdir mktemp mv printf pwd realpath rm sed sh sort tail tee
|
|
63
|
+
touch tr uniq wc xargs)
|
|
64
|
+
|
|
50
65
|
gate_path_pruned() {
|
|
51
66
|
local p="$1" d
|
|
52
67
|
for d in "${GATE_PRUNE_DIRS[@]}"; do
|
|
@@ -84,7 +99,63 @@ gate_resolve() {
|
|
|
84
99
|
return 1
|
|
85
100
|
}
|
|
86
101
|
|
|
87
|
-
# spec: gate-sdk/SPEC.md §lib/gate.sh —
|
|
102
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the owning kit of a bridged knob, derived from the knob's own `<KIT>_` prefix rather than from a maintained knob→kit roster: each gate_kit_roots member's basename, hyphens to underscores and upper-cased, is tried as a prefix. A knob matching no other kit's prefix is gate-sdk's own — the one kit every `.gate` dispatch already runs inside — never a parse error and never a third kit guessed at.
|
|
103
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the configured set is consulted first, then the shipped one: GATE_SDK_KIT_DIRS narrows which kits a battery *scans*, and reading it as the set of kits that *exist* would leave a narrowed run unable to attribute another kit's knob and fail-close on every member that declares one
|
|
104
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the candidates are read to EOF *before* the match loop, never streamed through a `while read` the first prefix hit returns out of: this runs under a stdout capture, so a producer left writing into a closed pipe reports the write error on stderr wherever SIGPIPE is ignored, which §run-gates' capture is what makes dispatch-fatal
|
|
105
|
+
_gate_knob_owning_kit() {
|
|
106
|
+
local knob="$1" kit base prefix
|
|
107
|
+
local -a kits=()
|
|
108
|
+
mapfile -t kits < <(gate_kit_roots; [[ -n "${GATE_SDK_KIT_DIRS:-}" ]] && _gate_kit_roots_derived)
|
|
109
|
+
for kit in ${kits[@]+"${kits[@]}"}; do
|
|
110
|
+
kit="${kit%/}"
|
|
111
|
+
[[ -n "$kit" ]] || continue
|
|
112
|
+
base="${kit##*/}"
|
|
113
|
+
prefix="${base^^}"; prefix="${prefix//-/_}_"
|
|
114
|
+
[[ "$knob" == "$prefix"* ]] && { printf '%s\n' "$kit"; return 0; }
|
|
115
|
+
done
|
|
116
|
+
gate_sdk_root
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — resolve one declared knob to its tab-joined value by sourcing the owning kit's lib/*.sh in a subshell, so a kit library's globals cannot leak into the dispatcher or across members. Emits the joined value on stdout; returns non-zero having named the knob on stderr for each of the three refusals (undeclared knob, tab in an element, newline in an element).
|
|
120
|
+
_gate_knob_value() {
|
|
121
|
+
local knob="$1" gate="$2" kit
|
|
122
|
+
kit="$(_gate_knob_owning_kit "$knob")"
|
|
123
|
+
(
|
|
124
|
+
shopt -s nullglob
|
|
125
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the knob under resolution, published to the
|
|
126
|
+
# kit library being sourced, so a library whose knob costs a subprocess resolves
|
|
127
|
+
# that one rather than all of them on every source
|
|
128
|
+
export GATE_SDK_RESOLVING_KNOB="$knob"
|
|
129
|
+
local _gkv_f
|
|
130
|
+
for _gkv_f in "$kit"/lib/*.sh; do
|
|
131
|
+
# shellcheck disable=SC1090 # the owning kit's library, resolved by prefix
|
|
132
|
+
source "$_gkv_f"
|
|
133
|
+
done
|
|
134
|
+
if ! declare -p "$knob" >/dev/null 2>&1; then
|
|
135
|
+
printf 'gate_command: %s declares knob %s, but %s/lib defines no such knob — ' "$gate" "$knob" "$kit" >&2
|
|
136
|
+
printf 'the config bridge could not resolve it; treating as failure (not clean)\n' >&2
|
|
137
|
+
exit 2
|
|
138
|
+
fi
|
|
139
|
+
local -n _gkv_val="$knob"
|
|
140
|
+
local _gkv_e
|
|
141
|
+
for _gkv_e in "${_gkv_val[@]+"${_gkv_val[@]}"}"; do
|
|
142
|
+
case "$_gkv_e" in
|
|
143
|
+
*$'\n'*)
|
|
144
|
+
printf 'gate_command: knob %s has an element containing a newline: %s — ' "$knob" "$_gkv_e" >&2
|
|
145
|
+
printf 'the argv protocol is one element per line; treating as failure (not clean)\n' >&2
|
|
146
|
+
exit 2 ;;
|
|
147
|
+
*$'\t'*)
|
|
148
|
+
printf 'gate_command: knob %s has an element containing a tab: %s — ' "$knob" "$_gkv_e" >&2
|
|
149
|
+
printf 'tab separates the serialized elements; treating as failure (not clean)\n' >&2
|
|
150
|
+
exit 2 ;;
|
|
151
|
+
esac
|
|
152
|
+
done
|
|
153
|
+
local IFS=$'\t'
|
|
154
|
+
printf '%s' "${_gkv_val[*]+"${_gkv_val[*]}"}"
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — resolve a gate name to its *invocation argv*, the execution counterpart of gate_resolve's declaration path: one element `<dir>/<name>.sh` for a shell gate, two elements `<binary> <name>` for a `.gate`-dispatched one — prefixed, when that member declares knobs, by `env` and one `GATE_SDK_KNOB_<NAME>=<tab-joined>` element per knob. Emits one argv element per line, so a caller looking for the dispatch executable takes the first element that is neither `env` nor an assignment. An absent or non-executable binary when a member dispatches to it is a harness error — exit 2, never a skip and never a pass (§Fail-closed contract): a skip would let the battery silently stop running a gate whenever a build is missing. A binary that cannot report its knobs, and each of the three knob-resolution refusals, exit 2 by the same contract.
|
|
88
159
|
gate_command() {
|
|
89
160
|
local g="$1" d bin
|
|
90
161
|
shift
|
|
@@ -98,9 +169,26 @@ gate_command() {
|
|
|
98
169
|
if [[ ! -x "$bin" ]]; then
|
|
99
170
|
printf 'gate_command: %s dispatches to the native binary, but %s is ' "$g" "$bin" >&2
|
|
100
171
|
printf 'absent or not executable — the gate could not run; treating as ' >&2
|
|
101
|
-
printf 'failure (not clean). Build it:
|
|
172
|
+
printf 'failure (not clean). Build it: bash gate-sdk/bin/build-native.sh\n' >&2
|
|
173
|
+
exit 2
|
|
174
|
+
fi
|
|
175
|
+
local knob_names knob_status knob value
|
|
176
|
+
knob_names="$("$bin" --knobs "$g" 2>&1)"; knob_status=$?
|
|
177
|
+
if [[ "$knob_status" -ne 0 ]]; then
|
|
178
|
+
printf 'gate_command: %s --knobs %s exited %s — the config bridge could not ' "$bin" "$g" "$knob_status" >&2
|
|
179
|
+
printf 'report what %s reads; treating as failure (not clean)\n%s\n' "$g" "$knob_names" >&2
|
|
102
180
|
exit 2
|
|
103
181
|
fi
|
|
182
|
+
local -a env_elems=()
|
|
183
|
+
while IFS= read -r knob; do
|
|
184
|
+
[[ -n "$knob" ]] || continue
|
|
185
|
+
value="$(_gate_knob_value "$knob" "$g")" || exit 2
|
|
186
|
+
env_elems+=("GATE_SDK_KNOB_$knob=$value")
|
|
187
|
+
done <<<"$knob_names"
|
|
188
|
+
if [[ ${#env_elems[@]} -gt 0 ]]; then
|
|
189
|
+
printf 'env\n'
|
|
190
|
+
printf '%s\n' "${env_elems[@]}"
|
|
191
|
+
fi
|
|
104
192
|
printf '%s\n%s\n' "$bin" "$g"
|
|
105
193
|
return 0
|
|
106
194
|
fi
|
|
@@ -119,6 +207,12 @@ gate_native_crate() {
|
|
|
119
207
|
printf '%s\n' "${crate%/}"
|
|
120
208
|
}
|
|
121
209
|
|
|
210
|
+
# spec: gate-sdk/SPEC.md §check-gate-output — the implementation module a .gate-dispatched member's rule lives in, derived from the gate name by the crate's own convention (drop the `check-` prefix, `-`→`_`) rather than held in a second registry that could drift from it
|
|
211
|
+
gate_native_module() {
|
|
212
|
+
local g="${1#check-}"
|
|
213
|
+
printf '%s/src/gates/%s.rs\n' "$(gate_native_crate)" "${g//-/_}"
|
|
214
|
+
}
|
|
215
|
+
|
|
122
216
|
# spec: gate-sdk/SPEC.md §Layout and configuration — GATE_SDK_NATIVE_TARGETS_FILE, defaulted off GATE_SDK_NATIVE_CRATE so the crate's location keeps one owner
|
|
123
217
|
gate_native_targets_file() {
|
|
124
218
|
local crate
|
|
@@ -154,13 +248,9 @@ gate_native_targets() {
|
|
|
154
248
|
gates_list_members "$f"
|
|
155
249
|
}
|
|
156
250
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
for d in $GATE_SDK_KIT_DIRS; do printf '%s\n' "$d"; done
|
|
161
|
-
return 0
|
|
162
|
-
fi
|
|
163
|
-
local sdk parent
|
|
251
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the shipped kit set, by the checks/-or-smoke/ predicate alone: what a tree *contains*, before GATE_SDK_KIT_DIRS narrows what a battery scans
|
|
252
|
+
_gate_kit_roots_derived() {
|
|
253
|
+
local d kit sdk parent
|
|
164
254
|
sdk="$(gate_sdk_root)"
|
|
165
255
|
printf '%s\n' "$sdk"
|
|
166
256
|
parent="${sdk%/*}"
|
|
@@ -173,6 +263,30 @@ gate_kit_roots() {
|
|
|
173
263
|
return 0
|
|
174
264
|
}
|
|
175
265
|
|
|
266
|
+
gate_kit_roots() {
|
|
267
|
+
local d
|
|
268
|
+
if [[ -n "${GATE_SDK_KIT_DIRS:-}" ]]; then
|
|
269
|
+
for d in $GATE_SDK_KIT_DIRS; do printf '%s\n' "$d"; done
|
|
270
|
+
return 0
|
|
271
|
+
fi
|
|
272
|
+
_gate_kit_roots_derived
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the resolved kit-root set as a bridgeable variable, the shape GATE_PRUNE_DIRS already has: GATE_SDK_KIT_DIRS is an override a consumer sets in the environment, so `declare -p` cannot find it and the config bridge cannot carry it. Resolving it here gives the value one computation serving both substrates, which is criterion 6's discharge-by-construction rather than a Rust twin of the predicate.
|
|
276
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — spelled relative to the *current directory*, because a bridged value is baked verbatim into the generated pre-commit hook: an absolute root would commit one machine's checkout path to a tracked file. Resolving each root against the invoking directory keeps the path-prefix comparison exact on the binary side while nothing environment-specific crosses.
|
|
277
|
+
GATE_KIT_ROOTS_HERE=()
|
|
278
|
+
while IFS= read -r _gkr; do
|
|
279
|
+
[[ -n "$_gkr" ]] || continue
|
|
280
|
+
if [[ "$_gkr" == "$PWD"/* ]]; then
|
|
281
|
+
GATE_KIT_ROOTS_HERE+=("${_gkr#"$PWD"/}")
|
|
282
|
+
elif [[ "$_gkr" == /* ]]; then
|
|
283
|
+
GATE_KIT_ROOTS_HERE+=("$(realpath --relative-to="$PWD" "$_gkr" 2>/dev/null || printf '%s' "$_gkr")")
|
|
284
|
+
else
|
|
285
|
+
GATE_KIT_ROOTS_HERE+=("$_gkr")
|
|
286
|
+
fi
|
|
287
|
+
done < <(gate_kit_roots)
|
|
288
|
+
unset _gkr
|
|
289
|
+
|
|
176
290
|
gate_check_dirs() {
|
|
177
291
|
gate_sdk_gates_dir
|
|
178
292
|
local k
|
|
@@ -204,7 +318,12 @@ _gate_kit_roots_rel_ensure_cache() {
|
|
|
204
318
|
anchor="${GATE_SDK_ROOT:-$(gate_sdk_root)}"; anchor="${anchor%/*}"
|
|
205
319
|
_gate_kit_roots_rel_cache=()
|
|
206
320
|
while IFS= read -r root; do
|
|
207
|
-
|
|
321
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — a root already under the anchor is the
|
|
322
|
+
# common case and its relative form is the string remainder, so the realpath fork
|
|
323
|
+
# is paid only for the exotic root that is not
|
|
324
|
+
if [[ "$root" == "$anchor"/* ]]; then
|
|
325
|
+
root="${root#"$anchor"/}"
|
|
326
|
+
elif [[ "$root" == /* ]]; then
|
|
208
327
|
root="$(realpath --relative-to="$anchor" "$root" 2>/dev/null || printf '%s' "$root")"
|
|
209
328
|
fi
|
|
210
329
|
_gate_kit_roots_rel_cache+=("$root")
|
|
@@ -218,6 +337,11 @@ gate_kit_roots_rel() {
|
|
|
218
337
|
printf '%s\n' "${_gate_kit_roots_rel_cache[@]}"
|
|
219
338
|
}
|
|
220
339
|
|
|
340
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the anchored spelling as a bridgeable variable, GATE_KIT_ROOTS' counterpart: a binary-side member needing repo-relative roots (a pathspec, a knob-prefix owner) reads this rather than re-deriving the anchor rule, which an override makes underivable from the absolute set alone
|
|
341
|
+
_gate_kit_roots_rel_ensure_cache
|
|
342
|
+
# shellcheck disable=SC2034 # read across the dispatch seam, never in this shell: the config bridge resolves it by name for a member that declares it
|
|
343
|
+
GATE_KIT_ROOTS_REL=("${_gate_kit_roots_rel_cache[@]}")
|
|
344
|
+
|
|
221
345
|
# spec: gate-sdk/SPEC.md §check-graph — expand each kit:<glob> token in a comma-joined couples/trigger field to <kit-root>/<glob> for every gate_kit_roots_rel member; non-kit tokens pass through verbatim. Assigns into the caller's <outvar> by nameref rather than printing, so a per-manifest-line loop calls this directly (no `$(...)` fork) and the whole loop shares one _gate_kit_roots_rel_ensure_cache fill instead of paying it — and forking — once per line. gate_expand_couples below is the same expansion for a caller that still wants the stdout form.
|
|
222
346
|
gate_expand_couples_var() {
|
|
223
347
|
local -n _gate_expand_couples_out="$1"
|
|
@@ -53,3 +53,28 @@ read_marker_block() {
|
|
|
53
53
|
' "$file"
|
|
54
54
|
)
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
# spec: gate-sdk/SPEC.md §lib/inject.sh — remove_marker_block <file> <begin> <end>; deletes the marker pair and everything between it (inclusive), leaving the rest of the file byte-identical. A no-op exiting 0, printing nothing, when no begin marker is present; a begin marker without its end is malformed (exit 2), as is a missing file — the same rule its siblings take, so all three helpers agree on what a malformed target is. Echoes 'removed' when it removed a block.
|
|
58
|
+
remove_marker_block() {
|
|
59
|
+
(
|
|
60
|
+
set -euo pipefail
|
|
61
|
+
file="$1"; begin="$2"; end="$3"
|
|
62
|
+
[[ -f "$file" ]] \
|
|
63
|
+
|| { echo "remove_marker_block: target file not found: $file" >&2; exit 2; }
|
|
64
|
+
|
|
65
|
+
grep -qF -- "$begin" "$file" || exit 0
|
|
66
|
+
grep -qF -- "$end" "$file" \
|
|
67
|
+
|| { echo "remove_marker_block: begin marker present but end marker missing in $file — refusing to guess the block bounds" >&2; exit 2; }
|
|
68
|
+
|
|
69
|
+
tmp="$(mktemp)"
|
|
70
|
+
trap 'rm -f "$tmp"' EXIT
|
|
71
|
+
awk -v b="$begin" -v e="$end" '
|
|
72
|
+
$0 == b { skip = 1; next }
|
|
73
|
+
$0 == e { skip = 0; next }
|
|
74
|
+
!skip { print }
|
|
75
|
+
' "$file" >"$tmp"
|
|
76
|
+
|
|
77
|
+
cp "$tmp" "$file"
|
|
78
|
+
printf '%s\n' "removed"
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -8,4 +8,30 @@ for _th_kit in "$_th_root"/gate-sdk "$_th_root"/*-kit; do
|
|
|
8
8
|
_th_var="$(printf '%s' "${_th_kit##*/}" | tr '[:lower:]-' '[:upper:]_')_CONFIG_FILE"
|
|
9
9
|
export "${_th_var}=${_th_empty}"
|
|
10
10
|
done
|
|
11
|
+
GATE_SDK_TEST_LIB_DIR="$(cd "${BASH_SOURCE[0]%/*}" && pwd)"
|
|
12
|
+
# spec: gate-sdk/SPEC.md §run-gate-tests — the binary pinned absolute, because a bespoke test
|
|
13
|
+
# runs its gate from a sandbox cwd where the knob's repo-relative default resolves to nothing
|
|
14
|
+
export GATE_SDK_NATIVE_BIN="${GATE_SDK_NATIVE_BIN:-${_th_root}/native/target/release/checkwright-gates}"
|
|
11
15
|
unset _th_root _th_empty _th_kit _th_var
|
|
16
|
+
|
|
17
|
+
# spec: gate-sdk/SPEC.md §run-gate-tests — invoke a gate through its declared dispatch rather
|
|
18
|
+
# than by script path, so a bespoke test names a gate and never a substrate: gate_command
|
|
19
|
+
# resolves a `.sh` path or the binary plus its bridged knobs, under the caller's cwd and env.
|
|
20
|
+
gate_env() { # $1.. = NAME=VALUE — a case's environment, applied in the caller's subshell
|
|
21
|
+
local _ge_kv
|
|
22
|
+
for _ge_kv in "$@"; do export "${_ge_kv?}"; done
|
|
23
|
+
return 0
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
gate_run() { # $1=gate-name $2=checks-dir (absolute) $3.. = gate args
|
|
27
|
+
local _gr_gate="$1" _gr_dir="$2"
|
|
28
|
+
shift 2
|
|
29
|
+
local -a _gr_argv=()
|
|
30
|
+
# shellcheck source=./gate.sh
|
|
31
|
+
source "$GATE_SDK_TEST_LIB_DIR/gate.sh"
|
|
32
|
+
mapfile -t _gr_argv < <(gate_command "$_gr_gate" "$_gr_dir")
|
|
33
|
+
# spec: gate-sdk/SPEC.md §Fail-closed contract — an argv the bridge refused to build is
|
|
34
|
+
# exit 2, the same verdict the dispatcher gives it, never a skipped assertion
|
|
35
|
+
[[ ${#_gr_argv[@]} -gt 0 ]] || return 2
|
|
36
|
+
"${_gr_argv[@]}" "$@"
|
|
37
|
+
}
|
|
@@ -16,6 +16,8 @@ check-gate-fixture-coverage
|
|
|
16
16
|
check-gate-exemption-tasks
|
|
17
17
|
check-gate-assertions
|
|
18
18
|
check-gate-substrate-parity
|
|
19
|
+
check-crate-arms
|
|
20
|
+
check-install-disposition
|
|
19
21
|
check-graph
|
|
20
22
|
check-commit-msg
|
|
21
23
|
check-tree-terms
|
|
@@ -100,3 +102,43 @@ grep -q 'pre-commit: check-shellcheck failed' <<<"$out" || { echo "smoke(hook):
|
|
|
100
102
|
grep -q 'unused_var' <<<"$out" || { echo "smoke(hook): red hook output not verbatim" >&2; exit 1; }
|
|
101
103
|
git reset -q -- scripts/smoke-hook-probe.sh
|
|
102
104
|
rm scripts/smoke-hook-probe.sh
|
|
105
|
+
|
|
106
|
+
# spec: gate-sdk/SPEC.md §port-blockers — the tokenizer rules, exercised behaviourally because
|
|
107
|
+
# the tool is a bin/ tool and owed no fixture pair: a scan that truncates at a here-string, or
|
|
108
|
+
# steals a case-pattern close inside a substitution, reports the trailing requirement as absent
|
|
109
|
+
pb="$(mktemp -d)"
|
|
110
|
+
printf '%s\n' 'check-smoke-tokenizer' > "$pb/gates.list"
|
|
111
|
+
cat > "$pb/check-smoke-tokenizer.sh" <<'EOF'
|
|
112
|
+
#!/usr/bin/env bash
|
|
113
|
+
# graph: couples=scripts/gates.list dir=one valve=none tier=precommit
|
|
114
|
+
set -uo pipefail
|
|
115
|
+
if [[ -n "$(pb_alpha_prog)" ]]; then
|
|
116
|
+
pb_bravo_prog
|
|
117
|
+
fi
|
|
118
|
+
v="$( case "$1" in a) pb_charlie_prog ;; *) pb_delta_prog ;; esac )"
|
|
119
|
+
read -r w <<<"$v"
|
|
120
|
+
for f in ./*.sh; do pb_tail_prog "$f" "$w"; done
|
|
121
|
+
fail_closed 0 SMOKE-TOKENIZER probe
|
|
122
|
+
EOF
|
|
123
|
+
pb_run() { GATE_SDK_GATES_DIR="$pb" bash "$SDK/bin/port-blockers.sh" "$@"; }
|
|
124
|
+
|
|
125
|
+
out="$(pb_run)" || { echo "smoke(port-blockers): default arm exited non-zero" >&2; exit 1; }
|
|
126
|
+
for prog in pb_bravo_prog pb_charlie_prog pb_delta_prog pb_tail_prog; do
|
|
127
|
+
grep -q " $prog " <<<"$out" || {
|
|
128
|
+
echo "smoke(port-blockers): scan lost $prog — the tokenizer truncated: $out" >&2; exit 1; }
|
|
129
|
+
done
|
|
130
|
+
if grep -q 'pb_alpha_prog' <<<"$out"; then
|
|
131
|
+
echo "smoke(port-blockers): reported a word inside [[ ]], which is not command position: $out" >&2; exit 1
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
out="$(pb_run --group)" || { echo "smoke(port-blockers): --group exited non-zero" >&2; exit 1; }
|
|
135
|
+
grep -q '1 group(s) formed, 0 undecidable' <<<"$out" || {
|
|
136
|
+
echo "smoke(port-blockers): --group did not key a fully-scannable member: $out" >&2; exit 1; }
|
|
137
|
+
grep -q 'libs=fail_closed globs=\*.sh' <<<"$out" || {
|
|
138
|
+
echo "smoke(port-blockers): --group key lost a factor: $out" >&2; exit 1; }
|
|
139
|
+
|
|
140
|
+
if pb_run --nope >/dev/null 2>&1; then
|
|
141
|
+
echo "smoke(port-blockers): an unrecognized argument was not refused" >&2; exit 1
|
|
142
|
+
fi
|
|
143
|
+
pb_run --help >/dev/null || { echo "smoke(port-blockers): --help did not exit 0" >&2; exit 1; }
|
|
144
|
+
rm -rf "$pb"
|