@intentius/chant 0.124.26 → 0.124.28
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 +1 -1
- package/dist/__golden__/wave-loop/fan-out-gated.json +8 -0
- package/dist/__golden__/wave-loop/fan-out-no-members.json +4 -0
- package/dist/__golden__/wave-loop/fan-out-only.json +6 -0
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +2 -0
- package/dist/__golden__/wave-loop/op-cost-member.json +3 -0
- package/dist/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
- package/dist/__golden__/wave-loop/op-held-on.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-held.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
- package/dist/__golden__/wave-loop/op-hooks-share.json +3 -0
- package/dist/__golden__/wave-loop/op-per-run.json +7 -0
- package/dist/__golden__/wave-loop/op-pr-review.json +7 -0
- package/dist/__golden__/wave-loop/op-sealed.json +3 -0
- package/dist/__golden__/wave-loop/op-spend.json +3 -0
- package/dist/__golden__/wave-loop/op-wave-commands.json +7 -0
- package/dist/__golden__/wave-loop/op-wide-waiting.json +4 -0
- package/dist/change-set-graph.d.ts +56 -0
- package/dist/change-set-graph.d.ts.map +1 -0
- package/dist/change-set-graph.js +128 -0
- package/dist/change-set.d.ts +52 -3
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +35 -4
- package/dist/chant-version.d.ts +9 -0
- package/dist/chant-version.d.ts.map +1 -0
- package/dist/chant-version.js +16 -0
- package/dist/cli/commands/build.d.ts +8 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +9 -8
- package/dist/cli/commands/check-lexicon-docs.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-docs.js +30 -2
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.js +13 -2
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts +4 -1
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/docs.js +6 -6
- package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon.js +17 -8
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +19 -4
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +28 -0
- package/dist/cli/handlers/change-set.d.ts +10 -0
- package/dist/cli/handlers/change-set.d.ts.map +1 -1
- package/dist/cli/handlers/change-set.js +51 -1
- package/dist/cli/handlers/fan-out.d.ts +1 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +14 -3
- package/dist/cli/handlers/pr.d.ts +8 -2
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +148 -24
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +256 -21
- package/dist/cli/handlers/release.d.ts +34 -0
- package/dist/cli/handlers/release.d.ts.map +1 -0
- package/dist/cli/handlers/release.js +203 -0
- package/dist/cli/handlers/run.d.ts +28 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +170 -13
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +88 -13
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +49 -3
- package/dist/cli/registry.d.ts +29 -3
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/run-events.d.ts +29 -0
- package/dist/cli/run-events.d.ts.map +1 -0
- package/dist/cli/run-events.js +47 -0
- package/dist/cli/version.d.ts +3 -5
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +3 -13
- package/dist/codegen/docs-in-site.d.ts +71 -0
- package/dist/codegen/docs-in-site.d.ts.map +1 -0
- package/dist/codegen/docs-in-site.js +177 -0
- package/dist/codegen/docs-types.d.ts +14 -1
- package/dist/codegen/docs-types.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts +18 -1
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/docs.js +40 -7
- package/dist/codegen/rehype-base-url.mjs +15 -9
- package/dist/components/auto-release.d.ts +4 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +2 -0
- package/dist/components/cli-support.d.ts +6 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +10 -9
- package/dist/components/driver.d.ts +42 -9
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +81 -54
- package/dist/components/fan-out-run.d.ts +7 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +35 -26
- package/dist/components/pr-run.d.ts +11 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +20 -1
- package/dist/components/promote-order.d.ts +38 -0
- package/dist/components/promote-order.d.ts.map +1 -0
- package/dist/components/promote-order.js +62 -0
- package/dist/components/promote.d.ts +15 -2
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +17 -0
- package/dist/components/release-compile.d.ts +133 -0
- package/dist/components/release-compile.d.ts.map +1 -0
- package/dist/components/release-compile.js +376 -0
- package/dist/components/release-gate.d.ts +125 -0
- package/dist/components/release-gate.d.ts.map +1 -0
- package/dist/components/release-gate.js +282 -0
- package/dist/components/release-promote.d.ts +96 -0
- package/dist/components/release-promote.d.ts.map +1 -0
- package/dist/components/release-promote.js +204 -0
- package/dist/components/run-progress.d.ts +7 -0
- package/dist/components/run-progress.d.ts.map +1 -1
- package/dist/components/wave-plan.d.ts +3 -1
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lifecycle/change-set-store.d.ts +67 -0
- package/dist/lifecycle/change-set-store.d.ts.map +1 -0
- package/dist/lifecycle/change-set-store.js +96 -0
- package/dist/lifecycle/commit-sha.d.ts +13 -0
- package/dist/lifecycle/commit-sha.d.ts.map +1 -0
- package/dist/lifecycle/commit-sha.js +21 -0
- package/dist/lifecycle/gate-change-set.d.ts +69 -0
- package/dist/lifecycle/gate-change-set.d.ts.map +1 -0
- package/dist/lifecycle/gate-change-set.js +106 -0
- package/dist/lifecycle/gate-ledger.d.ts +49 -1
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +18 -0
- package/dist/lifecycle/release-cut.d.ts +107 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -0
- package/dist/lifecycle/release-cut.js +273 -0
- package/dist/lifecycle/release-ledger.d.ts +54 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +53 -20
- package/dist/lifecycle/release-store.d.ts +190 -0
- package/dist/lifecycle/release-store.d.ts.map +1 -0
- package/dist/lifecycle/release-store.js +318 -0
- package/dist/lifecycle/run-ledger.d.ts +4 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +2 -0
- package/dist/op/activities/change-coverage.d.ts.map +1 -1
- package/dist/op/activities/change-coverage.js +4 -2
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +7 -3
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +7 -3
- package/dist/op/activity-registry.d.ts +6 -3
- package/dist/op/activity-registry.d.ts.map +1 -1
- package/dist/op/activity-registry.js +7 -5
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/discover.js +14 -7
- package/dist/op/gate-name.d.ts +11 -2
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-name.js +12 -3
- package/dist/op/gate-run-locator.d.ts +22 -0
- package/dist/op/gate-run-locator.d.ts.map +1 -1
- package/dist/op/gate-run-locator.js +31 -0
- package/dist/op/gate.d.ts +27 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +57 -3
- package/dist/op/local-executor.d.ts +36 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +158 -52
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +4 -0
- package/dist/op/run-live.d.ts +2 -0
- package/dist/op/run-live.d.ts.map +1 -1
- package/dist/op/run-live.js +1 -1
- package/dist/op/runtime.d.ts +46 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/runtimes/local.js +12 -2
- package/dist/point-decision.d.ts +2 -0
- package/dist/point-decision.d.ts.map +1 -1
- package/dist/point-decision.js +9 -2
- package/dist/run-event-store.d.ts +77 -0
- package/dist/run-event-store.d.ts.map +1 -0
- package/dist/run-event-store.js +204 -0
- package/dist/run-event-stream.d.ts +132 -0
- package/dist/run-event-stream.d.ts.map +1 -0
- package/dist/run-event-stream.js +238 -0
- package/dist/run-event.d.ts +267 -0
- package/dist/run-event.d.ts.map +1 -0
- package/dist/run-event.js +207 -0
- package/dist/wave-runtime.mjs +225 -242
- package/dist/workspace/__fixtures__/run-event-check.d.ts +19 -0
- package/dist/workspace/__fixtures__/run-event-check.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/run-event-check.js +59 -0
- package/dist/workspace/change-set-show.d.ts +56 -0
- package/dist/workspace/change-set-show.d.ts.map +1 -0
- package/dist/workspace/change-set-show.js +54 -0
- package/dist/workspace/change-set-show.schema.json +102 -0
- package/dist/workspace/change-set.schema.json +28 -1
- package/dist/workspace/changes-cli.d.ts.map +1 -1
- package/dist/workspace/changes-cli.js +10 -1
- package/dist/workspace/changes.d.ts +37 -0
- package/dist/workspace/changes.d.ts.map +1 -1
- package/dist/workspace/changes.js +49 -2
- package/dist/workspace/changes.schema.json +135 -0
- package/dist/workspace/ci-green-cli.d.ts +19 -4
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +75 -12
- package/dist/workspace/ci-green-forge.d.ts +20 -3
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green-forge.js +6 -4
- package/dist/workspace/ci-green-workflow.d.ts +11 -0
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +6 -0
- package/dist/workspace/ci-green.d.ts +273 -13
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +449 -38
- package/dist/workspace/ci-last-green.schema.json +32 -2
- package/dist/workspace/ci-list.schema.json +525 -0
- package/dist/workspace/commit-links.d.ts +85 -0
- package/dist/workspace/commit-links.d.ts.map +1 -0
- package/dist/workspace/commit-links.js +163 -0
- package/dist/workspace/declaration.d.ts +19 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +1 -1
- package/dist/workspace/declaration.schema.json +12 -0
- package/dist/workspace/identity-gate-rule.d.ts +37 -0
- package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
- package/dist/workspace/identity-gate-rule.js +72 -7
- package/dist/workspace/identity.d.ts +12 -0
- package/dist/workspace/identity.d.ts.map +1 -1
- package/dist/workspace/identity.js +13 -1
- package/dist/workspace/intent.d.ts +6 -1
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +51 -1
- package/dist/workspace/ls.d.ts +4 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +2 -0
- package/dist/workspace/ls.schema.json +3 -1
- package/dist/workspace/member-pipeline.d.ts +6 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -1
- package/dist/workspace/member-pipeline.js +6 -0
- package/dist/workspace/promotion-order.d.ts +41 -0
- package/dist/workspace/promotion-order.d.ts.map +1 -0
- package/dist/workspace/promotion-order.js +95 -0
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +4 -1
- package/dist/workspace/releases.d.ts +72 -0
- package/dist/workspace/releases.d.ts.map +1 -0
- package/dist/workspace/releases.js +94 -0
- package/dist/workspace/releases.schema.json +391 -0
- package/dist/workspace/run-event.schema.json +288 -0
- package/dist/workspace/status-gates.d.ts +26 -1
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status-gates.js +31 -2
- package/dist/workspace/status-stewards.d.ts +4 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -1
- package/dist/workspace/status-stewards.js +2 -0
- package/dist/workspace/status.d.ts +39 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +48 -1
- package/dist/workspace/status.schema.json +70 -1
- package/dist/workspace/trust/ci-tag-statement.d.ts +102 -0
- package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -0
- package/dist/workspace/trust/ci-tag-statement.js +123 -0
- package/dist/workspace/trust/op-run-statement.d.ts +91 -0
- package/dist/workspace/trust/op-run-statement.d.ts.map +1 -0
- package/dist/workspace/trust/op-run-statement.js +143 -0
- package/dist/workspace/trust/rotation.d.ts +18 -2
- package/dist/workspace/trust/rotation.d.ts.map +1 -1
- package/dist/workspace/trust/rotation.js +65 -16
- package/dist/workspace/trust/seal.d.ts +11 -0
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/seal.js +9 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
- package/dist/workspace/trust/ssh-commit.js +10 -10
- package/package.json +1 -1
- package/src/__golden__/wave-loop/fan-out-gated.json +8 -0
- package/src/__golden__/wave-loop/fan-out-no-members.json +4 -0
- package/src/__golden__/wave-loop/fan-out-only.json +6 -0
- package/src/__golden__/wave-loop/op-by-apply-hold.json +2 -0
- package/src/__golden__/wave-loop/op-cost-member.json +3 -0
- package/src/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
- package/src/__golden__/wave-loop/op-held-on.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-held.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
- package/src/__golden__/wave-loop/op-hooks-share.json +3 -0
- package/src/__golden__/wave-loop/op-per-run.json +7 -0
- package/src/__golden__/wave-loop/op-pr-review.json +7 -0
- package/src/__golden__/wave-loop/op-sealed.json +3 -0
- package/src/__golden__/wave-loop/op-spend.json +3 -0
- package/src/__golden__/wave-loop/op-wave-commands.json +7 -0
- package/src/__golden__/wave-loop/op-wide-waiting.json +4 -0
- package/src/change-set-graph.test.ts +72 -0
- package/src/change-set-graph.ts +133 -0
- package/src/change-set.ts +76 -6
- package/src/chant-version.ts +16 -0
- package/src/cli/commands/build.ts +19 -8
- package/src/cli/commands/check-lexicon-docs.test.ts +51 -0
- package/src/cli/commands/check-lexicon-docs.ts +39 -2
- package/src/cli/commands/check-lexicon.ts +14 -2
- package/src/cli/commands/init-lexicon/templates/docs.ts +7 -6
- package/src/cli/commands/init-lexicon.test.ts +25 -0
- package/src/cli/commands/init-lexicon.ts +18 -8
- package/src/cli/compiled-cli.e2e.test.ts +31 -6
- package/src/cli/handlers/approve-release.test.ts +80 -0
- package/src/cli/handlers/approve.ts +18 -2
- package/src/cli/handlers/build.test.ts +52 -0
- package/src/cli/handlers/build.ts +29 -0
- package/src/cli/handlers/change-set.ts +49 -1
- package/src/cli/handlers/fan-out.test.ts +48 -0
- package/src/cli/handlers/fan-out.ts +15 -3
- package/src/cli/handlers/operator.test.ts +37 -0
- package/src/cli/handlers/pr.test.ts +194 -0
- package/src/cli/handlers/pr.ts +168 -34
- package/src/cli/handlers/promote.test.ts +389 -5
- package/src/cli/handlers/promote.ts +279 -20
- package/src/cli/handlers/release-implicit.e2e.test.ts +153 -0
- package/src/cli/handlers/release.e2e.test.ts +85 -0
- package/src/cli/handlers/release.ts +206 -0
- package/src/cli/handlers/run-auto-release.test.ts +71 -0
- package/src/cli/handlers/run-events-cmd.test.ts +92 -0
- package/src/cli/handlers/run.test.ts +30 -0
- package/src/cli/handlers/run.ts +176 -15
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +88 -13
- package/src/cli/mcp/never-over-mcp.test.ts +2 -0
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/parse-args.ts +37 -3
- package/src/cli/registry.ts +29 -3
- package/src/cli/run-events.ts +54 -0
- package/src/cli/version.ts +3 -13
- package/src/codegen/docs-in-site.test.ts +166 -0
- package/src/codegen/docs-in-site.ts +182 -0
- package/src/codegen/docs-site/AgentPrompt.astro +26 -1
- package/src/codegen/docs-types.ts +14 -1
- package/src/codegen/docs.ts +60 -7
- package/src/codegen/rehype-base-url.d.mts +3 -1
- package/src/codegen/rehype-base-url.mjs +15 -9
- package/src/codegen/rehype-base-url.test.ts +34 -0
- package/src/components/auto-release.test.ts +21 -0
- package/src/components/auto-release.ts +6 -1
- package/src/components/cli-support.test.ts +82 -0
- package/src/components/cli-support.ts +16 -9
- package/src/components/driver.ts +129 -56
- package/src/components/fan-out-run.ts +56 -35
- package/src/components/pr-run.ts +30 -1
- package/src/components/promote-order.test.ts +90 -0
- package/src/components/promote-order.ts +75 -0
- package/src/components/promote.test.ts +10 -1
- package/src/components/promote.ts +26 -1
- package/src/components/release-compile.test.ts +147 -0
- package/src/components/release-compile.ts +445 -0
- package/src/components/release-gate.test.ts +215 -0
- package/src/components/release-gate.ts +341 -0
- package/src/components/release-promote.test.ts +159 -0
- package/src/components/release-promote.ts +232 -0
- package/src/components/run-progress.ts +7 -0
- package/src/components/wave-plan.ts +1 -1
- package/src/config.ts +7 -1
- package/src/index.ts +2 -0
- package/src/lifecycle/change-set-store.test.ts +217 -0
- package/src/lifecycle/change-set-store.ts +112 -0
- package/src/lifecycle/commit-sha.ts +23 -0
- package/src/lifecycle/gate-change-set.e2e.test.ts +122 -0
- package/src/lifecycle/gate-change-set.ts +133 -0
- package/src/lifecycle/gate-ledger.test.ts +33 -0
- package/src/lifecycle/gate-ledger.ts +66 -1
- package/src/lifecycle/release-cut-signed.test.ts +180 -0
- package/src/lifecycle/release-cut.test.ts +411 -0
- package/src/lifecycle/release-cut.ts +367 -0
- package/src/lifecycle/release-ledger.test.ts +14 -0
- package/src/lifecycle/release-ledger.ts +85 -17
- package/src/lifecycle/release-store.ts +423 -0
- package/src/lifecycle/run-ledger.test.ts +10 -0
- package/src/lifecycle/run-ledger.ts +6 -0
- package/src/op/activities/change-coverage.ts +4 -1
- package/src/op/activities/source-release.ts +8 -3
- package/src/op/activities/source-rollback.ts +8 -4
- package/src/op/activity-registry.ts +7 -5
- package/src/op/commit-run-gate-deploy-join.test.ts +117 -0
- package/src/op/discover-root.test.ts +39 -0
- package/src/op/discover.ts +15 -8
- package/src/op/gate-name.ts +13 -3
- package/src/op/gate-release.test.ts +126 -0
- package/src/op/gate-run-locator.test.ts +110 -0
- package/src/op/gate-run-locator.ts +35 -0
- package/src/op/gate.ts +88 -6
- package/src/op/local-executor.ts +207 -52
- package/src/op/op-waves-run.ts +4 -0
- package/src/op/run-events.test.ts +166 -0
- package/src/op/run-live.ts +1 -1
- package/src/op/runtime.ts +39 -0
- package/src/op/runtimes/local.test.ts +16 -0
- package/src/op/runtimes/local.ts +13 -2
- package/src/point-decision.ts +12 -2
- package/src/run-event-store.test.ts +144 -0
- package/src/run-event-store.ts +213 -0
- package/src/run-event-stream.test.ts +175 -0
- package/src/run-event-stream.ts +306 -0
- package/src/run-event.test.ts +277 -0
- package/src/run-event.ts +451 -0
- package/src/wave-loop-golden.test.ts +9 -0
- package/src/workspace/__fixtures__/run-event-check.ts +58 -0
- package/src/workspace/ancestry-index.test.ts +93 -0
- package/src/workspace/change-set-show.schema.json +102 -0
- package/src/workspace/change-set-show.ts +72 -0
- package/src/workspace/change-set.schema.json +28 -1
- package/src/workspace/changes-cli.ts +10 -1
- package/src/workspace/changes.schema.json +135 -0
- package/src/workspace/changes.test.ts +1 -1
- package/src/workspace/changes.ts +84 -2
- package/src/workspace/ci-green-cli.ts +75 -13
- package/src/workspace/ci-green-forge.ts +24 -4
- package/src/workspace/ci-green-runs.test.ts +242 -0
- package/src/workspace/ci-green-signed.test.ts +302 -0
- package/src/workspace/ci-green-workflow.test.ts +16 -0
- package/src/workspace/ci-green-workflow.ts +12 -0
- package/src/workspace/ci-green.test.ts +131 -2
- package/src/workspace/ci-green.ts +624 -42
- package/src/workspace/ci-last-green.schema.json +32 -2
- package/src/workspace/ci-list.schema.json +525 -0
- package/src/workspace/commit-links.test.ts +279 -0
- package/src/workspace/commit-links.ts +183 -0
- package/src/workspace/declaration.schema.json +12 -0
- package/src/workspace/declaration.ts +22 -2
- package/src/workspace/identity-gate-rule.ts +91 -7
- package/src/workspace/identity.ts +14 -1
- package/src/workspace/intent.ts +48 -1
- package/src/workspace/ls.schema.json +3 -1
- package/src/workspace/ls.ts +6 -0
- package/src/workspace/member-pipeline.test.ts +17 -0
- package/src/workspace/member-pipeline.ts +9 -0
- package/src/workspace/promotion-order.ts +97 -0
- package/src/workspace/read-contract.e2e.test.ts +4 -1
- package/src/workspace/reason-codes.test.ts +2 -1
- package/src/workspace/reason-codes.ts +4 -1
- package/src/workspace/releases.schema.json +391 -0
- package/src/workspace/releases.test.ts +108 -0
- package/src/workspace/releases.ts +122 -0
- package/src/workspace/run-event.schema.json +288 -0
- package/src/workspace/status-contract.test.ts +52 -1
- package/src/workspace/status-gates.ts +56 -1
- package/src/workspace/status-stewards.ts +6 -0
- package/src/workspace/status.schema.json +70 -1
- package/src/workspace/status.ts +80 -1
- package/src/workspace/trust/ci-tag-statement.ts +151 -0
- package/src/workspace/trust/op-run-statement.ts +148 -0
- package/src/workspace/trust/rotation.ts +61 -14
- package/src/workspace/trust/seal.ts +10 -0
- package/src/workspace/trust/ssh-commit.ts +10 -9
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/astro.config.mjs +0 -14
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/package.json +0 -16
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content/docs/index.mdx +0 -8
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +0 -15
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/tsconfig.json +0 -10
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The emitters' side of the run-event contract (#4041): what a runtime or a
|
|
3
|
+
* command needs to print a run's stream through the one writer in
|
|
4
|
+
* `./run-event.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Every emitter hands bodies to a {@link RunEventSink}. The CLI opens a
|
|
7
|
+
* {@link RunEventStream} over a run's identity, which stamps each body
|
|
8
|
+
* through `createRunEventWriter` and makes sure the stream opens with
|
|
9
|
+
* `run-start` and ends with one `run-settle`, even when the run threw before
|
|
10
|
+
* it said so itself. The components driver emits bodies only, and
|
|
11
|
+
* {@link progressOfRunEvent} turns them back into the older
|
|
12
|
+
* `RunProgressEvent` lines that `--progress-json` still prints.
|
|
13
|
+
*
|
|
14
|
+
* Kept apart from `./run-event.ts`, which a level-0 import loads: this
|
|
15
|
+
* module reads git and the CI environment.
|
|
16
|
+
*/
|
|
17
|
+
import { resolveCommitSha } from "./lifecycle/commit-sha.js";
|
|
18
|
+
import { resolveCiRun } from "./lifecycle/release-ledger.js";
|
|
19
|
+
import { createRunEventWriter, } from "./run-event.js";
|
|
20
|
+
/** One sink that hands each body to every sink given, or undefined when none is. */
|
|
21
|
+
export function joinRunEventSinks(...sinks) {
|
|
22
|
+
const live = sinks.filter((s) => s !== undefined);
|
|
23
|
+
if (live.length === 0)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (live.length === 1)
|
|
26
|
+
return live[0];
|
|
27
|
+
return (body) => {
|
|
28
|
+
for (const sink of live)
|
|
29
|
+
sink(body);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const GATE_PREFIX = "gate:";
|
|
33
|
+
/**
|
|
34
|
+
* A run-event body as the older `RunProgressEvent`, or undefined when that
|
|
35
|
+
* stream had no such event. It never printed a gate step, a skipped step,
|
|
36
|
+
* a phase outside a component or a gate's decision, so those map to nothing
|
|
37
|
+
* and `--progress-json` prints what it printed before #4041.
|
|
38
|
+
*/
|
|
39
|
+
export function progressOfRunEvent(body) {
|
|
40
|
+
const progressStatus = (s) => (s === "waiting" ? "gated" : s);
|
|
41
|
+
switch (body.type) {
|
|
42
|
+
case "run-start":
|
|
43
|
+
return { type: "run-start", waves: body.waves ?? [] };
|
|
44
|
+
case "wave-start":
|
|
45
|
+
return { type: "wave-start", wave: body.wave, components: body.components };
|
|
46
|
+
case "component-start":
|
|
47
|
+
return { type: "component-start", wave: body.wave, component: body.component };
|
|
48
|
+
case "phase-start":
|
|
49
|
+
return body.component === null ? undefined : { type: "phase-start", component: body.component, phase: body.phase };
|
|
50
|
+
case "step-start":
|
|
51
|
+
if (body.component === null || body.step.startsWith(GATE_PREFIX))
|
|
52
|
+
return undefined;
|
|
53
|
+
return { type: "step", component: body.component, phase: body.phase, step: body.step, status: "running" };
|
|
54
|
+
case "step-settle":
|
|
55
|
+
if (body.component === null || body.step.startsWith(GATE_PREFIX))
|
|
56
|
+
return undefined;
|
|
57
|
+
if (body.status !== "ok" && body.status !== "failed")
|
|
58
|
+
return undefined;
|
|
59
|
+
return {
|
|
60
|
+
type: "step",
|
|
61
|
+
component: body.component,
|
|
62
|
+
phase: body.phase,
|
|
63
|
+
step: body.step,
|
|
64
|
+
status: body.status,
|
|
65
|
+
...(body.error !== undefined ? { error: body.error } : {}),
|
|
66
|
+
};
|
|
67
|
+
case "phase-settle":
|
|
68
|
+
return body.component === null
|
|
69
|
+
? undefined
|
|
70
|
+
: { type: "phase-done", component: body.component, phase: body.phase, status: progressStatus(body.status) };
|
|
71
|
+
case "component-settle":
|
|
72
|
+
return { type: "component-done", wave: body.wave, component: body.component, status: progressStatus(body.status) };
|
|
73
|
+
case "wave-settle":
|
|
74
|
+
return { type: "wave-done", wave: body.wave, status: progressStatus(body.status) };
|
|
75
|
+
case "run-settle":
|
|
76
|
+
return { type: "run-done", status: progressStatus(body.status) };
|
|
77
|
+
case "gate-waiting":
|
|
78
|
+
case "gate-resolved":
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** A `RunProgressEvent` callback as a sink of run-event bodies, through {@link progressOfRunEvent}. */
|
|
83
|
+
export function progressSinkOf(onProgress) {
|
|
84
|
+
if (!onProgress)
|
|
85
|
+
return undefined;
|
|
86
|
+
return (body) => {
|
|
87
|
+
const event = progressOfRunEvent(body);
|
|
88
|
+
if (event)
|
|
89
|
+
onProgress(event);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A run's identity from what the emitter already knows. The runtime is `ci`
|
|
94
|
+
* inside a CI job, `steward` in a steward's turn and `local` otherwise; the
|
|
95
|
+
* origin is the CI run's, `op` for a steward's run, and `local` otherwise. An
|
|
96
|
+
* Op run keeps its own run id in CI, as its run record does (#4020).
|
|
97
|
+
*/
|
|
98
|
+
export function runEventRunOf(input) {
|
|
99
|
+
return {
|
|
100
|
+
runId: input.runId,
|
|
101
|
+
kind: input.kind,
|
|
102
|
+
name: input.name,
|
|
103
|
+
gitSha: input.gitSha ?? null,
|
|
104
|
+
runtime: input.runtime ?? (input.ci ? "ci" : input.steward ? "steward" : "local"),
|
|
105
|
+
runOrigin: input.runOrigin ?? input.ci?.runOrigin ?? (input.steward ? { forge: "op" } : { forge: "local" }),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A run's identity, resolved: the commit from `resolveCommitSha` and the CI
|
|
110
|
+
* run from `resolveCiRun` (#4020). Without `runId`, a CI run is named by its
|
|
111
|
+
* CI run id and any other by a locally minted `local-<ms>` id, the spelling
|
|
112
|
+
* `resolveRunId` uses for a release record.
|
|
113
|
+
*/
|
|
114
|
+
export async function resolveRunEventRun(input) {
|
|
115
|
+
const env = input.env ?? process.env;
|
|
116
|
+
const ci = resolveCiRun(env);
|
|
117
|
+
const gitSha = await resolveCommitSha({ ...(input.cwd ? { cwd: input.cwd } : {}), env });
|
|
118
|
+
const runId = input.runId ?? ci?.runId ?? `local-${Date.now()}`;
|
|
119
|
+
// An explicit id that is not the CI run's is one the caller minted, so the
|
|
120
|
+
// origin says local, as `resolveRunId` records it on a release.
|
|
121
|
+
const inCiSpace = ci !== undefined && runId === ci.runId;
|
|
122
|
+
return runEventRunOf({
|
|
123
|
+
kind: input.kind,
|
|
124
|
+
name: input.name,
|
|
125
|
+
runId,
|
|
126
|
+
...(gitSha ? { gitSha } : {}),
|
|
127
|
+
...(ci ? { ci } : {}),
|
|
128
|
+
...(ci && !inCiSpace ? { runOrigin: { forge: "local" } } : {}),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Open a run's stream over `write`. The first event is always `run-start`
|
|
133
|
+
* (one with `waves: null` is written first when the emitter starts with
|
|
134
|
+
* something else), a second `run-start` is dropped, `run-settle` gets the
|
|
135
|
+
* time since `run-start` when the emitter did not time it, and nothing is
|
|
136
|
+
* written after `run-settle`.
|
|
137
|
+
*/
|
|
138
|
+
export function openRunEventStream(run, write, opts = {}) {
|
|
139
|
+
const now = opts.now ?? (() => new Date());
|
|
140
|
+
const writer = createRunEventWriter({ run, write, now, ...(opts.chant ? { chant: opts.chant } : {}) });
|
|
141
|
+
let startedAt;
|
|
142
|
+
let settled = false;
|
|
143
|
+
const emit = (body) => {
|
|
144
|
+
if (settled)
|
|
145
|
+
return;
|
|
146
|
+
if (body.type === "run-start") {
|
|
147
|
+
if (startedAt !== undefined)
|
|
148
|
+
return;
|
|
149
|
+
startedAt = now().getTime();
|
|
150
|
+
writer.emit(body);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (startedAt === undefined)
|
|
154
|
+
emit({ type: "run-start", waves: null });
|
|
155
|
+
if (body.type === "run-settle") {
|
|
156
|
+
settled = true;
|
|
157
|
+
writer.emit(body.durationMs === null ? { ...body, durationMs: Math.max(0, now().getTime() - startedAt) } : body);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
writer.emit(body);
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
run,
|
|
164
|
+
emit,
|
|
165
|
+
nested: (body) => {
|
|
166
|
+
if (body.type !== "run-start" && body.type !== "run-settle")
|
|
167
|
+
emit(body);
|
|
168
|
+
},
|
|
169
|
+
settle(status, error) {
|
|
170
|
+
if (settled)
|
|
171
|
+
return;
|
|
172
|
+
emit({ type: "run-settle", status, durationMs: null, ...(error !== undefined ? { error } : {}) });
|
|
173
|
+
},
|
|
174
|
+
get settled() {
|
|
175
|
+
return settled;
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* A decided gate as events: `gate-resolved` and an `ok` settle when an
|
|
181
|
+
* approval stands, `gate-waiting` and a `gated` settle when none does.
|
|
182
|
+
* `message` says why it did not pass, for a person.
|
|
183
|
+
*/
|
|
184
|
+
export function gateEventsOf(check, at, opts) {
|
|
185
|
+
const where = { component: at.component, phase: at.phase, step: at.step, ...(at.index !== undefined ? { index: at.index } : {}) };
|
|
186
|
+
const message = opts.message !== undefined ? { message: opts.message } : {};
|
|
187
|
+
if (check.satisfied) {
|
|
188
|
+
return [
|
|
189
|
+
{
|
|
190
|
+
type: "gate-resolved",
|
|
191
|
+
...where,
|
|
192
|
+
op: at.op,
|
|
193
|
+
gate: at.gate,
|
|
194
|
+
resolvedBy: check.resolution.resolvedBy,
|
|
195
|
+
resolvedAt: check.resolution.timestamp,
|
|
196
|
+
via: check.via ?? null,
|
|
197
|
+
...(check.resolution.url ? { url: check.resolution.url } : {}),
|
|
198
|
+
},
|
|
199
|
+
{ type: "step-settle", ...where, status: "ok", durationMs: opts.durationMs },
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
return [
|
|
203
|
+
{ type: "gate-waiting", ...where, op: check.pending.op, gate: at.gate, point: null, ...message },
|
|
204
|
+
{ type: "step-settle", ...where, status: "gated", durationMs: opts.durationMs, ...message },
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
/** The phase a gate outside any component is the one step of: a fan-out's, a wave's or a pull request's. */
|
|
208
|
+
export const GATE_PHASE = "gate";
|
|
209
|
+
/**
|
|
210
|
+
* Decide a gate that stands outside any component, and emit it as the one
|
|
211
|
+
* step of a {@link GATE_PHASE} phase: `phase-start`, `step-start`, the
|
|
212
|
+
* decision through {@link gateEventsOf}, the settle and `phase-settle`. A
|
|
213
|
+
* decision that throws settles the step `failed` and is rethrown. `message`
|
|
214
|
+
* says, for a person, why a gate that did not pass did not.
|
|
215
|
+
*/
|
|
216
|
+
export async function emitGateStep(emit, at, decide, message) {
|
|
217
|
+
const where = { component: null, phase: GATE_PHASE, step: `gate:${at.gate}` };
|
|
218
|
+
emit?.({ type: "phase-start", component: null, phase: GATE_PHASE });
|
|
219
|
+
emit?.({ type: "step-start", ...where });
|
|
220
|
+
const start = Date.now();
|
|
221
|
+
let check;
|
|
222
|
+
try {
|
|
223
|
+
check = await decide();
|
|
224
|
+
}
|
|
225
|
+
catch (err) {
|
|
226
|
+
emit?.({ type: "step-settle", ...where, status: "failed", durationMs: Date.now() - start, error: err instanceof Error ? err.message : String(err) });
|
|
227
|
+
emit?.({ type: "phase-settle", component: null, phase: GATE_PHASE, status: "failed" });
|
|
228
|
+
throw err;
|
|
229
|
+
}
|
|
230
|
+
const why = check.satisfied
|
|
231
|
+
? undefined
|
|
232
|
+
: (message?.(check) ?? (check.mismatch ? "an approval stands for this gate, but for another plan" : undefined));
|
|
233
|
+
for (const body of gateEventsOf(check, { ...where, op: at.op, gate: at.gate }, { durationMs: Date.now() - start, ...(why !== undefined ? { message: why } : {}) })) {
|
|
234
|
+
emit?.(body);
|
|
235
|
+
}
|
|
236
|
+
emit?.({ type: "phase-settle", component: null, phase: GATE_PHASE, status: check.satisfied ? "ok" : "gated" });
|
|
237
|
+
return check;
|
|
238
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run-event contract (#4019, behold #678): one stream of events for Op
|
|
3
|
+
* runs, component runs and pipeline runs, so anything that shows a run reads
|
|
4
|
+
* the same fields wherever the run happened.
|
|
5
|
+
*
|
|
6
|
+
* `workspace/run-event.schema.json` is the contract. These types
|
|
7
|
+
* mirror it, and {@link createRunEventWriter} and {@link writeRunEvent} are
|
|
8
|
+
* the one writer: every emitter hands a writer the type-specific body and
|
|
9
|
+
* the writer stamps the run's identity, the sequence number, the time and the
|
|
10
|
+
* contract fields on it, then writes one JSON line. The emitters themselves
|
|
11
|
+
* are in `./run-event-stream.ts` and the runtimes (#4041); the files
|
|
12
|
+
* they are kept in, replay and `--follow` are `./run-event-store.ts` (#4042).
|
|
13
|
+
*
|
|
14
|
+
* Two older streams predate this one and keep their shape behind
|
|
15
|
+
* `--progress-json`, while `--events-json` prints this one (#4041):
|
|
16
|
+
* `RunProgressEvent` (`./components/run-progress.ts`, from `chant run
|
|
17
|
+
* --components --progress-json`) and the Op path's `StepRecord` lines
|
|
18
|
+
* (`./op/local-executor.ts`, from `chant run <op> --progress-json`).
|
|
19
|
+
* {@link runEventOfProgress} and {@link runEventsOfStepRecord} say how each
|
|
20
|
+
* maps onto this contract.
|
|
21
|
+
*
|
|
22
|
+
* This module imports no runtime code beyond the chant version (`./chant-version.ts`), so a consumer
|
|
23
|
+
* can import the types and the writer without loading the rest of chant. It
|
|
24
|
+
* lives outside `workspace/` so that a level-0 import of `@intentius/chant`
|
|
25
|
+
* loads no workspace module (#2526).
|
|
26
|
+
*/
|
|
27
|
+
import type { RunProgressEvent } from "./components/run-progress.js";
|
|
28
|
+
import type { RunOrigin } from "./lifecycle/release-ledger.js";
|
|
29
|
+
import type { StepRecord } from "./op/local-executor.js";
|
|
30
|
+
/** The schema's `$id`, which every event carries as `$schema`. */
|
|
31
|
+
export declare const RUN_EVENT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/run-event/v1/run-event.schema.json";
|
|
32
|
+
/** The contract version every event carries as `contract`. */
|
|
33
|
+
export declare const RUN_EVENT_CONTRACT_VERSION = 1;
|
|
34
|
+
/** The first chant that writes contract version 1 of the run-event stream. */
|
|
35
|
+
export declare const RUN_EVENT_FLOOR = "0.124.28";
|
|
36
|
+
/** What ran: an Op, a component selection (`chant run --components`), or a CI pipeline. */
|
|
37
|
+
export type RunEventKind = "op" | "component" | "pipeline";
|
|
38
|
+
/** Where the run happened: in the process that started it, on a steward, or in a forge's CI. */
|
|
39
|
+
export type RunEventRuntime = "local" | "steward" | "ci";
|
|
40
|
+
/** How a run, wave, component or phase settled. `gated` and `waiting` wait on a person and are not failures. */
|
|
41
|
+
export type RunEventSettleStatus = "ok" | "failed" | "gated" | "waiting";
|
|
42
|
+
/**
|
|
43
|
+
* How a step settled. `skipped` says why in {@link RunEventStepSettle.skip};
|
|
44
|
+
* `cached` is for a cache hit standing in for the step (#4015).
|
|
45
|
+
*/
|
|
46
|
+
export type RunEventStepStatus = "ok" | "failed" | "skipped" | "cached" | "gated" | "waiting";
|
|
47
|
+
/** Why a step was skipped. */
|
|
48
|
+
export type RunEventSkipReason = "receipt" | "resumed" | "refused" | "not-run";
|
|
49
|
+
/** How a gate's approval passed, when it was more than one person's approval of that gate. */
|
|
50
|
+
export type RunEventGateVia = "quorum" | "policy" | "point" | "alias" | "empty";
|
|
51
|
+
/** The run every event of a stream names: the same on every line. */
|
|
52
|
+
export interface RunEventRun {
|
|
53
|
+
/**
|
|
54
|
+
* The run's own id: an Op run's id, a component run's id (the id its
|
|
55
|
+
* release records carry), or the CI run id for a pipeline run.
|
|
56
|
+
*/
|
|
57
|
+
runId: string;
|
|
58
|
+
kind: RunEventKind;
|
|
59
|
+
/** The Op's name, the component selection as given, or the pipeline's name. */
|
|
60
|
+
name: string;
|
|
61
|
+
/** The commit the run built from, or null when it did not start in a git checkout. */
|
|
62
|
+
gitSha: string | null;
|
|
63
|
+
runtime: RunEventRuntime;
|
|
64
|
+
/**
|
|
65
|
+
* Where the run ran and how to reach it, the shape a release record's
|
|
66
|
+
* `runOrigin` has. For an Op run in CI it locates the CI run, as the run
|
|
67
|
+
* record does (#4020), while `runId` stays the Op run's own id.
|
|
68
|
+
*/
|
|
69
|
+
runOrigin: RunOrigin;
|
|
70
|
+
}
|
|
71
|
+
/** What every event carries besides its body. */
|
|
72
|
+
export interface RunEventEnvelope extends RunEventRun {
|
|
73
|
+
$schema: typeof RUN_EVENT_SCHEMA_ID;
|
|
74
|
+
contract: typeof RUN_EVENT_CONTRACT_VERSION;
|
|
75
|
+
/** The version of the chant that wrote the event. */
|
|
76
|
+
chant: string;
|
|
77
|
+
/** The event's place in its run's stream, from 0 at `run-start`. */
|
|
78
|
+
seq: number;
|
|
79
|
+
/** When it happened, ISO-8601. */
|
|
80
|
+
at: string;
|
|
81
|
+
}
|
|
82
|
+
export interface RunEventRunStart {
|
|
83
|
+
type: "run-start";
|
|
84
|
+
/** In a component run, the waves the run will attempt, in order. Null in an Op or pipeline run. */
|
|
85
|
+
waves: string[][] | null;
|
|
86
|
+
}
|
|
87
|
+
/** The last event of a stream. Its `status` is the run's verdict. */
|
|
88
|
+
export interface RunEventRunSettle {
|
|
89
|
+
type: "run-settle";
|
|
90
|
+
status: RunEventSettleStatus;
|
|
91
|
+
durationMs: number | null;
|
|
92
|
+
error?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface RunEventWaveStart {
|
|
95
|
+
type: "wave-start";
|
|
96
|
+
/** 1-based, into `run-start`'s `waves`. */
|
|
97
|
+
wave: number;
|
|
98
|
+
components: string[];
|
|
99
|
+
}
|
|
100
|
+
export interface RunEventWaveSettle {
|
|
101
|
+
type: "wave-settle";
|
|
102
|
+
wave: number;
|
|
103
|
+
status: RunEventSettleStatus;
|
|
104
|
+
}
|
|
105
|
+
export interface RunEventComponentStart {
|
|
106
|
+
type: "component-start";
|
|
107
|
+
wave: number;
|
|
108
|
+
component: string;
|
|
109
|
+
}
|
|
110
|
+
export interface RunEventComponentSettle {
|
|
111
|
+
type: "component-settle";
|
|
112
|
+
wave: number;
|
|
113
|
+
component: string;
|
|
114
|
+
status: RunEventSettleStatus;
|
|
115
|
+
}
|
|
116
|
+
/** An Op's phase, a component composition's phase, or a pipeline's stage. `component` is null outside a component run. */
|
|
117
|
+
export interface RunEventPhaseStart {
|
|
118
|
+
type: "phase-start";
|
|
119
|
+
component: string | null;
|
|
120
|
+
phase: string;
|
|
121
|
+
}
|
|
122
|
+
export interface RunEventPhaseSettle {
|
|
123
|
+
type: "phase-settle";
|
|
124
|
+
component: string | null;
|
|
125
|
+
phase: string;
|
|
126
|
+
status: RunEventSettleStatus;
|
|
127
|
+
}
|
|
128
|
+
/** An Op or composition step, or a pipeline's job. */
|
|
129
|
+
export interface RunEventStepStart {
|
|
130
|
+
type: "step-start";
|
|
131
|
+
component: string | null;
|
|
132
|
+
phase: string;
|
|
133
|
+
/** The activity, `gate:<name>`, `effect:<name>`, or the job's name. */
|
|
134
|
+
step: string;
|
|
135
|
+
/**
|
|
136
|
+
* The step's place in its phase as authored, from 0, so two steps of one
|
|
137
|
+
* phase that share a name stay apart. Optional: added within contract 1 by
|
|
138
|
+
* chant 0.124.28 (#4041), and left out where the writer has no authored
|
|
139
|
+
* position, such as a step the executor adds itself.
|
|
140
|
+
*/
|
|
141
|
+
index?: number;
|
|
142
|
+
}
|
|
143
|
+
export interface RunEventStepSettle {
|
|
144
|
+
type: "step-settle";
|
|
145
|
+
component: string | null;
|
|
146
|
+
phase: string;
|
|
147
|
+
step: string;
|
|
148
|
+
/** As on {@link RunEventStepStart.index}. */
|
|
149
|
+
index?: number;
|
|
150
|
+
status: RunEventStepStatus;
|
|
151
|
+
/** With `skipped`: why, or null when the writer does not know. */
|
|
152
|
+
skip?: RunEventSkipReason | null;
|
|
153
|
+
durationMs: number | null;
|
|
154
|
+
/** With `failed`: what failed. */
|
|
155
|
+
error?: string;
|
|
156
|
+
/** Why the step skipped, gated or waited, for a person. */
|
|
157
|
+
message?: string;
|
|
158
|
+
}
|
|
159
|
+
/** The run stopped at a gate nobody has approved, or a decision point nobody has answered. */
|
|
160
|
+
export interface RunEventGateWaiting {
|
|
161
|
+
type: "gate-waiting";
|
|
162
|
+
component: string | null;
|
|
163
|
+
phase: string;
|
|
164
|
+
step: string;
|
|
165
|
+
/** As on {@link RunEventStepStart.index}. */
|
|
166
|
+
index?: number;
|
|
167
|
+
/** The op the gate is recorded under, which `chant approve` takes. */
|
|
168
|
+
op: string;
|
|
169
|
+
/** The gate's name, or null when the step waits on a decision point alone. */
|
|
170
|
+
gate: string | null;
|
|
171
|
+
/** The open question's answer record id, or null. */
|
|
172
|
+
point: string | null;
|
|
173
|
+
message?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface RunEventGateResolved {
|
|
176
|
+
type: "gate-resolved";
|
|
177
|
+
component: string | null;
|
|
178
|
+
phase: string;
|
|
179
|
+
step: string;
|
|
180
|
+
/** As on {@link RunEventStepStart.index}. */
|
|
181
|
+
index?: number;
|
|
182
|
+
op: string;
|
|
183
|
+
gate: string;
|
|
184
|
+
resolvedBy: string;
|
|
185
|
+
resolvedAt: string;
|
|
186
|
+
via: RunEventGateVia | null;
|
|
187
|
+
url?: string;
|
|
188
|
+
}
|
|
189
|
+
/** The type-specific part of an event: what an emitter hands the writer. */
|
|
190
|
+
export type RunEventBody = RunEventRunStart | RunEventRunSettle | RunEventWaveStart | RunEventWaveSettle | RunEventComponentStart | RunEventComponentSettle | RunEventPhaseStart | RunEventPhaseSettle | RunEventStepStart | RunEventStepSettle | RunEventGateWaiting | RunEventGateResolved;
|
|
191
|
+
export type RunEventType = RunEventBody["type"];
|
|
192
|
+
/** Every event type, in the order a reader meets them. Closed: part of the contract. */
|
|
193
|
+
export declare const RUN_EVENT_TYPES: readonly ["run-start", "wave-start", "component-start", "phase-start", "step-start", "gate-waiting", "gate-resolved", "step-settle", "phase-settle", "component-settle", "wave-settle", "run-settle"];
|
|
194
|
+
/** One line of a run's stream. */
|
|
195
|
+
export type RunEvent = RunEventBody extends infer B ? (B extends RunEventBody ? RunEventEnvelope & B : never) : never;
|
|
196
|
+
/** One event as its line: JSON with the envelope first, then the body, and a newline. */
|
|
197
|
+
export declare function serializeRunEvent(event: RunEvent): string;
|
|
198
|
+
/** What {@link writeRunEvent} and {@link createRunEventWriter} need besides the body. */
|
|
199
|
+
export interface RunEventStamp {
|
|
200
|
+
run: RunEventRun;
|
|
201
|
+
seq: number;
|
|
202
|
+
/** When it happened. Defaults to now. */
|
|
203
|
+
at?: Date | string;
|
|
204
|
+
/** Defaults to this chant's version. */
|
|
205
|
+
chant?: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Build one event from its body and the run it belongs to. The envelope's
|
|
209
|
+
* fields come first, so every line reads the same way. No body names an
|
|
210
|
+
* envelope field, so neither overrides the other.
|
|
211
|
+
*/
|
|
212
|
+
export declare function buildRunEvent(body: RunEventBody, stamp: RunEventStamp): RunEvent;
|
|
213
|
+
/** Build one event and hand its line to `write`. Returns the event written. */
|
|
214
|
+
export declare function writeRunEvent(body: RunEventBody, stamp: RunEventStamp, write: (line: string) => void): RunEvent;
|
|
215
|
+
/** A run's writer: it keeps the run and the sequence, so an emitter hands it bodies only. */
|
|
216
|
+
export interface RunEventWriter {
|
|
217
|
+
/** Write the next event of the run and return it. */
|
|
218
|
+
emit(body: RunEventBody): RunEvent;
|
|
219
|
+
/** The `seq` the next event gets. */
|
|
220
|
+
readonly next: number;
|
|
221
|
+
}
|
|
222
|
+
export interface RunEventWriterOptions {
|
|
223
|
+
run: RunEventRun;
|
|
224
|
+
/** Where each line goes. Defaults to standard output. */
|
|
225
|
+
write?: (line: string) => void;
|
|
226
|
+
/** The clock. Defaults to `new Date()`. */
|
|
227
|
+
now?: () => Date;
|
|
228
|
+
/** The `seq` of the first event, for a writer that carries on a stream. Defaults to 0. */
|
|
229
|
+
seq?: number;
|
|
230
|
+
/** Defaults to this chant's version. */
|
|
231
|
+
chant?: string;
|
|
232
|
+
}
|
|
233
|
+
/** The one writer of a run's stream (#4019). Each `emit` writes one line and moves the sequence on. */
|
|
234
|
+
export declare function createRunEventWriter(opts: RunEventWriterOptions): RunEventWriter;
|
|
235
|
+
/**
|
|
236
|
+
* A `RunProgressEvent` (`chant run --components --progress-json`) as a
|
|
237
|
+
* run-event body. The older stream has no step timings, so `durationMs` is
|
|
238
|
+
* null on the settles it maps to.
|
|
239
|
+
*/
|
|
240
|
+
export declare function runEventOfProgress(event: RunProgressEvent): RunEventBody;
|
|
241
|
+
/**
|
|
242
|
+
* A settled `StepRecord` (`chant run <op> --progress-json`) as run-event
|
|
243
|
+
* bodies: a gate's `gate-resolved` or `gate-waiting` when the record carries
|
|
244
|
+
* one, then the `step-settle`. `op` is the run's Op, which a gate is recorded
|
|
245
|
+
* under unless the record names another.
|
|
246
|
+
*
|
|
247
|
+
* A record skipped with nothing to say why maps to `skip: null`. The local
|
|
248
|
+
* executor writes the same record for a gate nobody has approved, for a step
|
|
249
|
+
* of an effect whose receipt matched and for a step an earlier failure
|
|
250
|
+
* stopped, so only an emitter that knows which can say `gated`, `receipt` or
|
|
251
|
+
* `not-run`. The run's own status still says `gated`. The local executor
|
|
252
|
+
* (#4041) knows, and passes `skip` for a bare skipped record and `gate` for
|
|
253
|
+
* a gate step nobody has approved; it passes `index`, the step's place in
|
|
254
|
+
* its phase, too.
|
|
255
|
+
*/
|
|
256
|
+
export declare function runEventsOfStepRecord(record: StepRecord, ctx: {
|
|
257
|
+
op: string;
|
|
258
|
+
component?: string | null;
|
|
259
|
+
skip?: RunEventSkipReason;
|
|
260
|
+
index?: number;
|
|
261
|
+
/** The gate a skipped gate step stopped at, when the emitter knows it. */
|
|
262
|
+
gate?: {
|
|
263
|
+
op: string;
|
|
264
|
+
gate: string;
|
|
265
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