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,632 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=scripts/gates.list,scripts/*.sh,kit:*.sh,scripts/git-hooks/pre-commit,scripts/CHECK-GRAPH.html,docs/check-graph.html,SPEC-*.md,*/SPEC-*.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: zero-config
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-graph — manifest well-formedness, trigger parity, cycle valves, artifact drift, and amendment-body manifest validation (assertion G)
|
|
5
|
-
set -uo pipefail
|
|
6
|
-
|
|
7
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
8
|
-
# shellcheck source=../lib/gate.sh
|
|
9
|
-
source "$SDK/lib/gate.sh"
|
|
10
|
-
|
|
11
|
-
GATES_DIR="$(gate_sdk_gates_dir)"
|
|
12
|
-
LIST="$GATES_DIR/gates.list"
|
|
13
|
-
HOOK="${GATE_SDK_HOOKS_DIR:-$GATES_DIR/git-hooks}/pre-commit"
|
|
14
|
-
GEN="$SDK/bin/gen-pre-commit.sh"
|
|
15
|
-
|
|
16
|
-
GRAPH_VOCAB=()
|
|
17
|
-
GRAPH_LEADING=()
|
|
18
|
-
GRAPH_LAGGING=()
|
|
19
|
-
GRAPH_LAYERS=()
|
|
20
|
-
VOCAB_FILE="${GATE_SDK_GRAPH_VOCAB:-$GATES_DIR/graph-vocab.sh}"
|
|
21
|
-
if [[ -f "$VOCAB_FILE" ]]; then
|
|
22
|
-
# shellcheck disable=SC1090 # consumer-supplied rule content, path is config
|
|
23
|
-
source "$VOCAB_FILE"
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
MAX_EDGES="${GATE_SDK_GRAPH_MAX_EDGES:-100000}"
|
|
27
|
-
|
|
28
|
-
THEME_FILE="${GATE_SDK_GRAPH_THEME:-$GATES_DIR/graph-theme.sh}"
|
|
29
|
-
if [[ -f "$THEME_FILE" ]]; then
|
|
30
|
-
# shellcheck disable=SC1090 # consumer-supplied rule content, path is config
|
|
31
|
-
source "$THEME_FILE"
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
in_set() { local t="$1"; shift; local v; for v in "$@"; do [[ "$t" == "$v" ]] && return 0; done; return 1; }
|
|
35
|
-
|
|
36
|
-
surface_layer() {
|
|
37
|
-
if declare -F graph_surface_layer >/dev/null; then
|
|
38
|
-
graph_surface_layer "$1"
|
|
39
|
-
else
|
|
40
|
-
echo surfaces
|
|
41
|
-
fi
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
layer_specs() {
|
|
45
|
-
if [[ ${#GRAPH_LAYERS[@]} -gt 0 ]]; then
|
|
46
|
-
printf '%s\n' "${GRAPH_LAYERS[@]}"
|
|
47
|
-
else
|
|
48
|
-
printf '%s\n' 'surfaces:governed surfaces'
|
|
49
|
-
fi
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
graph_theme_css_default() {
|
|
53
|
-
cat <<'CSS'
|
|
54
|
-
:root { color-scheme: light dark; }
|
|
55
|
-
body { margin: 0; font: 15px/1.5 system-ui, sans-serif;
|
|
56
|
-
background: #fff; color: #1a1a1a; }
|
|
57
|
-
header { padding: 1rem 1.5rem; border-bottom: 1px solid #ddd; }
|
|
58
|
-
header h1 { margin: 0 0 .35rem; font-size: 1.25rem; }
|
|
59
|
-
header p { margin: .25rem 0; max-width: 68rem; }
|
|
60
|
-
.status { font-size: .85rem; opacity: .7; }
|
|
61
|
-
main { padding: 1rem 1.5rem; }
|
|
62
|
-
.legend { margin-bottom: .75rem; font-size: .9rem; }
|
|
63
|
-
.legend .valve { display: inline-block; width: 22px; border-top: 3px solid #d97706; }
|
|
64
|
-
.viewport { border: 1px solid #ddd; border-radius: 8px; padding: 16px;
|
|
65
|
-
background: #fafafa; overflow: auto; height: 78vh; cursor: grab; }
|
|
66
|
-
.viewport.grabbing { cursor: grabbing; }
|
|
67
|
-
.viewport svg { transform-origin: 0 0; max-width: none; }
|
|
68
|
-
.hint { margin: .5rem 0 0; font-size: .8rem; opacity: .6; }
|
|
69
|
-
@media (prefers-color-scheme: dark) {
|
|
70
|
-
body { background: #16181d; color: #e6e6e6; }
|
|
71
|
-
header { border-color: #333; }
|
|
72
|
-
.viewport { border-color: #333; background: #0f1115; }
|
|
73
|
-
}
|
|
74
|
-
CSS
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
emit_theme_css() {
|
|
78
|
-
if declare -F graph_theme_css >/dev/null; then graph_theme_css; else graph_theme_css_default; fi
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
emit_theme_header() {
|
|
82
|
-
declare -F graph_theme_header >/dev/null && graph_theme_header
|
|
83
|
-
return 0
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
emit_theme_footer() {
|
|
87
|
-
declare -F graph_theme_footer >/dev/null && graph_theme_footer
|
|
88
|
-
return 0
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
mapfile -t RESOLVE_DIRS < <(gate_check_dirs)
|
|
92
|
-
resolve_member() {
|
|
93
|
-
gate_resolve "$1" "${RESOLVE_DIRS[@]}"
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
emit_graph() {
|
|
97
|
-
local checks
|
|
98
|
-
local resolved_artifact="${GATE_SDK_GRAPH_ARTIFACT:-$GATES_DIR/CHECK-GRAPH.html}"
|
|
99
|
-
mapfile -t checks < <(gates_list_members "$LIST" | sort -u)
|
|
100
|
-
declare -A C_COUPLES C_DIR C_VALVE NODE_SEEN
|
|
101
|
-
local c src man kv couples dir valve s
|
|
102
|
-
for c in "${checks[@]}"; do
|
|
103
|
-
src="$(resolve_member "$c" || true)"
|
|
104
|
-
[[ -n "$src" ]] || continue
|
|
105
|
-
man="$(grep -m1 '^# graph: ' "$src" 2>/dev/null || true)"
|
|
106
|
-
[[ -n "$man" ]] || continue
|
|
107
|
-
couples=""; dir=""; valve=""
|
|
108
|
-
for kv in ${man#\# graph: }; do
|
|
109
|
-
case "$kv" in
|
|
110
|
-
couples=*) couples="${kv#couples=}" ;;
|
|
111
|
-
dir=*) dir="${kv#dir=}" ;;
|
|
112
|
-
valve=*) valve="${kv#valve=}" ;;
|
|
113
|
-
esac
|
|
114
|
-
done
|
|
115
|
-
gate_expand_couples_var couples "$couples"
|
|
116
|
-
C_COUPLES[$c]="$couples"; C_DIR[$c]="$dir"; C_VALVE[$c]="$valve"
|
|
117
|
-
local -a csurf; IFS=',' read -ra csurf <<<"$couples"
|
|
118
|
-
for s in "${csurf[@]}"; do NODE_SEEN[$s]=1; done
|
|
119
|
-
done
|
|
120
|
-
|
|
121
|
-
local nodes; mapfile -t nodes < <(printf '%s\n' "${!NODE_SEEN[@]}" | sort)
|
|
122
|
-
declare -A NODE_ID; local i=0 n
|
|
123
|
-
for n in "${nodes[@]}"; do NODE_ID[$n]="n$i"; i=$((i+1)); done
|
|
124
|
-
|
|
125
|
-
local -a edge_lines=() proposed_idx=(); local idx=0 arrow src_id tgt j
|
|
126
|
-
local -a surf
|
|
127
|
-
for c in "${checks[@]}"; do
|
|
128
|
-
[[ -n "${C_COUPLES[$c]:-}" ]] || continue
|
|
129
|
-
IFS=',' read -ra surf <<<"${C_COUPLES[$c]}"
|
|
130
|
-
[[ "${C_DIR[$c]}" == bi ]] && arrow="<-->" || arrow="-->"
|
|
131
|
-
src_id="${NODE_ID[${surf[0]}]}"
|
|
132
|
-
if [[ ${#surf[@]} -eq 1 ]]; then
|
|
133
|
-
edge_lines+=(" $src_id $arrow|\"$c\"| $src_id")
|
|
134
|
-
[[ "${C_VALVE[$c]}" == PROPOSED ]] && proposed_idx+=("$idx"); idx=$((idx+1))
|
|
135
|
-
else
|
|
136
|
-
for ((j=1; j<${#surf[@]}; j++)); do
|
|
137
|
-
tgt="${NODE_ID[${surf[$j]}]}"
|
|
138
|
-
edge_lines+=(" $src_id $arrow|\"$c\"| $tgt")
|
|
139
|
-
[[ "${C_VALVE[$c]}" == PROPOSED ]] && proposed_idx+=("$idx"); idx=$((idx+1))
|
|
140
|
-
done
|
|
141
|
-
fi
|
|
142
|
-
done
|
|
143
|
-
|
|
144
|
-
local graph_text spec layer label decl joined
|
|
145
|
-
graph_text="$(
|
|
146
|
-
printf 'graph LR\n'
|
|
147
|
-
while IFS= read -r spec; do
|
|
148
|
-
layer="${spec%%:*}"; label="${spec#*:}"
|
|
149
|
-
decl=""
|
|
150
|
-
for n in "${nodes[@]}"; do
|
|
151
|
-
[[ "$(surface_layer "$n")" == "$layer" ]] || continue
|
|
152
|
-
decl+=" ${NODE_ID[$n]}[\"$n\"]"$'\n'
|
|
153
|
-
done
|
|
154
|
-
[[ -n "$decl" ]] || continue
|
|
155
|
-
printf ' subgraph %s["%s"]\n' "$layer" "$label"
|
|
156
|
-
printf '%s' "$decl"
|
|
157
|
-
printf ' end\n'
|
|
158
|
-
done < <(layer_specs)
|
|
159
|
-
[[ ${#edge_lines[@]} -gt 0 ]] && printf '%s\n' "${edge_lines[@]}"
|
|
160
|
-
if [[ ${#proposed_idx[@]} -gt 0 ]]; then
|
|
161
|
-
joined="$(IFS=,; echo "${proposed_idx[*]}")"
|
|
162
|
-
printf ' linkStyle %s stroke:#d97706,stroke-width:2px;\n' "$joined"
|
|
163
|
-
fi
|
|
164
|
-
)"
|
|
165
|
-
|
|
166
|
-
printf '%s\n' '<!DOCTYPE html>'
|
|
167
|
-
cat <<'COMMENT_HEAD'
|
|
168
|
-
<!--
|
|
169
|
-
The check-coupling graph: which content surfaces each gates.list gate binds
|
|
170
|
-
together.
|
|
171
|
-
|
|
172
|
-
GENERATED, DO NOT EDIT. Source of truth is the per-gate `# graph:` manifests;
|
|
173
|
-
COMMENT_HEAD
|
|
174
|
-
printf ' regenerate with: bash gate-sdk/checks/check-graph.sh --emit > %s\n' "$resolved_artifact"
|
|
175
|
-
cat <<'HEAD'
|
|
176
|
-
check-graph (assertion E) fails if this file drifts from them.
|
|
177
|
-
|
|
178
|
-
Reading it: nodes are surfaces (grouped by layer when the consumer's
|
|
179
|
-
graph-vocab.sh declares layers); an edge is a gate. A bidirectional edge is a
|
|
180
|
-
coupling bijection; a self-loop is a gate that guards one surface's internal
|
|
181
|
-
consistency. Amber edges are cycle valves (valve=PROPOSED) - couplings where a
|
|
182
|
-
leading surface may run ahead via a queue-tracked PROPOSED marker.
|
|
183
|
-
|
|
184
|
-
Comment hygiene: arrows are named, never drawn, in this comment - an HTML
|
|
185
|
-
comment-close sequence inside it would end the block and leak the rest.
|
|
186
|
-
-->
|
|
187
|
-
<html lang="en">
|
|
188
|
-
<head>
|
|
189
|
-
<meta charset="utf-8" />
|
|
190
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
191
|
-
<title>Check-coupling graph</title>
|
|
192
|
-
<style>
|
|
193
|
-
HEAD
|
|
194
|
-
emit_theme_css
|
|
195
|
-
cat <<'HEAD_CHROME'
|
|
196
|
-
</style>
|
|
197
|
-
</head>
|
|
198
|
-
<body>
|
|
199
|
-
HEAD_CHROME
|
|
200
|
-
emit_theme_header
|
|
201
|
-
cat <<'HEAD'
|
|
202
|
-
<header>
|
|
203
|
-
<h1>Check-coupling graph</h1>
|
|
204
|
-
<p>Which content surfaces each <code>gates.list</code> gate binds together.
|
|
205
|
-
Source of truth is the per-gate <code>graph:</code> manifests; this is
|
|
206
|
-
their projection, regenerated by
|
|
207
|
-
<code>bash gate-sdk/checks/check-graph.sh --emit</code> and drift-checked
|
|
208
|
-
by assertion E.</p>
|
|
209
|
-
<p>Nodes are surfaces; an edge is a gate. A bidirectional edge is a coupling
|
|
210
|
-
bijection; a self-loop guards one surface. Amber edges are cycle valves
|
|
211
|
-
(<code>valve=PROPOSED</code>) - where a leading surface may run ahead via
|
|
212
|
-
a queue-tracked marker.</p>
|
|
213
|
-
<span class="status">Generated from the gate manifests - do not hand-edit.</span>
|
|
214
|
-
</header>
|
|
215
|
-
|
|
216
|
-
<main>
|
|
217
|
-
<div class="legend">
|
|
218
|
-
<span><span class="valve"></span> cycle valve (valve=PROPOSED)</span>
|
|
219
|
-
</div>
|
|
220
|
-
<div class="mermaid viewport" id="diagram"></div>
|
|
221
|
-
<p class="hint">Ctrl/⌘ + scroll to zoom · drag to pan · double-click to reset.</p>
|
|
222
|
-
</main>
|
|
223
|
-
|
|
224
|
-
<script type="module">
|
|
225
|
-
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
|
|
226
|
-
const dark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
227
|
-
const graph = `%%{init:{'theme':'${dark ? 'dark' : 'base'}','themeVariables':{'fontSize':'13px'}}}%%
|
|
228
|
-
HEAD
|
|
229
|
-
printf '%s\n' "$graph_text"
|
|
230
|
-
printf '`;\n mermaid.initialize({ startOnLoad: false, maxEdges: %s });\n' "$MAX_EDGES"
|
|
231
|
-
cat <<'TAIL'
|
|
232
|
-
const { svg } = await mermaid.render('graph', graph);
|
|
233
|
-
const vp = document.getElementById('diagram');
|
|
234
|
-
vp.innerHTML = svg;
|
|
235
|
-
|
|
236
|
-
// Pan/zoom (self-contained; no external lib) — the platform diagram-assets
|
|
237
|
-
// approach: render the SVG at its natural, readable size in an overflow:auto
|
|
238
|
-
// box; Ctrl/Cmd+wheel scales the SVG, drag pans via native scroll, and
|
|
239
|
-
// double-click resets the zoom. Never shrink-to-fit — that makes a dense
|
|
240
|
-
// graph unreadable.
|
|
241
|
-
const el = vp.querySelector('svg');
|
|
242
|
-
el.style.transformOrigin = '0 0';
|
|
243
|
-
let zoom = 1;
|
|
244
|
-
const applyZoom = () => { el.style.transform = 'scale(' + zoom + ')'; };
|
|
245
|
-
|
|
246
|
-
vp.addEventListener('wheel', (e) => {
|
|
247
|
-
if (!(e.ctrlKey || e.metaKey)) return;
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
zoom = Math.min(6, Math.max(0.4, zoom * (e.deltaY < 0 ? 1.1 : 1 / 1.1)));
|
|
250
|
-
applyZoom();
|
|
251
|
-
}, { passive: false });
|
|
252
|
-
|
|
253
|
-
let down = false, lx = 0, ly = 0;
|
|
254
|
-
vp.addEventListener('pointerdown', (e) => {
|
|
255
|
-
down = true; lx = e.clientX; ly = e.clientY;
|
|
256
|
-
vp.classList.add('grabbing'); vp.setPointerCapture(e.pointerId);
|
|
257
|
-
});
|
|
258
|
-
vp.addEventListener('pointermove', (e) => {
|
|
259
|
-
if (!down) return;
|
|
260
|
-
vp.scrollLeft -= e.clientX - lx; vp.scrollTop -= e.clientY - ly;
|
|
261
|
-
lx = e.clientX; ly = e.clientY;
|
|
262
|
-
});
|
|
263
|
-
const end = () => { down = false; vp.classList.remove('grabbing'); };
|
|
264
|
-
vp.addEventListener('pointerup', end);
|
|
265
|
-
vp.addEventListener('pointercancel', end);
|
|
266
|
-
vp.addEventListener('dblclick', () => { zoom = 1; applyZoom(); });
|
|
267
|
-
</script>
|
|
268
|
-
TAIL
|
|
269
|
-
emit_theme_footer
|
|
270
|
-
cat <<'TAILEND'
|
|
271
|
-
</body>
|
|
272
|
-
</html>
|
|
273
|
-
TAILEND
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
# spec: gate-sdk/SPEC.md §check-graph — the external-ref allowlist: the pinned-major
|
|
277
|
-
# mermaid ESM import emit_graph itself emits (kit-seeded, always allowed) plus the
|
|
278
|
-
# consumer-sanctioned GATE_SDK_GRAPH_EXTERNAL_REFS prefixes (graph-vocab seam)
|
|
279
|
-
GRAPH_MERMAID_SEED="https://cdn.jsdelivr.net/npm/mermaid@11"
|
|
280
|
-
read -ra GRAPH_EXTERNAL_REFS <<<"${GATE_SDK_GRAPH_EXTERNAL_REFS:-}"
|
|
281
|
-
ext_ref_allowed() {
|
|
282
|
-
local ref="$1" p
|
|
283
|
-
[[ "$ref" == "$GRAPH_MERMAID_SEED"* ]] && return 0
|
|
284
|
-
for p in "${GRAPH_EXTERNAL_REFS[@]+"${GRAPH_EXTERNAL_REFS[@]}"}"; do
|
|
285
|
-
[[ -n "$p" && "$ref" == "$p"* ]] && return 0
|
|
286
|
-
done
|
|
287
|
-
return 1
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
# spec: gate-sdk/SPEC.md §check-graph — echo each disallowed external reference in the emitted HTML: an absolute href/src value or ESM import specifier matching no allowed prefix
|
|
291
|
-
disallowed_external_refs() {
|
|
292
|
-
local emitted="$1" ref
|
|
293
|
-
while IFS= read -r ref; do
|
|
294
|
-
[[ -n "$ref" ]] || continue
|
|
295
|
-
ext_ref_allowed "$ref" || printf '%s\n' "$ref"
|
|
296
|
-
done < <(
|
|
297
|
-
{
|
|
298
|
-
grep -oE '(href|src)="[^"]+"' <<<"$emitted" | sed -E 's/^(href|src)="//; s/"$//' | grep '://'
|
|
299
|
-
grep -oE "import[[:space:]][^;]*from[[:space:]]*'[^']+'|import[[:space:]]*'[^']+'" <<<"$emitted" \
|
|
300
|
-
| grep -oE "'[^']+'" | tr -d "'"
|
|
301
|
-
} | sort -u
|
|
302
|
-
)
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
# spec: gate-sdk/SPEC.md §check-graph — count the emitted mermaid edges (an arrow bearing a gate label)
|
|
306
|
-
graph_edge_count() { grep -cE '(<-->|-->)\|"' <<<"$1"; }
|
|
307
|
-
|
|
308
|
-
# spec: gate-sdk/SPEC.md §check-graph — the render cap the emitted page declares, or Mermaid's built-in default when the init call names none
|
|
309
|
-
graph_render_cap() {
|
|
310
|
-
local cap; cap="$(grep -oE 'maxEdges:[[:space:]]*[0-9]+' <<<"$1" | grep -oE '[0-9]+' | head -1)"
|
|
311
|
-
printf '%s\n' "${cap:-500}"
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
# spec: gate-sdk/SPEC.md §check-graph (assertion G) — validate `# graph:` manifests in SPEC-*.md amendment bodies
|
|
315
|
-
valid_glob_token() {
|
|
316
|
-
local t="$1"
|
|
317
|
-
[[ -n "$t" ]] || return 1
|
|
318
|
-
t="${t#kit:}" # the kit:<glob> couples form validates on its glob part
|
|
319
|
-
[[ "$t" =~ ^[A-Za-z0-9._*?/-]+$ ]]
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
extract_amend_manifests() {
|
|
323
|
-
awk '
|
|
324
|
-
function emit_inline(line, s, span) {
|
|
325
|
-
s = line
|
|
326
|
-
while (match(s, /`# graph: [^`]+`/)) {
|
|
327
|
-
span = substr(s, RSTART, RLENGTH)
|
|
328
|
-
sub(/^`# graph: /, "", span); sub(/`$/, "", span)
|
|
329
|
-
print FILENAME "\t" span
|
|
330
|
-
s = substr(s, RSTART + RLENGTH)
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
FNR == 1 { infence = 0; flang = "" }
|
|
334
|
-
/^[[:space:]]*```/ {
|
|
335
|
-
if (infence) { infence = 0; flang = ""; next }
|
|
336
|
-
infence = 1; flang = $0
|
|
337
|
-
sub(/^[[:space:]]*`+/, "", flang); sub(/[^A-Za-z0-9_-].*$/, "", flang)
|
|
338
|
-
next
|
|
339
|
-
}
|
|
340
|
-
{
|
|
341
|
-
if (infence) {
|
|
342
|
-
if (flang == "proto") next
|
|
343
|
-
if ($0 ~ /^# graph: /) { span = $0; sub(/^# graph: /, "", span); print FILENAME "\t" span }
|
|
344
|
-
next
|
|
345
|
-
}
|
|
346
|
-
emit_inline($0)
|
|
347
|
-
}
|
|
348
|
-
' "$@"
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
validate_amend_manifest() {
|
|
352
|
-
local file="$1" span="$2" tok
|
|
353
|
-
[[ "$span" =~ (^|[[:space:]])(couples|dir|valve|tier|mode|trigger|gen)= ]] || return 0
|
|
354
|
-
local couples="" dir="" valve="" tier="" mode="" trigger="" gen=""
|
|
355
|
-
local have_couples=0 have_dir=0 have_valve=0 have_tier=0
|
|
356
|
-
local -a unknown=()
|
|
357
|
-
for tok in $span; do
|
|
358
|
-
case "$tok" in
|
|
359
|
-
couples=*) couples="${tok#couples=}"; have_couples=1 ;;
|
|
360
|
-
dir=*) dir="${tok#dir=}"; have_dir=1 ;;
|
|
361
|
-
valve=*) valve="${tok#valve=}"; have_valve=1 ;;
|
|
362
|
-
tier=*) tier="${tok#tier=}"; have_tier=1 ;;
|
|
363
|
-
mode=*) mode="${tok#mode=}" ;;
|
|
364
|
-
trigger=*) trigger="${tok#trigger=}" ;;
|
|
365
|
-
gen=*) gen="${tok#gen=}" ;;
|
|
366
|
-
*) unknown+=("$tok") ;;
|
|
367
|
-
esac
|
|
368
|
-
done
|
|
369
|
-
local where="AMEND-MANIFEST: $file"
|
|
370
|
-
(( have_couples )) || g_errors+=("$where: missing required key 'couples='")
|
|
371
|
-
(( have_dir )) || g_errors+=("$where: missing required key 'dir='")
|
|
372
|
-
(( have_valve )) || g_errors+=("$where: missing required key 'valve='")
|
|
373
|
-
(( have_tier )) || g_errors+=("$where: missing required key 'tier='")
|
|
374
|
-
local u
|
|
375
|
-
for u in "${unknown[@]+"${unknown[@]}"}"; do
|
|
376
|
-
g_errors+=("$where: unknown manifest key/token '$u'")
|
|
377
|
-
done
|
|
378
|
-
if (( have_dir )) && [[ "$dir" != bi && "$dir" != one ]]; then
|
|
379
|
-
g_errors+=("$where: dir= must be bi|one (got '$dir')")
|
|
380
|
-
fi
|
|
381
|
-
if (( have_valve )) && [[ "$valve" != none && "$valve" != PROPOSED ]]; then
|
|
382
|
-
g_errors+=("$where: valve= must be none|PROPOSED (got '$valve')")
|
|
383
|
-
fi
|
|
384
|
-
if (( have_tier )) && [[ "$tier" != precommit && "$tier" != align-only && "$tier" != commit-msg ]]; then
|
|
385
|
-
g_errors+=("$where: tier= must be precommit|align-only|commit-msg (got '$tier')")
|
|
386
|
-
fi
|
|
387
|
-
if [[ -n "$mode" && "$mode" != staged && "$mode" != whole-tree ]]; then
|
|
388
|
-
g_errors+=("$where: mode= must be staged|whole-tree (got '$mode')")
|
|
389
|
-
fi
|
|
390
|
-
if [[ -n "$gen" && "$gen" != manual ]]; then
|
|
391
|
-
g_errors+=("$where: gen= must be manual (got '$gen')")
|
|
392
|
-
fi
|
|
393
|
-
if (( have_couples )) && [[ -z "$couples" ]]; then
|
|
394
|
-
g_errors+=("$where: couples= is empty")
|
|
395
|
-
fi
|
|
396
|
-
local s
|
|
397
|
-
local -a parts
|
|
398
|
-
if [[ -n "$couples" ]]; then
|
|
399
|
-
IFS=',' read -ra parts <<<"$couples"
|
|
400
|
-
for s in "${parts[@]}"; do
|
|
401
|
-
valid_glob_token "$s" || g_errors+=("$where: couples token '$s' is not a syntactically valid glob/path")
|
|
402
|
-
done
|
|
403
|
-
fi
|
|
404
|
-
if [[ -n "$trigger" ]]; then
|
|
405
|
-
IFS=',' read -ra parts <<<"$trigger"
|
|
406
|
-
for s in "${parts[@]}"; do
|
|
407
|
-
[[ "$s" == '*' ]] && continue
|
|
408
|
-
valid_glob_token "$s" || g_errors+=("$where: trigger token '$s' is not a syntactically valid glob/path")
|
|
409
|
-
done
|
|
410
|
-
fi
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
amendment_findings() {
|
|
414
|
-
local root="$1" file span
|
|
415
|
-
local -a files
|
|
416
|
-
mapfile -t files < <(find "$root" -name 'SPEC-*.md' -not -path '*/target/*' -not -path '*/.git/*' -not -path '*/gate-tests/*' 2>/dev/null | sort)
|
|
417
|
-
[[ ${#files[@]} -gt 0 ]] || return 0
|
|
418
|
-
while IFS=$'\t' read -r file span; do
|
|
419
|
-
[[ -n "$span" ]] || continue
|
|
420
|
-
validate_amend_manifest "$file" "$span"
|
|
421
|
-
done < <(extract_amend_manifests "${files[@]}")
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if [[ "${1:-}" == "--amend-only" ]]; then
|
|
425
|
-
g_errors=()
|
|
426
|
-
amendment_findings "${2:-.}"
|
|
427
|
-
if [[ ${#g_errors[@]} -gt 0 ]]; then
|
|
428
|
-
echo "CHECK-GRAPH: ${#g_errors[@]} amendment-manifest violation(s):"
|
|
429
|
-
printf ' %s\n' "${g_errors[@]}"
|
|
430
|
-
echo " help: fix the malformed '# graph:' manifest in the SPEC-*.md amendment body (required keys couples/dir/valve/tier; dir=bi|one valve=none|PROPOSED tier=precommit|align-only; couples tokens must be syntactically valid globs)"
|
|
431
|
-
exit 1
|
|
432
|
-
fi
|
|
433
|
-
echo "CHECK-GRAPH: clean (amendment-body '# graph:' manifests well-formed)"
|
|
434
|
-
exit 0
|
|
435
|
-
fi
|
|
436
|
-
|
|
437
|
-
if [[ "${1:-}" == "--refs-only" ]]; then
|
|
438
|
-
ref_errors=()
|
|
439
|
-
emitted="$(emit_graph)"
|
|
440
|
-
while IFS= read -r ref; do
|
|
441
|
-
ref_errors+=("EXTERNAL-REF: emitted artifact references '$ref', neither the seeded mermaid import nor a GATE_SDK_GRAPH_EXTERNAL_REFS prefix; add its prefix to the knob or drop the reference")
|
|
442
|
-
done < <(disallowed_external_refs "$emitted")
|
|
443
|
-
if [[ ${#ref_errors[@]} -gt 0 ]]; then
|
|
444
|
-
echo "CHECK-GRAPH: ${#ref_errors[@]} external-ref violation(s):"
|
|
445
|
-
printf ' %s\n' "${ref_errors[@]}"
|
|
446
|
-
echo " help: an emitted external reference must prefix-match the seeded mermaid import or a GATE_SDK_GRAPH_EXTERNAL_REFS prefix"
|
|
447
|
-
exit 1
|
|
448
|
-
fi
|
|
449
|
-
echo "CHECK-GRAPH: clean (emitted external refs allowlisted)"
|
|
450
|
-
exit 0
|
|
451
|
-
fi
|
|
452
|
-
|
|
453
|
-
if [[ "${1:-}" == "--cap-only" ]]; then
|
|
454
|
-
emitted="$(emit_graph)"; edge_n="$(graph_edge_count "$emitted")"; cap="$(graph_render_cap "$emitted")"
|
|
455
|
-
if [[ "$edge_n" -gt "$cap" ]]; then
|
|
456
|
-
echo "CHECK-GRAPH: 1 render-cap violation(s):"
|
|
457
|
-
echo " RENDER-CAP: emitted graph has $edge_n edges but the page declares maxEdges=$cap; Mermaid refuses a flowchart with more edges than the cap and paints an error graphic — raise GATE_SDK_GRAPH_MAX_EDGES above $edge_n"
|
|
458
|
-
exit 1
|
|
459
|
-
fi
|
|
460
|
-
echo "CHECK-GRAPH: clean (emitted graph within the render cap: $edge_n edges <= maxEdges=$cap)"
|
|
461
|
-
exit 0
|
|
462
|
-
fi
|
|
463
|
-
|
|
464
|
-
[[ -f "$LIST" ]] || { echo "check-graph: no registry at $LIST" >&2; exit 2; }
|
|
465
|
-
|
|
466
|
-
[[ "${1:-}" == "--emit" ]] && { emit_graph; exit 0; }
|
|
467
|
-
|
|
468
|
-
in_vocab() {
|
|
469
|
-
[[ ${#GRAPH_VOCAB[@]} -eq 0 ]] && return 0
|
|
470
|
-
local t="$1" v
|
|
471
|
-
for v in "${GRAPH_VOCAB[@]}"; do [[ "$t" == "$v" ]] && return 0; done
|
|
472
|
-
return 1
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
covered_by() {
|
|
476
|
-
local s="$1"; shift
|
|
477
|
-
local t
|
|
478
|
-
for t in "$@"; do
|
|
479
|
-
[[ "$t" == "*" ]] && return 0
|
|
480
|
-
[[ "$t" == "$s" ]] && return 0
|
|
481
|
-
# shellcheck disable=SC2053 # $t is deliberately unquoted: it is the glob
|
|
482
|
-
[[ "$s" != *[\*\?]* && "$s" == $t ]] && return 0
|
|
483
|
-
[[ "$t" == \*.* && "$s" == *"${t#\*}" ]] && return 0
|
|
484
|
-
done
|
|
485
|
-
return 1
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
mapfile -t CHECKS < <(gates_list_members "$LIST")
|
|
489
|
-
[[ ${#CHECKS[@]} -gt 0 ]] || { echo "check-graph: no members parsed from $LIST" >&2; exit 2; }
|
|
490
|
-
|
|
491
|
-
[[ -f "$GEN" ]] || { echo "check-graph: gen-pre-commit.sh not found at $GEN" >&2; exit 2; }
|
|
492
|
-
|
|
493
|
-
# assertion A: every gates.list member has a well-formed `# graph:` line
|
|
494
|
-
errors=()
|
|
495
|
-
has_msg_gate=0
|
|
496
|
-
|
|
497
|
-
for c in "${CHECKS[@]}"; do
|
|
498
|
-
if ! script="$(resolve_member "$c")"; then
|
|
499
|
-
errors+=("MANIFEST: $c is in gates.list but resolves in none of: ${RESOLVE_DIRS[*]}")
|
|
500
|
-
continue
|
|
501
|
-
fi
|
|
502
|
-
man="$(grep -m1 '^# graph: ' "$script" || true)"
|
|
503
|
-
if [[ -z "$man" ]]; then
|
|
504
|
-
errors+=("MANIFEST: $script has no '# graph:' manifest line")
|
|
505
|
-
continue
|
|
506
|
-
fi
|
|
507
|
-
couples=""; dir=""; valve=""; tier=""; mode=""; trigger=""; gen=""
|
|
508
|
-
for kv in ${man#\# graph: }; do
|
|
509
|
-
case "$kv" in
|
|
510
|
-
couples=*) couples="${kv#couples=}" ;;
|
|
511
|
-
dir=*) dir="${kv#dir=}" ;;
|
|
512
|
-
valve=*) valve="${kv#valve=}" ;;
|
|
513
|
-
tier=*) tier="${kv#tier=}" ;;
|
|
514
|
-
mode=*) mode="${kv#mode=}" ;;
|
|
515
|
-
trigger=*) trigger="${kv#trigger=}" ;;
|
|
516
|
-
gen=*) gen="${kv#gen=}" ;;
|
|
517
|
-
*) errors+=("MANIFEST: $script unknown manifest key '$kv'") ;;
|
|
518
|
-
esac
|
|
519
|
-
done
|
|
520
|
-
gate_expand_couples_var couples "$couples"
|
|
521
|
-
[[ -n "$trigger" ]] && gate_expand_couples_var trigger "$trigger"
|
|
522
|
-
[[ "$dir" == bi || "$dir" == one ]] || errors+=("MANIFEST: $script dir= must be bi|one (got '$dir')")
|
|
523
|
-
[[ "$valve" == none || "$valve" == PROPOSED ]] || errors+=("MANIFEST: $script valve= must be none|PROPOSED (got '$valve')")
|
|
524
|
-
[[ "$tier" == precommit || "$tier" == align-only || "$tier" == commit-msg ]] || errors+=("MANIFEST: $script tier= must be precommit|align-only|commit-msg (got '$tier')")
|
|
525
|
-
[[ "$tier" == commit-msg ]] && has_msg_gate=1
|
|
526
|
-
[[ -z "$mode" || "$mode" == staged || "$mode" == whole-tree ]] || errors+=("MANIFEST: $script mode= must be staged|whole-tree (got '$mode')")
|
|
527
|
-
[[ -z "$gen" || "$gen" == manual ]] || errors+=("MANIFEST: $script gen= must be manual (got '$gen')")
|
|
528
|
-
[[ -n "$couples" ]] || { errors+=("MANIFEST: $script couples= is empty"); continue; }
|
|
529
|
-
|
|
530
|
-
IFS=',' read -ra surf <<<"$couples"
|
|
531
|
-
for s in "${surf[@]}"; do
|
|
532
|
-
in_vocab "$s" || errors+=("MANIFEST: $script couples surface '$s' not in the declared GRAPH_VOCAB")
|
|
533
|
-
done
|
|
534
|
-
|
|
535
|
-
# assertion B: couples⊆trigger parity
|
|
536
|
-
trig_set="${trigger:-$couples}"
|
|
537
|
-
IFS=',' read -ra trigsurf <<<"$trig_set"
|
|
538
|
-
for s in "${trigsurf[@]}"; do
|
|
539
|
-
[[ "$s" == '*' ]] && continue
|
|
540
|
-
in_vocab "$s" || errors+=("MANIFEST: $script trigger surface '$s' not in the declared GRAPH_VOCAB")
|
|
541
|
-
done
|
|
542
|
-
for s in "${surf[@]}"; do
|
|
543
|
-
covered_by "$s" "${trigsurf[@]}" || \
|
|
544
|
-
errors+=("PARITY: $c couples '$s' but its trigger ($trig_set) would not fire on it")
|
|
545
|
-
done
|
|
546
|
-
|
|
547
|
-
# assertion C: dir=bi cycle valve rule (PROPOSED vs none)
|
|
548
|
-
if [[ "$dir" == bi ]]; then
|
|
549
|
-
has_leading=0; has_lagging=0
|
|
550
|
-
for s in "${surf[@]}"; do
|
|
551
|
-
[[ ${#GRAPH_LEADING[@]} -gt 0 ]] && in_set "$s" "${GRAPH_LEADING[@]}" && has_leading=1
|
|
552
|
-
[[ ${#GRAPH_LAGGING[@]} -gt 0 ]] && in_set "$s" "${GRAPH_LAGGING[@]}" && has_lagging=1
|
|
553
|
-
done
|
|
554
|
-
if [[ "$has_leading" -eq 1 && "$has_lagging" -eq 1 ]]; then
|
|
555
|
-
[[ "$valve" == PROPOSED ]] || errors+=("CYCLE-VALVE: $c is a design<->code bi cycle (couples a leading AND a lagging surface) but valve=$valve; it must be valve=PROPOSED so the leading surface can run ahead via a queue-tracked marker")
|
|
556
|
-
elif [[ "$has_leading" -eq 1 ]]; then
|
|
557
|
-
[[ "$valve" == none || "$valve" == PROPOSED ]] || errors+=("CYCLE-VALVE: $c couples a leading design surface (dir=bi) with no lagging surface, so valve= must be none|PROPOSED (got '$valve')")
|
|
558
|
-
else
|
|
559
|
-
[[ "$valve" == none ]] || errors+=("CYCLE-VALVE: $c is a dir=bi bijection with no leading design surface but valve=$valve; it must agree now, so valve=none")
|
|
560
|
-
fi
|
|
561
|
-
fi
|
|
562
|
-
done
|
|
563
|
-
|
|
564
|
-
# assertion D: hook artifact freshness (pre-commit == --emit)
|
|
565
|
-
hook_emitted="$(bash "$GEN" --emit 2>/dev/null)"; gen_st=$?
|
|
566
|
-
if [[ ! -f "$HOOK" ]]; then
|
|
567
|
-
errors+=("ARTIFACT: $HOOK does not exist; regenerate: bash gate-sdk/bin/gen-pre-commit.sh --write")
|
|
568
|
-
elif [[ "$gen_st" -ne 0 ]]; then
|
|
569
|
-
errors+=("ARTIFACT: gen-pre-commit.sh --emit failed (exit $gen_st); fix the generator before trusting the hook")
|
|
570
|
-
elif [[ "$hook_emitted" != "$(cat "$HOOK")" ]]; then
|
|
571
|
-
errors+=("ARTIFACT: $HOOK is stale vs the '# graph:' manifests; regenerate: bash gate-sdk/bin/gen-pre-commit.sh --write")
|
|
572
|
-
fi
|
|
573
|
-
|
|
574
|
-
# assertion D (commit-msg surface): when any gate is tier=commit-msg, the
|
|
575
|
-
# committed commit-msg hook equals gen-pre-commit.sh --emit-commit-msg
|
|
576
|
-
MSG_HOOK="${GATE_SDK_HOOKS_DIR:-$GATES_DIR/git-hooks}/commit-msg"
|
|
577
|
-
if [[ "$has_msg_gate" -eq 1 ]]; then
|
|
578
|
-
msg_emitted="$(bash "$GEN" --emit-commit-msg 2>/dev/null)"; msg_st=$?
|
|
579
|
-
if [[ ! -f "$MSG_HOOK" ]]; then
|
|
580
|
-
errors+=("ARTIFACT: $MSG_HOOK does not exist but a tier=commit-msg gate is registered; regenerate: bash gate-sdk/bin/gen-pre-commit.sh --write")
|
|
581
|
-
elif [[ "$msg_st" -ne 0 ]]; then
|
|
582
|
-
errors+=("ARTIFACT: gen-pre-commit.sh --emit-commit-msg failed (exit $msg_st); fix the generator before trusting the hook")
|
|
583
|
-
elif [[ "$msg_emitted" != "$(cat "$MSG_HOOK")" ]]; then
|
|
584
|
-
errors+=("ARTIFACT: $MSG_HOOK is stale vs the '# graph:' manifests; regenerate: bash gate-sdk/bin/gen-pre-commit.sh --write")
|
|
585
|
-
fi
|
|
586
|
-
fi
|
|
587
|
-
|
|
588
|
-
# assertion E: the coupling-graph artifact matches --emit; its path is the
|
|
589
|
-
# GATE_SDK_GRAPH_ARTIFACT knob (gates-dir default), so a consumer that
|
|
590
|
-
# republishes the artifact elsewhere gets its own path in every remedy line
|
|
591
|
-
ARTIFACT="${GATE_SDK_GRAPH_ARTIFACT:-$GATES_DIR/CHECK-GRAPH.html}"
|
|
592
|
-
ARTIFACT_DIR="$(dirname "$ARTIFACT")"
|
|
593
|
-
emitted="$(emit_graph)"
|
|
594
|
-
if [[ ! -f "$ARTIFACT" ]]; then
|
|
595
|
-
errors+=("ARTIFACT: $ARTIFACT does not exist; regenerate: bash gate-sdk/checks/check-graph.sh --emit > $ARTIFACT")
|
|
596
|
-
elif [[ "$emitted" != "$(cat "$ARTIFACT")" ]]; then
|
|
597
|
-
errors+=("ARTIFACT: $ARTIFACT is stale vs the '# graph:' manifests; regenerate: bash gate-sdk/checks/check-graph.sh --emit > $ARTIFACT")
|
|
598
|
-
fi
|
|
599
|
-
|
|
600
|
-
# assertion F: every emitted asset href resolves under the artifact dir
|
|
601
|
-
while IFS= read -r href; do
|
|
602
|
-
[[ -n "$href" ]] || continue
|
|
603
|
-
[[ -f "$ARTIFACT_DIR/$href" ]] || \
|
|
604
|
-
errors+=("ASSET-HREF: emitted asset '$href' does not resolve to a file under $ARTIFACT_DIR/ (artifact-relative); fix the href in emit_graph")
|
|
605
|
-
done < <(grep -oE '(href|src)="[^"]+"' <<<"$emitted" | sed -E 's/^(href|src)="//; s/"$//' | grep -v '://')
|
|
606
|
-
|
|
607
|
-
# assertion H: every emitted external reference prefix-matches the seeded
|
|
608
|
-
# mermaid import or a GATE_SDK_GRAPH_EXTERNAL_REFS prefix (§check-graph)
|
|
609
|
-
while IFS= read -r ref; do
|
|
610
|
-
errors+=("EXTERNAL-REF: emitted artifact references '$ref', neither the seeded mermaid import nor a GATE_SDK_GRAPH_EXTERNAL_REFS prefix; add its prefix to the knob or drop the reference")
|
|
611
|
-
done < <(disallowed_external_refs "$emitted")
|
|
612
|
-
|
|
613
|
-
# assertion I: the emitted edge count fits the render cap the page declares —
|
|
614
|
-
# Mermaid paints an error graphic past maxEdges, invisible to the byte-compare
|
|
615
|
-
# freshness check (§check-graph)
|
|
616
|
-
edge_n="$(graph_edge_count "$emitted")"; cap="$(graph_render_cap "$emitted")"
|
|
617
|
-
[[ "$edge_n" -gt "$cap" ]] && \
|
|
618
|
-
errors+=("RENDER-CAP: emitted graph has $edge_n edges but the page declares maxEdges=$cap; Mermaid would paint an error graphic instead of the diagram — raise GATE_SDK_GRAPH_MAX_EDGES above $edge_n")
|
|
619
|
-
|
|
620
|
-
# assertion G: every `# graph:` manifest in a SPEC-*.md amendment body is well-formed
|
|
621
|
-
g_errors=()
|
|
622
|
-
amendment_findings "."
|
|
623
|
-
[[ ${#g_errors[@]} -gt 0 ]] && errors+=("${g_errors[@]}")
|
|
624
|
-
|
|
625
|
-
if [[ ${#errors[@]} -gt 0 ]]; then
|
|
626
|
-
echo "CHECK-GRAPH: ${#errors[@]} violation(s):"
|
|
627
|
-
printf ' %s\n' "${errors[@]}"
|
|
628
|
-
echo " help: fix the '# graph:' manifest / gates.list-membership / hook-trigger mismatch (or the malformed amendment-body manifest), then regenerate the hook and graph artifacts"
|
|
629
|
-
exit 1
|
|
630
|
-
fi
|
|
631
|
-
echo "CHECK-GRAPH: clean (${#CHECKS[@]} gates; manifests well-formed, couples<->trigger parity, cycle valves, the generated pre-commit hook + CHECK-GRAPH.html artifacts fresh, emitted asset hrefs resolve, external refs allowlisted, edge count within the render cap, and amendment-body manifests valid)"
|
|
632
|
-
exit 0
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=scripts/git-hooks/* dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: gate-sdk/SPEC.md §check-hook-exec-bit — every tracked file in the hooks dir carries index mode 100755, or a fresh clone silently skips a non-executable hook
|
|
5
|
-
#
|
|
6
|
-
# usage: check-hook-exec-bit.sh [hooks-dir]
|
|
7
|
-
# Defaults to GATE_SDK_HOOKS_DIR (<gates-dir>/git-hooks). Reads the git
|
|
8
|
-
# *index* mode — the mode a fresh clone receives — not the worktree bit.
|
|
9
|
-
set -uo pipefail
|
|
10
|
-
|
|
11
|
-
SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
12
|
-
# shellcheck source=../lib/gate.sh
|
|
13
|
-
source "$SDK/lib/gate.sh"
|
|
14
|
-
|
|
15
|
-
DIR="${1:-${GATE_SDK_HOOKS_DIR:-$(gate_sdk_gates_dir)/git-hooks}}"
|
|
16
|
-
|
|
17
|
-
git rev-parse --git-dir >/dev/null 2>&1 || {
|
|
18
|
-
echo "check-hook-exec-bit: not a git repository — cannot read index modes" >&2; exit 2; }
|
|
19
|
-
|
|
20
|
-
if [[ ! -d "$DIR" ]]; then
|
|
21
|
-
echo "HOOK-EXEC-BIT: clean (no hooks dir at $DIR — nothing committed to skip)"
|
|
22
|
-
exit 0
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
listing="$(git ls-files -s -- "$DIR")"; st=$?
|
|
26
|
-
fail_closed "$st" HOOK-EXEC-BIT git-ls-files
|
|
27
|
-
|
|
28
|
-
bad=(); count=0
|
|
29
|
-
while IFS= read -r line; do
|
|
30
|
-
[[ -n "$line" ]] || continue
|
|
31
|
-
count=$((count + 1))
|
|
32
|
-
mode="${line%% *}"
|
|
33
|
-
path="${line#*$'\t'}"
|
|
34
|
-
[[ "$mode" == 100755 ]] || bad+=("$path (index mode $mode)")
|
|
35
|
-
done <<< "$listing"
|
|
36
|
-
|
|
37
|
-
if [[ ${#bad[@]} -gt 0 ]]; then
|
|
38
|
-
echo "check-hook-exec-bit: hook file(s) not committed executable (mode 100755) — git"
|
|
39
|
-
echo "silently skips a non-executable hook, disabling the gate battery for a fresh clone:"
|
|
40
|
-
printf ' %s\n' "${bad[@]}"
|
|
41
|
-
echo " help: git update-index --chmod=+x <path> (and chmod +x locally), then recommit."
|
|
42
|
-
exit 1
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
echo "HOOK-EXEC-BIT: clean ($count tracked hook file(s) in $DIR at index mode 100755)"
|
|
46
|
-
exit 0
|