checkwright 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1013 -50
- package/lib/common/digest.sh +18 -0
- package/lib/common/lock.sh +40 -0
- package/lib/common/profile.sh +33 -0
- package/lib/common/recipe.sh +56 -43
- package/lib/diff.sh +64 -0
- package/lib/doctor.sh +81 -7
- package/lib/init.sh +167 -52
- package/lib/uninstall.sh +212 -0
- package/lib/update.sh +34 -0
- package/package.json +2 -2
- package/payload/artifact/targets.list +30 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
- package/payload/canon-kit/README.md +2 -0
- package/payload/canon-kit/SPEC.md +666 -59
- package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
- package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
- package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
- package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
- package/payload/canon-kit/checks/check-docs-link-convention.sh +12 -4
- package/payload/canon-kit/checks/check-install-claim.gate +3 -0
- package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
- package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
- package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
- package/payload/canon-kit/checks/check-md-refs.gate +3 -0
- package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
- package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
- package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
- package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
- package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
- package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
- package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
- package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
- package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
- package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
- package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
- package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +32 -8
- package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
- package/payload/canon-kit/lib/spec.sh +109 -70
- package/payload/canon-kit/smoke/install.sh +21 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
- package/payload/context-kit/README.md +4 -1
- package/payload/context-kit/SPEC.md +166 -9
- package/payload/context-kit/bin/env-probe.sh +19 -6
- package/payload/context-kit/checks/check-brevity.sh +1 -0
- package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
- package/payload/context-kit/checks/check-memory-off.sh +1 -0
- package/payload/context-kit/checks/check-settings-paths.sh +94 -0
- package/payload/context-kit/checks/check-settings-pins.sh +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
- package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
- package/payload/context-kit/lib/toolfloor.sh +15 -4
- package/payload/context-kit/smoke/agents-md.sh +12 -1
- package/payload/context-kit/smoke/install.sh +4 -1
- package/payload/delegation-kit/README.md +3 -3
- package/payload/delegation-kit/SPEC.md +499 -26
- package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
- package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
- package/payload/delegation-kit/lib/delegation.sh +1 -0
- package/payload/delegation-kit/smoke/install.sh +2 -1
- package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
- package/payload/delegation-kit/templates/agent-execution.md +127 -12
- package/payload/delegation-kit/templates/delegation-config.sh +4 -0
- package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
- package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
- package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
- package/payload/doctrine-kit/DOCTRINE.md +112 -11
- package/payload/doctrine-kit/README.md +12 -3
- package/payload/doctrine-kit/SPEC.md +163 -11
- package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
- package/payload/doctrine-kit/smoke/install.sh +167 -1
- package/payload/drift-kit/README.md +3 -2
- package/payload/drift-kit/SPEC.md +264 -22
- package/payload/drift-kit/bin/kfric.sh +21 -2
- package/payload/drift-kit/bin/stage-economics.sh +157 -3
- package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
- package/payload/drift-kit/smoke/install.sh +183 -1
- package/payload/drift-kit/templates/economics.md +9 -0
- package/payload/drift-kit/templates/kpis.list +6 -1
- package/payload/evidence-kit/README.md +20 -6
- package/payload/evidence-kit/SPEC.md +355 -17
- package/payload/evidence-kit/bin/run-validate.sh +51 -9
- package/payload/evidence-kit/checks/check-battery-roster.sh +87 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +35 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
- package/payload/evidence-kit/lib/evidence.sh +18 -0
- package/payload/evidence-kit/smoke/install.sh +17 -3
- package/payload/gate-sdk/README.md +17 -1
- package/payload/gate-sdk/SPEC.md +4427 -92
- package/payload/gate-sdk/bin/build-native.sh +38 -0
- package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
- package/payload/gate-sdk/bin/gen-pre-commit.sh +32 -2
- package/payload/gate-sdk/bin/port-blockers.sh +445 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
- package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
- package/payload/gate-sdk/bin/run-gates.sh +37 -2
- package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
- package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
- package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
- package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
- package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
- package/payload/gate-sdk/checks/check-core-files.sh +28 -4
- package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
- package/payload/gate-sdk/checks/check-exec-bit.sh +21 -1
- package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-output.sh +41 -3
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
- package/payload/gate-sdk/checks/check-graph.sh +5 -5
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
- package/payload/gate-sdk/checks/check-identity.sh +1 -0
- package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
- package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
- package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
- package/payload/gate-sdk/checks/check-readme-roster.sh +6 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
- package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
- package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
- package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
- package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
- package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
- package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
- package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
- package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
- package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
- package/payload/gate-sdk/lib/gate.sh +208 -9
- package/payload/gate-sdk/lib/inject.sh +46 -1
- package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
- package/payload/gate-sdk/smoke/install.sh +61 -1
- package/payload/guard-kit/README.md +18 -14
- package/payload/guard-kit/SPEC.md +366 -72
- package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
- package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
- package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
- package/payload/guard-kit/guard-tests/cases.tsv +49 -7
- package/payload/guard-kit/lib/guard.sh +277 -54
- package/payload/guard-kit/templates/close-triage.md +38 -10
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/guard-kit/templates/settings-hooks.json +7 -1
- package/payload/lifecycle-kit/README.md +12 -1
- package/payload/lifecycle-kit/SPEC.md +991 -41
- package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
- package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
- package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
- package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
- package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
- package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
- package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
- package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
- package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
- package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -3
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
- package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
- package/payload/lifecycle-kit/lib/stages.sh +12 -2
- package/payload/lifecycle-kit/smoke/install.sh +83 -4
- package/payload/lifecycle-kit/templates/consult.md +73 -0
- package/payload/lifecycle-kit/templates/lead.md +139 -7
- package/payload/lifecycle-kit/templates/stages/align.md +12 -0
- package/payload/lifecycle-kit/templates/stages/build.md +8 -0
- package/payload/lifecycle-kit/templates/stages/close.md +45 -5
- package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
- package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
- package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
- package/payload/queue-kit/README.md +6 -1
- package/payload/queue-kit/SPEC.md +350 -6
- package/payload/queue-kit/bin/queue-counts.sh +35 -0
- package/payload/queue-kit/bin/queue-edges.sh +78 -0
- package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
- package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
- package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
- package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
- package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
- package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
- package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
- package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
- package/payload/queue-kit/checks/check-task-names.gate +3 -0
- package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
- package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
- package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
- package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
- package/payload/queue-kit/lib/queue.sh +4 -19
- package/payload/queue-kit/smoke/install.sh +4 -1
- package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
- package/payload/site-kit/SPEC.md +64 -27
- package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
- package/payload/site-kit/smoke/install.sh +9 -1
- package/profiles.list +36 -8
- package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
- package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
- package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
- package/payload/canon-kit/checks/check-install-claim.sh +0 -146
- package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
- package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
- package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
- package/payload/canon-kit/checks/check-md-refs.sh +0 -128
- package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
- package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
- package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
- package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
- package/payload/canon-kit/checks/check-spec-pointer.sh +0 -180
- package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
- package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
- package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
- package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
- package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
- package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
- package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
- package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
- package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
- package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
- package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
- package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
- package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
- package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -104
- package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
- package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
- package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
- package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
- package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
- package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
- package/payload/queue-kit/checks/check-task-names.sh +0 -128
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=*SPEC*.md dir=one valve=none tier=align-only
|
|
3
|
-
# spec: canon-kit/SPEC.md §check-spec-derivable-section — a banned-heading section may not be a fenced code dump above the density budget
|
|
4
|
-
set -uo pipefail
|
|
5
|
-
|
|
6
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
7
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
8
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
9
|
-
source "$SDK/lib/gate.sh"
|
|
10
|
-
# shellcheck source=../lib/spec.sh
|
|
11
|
-
source "$KIT/lib/spec.sh"
|
|
12
|
-
|
|
13
|
-
ROOT="${1:-.}"
|
|
14
|
-
[[ -d "$ROOT" ]] || { echo "check-spec-derivable-section: not a directory: $ROOT" >&2; exit 2; }
|
|
15
|
-
|
|
16
|
-
mapfile -t specs < <(spec_canonical_specs "$ROOT" | sort)
|
|
17
|
-
[[ ${#specs[@]} -eq 0 ]] && { echo "SPEC-DERIVABLE-SECTION: clean (0 $CANON_KIT_SPEC_NAME found)"; exit 0; }
|
|
18
|
-
|
|
19
|
-
banned=""
|
|
20
|
-
for h in "${CANON_KIT_BANNED_HEADINGS[@]}"; do
|
|
21
|
-
banned+=$'\x01'"$(printf '%s' "$h" | tr '[:upper:]' '[:lower:]')"
|
|
22
|
-
done
|
|
23
|
-
banned+=$'\x01'
|
|
24
|
-
|
|
25
|
-
out="$(awk -v banned="$banned" -v density="$CANON_KIT_DERIVABLE_DENSITY" \
|
|
26
|
-
-v pointer="$CANON_KIT_DERIVABLE_POINTER_REGEX" '
|
|
27
|
-
function flush( dens) {
|
|
28
|
-
if (cur_heading == "") return
|
|
29
|
-
if (is_banned && !has_pointer && body_nonblank > 0) {
|
|
30
|
-
dens = int(fenced_nonblank * 100 / body_nonblank)
|
|
31
|
-
if (fenced_nonblank * 100 > density * body_nonblank)
|
|
32
|
-
printf "%s: section \"%s\" (line %d) is %d%% fenced (banned heading, budget %d%%) — shed to a one-line index pointer\n", \
|
|
33
|
-
cur_file, cur_heading, cur_line, dens, density
|
|
34
|
-
}
|
|
35
|
-
cur_heading = ""; is_banned = 0; has_pointer = 0; body_nonblank = 0; fenced_nonblank = 0
|
|
36
|
-
}
|
|
37
|
-
FNR == 1 { flush(); in_fence = 0 }
|
|
38
|
-
{
|
|
39
|
-
if ($0 ~ /^```/) {
|
|
40
|
-
in_fence = !in_fence
|
|
41
|
-
if (cur_heading != "") { body_nonblank++; fenced_nonblank++ }
|
|
42
|
-
next
|
|
43
|
-
}
|
|
44
|
-
if (!in_fence && $0 ~ /^#{1,6}[[:space:]]/) {
|
|
45
|
-
flush()
|
|
46
|
-
h = $0; sub(/^#{1,6}[[:space:]]+/, "", h); sub(/[[:space:]]+$/, "", h)
|
|
47
|
-
cur_heading = h; cur_file = FILENAME; cur_line = FNR
|
|
48
|
-
is_banned = (index(banned, "\x01" tolower(h) "\x01") > 0)
|
|
49
|
-
next
|
|
50
|
-
}
|
|
51
|
-
if (cur_heading != "" && $0 ~ /[^[:space:]]/) {
|
|
52
|
-
body_nonblank++
|
|
53
|
-
if (in_fence) fenced_nonblank++
|
|
54
|
-
if ($0 ~ pointer) has_pointer = 1
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
END { flush() }
|
|
58
|
-
' "${specs[@]}")"; st=$?
|
|
59
|
-
fail_closed "$st" check-spec-derivable-section awk
|
|
60
|
-
|
|
61
|
-
if [[ -n "$out" ]]; then
|
|
62
|
-
n="$(printf '%s\n' "$out" | grep -c .)"
|
|
63
|
-
echo "SPEC-DERIVABLE-SECTION: ${n} violation(s):"
|
|
64
|
-
printf '%s\n' "$out" | sed 's/^/ /'
|
|
65
|
-
echo " help: a banned-heading section (${CANON_KIT_BANNED_HEADINGS[*]}) that is mostly a code dump drifts — shed the body to a one-line index pointer (cite the code), keeping the prose that owns semantics"
|
|
66
|
-
exit 1
|
|
67
|
-
fi
|
|
68
|
-
echo "SPEC-DERIVABLE-SECTION: clean (${#specs[@]} $CANON_KIT_SPEC_NAME, no banned-heading section exceeds the ${CANON_KIT_DERIVABLE_DENSITY}% fenced budget)"
|
|
69
|
-
exit 0
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=*SPEC*.md dir=one valve=none tier=align-only
|
|
3
|
-
# spec: canon-kit/SPEC.md §check-spec-dod-singleton — a canonical spec carries the Definition-of-Done heading the configured number of times
|
|
4
|
-
set -uo pipefail
|
|
5
|
-
|
|
6
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
7
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
8
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
9
|
-
source "$SDK/lib/gate.sh"
|
|
10
|
-
# shellcheck source=../lib/spec.sh
|
|
11
|
-
source "$KIT/lib/spec.sh"
|
|
12
|
-
|
|
13
|
-
ROOT="${1:-.}"
|
|
14
|
-
[[ -d "$ROOT" ]] || { echo "check-spec-dod-singleton: not a directory: $ROOT" >&2; exit 2; }
|
|
15
|
-
|
|
16
|
-
mapfile -t specs < <(spec_canonical_specs "$ROOT" | sort)
|
|
17
|
-
[[ ${#specs[@]} -eq 0 ]] && { echo "SPEC-DOD-SINGLETON: clean (0 $CANON_KIT_SPEC_NAME found)"; exit 0; }
|
|
18
|
-
|
|
19
|
-
dod_lc="$(printf '%s' "$CANON_KIT_DOD_HEADING" | tr '[:upper:]' '[:lower:]')"
|
|
20
|
-
|
|
21
|
-
errors=()
|
|
22
|
-
for f in "${specs[@]}"; do
|
|
23
|
-
n="$(awk -v want="$dod_lc" '
|
|
24
|
-
/^#{2,4}[[:space:]]/ {
|
|
25
|
-
h = tolower($0); sub(/^#{2,4}[[:space:]]+/, "", h)
|
|
26
|
-
if (index(h, want) > 0) c++
|
|
27
|
-
}
|
|
28
|
-
END { print c + 0 }
|
|
29
|
-
' "$f")"; st=$?
|
|
30
|
-
fail_closed "$st" check-spec-dod-singleton awk
|
|
31
|
-
if [[ "$CANON_KIT_DOD_MODE" == "exactly-one" && "$n" -ne 1 ]]; then
|
|
32
|
-
errors+=("$f has $n \"$CANON_KIT_DOD_HEADING\" heading(s) (need exactly 1)")
|
|
33
|
-
elif [[ "$CANON_KIT_DOD_MODE" == "at-most-one" && "$n" -gt 1 ]]; then
|
|
34
|
-
errors+=("$f has $n \"$CANON_KIT_DOD_HEADING\" heading(s) (need at most 1)")
|
|
35
|
-
fi
|
|
36
|
-
done
|
|
37
|
-
|
|
38
|
-
if [[ ${#errors[@]} -gt 0 ]]; then
|
|
39
|
-
echo "SPEC-DOD-SINGLETON: ${#errors[@]} violation(s) ($CANON_KIT_DOD_MODE):"
|
|
40
|
-
printf ' %s\n' "${errors[@]}"
|
|
41
|
-
echo " help: a duplicate Definition-of-Done checklist is two sources on the completion contract — fold the doubled/appended one into the canonical '## $CANON_KIT_DOD_HEADING' heading${CANON_KIT_DOD_MODE:+ (add one if missing under exactly-one)}"
|
|
42
|
-
exit 1
|
|
43
|
-
fi
|
|
44
|
-
echo "SPEC-DOD-SINGLETON: clean (${#specs[@]} $CANON_KIT_SPEC_NAME scanned, $CANON_KIT_DOD_MODE)"
|
|
45
|
-
exit 0
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=*SPEC*.md,*README.md,CLAUDE.md,TASK-QUEUE.md dir=one valve=none tier=precommit
|
|
3
|
-
# spec: canon-kit/SPEC.md §check-spec-fence-balance — every governed markdown file has an even fence-delimiter count, so the fence-skipping parsers never desync and fail open
|
|
4
|
-
#
|
|
5
|
-
# usage: check-spec-fence-balance.sh [file...]
|
|
6
|
-
# Defaults to the manifest set (lib/spec.sh) plus the configured queue file.
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
11
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
# shellcheck source=../lib/spec.sh
|
|
14
|
-
source "$KIT/lib/spec.sh"
|
|
15
|
-
|
|
16
|
-
if [[ $# -gt 0 ]]; then
|
|
17
|
-
files=("$@")
|
|
18
|
-
else
|
|
19
|
-
mapfile -t files < <(spec_manifest_files ".")
|
|
20
|
-
[[ -f "$CANON_KIT_QUEUE_FILE" ]] && files+=("$CANON_KIT_QUEUE_FILE")
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
bad=(); scanned=0
|
|
24
|
-
for f in "${files[@]}"; do
|
|
25
|
-
[[ -f "$f" ]] || continue
|
|
26
|
-
scanned=$((scanned + 1))
|
|
27
|
-
n="$(grep -cE '^[[:space:]]*```' "$f")"; gst=$?
|
|
28
|
-
[[ "$gst" -ge 2 ]] && { echo "check-spec-fence-balance: grep failed on $f (exit $gst)" >&2; exit 2; }
|
|
29
|
-
(( n % 2 == 0 )) || bad+=("$f ($n fence delimiters — odd)")
|
|
30
|
-
done
|
|
31
|
-
|
|
32
|
-
if [[ ${#bad[@]} -gt 0 ]]; then
|
|
33
|
-
echo "check-spec-fence-balance: markdown file(s) with an odd fence-delimiter count —"
|
|
34
|
-
echo "the fence-skipping parsers (embedded-source, tag-lead-line, the queue scanners)"
|
|
35
|
-
echo "toggle a fence flag; an odd count desyncs it and the rest of the file fails open:"
|
|
36
|
-
printf ' %s\n' "${bad[@]}"
|
|
37
|
-
echo " help: close the unbalanced code fence, or delete the stray delimiter line."
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
echo "SPEC-FENCE-BALANCE: clean ($scanned governed markdown file(s), all even fence counts)"
|
|
42
|
-
exit 0
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=*SPEC*.md,*README.md,CLAUDE.md,scripts/*.sh,kit:*.sh,.workflow/* dir=one valve=none tier=precommit
|
|
3
|
-
# spec: canon-kit/SPEC.md §check-spec-pointer — every spec:/contract: directive on a governed source and every free-prose <path>.md §<heading> citation on a governed manifest resolves: the target file is tracked and a §heading fragment names a heading the file carries
|
|
4
|
-
#
|
|
5
|
-
# usage: check-spec-pointer.sh [scan-root] (default '.')
|
|
6
|
-
set -uo pipefail
|
|
7
|
-
|
|
8
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
9
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
10
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
11
|
-
source "$SDK/lib/gate.sh"
|
|
12
|
-
# shellcheck source=../lib/spec.sh
|
|
13
|
-
source "$KIT/lib/spec.sh"
|
|
14
|
-
|
|
15
|
-
ROOT="${1:-.}"
|
|
16
|
-
[[ -d "$ROOT" ]] || { echo "check-spec-pointer: not a directory: $ROOT" >&2; exit 2; }
|
|
17
|
-
git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1 || {
|
|
18
|
-
echo "check-spec-pointer: $ROOT is not a git repository — cannot verify tracked targets" >&2; exit 2; }
|
|
19
|
-
|
|
20
|
-
# spec: canon-kit/SPEC.md §check-spec-pointer — shape-only extraction of the
|
|
21
|
-
# spec:/contract: directive lines across the hash (# / .txt) and slash (// , block
|
|
22
|
-
# *) comment surfaces; resolution happens in the shell below.
|
|
23
|
-
read -r -d '' EXTRACT <<'AWK' || true
|
|
24
|
-
{
|
|
25
|
-
L = $0
|
|
26
|
-
# the colon needs trailing whitespace (a real "<keyword>: <path>" directive) or
|
|
27
|
-
# end-of-line (a degenerate empty directive, flagged downstream); this parts a
|
|
28
|
-
# pointer from prose that merely opens with "spec:/contract:".
|
|
29
|
-
if (L ~ /^[ \t]*#+[ \t]*(spec|contract):([ \t]|$)/) sub(/^[ \t]*#+[ \t]*/, "", L)
|
|
30
|
-
else if (L ~ /^[ \t]*\/\/+[ \t]*(spec|contract):([ \t]|$)/) sub(/^[ \t]*\/\/+[ \t]*/, "", L)
|
|
31
|
-
else if (L ~ /^[ \t]*\*[ \t]*(spec|contract):([ \t]|$)/) sub(/^[ \t]*\*[ \t]*/, "", L)
|
|
32
|
-
else next
|
|
33
|
-
print FILENAME "\t" FNR "\t" L
|
|
34
|
-
}
|
|
35
|
-
AWK
|
|
36
|
-
|
|
37
|
-
heading_present() { # $1=target file $2=heading fragment [$3=exact(default)|prefix] -> 0 when a heading matches
|
|
38
|
-
local file="$1" frag="$2" mode="${3:-exact}" res st
|
|
39
|
-
# spec: canon-kit/SPEC.md §check-spec-pointer — one resolver, two callers:
|
|
40
|
-
# the directive pass matches the fragment whole (exact), the prose pass as
|
|
41
|
-
# a boundary-anchored prefix (prefix); both tolerate a trailing "(qualifier)".
|
|
42
|
-
res="$(awk -v a="$frag" -v mode="$mode" '
|
|
43
|
-
function strippar(s) { sub(/[[:space:]]*\([^)]*\)[[:space:]]*$/, "", s); return s }
|
|
44
|
-
function isprefix(text, h, L, nc) {
|
|
45
|
-
L = length(h)
|
|
46
|
-
if (substr(text, 1, L) != h) return 0
|
|
47
|
-
if (length(text) == L) return 1
|
|
48
|
-
nc = substr(text, L + 1, 1)
|
|
49
|
-
return (nc !~ /[[:alnum:]]/)
|
|
50
|
-
}
|
|
51
|
-
BEGIN { as = strippar(a) }
|
|
52
|
-
/^#{1,6}[[:space:]]/ {
|
|
53
|
-
h = $0; sub(/^#{1,6}[[:space:]]+/, "", h); sub(/[[:space:]]+$/, "", h)
|
|
54
|
-
hs = strippar(h)
|
|
55
|
-
if (mode == "prefix") {
|
|
56
|
-
if (isprefix(a, h) || isprefix(a, hs)) found = 1
|
|
57
|
-
} else if (h == a || hs == a || h == as || hs == as) {
|
|
58
|
-
found = 1
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
END { print found + 0 }
|
|
62
|
-
' "$file")"; st=$?
|
|
63
|
-
fail_closed "$st" SPEC-POINTER "awk heading match"
|
|
64
|
-
[[ "$res" == "1" ]]
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
# spec: canon-kit/SPEC.md §check-spec-pointer — shape-only extraction of prose
|
|
68
|
-
# <path>.md § citations over the blank-line paragraph join; fenced code skipped,
|
|
69
|
-
# resolution and the tracked-file carve-out happen in the shell below.
|
|
70
|
-
read -r -d '' PROSE_EXTRACT <<'AWK' || true
|
|
71
|
-
function flush( i, joined, mstart, mend, seg, path, post, li, s) {
|
|
72
|
-
if (np == 0) return
|
|
73
|
-
joined = ""
|
|
74
|
-
for (i = 1; i <= np; i++) { lstart[i] = length(joined) + 1; joined = joined (i > 1 ? " " : "") ptext[i] }
|
|
75
|
-
scanpos = 1
|
|
76
|
-
while (1) {
|
|
77
|
-
s = substr(joined, scanpos)
|
|
78
|
-
if (match(s, /[A-Za-z0-9._\/-]+\.md[[:space:]]*§/) == 0) break
|
|
79
|
-
mstart = scanpos + RSTART - 1
|
|
80
|
-
mend = mstart + RLENGTH - 1
|
|
81
|
-
seg = substr(joined, mstart, RLENGTH)
|
|
82
|
-
path = seg; sub(/[[:space:]]*§$/, "", path)
|
|
83
|
-
post = substr(joined, mend + 1)
|
|
84
|
-
li = 1
|
|
85
|
-
for (i = 1; i <= np; i++) if (lstart[i] <= mstart) li = i
|
|
86
|
-
printf "%s\t%d\t%s\t%s\n", cf, pfnr[li], path, post
|
|
87
|
-
scanpos = mend + 1
|
|
88
|
-
}
|
|
89
|
-
np = 0
|
|
90
|
-
}
|
|
91
|
-
FNR == 1 { flush(); fence = 0 }
|
|
92
|
-
{
|
|
93
|
-
cf = FILENAME
|
|
94
|
-
if ($0 ~ /^[[:space:]]*```/) { flush(); fence = !fence; next }
|
|
95
|
-
if (fence) { flush(); next }
|
|
96
|
-
if ($0 ~ /^[[:space:]]*$/) { flush(); next }
|
|
97
|
-
np++; pfnr[np] = FNR; ptext[np] = $0
|
|
98
|
-
}
|
|
99
|
-
END { flush() }
|
|
100
|
-
AWK
|
|
101
|
-
|
|
102
|
-
# spec: canon-kit/SPEC.md §check-spec-pointer — the tracked-file membership set, filled once from a single git ls-files pass rather than a per-pointer `git ls-files --error-unmatch` exec
|
|
103
|
-
declare -A TRACKED=()
|
|
104
|
-
while IFS= read -r -d '' _tf; do TRACKED["$_tf"]=1; done < <(git -C "$ROOT" ls-files -z)
|
|
105
|
-
|
|
106
|
-
errors=()
|
|
107
|
-
scanned=0
|
|
108
|
-
pointers=0
|
|
109
|
-
while IFS= read -r f; do
|
|
110
|
-
[[ -n "$f" ]] || continue
|
|
111
|
-
rel="${f#"$ROOT"/}"; rel="${rel#./}"
|
|
112
|
-
spec_comment_whitelisted "$rel" && continue
|
|
113
|
-
scanned=$((scanned + 1))
|
|
114
|
-
out="$(awk "$EXTRACT" "$f")"; st=$?
|
|
115
|
-
fail_closed "$st" SPEC-POINTER "awk extract ($rel)"
|
|
116
|
-
while IFS=$'\t' read -r _file lineno body; do
|
|
117
|
-
[[ -n "$body" ]] || continue
|
|
118
|
-
pointers=$((pointers + 1))
|
|
119
|
-
if [[ "$body" == spec:* ]]; then after="${body#spec:}"; else after="${body#contract:}"; fi
|
|
120
|
-
# comment-tier-exempt: a § inside the em-dash prose tail is not a heading marker
|
|
121
|
-
sig="${after%% — *}"; sig="${sig%% -- *}"
|
|
122
|
-
read -r path prest <<< "$sig"
|
|
123
|
-
frag=""
|
|
124
|
-
if [[ "$path" == *§* ]]; then
|
|
125
|
-
frag="${path#*§}"; path="${path%%§*}"
|
|
126
|
-
elif [[ "$prest" == *§* ]]; then
|
|
127
|
-
frag="${prest#*§}"
|
|
128
|
-
fi
|
|
129
|
-
frag="${frag#"${frag%%[![:space:]]*}"}"
|
|
130
|
-
frag="${frag%"${frag##*[![:space:]]}"}"
|
|
131
|
-
|
|
132
|
-
if [[ -z "$path" || "$path" == §* ]]; then
|
|
133
|
-
errors+=("$rel:$lineno: pointer directive carries no target path: $body")
|
|
134
|
-
continue
|
|
135
|
-
fi
|
|
136
|
-
if [[ ! -f "$ROOT/$path" ]]; then
|
|
137
|
-
errors+=("$rel:$lineno: target file not found: $path")
|
|
138
|
-
continue
|
|
139
|
-
fi
|
|
140
|
-
if [[ -z "${TRACKED[$path]:-}" ]]; then
|
|
141
|
-
errors+=("$rel:$lineno: target file untracked: $path")
|
|
142
|
-
continue
|
|
143
|
-
fi
|
|
144
|
-
if [[ -n "$frag" ]] && ! heading_present "$ROOT/$path" "$frag"; then
|
|
145
|
-
errors+=("$rel:$lineno: §heading not found in $path: §$frag")
|
|
146
|
-
fi
|
|
147
|
-
done <<< "$out"
|
|
148
|
-
done < <(spec_comment_surface "$ROOT")
|
|
149
|
-
|
|
150
|
-
# spec: canon-kit/SPEC.md §check-spec-pointer — the prose-citation pass:
|
|
151
|
-
# heading_present in prefix mode over the manifest set; an untracked cited path
|
|
152
|
-
# is out of scope (path liveness stays with check-md-refs / check-kit-ref-liveness).
|
|
153
|
-
mapfile -t manifest_files < <(spec_manifest_files "$ROOT")
|
|
154
|
-
prose_cites=0
|
|
155
|
-
manifests=0
|
|
156
|
-
if [[ ${#manifest_files[@]} -gt 0 ]]; then
|
|
157
|
-
manifests=${#manifest_files[@]}
|
|
158
|
-
prose_out="$(awk "$PROSE_EXTRACT" "${manifest_files[@]}")"; st=$?
|
|
159
|
-
fail_closed "$st" SPEC-POINTER "awk prose extract"
|
|
160
|
-
while IFS=$'\t' read -r pfile plineno ppath pfrag; do
|
|
161
|
-
[[ -n "$ppath" ]] || continue
|
|
162
|
-
[[ -f "$ROOT/$ppath" ]] || continue
|
|
163
|
-
[[ -n "${TRACKED[$ppath]:-}" ]] || continue
|
|
164
|
-
prose_cites=$((prose_cites + 1))
|
|
165
|
-
[[ -n "$pfrag" ]] || continue
|
|
166
|
-
if ! heading_present "$ROOT/$ppath" "$pfrag" prefix; then
|
|
167
|
-
prel="${pfile#"$ROOT"/}"; prel="${prel#./}"
|
|
168
|
-
errors+=("$prel:$plineno: §heading not found in $ppath: §${pfrag:0:50}")
|
|
169
|
-
fi
|
|
170
|
-
done <<< "$prose_out"
|
|
171
|
-
fi
|
|
172
|
-
|
|
173
|
-
if [[ ${#errors[@]} -gt 0 ]]; then
|
|
174
|
-
echo "SPEC-POINTER: ${#errors[@]} dangling pointer(s):"
|
|
175
|
-
printf ' %s\n' "${errors[@]}"
|
|
176
|
-
echo " help: a spec:/contract: directive and a free-prose <path>.md §<heading> citation each bind a site to the requirement that governs it — the binding is only live if it resolves. Fix the <path> (repo-relative, tracked) or the §<heading> to name the current target, or drop the § fragment for a file-only pointer. A renamed heading updates every inbound pointer and citation in the same commit."
|
|
177
|
-
exit 1
|
|
178
|
-
fi
|
|
179
|
-
echo "SPEC-POINTER: clean ($pointers directive pointer(s) across $scanned governed source(s); $prose_cites prose citation(s) across $manifests manifest file(s); every target file tracked and named §heading present)"
|
|
180
|
-
exit 0
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=scripts/*.sh,kit:*.sh,.workflow/*.txt,TASK-QUEUE.md dir=one valve=none tier=precommit
|
|
3
|
-
# spec: canon-kit/SPEC.md §check-todo-task-liveness — every TODO(task: <slug>) marker on a governed source resolves to a live queue task, stale-flagged on a done slug
|
|
4
|
-
#
|
|
5
|
-
# usage: check-todo-task-liveness.sh [scan-root [queue-file]]
|
|
6
|
-
# Scans the governed comment surface under scan-root (default '.') for
|
|
7
|
-
# TODO(task: <slug>) markers and resolves each slug against the queue
|
|
8
|
-
# (default $CANON_KIT_QUEUE_FILE): live task resolves, done task is stale,
|
|
9
|
-
# absent slug is unresolved.
|
|
10
|
-
set -uo pipefail
|
|
11
|
-
|
|
12
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
13
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
14
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
15
|
-
source "$SDK/lib/gate.sh"
|
|
16
|
-
# shellcheck source=../lib/spec.sh
|
|
17
|
-
source "$KIT/lib/spec.sh"
|
|
18
|
-
|
|
19
|
-
ROOT="${1:-.}"
|
|
20
|
-
QUEUE="${2:-$CANON_KIT_QUEUE_FILE}"
|
|
21
|
-
[[ -d "$ROOT" ]] || { echo "check-todo-task-liveness: not a directory: $ROOT" >&2; exit 2; }
|
|
22
|
-
[[ -f "$QUEUE" ]] || { echo "check-todo-task-liveness: queue file not found: $QUEUE" >&2; exit 2; }
|
|
23
|
-
|
|
24
|
-
# spec: canon-kit/SPEC.md §check-todo-task-liveness — the queue-resolution pass is
|
|
25
|
-
# the shared lib adapter both liveness gates read: live slug versus done slug.
|
|
26
|
-
qout="$(spec_queue_slugs "$QUEUE")"; st=$?
|
|
27
|
-
fail_closed "$st" TODO-TASK-LIVENESS "queue awk"
|
|
28
|
-
|
|
29
|
-
declare -A IS_LIVE=() IS_DONE=()
|
|
30
|
-
while IFS=$'\t' read -r kind slug; do
|
|
31
|
-
[[ -n "$slug" ]] || continue
|
|
32
|
-
case "$kind" in
|
|
33
|
-
live) IS_LIVE["$slug"]=1 ;;
|
|
34
|
-
done) IS_DONE["$slug"]=1 ;;
|
|
35
|
-
esac
|
|
36
|
-
done <<< "$qout"
|
|
37
|
-
|
|
38
|
-
declare -a SURFACE=()
|
|
39
|
-
while IFS= read -r f; do
|
|
40
|
-
[[ -n "$f" ]] && SURFACE+=("$f")
|
|
41
|
-
done < <(spec_comment_surface "$ROOT")
|
|
42
|
-
|
|
43
|
-
stale=(); unresolved=(); scanned=0
|
|
44
|
-
for f in "${SURFACE[@]}"; do
|
|
45
|
-
rel="${f#"$ROOT"/}"; rel="${rel#./}"
|
|
46
|
-
scanned=$((scanned + 1))
|
|
47
|
-
# spec: canon-kit/SPEC.md §check-todo-task-liveness — the marker needs a
|
|
48
|
-
# resolvable slug after the colon, so the bare roster literal a tool
|
|
49
|
-
# carries (check-comment-tier's own directive name) never self-matches.
|
|
50
|
-
mout="$(awk '
|
|
51
|
-
{
|
|
52
|
-
s = $0
|
|
53
|
-
while (match(s, /TODO\(task:[[:space:]]*[a-z0-9][a-z0-9-]*/)) {
|
|
54
|
-
m = substr(s, RSTART, RLENGTH); sub(/TODO\(task:[[:space:]]*/, "", m)
|
|
55
|
-
printf "%d\t%s\n", FNR, m
|
|
56
|
-
s = substr(s, RSTART + RLENGTH)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
' "$f")"; st=$?
|
|
60
|
-
fail_closed "$st" TODO-TASK-LIVENESS "marker awk ($rel)"
|
|
61
|
-
while IFS=$'\t' read -r ln slug; do
|
|
62
|
-
[[ -n "$slug" ]] || continue
|
|
63
|
-
[[ -n "${IS_LIVE[$slug]:-}" ]] && continue
|
|
64
|
-
if [[ -n "${IS_DONE[$slug]:-}" ]]; then
|
|
65
|
-
stale+=("$rel:$ln: TODO(task: $slug) — task '$slug' is done; drop the completed TODO")
|
|
66
|
-
else
|
|
67
|
-
unresolved+=("$rel:$ln: TODO(task: $slug) — no live task '$slug' in $QUEUE")
|
|
68
|
-
fi
|
|
69
|
-
done <<< "$mout"
|
|
70
|
-
done
|
|
71
|
-
|
|
72
|
-
if (( ${#stale[@]} + ${#unresolved[@]} > 0 )); then
|
|
73
|
-
echo "TODO-TASK-LIVENESS: $(( ${#stale[@]} + ${#unresolved[@]} )) violation(s):"
|
|
74
|
-
(( ${#stale[@]} )) && printf ' %s\n' "${stale[@]}"
|
|
75
|
-
(( ${#unresolved[@]} )) && printf ' %s\n' "${unresolved[@]}"
|
|
76
|
-
echo " help: a TODO(task: <slug>) binds a code site to a live queue task — point it at an active or deferred slug, or resolve the code and delete the marker once the task is done (a done or absent slug leaves the marker referencing nothing)."
|
|
77
|
-
exit 1
|
|
78
|
-
fi
|
|
79
|
-
echo "TODO-TASK-LIVENESS: clean ($scanned governed source(s); every TODO(task: <slug>) marker resolves to a live queue task)"
|
|
80
|
-
exit 0
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=*SPEC*.md,*README.md,CLAUDE.md,.gitignore dir=one valve=none tier=precommit
|
|
3
|
-
# spec: canon-kit/SPEC.md §check-tracking-claim — every fixed-vocabulary tracking claim on a governed manifest surface agrees with git
|
|
4
|
-
#
|
|
5
|
-
# usage: check-tracking-claim.sh [scan-root] (default '.')
|
|
6
|
-
set -uo pipefail
|
|
7
|
-
|
|
8
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
9
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
10
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
11
|
-
source "$SDK/lib/gate.sh"
|
|
12
|
-
# shellcheck source=../lib/spec.sh
|
|
13
|
-
source "$KIT/lib/spec.sh"
|
|
14
|
-
|
|
15
|
-
ROOT="${1:-.}"
|
|
16
|
-
[[ -d "$ROOT" ]] || { echo "check-tracking-claim: not a directory: $ROOT" >&2; exit 2; }
|
|
17
|
-
git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1 || {
|
|
18
|
-
echo "check-tracking-claim: $ROOT is not a git repository — a tracking claim is unverifiable" >&2; exit 2; }
|
|
19
|
-
|
|
20
|
-
# spec: canon-kit/SPEC.md §check-tracking-claim — shape-only extraction over the
|
|
21
|
-
# blank-line paragraph join: a predicate outside inline code, bound by adjacency
|
|
22
|
-
# to the backticked path it follows; verification happens in the shell below.
|
|
23
|
-
read -r -d '' EXTRACT <<'AWK' || true
|
|
24
|
-
function blank_code(s, out, i, c, incode) {
|
|
25
|
-
out = ""; incode = 0
|
|
26
|
-
for (i = 1; i <= length(s); i++) {
|
|
27
|
-
c = substr(s, i, 1)
|
|
28
|
-
if (c == "`") { incode = !incode; out = out " "; continue }
|
|
29
|
-
out = out (incode ? " " : c)
|
|
30
|
-
}
|
|
31
|
-
return out
|
|
32
|
-
}
|
|
33
|
-
function is_pathish(t) {
|
|
34
|
-
if (t !~ /^[A-Za-z0-9._~-]+(\/[A-Za-z0-9._~-]+)*\/?$/) return 0
|
|
35
|
-
return (index(t, "/") > 0 || index(t, ".") > 0)
|
|
36
|
-
}
|
|
37
|
-
function bound_path(prefix, p, i, tok) {
|
|
38
|
-
# the binding is adjacency: only whitespace may sit between the path's
|
|
39
|
-
# closing backtick and the predicate, so an intervening clause unbinds it
|
|
40
|
-
p = prefix
|
|
41
|
-
sub(/[[:space:]]+$/, "", p)
|
|
42
|
-
if (substr(p, length(p), 1) != "`") return ""
|
|
43
|
-
p = substr(p, 1, length(p) - 1)
|
|
44
|
-
i = length(p)
|
|
45
|
-
while (i >= 1 && substr(p, i, 1) != "`") i--
|
|
46
|
-
if (i < 1) return ""
|
|
47
|
-
tok = substr(p, i + 1)
|
|
48
|
-
return is_pathish(tok) ? tok : ""
|
|
49
|
-
}
|
|
50
|
-
function flush( i, joined, scan, rest, off, ms, me, pred, prefix, path, li) {
|
|
51
|
-
if (np == 0) return
|
|
52
|
-
joined = ""
|
|
53
|
-
for (i = 1; i <= np; i++) { lstart[i] = length(joined) + 1; joined = joined (i > 1 ? " " : "") ptext[i] }
|
|
54
|
-
scan = blank_code(joined)
|
|
55
|
-
rest = scan; off = 0
|
|
56
|
-
while (match(rest, PRED) > 0) {
|
|
57
|
-
ms = off + RSTART; me = ms + RLENGTH - 1
|
|
58
|
-
pred = substr(scan, ms, RLENGTH)
|
|
59
|
-
sub(/^[^A-Za-z]*is[[:space:]]+/, "", pred)
|
|
60
|
-
sub(/[^A-Za-z-]+$/, "", pred)
|
|
61
|
-
prefix = substr(joined, 1, ms - 1)
|
|
62
|
-
path = bound_path(prefix)
|
|
63
|
-
if (path != "") {
|
|
64
|
-
li = 1
|
|
65
|
-
for (i = 1; i <= np; i++) if (lstart[i] <= ms) li = i
|
|
66
|
-
printf "%s\t%d\t%s\t%s\n", cf, pfnr[li], path, pred
|
|
67
|
-
}
|
|
68
|
-
off = me; rest = substr(scan, me + 1)
|
|
69
|
-
}
|
|
70
|
-
np = 0
|
|
71
|
-
}
|
|
72
|
-
FNR == 1 { flush(); fence = 0 }
|
|
73
|
-
{
|
|
74
|
-
cf = FILENAME
|
|
75
|
-
if ($0 ~ /^[[:space:]]*```/) { flush(); fence = !fence; next }
|
|
76
|
-
if (fence) { flush(); next }
|
|
77
|
-
if ($0 ~ /^[[:space:]]*$/) { flush(); next }
|
|
78
|
-
np++; pfnr[np] = FNR; ptext[np] = $0
|
|
79
|
-
}
|
|
80
|
-
END { flush() }
|
|
81
|
-
AWK
|
|
82
|
-
|
|
83
|
-
PRED='(^|[^A-Za-z])is[[:space:]]+(committed|tracked|gitignored|local-only|two-tier)([^A-Za-z]|$)'
|
|
84
|
-
|
|
85
|
-
mapfile -t manifest_files < <(spec_manifest_files "$ROOT")
|
|
86
|
-
if [[ ${#manifest_files[@]} -eq 0 ]]; then
|
|
87
|
-
echo "TRACKING-CLAIM: clean (0 governed manifest surface(s))"
|
|
88
|
-
exit 0
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
out="$(awk -v PRED="$PRED" "$EXTRACT" "${manifest_files[@]}")"; st=$?
|
|
92
|
-
fail_closed "$st" TRACKING-CLAIM "awk claim extract"
|
|
93
|
-
|
|
94
|
-
errors=()
|
|
95
|
-
claims=0
|
|
96
|
-
while IFS=$'\t' read -r file lineno path pred; do
|
|
97
|
-
[[ -n "$path" ]] || continue
|
|
98
|
-
claims=$((claims + 1))
|
|
99
|
-
rel="${file#"$ROOT"/}"; rel="${rel#./}"
|
|
100
|
-
|
|
101
|
-
tracked="$(git -C "$ROOT" ls-files -- "$path")"; gst=$?
|
|
102
|
-
[[ "$gst" -eq 0 ]] || { echo "check-tracking-claim: git ls-files failed for '$path'" >&2; exit 2; }
|
|
103
|
-
ntracked=0; [[ -n "$tracked" ]] && ntracked=1
|
|
104
|
-
|
|
105
|
-
# spec: canon-kit/SPEC.md §check-tracking-claim — the ignored side is
|
|
106
|
-
# rule-based (check-ignore --no-index), not presence-based, so it resolves
|
|
107
|
-
# in a fresh checkout; that section owns why --no-index is load-bearing.
|
|
108
|
-
nignored=0
|
|
109
|
-
git -C "$ROOT" check-ignore -q --no-index -- "$path" && nignored=1
|
|
110
|
-
|
|
111
|
-
if [[ "$ntracked" == 0 && "$nignored" == 0 && ! -e "$ROOT/$path" ]]; then
|
|
112
|
-
errors+=("$rel:$lineno: '$path is $pred' — the path is in neither the index nor the ignore rules nor the working tree, so the claim is unverifiable")
|
|
113
|
-
continue
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
case "$pred" in
|
|
117
|
-
committed|tracked)
|
|
118
|
-
[[ "$ntracked" == 1 && "$nignored" == 0 ]] \
|
|
119
|
-
|| errors+=("$rel:$lineno: '$path is $pred' is false — tracked members: $ntracked, ignored members: $nignored") ;;
|
|
120
|
-
gitignored|local-only)
|
|
121
|
-
[[ "$ntracked" == 0 && "$nignored" == 1 ]] \
|
|
122
|
-
|| errors+=("$rel:$lineno: '$path is $pred' is false — tracked members: $ntracked, ignored members: $nignored") ;;
|
|
123
|
-
two-tier)
|
|
124
|
-
[[ "$ntracked" == 1 && "$nignored" == 1 ]] \
|
|
125
|
-
|| errors+=("$rel:$lineno: '$path is $pred' is false — tracked members: $ntracked, ignored members: $nignored") ;;
|
|
126
|
-
esac
|
|
127
|
-
done <<<"$out"
|
|
128
|
-
|
|
129
|
-
if [[ ${#errors[@]} -gt 0 ]]; then
|
|
130
|
-
echo "check-tracking-claim: ${#errors[@]} prose claim(s) git disagrees with:"
|
|
131
|
-
printf ' %s\n' "${errors[@]}"
|
|
132
|
-
echo " help: git owns a path's tracking status, so prose states the rule and this gate verifies it. Reword the sentence to the predicate git actually supports — 'is committed'/'is tracked' (every member tracked, none ignored), 'is gitignored'/'is local-only' (no member tracked), or 'is two-tier' (both classes non-empty) — or fix the tracking. There is no per-site valve: a claim that cannot be made true is a claim that must be reworded."
|
|
133
|
-
exit 1
|
|
134
|
-
fi
|
|
135
|
-
echo "TRACKING-CLAIM: clean ($claims tracking claim(s) across ${#manifest_files[@]} manifest surface(s); every predicate agrees with git)"
|
|
136
|
-
exit 0
|