checkwright 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1013 -50
- package/lib/common/digest.sh +18 -0
- package/lib/common/lock.sh +40 -0
- package/lib/common/profile.sh +33 -0
- package/lib/common/recipe.sh +56 -43
- package/lib/diff.sh +64 -0
- package/lib/doctor.sh +81 -7
- package/lib/init.sh +167 -52
- package/lib/uninstall.sh +212 -0
- package/lib/update.sh +34 -0
- package/package.json +2 -2
- package/payload/artifact/targets.list +30 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
- package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
- package/payload/canon-kit/README.md +2 -0
- package/payload/canon-kit/SPEC.md +666 -59
- package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
- package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
- package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
- package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
- package/payload/canon-kit/checks/check-docs-link-convention.sh +12 -4
- package/payload/canon-kit/checks/check-install-claim.gate +3 -0
- package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
- package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
- package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
- package/payload/canon-kit/checks/check-md-refs.gate +3 -0
- package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
- package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
- package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
- package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
- package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
- package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
- package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
- package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
- package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
- package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
- package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
- package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
- package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
- package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +32 -8
- package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
- package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
- package/payload/canon-kit/lib/spec.sh +109 -70
- package/payload/canon-kit/smoke/install.sh +21 -1
- package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
- package/payload/context-kit/README.md +4 -1
- package/payload/context-kit/SPEC.md +166 -9
- package/payload/context-kit/bin/env-probe.sh +19 -6
- package/payload/context-kit/checks/check-brevity.sh +1 -0
- package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
- package/payload/context-kit/checks/check-memory-off.sh +1 -0
- package/payload/context-kit/checks/check-settings-paths.sh +94 -0
- package/payload/context-kit/checks/check-settings-pins.sh +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
- package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
- package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
- package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
- package/payload/context-kit/lib/toolfloor.sh +15 -4
- package/payload/context-kit/smoke/agents-md.sh +12 -1
- package/payload/context-kit/smoke/install.sh +4 -1
- package/payload/delegation-kit/README.md +3 -3
- package/payload/delegation-kit/SPEC.md +499 -26
- package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
- package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
- package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
- package/payload/delegation-kit/lib/delegation.sh +1 -0
- package/payload/delegation-kit/smoke/install.sh +2 -1
- package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
- package/payload/delegation-kit/templates/agent-execution.md +127 -12
- package/payload/delegation-kit/templates/delegation-config.sh +4 -0
- package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
- package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
- package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
- package/payload/doctrine-kit/DOCTRINE.md +112 -11
- package/payload/doctrine-kit/README.md +12 -3
- package/payload/doctrine-kit/SPEC.md +163 -11
- package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
- package/payload/doctrine-kit/smoke/install.sh +167 -1
- package/payload/drift-kit/README.md +3 -2
- package/payload/drift-kit/SPEC.md +264 -22
- package/payload/drift-kit/bin/kfric.sh +21 -2
- package/payload/drift-kit/bin/stage-economics.sh +157 -3
- package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
- package/payload/drift-kit/smoke/install.sh +183 -1
- package/payload/drift-kit/templates/economics.md +9 -0
- package/payload/drift-kit/templates/kpis.list +6 -1
- package/payload/evidence-kit/README.md +20 -6
- package/payload/evidence-kit/SPEC.md +355 -17
- package/payload/evidence-kit/bin/run-validate.sh +51 -9
- package/payload/evidence-kit/checks/check-battery-roster.sh +87 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
- package/payload/evidence-kit/checks/check-producer-liveness.sh +35 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
- package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
- package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
- package/payload/evidence-kit/lib/evidence.sh +18 -0
- package/payload/evidence-kit/smoke/install.sh +17 -3
- package/payload/gate-sdk/README.md +17 -1
- package/payload/gate-sdk/SPEC.md +4427 -92
- package/payload/gate-sdk/bin/build-native.sh +38 -0
- package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
- package/payload/gate-sdk/bin/gen-pre-commit.sh +32 -2
- package/payload/gate-sdk/bin/port-blockers.sh +445 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
- package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
- package/payload/gate-sdk/bin/run-gates.sh +37 -2
- package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
- package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
- package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
- package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
- package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
- package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
- package/payload/gate-sdk/checks/check-core-files.sh +28 -4
- package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
- package/payload/gate-sdk/checks/check-exec-bit.sh +21 -1
- package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
- package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
- package/payload/gate-sdk/checks/check-gate-output.sh +41 -3
- package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
- package/payload/gate-sdk/checks/check-graph.sh +5 -5
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
- package/payload/gate-sdk/checks/check-identity.sh +1 -0
- package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
- package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
- package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
- package/payload/gate-sdk/checks/check-readme-roster.sh +6 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
- package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
- package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
- package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
- package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
- package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
- package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
- package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
- package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
- package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
- package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
- package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
- package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
- package/payload/gate-sdk/lib/gate.sh +208 -9
- package/payload/gate-sdk/lib/inject.sh +46 -1
- package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
- package/payload/gate-sdk/smoke/install.sh +61 -1
- package/payload/guard-kit/README.md +18 -14
- package/payload/guard-kit/SPEC.md +366 -72
- package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
- package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
- package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
- package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
- package/payload/guard-kit/guard-tests/cases.tsv +49 -7
- package/payload/guard-kit/lib/guard.sh +277 -54
- package/payload/guard-kit/templates/close-triage.md +38 -10
- package/payload/guard-kit/templates/guard-config.sh +3 -0
- package/payload/guard-kit/templates/settings-hooks.json +7 -1
- package/payload/lifecycle-kit/README.md +12 -1
- package/payload/lifecycle-kit/SPEC.md +991 -41
- package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
- package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
- package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
- package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
- package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
- package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
- package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
- package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
- package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
- package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -3
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
- package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
- package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
- package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
- package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
- package/payload/lifecycle-kit/lib/stages.sh +12 -2
- package/payload/lifecycle-kit/smoke/install.sh +83 -4
- package/payload/lifecycle-kit/templates/consult.md +73 -0
- package/payload/lifecycle-kit/templates/lead.md +139 -7
- package/payload/lifecycle-kit/templates/stages/align.md +12 -0
- package/payload/lifecycle-kit/templates/stages/build.md +8 -0
- package/payload/lifecycle-kit/templates/stages/close.md +45 -5
- package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
- package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
- package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
- package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
- package/payload/queue-kit/README.md +6 -1
- package/payload/queue-kit/SPEC.md +350 -6
- package/payload/queue-kit/bin/queue-counts.sh +35 -0
- package/payload/queue-kit/bin/queue-edges.sh +78 -0
- package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
- package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
- package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
- package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
- package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
- package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
- package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
- package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
- package/payload/queue-kit/checks/check-task-names.gate +3 -0
- package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
- package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
- package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
- package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
- package/payload/queue-kit/lib/queue.sh +4 -19
- package/payload/queue-kit/smoke/install.sh +4 -1
- package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
- package/payload/site-kit/SPEC.md +64 -27
- package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
- package/payload/site-kit/smoke/install.sh +9 -1
- package/profiles.list +36 -8
- package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
- package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
- package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
- package/payload/canon-kit/checks/check-install-claim.sh +0 -146
- package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
- package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
- package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
- package/payload/canon-kit/checks/check-md-refs.sh +0 -128
- package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
- package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
- package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
- package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
- package/payload/canon-kit/checks/check-spec-pointer.sh +0 -180
- package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
- package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
- package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
- package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
- package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
- package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
- package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
- package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
- package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
- package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
- package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
- package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
- package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
- package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -104
- package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
- package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
- package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
- package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
- package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
- package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
- package/payload/queue-kit/checks/check-task-names.sh +0 -128
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# spec: doctrine-kit/SPEC.md §install-doctrine — idempotent insert/replace of the doctrine reference block between fixed markers in the always-loaded agent file
|
|
2
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — idempotent insert/replace of the doctrine reference block between fixed markers in the always-loaded agent file, carrying the consumer's declared trims across the rewrite
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
@@ -9,16 +9,96 @@ source "$KIT/lib/doctrine.sh"
|
|
|
9
9
|
# shellcheck source=../../gate-sdk/lib/inject.sh
|
|
10
10
|
source "$SDK/lib/inject.sh"
|
|
11
11
|
|
|
12
|
+
BEGIN="<!-- doctrine-kit:begin -->"
|
|
13
|
+
END="<!-- doctrine-kit:end -->"
|
|
14
|
+
|
|
15
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — --remove: the reverse of the insert path over the same marker pair, riding gate-sdk's remove_marker_block (gate-sdk/SPEC.md §lib/inject.sh). It harvests no trims and emits no digest — a removal has nothing to carry forward — and reports what it did on the same channel (stdout) the insert path reports on. A missing agent file stays exit 2, unchanged.
|
|
16
|
+
if [[ "${1:-}" == "--remove" ]]; then
|
|
17
|
+
shift
|
|
18
|
+
AGENT_FILE="${1:-$DOCTRINE_KIT_AGENT_FILE}"
|
|
19
|
+
[[ -f "$AGENT_FILE" ]] \
|
|
20
|
+
|| { echo "install-doctrine: agent file not found: $AGENT_FILE — nothing to remove" >&2; exit 2; }
|
|
21
|
+
|
|
22
|
+
result="$(remove_marker_block "$AGENT_FILE" "$BEGIN" "$END")" || exit $?
|
|
23
|
+
if [[ "$result" == "removed" ]]; then
|
|
24
|
+
echo "install-doctrine: removed the doctrine reference block from $AGENT_FILE"
|
|
25
|
+
else
|
|
26
|
+
echo "install-doctrine: no doctrine reference block found in $AGENT_FILE — nothing to remove"
|
|
27
|
+
fi
|
|
28
|
+
exit 0
|
|
29
|
+
fi
|
|
30
|
+
|
|
12
31
|
AGENT_FILE="${1:-$DOCTRINE_KIT_AGENT_FILE}"
|
|
13
32
|
DOCTRINE_FILE="${2:-$DOCTRINE_KIT_DOCTRINE_FILE}"
|
|
14
33
|
[[ -f "$AGENT_FILE" ]] \
|
|
15
34
|
|| { echo "install-doctrine: agent file not found: $AGENT_FILE — nothing to install into" >&2; exit 2; }
|
|
16
35
|
|
|
17
|
-
|
|
18
|
-
|
|
36
|
+
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — the doctrine-side section heading is kit mechanism (the kit ships DOCTRINE.md), never config
|
|
37
|
+
METH_SECTION="## Methodology-maintenance rules"
|
|
19
38
|
|
|
20
|
-
|
|
21
|
-
|
|
39
|
+
[[ -f "$DOCTRINE_FILE" ]] \
|
|
40
|
+
|| { echo "install-doctrine: doctrine file not found: $DOCTRINE_FILE — nothing to derive the digest from" >&2; exit 2; }
|
|
41
|
+
|
|
42
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the rule walk: name read exactly as check-doctrine-registration assertion C reads it, summary read from the rule's own *Digest:* trailer exactly as assertion E counts it
|
|
43
|
+
read -r -d '' DIGEST_WALK <<'AWK' || true
|
|
44
|
+
function hlevel(line, n) {
|
|
45
|
+
if (line !~ /^#+[[:space:]]/) return 0
|
|
46
|
+
n = 0
|
|
47
|
+
while (substr(line, n + 1, 1) == "#") n++
|
|
48
|
+
return n
|
|
49
|
+
}
|
|
50
|
+
function flush() {
|
|
51
|
+
if (have) print cur_name "\t" dcount "\t" summary
|
|
52
|
+
}
|
|
53
|
+
!insec {
|
|
54
|
+
if (hlevel($0) > 0 && substr($0, 1, length(section)) == section) {
|
|
55
|
+
insec = 1; seen = 1; start_lvl = hlevel($0)
|
|
56
|
+
}
|
|
57
|
+
next
|
|
58
|
+
}
|
|
59
|
+
insec && hlevel($0) > 0 && hlevel($0) <= start_lvl { flush(); insec = 0; have = 0; next }
|
|
60
|
+
insec {
|
|
61
|
+
if ($0 ~ /^[0-9]+\.[[:space:]]+\*\*/) {
|
|
62
|
+
flush()
|
|
63
|
+
name = $0
|
|
64
|
+
sub(/^[0-9]+\.[[:space:]]+\*\*/, "", name)
|
|
65
|
+
sub(/\*\*.*/, "", name)
|
|
66
|
+
sub(/\.$/, "", name)
|
|
67
|
+
cur_name = name; have = 1; dcount = 0; summary = ""
|
|
68
|
+
} else if ($0 ~ /^[[:space:]]*\*Digest:\*/) {
|
|
69
|
+
dcount++
|
|
70
|
+
val = $0
|
|
71
|
+
sub(/^[[:space:]]*\*Digest:\*[[:space:]]*/, "", val)
|
|
72
|
+
sub(/[[:space:]]+$/, "", val)
|
|
73
|
+
if (dcount == 1) summary = val
|
|
74
|
+
}
|
|
75
|
+
next
|
|
76
|
+
}
|
|
77
|
+
END { flush(); if (!seen) print "@@NOSECTION" }
|
|
78
|
+
AWK
|
|
79
|
+
|
|
80
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — derived once at top level, never inside digest(): digest() is read through process substitution, where an exit would end the subshell and let a malformed doctrine through as a silently short digest
|
|
81
|
+
WALK_OUT="$(awk -v section="$METH_SECTION" "$DIGEST_WALK" "$DOCTRINE_FILE")" \
|
|
82
|
+
|| { echo "install-doctrine: awk failed reading $DOCTRINE_FILE" >&2; exit 2; }
|
|
83
|
+
if [[ "$WALK_OUT" == "@@NOSECTION" ]]; then
|
|
84
|
+
echo "install-doctrine: no '$METH_SECTION' section in $DOCTRINE_FILE — cannot derive the digest from an unreadable rule set" >&2
|
|
85
|
+
exit 2
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
BULLETS=()
|
|
89
|
+
while IFS=$'\t' read -r rname dcount summary; do
|
|
90
|
+
[[ -n "$rname" ]] || continue
|
|
91
|
+
if [[ "$dcount" != 1 ]]; then
|
|
92
|
+
echo "install-doctrine: methodology rule '$rname' carries $dcount *Digest:* trailer(s) in $DOCTRINE_FILE, want exactly one — refusing to emit a digest missing or double-sourcing its bullet" >&2
|
|
93
|
+
exit 2
|
|
94
|
+
fi
|
|
95
|
+
BULLETS+=("- **$rname** — $summary")
|
|
96
|
+
done <<< "$WALK_OUT"
|
|
97
|
+
[[ ${#BULLETS[@]} -gt 0 ]] \
|
|
98
|
+
|| { echo "install-doctrine: no methodology rules found under '$METH_SECTION' in $DOCTRINE_FILE — refusing to install an empty digest" >&2; exit 2; }
|
|
99
|
+
|
|
100
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the untrimmed digest: the always-loaded shape applied to the doctrine itself, a one-line-per-rule digest plus the markdown link to the doctrine file
|
|
101
|
+
digest() {
|
|
22
102
|
cat <<EOF
|
|
23
103
|
## Delivery doctrine
|
|
24
104
|
|
|
@@ -26,19 +106,89 @@ The cross-kit delivery rules live in [$DOCTRINE_FILE]($DOCTRINE_FILE) — re-ven
|
|
|
26
106
|
to upgrade. The always-loaded maintenance rules, one line each; the doctrine adds
|
|
27
107
|
an engineering-craft section behind the link:
|
|
28
108
|
|
|
29
|
-
- **Content-tiering / SSOT** — one content tier per surface; point, never restate.
|
|
30
|
-
- **Enforcement-first** — the fix and the gate that catches it land in one unit; removing the duplication outranks gating it.
|
|
31
|
-
- **De-literalization** — prose cites names; code or the owning SPEC owns values.
|
|
32
|
-
- **Derivation-first** — derive the derivable (a roster, a count), never maintain it; a needed copy is generated and freshness-gated.
|
|
33
|
-
- **Always-loaded shape** — one line per rule here; the mechanism behind the pointer.
|
|
34
|
-
- **Load-trigger residency** — resident only when no stage, skill, or tool loads it.
|
|
35
|
-
- **Widest-true-tier placement** — the widest tier true for every reader of it.
|
|
36
|
-
- **Oracle-first** — run the gate, never emulate it; a red run is the feedback channel.
|
|
37
|
-
- **Spec-over-precedent** — the owner doc is ground truth; history answers what happened, never what is correct.
|
|
38
|
-
- **Gap disposition** — a gap you defer is costed and filed, never flagged-and-skipped.
|
|
39
|
-
- **Scope-gated intake** — a mid-session initiative is filed as a costed Deferred entry by default, never started; work enters only through scope.
|
|
40
109
|
EOF
|
|
110
|
+
printf '%s\n' "${BULLETS[@]}"
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — a digest bullet's rule name, extracted exactly as check-doctrine-registration extracts it (assertion C), so the substitution keys on the same string the gate keys on
|
|
114
|
+
bullet_name() { # $1 = a digest line -> its bold lead-in name, non-zero when the line is not a rule bullet
|
|
115
|
+
local l="$1"
|
|
116
|
+
[[ "$l" == "- **"*"**"* ]] || return 1
|
|
117
|
+
l="${l#- \*\*}"
|
|
118
|
+
printf '%s\n' "${l%%\*\**}"
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the declared-trim grammar read exactly as check-doctrine-registration reads it (assertion B), so installer and gate never disagree about which rule a marker names
|
|
122
|
+
harvest_trims() { # block content on stdin -> one '<rule name><TAB><marker line verbatim>' per declared trim, in declaration order
|
|
123
|
+
awk '
|
|
124
|
+
/doctrine-digest-trim:/ {
|
|
125
|
+
name = $0
|
|
126
|
+
sub(/^.*doctrine-digest-trim:[[:space:]]*/, "", name)
|
|
127
|
+
sub(/[[:space:]]*—.*$/, "", name)
|
|
128
|
+
print name "\t" $0
|
|
129
|
+
}
|
|
130
|
+
'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the round-trip's read half: the block as it stands is the only record of what the consumer declared, so it is harvested before the rewrite that would erase it
|
|
134
|
+
CURRENT="$(read_marker_block "$AGENT_FILE" "$BEGIN" "$END")" || exit $?
|
|
135
|
+
|
|
136
|
+
declare -A TRIM_LINE=()
|
|
137
|
+
TRIM_ORDER=()
|
|
138
|
+
DUPES=()
|
|
139
|
+
while IFS=$'\t' read -r tname tline; do
|
|
140
|
+
[[ -n "$tname" ]] || continue
|
|
141
|
+
if [[ -n "${TRIM_LINE[$tname]+set}" ]]; then
|
|
142
|
+
DUPES+=("$tname")
|
|
143
|
+
continue
|
|
144
|
+
fi
|
|
145
|
+
TRIM_LINE["$tname"]="$tline"
|
|
146
|
+
TRIM_ORDER+=("$tname")
|
|
147
|
+
done < <(printf '%s\n' "$CURRENT" | harvest_trims)
|
|
148
|
+
|
|
149
|
+
declare -A IS_RULE=()
|
|
150
|
+
while IFS= read -r dline; do
|
|
151
|
+
if rname="$(bullet_name "$dline")"; then IS_RULE["$rname"]=1; fi
|
|
152
|
+
done < <(digest)
|
|
153
|
+
|
|
154
|
+
ORPHANS=()
|
|
155
|
+
if [[ ${#TRIM_ORDER[@]} -gt 0 ]]; then
|
|
156
|
+
for tname in "${TRIM_ORDER[@]}"; do
|
|
157
|
+
[[ -n "${IS_RULE[$tname]:-}" ]] || ORPHANS+=("$tname")
|
|
158
|
+
done
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the emit: a trimmed rule's marker replaces its bullet in place, because a block carrying both would satisfy the gate while handing back the rule the consumer removed
|
|
162
|
+
block() {
|
|
163
|
+
local line name
|
|
164
|
+
while IFS= read -r line; do
|
|
165
|
+
if name="$(bullet_name "$line")" && [[ -n "${TRIM_LINE[$name]+set}" ]]; then
|
|
166
|
+
printf '%s\n' "${TRIM_LINE[$name]}"
|
|
167
|
+
continue
|
|
168
|
+
fi
|
|
169
|
+
printf '%s\n' "$line"
|
|
170
|
+
done < <(digest)
|
|
171
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — a trim naming no live rule has no bullet position to take, so it is carried at the digest's end rather than dropped
|
|
172
|
+
if [[ ${#ORPHANS[@]} -gt 0 ]]; then
|
|
173
|
+
for name in "${ORPHANS[@]}"; do printf '%s\n' "${TRIM_LINE[$name]}"; done
|
|
174
|
+
fi
|
|
41
175
|
}
|
|
42
176
|
|
|
43
177
|
action="$(block | inject_marker_block "$AGENT_FILE" "$BEGIN" "$END")" || exit $?
|
|
44
|
-
|
|
178
|
+
|
|
179
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — findings go to stderr, the one channel init does not discard, so a reconciliation the consumer owes is never silent on the install path
|
|
180
|
+
if [[ ${#ORPHANS[@]} -gt 0 ]]; then
|
|
181
|
+
for tname in "${ORPHANS[@]}"; do
|
|
182
|
+
echo "install-doctrine: declared trim names '$tname', which no rule in the current doctrine digest matches — carried forward unchanged; adopt the renamed rule or drop the marker" >&2
|
|
183
|
+
done
|
|
184
|
+
fi
|
|
185
|
+
if [[ ${#DUPES[@]} -gt 0 ]]; then
|
|
186
|
+
for tname in "${DUPES[@]}"; do
|
|
187
|
+
echo "install-doctrine: duplicate declared trim for '$tname' — the first is carried, the duplicate dropped" >&2
|
|
188
|
+
done
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
findings=""
|
|
192
|
+
if [[ ${#ORPHANS[@]} -gt 0 ]]; then findings="$findings, ${#ORPHANS[@]} unmatched"; fi
|
|
193
|
+
if [[ ${#DUPES[@]} -gt 0 ]]; then findings="$findings, ${#DUPES[@]} duplicate"; fi
|
|
194
|
+
echo "install-doctrine: $action the doctrine reference block in $AGENT_FILE (link → $DOCTRINE_FILE); ${#TRIM_ORDER[@]} declared trim(s) carried$findings"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# graph: couples=CLAUDE.md,doctrine-kit/DOCTRINE.md dir=one valve=none tier=precommit
|
|
3
|
+
# install: zero-config
|
|
3
4
|
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — the always-loaded agent file links the doctrine file and holds its methodology-rule digest in per-rule lockstep with DOCTRINE.md, fail-closed when a scanned file or section is missing
|
|
4
5
|
#
|
|
5
6
|
# usage: check-doctrine-registration.sh [agent-file [doctrine-file]]
|
|
@@ -84,8 +85,8 @@ insec {
|
|
|
84
85
|
END { if (!seen) print "@@NOSECTION" }
|
|
85
86
|
AWK
|
|
86
87
|
|
|
87
|
-
# spec: doctrine-kit/SPEC.md §check-doctrine-registration —
|
|
88
|
-
read -r -d ''
|
|
88
|
+
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — assertions D and E share one walk over a register's numbered rules, counting a named per-rule trailer and grading its value: D is `Stages` over the craft register, E is `Digest` over the methodology register
|
|
89
|
+
read -r -d '' TRAILER_WALK <<'AWK' || true
|
|
89
90
|
function hlevel(line, n) {
|
|
90
91
|
if (line !~ /^#+[[:space:]]/) return 0
|
|
91
92
|
n = 0
|
|
@@ -93,7 +94,11 @@ function hlevel(line, n) {
|
|
|
93
94
|
return n
|
|
94
95
|
}
|
|
95
96
|
function flush() {
|
|
96
|
-
if (have) print "C\t" cur_name "\t"
|
|
97
|
+
if (have) print "C\t" cur_name "\t" tcount "\t" bad
|
|
98
|
+
}
|
|
99
|
+
BEGIN {
|
|
100
|
+
mark = "^[[:space:]]*\\*" trailer ":\\*"
|
|
101
|
+
strip = mark "[[:space:]]*"
|
|
97
102
|
}
|
|
98
103
|
!insec {
|
|
99
104
|
if (hlevel($0) > 0 && substr($0, 1, length(section)) == section) {
|
|
@@ -109,13 +114,15 @@ insec {
|
|
|
109
114
|
sub(/^[0-9]+\.[[:space:]]+\*\*/, "", name)
|
|
110
115
|
sub(/\*\*.*/, "", name)
|
|
111
116
|
sub(/\.$/, "", name)
|
|
112
|
-
cur_name = name; have = 1;
|
|
113
|
-
} else if ($0 ~
|
|
114
|
-
|
|
117
|
+
cur_name = name; have = 1; tcount = 0; bad = 0
|
|
118
|
+
} else if ($0 ~ mark) {
|
|
119
|
+
tcount++
|
|
115
120
|
val = $0
|
|
116
|
-
sub(
|
|
121
|
+
sub(strip, "", val)
|
|
117
122
|
sub(/[[:space:]]+$/, "", val)
|
|
118
|
-
if (
|
|
123
|
+
if (grammar == "stages") {
|
|
124
|
+
if (val != "—" && val !~ /^[a-z]+(,[[:space:]]+[a-z]+)*$/) bad = 1
|
|
125
|
+
} else if (val == "") bad = 1
|
|
119
126
|
}
|
|
120
127
|
next
|
|
121
128
|
}
|
|
@@ -139,7 +146,7 @@ if [[ "$digest_out" == "@@NOSECTION" ]]; then
|
|
|
139
146
|
exit 2 # exit 2: fail-closed
|
|
140
147
|
fi
|
|
141
148
|
|
|
142
|
-
craft_out="$(awk -v section="$CRAFT_SECTION" "$
|
|
149
|
+
craft_out="$(awk -v section="$CRAFT_SECTION" -v trailer=Stages -v grammar=stages "$TRAILER_WALK" "$DOCTRINE_FILE")"; st=$?
|
|
143
150
|
fail_closed "$st" check-doctrine-registration awk
|
|
144
151
|
if [[ "$craft_out" == "@@NOSECTION" ]]; then
|
|
145
152
|
echo "check-doctrine-registration: no '$CRAFT_SECTION' section in $DOCTRINE_FILE — cannot certify the stage-routing trailers against an unreadable rule set" >&2
|
|
@@ -159,6 +166,20 @@ while IFS=$'\t' read -r kind name scount bad; do
|
|
|
159
166
|
fi
|
|
160
167
|
done <<< "$craft_out"
|
|
161
168
|
|
|
169
|
+
# spec: doctrine-kit/SPEC.md §check-doctrine-registration — assertion E: every methodology rule carries exactly one non-empty *Digest:* trailer, the surface install-doctrine derives its bullet from
|
|
170
|
+
meth_out="$(awk -v section="$METH_SECTION" -v trailer=Digest -v grammar=digest "$TRAILER_WALK" "$DOCTRINE_FILE")"; st=$?
|
|
171
|
+
fail_closed "$st" check-doctrine-registration awk
|
|
172
|
+
|
|
173
|
+
digest_findings=()
|
|
174
|
+
while IFS=$'\t' read -r kind name dcount bad; do
|
|
175
|
+
[[ "$kind" == C ]] || continue
|
|
176
|
+
if [[ "$dcount" -ne 1 ]]; then
|
|
177
|
+
digest_findings+=("methodology rule carries $dcount *Digest:* trailer(s), want exactly one: $name")
|
|
178
|
+
elif [[ "$bad" == 1 ]]; then
|
|
179
|
+
digest_findings+=("methodology rule's *Digest:* value is empty: $name")
|
|
180
|
+
fi
|
|
181
|
+
done <<< "$meth_out"
|
|
182
|
+
|
|
162
183
|
declare -A in_digest in_trim in_doctrine
|
|
163
184
|
digest_names=()
|
|
164
185
|
trim_count=0
|
|
@@ -186,7 +207,7 @@ for name in "${digest_names[@]+"${digest_names[@]}"}"; do
|
|
|
186
207
|
[[ -z "${in_doctrine[$name]:-}" ]] && orphans+=("$name")
|
|
187
208
|
done
|
|
188
209
|
|
|
189
|
-
if [[ ${#missing[@]} -gt 0 || ${#orphans[@]} -gt 0 || ${#craft_findings[@]} -gt 0 ]]; then
|
|
210
|
+
if [[ ${#missing[@]} -gt 0 || ${#orphans[@]} -gt 0 || ${#craft_findings[@]} -gt 0 || ${#digest_findings[@]} -gt 0 ]]; then
|
|
190
211
|
if [[ ${#missing[@]} -gt 0 || ${#orphans[@]} -gt 0 ]]; then
|
|
191
212
|
echo "check-doctrine-registration: the digest and the doctrine are out of lockstep in $AGENT_FILE:"
|
|
192
213
|
for name in "${missing[@]+"${missing[@]}"}"; do
|
|
@@ -209,8 +230,17 @@ if [[ ${#missing[@]} -gt 0 || ${#orphans[@]} -gt 0 || ${#craft_findings[@]} -gt
|
|
|
209
230
|
echo " trailer ('*Stages:* —' for none) so a re-vendored DOCTRINE.md that adds an"
|
|
210
231
|
echo " untagged craft rule reddens instead of silently dropping out of stage routing."
|
|
211
232
|
fi
|
|
233
|
+
if [[ ${#digest_findings[@]} -gt 0 ]]; then
|
|
234
|
+
echo "check-doctrine-registration: the digest trailers are out of grammar in $DOCTRINE_FILE:"
|
|
235
|
+
for f in "${digest_findings[@]}"; do
|
|
236
|
+
echo " $f"
|
|
237
|
+
done
|
|
238
|
+
echo " help: every methodology rule owns exactly one non-empty '*Digest:* <one-line summary>'"
|
|
239
|
+
echo " trailer — install-doctrine.sh derives that rule's digest bullet from it, so an"
|
|
240
|
+
echo " untrailered rule would ship every consumer a digest one rule short."
|
|
241
|
+
fi
|
|
212
242
|
exit 1
|
|
213
243
|
fi
|
|
214
244
|
|
|
215
|
-
echo "DOCTRINE-REGISTRATION: clean ($AGENT_FILE links $DOCTRINE_FILE; $rule_count methodology rule(s) in per-rule digest lockstep, $trim_count declared trim(s); $craft_count craft rule(s) each carry one *Stages:* trailer)"
|
|
245
|
+
echo "DOCTRINE-REGISTRATION: clean ($AGENT_FILE links $DOCTRINE_FILE; $rule_count methodology rule(s) in per-rule digest lockstep, $trim_count declared trim(s), each carrying one *Digest:* trailer; $craft_count craft rule(s) each carry one *Stages:* trailer)"
|
|
216
246
|
exit 0
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
## Methodology-maintenance rules
|
|
4
4
|
|
|
5
5
|
1. **Content-tiering / SSOT.** One content tier per surface; point, never restate.
|
|
6
|
+
*Digest:* one content tier per surface; point, never restate.
|
|
6
7
|
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
8
|
+
*Digest:* the fix and the gate land in one unit.
|
|
7
9
|
3. **De-literalization.** Prose cites names; code owns values.
|
|
10
|
+
*Digest:* prose cites names; code owns values.
|
|
8
11
|
|
|
9
12
|
## Engineering-craft rules
|
|
10
13
|
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
## Methodology-maintenance rules
|
|
4
4
|
|
|
5
5
|
1. **Content-tiering / SSOT.** One content tier per surface; point, never restate.
|
|
6
|
+
*Digest:* one content tier per surface; point, never restate.
|
|
6
7
|
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
8
|
+
*Digest:* the fix and the gate land in one unit.
|
|
7
9
|
3. **De-literalization.** Prose cites names; code owns values.
|
|
10
|
+
*Digest:* prose cites names; code owns values.
|
|
8
11
|
|
|
9
12
|
## Engineering-craft rules
|
|
10
13
|
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
# harness admits one bad/ dir, so this drives the digest-extra-line case
|
|
6
6
|
# (assertion C), the declared-trim case (assertion B satisfied by a trim marker),
|
|
7
7
|
# the link-absent case (assertion A), the craft-trailer cases (assertion D:
|
|
8
|
-
# untagged and malformed),
|
|
8
|
+
# untagged and malformed), the digest-trailer cases (assertion E: untrailered,
|
|
9
|
+
# doubled and empty), and the four fail-closed exits.
|
|
9
10
|
#
|
|
10
11
|
# Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
|
|
11
12
|
set -uo pipefail
|
|
@@ -39,8 +40,11 @@ write_doctrine() { # $1=dir
|
|
|
39
40
|
## Methodology-maintenance rules
|
|
40
41
|
|
|
41
42
|
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
43
|
+
*Digest:* one tier per surface.
|
|
42
44
|
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
45
|
+
*Digest:* fix and gate in one unit.
|
|
43
46
|
3. **De-literalization.** Prose cites names; code owns values.
|
|
47
|
+
*Digest:* prose cites names.
|
|
44
48
|
|
|
45
49
|
## Engineering-craft rules
|
|
46
50
|
|
|
@@ -160,8 +164,11 @@ cat >"$u/DOCTRINE.md" <<'EOF'
|
|
|
160
164
|
## Methodology-maintenance rules
|
|
161
165
|
|
|
162
166
|
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
167
|
+
*Digest:* one tier per surface.
|
|
163
168
|
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
169
|
+
*Digest:* fix and gate in one unit.
|
|
164
170
|
3. **De-literalization.** Prose cites names; code owns values.
|
|
171
|
+
*Digest:* prose cites names.
|
|
165
172
|
|
|
166
173
|
## Engineering-craft rules
|
|
167
174
|
|
|
@@ -177,8 +184,11 @@ cat >"$f/DOCTRINE.md" <<'EOF'
|
|
|
177
184
|
## Methodology-maintenance rules
|
|
178
185
|
|
|
179
186
|
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
187
|
+
*Digest:* one tier per surface.
|
|
180
188
|
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
189
|
+
*Digest:* fix and gate in one unit.
|
|
181
190
|
3. **De-literalization.** Prose cites names; code owns values.
|
|
191
|
+
*Digest:* prose cites names.
|
|
182
192
|
|
|
183
193
|
## Engineering-craft rules
|
|
184
194
|
|
|
@@ -195,14 +205,84 @@ cat >"$c/DOCTRINE.md" <<'EOF'
|
|
|
195
205
|
## Methodology-maintenance rules
|
|
196
206
|
|
|
197
207
|
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
208
|
+
*Digest:* one tier per surface.
|
|
198
209
|
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
210
|
+
*Digest:* fix and gate in one unit.
|
|
199
211
|
3. **De-literalization.** Prose cites names; code owns values.
|
|
212
|
+
*Digest:* prose cites names.
|
|
200
213
|
EOF
|
|
201
214
|
check_case "craft-section-missing-failclosed" "$c" 2 "Engineering-craft rules"
|
|
202
215
|
|
|
216
|
+
# --- meth-untrailered: a methodology rule with no *Digest:* trailer (assertion E) ---
|
|
217
|
+
# The defect this assertion exists for: the rule reaches the doctrine, the digest
|
|
218
|
+
# has nothing to generate its bullet from, and every fresh install ships one short.
|
|
219
|
+
n="$SANDBOX/untrailered"; mkdir -p "$n"; write_full_agent "$n"
|
|
220
|
+
cat >"$n/DOCTRINE.md" <<'EOF'
|
|
221
|
+
# DOCTRINE.md — fixture doctrine
|
|
222
|
+
|
|
223
|
+
## Methodology-maintenance rules
|
|
224
|
+
|
|
225
|
+
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
226
|
+
*Digest:* one tier per surface.
|
|
227
|
+
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
228
|
+
*Digest:* fix and gate in one unit.
|
|
229
|
+
3. **De-literalization.** Untrailered — no *Digest:* line.
|
|
230
|
+
|
|
231
|
+
## Engineering-craft rules
|
|
232
|
+
|
|
233
|
+
4. **Rename is a full-surface sweep.** Behind the link — never digested.
|
|
234
|
+
*Stages:* build
|
|
235
|
+
EOF
|
|
236
|
+
check_case "meth-untrailered" "$n" 1 "carries 0 *Digest:* trailer(s)"
|
|
237
|
+
|
|
238
|
+
# --- meth-double-trailer: two *Digest:* trailers on one rule (assertion E) ---
|
|
239
|
+
# Two trailers is not a harmless duplicate: the installer would silently pick one
|
|
240
|
+
# and the rule's digest line would stop being decidable from the doctrine.
|
|
241
|
+
w="$SANDBOX/doubled"; mkdir -p "$w"; write_full_agent "$w"
|
|
242
|
+
cat >"$w/DOCTRINE.md" <<'EOF'
|
|
243
|
+
# DOCTRINE.md — fixture doctrine
|
|
244
|
+
|
|
245
|
+
## Methodology-maintenance rules
|
|
246
|
+
|
|
247
|
+
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
248
|
+
*Digest:* one tier per surface.
|
|
249
|
+
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
250
|
+
*Digest:* fix and gate in one unit.
|
|
251
|
+
3. **De-literalization.** Two trailers, so the bullet is undecidable.
|
|
252
|
+
*Digest:* prose cites names.
|
|
253
|
+
*Digest:* code owns values.
|
|
254
|
+
|
|
255
|
+
## Engineering-craft rules
|
|
256
|
+
|
|
257
|
+
4. **Rename is a full-surface sweep.** Behind the link — never digested.
|
|
258
|
+
*Stages:* build
|
|
259
|
+
EOF
|
|
260
|
+
check_case "meth-double-trailer" "$w" 1 "carries 2 *Digest:* trailer(s)"
|
|
261
|
+
|
|
262
|
+
# --- meth-empty-trailer: a *Digest:* trailer with no summary (assertion E) ---
|
|
263
|
+
e="$SANDBOX/emptytrailer"; mkdir -p "$e"; write_full_agent "$e"
|
|
264
|
+
cat >"$e/DOCTRINE.md" <<'EOF'
|
|
265
|
+
# DOCTRINE.md — fixture doctrine
|
|
266
|
+
|
|
267
|
+
## Methodology-maintenance rules
|
|
268
|
+
|
|
269
|
+
1. **Content-tiering / SSOT.** One content tier per surface.
|
|
270
|
+
*Digest:* one tier per surface.
|
|
271
|
+
2. **Enforcement-first.** The fix and the gate land in one unit.
|
|
272
|
+
*Digest:* fix and gate in one unit.
|
|
273
|
+
3. **De-literalization.** Present but empty — a bullet with no summary.
|
|
274
|
+
*Digest:*
|
|
275
|
+
|
|
276
|
+
## Engineering-craft rules
|
|
277
|
+
|
|
278
|
+
4. **Rename is a full-surface sweep.** Behind the link — never digested.
|
|
279
|
+
*Stages:* build
|
|
280
|
+
EOF
|
|
281
|
+
check_case "meth-empty-trailer" "$e" 1 "*Digest:* value is empty"
|
|
282
|
+
|
|
203
283
|
if [[ "$fails" -gt 0 ]]; then
|
|
204
284
|
echo "check-doctrine-registration.test.sh: $fails case(s) failed"
|
|
205
285
|
exit 1
|
|
206
286
|
fi
|
|
207
|
-
echo "check-doctrine-registration.test.sh: clean (extra-line + declared-trim + link-absent + craft-untagged + craft-malformed + 4 fail-closed,
|
|
287
|
+
echo "check-doctrine-registration.test.sh: clean (extra-line + declared-trim + link-absent + craft-untagged + craft-malformed + meth-untrailered + meth-double-trailer + meth-empty-trailer + 4 fail-closed, 12 cases)"
|
|
208
288
|
exit 0
|
|
@@ -15,10 +15,176 @@ EOF
|
|
|
15
15
|
fi
|
|
16
16
|
bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" >/dev/null
|
|
17
17
|
|
|
18
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — every assertion below reads the doctrine block alone, never the whole agent file: a consumer with several kits installed carries several marker blocks in one CLAUDE.md, and a bullet outside this kit's span is not this kit's to reason about
|
|
19
|
+
SMOKE_BEGIN="<!-- doctrine-kit:begin -->"
|
|
20
|
+
SMOKE_END="<!-- doctrine-kit:end -->"
|
|
21
|
+
smoke_block() { awk -v b="$SMOKE_BEGIN" -v e="$SMOKE_END" '$0 == e { inb = 0 } inb; $0 == b { inb = 1 }' CLAUDE.md; }
|
|
22
|
+
|
|
23
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the declared-trim round-trip's acceptor. inject.sh is a sourced library with no gate surface (gate-sdk/SPEC.md §lib/inject.sh), so its read half and this installer's preservation rule are exercised here: declare a trim in the block the installer just emitted, re-run the installer, and hold that the marker survived *in the trimmed bullet's position* with the bullet gone and the gate green
|
|
24
|
+
mapfile -t SMOKE_RULES < <(smoke_block | awk '/^- \*\*/ { sub(/^- \*\*/, ""); sub(/\*\*.*/, ""); print }')
|
|
25
|
+
if [[ ${#SMOKE_RULES[@]} -lt 2 ]]; then
|
|
26
|
+
echo "doctrine smoke: the installed digest has fewer than two rule bullets — nothing to trim against" >&2
|
|
27
|
+
exit 2
|
|
28
|
+
fi
|
|
29
|
+
SMOKE_TRIMMED="${SMOKE_RULES[0]}"
|
|
30
|
+
SMOKE_NEXT="- **${SMOKE_RULES[1]}**"
|
|
31
|
+
SMOKE_TRIM="<!-- doctrine-digest-trim: $SMOKE_TRIMMED — smoke: the declared-trim round-trip acceptor -->"
|
|
32
|
+
|
|
33
|
+
awk -v b="$SMOKE_BEGIN" -v e="$SMOKE_END" -v bullet="- **$SMOKE_TRIMMED**" -v trim="$SMOKE_TRIM" '
|
|
34
|
+
$0 == b { inb = 1 }
|
|
35
|
+
$0 == e { inb = 0 }
|
|
36
|
+
inb && index($0, bullet) == 1 { print trim; next }
|
|
37
|
+
{ print }
|
|
38
|
+
' CLAUDE.md > CLAUDE.md.smoke && mv CLAUDE.md.smoke CLAUDE.md
|
|
39
|
+
|
|
40
|
+
bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" >/dev/null
|
|
41
|
+
|
|
42
|
+
if ! smoke_block | grep -qF -- "$SMOKE_TRIM"; then
|
|
43
|
+
echo "doctrine smoke: the re-run dropped the declared trim for '$SMOKE_TRIMMED' — init silently revokes a customization doctrine-kit's own gate grants" >&2
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
if smoke_block | grep -qF -- "- **$SMOKE_TRIMMED**"; then
|
|
47
|
+
echo "doctrine smoke: the re-run restored the bullet for '$SMOKE_TRIMMED' — a block carrying the trim *and* its bullet hands back the rule the consumer removed" >&2
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
if [[ "$(smoke_block | grep -A1 -F -- "$SMOKE_TRIM" | tail -n1)" != "$SMOKE_NEXT"* ]]; then
|
|
51
|
+
echo "doctrine smoke: the carried trim for '$SMOKE_TRIMMED' is not in the trimmed bullet's position (expected '$SMOKE_NEXT' beneath it)" >&2
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
bash "$SMOKE_KIT_ROOT/checks/check-doctrine-registration.sh" >/dev/null \
|
|
55
|
+
|| { echo "doctrine smoke: check-doctrine-registration is not green across the trim round-trip" >&2; exit 1; }
|
|
56
|
+
|
|
57
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the two reported findings, each carried *and* named. Both ride stderr, so this captures that channel and not stdout
|
|
58
|
+
SMOKE_ORPHAN="<!-- doctrine-digest-trim: Rule-that-left — smoke: renamed upstream -->"
|
|
59
|
+
SMOKE_DUP="<!-- doctrine-digest-trim: $SMOKE_TRIMMED — smoke: a second declaration for one rule -->"
|
|
60
|
+
awk -v e="$SMOKE_END" -v orphan="$SMOKE_ORPHAN" -v dup="$SMOKE_DUP" '
|
|
61
|
+
$0 == e { print orphan; print dup }
|
|
62
|
+
{ print }
|
|
63
|
+
' CLAUDE.md > CLAUDE.md.smoke && mv CLAUDE.md.smoke CLAUDE.md
|
|
64
|
+
|
|
65
|
+
SMOKE_ERR="$(bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" 2>&1 >/dev/null)"
|
|
66
|
+
if ! smoke_block | grep -qF -- "$SMOKE_ORPHAN"; then
|
|
67
|
+
echo "doctrine smoke: the re-run dropped a trim naming no live rule — a rule renamed upstream must survive to the re-vendor moment, not vanish before the consumer can reconcile it" >&2
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
case "$SMOKE_ERR" in
|
|
71
|
+
*Rule-that-left*) : ;;
|
|
72
|
+
*) echo "doctrine smoke: a trim naming no live rule was carried but never reported (stderr was: $SMOKE_ERR)" >&2; exit 1 ;;
|
|
73
|
+
esac
|
|
74
|
+
if [[ "$(smoke_block | grep -cF -- "doctrine-digest-trim: $SMOKE_TRIMMED")" != "1" ]]; then
|
|
75
|
+
echo "doctrine smoke: the duplicate trim for '$SMOKE_TRIMMED' was not carried exactly once" >&2
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
case "$SMOKE_ERR" in
|
|
79
|
+
*duplicate*"$SMOKE_TRIMMED"*) : ;;
|
|
80
|
+
*) echo "doctrine smoke: the duplicate trim for '$SMOKE_TRIMMED' was collapsed silently (stderr was: $SMOKE_ERR)" >&2; exit 1 ;;
|
|
81
|
+
esac
|
|
82
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — carrying an unmatched trim forward is only safe if the gate tolerates one; a gate that red on it would hand the consumer a broken battery instead of a reconciliation
|
|
83
|
+
bash "$SMOKE_KIT_ROOT/checks/check-doctrine-registration.sh" >/dev/null \
|
|
84
|
+
|| { echo "doctrine smoke: check-doctrine-registration reds on a carried-forward trim naming no live rule — carrying it forward would break the consumer's battery" >&2; exit 1; }
|
|
85
|
+
|
|
86
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the other direction, and the reason the smoke's steady state is an untrimmed consumer: withdrawing the declarations restores the bullet where it was
|
|
87
|
+
grep -v -F -e "$SMOKE_TRIM" -e "$SMOKE_ORPHAN" -e "$SMOKE_DUP" CLAUDE.md > CLAUDE.md.smoke && mv CLAUDE.md.smoke CLAUDE.md
|
|
88
|
+
bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" >/dev/null
|
|
89
|
+
if ! smoke_block | grep -qF -- "- **$SMOKE_TRIMMED**"; then
|
|
90
|
+
echo "doctrine smoke: withdrawing the trim for '$SMOKE_TRIMMED' did not restore its bullet" >&2
|
|
91
|
+
exit 1
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the --remove path's acceptor. remove_marker_block (gate-sdk/SPEC.md §lib/inject.sh) is a sourced library with no gate surface, so its removal half is exercised here through the one caller that drives it: --remove must strip the block entirely, a second --remove must be an idempotent no-op, and a reinstall afterward must restore the same steady-state block this script's own baseline expects
|
|
95
|
+
bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" --remove >/dev/null
|
|
96
|
+
if smoke_block | grep -q .; then
|
|
97
|
+
echo "doctrine smoke: --remove left doctrine block content in the agent file" >&2
|
|
98
|
+
exit 1
|
|
99
|
+
fi
|
|
100
|
+
if grep -qF -- "$SMOKE_BEGIN" CLAUDE.md; then
|
|
101
|
+
echo "doctrine smoke: --remove left the begin marker in the agent file" >&2
|
|
102
|
+
exit 1
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
SMOKE_REMOVED="$(cat CLAUDE.md)"
|
|
106
|
+
bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" --remove >/dev/null
|
|
107
|
+
if [[ "$(cat CLAUDE.md)" != "$SMOKE_REMOVED" ]]; then
|
|
108
|
+
echo "doctrine smoke: a second --remove changed an already-clean agent file" >&2
|
|
109
|
+
exit 1
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" >/dev/null
|
|
113
|
+
if ! smoke_block | grep -q .; then
|
|
114
|
+
echo "doctrine smoke: a reinstall after --remove did not restore the doctrine block" >&2
|
|
115
|
+
exit 1
|
|
116
|
+
fi
|
|
117
|
+
bash "$SMOKE_KIT_ROOT/checks/check-doctrine-registration.sh" >/dev/null \
|
|
118
|
+
|| { echo "doctrine smoke: check-doctrine-registration is not green after the --remove/reinstall round trip" >&2; exit 1; }
|
|
119
|
+
|
|
120
|
+
# spec: doctrine-kit/SPEC.md §install-doctrine — the derivation's refusals. The digest is derived from DOCTRINE.md's *Digest:* trailers, so a rule carrying none (or two) leaves its bullet undecidable; the installer must refuse rather than emit a digest silently one rule short, which is the exact defect the derivation replaced. Driven through the positional overrides so the refusal is *run*, not inspected
|
|
121
|
+
mkdir -p .doctrine-refusal
|
|
122
|
+
cat > .doctrine-refusal/AGENT.md <<'EOF'
|
|
123
|
+
# CLAUDE.md — refusal fixture
|
|
124
|
+
|
|
125
|
+
<!-- doctrine-kit:begin -->
|
|
126
|
+
sentinel
|
|
127
|
+
<!-- doctrine-kit:end -->
|
|
128
|
+
EOF
|
|
129
|
+
SMOKE_SENTINEL="$(cat .doctrine-refusal/AGENT.md)"
|
|
130
|
+
|
|
131
|
+
smoke_refusal() { # $1=label $2=stderr substring; the scratch doctrine on stdin
|
|
132
|
+
local rc=0 err
|
|
133
|
+
cat > .doctrine-refusal/DOCTRINE.md
|
|
134
|
+
err="$(bash "$SMOKE_KIT_ROOT/bin/install-doctrine.sh" \
|
|
135
|
+
.doctrine-refusal/AGENT.md .doctrine-refusal/DOCTRINE.md 2>&1 >/dev/null)" || rc=$?
|
|
136
|
+
if [[ "$rc" -ne 2 ]]; then
|
|
137
|
+
echo "doctrine smoke: $1 — the installer exited $rc, want 2; a digest it cannot derive must fail closed, not ship short" >&2
|
|
138
|
+
exit 1
|
|
139
|
+
fi
|
|
140
|
+
case "$err" in
|
|
141
|
+
*"$2"*) : ;;
|
|
142
|
+
*) echo "doctrine smoke: $1 — the refusal never named the offending rule (stderr was: $err)" >&2; exit 1 ;;
|
|
143
|
+
esac
|
|
144
|
+
if [[ "$(cat .doctrine-refusal/AGENT.md)" != "$SMOKE_SENTINEL" ]]; then
|
|
145
|
+
echo "doctrine smoke: $1 — the installer refused but still wrote the agent file; a refusal must leave the block untouched" >&2
|
|
146
|
+
exit 1
|
|
147
|
+
fi
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
smoke_refusal "untrailered rule" "Untrailered" <<'EOF'
|
|
151
|
+
# DOCTRINE.md — refusal fixture
|
|
152
|
+
|
|
153
|
+
## Methodology-maintenance rules
|
|
154
|
+
|
|
155
|
+
1. **Kept.** Has a trailer.
|
|
156
|
+
*Digest:* kept.
|
|
157
|
+
2. **Untrailered.** The rule that would ship a digest one bullet short.
|
|
158
|
+
|
|
159
|
+
## Engineering-craft rules
|
|
160
|
+
|
|
161
|
+
3. **Craft.** Behind the link.
|
|
162
|
+
*Stages:* build
|
|
163
|
+
EOF
|
|
164
|
+
|
|
165
|
+
smoke_refusal "doubled trailer" "Doubled" <<'EOF'
|
|
166
|
+
# DOCTRINE.md — refusal fixture
|
|
167
|
+
|
|
168
|
+
## Methodology-maintenance rules
|
|
169
|
+
|
|
170
|
+
1. **Kept.** Has a trailer.
|
|
171
|
+
*Digest:* kept.
|
|
172
|
+
2. **Doubled.** Two trailers, so the bullet is undecidable.
|
|
173
|
+
*Digest:* first.
|
|
174
|
+
*Digest:* second.
|
|
175
|
+
|
|
176
|
+
## Engineering-craft rules
|
|
177
|
+
|
|
178
|
+
3. **Craft.** Behind the link.
|
|
179
|
+
*Stages:* build
|
|
180
|
+
EOF
|
|
181
|
+
|
|
182
|
+
rm -rf .doctrine-refusal
|
|
183
|
+
|
|
18
184
|
cat >> scripts/gates.list <<'EOF'
|
|
19
185
|
# doctrine-kit
|
|
20
186
|
check-doctrine-registration
|
|
21
187
|
EOF
|
|
22
188
|
|
|
23
189
|
bash "$SDK/bin/gen-pre-commit.sh" --write >/dev/null
|
|
24
|
-
bash "$SDK/checks/check-graph.sh" --emit >
|
|
190
|
+
bash "$SDK/checks/check-graph.sh" --emit > scripts/CHECK-GRAPH.html
|