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,134 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:smoke/*.sh,kit:gate-tests/*.test.sh,kit:bin/*.sh dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-assertion-strength — a guard over a call to a script whose declared `# exit:` header binds a verdict token to one non-zero code must not name that token in its failure message while comparing no status to that token's code
|
|
4
|
-
#
|
|
5
|
-
# usage: check-assertion-strength.sh [dir...] scan the named smoke/gate-tests dir(s)
|
|
6
|
-
# (no args) each kit's smoke/ and gate-tests/
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
# shellcheck source=../lib/gate.sh
|
|
11
|
-
source "$SDK/lib/gate.sh"
|
|
12
|
-
|
|
13
|
-
WINDOW=8
|
|
14
|
-
|
|
15
|
-
# spec: gate-sdk/SPEC.md §check-assertion-strength — the token->code grammar: each uppercase token binds to the nearest preceding integer on the line; a token bound to several codes or to code 0 is not discriminable and is dropped, which is what keeps an honest `did not verdict OK` message off the finding list
|
|
16
|
-
exit_map() {
|
|
17
|
-
awk '
|
|
18
|
-
/^#[[:space:]]*exit:/ {
|
|
19
|
-
sub(/^#[[:space:]]*exit:/, "")
|
|
20
|
-
code = -1
|
|
21
|
-
n = split($0, part, /[^A-Za-z0-9_-]+/)
|
|
22
|
-
for (i = 1; i <= n; i++) {
|
|
23
|
-
t = part[i]
|
|
24
|
-
if (t == "") continue
|
|
25
|
-
if (t ~ /^[0-9]+$/) { code = t + 0; continue }
|
|
26
|
-
if (code < 0) continue
|
|
27
|
-
if (t !~ /^[A-Z][A-Z0-9]*(-[A-Z0-9]+)*$/) continue
|
|
28
|
-
if (length(t) < 2) continue
|
|
29
|
-
if (t in code_of) { if (code_of[t] != code) dup[t] = 1 }
|
|
30
|
-
else code_of[t] = code
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
END { for (t in code_of) if (!(t in dup) && code_of[t] != 0) print t, code_of[t] }
|
|
34
|
-
' "$1"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
fail=0
|
|
38
|
-
scanned=0
|
|
39
|
-
declaring=0
|
|
40
|
-
declare -a findings=()
|
|
41
|
-
|
|
42
|
-
scan_file() {
|
|
43
|
-
local f="$1" kitroot="$2"
|
|
44
|
-
local -a L=()
|
|
45
|
-
mapfile -t L < "$f"
|
|
46
|
-
local n=${#L[@]} i j
|
|
47
|
-
|
|
48
|
-
local -a inv=()
|
|
49
|
-
for (( i = 0; i < n; i++ )); do
|
|
50
|
-
[[ "${L[i]}" =~ bin/([A-Za-z0-9._-]+\.sh) ]] || continue
|
|
51
|
-
[[ -r "$kitroot/bin/${BASH_REMATCH[1]}" ]] || continue
|
|
52
|
-
inv+=("$i")
|
|
53
|
-
done
|
|
54
|
-
[[ ${#inv[@]} -gt 0 ]] || return 0
|
|
55
|
-
|
|
56
|
-
local k callee name map tok code wtext gtext line stop cbstart
|
|
57
|
-
for (( k = 0; k < ${#inv[@]}; k++ )); do
|
|
58
|
-
i="${inv[k]}"
|
|
59
|
-
[[ "${L[i]}" =~ bin/([A-Za-z0-9._-]+\.sh) ]] || continue
|
|
60
|
-
name="${BASH_REMATCH[1]}"
|
|
61
|
-
callee="$kitroot/bin/$name"
|
|
62
|
-
map="$(exit_map "$callee")"; st=$?
|
|
63
|
-
fail_closed "$st" check-assertion-strength awk
|
|
64
|
-
[[ -n "$map" ]] || continue
|
|
65
|
-
declaring=$((declaring + 1))
|
|
66
|
-
|
|
67
|
-
[[ "${L[i]}" == *'||'*|| "${L[i]}" == *'&&'* || "${L[i]}" =~ ^[[:space:]]*if[[:space:]] || "${L[i]}" == *'; then'* ]] || continue
|
|
68
|
-
|
|
69
|
-
stop=$(( i + WINDOW ))
|
|
70
|
-
(( stop > n - 1 )) && stop=$(( n - 1 ))
|
|
71
|
-
(( k + 1 < ${#inv[@]} && inv[k+1] - 1 < stop )) && stop=$(( inv[k+1] - 1 ))
|
|
72
|
-
|
|
73
|
-
cbstart="$i"
|
|
74
|
-
while (( cbstart > 0 )) && [[ "${L[cbstart-1]}" =~ ^[[:space:]]*# ]]; do cbstart=$(( cbstart - 1 )); done
|
|
75
|
-
gtext=""
|
|
76
|
-
for (( j = cbstart; j <= stop; j++ )); do gtext+="${L[j]}"$'\n'; done
|
|
77
|
-
[[ "$gtext" =~ ^\ *#.*assertion-strength-exempt: || "$gtext" == *'assertion-strength-exempt:'* ]] && continue
|
|
78
|
-
|
|
79
|
-
wtext=""
|
|
80
|
-
for (( j = i; j <= stop; j++ )); do
|
|
81
|
-
line="${L[j]}"
|
|
82
|
-
[[ "$line" == *echo* || "$line" == *printf* ]] && wtext+="$line"$'\n'
|
|
83
|
-
done
|
|
84
|
-
[[ -n "$wtext" ]] || continue
|
|
85
|
-
|
|
86
|
-
while read -r tok code; do
|
|
87
|
-
[[ -n "$tok" ]] || continue
|
|
88
|
-
[[ "$wtext" =~ (^|[^A-Za-z0-9_-])"$tok"([^A-Za-z0-9_-]|$) ]] || continue
|
|
89
|
-
[[ "$gtext" =~ (-eq|-ne|==|!=)[[:space:]]*\"?"$code"\"? ]] && continue
|
|
90
|
-
[[ "$gtext" =~ (^|[^A-Za-z0-9_-])"$code"\) ]] && continue
|
|
91
|
-
findings+=("$f:$(( i + 1 )): message names $tok (exit $code of $name) but the guard compares no status to $code")
|
|
92
|
-
fail=1
|
|
93
|
-
done <<<"$map"
|
|
94
|
-
done
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
declare -a scan_dirs=()
|
|
98
|
-
if [[ $# -gt 0 ]]; then
|
|
99
|
-
scan_dirs=("$@")
|
|
100
|
-
else
|
|
101
|
-
while IFS= read -r k; do
|
|
102
|
-
[[ -d "$k/smoke" ]] && scan_dirs+=("$k/smoke")
|
|
103
|
-
[[ -d "$k/gate-tests" ]] && scan_dirs+=("$k/gate-tests")
|
|
104
|
-
done < <(gate_kit_roots)
|
|
105
|
-
fi
|
|
106
|
-
|
|
107
|
-
shopt -s nullglob
|
|
108
|
-
for d in "${scan_dirs[@]}"; do
|
|
109
|
-
[[ -d "$d" ]] || { echo "check-assertion-strength: not a directory: $d" >&2; exit 2; }
|
|
110
|
-
kitroot="$(cd "$d/.." && pwd)"
|
|
111
|
-
for f in "$d"/*.sh; do
|
|
112
|
-
[[ -r "$f" ]] || { echo "check-assertion-strength: unreadable script: $f" >&2; exit 2; }
|
|
113
|
-
scanned=$((scanned + 1))
|
|
114
|
-
scan_file "$f" "$kitroot"
|
|
115
|
-
done
|
|
116
|
-
done
|
|
117
|
-
shopt -u nullglob
|
|
118
|
-
|
|
119
|
-
if [[ "$fail" -ne 0 ]]; then
|
|
120
|
-
echo "check-assertion-strength: guard(s) whose failure message is more specific than the"
|
|
121
|
-
echo "guard behind it — the message names a verdict token the callee's declared '# exit:'"
|
|
122
|
-
echo "header binds to one non-zero code, but the guard discriminates only zero from"
|
|
123
|
-
echo "non-zero, so a different failure mode reports itself under the wrong name"
|
|
124
|
-
echo "(gate-sdk/SPEC.md §check-assertion-strength):"
|
|
125
|
-
for m in "${findings[@]}"; do echo " $m"; done
|
|
126
|
-
echo " help: capture the status and compare it to the code the message claims —"
|
|
127
|
-
echo " cmd && rc=0 || rc=\$? then if [[ \"\$rc\" -ne <code> ]]; then …"
|
|
128
|
-
echo " (report the observed status in the message), OR reword the message to claim only"
|
|
129
|
-
echo " what truthiness establishes, OR add a '# assertion-strength-exempt: <reason>' line"
|
|
130
|
-
echo " on a guard that establishes the outcome by other means."
|
|
131
|
-
exit 1
|
|
132
|
-
fi
|
|
133
|
-
echo "ASSERTION-STRENGTH: clean ($scanned script(s) scanned; $declaring call(s) to a script with a declared exit contract)"
|
|
134
|
-
exit 0
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=README.md,kit:gate-tests/* dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-kit-registration — every gate_kit_roots kit is registered in the human-facing docs: a registry-doc row linking into each root, and a fixture-runner line for each root that ships gate-tests
|
|
4
|
-
#
|
|
5
|
-
# usage: check-kit-registration.sh [registry-doc [runner-doc]]
|
|
6
|
-
# docs resolve relative to the git toplevel; defaults README.md / README.md,
|
|
7
|
-
# overridable via GATE_SDK_REGISTRY_DOC / GATE_SDK_RUNNER_DOC.
|
|
8
|
-
set -uo pipefail
|
|
9
|
-
|
|
10
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
# shellcheck source=../lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
|
|
14
|
-
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
|
|
15
|
-
|| { echo "check-kit-registration: not a git repository — cannot test tracked kit files" >&2; exit 2; }
|
|
16
|
-
|
|
17
|
-
REGISTRY_DOC="${1:-${GATE_SDK_REGISTRY_DOC:-README.md}}"
|
|
18
|
-
RUNNER_DOC="${2:-${GATE_SDK_RUNNER_DOC:-README.md}}"
|
|
19
|
-
[[ "$REGISTRY_DOC" == /* ]] || REGISTRY_DOC="$REPO_ROOT/$REGISTRY_DOC"
|
|
20
|
-
[[ "$RUNNER_DOC" == /* ]] || RUNNER_DOC="$REPO_ROOT/$RUNNER_DOC"
|
|
21
|
-
[[ -f "$REGISTRY_DOC" ]] || { echo "check-kit-registration: registry doc not found: $REGISTRY_DOC" >&2; exit 2; }
|
|
22
|
-
[[ -f "$RUNNER_DOC" ]] || { echo "check-kit-registration: runner doc not found: $RUNNER_DOC" >&2; exit 2; }
|
|
23
|
-
|
|
24
|
-
mapfile -t KIT_ROOTS < <(gate_kit_roots_rel)
|
|
25
|
-
[[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-kit-registration: no kit roots enumerated" >&2; exit 2; }
|
|
26
|
-
|
|
27
|
-
root_ships_gate_tests() {
|
|
28
|
-
local root="$1" out st
|
|
29
|
-
out="$(git -C "$REPO_ROOT" ls-files -- "${root%/}/gate-tests/" 2>/dev/null)"; st=$?
|
|
30
|
-
fail_closed "$st" check-kit-registration "git ls-files"
|
|
31
|
-
[[ -n "$out" ]]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
missing_row=()
|
|
35
|
-
missing_runner=()
|
|
36
|
-
runner_owed=0
|
|
37
|
-
for r in "${KIT_ROOTS[@]}"; do
|
|
38
|
-
r="${r%/}"
|
|
39
|
-
# assertion A: registry row — a '](<kit>/…' link into the root in the registry doc
|
|
40
|
-
grep -qF -- "]($r/" "$REGISTRY_DOC" || missing_row+=("$r")
|
|
41
|
-
# assertion B: fixture-runner line — a '<kit>/gate-tests' line for each root shipping gate-tests
|
|
42
|
-
if root_ships_gate_tests "$r"; then
|
|
43
|
-
runner_owed=$((runner_owed + 1))
|
|
44
|
-
grep -qF -- "$r/gate-tests" "$RUNNER_DOC" || missing_runner+=("$r")
|
|
45
|
-
fi
|
|
46
|
-
done
|
|
47
|
-
|
|
48
|
-
if [[ ${#missing_row[@]} -gt 0 || ${#missing_runner[@]} -gt 0 ]]; then
|
|
49
|
-
if [[ ${#missing_row[@]} -gt 0 ]]; then
|
|
50
|
-
echo "check-kit-registration: kit root(s) not registered in the registry doc"
|
|
51
|
-
echo "($REGISTRY_DOC has no '](<kit>/' link row):"
|
|
52
|
-
for r in "${missing_row[@]}"; do echo " $r"; done
|
|
53
|
-
fi
|
|
54
|
-
if [[ ${#missing_runner[@]} -gt 0 ]]; then
|
|
55
|
-
[[ ${#missing_row[@]} -gt 0 ]] && echo ""
|
|
56
|
-
echo "check-kit-registration: kit root(s) shipping gate-tests but absent from the"
|
|
57
|
-
echo "fixture-runner battery ($RUNNER_DOC names no '<kit>/gate-tests' line):"
|
|
58
|
-
for r in "${missing_runner[@]}"; do echo " $r"; done
|
|
59
|
-
fi
|
|
60
|
-
echo " help: add the kit's registry row to $REGISTRY_DOC (a '](<kit>/' link — bare"
|
|
61
|
-
echo " dir or a page under it, e.g. '](<kit>/index.md)') and,"
|
|
62
|
-
echo " for a kit that ships gate-tests, its 'run-gate-tests.sh <kit>/gate-tests'"
|
|
63
|
-
echo " line to $RUNNER_DOC, so a landed kit cannot fall out of the docs."
|
|
64
|
-
exit 1
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
echo "KIT-REGISTRATION: clean (${#KIT_ROOTS[@]} kit root(s) each carry a registry row; ${runner_owed} shipping gate-tests each name a fixture-runner line)"
|
|
68
|
-
exit 0
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:smoke/install.sh,kit:smoke/violation.sh dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-smoke-entry-guard — every mutating smoke script (install.sh, violation.sh) carries the ${SMOKE_KIT_ROOT:?} entry-point guard so a bare run refuses instead of mutating the caller's tree
|
|
4
|
-
#
|
|
5
|
-
# usage: check-smoke-entry-guard.sh [root]
|
|
6
|
-
# bare: sweep gate_kit_roots against the git toplevel; root: resolve relative
|
|
7
|
-
# kit roots against a fixture tree (the case dir's gate-sdk-config.sh names them).
|
|
8
|
-
set -uo pipefail
|
|
9
|
-
|
|
10
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
# shellcheck source=../lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
|
|
14
|
-
ROOT="${1:-}"
|
|
15
|
-
if [[ -z "$ROOT" ]]; then
|
|
16
|
-
ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
|
|
17
|
-
|| { echo "check-smoke-entry-guard: not a git repository and no root argument" >&2; exit 2; }
|
|
18
|
-
fi
|
|
19
|
-
[[ -d "$ROOT" ]] || { echo "check-smoke-entry-guard: root not found: $ROOT" >&2; exit 2; }
|
|
20
|
-
|
|
21
|
-
GUARD='${SMOKE_KIT_ROOT:?'
|
|
22
|
-
|
|
23
|
-
mapfile -t KIT_ROOTS < <(gate_kit_roots)
|
|
24
|
-
[[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-smoke-entry-guard: no kit roots enumerated" >&2; exit 2; }
|
|
25
|
-
|
|
26
|
-
findings=()
|
|
27
|
-
swept=0
|
|
28
|
-
for r in "${KIT_ROOTS[@]}"; do
|
|
29
|
-
r="${r%/}"
|
|
30
|
-
abs="$r"
|
|
31
|
-
[[ "$abs" == /* ]] || abs="$ROOT/$r"
|
|
32
|
-
kit="${r##*/}"
|
|
33
|
-
[[ -d "$abs/smoke" ]] || continue
|
|
34
|
-
for name in install.sh violation.sh; do
|
|
35
|
-
f="$abs/smoke/$name"
|
|
36
|
-
[[ -e "$f" ]] || continue
|
|
37
|
-
[[ -r "$f" ]] || { echo "check-smoke-entry-guard: unreadable smoke script: $kit/smoke/$name" >&2; exit 2; }
|
|
38
|
-
swept=$((swept + 1))
|
|
39
|
-
grep -qF -- "$GUARD" "$f" || findings+=("$kit/smoke/$name: no \${SMOKE_KIT_ROOT:?…} entry-point guard")
|
|
40
|
-
done
|
|
41
|
-
done
|
|
42
|
-
|
|
43
|
-
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
44
|
-
echo "check-smoke-entry-guard: mutating smoke script(s) missing the entry-point guard:"
|
|
45
|
-
for f in "${findings[@]}"; do echo " $f"; done
|
|
46
|
-
echo " help: add ': \"\${SMOKE_KIT_ROOT:?run via run-consumer-smoke.sh}\"' right after"
|
|
47
|
-
echo " 'set -euo pipefail' and before the first mutating command, so a bare run"
|
|
48
|
-
echo " refuses instead of writing into the caller's repo (gate-sdk/SPEC.md §Consumer smoke)."
|
|
49
|
-
exit 1
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
echo "SMOKE-ENTRY-GUARD: clean ($swept mutating smoke script(s) carry the entry-point guard)"
|
|
53
|
-
exit 0
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:templates/*.list,kit:*/*.sh dir=bi valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-template-registry-parity — a kit's shipped `.list` registry template names exactly the artifacts of its sibling directory, both directions
|
|
4
|
-
#
|
|
5
|
-
# usage: check-template-registry-parity.sh [root]
|
|
6
|
-
# bare: sweep gate_kit_roots against the git toplevel; root: resolve relative
|
|
7
|
-
# kit roots against a fixture tree (the case dir's gate-sdk-config.sh names them).
|
|
8
|
-
set -uo pipefail
|
|
9
|
-
|
|
10
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
# shellcheck source=../lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
|
|
14
|
-
ROOT="${1:-}"
|
|
15
|
-
if [[ -z "$ROOT" ]]; then
|
|
16
|
-
ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" \
|
|
17
|
-
|| { echo "check-template-registry-parity: not a git repository and no root argument" >&2; exit 2; }
|
|
18
|
-
fi
|
|
19
|
-
[[ -d "$ROOT" ]] || { echo "check-template-registry-parity: root not found: $ROOT" >&2; exit 2; }
|
|
20
|
-
|
|
21
|
-
mapfile -t KIT_ROOTS < <(gate_kit_roots)
|
|
22
|
-
[[ ${#KIT_ROOTS[@]} -gt 0 ]] || { echo "check-template-registry-parity: no kit roots enumerated" >&2; exit 2; }
|
|
23
|
-
|
|
24
|
-
findings=()
|
|
25
|
-
registries=0
|
|
26
|
-
skipped=0
|
|
27
|
-
|
|
28
|
-
for r in "${KIT_ROOTS[@]}"; do
|
|
29
|
-
r="${r%/}"
|
|
30
|
-
abs="$r"
|
|
31
|
-
[[ "$abs" == /* ]] || abs="$ROOT/$r"
|
|
32
|
-
kit="${r##*/}"
|
|
33
|
-
|
|
34
|
-
shopt -s nullglob
|
|
35
|
-
templates=("$abs"/templates/*.list)
|
|
36
|
-
shopt -u nullglob
|
|
37
|
-
|
|
38
|
-
for tpl in "${templates[@]}"; do
|
|
39
|
-
base="${tpl##*/}"
|
|
40
|
-
dir="$abs/${base%.list}"
|
|
41
|
-
# spec: gate-sdk/SPEC.md §check-template-registry-parity — the population predicate: a `.list` template enters only beside a sibling directory of kit-shipped artifacts, so a template of consumer rule content is skipped-and-counted by construction rather than by an exception naming it
|
|
42
|
-
[[ -d "$dir" ]] || { skipped=$((skipped + 1)); continue; }
|
|
43
|
-
[[ -r "$tpl" ]] || { echo "check-template-registry-parity: template not readable: $tpl" >&2; exit 2; }
|
|
44
|
-
[[ -r "$dir" && -x "$dir" ]] || { echo "check-template-registry-parity: sibling directory not readable: $dir" >&2; exit 2; }
|
|
45
|
-
registries=$((registries + 1))
|
|
46
|
-
rel_tpl="${tpl#"$ROOT"/}"
|
|
47
|
-
|
|
48
|
-
listing="$(git -C "$dir" ls-files -- '*.sh')"; st=$?
|
|
49
|
-
[[ "$st" -eq 0 ]] || { echo "check-template-registry-parity: git ls-files failed under $dir" >&2; exit 2; }
|
|
50
|
-
shipped="$(
|
|
51
|
-
while IFS= read -r f; do
|
|
52
|
-
[[ -n "$f" && "$f" != */* ]] || continue
|
|
53
|
-
printf '%s\n' "${f%.sh}"
|
|
54
|
-
done <<<"$listing" | sort -u
|
|
55
|
-
)"
|
|
56
|
-
registered="$(gates_list_members "$tpl" | sort -u)"
|
|
57
|
-
|
|
58
|
-
# assertion A: every shipped artifact is registered
|
|
59
|
-
while IFS= read -r m; do
|
|
60
|
-
[[ -n "$m" ]] && findings+=("$kit: $rel_tpl does not register shipped artifact: $m")
|
|
61
|
-
done < <(comm -23 <(printf '%s\n' "$shipped") <(printf '%s\n' "$registered"))
|
|
62
|
-
|
|
63
|
-
# assertion B: every registry line resolves to a shipped artifact
|
|
64
|
-
while IFS= read -r m; do
|
|
65
|
-
[[ -n "$m" ]] && findings+=("$kit: $rel_tpl registers a name no shipped artifact answers: $m")
|
|
66
|
-
done < <(comm -13 <(printf '%s\n' "$shipped") <(printf '%s\n' "$registered"))
|
|
67
|
-
done
|
|
68
|
-
done
|
|
69
|
-
|
|
70
|
-
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
71
|
-
echo "check-template-registry-parity: a kit's shipped registry template is out of parity with the directory it registers:"
|
|
72
|
-
printf ' %s\n' "${findings[@]}"
|
|
73
|
-
echo " help: a shipped registry template names the kit's whole bundled set — add the"
|
|
74
|
-
echo " missing line (the consumer prunes its own copy, the kit ships all of it),"
|
|
75
|
-
echo " or drop the line whose artifact the kit no longer ships. An untracked file"
|
|
76
|
-
echo " is not shipped and forces nothing: commit it first."
|
|
77
|
-
exit 1
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
echo "TEMPLATE-REGISTRY-PARITY: clean ($registries shipped registry template(s) in name-set parity with the sibling directory each registers; $skipped .list template(s) with no such sibling skipped)"
|
|
81
|
-
exit 0
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:gate-tests/*.test.sh,kit:smoke/install.sh,kit:smoke/violation.sh dir=one valve=none tier=precommit
|
|
3
|
-
# spec: gate-sdk/SPEC.md §check-test-hermetic — two assertions (A) every bespoke gate-tests/*.test.sh sources lib/test-hermetic.sh or carries a `# hermetic-exempt:` marker; (B) a credential-managing smoke script pins every own-kit bin call ("$SMOKE_KIT_ROOT/bin/*") to a *_CRED_FILE path so it cannot resolve the ambient ~/.claude credential
|
|
4
|
-
#
|
|
5
|
-
# usage: check-test-hermetic.sh [dir...] assertion A over gate-tests dir(s)
|
|
6
|
-
# check-test-hermetic.sh --smoke [dir...] assertion B over smoke dir(s)
|
|
7
|
-
# (no args) both, over each kit's gate-tests/ and smoke/
|
|
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
|
-
MODE=all
|
|
15
|
-
if [[ "${1:-}" == "--smoke" ]]; then
|
|
16
|
-
MODE=smoke; shift
|
|
17
|
-
elif [[ $# -gt 0 ]]; then
|
|
18
|
-
MODE=tests
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
fail=0
|
|
22
|
-
tests_total=0
|
|
23
|
-
smoke_total=0
|
|
24
|
-
|
|
25
|
-
# assertion A: every bespoke gate-tests/*.test.sh sources the hermetic bootstrap or is exempt
|
|
26
|
-
scan_tests() {
|
|
27
|
-
local -a scan_dirs=()
|
|
28
|
-
if [[ $# -gt 0 ]]; then
|
|
29
|
-
scan_dirs=("$@")
|
|
30
|
-
else
|
|
31
|
-
local k
|
|
32
|
-
while IFS= read -r k; do scan_dirs+=("$k/gate-tests"); done < <(gate_kit_roots)
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
local -a files=()
|
|
36
|
-
local d
|
|
37
|
-
shopt -s nullglob
|
|
38
|
-
for d in "${scan_dirs[@]}"; do
|
|
39
|
-
files+=("$d"/*.test.sh)
|
|
40
|
-
done
|
|
41
|
-
shopt -u nullglob
|
|
42
|
-
[[ ${#files[@]} -gt 0 ]] || { echo "check-test-hermetic: no *.test.sh under: ${scan_dirs[*]}" >&2; exit 2; }
|
|
43
|
-
|
|
44
|
-
local -a leaky=()
|
|
45
|
-
local f
|
|
46
|
-
for f in "${files[@]}"; do
|
|
47
|
-
tests_total=$((tests_total + 1))
|
|
48
|
-
grep -q 'lib/test-hermetic\.sh' "$f" && continue
|
|
49
|
-
grep -qE '^#[[:space:]]*hermetic-exempt:' "$f" && continue
|
|
50
|
-
leaky+=("$f")
|
|
51
|
-
done
|
|
52
|
-
|
|
53
|
-
if [[ ${#leaky[@]} -gt 0 ]]; then
|
|
54
|
-
echo "check-test-hermetic: bespoke test(s) neither source lib/test-hermetic.sh nor"
|
|
55
|
-
echo "carry a '# hermetic-exempt:' marker (gate-sdk/SPEC.md §check-test-hermetic — a"
|
|
56
|
-
echo "test on the invoker's cwd config can green wrongly on the consumer's posture):"
|
|
57
|
-
for f in "${leaky[@]}"; do echo " $f"; done
|
|
58
|
-
echo " help: source the bootstrap as the test's first act —"
|
|
59
|
-
echo " source \"\$(dirname \"\${BASH_SOURCE[0]}\")/../../gate-sdk/lib/test-hermetic.sh\""
|
|
60
|
-
echo " (per-case config overrides after the source still win by ordering), OR add a"
|
|
61
|
-
echo " '# hermetic-exempt: <reason>' line for a test that proves hermeticity otherwise."
|
|
62
|
-
fail=1
|
|
63
|
-
fi
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
# assertion B: a credential-managing smoke script (one that assigns *_CRED_FILE) must pin
|
|
67
|
-
# every own-kit bin call, else the bin resolves its cred file from the ambient ~/.claude
|
|
68
|
-
scan_smoke() {
|
|
69
|
-
local -a smoke_dirs=()
|
|
70
|
-
if [[ $# -gt 0 ]]; then
|
|
71
|
-
smoke_dirs=("$@")
|
|
72
|
-
else
|
|
73
|
-
local k
|
|
74
|
-
while IFS= read -r k; do [[ -d "$k/smoke" ]] && smoke_dirs+=("$k/smoke"); done < <(gate_kit_roots)
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
local -a leaky=()
|
|
78
|
-
local d name f line lineno content
|
|
79
|
-
for d in "${smoke_dirs[@]}"; do
|
|
80
|
-
for name in install.sh violation.sh; do
|
|
81
|
-
f="$d/$name"
|
|
82
|
-
[[ -e "$f" ]] || continue
|
|
83
|
-
[[ -r "$f" ]] || { echo "check-test-hermetic: unreadable smoke script: $f" >&2; exit 2; }
|
|
84
|
-
smoke_total=$((smoke_total + 1))
|
|
85
|
-
grep -qE '^#[[:space:]]*hermetic-exempt:' "$f" && continue
|
|
86
|
-
grep -q '_CRED_FILE=' "$f" || continue
|
|
87
|
-
while IFS= read -r line; do
|
|
88
|
-
lineno="${line%%:*}"
|
|
89
|
-
content="${line#*:}"
|
|
90
|
-
[[ "$content" == *_CRED_FILE=* ]] && continue
|
|
91
|
-
leaky+=("$f:$lineno")
|
|
92
|
-
done < <(grep -nF 'SMOKE_KIT_ROOT/bin/' "$f")
|
|
93
|
-
done
|
|
94
|
-
done
|
|
95
|
-
|
|
96
|
-
if [[ ${#leaky[@]} -gt 0 ]]; then
|
|
97
|
-
echo "check-test-hermetic: credential-managing smoke script(s) invoke an own-kit bin"
|
|
98
|
-
echo "(\$SMOKE_KIT_ROOT/bin/…) with no *_CRED_FILE= pin on the line — the bin resolves"
|
|
99
|
-
echo "its credential file from the ambient \$HOME/.claude, so the smoke reads live"
|
|
100
|
-
echo "credential state (gate-sdk/SPEC.md §check-test-hermetic):"
|
|
101
|
-
for f in "${leaky[@]}"; do echo " $f"; done
|
|
102
|
-
echo " help: prefix the invocation with a hermetic pin to an absent path, e.g."
|
|
103
|
-
echo " <KIT>_CRED_FILE=\"\$pp/absent.json\" bash \"\$SMOKE_KIT_ROOT/bin/…\" …"
|
|
104
|
-
echo " (an absent path zeroes the login timestamp so no ambient auth event leaks in),"
|
|
105
|
-
echo " OR add a '# hermetic-exempt: <reason>' line for a script hermetic otherwise."
|
|
106
|
-
fail=1
|
|
107
|
-
fi
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
case "$MODE" in
|
|
111
|
-
tests) scan_tests "$@" ;;
|
|
112
|
-
smoke) scan_smoke "$@" ;;
|
|
113
|
-
all) scan_tests; scan_smoke ;;
|
|
114
|
-
esac
|
|
115
|
-
|
|
116
|
-
[[ "$fail" -eq 0 ]] || exit 1
|
|
117
|
-
|
|
118
|
-
echo "TEST-HERMETIC: clean ($tests_total bespoke test(s) pinned to kit defaults; $smoke_total smoke script(s) checked for ambient-credential leaks)"
|
|
119
|
-
exit 0
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=TASK-QUEUE.md,.workflow/lesson-evidence.txt dir=one valve=none tier=precommit
|
|
3
|
-
# spec: lifecycle-kit/SPEC.md §check-lesson-disposition — every Lessons entry present at HEAD and gone from the worktree leaves a well-formed disposition stamp in the evidence file
|
|
4
|
-
#
|
|
5
|
-
# usage: check-lesson-disposition.sh [queue-head] [queue-worktree] [evidence-file]
|
|
6
|
-
# bare compares git show HEAD:<queue> vs the worktree + LIFECYCLE_KIT_LESSON_EVIDENCE_FILE;
|
|
7
|
-
# three explicit file args drive it hermetically (the check-task-conservation precedent).
|
|
8
|
-
set -uo pipefail
|
|
9
|
-
|
|
10
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
12
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
# shellcheck source=../lib/stages.sh
|
|
15
|
-
source "$KIT/lib/stages.sh"
|
|
16
|
-
|
|
17
|
-
cleanup=()
|
|
18
|
-
trap 'rm -f ${cleanup[@]+"${cleanup[@]}"}' EXIT
|
|
19
|
-
|
|
20
|
-
if [[ -n "${1:-}" ]]; then
|
|
21
|
-
HEAD_FILE="$1"; WORK_FILE="${2:-}"; EVID_FILE="${3:-}"
|
|
22
|
-
[[ -f "$HEAD_FILE" ]] || { echo "check-lesson-disposition: queue-head not found: $HEAD_FILE" >&2; exit 2; }
|
|
23
|
-
[[ -f "$WORK_FILE" ]] || { echo "check-lesson-disposition: queue-worktree not found: $WORK_FILE" >&2; exit 2; }
|
|
24
|
-
[[ -f "$EVID_FILE" ]] || { echo "check-lesson-disposition: evidence file not found: $EVID_FILE" >&2; exit 2; }
|
|
25
|
-
else
|
|
26
|
-
QUEUE="$LIFECYCLE_KIT_QUEUE_FILE"
|
|
27
|
-
git rev-parse --git-dir >/dev/null 2>&1 || {
|
|
28
|
-
echo "LESSON-DISPOSITION: clean (no git repository — no HEAD baseline to compare)"; exit 0; }
|
|
29
|
-
ht="$(mktemp)"; cleanup+=("$ht")
|
|
30
|
-
if ! git show "HEAD:$QUEUE" >"$ht" 2>/dev/null; then
|
|
31
|
-
echo "LESSON-DISPOSITION: clean ($QUEUE not at HEAD — no prior lessons to disposition)"; exit 0
|
|
32
|
-
fi
|
|
33
|
-
[[ -f "$QUEUE" ]] || { echo "check-lesson-disposition: worktree queue not found: $QUEUE" >&2; exit 2; }
|
|
34
|
-
HEAD_FILE="$ht"; WORK_FILE="$QUEUE"; EVID_FILE="$LIFECYCLE_KIT_LESSON_EVIDENCE_FILE"
|
|
35
|
-
[[ -f "$EVID_FILE" ]] || { echo "check-lesson-disposition: evidence file not found: $EVID_FILE" >&2; exit 2; }
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
lessons_of() { # queue-file -> one normalized Lessons lead line per top-level entry
|
|
39
|
-
awk '
|
|
40
|
-
/^## Lessons Learned[[:space:]]*$/ { inl = 1; next }
|
|
41
|
-
/^## / { inl = 0 }
|
|
42
|
-
inl && /^-[[:space:]]/ {
|
|
43
|
-
line = $0
|
|
44
|
-
sub(/^[[:space:]]*-[[:space:]]+/, "", line)
|
|
45
|
-
sub(/[[:space:]]+$/, "", line)
|
|
46
|
-
print line
|
|
47
|
-
}
|
|
48
|
-
' "$1"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
parsed="$(awk 'BEGIN { FS = " — " }
|
|
52
|
-
/^[[:space:]]*#/ || /^[[:space:]]*$/ { next }
|
|
53
|
-
{
|
|
54
|
-
if (NF < 2 || $1 !~ /^[^ ]+ lesson (rule|task|harvest|discard) /) { print "BAD\t" $0; next }
|
|
55
|
-
p = $2; for (i = 3; i <= NF; i++) p = p FS $i
|
|
56
|
-
print "OK\t" p
|
|
57
|
-
}
|
|
58
|
-
' "$EVID_FILE")"; st=$?
|
|
59
|
-
fail_closed "$st" LESSON-DISPOSITION awk
|
|
60
|
-
|
|
61
|
-
malformed=(); prefixes=()
|
|
62
|
-
while IFS=$'\t' read -r kind rest; do
|
|
63
|
-
[[ -n "$kind" ]] || continue
|
|
64
|
-
if [[ "$kind" == BAD ]]; then malformed+=("$rest"); else prefixes+=("$rest"); fi
|
|
65
|
-
done <<<"$parsed"
|
|
66
|
-
|
|
67
|
-
if [[ ${#malformed[@]} -gt 0 ]]; then
|
|
68
|
-
echo "check-lesson-disposition: malformed disposition line(s) in $EVID_FILE"
|
|
69
|
-
echo "(grammar: <iteration> lesson <rule <file>|task <slug>|harvest <tag>|discard <reason>> — <lead-line prefix>):"
|
|
70
|
-
printf ' %s\n' "${malformed[@]}"
|
|
71
|
-
echo " help: rewrite each line to the grammar above; the ' — ' separates the disposition from the lead-line prefix it dispositions."
|
|
72
|
-
exit 1
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
declare -A in_work=()
|
|
76
|
-
while IFS= read -r l; do [[ -n "$l" ]] && in_work["$l"]=1; done < <(lessons_of "$WORK_FILE")
|
|
77
|
-
|
|
78
|
-
undispositioned=(); matched=0
|
|
79
|
-
while IFS= read -r entry; do
|
|
80
|
-
[[ -n "$entry" ]] || continue
|
|
81
|
-
[[ -n "${in_work[$entry]:-}" ]] && continue # still present in the worktree — not a removal
|
|
82
|
-
hit=0
|
|
83
|
-
for p in ${prefixes[@]+"${prefixes[@]}"}; do
|
|
84
|
-
[[ -n "$p" && "$entry" == "$p"* ]] && { hit=1; break; }
|
|
85
|
-
done
|
|
86
|
-
if [[ "$hit" == 1 ]]; then matched=$((matched + 1)); else undispositioned+=("$entry"); fi
|
|
87
|
-
done < <(lessons_of "$HEAD_FILE")
|
|
88
|
-
|
|
89
|
-
if [[ ${#undispositioned[@]} -gt 0 ]]; then
|
|
90
|
-
echo "check-lesson-disposition: Lessons entr(y|ies) removed since HEAD with no disposition"
|
|
91
|
-
echo "stamp in $EVID_FILE (a lesson cleared without a rule/task/harvest/discard record):"
|
|
92
|
-
printf ' %s\n' "${undispositioned[@]}"
|
|
93
|
-
echo " help: stamp each removed lesson in $EVID_FILE — '<iteration> lesson <kind> <ref> — <lead-line prefix>' — or restore the entry."
|
|
94
|
-
exit 1
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
echo "LESSON-DISPOSITION: clean ($matched removed lesson(s) each matched a disposition stamp; grammar holds in $EVID_FILE)"
|
|
98
|
-
exit 0
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=CLAUDE.md,lifecycle-kit/lib/stages.sh dir=one valve=none tier=precommit
|
|
3
|
-
# spec: lifecycle-kit/SPEC.md §check-lifecycle-registration — the always-loaded agent file carries a lifecycle-kit marker block whose content byte-matches the block regenerated from the live stage machine, fail-closed when the target or a marker is missing
|
|
4
|
-
#
|
|
5
|
-
# usage: check-lifecycle-registration.sh [agent-file]
|
|
6
|
-
# path resolves relative to cwd (= repo root in a battery run); the default
|
|
7
|
-
# comes from LIFECYCLE_KIT_AGENT_FILE (lifecycle-kit/lib/stages.sh).
|
|
8
|
-
set -uo pipefail
|
|
9
|
-
|
|
10
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
12
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
# shellcheck source=../lib/stages.sh
|
|
15
|
-
source "$KIT/lib/stages.sh"
|
|
16
|
-
|
|
17
|
-
AGENT_FILE="${1:-$LIFECYCLE_KIT_AGENT_FILE}"
|
|
18
|
-
[[ -f "$AGENT_FILE" ]] \
|
|
19
|
-
|| { echo "check-lifecycle-registration: agent file not found: $AGENT_FILE" >&2; exit 2; } # exit 2: fail-closed
|
|
20
|
-
|
|
21
|
-
BEGIN="<!-- lifecycle-kit:begin -->"
|
|
22
|
-
END="<!-- lifecycle-kit:end -->"
|
|
23
|
-
|
|
24
|
-
if ! grep -qF -- "$BEGIN" "$AGENT_FILE"; then
|
|
25
|
-
echo "check-lifecycle-registration: no lifecycle-kit registration block in $AGENT_FILE"
|
|
26
|
-
echo " help: install the resident registration block into the always-loaded agent file —"
|
|
27
|
-
echo " bash lifecycle-kit/bin/install-lifecycle.sh — so a session that loads it"
|
|
28
|
-
echo " is pointed at the stage machine. Override the path with LIFECYCLE_KIT_AGENT_FILE."
|
|
29
|
-
exit 1
|
|
30
|
-
fi
|
|
31
|
-
grep -qF -- "$END" "$AGENT_FILE" \
|
|
32
|
-
|| { echo "check-lifecycle-registration: begin marker present but end marker missing in $AGENT_FILE — the block bounds are unreadable" >&2; exit 2; } # exit 2: fail-closed
|
|
33
|
-
|
|
34
|
-
present="$(awk -v b="$BEGIN" -v e="$END" '
|
|
35
|
-
$0 == b { inb = 1; next }
|
|
36
|
-
$0 == e { inb = 0; next }
|
|
37
|
-
inb { print }
|
|
38
|
-
' "$AGENT_FILE")"; st=$?
|
|
39
|
-
fail_closed "$st" check-lifecycle-registration awk
|
|
40
|
-
|
|
41
|
-
expected="$(lifecycle_registration_block)"; st=$?
|
|
42
|
-
fail_closed "$st" check-lifecycle-registration lifecycle_registration_block
|
|
43
|
-
|
|
44
|
-
if [[ "$present" != "$expected" ]]; then
|
|
45
|
-
echo "check-lifecycle-registration: the registration block in $AGENT_FILE is stale — it does not match the block derived from the live stage machine:"
|
|
46
|
-
diff <(printf '%s\n' "$expected") <(printf '%s\n' "$present") | sed 's/^/ /'
|
|
47
|
-
echo " help: a reshaped stage machine (LIFECYCLE_KIT_STAGES / LIFECYCLE_KIT_QUEUE_FILE) or a"
|
|
48
|
-
echo " hand-edited block staled the registration — regenerate it in place:"
|
|
49
|
-
echo " bash lifecycle-kit/bin/install-lifecycle.sh"
|
|
50
|
-
exit 1
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
echo "LIFECYCLE-REGISTRATION: clean ($AGENT_FILE carries the lifecycle-kit registration block in byte-lockstep with the derived stage machine; ${#LIFECYCLE_KIT_STAGES[@]} stage(s))"
|
|
54
|
-
exit 0
|