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,117 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=TASK-QUEUE.md,SPEC-*.md,*/SPEC-*.md dir=bi valve=none tier=precommit
|
|
3
|
-
# install: zero-config
|
|
4
|
-
# spec: canon-kit/SPEC.md §check-amendment-queue — the Task↔amendment bidirectional rule and spec-readiness
|
|
5
|
-
#
|
|
6
|
-
# usage: check-amendment-queue.sh [queue-file [scan-root]]
|
|
7
|
-
# Defaults to the configured queue file (CANON_KIT_QUEUE_FILE) and '.' for the
|
|
8
|
-
# amendment-on-disk scan (a fixture case dir carries its own copies).
|
|
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/spec.sh
|
|
16
|
-
source "$KIT/lib/spec.sh"
|
|
17
|
-
|
|
18
|
-
QUEUE="${1:-$CANON_KIT_QUEUE_FILE}"
|
|
19
|
-
ROOT="${2:-.}"
|
|
20
|
-
[[ -f "$QUEUE" ]] || { echo "check-amendment-queue: file not found: $QUEUE" >&2; exit 2; }
|
|
21
|
-
|
|
22
|
-
errors=""
|
|
23
|
-
|
|
24
|
-
# (a) feature-section entries missing [spec:], any [design-pending] in the
|
|
25
|
-
# active sections (entries, sub-bullets, or prose — a mention masks a
|
|
26
|
-
# missing tag), and a [spec:]-tagged entry misfiled in an active
|
|
27
|
-
# non-feature section; (b) design-pending-section entries (deferred plus a
|
|
28
|
-
# configured icebox) missing [design-pending], and one already carrying
|
|
29
|
-
# [spec:] (promote it). One awk pass.
|
|
30
|
-
qout="$(awk -v featre="$SPEC_FEATURE_RE" -v activere="$SPEC_ACTIVE_RE" \
|
|
31
|
-
-v defre="$SPEC_DEFERRED_RE" -v sectre="$SPEC_SECTION_RE" '
|
|
32
|
-
$0 ~ sectre {
|
|
33
|
-
sec = "other"
|
|
34
|
-
if ($0 ~ featre) sec = "feature"
|
|
35
|
-
else if ($0 ~ activere) sec = "active"
|
|
36
|
-
else if ($0 ~ defre) sec = "deferred"
|
|
37
|
-
next
|
|
38
|
-
}
|
|
39
|
-
(sec == "feature" || sec == "active") {
|
|
40
|
-
if ($0 ~ /^- /) {
|
|
41
|
-
if ($0 ~ /\[design-pending\]/)
|
|
42
|
-
printf "active-design-pending\t%d\t%s\n", FNR, $0
|
|
43
|
-
else if (sec == "feature" && $0 !~ /\[spec:/)
|
|
44
|
-
printf "missing-spec\t%d\t%s\n", FNR, $0
|
|
45
|
-
else if (sec == "active" && $0 ~ /\[spec:/)
|
|
46
|
-
printf "misfiled-ready\t%d\t%s\n", FNR, $0
|
|
47
|
-
} else if ($0 ~ /\[design-pending\]/) {
|
|
48
|
-
printf "prose-design-pending\t%d\t%s\n", FNR, $0
|
|
49
|
-
}
|
|
50
|
-
next
|
|
51
|
-
}
|
|
52
|
-
sec == "deferred" && $0 ~ /^- / {
|
|
53
|
-
if ($0 !~ /\[design-pending\]/)
|
|
54
|
-
printf "deferred-open\t%d\t%s\n", FNR, $0
|
|
55
|
-
else if ($0 ~ /\[spec:/)
|
|
56
|
-
printf "deferred-ready\t%d\t%s\n", FNR, $0
|
|
57
|
-
next
|
|
58
|
-
}
|
|
59
|
-
' "$QUEUE")"; st=$?
|
|
60
|
-
fail_closed "$st" check-amendment-queue awk
|
|
61
|
-
|
|
62
|
-
missing=(); an=(); pn=(); dopen=(); dready=(); mready=()
|
|
63
|
-
while IFS=$'\t' read -r class ln text; do
|
|
64
|
-
[[ -n "$class" ]] || continue
|
|
65
|
-
case "$class" in
|
|
66
|
-
missing-spec) missing+=("$QUEUE:$ln: $text") ;;
|
|
67
|
-
active-design-pending) an+=("$QUEUE:$ln: $text") ;;
|
|
68
|
-
prose-design-pending) pn+=("$QUEUE:$ln: $text") ;;
|
|
69
|
-
deferred-open) dopen+=("$QUEUE:$ln: $text") ;;
|
|
70
|
-
deferred-ready) dready+=("$QUEUE:$ln: $text") ;;
|
|
71
|
-
misfiled-ready) mready+=("$QUEUE:$ln: $text") ;;
|
|
72
|
-
esac
|
|
73
|
-
done <<< "$qout"
|
|
74
|
-
|
|
75
|
-
(( ${#missing[@]} )) && errors+="feature-section entries without [spec:] (spec-writing is an authoring-stage activity — write the amendment, then promote):"$'\n'"$(printf ' %s\n' "${missing[@]}")"$'\n'
|
|
76
|
-
(( ${#an[@]} )) && errors+="[design-pending] tag in an active-queue entry (move it to $CANON_KIT_DEFERRED_SECTION):"$'\n'"$(printf ' %s\n' "${an[@]}")"$'\n'
|
|
77
|
-
(( ${#pn[@]} )) && errors+="[design-pending] tag in active-queue prose (a design-pending-section-only tag; say \"needs design\" in prose):"$'\n'"$(printf ' %s\n' "${pn[@]}")"$'\n'
|
|
78
|
-
(( ${#dopen[@]} )) && errors+="design-pending-section entries without [design-pending] (all deferred work is design-pending):"$'\n'"$(printf ' %s\n' "${dopen[@]}")"$'\n'
|
|
79
|
-
(( ${#dready[@]} )) && errors+="design-pending-section entries already carrying [spec:] (promote to a feature section):"$'\n'"$(printf ' %s\n' "${dready[@]}")"$'\n'
|
|
80
|
-
(( ${#mready[@]} )) && errors+="[spec:]-tagged entries misfiled in an active non-feature section (a spec-ready entry belongs in a feature section):"$'\n'"$(printf ' %s\n' "${mready[@]}")"$'\n'
|
|
81
|
-
|
|
82
|
-
# (c) bidirectional pairing on disk: every [spec:] ref resolves to a file, and
|
|
83
|
-
# every amendment on disk is referenced by a [spec:] entry (by basename). A
|
|
84
|
-
# ref with a '/' is a repo-relative path (resolved directly); a bare ref is
|
|
85
|
-
# an amendment basename (searched tree-wide).
|
|
86
|
-
mapfile -t refs < <(grep -oE '\[spec:[[:space:]]*[^]]+\]' "$QUEUE" 2>/dev/null \
|
|
87
|
-
| sed -E 's/\[spec:[[:space:]]*//; s/[[:space:]]*\]$//' | sort -u)
|
|
88
|
-
|
|
89
|
-
declare -A ref_bases=()
|
|
90
|
-
for r in ${refs[@]+"${refs[@]}"}; do
|
|
91
|
-
[[ -n "$r" ]] || continue
|
|
92
|
-
ref_bases["$(basename "$r")"]=1
|
|
93
|
-
if [[ "$r" == */* ]]; then
|
|
94
|
-
[[ -f "$r" ]] || errors+="queue references [spec: $r] but no such file exists at that path"$'\n'
|
|
95
|
-
else
|
|
96
|
-
hit="$(spec_amendments "$ROOT" | while IFS= read -r f; do [[ "$(basename "$f")" == "$r" ]] && { echo "$f"; break; }; done)"
|
|
97
|
-
[[ -n "$hit" ]] || errors+="queue references [spec: $r] but no amendment file named $r exists on disk"$'\n'
|
|
98
|
-
fi
|
|
99
|
-
done
|
|
100
|
-
|
|
101
|
-
while IFS= read -r f; do
|
|
102
|
-
[[ -n "$f" ]] || continue
|
|
103
|
-
base="$(basename "$f")"
|
|
104
|
-
[[ -n "${ref_bases[$base]:-}" ]] \
|
|
105
|
-
|| errors+="amendment on disk with no queue entry: $f (expected a task tagged [spec: $base])"$'\n'
|
|
106
|
-
done < <(spec_amendments "$ROOT")
|
|
107
|
-
|
|
108
|
-
if [[ -n "$errors" ]]; then
|
|
109
|
-
echo "check-amendment-queue: Task↔amendment bidirectional-rule violation(s):"
|
|
110
|
-
echo ""
|
|
111
|
-
printf '%s' "$errors"
|
|
112
|
-
echo " help: pair every amendment with a [spec: …] queue entry and vice versa; tag every design-pending-section entry [design-pending]; give every feature entry a [spec:] ref"
|
|
113
|
-
exit 1
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
echo "AMENDMENT-QUEUE: clean (every amendment ↔ a queue entry; feature entries spec-ready; every design-pending-section entry tagged)"
|
|
117
|
-
exit 0
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=docs/*.md,docs/*/index.md,docs/posts/*.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: canon-kit/SPEC.md §check-docs-link-convention — docs pages cite downward: no directory-target relative link (name the file), a kit page's back-link to its own README/SPEC carries a #section anchor, no relative link to a target resolving outside the docs root
|
|
5
|
-
#
|
|
6
|
-
# usage: check-docs-link-convention.sh [docs-root] (default CANON_KIT_LINK_ROOT;
|
|
7
|
-
# the optional arg points the fixture pair at a synthetic docs tree)
|
|
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/spec.sh
|
|
15
|
-
source "$KIT/lib/spec.sh"
|
|
16
|
-
|
|
17
|
-
ROOT="${1:-$CANON_KIT_LINK_ROOT}"; ROOT="${ROOT%/}"
|
|
18
|
-
[[ -d "$ROOT" ]] || { echo "check-docs-link-convention: not a directory: $ROOT" >&2; exit 2; }
|
|
19
|
-
|
|
20
|
-
mapfile -t pages < <(find "$ROOT" -type f -name '*.md' | sort)
|
|
21
|
-
[[ ${#pages[@]} -eq 0 ]] && { echo "DOCS-LINK-CONVENTION: clean (0 docs page(s) found)"; exit 0; }
|
|
22
|
-
|
|
23
|
-
exempt() { # $1=file $2=lineno — a docs-link-exempt marker on the hit line or the one above
|
|
24
|
-
local f="$1" n="$2" lo
|
|
25
|
-
lo=$(( n > 1 ? n - 1 : 1 ))
|
|
26
|
-
sed -n "${lo},${n}p" "$f" | grep -q 'docs-link-exempt:'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
bad=(); links=0
|
|
30
|
-
for f in "${pages[@]}"; do
|
|
31
|
-
base="$(dirname "$f")"
|
|
32
|
-
kit="" # a kit page is <root>/<kit>/index.md — its kit is the parent dir name
|
|
33
|
-
[[ "$(basename "$f")" == index.md && "$base" != "$ROOT" && "$(dirname "$base")" == "$ROOT" ]] \
|
|
34
|
-
&& kit="$(basename "$base")"
|
|
35
|
-
while IFS= read -r hit; do
|
|
36
|
-
lno="${hit%%:*}"; raw="${hit#*:}"
|
|
37
|
-
tgt="${raw#*](}"; tgt="${tgt%\)}"; tgt="${tgt%% *}" # strip ]( … ) and any "title" suffix
|
|
38
|
-
[[ -n "$tgt" ]] || continue
|
|
39
|
-
[[ "$tgt" == *"://"* || "$tgt" == mailto:* ]] && continue
|
|
40
|
-
links=$((links + 1))
|
|
41
|
-
path="${tgt%%#*}"; anchor=""
|
|
42
|
-
[[ "$tgt" == *#* ]] && anchor="${tgt#*#}"
|
|
43
|
-
[[ -n "$path" ]] || continue # pure #anchor — neither invariant applies
|
|
44
|
-
|
|
45
|
-
if [[ "$path" == */ ]]; then
|
|
46
|
-
exempt "$f" "$lno" || bad+=("$f:$lno: directory-target link '$tgt' — name the file (e.g. ${path}index.md), not the directory")
|
|
47
|
-
continue
|
|
48
|
-
fi
|
|
49
|
-
p="$(realpath -m --relative-to=. -- "$base/$path" 2>/dev/null)"
|
|
50
|
-
[[ -n "$p" ]] || continue
|
|
51
|
-
if [[ -d "$p" ]]; then
|
|
52
|
-
exempt "$f" "$lno" || bad+=("$f:$lno: directory-target link '$tgt' → $p/ — name the file (e.g. $tgt/index.md), not the directory")
|
|
53
|
-
continue
|
|
54
|
-
fi
|
|
55
|
-
if [[ -e "$p" && "$p" != "$ROOT"/* ]]; then
|
|
56
|
-
exempt "$f" "$lno" \
|
|
57
|
-
|| bad+=("$f:$lno: off-root relative link '$tgt' → $p — resolves outside $ROOT/, so it 404s on a site served from $ROOT/ alone; cite it in the absolute self-repo blob form")
|
|
58
|
-
continue
|
|
59
|
-
fi
|
|
60
|
-
if [[ -n "$kit" && -z "$anchor" ]]; then
|
|
61
|
-
b="$(basename "$p")"
|
|
62
|
-
[[ ( "$b" == README.md || "$b" == SPEC.md ) && "$(basename "$(dirname "$p")")" == "$kit" ]] \
|
|
63
|
-
&& { exempt "$f" "$lno" || bad+=("$f:$lno: anchorless back-link '$tgt' to this kit's $b — a docs page cites downward, name the #section rather than the whole spec"); }
|
|
64
|
-
fi
|
|
65
|
-
done < <(grep -noE '\]\([^)]+\)' "$f")
|
|
66
|
-
done
|
|
67
|
-
|
|
68
|
-
if [[ ${#bad[@]} -gt 0 ]]; then
|
|
69
|
-
echo "check-docs-link-convention: docs page link(s) break a shape convention (resolution is check-md-refs' job; this gate owns shape):"
|
|
70
|
-
printf ' %s\n' "${bad[@]}"
|
|
71
|
-
echo " help: name the file a directory link points at (kit/index.md, not kit/); give a kit page's"
|
|
72
|
-
echo " back-link to its own README/SPEC a #section anchor; cite a target outside the docs"
|
|
73
|
-
echo " root with the absolute self-repo blob form (canon-kit/SPEC.md §The reference-link"
|
|
74
|
-
echo " grammar) rather than relatively. Per-site valve: a 'docs-link-exempt: <reason>'"
|
|
75
|
-
echo " HTML comment on the link line or the one above."
|
|
76
|
-
exit 1
|
|
77
|
-
fi
|
|
78
|
-
echo "DOCS-LINK-CONVENTION: clean (${#pages[@]} docs page(s), $links relative link(s); no directory target, kit back-links anchored, no off-root relative target)"
|
|
79
|
-
exit 0
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=kit:*.sh,kit:SPEC.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: zero-config
|
|
4
|
-
# spec: canon-kit/SPEC.md §check-knob-default-coupling — every literal kit-knob default in kit source agrees across its sites and with the default the owning SPEC states
|
|
5
|
-
#
|
|
6
|
-
# usage: check-knob-default-coupling.sh (no args — the roster is gate_kit_roots)
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
11
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
# shellcheck source=../lib/spec.sh
|
|
14
|
-
source "$KIT/lib/spec.sh"
|
|
15
|
-
|
|
16
|
-
# spec: canon-kit/SPEC.md §check-knob-default-coupling — the knob prefix is derived, never listed: one SCREAMING_SNAKE form per kit root (dir uppercased, hyphens to underscores), so the gate ships no term list and the provenance seam holds
|
|
17
|
-
pairs="$(
|
|
18
|
-
while IFS= read -r kr; do
|
|
19
|
-
kr="${kr%/}"; [[ -n "$kr" ]] || continue
|
|
20
|
-
b="${kr##*/}"
|
|
21
|
-
a="${b^^}"; a="${a//-/_}_"
|
|
22
|
-
printf '%s\t%s\n' "$a" "$kr"
|
|
23
|
-
done < <(gate_kit_roots_rel)
|
|
24
|
-
)"
|
|
25
|
-
[[ -n "$pairs" ]] || { echo "check-knob-default-coupling: no kit roots enumerated" >&2; exit 2; }
|
|
26
|
-
|
|
27
|
-
mapfile -t sources < <(
|
|
28
|
-
while IFS= read -r kr; do
|
|
29
|
-
kr="${kr%/}"; [[ -n "$kr" ]] || continue
|
|
30
|
-
gate_find "$kr" -name '*.sh' -type f 2>/dev/null | grep -v '/templates/' || true
|
|
31
|
-
done < <(gate_kit_roots_rel) | sed 's#^\./##' | sort -u
|
|
32
|
-
)
|
|
33
|
-
[[ ${#sources[@]} -eq 0 ]] && { echo "KNOB-DEFAULT-COUPLING: clean (0 kit source file(s) found)"; exit 0; }
|
|
34
|
-
|
|
35
|
-
# spec: canon-kit/SPEC.md §check-knob-default-coupling — one record per default site: "<class>\t<knob>\t<kit>\t<value>\t<file>\t<lno>", class literal|skip. A ${…:-v} fallback and the guarded-assignment idiom are the two sites; an array (…), an empty fallback, or a value carrying an expansion/substitution ($ or backtick) is a computed default with no single literal — class skip, counted not coupled.
|
|
36
|
-
read -r -d '' EXTRACT <<'AWK' || true
|
|
37
|
-
BEGIN {
|
|
38
|
-
n = split(PAIRS, _rows, "\n"); j = 0
|
|
39
|
-
for (i = 1; i <= n; i++) {
|
|
40
|
-
if (_rows[i] == "") continue
|
|
41
|
-
t = index(_rows[i], "\t")
|
|
42
|
-
j++; PFX[j] = substr(_rows[i], 1, t - 1); PKIT[j] = substr(_rows[i], t + 1)
|
|
43
|
-
}
|
|
44
|
-
NPFX = j
|
|
45
|
-
}
|
|
46
|
-
function knob_owner(knob, i) {
|
|
47
|
-
for (i = 1; i <= NPFX; i++) if (index(knob, PFX[i]) == 1) return PKIT[i]
|
|
48
|
-
return ""
|
|
49
|
-
}
|
|
50
|
-
function classify(v) {
|
|
51
|
-
if (v == "") return "skip"
|
|
52
|
-
if (substr(v, 1, 1) == "(") return "skip" # array literal — no single value to couple
|
|
53
|
-
if (v ~ /[$`]/) return "skip" # expansion / substitution / command — computed
|
|
54
|
-
return "literal"
|
|
55
|
-
}
|
|
56
|
-
function emit(knob, val, kit, cls) {
|
|
57
|
-
kit = knob_owner(knob)
|
|
58
|
-
if (kit == "") return
|
|
59
|
-
cls = classify(val)
|
|
60
|
-
printf "%s\t%s\t%s\t%s\t%s\t%d\n", cls, knob, kit, val, FILENAME, FNR
|
|
61
|
-
}
|
|
62
|
-
function strip_quotes(v) {
|
|
63
|
-
if (v ~ /^".*"$/) return substr(v, 2, length(v) - 2)
|
|
64
|
-
if (v ~ /^'.*'$/) return substr(v, 2, length(v) - 2)
|
|
65
|
-
return v
|
|
66
|
-
}
|
|
67
|
-
{
|
|
68
|
-
line = $0
|
|
69
|
-
# idiom 1: ${PREFIX_KNOB:-value} fallback
|
|
70
|
-
rest = line; base = 0
|
|
71
|
-
while (match(rest, /\$\{[A-Za-z_][A-Za-z0-9_]*:-[^}]*\}/) > 0) {
|
|
72
|
-
seg = substr(rest, RSTART, RLENGTH)
|
|
73
|
-
inner = substr(seg, 3, length(seg) - 3) # drop ${ and }
|
|
74
|
-
c = index(inner, ":-")
|
|
75
|
-
knob = substr(inner, 1, c - 1)
|
|
76
|
-
val = substr(inner, c + 2)
|
|
77
|
-
emit(knob, val)
|
|
78
|
-
base += RSTART + RLENGTH - 1
|
|
79
|
-
rest = substr(rest, RSTART + RLENGTH)
|
|
80
|
-
}
|
|
81
|
-
# idiom 2: guarded assignment — [[ -v KNOB ]] || KNOB=value / declare -p KNOB &>/dev/null || KNOB=(…)
|
|
82
|
-
if (line ~ /(\]|&>\/dev\/null)[ \t]*\|\|[ \t]*[A-Za-z_][A-Za-z0-9_]*=/) {
|
|
83
|
-
tail = line
|
|
84
|
-
sub(/^.*\|\|[ \t]*/, "", tail)
|
|
85
|
-
if (match(tail, /^[A-Za-z_][A-Za-z0-9_]*=/) > 0) {
|
|
86
|
-
knob = substr(tail, 1, RLENGTH - 1)
|
|
87
|
-
val = substr(tail, RLENGTH + 1)
|
|
88
|
-
sub(/[ \t]+$/, "", val)
|
|
89
|
-
emit(knob, strip_quotes(val))
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
AWK
|
|
94
|
-
|
|
95
|
-
records="$(awk -v PAIRS="$pairs" "$EXTRACT" "${sources[@]}")"; st=$?
|
|
96
|
-
fail_closed "$st" check-knob-default-coupling "awk extract"
|
|
97
|
-
|
|
98
|
-
skipped="$(grep -c '^skip'$'\t' <<<"$records" 2>/dev/null || true)"; skipped="${skipped:-0}"
|
|
99
|
-
|
|
100
|
-
findings=()
|
|
101
|
-
described=0
|
|
102
|
-
|
|
103
|
-
# spec: canon-kit/SPEC.md §check-knob-default-coupling — assertion 1: every literal site for one knob carries the same literal, else the source disagrees with itself before any SPEC is read (and the knob's assertion-2 check is suppressed)
|
|
104
|
-
declare -A knob_val knob_first knob_kit knob_conflict
|
|
105
|
-
while IFS=$'\t' read -r cls knob kit val file lno; do
|
|
106
|
-
[[ "$cls" == "literal" ]] || continue
|
|
107
|
-
if [[ -z "${knob_val[$knob]+x}" ]]; then
|
|
108
|
-
knob_val[$knob]="$val"; knob_first[$knob]="$file:$lno"; knob_kit[$knob]="$kit"
|
|
109
|
-
elif [[ "${knob_val[$knob]}" != "$val" ]]; then
|
|
110
|
-
knob_conflict[$knob]=1
|
|
111
|
-
findings+=(" $file:$lno $knob default '$val' disagrees with '${knob_val[$knob]}' at ${knob_first[$knob]} — a knob's default has one literal across its sites")
|
|
112
|
-
fi
|
|
113
|
-
done < <(printf '%s\n' "$records")
|
|
114
|
-
|
|
115
|
-
# spec: canon-kit/SPEC.md §check-knob-default-coupling — assertion 2: the owning kit's SPEC states that same literal, read through the shared default-statement grammar (§lib/spec.sh); a descriptively-stated default carries no literal and is skipped
|
|
116
|
-
SPECGRAMMAR="$(spec_default_grammar_awk)"
|
|
117
|
-
read -r -d '' SPECSCAN <<'AWK' || true
|
|
118
|
-
BEGIN {
|
|
119
|
-
n = split(PAIRS, _rows, "\n"); j = 0
|
|
120
|
-
for (i = 1; i <= n; i++) {
|
|
121
|
-
if (_rows[i] == "") continue
|
|
122
|
-
t = index(_rows[i], "\t")
|
|
123
|
-
j++; PFX[j] = substr(_rows[i], 1, t - 1)
|
|
124
|
-
}
|
|
125
|
-
NPFX = j
|
|
126
|
-
m = split(SUBSET, _s, "\n"); NS = 0
|
|
127
|
-
for (i = 1; i <= m; i++) {
|
|
128
|
-
if (_s[i] == "") continue
|
|
129
|
-
t = index(_s[i], "\t")
|
|
130
|
-
NS++; K[NS] = substr(_s[i], 1, t - 1); L[NS] = substr(_s[i], t + 1)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function sk_is_knobname(tok, i) {
|
|
134
|
-
for (i = 1; i <= NPFX; i++) if (index(tok, PFX[i]) == 1) return 1
|
|
135
|
-
return 0
|
|
136
|
-
}
|
|
137
|
-
# reduce every ${VAR:-tail} deferral expression in a window to its tail literal, so
|
|
138
|
-
# a SPEC default stated as the same deferral the source uses (a cross-kit knob
|
|
139
|
-
# inheriting another's default) compares tail-to-tail, not expression-to-literal.
|
|
140
|
-
function reduce_deferrals(s, out, m, inner, c) {
|
|
141
|
-
out = ""
|
|
142
|
-
while (match(s, /\$\{[A-Za-z_][A-Za-z0-9_]*:-[^}]*\}/) > 0) {
|
|
143
|
-
m = substr(s, RSTART, RLENGTH)
|
|
144
|
-
inner = substr(m, 3, length(m) - 3)
|
|
145
|
-
c = index(inner, ":-")
|
|
146
|
-
out = out substr(s, 1, RSTART - 1) substr(inner, c + 2)
|
|
147
|
-
s = substr(s, RSTART + RLENGTH)
|
|
148
|
-
}
|
|
149
|
-
return out s
|
|
150
|
-
}
|
|
151
|
-
# v appears in win as a full delimited token: bounded on both sides by a non-value
|
|
152
|
-
# char (not alnum, _, ., /, *, or -), so a suffix of a longer literal never matches.
|
|
153
|
-
function fulltoken(win, v, L, start, p, bpos, b, a) {
|
|
154
|
-
L = length(v); start = 1
|
|
155
|
-
while ((p = index(substr(win, start), v)) > 0) {
|
|
156
|
-
bpos = start + p - 1
|
|
157
|
-
b = (bpos > 1) ? substr(win, bpos - 1, 1) : " "
|
|
158
|
-
a = substr(win, bpos + L, 1); if (a == "") a = " "
|
|
159
|
-
if (b !~ /[A-Za-z0-9_.\/*-]/ && a !~ /[A-Za-z0-9_.\/*-]/) return 1
|
|
160
|
-
start = bpos + L
|
|
161
|
-
}
|
|
162
|
-
return 0
|
|
163
|
-
}
|
|
164
|
-
# truncate s at the first kit-knob token, so a knob's default window never bleeds
|
|
165
|
-
# into the next knob's statement (an inline paragraph lists many knob defaults).
|
|
166
|
-
function bound_next_knob(s, i, pos, best) {
|
|
167
|
-
best = length(s) + 1
|
|
168
|
-
for (i = 1; i <= NPFX; i++) { pos = index(s, PFX[i]); if (pos > 0 && pos < best) best = pos }
|
|
169
|
-
return substr(s, 1, best - 1)
|
|
170
|
-
}
|
|
171
|
-
{ blob = (blob == "" ? $0 : blob " " $0) }
|
|
172
|
-
END {
|
|
173
|
-
for (s = 1; s <= NS; s++) {
|
|
174
|
-
found = 0; any_disagree = 0; any_described = 0; disagree_lit = ""
|
|
175
|
-
start = 1
|
|
176
|
-
while ((p = index(substr(blob, start), K[s])) > 0) {
|
|
177
|
-
kpos = start + p - 1
|
|
178
|
-
after = substr(blob, kpos + length(K[s]), 1)
|
|
179
|
-
if (after ~ /[A-Za-z0-9_]/) { start = kpos + length(K[s]); continue } # a longer knob, not this one
|
|
180
|
-
win = reduce_deferrals(substr(blob, kpos, length(K[s]) + 400))
|
|
181
|
-
haskw = index(tolower(win), "default")
|
|
182
|
-
slit = ""
|
|
183
|
-
if (haskw) {
|
|
184
|
-
# the literal the knob's own (first) "default" binds, bounded before the next knob
|
|
185
|
-
slit = sk_literal_at(bound_next_knob(substr(win, haskw + 7)))
|
|
186
|
-
}
|
|
187
|
-
if (slit == L[s] || (haskw && fulltoken(win, L[s]))) { found = 1; break }
|
|
188
|
-
if (slit != "") { any_disagree = 1; disagree_lit = slit } # a default literal, but not this one
|
|
189
|
-
else if (haskw) any_described = 1 # descriptively stated — no literal to couple
|
|
190
|
-
start = kpos + length(K[s])
|
|
191
|
-
}
|
|
192
|
-
if (!found) {
|
|
193
|
-
if (any_disagree) printf "disagree\t%s\t%s\n", K[s], L[s]
|
|
194
|
-
else if (any_described) printf "described\t%s\t%s\n", K[s], L[s]
|
|
195
|
-
else printf "absent\t%s\t%s\n", K[s], L[s]
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
AWK
|
|
200
|
-
|
|
201
|
-
declare -A kit_subset
|
|
202
|
-
for knob in "${!knob_val[@]}"; do
|
|
203
|
-
[[ -n "${knob_conflict[$knob]+x}" ]] && continue # source disagrees first — fix that before the SPEC
|
|
204
|
-
kit="${knob_kit[$knob]}"
|
|
205
|
-
kit_subset[$kit]+="$knob"$'\t'"${knob_val[$knob]}"$'\n'
|
|
206
|
-
done
|
|
207
|
-
|
|
208
|
-
for kit in "${!kit_subset[@]}"; do
|
|
209
|
-
spec="$kit/$CANON_KIT_SPEC_NAME"
|
|
210
|
-
if [[ ! -f "$spec" ]]; then
|
|
211
|
-
while IFS=$'\t' read -r knob val; do
|
|
212
|
-
[[ -n "$knob" ]] || continue
|
|
213
|
-
findings+=(" $spec $knob default \`$val\` has no owning SPEC to state it — the SPEC owns knob defaults")
|
|
214
|
-
done < <(printf '%s' "${kit_subset[$kit]}")
|
|
215
|
-
continue
|
|
216
|
-
fi
|
|
217
|
-
out="$(awk -v PAIRS="$pairs" -v SUBSET="${kit_subset[$kit]}" "$SPECGRAMMAR
|
|
218
|
-
$SPECSCAN" "$spec")"; st=$?
|
|
219
|
-
fail_closed "$st" check-knob-default-coupling "awk spec-scan($spec)"
|
|
220
|
-
while IFS=$'\t' read -r verdict knob val; do
|
|
221
|
-
[[ -n "$verdict" ]] || continue
|
|
222
|
-
case "$verdict" in
|
|
223
|
-
disagree) findings+=(" $spec $knob — source default \`$val\` but the SPEC states a different default") ;;
|
|
224
|
-
absent) findings+=(" $spec $knob — source default \`$val\` is stated nowhere in the owning SPEC") ;;
|
|
225
|
-
described) described=$((described + 1)) ;; # SPEC states the default descriptively — no literal to couple
|
|
226
|
-
esac
|
|
227
|
-
done <<< "$out"
|
|
228
|
-
done
|
|
229
|
-
|
|
230
|
-
if [[ ${#findings[@]} -gt 0 ]]; then
|
|
231
|
-
echo "check-knob-default-coupling: kit-knob default(s) drift between source sites or from the owning SPEC — a default has one home, and a divergent copy is a silent regression:"
|
|
232
|
-
echo ""
|
|
233
|
-
printf '%s\n' "${findings[@]}" | sort
|
|
234
|
-
echo " help: make every fallback site for the knob carry the same literal, and state that literal as the knob's default in the owning kit's SPEC (the default-statement grammar check-knob-citation reads); a computed default belongs in the SPEC as prose, not a coupled literal"
|
|
235
|
-
exit 1
|
|
236
|
-
fi
|
|
237
|
-
|
|
238
|
-
lit_count="$(grep -c '^literal'$'\t' <<<"$records" 2>/dev/null || true)"; lit_count="${lit_count:-0}"
|
|
239
|
-
echo "KNOB-DEFAULT-COUPLING: clean (${#sources[@]} kit source file(s); $lit_count literal default site(s) agree across sites and with the owning SPEC; $skipped computed/array/empty + $described descriptively-stated default(s) skipped-and-counted)"
|
|
240
|
-
exit 0
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# graph: couples=docs/*.md dir=one valve=none tier=precommit
|
|
3
|
-
# install: on-surface
|
|
4
|
-
# spec: canon-kit/SPEC.md §check-prose-tells — the mechanical AI-prose tells over the consumer-configured prose surfaces, each threshold-gated, with the prose-tell-exempt valve
|
|
5
|
-
#
|
|
6
|
-
# usage: check-prose-tells.sh [scan-root] (default '.')
|
|
7
|
-
set -uo pipefail
|
|
8
|
-
|
|
9
|
-
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
|
|
11
|
-
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
12
|
-
source "$SDK/lib/gate.sh"
|
|
13
|
-
# shellcheck source=../lib/spec.sh
|
|
14
|
-
source "$KIT/lib/spec.sh"
|
|
15
|
-
|
|
16
|
-
ROOT="${1:-.}"
|
|
17
|
-
[[ -d "$ROOT" ]] || { echo "check-prose-tells: not a directory: $ROOT" >&2; exit 2; }
|
|
18
|
-
|
|
19
|
-
# spec: canon-kit/SPEC.md §check-prose-tells — the scanned surfaces are the consumer's CANON_KIT_PROSE_TELL_GLOBS; empty ⇒ nothing scanned, a clean pass (the unconfigured-consumer no-op)
|
|
20
|
-
declare -a FILES=()
|
|
21
|
-
if [[ ${#CANON_KIT_PROSE_TELL_GLOBS[@]} -gt 0 ]]; then
|
|
22
|
-
shopt -s nullglob globstar
|
|
23
|
-
for g in "${CANON_KIT_PROSE_TELL_GLOBS[@]}"; do
|
|
24
|
-
for f in "$ROOT"/$g; do [[ -f "$f" ]] && FILES+=("$f"); done
|
|
25
|
-
done
|
|
26
|
-
shopt -u nullglob globstar
|
|
27
|
-
fi
|
|
28
|
-
if [[ ${#FILES[@]} -eq 0 ]]; then
|
|
29
|
-
echo "PROSE-TELLS: clean (0 configured surface(s); nothing scanned)"
|
|
30
|
-
exit 0
|
|
31
|
-
fi
|
|
32
|
-
mapfile -t FILES < <(printf '%s\n' "${FILES[@]}" | sort -u)
|
|
33
|
-
|
|
34
|
-
PHRASES_NL="$(printf '%s\n' "${CANON_KIT_PROSE_TELL_PHRASES[@]}")"
|
|
35
|
-
ABBR_NL="$(printf '%s\n' "${CANON_KIT_PROSE_TELL_ABBR_ALLOW[@]}")"
|
|
36
|
-
|
|
37
|
-
read -r -d '' HOOKS <<'AWK' || true
|
|
38
|
-
BEGIN {
|
|
39
|
-
n = split(PHRASES, _ph, "\n"); NPH = 0
|
|
40
|
-
for (i = 1; i <= n; i++) { if (_ph[i] == "") continue; NPH++; PHO[NPH] = _ph[i]; PHL[NPH] = tolower(_ph[i]) }
|
|
41
|
-
n = split(ABBR, _ab, "\n")
|
|
42
|
-
for (i = 1; i <= n; i++) { if (_ab[i] == "") continue; ALLOWSET[_ab[i]] = 1 }
|
|
43
|
-
sec_startline = 1; sec_buf = ""; file_buf = ""; in_gen = 0
|
|
44
|
-
}
|
|
45
|
-
function emit(ln, code, msg) { print FILENAME ":" ln ": [" code "] " msg }
|
|
46
|
-
|
|
47
|
-
# what the tells measure is authored reader-facing prose, so three non-prose
|
|
48
|
-
# surfaces are held out: inline `code` spans (identifiers, filenames, env-vars),
|
|
49
|
-
# markdown table rows (data layout), and generated <!-- x:begin -->..<!-- x:end -->
|
|
50
|
-
# regions (byte-gated elsewhere; a prose gate that forced edits to generated
|
|
51
|
-
# content would contradict its generation, the docs/posts rationale).
|
|
52
|
-
function strip_code(s, t) { t = s; gsub(/`[^`]*`/, " ", t); return t }
|
|
53
|
-
function is_table(s) { return (s ~ /^[ \t]*\|/) }
|
|
54
|
-
# a markdown list item (- / * / + / N.) is its own unit, not flowing prose: a
|
|
55
|
-
# definition list carrying one em-dash per item is well-formed markdown, so the
|
|
56
|
-
# paragraph/section assertions must not lump items into one blank-line block. In
|
|
57
|
-
# the paragraph buffer each item flushes A/B/E on its own span (sk_on_pflush); in
|
|
58
|
-
# the section buffer a leading "." boundary keeps the C/F regexes from matching
|
|
59
|
-
# across two items.
|
|
60
|
-
function is_list_item(s) { return (s ~ /^[ \t]*([-*+]|[0-9]+\.)[ \t]/) }
|
|
61
|
-
function is_gen_begin(s) { return (s ~ /<!--[ \t]*[A-Za-z0-9_-]+:begin[ \t]*-->/) }
|
|
62
|
-
function is_gen_end(s) { return (s ~ /<!--[ \t]*[A-Za-z0-9_-]+:end[ \t]*-->/) }
|
|
63
|
-
|
|
64
|
-
# the walk driver feeds prose lines here (exempt/fenced/blank already dropped);
|
|
65
|
-
# a heading is never prose — a level-1/2 head closes the section span (F, C),
|
|
66
|
-
# any head is kept out of the paragraph (A, E) and file (D) buffers.
|
|
67
|
-
function sk_on_line(file, fnr, raw, clean) {
|
|
68
|
-
if (is_gen_begin(raw)) { in_gen = 1; return }
|
|
69
|
-
if (is_gen_end(raw)) { in_gen = 0; return }
|
|
70
|
-
if (in_gen) return
|
|
71
|
-
if (raw ~ /^[ \t]*#{1,6}[ \t]/) {
|
|
72
|
-
if (raw ~ /^[ \t]*#{1,2}[ \t]/) { flush_section(); sec_startline = fnr }
|
|
73
|
-
return
|
|
74
|
-
}
|
|
75
|
-
if (is_table(raw)) return
|
|
76
|
-
clean = strip_code(raw)
|
|
77
|
-
if (is_list_item(raw)) { sec_buf = sec_buf " ."; file_buf = file_buf " ." }
|
|
78
|
-
sec_buf = sec_buf " " clean
|
|
79
|
-
file_buf = file_buf " " clean
|
|
80
|
-
}
|
|
81
|
-
# each blank-line paragraph is unitized: the run before the first list item and
|
|
82
|
-
# every list item (with its continuation lines) is a separate A/B/E unit.
|
|
83
|
-
function sk_on_pflush( first, i, ustart) {
|
|
84
|
-
if (sk_pn == 0 || in_gen) return
|
|
85
|
-
first = sk_pline[1]
|
|
86
|
-
if (first ~ /^[ \t]*#{1,6}[ \t]/ || is_table(first)) return
|
|
87
|
-
ustart = 1
|
|
88
|
-
for (i = 2; i <= sk_pn; i++)
|
|
89
|
-
if (is_list_item(sk_pline[i])) { pflush_unit(ustart, i - 1); ustart = i }
|
|
90
|
-
pflush_unit(ustart, sk_pn)
|
|
91
|
-
}
|
|
92
|
-
function pflush_unit(lo, hi, para) {
|
|
93
|
-
para = strip_code(_sk_join(lo, hi))
|
|
94
|
-
a_emdash(para, sk_pfnr[lo])
|
|
95
|
-
b_phrases(para, sk_pfnr[lo])
|
|
96
|
-
e_rhythm(para, sk_pfnr[lo])
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
# assertion A: em-dash density — a paragraph over the em-dash cap
|
|
100
|
-
function a_emdash(para, ln, n) {
|
|
101
|
-
n = gsub(EMD, "", para)
|
|
102
|
-
if (n > EMDASH_MAX) emit(ln, "A", "em-dash density (" n " em-dashes > " EMDASH_MAX ") in a paragraph")
|
|
103
|
-
}
|
|
104
|
-
# assertion B: throat-clearing phrases — any bundled/consumer phrase, case-insensitive
|
|
105
|
-
function b_phrases(para, ln, i, lc) {
|
|
106
|
-
lc = tolower(para)
|
|
107
|
-
for (i = 1; i <= NPH; i++)
|
|
108
|
-
if (index(lc, PHL[i]) > 0) emit(ln, "B", "throat-clearing phrase \"" PHO[i] "\"")
|
|
109
|
-
}
|
|
110
|
-
# assertion E: sentence-rhythm variance — >= min sentences, word-count CV below the floor
|
|
111
|
-
function e_rhythm(para, ln, ns, i, sum, mean, sq, sd, cv) {
|
|
112
|
-
ns = split_sentences(para)
|
|
113
|
-
if (ns < RHYTHM_MIN) return
|
|
114
|
-
sum = 0
|
|
115
|
-
for (i = 1; i <= ns; i++) sum += SW[i]
|
|
116
|
-
mean = sum / ns
|
|
117
|
-
if (mean <= 0) return
|
|
118
|
-
sq = 0
|
|
119
|
-
for (i = 1; i <= ns; i++) sq += (SW[i] - mean) * (SW[i] - mean)
|
|
120
|
-
sd = sqrt(sq / ns)
|
|
121
|
-
cv = sd / mean
|
|
122
|
-
if (cv < RHYTHM_CV_MIN)
|
|
123
|
-
emit(ln, "E", sprintf("metronomic rhythm (%d sentences, word-count CV %.3f < %.2f)", ns, cv, RHYTHM_CV_MIN))
|
|
124
|
-
}
|
|
125
|
-
function split_sentences(p, tmp, parts, m, k, seg, cnt) {
|
|
126
|
-
tmp = p
|
|
127
|
-
gsub(/[.!?]+[ \t]/, "\001", tmp)
|
|
128
|
-
sub(/[.!?]+[ \t]*$/, "\001", tmp)
|
|
129
|
-
m = split(tmp, parts, /\001/)
|
|
130
|
-
cnt = 0
|
|
131
|
-
for (k = 1; k <= m; k++) {
|
|
132
|
-
seg = parts[k]; gsub(/^[ \t]+|[ \t]+$/, "", seg)
|
|
133
|
-
if (seg == "") continue
|
|
134
|
-
cnt++; SW[cnt] = wc(seg)
|
|
135
|
-
}
|
|
136
|
-
return cnt
|
|
137
|
-
}
|
|
138
|
-
function wc(s, a) { if (s == "") return 0; return split(s, a, /[ \t]+/) }
|
|
139
|
-
|
|
140
|
-
# section-span assertions (C, F): flushed at each level-1/2 heading and at END
|
|
141
|
-
function flush_section( lc, sec, n) {
|
|
142
|
-
if (sec_buf == "") return
|
|
143
|
-
lc = tolower(sec_buf)
|
|
144
|
-
# assertion C: contrast cadence — the "not X — it's Y" shape over the cap per section
|
|
145
|
-
n = gsub(/not[^.]*(—|, but)[^.]*it('s| is)/, "", lc)
|
|
146
|
-
if (n > CONTRAST_MAX) emit(sec_startline, "C", "contrast cadence (" n " \"not X, it's Y\" turns > " CONTRAST_MAX ") in a section")
|
|
147
|
-
sec = sec_buf
|
|
148
|
-
# assertion F: tricolon density — "A, B, and C" lists of three over the cap per section
|
|
149
|
-
n = gsub(/[A-Za-z][^,.]*, [^,.]*, and [^,.]*[A-Za-z]/, "", sec)
|
|
150
|
-
if (n > TRICOLON_MAX) emit(sec_startline, "F", "tricolon density (" n " \"A, B, and C\" triples > " TRICOLON_MAX ") in a section")
|
|
151
|
-
sec_buf = ""
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
# assertion D: undefined abbreviations — an all-caps token (>=3) with no parenthesized expansion anywhere in the file and absent from the allow-list
|
|
155
|
-
function flush_file( s, tok, st_, len_, before) {
|
|
156
|
-
s = file_buf
|
|
157
|
-
delete SEEN
|
|
158
|
-
while (match(s, /[A-Z][A-Z0-9][A-Z0-9]+/)) {
|
|
159
|
-
st_ = RSTART; len_ = RLENGTH
|
|
160
|
-
before = (st_ > 1) ? substr(s, st_ - 1, 1) : " "
|
|
161
|
-
tok = substr(s, st_, len_)
|
|
162
|
-
s = substr(s, st_ + len_)
|
|
163
|
-
if (before ~ /[A-Za-z0-9]/) continue
|
|
164
|
-
if (tok in SEEN) continue
|
|
165
|
-
SEEN[tok] = 1
|
|
166
|
-
if (tok in ALLOWSET) continue
|
|
167
|
-
if (is_defined(tok)) continue
|
|
168
|
-
emit(1, "D", "undefined abbreviation \"" tok "\" (never expanded in-file, not in the allow-list)")
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function is_defined(tok, re) { re = "\\(" tok "|" tok "[ ]*\\("; return (file_buf ~ re) }
|
|
172
|
-
|
|
173
|
-
END { flush_section(); flush_file() }
|
|
174
|
-
AWK
|
|
175
|
-
|
|
176
|
-
AWKSRC="$(spec_para_accum_awk)
|
|
177
|
-
$(spec_manifest_walk_awk)
|
|
178
|
-
$HOOKS"
|
|
179
|
-
|
|
180
|
-
findings_raw=""
|
|
181
|
-
scanned=0
|
|
182
|
-
for f in "${FILES[@]}"; do
|
|
183
|
-
out="$(awk \
|
|
184
|
-
-v EMD="—" \
|
|
185
|
-
-v EMDASH_MAX="$CANON_KIT_PROSE_TELL_EMDASH_MAX" \
|
|
186
|
-
-v CONTRAST_MAX="$CANON_KIT_PROSE_TELL_CONTRAST_MAX" \
|
|
187
|
-
-v RHYTHM_MIN="$CANON_KIT_PROSE_TELL_RHYTHM_MIN_SENTENCES" \
|
|
188
|
-
-v RHYTHM_CV_MIN="$CANON_KIT_PROSE_TELL_RHYTHM_CV_MIN" \
|
|
189
|
-
-v TRICOLON_MAX="$CANON_KIT_PROSE_TELL_TRICOLON_MAX" \
|
|
190
|
-
-v PHRASES="$PHRASES_NL" \
|
|
191
|
-
-v ABBR="$ABBR_NL" \
|
|
192
|
-
-v SK_EXEMPT="prose-tell-exempt:" \
|
|
193
|
-
"$AWKSRC" "$f")"; st=$?
|
|
194
|
-
fail_closed "$st" check-prose-tells "awk ($f)"
|
|
195
|
-
[[ -n "$out" ]] && findings_raw+="$out"$'\n'
|
|
196
|
-
scanned=$((scanned + 1))
|
|
197
|
-
done
|
|
198
|
-
|
|
199
|
-
findings="$(printf '%s' "$findings_raw" | grep -v '^[[:space:]]*$' | sort -u || true)"
|
|
200
|
-
if [[ -n "$findings" ]]; then
|
|
201
|
-
count="$(printf '%s\n' "$findings" | grep -c .)"
|
|
202
|
-
echo "check-prose-tells: $count mechanical AI-prose tell(s) across $scanned configured surface(s):"
|
|
203
|
-
printf '%s\n' "$findings"
|
|
204
|
-
echo " help: rewrite the flagged prose — break the em-dash-dense paragraph, cut the throat-clearing opener, vary sentence length, spell out the abbreviation once, thin the contrast/tricolon cadence — or, for a deliberate keep, tag '<!-- prose-tell-exempt: <reason> -->' on the flagged line or directly above it (a reason is mandatory). Thresholds are the CANON_KIT_PROSE_TELL_* knobs (canon-kit/SPEC.md §Layout and configuration)."
|
|
205
|
-
exit 1
|
|
206
|
-
fi
|
|
207
|
-
echo "PROSE-TELLS: clean ($scanned configured surface(s); no mechanical AI-prose tell tripped)"
|
|
208
|
-
exit 0
|