checkwright 0.23.0 → 0.25.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 +175 -13
- package/lib/common/lock.sh +7 -0
- package/lib/common/recipe.sh +1 -1
- package/lib/diff.sh +2 -0
- package/lib/init.sh +40 -16
- package/lib/uninstall.sh +2 -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 +2 -0
- package/payload/canon-kit/SPEC.md +454 -28
- package/payload/canon-kit/checks/check-amendment-queue.gate +3 -0
- package/payload/canon-kit/checks/check-amendment-update-target.gate +3 -0
- package/payload/canon-kit/checks/check-docs-link-convention.gate +3 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.gate +3 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.gate +3 -0
- package/payload/canon-kit/checks/check-unmarked-claim.gate +3 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-orphan.md +6 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +7 -2
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +8 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/SPEC-thing.md +26 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/bad/expect.txt +8 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +47 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +82 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +4 -4
- package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC-wire.md +18 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +3 -1
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.proto +13 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC-wire.md +22 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +17 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.proto +13 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/SPEC.md +11 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +18 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +85 -0
- package/payload/canon-kit/lib/spec.sh +16 -0
- package/payload/canon-kit/smoke/install.sh +3 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +17 -2
- package/payload/context-kit/README.md +6 -4
- package/payload/context-kit/SPEC.md +256 -76
- package/payload/context-kit/bin/always-loaded.sh +5 -21
- package/payload/context-kit/bin/env-probe.sh +2 -17
- package/payload/context-kit/checks/check-brevity.gate +3 -0
- package/payload/context-kit/checks/check-footprint-fresh.gate +3 -0
- package/payload/context-kit/checks/check-memory-off.gate +3 -0
- package/payload/context-kit/checks/check-settings-paths.gate +3 -0
- package/payload/context-kit/checks/check-settings-pins.gate +3 -0
- package/payload/context-kit/gate-tests/check-brevity.test.sh +3 -2
- package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/context-config.sh +4 -0
- package/payload/context-kit/gate-tests/check-memory-off/good/scripts/context-config.sh +4 -0
- package/payload/context-kit/gate-tests/check-memory-off.test.sh +18 -4
- package/payload/context-kit/gate-tests/check-settings-pins.test.sh +70 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +5 -5
- package/payload/context-kit/index-tests/toolfloor-cases.sh +5 -5
- package/payload/context-kit/lib/context.sh +56 -0
- package/payload/context-kit/lib/toolfloor.sh +1 -1
- package/payload/context-kit/smoke/agents-md.sh +16 -4
- package/payload/context-kit/smoke/install.sh +3 -2
- package/payload/context-kit/templates/session-context.sh +5 -5
- package/payload/delegation-kit/README.md +11 -1
- package/payload/delegation-kit/SPEC.md +652 -11
- package/payload/delegation-kit/bin/wait-probe.sh +184 -0
- package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +3 -0
- package/payload/delegation-kit/checks/check-gate-tamper.gate +3 -0
- package/payload/delegation-kit/checks/check-rule-citation.gate +3 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/added-exemptions +5 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +2 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +108 -0
- package/payload/delegation-kit/gate-tests/subagent-stop-liveness.test.sh +99 -0
- package/payload/delegation-kit/smoke/install.sh +21 -1
- package/payload/delegation-kit/templates/agent-execution.md +88 -4
- package/payload/delegation-kit/templates/subagent-stop-liveness.sh +56 -0
- package/payload/doctrine-kit/SPEC.md +1 -1
- package/payload/doctrine-kit/checks/check-doctrine-registration.gate +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +2 -3
- package/payload/doctrine-kit/smoke/install.sh +17 -4
- package/payload/drift-kit/README.md +2 -2
- package/payload/drift-kit/SPEC.md +71 -7
- package/payload/drift-kit/bin/stage-economics.sh +1 -1
- package/payload/drift-kit/lib/drift.sh +43 -0
- package/payload/drift-kit/smoke/install.sh +21 -14
- package/payload/evidence-kit/README.md +3 -1
- package/payload/evidence-kit/SPEC.md +160 -19
- package/payload/evidence-kit/checks/check-battery-roster.gate +3 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.gate +3 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.gate +3 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +42 -2
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +4 -3
- package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +8 -5
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +1 -1
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/evidence-config.sh +9 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +1 -1
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/evidence-config.sh +9 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +6 -4
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +42 -1
- package/payload/evidence-kit/lib/evidence.sh +2 -0
- package/payload/evidence-kit/smoke/install.sh +1 -1
- package/payload/gate-sdk/README.md +17 -9
- package/payload/gate-sdk/SPEC.md +4680 -295
- package/payload/gate-sdk/bin/build-native.sh +66 -1
- package/payload/gate-sdk/bin/install-hooks.sh +14 -2
- package/payload/gate-sdk/bin/port-blockers.sh +37 -9
- package/payload/gate-sdk/bin/run-gate-tests.sh +1 -2
- package/payload/gate-sdk/bin/run-gates.sh +137 -13
- package/payload/gate-sdk/bin/upgrade-smoke.sh +21 -16
- package/payload/gate-sdk/checks/check-action-run-shell.sh +2 -1
- package/payload/gate-sdk/checks/check-commit-msg.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-subject.gate +3 -0
- package/payload/gate-sdk/checks/check-core-files.gate +3 -0
- package/payload/gate-sdk/checks/check-crate-arms.sh +1 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -0
- package/payload/gate-sdk/checks/check-exec-bit.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-assertions.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-fail-closed.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-output.gate +3 -0
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +132 -15
- package/payload/gate-sdk/checks/check-graph.gate +3 -0
- package/payload/gate-sdk/checks/check-hook-exec-bit.gate +3 -0
- package/payload/gate-sdk/checks/check-identity.gate +3 -0
- package/payload/gate-sdk/checks/check-install-disposition.sh +1 -0
- package/payload/gate-sdk/checks/check-kit-enum.gate +3 -0
- package/payload/gate-sdk/checks/check-readme-roster.gate +3 -0
- package/payload/gate-sdk/checks/check-reads-couples.gate +3 -0
- package/payload/gate-sdk/checks/check-root-tiering.gate +3 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-tree-terms.gate +3 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +17 -12
- package/payload/gate-sdk/gate-tests/check-core-files.test.sh +4 -5
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +3 -4
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +5 -1
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +22 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-count.sh +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-extra.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-zero.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +27 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-qux.sh +13 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +117 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +26 -4
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +6 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/kitroot/checks/check-vendored.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-held.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +8 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/kitroot/checks/check-vendored.sh +14 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-held.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +77 -0
- package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +4 -5
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +9 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kit-spec.md +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-bare.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-both.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-heldtwice.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-nospec.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twice.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-ungrounded.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kit-spec.md +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-held.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +49 -4
- package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +15 -5
- package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +12 -0
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +27 -5
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +12 -0
- package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +5 -4
- package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +14 -12
- package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +43 -17
- package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +190 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/gh-hosts.yml +9 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -2
- package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/gate-sdk-config.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/gh-hosts.yml +11 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -1
- package/payload/gate-sdk/gate-tests/check-identity/good/scripts/gate-sdk-config.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-identity.test.sh +114 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -1
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +5 -2
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +3 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/README.md +15 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-one.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/delta-kit/checks/check-delta-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +3 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +1 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +3 -1
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/README.md +13 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/delta-kit/checks/check-delta-one.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/README.md +14 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/epsilon-kit/checks/check-eps-two.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +1 -1
- package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +87 -89
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +56 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/multi.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/second-leak.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/worktrees/vendored-note.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +94 -0
- package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +211 -0
- package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +16 -15
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +94 -1
- package/payload/gate-sdk/lib/gate.sh +232 -25
- package/payload/gate-sdk/smoke/install.sh +28 -1
- package/payload/guard-kit/README.md +4 -3
- package/payload/guard-kit/SPEC.md +578 -47
- package/payload/guard-kit/bin/compare-settings-allow.sh +36 -12
- package/payload/guard-kit/bin/run-guard-tests.sh +27 -4
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +46 -1
- package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +105 -0
- package/payload/guard-kit/guard-tests/background-cases.tsv +14 -0
- package/payload/guard-kit/guard-tests/cases.tsv +67 -9
- package/payload/guard-kit/lib/guard.sh +361 -18
- package/payload/guard-kit/templates/bash-guard.sh +2 -0
- package/payload/guard-kit/templates/close-triage.md +10 -3
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/lifecycle-kit/README.md +3 -2
- package/payload/lifecycle-kit/SPEC.md +509 -77
- package/payload/lifecycle-kit/bin/enter-stage.sh +72 -33
- package/payload/lifecycle-kit/bin/file-gap.sh +2 -2
- package/payload/lifecycle-kit/checks/check-close-surfaces.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.gate +3 -0
- package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +4 -4
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -1
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +3 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +3 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +22 -22
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +2 -2
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +2 -2
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +120 -10
- package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +123 -0
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +11 -11
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +16 -5
- package/payload/lifecycle-kit/lib/stages.sh +5 -0
- package/payload/lifecycle-kit/smoke/install.sh +29 -15
- package/payload/lifecycle-kit/templates/lead.md +32 -0
- package/payload/lifecycle-kit/templates/stages/align.md +20 -2
- package/payload/lifecycle-kit/templates/stages/build.md +3 -3
- package/payload/lifecycle-kit/templates/stages/close.md +20 -6
- package/payload/lifecycle-kit/templates/stages/scope.md +20 -1
- package/payload/lifecycle-kit/templates/stages/spec.md +1 -1
- package/payload/lifecycle-kit/templates/stages/validate.md +1 -1
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +1 -1
- package/payload/queue-kit/README.md +10 -10
- package/payload/queue-kit/SPEC.md +379 -84
- package/payload/queue-kit/bin/queue-counts.sh +1 -1
- package/payload/queue-kit/checks/check-queue-entry-budget.gate +1 -1
- package/payload/queue-kit/checks/check-queue-prose-precondition.gate +3 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +15 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +2 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +7 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +4 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -1
- package/payload/queue-kit/gate-tests/queue-counts.test.sh +1 -1
- package/payload/queue-kit/gate-tests/queue-index.test.sh +55 -119
- package/payload/queue-kit/gate-tests/roadmap.test.sh +22 -12
- package/payload/queue-kit/lib/queue.sh +0 -49
- package/payload/queue-kit/smoke/install.sh +1 -1
- package/payload/site-kit/SPEC.md +41 -2
- package/payload/site-kit/checks/check-docs-cname-parity.gate +3 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +5 -4
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +6 -5
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/checks/check-sample.gate +3 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -1
- package/payload/site-kit/smoke/install.sh +1 -1
- package/payload/canon-kit/checks/check-amendment-queue.sh +0 -117
- package/payload/canon-kit/checks/check-docs-link-convention.sh +0 -79
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +0 -240
- package/payload/canon-kit/checks/check-prose-tells.sh +0 -208
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +0 -134
- package/payload/context-kit/bin/footprint.sh +0 -144
- package/payload/context-kit/checks/check-brevity.sh +0 -124
- package/payload/context-kit/checks/check-footprint-fresh.sh +0 -39
- package/payload/context-kit/checks/check-memory-off.sh +0 -113
- package/payload/context-kit/checks/check-settings-paths.sh +0 -94
- package/payload/context-kit/checks/check-settings-pins.sh +0 -111
- package/payload/context-kit/gate-tests/check-memory-off/bad/args +0 -1
- package/payload/context-kit/gate-tests/check-memory-off/good/args +0 -1
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +0 -62
- package/payload/delegation-kit/checks/check-gate-tamper.sh +0 -140
- package/payload/delegation-kit/checks/check-rule-citation.sh +0 -77
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +0 -246
- package/payload/drift-kit/bin/trajectory.sh +0 -242
- package/payload/evidence-kit/checks/check-battery-roster.sh +0 -87
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +0 -104
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +0 -105
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +0 -3
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +0 -3
- package/payload/gate-sdk/bin/enforcement-map.sh +0 -273
- package/payload/gate-sdk/checks/check-commit-msg.sh +0 -51
- package/payload/gate-sdk/checks/check-commit-subject.sh +0 -44
- package/payload/gate-sdk/checks/check-core-files.sh +0 -76
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +0 -38
- package/payload/gate-sdk/checks/check-exec-bit.sh +0 -96
- package/payload/gate-sdk/checks/check-gate-assertions.sh +0 -148
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +0 -107
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +0 -106
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +0 -85
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +0 -93
- package/payload/gate-sdk/checks/check-gate-output.sh +0 -103
- package/payload/gate-sdk/checks/check-graph.sh +0 -632
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +0 -46
- package/payload/gate-sdk/checks/check-identity.sh +0 -135
- package/payload/gate-sdk/checks/check-kit-enum.sh +0 -95
- package/payload/gate-sdk/checks/check-readme-roster.sh +0 -108
- package/payload/gate-sdk/checks/check-reads-couples.sh +0 -200
- package/payload/gate-sdk/checks/check-root-tiering.sh +0 -67
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +0 -127
- package/payload/gate-sdk/checks/check-tree-terms.sh +0 -66
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +0 -85
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +0 -1
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +0 -1
- package/payload/gate-sdk/gate-tests/check-identity/bad/args +0 -1
- package/payload/gate-sdk/gate-tests/check-identity/good/args +0 -1
- package/payload/lifecycle-kit/bin/close-surfaces.sh +0 -94
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +0 -64
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +0 -198
- package/payload/queue-kit/bin/queue-index.sh +0 -182
- package/payload/queue-kit/bin/roadmap.sh +0 -76
- package/payload/queue-kit/checks/check-queue-prose-precondition.sh +0 -64
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +0 -111
- package/payload/site-kit/checks/check-docs-cname-parity.sh +0 -81
- /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/{gates → scripts}/check-sample.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/{gates → scripts}/check-sample.sh +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{check-gamma.sh → scripts/check-gamma.sh} +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/{gates.list → scripts/gates.list} +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{check-beta.sh → scripts/check-beta.sh} +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/bad/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gate-tests → scripts/gate-tests}/check-alpha/good/.keep +0 -0
- /package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/{gates.list → scripts/gates.list} +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/{site-config.sh → scripts/site-config.sh} +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/CNAME +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree → docs}/index.md +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/docs → docs}/posts/2026-01-01-legacy.md +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{tree/pkg → pkg}/gate-tests/fixture.md +0 -0
- /package/payload/site-kit/gate-tests/check-docs-cname-parity/good/{site-config.sh → scripts/site-config.sh} +0 -0
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=.claude/settings.json,scripts/settings-pins.conf dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: context-kit/SPEC.md §check-settings-pins — every pin in the pins file holds against the tracked harness settings file
|
|
5
|
-
#
|
|
6
|
-
# usage: check-settings-pins.sh [--fixture <dir>]
|
|
7
|
-
# live: pins CONTEXT_KIT_SETTINGS_PINS against CONTEXT_KIT_SETTINGS_FILE;
|
|
8
|
-
# --fixture <dir> reads <dir>/settings.json against <dir>/settings-pins.conf
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
13
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
14
|
-
source "$SDK/lib/gate.sh"
|
|
15
|
-
|
|
16
|
-
_ck_cfg="${CONTEXT_KIT_CONFIG_FILE:-}"
|
|
17
|
-
if [[ -n "$_ck_cfg" ]]; then
|
|
18
|
-
[[ -f "$_ck_cfg" ]] || {
|
|
19
|
-
echo "context-kit: CONTEXT_KIT_CONFIG_FILE not found: $_ck_cfg" >&2
|
|
20
|
-
exit 2
|
|
21
|
-
}
|
|
22
|
-
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
23
|
-
source "$_ck_cfg"
|
|
24
|
-
else
|
|
25
|
-
_ck_cfg="${GATE_SDK_GATES_DIR:-scripts}/context-config.sh"
|
|
26
|
-
if [[ -f "$_ck_cfg" ]]; then
|
|
27
|
-
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
28
|
-
source "$_ck_cfg"
|
|
29
|
-
fi
|
|
30
|
-
fi
|
|
31
|
-
unset _ck_cfg
|
|
32
|
-
|
|
33
|
-
MODE=live
|
|
34
|
-
FIXTURE_DIR=""
|
|
35
|
-
while [[ $# -gt 0 ]]; do
|
|
36
|
-
case "$1" in
|
|
37
|
-
--fixture) MODE=fixture; FIXTURE_DIR="${2:-}"; shift 2 ;;
|
|
38
|
-
-*) echo "check-settings-pins: unknown argument: $1" >&2; exit 2 ;;
|
|
39
|
-
*) echo "check-settings-pins: unexpected argument: $1" >&2; exit 2 ;;
|
|
40
|
-
esac
|
|
41
|
-
done
|
|
42
|
-
|
|
43
|
-
if [[ "$MODE" == fixture ]]; then
|
|
44
|
-
[[ -d "$FIXTURE_DIR" ]] || { echo "check-settings-pins: fixture dir not found: $FIXTURE_DIR" >&2; exit 2; }
|
|
45
|
-
SETTINGS_FILE="$FIXTURE_DIR/settings.json"
|
|
46
|
-
PINS_FILE="$FIXTURE_DIR/settings-pins.conf"
|
|
47
|
-
else
|
|
48
|
-
: "${CONTEXT_KIT_SETTINGS_FILE:=.claude/settings.json}"
|
|
49
|
-
: "${CONTEXT_KIT_SETTINGS_PINS:=${GATE_SDK_GATES_DIR:-scripts}/settings-pins.conf}"
|
|
50
|
-
SETTINGS_FILE="$CONTEXT_KIT_SETTINGS_FILE"
|
|
51
|
-
PINS_FILE="$CONTEXT_KIT_SETTINGS_PINS"
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
# spec: context-kit/SPEC.md §check-settings-pins — absent pins file is the opt-in-off state, not a failure (the identity.conf precedent)
|
|
55
|
-
if [[ ! -e "$PINS_FILE" ]]; then
|
|
56
|
-
echo "SETTINGS-PINS: clean (no pins file at $PINS_FILE — optional consumer config absent)"
|
|
57
|
-
exit 0
|
|
58
|
-
fi
|
|
59
|
-
[[ -r "$PINS_FILE" ]] || { echo "check-settings-pins: pins file not readable: $PINS_FILE" >&2; exit 2; }
|
|
60
|
-
|
|
61
|
-
command -v jq >/dev/null 2>&1 || { echo "check-settings-pins: jq not found — cannot read $SETTINGS_FILE" >&2; exit 2; }
|
|
62
|
-
[[ -r "$SETTINGS_FILE" ]] || { echo "check-settings-pins: settings file not readable: $SETTINGS_FILE" >&2; exit 2; }
|
|
63
|
-
jq -e . "$SETTINGS_FILE" >/dev/null 2>&1 || { echo "check-settings-pins: $SETTINGS_FILE is not valid JSON" >&2; exit 2; }
|
|
64
|
-
|
|
65
|
-
malformed=(); absent=(); mismatches=(); checked=0
|
|
66
|
-
while IFS= read -r line; do
|
|
67
|
-
path="${line%%=*}"; path="${path#"${path%%[![:space:]]*}"}"; path="${path%"${path##*[![:space:]]}"}"
|
|
68
|
-
expected="${line#*=}"; expected="${expected#"${expected%%[![:space:]]*}"}"; expected="${expected%"${expected##*[![:space:]]}"}"
|
|
69
|
-
if [[ "$line" != *=* || -z "$path" || -z "$expected" || "$path" != .* ]]; then
|
|
70
|
-
malformed+=("$line")
|
|
71
|
-
continue
|
|
72
|
-
fi
|
|
73
|
-
actual="$(jq -c "$path" "$SETTINGS_FILE" 2>/dev/null)"; st=$?
|
|
74
|
-
if [[ "$st" -ne 0 ]]; then
|
|
75
|
-
malformed+=("$line (jq could not evaluate path '$path')")
|
|
76
|
-
continue
|
|
77
|
-
fi
|
|
78
|
-
checked=$((checked + 1))
|
|
79
|
-
if [[ "$actual" == "$expected" ]]; then
|
|
80
|
-
continue
|
|
81
|
-
fi
|
|
82
|
-
# spec: context-kit/SPEC.md §check-settings-pins — a pin naming an absent key is a desynced manifest (fail-closed), a present-but-wrong value is the legible violation
|
|
83
|
-
if [[ "$actual" == "null" ]]; then
|
|
84
|
-
absent+=("$path — pin expects $expected, but $SETTINGS_FILE has no such key")
|
|
85
|
-
else
|
|
86
|
-
mismatches+=("$path — pin expects $expected, settings has $actual")
|
|
87
|
-
fi
|
|
88
|
-
done < <(gates_list_members "$PINS_FILE")
|
|
89
|
-
|
|
90
|
-
if [[ ${#malformed[@]} -gt 0 ]]; then
|
|
91
|
-
echo "check-settings-pins: malformed pin(s) in $PINS_FILE (expected '<jq path> = <expected JSON>'):" >&2
|
|
92
|
-
printf ' %s\n' "${malformed[@]}" >&2
|
|
93
|
-
exit 2
|
|
94
|
-
fi
|
|
95
|
-
if [[ ${#absent[@]} -gt 0 ]]; then
|
|
96
|
-
echo "check-settings-pins: pinned key absent from $SETTINGS_FILE — the manifest and settings have desynced:" >&2
|
|
97
|
-
printf ' %s\n' "${absent[@]}" >&2
|
|
98
|
-
echo " help: add the key to $SETTINGS_FILE, or drop the pin from $PINS_FILE if the key was retired" >&2
|
|
99
|
-
exit 2
|
|
100
|
-
fi
|
|
101
|
-
|
|
102
|
-
if [[ ${#mismatches[@]} -gt 0 ]]; then
|
|
103
|
-
echo "check-settings-pins: $SETTINGS_FILE does not match $PINS_FILE:"
|
|
104
|
-
printf ' %s\n' "${mismatches[@]}"
|
|
105
|
-
echo " help: restore each key in $SETTINGS_FILE to its pinned value, or — if the"
|
|
106
|
-
echo " expectation itself moved — update the matching line in $PINS_FILE."
|
|
107
|
-
exit 1
|
|
108
|
-
fi
|
|
109
|
-
|
|
110
|
-
echo "SETTINGS-PINS: clean ($checked pin(s) hold against $SETTINGS_FILE)"
|
|
111
|
-
exit 0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--fixture .
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--fixture .
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=.claude/agents/*.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: delegation-kit/SPEC.md §check-agent-tier-explicit — every agent definition under the scanned directory declares a `model:` field in its frontmatter (an explicit `inherit` passes; only omission reds)
|
|
5
|
-
#
|
|
6
|
-
# usage: check-agent-tier-explicit.sh [agent-dir]
|
|
7
|
-
# defaults DELEGATION_KIT_AGENT_DIR; a fixture passes its own directory.
|
|
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/delegation.sh
|
|
15
|
-
source "$KIT/lib/delegation.sh"
|
|
16
|
-
|
|
17
|
-
DIR="${1:-$DELEGATION_KIT_AGENT_DIR}"; DIR="${DIR%/}"
|
|
18
|
-
|
|
19
|
-
if [[ ! -d "$DIR" ]]; then
|
|
20
|
-
echo "AGENT-TIER-EXPLICIT: clean (0 agent definition(s) under $DIR; no agent-definition directory)"
|
|
21
|
-
exit 0
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
listing="$(find "$DIR" -type f -name '*.md' | LC_ALL=C sort)"; st=$?
|
|
25
|
-
fail_closed "$st" AGENT-TIER-EXPLICIT find
|
|
26
|
-
|
|
27
|
-
files=()
|
|
28
|
-
while IFS= read -r path; do
|
|
29
|
-
[[ -n "$path" ]] || continue
|
|
30
|
-
gate_path_pruned "$path" && continue
|
|
31
|
-
files+=("$path")
|
|
32
|
-
done <<< "$listing"
|
|
33
|
-
|
|
34
|
-
if [[ ${#files[@]} -eq 0 ]]; then
|
|
35
|
-
echo "AGENT-TIER-EXPLICIT: clean (0 agent definition(s) under $DIR; nothing to check)"
|
|
36
|
-
exit 0
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
bare="$(awk '
|
|
40
|
-
FNR == 1 { if (fname != "" && !seen) print fname; fname = FILENAME; seen = 0; open = 0; shut = 0; ln = 0 }
|
|
41
|
-
{ ln++ }
|
|
42
|
-
ln == 1 { if ($0 == "---") open = 1; else shut = 1; next }
|
|
43
|
-
shut || !open { next }
|
|
44
|
-
$0 == "---" { shut = 1; next }
|
|
45
|
-
$0 ~ /^model:[[:space:]]*[^[:space:]]/ { seen = 1 }
|
|
46
|
-
END { if (fname != "" && !seen) print fname }
|
|
47
|
-
' "${files[@]}")"; st=$?
|
|
48
|
-
fail_closed "$st" AGENT-TIER-EXPLICIT awk
|
|
49
|
-
|
|
50
|
-
if [[ -n "$bare" ]]; then
|
|
51
|
-
echo "check-agent-tier-explicit: agent definition(s) whose frontmatter omits the model: field:"
|
|
52
|
-
while IFS= read -r f; do
|
|
53
|
-
[[ -n "$f" ]] && echo " $f: no 'model:' field in frontmatter"
|
|
54
|
-
done <<< "$bare"
|
|
55
|
-
echo " help: state the tier in the definition's frontmatter — an omitted model: is not a neutral"
|
|
56
|
-
echo " default but the literal 'inherit' (the dispatcher's tier), so declare it even when"
|
|
57
|
-
echo " the answer is to inherit; 'model: inherit' passes."
|
|
58
|
-
exit 1
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
echo "AGENT-TIER-EXPLICIT: clean (${#files[@]} agent definition(s) under $DIR, each declaring an explicit model:)"
|
|
62
|
-
exit 0
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:*.sh dir=one valve=none tier=precommit
|
|
3
|
-
# install: zero-config
|
|
4
|
-
# spec: delegation-kit/SPEC.md §Verify after every agent commit — a gate-weakening commit is blocked by shape (A gate edits stay meta-isolated; B a new path-exemption can't excuse a co-staged file)
|
|
5
|
-
#
|
|
6
|
-
# --fixture <dir> injects staged-files / added-exemptions lists; live mode reads git diff --cached.
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
# shellcheck source=../lib/delegation.sh
|
|
11
|
-
source "$KIT/lib/delegation.sh"
|
|
12
|
-
|
|
13
|
-
is_meta() {
|
|
14
|
-
local p="$1" pre
|
|
15
|
-
for pre in "${DELEGATION_KIT_META_PATHS[@]}"; do
|
|
16
|
-
[[ "$p" == "$pre"* ]] && return 0
|
|
17
|
-
done
|
|
18
|
-
[[ "$p" == *.md && "$p" != */* ]] && return 0 # root-level *.md is always meta
|
|
19
|
-
return 1
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
is_gate_file() {
|
|
23
|
-
local p="$1" g
|
|
24
|
-
for g in "${DELEGATION_KIT_GATE_FILES[@]}"; do
|
|
25
|
-
# shellcheck disable=SC2053 # $g is a glob pattern by design here
|
|
26
|
-
[[ "$p" == $g ]] && return 0
|
|
27
|
-
done
|
|
28
|
-
return 1
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
is_pathlike() {
|
|
32
|
-
case "$1" in
|
|
33
|
-
*/* | *'*'* | *'?'* | *'['*) return 0 ;;
|
|
34
|
-
*) return 1 ;;
|
|
35
|
-
esac
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
extract_exemptions() {
|
|
39
|
-
awk '
|
|
40
|
-
/^[[:space:]]*#[[:space:]]*exception-list:/ { tag=1; next }
|
|
41
|
-
tag==1 && /^[[:space:]]*[A-Za-z_][A-Za-z0-9_]*=\(/ {
|
|
42
|
-
tag=0; inarr=1
|
|
43
|
-
line=$0; sub(/#.*/,"",line)
|
|
44
|
-
ob=gsub(/\(/,"",line); cb=gsub(/\)/,"",line)
|
|
45
|
-
bal=ob-cb
|
|
46
|
-
if (bal<=0) inarr=0
|
|
47
|
-
next
|
|
48
|
-
}
|
|
49
|
-
inarr==1 {
|
|
50
|
-
line=$0; sub(/#.*/,"",line)
|
|
51
|
-
ob=gsub(/\(/,"",line); cb=gsub(/\)/,"",line)
|
|
52
|
-
v=line; sub(/^[[:space:]]+/,"",v); sub(/[[:space:]].*$/,"",v)
|
|
53
|
-
gsub(/\047/,"",v); gsub(/"/,"",v)
|
|
54
|
-
if (v != "" && v !~ /^[)(]/) print v
|
|
55
|
-
bal += ob - cb
|
|
56
|
-
if (bal<=0) inarr=0
|
|
57
|
-
}
|
|
58
|
-
'
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare -a STAGED=() ADDED=()
|
|
62
|
-
|
|
63
|
-
collect_live() {
|
|
64
|
-
mapfile -t STAGED < <(git diff --cached --name-only 2>/dev/null)
|
|
65
|
-
local f new old v
|
|
66
|
-
declare -A added_set=()
|
|
67
|
-
for f in "${STAGED[@]}"; do
|
|
68
|
-
is_gate_file "$f" || continue
|
|
69
|
-
new="$(git show ":$f" 2>/dev/null)" || new=""
|
|
70
|
-
old="$(git show "HEAD:$f" 2>/dev/null)" || old=""
|
|
71
|
-
declare -A old_set=()
|
|
72
|
-
while IFS= read -r v; do [[ -n "$v" ]] && old_set["$v"]=1; done \
|
|
73
|
-
< <(printf '%s\n' "$old" | extract_exemptions)
|
|
74
|
-
while IFS= read -r v; do
|
|
75
|
-
[[ -n "$v" && -z "${old_set[$v]:-}" ]] && added_set["$v"]=1
|
|
76
|
-
done < <(printf '%s\n' "$new" | extract_exemptions)
|
|
77
|
-
unset old_set
|
|
78
|
-
done
|
|
79
|
-
ADDED=("${!added_set[@]}")
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
collect_fixture() {
|
|
83
|
-
local dir="$1"
|
|
84
|
-
[[ -d "$dir" ]] || { echo "check-gate-tamper: fixture dir not found: $dir" >&2; exit 2; }
|
|
85
|
-
[[ -f "$dir/staged-files" ]] &&
|
|
86
|
-
mapfile -t STAGED < <(grep -vE '^[[:space:]]*(#|$)' "$dir/staged-files")
|
|
87
|
-
[[ -f "$dir/added-exemptions" ]] &&
|
|
88
|
-
mapfile -t ADDED < <(grep -vE '^[[:space:]]*(#|$)' "$dir/added-exemptions")
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
MODE=live
|
|
92
|
-
FIXTURE_DIR=""
|
|
93
|
-
while [[ $# -gt 0 ]]; do
|
|
94
|
-
case "$1" in
|
|
95
|
-
--fixture) MODE=fixture; FIXTURE_DIR="${2:-}"; shift 2 ;;
|
|
96
|
-
*) echo "check-gate-tamper: unknown argument: $1" >&2; exit 2 ;;
|
|
97
|
-
esac
|
|
98
|
-
done
|
|
99
|
-
|
|
100
|
-
if [[ "$MODE" == fixture ]]; then
|
|
101
|
-
collect_fixture "$FIXTURE_DIR"
|
|
102
|
-
else
|
|
103
|
-
collect_live
|
|
104
|
-
fi
|
|
105
|
-
|
|
106
|
-
viol_a=()
|
|
107
|
-
viol_b=()
|
|
108
|
-
|
|
109
|
-
# assertion A: gate-edit-isolation
|
|
110
|
-
gate_touched=0
|
|
111
|
-
for f in "${STAGED[@]}"; do is_gate_file "$f" && { gate_touched=1; break; }; done
|
|
112
|
-
if [[ "$gate_touched" -eq 1 ]]; then
|
|
113
|
-
for f in "${STAGED[@]}"; do is_meta "$f" || viol_a+=("$f"); done
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
# assertion B: no-self-serving-exemption
|
|
117
|
-
for e in "${ADDED[@]}"; do
|
|
118
|
-
is_pathlike "$e" || continue
|
|
119
|
-
for f in "${STAGED[@]}"; do
|
|
120
|
-
# shellcheck disable=SC2053 # $e is a glob pattern by design here
|
|
121
|
-
[[ "$f" == $e ]] && viol_b+=("$e -> $f")
|
|
122
|
-
done
|
|
123
|
-
done
|
|
124
|
-
|
|
125
|
-
if [[ ${#viol_a[@]} -gt 0 || ${#viol_b[@]} -gt 0 ]]; then
|
|
126
|
-
if [[ ${#viol_a[@]} -gt 0 ]]; then
|
|
127
|
-
echo "check-gate-tamper: gate edit not isolated — a commit touching a gate file (${DELEGATION_KIT_GATE_FILES[*]}) may touch only meta-layer paths; these co-staged paths are not:"
|
|
128
|
-
printf ' %s\n' "${viol_a[@]}"
|
|
129
|
-
echo " help: split the gate change into its own commit (meta-layer paths only: ${DELEGATION_KIT_META_PATHS[*]} and root *.md); land the product change in a separate commit"
|
|
130
|
-
fi
|
|
131
|
-
if [[ ${#viol_b[@]} -gt 0 ]]; then
|
|
132
|
-
echo "check-gate-tamper: self-serving exemption — a newly added path/glob exemption matches a file staged in the same commit:"
|
|
133
|
-
printf ' %s\n' "${viol_b[@]}"
|
|
134
|
-
echo " help: an exemption must not excuse the very change it lands with; add the exemption in a separate commit, or drop the matched file from this commit"
|
|
135
|
-
fi
|
|
136
|
-
exit 1
|
|
137
|
-
fi
|
|
138
|
-
|
|
139
|
-
echo "GATE-TAMPER: clean (${#STAGED[@]} staged path(s); gate edits meta-isolated, no self-serving path-exemption)"
|
|
140
|
-
exit 0
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=delegation-kit/SPEC.md,delegation-kit/templates/agent-execution.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: delegation-kit/SPEC.md §One template, a resident pointer — every `the template's **<name>** rule` citation in SPEC §The delegation model resolves to a template bullet's bold lead-in (forward direction only)
|
|
5
|
-
#
|
|
6
|
-
# usage: check-rule-citation.sh [spec-file [template-file]]
|
|
7
|
-
# paths resolve relative to cwd (= repo root in a battery run); fixtures pass
|
|
8
|
-
# their own spec + template as the two positional arguments.
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
13
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
14
|
-
source "$SDK/lib/gate.sh"
|
|
15
|
-
|
|
16
|
-
SPEC_FILE="${1:-delegation-kit/SPEC.md}"
|
|
17
|
-
TEMPLATE_FILE="${2:-delegation-kit/templates/agent-execution.md}"
|
|
18
|
-
for f in "$SPEC_FILE" "$TEMPLATE_FILE"; do
|
|
19
|
-
[[ -f "$f" ]] || { echo "check-rule-citation: not found: $f" >&2; exit 2; } # exit 2: fail-closed
|
|
20
|
-
done
|
|
21
|
-
|
|
22
|
-
tmpl_out="$(awk '
|
|
23
|
-
/^- \*\*/ {
|
|
24
|
-
line=$0; sub(/^- /,"",line)
|
|
25
|
-
rest=substr(line,3)
|
|
26
|
-
p=index(rest,"**")
|
|
27
|
-
if (p>0) {
|
|
28
|
-
name=substr(rest,1,p-1)
|
|
29
|
-
sub(/\.$/,"",name)
|
|
30
|
-
gsub(/`[^`]*`/,"",name)
|
|
31
|
-
print name
|
|
32
|
-
}
|
|
33
|
-
}' "$TEMPLATE_FILE")"; st=$?
|
|
34
|
-
fail_closed "$st" check-rule-citation awk
|
|
35
|
-
|
|
36
|
-
declare -A LEADIN=()
|
|
37
|
-
while IFS= read -r n; do [[ -n "$n" ]] && LEADIN["$n"]=1; done <<<"$tmpl_out"
|
|
38
|
-
|
|
39
|
-
cite_out="$(awk '
|
|
40
|
-
/^## The delegation model[[:space:]]*$/ { insec=1; next }
|
|
41
|
-
/^## / { insec=0 }
|
|
42
|
-
insec { sec = sec " " $0 }
|
|
43
|
-
END {
|
|
44
|
-
gsub(/`[^`]*`/, "", sec)
|
|
45
|
-
n=length(sec); i=1
|
|
46
|
-
while (i<=n) {
|
|
47
|
-
op=index(substr(sec,i),"**"); if (op==0) break
|
|
48
|
-
op=i+op-1; after=op+2
|
|
49
|
-
cl=index(substr(sec,after),"**"); if (cl==0) break
|
|
50
|
-
cl=after+cl-1
|
|
51
|
-
name=substr(sec,after,cl-after)
|
|
52
|
-
tail=substr(sec,cl+2)
|
|
53
|
-
if (tail ~ /^[[:space:]]+(rule|bullet)([^[:alnum:]]|$)/) {
|
|
54
|
-
c=name; sub(/\.$/,"",c); print c
|
|
55
|
-
}
|
|
56
|
-
i=cl+2
|
|
57
|
-
}
|
|
58
|
-
}' "$SPEC_FILE")"; st=$?
|
|
59
|
-
fail_closed "$st" check-rule-citation awk
|
|
60
|
-
|
|
61
|
-
unresolved=()
|
|
62
|
-
cites=0
|
|
63
|
-
while IFS= read -r c; do
|
|
64
|
-
[[ -n "$c" ]] || continue
|
|
65
|
-
cites=$((cites + 1))
|
|
66
|
-
[[ -n "${LEADIN[$c]:-}" ]] || unresolved+=("$c")
|
|
67
|
-
done <<<"$cite_out"
|
|
68
|
-
|
|
69
|
-
if [[ ${#unresolved[@]} -gt 0 ]]; then
|
|
70
|
-
echo "check-rule-citation: SPEC §The delegation model cites a rule that does not resolve to a template lead-in in $TEMPLATE_FILE:"
|
|
71
|
-
printf ' **%s**\n' "${unresolved[@]}"
|
|
72
|
-
echo " help: a citation names a template bullet's bold lead-in verbatim (minus its trailing period); fix the name or the renamed lead-in — delegation-kit/SPEC.md §One template, a resident pointer"
|
|
73
|
-
exit 1
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
echo "RULE-CITATION: clean ($cites citation(s) in SPEC §The delegation model each resolve to a template lead-in; ${#LEADIN[@]} lead-in(s) available)"
|
|
77
|
-
exit 0
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=CLAUDE.md,doctrine-kit/DOCTRINE.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: zero-config
|
|
4
|
-
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — the always-loaded agent file links the doctrine file and holds its methodology-rule digest in per-rule lockstep with DOCTRINE.md, fail-closed when a scanned file or section is missing
|
|
5
|
-
#
|
|
6
|
-
# usage: check-doctrine-registration.sh [agent-file [doctrine-file]]
|
|
7
|
-
# paths resolve relative to cwd (= repo root in a battery run); defaults come
|
|
8
|
-
# from DOCTRINE_KIT_AGENT_FILE / DOCTRINE_KIT_DOCTRINE_FILE (doctrine-kit/lib/doctrine.sh).
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
13
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
14
|
-
source "$SDK/lib/gate.sh"
|
|
15
|
-
# shellcheck source=../lib/doctrine.sh
|
|
16
|
-
source "$KIT/lib/doctrine.sh"
|
|
17
|
-
|
|
18
|
-
AGENT_FILE="${1:-$DOCTRINE_KIT_AGENT_FILE}"
|
|
19
|
-
DOCTRINE_FILE="${2:-$DOCTRINE_KIT_DOCTRINE_FILE}"
|
|
20
|
-
[[ -f "$AGENT_FILE" ]] \
|
|
21
|
-
|| { echo "check-doctrine-registration: agent file not found: $AGENT_FILE" >&2; exit 2; } # exit 2: fail-closed
|
|
22
|
-
|
|
23
|
-
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — the doctrine-side section headings are kit mechanism (the kit ships DOCTRINE.md), never config
|
|
24
|
-
METH_SECTION="## Methodology-maintenance rules"
|
|
25
|
-
CRAFT_SECTION="## Engineering-craft rules"
|
|
26
|
-
|
|
27
|
-
grep -qF -- "]($DOCTRINE_FILE" "$AGENT_FILE"; st=$?
|
|
28
|
-
if [[ "$st" -ne 0 ]]; then
|
|
29
|
-
[[ "$st" -eq 1 ]] || fail_closed "$st" check-doctrine-registration grep
|
|
30
|
-
echo "check-doctrine-registration: $AGENT_FILE carries no markdown link to the doctrine file:"
|
|
31
|
-
echo " $DOCTRINE_FILE"
|
|
32
|
-
echo " help: install the doctrine reference block into the always-loaded agent file —"
|
|
33
|
-
echo " bash doctrine-kit/bin/install-doctrine.sh — so a session that loads it"
|
|
34
|
-
echo " follows the link to the delivery doctrine. Override the paths with"
|
|
35
|
-
echo " DOCTRINE_KIT_AGENT_FILE / DOCTRINE_KIT_DOCTRINE_FILE."
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
[[ -f "$DOCTRINE_FILE" ]] \
|
|
40
|
-
|| { echo "check-doctrine-registration: doctrine file not found: $DOCTRINE_FILE" >&2; exit 2; } # exit 2: fail-closed
|
|
41
|
-
|
|
42
|
-
read -r -d '' SECTION_WALK <<'AWK' || true
|
|
43
|
-
function hlevel(line, n) {
|
|
44
|
-
if (line !~ /^#+[[:space:]]/) return 0
|
|
45
|
-
n = 0
|
|
46
|
-
while (substr(line, n + 1, 1) == "#") n++
|
|
47
|
-
return n
|
|
48
|
-
}
|
|
49
|
-
# Enter the governed section: heading line whose text starts with the knob.
|
|
50
|
-
!insec {
|
|
51
|
-
if (hlevel($0) > 0 && substr($0, 1, length(section)) == section) {
|
|
52
|
-
insec = 1; seen = 1; start_lvl = hlevel($0)
|
|
53
|
-
}
|
|
54
|
-
next
|
|
55
|
-
}
|
|
56
|
-
# A heading at the same level or higher closes the section.
|
|
57
|
-
insec && hlevel($0) > 0 && hlevel($0) <= start_lvl { insec = 0; next }
|
|
58
|
-
insec {
|
|
59
|
-
if (mode == "doctrine") {
|
|
60
|
-
# Numbered rule lead-in: bold name, trailing in-bold period dropped.
|
|
61
|
-
if ($0 ~ /^[0-9]+\.[[:space:]]+\*\*/) {
|
|
62
|
-
name = $0
|
|
63
|
-
sub(/^[0-9]+\.[[:space:]]+\*\*/, "", name)
|
|
64
|
-
sub(/\*\*.*/, "", name)
|
|
65
|
-
sub(/\.$/, "", name)
|
|
66
|
-
print "R\t" name
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
# Digest bullet lead-in.
|
|
70
|
-
if ($0 ~ /^- \*\*/) {
|
|
71
|
-
name = $0
|
|
72
|
-
sub(/^- \*\*/, "", name)
|
|
73
|
-
sub(/\*\*.*/, "", name)
|
|
74
|
-
print "D\t" name
|
|
75
|
-
# Declared trim: <!-- doctrine-digest-trim: <rule name> — <reason> -->
|
|
76
|
-
} else if ($0 ~ /doctrine-digest-trim:/) {
|
|
77
|
-
name = $0
|
|
78
|
-
sub(/^.*doctrine-digest-trim:[[:space:]]*/, "", name)
|
|
79
|
-
sub(/[[:space:]]*—.*$/, "", name)
|
|
80
|
-
print "T\t" name
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
next
|
|
84
|
-
}
|
|
85
|
-
END { if (!seen) print "@@NOSECTION" }
|
|
86
|
-
AWK
|
|
87
|
-
|
|
88
|
-
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — assertions D and E share one walk over a register's numbered rules, counting a named per-rule trailer and grading its value: D is `Stages` over the craft register, E is `Digest` over the methodology register
|
|
89
|
-
read -r -d '' TRAILER_WALK <<'AWK' || true
|
|
90
|
-
function hlevel(line, n) {
|
|
91
|
-
if (line !~ /^#+[[:space:]]/) return 0
|
|
92
|
-
n = 0
|
|
93
|
-
while (substr(line, n + 1, 1) == "#") n++
|
|
94
|
-
return n
|
|
95
|
-
}
|
|
96
|
-
function flush() {
|
|
97
|
-
if (have) print "C\t" cur_name "\t" tcount "\t" bad
|
|
98
|
-
}
|
|
99
|
-
BEGIN {
|
|
100
|
-
mark = "^[[:space:]]*\\*" trailer ":\\*"
|
|
101
|
-
strip = mark "[[:space:]]*"
|
|
102
|
-
}
|
|
103
|
-
!insec {
|
|
104
|
-
if (hlevel($0) > 0 && substr($0, 1, length(section)) == section) {
|
|
105
|
-
insec = 1; seen = 1; start_lvl = hlevel($0)
|
|
106
|
-
}
|
|
107
|
-
next
|
|
108
|
-
}
|
|
109
|
-
insec && hlevel($0) > 0 && hlevel($0) <= start_lvl { flush(); insec = 0; have = 0; next }
|
|
110
|
-
insec {
|
|
111
|
-
if ($0 ~ /^[0-9]+\.[[:space:]]+\*\*/) {
|
|
112
|
-
flush()
|
|
113
|
-
name = $0
|
|
114
|
-
sub(/^[0-9]+\.[[:space:]]+\*\*/, "", name)
|
|
115
|
-
sub(/\*\*.*/, "", name)
|
|
116
|
-
sub(/\.$/, "", name)
|
|
117
|
-
cur_name = name; have = 1; tcount = 0; bad = 0
|
|
118
|
-
} else if ($0 ~ mark) {
|
|
119
|
-
tcount++
|
|
120
|
-
val = $0
|
|
121
|
-
sub(strip, "", val)
|
|
122
|
-
sub(/[[:space:]]+$/, "", val)
|
|
123
|
-
if (grammar == "stages") {
|
|
124
|
-
if (val != "—" && val !~ /^[a-z]+(,[[:space:]]+[a-z]+)*$/) bad = 1
|
|
125
|
-
} else if (val == "") bad = 1
|
|
126
|
-
}
|
|
127
|
-
next
|
|
128
|
-
}
|
|
129
|
-
END { flush(); if (!seen) print "@@NOSECTION" }
|
|
130
|
-
AWK
|
|
131
|
-
|
|
132
|
-
doctrine_out="$(awk -v section="$METH_SECTION" -v mode=doctrine "$SECTION_WALK" "$DOCTRINE_FILE")"; st=$?
|
|
133
|
-
fail_closed "$st" check-doctrine-registration awk
|
|
134
|
-
if [[ "$doctrine_out" == "@@NOSECTION" ]]; then
|
|
135
|
-
echo "check-doctrine-registration: no '$METH_SECTION' section in $DOCTRINE_FILE — cannot certify the digest against an unreadable rule set" >&2
|
|
136
|
-
echo " help: the methodology-maintenance section heading is kit mechanism; restore it in the doctrine file" >&2
|
|
137
|
-
exit 2 # exit 2: fail-closed
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
digest_out="$(awk -v section="$DOCTRINE_KIT_DIGEST_SECTION" -v mode=digest "$SECTION_WALK" "$AGENT_FILE")"; st=$?
|
|
141
|
-
fail_closed "$st" check-doctrine-registration awk
|
|
142
|
-
if [[ "$digest_out" == "@@NOSECTION" ]]; then
|
|
143
|
-
printf 'check-doctrine-registration: no heading matches %s in %s: %s\n' \
|
|
144
|
-
DOCTRINE_KIT_DIGEST_SECTION "$AGENT_FILE" "'$DOCTRINE_KIT_DIGEST_SECTION'" >&2
|
|
145
|
-
echo " help: a renamed or deleted digest section silently disarms this gate — repoint DOCTRINE_KIT_DIGEST_SECTION at the live heading, or restore the heading it names" >&2
|
|
146
|
-
exit 2 # exit 2: fail-closed
|
|
147
|
-
fi
|
|
148
|
-
|
|
149
|
-
craft_out="$(awk -v section="$CRAFT_SECTION" -v trailer=Stages -v grammar=stages "$TRAILER_WALK" "$DOCTRINE_FILE")"; st=$?
|
|
150
|
-
fail_closed "$st" check-doctrine-registration awk
|
|
151
|
-
if [[ "$craft_out" == "@@NOSECTION" ]]; then
|
|
152
|
-
echo "check-doctrine-registration: no '$CRAFT_SECTION' section in $DOCTRINE_FILE — cannot certify the stage-routing trailers against an unreadable rule set" >&2
|
|
153
|
-
echo " help: the engineering-craft section heading is kit mechanism; restore it in the doctrine file" >&2
|
|
154
|
-
exit 2 # exit 2: fail-closed
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
craft_count=0
|
|
158
|
-
craft_findings=()
|
|
159
|
-
while IFS=$'\t' read -r kind name scount bad; do
|
|
160
|
-
[[ "$kind" == C ]] || continue
|
|
161
|
-
craft_count=$((craft_count + 1))
|
|
162
|
-
if [[ "$scount" -ne 1 ]]; then
|
|
163
|
-
craft_findings+=("craft rule carries $scount *Stages:* trailer(s), want exactly one: $name")
|
|
164
|
-
elif [[ "$bad" == 1 ]]; then
|
|
165
|
-
craft_findings+=("craft rule's *Stages:* value is malformed (want a comma list of lowercase stages, or —): $name")
|
|
166
|
-
fi
|
|
167
|
-
done <<< "$craft_out"
|
|
168
|
-
|
|
169
|
-
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — assertion E: every methodology rule carries exactly one non-empty *Digest:* trailer, the surface install-doctrine derives its bullet from
|
|
170
|
-
meth_out="$(awk -v section="$METH_SECTION" -v trailer=Digest -v grammar=digest "$TRAILER_WALK" "$DOCTRINE_FILE")"; st=$?
|
|
171
|
-
fail_closed "$st" check-doctrine-registration awk
|
|
172
|
-
|
|
173
|
-
digest_findings=()
|
|
174
|
-
while IFS=$'\t' read -r kind name dcount bad; do
|
|
175
|
-
[[ "$kind" == C ]] || continue
|
|
176
|
-
if [[ "$dcount" -ne 1 ]]; then
|
|
177
|
-
digest_findings+=("methodology rule carries $dcount *Digest:* trailer(s), want exactly one: $name")
|
|
178
|
-
elif [[ "$bad" == 1 ]]; then
|
|
179
|
-
digest_findings+=("methodology rule's *Digest:* value is empty: $name")
|
|
180
|
-
fi
|
|
181
|
-
done <<< "$meth_out"
|
|
182
|
-
|
|
183
|
-
declare -A in_digest in_trim in_doctrine
|
|
184
|
-
digest_names=()
|
|
185
|
-
trim_count=0
|
|
186
|
-
while IFS=$'\t' read -r kind name; do
|
|
187
|
-
[[ -n "$name" ]] || continue
|
|
188
|
-
case "$kind" in
|
|
189
|
-
D) digest_names+=("$name"); in_digest["$name"]=1 ;;
|
|
190
|
-
T) in_trim["$name"]=1; trim_count=$((trim_count + 1)) ;;
|
|
191
|
-
esac
|
|
192
|
-
done <<< "$digest_out"
|
|
193
|
-
|
|
194
|
-
rule_count=0
|
|
195
|
-
missing=()
|
|
196
|
-
while IFS=$'\t' read -r _kind name; do
|
|
197
|
-
[[ -n "$name" ]] || continue
|
|
198
|
-
rule_count=$((rule_count + 1))
|
|
199
|
-
in_doctrine["$name"]=1
|
|
200
|
-
if [[ -z "${in_digest[$name]:-}" && -z "${in_trim[$name]:-}" ]]; then
|
|
201
|
-
missing+=("$name")
|
|
202
|
-
fi
|
|
203
|
-
done <<< "$doctrine_out"
|
|
204
|
-
|
|
205
|
-
orphans=()
|
|
206
|
-
for name in "${digest_names[@]+"${digest_names[@]}"}"; do
|
|
207
|
-
[[ -z "${in_doctrine[$name]:-}" ]] && orphans+=("$name")
|
|
208
|
-
done
|
|
209
|
-
|
|
210
|
-
if [[ ${#missing[@]} -gt 0 || ${#orphans[@]} -gt 0 || ${#craft_findings[@]} -gt 0 || ${#digest_findings[@]} -gt 0 ]]; then
|
|
211
|
-
if [[ ${#missing[@]} -gt 0 || ${#orphans[@]} -gt 0 ]]; then
|
|
212
|
-
echo "check-doctrine-registration: the digest and the doctrine are out of lockstep in $AGENT_FILE:"
|
|
213
|
-
for name in "${missing[@]+"${missing[@]}"}"; do
|
|
214
|
-
echo " doctrine rule absent from the digest: $name"
|
|
215
|
-
done
|
|
216
|
-
for name in "${orphans[@]+"${orphans[@]}"}"; do
|
|
217
|
-
echo " digest bullet owns no doctrine rule: $name"
|
|
218
|
-
done
|
|
219
|
-
echo " help: a re-vendored DOCTRINE.md changed the methodology-rule set — reconcile the"
|
|
220
|
-
echo " '$DOCTRINE_KIT_DIGEST_SECTION' digest in $AGENT_FILE: add '- **<name>** — …' for"
|
|
221
|
-
echo " each absent rule (or declare a trim '<!-- doctrine-digest-trim: <name> — <reason> -->'),"
|
|
222
|
-
echo " and rename or remove any bullet that owns no rule."
|
|
223
|
-
fi
|
|
224
|
-
if [[ ${#craft_findings[@]} -gt 0 ]]; then
|
|
225
|
-
echo "check-doctrine-registration: the stage-routing trailers are out of grammar in $DOCTRINE_FILE:"
|
|
226
|
-
for f in "${craft_findings[@]}"; do
|
|
227
|
-
echo " $f"
|
|
228
|
-
done
|
|
229
|
-
echo " help: every engineering-craft rule owns exactly one '*Stages:* <stage>[, <stage>…]'"
|
|
230
|
-
echo " trailer ('*Stages:* —' for none) so a re-vendored DOCTRINE.md that adds an"
|
|
231
|
-
echo " untagged craft rule reddens instead of silently dropping out of stage routing."
|
|
232
|
-
fi
|
|
233
|
-
if [[ ${#digest_findings[@]} -gt 0 ]]; then
|
|
234
|
-
echo "check-doctrine-registration: the digest trailers are out of grammar in $DOCTRINE_FILE:"
|
|
235
|
-
for f in "${digest_findings[@]}"; do
|
|
236
|
-
echo " $f"
|
|
237
|
-
done
|
|
238
|
-
echo " help: every methodology rule owns exactly one non-empty '*Digest:* <one-line summary>'"
|
|
239
|
-
echo " trailer — install-doctrine.sh derives that rule's digest bullet from it, so an"
|
|
240
|
-
echo " untrailered rule would ship every consumer a digest one rule short."
|
|
241
|
-
fi
|
|
242
|
-
exit 1
|
|
243
|
-
fi
|
|
244
|
-
|
|
245
|
-
echo "DOCTRINE-REGISTRATION: clean ($AGENT_FILE links $DOCTRINE_FILE; $rule_count methodology rule(s) in per-rule digest lockstep, $trim_count declared trim(s), each carrying one *Digest:* trailer; $craft_count craft rule(s) each carry one *Stages:* trailer)"
|
|
246
|
-
exit 0
|