@intentius/chant 0.124.27 → 0.124.29
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/build-params.d.ts +34 -1
- package/dist/build-params.d.ts.map +1 -1
- package/dist/build-params.js +31 -1
- package/dist/change-set-graph.d.ts +63 -0
- package/dist/change-set-graph.d.ts.map +1 -0
- package/dist/change-set-graph.js +130 -0
- package/dist/change-set.d.ts +62 -3
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +36 -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/build-params-cli.d.ts +7 -1
- package/dist/cli/build-params-cli.d.ts.map +1 -1
- package/dist/cli/build-params-cli.js +17 -8
- 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 +15 -11
- 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 +64 -4
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +43 -4
- 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 +10 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +54 -6
- package/dist/cli/handlers/lifecycle-gc.d.ts +19 -0
- package/dist/cli/handlers/lifecycle-gc.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-gc.js +143 -0
- package/dist/cli/handlers/pr.d.ts +16 -2
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +269 -37
- package/dist/cli/handlers/promote.d.ts +7 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +440 -28
- package/dist/cli/handlers/release.d.ts +91 -0
- package/dist/cli/handlers/release.d.ts.map +1 -0
- package/dist/cli/handlers/release.js +589 -0
- package/dist/cli/handlers/run.d.ts +38 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +234 -16
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +143 -17
- 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 +73 -5
- package/dist/cli/registry.d.ts +43 -5
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/run-events.d.ts +30 -0
- package/dist/cli/run-events.d.ts.map +1 -0
- package/dist/cli/run-events.js +49 -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 +6 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +3 -0
- package/dist/components/capability.d.ts +9 -0
- package/dist/components/capability.d.ts.map +1 -1
- 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 +50 -9
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +116 -54
- package/dist/components/fan-out-inputs.d.ts +69 -0
- package/dist/components/fan-out-inputs.d.ts.map +1 -0
- package/dist/components/fan-out-inputs.js +169 -0
- package/dist/components/fan-out-record.d.ts +13 -0
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +16 -0
- 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 +85 -26
- package/dist/components/fan-out.d.ts +4 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/pr-pipeline.d.ts +25 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +22 -4
- 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 +38 -2
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +77 -2
- package/dist/components/release-compile.d.ts +142 -0
- package/dist/components/release-compile.d.ts.map +1 -0
- package/dist/components/release-compile.js +382 -0
- package/dist/components/release-gate.d.ts +135 -0
- package/dist/components/release-gate.d.ts.map +1 -0
- package/dist/components/release-gate.js +288 -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 +8 -1
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +11 -3
- package/dist/config.d.ts +45 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -0
- package/dist/flag-params.d.ts +54 -0
- package/dist/flag-params.d.ts.map +1 -0
- package/dist/flag-params.js +130 -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/__fixtures__/publish-fakes.d.ts +120 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +304 -0
- package/dist/lifecycle/change-set-store.d.ts +68 -0
- package/dist/lifecycle/change-set-store.d.ts.map +1 -0
- package/dist/lifecycle/change-set-store.js +97 -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/delivery-metrics.d.ts +139 -0
- package/dist/lifecycle/delivery-metrics.d.ts.map +1 -0
- package/dist/lifecycle/delivery-metrics.js +145 -0
- package/dist/lifecycle/deploy-outcome.d.ts +81 -0
- package/dist/lifecycle/deploy-outcome.d.ts.map +1 -0
- package/dist/lifecycle/deploy-outcome.js +101 -0
- package/dist/lifecycle/gate-change-set.d.ts +78 -0
- package/dist/lifecycle/gate-change-set.d.ts.map +1 -0
- package/dist/lifecycle/gate-change-set.js +138 -0
- package/dist/lifecycle/gate-ledger.d.ts +51 -4
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +18 -0
- package/dist/lifecycle/git.d.ts +30 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +31 -5
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/mixed-environment.d.ts +95 -0
- package/dist/lifecycle/mixed-environment.d.ts.map +1 -0
- package/dist/lifecycle/mixed-environment.js +154 -0
- package/dist/lifecycle/publish-attachments.d.ts +79 -0
- package/dist/lifecycle/publish-attachments.d.ts.map +1 -0
- package/dist/lifecycle/publish-attachments.js +179 -0
- package/dist/lifecycle/publish-credentials.d.ts +37 -0
- package/dist/lifecycle/publish-credentials.d.ts.map +1 -0
- package/dist/lifecycle/publish-credentials.js +69 -0
- package/dist/lifecycle/publish-declaration.d.ts +97 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -0
- package/dist/lifecycle/publish-declaration.js +83 -0
- package/dist/lifecycle/publish-forge.d.ts +53 -0
- package/dist/lifecycle/publish-forge.d.ts.map +1 -0
- package/dist/lifecycle/publish-forge.js +298 -0
- package/dist/lifecycle/publish-npm.d.ts +61 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -0
- package/dist/lifecycle/publish-npm.js +242 -0
- package/dist/lifecycle/publish-oci.d.ts +64 -0
- package/dist/lifecycle/publish-oci.d.ts.map +1 -0
- package/dist/lifecycle/publish-oci.js +383 -0
- package/dist/lifecycle/publish-record.d.ts +66 -0
- package/dist/lifecycle/publish-record.d.ts.map +1 -0
- package/dist/lifecycle/publish-record.js +84 -0
- package/dist/lifecycle/publish-targets.d.ts +45 -0
- package/dist/lifecycle/publish-targets.d.ts.map +1 -0
- package/dist/lifecycle/publish-targets.js +85 -0
- package/dist/lifecycle/release-cut.d.ts +154 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -0
- package/dist/lifecycle/release-cut.js +366 -0
- package/dist/lifecycle/release-join.d.ts +95 -0
- package/dist/lifecycle/release-join.d.ts.map +1 -0
- package/dist/lifecycle/release-join.js +139 -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-publish.d.ts +312 -0
- package/dist/lifecycle/release-publish.d.ts.map +1 -0
- package/dist/lifecycle/release-publish.js +335 -0
- package/dist/lifecycle/release-revocation.d.ts +80 -0
- package/dist/lifecycle/release-revocation.d.ts.map +1 -0
- package/dist/lifecycle/release-revocation.js +123 -0
- package/dist/lifecycle/release-store.d.ts +200 -0
- package/dist/lifecycle/release-store.d.ts.map +1 -0
- package/dist/lifecycle/release-store.js +320 -0
- package/dist/lifecycle/release-verify.d.ts +61 -0
- package/dist/lifecycle/release-verify.d.ts.map +1 -0
- package/dist/lifecycle/release-verify.js +92 -0
- package/dist/lifecycle/release-workstation.d.ts +91 -0
- package/dist/lifecycle/release-workstation.d.ts.map +1 -0
- package/dist/lifecycle/release-workstation.js +180 -0
- package/dist/lifecycle/retention-policy.d.ts +45 -0
- package/dist/lifecycle/retention-policy.d.ts.map +1 -0
- package/dist/lifecycle/retention-policy.js +43 -0
- package/dist/lifecycle/retention.d.ts +185 -0
- package/dist/lifecycle/retention.d.ts.map +1 -0
- package/dist/lifecycle/retention.js +400 -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/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 +8 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -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/pr-loop.d.ts +7 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +23 -4
- package/dist/pr-report-url.d.ts +82 -0
- package/dist/pr-report-url.d.ts.map +1 -0
- package/dist/pr-report-url.js +174 -0
- package/dist/provenance.d.ts +2 -2
- package/dist/provenance.d.ts.map +1 -1
- package/dist/run-event-store.d.ts +104 -0
- package/dist/run-event-store.d.ts.map +1 -0
- package/dist/run-event-store.js +251 -0
- package/dist/run-event-stream.d.ts +133 -0
- package/dist/run-event-stream.d.ts.map +1 -0
- package/dist/run-event-stream.js +242 -0
- package/dist/run-event.d.ts +285 -0
- package/dist/run-event.d.ts.map +1 -0
- package/dist/run-event.js +209 -0
- package/dist/wave-runtime.mjs +262 -226
- package/dist/workspace/__fixtures__/flag-workspace.d.ts +31 -0
- package/dist/workspace/__fixtures__/flag-workspace.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/flag-workspace.js +114 -0
- 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 +32 -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/check.schema.json +4 -2
- package/dist/workspace/checks/records.d.ts +9 -1
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks/records.js +35 -1
- package/dist/workspace/checks.d.ts +1 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +2 -1
- 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 +281 -13
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +456 -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 +35 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +27 -1
- package/dist/workspace/declaration.schema.json +76 -0
- package/dist/workspace/declared-kinds.d.ts +16 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -1
- package/dist/workspace/declared-kinds.js +25 -0
- package/dist/workspace/delivery-metrics.d.ts +91 -0
- package/dist/workspace/delivery-metrics.d.ts.map +1 -0
- package/dist/workspace/delivery-metrics.js +217 -0
- package/dist/workspace/delivery-metrics.schema.json +519 -0
- package/dist/workspace/flags-read.d.ts +37 -0
- package/dist/workspace/flags-read.d.ts.map +1 -0
- package/dist/workspace/flags-read.js +103 -0
- package/dist/workspace/flags.d.ts +100 -0
- package/dist/workspace/flags.d.ts.map +1 -0
- package/dist/workspace/flags.js +98 -0
- package/dist/workspace/graph-cli.js +1 -1
- 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-cli.d.ts +11 -2
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.js +54 -5
- package/dist/workspace/intent-trace.d.ts +219 -0
- package/dist/workspace/intent-trace.d.ts.map +1 -0
- package/dist/workspace/intent-trace.js +314 -0
- package/dist/workspace/intent.d.ts +36 -7
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +192 -22
- package/dist/workspace/intent.schema.json +702 -6
- 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/overlap.d.ts +146 -0
- package/dist/workspace/overlap.d.ts.map +1 -0
- package/dist/workspace/overlap.js +276 -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 +4 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +7 -1
- package/dist/workspace/records.d.ts +15 -2
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +32 -0
- package/dist/workspace/records.schema.json +21 -2
- package/dist/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/dist/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/dist/workspace/releases.d.ts +81 -0
- package/dist/workspace/releases.d.ts.map +1 -0
- package/dist/workspace/releases.js +103 -0
- package/dist/workspace/releases.schema.json +513 -0
- package/dist/workspace/run-event.schema.json +295 -0
- package/dist/workspace/status-gates.d.ts +34 -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 +117 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +218 -4
- package/dist/workspace/status.schema.json +268 -2
- 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/dist/workspace/wip.d.ts.map +1 -1
- package/dist/workspace/wip.js +11 -3
- 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/build-params.test.ts +46 -0
- package/src/build-params.ts +55 -1
- package/src/change-set-graph.test.ts +72 -0
- package/src/change-set-graph.ts +141 -0
- package/src/change-set.ts +87 -6
- package/src/chant-version.ts +16 -0
- package/src/cli/build-params-cli.ts +22 -9
- package/src/cli/commands/build.ts +25 -11
- 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/handlers/approve-release.test.ts +84 -0
- package/src/cli/handlers/approve-revoked.test.ts +155 -0
- package/src/cli/handlers/approve.ts +65 -2
- package/src/cli/handlers/build.test.ts +67 -0
- package/src/cli/handlers/build.ts +46 -4
- package/src/cli/handlers/change-set.ts +49 -1
- package/src/cli/handlers/fan-out.test.ts +228 -1
- package/src/cli/handlers/fan-out.ts +53 -6
- package/src/cli/handlers/intent-trace.e2e.test.ts +201 -0
- package/src/cli/handlers/lifecycle-gc.test.ts +126 -0
- package/src/cli/handlers/lifecycle-gc.ts +146 -0
- package/src/cli/handlers/operator.test.ts +37 -0
- package/src/cli/handlers/pr.test.ts +341 -0
- package/src/cli/handlers/pr.ts +292 -47
- package/src/cli/handlers/promote.test.ts +669 -7
- package/src/cli/handlers/promote.ts +464 -29
- package/src/cli/handlers/release-implicit.e2e.test.ts +161 -0
- package/src/cli/handlers/release-join.e2e.test.ts +185 -0
- package/src/cli/handlers/release-publish-targets.e2e.test.ts +295 -0
- package/src/cli/handlers/release-verify.e2e.test.ts +117 -0
- package/src/cli/handlers/release-workstation-ci.e2e.test.ts +135 -0
- package/src/cli/handlers/release.e2e.test.ts +199 -0
- package/src/cli/handlers/release.ts +593 -0
- package/src/cli/handlers/run-auto-release.test.ts +80 -0
- package/src/cli/handlers/run-events-cmd.test.ts +92 -0
- package/src/cli/handlers/run-release.test.ts +55 -0
- package/src/cli/handlers/run.test.ts +30 -0
- package/src/cli/handlers/run.ts +243 -18
- package/src/cli/main.test.ts +8 -0
- package/src/cli/main.ts +143 -17
- 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 +56 -5
- package/src/cli/registry.ts +43 -5
- package/src/cli/run-events.ts +57 -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 +30 -0
- package/src/components/auto-release.ts +9 -1
- package/src/components/capability.ts +9 -0
- package/src/components/cli-support.test.ts +82 -0
- package/src/components/cli-support.ts +16 -9
- package/src/components/driver.test.ts +24 -0
- package/src/components/driver.ts +165 -56
- package/src/components/fan-out-inputs.test.ts +85 -0
- package/src/components/fan-out-inputs.ts +192 -0
- package/src/components/fan-out-record.test.ts +10 -0
- package/src/components/fan-out-record.ts +19 -0
- package/src/components/fan-out-run.ts +104 -35
- package/src/components/fan-out.ts +4 -0
- package/src/components/pr-pipeline.ts +35 -4
- 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 +94 -3
- package/src/components/release-compile.test.ts +147 -0
- package/src/components/release-compile.ts +459 -0
- package/src/components/release-gate.test.ts +215 -0
- package/src/components/release-gate.ts +355 -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 +16 -3
- package/src/config.ts +15 -1
- package/src/flag-params.test.ts +144 -0
- package/src/flag-params.ts +134 -0
- package/src/index.ts +2 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +351 -0
- package/src/lifecycle/change-set-store.test.ts +217 -0
- package/src/lifecycle/change-set-store.ts +113 -0
- package/src/lifecycle/commit-sha.ts +23 -0
- package/src/lifecycle/delivery-metrics.ts +263 -0
- package/src/lifecycle/deploy-outcome.ts +147 -0
- package/src/lifecycle/gate-change-set.e2e.test.ts +122 -0
- package/src/lifecycle/gate-change-set.ts +164 -0
- package/src/lifecycle/gate-ledger.test.ts +33 -0
- package/src/lifecycle/gate-ledger.ts +68 -3
- package/src/lifecycle/git.ts +61 -8
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/mixed-environment.test.ts +97 -0
- package/src/lifecycle/mixed-environment.ts +204 -0
- package/src/lifecycle/publish-attachments.ts +196 -0
- package/src/lifecycle/publish-credentials.ts +84 -0
- package/src/lifecycle/publish-declaration.ts +95 -0
- package/src/lifecycle/publish-forge.ts +325 -0
- package/src/lifecycle/publish-npm.ts +259 -0
- package/src/lifecycle/publish-oci.ts +396 -0
- package/src/lifecycle/publish-record.ts +113 -0
- package/src/lifecycle/publish-resume.test.ts +168 -0
- package/src/lifecycle/publish-targets.test.ts +494 -0
- package/src/lifecycle/publish-targets.ts +100 -0
- package/src/lifecycle/release-cut-signed.test.ts +180 -0
- package/src/lifecycle/release-cut.test.ts +483 -0
- package/src/lifecycle/release-cut.ts +503 -0
- package/src/lifecycle/release-flag.test.ts +112 -0
- package/src/lifecycle/release-join.test.ts +68 -0
- package/src/lifecycle/release-join.ts +182 -0
- package/src/lifecycle/release-ledger.test.ts +14 -0
- package/src/lifecycle/release-ledger.ts +85 -17
- package/src/lifecycle/release-publish.test.ts +225 -0
- package/src/lifecycle/release-publish.ts +568 -0
- package/src/lifecycle/release-revocation.ts +147 -0
- package/src/lifecycle/release-store.ts +434 -0
- package/src/lifecycle/release-verify.test.ts +110 -0
- package/src/lifecycle/release-verify.ts +120 -0
- package/src/lifecycle/release-workstation.test.ts +204 -0
- package/src/lifecycle/release-workstation.ts +216 -0
- package/src/lifecycle/retention-growth.e2e.test.ts +279 -0
- package/src/lifecycle/retention-policy.ts +63 -0
- package/src/lifecycle/retention.test.ts +363 -0
- package/src/lifecycle/retention.ts +508 -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/commit-run-gate-deploy-join.test.ts +117 -0
- 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 +9 -0
- package/src/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/point-decision.ts +12 -2
- package/src/pr-loop.ts +25 -4
- package/src/pr-report-url.test.ts +131 -0
- package/src/pr-report-url.ts +209 -0
- package/src/provenance.ts +2 -2
- package/src/run-event-store.test.ts +144 -0
- package/src/run-event-store.ts +273 -0
- package/src/run-event-stream.test.ts +175 -0
- package/src/run-event-stream.ts +309 -0
- package/src/run-event.test.ts +277 -0
- package/src/run-event.ts +471 -0
- package/src/wave-loop-golden.test.ts +9 -0
- package/src/workspace/__fixtures__/flag-workspace.ts +132 -0
- package/src/workspace/__fixtures__/older-records/change-set-984534ea9.json +100 -0
- package/src/workspace/__fixtures__/older-records/older-records.json +326 -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 +32 -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/check.schema.json +4 -2
- package/src/workspace/checks/records.ts +35 -1
- package/src/workspace/checks.ts +2 -1
- 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 +635 -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 +76 -0
- package/src/workspace/declaration.test.ts +28 -0
- package/src/workspace/declaration.ts +60 -2
- package/src/workspace/declared-kinds.ts +40 -1
- package/src/workspace/delivery-metrics.schema.json +519 -0
- package/src/workspace/delivery-metrics.test.ts +236 -0
- package/src/workspace/delivery-metrics.ts +286 -0
- package/src/workspace/flags-read.ts +121 -0
- package/src/workspace/flags.test.ts +141 -0
- package/src/workspace/flags.ts +157 -0
- package/src/workspace/graph-cli.ts +1 -1
- package/src/workspace/identity-gate-rule.ts +91 -7
- package/src/workspace/identity.ts +14 -1
- package/src/workspace/intent-cli.ts +46 -5
- package/src/workspace/intent-trace.test.ts +173 -0
- package/src/workspace/intent-trace.ts +484 -0
- package/src/workspace/intent.schema.json +702 -6
- package/src/workspace/intent.ts +196 -26
- 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/older-records.test.ts +412 -0
- package/src/workspace/overlap.test.ts +165 -0
- package/src/workspace/overlap.ts +340 -0
- package/src/workspace/promotion-order.ts +97 -0
- package/src/workspace/read-contract.e2e.test.ts +5 -1
- package/src/workspace/reason-codes.test.ts +7 -1
- package/src/workspace/reason-codes.ts +7 -1
- package/src/workspace/record-assets.test.ts +2 -1
- package/src/workspace/records-contract.e2e.test.ts +2 -1
- package/src/workspace/records.schema.json +21 -2
- package/src/workspace/records.ts +36 -2
- package/src/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/src/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/src/workspace/releases.schema.json +513 -0
- package/src/workspace/releases.test.ts +108 -0
- package/src/workspace/releases.ts +133 -0
- package/src/workspace/run-event.schema.json +295 -0
- package/src/workspace/status-contract.test.ts +81 -1
- package/src/workspace/status-gates.ts +64 -1
- package/src/workspace/status-mixed.test.ts +152 -0
- package/src/workspace/status-revoked.test.ts +153 -0
- package/src/workspace/status-stewards.ts +6 -0
- package/src/workspace/status.schema.json +268 -2
- package/src/workspace/status.ts +334 -4
- 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/workspace/wip.ts +11 -2
- 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
package/src/cli/handlers/pr.ts
CHANGED
|
@@ -29,6 +29,20 @@
|
|
|
29
29
|
*
|
|
30
30
|
* Every run writes `pr-plan.json` or `pr-apply.json` (`pr-report.schema.json`),
|
|
31
31
|
* `change-set.json` and `pr-note.md` under `--output` (default `.chant/pr`). *
|
|
32
|
+
* `--events-json` (#4041, #4007) streams the stage's run events to stdout,
|
|
33
|
+
* one `run-event.schema.json` line each: the planning as a `plan` phase with
|
|
34
|
+
* a step per component, the gate's decision as a `gate` phase, and on
|
|
35
|
+
* pr-apply the apply's waves and components as `chant run --components`
|
|
36
|
+
* streams them. A component the apply does not start settles too, `blocked`
|
|
37
|
+
* behind a failed dependency or `already-applied` on a resumed apply.
|
|
38
|
+
* With or without it, pr-apply prints a line on stderr as each wave starts
|
|
39
|
+
* and as each component settles, so a job log shows the waves in order.
|
|
40
|
+
*
|
|
41
|
+
* `--report-url <s3 or file URL>` (#4007) copies `pr-<stage>.json`,
|
|
42
|
+
* `change-set.json` and, with `--events-json`, the events to
|
|
43
|
+
* `<url>/<pr>/<commit>/`, the events again as each wave and component
|
|
44
|
+
* settles (`../../pr-report-url.ts`).
|
|
45
|
+
*
|
|
32
46
|
* `--member <name>` (#3465) runs a workspace member's loop: the member's
|
|
33
47
|
* generated pipeline passes it from the member's directory. The gate is
|
|
34
48
|
* recorded under `pr-<n>-<member>`, and the note and the statuses carry the
|
|
@@ -53,8 +67,13 @@ import {
|
|
|
53
67
|
type PrPlanSet,
|
|
54
68
|
} from "../../components/pr-run";
|
|
55
69
|
import { readFanOutAttempt, writeFanOutAttempt, type FanOutAttempt, type PrApplyRecord } from "../../components/fan-out-record";
|
|
70
|
+
import { componentInputDigests, progressThatCarries } from "../../components/fan-out-inputs";
|
|
56
71
|
import { samePlanDigest } from "../../lifecycle/plan-digest";
|
|
57
|
-
import { gitGateLedgerPort } from "../../op/gate";
|
|
72
|
+
import { gitGateLedgerPort, type GateCheck } from "../../op/gate";
|
|
73
|
+
import { emitGateStep, gateEventsOf, GATE_PHASE, type RunEventSink, type RunEventStream } from "../../run-event-stream";
|
|
74
|
+
import type { RunEventBody, RunEventComponentSettle, RunEventSettleStatus } from "../../run-event";
|
|
75
|
+
import { openCliRunEvents, refusesEventsWithJson } from "../run-events";
|
|
76
|
+
import { openPrReportUpload, parseReportUrl, reportKey, type PrReportUpload, type ReportTarget } from "../../pr-report-url";
|
|
58
77
|
import {
|
|
59
78
|
describePlanChanged,
|
|
60
79
|
PR_APPLY_GATE,
|
|
@@ -74,7 +93,7 @@ import { resolveCliBuildParams, parseParamFlags } from "../build-params-cli";
|
|
|
74
93
|
import { formatError, formatInfo, formatSuccess, formatWarning } from "../format";
|
|
75
94
|
import { findWorkspaceRoot } from "../../project-root";
|
|
76
95
|
import { resolveChangedUnits } from "./fan-out";
|
|
77
|
-
import { GATED_EXIT_CODE, recordAutoReleasesForRun } from "./run";
|
|
96
|
+
import { GATED_EXIT_CODE, autoReleaseRun, recordAutoReleasesForRun } from "./run";
|
|
78
97
|
import type { CommandContext } from "../registry";
|
|
79
98
|
import type { ComponentChangeSignal, FanOutPlan } from "../../components/fan-out";
|
|
80
99
|
import type { DriverComponent } from "../../components/driver";
|
|
@@ -225,16 +244,46 @@ async function checkMember(projectPath: string, names: string[]): Promise<string
|
|
|
225
244
|
}
|
|
226
245
|
|
|
227
246
|
/** Plan every member the derivation selects. */
|
|
228
|
-
function planAll(p: Prepared): Promise<PrPlanSet> {
|
|
229
|
-
return planPrSet({
|
|
247
|
+
function planAll(p: Prepared, onRunEvent?: RunEventSink): Promise<PrPlanSet> {
|
|
248
|
+
return planPrSet({
|
|
249
|
+
components: p.components,
|
|
250
|
+
plan: p.plan,
|
|
251
|
+
registry: p.registry,
|
|
252
|
+
env: p.env,
|
|
253
|
+
seededOutputs: p.seededOutputs,
|
|
254
|
+
...(onRunEvent ? { onRunEvent } : {}),
|
|
255
|
+
});
|
|
230
256
|
}
|
|
231
257
|
|
|
232
|
-
/**
|
|
233
|
-
|
|
258
|
+
/**
|
|
259
|
+
* How a stage's report settles its run's events (#4041): a refusal waits on
|
|
260
|
+
* a person, as a gate does, and exits the same way.
|
|
261
|
+
*/
|
|
262
|
+
function settleOf(status: PrReport["status"]): RunEventSettleStatus {
|
|
263
|
+
switch (status) {
|
|
264
|
+
case "nothing":
|
|
265
|
+
case "planned":
|
|
266
|
+
case "applied":
|
|
267
|
+
return "ok";
|
|
268
|
+
case "refused":
|
|
269
|
+
return "gated";
|
|
270
|
+
default:
|
|
271
|
+
return "failed";
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** Write the report, the change set and the note, and hand the first two to `--report-url`'s upload. */
|
|
276
|
+
function writeOutputs(ctx: CommandContext, report: PrReport, note: string, upload?: PrReportUpload): void {
|
|
234
277
|
const dir = resolve(ctx.args.output ?? PR_REPORT_DIR);
|
|
235
278
|
mkdirSync(dir, { recursive: true });
|
|
236
|
-
|
|
237
|
-
|
|
279
|
+
const files: Array<[string, string]> = [
|
|
280
|
+
[`pr-${report.stage}.json`, JSON.stringify(report, null, 2) + "\n"],
|
|
281
|
+
["change-set.json", JSON.stringify(report.changeSet, null, 2) + "\n"],
|
|
282
|
+
];
|
|
283
|
+
for (const [name, body] of files) {
|
|
284
|
+
writeFileSync(join(dir, name), body);
|
|
285
|
+
upload?.file(name, body);
|
|
286
|
+
}
|
|
238
287
|
writeFileSync(join(dir, "pr-note.md"), note);
|
|
239
288
|
}
|
|
240
289
|
|
|
@@ -277,27 +326,88 @@ function printMembers(report: PrReport): void {
|
|
|
277
326
|
}
|
|
278
327
|
}
|
|
279
328
|
|
|
280
|
-
async function finish(ctx: CommandContext, p: Prepared, report: PrReport): Promise<void> {
|
|
329
|
+
async function finish(ctx: CommandContext, p: Prepared, report: PrReport, upload?: PrReportUpload): Promise<void> {
|
|
281
330
|
const note = noteFor(report, p.forge);
|
|
282
|
-
writeOutputs(ctx, report, note);
|
|
331
|
+
writeOutputs(ctx, report, note, upload);
|
|
283
332
|
await publish(p.forge, report, note);
|
|
284
333
|
if (ctx.args.json) console.log(JSON.stringify(report, null, 2));
|
|
285
334
|
}
|
|
286
335
|
|
|
287
|
-
/**
|
|
288
|
-
|
|
336
|
+
/**
|
|
337
|
+
* A stage's stream and its `--report-url` upload, held so that a stage that
|
|
338
|
+
* returns or throws before it settles still ends the stream and uploads.
|
|
339
|
+
*/
|
|
340
|
+
interface StageEvents {
|
|
341
|
+
stream?: RunEventStream;
|
|
342
|
+
/** Where `--report-url` points, read before the stage starts. */
|
|
343
|
+
target?: ReportTarget;
|
|
344
|
+
upload?: PrReportUpload;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** Run a stage, end its stream as `failed` when the stage did not settle it, and finish its upload. */
|
|
348
|
+
async function withStageEvents(stage: string, ctx: CommandContext, run: (events: StageEvents) => Promise<number>): Promise<number> {
|
|
349
|
+
const events: StageEvents = {};
|
|
350
|
+
if (ctx.args.reportUrl !== undefined) {
|
|
351
|
+
const target = parseReportUrl(ctx.args.reportUrl);
|
|
352
|
+
if ("error" in target) return fail(target.error);
|
|
353
|
+
events.target = target;
|
|
354
|
+
}
|
|
355
|
+
try {
|
|
356
|
+
return await run(events);
|
|
357
|
+
} catch (err) {
|
|
358
|
+
events.stream?.settle("failed", err instanceof Error ? err.message : String(err));
|
|
359
|
+
throw err;
|
|
360
|
+
} finally {
|
|
361
|
+
events.stream?.settle("failed", `${stage} stopped before it finished`);
|
|
362
|
+
if (events.upload) {
|
|
363
|
+
await events.upload.close();
|
|
364
|
+
console.error(formatInfo(`report : ${events.upload.where}/`));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Open the stage's `--report-url` upload under its pull request and commit,
|
|
371
|
+
* when the flag was given. Its events are the lines `openCliRunEvents` writes.
|
|
372
|
+
*/
|
|
373
|
+
function openUpload(events: StageEvents, stage: "plan" | "apply", pr: number | null, p: Prepared): PrReportUpload | undefined {
|
|
374
|
+
if (!events.target) return undefined;
|
|
375
|
+
events.upload = openPrReportUpload({
|
|
376
|
+
target: events.target,
|
|
377
|
+
key: reportKey(pr, p.head, p.member),
|
|
378
|
+
stage,
|
|
379
|
+
warn: (message) => console.error(formatWarning({ message })),
|
|
380
|
+
});
|
|
381
|
+
return events.upload;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** chant components pr-plan --base <ref> --pr <n> [--env <env>] [--gate <name>] [--forge <kind>] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
385
|
+
export function runComponentsPrPlan(ctx: CommandContext): Promise<number> {
|
|
386
|
+
if (refusesEventsWithJson(ctx.args, "the stage's report")) return Promise.resolve(1);
|
|
387
|
+
return withStageEvents("pr-plan", ctx, (events) => prPlan(ctx, events));
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
async function prPlan(ctx: CommandContext, stage: StageEvents): Promise<number> {
|
|
289
391
|
if (ctx.args.pr === undefined) {
|
|
290
392
|
return fail("pr-plan needs the pull or merge request: --pr <n>", "Its approval is recorded under op pr-<n>, so one pull request's approval never answers another's.");
|
|
291
393
|
}
|
|
292
394
|
const p = await prepare(ctx, "plan");
|
|
293
395
|
if (typeof p === "number") return p;
|
|
294
|
-
const set = await planAll(p);
|
|
295
396
|
const op = prOp(ctx.args.pr, p.member);
|
|
397
|
+
const upload = openUpload(stage, "plan", ctx.args.pr, p);
|
|
398
|
+
// `--events-json` (#4041): planning, then where the approval stands.
|
|
399
|
+
const events = await openCliRunEvents(ctx.args, { kind: "component", name: `pr-plan ${op}`, cwd: resolve(".") }, upload?.line);
|
|
400
|
+
stage.stream = events;
|
|
401
|
+
events?.emit({ type: "run-start", waves: p.plan.waves });
|
|
402
|
+
const set = await planAll(p, events?.emit);
|
|
296
403
|
|
|
297
404
|
let approval: PrApproval = { status: "pending" };
|
|
298
405
|
if (p.plan.order.length > 0) {
|
|
299
406
|
try {
|
|
300
|
-
|
|
407
|
+
const check = await emitGateStep(events?.emit, { op, gate: p.gate }, () =>
|
|
408
|
+
decidePrGate(readOnlyLedger(gitGateLedgerPort()), { op, gate: p.gate, digest: set.doc.digest }),
|
|
409
|
+
);
|
|
410
|
+
approval = approvalOf(check);
|
|
301
411
|
} catch (err) {
|
|
302
412
|
console.error(formatWarning({ message: `could not read the gate ledger, so the approval reads as pending: ${err instanceof Error ? err.message : String(err)}` }));
|
|
303
413
|
}
|
|
@@ -318,7 +428,9 @@ export async function runComponentsPrPlan(ctx: CommandContext): Promise<number>
|
|
|
318
428
|
approval,
|
|
319
429
|
status,
|
|
320
430
|
});
|
|
321
|
-
await finish(ctx, p, report);
|
|
431
|
+
await finish(ctx, p, report, upload);
|
|
432
|
+
// The plan stage settles on its planning: an approval still to come is what it reports, not a stop.
|
|
433
|
+
events?.settle(settleOf(status), status === "plan-failed" ? "a member failed to plan" : undefined);
|
|
322
434
|
|
|
323
435
|
console.error(formatInfo(`pr-plan: ${report.members.length} member(s), ${status}`));
|
|
324
436
|
printMembers(report);
|
|
@@ -329,8 +441,13 @@ export async function runComponentsPrPlan(ctx: CommandContext): Promise<number>
|
|
|
329
441
|
return status === "plan-failed" ? 1 : 0;
|
|
330
442
|
}
|
|
331
443
|
|
|
332
|
-
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--output <dir>] [--json] */
|
|
333
|
-
export
|
|
444
|
+
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
445
|
+
export function runComponentsPrApply(ctx: CommandContext): Promise<number> {
|
|
446
|
+
if (refusesEventsWithJson(ctx.args, "the stage's report")) return Promise.resolve(1);
|
|
447
|
+
return withStageEvents("pr-apply", ctx, (events) => prApply(ctx, events));
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
async function prApply(ctx: CommandContext, stage: StageEvents): Promise<number> {
|
|
334
451
|
const { args } = ctx;
|
|
335
452
|
if (args.requireReview && !args.forge) return fail("--require-review reads the pull request's reviews, so it needs --forge <kind>");
|
|
336
453
|
const p = await prepare(ctx, "apply");
|
|
@@ -345,6 +462,13 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
345
462
|
}
|
|
346
463
|
}
|
|
347
464
|
const op = pr === null ? "pr-unknown" : prOp(pr, p.member);
|
|
465
|
+
// The run id the release records carry, chosen before the run so that
|
|
466
|
+
// `--events-json` (#4041, #4007) names the run by it too.
|
|
467
|
+
const release = autoReleaseRun(`${op}-${Date.now()}`);
|
|
468
|
+
const upload = openUpload(stage, "apply", pr, p);
|
|
469
|
+
const events = await openCliRunEvents(args, { kind: "component", name: `pr-apply ${op}`, runId: release.runId, cwd: resolve(".") }, upload?.line);
|
|
470
|
+
stage.stream = events;
|
|
471
|
+
events?.emit({ type: "run-start", waves: p.plan.waves });
|
|
348
472
|
|
|
349
473
|
// `--resume` (#3464): an earlier attempt at this change on this commit
|
|
350
474
|
// applied part of an approved set. When the members left are covered by
|
|
@@ -358,13 +482,28 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
358
482
|
return fail(`--resume: could not read "${args.resume}": ${err instanceof Error ? err.message : String(err)}`);
|
|
359
483
|
}
|
|
360
484
|
}
|
|
361
|
-
|
|
485
|
+
// What each component would apply now (#4081): progress carries only where it is unchanged.
|
|
486
|
+
const inputsNow = resumePath ? componentInputDigests(p.components, { projectRoot: resolve("."), env: p.env }) : {};
|
|
487
|
+
const resumed = pr !== null && p.plan.order.length > 0 && attempt ? await tryResume(p, attempt, args.resume!, op, inputsNow) : undefined;
|
|
362
488
|
|
|
363
|
-
|
|
489
|
+
// The components an earlier attempt applied settle first (#4007), each in
|
|
490
|
+
// the wave the derivation gave it, which is the run-start's.
|
|
491
|
+
const log = applyLog();
|
|
492
|
+
if (resumed) {
|
|
493
|
+
const waveOf = new Map(p.plan.waves.flatMap((wave, i) => wave.map((name) => [name, i + 1] as const)));
|
|
494
|
+
for (const component of p.plan.order.filter((name) => resumed.completed.includes(name))) {
|
|
495
|
+
const body: RunEventComponentSettle = { type: "component-settle", wave: waveOf.get(component)!, component, status: "already-applied" };
|
|
496
|
+
events?.emit(body);
|
|
497
|
+
log(body);
|
|
498
|
+
}
|
|
499
|
+
emitResumedGate(events, op, p.gate, resumed.check);
|
|
500
|
+
}
|
|
501
|
+
const set = resumed?.set ?? (await planAll(p, events?.emit));
|
|
364
502
|
const base = { stage: "apply" as const, pr, env: p.env, ...(p.member ? { member: p.member } : {}), base: p.base, head: p.head, op, gate: p.gate, plan: p.plan, signal: p.signal, set };
|
|
365
503
|
|
|
366
|
-
const stop = async (report: PrReport, code: number): Promise<number> => {
|
|
367
|
-
|
|
504
|
+
const stop = async (report: PrReport, code: number, settle?: RunEventSettleStatus): Promise<number> => {
|
|
505
|
+
events?.settle(settle ?? settleOf(report.status), report.status === "plan-failed" || report.status === "failed" ? report.message ?? `pr-apply ${report.status}` : undefined);
|
|
506
|
+
await finish(ctx, p, report, upload);
|
|
368
507
|
console.error((code === 0 ? formatInfo : (m: string) => formatWarning({ message: m }))(`pr-apply: ${report.status}${report.refusal ? ` (${report.refusal})` : ""}`));
|
|
369
508
|
if (report.message) console.error(report.message);
|
|
370
509
|
printMembers(report);
|
|
@@ -398,16 +537,32 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
398
537
|
);
|
|
399
538
|
}
|
|
400
539
|
|
|
540
|
+
// #4022: keep the change set the gate binds on chant/lifecycle under its
|
|
541
|
+
// digest before deciding the gate, so the plan an approval bound, or the
|
|
542
|
+
// one a pending fact waits on, can be read once this job is gone.
|
|
543
|
+
await storeChangeSetForGate(ctx, p, set.doc);
|
|
544
|
+
|
|
401
545
|
let approval: PrApproval;
|
|
402
546
|
if (resumed) {
|
|
403
547
|
approval = resumed.approval;
|
|
404
548
|
} else {
|
|
405
|
-
const check = await
|
|
406
|
-
|
|
407
|
-
gate: p.gate,
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
549
|
+
const check = await emitGateStep(
|
|
550
|
+
events?.emit,
|
|
551
|
+
{ op, gate: p.gate },
|
|
552
|
+
() =>
|
|
553
|
+
decidePrGate(gitGateLedgerPort(), {
|
|
554
|
+
op,
|
|
555
|
+
gate: p.gate,
|
|
556
|
+
digest: set.doc.digest,
|
|
557
|
+
description: `pull request #${pr}: ${p.plan.order.join(", ")}`,
|
|
558
|
+
}),
|
|
559
|
+
(unapproved) => {
|
|
560
|
+
const a = approvalOf(unapproved);
|
|
561
|
+
return a.status === "changed"
|
|
562
|
+
? describePlanChanged({ op, gate: p.gate, digest: set.doc.digest, approval: a })
|
|
563
|
+
: `No approval stands for this plan. Approve it: ${prApproveCommand({ op, gate: p.gate, digest: set.doc.digest })}`;
|
|
564
|
+
},
|
|
565
|
+
);
|
|
411
566
|
approval = approvalOf(check);
|
|
412
567
|
if (!check.satisfied) {
|
|
413
568
|
const partial = { ...base, approval, status: "refused" as const };
|
|
@@ -431,19 +586,12 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
431
586
|
}
|
|
432
587
|
const strangers = approversWithoutReview(approval.approvedBy ?? [], reviewers);
|
|
433
588
|
if (strangers.length > 0) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
message:
|
|
441
|
-
`The plan is approved by ${strangers.join(", ")}, who ${strangers.length === 1 ? "has" : "have"} no approving review on #${pr}` +
|
|
442
|
-
` (approving reviews: ${reviewers.join(", ") || "none"}). Nothing was applied. ` +
|
|
443
|
-
`An approval counts when it names the reviewer the way the forge does: ${p.forge.principalOf("<login>")}.`,
|
|
444
|
-
}),
|
|
445
|
-
GATED_EXIT_CODE,
|
|
446
|
-
);
|
|
589
|
+
const message =
|
|
590
|
+
`The plan is approved by ${strangers.join(", ")}, who ${strangers.length === 1 ? "has" : "have"} no approving review on #${pr}` +
|
|
591
|
+
` (approving reviews: ${reviewers.join(", ") || "none"}). Nothing was applied. ` +
|
|
592
|
+
`An approval counts when it names the reviewer the way the forge does: ${p.forge.principalOf("<login>")}.`;
|
|
593
|
+
emitReviewStop(events, message);
|
|
594
|
+
return stop(prReport({ ...base, approval, status: "refused", refusal: "not-a-reviewer", message }), GATED_EXIT_CODE);
|
|
447
595
|
}
|
|
448
596
|
}
|
|
449
597
|
|
|
@@ -451,6 +599,9 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
451
599
|
// one settles, so a run killed partway still knows what applied.
|
|
452
600
|
const prior = resumed ? { completed: resumed.completed, outputs: resumed.outputs } : { completed: [], outputs: {} };
|
|
453
601
|
const completedSoFar = new Set<string>(prior.completed);
|
|
602
|
+
const inputsSoFar: Record<string, string> = Object.fromEntries(
|
|
603
|
+
prior.completed.filter((name) => inputsNow[name] !== undefined).map((name) => [name, inputsNow[name]!]),
|
|
604
|
+
);
|
|
454
605
|
const failedSoFar: string[] = [];
|
|
455
606
|
const outputsSoFar: Record<string, Record<string, unknown>> = { ...prior.outputs };
|
|
456
607
|
const record: PrApplyRecord = {
|
|
@@ -470,6 +621,7 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
470
621
|
completed: [...completedSoFar].sort(),
|
|
471
622
|
failed: [...failedSoFar].sort(),
|
|
472
623
|
outputs: outputsSoFar,
|
|
624
|
+
inputs: Object.fromEntries(Object.entries(inputsSoFar).sort(([a], [b]) => a.localeCompare(b))),
|
|
473
625
|
prApply: record,
|
|
474
626
|
});
|
|
475
627
|
};
|
|
@@ -482,11 +634,18 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
482
634
|
env: p.env,
|
|
483
635
|
set,
|
|
484
636
|
...(resumed ? { resumed: prior } : {}),
|
|
637
|
+
// The apply is this run's waves, so the fan-out's own run framing is
|
|
638
|
+
// dropped. The log's lines go to stderr with or without --events-json.
|
|
639
|
+
onRunEvent: (body: RunEventBody) => {
|
|
640
|
+
events?.nested(body);
|
|
641
|
+
log(body);
|
|
642
|
+
},
|
|
485
643
|
...(resumePath
|
|
486
644
|
? {
|
|
487
645
|
onComponentSettled: (settled, outputs) => {
|
|
488
646
|
if (settled.status === "ok") {
|
|
489
647
|
completedSoFar.add(settled.component);
|
|
648
|
+
if (inputsNow[settled.component] !== undefined) inputsSoFar[settled.component] = inputsNow[settled.component]!;
|
|
490
649
|
if (outputs) outputsSoFar[settled.component] = outputs;
|
|
491
650
|
} else if (settled.status === "fail") {
|
|
492
651
|
failedSoFar.push(settled.component);
|
|
@@ -497,7 +656,7 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
497
656
|
: {}),
|
|
498
657
|
});
|
|
499
658
|
recordAttempt();
|
|
500
|
-
await recordAutoReleasesForRun(applied.run.results, p.env,
|
|
659
|
+
await recordAutoReleasesForRun(applied.run.results, p.env, release.runId, resolveAutoReleaseDisabled(p.config, args.noReleaseRecord), release.runOrigin);
|
|
501
660
|
const report = prReport({
|
|
502
661
|
...base,
|
|
503
662
|
approval,
|
|
@@ -505,14 +664,90 @@ export async function runComponentsPrApply(ctx: CommandContext): Promise<number>
|
|
|
505
664
|
members: applied.members,
|
|
506
665
|
...(resumed ? { resumed: resumed.completed } : {}),
|
|
507
666
|
});
|
|
508
|
-
|
|
667
|
+
// A component that stopped at a gate of its own leaves the apply waiting on a person.
|
|
668
|
+
const code = await stop(report, applied.status === "applied" ? 0 : 1, applied.run.status === "gated" ? "gated" : undefined);
|
|
509
669
|
if (applied.status === "applied") console.error(formatSuccess(`applied the plan ${report.digest} approved by ${(approval.approvedBy ?? []).join(", ")}`));
|
|
510
670
|
return code;
|
|
511
671
|
}
|
|
512
672
|
|
|
673
|
+
/** What a component's settle says in the job log. */
|
|
674
|
+
function settleWords(body: RunEventComponentSettle): string {
|
|
675
|
+
switch (body.status) {
|
|
676
|
+
case "ok":
|
|
677
|
+
return "applied";
|
|
678
|
+
case "failed":
|
|
679
|
+
return "failed";
|
|
680
|
+
case "gated":
|
|
681
|
+
return "stopped at its own gate";
|
|
682
|
+
case "waiting":
|
|
683
|
+
return "waiting on a decision";
|
|
684
|
+
case "blocked":
|
|
685
|
+
return `blocked by ${body.blockedBy ?? "a dependency"}, not run`;
|
|
686
|
+
case "already-applied":
|
|
687
|
+
return "already applied in an earlier attempt";
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* pr-apply's job log (#4007): a line on stderr as each wave starts and as
|
|
693
|
+
* each component settles, so the log shows the waves in order while they run.
|
|
694
|
+
*/
|
|
695
|
+
function applyLog(): (body: RunEventBody) => void {
|
|
696
|
+
let waves = 0;
|
|
697
|
+
return (body) => {
|
|
698
|
+
if (body.type === "run-start") waves = body.waves?.length ?? 0;
|
|
699
|
+
else if (body.type === "wave-start") console.error(formatInfo(`wave ${body.wave}${waves ? `/${waves}` : ""}: ${body.components.join(", ")}`));
|
|
700
|
+
else if (body.type === "component-settle") console.error(formatInfo(` ${body.component}: ${settleWords(body)}`));
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/** A resumed apply's gate (#3464), decided against the approved digest, as the run's `gate` phase. */
|
|
705
|
+
function emitResumedGate(events: RunEventStream | undefined, op: string, gate: string, check: GateCheck): void {
|
|
706
|
+
if (!events) return;
|
|
707
|
+
const where = { component: null, phase: GATE_PHASE, step: `gate:${gate}` };
|
|
708
|
+
events.emit({ type: "phase-start", component: null, phase: GATE_PHASE });
|
|
709
|
+
events.emit({ type: "step-start", ...where });
|
|
710
|
+
for (const body of gateEventsOf(check, { ...where, op, gate }, { durationMs: null })) events.emit(body);
|
|
711
|
+
events.emit({ type: "phase-settle", component: null, phase: GATE_PHASE, status: check.satisfied ? "ok" : "gated" });
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/** An approval by someone with no approving review (#3183) stops the apply: a `review` phase that settles `gated`. */
|
|
715
|
+
function emitReviewStop(events: RunEventStream | undefined, message: string): void {
|
|
716
|
+
if (!events) return;
|
|
717
|
+
events.emit({ type: "phase-start", component: null, phase: "review" });
|
|
718
|
+
events.emit({ type: "step-start", component: null, phase: "review", step: "review" });
|
|
719
|
+
events.emit({ type: "step-settle", component: null, phase: "review", step: "review", status: "gated", durationMs: null, message });
|
|
720
|
+
events.emit({ type: "phase-settle", component: null, phase: "review", status: "gated" });
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Store `doc` under its digest with its entries mapped onto the member's
|
|
725
|
+
* graph (`storeGateChangeSet`), and push. A failure is a warning: the gate
|
|
726
|
+
* decides the same either way.
|
|
727
|
+
*/
|
|
728
|
+
async function storeChangeSetForGate(ctx: CommandContext, p: Prepared, doc: PrPlanSet["doc"]): Promise<void> {
|
|
729
|
+
const { storeGateChangeSet, gateGraphReader } = await import("../../lifecycle/gate-change-set");
|
|
730
|
+
const { pushLifecycleReport } = await import("../../lifecycle/git");
|
|
731
|
+
const graphArgs = [
|
|
732
|
+
...(ctx.args.param ?? []).flatMap((kv) => ["--param", kv]),
|
|
733
|
+
...(ctx.args.paramsFile ? ["--params-file", ctx.args.paramsFile] : []),
|
|
734
|
+
];
|
|
735
|
+
try {
|
|
736
|
+
const stored = await storeGateChangeSet({ doc, cwd: resolve("."), at: p.head, readGraph: gateGraphReader(graphArgs) });
|
|
737
|
+
if (stored.warning) console.error(formatWarning({ message: stored.warning }));
|
|
738
|
+
// The push's own outcome is said by the gate's pending fact, or by the
|
|
739
|
+
// release records the apply writes, which push the same branch.
|
|
740
|
+
if (stored.written) await pushLifecycleReport();
|
|
741
|
+
} catch (err) {
|
|
742
|
+
console.error(formatWarning({ message: `could not store the change set ${doc.digest}: ${err instanceof Error ? err.message : String(err)}` }));
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
513
746
|
interface Resumed {
|
|
514
747
|
plan: FanOutPlan;
|
|
515
748
|
set: PrPlanSet;
|
|
749
|
+
/** The gate's decision against the approved digest. */
|
|
750
|
+
check: GateCheck;
|
|
516
751
|
approval: PrApproval;
|
|
517
752
|
completed: string[];
|
|
518
753
|
outputs: Record<string, Record<string, unknown>>;
|
|
@@ -524,8 +759,13 @@ interface Resumed {
|
|
|
524
759
|
* derivation; when its approval still stands; and when every member left is
|
|
525
760
|
* covered by the approved set. Otherwise it says why on stderr and the apply
|
|
526
761
|
* runs as it would with no record.
|
|
762
|
+
*
|
|
763
|
+
* Of the components it applied, only those whose input digest is the same
|
|
764
|
+
* now carry (#4081), as in `components fan-out --resume`. One that changed
|
|
765
|
+
* runs again, under the same approval when the approved set covers its new
|
|
766
|
+
* plan. A record without input digests carries nothing.
|
|
527
767
|
*/
|
|
528
|
-
async function tryResume(p: Prepared, attempt: FanOutAttempt, file: string, op: string): Promise<Resumed | undefined> {
|
|
768
|
+
async function tryResume(p: Prepared, attempt: FanOutAttempt, file: string, op: string, inputsNow: Record<string, string>): Promise<Resumed | undefined> {
|
|
529
769
|
const skip = (why: string): undefined => {
|
|
530
770
|
console.error(formatWarning({ message: `--resume: "${file}" does not carry: ${why}`, hint: "Every member is planned again, and the plan needs an approval of its own." }));
|
|
531
771
|
return undefined;
|
|
@@ -536,6 +776,11 @@ async function tryResume(p: Prepared, attempt: FanOutAttempt, file: string, op:
|
|
|
536
776
|
if (record.head !== p.head) return skip(`it records an apply of ${record.head.slice(0, 12)}, not ${p.head.slice(0, 12)}`);
|
|
537
777
|
if (!samePlanDigest(attempt.digest, p.plan.digest)) return skip("the change selects other components than it did");
|
|
538
778
|
if (attempt.completed.length === 0) return undefined;
|
|
779
|
+
const split = progressThatCarries(attempt, inputsNow);
|
|
780
|
+
if (split.unrecorded) return skip("it does not record what each component applied, since it was written before chant recorded component inputs");
|
|
781
|
+
for (const name of split.changed) console.error(formatInfo(`${name}: changed since the earlier attempt, so it runs again`));
|
|
782
|
+
if (split.carried.length === 0) return undefined;
|
|
783
|
+
const completed = split.carried;
|
|
539
784
|
|
|
540
785
|
let check;
|
|
541
786
|
try {
|
|
@@ -545,7 +790,7 @@ async function tryResume(p: Prepared, attempt: FanOutAttempt, file: string, op:
|
|
|
545
790
|
}
|
|
546
791
|
if (!check.satisfied) return skip(`no approval stands for the plan it applied (${record.digest}) any more`);
|
|
547
792
|
|
|
548
|
-
const outputs = Object.fromEntries(Object.entries(attempt.outputs).filter(([name]) =>
|
|
793
|
+
const outputs = Object.fromEntries(Object.entries(attempt.outputs).filter(([name]) => completed.includes(name)));
|
|
549
794
|
const resumed = await resumePrSet({
|
|
550
795
|
components: p.components,
|
|
551
796
|
plan: p.plan,
|
|
@@ -553,9 +798,9 @@ async function tryResume(p: Prepared, attempt: FanOutAttempt, file: string, op:
|
|
|
553
798
|
env: p.env,
|
|
554
799
|
seededOutputs: p.seededOutputs,
|
|
555
800
|
record,
|
|
556
|
-
completed
|
|
801
|
+
completed,
|
|
557
802
|
});
|
|
558
803
|
if (!resumed.ok) return skip(`what is left is not what was approved. ${resumed.reasons.join("; ")}`);
|
|
559
|
-
console.error(formatInfo(`resume : ${
|
|
560
|
-
return { plan: resumed.plan, set: resumed.set, approval: approvalOf(check), completed
|
|
804
|
+
console.error(formatInfo(`resume : ${completed.join(", ")} applied in an earlier attempt; applying ${resumed.plan.order.join(", ") || "nothing more"} under the approval of ${record.digest}`));
|
|
805
|
+
return { plan: resumed.plan, set: resumed.set, check, approval: approvalOf(check), completed, outputs };
|
|
561
806
|
}
|