checkwright 0.0.1 → 0.18.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 +260 -4
- package/bin/checkwright.sh +53 -0
- package/lib/common/lock.sh +28 -0
- package/lib/common/profile.sh +58 -0
- package/lib/common/recipe.sh +93 -0
- package/lib/doctor.sh +90 -0
- package/lib/init.sh +289 -0
- package/package.json +15 -3
- package/payload/canon-kit/README.md +79 -0
- package/payload/canon-kit/SPEC.md +1410 -0
- package/payload/canon-kit/checks/check-amendment-queue.sh +116 -0
- package/payload/canon-kit/checks/check-comment-tier.sh +211 -0
- package/payload/canon-kit/checks/check-deprecation-task.sh +90 -0
- package/payload/canon-kit/checks/check-docs-cmd.sh +153 -0
- package/payload/canon-kit/checks/check-docs-link-convention.sh +71 -0
- package/payload/canon-kit/checks/check-install-claim.sh +146 -0
- package/payload/canon-kit/checks/check-knob-citation.sh +117 -0
- package/payload/canon-kit/checks/check-knob-default-coupling.sh +239 -0
- package/payload/canon-kit/checks/check-manifest-count.sh +46 -0
- package/payload/canon-kit/checks/check-manifest-temporal.sh +83 -0
- package/payload/canon-kit/checks/check-md-refs.sh +115 -0
- package/payload/canon-kit/checks/check-prose-enum.sh +115 -0
- package/payload/canon-kit/checks/check-prose-tells.sh +207 -0
- package/payload/canon-kit/checks/check-spec-derivable-section.sh +69 -0
- package/payload/canon-kit/checks/check-spec-dod-singleton.sh +45 -0
- package/payload/canon-kit/checks/check-spec-embedded-source.sh +133 -0
- package/payload/canon-kit/checks/check-spec-fence-balance.sh +42 -0
- package/payload/canon-kit/checks/check-spec-pointer.sh +176 -0
- package/payload/canon-kit/checks/check-surface-duplication.sh +105 -0
- package/payload/canon-kit/checks/check-todo-task-liveness.sh +80 -0
- package/payload/canon-kit/checks/check-tracking-claim.sh +136 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-tidy.md +5 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +15 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/good/TASK-QUEUE.md +15 -0
- package/payload/canon-kit/gate-tests/check-amendment-queue/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +25 -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/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +32 -0
- package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +146 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/TASK-QUEUE.md +19 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.sh +6 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/TASK-QUEUE.md +21 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +5 -0
- package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +98 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/bad/args +1 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/bad/doc.md +9 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/good/args +1 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/good/bin/tool.sh +3 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/good/doc.md +18 -0
- package/payload/canon-kit/gate-tests/check-docs-cmd/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/args +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/demokit/index.md +5 -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/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/args +4 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/demokit/index.md +6 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/index.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +3 -0
- package/payload/canon-kit/gate-tests/check-docs-link-convention/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +12 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/install.md +24 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/posts/note.md +7 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/canon-config.sh +10 -0
- package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/install-transports.sh +7 -0
- package/payload/canon-kit/gate-tests/check-install-claim/good/README.md +12 -0
- package/payload/canon-kit/gate-tests/check-install-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-install-claim/good/install.md +24 -0
- package/payload/canon-kit/gate-tests/check-install-claim/good/posts/note.md +7 -0
- package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/canon-config.sh +10 -0
- package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/install-transports.sh +7 -0
- package/payload/canon-kit/gate-tests/check-knob-citation/bad/SPEC.md +10 -0
- package/payload/canon-kit/gate-tests/check-knob-citation/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-knob-citation/good/SPEC.md +19 -0
- package/payload/canon-kit/gate-tests/check-knob-citation/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +71 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/scripts/gate-sdk-config.sh +4 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/SPEC.md +4 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget-cli.sh +3 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget.sh +5 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/SPEC.md +7 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget-cli.sh +3 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget.sh +5 -0
- package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +73 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +15 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +37 -0
- package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +104 -0
- package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/SPEC.md +6 -0
- package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +17 -0
- package/payload/canon-kit/gate-tests/check-manifest-temporal/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-md-refs/bad/args +1 -0
- package/payload/canon-kit/gate-tests/check-md-refs/bad/doc.md +3 -0
- package/payload/canon-kit/gate-tests/check-md-refs/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-md-refs/good/args +1 -0
- package/payload/canon-kit/gate-tests/check-md-refs/good/doc.md +3 -0
- package/payload/canon-kit/gate-tests/check-md-refs/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-md-refs/good/target.md +1 -0
- package/payload/canon-kit/gate-tests/check-md-refs.test.sh +82 -0
- package/payload/canon-kit/gate-tests/check-prose-enum/bad/SPEC.md +4 -0
- package/payload/canon-kit/gate-tests/check-prose-enum/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-prose-enum/bad/scripts/canon-config.sh +4 -0
- package/payload/canon-kit/gate-tests/check-prose-enum/good/SPEC.md +16 -0
- package/payload/canon-kit/gate-tests/check-prose-enum/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-prose-enum/good/scripts/canon-config.sh +4 -0
- package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +127 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/prose.md +15 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +21 -0
- package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.sh +8 -0
- package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +20 -0
- package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/SPEC.md +13 -0
- package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/SPEC.md +15 -0
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/SPEC.md +13 -0
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +63 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +16 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.sh +9 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +19 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.sh +9 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/doc.md +8 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/args +1 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +9 -0
- package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/README.md +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-target.md +6 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-widget.md +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/cand-tmpl.md +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +4 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-target.md +6 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-widget.md +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/cand-tmpl.md +7 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.sh +5 -0
- package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +6 -0
- package/payload/canon-kit/gate-tests/check-surface-duplication/bad/GLOSSARY.md +11 -0
- package/payload/canon-kit/gate-tests/check-surface-duplication/bad/VISION.md +6 -0
- package/payload/canon-kit/gate-tests/check-surface-duplication/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-surface-duplication/good/GLOSSARY.md +11 -0
- package/payload/canon-kit/gate-tests/check-surface-duplication/good/VISION.md +6 -0
- package/payload/canon-kit/gate-tests/check-surface-duplication/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/TASK-QUEUE.md +19 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.sh +5 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/TASK-QUEUE.md +23 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.sh +5 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/bad/args +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/bad/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/bad/kept.txt +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/good/README.md +7 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/good/args +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/good/expect.txt +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/good/kept.txt +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim/good/roster.list +1 -0
- package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +86 -0
- package/payload/canon-kit/lib/spec.sh +505 -0
- package/payload/canon-kit/smoke/install.sh +36 -0
- package/payload/canon-kit/smoke/violation.sh +22 -0
- package/payload/canon-kit/templates/SPEC-amendment.md +55 -0
- package/payload/canon-kit/templates/canon-config.sh +2 -0
- package/payload/context-kit/README.md +82 -0
- package/payload/context-kit/SPEC.md +790 -0
- package/payload/context-kit/bin/always-loaded.sh +86 -0
- package/payload/context-kit/bin/env-probe.sh +144 -0
- package/payload/context-kit/bin/footprint.sh +144 -0
- package/payload/context-kit/bin/md-index.sh +80 -0
- package/payload/context-kit/bin/md-section.sh +63 -0
- package/payload/context-kit/bin/pub-index.sh +90 -0
- package/payload/context-kit/bin/run-index-tests.sh +91 -0
- package/payload/context-kit/checks/check-brevity.sh +123 -0
- package/payload/context-kit/checks/check-footprint-fresh.sh +38 -0
- package/payload/context-kit/checks/check-memory-off.sh +112 -0
- package/payload/context-kit/checks/check-settings-pins.sh +110 -0
- package/payload/context-kit/gate-tests/check-brevity/bad/CLAUDE.md +14 -0
- package/payload/context-kit/gate-tests/check-brevity/bad/args +2 -0
- package/payload/context-kit/gate-tests/check-brevity/bad/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-brevity/good/CLAUDE.md +20 -0
- package/payload/context-kit/gate-tests/check-brevity/good/args +2 -0
- package/payload/context-kit/gate-tests/check-brevity/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-brevity.test.sh +89 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +4 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +12 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +11 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/args +4 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/emit.txt +12 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-footprint-fresh/good/projection.txt +12 -0
- package/payload/context-kit/gate-tests/check-memory-off/bad/args +1 -0
- package/payload/context-kit/gate-tests/check-memory-off/bad/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-memory-off/bad/memory/example-fact.md +6 -0
- package/payload/context-kit/gate-tests/check-memory-off/good/args +1 -0
- package/payload/context-kit/gate-tests/check-memory-off/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-memory-off/good/memory/.gitkeep +0 -0
- package/payload/context-kit/gate-tests/check-memory-off.test.sh +54 -0
- package/payload/context-kit/gate-tests/check-settings-pins/bad/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-pins/bad/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-settings-pins/bad/settings-pins.conf +3 -0
- package/payload/context-kit/gate-tests/check-settings-pins/bad/settings.json +6 -0
- package/payload/context-kit/gate-tests/check-settings-pins/good/args +1 -0
- package/payload/context-kit/gate-tests/check-settings-pins/good/expect.txt +1 -0
- package/payload/context-kit/gate-tests/check-settings-pins/good/settings-pins.conf +3 -0
- package/payload/context-kit/gate-tests/check-settings-pins/good/settings.json +6 -0
- package/payload/context-kit/index-tests/corpus/baseline.txt +2 -0
- package/payload/context-kit/index-tests/corpus/hook-sample.txt +4 -0
- package/payload/context-kit/index-tests/corpus/sample.md +23 -0
- package/payload/context-kit/index-tests/corpus/sample.rs +24 -0
- package/payload/context-kit/index-tests/corpus/sample.ts +34 -0
- package/payload/context-kit/index-tests/corpus/surface.md +6 -0
- package/payload/context-kit/index-tests/expected/always-loaded.txt +1 -0
- package/payload/context-kit/index-tests/expected/md-index.txt +6 -0
- package/payload/context-kit/index-tests/expected/md-section.txt +6 -0
- package/payload/context-kit/index-tests/expected/pub-index-shadow.txt +2 -0
- package/payload/context-kit/index-tests/expected/pub-index-ts.txt +12 -0
- package/payload/context-kit/index-tests/expected/pub-index.txt +10 -0
- package/payload/context-kit/index-tests/expected/toolfloor.txt +14 -0
- package/payload/context-kit/index-tests/toolfloor-cases.sh +29 -0
- package/payload/context-kit/lib/pub-lang/rust.sh +26 -0
- package/payload/context-kit/lib/pub-lang/ts.sh +32 -0
- package/payload/context-kit/lib/toolfloor.sh +47 -0
- package/payload/context-kit/smoke/agents-md.sh +116 -0
- package/payload/context-kit/smoke/install.sh +60 -0
- package/payload/context-kit/smoke/violation.sh +21 -0
- package/payload/context-kit/templates/close-brevity.md +30 -0
- package/payload/context-kit/templates/context-config.sh +2 -0
- package/payload/context-kit/templates/session-context.sh +133 -0
- package/payload/context-kit/templates/settings-sessionstart.json +12 -0
- package/payload/delegation-kit/README.md +87 -0
- package/payload/delegation-kit/SPEC.md +792 -0
- package/payload/delegation-kit/bin/run-budget-guard-tests.sh +88 -0
- package/payload/delegation-kit/bin/run-trend-tests.sh +63 -0
- package/payload/delegation-kit/bin/run-usage-tests.sh +226 -0
- package/payload/delegation-kit/bin/usage-trend.sh +120 -0
- package/payload/delegation-kit/bin/usage-verdict.sh +144 -0
- package/payload/delegation-kit/checks/check-gate-tamper.sh +139 -0
- package/payload/delegation-kit/checks/check-rule-citation.sh +76 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/args +1 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +1 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +5 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/good/added-exemptions +2 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/good/args +1 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/good/expect.txt +1 -0
- package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +5 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +1 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +1 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +9 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +4 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +1 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +1 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +20 -0
- package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +5 -0
- package/payload/delegation-kit/lib/delegation.sh +81 -0
- package/payload/delegation-kit/smoke/install.sh +61 -0
- package/payload/delegation-kit/smoke/violation.sh +16 -0
- package/payload/delegation-kit/templates/agent-budget-guard.sh +18 -0
- package/payload/delegation-kit/templates/agent-execution.md +136 -0
- package/payload/delegation-kit/templates/delegation-config.sh +2 -0
- package/payload/delegation-kit/templates/dispatch-checklists.md +60 -0
- package/payload/delegation-kit/templates/statusline-usage.sh +79 -0
- package/payload/delegation-kit/templates/usage-poller.sh +67 -0
- package/payload/delegation-kit/usage-tests/budget-guard-cases.tsv +20 -0
- package/payload/delegation-kit/usage-tests/cases.tsv +44 -0
- package/payload/delegation-kit/usage-tests/trend-history.log +20 -0
- package/payload/doctrine-kit/DOCTRINE.md +386 -0
- package/payload/doctrine-kit/README.md +70 -0
- package/payload/doctrine-kit/SPEC.md +233 -0
- package/payload/doctrine-kit/bin/install-doctrine.sh +44 -0
- package/payload/doctrine-kit/bin/stage-rules.sh +51 -0
- package/payload/doctrine-kit/checks/check-doctrine-registration.sh +216 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/AGENT.md +14 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +12 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/args +1 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/expect.txt +1 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/AGENT.md +15 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +12 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/args +1 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/expect.txt +1 -0
- package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +208 -0
- package/payload/doctrine-kit/lib/doctrine.sh +29 -0
- package/payload/doctrine-kit/smoke/install.sh +24 -0
- package/payload/doctrine-kit/smoke/violation.sh +13 -0
- package/payload/drift-kit/README.md +115 -0
- package/payload/drift-kit/SPEC.md +881 -0
- package/payload/drift-kit/bin/drift-report.sh +155 -0
- package/payload/drift-kit/bin/kfric.sh +42 -0
- package/payload/drift-kit/bin/overhead-meter.sh +106 -0
- package/payload/drift-kit/bin/stage-economics.sh +311 -0
- package/payload/drift-kit/bin/trajectory.sh +242 -0
- package/payload/drift-kit/kpis/kpi-always-loaded.sh +39 -0
- package/payload/drift-kit/kpis/kpi-amendment-age.sh +33 -0
- package/payload/drift-kit/kpis/kpi-deferred-age.sh +46 -0
- package/payload/drift-kit/kpis/kpi-gate-backlog.sh +52 -0
- package/payload/drift-kit/kpis/kpi-gate-runtime.sh +31 -0
- package/payload/drift-kit/kpis/kpi-knowledge-friction.sh +21 -0
- package/payload/drift-kit/kpis/kpi-overhead.sh +44 -0
- package/payload/drift-kit/kpis/kpi-price-table-age.sh +68 -0
- package/payload/drift-kit/kpis/kpi-prompt-friction.sh +38 -0
- package/payload/drift-kit/kpis/kpi-queue-net-delta.sh +74 -0
- package/payload/drift-kit/kpis/kpi-settings-local.sh +21 -0
- package/payload/drift-kit/kpis/kpi-task-split.sh +43 -0
- package/payload/drift-kit/smoke/install.sh +348 -0
- package/payload/drift-kit/smoke/overhead-fixture.jsonl +4 -0
- package/payload/drift-kit/templates/close-knowledge.md +24 -0
- package/payload/drift-kit/templates/drift-config.sh +2 -0
- package/payload/drift-kit/templates/economics.md +45 -0
- package/payload/drift-kit/templates/kpi-deprecated-surface.sh +32 -0
- package/payload/drift-kit/templates/kpis.list +22 -0
- package/payload/drift-kit/templates/price-table.tsv +21 -0
- package/payload/evidence-kit/README.md +59 -0
- package/payload/evidence-kit/SPEC.md +261 -0
- package/payload/evidence-kit/bin/diff-baseline.sh +34 -0
- package/payload/evidence-kit/bin/run-validate.sh +82 -0
- package/payload/evidence-kit/checks/check-evidence-baseline.sh +103 -0
- package/payload/evidence-kit/checks/check-evidence-manifest.sh +104 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/TASK-QUEUE.md +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/args +2 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/validate-baseline.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/TASK-QUEUE.md +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/args +2 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/validate-baseline.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +84 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/TASK-QUEUE.md +1 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/validate-evidence.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/TASK-QUEUE.md +1 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +3 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/expect.txt +1 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/validate-evidence.txt +2 -0
- package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +107 -0
- package/payload/evidence-kit/gate-tests/evidence-lib.test.sh +82 -0
- package/payload/evidence-kit/lib/evidence.sh +173 -0
- package/payload/evidence-kit/smoke/install.sh +45 -0
- package/payload/evidence-kit/smoke/violation.sh +8 -0
- package/payload/evidence-kit/templates/evidence-config.sh +2 -0
- package/payload/gate-sdk/README.md +124 -0
- package/payload/gate-sdk/SPEC.md +1876 -0
- package/payload/gate-sdk/bin/enforcement-map.sh +272 -0
- package/payload/gate-sdk/bin/gen-pre-commit.sh +267 -0
- package/payload/gate-sdk/bin/install-hooks.sh +48 -0
- package/payload/gate-sdk/bin/run-consumer-smoke.sh +112 -0
- package/payload/gate-sdk/bin/run-gate-tests.sh +128 -0
- package/payload/gate-sdk/bin/run-gates.sh +147 -0
- package/payload/gate-sdk/bin/upgrade-smoke.sh +163 -0
- package/payload/gate-sdk/checks/check-action-pinning.sh +55 -0
- package/payload/gate-sdk/checks/check-action-run-shell.sh +219 -0
- package/payload/gate-sdk/checks/check-assertion-strength.sh +134 -0
- package/payload/gate-sdk/checks/check-commit-msg.sh +50 -0
- package/payload/gate-sdk/checks/check-commit-subject.sh +43 -0
- package/payload/gate-sdk/checks/check-core-files.sh +52 -0
- package/payload/gate-sdk/checks/check-enforcement-fresh.sh +37 -0
- package/payload/gate-sdk/checks/check-exec-bit.sh +76 -0
- package/payload/gate-sdk/checks/check-gate-assertions.sh +123 -0
- package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +106 -0
- package/payload/gate-sdk/checks/check-gate-fail-closed.sh +84 -0
- package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +92 -0
- package/payload/gate-sdk/checks/check-gate-output.sh +65 -0
- package/payload/gate-sdk/checks/check-graph.sh +632 -0
- package/payload/gate-sdk/checks/check-hook-exec-bit.sh +45 -0
- package/payload/gate-sdk/checks/check-identity.sh +134 -0
- package/payload/gate-sdk/checks/check-kit-enum.sh +94 -0
- package/payload/gate-sdk/checks/check-kit-registration.sh +68 -0
- package/payload/gate-sdk/checks/check-readme-roster.sh +102 -0
- package/payload/gate-sdk/checks/check-reads-couples.sh +148 -0
- package/payload/gate-sdk/checks/check-root-tiering.sh +66 -0
- package/payload/gate-sdk/checks/check-shellcheck.sh +55 -0
- package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +53 -0
- package/payload/gate-sdk/checks/check-template-copy-parity.sh +126 -0
- package/payload/gate-sdk/checks/check-test-hermetic.sh +119 -0
- package/payload/gate-sdk/checks/check-tree-terms.sh +61 -0
- package/payload/gate-sdk/checks/check-workflow-tiering.sh +84 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/mutable.yml +11 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/nested/pinned.yml +5 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/nested/deep.yml +5 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/no-refs.yaml +8 -0
- package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/pinned.yml +10 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/args +3 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/tree/workflows/ci.yml +15 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/good/args +3 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/action.yml +14 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/not-actions.yml +16 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/workflows/ci.yml +106 -0
- package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +88 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/args +3 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/bin/verdict.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/smoke/install.sh +11 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/good/args +3 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/good/bin/verdict.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-assertion-strength/good/smoke/install.sh +16 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/bad/msg.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/bad/patterns.list +5 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/good/msg.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-commit-msg/good/patterns.list +5 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject/bad/msg.txt +4 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject/good/msg.txt +5 -0
- package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +73 -0
- package/payload/gate-sdk/gate-tests/check-core-files/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-core-files/bad/core-files.list +3 -0
- package/payload/gate-sdk/gate-tests/check-core-files/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-core-files/bad/present.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-core-files/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-core-files/good/core-files.list +5 -0
- package/payload/gate-sdk/gate-tests/check-core-files/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-core-files/good/nested/also-present.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-core-files/good/present.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/emit.txt +14 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/projection.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/args +4 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/emit.txt +14 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/projection.txt +14 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +7 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +46 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +13 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-baz.sh +13 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-foo.sh +10 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +20 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-baz.sh +12 -0
- package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-foo.sh +9 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +9 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/TASK-QUEUE.md +9 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/gates/check-sample.sh +11 -0
- package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/gates/check-sample.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/gates/check-sample.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/check-gamma.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/bad/.keep +0 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/good/.keep +0 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/check-beta.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/bad/.keep +0 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/good/.keep +0 -0
- package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gates.list +5 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +2 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +9 -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 +3 -0
- package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +12 -0
- package/payload/gate-sdk/gate-tests/check-graph/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +20 -0
- package/payload/gate-sdk/gate-tests/check-graph/good/args +3 -0
- package/payload/gate-sdk/gate-tests/check-graph/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +51 -0
- package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +55 -0
- package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +63 -0
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +2 -0
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +2 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/git-config-email +1 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/git-remotes +2 -0
- package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/git-config-email +1 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/git-remotes +3 -0
- package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-sample.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-sample.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration/bad/registry-doc.md +20 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration/good/args +5 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +75 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/README.md +14 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/README.md +5 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/checks/check-gamma-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/README.md +16 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-one.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-two.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/beta-kit/smoke/install.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/sub/deep.md +1 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/top.md +1 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/bad/sandbox-gate.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/good/args +3 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/sub/deep.md +1 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/top.md +1 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-reads-couples/good/sandbox-gate.sh +8 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/bad/allow.list +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/README.md +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/stray.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/good/allow.list +3 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/LICENSE +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/README.md +1 -0
- package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/somedir/keep.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/args +1 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/bad/warn.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/args +1 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-shellcheck/good/ok.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/install.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/violation.sh +7 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/args +4 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/install.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/violation.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/args +6 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/beta-kit/smoke/install.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/scripts/gate-sdk-config.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +9 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/delegation-kit/templates/agent-budget-guard.sh +16 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/agent-budget-guard.sh +17 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +8 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/agent-budget-guard.sh +16 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/delegation-config.sh +3 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/usage-poller.sh +6 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +16 -0
- package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/delegation-config.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/args +3 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/leaky.test.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/good/args +3 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/good/exempt.test.sh +4 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic/good/sourced.test.sh +5 -0
- package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +84 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/args +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +3 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/leak.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -0
- package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -0
- 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/clean.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/payload.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/projection.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/projection.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/wire.txt +1 -0
- package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/expect.txt +1 -0
- package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +87 -0
- package/payload/gate-sdk/gate-tests/lib-gate.test.sh +78 -0
- package/payload/gate-sdk/gate-tests/run-for-path.test.sh +77 -0
- package/payload/gate-sdk/lib/consumer-smoke.sh +32 -0
- package/payload/gate-sdk/lib/gate.sh +216 -0
- package/payload/gate-sdk/lib/inject.sh +35 -0
- package/payload/gate-sdk/lib/test-hermetic.sh +11 -0
- package/payload/gate-sdk/smoke/install.sh +84 -0
- package/payload/gate-sdk/smoke/violation.sh +13 -0
- package/payload/gate-sdk/templates/check-skeleton.sh +23 -0
- package/payload/gate-sdk/templates/gates-workflow.yml +55 -0
- package/payload/gate-sdk/templates/msg-patterns.list +21 -0
- package/payload/guard-kit/README.md +65 -0
- package/payload/guard-kit/SPEC.md +590 -0
- package/payload/guard-kit/bin/compare-settings-allow.sh +58 -0
- package/payload/guard-kit/bin/run-guard-tests.sh +86 -0
- package/payload/guard-kit/bin/scan-prompts.sh +166 -0
- package/payload/guard-kit/bin/scratch-run.sh +34 -0
- package/payload/guard-kit/gate-tests/scan-prompts.test.sh +70 -0
- package/payload/guard-kit/gate-tests/scratch-run.test.sh +62 -0
- package/payload/guard-kit/guard-tests/cases.tsv +117 -0
- package/payload/guard-kit/guard-tests/escalation-cases.tsv +13 -0
- package/payload/guard-kit/lib/guard.sh +448 -0
- package/payload/guard-kit/smoke/install.sh +26 -0
- package/payload/guard-kit/templates/bash-guard.sh +18 -0
- package/payload/guard-kit/templates/close-triage.md +31 -0
- package/payload/guard-kit/templates/escalation-guard.sh +27 -0
- package/payload/guard-kit/templates/guard-config.sh +2 -0
- package/payload/guard-kit/templates/settings-hooks.json +19 -0
- package/payload/guard-kit/templates/wakeup-guard.sh +20 -0
- package/payload/lifecycle-kit/README.md +106 -0
- package/payload/lifecycle-kit/SPEC.md +1492 -0
- package/payload/lifecycle-kit/bin/close-surfaces.sh +94 -0
- package/payload/lifecycle-kit/bin/enter-stage.sh +215 -0
- package/payload/lifecycle-kit/bin/file-gap.sh +43 -0
- package/payload/lifecycle-kit/bin/install-lifecycle.sh +36 -0
- package/payload/lifecycle-kit/bin/session-id.sh +75 -0
- package/payload/lifecycle-kit/checks/check-close-surfaces.sh +63 -0
- package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +98 -0
- package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +54 -0
- package/payload/lifecycle-kit/checks/check-merge-attrs.sh +69 -0
- package/payload/lifecycle-kit/checks/check-shim-restatement.sh +97 -0
- package/payload/lifecycle-kit/checks/check-skill-binding.sh +59 -0
- package/payload/lifecycle-kit/checks/check-stage-entry.sh +197 -0
- package/payload/lifecycle-kit/checks/check-stage-evidence.sh +81 -0
- package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +47 -0
- package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +96 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/owners/inbox.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/owners/inbox.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/scripts/lifecycle-config.sh +4 -0
- package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +66 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/evidence.txt +2 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-head.md +8 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-work.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/evidence.txt +3 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-head.md +8 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-work.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +56 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/AGENT.md +11 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/AGENT.md +11 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +59 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +6 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +5 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +113 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/commands/build.md +6 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/corpus.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/args +2 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/commands/build.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/corpus.md +4 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +80 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/commands/build.md +5 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/templates/build.md +7 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/commands/build.md +7 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/templates/build.md +7 -0
- package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +84 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +7 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/TASK-QUEUE.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +7 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/TASK-QUEUE.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +251 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +6 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/TASK-QUEUE.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +6 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/TASK-QUEUE.md +13 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +115 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/build.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/scope.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/validate.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/args +1 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/build.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/close.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/scope.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/validate.md +2 -0
- package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
- package/payload/lifecycle-kit/lib/stages.sh +179 -0
- package/payload/lifecycle-kit/smoke/install.sh +341 -0
- package/payload/lifecycle-kit/smoke/violation.sh +8 -0
- package/payload/lifecycle-kit/templates/lead.md +271 -0
- package/payload/lifecycle-kit/templates/lifecycle-config.sh +2 -0
- package/payload/lifecycle-kit/templates/release-sweep.md +39 -0
- package/payload/lifecycle-kit/templates/stages/align.md +65 -0
- package/payload/lifecycle-kit/templates/stages/build.md +78 -0
- package/payload/lifecycle-kit/templates/stages/close.md +122 -0
- package/payload/lifecycle-kit/templates/stages/scope.md +112 -0
- package/payload/lifecycle-kit/templates/stages/spec.md +91 -0
- package/payload/lifecycle-kit/templates/stages/validate.md +54 -0
- package/payload/lifecycle-kit/templates/upgrade.md +41 -0
- package/payload/queue-kit/README.md +78 -0
- package/payload/queue-kit/SPEC.md +797 -0
- package/payload/queue-kit/bin/lesson-sink.sh +28 -0
- package/payload/queue-kit/bin/queue-index.sh +182 -0
- package/payload/queue-kit/bin/roadmap.sh +76 -0
- package/payload/queue-kit/checks/check-queue-entry-budget.sh +104 -0
- package/payload/queue-kit/checks/check-queue-hygiene.sh +81 -0
- package/payload/queue-kit/checks/check-queue-prose-precondition.sh +63 -0
- package/payload/queue-kit/checks/check-queue-sections.sh +44 -0
- package/payload/queue-kit/checks/check-queue-slug-liveness.sh +63 -0
- package/payload/queue-kit/checks/check-queue-wrap.sh +56 -0
- package/payload/queue-kit/checks/check-roadmap-fresh.sh +110 -0
- package/payload/queue-kit/checks/check-tag-lead-line.sh +70 -0
- package/payload/queue-kit/checks/check-task-conservation.sh +50 -0
- package/payload/queue-kit/checks/check-task-names.sh +128 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +33 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +4 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/scripts/queue-config.sh +6 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +35 -0
- package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/scripts/queue-config.sh +6 -0
- package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/TASK-QUEUE.md +17 -0
- package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +25 -0
- package/payload/queue-kit/gate-tests/check-queue-hygiene/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/TASK-QUEUE.md +15 -0
- package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/TASK-QUEUE.md +25 -0
- package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/bad/TASK-QUEUE.md +13 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +15 -0
- package/payload/queue-kit/gate-tests/check-queue-sections/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/TASK-QUEUE.md +17 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/docs/page.md +4 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/scripts/queue-config.sh +3 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/TASK-QUEUE.md +19 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/docs/page.md +5 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/scripts/queue-config.sh +3 -0
- package/payload/queue-kit/gate-tests/check-queue-wrap/bad/TASK-QUEUE.md +15 -0
- package/payload/queue-kit/gate-tests/check-queue-wrap/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +25 -0
- package/payload/queue-kit/gate-tests/check-queue-wrap/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/TASK-QUEUE.md +24 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/args +5 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/emit.txt +8 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/projection.txt +16 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/scripts/queue-config.sh +6 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/TASK-QUEUE.md +22 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/args +5 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/emit.txt +7 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/projection.txt +16 -0
- package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/scripts/queue-config.sh +6 -0
- package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/TASK-QUEUE.md +25 -0
- package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/expect.txt +2 -0
- package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +30 -0
- package/payload/queue-kit/gate-tests/check-tag-lead-line/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +18 -0
- package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +25 -0
- package/payload/queue-kit/gate-tests/check-task-names/good/expect.txt +1 -0
- package/payload/queue-kit/gate-tests/queue-index.test.sh +159 -0
- package/payload/queue-kit/gate-tests/roadmap.test.sh +197 -0
- package/payload/queue-kit/lib/queue.sh +193 -0
- package/payload/queue-kit/smoke/install.sh +22 -0
- package/payload/queue-kit/smoke/violation.sh +8 -0
- package/payload/queue-kit/templates/TASK-QUEUE.md +43 -0
- package/payload/queue-kit/templates/queue-config.sh +2 -0
- package/payload/site-kit/README.md +61 -0
- package/payload/site-kit/SPEC.md +269 -0
- package/payload/site-kit/checks/check-docs-cname-parity.sh +80 -0
- package/payload/site-kit/checks/check-docs-render-fidelity.sh +167 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +4 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/site-config.sh +7 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/CNAME +1 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/README.md +5 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +5 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/site-config.sh +7 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/CNAME +1 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/docs/posts/2026-01-01-legacy.md +4 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/index.md +4 -0
- package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/pkg/gate-tests/fixture.md +5 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/args +8 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/tree/docs/install.md +38 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/args +6 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/expect.txt +1 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/tree/docs/install.md +35 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity-foreign.test.sh +87 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity-span.test.sh +80 -0
- package/payload/site-kit/gate-tests/check-docs-render-fidelity-table.test.sh +90 -0
- package/payload/site-kit/lib/site.sh +29 -0
- package/payload/site-kit/smoke/install.sh +26 -0
- package/payload/site-kit/smoke/violation.sh +20 -0
- package/payload/site-kit/templates/site-health.yml +164 -0
- package/profiles.list +53 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Install notes: clone into /home/bob/projects and run the setup script.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TREE-TERMS: clean
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
A tracked file with no local paths and no promo URL — nothing to leak here.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# contract: not a pointer and not a version marker
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# a descriptive header, not a ruled contract payload
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
is not a '# contract: ' header
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# contract: gate-sdk/SPEC.md §The workflow directory — the pointer payload form, with its grammar riding the em-dash tail
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# contract: fixture-format v3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
WORKFLOW-TIERING: clean
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §enforcement-map — degraded-registry coverage the hermetic fixtures cannot reach: a knob unset with its default absent drops exactly its own section (the gate registry — gate-sdk's core — always remains), while a knob explicitly set to a missing path refuses (exit 2, empty stdout, stderr names the knob)
|
|
3
|
+
set -uo pipefail
|
|
4
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
5
|
+
|
|
6
|
+
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
7
|
+
cd "$ROOT" || exit 2
|
|
8
|
+
EMIT="gate-sdk/bin/enforcement-map.sh"
|
|
9
|
+
[[ -x "$EMIT" ]] || { echo "enforcement-map.test: emitter not found: $EMIT"; exit 2; }
|
|
10
|
+
|
|
11
|
+
emptydir="$(mktemp -d)"; scandir="$(mktemp -d)"; scratch="$(mktemp -d)"
|
|
12
|
+
trap 'rm -rf "$emptydir" "$scandir" "$scratch"' EXIT
|
|
13
|
+
|
|
14
|
+
fails=0
|
|
15
|
+
assert_has() { grep -qF -- "$2" <<<"$3" || { echo "FAIL [$1]: expected present: $2"; fails=$((fails + 1)); }; }
|
|
16
|
+
assert_absent() { grep -qF -- "$2" <<<"$3" && { echo "FAIL [$1]: expected absent: $2"; fails=$((fails + 1)); }; return 0; }
|
|
17
|
+
|
|
18
|
+
# The baseline asserts every real registry projects its section. Evidence
|
|
19
|
+
# routes through EVIDENCE_KIT_CONFIG_FILE, which the hermetic bootstrap pins to
|
|
20
|
+
# an empty file; drop that pin here so the emitter resolves this repo's real
|
|
21
|
+
# evidence-config.sh (the other registries already read their real defaults).
|
|
22
|
+
base="$(env -u EVIDENCE_KIT_CONFIG_FILE bash "$EMIT" --emit)"
|
|
23
|
+
for section in "## Blocking gates" "## Advisory KPIs" "## Guards" "## Session warnings" "## Validate suites" "## Monitors"; do
|
|
24
|
+
assert_has baseline "$section" "$base"
|
|
25
|
+
done
|
|
26
|
+
|
|
27
|
+
# spec: gate-sdk/SPEC.md §enforcement-map — adopted-but-broken refuses: a knob
|
|
28
|
+
# explicitly set to a missing path exits 2 before the first stdout byte, the
|
|
29
|
+
# stderr line naming the knob; the settings knob also refuses a set file jq
|
|
30
|
+
# cannot parse.
|
|
31
|
+
errfile="$scratch/stderr"
|
|
32
|
+
assert_strict() { # $1=case $2=knob-name $3=knob-value
|
|
33
|
+
local out rc
|
|
34
|
+
out="$(env "$2=$3" bash "$EMIT" --emit 2>"$errfile")"; rc=$?
|
|
35
|
+
[[ "$rc" -eq 2 ]] || { echo "FAIL [$1]: expected exit 2, got $rc"; fails=$((fails + 1)); }
|
|
36
|
+
[[ -z "$out" ]] || { echo "FAIL [$1]: expected empty stdout"; fails=$((fails + 1)); }
|
|
37
|
+
grep -qF -- "$2" "$errfile" || { echo "FAIL [$1]: stderr does not name $2"; fails=$((fails + 1)); }
|
|
38
|
+
}
|
|
39
|
+
assert_strict strict-kpis DRIFT_KIT_KPIS_FILE /nonexistent/kpis.list
|
|
40
|
+
assert_strict strict-settings CONTEXT_KIT_SETTINGS_FILE /nonexistent/settings.json
|
|
41
|
+
assert_strict strict-evidence EVIDENCE_KIT_CONFIG_FILE /nonexistent/evidence-config.sh
|
|
42
|
+
assert_strict strict-scandir GATE_SDK_ENFORCE_SCAN_DIR /nonexistent/scandir
|
|
43
|
+
printf '{ not json\n' > "$scratch/bad-settings.json"
|
|
44
|
+
assert_strict strict-settings-unparseable CONTEXT_KIT_SETTINGS_FILE "$scratch/bad-settings.json"
|
|
45
|
+
|
|
46
|
+
# spec: gate-sdk/SPEC.md §enforcement-map — not-adopted degrades: an unset knob
|
|
47
|
+
# whose default path is absent drops exactly its own section. A scratch
|
|
48
|
+
# GATE_SDK_GATES_DIR holding only a gates.list copy leaves the kpis.list and
|
|
49
|
+
# evidence-config.sh defaults absent; adding kpis.list back restores only the
|
|
50
|
+
# KPI section, so the sections drop independently.
|
|
51
|
+
mkdir -p "$scratch/gates"
|
|
52
|
+
cp "scripts/gates.list" "$scratch/gates/gates.list"
|
|
53
|
+
deg="$(env -u DRIFT_KIT_KPIS_FILE -u EVIDENCE_KIT_CONFIG_FILE GATE_SDK_GATES_DIR="$scratch/gates" bash "$EMIT" --emit)"
|
|
54
|
+
assert_absent degrade-both "## Advisory KPIs" "$deg"
|
|
55
|
+
assert_absent degrade-both "## Validate suites" "$deg"
|
|
56
|
+
assert_has degrade-both "## Blocking gates" "$deg"
|
|
57
|
+
cp "scripts/kpis.list" "$scratch/gates/kpis.list"
|
|
58
|
+
deg2="$(env -u DRIFT_KIT_KPIS_FILE -u EVIDENCE_KIT_CONFIG_FILE GATE_SDK_GATES_DIR="$scratch/gates" bash "$EMIT" --emit)"
|
|
59
|
+
assert_has degrade-independent "## Advisory KPIs" "$deg2"
|
|
60
|
+
assert_absent degrade-independent "## Validate suites" "$deg2"
|
|
61
|
+
assert_has degrade-independent "## Blocking gates" "$deg2"
|
|
62
|
+
|
|
63
|
+
# The settings default (.claude/settings.json) is cwd-relative: run from a cwd
|
|
64
|
+
# without one, the unset knob degrades — both hook sections drop, the gate
|
|
65
|
+
# registry (reached through an absolute GATE_SDK_GATES_DIR) remains.
|
|
66
|
+
nohooks="$(cd "$emptydir" && env -u CONTEXT_KIT_SETTINGS_FILE -u DRIFT_KIT_KPIS_FILE -u EVIDENCE_KIT_CONFIG_FILE GATE_SDK_GATES_DIR="$scratch/gates" bash "$ROOT/$EMIT" --emit)"
|
|
67
|
+
assert_absent no-hooks "## Guards" "$nohooks"
|
|
68
|
+
assert_absent no-hooks "## Session warnings" "$nohooks"
|
|
69
|
+
assert_has no-hooks "## Blocking gates" "$nohooks"
|
|
70
|
+
|
|
71
|
+
nomon="$(GATE_SDK_ENFORCE_SCAN_DIR="$emptydir" bash "$EMIT" --emit)"
|
|
72
|
+
assert_absent no-monitors "## Monitors" "$nomon"
|
|
73
|
+
assert_has no-monitors "## Blocking gates" "$nomon"
|
|
74
|
+
|
|
75
|
+
# spec: gate-sdk/SPEC.md §enforcement-map — a marker is dormant in a template
|
|
76
|
+
# (an inert copy-source) and activates only where a consumer copies it live: a
|
|
77
|
+
# live marker projects a row, an identical one under templates/ does not.
|
|
78
|
+
mkdir -p "$scandir/live" "$scandir/templates"
|
|
79
|
+
printf '# enforce: class=monitor live-surface-alpha\n' > "$scandir/live/probe.yml"
|
|
80
|
+
printf '# enforce: class=monitor template-surface-beta\n' > "$scandir/templates/probe.yml"
|
|
81
|
+
tmpl="$(GATE_SDK_ENFORCE_SCAN_DIR="$scandir" bash "$EMIT" --emit)"
|
|
82
|
+
assert_has template-inert "live-surface-alpha" "$tmpl"
|
|
83
|
+
assert_absent template-inert "template-surface-beta" "$tmpl"
|
|
84
|
+
|
|
85
|
+
[[ "$fails" -eq 0 ]] || { echo "enforcement-map.test: $fails assertion(s) failed"; exit 1; }
|
|
86
|
+
echo "enforcement-map.test: clean (set-but-missing knobs refuse; unset-with-default-absent sections drop independently; gate registry always present)"
|
|
87
|
+
exit 0
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Direct unit test of gate-sdk/lib/gate.sh — the runtime lock-in for the
|
|
3
|
+
# fail-closed contract. A green static check cannot prove fail-closed; this
|
|
4
|
+
# exercises both branches of the helper directly.
|
|
5
|
+
#
|
|
6
|
+
# Why a direct test and not per-gate input fixtures: a well-formed awk cannot be
|
|
7
|
+
# crashed on present, readable input, and a *missing* input trips each gate's
|
|
8
|
+
# pre-`-f` guard before reaching the capture fail_closed protects. So the helper
|
|
9
|
+
# is where the fail-closed contract is actually verifiable. Per-gate *wiring*
|
|
10
|
+
# (does the gate call fail_closed after its capture) is a structural property,
|
|
11
|
+
# verified by check-gate-fail-closed + check-shellcheck.
|
|
12
|
+
#
|
|
13
|
+
# Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
|
|
14
|
+
set -uo pipefail
|
|
15
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
16
|
+
|
|
17
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # gate-sdk/
|
|
18
|
+
# shellcheck source=../lib/gate.sh
|
|
19
|
+
source "$DIR/lib/gate.sh"
|
|
20
|
+
|
|
21
|
+
fails=0
|
|
22
|
+
|
|
23
|
+
# Branch 1: zero status -> no-op (returns 0, does NOT exit the caller).
|
|
24
|
+
fail_closed 0 check-x awk
|
|
25
|
+
reached=yes
|
|
26
|
+
[[ "$reached" == yes ]] || { echo " FAIL: fail_closed 0 aborted the caller"; fails=$((fails + 1)); }
|
|
27
|
+
|
|
28
|
+
# Branch 2: non-zero status -> exit 2 + diagnostic on stderr (run in a subshell
|
|
29
|
+
# so the exit doesn't abort this test).
|
|
30
|
+
out="$( ( fail_closed 2 check-x awk ) 2>&1 )"; rc=$?
|
|
31
|
+
[[ "$rc" -eq 2 ]] || { echo " FAIL: fail_closed 2 should exit 2, exited $rc"; fails=$((fails + 1)); }
|
|
32
|
+
grep -qF 'the check could not run' <<<"$out" \
|
|
33
|
+
|| { echo " FAIL: fail_closed 2 missing 'the check could not run': $out"; fails=$((fails + 1)); }
|
|
34
|
+
|
|
35
|
+
# --- discovery prune set: gate_path_pruned (pure predicate) ------------------
|
|
36
|
+
for p in 'a/target/b' './node_modules/x' 'kit/gate-tests/g/SPEC.md' '.tmp/s'; do
|
|
37
|
+
gate_path_pruned "$p" || { echo " FAIL: gate_path_pruned missed '$p'"; fails=$((fails + 1)); }
|
|
38
|
+
done
|
|
39
|
+
for p in 'src/main.rs' 'a/targets/b' 'some-service/proto/x.proto'; do
|
|
40
|
+
gate_path_pruned "$p" && { echo " FAIL: gate_path_pruned over-pruned '$p'"; fails=$((fails + 1)); }
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
# --- GATE_GREP_EXCLUDES: one --exclude-dir per pruned dir --------------------
|
|
44
|
+
for d in target gate-tests node_modules; do
|
|
45
|
+
printf '%s\n' "${GATE_GREP_EXCLUDES[@]}" | grep -qxF -- "--exclude-dir=$d" \
|
|
46
|
+
|| { echo " FAIL: GATE_GREP_EXCLUDES missing $d"; fails=$((fails + 1)); }
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
# --- gate_find: prunes the set, returns everything else ----------------------
|
|
50
|
+
sandbox="$(mktemp -d)"; trap 'rm -rf "$sandbox"' EXIT
|
|
51
|
+
mkdir -p "$sandbox/sub" "$sandbox/target" "$sandbox/gate-tests/x" "$sandbox/node_modules"
|
|
52
|
+
: >"$sandbox/a.proto"; : >"$sandbox/sub/b.proto"
|
|
53
|
+
: >"$sandbox/target/c.proto"; : >"$sandbox/gate-tests/x/d.proto"; : >"$sandbox/node_modules/e.proto"
|
|
54
|
+
got="$(gate_find "$sandbox" -name '*.proto' | sed "s#^$sandbox/##" | sort | paste -sd, -)"
|
|
55
|
+
[[ "$got" == 'a.proto,sub/b.proto' ]] \
|
|
56
|
+
|| { echo " FAIL: gate_find returned '$got' (want 'a.proto,sub/b.proto')"; fails=$((fails + 1)); }
|
|
57
|
+
|
|
58
|
+
# --- registry + resolution (gate-sdk additions) -------------------------------
|
|
59
|
+
list="$sandbox/gates.list"
|
|
60
|
+
printf '# comment\n\ncheck-one\ncheck-two\n' > "$list"
|
|
61
|
+
got="$(gates_list_members "$list" | paste -sd, -)"
|
|
62
|
+
[[ "$got" == 'check-one,check-two' ]] \
|
|
63
|
+
|| { echo " FAIL: gates_list_members returned '$got' (want 'check-one,check-two')"; fails=$((fails + 1)); }
|
|
64
|
+
|
|
65
|
+
mkdir -p "$sandbox/a" "$sandbox/b"
|
|
66
|
+
: >"$sandbox/b/check-one.sh"
|
|
67
|
+
got="$(gate_resolve check-one "$sandbox/a" "$sandbox/b")"
|
|
68
|
+
[[ "$got" == "$sandbox/b/check-one.sh" ]] \
|
|
69
|
+
|| { echo " FAIL: gate_resolve returned '$got' (want '$sandbox/b/check-one.sh')"; fails=$((fails + 1)); }
|
|
70
|
+
gate_resolve check-missing "$sandbox/a" "$sandbox/b" >/dev/null \
|
|
71
|
+
&& { echo " FAIL: gate_resolve found a nonexistent gate"; fails=$((fails + 1)); }
|
|
72
|
+
|
|
73
|
+
if [[ "$fails" -gt 0 ]]; then
|
|
74
|
+
echo "lib-gate.test: $fails assertion(s) failed"
|
|
75
|
+
exit 1
|
|
76
|
+
fi
|
|
77
|
+
echo "lib-gate.test: ok (fail_closed branches; gate_path_pruned; GATE_GREP_EXCLUDES; gate_find prune; registry + resolution)"
|
|
78
|
+
exit 0
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §run-gates — end-to-end lock-in for `run-gates.sh --for`
|
|
3
|
+
# selection over a hermetic scratch registry: the two behaviors the live gate
|
|
4
|
+
# set cannot exercise (the no-match note on an ungoverned path, a mode=staged
|
|
5
|
+
# gate's git-pathspec exact-or-subtree match with its matching paths passed as
|
|
6
|
+
# args) plus the trigger='*'/plain-glob cases. Run by run-gate-tests.sh.
|
|
7
|
+
set -uo pipefail
|
|
8
|
+
source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
|
|
9
|
+
|
|
10
|
+
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
11
|
+
RUN="$ROOT/gate-sdk/bin/run-gates.sh"
|
|
12
|
+
[[ -x "$RUN" ]] || { echo "run-for-path.test: runner not found: $RUN"; exit 2; }
|
|
13
|
+
|
|
14
|
+
scratch="$(mktemp -d)"
|
|
15
|
+
trap 'rm -rf "$scratch"' EXIT
|
|
16
|
+
|
|
17
|
+
# A trivial gate: prints its name + any args, exits 0.
|
|
18
|
+
mk_gate() {
|
|
19
|
+
local name="$1" manifest="$2"
|
|
20
|
+
{ printf '#!/usr/bin/env bash\n'
|
|
21
|
+
printf '%s\n' "$manifest"
|
|
22
|
+
printf 'echo "%s ran args=[$*]"\n' "$name"
|
|
23
|
+
} > "$scratch/$name.sh"
|
|
24
|
+
chmod +x "$scratch/$name.sh"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# Registry with a trigger='*' gate, a plain-glob gate, and a mode=staged gate.
|
|
28
|
+
mk_gate g_star '# graph: couples=cfg dir=one valve=none tier=precommit trigger=*'
|
|
29
|
+
mk_gate g_glob '# graph: couples=alpha/*.txt dir=one valve=none tier=precommit'
|
|
30
|
+
mk_gate g_staged '# graph: couples=beta dir=one valve=none tier=precommit mode=staged'
|
|
31
|
+
{ echo g_star; echo g_glob; echo g_staged; } > "$scratch/gates.list"
|
|
32
|
+
|
|
33
|
+
# Isolate the runner onto the scratch registry: no kit roots, tmp off-tree.
|
|
34
|
+
# Verbose: selection is observed through each stub gate's echoed banner output.
|
|
35
|
+
run_for() {
|
|
36
|
+
GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch" \
|
|
37
|
+
GATE_SDK_TMP_DIR="$scratch/.tmp" GATE_SDK_VERBOSE=1 bash "$RUN" --for "$@" 2>&1
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
fails=0
|
|
41
|
+
assert_has() { grep -qF -- "$2" <<<"$3" || { echo "FAIL [$1]: expected present: $2"; fails=$((fails + 1)); }; }
|
|
42
|
+
assert_absent() { grep -qF -- "$2" <<<"$3" && { echo "FAIL [$1]: expected absent: $2"; fails=$((fails + 1)); }; return 0; }
|
|
43
|
+
|
|
44
|
+
# A plain-glob path: g_glob (alpha/*.txt) selected, g_star always, g_staged not.
|
|
45
|
+
out="$(run_for alpha/foo.txt)"
|
|
46
|
+
assert_has glob "g_glob ran" "$out"
|
|
47
|
+
assert_has glob "g_star ran" "$out"
|
|
48
|
+
assert_absent glob "g_staged ran" "$out"
|
|
49
|
+
assert_absent glob "no registered gate couples to" "$out"
|
|
50
|
+
|
|
51
|
+
# A mode=staged gate matches by git pathspec (exact-or-subtree) and receives its
|
|
52
|
+
# matching paths as args; a plain-glob gate would not match the subtree path.
|
|
53
|
+
out="$(run_for beta/inner/x)"
|
|
54
|
+
assert_has staged "g_staged ran args=[beta/inner/x]" "$out"
|
|
55
|
+
assert_has staged "g_star ran" "$out"
|
|
56
|
+
assert_absent staged "g_glob ran" "$out"
|
|
57
|
+
|
|
58
|
+
# An ungoverned path with a trigger='*' gate present: g_star covers it, so no note.
|
|
59
|
+
out="$(run_for zzz/nowhere.md)"
|
|
60
|
+
assert_has covered "g_star ran" "$out"
|
|
61
|
+
assert_absent covered "no registered gate couples to" "$out"
|
|
62
|
+
|
|
63
|
+
# Registry with no trigger='*' gate: an ungoverned path yields the note + nothing.
|
|
64
|
+
{ echo g_glob; echo g_staged; } > "$scratch/gates.list"
|
|
65
|
+
out="$(run_for zzz/nowhere.md)"; rc=$?
|
|
66
|
+
assert_has nomatch "no registered gate couples to zzz/nowhere.md" "$out"
|
|
67
|
+
assert_has nomatch "nothing to run" "$out"
|
|
68
|
+
[[ "$rc" -eq 0 ]] || { echo "FAIL [nomatch]: expected exit 0, got $rc"; fails=$((fails + 1)); }
|
|
69
|
+
|
|
70
|
+
# --for with no path is a usage error (exit 2).
|
|
71
|
+
GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch" \
|
|
72
|
+
GATE_SDK_TMP_DIR="$scratch/.tmp" bash "$RUN" --for >/dev/null 2>&1
|
|
73
|
+
[[ $? -eq 2 ]] || { echo "FAIL [usage]: --for with no path should exit 2"; fails=$((fails + 1)); }
|
|
74
|
+
|
|
75
|
+
[[ "$fails" -eq 0 ]] || { echo "run-for-path.test: $fails assertion(s) failed"; exit 1; }
|
|
76
|
+
echo "run-for-path.test: clean (--for selects by shared matcher; trigger='*' universal, mode=staged pathspec passes args, ungoverned path noted)"
|
|
77
|
+
exit 0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# shellcheck shell=bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §Consumer smoke — the shared scratch-consumer builder both smoke harnesses vendor through (run-consumer-smoke.sh and context-kit/smoke/agents-md.sh)
|
|
3
|
+
|
|
4
|
+
# spec: gate-sdk/SPEC.md §Consumer smoke — csmoke_vendor_and_install: from the kit roots (gate-sdk first) sets SCRATCH + CSMOKE_INSTALLED; returns 2 on an environment failure; the caller owns cleanup and every post-baseline assertion
|
|
5
|
+
csmoke_vendor_and_install() {
|
|
6
|
+
local roots=("$@") r kit
|
|
7
|
+
SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/consumer-smoke.XXXXXX")" || return 2
|
|
8
|
+
|
|
9
|
+
git -C "$SCRATCH" init -q
|
|
10
|
+
printf '.tmp/\n' > "$SCRATCH/.gitignore"
|
|
11
|
+
git -C "$SCRATCH" add -A
|
|
12
|
+
git -C "$SCRATCH" -c user.email=smoke@example.invalid -c user.name=smoke \
|
|
13
|
+
commit -q --allow-empty -m "seed"
|
|
14
|
+
|
|
15
|
+
for r in "${roots[@]}"; do
|
|
16
|
+
cp -R "$r" "$SCRATCH/$(basename "$r")"
|
|
17
|
+
done
|
|
18
|
+
|
|
19
|
+
CSMOKE_INSTALLED=0
|
|
20
|
+
for r in "${roots[@]}"; do
|
|
21
|
+
kit="$(basename "$r")"
|
|
22
|
+
if ! ( cd "$SCRATCH" && SMOKE_KIT_ROOT="$SCRATCH/$kit" bash "$SCRATCH/$kit/smoke/install.sh" ); then
|
|
23
|
+
echo "csmoke: $kit/smoke/install.sh failed (a broken installer is an environment failure)" >&2
|
|
24
|
+
return 2
|
|
25
|
+
fi
|
|
26
|
+
CSMOKE_INSTALLED=$((CSMOKE_INSTALLED + 1))
|
|
27
|
+
done
|
|
28
|
+
|
|
29
|
+
git -C "$SCRATCH" add -A
|
|
30
|
+
git -C "$SCRATCH" -c user.email=smoke@example.invalid -c user.name=smoke \
|
|
31
|
+
commit -q --no-verify -m "installed baseline"
|
|
32
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# shellcheck shell=bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — sourced library: values + adapters, never gate structure
|
|
3
|
+
|
|
4
|
+
# spec: gate-sdk/SPEC.md §Layout and configuration — auto-source the consumer config seam so a layout knob's override persists past the shell that set it; GATE_SDK_CONFIG_FILE wins, else <gates-dir>/gate-sdk-config.sh (GATE_SDK_GATES_DIR stays env-or-default — a config file cannot name its own directory)
|
|
5
|
+
_gate_sdk_config="${GATE_SDK_CONFIG_FILE:-}"
|
|
6
|
+
if [[ -n "$_gate_sdk_config" ]]; then
|
|
7
|
+
[[ -f "$_gate_sdk_config" ]] || {
|
|
8
|
+
echo "gate-sdk: GATE_SDK_CONFIG_FILE not found: $_gate_sdk_config" >&2
|
|
9
|
+
exit 2
|
|
10
|
+
}
|
|
11
|
+
# shellcheck disable=SC1090 # consumer-supplied config, path is a knob
|
|
12
|
+
source "$_gate_sdk_config"
|
|
13
|
+
else
|
|
14
|
+
_gate_sdk_config="${GATE_SDK_GATES_DIR:-scripts}/gate-sdk-config.sh"
|
|
15
|
+
if [[ -f "$_gate_sdk_config" ]]; then
|
|
16
|
+
# shellcheck disable=SC1090 # consumer-supplied config, path is a knob
|
|
17
|
+
source "$_gate_sdk_config"
|
|
18
|
+
fi
|
|
19
|
+
fi
|
|
20
|
+
unset _gate_sdk_config
|
|
21
|
+
|
|
22
|
+
# spec: gate-sdk/SPEC.md §Fail-closed contract — non-zero capture status means the check could not run; exit 2, never a false clean
|
|
23
|
+
fail_closed() {
|
|
24
|
+
if [[ "$1" -ne 0 ]]; then
|
|
25
|
+
printf '%s: %s exited %s — the check could not run; treating as ' \
|
|
26
|
+
"$2" "$3" "$1" >&2
|
|
27
|
+
printf 'failure (not clean)\n' >&2
|
|
28
|
+
exit 2
|
|
29
|
+
fi
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if [[ -n "${GATE_SDK_PRUNE_DIRS:-}" ]]; then
|
|
33
|
+
read -r -a GATE_PRUNE_DIRS <<<"$GATE_SDK_PRUNE_DIRS"
|
|
34
|
+
else
|
|
35
|
+
GATE_PRUNE_DIRS=(target .git node_modules .tmp gate-tests)
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
gate_find() {
|
|
39
|
+
local prune=() d
|
|
40
|
+
for d in "${GATE_PRUNE_DIRS[@]}"; do prune+=(-name "$d" -o); done
|
|
41
|
+
unset 'prune[${#prune[@]}-1]'
|
|
42
|
+
find "$1" \( "${prune[@]}" \) -prune -o "${@:2}" -print
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# shellcheck disable=SC2034 # consumed by sourcing gates, never within this lib
|
|
46
|
+
GATE_GREP_EXCLUDES=()
|
|
47
|
+
for _gpd in "${GATE_PRUNE_DIRS[@]}"; do GATE_GREP_EXCLUDES+=(--exclude-dir="$_gpd"); done
|
|
48
|
+
unset _gpd
|
|
49
|
+
|
|
50
|
+
gate_path_pruned() {
|
|
51
|
+
local p="$1" d
|
|
52
|
+
for d in "${GATE_PRUNE_DIRS[@]}"; do
|
|
53
|
+
[[ "$p" == "$d/"* || "$p" == "./$d/"* || "$p" == */"$d"/* ]] && return 0
|
|
54
|
+
done
|
|
55
|
+
return 1
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
gate_sdk_root() {
|
|
59
|
+
( cd "${BASH_SOURCE[0]%/*}/.." && pwd )
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
gate_sdk_gates_dir() {
|
|
63
|
+
printf '%s\n' "${GATE_SDK_GATES_DIR:-scripts}"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
gates_list_members() {
|
|
67
|
+
grep -Ev '^[[:space:]]*(#|$)' "$1" || true
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
gate_resolve() {
|
|
71
|
+
local g="$1" d
|
|
72
|
+
shift
|
|
73
|
+
for d in "$@"; do
|
|
74
|
+
if [[ -f "$d/$g.sh" ]]; then
|
|
75
|
+
printf '%s\n' "$d/$g.sh"
|
|
76
|
+
return 0
|
|
77
|
+
fi
|
|
78
|
+
done
|
|
79
|
+
return 1
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
gate_kit_roots() {
|
|
83
|
+
local d kit
|
|
84
|
+
if [[ -n "${GATE_SDK_KIT_DIRS:-}" ]]; then
|
|
85
|
+
for d in $GATE_SDK_KIT_DIRS; do printf '%s\n' "$d"; done
|
|
86
|
+
return 0
|
|
87
|
+
fi
|
|
88
|
+
local sdk parent
|
|
89
|
+
sdk="$(gate_sdk_root)"
|
|
90
|
+
printf '%s\n' "$sdk"
|
|
91
|
+
parent="${sdk%/*}"
|
|
92
|
+
for d in "$parent"/*/; do
|
|
93
|
+
kit="${d%/}"
|
|
94
|
+
[[ "$kit" == "$sdk" ]] && continue
|
|
95
|
+
[[ -d "$kit/checks" || -d "$kit/smoke" ]] || continue
|
|
96
|
+
printf '%s\n' "$kit"
|
|
97
|
+
done
|
|
98
|
+
return 0
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
gate_check_dirs() {
|
|
102
|
+
gate_sdk_gates_dir
|
|
103
|
+
local k
|
|
104
|
+
while IFS= read -r k; do
|
|
105
|
+
printf '%s/checks\n' "$k"
|
|
106
|
+
done < <(gate_kit_roots)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the fixture-suite derivation shared by CI and evidence-kit's validate config: every dir with a gate-tests/ tree (the kit roots plus the gates dir), one tab-separated '<suite> <tests-dir> <checks-dir-or-empty>' row per suite in kit-roots-then-gates-dir order. suite = the dir basename with '-'→'_' (a valid var suffix + scenario name); checks-dir is the sibling checks/ when present, else empty so run-gate-tests falls back to consumer-first resolution. A new kit's gate-tests/ enrols with no hand-list to drift.
|
|
110
|
+
gate_fixture_suites() {
|
|
111
|
+
local anchor base suite
|
|
112
|
+
anchor="${GATE_SDK_ROOT:-$(gate_sdk_root)}"; anchor="${anchor%/*}"
|
|
113
|
+
{ gate_kit_roots_rel; gate_sdk_gates_dir; } | while IFS= read -r base; do
|
|
114
|
+
base="${base%/}"
|
|
115
|
+
[[ -d "$anchor/$base/gate-tests" ]] || continue
|
|
116
|
+
suite="${base##*/}"; suite="${suite//-/_}"
|
|
117
|
+
if [[ -d "$anchor/$base/checks" ]]; then
|
|
118
|
+
printf '%s\t%s\t%s\n' "$suite" "$base/gate-tests" "$base/checks"
|
|
119
|
+
else
|
|
120
|
+
printf '%s\t%s\t\n' "$suite" "$base/gate-tests"
|
|
121
|
+
fi
|
|
122
|
+
done
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — gate_kit_roots as repo-root-relative dirs (the anchor the couples globs share); absolute roots resolve against the kits' parent, relative roots (a GATE_SDK_KIT_DIRS override) pass through
|
|
126
|
+
gate_kit_roots_rel() {
|
|
127
|
+
local anchor root
|
|
128
|
+
anchor="${GATE_SDK_ROOT:-$(gate_sdk_root)}"; anchor="${anchor%/*}"
|
|
129
|
+
while IFS= read -r root; do
|
|
130
|
+
if [[ "$root" == /* ]]; then
|
|
131
|
+
realpath --relative-to="$anchor" "$root" 2>/dev/null || printf '%s\n' "$root"
|
|
132
|
+
else
|
|
133
|
+
printf '%s\n' "$root"
|
|
134
|
+
fi
|
|
135
|
+
done < <(gate_kit_roots)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# spec: gate-sdk/SPEC.md §check-graph — expand each kit:<glob> token in a comma-joined couples/trigger field to <kit-root>/<glob> for every gate_kit_roots_rel member; non-kit tokens pass through verbatim. The single reader gen-pre-commit, check-graph, and the hook share, so emitter and checker cannot desync.
|
|
139
|
+
gate_expand_couples() {
|
|
140
|
+
local field="$1"
|
|
141
|
+
local -a roots=() parts=() out=()
|
|
142
|
+
mapfile -t roots < <(gate_kit_roots_rel)
|
|
143
|
+
IFS=',' read -ra parts <<<"$field"
|
|
144
|
+
local tok r glob
|
|
145
|
+
for tok in "${parts[@]}"; do
|
|
146
|
+
if [[ "$tok" == kit:* ]]; then
|
|
147
|
+
glob="${tok#kit:}"
|
|
148
|
+
for r in "${roots[@]}"; do out+=("${r%/}/$glob"); done
|
|
149
|
+
else
|
|
150
|
+
out+=("$tok")
|
|
151
|
+
fi
|
|
152
|
+
done
|
|
153
|
+
local IFS=','
|
|
154
|
+
printf '%s\n' "${out[*]}"
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
# spec: gate-sdk/SPEC.md §The `# graph:` manifest — read one field from a resolved gate's `# graph:` line; the shared field reader gen-pre-commit and run-gates --for selection draw the manifest through (the couples-token expansion stays gate_expand_couples, the reader check-graph also shares). Emits the value, empty when the field is absent; never fails on a missing field.
|
|
158
|
+
gate_manifest_field() {
|
|
159
|
+
local src="$1" key="$2" man kv
|
|
160
|
+
man="$(grep -m1 '^# graph: ' "$src" 2>/dev/null || true)"
|
|
161
|
+
for kv in ${man#\# graph: }; do
|
|
162
|
+
[[ "$kv" == "$key="* ]] && { printf '%s' "${kv#"$key"=}"; return 0; }
|
|
163
|
+
done
|
|
164
|
+
return 0
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
# spec: gate-sdk/SPEC.md §run-gates — the path/glob matcher shared by run-gates --for selection and the emitted pre-commit hook: true when a path in the caller's staged_all array matches one of the given globs (bash glob, `*` spans '/'). gen-pre-commit emits this body verbatim into the hook's staged_matches; check-graph's freshness assertion holds the two in sync.
|
|
168
|
+
# shellcheck disable=SC2154 # staged_all is the caller's array: the hook's staged set, the selector's --for paths
|
|
169
|
+
gate_staged_matches() {
|
|
170
|
+
local f pat
|
|
171
|
+
for f in "${staged_all[@]}"; do
|
|
172
|
+
for pat in "$@"; do
|
|
173
|
+
# shellcheck disable=SC2053
|
|
174
|
+
[[ "$f" == $pat ]] && return 0
|
|
175
|
+
done
|
|
176
|
+
done
|
|
177
|
+
return 1
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
# spec: gate-sdk/SPEC.md §check-commit-msg — resolve the banned-pattern file set shared by check-commit-msg and check-tree-terms: explicit positional args win; otherwise GATE_SDK_MSG_PATTERN_FILES (tracked, must exist — fail-closed) plus GATE_SDK_MSG_PATTERN_FILES_LOCAL (gitignored, skipped when absent). Emits one existing readable file path per line; returns 2 when a required tracked file is missing.
|
|
181
|
+
gate_msg_pattern_files() {
|
|
182
|
+
if [[ $# -gt 0 ]]; then
|
|
183
|
+
printf '%s\n' "$@"
|
|
184
|
+
return 0
|
|
185
|
+
fi
|
|
186
|
+
local f gd
|
|
187
|
+
gd="$(gate_sdk_gates_dir)"
|
|
188
|
+
for f in ${GATE_SDK_MSG_PATTERN_FILES:-$gd/msg-patterns.list}; do
|
|
189
|
+
[[ -f "$f" ]] || { echo "gate_msg_pattern_files: required tracked pattern file missing: $f" >&2; return 2; }
|
|
190
|
+
[[ -r "$f" ]] || { echo "gate_msg_pattern_files: pattern file not readable: $f" >&2; return 2; }
|
|
191
|
+
printf '%s\n' "$f"
|
|
192
|
+
done
|
|
193
|
+
for f in ${GATE_SDK_MSG_PATTERN_FILES_LOCAL:-$gd/msg-patterns.local.list}; do
|
|
194
|
+
[[ -f "$f" && -r "$f" ]] && printf '%s\n' "$f"
|
|
195
|
+
done
|
|
196
|
+
return 0
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
# spec: gate-sdk/SPEC.md §check-commit-subject — the single home of the commit-type roster (check-commit-subject's type alternation; trajectory.sh and kpi-task-split classify over the same tokens). Emits the space-separated roster on one line: GATE_SDK_COMMIT_TYPES when set, else the shipped default.
|
|
200
|
+
gate_commit_types() {
|
|
201
|
+
printf '%s\n' "${GATE_SDK_COMMIT_TYPES:-feat fix refactor perf docs test build ci chore style}"
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
# spec: gate-sdk/SPEC.md §lib/gate.sh — the self-repo blob-link prefix `<identity>/blob/<ref>/`, shared by check-md-refs' resolver and the reference-link producers (the enforcement map) so an emitted link and the pass that validates it derive one identity. Identity comes from `git remote get-url origin`; the git@ and https remote forms normalize to one https identity, so no kit ships a repo name (the provenance seam holds). Empty output ⇒ no origin or an unrecognized remote form, and the caller skips the self-repo pass. The ref is the caller's policy arg, never a literal here.
|
|
205
|
+
gate_self_repo_prefix() {
|
|
206
|
+
local ref="$1" origin id rest
|
|
207
|
+
origin="$(git remote get-url origin 2>/dev/null)" || return 0
|
|
208
|
+
[[ -n "$origin" ]] || return 0
|
|
209
|
+
id="${origin%.git}"; id="${id%/}"
|
|
210
|
+
case "$id" in
|
|
211
|
+
git@*:*) rest="${id#git@}"; id="https://${rest/:/\/}" ;;
|
|
212
|
+
https://*|http://*) ;;
|
|
213
|
+
*) return 0 ;;
|
|
214
|
+
esac
|
|
215
|
+
printf '%s/blob/%s/\n' "$id" "$ref"
|
|
216
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# shellcheck shell=bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §lib/inject.sh — the marker-bounded insert/replace shared by every kit's agent-file injector; block-content generation stays with the caller
|
|
3
|
+
|
|
4
|
+
# spec: gate-sdk/SPEC.md §lib/inject.sh — inject_marker_block <file> <begin> <end>; inner block content on stdin. Replaces the span between an existing marker pair (inclusive) or appends a fresh block when absent; a begin marker without its end is malformed (exit 2); the file must exist (exit 2). Echoes the action taken (appended|replaced).
|
|
5
|
+
inject_marker_block() {
|
|
6
|
+
(
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
file="$1"; begin="$2"; end="$3"
|
|
9
|
+
[[ -f "$file" ]] \
|
|
10
|
+
|| { echo "inject_marker_block: target file not found: $file" >&2; exit 2; }
|
|
11
|
+
|
|
12
|
+
tmp="$(mktemp)"; block="$(mktemp)"
|
|
13
|
+
trap 'rm -f "$tmp" "$block"' EXIT
|
|
14
|
+
{ printf '%s\n' "$begin"; cat; printf '%s\n' "$end"; } >"$block"
|
|
15
|
+
|
|
16
|
+
if grep -qF -- "$begin" "$file"; then
|
|
17
|
+
grep -qF -- "$end" "$file" \
|
|
18
|
+
|| { echo "inject_marker_block: begin marker present but end marker missing in $file — refusing to guess the block bounds" >&2; exit 2; }
|
|
19
|
+
awk -v b="$begin" -v e="$end" -v blockfile="$block" '
|
|
20
|
+
$0 == b { skip = 1; while ((getline line < blockfile) > 0) print line; close(blockfile); next }
|
|
21
|
+
$0 == e { skip = 0; next }
|
|
22
|
+
!skip { print }
|
|
23
|
+
' "$file" >"$tmp"
|
|
24
|
+
action="replaced"
|
|
25
|
+
else
|
|
26
|
+
cp "$file" "$tmp"
|
|
27
|
+
printf '\n' >>"$tmp"
|
|
28
|
+
cat "$block" >>"$tmp"
|
|
29
|
+
action="appended"
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
cp "$tmp" "$file"
|
|
33
|
+
printf '%s\n' "$action"
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# shellcheck shell=bash
|
|
2
|
+
# spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — pin every kit's <KIT>_CONFIG_FILE to one shared empty file so a bespoke gate-tests/*.test.sh runs on kit defaults, never the invoker's cwd config; knob-free by design (a config-pinning tool cannot be configured by the surface it pins)
|
|
3
|
+
_th_root="$(cd "${BASH_SOURCE[0]%/*}/../.." && pwd)"
|
|
4
|
+
_th_empty="${TMPDIR:-/tmp}/gate-sdk-hermetic-empty.sh"
|
|
5
|
+
: >"$_th_empty"
|
|
6
|
+
for _th_kit in "$_th_root"/gate-sdk "$_th_root"/*-kit; do
|
|
7
|
+
[[ -d "$_th_kit" ]] || continue
|
|
8
|
+
_th_var="$(printf '%s' "${_th_kit##*/}" | tr '[:lower:]-' '[:upper:]_')_CONFIG_FILE"
|
|
9
|
+
export "${_th_var}=${_th_empty}"
|
|
10
|
+
done
|
|
11
|
+
unset _th_root _th_empty _th_kit _th_var
|