@intentius/chant 0.124.52 → 0.124.55
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/dist/__fixtures__/estate-ledger.d.ts +13 -0
- package/dist/__fixtures__/estate-ledger.d.ts.map +1 -0
- package/dist/__fixtures__/estate-ledger.js +67 -0
- package/dist/__fixtures__/oidc-emulator.d.ts +11 -1
- package/dist/__fixtures__/oidc-emulator.d.ts.map +1 -1
- package/dist/__fixtures__/oidc-emulator.js +26 -2
- package/dist/__fixtures__/product-words.d.ts +78 -0
- package/dist/__fixtures__/product-words.d.ts.map +1 -0
- package/dist/__fixtures__/product-words.js +43 -0
- package/dist/__golden__/wave-loop/op-by-apply-after-fails.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +20 -4
- package/dist/__golden__/wave-loop/op-by-apply-ignored.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-pass.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-skip.json +10 -2
- package/dist/__golden__/wave-loop/op-discover-rest-stops.json +22 -6
- package/dist/__golden__/wave-loop/op-discover-rest.json +44 -12
- package/dist/__golden__/wave-loop/op-discover-wide.json +12 -3
- package/dist/__golden__/wave-loop/op-held-on.json +28 -7
- package/dist/__golden__/wave-loop/op-hooks-apply-fails.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-fail-after-apply.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-fail-before-apply.json +4 -2
- package/dist/__golden__/wave-loop/op-hooks-held.json +26 -8
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +18 -4
- package/dist/__golden__/wave-loop/op-hooks-pass.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-share.json +20 -7
- package/dist/__golden__/wave-loop/op-outcome-held.json +12 -3
- package/dist/__golden__/wave-loop/op-outcome-replan-approved.json +16 -5
- package/dist/__golden__/wave-loop/op-outcome-replan-forever.json +48 -21
- package/dist/__golden__/wave-loop/op-outcome-replan.json +16 -5
- package/dist/__golden__/wave-loop/op-outcome-stood-down.json +12 -3
- package/dist/__golden__/wave-loop/op-outcome-unreadable.json +12 -3
- package/dist/__golden__/wave-loop/op-overridden.json +28 -7
- package/dist/__golden__/wave-loop/op-per-run.json +20 -4
- package/dist/__golden__/wave-loop/op-point.json +18 -4
- package/dist/__golden__/wave-loop/op-pr-review.json +10 -2
- package/dist/__golden__/wave-loop/op-spend-change-only.json +10 -2
- package/dist/__golden__/wave-loop/op-spend.json +10 -2
- package/dist/__golden__/wave-loop/op-wave-commands.json +56 -13
- package/dist/__golden__/wave-loop/op-wide.json +20 -4
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/discover.js +3 -1
- package/dist/behaviour.d.ts +1 -1
- package/dist/behaviour.d.ts.map +1 -1
- package/dist/bucket-check/azure.d.ts +108 -0
- package/dist/bucket-check/azure.d.ts.map +1 -0
- package/dist/bucket-check/azure.js +258 -0
- package/dist/bucket-check/fixtures/azure.json +153 -0
- package/dist/bucket-check/fixtures/gcs.json +148 -0
- package/dist/bucket-check/fixtures/s3.json +277 -0
- package/dist/bucket-check/gcs.d.ts +77 -0
- package/dist/bucket-check/gcs.d.ts.map +1 -0
- package/dist/bucket-check/gcs.js +202 -0
- package/dist/bucket-check/index.d.ts +48 -0
- package/dist/bucket-check/index.d.ts.map +1 -0
- package/dist/bucket-check/index.js +44 -0
- package/dist/bucket-check/s3.d.ts +116 -0
- package/dist/bucket-check/s3.d.ts.map +1 -0
- package/dist/bucket-check/s3.js +362 -0
- package/dist/bucket-check/types.d.ts +66 -0
- package/dist/bucket-check/types.d.ts.map +1 -0
- package/dist/bucket-check/types.js +31 -0
- package/dist/bucket-check/wire.d.ts +27 -0
- package/dist/bucket-check/wire.d.ts.map +1 -0
- package/dist/bucket-check/wire.js +32 -0
- package/dist/bucket-check.d.ts +6 -0
- package/dist/bucket-check.d.ts.map +1 -0
- package/dist/bucket-check.js +5 -0
- package/dist/capabilities/templates.d.ts +65 -0
- package/dist/capabilities/templates.d.ts.map +1 -0
- package/dist/capabilities/templates.js +192 -0
- package/dist/capabilities/templates.json +145 -0
- package/dist/change-set-graph.d.ts +35 -3
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +60 -9
- package/dist/change-set.d.ts +65 -7
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +22 -12
- package/dist/ci-agent.d.ts +381 -0
- package/dist/ci-agent.d.ts.map +1 -0
- package/dist/ci-agent.js +833 -0
- package/dist/ci-control.d.ts +42 -0
- package/dist/ci-control.d.ts.map +1 -0
- package/dist/ci-control.js +42 -0
- package/dist/ci-estate/delivery.d.ts +137 -0
- package/dist/ci-estate/delivery.d.ts.map +1 -0
- package/dist/ci-estate/delivery.js +311 -0
- package/dist/ci-estate/overdue.d.ts +34 -0
- package/dist/ci-estate/overdue.d.ts.map +1 -0
- package/dist/ci-estate/overdue.js +58 -0
- package/dist/ci-estate/page.d.ts +134 -0
- package/dist/ci-estate/page.d.ts.map +1 -0
- package/dist/ci-estate/page.js +233 -0
- package/dist/ci-estate/rows.d.ts +118 -0
- package/dist/ci-estate/rows.d.ts.map +1 -0
- package/dist/ci-estate/rows.js +126 -0
- package/dist/ci-estate.d.ts +68 -0
- package/dist/ci-estate.d.ts.map +1 -0
- package/dist/ci-estate.js +83 -0
- package/dist/ci-handover.d.ts +29 -5
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +50 -16
- package/dist/ci-identity.d.ts +89 -9
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +91 -16
- package/dist/ci-product-words.d.ts +290 -0
- package/dist/ci-product-words.d.ts.map +1 -0
- package/dist/ci-product-words.js +373 -0
- package/dist/ci-product.d.ts +82 -0
- package/dist/ci-product.d.ts.map +1 -0
- package/dist/ci-product.js +78 -0
- package/dist/cli/commands/audit.d.ts +2 -2
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +3 -2
- package/dist/cli/commands/carve.js +2 -2
- package/dist/cli/commands/import-index.d.ts +52 -0
- package/dist/cli/commands/import-index.d.ts.map +1 -0
- package/dist/cli/commands/import-index.js +226 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +4 -2
- package/dist/cli/handlers/agent.d.ts +17 -0
- package/dist/cli/handlers/agent.d.ts.map +1 -0
- package/dist/cli/handlers/agent.js +114 -0
- package/dist/cli/handlers/approve-confirm.d.ts +84 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -0
- package/dist/cli/handlers/approve-confirm.js +142 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +19 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +43 -1
- package/dist/cli/handlers/ci-check.d.ts +3 -0
- package/dist/cli/handlers/ci-check.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check.js +34 -0
- package/dist/cli/handlers/ci-forge-check.d.ts +3 -0
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -0
- package/dist/cli/handlers/ci-forge-check.js +89 -0
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +11 -2
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +20 -3
- package/dist/cli/handlers/gate-pending.d.ts +11 -0
- package/dist/cli/handlers/gate-pending.d.ts.map +1 -0
- package/dist/cli/handlers/gate-pending.js +44 -0
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +22 -4
- package/dist/cli/handlers/index-cloud.d.ts +14 -0
- package/dist/cli/handlers/index-cloud.d.ts.map +1 -0
- package/dist/cli/handlers/index-cloud.js +22 -0
- package/dist/cli/handlers/index-diff.d.ts +18 -0
- package/dist/cli/handlers/index-diff.d.ts.map +1 -0
- package/dist/cli/handlers/index-diff.js +142 -0
- package/dist/cli/handlers/init.d.ts.map +1 -1
- package/dist/cli/handlers/init.js +1 -0
- package/dist/cli/handlers/ledger.js +1 -1
- package/dist/cli/handlers/lifecycle-drift.d.ts +29 -0
- package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-drift.js +69 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +188 -28
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +64 -5
- package/dist/cli/handlers/misc.d.ts +9 -0
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/misc.js +77 -0
- package/dist/cli/handlers/notify-relay.d.ts +15 -0
- package/dist/cli/handlers/notify-relay.d.ts.map +1 -0
- package/dist/cli/handlers/notify-relay.js +130 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +42 -11
- package/dist/cli/handlers/pr.d.ts +38 -3
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +668 -207
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +110 -17
- package/dist/cli/handlers/query.d.ts.map +1 -1
- package/dist/cli/handlers/query.js +28 -4
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +3 -0
- package/dist/cli/handlers/run-wave.d.ts +8 -0
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +71 -1
- package/dist/cli/handlers/run.d.ts +6 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +86 -1
- package/dist/cli/handlers/scenario.d.ts.map +1 -1
- package/dist/cli/handlers/scenario.js +8 -7
- package/dist/cli/handlers/search.d.ts +34 -4
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +216 -36
- package/dist/cli/handlers/serve.d.ts.map +1 -1
- package/dist/cli/handlers/serve.js +10 -1
- package/dist/cli/main.d.ts +11 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +179 -14
- package/dist/cli/mcp/ledger-tools.d.ts +36 -0
- package/dist/cli/mcp/ledger-tools.d.ts.map +1 -0
- package/dist/cli/mcp/ledger-tools.js +122 -0
- package/dist/cli/mcp/lifecycle-tools.d.ts.map +1 -1
- package/dist/cli/mcp/lifecycle-tools.js +3 -2
- package/dist/cli/mcp/product-tools.d.ts +78 -0
- package/dist/cli/mcp/product-tools.d.ts.map +1 -0
- package/dist/cli/mcp/product-tools.js +93 -0
- package/dist/cli/mcp/read-only.d.ts +34 -0
- package/dist/cli/mcp/read-only.d.ts.map +1 -0
- package/dist/cli/mcp/read-only.js +61 -0
- package/dist/cli/mcp/report-tools.d.ts +48 -0
- package/dist/cli/mcp/report-tools.d.ts.map +1 -0
- package/dist/cli/mcp/report-tools.js +128 -0
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/resource-handlers.js +4 -3
- package/dist/cli/mcp/server.d.ts +28 -1
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/server.js +86 -15
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/mcp-config.d.ts +9 -2
- package/dist/cli/mcp-config.d.ts.map +1 -1
- package/dist/cli/mcp-config.js +8 -3
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +112 -5
- package/dist/cli/registry.d.ts +54 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/aws.d.ts +35 -0
- package/dist/cloud-lister/aws.d.ts.map +1 -0
- package/dist/cloud-lister/aws.js +203 -0
- package/dist/cloud-lister/azure.d.ts +34 -0
- package/dist/cloud-lister/azure.d.ts.map +1 -0
- package/dist/cloud-lister/azure.js +129 -0
- package/dist/cloud-lister/common.d.ts +40 -0
- package/dist/cloud-lister/common.d.ts.map +1 -0
- package/dist/cloud-lister/common.js +83 -0
- package/dist/cloud-lister/credentials.d.ts +50 -0
- package/dist/cloud-lister/credentials.d.ts.map +1 -0
- package/dist/cloud-lister/credentials.js +86 -0
- package/dist/cloud-lister/fakes.d.ts +27 -0
- package/dist/cloud-lister/fakes.d.ts.map +1 -0
- package/dist/cloud-lister/fakes.js +50 -0
- package/dist/cloud-lister/gcp.d.ts +42 -0
- package/dist/cloud-lister/gcp.d.ts.map +1 -0
- package/dist/cloud-lister/gcp.js +143 -0
- package/dist/cloud-lister/guard.d.ts +49 -0
- package/dist/cloud-lister/guard.d.ts.map +1 -0
- package/dist/cloud-lister/guard.js +103 -0
- package/dist/cloud-lister/ids.d.ts +23 -0
- package/dist/cloud-lister/ids.d.ts.map +1 -0
- package/dist/cloud-lister/ids.js +42 -0
- package/dist/cloud-lister/index.d.ts +67 -0
- package/dist/cloud-lister/index.d.ts.map +1 -0
- package/dist/cloud-lister/index.js +102 -0
- package/dist/cloud-lister/kubernetes.d.ts +64 -0
- package/dist/cloud-lister/kubernetes.d.ts.map +1 -0
- package/dist/cloud-lister/kubernetes.js +276 -0
- package/dist/cloud-lister/markers.d.ts +31 -0
- package/dist/cloud-lister/markers.d.ts.map +1 -0
- package/dist/cloud-lister/markers.js +73 -0
- package/dist/cloud-lister/mask.d.ts +31 -0
- package/dist/cloud-lister/mask.d.ts.map +1 -0
- package/dist/cloud-lister/mask.js +74 -0
- package/dist/cloud-lister/sigv4.d.ts +64 -0
- package/dist/cloud-lister/sigv4.d.ts.map +1 -0
- package/dist/cloud-lister/sigv4.js +104 -0
- package/dist/cloud-lister/transport.d.ts +55 -0
- package/dist/cloud-lister/transport.d.ts.map +1 -0
- package/dist/cloud-lister/transport.js +86 -0
- package/dist/cloud-lister/types.d.ts +121 -0
- package/dist/cloud-lister/types.d.ts.map +1 -0
- package/dist/cloud-lister/types.js +24 -0
- package/dist/components/adoption.d.ts +69 -0
- package/dist/components/adoption.d.ts.map +1 -0
- package/dist/components/adoption.js +93 -0
- package/dist/components/apply-lease.d.ts +19 -0
- package/dist/components/apply-lease.d.ts.map +1 -0
- package/dist/components/apply-lease.js +41 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.js +6 -0
- package/dist/components/capability-plugin.d.ts +9 -0
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/capability.d.ts +337 -5
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +14 -6
- package/dist/components/check-hooks.d.ts +113 -0
- package/dist/components/check-hooks.d.ts.map +1 -0
- package/dist/components/check-hooks.js +192 -0
- package/dist/components/ci-services.d.ts +57 -0
- package/dist/components/ci-services.d.ts.map +1 -0
- package/dist/components/ci-services.js +61 -0
- package/dist/components/cli-support.d.ts +34 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +67 -15
- package/dist/components/declared-reads.d.ts +38 -0
- package/dist/components/declared-reads.d.ts.map +1 -0
- package/dist/components/declared-reads.js +131 -0
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/deploy-units.js +4 -0
- package/dist/components/driver.d.ts +54 -4
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +90 -7
- package/dist/components/fan-out-run.d.ts +35 -1
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +138 -30
- package/dist/components/fan-out-support.d.ts +6 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out-support.js +4 -1
- package/dist/components/fan-out.d.ts +28 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/groups.d.ts +229 -0
- package/dist/components/groups.d.ts.map +1 -0
- package/dist/components/groups.js +777 -0
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/plan-shape-conformance.d.ts +48 -0
- package/dist/components/plan-shape-conformance.d.ts.map +1 -0
- package/dist/components/plan-shape-conformance.js +122 -0
- package/dist/components/pr-env-ledger.d.ts +32 -0
- package/dist/components/pr-env-ledger.d.ts.map +1 -0
- package/dist/components/pr-env-ledger.js +39 -0
- package/dist/components/pr-env-ports.d.ts +12 -0
- package/dist/components/pr-env-ports.d.ts.map +1 -1
- package/dist/components/pr-env-ports.js +13 -3
- package/dist/components/pr-env-run.d.ts +6 -0
- package/dist/components/pr-env-run.d.ts.map +1 -1
- package/dist/components/pr-env-run.js +3 -2
- package/dist/components/pr-environment.d.ts +31 -3
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +25 -7
- package/dist/components/pr-pipeline.d.ts +169 -3
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +184 -9
- package/dist/components/pr-policy.d.ts +26 -2
- package/dist/components/pr-policy.d.ts.map +1 -1
- package/dist/components/pr-policy.js +41 -7
- package/dist/components/pr-run.d.ts +104 -4
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +290 -41
- package/dist/components/pr-targets.d.ts +24 -0
- package/dist/components/pr-targets.d.ts.map +1 -0
- package/dist/components/pr-targets.js +48 -0
- package/dist/components/product-pipeline.d.ts +217 -0
- package/dist/components/product-pipeline.d.ts.map +1 -0
- package/dist/components/product-pipeline.js +193 -0
- package/dist/components/promote-rounds.d.ts +9 -0
- package/dist/components/promote-rounds.d.ts.map +1 -1
- package/dist/components/promote-rounds.js +23 -2
- package/dist/components/promote.d.ts +23 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +39 -6
- package/dist/components/release-compile.d.ts +22 -1
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +85 -0
- package/dist/components/release-gate.d.ts +23 -1
- package/dist/components/release-gate.d.ts.map +1 -1
- package/dist/components/release-gate.js +97 -33
- package/dist/components/release-promote.d.ts +15 -1
- package/dist/components/release-promote.d.ts.map +1 -1
- package/dist/components/release-promote.js +67 -2
- package/dist/components/repo-lock.d.ts +27 -0
- package/dist/components/repo-lock.d.ts.map +1 -0
- package/dist/components/repo-lock.js +49 -0
- package/dist/components/row-lease.d.ts +84 -0
- package/dist/components/row-lease.d.ts.map +1 -0
- package/dist/components/row-lease.js +110 -0
- package/dist/components/run-groups.d.ts +58 -0
- package/dist/components/run-groups.d.ts.map +1 -0
- package/dist/components/run-groups.js +78 -0
- package/dist/components/starter-plugin.d.ts +1 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/starter-plugin.js +6 -1
- package/dist/components/verbs/index.d.ts +1 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/index.js +1 -0
- package/dist/components/verbs/member-outputs.d.ts +187 -0
- package/dist/components/verbs/member-outputs.d.ts.map +1 -0
- package/dist/components/verbs/member-outputs.js +218 -0
- package/dist/components/wave-plan.d.ts +34 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +54 -2
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +27 -0
- package/dist/control/applied.d.ts +89 -0
- package/dist/control/applied.d.ts.map +1 -0
- package/dist/control/applied.js +175 -0
- package/dist/control/consumers.d.ts +78 -0
- package/dist/control/consumers.d.ts.map +1 -0
- package/dist/control/consumers.js +172 -0
- package/dist/control/dispatch.d.ts +334 -0
- package/dist/control/dispatch.d.ts.map +1 -0
- package/dist/control/dispatch.js +519 -0
- package/dist/control/edges.d.ts +75 -0
- package/dist/control/edges.d.ts.map +1 -0
- package/dist/control/edges.js +133 -0
- package/dist/control/reconcile.d.ts +120 -0
- package/dist/control/reconcile.d.ts.map +1 -0
- package/dist/control/reconcile.js +178 -0
- package/dist/control/records.d.ts +187 -0
- package/dist/control/records.d.ts.map +1 -0
- package/dist/control/records.js +307 -0
- package/dist/deep-observation.d.ts +1 -13
- package/dist/deep-observation.d.ts.map +1 -1
- package/dist/deep-observation.js +5 -22
- package/dist/discovery/sandbox/bundle.d.ts.map +1 -1
- package/dist/discovery/sandbox/bundle.js +25 -1
- package/dist/drift-record.d.ts +542 -0
- package/dist/drift-record.d.ts.map +1 -0
- package/dist/drift-record.js +886 -0
- package/dist/engine-facts.d.ts +144 -0
- package/dist/engine-facts.d.ts.map +1 -0
- package/dist/engine-facts.js +13 -0
- package/dist/exit-codes.d.ts +48 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +49 -0
- package/dist/forge-check/check.d.ts +63 -0
- package/dist/forge-check/check.d.ts.map +1 -0
- package/dist/forge-check/check.js +139 -0
- package/dist/forge-check/contract.d.ts +152 -0
- package/dist/forge-check/contract.d.ts.map +1 -0
- package/dist/forge-check/contract.js +118 -0
- package/dist/forge-check/forge.d.ts +42 -0
- package/dist/forge-check/forge.d.ts.map +1 -0
- package/dist/forge-check/forge.js +338 -0
- package/dist/forge-check/index.d.ts +24 -0
- package/dist/forge-check/index.d.ts.map +1 -0
- package/dist/forge-check/index.js +23 -0
- package/dist/forge-check/pulumi.d.ts +44 -0
- package/dist/forge-check/pulumi.d.ts.map +1 -0
- package/dist/forge-check/pulumi.js +184 -0
- package/dist/forge-check/read-only.d.ts +26 -0
- package/dist/forge-check/read-only.d.ts.map +1 -0
- package/dist/forge-check/read-only.js +53 -0
- package/dist/forge-check/trust.d.ts +94 -0
- package/dist/forge-check/trust.d.ts.map +1 -0
- package/dist/forge-check/trust.js +532 -0
- package/dist/forge-check/types.d.ts +80 -0
- package/dist/forge-check/types.d.ts.map +1 -0
- package/dist/forge-check/types.js +18 -0
- package/dist/forge-check.d.ts +6 -0
- package/dist/forge-check.d.ts.map +1 -0
- package/dist/forge-check.js +5 -0
- package/dist/gate-decision.d.ts +1 -0
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +2 -0
- package/dist/gate-policy.d.ts +47 -1
- package/dist/gate-policy.d.ts.map +1 -1
- package/dist/gate-policy.js +50 -2
- package/dist/graph-ir.d.ts +153 -2
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ir.js +224 -6
- package/dist/graph-refs.d.ts +145 -0
- package/dist/graph-refs.d.ts.map +1 -1
- package/dist/graph-refs.js +305 -0
- package/dist/graph-schema/fixtures/adopt.json +15 -0
- package/dist/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/dist/graph-schema/fixtures/index.json +68 -0
- package/dist/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/dist/graph-schema/fixtures.d.ts +23 -0
- package/dist/graph-schema/fixtures.d.ts.map +1 -0
- package/dist/graph-schema/fixtures.js +246 -0
- package/dist/graph-schema/generate.d.ts +15 -0
- package/dist/graph-schema/generate.d.ts.map +1 -0
- package/dist/graph-schema/generate.js +267 -0
- package/dist/graph-schema/graph.schema.json +1387 -0
- package/dist/health.schema.json +2 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/instance-nodes.d.ts +159 -0
- package/dist/instance-nodes.d.ts.map +1 -0
- package/dist/instance-nodes.js +231 -0
- package/dist/lexicon.d.ts +178 -6
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.d.ts +80 -0
- package/dist/lifecycle/adoption-file.d.ts.map +1 -0
- package/dist/lifecycle/adoption-file.js +122 -0
- package/dist/lifecycle/cloud-index.d.ts +186 -0
- package/dist/lifecycle/cloud-index.d.ts.map +1 -0
- package/dist/lifecycle/cloud-index.js +617 -0
- package/dist/lifecycle/derive-edges.d.ts +59 -0
- package/dist/lifecycle/derive-edges.d.ts.map +1 -0
- package/dist/lifecycle/derive-edges.js +126 -0
- package/dist/lifecycle/gate-applied.d.ts +6 -0
- package/dist/lifecycle/gate-applied.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +29 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +11 -1
- package/dist/lifecycle/gate-pending-by-plan.d.ts +75 -0
- package/dist/lifecycle/gate-pending-by-plan.d.ts.map +1 -0
- package/dist/lifecycle/gate-pending-by-plan.js +96 -0
- package/dist/lifecycle/gated-request-digest.d.ts +28 -0
- package/dist/lifecycle/gated-request-digest.d.ts.map +1 -0
- package/dist/lifecycle/gated-request-digest.js +35 -0
- package/dist/lifecycle/gated-request.d.ts +126 -0
- package/dist/lifecycle/gated-request.d.ts.map +1 -0
- package/dist/lifecycle/gated-request.js +205 -0
- package/dist/lifecycle/git.d.ts +10 -9
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +7 -1
- package/dist/lifecycle/identity-match.d.ts +148 -0
- package/dist/lifecycle/identity-match.d.ts.map +1 -0
- package/dist/lifecycle/identity-match.js +152 -0
- package/dist/lifecycle/index-diff.d.ts +264 -0
- package/dist/lifecycle/index-diff.d.ts.map +1 -0
- package/dist/lifecycle/index-diff.js +326 -0
- package/dist/lifecycle/index-document.d.ts +130 -0
- package/dist/lifecycle/index-document.d.ts.map +1 -0
- package/dist/lifecycle/index-document.js +188 -0
- package/dist/lifecycle/index-drift.d.ts +121 -0
- package/dist/lifecycle/index-drift.d.ts.map +1 -0
- package/dist/lifecycle/index-drift.js +178 -0
- package/dist/lifecycle/index-import.d.ts +171 -0
- package/dist/lifecycle/index-import.d.ts.map +1 -0
- package/dist/lifecycle/index-import.js +512 -0
- package/dist/lifecycle/index-join.d.ts +129 -0
- package/dist/lifecycle/index-join.d.ts.map +1 -0
- package/dist/lifecycle/index-join.js +248 -0
- 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/ledger-read.d.ts.map +1 -1
- package/dist/lifecycle/ledger-read.js +7 -3
- package/dist/lifecycle/lock-rows.d.ts +76 -0
- package/dist/lifecycle/lock-rows.d.ts.map +1 -0
- package/dist/lifecycle/lock-rows.js +140 -0
- package/dist/lifecycle/observation-baseline.d.ts +61 -21
- package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
- package/dist/lifecycle/observation-baseline.js +144 -19
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/observe.js +6 -1
- package/dist/lifecycle/query.d.ts +94 -6
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +182 -9
- package/dist/lifecycle/release-catalog-site.d.ts +66 -0
- package/dist/lifecycle/release-catalog-site.d.ts.map +1 -0
- package/dist/lifecycle/release-catalog-site.js +232 -0
- package/dist/lifecycle/release-catalog.d.ts +201 -0
- package/dist/lifecycle/release-catalog.d.ts.map +1 -0
- package/dist/lifecycle/release-catalog.js +198 -0
- package/dist/lifecycle/release-changelog.d.ts +41 -0
- package/dist/lifecycle/release-changelog.d.ts.map +1 -0
- package/dist/lifecycle/release-changelog.js +38 -0
- package/dist/lifecycle/release-cut.d.ts +1 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +1 -1
- package/dist/lifecycle/release-ledger.d.ts +16 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +10 -0
- package/dist/lifecycle/release-publish.d.ts +43 -22
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-read.d.ts.map +1 -1
- package/dist/lifecycle/release-read.js +3 -0
- package/dist/lifecycle/release-status.d.ts +86 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -0
- package/dist/lifecycle/release-status.js +136 -0
- package/dist/lifecycle/replay.d.ts +10 -3
- package/dist/lifecycle/replay.d.ts.map +1 -1
- package/dist/lifecycle/replay.js +10 -6
- package/dist/lifecycle/resource-lock.d.ts +120 -0
- package/dist/lifecycle/resource-lock.d.ts.map +1 -0
- package/dist/lifecycle/resource-lock.js +317 -0
- package/dist/lifecycle/retention.d.ts.map +1 -1
- package/dist/lifecycle/retention.js +3 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +9 -1
- package/dist/lifecycle/scenario.d.ts +4 -3
- package/dist/lifecycle/scenario.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store-fake.d.ts +9 -0
- package/dist/lifecycle/snapshot-store-fake.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-fake.js +21 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts +135 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-s3.js +219 -0
- package/dist/lifecycle/snapshot-store.d.ts +170 -0
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store.js +831 -0
- package/dist/lifecycle/snapshot.d.ts +11 -0
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.js +18 -5
- package/dist/lifecycle/target-lock.d.ts +15 -0
- package/dist/lifecycle/target-lock.d.ts.map +1 -1
- package/dist/lifecycle/target-lock.js +25 -10
- package/dist/lifecycle/type-listing.d.ts +148 -0
- package/dist/lifecycle/type-listing.d.ts.map +1 -0
- package/dist/lifecycle/type-listing.js +166 -0
- package/dist/lint/component-checks.d.ts +15 -1
- package/dist/lint/component-checks.d.ts.map +1 -1
- package/dist/lint/component-checks.js +1 -0
- package/dist/lint/presets/relaxed.json +2 -1
- package/dist/lint/presets/strict.json +2 -1
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.js +13 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.js +8 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts +33 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.js +123 -0
- package/dist/lint/rules/comp/index.d.ts +2 -1
- package/dist/lint/rules/comp/index.d.ts.map +1 -1
- package/dist/lint/rules/comp/index.js +4 -1
- package/dist/mcp/types.d.ts +7 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/notify-product.d.ts +43 -0
- package/dist/notify-product.d.ts.map +1 -0
- package/dist/notify-product.js +58 -0
- package/dist/notify-relay.d.ts +197 -0
- package/dist/notify-relay.d.ts.map +1 -0
- package/dist/notify-relay.js +321 -0
- package/dist/notify.d.ts +44 -4
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +77 -14
- package/dist/object-store/azure-blob.d.ts +129 -0
- package/dist/object-store/azure-blob.d.ts.map +1 -0
- package/dist/object-store/azure-blob.js +341 -0
- package/dist/object-store/common.d.ts +108 -0
- package/dist/object-store/common.d.ts.map +1 -0
- package/dist/object-store/common.js +80 -0
- package/dist/object-store/errors.d.ts +28 -0
- package/dist/object-store/errors.d.ts.map +1 -0
- package/dist/object-store/errors.js +21 -0
- package/dist/object-store/from-env.d.ts +18 -0
- package/dist/object-store/from-env.d.ts.map +1 -0
- package/dist/object-store/from-env.js +22 -0
- package/dist/object-store/gcs.d.ts +106 -0
- package/dist/object-store/gcs.d.ts.map +1 -0
- package/dist/object-store/gcs.js +393 -0
- package/dist/object-store/index.d.ts +9 -0
- package/dist/object-store/index.d.ts.map +1 -0
- package/dist/object-store/index.js +8 -0
- package/dist/object-store/s3.d.ts +146 -0
- package/dist/object-store/s3.d.ts.map +1 -0
- package/dist/object-store/s3.js +306 -0
- package/dist/observation.d.ts +19 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +18 -1
- package/dist/op/activities/activity-contracts.d.ts +1 -1
- package/dist/op/activities/activity-contracts.js +1 -1
- package/dist/op/activities/change-set.d.ts +6 -4
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +4 -2
- package/dist/op/activities/converge.d.ts.map +1 -1
- package/dist/op/activities/converge.js +2 -1
- package/dist/op/activities/index.d.ts +1 -1
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/index.js +1 -1
- package/dist/op/activities/review-agent.d.ts +55 -2
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +65 -5
- package/dist/op/activity-failure.d.ts +27 -0
- package/dist/op/activity-failure.d.ts.map +1 -1
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/gate.d.ts +29 -1
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +59 -23
- package/dist/op/generate-pipeline.d.ts.map +1 -1
- package/dist/op/generate-pipeline.js +7 -1
- package/dist/op/index.d.ts +14 -2
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +8 -2
- package/dist/op/local-executor.d.ts +5 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +22 -8
- package/dist/op/op-waves-after-plan.d.ts +137 -0
- package/dist/op/op-waves-after-plan.d.ts.map +1 -0
- package/dist/op/op-waves-after-plan.js +163 -0
- package/dist/op/op-waves-capability-spec.d.ts +55 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -0
- package/dist/op/op-waves-capability-spec.js +94 -0
- package/dist/op/op-waves-capability.d.ts +197 -0
- package/dist/op/op-waves-capability.d.ts.map +1 -0
- package/dist/op/op-waves-capability.js +311 -0
- package/dist/op/op-waves-events.d.ts +54 -0
- package/dist/op/op-waves-events.d.ts.map +1 -0
- package/dist/op/op-waves-events.js +122 -0
- package/dist/op/op-waves-notify.d.ts +7 -1
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +35 -16
- package/dist/op/op-waves-release-port.d.ts +18 -0
- package/dist/op/op-waves-release-port.d.ts.map +1 -0
- package/dist/op/op-waves-release-port.js +61 -0
- package/dist/op/op-waves-release.d.ts +92 -0
- package/dist/op/op-waves-release.d.ts.map +1 -0
- package/dist/op/op-waves-release.js +97 -0
- package/dist/op/op-waves-run.d.ts +175 -4
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +981 -41
- package/dist/op/op-waves-stand-down.d.ts +60 -0
- package/dist/op/op-waves-stand-down.d.ts.map +1 -0
- package/dist/op/op-waves-stand-down.js +97 -0
- package/dist/op/op-waves.d.ts +152 -8
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +161 -17
- package/dist/op/runtime.d.ts +91 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +19 -0
- package/dist/op/stage-hooks.d.ts +45 -7
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +61 -3
- package/dist/op/steward-beside.d.ts.map +1 -1
- package/dist/op/steward-beside.js +2 -1
- package/dist/op/types.d.ts +2 -2
- package/dist/op/types.d.ts.map +1 -1
- package/dist/op/types.js +3 -2
- package/dist/otlp-metrics.d.ts +38 -0
- package/dist/otlp-metrics.d.ts.map +1 -0
- package/dist/otlp-metrics.js +82 -0
- package/dist/otlp.d.ts +249 -0
- package/dist/otlp.d.ts.map +1 -0
- package/dist/otlp.js +426 -0
- package/dist/override-gate.d.ts.map +1 -1
- package/dist/override-gate.js +5 -0
- package/dist/policy-packs.d.ts +69 -0
- package/dist/policy-packs.d.ts.map +1 -0
- package/dist/policy-packs.js +205 -0
- package/dist/policy-source.d.ts +51 -0
- package/dist/policy-source.d.ts.map +1 -0
- package/dist/policy-source.js +103 -0
- package/dist/pr-forge.d.ts +40 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +92 -0
- package/dist/pr-loop.d.ts +205 -12
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +330 -41
- package/dist/pr-post.d.ts +16 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +26 -1
- package/dist/pr-report-url.d.ts +32 -4
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +46 -5
- package/dist/pr-requires.d.ts +13 -2
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +14 -0
- package/dist/pulumi-urn.d.ts +101 -0
- package/dist/pulumi-urn.d.ts.map +1 -0
- package/dist/pulumi-urn.js +131 -0
- package/dist/release-floors.d.ts +23 -0
- package/dist/release-floors.d.ts.map +1 -0
- package/dist/release-floors.js +22 -0
- package/dist/run-event.d.ts +26 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +4 -1
- package/dist/sensitive-key.d.ts +23 -0
- package/dist/sensitive-key.d.ts.map +1 -0
- package/dist/sensitive-key.js +31 -0
- package/dist/sorted-json.d.ts +10 -0
- package/dist/sorted-json.d.ts.map +1 -0
- package/dist/sorted-json.js +14 -0
- package/dist/terraform/credentials.d.ts +59 -0
- package/dist/terraform/credentials.d.ts.map +1 -0
- package/dist/terraform/credentials.js +149 -0
- package/dist/utils.d.ts +1 -4
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -9
- package/dist/wave-runtime.d.ts +1 -1
- package/dist/wave-runtime.js +2 -2
- package/dist/wave-runtime.mjs +390 -285
- package/dist/workspace/adoption-report.d.ts +53 -0
- package/dist/workspace/adoption-report.d.ts.map +1 -0
- package/dist/workspace/adoption-report.js +76 -0
- package/dist/workspace/capabilities-contract.d.ts +7 -0
- package/dist/workspace/capabilities-contract.d.ts.map +1 -1
- package/dist/workspace/capabilities-contract.js +2 -1
- package/dist/workspace/capabilities.schema.json +98 -0
- package/dist/workspace/change-set.schema.json +42 -3
- package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -1
- package/dist/workspace/chant-migrations/chud-lexicon-exit.js +4 -1
- package/dist/workspace/ci-cloud-identity.d.ts +13 -1
- package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
- package/dist/workspace/ci-cloud-identity.js +30 -1
- package/dist/workspace/ci-lock-grain.d.ts +12 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -0
- package/dist/workspace/ci-lock-grain.js +27 -0
- package/dist/workspace/ci-run.d.ts +2 -1
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +6 -3
- package/dist/workspace/compose-graph.d.ts +10 -1
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +6 -1
- package/dist/workspace/conformance/index.d.ts +1 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/index.js +6 -1
- package/dist/workspace/declaration.d.ts +16 -4
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +5 -2
- package/dist/workspace/declaration.schema.json +27 -3
- package/dist/workspace/drift-cli.d.ts +81 -0
- package/dist/workspace/drift-cli.d.ts.map +1 -0
- package/dist/workspace/drift-cli.js +322 -0
- package/dist/workspace/drift.schema.json +672 -0
- package/dist/workspace/exit-cli.d.ts +1 -1
- package/dist/workspace/exit-cli.d.ts.map +1 -1
- package/dist/workspace/exit-cli.js +2 -1
- package/dist/workspace/graph-cli.d.ts +2 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +3 -0
- package/dist/workspace/graph.schema.json +72 -0
- package/dist/workspace/import-fetch.d.ts +4 -2
- package/dist/workspace/import-fetch.d.ts.map +1 -1
- package/dist/workspace/import-fetch.js +4 -2
- package/dist/workspace/import-init.d.ts.map +1 -1
- package/dist/workspace/import-init.js +4 -2
- package/dist/workspace/init.d.ts +5 -1
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +55 -9
- package/dist/workspace/ledger.schema.json +7 -3
- package/dist/workspace/lineage-upgrade-cli.d.ts +1 -1
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade-cli.js +2 -1
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +125 -5
- package/dist/workspace/promote-waves.d.ts +112 -0
- package/dist/workspace/promote-waves.d.ts.map +1 -0
- package/dist/workspace/promote-waves.js +290 -0
- package/dist/workspace/promote.d.ts +85 -3
- package/dist/workspace/promote.d.ts.map +1 -1
- package/dist/workspace/promote.js +349 -62
- package/dist/workspace/reason-codes.d.ts +12 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +14 -0
- package/dist/workspace/records-cli.d.ts +2 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +3 -2
- package/dist/workspace/release-catalog.schema.json +277 -0
- package/dist/workspace/run-event.schema.json +18 -1
- package/dist/workspace/search-contract.d.ts +3 -3
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/search-contract.js +2 -0
- package/dist/workspace/search.schema.json +103 -5
- package/dist/workspace/work-cli.d.ts +3 -1
- package/dist/workspace/work-cli.d.ts.map +1 -1
- package/dist/workspace/work-cli.js +7 -2
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +34 -1
- package/src/__fixtures__/drift-record/README.md +58 -0
- package/src/__fixtures__/drift-record/choudoufu-cone.ndjson +4 -0
- package/src/__fixtures__/drift-record/choudoufu-resource.ndjson +3 -0
- package/src/__fixtures__/drift-record/component-status-ledger.json +65 -0
- package/src/__fixtures__/drift-record/component-status.json +91 -0
- package/src/__fixtures__/drift-record/deep-diff.json +259 -0
- package/src/__fixtures__/drift-record/lifecycle-diff-live.json +825 -0
- package/src/__fixtures__/drift-record/live-diff.json +125 -0
- package/src/__fixtures__/estate-ledger.ts +101 -0
- package/src/__fixtures__/oidc-emulator.ts +31 -2
- package/src/__fixtures__/product-words.ts +44 -0
- package/src/__golden__/wave-loop/op-by-apply-after-fails.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-hold.json +20 -4
- package/src/__golden__/wave-loop/op-by-apply-ignored.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-pass.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-skip.json +10 -2
- package/src/__golden__/wave-loop/op-discover-rest-stops.json +22 -6
- package/src/__golden__/wave-loop/op-discover-rest.json +44 -12
- package/src/__golden__/wave-loop/op-discover-wide.json +12 -3
- package/src/__golden__/wave-loop/op-held-on.json +28 -7
- package/src/__golden__/wave-loop/op-hooks-apply-fails.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-fail-after-apply.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-fail-before-apply.json +4 -2
- package/src/__golden__/wave-loop/op-hooks-held.json +26 -8
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +18 -4
- package/src/__golden__/wave-loop/op-hooks-pass.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-share.json +20 -7
- package/src/__golden__/wave-loop/op-outcome-held.json +12 -3
- package/src/__golden__/wave-loop/op-outcome-replan-approved.json +16 -5
- package/src/__golden__/wave-loop/op-outcome-replan-forever.json +48 -21
- package/src/__golden__/wave-loop/op-outcome-replan.json +16 -5
- package/src/__golden__/wave-loop/op-outcome-stood-down.json +12 -3
- package/src/__golden__/wave-loop/op-outcome-unreadable.json +12 -3
- package/src/__golden__/wave-loop/op-overridden.json +28 -7
- package/src/__golden__/wave-loop/op-per-run.json +20 -4
- package/src/__golden__/wave-loop/op-point.json +18 -4
- package/src/__golden__/wave-loop/op-pr-review.json +10 -2
- package/src/__golden__/wave-loop/op-spend-change-only.json +10 -2
- package/src/__golden__/wave-loop/op-spend.json +10 -2
- package/src/__golden__/wave-loop/op-wave-commands.json +56 -13
- package/src/__golden__/wave-loop/op-wide.json +20 -4
- package/src/audit/discover.e2e.test.ts +14 -0
- package/src/audit/discover.ts +3 -1
- package/src/behaviour.ts +1 -1
- package/src/bucket-check/azure.ts +307 -0
- package/src/bucket-check/bucket-check.test.ts +210 -0
- package/src/bucket-check/fixtures/azure.json +153 -0
- package/src/bucket-check/fixtures/gcs.json +148 -0
- package/src/bucket-check/fixtures/s3.json +277 -0
- package/src/bucket-check/gcs.ts +257 -0
- package/src/bucket-check/index.ts +61 -0
- package/src/bucket-check/s3.ts +433 -0
- package/src/bucket-check/types.ts +75 -0
- package/src/bucket-check/wire.ts +50 -0
- package/src/bucket-check.ts +5 -0
- package/src/capabilities/templates.json +145 -0
- package/src/capabilities/templates.test.ts +211 -0
- package/src/capabilities/templates.ts +203 -0
- package/src/cdk/advise.test.ts +1 -1
- package/src/change-set-bundle.test.ts +82 -0
- package/src/change-set-graph.ts +80 -9
- package/src/change-set.test.ts +24 -0
- package/src/change-set.ts +76 -14
- package/src/ci-agent.test.ts +348 -0
- package/src/ci-agent.ts +1026 -0
- package/src/ci-control.ts +174 -0
- package/src/ci-estate/delivery.ts +433 -0
- package/src/ci-estate/overdue.ts +81 -0
- package/src/ci-estate/page.ts +343 -0
- package/src/ci-estate/rows.ts +251 -0
- package/src/ci-estate.test.ts +281 -0
- package/src/ci-estate.ts +176 -0
- package/src/ci-handover.ts +67 -16
- package/src/ci-identity-database.test.ts +55 -0
- package/src/ci-identity-pulumi.test.ts +163 -0
- package/src/ci-identity-targets.test.ts +29 -2
- package/src/ci-identity.ts +134 -26
- package/src/ci-product-words.test.ts +101 -0
- package/src/ci-product-words.ts +536 -0
- package/src/ci-product.ts +174 -0
- package/src/ci-shared-reads.test.ts +145 -0
- package/src/cli/commands/audit.test.ts +1 -1
- package/src/cli/commands/audit.ts +3 -2
- package/src/cli/commands/carve.test.ts +1 -1
- package/src/cli/commands/carve.ts +2 -2
- package/src/cli/commands/import-index.test.ts +117 -0
- package/src/cli/commands/import-index.ts +265 -0
- package/src/cli/commands/init.ts +3 -1
- package/src/cli/commands/lint.ts +4 -2
- package/src/cli/component-wave-args.test.ts +16 -0
- package/src/cli/handlers/agent.ts +126 -0
- package/src/cli/handlers/approve-confirm.test.ts +276 -0
- package/src/cli/handlers/approve-confirm.ts +200 -0
- package/src/cli/handlers/approve.ts +18 -1
- package/src/cli/handlers/build.test.ts +7 -0
- package/src/cli/handlers/build.ts +44 -1
- package/src/cli/handlers/ci-check.ts +33 -0
- package/src/cli/handlers/ci-forge-check.ts +91 -0
- package/src/cli/handlers/components.test.ts +9 -0
- package/src/cli/handlers/components.ts +12 -2
- package/src/cli/handlers/fan-out.test.ts +10 -10
- package/src/cli/handlers/fan-out.ts +22 -3
- package/src/cli/handlers/gate-pending.ts +46 -0
- package/src/cli/handlers/graph.test.ts +42 -0
- package/src/cli/handlers/graph.ts +26 -4
- package/src/cli/handlers/index-cloud.ts +32 -0
- package/src/cli/handlers/index-diff.test.ts +68 -0
- package/src/cli/handlers/index-diff.ts +146 -0
- package/src/cli/handlers/init.ts +1 -0
- package/src/cli/handlers/ledger-root-member.test.ts +161 -0
- package/src/cli/handlers/ledger.ts +1 -1
- package/src/cli/handlers/lifecycle-drift.ts +73 -0
- package/src/cli/handlers/lifecycle.test.ts +33 -11
- package/src/cli/handlers/lifecycle.ts +205 -30
- package/src/cli/handlers/lock.test.ts +29 -2
- package/src/cli/handlers/lock.ts +66 -6
- package/src/cli/handlers/misc.ts +73 -0
- package/src/cli/handlers/notify-relay.ts +130 -0
- package/src/cli/handlers/pr-before-merge.test.ts +2 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +7 -7
- package/src/cli/handlers/pr-env.ts +48 -11
- package/src/cli/handlers/pr-plan-targets.test.ts +155 -0
- package/src/cli/handlers/pr-waves-blocked.test.ts +42 -2
- package/src/cli/handlers/pr-waves.test.ts +8 -2
- package/src/cli/handlers/pr.test.ts +8 -8
- package/src/cli/handlers/pr.ts +669 -207
- package/src/cli/handlers/promote.test.ts +69 -5
- package/src/cli/handlers/promote.ts +103 -8
- package/src/cli/handlers/query.ts +27 -4
- package/src/cli/handlers/release.ts +2 -0
- package/src/cli/handlers/run-components-exit.test.ts +7 -7
- package/src/cli/handlers/run-declared-reads-cli.test.ts +187 -0
- package/src/cli/handlers/run-groups-cli.test.ts +229 -0
- package/src/cli/handlers/run-wave.ts +65 -1
- package/src/cli/handlers/run.test.ts +6 -4
- package/src/cli/handlers/run.ts +86 -1
- package/src/cli/handlers/scenario.test.ts +13 -0
- package/src/cli/handlers/scenario.ts +8 -7
- package/src/cli/handlers/search-index.test.ts +255 -0
- package/src/cli/handlers/search-json.test.ts +1 -1
- package/src/cli/handlers/search-ownership.test.ts +194 -0
- package/src/cli/handlers/search.ts +271 -38
- package/src/cli/handlers/serve.ts +10 -1
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +182 -14
- package/src/cli/mcp/ledger-tools.ts +126 -0
- package/src/cli/mcp/lifecycle-tools.ts +3 -2
- package/src/cli/mcp/product-tools.test.ts +123 -0
- package/src/cli/mcp/product-tools.ts +129 -0
- package/src/cli/mcp/read-only.test.ts +134 -0
- package/src/cli/mcp/read-only.ts +68 -0
- package/src/cli/mcp/report-tools.ts +135 -0
- package/src/cli/mcp/resource-handlers.ts +4 -3
- package/src/cli/mcp/server.test.ts +5 -4
- package/src/cli/mcp/server.ts +90 -16
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/mcp-config.ts +8 -3
- package/src/cli/parse-args.ts +82 -4
- package/src/cli/registry.ts +54 -1
- package/src/cloud-lister/aws.test.ts +202 -0
- package/src/cloud-lister/aws.ts +226 -0
- package/src/cloud-lister/azure.test.ts +132 -0
- package/src/cloud-lister/azure.ts +142 -0
- package/src/cloud-lister/common.ts +115 -0
- package/src/cloud-lister/credentials.ts +110 -0
- package/src/cloud-lister/fakes.ts +66 -0
- package/src/cloud-lister/gcp.test.ts +121 -0
- package/src/cloud-lister/gcp.ts +159 -0
- package/src/cloud-lister/guard.test.ts +198 -0
- package/src/cloud-lister/guard.ts +111 -0
- package/src/cloud-lister/ids.ts +54 -0
- package/src/cloud-lister/index.ts +134 -0
- package/src/cloud-lister/kubernetes.test.ts +160 -0
- package/src/cloud-lister/kubernetes.ts +284 -0
- package/src/cloud-lister/markers.ts +74 -0
- package/src/cloud-lister/mask.ts +77 -0
- package/src/cloud-lister/shape.test.ts +81 -0
- package/src/cloud-lister/sigv4.ts +127 -0
- package/src/cloud-lister/transport.ts +118 -0
- package/src/cloud-lister/types.ts +135 -0
- package/src/components/adoption.test.ts +140 -0
- package/src/components/adoption.ts +141 -0
- package/src/components/apply-lease.ts +49 -0
- package/src/components/capability-plugin-loader.ts +4 -0
- package/src/components/capability-plugin.ts +10 -0
- package/src/components/capability.ts +359 -6
- package/src/components/check-hooks.test.ts +66 -0
- package/src/components/check-hooks.ts +252 -0
- package/src/components/ci-services.test.ts +51 -0
- package/src/components/ci-services.ts +83 -0
- package/src/components/cli-support.ts +92 -15
- package/src/components/declared-reads.test.ts +103 -0
- package/src/components/declared-reads.ts +134 -0
- package/src/components/deploy-units.ts +4 -0
- package/src/components/driver.test.ts +3 -3
- package/src/components/driver.ts +127 -9
- package/src/components/fan-out-run.ts +163 -33
- package/src/components/fan-out-support.ts +10 -1
- package/src/components/fan-out.ts +30 -0
- package/src/components/groups.test.ts +320 -0
- package/src/components/groups.ts +895 -0
- package/src/components/index.ts +42 -0
- package/src/components/plan-shape-conformance.ts +130 -0
- package/src/components/pr-comment-preview.test.ts +54 -0
- package/src/components/pr-env-ledger.test.ts +9 -0
- package/src/components/pr-env-ledger.ts +43 -0
- package/src/components/pr-env-ports.ts +29 -4
- package/src/components/pr-env-run-bundle.test.ts +10 -0
- package/src/components/pr-env-run.test.ts +19 -0
- package/src/components/pr-env-run.ts +12 -2
- package/src/components/pr-environment.test.ts +29 -0
- package/src/components/pr-environment.ts +39 -7
- package/src/components/pr-pipeline.test.ts +15 -0
- package/src/components/pr-pipeline.ts +274 -9
- package/src/components/pr-policy.ts +45 -7
- package/src/components/pr-run.test.ts +516 -3
- package/src/components/pr-run.ts +350 -44
- package/src/components/pr-targets.test.ts +35 -0
- package/src/components/pr-targets.ts +45 -0
- package/src/components/product-pipeline.test.ts +200 -0
- package/src/components/product-pipeline.ts +341 -0
- package/src/components/promote-rounds.ts +25 -2
- package/src/components/promote.ts +64 -5
- package/src/components/registry.test.ts +1 -1
- package/src/components/release-compile.ts +87 -1
- package/src/components/release-gate.ts +115 -30
- package/src/components/release-groups.test.ts +362 -0
- package/src/components/release-promote.ts +65 -1
- package/src/components/repo-lock.ts +52 -0
- package/src/components/row-lease.test.ts +490 -0
- package/src/components/row-lease.ts +167 -0
- package/src/components/run-groups.ts +113 -0
- package/src/components/starter-plugin.ts +6 -0
- package/src/components/verbs/index.ts +1 -0
- package/src/components/verbs/member-outputs.test.ts +205 -0
- package/src/components/verbs/member-outputs.ts +308 -0
- package/src/components/wave-plan-policy.test.ts +19 -0
- package/src/components/wave-plan.ts +78 -4
- package/src/config.ts +44 -0
- package/src/control/__fixtures__/consumers/apps/consumers.json +15 -0
- package/src/control/__fixtures__/consumers/infra/consumers.json +23 -0
- package/src/control/applied.test.ts +148 -0
- package/src/control/applied.ts +191 -0
- package/src/control/consumers.test.ts +129 -0
- package/src/control/consumers.ts +192 -0
- package/src/control/control.test.ts +302 -0
- package/src/control/dispatch.ts +699 -0
- package/src/control/edges.test.ts +112 -0
- package/src/control/edges.ts +164 -0
- package/src/control/note-checkout.test.ts +91 -0
- package/src/control/reconcile.ts +250 -0
- package/src/control/records.ts +395 -0
- package/src/deep-observation.ts +5 -23
- package/src/discovery/sandbox/bundle.ts +25 -1
- package/src/drift-record.test.ts +596 -0
- package/src/drift-record.ts +1206 -0
- package/src/engine-facts.guard.test.ts +111 -0
- package/src/engine-facts.test.ts +177 -0
- package/src/engine-facts.ts +153 -0
- package/src/exit-codes.test.ts +31 -0
- package/src/exit-codes.ts +55 -0
- package/src/forge-check/check.ts +155 -0
- package/src/forge-check/contract.ts +215 -0
- package/src/forge-check/forge-check.test.ts +427 -0
- package/src/forge-check/forge.ts +318 -0
- package/src/forge-check/index.ts +43 -0
- package/src/forge-check/pulumi.ts +192 -0
- package/src/forge-check/read-only.ts +56 -0
- package/src/forge-check/trust.ts +527 -0
- package/src/forge-check/types.ts +78 -0
- package/src/forge-check.ts +5 -0
- package/src/gate-decision-bundle.test.ts +13 -0
- package/src/gate-decision.ts +3 -0
- package/src/gate-policy.ts +92 -3
- package/src/gated-waves-bundle.test.ts +1 -0
- package/src/graph-ir-live.test.ts +92 -0
- package/src/graph-ir.ts +317 -7
- package/src/graph-refs.ts +416 -0
- package/src/graph-schema/fixtures/adopt.json +15 -0
- package/src/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/src/graph-schema/fixtures/index.json +68 -0
- package/src/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/src/graph-schema/fixtures.ts +267 -0
- package/src/graph-schema/generate.ts +263 -0
- package/src/graph-schema/graph-schema.test.ts +153 -0
- package/src/graph-schema/graph.schema.json +1387 -0
- package/src/health.schema.json +2 -1
- package/src/identity.ts +2 -0
- package/src/index.ts +4 -0
- package/src/instance-nodes.ts +288 -0
- package/src/lexicon.ts +171 -6
- package/src/lifecycle/__fixtures__/index-diff/20261026T120000Z-aaaaaaaaaaaa.json +149 -0
- package/src/lifecycle/__fixtures__/index-diff/20261026T130000Z-bbbbbbbbbbbb.json +127 -0
- package/src/lifecycle/adoption-file.test.ts +100 -0
- package/src/lifecycle/adoption-file.ts +153 -0
- package/src/lifecycle/cloud-index.test.ts +516 -0
- package/src/lifecycle/cloud-index.ts +735 -0
- package/src/lifecycle/control-entries-ledger.test.ts +70 -0
- package/src/lifecycle/derive-edges.test.ts +193 -0
- package/src/lifecycle/derive-edges.ts +182 -0
- package/src/lifecycle/gate-applied.ts +6 -0
- package/src/lifecycle/gate-ledger.ts +36 -1
- package/src/lifecycle/gate-pending-by-plan.test.ts +69 -0
- package/src/lifecycle/gate-pending-by-plan.ts +133 -0
- package/src/lifecycle/gated-request-digest.ts +49 -0
- package/src/lifecycle/gated-request-ledger.test.ts +53 -0
- package/src/lifecycle/gated-request.ts +280 -0
- package/src/lifecycle/git.ts +10 -4
- package/src/lifecycle/identity-match.test.ts +308 -0
- package/src/lifecycle/identity-match.ts +276 -0
- package/src/lifecycle/index-diff.test.ts +198 -0
- package/src/lifecycle/index-diff.ts +475 -0
- package/src/lifecycle/index-document.test.ts +64 -0
- package/src/lifecycle/index-document.ts +298 -0
- package/src/lifecycle/index-drift.test.ts +191 -0
- package/src/lifecycle/index-drift.ts +304 -0
- package/src/lifecycle/index-import.test.ts +269 -0
- package/src/lifecycle/index-import.ts +654 -0
- package/src/lifecycle/index-join.test.ts +250 -0
- package/src/lifecycle/index-join.ts +304 -0
- package/src/lifecycle/index-store-load-bearing.test.ts +187 -0
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/ledger-read.ts +7 -3
- package/src/lifecycle/lock-rows.test.ts +109 -0
- package/src/lifecycle/lock-rows.ts +167 -0
- package/src/lifecycle/member-ledger.test.ts +25 -7
- package/src/lifecycle/observation-baseline.test.ts +72 -1
- package/src/lifecycle/observation-baseline.ts +190 -27
- package/src/lifecycle/observe.ts +6 -1
- package/src/lifecycle/publish-target-context.test.ts +108 -0
- package/src/lifecycle/query.test.ts +68 -1
- package/src/lifecycle/query.ts +208 -13
- package/src/lifecycle/release-catalog-site.test.ts +142 -0
- package/src/lifecycle/release-catalog-site.ts +291 -0
- package/src/lifecycle/release-catalog.test.ts +193 -0
- package/src/lifecycle/release-catalog.ts +353 -0
- package/src/lifecycle/release-changelog.test.ts +70 -0
- package/src/lifecycle/release-changelog.ts +71 -0
- package/src/lifecycle/release-cut.ts +2 -2
- package/src/lifecycle/release-ledger.ts +20 -0
- package/src/lifecycle/release-publish.ts +45 -22
- package/src/lifecycle/release-read.ts +2 -0
- package/src/lifecycle/release-status.test.ts +186 -0
- package/src/lifecycle/release-status.ts +176 -0
- package/src/lifecycle/replay.test.ts +9 -5
- package/src/lifecycle/replay.ts +9 -5
- package/src/lifecycle/resource-lock.test.ts +175 -0
- package/src/lifecycle/resource-lock.ts +354 -0
- package/src/lifecycle/retention.ts +2 -0
- package/src/lifecycle/run-ledger.ts +7 -1
- package/src/lifecycle/scenario.ts +4 -3
- package/src/lifecycle/snapshot-store-fake.ts +29 -0
- package/src/lifecycle/snapshot-store-s3.ts +280 -0
- package/src/lifecycle/snapshot-store.test.ts +385 -0
- package/src/lifecycle/snapshot-store.ts +980 -0
- package/src/lifecycle/snapshot.test.ts +13 -0
- package/src/lifecycle/snapshot.ts +23 -6
- package/src/lifecycle/target-lock.ts +24 -9
- package/src/lifecycle/type-listing.test.ts +166 -0
- package/src/lifecycle/type-listing.ts +309 -0
- package/src/lint/component-checks.ts +17 -1
- package/src/lint/config.test.ts +3 -0
- package/src/lint/presets/relaxed.json +2 -1
- package/src/lint/presets/strict.json +2 -1
- package/src/lint/rules/__fixtures__/comp/comp008/fail/dns.component.ts +15 -0
- package/src/lint/rules/__fixtures__/comp/comp008/pass/dns.component.ts +10 -0
- package/src/lint/rules/comp/comp.test.ts +2 -1
- package/src/lint/rules/comp/comp008-applies-signal-only-root.ts +121 -0
- package/src/lint/rules/comp/comp008.test.ts +77 -0
- package/src/lint/rules/comp/index.ts +4 -1
- package/src/mcp/types.ts +7 -0
- package/src/notify-product.ts +76 -0
- package/src/notify-relay.test.ts +213 -0
- package/src/notify-relay.ts +407 -0
- package/src/notify.ts +95 -14
- package/src/object-store/azure-blob.ts +374 -0
- package/src/object-store/common.ts +133 -0
- package/src/object-store/errors.ts +26 -0
- package/src/object-store/from-env.ts +36 -0
- package/src/object-store/gcs.ts +436 -0
- package/src/object-store/index.ts +8 -0
- package/src/object-store/object-store.test.ts +130 -0
- package/src/object-store/s3.ts +350 -0
- package/src/observation-edges.test.ts +33 -0
- package/src/observation.ts +36 -1
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +8 -5
- package/src/op/activities/converge.ts +2 -1
- package/src/op/activities/index.ts +1 -1
- package/src/op/activities/review-agent.open.test.ts +78 -0
- package/src/op/activities/review-agent.test.ts +13 -0
- package/src/op/activities/review-agent.ts +89 -5
- package/src/op/activity-failure.ts +36 -0
- package/src/op/gate.ts +81 -22
- package/src/op/generate-pipeline.ts +7 -1
- package/src/op/index.ts +23 -1
- package/src/op/local-executor.test.ts +80 -0
- package/src/op/local-executor.ts +27 -9
- package/src/op/op-waves-after-plan.test.ts +276 -0
- package/src/op/op-waves-after-plan.ts +238 -0
- package/src/op/op-waves-capability-spec.ts +113 -0
- package/src/op/op-waves-capability.test.ts +217 -0
- package/src/op/op-waves-capability.ts +370 -0
- package/src/op/op-waves-events.ts +135 -0
- package/src/op/op-waves-notify-words.test.ts +149 -0
- package/src/op/op-waves-notify.ts +41 -16
- package/src/op/op-waves-pull-request.test.ts +142 -0
- package/src/op/op-waves-release-port.ts +64 -0
- package/src/op/op-waves-release.test.ts +209 -0
- package/src/op/op-waves-release.ts +133 -0
- package/src/op/op-waves-run-record.test.ts +32 -0
- package/src/op/op-waves-run.ts +1142 -49
- package/src/op/op-waves-stand-down.test.ts +240 -0
- package/src/op/op-waves-stand-down.ts +108 -0
- package/src/op/op-waves-trace.test.ts +205 -0
- package/src/op/op-waves.test.ts +112 -0
- package/src/op/op-waves.ts +261 -20
- package/src/op/runtime.ts +104 -0
- package/src/op/stage-hooks-hold-record.test.ts +41 -0
- package/src/op/stage-hooks.ts +91 -12
- package/src/op/steward-beside.ts +2 -1
- package/src/op/types.ts +3 -2
- package/src/otlp-metrics.ts +96 -0
- package/src/otlp.test.ts +243 -0
- package/src/otlp.ts +544 -0
- package/src/override-gate-bundle.test.ts +2 -0
- package/src/override-gate.ts +4 -0
- package/src/policy-packs.ts +230 -0
- package/src/policy-source.test.ts +256 -0
- package/src/policy-source.ts +112 -0
- package/src/pr-forge.ts +123 -0
- package/src/pr-loop-bundle.test.ts +9 -2
- package/src/pr-loop-words.test.ts +155 -0
- package/src/pr-loop.test.ts +43 -0
- package/src/pr-loop.ts +478 -50
- package/src/pr-post.ts +32 -1
- package/src/pr-report-url.ts +62 -6
- package/src/pr-requires.test.ts +37 -1
- package/src/pr-requires.ts +16 -2
- package/src/product-subpaths-plain-node.e2e.test.ts +211 -0
- package/src/pulumi-urn.ts +151 -0
- package/src/release-floors.ts +22 -0
- package/src/run-event.ts +29 -1
- package/src/sensitive-key.ts +34 -0
- package/src/sorted-json.ts +17 -0
- package/src/stage-hooks-bundle.test.ts +8 -0
- package/src/terraform/credentials.test.ts +77 -0
- package/src/terraform/credentials.ts +162 -0
- package/src/utils.ts +2 -11
- package/src/wave-loop-golden.test.ts +2 -1
- package/src/wave-runtime.ts +2 -2
- package/src/workspace/adoption-report.test.ts +61 -0
- package/src/workspace/adoption-report.ts +103 -0
- package/src/workspace/capabilities-contract.test.ts +4 -0
- package/src/workspace/capabilities-contract.ts +9 -1
- package/src/workspace/capabilities.schema.json +98 -0
- package/src/workspace/change-set.schema.json +42 -3
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +4 -1
- package/src/workspace/ci-cloud-identity.ts +31 -1
- package/src/workspace/ci-lock-grain.test.ts +31 -0
- package/src/workspace/ci-lock-grain.ts +30 -0
- package/src/workspace/ci-report-url.test.ts +1 -1
- package/src/workspace/ci-run.test.ts +1 -1
- package/src/workspace/ci-run.ts +6 -3
- package/src/workspace/compose-graph.test.ts +12 -0
- package/src/workspace/compose-graph.ts +12 -1
- package/src/workspace/conformance/conformance.e2e.test.ts +2 -1
- package/src/workspace/conformance/index.ts +6 -1
- package/src/workspace/declaration.schema.json +27 -3
- package/src/workspace/declaration.test.ts +1 -1
- package/src/workspace/declaration.ts +26 -10
- package/src/workspace/drift-cli.test.ts +65 -0
- package/src/workspace/drift-cli.ts +370 -0
- package/src/workspace/drift.schema.json +672 -0
- package/src/workspace/exit-cli.ts +2 -1
- package/src/workspace/graph-cli.ts +5 -0
- package/src/workspace/graph.schema.json +72 -0
- package/src/workspace/import-fetch.ts +4 -2
- package/src/workspace/import-init.ts +4 -2
- package/src/workspace/init.test.ts +38 -1
- package/src/workspace/init.ts +50 -8
- package/src/workspace/intent-gaps.test.ts +18 -2
- package/src/workspace/ledger.schema.json +7 -3
- package/src/workspace/lineage-upgrade-cli.ts +2 -1
- package/src/workspace/nested-graph.ts +1 -0
- package/src/workspace/pr-report.schema.json +125 -5
- package/src/workspace/promote-waves.test.ts +296 -0
- package/src/workspace/promote-waves.ts +340 -0
- package/src/workspace/promote.test.ts +158 -4
- package/src/workspace/promote.ts +400 -58
- package/src/workspace/reason-codes.test.ts +4 -1
- package/src/workspace/reason-codes.ts +14 -0
- package/src/workspace/records-cli.ts +3 -2
- package/src/workspace/release-catalog.schema.json +277 -0
- package/src/workspace/run-event.schema.json +18 -1
- package/src/workspace/search-contract.ts +2 -0
- package/src/workspace/search.schema.json +103 -5
- package/src/workspace/work-cli.ts +8 -2
- package/src/workspace/workspace-run.ts +2 -1
package/src/cli/handlers/pr.ts
CHANGED
|
@@ -65,11 +65,14 @@
|
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
67
|
import { spawnSync } from "node:child_process";
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
68
|
+
import { CHANT_EXIT } from "../../exit-codes";
|
|
69
|
+
import { anyResourceGrain, leaseRowsOf as leaseRowsOfLocks, lockTargetsOf, type LockGrain } from "../../lifecycle/lock-rows";
|
|
70
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
71
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
70
72
|
import { loadChantConfig, resolveAutoReleaseDisabled, type ChantConfig } from "../../config";
|
|
71
73
|
import { resolveCommit, resolveMergeBase } from "../../components/changed-files";
|
|
72
74
|
import { deriveFanOut, fanOutRegistry } from "../../components/fan-out-support";
|
|
75
|
+
import { findComponentGroups, groupFanOut } from "../../components/groups";
|
|
73
76
|
import {
|
|
74
77
|
applyPrSet,
|
|
75
78
|
approvalOf,
|
|
@@ -81,15 +84,14 @@ import {
|
|
|
81
84
|
readOnlyLedger,
|
|
82
85
|
prWavePlan,
|
|
83
86
|
resumePrSet,
|
|
84
|
-
waveNotCovered,
|
|
85
87
|
type PrPlanSet,
|
|
86
88
|
} from "../../components/pr-run";
|
|
87
89
|
import { composeChangeSet, verifyChangeSetDigest } from "../../change-set";
|
|
88
|
-
import { waveGateName } from "../../gated-waves";
|
|
89
90
|
import { blockedMembers, blockedWords, settleEarlierWaves, type WaveMemberOutcome } from "../../wave-blocked";
|
|
90
91
|
import { readFanOutAttempt, writeFanOutAttempt, type FanOutAttempt, type PrApplyRecord } from "../../components/fan-out-record";
|
|
91
92
|
import { componentInputDigests, progressThatCarries } from "../../components/fan-out-inputs";
|
|
92
|
-
import { samePlanDigest } from "../../lifecycle/plan-digest";
|
|
93
|
+
import { computePlanDigest, samePlanDigest } from "../../lifecycle/plan-digest";
|
|
94
|
+
import type { GateResolutionRecord } from "../../lifecycle/gate-ledger";
|
|
93
95
|
import { evaluateGate, gateIsSealed, gitGateLedgerPort, type GateCheck, type GateLedgerPort } from "../../op/gate";
|
|
94
96
|
import type { OtherGateHold } from "../../op/stage-hooks";
|
|
95
97
|
import { emitGateStep, gateEventsOf, GATE_PHASE, type RunEventSink, type RunEventStream } from "../../run-event-stream";
|
|
@@ -100,6 +102,7 @@ import {
|
|
|
100
102
|
describePlanChanged,
|
|
101
103
|
PR_APPLY_GATE,
|
|
102
104
|
prApproveCommand,
|
|
105
|
+
prApproveCommands,
|
|
103
106
|
prNoteMarker,
|
|
104
107
|
prOp,
|
|
105
108
|
prStatusDescription,
|
|
@@ -109,6 +112,7 @@ import {
|
|
|
109
112
|
type PrApproval,
|
|
110
113
|
type PrBeforeMerge,
|
|
111
114
|
type PrMember,
|
|
115
|
+
type PrMemberDetail,
|
|
112
116
|
type PrPolicyReport,
|
|
113
117
|
type PrReport,
|
|
114
118
|
type PrWave,
|
|
@@ -117,6 +121,8 @@ import {
|
|
|
117
121
|
} from "../../pr-loop";
|
|
118
122
|
import { FORGE_KINDS, forgeFromEnv, forgePrincipalOf, type ForgeKind, type PrForge } from "../../pr-forge";
|
|
119
123
|
import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "../../plan-summary";
|
|
124
|
+
import { upsertPlanNote } from "../../pr-post";
|
|
125
|
+
import { activeProductWords, productContext } from "../../ci-product-words";
|
|
120
126
|
import { resolveCliBuildParams, parseParamFlags } from "../build-params-cli";
|
|
121
127
|
import { formatError, formatInfo, formatSuccess, formatWarning } from "../format";
|
|
122
128
|
import { reportUninstalledDependencies } from "../dependencies";
|
|
@@ -126,10 +132,12 @@ import { coverByMerges, greenOp, type GreenTarget } from "../../components/green
|
|
|
126
132
|
import { GATED_EXIT_CODE, autoReleaseRun, recordAutoReleasesForRun } from "./run";
|
|
127
133
|
import { appliedDigestOf } from "../../components/auto-release";
|
|
128
134
|
import type { CommandContext } from "../registry";
|
|
135
|
+
import { parseArgs } from "../parse-args";
|
|
129
136
|
import { withComponentEndpoint } from "../component-endpoint";
|
|
130
137
|
import type { ComponentChangeSignal, FanOutPlan } from "../../components/fan-out";
|
|
131
|
-
import { failedRunExitCode, type DriverComponent } from "../../components/driver";
|
|
132
|
-
import type
|
|
138
|
+
import { assertTargetsAccepted, failedRunExitCode, type DriverComponent } from "../../components/driver";
|
|
139
|
+
import { TargetsRefusedError, type CapabilityRegistry } from "../../components/capability";
|
|
140
|
+
import { prPlanTargets } from "../../components/pr-targets";
|
|
133
141
|
import type { ComponentEnvironmentDeclaration } from "../../components/component";
|
|
134
142
|
import { prLoopHooksAt, runPrHooks, type PrHoldSettled, type PrHookPlace, type PrLoopHooks } from "../../components/pr-hooks";
|
|
135
143
|
import { decidePrPolicyOverride, policyReviewOf, prLoopPolicyAt, prPolicyReport, runPrPolicy, spendPrPolicyOverride, type PrLoopPolicy } from "../../components/pr-policy";
|
|
@@ -171,6 +179,8 @@ export interface Prepared {
|
|
|
171
179
|
hookFailed?: string;
|
|
172
180
|
/** Where the stage's hooks run, once its op is known. */
|
|
173
181
|
hookPlace?: PrHookPlace;
|
|
182
|
+
/** `pr-plan --target` (#4620): the addresses each planned member's capability plan narrows to. */
|
|
183
|
+
targets?: Record<string, string[]>;
|
|
174
184
|
/**
|
|
175
185
|
* Set when `ci.branches` or `ci.labels` (#4292) leave the member out of this
|
|
176
186
|
* stage: why. The plan is then empty, so the stage reports `nothing`.
|
|
@@ -210,6 +220,10 @@ export async function prepare(ctx: CommandContext, stage: "plan" | "apply" | "re
|
|
|
210
220
|
);
|
|
211
221
|
}
|
|
212
222
|
if (args.fromAffected) return fail(`pr-${stage} derives the change itself; drop --from-affected`);
|
|
223
|
+
// #4620: a target narrows the preview; an apply or a record covers what the approved plan covers.
|
|
224
|
+
if (stage !== "plan" && args.targets && args.targets.length > 0) {
|
|
225
|
+
return fail(`pr-${stage} applies or records what the pull request's approved plan covers, so it takes no --target`, "Narrow the plan with pr-plan --target, and approve that plan.");
|
|
226
|
+
}
|
|
213
227
|
let member: string | undefined;
|
|
214
228
|
if (args.members?.length) {
|
|
215
229
|
const checked = await checkMember(projectPath, args.members);
|
|
@@ -241,6 +255,7 @@ export async function prepare(ctx: CommandContext, stage: "plan" | "apply" | "re
|
|
|
241
255
|
const signal = await resolveChangedUnits(ctx, config, { base, stacksOnly: true });
|
|
242
256
|
if ("error" in signal) return fail(signal.error, signal.hint);
|
|
243
257
|
|
|
258
|
+
const registry = await fanOutRegistry(projectPath, config);
|
|
244
259
|
let derived;
|
|
245
260
|
try {
|
|
246
261
|
derived = await deriveFanOut({
|
|
@@ -249,6 +264,7 @@ export async function prepare(ctx: CommandContext, stage: "plan" | "apply" | "re
|
|
|
249
264
|
sandbox: args.sandbox,
|
|
250
265
|
buildParams: paramsResolution.provenance,
|
|
251
266
|
config,
|
|
267
|
+
registry,
|
|
252
268
|
});
|
|
253
269
|
} catch (err) {
|
|
254
270
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -288,9 +304,17 @@ export async function prepare(ctx: CommandContext, stage: "plan" | "apply" | "re
|
|
|
288
304
|
if (policy.note) console.error(formatInfo(policy.note));
|
|
289
305
|
|
|
290
306
|
const env = args.env ?? "local";
|
|
291
|
-
const registry = await fanOutRegistry(projectPath, config);
|
|
292
307
|
const routedAway = member ? await routing(ctx, stage, projectPath, member, base, forge) : undefined;
|
|
293
308
|
if (routedAway) console.error(formatInfo(routedAway));
|
|
309
|
+
// ws-107: the groups a capability plans and applies as one, placed in the waves every stage and wave job reads.
|
|
310
|
+
let plan = derived.plan;
|
|
311
|
+
if (!routedAway && plan.order.length > 0) {
|
|
312
|
+
try {
|
|
313
|
+
plan = groupFanOut(plan, derived.components, await findComponentGroups({ components: derived.components, plan, registry, env }));
|
|
314
|
+
} catch (err) {
|
|
315
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
294
318
|
return {
|
|
295
319
|
config,
|
|
296
320
|
env,
|
|
@@ -300,7 +324,7 @@ export async function prepare(ctx: CommandContext, stage: "plan" | "apply" | "re
|
|
|
300
324
|
gate: args.gate ?? PR_APPLY_GATE,
|
|
301
325
|
...(forge ? { forge } : {}),
|
|
302
326
|
components: derived.components,
|
|
303
|
-
plan: routedAway ? { ...derived.plan, order: [], waves: [], seeds: [], indeterminate: [] } :
|
|
327
|
+
plan: routedAway ? { ...derived.plan, order: [], waves: [], seeds: [], indeterminate: [] } : plan,
|
|
304
328
|
signal: derived.signal,
|
|
305
329
|
...(derived.sites ? { sites: derived.sites } : {}),
|
|
306
330
|
registry,
|
|
@@ -465,17 +489,94 @@ export function planAll(p: Prepared, onRunEvent?: RunEventSink): Promise<PrPlanS
|
|
|
465
489
|
return hookedPlan(p, p.plan.order, () => planBare(p, onRunEvent));
|
|
466
490
|
}
|
|
467
491
|
|
|
468
|
-
export function planBare(p: Prepared, onRunEvent?: RunEventSink): Promise<PrPlanSet> {
|
|
492
|
+
export async function planBare(p: Prepared, onRunEvent?: RunEventSink): Promise<PrPlanSet> {
|
|
493
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
469
494
|
return planPrSet({
|
|
470
495
|
components: p.components,
|
|
471
496
|
plan: p.plan,
|
|
472
497
|
registry: p.registry,
|
|
473
498
|
env: p.env,
|
|
474
499
|
seededOutputs: p.seededOutputs,
|
|
500
|
+
...(lockGrain ? { lockGrain } : {}),
|
|
501
|
+
// #4613: a step's own policy engine (CrossGuard) reads its packs at the base, as ci.policy is.
|
|
502
|
+
policyBase: p.base,
|
|
475
503
|
...(onRunEvent ? { onRunEvent } : {}),
|
|
504
|
+
...(p.targets ? { targets: p.targets } : {}),
|
|
476
505
|
});
|
|
477
506
|
}
|
|
478
507
|
|
|
508
|
+
/**
|
|
509
|
+
* `pr-plan --target` (#4620): the addresses by member, set on `p`, or the
|
|
510
|
+
* exit code when a value is refused or a targeted member has a capability
|
|
511
|
+
* that cannot narrow, which is named before anything plans.
|
|
512
|
+
*/
|
|
513
|
+
function narrowToTargets(p: Prepared, values: readonly string[] | undefined): number | undefined {
|
|
514
|
+
if (!values || values.length === 0) return undefined;
|
|
515
|
+
const resolved = prPlanTargets(values, p.plan.order, new Set(p.components.map((c) => c.name)));
|
|
516
|
+
if ("error" in resolved) return fail(resolved.error, "--target <address> narrows every member the pull request plans; --target <member>:<address> narrows one.");
|
|
517
|
+
const { targets } = resolved;
|
|
518
|
+
const byName = new Map(p.components.map((c) => [c.name, c]));
|
|
519
|
+
for (const [name, addresses] of Object.entries(targets)) {
|
|
520
|
+
try {
|
|
521
|
+
assertTargetsAccepted(byName.get(name)!, p.registry, { targets: addresses });
|
|
522
|
+
} catch (err) {
|
|
523
|
+
if (err instanceof TargetsRefusedError) return fail(`${err.message}, so nothing was planned`, "Drop --target, or name a member whose steps can narrow: --target <member>:<address>.");
|
|
524
|
+
throw err;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
p.targets = targets;
|
|
528
|
+
console.error(formatInfo(`narrowed to ${Object.entries(targets).map(([name, a]) => `${name}: ${a.join(", ")}`).join("; ") || "nothing planned"}`));
|
|
529
|
+
return undefined;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* `ci.lockGrain` of the stage's member (#4552), read from the declaration at
|
|
534
|
+
* base like `ci.locks`, so a change cannot pick its own grain. Undefined when
|
|
535
|
+
* none is declared: each member then takes its lexicon's default.
|
|
536
|
+
*/
|
|
537
|
+
async function declaredLockGrainOf(p: Pick<Prepared, "base" | "member">): Promise<LockGrain | undefined> {
|
|
538
|
+
const { ciLockGrainAt } = await import("../../workspace/ci-lock-grain");
|
|
539
|
+
return ciLockGrainAt(process.cwd(), p.base, p.member) ?? undefined;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Lease the rows a set's members on the resource grain change (#4552),
|
|
544
|
+
* before anything applies: the refusal naming the run that holds one, the
|
|
545
|
+
* exit code when the rows file could not be written, or the lease to let go
|
|
546
|
+
* of once the apply ends (one that holds nothing when no member is on the
|
|
547
|
+
* resource grain).
|
|
548
|
+
*/
|
|
549
|
+
async function leaseSetRows(p: Prepared, set: Pick<PrPlanSet, "locks">): Promise<{ release(): Promise<boolean> } | { held: string } | number> {
|
|
550
|
+
const leased = await leaseRowsOf(p, set);
|
|
551
|
+
return "failed" in leased ? fail(leased.failed) : leased;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* {@link leaseSetRows} without printing a failure (#4594), for a later round
|
|
556
|
+
* of `applyPrSet` (`leaseRound`), which records it on the round, and for a
|
|
557
|
+
* pull request environment's apply, which reports it.
|
|
558
|
+
*/
|
|
559
|
+
export async function leaseRowsOf(p: Pick<Prepared, "gate">, set: Pick<PrPlanSet, "locks">, label = "this apply"): Promise<{ release(): Promise<boolean> } | { held: string } | { failed: string }> {
|
|
560
|
+
const rows = leaseRowsOfLocks(set.locks);
|
|
561
|
+
if (rows.length === 0) return { release: () => Promise.resolve(true) };
|
|
562
|
+
const { leaseLockRows } = await import("../../lifecycle/resource-lock");
|
|
563
|
+
let leased;
|
|
564
|
+
try {
|
|
565
|
+
leased = await leaseLockRows(p.gate, rows);
|
|
566
|
+
} catch (err) {
|
|
567
|
+
return { failed: `could not hold the rows ${label} changes in ${p.gate}, so nothing of it was applied: ${err instanceof Error ? err.message : String(err)}` };
|
|
568
|
+
}
|
|
569
|
+
if (!leased.ok) return { held: `${leased.message}, so nothing of ${label} was applied. Apply again once that run ends; a run that is gone, or whose lease is older than CHANT_LOCK_STALE seconds, is taken over.` };
|
|
570
|
+
for (const h of leased.tookOver) console.error(formatInfo(`took over the rows of run ${h.run}, which is gone`));
|
|
571
|
+
console.error(formatInfo(`${label} holds ${leased.lease.keys.length} row${leased.lease.keys.length === 1 ? "" : "s"} of ${p.gate} while it applies`));
|
|
572
|
+
return leased.lease;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/** `applyPrSet`'s `leaseRound` (#4594): a round after the first leases the rows its own plan locks. */
|
|
576
|
+
export function leaseRoundRows(p: Pick<Prepared, "gate">): NonNullable<Parameters<typeof applyPrSet>[0]["leaseRound"]> {
|
|
577
|
+
return ({ round, set }) => leaseRowsOf(p, set, `round ${round}`);
|
|
578
|
+
}
|
|
579
|
+
|
|
479
580
|
/**
|
|
480
581
|
* How a stage's report settles its run's events (#4041): a refusal waits on
|
|
481
582
|
* a person, as a gate does, and exits the same way.
|
|
@@ -529,7 +630,7 @@ async function publish(forge: PrForge | undefined, report: PrReport, note: strin
|
|
|
529
630
|
// member would put a line on every pull request for each member it skips.
|
|
530
631
|
if (report.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length) return;
|
|
531
632
|
try {
|
|
532
|
-
await forge
|
|
633
|
+
await upsertPlanNote(forge, report.pr, prNoteMarker(report.env, report.member), note);
|
|
533
634
|
} catch (err) {
|
|
534
635
|
console.error(formatWarning({ message: `could not post the note on #${report.pr}: ${err instanceof Error ? err.message : String(err)}` }));
|
|
535
636
|
}
|
|
@@ -556,6 +657,14 @@ async function finish(ctx: CommandContext, p: Prepared, report: PrReport, upload
|
|
|
556
657
|
if (p.routedAway && report.status === "nothing" && !report.message) report = { ...report, message: p.routedAway };
|
|
557
658
|
if (p.policyReport) report = { ...report, policy: p.policyReport };
|
|
558
659
|
if (p.beforeMerge) report = { ...report, beforeMerge: p.beforeMerge };
|
|
660
|
+
// #4617: with a checkout of the control repo named, its entries and apply records mark the cross-stack edges.
|
|
661
|
+
if (report.crossStackEdges?.length && process.env.CHANT_CONTROL_DIR) {
|
|
662
|
+
const { controlEdgeFactsFromEnv, remarkCrossStackEdges } = await import("../../control/edges");
|
|
663
|
+
report = remarkCrossStackEdges(report, await controlEdgeFactsFromEnv());
|
|
664
|
+
}
|
|
665
|
+
// #4573: each member's section its lexicon renders from its own part of the change set.
|
|
666
|
+
const details = await memberDetails(p, report);
|
|
667
|
+
if (details.length > 0) report = { ...report, details };
|
|
559
668
|
const note = noteFor(report, p.forge);
|
|
560
669
|
writeOutputs(ctx, report, note, upload);
|
|
561
670
|
if (!ctx.args.noStatus) await publish(p.forge, report, note);
|
|
@@ -657,9 +766,9 @@ async function judgePolicy(p: Prepared, at: { stage: "plan" | "apply"; op: strin
|
|
|
657
766
|
const why = err instanceof Error ? err.message : String(err);
|
|
658
767
|
if (at.stage === "plan") {
|
|
659
768
|
console.error(formatWarning({ message: `could not read the override ledger, so no override reads as standing: ${why}` }));
|
|
660
|
-
return { held, stop: { refusal: "policy-denied", code:
|
|
769
|
+
return { held, stop: { refusal: "policy-denied", code: CHANT_EXIT.denied, message: `The policy denied this plan: ${denied}.` } };
|
|
661
770
|
}
|
|
662
|
-
return { held, stop: { refusal: "policy-denied", code:
|
|
771
|
+
return { held, stop: { refusal: "policy-denied", code: CHANT_EXIT.denied, message: `The policy denied this plan (${denied}), and the override ledger could not be read or written: ${why}. Nothing was applied.` } };
|
|
663
772
|
}
|
|
664
773
|
if (decided.status === "overridden") {
|
|
665
774
|
report.override = decided.override;
|
|
@@ -674,7 +783,7 @@ async function judgePolicy(p: Prepared, at: { stage: "plan" | "apply"; op: strin
|
|
|
674
783
|
held,
|
|
675
784
|
stop: {
|
|
676
785
|
refusal: "policy-denied",
|
|
677
|
-
code:
|
|
786
|
+
code: CHANT_EXIT.denied,
|
|
678
787
|
message: `The policy denied this plan: ${denied}.${moved} Nothing was applied. ${who} override it: ${decided.command}`,
|
|
679
788
|
},
|
|
680
789
|
};
|
|
@@ -704,6 +813,8 @@ async function prPlan(ctx: CommandContext, stage: StageEvents): Promise<number>
|
|
|
704
813
|
}
|
|
705
814
|
const p = await prepare(ctx, "plan");
|
|
706
815
|
if (typeof p === "number") return p;
|
|
816
|
+
const narrowed = narrowToTargets(p, ctx.args.targets);
|
|
817
|
+
if (narrowed !== undefined) return narrowed;
|
|
707
818
|
const op = prOp(ctx.args.pr, p.member);
|
|
708
819
|
placeHooks(ctx, p, "plan", op);
|
|
709
820
|
const upload = openUpload(stage, "plan", ctx.args.pr, p);
|
|
@@ -755,10 +866,41 @@ async function prPlan(ctx: CommandContext, stage: StageEvents): Promise<number>
|
|
|
755
866
|
printMembers(report);
|
|
756
867
|
if (status === "planned") {
|
|
757
868
|
console.error(formatInfo(`plan : ${report.digest}`));
|
|
758
|
-
console.error(formatInfo(approval.status === "approved" ? `approved by ${(approval.approvedBy ?? []).join(", ")}` : `approve : ${
|
|
869
|
+
console.error(formatInfo(approval.status === "approved" ? `approved by ${(approval.approvedBy ?? []).join(", ")}` : `approve : ${prApproveCommands(report).join("; ")}`));
|
|
759
870
|
}
|
|
760
871
|
if (judged.stop) console.error(formatWarning({ message: judged.stop.message }));
|
|
761
|
-
|
|
872
|
+
// #4550: a capability's policy denial (pulumi-up's CrossGuard) exits as a denial, 7, not as a failed plan.
|
|
873
|
+
if (status === "plan-failed" && set.policyDenied) return CHANT_EXIT.denied;
|
|
874
|
+
return status === "plan-failed" ? CHANT_EXIT.failed : judged.stop ? judged.stop.code : CHANT_EXIT.done;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* The member detail sections (#4573): each lexicon the project lists that
|
|
879
|
+
* renders one (`prNoteDetail`) gets each member's part of the change set. A
|
|
880
|
+
* lexicon that cannot load, or throws, leaves the note as it was.
|
|
881
|
+
*/
|
|
882
|
+
async function memberDetails(p: Prepared, report: PrReport): Promise<PrMemberDetail[]> {
|
|
883
|
+
if (report.changeSet.members.length === 0) return [];
|
|
884
|
+
const { loadPlugin } = await import("../plugins");
|
|
885
|
+
const out: PrMemberDetail[] = [];
|
|
886
|
+
for (const name of lexiconNames(p.config.lexicons ?? [])) {
|
|
887
|
+
let plugin: Awaited<ReturnType<typeof loadPlugin>>;
|
|
888
|
+
try {
|
|
889
|
+
plugin = await loadPlugin(name);
|
|
890
|
+
} catch {
|
|
891
|
+
continue;
|
|
892
|
+
}
|
|
893
|
+
if (!plugin.prNoteDetail) continue;
|
|
894
|
+
for (const member of report.changeSet.members) {
|
|
895
|
+
try {
|
|
896
|
+
const detail = await plugin.prNoteDetail({ member: member.member, changeSet: report.changeSet, stage: report.stage });
|
|
897
|
+
if (detail && detail.lines.length > 0) out.push({ member: member.member, ...(detail.title ? { title: detail.title } : {}), lines: detail.lines });
|
|
898
|
+
} catch (err) {
|
|
899
|
+
console.error(formatWarning({ message: `the ${name} lexicon could not render ${member.member}'s detail: ${err instanceof Error ? err.message : String(err)}` }));
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return out;
|
|
762
904
|
}
|
|
763
905
|
|
|
764
906
|
/**
|
|
@@ -806,12 +948,13 @@ async function overdueOps(forge: PrForge | undefined, member: string | undefined
|
|
|
806
948
|
return overdueOpsAt({ forge, cwd: resolve("."), ...(member ? { member } : {}), log: (line) => console.error(formatWarning({ message: line })) });
|
|
807
949
|
}
|
|
808
950
|
|
|
809
|
-
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
951
|
+
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--before-merge [--requires <list>]] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
810
952
|
export function runComponentsPrApply(ctx: CommandContext): Promise<number> {
|
|
811
953
|
if (refusesEventsWithJson(ctx.args, "the stage's report")) return Promise.resolve(1);
|
|
812
954
|
return withStageEvents("pr-apply", ctx, async (events) => {
|
|
813
955
|
// #4301: an apply before merge asks the forge its requires checks before any of the head's code loads, the config included.
|
|
814
956
|
let beforeMerge: PrBeforeMerge | undefined;
|
|
957
|
+
if (ctx.args.requires && !ctx.args.beforeMerge) return fail("--requires names the checks of an apply before merge, so it needs --before-merge --pr <n>");
|
|
815
958
|
if (ctx.args.beforeMerge) {
|
|
816
959
|
const checked = await beforeMergeChecks(ctx);
|
|
817
960
|
if (typeof checked === "number") return checked;
|
|
@@ -870,7 +1013,7 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
870
1013
|
const set: PrPlanSet = { doc: composeChangeSet([]), members: [], plans: {}, outputs: {}, failed: false };
|
|
871
1014
|
return stopper(ctx, p, events, upload)(
|
|
872
1015
|
prReport({ stage: "apply", 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, approval: { status: "pending" }, status: "refused", refusal: "locked", message: held }),
|
|
873
|
-
|
|
1016
|
+
CHANT_EXIT.held,
|
|
874
1017
|
);
|
|
875
1018
|
}
|
|
876
1019
|
}
|
|
@@ -930,12 +1073,22 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
930
1073
|
...base,
|
|
931
1074
|
approval: { status: "pending" },
|
|
932
1075
|
status: "plan-failed",
|
|
933
|
-
message:
|
|
1076
|
+
message: set.policyDenied
|
|
1077
|
+
? "The policy denied a member's plan, so nothing was applied."
|
|
1078
|
+
: "A member failed to plan, so there is no plan to compare with the approved one. Nothing was applied.",
|
|
934
1079
|
}),
|
|
935
|
-
1,
|
|
1080
|
+
set.policyDenied ? CHANT_EXIT.denied : 1,
|
|
936
1081
|
);
|
|
937
1082
|
}
|
|
938
1083
|
|
|
1084
|
+
// #4552, ruling D: on the resource grain a pull request's locks name row keys, which only the plan knows.
|
|
1085
|
+
const lockTargets = lockTargetsOf(p.plan.order, set.locks);
|
|
1086
|
+
if (locks && anyResourceGrain(set.locks)) {
|
|
1087
|
+
const held = await heldLocksOf(p, pr, lockTargets);
|
|
1088
|
+
if (typeof held === "number") return held;
|
|
1089
|
+
if (held) return stop(prReport({ ...base, approval: { status: "pending" }, status: "refused", refusal: "locked", message: held }), CHANT_EXIT.held);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
939
1092
|
// #4022: keep the change set the gate binds on chant/lifecycle under its
|
|
940
1093
|
// digest before deciding the gate, so the plan an approval bound, or the
|
|
941
1094
|
// one a pending fact waits on, can be read once this job is gone.
|
|
@@ -955,7 +1108,7 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
955
1108
|
// #4323: the after-gate hooks hear the decision, a refusal too; only a failure that would have applied changes the outcome.
|
|
956
1109
|
const afterGate = await runGateHook(p, { op, digest: set.doc.digest, satisfied: decided.satisfied }, p.plan.order);
|
|
957
1110
|
if (afterGate && decided.satisfied) return stop(prReport({ ...base, approval, status: "failed", message: afterGate }), 1);
|
|
958
|
-
if (!decided.satisfied) return stop(prReport({ ...base, approval, status: "refused", refusal: decided.refusal, message: decided.message }),
|
|
1111
|
+
if (!decided.satisfied) return stop(prReport({ ...base, approval, status: "refused", refusal: decided.refusal, message: decided.message }), decided.refusal === "plan-changed" ? CHANT_EXIT.moved : CHANT_EXIT.waiting);
|
|
959
1112
|
via = decided.via;
|
|
960
1113
|
}
|
|
961
1114
|
|
|
@@ -970,10 +1123,14 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
970
1123
|
if (unspent) return stop(prReport({ ...base, approval, status: "refused", refusal: "policy-denied", message: unspent }), 1);
|
|
971
1124
|
// #4293, #4301: under ci.locks an apply before merge holds its targets until the pull request merges or closes.
|
|
972
1125
|
if (locks && beforeMerge && pr !== null) {
|
|
973
|
-
const taken = await takeApplyLocks(p, pr);
|
|
1126
|
+
const taken = await takeApplyLocks(p, pr, lockTargets);
|
|
974
1127
|
if (typeof taken === "number") return taken;
|
|
975
|
-
if (taken) return stop(prReport({ ...base, approval, status: "refused", refusal: "locked", message: taken }),
|
|
1128
|
+
if (taken) return stop(prReport({ ...base, approval, status: "refused", refusal: "locked", message: taken }), CHANT_EXIT.held);
|
|
976
1129
|
}
|
|
1130
|
+
// #4552: on the resource grain the apply leases the rows it changes, whatever ci.locks says, and lets go when it ends.
|
|
1131
|
+
const lease = await leaseSetRows(p, set);
|
|
1132
|
+
if (typeof lease === "number") return lease;
|
|
1133
|
+
if ("held" in lease) return stop(prReport({ ...base, approval, status: "refused", refusal: "locked", message: lease.held }), CHANT_EXIT.held);
|
|
977
1134
|
|
|
978
1135
|
// The record is written before the first component runs and again as each
|
|
979
1136
|
// one settles, so a run killed partway still knows what applied.
|
|
@@ -1010,7 +1167,10 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
1010
1167
|
// #4288: the before-apply hooks, once the gate and the review let the apply through.
|
|
1011
1168
|
const toApply = (resumed?.plan ?? p.plan).order.filter((name) => !completedSoFar.has(name));
|
|
1012
1169
|
const beforeFailed = await runStageHook(p, "before-apply", toApply);
|
|
1013
|
-
if (beforeFailed)
|
|
1170
|
+
if (beforeFailed) {
|
|
1171
|
+
await lease.release();
|
|
1172
|
+
return stop(prReport({ ...base, approval, status: "failed", message: beforeFailed }), 1);
|
|
1173
|
+
}
|
|
1014
1174
|
|
|
1015
1175
|
// #3999: a round planned after an upstream applied waits on a gate of its
|
|
1016
1176
|
// own, under the same identity.gates rule and the same review checks.
|
|
@@ -1036,37 +1196,47 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
1036
1196
|
return { satisfied: true, approval: roundApproval };
|
|
1037
1197
|
};
|
|
1038
1198
|
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1199
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
1200
|
+
let applied: Awaited<ReturnType<typeof applyPrSet>>;
|
|
1201
|
+
try {
|
|
1202
|
+
applied = await applyPrSet({
|
|
1203
|
+
components: p.components,
|
|
1204
|
+
plan: resumed?.plan ?? p.plan,
|
|
1205
|
+
registry: p.registry,
|
|
1206
|
+
env: p.env,
|
|
1207
|
+
set,
|
|
1208
|
+
...(lockGrain ? { lockGrain } : {}),
|
|
1209
|
+
policyBase: p.base,
|
|
1210
|
+
gate: p.gate,
|
|
1211
|
+
approval,
|
|
1212
|
+
decideRound,
|
|
1213
|
+
// #4594: a later round's plan may change rows the first did not, so it leases its own.
|
|
1214
|
+
leaseRound: leaseRoundRows(p),
|
|
1215
|
+
...(resumed ? { resumed: prior } : {}),
|
|
1216
|
+
// The apply is this run's waves, so the fan-out's own run framing is
|
|
1217
|
+
// dropped. The log's lines go to stderr with or without --events-json.
|
|
1218
|
+
onRunEvent: (body: RunEventBody) => {
|
|
1219
|
+
events?.nested(body);
|
|
1220
|
+
log(body);
|
|
1221
|
+
},
|
|
1222
|
+
...(resumePath
|
|
1223
|
+
? {
|
|
1224
|
+
onComponentSettled: (settled, outputs) => {
|
|
1225
|
+
if (settled.status === "ok") {
|
|
1226
|
+
completedSoFar.add(settled.component);
|
|
1227
|
+
if (inputsNow[settled.component] !== undefined) inputsSoFar[settled.component] = inputsNow[settled.component]!;
|
|
1228
|
+
if (outputs) outputsSoFar[settled.component] = outputs;
|
|
1229
|
+
} else if (settled.status === "fail") {
|
|
1230
|
+
failedSoFar.push(settled.component);
|
|
1231
|
+
}
|
|
1232
|
+
recordAttempt();
|
|
1233
|
+
},
|
|
1234
|
+
}
|
|
1235
|
+
: {}),
|
|
1236
|
+
});
|
|
1237
|
+
} finally {
|
|
1238
|
+
await lease.release();
|
|
1239
|
+
}
|
|
1070
1240
|
recordAttempt();
|
|
1071
1241
|
// #4288: the after-apply hooks, for the components that applied.
|
|
1072
1242
|
const afterFailed = await runStageHook(p, "after-apply", toApply.filter((name) => applied.run.completed.includes(name)), undefined, "the apply counts as failed though its components applied");
|
|
@@ -1078,12 +1248,23 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
1078
1248
|
members: applied.members,
|
|
1079
1249
|
...(resumed ? { resumed: resumed.completed } : {}),
|
|
1080
1250
|
...(applied.rounds ? { rounds: applied.rounds } : {}),
|
|
1081
|
-
...(applied.status === "waiting" ? { message: waitingMessage(op, applied.rounds) } : {}),
|
|
1251
|
+
...(applied.held ? { message: applied.held } : applied.leaseFailed ? { message: applied.leaseFailed } : applied.status === "waiting" ? { message: waitingMessage(op, applied.rounds) } : {}),
|
|
1082
1252
|
});
|
|
1083
1253
|
// A component that stopped at a gate of its own leaves the apply waiting on
|
|
1084
1254
|
// a person. A step that refused its plan because the target moved since
|
|
1085
|
-
// the approval exits
|
|
1086
|
-
|
|
1255
|
+
// the approval exits 4 (moved), as a moved digest does before anything applies (#3997, #4553).
|
|
1256
|
+
// A later round whose rows another run holds exits 5 (held, #4594).
|
|
1257
|
+
const exit = afterFailed
|
|
1258
|
+
? 1
|
|
1259
|
+
: applied.held
|
|
1260
|
+
? CHANT_EXIT.held
|
|
1261
|
+
: applied.status === "applied"
|
|
1262
|
+
? 0
|
|
1263
|
+
: applied.status === "waiting"
|
|
1264
|
+
? GATED_EXIT_CODE
|
|
1265
|
+
: applied.leaseFailed
|
|
1266
|
+
? 1
|
|
1267
|
+
: failedRunExitCode(applied.run.results);
|
|
1087
1268
|
if (green && applied.status === "applied") await recordGreenApplied(p, green, set.doc.digest, approval, via);
|
|
1088
1269
|
const code = await stop(report, exit, applied.run.status === "gated" ? "gated" : undefined);
|
|
1089
1270
|
if (applied.status === "applied" && !afterFailed) console.error(formatSuccess(`applied the plan ${report.digest} approved by ${(approval.approvedBy ?? []).join(", ")}`));
|
|
@@ -1098,12 +1279,12 @@ async function prApply(ctx: CommandContext, stage: StageEvents, beforeMerge?: Pr
|
|
|
1098
1279
|
* `--forge` every lock counts. A lock file that cannot be read stops the
|
|
1099
1280
|
* apply, since nothing then says the targets are free.
|
|
1100
1281
|
*/
|
|
1101
|
-
async function heldLocksOf(p: Prepared, pr: number | null): Promise<string | null | number> {
|
|
1282
|
+
async function heldLocksOf(p: Prepared, pr: number | null, targets: readonly string[] = p.plan.order): Promise<string | null | number> {
|
|
1102
1283
|
const { heldTargetLocks, describeHeldTargetLocks } = await import("../../lifecycle/target-lock");
|
|
1103
1284
|
const isOpen = p.forge?.pullRequestOpen?.bind(p.forge);
|
|
1104
1285
|
let held;
|
|
1105
1286
|
try {
|
|
1106
|
-
held = await heldTargetLocks(p.gate,
|
|
1287
|
+
held = await heldTargetLocks(p.gate, targets, pr, { ...(isOpen ? { isOpen } : {}) });
|
|
1107
1288
|
} catch (err) {
|
|
1108
1289
|
return fail(`could not read the target locks of ${p.gate}, so nothing was applied: ${err instanceof Error ? err.message : String(err)}`);
|
|
1109
1290
|
}
|
|
@@ -1127,6 +1308,10 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
|
|
|
1127
1308
|
if (args.pr === undefined) return fail("--before-merge applies an open pull request, so it needs --pr <n>");
|
|
1128
1309
|
if (!args.forge || !(FORGE_KINDS as readonly string[]).includes(args.forge)) return fail("--before-merge asks the forge whether the pull request is ready, so it needs --forge github|gitlab|forgejo");
|
|
1129
1310
|
if (!args.base) return fail("pr-apply needs the commit the change is measured from: --base <ref>", "Before merge, the target branch's commit.");
|
|
1311
|
+
const { checkPrRequires, unmetRequires, parseRequiresList } = await import("../../pr-requires");
|
|
1312
|
+
// #4607: a product's `apply.requires` names the checks to ask; absent, all four.
|
|
1313
|
+
const only = args.requires ? parseRequiresList(args.requires) : undefined;
|
|
1314
|
+
if (only && "error" in only) return fail(only.error);
|
|
1130
1315
|
const cwd = resolve(".");
|
|
1131
1316
|
let forge: PrForge;
|
|
1132
1317
|
let head: string;
|
|
@@ -1142,7 +1327,6 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
|
|
|
1142
1327
|
const gate = args.gate ?? PR_APPLY_GATE;
|
|
1143
1328
|
const { ciWorkflowAt } = await import("../../workspace/ci-workflow-at");
|
|
1144
1329
|
const { appliesBeforeMerge } = await import("../../workspace/ci-workflow");
|
|
1145
|
-
const { checkPrRequires, unmetRequires } = await import("../../pr-requires");
|
|
1146
1330
|
const workflow = ciWorkflowAt(cwd, args.base, member);
|
|
1147
1331
|
const early = earlyStop(ctx, forge, { pr: args.pr, base, head, gate, ...(member ? { member } : {}) });
|
|
1148
1332
|
if (!appliesBeforeMerge(workflow)) {
|
|
@@ -1154,9 +1338,10 @@ async function beforeMergeChecks(ctx: CommandContext): Promise<PrBeforeMerge | n
|
|
|
1154
1338
|
);
|
|
1155
1339
|
}
|
|
1156
1340
|
// The apply's own statuses never hold it back: chant ci run's, and the report's.
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1341
|
+
// #4550: under a product's words its own prefix too.
|
|
1342
|
+
const ignore = [...new Set([productContext(activeProductWords(), gate), productContext(activeProductWords(), PR_APPLY_GATE), `chant/${gate}`, `chant/${PR_APPLY_GATE}`, prStatusContext("apply", member)])];
|
|
1343
|
+
// ws-106 gives the declaration no way to leave a check out, so with no --requires all four are asked (#4336, #4607).
|
|
1344
|
+
const requires = await checkPrRequires(forge, args.pr, head, { ignore, ...(only ? { only: only.checks } : {}) });
|
|
1160
1345
|
for (const r of requires) console.error(formatInfo(`${r.name}: ${r.passed ? "passed" : r.pending ? "pending" : "unmet"}, ${r.reason}`));
|
|
1161
1346
|
const unmet = unmetRequires(requires);
|
|
1162
1347
|
if (unmet) {
|
|
@@ -1183,13 +1368,13 @@ function earlyStop(ctx: CommandContext, forge: PrForge, at: { pr: number; base:
|
|
|
1183
1368
|
* refusal when another open pull request holds one, null once taken, or the
|
|
1184
1369
|
* exit code when the locks could not be written.
|
|
1185
1370
|
*/
|
|
1186
|
-
async function takeApplyLocks(p: Prepared, pr: number): Promise<string | null | number> {
|
|
1371
|
+
async function takeApplyLocks(p: Prepared, pr: number, targets: readonly string[] = p.plan.order): Promise<string | null | number> {
|
|
1187
1372
|
const { takeTargetLocks, describeHeldTargetLocks } = await import("../../lifecycle/target-lock");
|
|
1188
1373
|
const isOpen = p.forge?.pullRequestOpen?.bind(p.forge);
|
|
1189
1374
|
const by = process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER ?? "unknown";
|
|
1190
1375
|
let result;
|
|
1191
1376
|
try {
|
|
1192
|
-
result = await takeTargetLocks(p.gate,
|
|
1377
|
+
result = await takeTargetLocks(p.gate, targets, { pr, by, at: new Date().toISOString(), stage: "apply", head: p.head }, { ...(isOpen ? { isOpen } : {}) });
|
|
1193
1378
|
} catch (err) {
|
|
1194
1379
|
return fail(`could not take the target locks of ${p.gate}, so nothing was applied: ${err instanceof Error ? err.message : String(err)}`);
|
|
1195
1380
|
}
|
|
@@ -1541,6 +1726,11 @@ function settleWords(body: RunEventComponentSettle): string {
|
|
|
1541
1726
|
* pr-apply's job log (#4007): a line on stderr as each wave starts and as
|
|
1542
1727
|
* each component settles, so the log shows the waves in order while they run.
|
|
1543
1728
|
*/
|
|
1729
|
+
/** One wave's fan-out numbers its wave 1; the events and the log carry the derivation's number (#4003). */
|
|
1730
|
+
function inWave(body: RunEventBody, wave: number): RunEventBody {
|
|
1731
|
+
return "wave" in body && typeof (body as { wave?: unknown }).wave === "number" ? ({ ...body, wave } as RunEventBody) : body;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1544
1734
|
function applyLog(): (body: RunEventBody) => void {
|
|
1545
1735
|
let waves = 0;
|
|
1546
1736
|
return (body) => {
|
|
@@ -1646,8 +1836,10 @@ async function tryResume(p: Prepared, attempt: FanOutAttempt, file: string, op:
|
|
|
1646
1836
|
registry: p.registry,
|
|
1647
1837
|
env: p.env,
|
|
1648
1838
|
seededOutputs: p.seededOutputs,
|
|
1839
|
+
policyBase: p.base,
|
|
1649
1840
|
record,
|
|
1650
1841
|
completed,
|
|
1842
|
+
applied: outputs,
|
|
1651
1843
|
});
|
|
1652
1844
|
if (!resumed.ok) return skip(`what is left is not what was approved. ${resumed.reasons.join("; ")}`);
|
|
1653
1845
|
console.error(formatInfo(`resume : ${completed.join(", ")} applied in an earlier attempt; applying ${resumed.plan.order.join(", ") || "nothing more"} under the approval of ${record.digest}`));
|
|
@@ -1702,22 +1894,20 @@ async function carryWaves(p: Prepared, attempt: FanOutAttempt, file: string, op:
|
|
|
1702
1894
|
return { record, check, approval: approvalOf(check), completed, outputs };
|
|
1703
1895
|
}
|
|
1704
1896
|
|
|
1705
|
-
/** A run event with its wave renumbered to `wave`: the fan-out that applies one wave numbers it 1. */
|
|
1706
|
-
function inWave(body: RunEventBody, wave: number): RunEventBody {
|
|
1707
|
-
return "wave" in body && typeof (body as { wave?: unknown }).wave === "number" ? ({ ...body, wave } as RunEventBody) : body;
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
1897
|
/**
|
|
1711
1898
|
* `pr-apply --wave-gate <gate>` (#4003): apply the pull request's approved
|
|
1712
1899
|
* set a wave at a time, each wave planned after the one before it applied.
|
|
1713
1900
|
*
|
|
1714
1901
|
* The first job plans every member, as pr-apply does, and decides the pull
|
|
1715
|
-
* request's gate against that digest.
|
|
1716
|
-
*
|
|
1717
|
-
*
|
|
1718
|
-
* (`
|
|
1719
|
-
*
|
|
1720
|
-
*
|
|
1902
|
+
* request's gate against that digest. The waves then run on op waves
|
|
1903
|
+
* (#4588): the component waves spec (`componentWavesSpec`), each run a
|
|
1904
|
+
* component, planned and applied through the component plan-wave and
|
|
1905
|
+
* apply-wave steps (`chant components plan-wave|apply-wave`). Each wave is
|
|
1906
|
+
* planned against the outputs the waves before it left. When the approved
|
|
1907
|
+
* change set covers its plan (`planCoveredBy`, the op waves' `pull-request`
|
|
1908
|
+
* approval) it applies under the pull request's approval; when it does not,
|
|
1909
|
+
* it waits at `<gate>-wave-<k>` under the pull request's op for an approval
|
|
1910
|
+
* of its new plan, and exits 3.
|
|
1721
1911
|
*
|
|
1722
1912
|
* With `--wave <k>` the job runs wave k and no other, reading the approved
|
|
1723
1913
|
* set and the progress from the `--resume` record the job before it left.
|
|
@@ -1838,7 +2028,6 @@ async function prApplyWaves(
|
|
|
1838
2028
|
);
|
|
1839
2029
|
}
|
|
1840
2030
|
|
|
1841
|
-
let planned: PrPlanSet | undefined;
|
|
1842
2031
|
let judged: PolicyJudged = { held: false };
|
|
1843
2032
|
if (carry) {
|
|
1844
2033
|
// What the earlier waves applied settles first (#4007), each in its own wave, as a resumed apply's does.
|
|
@@ -1854,6 +2043,7 @@ async function prApplyWaves(
|
|
|
1854
2043
|
const set = await planAll(p, events?.emit);
|
|
1855
2044
|
approved = set;
|
|
1856
2045
|
if (set.failed) {
|
|
2046
|
+
if (set.policyDenied) return stop(report({ status: "plan-failed", message: "The policy denied a member's plan, so nothing was applied." }), CHANT_EXIT.denied);
|
|
1857
2047
|
return stop(report({ status: "plan-failed", message: "A member failed to plan, so there is no plan to compare with the approved one. Nothing was applied." }), 1);
|
|
1858
2048
|
}
|
|
1859
2049
|
await storeChangeSetForGate(ctx, p, set.doc);
|
|
@@ -1865,9 +2055,8 @@ async function prApplyWaves(
|
|
|
1865
2055
|
// #4323: the after-gate hooks hear the decision, a refusal too.
|
|
1866
2056
|
const afterGate = await runGateHook(p, { op, digest: set.doc.digest, satisfied: decided.satisfied }, p.plan.order);
|
|
1867
2057
|
if (afterGate && decided.satisfied) return stop(report({ status: "failed", message: afterGate }), 1);
|
|
1868
|
-
if (!decided.satisfied) return stop(report({ status: "refused", refusal: decided.refusal, message: decided.message }),
|
|
2058
|
+
if (!decided.satisfied) return stop(report({ status: "refused", refusal: decided.refusal, message: decided.message }), decided.refusal === "plan-changed" ? CHANT_EXIT.moved : CHANT_EXIT.waiting);
|
|
1869
2059
|
via = decided.via;
|
|
1870
|
-
planned = set;
|
|
1871
2060
|
}
|
|
1872
2061
|
const approvedSet = approved!;
|
|
1873
2062
|
|
|
@@ -1911,8 +2100,11 @@ async function prApplyWaves(
|
|
|
1911
2100
|
const from = only ?? (left || total + 1);
|
|
1912
2101
|
const to = only ?? total;
|
|
1913
2102
|
/** The last apply in this job that failed (#4291): its results give the exit code once every wave ran. */
|
|
1914
|
-
let lastFailure: {
|
|
2103
|
+
let lastFailure: { exitCode: number } | undefined;
|
|
1915
2104
|
let planFailedIn: number | undefined;
|
|
2105
|
+
// #4588: the outputs file the waves' plan-wave and apply-wave steps hand outputs on in.
|
|
2106
|
+
const { componentWaveOutputsFile } = await import("../../components/product-pipeline");
|
|
2107
|
+
const outputsFile = componentWaveOutputsFile(op);
|
|
1916
2108
|
for (let k = from; k <= to; k++) {
|
|
1917
2109
|
// #4291: a component of this wave whose upstream failed, or was blocked by a failure, is blocked; the rest of the wave runs.
|
|
1918
2110
|
const before = new Set(p.plan.waves.slice(0, k - 1).flat());
|
|
@@ -1931,138 +2123,59 @@ async function prApplyWaves(
|
|
|
1931
2123
|
if (blockedNow.size > 0) recordAttempt();
|
|
1932
2124
|
continue;
|
|
1933
2125
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
// they are the approved set's. Every other wave is planned again, against
|
|
1938
|
-
// the outputs the waves before it left.
|
|
1939
|
-
let set: PrPlanSet;
|
|
1940
|
-
let entry: PrWave;
|
|
1941
|
-
if (planned && k === 1) {
|
|
1942
|
-
set = {
|
|
1943
|
-
...planned,
|
|
1944
|
-
members: planned.members.filter((m) => inThisWave.has(m.component)),
|
|
1945
|
-
plans: Object.fromEntries(Object.entries(planned.plans).filter(([name]) => inThisWave.has(name))),
|
|
1946
|
-
};
|
|
1947
|
-
entry = { wave: k, components: wavePlan.order, status: "applied", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest, ...(approval.approvedBy ? { approvedBy: approval.approvedBy } : {}) };
|
|
1948
|
-
} else {
|
|
1949
|
-
const notApplied = Object.fromEntries(Object.entries(approvedSet.outputs).filter(([name]) => !completed.has(name)));
|
|
1950
|
-
const fresh = await hookedPlan(p, wavePlan.order, () =>
|
|
1951
|
-
planPrSet({
|
|
1952
|
-
components: p.components,
|
|
1953
|
-
plan: wavePlan,
|
|
1954
|
-
registry: p.registry,
|
|
1955
|
-
env: p.env,
|
|
1956
|
-
seededOutputs: { ...p.seededOutputs, ...notApplied, ...outputsSoFar },
|
|
1957
|
-
...(events ? { onRunEvent: (body: RunEventBody) => events.emit(body) } : {}),
|
|
1958
|
-
}),
|
|
1959
|
-
);
|
|
1960
|
-
if (fresh.failed) {
|
|
1961
|
-
for (const m of fresh.members) {
|
|
1962
|
-
after.set(m.member, m);
|
|
1963
|
-
if (m.status === "plan-failed") failedSoFar.add(m.component);
|
|
1964
|
-
}
|
|
1965
|
-
setWave({ wave: k, components: wavePlan.order, status: "plan-failed", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest });
|
|
1966
|
-
// #4291: the later waves still run what does not depend on this wave.
|
|
1967
|
-
console.error(formatWarning({ message: `A member of wave ${k} failed to plan, so nothing in wave ${k} was applied.`, hint: "The waves after it apply what does not depend on wave " + k + "." }));
|
|
1968
|
-
planFailedIn ??= k;
|
|
1969
|
-
continue;
|
|
1970
|
-
}
|
|
1971
|
-
const moved = waveNotCovered(approvedSet.doc, fresh.doc, approvedSet.members, { approved: approvedSet.shapes, fresh: fresh.shapes });
|
|
1972
|
-
set = fresh;
|
|
1973
|
-
if (moved.length === 0) {
|
|
1974
|
-
console.error(formatInfo(`wave ${k}: the approved plan covers what it plans now, so it applies under the pull request's approval`));
|
|
1975
|
-
entry = { wave: k, components: wavePlan.order, status: "applied", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest, ...(approval.approvedBy ? { approvedBy: approval.approvedBy } : {}) };
|
|
1976
|
-
} else {
|
|
1977
|
-
const gate = waveGateName(waveGate, k);
|
|
1978
|
-
const digest = fresh.doc.digest;
|
|
1979
|
-
console.error(formatInfo(`wave ${k}: its plan moved since the pull request's (${moved.join("; ")}), so it needs an approval of ${gate}`));
|
|
1980
|
-
await storeChangeSetForGate(ctx, p, fresh.doc);
|
|
1981
|
-
writeWaveChangeSet(ctx, k, fresh.doc, upload);
|
|
1982
|
-
const approveLine = prApproveCommand({ op, gate, digest });
|
|
1983
|
-
const check = await emitGateStep(
|
|
1984
|
-
events?.emit,
|
|
1985
|
-
{ op, gate },
|
|
1986
|
-
() => decidePrGate(gitGateLedgerPort(), { op, gate, digest, description: `${changeLabel(pr, green)}, wave ${k} of ${total}: ${wavePlan.order.join(", ")}` }),
|
|
1987
|
-
(unapproved) =>
|
|
1988
|
-
unapproved.mismatch
|
|
1989
|
-
? `wave ${k}'s plan changed after its approval. Approve the plan now: ${approveLine}`
|
|
1990
|
-
: `wave ${k}'s plan is not the one the pull request approved. Approve it: ${approveLine}`,
|
|
1991
|
-
);
|
|
1992
|
-
const waveApproval = approvalOf(check);
|
|
1993
|
-
const waiting: PrWave = {
|
|
1994
|
-
wave: k,
|
|
1995
|
-
components: wavePlan.order,
|
|
1996
|
-
status: "waiting",
|
|
1997
|
-
approval: "wave",
|
|
1998
|
-
gate,
|
|
1999
|
-
digest,
|
|
2000
|
-
moved,
|
|
2001
|
-
...(waveApproval.approved ? { approved: waveApproval.approved } : {}),
|
|
2002
|
-
};
|
|
2003
|
-
if (!check.satisfied) {
|
|
2004
|
-
setWave(waiting);
|
|
2005
|
-
const message =
|
|
2006
|
-
waveApproval.status === "changed"
|
|
2007
|
-
? `Wave ${k}'s plan changed after its approval, so nothing in it was applied. approved: ${waveApproval.approved ?? "(none)"}; planned now: ${digest}. ` +
|
|
2008
|
-
`Read the new plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`
|
|
2009
|
-
: `Wave ${k} was planned after the waves before it applied, and the pull request's approved plan does not cover it: ${moved.join("; ")}. ` +
|
|
2010
|
-
`Nothing in wave ${k} was applied. Read its plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`;
|
|
2011
|
-
return stop(report({ status: "refused", refusal: waveApproval.status === "changed" ? "wave-plan-changed" : "wave-not-approved", message }), GATED_EXIT_CODE);
|
|
2012
|
-
}
|
|
2013
|
-
const waveReview = await review(waveApproval.approvedBy ?? [], `Wave ${k}'s plan`);
|
|
2014
|
-
if (waveReview && "error" in waveReview) return fail(waveReview.error);
|
|
2015
|
-
if (waveReview) {
|
|
2016
|
-
setWave(waiting);
|
|
2017
|
-
emitReviewStop(events, waveReview.message);
|
|
2018
|
-
return stop(report({ status: "refused", refusal: waveReview.refusal, message: waveReview.message }), GATED_EXIT_CODE);
|
|
2019
|
-
}
|
|
2020
|
-
entry = { wave: k, components: wavePlan.order, status: "applied", approval: "wave", gate, digest, moved, ...(waveApproval.approvedBy ? { approvedBy: waveApproval.approvedBy } : {}) };
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2126
|
+
// #4588: the wave plans, waits or passes its gate, and applies on op waves: the component waves spec,
|
|
2127
|
+
// each run a component, through the component plan-wave and apply-wave steps.
|
|
2128
|
+
const pending: PrWave = { wave: k, components: wavePlan.order, status: "applied", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest };
|
|
2024
2129
|
// #4288: the wave's apply-side hooks, around its apply.
|
|
2025
2130
|
const waveBefore = await runStageHook(p, "before-apply", wavePlan.order, undefined, `nothing in wave ${k} was applied`);
|
|
2026
2131
|
if (waveBefore) {
|
|
2027
|
-
setWave({ ...
|
|
2132
|
+
setWave({ ...pending, status: "failed" });
|
|
2028
2133
|
return stop(report({ status: "failed", message: waveBefore }), 1);
|
|
2029
2134
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
if (settled.status === "ok") {
|
|
2044
|
-
completed.add(settled.component);
|
|
2045
|
-
failedSoFar.delete(settled.component);
|
|
2046
|
-
if (inputsNow[settled.component] !== undefined) inputsSoFar[settled.component] = inputsNow[settled.component]!;
|
|
2047
|
-
if (outputs) outputsSoFar[settled.component] = outputs;
|
|
2048
|
-
} else if (settled.status === "fail") {
|
|
2049
|
-
failedSoFar.add(settled.component);
|
|
2050
|
-
}
|
|
2051
|
-
recordAttempt();
|
|
2052
|
-
},
|
|
2053
|
-
});
|
|
2054
|
-
for (const m of applied.members) after.set(m.member, m);
|
|
2055
|
-
for (const name of applied.run.completed) {
|
|
2135
|
+
// The outputs the waves before this one left, and the approved set's for what has not applied yet, seed its plans.
|
|
2136
|
+
const notApplied = Object.fromEntries(Object.entries(approvedSet.outputs).filter(([name]) => !completed.has(name)));
|
|
2137
|
+
mkdirSync(dirname(resolve(outputsFile)), { recursive: true });
|
|
2138
|
+
writeFileSync(resolve(outputsFile), JSON.stringify({ ...p.seededOutputs, ...notApplied, ...outputsSoFar }, null, 2) + "\n");
|
|
2139
|
+
const ran = await runComponentWave(p, { op, waveGate, k, runs: wavePlan.order, approved: approvedSet.doc, approvedBy: approval.approvedBy ?? [], outputsFile, ...(args.noReleaseRecord ? { noReleaseRecord: true } : {}), review, ...(events ? { events } : {}), log });
|
|
2140
|
+
const entry = ran.entry;
|
|
2141
|
+
if (ran.review && "error" in ran.review) return fail(ran.review.error);
|
|
2142
|
+
if (ran.review && ran.exitCode === CHANT_EXIT.waiting) {
|
|
2143
|
+
setWave(entry);
|
|
2144
|
+
emitReviewStop(events, ran.review.message);
|
|
2145
|
+
return stop(report({ status: "refused", refusal: ran.review.refusal, message: ran.review.message }), GATED_EXIT_CODE);
|
|
2146
|
+
}
|
|
2147
|
+
for (const name of ran.applied) {
|
|
2056
2148
|
completed.add(name);
|
|
2057
|
-
|
|
2058
|
-
if (
|
|
2149
|
+
failedSoFar.delete(name);
|
|
2150
|
+
if (inputsNow[name] !== undefined) inputsSoFar[name] = inputsNow[name]!;
|
|
2151
|
+
if (ran.outputs[name]) outputsSoFar[name] = ran.outputs[name]!;
|
|
2152
|
+
}
|
|
2153
|
+
for (const name of ran.failed) failedSoFar.add(name);
|
|
2154
|
+
if (ran.exitCode === CHANT_EXIT.waiting || ran.exitCode === CHANT_EXIT.moved) {
|
|
2155
|
+
setWave(entry);
|
|
2156
|
+
// #4003: the wave's new plan beside the report, for whoever approves its gate.
|
|
2157
|
+
if (ran.changeSet) writeWaveChangeSet(ctx, k, ran.changeSet, upload);
|
|
2158
|
+
const approveLine = prApproveCommand({ op, gate: entry.gate, digest: entry.digest });
|
|
2159
|
+
const message =
|
|
2160
|
+
ran.exitCode === CHANT_EXIT.moved
|
|
2161
|
+
? `Wave ${k}'s plan changed after its approval, so nothing in it was applied.${entry.approved ? ` approved: ${entry.approved}; planned now: ${entry.digest}.` : ""} Read the new plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`
|
|
2162
|
+
: `Wave ${k} was planned after the waves before it applied, and the pull request's approved plan does not cover it${entry.moved?.length ? `: ${entry.moved.join("; ")}` : ""}. ` +
|
|
2163
|
+
`Nothing in wave ${k} was applied. Read its plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`;
|
|
2164
|
+
return stop(report({ status: "refused", refusal: ran.exitCode === CHANT_EXIT.moved ? "wave-plan-changed" : "wave-not-approved", message }), ran.exitCode);
|
|
2059
2165
|
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2166
|
+
if (ran.exitCode === CHANT_EXIT.held) {
|
|
2167
|
+
setWave({ ...entry, status: "waiting" });
|
|
2168
|
+
return stop(report({ status: "refused", refusal: "locked", message: `Wave ${k}: another run holds what it changes, so nothing in it was applied.` }), CHANT_EXIT.held);
|
|
2169
|
+
}
|
|
2170
|
+
if (ran.exitCode === CHANT_EXIT.denied || ran.exitCode === CHANT_EXIT.declined || ran.exitCode === CHANT_EXIT.superseded) {
|
|
2171
|
+
setWave({ ...entry, status: "failed" });
|
|
2172
|
+
return stop(report({ status: "failed", message: `Wave ${k} stopped on op waves with exit ${ran.exitCode}; nothing more was applied.` }), ran.exitCode);
|
|
2173
|
+
}
|
|
2174
|
+
const waveAfter = await runStageHook(p, "after-apply", wavePlan.order.filter((name) => ran.applied.includes(name)), undefined, `wave ${k} counts as failed though its components applied`);
|
|
2175
|
+
setWave({ ...entry, status: ran.exitCode === CHANT_EXIT.done && !waveAfter ? "applied" : "failed" });
|
|
2176
|
+
if (ran.exitCode !== CHANT_EXIT.done) {
|
|
2064
2177
|
// #4291: a failed member blocks only its dependents, so the later waves still run.
|
|
2065
|
-
lastFailure = {
|
|
2178
|
+
lastFailure = { exitCode: ran.exitCode };
|
|
2066
2179
|
recordAttempt();
|
|
2067
2180
|
continue;
|
|
2068
2181
|
}
|
|
@@ -2079,8 +2192,7 @@ async function prApplyWaves(
|
|
|
2079
2192
|
: blockedLine ? blockedLine.trim() : undefined;
|
|
2080
2193
|
return stop(
|
|
2081
2194
|
report({ status: "failed", ...(message ? { message } : {}) }),
|
|
2082
|
-
lastFailure ?
|
|
2083
|
-
lastFailure?.gated ? "gated" : undefined,
|
|
2195
|
+
lastFailure ? lastFailure.exitCode : 1,
|
|
2084
2196
|
);
|
|
2085
2197
|
}
|
|
2086
2198
|
|
|
@@ -2089,6 +2201,356 @@ async function prApplyWaves(
|
|
|
2089
2201
|
return stop(report({ status: done ? "applied" : "wave-applied" }), 0);
|
|
2090
2202
|
}
|
|
2091
2203
|
|
|
2204
|
+
// ── The component plan-wave and apply-wave steps (#4588) ─────────────────────
|
|
2205
|
+
|
|
2206
|
+
/** The outputs earlier waves' components left, from `--wave-outputs`; empty when the file is not there yet. */
|
|
2207
|
+
function readWaveOutputs(file: string | undefined): { outputs: Record<string, Record<string, unknown>> } | { error: string } {
|
|
2208
|
+
if (!file || !existsSync(resolve(file))) return { outputs: {} };
|
|
2209
|
+
try {
|
|
2210
|
+
const parsed = JSON.parse(readFileSync(resolve(file), "utf8")) as unknown;
|
|
2211
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return { error: `--wave-outputs ${file} must hold { "<component>": { ...outputs } }` };
|
|
2212
|
+
return { outputs: parsed as Record<string, Record<string, unknown>> };
|
|
2213
|
+
} catch (err) {
|
|
2214
|
+
return { error: `--wave-outputs: could not read "${file}": ${err instanceof Error ? err.message : String(err)}` };
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
/** The runs `chant run wave` wrote to `{runs}`: their targets, each a component, and on apply-wave the digest each was approved at. */
|
|
2219
|
+
function readWaveRuns(file: string | undefined): Array<{ target: string; planDigest?: string }> | { error: string } {
|
|
2220
|
+
if (!file) return { error: "the step needs --runs <file>, which chant run wave fills in as {runs}" };
|
|
2221
|
+
try {
|
|
2222
|
+
const parsed = JSON.parse(readFileSync(resolve(file), "utf8")) as { runs?: unknown };
|
|
2223
|
+
if (!Array.isArray(parsed?.runs)) return { error: `--runs ${file} has no runs` };
|
|
2224
|
+
return (parsed.runs as Array<{ target?: unknown; planDigest?: unknown }>).flatMap((r) =>
|
|
2225
|
+
typeof r?.target === "string" ? [{ target: r.target, ...(typeof r.planDigest === "string" ? { planDigest: r.planDigest } : {}) }] : [],
|
|
2226
|
+
);
|
|
2227
|
+
} catch (err) {
|
|
2228
|
+
return { error: `--runs: could not read "${file}": ${err instanceof Error ? err.message : String(err)}` };
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
/** The fan-out plan of `names`, one wave of the derivation, with the rest of that wave counted as done. */
|
|
2233
|
+
function namedWavePlan(p: Prepared, names: readonly string[]): FanOutPlan | { error: string } {
|
|
2234
|
+
const unknown = names.filter((n) => !p.plan.order.includes(n));
|
|
2235
|
+
if (unknown.length > 0) return { error: `${unknown.join(", ")} ${unknown.length === 1 ? "is" : "are"} not in the change between ${p.base.slice(0, 12)} and ${p.head.slice(0, 12)}, so the wave cannot plan ${unknown.length === 1 ? "it" : "them"}` };
|
|
2236
|
+
const k = p.plan.waves.findIndex((w) => w.includes(names[0]!)) + 1;
|
|
2237
|
+
const wave = p.plan.waves[k - 1] ?? [];
|
|
2238
|
+
const across = names.filter((n) => !wave.includes(n));
|
|
2239
|
+
if (across.length > 0) return { error: `${names[0]} and ${across.join(", ")} are in different waves of the derivation, so one wave step cannot plan them together` };
|
|
2240
|
+
return prWavePlan(p.plan, p.components, k, wave.filter((n) => !names.includes(n)));
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
/** One component's entry in the op-waves plans file: the digest over its members' plans, and whether it changes or destroys anything. */
|
|
2244
|
+
function componentPlanEntry(set: PrPlanSet, component: string): { target: string; planDigest: string; empty?: true; destructive?: true } {
|
|
2245
|
+
const members = set.members.filter((m) => m.component === component).sort((a, b) => a.member.localeCompare(b.member));
|
|
2246
|
+
const names = new Set(members.map((m) => m.member));
|
|
2247
|
+
const entries = set.doc.entries.filter((e) => names.has(e.member));
|
|
2248
|
+
const changes = entries.filter((e) => e.action !== "no-op" && e.action !== "read");
|
|
2249
|
+
const destructive = changes.some((e) => e.action === "delete" || e.action === "replace");
|
|
2250
|
+
return {
|
|
2251
|
+
target: component,
|
|
2252
|
+
planDigest: computePlanDigest("component-wave", members.map((m) => ({ member: m.member, planDigest: m.planDigest }))),
|
|
2253
|
+
...(changes.length === 0 ? { empty: true as const } : {}),
|
|
2254
|
+
...(destructive ? { destructive: true as const } : {}),
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
/** The files a component wave step names: `{runs}`, `{plans}` and the outputs file. */
|
|
2259
|
+
interface WaveStepFiles {
|
|
2260
|
+
runs: Array<{ target: string; planDigest?: string }>;
|
|
2261
|
+
plansFile: string;
|
|
2262
|
+
outputsFile?: string;
|
|
2263
|
+
outputs: Record<string, Record<string, unknown>>;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/** Read the step's runs and outputs files from its flags. */
|
|
2267
|
+
function waveStepFiles(args: Pick<CommandContext["args"], "runsFile" | "plansFile" | "waveOutputs">): WaveStepFiles | { error: string } {
|
|
2268
|
+
const runs = readWaveRuns(args.runsFile);
|
|
2269
|
+
if ("error" in runs) return runs;
|
|
2270
|
+
if (!args.plansFile) return { error: "the step needs --plans <file>, which chant run wave fills in as {plans}" };
|
|
2271
|
+
const read = readWaveOutputs(args.waveOutputs);
|
|
2272
|
+
if ("error" in read) return read;
|
|
2273
|
+
return { runs, plansFile: args.plansFile, ...(args.waveOutputs ? { outputsFile: args.waveOutputs } : {}), outputs: read.outputs };
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
/** Plan the step's runs, each a component, against the outputs the earlier waves left. */
|
|
2277
|
+
async function planComponentRuns(p: Prepared, files: WaveStepFiles): Promise<{ set: PrPlanSet; plan: FanOutPlan } | { error: string }> {
|
|
2278
|
+
const names = files.runs.map((r) => r.target);
|
|
2279
|
+
const plan = names.length > 0 ? namedWavePlan(p, names) : { ...p.plan, order: [], waves: [] };
|
|
2280
|
+
if ("error" in plan) return plan;
|
|
2281
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
2282
|
+
const set = await planPrSet({ components: p.components, plan, registry: p.registry, env: p.env, seededOutputs: { ...p.seededOutputs, ...files.outputs }, ...(lockGrain ? { lockGrain } : {}), policyBase: p.base });
|
|
2283
|
+
return { set, plan };
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
/** The plan step over `p`: write `{plans}`, one digest per component and the wave's change set. */
|
|
2287
|
+
async function planComponentWave(p: Prepared, files: WaveStepFiles): Promise<number> {
|
|
2288
|
+
const planned = await planComponentRuns(p, files);
|
|
2289
|
+
if ("error" in planned) return fail(planned.error);
|
|
2290
|
+
const { set } = planned;
|
|
2291
|
+
if (set.failed) {
|
|
2292
|
+
for (const m of set.members.filter((x) => x.status === "plan-failed")) console.error(formatError({ message: `${m.member} (${m.component}) failed to plan${m.error ? `: ${m.error}` : ""}` }));
|
|
2293
|
+
return set.policyDenied ? CHANT_EXIT.denied : 1;
|
|
2294
|
+
}
|
|
2295
|
+
const file = { runs: files.runs.map((r) => componentPlanEntry(set, r.target)), changeSet: set.doc };
|
|
2296
|
+
mkdirSync(dirname(resolve(files.plansFile)), { recursive: true });
|
|
2297
|
+
writeFileSync(resolve(files.plansFile), JSON.stringify(file, null, 2) + "\n");
|
|
2298
|
+
console.error(formatInfo(`planned ${files.runs.length} component${files.runs.length === 1 ? "" : "s"}: ${files.runs.map((r) => r.target).join(", ") || "(none)"}; change set ${set.doc.digest}`));
|
|
2299
|
+
return 0;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
/** The apply step over `p`: plan the approved runs again, refuse a moved one with 4, else lease, apply, record, and hand the outputs on. */
|
|
2303
|
+
async function applyComponentWave(p: Prepared, files: WaveStepFiles, opts: { noReleaseRecord?: boolean; onRunEvent?: RunEventSink; runsResult?: string } = {}): Promise<number> {
|
|
2304
|
+
if (files.runs.length === 0) return 0;
|
|
2305
|
+
const planned = await planComponentRuns(p, files);
|
|
2306
|
+
if ("error" in planned) return fail(planned.error);
|
|
2307
|
+
const { set, plan } = planned;
|
|
2308
|
+
if (set.failed) return fail("A component of the wave failed to plan again, so nothing in it was applied.");
|
|
2309
|
+
const moved = files.runs.filter((r) => r.planDigest !== undefined && !samePlanDigest(componentPlanEntry(set, r.target).planDigest, r.planDigest));
|
|
2310
|
+
if (moved.length > 0) {
|
|
2311
|
+
console.error(formatError({ message: `${moved.map((r) => r.target).join(", ")} now plan${moved.length === 1 ? "s" : ""} something other than the approved plan, so nothing in the wave was applied.`, hint: "Run the wave's job again to plan it afresh and decide its gate." }));
|
|
2312
|
+
return CHANT_EXIT.moved;
|
|
2313
|
+
}
|
|
2314
|
+
const lease = await leaseSetRows(p, set);
|
|
2315
|
+
if (typeof lease === "number") return lease;
|
|
2316
|
+
if ("held" in lease) {
|
|
2317
|
+
console.error(formatError({ message: lease.held }));
|
|
2318
|
+
return CHANT_EXIT.held;
|
|
2319
|
+
}
|
|
2320
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
2321
|
+
const release = autoReleaseRun(`wave-${Date.now()}`);
|
|
2322
|
+
let applied: Awaited<ReturnType<typeof applyPrSet>>;
|
|
2323
|
+
try {
|
|
2324
|
+
applied = await applyPrSet({ components: p.components, plan, registry: p.registry, env: p.env, set, gate: p.gate, ...(lockGrain ? { lockGrain } : {}), policyBase: p.base, ...(opts.onRunEvent ? { onRunEvent: opts.onRunEvent } : {}) });
|
|
2325
|
+
} finally {
|
|
2326
|
+
await lease.release();
|
|
2327
|
+
}
|
|
2328
|
+
await recordAutoReleasesForRun(applied.run.results, p.env, release.runId, resolveAutoReleaseDisabled(p.config, opts.noReleaseRecord), release.runOrigin, undefined, undefined, prAppliedDigests(p, applied.members));
|
|
2329
|
+
if (files.outputsFile) {
|
|
2330
|
+
const next = { ...files.outputs };
|
|
2331
|
+
for (const name of applied.run.completed) next[name] = applied.run.componentOutputs[name] ?? {};
|
|
2332
|
+
mkdirSync(dirname(resolve(files.outputsFile)), { recursive: true });
|
|
2333
|
+
writeFileSync(resolve(files.outputsFile), JSON.stringify(next, null, 2) + "\n");
|
|
2334
|
+
}
|
|
2335
|
+
for (const m of applied.members) console.error(m.status === "applied" ? formatSuccess(`applied ${m.member} (${m.component})`) : formatWarning({ message: `${m.member} (${m.component}): ${m.status}${m.error ? `, ${m.error}` : ""}` }));
|
|
2336
|
+
// #4291: the components that applied, so op waves fails only the others and blocks only what depends on them.
|
|
2337
|
+
const runsResult = opts.runsResult ?? (process.env.CHANT_APPLY_RUNS_RESULT ? resolve(process.env.CHANT_APPLY_RUNS_RESULT) : undefined);
|
|
2338
|
+
if (runsResult && applied.status !== "applied") {
|
|
2339
|
+
mkdirSync(dirname(runsResult), { recursive: true });
|
|
2340
|
+
writeFileSync(runsResult, JSON.stringify({ applied: [...applied.run.completed].sort() }, null, 2) + "\n");
|
|
2341
|
+
}
|
|
2342
|
+
return applied.status === "applied" ? 0 : applied.status === "waiting" ? CHANT_EXIT.waiting : 1;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* `chant components plan-wave --runs <file> --plans <file> --base <ref>
|
|
2347
|
+
* --env <env> [--member <m>] [--wave-outputs <file>]` (#4588): the
|
|
2348
|
+
* component plan step of a component waves spec. Plans each run, a
|
|
2349
|
+
* component, through the project's capabilities against the outputs the
|
|
2350
|
+
* waves before it left, and writes `{plans}`: one digest per component over
|
|
2351
|
+
* its members' plans, and the wave's change set, which a `pull-request`
|
|
2352
|
+
* wave checks the pull request's approval against.
|
|
2353
|
+
*/
|
|
2354
|
+
export async function runComponentsPlanWave(ctx: CommandContext): Promise<number> {
|
|
2355
|
+
const files = waveStepFiles(ctx.args);
|
|
2356
|
+
if ("error" in files) return fail(files.error);
|
|
2357
|
+
const p = await prepare(ctx, "apply");
|
|
2358
|
+
if (typeof p === "number") return p;
|
|
2359
|
+
return planComponentWave(p, files);
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* `chant components apply-wave --runs <file> --plans <file> --base <ref>
|
|
2364
|
+
* --env <env> [--member <m>] [--wave-outputs <file>]` (#4588): the
|
|
2365
|
+
* component apply step. Plans the approved runs again and exits 4 when a
|
|
2366
|
+
* component's plan is not the one approved; else leases its rows on the
|
|
2367
|
+
* resource grain, applies, records the releases, and adds each applied
|
|
2368
|
+
* component's outputs to `--wave-outputs` for the next wave.
|
|
2369
|
+
*/
|
|
2370
|
+
export async function runComponentsApplyWave(ctx: CommandContext): Promise<number> {
|
|
2371
|
+
const files = waveStepFiles(ctx.args);
|
|
2372
|
+
if ("error" in files) return fail(files.error);
|
|
2373
|
+
const p = await prepare(ctx, "apply");
|
|
2374
|
+
if (typeof p === "number") return p;
|
|
2375
|
+
return applyComponentWave(p, files, { noReleaseRecord: ctx.args.noReleaseRecord });
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
/**
|
|
2379
|
+
* The component steps in this process (#4588): `pr-apply --wave-gate`
|
|
2380
|
+
* already holds the prepared project, so the plan-wave and apply-wave lines
|
|
2381
|
+
* of its spec run here against it, rather than in a process that would
|
|
2382
|
+
* derive the change again.
|
|
2383
|
+
*/
|
|
2384
|
+
function componentWaveExec(p: Prepared, noReleaseRecord?: boolean, onRunEvent?: RunEventSink): (argv: string[], cwd: string, env?: Record<string, string>) => Promise<number> {
|
|
2385
|
+
return async (argv, cwd, env) => {
|
|
2386
|
+
const at = argv.findIndex((a, i) => a === "components" && (argv[i + 1] === "plan-wave" || argv[i + 1] === "apply-wave"));
|
|
2387
|
+
if (at < 0) return fail(`not a component wave step: ${argv.join(" ")}`);
|
|
2388
|
+
let args: CommandContext["args"];
|
|
2389
|
+
try {
|
|
2390
|
+
args = parseArgs(argv.slice(at));
|
|
2391
|
+
} catch (err) {
|
|
2392
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
2393
|
+
}
|
|
2394
|
+
const files = waveStepFiles(args);
|
|
2395
|
+
if ("error" in files) return fail(files.error);
|
|
2396
|
+
const runsResult = env?.CHANT_APPLY_RUNS_RESULT ? resolve(cwd, env.CHANT_APPLY_RUNS_RESULT) : undefined;
|
|
2397
|
+
return argv[at + 1] === "plan-wave" ? planComponentWave(p, files) : applyComponentWave(p, files, { noReleaseRecord, ...(onRunEvent ? { onRunEvent } : {}), ...(runsResult ? { runsResult } : {}) });
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
/**
|
|
2402
|
+
* A gate ledger that holds the approval `pr-apply` already decided (#4588):
|
|
2403
|
+
* an approval of the pull request's gate under its op, for the approved
|
|
2404
|
+
* change set, so an op wave of the component waves spec finds the approval
|
|
2405
|
+
* a pull request (or a green commit's merges) gave and checks its own plan
|
|
2406
|
+
* against it. Everything else is the real ledger's.
|
|
2407
|
+
*/
|
|
2408
|
+
function withDecidedApproval(port: GateLedgerPort, at: { op: string; gate: string; digest: string; approvedBy: string[]; timestamp: string }): GateLedgerPort {
|
|
2409
|
+
return {
|
|
2410
|
+
...port,
|
|
2411
|
+
appendPending: (input) => port.appendPending(input),
|
|
2412
|
+
async read(op) {
|
|
2413
|
+
const got = await port.read(op);
|
|
2414
|
+
if (op !== at.op) return got;
|
|
2415
|
+
const decided: GateResolutionRecord = { version: 1, kind: "resolution", op: at.op, gate: at.gate, resolvedBy: at.approvedBy.join(", ") || "pr-apply", timestamp: at.timestamp, planDigest: at.digest, changeSet: at.digest };
|
|
2416
|
+
return { ...got, resolutions: [...got.resolutions, decided] };
|
|
2417
|
+
},
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
/**
|
|
2422
|
+
* The review rule on a wave's own gate (#4000, #4588): `--require-review`
|
|
2423
|
+
* judges an approval of the wave's gate as it judges the pull request's, so
|
|
2424
|
+
* an approval it refuses never reaches the op wave, which then waits. The
|
|
2425
|
+
* refusal is kept in `refused` for pr-apply's report. The pull request's gate
|
|
2426
|
+
* was judged before the waves ran, so its approvals pass as they are.
|
|
2427
|
+
*/
|
|
2428
|
+
function withWaveReview(port: GateLedgerPort, at: { prGate: string; what: string; review: (approvedBy: readonly string[], what: string) => Promise<ReviewStop>; refused: { stop?: ReviewStop } }): GateLedgerPort {
|
|
2429
|
+
return {
|
|
2430
|
+
...port,
|
|
2431
|
+
async read(op) {
|
|
2432
|
+
const got = await port.read(op);
|
|
2433
|
+
const resolutions: GateResolutionRecord[] = [];
|
|
2434
|
+
for (const r of got.resolutions) {
|
|
2435
|
+
const stop = r.gate === at.prGate ? undefined : await at.review([r.resolvedBy], at.what);
|
|
2436
|
+
if (stop) at.refused.stop ??= stop;
|
|
2437
|
+
else resolutions.push(r);
|
|
2438
|
+
}
|
|
2439
|
+
return { ...got, resolutions };
|
|
2440
|
+
},
|
|
2441
|
+
};
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
/** What one wave of `pr-apply --wave-gate` on op waves came to (#4588). */
|
|
2445
|
+
interface ComponentWaveOutcome {
|
|
2446
|
+
exitCode: number;
|
|
2447
|
+
applied: string[];
|
|
2448
|
+
failed: string[];
|
|
2449
|
+
entry: PrWave;
|
|
2450
|
+
/** The wave's outputs file after it ran. */
|
|
2451
|
+
outputs: Record<string, Record<string, unknown>>;
|
|
2452
|
+
/** The wave's new plan, when it planned: what an approval of its own gate is asked for. */
|
|
2453
|
+
changeSet?: PrPlanSet["doc"];
|
|
2454
|
+
/** Why `--require-review` refused an approval of the wave's own gate (#4000). */
|
|
2455
|
+
review?: ReviewStop;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Run wave `k` of `pr-apply --wave-gate` on op waves (#4588): the component
|
|
2460
|
+
* waves spec with the wave's runs left to apply, read at base as chant
|
|
2461
|
+
* wrote it (the spec is chant's, never the change's), decided under the
|
|
2462
|
+
* approval pr-apply holds, planned and applied through the component
|
|
2463
|
+
* plan-wave and apply-wave steps.
|
|
2464
|
+
*/
|
|
2465
|
+
async function runComponentWave(
|
|
2466
|
+
p: Prepared,
|
|
2467
|
+
at: {
|
|
2468
|
+
op: string;
|
|
2469
|
+
waveGate: string;
|
|
2470
|
+
k: number;
|
|
2471
|
+
runs: string[];
|
|
2472
|
+
approved: PrPlanSet["doc"];
|
|
2473
|
+
approvedBy: string[];
|
|
2474
|
+
outputsFile: string;
|
|
2475
|
+
noReleaseRecord?: boolean;
|
|
2476
|
+
review: (approvedBy: readonly string[], what: string) => Promise<ReviewStop>;
|
|
2477
|
+
events?: RunEventStream;
|
|
2478
|
+
log: (body: RunEventBody) => void;
|
|
2479
|
+
},
|
|
2480
|
+
): Promise<ComponentWaveOutcome> {
|
|
2481
|
+
const { componentWavesSpec, componentWaveSteps, PRODUCT_WAVES_SPEC_DIR: PRODUCT_WAVES_DIR } = await import("../../components/product-pipeline");
|
|
2482
|
+
const { runOpWave, opWavePlansPath } = await import("../../op/op-waves-run");
|
|
2483
|
+
const words = activeProductWords();
|
|
2484
|
+
const cwd = resolve(".");
|
|
2485
|
+
const steps = componentWaveSteps({ ...(words.bin ? { bin: words.bin } : {}), env: p.env, base: p.base, head: p.head, ...(p.member ? { member: p.member } : {}), op: at.op, gate: p.gate, outputs: at.outputsFile });
|
|
2486
|
+
const waves = p.plan.waves.map((w, i) => (i === at.k - 1 ? at.runs : w));
|
|
2487
|
+
const spec = componentWavesSpec(p.components, words, steps, { op: at.op, gate: at.waveGate, prGate: p.gate, waves });
|
|
2488
|
+
const specFile = `${PRODUCT_WAVES_DIR}/${at.op}.spec.json`;
|
|
2489
|
+
const refused: { stop?: ReviewStop } = {};
|
|
2490
|
+
const result = await runOpWave({
|
|
2491
|
+
spec,
|
|
2492
|
+
specFile,
|
|
2493
|
+
wave: at.k,
|
|
2494
|
+
base: p.base,
|
|
2495
|
+
head: p.head,
|
|
2496
|
+
cwd,
|
|
2497
|
+
show: () => ({ sha: p.base, text: JSON.stringify(spec) }),
|
|
2498
|
+
gates: withWaveReview(withDecidedApproval(gitGateLedgerPort(), { op: at.op, gate: p.gate, digest: at.approved.digest, approvedBy: at.approvedBy, timestamp: new Date().toISOString() }), {
|
|
2499
|
+
prGate: p.gate,
|
|
2500
|
+
what: `Wave ${at.k}'s plan`,
|
|
2501
|
+
review: at.review,
|
|
2502
|
+
refused,
|
|
2503
|
+
}),
|
|
2504
|
+
// pr-apply's report and the `chant ci run` record stand for the job, so the wave writes no op-wave run record beside them.
|
|
2505
|
+
runs: { append: async () => {} },
|
|
2506
|
+
changeSets: async (digest) => {
|
|
2507
|
+
if (samePlanDigest(digest, at.approved.digest)) return at.approved;
|
|
2508
|
+
const { readStoredChangeSet } = await import("../../lifecycle/change-set-store");
|
|
2509
|
+
const got = await readStoredChangeSet(digest, { cwd });
|
|
2510
|
+
return got.status === "found" ? got.document : undefined;
|
|
2511
|
+
},
|
|
2512
|
+
lockGate: p.gate,
|
|
2513
|
+
// The apply's run events nest in pr-apply's stream with the derivation's wave number, as its log does.
|
|
2514
|
+
waveExec: componentWaveExec(p, at.noReleaseRecord, (body) => {
|
|
2515
|
+
const numbered = inWave(body, at.k);
|
|
2516
|
+
at.events?.nested(numbered);
|
|
2517
|
+
if (numbered.type !== "run-start") at.log(numbered);
|
|
2518
|
+
}),
|
|
2519
|
+
// The outcome files of this commit's waves alone, so a run of another commit on the same checkout blocks nothing here.
|
|
2520
|
+
outcomeDir: `${PRODUCT_WAVES_DIR}/${at.op}/outcomes-${p.head.slice(0, 12)}`,
|
|
2521
|
+
});
|
|
2522
|
+
const d = result.decision;
|
|
2523
|
+
const byPullRequest = d?.via === "pull-request";
|
|
2524
|
+
// #4553: an approval of the wave's own gate stands, but for another plan: the plan moved after its approval.
|
|
2525
|
+
const exitCode = result.exitCode === CHANT_EXIT.waiting && !byPullRequest && d?.mismatch && !refused.stop ? CHANT_EXIT.moved : result.exitCode;
|
|
2526
|
+
const entry: PrWave = {
|
|
2527
|
+
wave: at.k,
|
|
2528
|
+
components: at.runs,
|
|
2529
|
+
status: exitCode === CHANT_EXIT.done ? "applied" : exitCode === CHANT_EXIT.waiting || exitCode === CHANT_EXIT.moved ? "waiting" : "failed",
|
|
2530
|
+
approval: byPullRequest || !d ? "pull-request" : "wave",
|
|
2531
|
+
gate: byPullRequest || !d ? p.gate : d.gate,
|
|
2532
|
+
digest: byPullRequest || !d ? at.approved.digest : d.digest,
|
|
2533
|
+
...(byPullRequest ? (at.approvedBy.length > 0 ? { approvedBy: at.approvedBy } : {}) : d?.approvedBy ? { approvedBy: [d.approvedBy] } : {}),
|
|
2534
|
+
...(!byPullRequest && d?.coveredBy?.reason ? { moved: [d.coveredBy.reason] } : {}),
|
|
2535
|
+
...(!byPullRequest && d?.mismatch?.approved ? { approved: d.mismatch.approved } : {}),
|
|
2536
|
+
};
|
|
2537
|
+
// A wave that waits at its own gate is the stream's gate step there, as before op waves (#4003).
|
|
2538
|
+
if (d && !byPullRequest && (exitCode === CHANT_EXIT.waiting || exitCode === CHANT_EXIT.moved)) {
|
|
2539
|
+
const waiting = { satisfied: false, pending: { op: at.op }, ...(d.mismatch ? { mismatch: d.mismatch } : {}) } as unknown as GateCheck;
|
|
2540
|
+
await emitGateStep(at.events?.emit, { op: at.op, gate: d.gate }, async () => waiting, () =>
|
|
2541
|
+
d.mismatch ? `wave ${at.k}'s plan changed after its approval. Approve the plan now: ${prApproveCommand({ op: at.op, gate: d.gate, digest: d.digest })}` : `wave ${at.k}'s plan is not the one the pull request approved. Approve it: ${prApproveCommand({ op: at.op, gate: d.gate, digest: d.digest })}`,
|
|
2542
|
+
);
|
|
2543
|
+
}
|
|
2544
|
+
const read = readWaveOutputs(at.outputsFile);
|
|
2545
|
+
let changeSet: PrPlanSet["doc"] | undefined;
|
|
2546
|
+
try {
|
|
2547
|
+
changeSet = (JSON.parse(readFileSync(join(cwd, opWavePlansPath(spec, at.k)), "utf8")) as { changeSet?: PrPlanSet["doc"] }).changeSet;
|
|
2548
|
+
} catch {
|
|
2549
|
+
// The wave stopped before it planned.
|
|
2550
|
+
}
|
|
2551
|
+
return { exitCode, applied: result.applied, failed: result.failed, entry, outputs: "error" in read ? {} : read.outputs, ...(changeSet ? { changeSet } : {}), ...(refused.stop ? { review: refused.stop } : {}) };
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2092
2554
|
/** A wave's new plan (#4003), beside the report as `change-set-wave-<k>.json`, for whoever approves its gate. */
|
|
2093
2555
|
function writeWaveChangeSet(ctx: CommandContext, wave: number, doc: PrPlanSet["doc"], upload?: PrReportUpload): void {
|
|
2094
2556
|
const dir = resolve(ctx.args.output ?? PR_REPORT_DIR);
|