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,155 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: drift-kit/SPEC.md §The report skeleton — the collator; owns the frame, every measurement lives in a plugin
|
|
3
|
+
# usage: drift-report.sh [--trend] (bare: full lead/lag report; --trend: one compact hook line)
|
|
4
|
+
# advisory by construction: exit is always 0, never joins gates.list
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
8
|
+
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
9
|
+
cd "$REPO_ROOT" 2>/dev/null || exit 0
|
|
10
|
+
|
|
11
|
+
_ds_gatelib="$KIT/../gate-sdk/lib/gate.sh"
|
|
12
|
+
if [[ -f "$_ds_gatelib" ]]; then
|
|
13
|
+
# shellcheck source=../../gate-sdk/lib/gate.sh
|
|
14
|
+
source "$_ds_gatelib"
|
|
15
|
+
fi
|
|
16
|
+
unset _ds_gatelib
|
|
17
|
+
|
|
18
|
+
# spec: drift-kit/SPEC.md §Layout and configuration
|
|
19
|
+
_ds_cfg="${DRIFT_KIT_CONFIG_FILE:-}"
|
|
20
|
+
if [[ -n "$_ds_cfg" ]]; then
|
|
21
|
+
[[ -f "$_ds_cfg" ]] || {
|
|
22
|
+
echo "drift-kit: DRIFT_KIT_CONFIG_FILE not found: $_ds_cfg" >&2
|
|
23
|
+
exit 2
|
|
24
|
+
}
|
|
25
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
26
|
+
source "$_ds_cfg"
|
|
27
|
+
else
|
|
28
|
+
_ds_cfg="${GATE_SDK_GATES_DIR:-scripts}/drift-config.sh"
|
|
29
|
+
if [[ -f "$_ds_cfg" ]]; then
|
|
30
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
31
|
+
source "$_ds_cfg"
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
unset _ds_cfg
|
|
35
|
+
|
|
36
|
+
: "${DRIFT_KIT_KPIS_FILE:=${GATE_SDK_GATES_DIR:-scripts}/kpis.list}"
|
|
37
|
+
: "${DRIFT_KIT_QUEUE_FILE:=${GATE_SDK_QUEUE_FILE:-TASK-QUEUE.md}}"
|
|
38
|
+
: "${DRIFT_KIT_KNOWLEDGE_LOG:=${GATE_SDK_WORKFLOW_DIR:-.workflow}/knowledge-friction.log}"
|
|
39
|
+
: "${DRIFT_KIT_TIMINGS_FILE:=${GATE_SDK_TMP_DIR:-.tmp}/gate-timings.txt}"
|
|
40
|
+
: "${DRIFT_KIT_TMP_DIR:=${GATE_SDK_TMP_DIR:-.tmp}}"
|
|
41
|
+
: "${DRIFT_KIT_METRIC_DIR:=.metric}"
|
|
42
|
+
: "${DRIFT_KIT_DONE_SECTION:=Done}"
|
|
43
|
+
: "${DRIFT_KIT_DEFERRED_SECTION:=Deferred}"
|
|
44
|
+
: "${DRIFT_KIT_ICEBOX_SECTION:=}"
|
|
45
|
+
declare -p DRIFT_KIT_KPI_DIRS >/dev/null 2>&1 || DRIFT_KIT_KPI_DIRS=("${GATE_SDK_GATES_DIR:-scripts}")
|
|
46
|
+
|
|
47
|
+
iteration_start() {
|
|
48
|
+
local state="${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt" iter
|
|
49
|
+
[[ -f "$DRIFT_KIT_QUEUE_FILE" ]] || return 0
|
|
50
|
+
iter="$(grep -m1 '^## Iteration:' "$DRIFT_KIT_QUEUE_FILE" 2>/dev/null \
|
|
51
|
+
| sed -E 's/^## Iteration:[[:space:]]*//; s/[[:space:]]*\[stage:.*$//')"
|
|
52
|
+
[[ -n "$iter" ]] || return 0
|
|
53
|
+
git log --format='%h' -S"$iter scope " -- "$state" 2>/dev/null | tail -1
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# spec: drift-kit/SPEC.md §The KPI plugin contract — a driver handoff, not a consumer knob: derived here so the compgen export below carries it to plugins with no new export list to drift out of parity. Priced: hoisting it above the loop runs it in --trend too, putting one grep and one single-file git pickaxe on every session start via the context hook.
|
|
57
|
+
DRIFT_KIT_ITERATION_START="$(iteration_start)"
|
|
58
|
+
|
|
59
|
+
# spec: drift-kit/SPEC.md §The KPI plugin contract — export every scalar DRIFT_KIT_* (arrays skipped: unexportable, collator-internal), so a config override reaches plugins with no fixed list to drift
|
|
60
|
+
for _dv in $(compgen -v DRIFT_KIT_); do
|
|
61
|
+
[[ "$(declare -p "$_dv" 2>/dev/null)" == "declare -a"* ]] && continue
|
|
62
|
+
export "${_dv?}"
|
|
63
|
+
done
|
|
64
|
+
unset _dv
|
|
65
|
+
|
|
66
|
+
if declare -f gate_kit_roots >/dev/null 2>&1; then
|
|
67
|
+
DRIFT_KIT_KIT_ROOTS="$(gate_kit_roots)"
|
|
68
|
+
else
|
|
69
|
+
DRIFT_KIT_KIT_ROOTS="$KIT/.."
|
|
70
|
+
fi
|
|
71
|
+
export DRIFT_KIT_KIT_ROOTS
|
|
72
|
+
|
|
73
|
+
mkdir -p "$DRIFT_KIT_TMP_DIR" 2>/dev/null || true
|
|
74
|
+
|
|
75
|
+
kpi_dirs() {
|
|
76
|
+
local d k
|
|
77
|
+
for d in "${DRIFT_KIT_KPI_DIRS[@]}"; do printf '%s\n' "$d"; done
|
|
78
|
+
while IFS= read -r k; do
|
|
79
|
+
[[ -n "$k" && -d "$k/kpis" ]] && printf '%s/kpis\n' "$k"
|
|
80
|
+
done <<<"$DRIFT_KIT_KIT_ROOTS"
|
|
81
|
+
[[ -d "$KIT/kpis" ]] && printf '%s/kpis\n' "$KIT"
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
resolve_kpi() {
|
|
85
|
+
local name="$1" d
|
|
86
|
+
while IFS= read -r d; do
|
|
87
|
+
[[ -f "$d/$name.sh" ]] && { printf '%s\n' "$d/$name.sh"; return 0; }
|
|
88
|
+
done < <(kpi_dirs)
|
|
89
|
+
return 1
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
registry_members() {
|
|
93
|
+
[[ -f "$DRIFT_KIT_KPIS_FILE" ]] || return 0
|
|
94
|
+
grep -Ev '^[[:space:]]*(#|$)' "$DRIFT_KIT_KPIS_FILE" || true
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if [[ "${1:-}" == "--trend" ]]; then
|
|
98
|
+
frags=()
|
|
99
|
+
while IFS= read -r name; do
|
|
100
|
+
[[ -n "$name" ]] || continue
|
|
101
|
+
path="$(resolve_kpi "$name")" || continue
|
|
102
|
+
frag="$("$path" --trend 2>/dev/null)" || true
|
|
103
|
+
frag="${frag%%$'\n'*}"
|
|
104
|
+
[[ -n "$frag" ]] && frags+=("$frag")
|
|
105
|
+
done < <(registry_members)
|
|
106
|
+
[[ ${#frags[@]} -eq 0 ]] && exit 0
|
|
107
|
+
line="drift:"
|
|
108
|
+
for f in "${frags[@]}"; do line="$line $f ·"; done
|
|
109
|
+
printf '%s\n' "${line% ·}"
|
|
110
|
+
exit 0
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
lead_rows=()
|
|
114
|
+
lag_rows=()
|
|
115
|
+
while IFS= read -r name; do
|
|
116
|
+
[[ -n "$name" ]] || continue
|
|
117
|
+
if ! path="$(resolve_kpi "$name")"; then
|
|
118
|
+
lead_rows+=("$name"$'\t'"n/a (unresolved — not in any KPI dir)")
|
|
119
|
+
continue
|
|
120
|
+
fi
|
|
121
|
+
out="$("$path" 2>/dev/null)"; rc=$?
|
|
122
|
+
if [[ "$rc" -ne 0 || -z "$out" ]]; then
|
|
123
|
+
lead_rows+=("$name"$'\t'"n/a (plugin failed)")
|
|
124
|
+
continue
|
|
125
|
+
fi
|
|
126
|
+
while IFS=$'\t' read -r section label value; do
|
|
127
|
+
[[ -z "$section" ]] && continue
|
|
128
|
+
case "$section" in
|
|
129
|
+
lag) lag_rows+=("$label"$'\t'"$value") ;;
|
|
130
|
+
*) lead_rows+=("$label"$'\t'"$value") ;;
|
|
131
|
+
esac
|
|
132
|
+
done <<<"$out"
|
|
133
|
+
done < <(registry_members)
|
|
134
|
+
|
|
135
|
+
print_section() {
|
|
136
|
+
local -n rows="$1"
|
|
137
|
+
local r label value
|
|
138
|
+
for r in "${rows[@]}"; do
|
|
139
|
+
IFS=$'\t' read -r label value <<<"$r"
|
|
140
|
+
printf ' %-22s %s\n' "$label" "$value"
|
|
141
|
+
done
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
header="=== Drift KPIs (advisory — trend, not level) ==="
|
|
145
|
+
[[ -n "$DRIFT_KIT_ITERATION_START" ]] && header="$header [iteration start $DRIFT_KIT_ITERATION_START]"
|
|
146
|
+
printf '%s\n\n' "$header"
|
|
147
|
+
|
|
148
|
+
printf -- '--- Lead (weighted high — act before drift compounds) ---\n'
|
|
149
|
+
if [[ ${#lead_rows[@]} -gt 0 ]]; then print_section lead_rows; else echo " (none registered)"; fi
|
|
150
|
+
printf '\n'
|
|
151
|
+
printf -- '--- Lag (weighted low — undercounts by construction) ---\n'
|
|
152
|
+
if [[ ${#lag_rows[@]} -gt 0 ]]; then print_section lag_rows; else echo " (none registered)"; fi
|
|
153
|
+
printf '\n'
|
|
154
|
+
echo "Read trend across sessions; lag KPIs lower-bound only."
|
|
155
|
+
exit 0
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: drift-kit/SPEC.md §The knowledge-friction loop — the capture affordance; stamps the grammar, no caller-side redirect
|
|
3
|
+
# usage: kfric.sh "<fact re-derived>" "<surface it was read from>" (both required, non-empty)
|
|
4
|
+
# appends one line '<date> <fact> ← <surface>' to the knowledge-friction log; exit 2 on misuse
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
8
|
+
cd "$REPO_ROOT" 2>/dev/null || exit 1
|
|
9
|
+
|
|
10
|
+
# spec: drift-kit/SPEC.md §Layout and configuration
|
|
11
|
+
_ds_cfg="${DRIFT_KIT_CONFIG_FILE:-}"
|
|
12
|
+
if [[ -n "$_ds_cfg" ]]; then
|
|
13
|
+
[[ -f "$_ds_cfg" ]] || {
|
|
14
|
+
echo "drift-kit: DRIFT_KIT_CONFIG_FILE not found: $_ds_cfg" >&2
|
|
15
|
+
exit 2
|
|
16
|
+
}
|
|
17
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
18
|
+
source "$_ds_cfg"
|
|
19
|
+
else
|
|
20
|
+
_ds_cfg="${GATE_SDK_GATES_DIR:-scripts}/drift-config.sh"
|
|
21
|
+
if [[ -f "$_ds_cfg" ]]; then
|
|
22
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
23
|
+
source "$_ds_cfg"
|
|
24
|
+
fi
|
|
25
|
+
fi
|
|
26
|
+
unset _ds_cfg
|
|
27
|
+
|
|
28
|
+
: "${DRIFT_KIT_KNOWLEDGE_LOG:=${GATE_SDK_WORKFLOW_DIR:-.workflow}/knowledge-friction.log}"
|
|
29
|
+
|
|
30
|
+
usage() {
|
|
31
|
+
printf 'usage: %s "<fact re-derived>" "<surface it was read from>"\n' "$(basename "$0")" >&2
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if [[ $# -ne 2 || -z "$1" || -z "$2" ]]; then
|
|
35
|
+
usage
|
|
36
|
+
exit 2
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
mkdir -p "$(dirname "$DRIFT_KIT_KNOWLEDGE_LOG")" 2>/dev/null || true
|
|
40
|
+
line="$(date +%F) $1 ← $2"
|
|
41
|
+
printf '%s\n' "$line" >>"$DRIFT_KIT_KNOWLEDGE_LOG"
|
|
42
|
+
printf 'kfric: %s\n' "$line"
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: drift-kit/SPEC.md §The overhead meter — the byte-proxy governance/task classifier over a session transcript
|
|
3
|
+
# usage: overhead-meter.sh [transcript.jsonl] (bare: newest transcript under DRIFT_KIT_SESSIONS_DIR)
|
|
4
|
+
# advisory by construction: exit is always 0, never joins gates.list; writes counts only, never transcript content
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
8
|
+
cd "$REPO_ROOT" 2>/dev/null || exit 0
|
|
9
|
+
|
|
10
|
+
# spec: drift-kit/SPEC.md §Layout and configuration
|
|
11
|
+
_ds_cfg="${DRIFT_KIT_CONFIG_FILE:-}"
|
|
12
|
+
if [[ -n "$_ds_cfg" ]]; then
|
|
13
|
+
[[ -f "$_ds_cfg" ]] || {
|
|
14
|
+
echo "drift-kit: DRIFT_KIT_CONFIG_FILE not found: $_ds_cfg" >&2
|
|
15
|
+
exit 2
|
|
16
|
+
}
|
|
17
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
18
|
+
source "$_ds_cfg"
|
|
19
|
+
else
|
|
20
|
+
_ds_cfg="${GATE_SDK_GATES_DIR:-scripts}/drift-config.sh"
|
|
21
|
+
if [[ -f "$_ds_cfg" ]]; then
|
|
22
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
23
|
+
source "$_ds_cfg"
|
|
24
|
+
fi
|
|
25
|
+
fi
|
|
26
|
+
unset _ds_cfg
|
|
27
|
+
|
|
28
|
+
: "${DRIFT_KIT_TMP_DIR:=${GATE_SDK_TMP_DIR:-.tmp}}"
|
|
29
|
+
: "${DRIFT_KIT_METRIC_DIR:=.metric}"
|
|
30
|
+
: "${DRIFT_KIT_OVERHEAD_LOG:=$DRIFT_KIT_METRIC_DIR/overhead-log.txt}"
|
|
31
|
+
|
|
32
|
+
sessions_dir() {
|
|
33
|
+
if [[ -n "${DRIFT_KIT_SESSIONS_DIR:-}" ]]; then
|
|
34
|
+
printf '%s\n' "$DRIFT_KIT_SESSIONS_DIR"
|
|
35
|
+
return 0
|
|
36
|
+
fi
|
|
37
|
+
local home slug
|
|
38
|
+
home="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
|
|
39
|
+
slug="$(pwd | sed 's/[^a-zA-Z0-9]/-/g')"
|
|
40
|
+
printf '%s/projects/%s\n' "$home" "$slug"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
transcript="${1:-}"
|
|
44
|
+
if [[ -z "$transcript" ]]; then
|
|
45
|
+
dir="$(sessions_dir)"
|
|
46
|
+
if [[ -d "$dir" ]]; then
|
|
47
|
+
newest=""
|
|
48
|
+
shopt -s nullglob
|
|
49
|
+
for f in "$dir"/*.jsonl; do
|
|
50
|
+
[[ -z "$newest" || "$f" -nt "$newest" ]] && newest="$f"
|
|
51
|
+
done
|
|
52
|
+
shopt -u nullglob
|
|
53
|
+
transcript="$newest"
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
if [[ -z "$transcript" || ! -f "$transcript" ]]; then
|
|
58
|
+
echo "overhead-meter: no transcript to measure${transcript:+: $transcript}" >&2
|
|
59
|
+
echo " help: pass a transcript path, or set DRIFT_KIT_SESSIONS_DIR to the agent transcript dir." >&2
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# spec: drift-kit/SPEC.md §The overhead meter — the fixed marker table: kit-name and
|
|
64
|
+
# gate-output shapes only (mechanism, never a private vocabulary; the seam holds).
|
|
65
|
+
# LC_ALL=C makes length() count bytes, honouring the byte-proxy contract.
|
|
66
|
+
read -r total gate hook stage govdoc < <(
|
|
67
|
+
LC_ALL=C awk '
|
|
68
|
+
{ b = length($0); total += b }
|
|
69
|
+
/PASS: check-|FAIL: check-|===== check|: clean \(|run-gate/ { gate += b; next }
|
|
70
|
+
/<system-reminder>|PreToolUse|PostToolUse|SessionStart|bash-guard|hook error/ { hook += b; next }
|
|
71
|
+
/lifecycle-kit\/templates\/stages|enter-stage|WORKFLOW-STATE|Execute the template at/ { stage += b; next }
|
|
72
|
+
/SPEC\.md|SPEC-|CLAUDE\.md|DOCTRINE\.md|BRIEF\.local/ { govdoc += b; next }
|
|
73
|
+
END { printf "%d %d %d %d %d\n", total+0, gate+0, hook+0, stage+0, govdoc+0 }
|
|
74
|
+
' "$transcript"
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
gov=$(( gate + hook + stage + govdoc ))
|
|
78
|
+
task=$(( total - gov ))
|
|
79
|
+
if (( total > 0 )); then
|
|
80
|
+
pct=$(( (gov * 100 + total / 2) / total ))
|
|
81
|
+
tpct=$(( (task * 100 + total / 2) / total ))
|
|
82
|
+
else
|
|
83
|
+
pct=0; tpct=0
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
base="${transcript##*/}"
|
|
87
|
+
base="${base%.jsonl}"
|
|
88
|
+
session8="${base:0:8}"
|
|
89
|
+
today="$(date +%F)"
|
|
90
|
+
|
|
91
|
+
mkdir -p "$(dirname "$DRIFT_KIT_OVERHEAD_LOG")" 2>/dev/null || true
|
|
92
|
+
line="$today $session8 total=$total gov=$gov gate=$gate pct=$pct"
|
|
93
|
+
if [[ -f "$DRIFT_KIT_OVERHEAD_LOG" ]]; then
|
|
94
|
+
tmp="$(mktemp "${TMPDIR:-/tmp}/overhead-log.XXXXXX")"
|
|
95
|
+
grep -Fv " $session8 total=" "$DRIFT_KIT_OVERHEAD_LOG" > "$tmp" 2>/dev/null || true
|
|
96
|
+
mv "$tmp" "$DRIFT_KIT_OVERHEAD_LOG"
|
|
97
|
+
fi
|
|
98
|
+
printf '%s\n' "$line" >> "$DRIFT_KIT_OVERHEAD_LOG"
|
|
99
|
+
|
|
100
|
+
printf 'overhead-meter: %s %s\n' "$today" "$session8"
|
|
101
|
+
printf ' total=%d bytes\n' "$total"
|
|
102
|
+
printf ' governance=%d (%d%%) [gate=%d hook=%d stage=%d govdoc=%d]\n' "$gov" "$pct" "$gate" "$hook" "$stage" "$govdoc"
|
|
103
|
+
printf ' task=%d (%d%%)\n' "$task" "$tpct"
|
|
104
|
+
printf ' (byte-proxy at line granularity — a proportion across same-shape sessions, not tokens; drift-kit/SPEC.md §The overhead meter)\n'
|
|
105
|
+
printf ' logged: %s\n' "$DRIFT_KIT_OVERHEAD_LOG"
|
|
106
|
+
exit 0
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — prices lifecycle spend by stage × model × iteration via WORKFLOW-STATE stamps ⋈ transcripts ⋈ a consumer price table
|
|
3
|
+
# usage: stage-economics.sh (reads DRIFT_KIT_STATE_FILE stamps, matches transcripts under DRIFT_KIT_SESSIONS_DIR, prices via DRIFT_KIT_PRICE_TABLE)
|
|
4
|
+
# advisory by construction (§The overhead meter): exit is always 0, never joins gates.list; a missing input is a 0-exit notice, writes counts/cost only, never transcript content, and emits no account identifiers
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
8
|
+
cd "$REPO_ROOT" 2>/dev/null || exit 0
|
|
9
|
+
|
|
10
|
+
# spec: drift-kit/SPEC.md §Layout and configuration
|
|
11
|
+
_ds_cfg="${DRIFT_KIT_CONFIG_FILE:-}"
|
|
12
|
+
if [[ -n "$_ds_cfg" ]]; then
|
|
13
|
+
[[ -f "$_ds_cfg" ]] || {
|
|
14
|
+
echo "drift-kit: DRIFT_KIT_CONFIG_FILE not found: $_ds_cfg" >&2
|
|
15
|
+
exit 2
|
|
16
|
+
}
|
|
17
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
18
|
+
source "$_ds_cfg"
|
|
19
|
+
else
|
|
20
|
+
_ds_cfg="${GATE_SDK_GATES_DIR:-scripts}/drift-config.sh"
|
|
21
|
+
if [[ -f "$_ds_cfg" ]]; then
|
|
22
|
+
# shellcheck source=/dev/null # consumer config path is resolved at runtime
|
|
23
|
+
source "$_ds_cfg"
|
|
24
|
+
fi
|
|
25
|
+
fi
|
|
26
|
+
unset _ds_cfg
|
|
27
|
+
|
|
28
|
+
: "${DRIFT_KIT_METRIC_DIR:=.metric}"
|
|
29
|
+
: "${DRIFT_KIT_STAGE_ECONOMICS_LOG:=$DRIFT_KIT_METRIC_DIR/stage-economics-log.txt}"
|
|
30
|
+
: "${DRIFT_KIT_PRICE_TABLE:=${GATE_SDK_GATES_DIR:-scripts}/price-table.tsv}"
|
|
31
|
+
: "${DRIFT_KIT_STATE_FILE:=${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt}"
|
|
32
|
+
: "${DRIFT_KIT_SUPERVISION_LABEL:=supervision}"
|
|
33
|
+
|
|
34
|
+
sessions_dir() {
|
|
35
|
+
if [[ -n "${DRIFT_KIT_SESSIONS_DIR:-}" ]]; then
|
|
36
|
+
printf '%s\n' "$DRIFT_KIT_SESSIONS_DIR"
|
|
37
|
+
return 0
|
|
38
|
+
fi
|
|
39
|
+
local home slug
|
|
40
|
+
home="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
|
|
41
|
+
slug="$(pwd | sed 's/[^a-zA-Z0-9]/-/g')"
|
|
42
|
+
printf '%s/projects/%s\n' "$home" "$slug"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
normalize8() { # lifecycle's session-id.sh normalization: strip a leading agent-, take the first 8 chars
|
|
46
|
+
local id="${1#agent-}"
|
|
47
|
+
printf '%s' "${id:0:8}"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — a stamp's session8 selects a transcript by
|
|
51
|
+
# applying that same normalization to each candidate basename (never a raw agent- prefix match).
|
|
52
|
+
find_transcript() { # $1=session8 -> newest matching transcript path, empty if none
|
|
53
|
+
local want="$1" dir newest="" f base
|
|
54
|
+
dir="$(sessions_dir)"
|
|
55
|
+
[[ -d "$dir" ]] || return 0
|
|
56
|
+
shopt -s nullglob
|
|
57
|
+
for f in "$dir"/*.jsonl "$dir"/*/subagents/*.jsonl; do
|
|
58
|
+
base="${f##*/}"; base="${base%.jsonl}"
|
|
59
|
+
[[ "$(normalize8 "$base")" == "$want" ]] || continue
|
|
60
|
+
[[ -z "$newest" || "$f" -nt "$newest" ]] && newest="$f"
|
|
61
|
+
done
|
|
62
|
+
shopt -u nullglob
|
|
63
|
+
printf '%s' "$newest"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — sum the matched session's assistant-turn usage into four
|
|
67
|
+
# token categories per model id. Streaming records repeat a message id across lines (input/cache constant, output
|
|
68
|
+
# growing), so keep the last usage per message id, then aggregate by model — summing raw lines would multi-count.
|
|
69
|
+
usage_by_model() { # $1=transcript -> lines: model<TAB>in<TAB>out<TAB>cr<TAB>cw
|
|
70
|
+
command -v jq >/dev/null 2>&1 || return 3
|
|
71
|
+
jq -rc 'select(.type=="assistant" and (.message.usage != null))
|
|
72
|
+
| [ (.message.id // "?"), (.message.model // "?"),
|
|
73
|
+
(.message.usage.input_tokens // 0),
|
|
74
|
+
(.message.usage.output_tokens // 0),
|
|
75
|
+
(.message.usage.cache_read_input_tokens // 0),
|
|
76
|
+
(.message.usage.cache_creation_input_tokens // 0) ] | @tsv' "$1" \
|
|
77
|
+
| awk -F'\t' '
|
|
78
|
+
{ model[$1]=$2; in_[$1]=$3; out[$1]=$4; cr[$1]=$5; cw[$1]=$6 }
|
|
79
|
+
END {
|
|
80
|
+
for (i in model) { m=model[i]; IN[m]+=in_[i]; OUT[m]+=out[i]; CR[m]+=cr[i]; CW[m]+=cw[i]; seen[m]=1 }
|
|
81
|
+
for (m in seen) printf "%s\t%d\t%d\t%d\t%d\n", m, IN[m], OUT[m], CR[m], CW[m]
|
|
82
|
+
}'
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — the price table is consumer config (the provenance seam);
|
|
86
|
+
# absent or missing a model's row degrades that cell to n/a rather than failing.
|
|
87
|
+
declare -A PRICE_IN PRICE_OUT PRICE_CR PRICE_CW
|
|
88
|
+
PRICE_TABLE_PRESENT=0
|
|
89
|
+
if [[ -f "$DRIFT_KIT_PRICE_TABLE" ]]; then
|
|
90
|
+
PRICE_TABLE_PRESENT=1
|
|
91
|
+
while IFS=$'\t' read -r m pin pout pcr pcw _; do
|
|
92
|
+
[[ -z "$m" || "$m" == \#* || "$m" == "model" ]] && continue
|
|
93
|
+
PRICE_IN[$m]="$pin"; PRICE_OUT[$m]="$pout"; PRICE_CR[$m]="$pcr"; PRICE_CW[$m]="$pcw"
|
|
94
|
+
done < "$DRIFT_KIT_PRICE_TABLE"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
price_cell() { # $1=model $2=in $3=out $4=cr $5=cw -> USD cost, or "n/a"
|
|
98
|
+
local m="$1"
|
|
99
|
+
[[ -n "${PRICE_IN[$m]:-}" ]] || { printf 'n/a'; return 0; }
|
|
100
|
+
awk -v i="$2" -v o="$3" -v cr="$4" -v cw="$5" \
|
|
101
|
+
-v pi="${PRICE_IN[$m]}" -v po="${PRICE_OUT[$m]}" -v pcr="${PRICE_CR[$m]}" -v pcw="${PRICE_CW[$m]}" \
|
|
102
|
+
'BEGIN { printf "%.4f", i*pi + o*po + cr*pcr + cw*pcw }'
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — the apportionment key: integer split in
|
|
106
|
+
# proportion to the given counts, remainder to the first, so the parts re-sum to the whole exactly.
|
|
107
|
+
split_tokens() { # $1=total $2..=counts (caller's order) -> one integer per line
|
|
108
|
+
local total="$1"; shift
|
|
109
|
+
local n sum=0 acc=0 part
|
|
110
|
+
local -a parts=()
|
|
111
|
+
for n in "$@"; do sum=$((sum + n)); done
|
|
112
|
+
[[ "$sum" -gt 0 ]] || { printf '%s\n' "$total"; return 0; }
|
|
113
|
+
for n in "$@"; do
|
|
114
|
+
part=$((total * n / sum))
|
|
115
|
+
parts+=("$part")
|
|
116
|
+
acc=$((acc + part))
|
|
117
|
+
done
|
|
118
|
+
parts[0]=$(( parts[0] + total - acc ))
|
|
119
|
+
printf '%s\n' "${parts[@]}"
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — history ∪ live, the same reader
|
|
123
|
+
# bin/trajectory.sh already ships: the boundary truncation of the live file destroys no
|
|
124
|
+
# economics, and the live arm keeps a stamped-but-uncommitted stage visible.
|
|
125
|
+
collect_stamps() {
|
|
126
|
+
git log --reverse --format='%H' -p -U0 -- "$DRIFT_KIT_STATE_FILE" 2>/dev/null \
|
|
127
|
+
| sed -n -E 's/^\+([a-z0-9][a-z0-9-]* [a-z][a-z0-9-]* [A-Za-z0-9]+ [0-9]{4}-[0-9]{2}-[0-9]{2}.*)$/\1/p'
|
|
128
|
+
[[ -f "$DRIFT_KIT_STATE_FILE" ]] && cat "$DRIFT_KIT_STATE_FILE"
|
|
129
|
+
return 0
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[[ -f "$DRIFT_KIT_STATE_FILE" ]] || \
|
|
133
|
+
echo "stage-economics: no live state file ($DRIFT_KIT_STATE_FILE) — reading committed history alone" >&2
|
|
134
|
+
|
|
135
|
+
today="$(date +%F)"
|
|
136
|
+
mkdir -p "$(dirname "$DRIFT_KIT_STAGE_ECONOMICS_LOG")" 2>/dev/null || true
|
|
137
|
+
|
|
138
|
+
log_line() { # dedup on the <iteration> <stage> <model> triple, then append
|
|
139
|
+
local iter="$1" stage="$2" model="$3" line="$4" tmp
|
|
140
|
+
if [[ -f "$DRIFT_KIT_STAGE_ECONOMICS_LOG" ]]; then
|
|
141
|
+
tmp="$(mktemp "${TMPDIR:-/tmp}/stage-economics-log.XXXXXX")"
|
|
142
|
+
grep -Fv " $iter $stage $model in=" "$DRIFT_KIT_STAGE_ECONOMICS_LOG" > "$tmp" 2>/dev/null || true
|
|
143
|
+
mv "$tmp" "$DRIFT_KIT_STAGE_ECONOMICS_LOG"
|
|
144
|
+
fi
|
|
145
|
+
printf '%s\n' "$line" >> "$DRIFT_KIT_STAGE_ECONOMICS_LOG"
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
rows=0
|
|
149
|
+
incomplete=0
|
|
150
|
+
emit_row() { # $1=iteration $2=stage-or-role $3=who $4=model $5..$8=in out cr cw
|
|
151
|
+
local iter="$1" stage="$2" who="$3" model="$4" in="$5" out="$6" cr="$7" cw="$8" cost
|
|
152
|
+
cost="$(price_cell "$model" "$in" "$out" "$cr" "$cw")"
|
|
153
|
+
[[ "$cost" == "n/a" ]] && incomplete=1
|
|
154
|
+
printf ' %s %s %s [%s]: in=%s out=%s cr=%s cw=%s cost=%s\n' \
|
|
155
|
+
"$iter" "$stage" "$who" "$model" "$in" "$out" "$cr" "$cw" "$cost"
|
|
156
|
+
log_line "$iter" "$stage" "$model" \
|
|
157
|
+
"$today $iter $stage $model in=$in out=$out cr=$cr cw=$cw cost=$cost"
|
|
158
|
+
rows=$((rows + 1))
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
printf 'stage-economics: %s\n' "$today"
|
|
162
|
+
[[ "$PRICE_TABLE_PRESENT" -eq 1 ]] || printf ' no price table (%s) — token-only, cost=n/a (degraded, not failed)\n' "$DRIFT_KIT_PRICE_TABLE"
|
|
163
|
+
|
|
164
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — the attribution invariant: one transcript,
|
|
165
|
+
# one (iteration, stage). The stamp pass keys on the session, not the stamp, so a session bearing
|
|
166
|
+
# two stamps resolves to its last one and the yielded stamps take no row instead of a duplicate.
|
|
167
|
+
declare -A STAMP_SEEN=() SESS_CHOICE=() SESS_YIELDED=() ATTRIBUTED=() DISPATCH=() LEAD_SEEN=()
|
|
168
|
+
SESS_ORDER=()
|
|
169
|
+
LEAD_ORDER=()
|
|
170
|
+
label_collision=0
|
|
171
|
+
stamps=0
|
|
172
|
+
while read -r iter stage session8 _date _rest; do
|
|
173
|
+
[[ -z "$iter" || "$iter" == \#* || "$iter" == "---" ]] && continue
|
|
174
|
+
[[ -n "$stage" && -n "$session8" ]] || continue
|
|
175
|
+
[[ -n "${STAMP_SEEN["$iter/$stage/$session8"]:-}" ]] && continue
|
|
176
|
+
STAMP_SEEN["$iter/$stage/$session8"]=1
|
|
177
|
+
stamps=$((stamps + 1))
|
|
178
|
+
[[ "$stage" == "$DRIFT_KIT_SUPERVISION_LABEL" ]] && label_collision=1
|
|
179
|
+
if [[ -n "${SESS_CHOICE[$session8]:-}" ]]; then
|
|
180
|
+
SESS_YIELDED[$session8]="${SESS_YIELDED[$session8]:-}${SESS_CHOICE[$session8]}; "
|
|
181
|
+
else
|
|
182
|
+
SESS_ORDER+=("$session8")
|
|
183
|
+
fi
|
|
184
|
+
SESS_CHOICE[$session8]="$iter $stage"
|
|
185
|
+
done < <(collect_stamps)
|
|
186
|
+
|
|
187
|
+
if [[ "$stamps" -eq 0 ]]; then
|
|
188
|
+
echo "stage-economics: no stamps in either source (committed history or $DRIFT_KIT_STATE_FILE) — nothing to read" >&2
|
|
189
|
+
echo " help: set DRIFT_KIT_STATE_FILE to the WORKFLOW-STATE path carrying the stage stamps." >&2
|
|
190
|
+
exit 0
|
|
191
|
+
fi
|
|
192
|
+
|
|
193
|
+
degraded=0
|
|
194
|
+
unmatched=0
|
|
195
|
+
for session8 in ${SESS_ORDER[@]+"${SESS_ORDER[@]}"}; do
|
|
196
|
+
read -r iter stage <<< "${SESS_CHOICE[$session8]}"
|
|
197
|
+
transcript="$(find_transcript "$session8")"
|
|
198
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — unbounded history makes a
|
|
199
|
+
# per-stamp skip notice unbounded output, so unmatched stamps are counted, not listed.
|
|
200
|
+
if [[ -z "$transcript" ]]; then
|
|
201
|
+
unmatched=$((unmatched + 1))
|
|
202
|
+
continue
|
|
203
|
+
fi
|
|
204
|
+
ATTRIBUTED[$transcript]=1
|
|
205
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — a nested-tier transcript names its supervising lead in
|
|
206
|
+
# its own path, which is what makes the supervision row derivable with no stamp and no lifecycle change.
|
|
207
|
+
if [[ "$transcript" == */subagents/*.jsonl ]]; then
|
|
208
|
+
lead="${transcript%/subagents/*}"; lead="${lead##*/}"
|
|
209
|
+
DISPATCH["$lead $iter"]=$(( ${DISPATCH["$lead $iter"]:-0} + 1 ))
|
|
210
|
+
if [[ -z "${LEAD_SEEN[$lead]:-}" ]]; then
|
|
211
|
+
LEAD_SEEN[$lead]=1
|
|
212
|
+
LEAD_ORDER+=("$lead")
|
|
213
|
+
fi
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
usage="$(usage_by_model "$transcript")"; st=$?
|
|
217
|
+
if [[ "$st" -eq 3 ]]; then
|
|
218
|
+
echo " jq not found — cannot parse transcript usage (degraded, not failed)" >&2
|
|
219
|
+
degraded=1
|
|
220
|
+
break
|
|
221
|
+
fi
|
|
222
|
+
[[ -n "$usage" ]] || { printf ' %s %s %s: no assistant-turn usage found (skipped)\n' "$iter" "$stage" "$session8"; continue; }
|
|
223
|
+
|
|
224
|
+
while IFS=$'\t' read -r model in out cr cw; do
|
|
225
|
+
[[ -n "$model" ]] || continue
|
|
226
|
+
emit_row "$iter" "$stage" "$session8" "$model" "$in" "$out" "$cr" "$cw"
|
|
227
|
+
done <<< "$usage"
|
|
228
|
+
done
|
|
229
|
+
|
|
230
|
+
for session8 in ${SESS_ORDER[@]+"${SESS_ORDER[@]}"}; do
|
|
231
|
+
[[ -n "${SESS_YIELDED[$session8]:-}" ]] || continue
|
|
232
|
+
printf ' %s: one session, several stamps — attributed to "%s"; yielded (no row): %s\n' \
|
|
233
|
+
"$session8" "${SESS_CHOICE[$session8]}" "${SESS_YIELDED[$session8]%; }"
|
|
234
|
+
done
|
|
235
|
+
|
|
236
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — supervision is its own row, never an apportionment across
|
|
237
|
+
# stages: the lead's burn carries no stamp, and folding it into stage rows would need an allocation key
|
|
238
|
+
# grounded in nothing measured. A lead spanning iterations splits by dispatch count, the one key that is.
|
|
239
|
+
if [[ "$degraded" -eq 0 && ${#LEAD_ORDER[@]} -gt 0 ]]; then
|
|
240
|
+
if [[ "$label_collision" -eq 1 ]]; then
|
|
241
|
+
printf ' a stamp names the stage "%s", colliding with DRIFT_KIT_SUPERVISION_LABEL — no supervision row emitted this run\n' \
|
|
242
|
+
"$DRIFT_KIT_SUPERVISION_LABEL"
|
|
243
|
+
else
|
|
244
|
+
for lead in "${LEAD_ORDER[@]}"; do
|
|
245
|
+
lead_path="$(sessions_dir)/$lead.jsonl"
|
|
246
|
+
[[ -n "${ATTRIBUTED[$lead_path]:-}" ]] && continue # already a stage row: the invariant holds, no second claim
|
|
247
|
+
if [[ ! -f "$lead_path" ]]; then
|
|
248
|
+
unmatched=$((unmatched + 1))
|
|
249
|
+
continue
|
|
250
|
+
fi
|
|
251
|
+
split=()
|
|
252
|
+
while IFS= read -r dline; do split+=("$dline"); done < <(
|
|
253
|
+
for dkey in "${!DISPATCH[@]}"; do
|
|
254
|
+
[[ "$dkey" == "$lead "* ]] || continue
|
|
255
|
+
printf '%s\t%s\n' "${DISPATCH[$dkey]}" "${dkey#"$lead" }"
|
|
256
|
+
done | sort -k1,1nr -k2,2)
|
|
257
|
+
counts=(); iters=()
|
|
258
|
+
for dline in "${split[@]}"; do
|
|
259
|
+
counts+=("${dline%%$'\t'*}")
|
|
260
|
+
iters+=("${dline#*$'\t'}")
|
|
261
|
+
done
|
|
262
|
+
usage="$(usage_by_model "$lead_path")"; st=$?
|
|
263
|
+
if [[ "$st" -eq 3 ]]; then degraded=1; break; fi
|
|
264
|
+
[[ -n "$usage" ]] || continue
|
|
265
|
+
[[ "${#iters[@]}" -le 1 ]] || \
|
|
266
|
+
printf ' %s supervised %d iterations — apportioned by dispatch count (%s), remainder to %s\n' \
|
|
267
|
+
"$(normalize8 "$lead")" "${#iters[@]}" "${counts[*]}" "${iters[0]}"
|
|
268
|
+
while IFS=$'\t' read -r model in out cr cw; do
|
|
269
|
+
[[ -n "$model" ]] || continue
|
|
270
|
+
p_in=(); p_out=(); p_cr=(); p_cw=()
|
|
271
|
+
while IFS= read -r v; do p_in+=("$v"); done < <(split_tokens "$in" "${counts[@]}")
|
|
272
|
+
while IFS= read -r v; do p_out+=("$v"); done < <(split_tokens "$out" "${counts[@]}")
|
|
273
|
+
while IFS= read -r v; do p_cr+=("$v"); done < <(split_tokens "$cr" "${counts[@]}")
|
|
274
|
+
while IFS= read -r v; do p_cw+=("$v"); done < <(split_tokens "$cw" "${counts[@]}")
|
|
275
|
+
for i in "${!iters[@]}"; do
|
|
276
|
+
emit_row "${iters[$i]}" "$DRIFT_KIT_SUPERVISION_LABEL" "$(normalize8 "$lead")" \
|
|
277
|
+
"$model" "${p_in[$i]}" "${p_out[$i]}" "${p_cr[$i]}" "${p_cw[$i]}"
|
|
278
|
+
done
|
|
279
|
+
done <<< "$usage"
|
|
280
|
+
ATTRIBUTED[$lead_path]=1
|
|
281
|
+
done
|
|
282
|
+
fi
|
|
283
|
+
fi
|
|
284
|
+
|
|
285
|
+
# spec: drift-kit/SPEC.md §The stage-economics meter — the under-count bound: the unmatched counter reports stamps
|
|
286
|
+
# with no transcript and is structurally blind to the inverse, so the inverse is counted too. A bound,
|
|
287
|
+
# never an attribution — a transcript carries no iteration and no stage, so nothing could place it.
|
|
288
|
+
unstamped=0
|
|
289
|
+
if [[ "$degraded" -eq 0 ]]; then
|
|
290
|
+
_se_dir="$(sessions_dir)"
|
|
291
|
+
if [[ -d "$_se_dir" ]]; then
|
|
292
|
+
shopt -s nullglob
|
|
293
|
+
for f in "$_se_dir"/*.jsonl "$_se_dir"/*/subagents/*.jsonl; do
|
|
294
|
+
[[ -n "${ATTRIBUTED[$f]:-}" ]] && continue
|
|
295
|
+
unstamped=$((unstamped + 1))
|
|
296
|
+
done
|
|
297
|
+
shopt -u nullglob
|
|
298
|
+
fi
|
|
299
|
+
fi
|
|
300
|
+
|
|
301
|
+
[[ "$unmatched" -eq 0 ]] || \
|
|
302
|
+
printf ' %d stamp(s) had no matching transcript (skipped — session transcripts age out of the sessions dir)\n' "$unmatched"
|
|
303
|
+
[[ "$unstamped" -eq 0 ]] || \
|
|
304
|
+
printf ' %d transcript(s) in the sessions dir match no stamp and bill to no row — an upper bound on the unstamped-continuation under-count, not an attribution\n' "$unstamped"
|
|
305
|
+
|
|
306
|
+
if [[ "$incomplete" -eq 1 ]]; then
|
|
307
|
+
printf ' total pricing incomplete — one or more model cost cells degraded to n/a (unpriced model or absent table)\n'
|
|
308
|
+
fi
|
|
309
|
+
printf ' (cr=cache-read is the headline burn lever; one transcript bills to exactly one (iteration, stage) — a session bearing several stamps is attributed to its last and the yielded stamps are named above, never billed twice)\n'
|
|
310
|
+
printf ' logged: %s (%d row(s))\n' "$DRIFT_KIT_STAGE_ECONOMICS_LOG" "$rows"
|
|
311
|
+
exit 0
|