@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/dist/cli/handlers/pr.js
CHANGED
|
@@ -64,25 +64,29 @@
|
|
|
64
64
|
* through `--forge`.
|
|
65
65
|
*/
|
|
66
66
|
import { spawnSync } from "node:child_process";
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
67
|
+
import { CHANT_EXIT } from "../../exit-codes.js";
|
|
68
|
+
import { anyResourceGrain, leaseRowsOf as leaseRowsOfLocks, lockTargetsOf } from "../../lifecycle/lock-rows.js";
|
|
69
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
70
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
69
71
|
import { loadChantConfig, resolveAutoReleaseDisabled } from "../../config.js";
|
|
70
72
|
import { resolveCommit, resolveMergeBase } from "../../components/changed-files.js";
|
|
71
73
|
import { deriveFanOut, fanOutRegistry } from "../../components/fan-out-support.js";
|
|
72
|
-
import {
|
|
74
|
+
import { findComponentGroups, groupFanOut } from "../../components/groups.js";
|
|
75
|
+
import { applyPrSet, approvalOf, approversWhoAuthored, approversWithoutReview, decidePrGate, planPrSet, prReport, readOnlyLedger, prWavePlan, resumePrSet, } from "../../components/pr-run.js";
|
|
73
76
|
import { composeChangeSet, verifyChangeSetDigest } from "../../change-set.js";
|
|
74
|
-
import { waveGateName } from "../../gated-waves.js";
|
|
75
77
|
import { blockedMembers, blockedWords, settleEarlierWaves } from "../../wave-blocked.js";
|
|
76
78
|
import { readFanOutAttempt, writeFanOutAttempt } from "../../components/fan-out-record.js";
|
|
77
79
|
import { componentInputDigests, progressThatCarries } from "../../components/fan-out-inputs.js";
|
|
78
|
-
import { samePlanDigest } from "../../lifecycle/plan-digest.js";
|
|
80
|
+
import { computePlanDigest, samePlanDigest } from "../../lifecycle/plan-digest.js";
|
|
79
81
|
import { evaluateGate, gateIsSealed, gitGateLedgerPort } from "../../op/gate.js";
|
|
80
82
|
import { emitGateStep, gateEventsOf, GATE_PHASE } from "../../run-event-stream.js";
|
|
81
83
|
import { openCliRunEvents, refusesEventsWithJson } from "../run-events.js";
|
|
82
84
|
import { openPrReportUpload, parseReportUrl, reportKey } from "../../pr-report-url.js";
|
|
83
|
-
import { describePlanChanged, PR_APPLY_GATE, prApproveCommand, prNoteMarker, prOp, prStatusDescription, prStatusContext, prStatusState, renderPrNote, } from "../../pr-loop.js";
|
|
85
|
+
import { describePlanChanged, PR_APPLY_GATE, prApproveCommand, prApproveCommands, prNoteMarker, prOp, prStatusDescription, prStatusContext, prStatusState, renderPrNote, } from "../../pr-loop.js";
|
|
84
86
|
import { FORGE_KINDS, forgeFromEnv, forgePrincipalOf } from "../../pr-forge.js";
|
|
85
87
|
import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "../../plan-summary.js";
|
|
88
|
+
import { upsertPlanNote } from "../../pr-post.js";
|
|
89
|
+
import { activeProductWords, productContext } from "../../ci-product-words.js";
|
|
86
90
|
import { resolveCliBuildParams, parseParamFlags } from "../build-params-cli.js";
|
|
87
91
|
import { formatError, formatInfo, formatSuccess, formatWarning } from "../format.js";
|
|
88
92
|
import { reportUninstalledDependencies } from "../dependencies.js";
|
|
@@ -91,8 +95,11 @@ import { resolveChangedUnits } from "./fan-out.js";
|
|
|
91
95
|
import { coverByMerges, greenOp } from "../../components/green-cover.js";
|
|
92
96
|
import { GATED_EXIT_CODE, autoReleaseRun, recordAutoReleasesForRun } from "./run.js";
|
|
93
97
|
import { appliedDigestOf } from "../../components/auto-release.js";
|
|
98
|
+
import { parseArgs } from "../parse-args.js";
|
|
94
99
|
import { withComponentEndpoint } from "../component-endpoint.js";
|
|
95
|
-
import { failedRunExitCode } from "../../components/driver.js";
|
|
100
|
+
import { assertTargetsAccepted, failedRunExitCode } from "../../components/driver.js";
|
|
101
|
+
import { TargetsRefusedError } from "../../components/capability.js";
|
|
102
|
+
import { prPlanTargets } from "../../components/pr-targets.js";
|
|
96
103
|
import { prLoopHooksAt, runPrHooks } from "../../components/pr-hooks.js";
|
|
97
104
|
import { decidePrPolicyOverride, policyReviewOf, prLoopPolicyAt, prPolicyReport, runPrPolicy, spendPrPolicyOverride } from "../../components/pr-policy.js";
|
|
98
105
|
import { lexiconNames } from "../../lexicon-module.js";
|
|
@@ -122,6 +129,10 @@ export async function prepare(ctx, stage) {
|
|
|
122
129
|
}
|
|
123
130
|
if (args.fromAffected)
|
|
124
131
|
return fail(`pr-${stage} derives the change itself; drop --from-affected`);
|
|
132
|
+
// #4620: a target narrows the preview; an apply or a record covers what the approved plan covers.
|
|
133
|
+
if (stage !== "plan" && args.targets && args.targets.length > 0) {
|
|
134
|
+
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.");
|
|
135
|
+
}
|
|
125
136
|
let member;
|
|
126
137
|
if (args.members?.length) {
|
|
127
138
|
const checked = await checkMember(projectPath, args.members);
|
|
@@ -153,6 +164,7 @@ export async function prepare(ctx, stage) {
|
|
|
153
164
|
const signal = await resolveChangedUnits(ctx, config, { base, stacksOnly: true });
|
|
154
165
|
if ("error" in signal)
|
|
155
166
|
return fail(signal.error, signal.hint);
|
|
167
|
+
const registry = await fanOutRegistry(projectPath, config);
|
|
156
168
|
let derived;
|
|
157
169
|
try {
|
|
158
170
|
derived = await deriveFanOut({
|
|
@@ -161,6 +173,7 @@ export async function prepare(ctx, stage) {
|
|
|
161
173
|
sandbox: args.sandbox,
|
|
162
174
|
buildParams: paramsResolution.provenance,
|
|
163
175
|
config,
|
|
176
|
+
registry,
|
|
164
177
|
});
|
|
165
178
|
}
|
|
166
179
|
catch (err) {
|
|
@@ -204,10 +217,19 @@ export async function prepare(ctx, stage) {
|
|
|
204
217
|
if (policy.note)
|
|
205
218
|
console.error(formatInfo(policy.note));
|
|
206
219
|
const env = args.env ?? "local";
|
|
207
|
-
const registry = await fanOutRegistry(projectPath, config);
|
|
208
220
|
const routedAway = member ? await routing(ctx, stage, projectPath, member, base, forge) : undefined;
|
|
209
221
|
if (routedAway)
|
|
210
222
|
console.error(formatInfo(routedAway));
|
|
223
|
+
// ws-107: the groups a capability plans and applies as one, placed in the waves every stage and wave job reads.
|
|
224
|
+
let plan = derived.plan;
|
|
225
|
+
if (!routedAway && plan.order.length > 0) {
|
|
226
|
+
try {
|
|
227
|
+
plan = groupFanOut(plan, derived.components, await findComponentGroups({ components: derived.components, plan, registry, env }));
|
|
228
|
+
}
|
|
229
|
+
catch (err) {
|
|
230
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
211
233
|
return {
|
|
212
234
|
config,
|
|
213
235
|
env,
|
|
@@ -217,7 +239,7 @@ export async function prepare(ctx, stage) {
|
|
|
217
239
|
gate: args.gate ?? PR_APPLY_GATE,
|
|
218
240
|
...(forge ? { forge } : {}),
|
|
219
241
|
components: derived.components,
|
|
220
|
-
plan: routedAway ? { ...derived.plan, order: [], waves: [], seeds: [], indeterminate: [] } :
|
|
242
|
+
plan: routedAway ? { ...derived.plan, order: [], waves: [], seeds: [], indeterminate: [] } : plan,
|
|
221
243
|
signal: derived.signal,
|
|
222
244
|
...(derived.sites ? { sites: derived.sites } : {}),
|
|
223
245
|
registry,
|
|
@@ -384,16 +406,96 @@ async function checkMember(projectPath, names) {
|
|
|
384
406
|
export function planAll(p, onRunEvent) {
|
|
385
407
|
return hookedPlan(p, p.plan.order, () => planBare(p, onRunEvent));
|
|
386
408
|
}
|
|
387
|
-
export function planBare(p, onRunEvent) {
|
|
409
|
+
export async function planBare(p, onRunEvent) {
|
|
410
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
388
411
|
return planPrSet({
|
|
389
412
|
components: p.components,
|
|
390
413
|
plan: p.plan,
|
|
391
414
|
registry: p.registry,
|
|
392
415
|
env: p.env,
|
|
393
416
|
seededOutputs: p.seededOutputs,
|
|
417
|
+
...(lockGrain ? { lockGrain } : {}),
|
|
418
|
+
// #4613: a step's own policy engine (CrossGuard) reads its packs at the base, as ci.policy is.
|
|
419
|
+
policyBase: p.base,
|
|
394
420
|
...(onRunEvent ? { onRunEvent } : {}),
|
|
421
|
+
...(p.targets ? { targets: p.targets } : {}),
|
|
395
422
|
});
|
|
396
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* `pr-plan --target` (#4620): the addresses by member, set on `p`, or the
|
|
426
|
+
* exit code when a value is refused or a targeted member has a capability
|
|
427
|
+
* that cannot narrow, which is named before anything plans.
|
|
428
|
+
*/
|
|
429
|
+
function narrowToTargets(p, values) {
|
|
430
|
+
if (!values || values.length === 0)
|
|
431
|
+
return undefined;
|
|
432
|
+
const resolved = prPlanTargets(values, p.plan.order, new Set(p.components.map((c) => c.name)));
|
|
433
|
+
if ("error" in resolved)
|
|
434
|
+
return fail(resolved.error, "--target <address> narrows every member the pull request plans; --target <member>:<address> narrows one.");
|
|
435
|
+
const { targets } = resolved;
|
|
436
|
+
const byName = new Map(p.components.map((c) => [c.name, c]));
|
|
437
|
+
for (const [name, addresses] of Object.entries(targets)) {
|
|
438
|
+
try {
|
|
439
|
+
assertTargetsAccepted(byName.get(name), p.registry, { targets: addresses });
|
|
440
|
+
}
|
|
441
|
+
catch (err) {
|
|
442
|
+
if (err instanceof TargetsRefusedError)
|
|
443
|
+
return fail(`${err.message}, so nothing was planned`, "Drop --target, or name a member whose steps can narrow: --target <member>:<address>.");
|
|
444
|
+
throw err;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
p.targets = targets;
|
|
448
|
+
console.error(formatInfo(`narrowed to ${Object.entries(targets).map(([name, a]) => `${name}: ${a.join(", ")}`).join("; ") || "nothing planned"}`));
|
|
449
|
+
return undefined;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* `ci.lockGrain` of the stage's member (#4552), read from the declaration at
|
|
453
|
+
* base like `ci.locks`, so a change cannot pick its own grain. Undefined when
|
|
454
|
+
* none is declared: each member then takes its lexicon's default.
|
|
455
|
+
*/
|
|
456
|
+
async function declaredLockGrainOf(p) {
|
|
457
|
+
const { ciLockGrainAt } = await import("../../workspace/ci-lock-grain.js");
|
|
458
|
+
return ciLockGrainAt(process.cwd(), p.base, p.member) ?? undefined;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Lease the rows a set's members on the resource grain change (#4552),
|
|
462
|
+
* before anything applies: the refusal naming the run that holds one, the
|
|
463
|
+
* exit code when the rows file could not be written, or the lease to let go
|
|
464
|
+
* of once the apply ends (one that holds nothing when no member is on the
|
|
465
|
+
* resource grain).
|
|
466
|
+
*/
|
|
467
|
+
async function leaseSetRows(p, set) {
|
|
468
|
+
const leased = await leaseRowsOf(p, set);
|
|
469
|
+
return "failed" in leased ? fail(leased.failed) : leased;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* {@link leaseSetRows} without printing a failure (#4594), for a later round
|
|
473
|
+
* of `applyPrSet` (`leaseRound`), which records it on the round, and for a
|
|
474
|
+
* pull request environment's apply, which reports it.
|
|
475
|
+
*/
|
|
476
|
+
export async function leaseRowsOf(p, set, label = "this apply") {
|
|
477
|
+
const rows = leaseRowsOfLocks(set.locks);
|
|
478
|
+
if (rows.length === 0)
|
|
479
|
+
return { release: () => Promise.resolve(true) };
|
|
480
|
+
const { leaseLockRows } = await import("../../lifecycle/resource-lock.js");
|
|
481
|
+
let leased;
|
|
482
|
+
try {
|
|
483
|
+
leased = await leaseLockRows(p.gate, rows);
|
|
484
|
+
}
|
|
485
|
+
catch (err) {
|
|
486
|
+
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)}` };
|
|
487
|
+
}
|
|
488
|
+
if (!leased.ok)
|
|
489
|
+
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.` };
|
|
490
|
+
for (const h of leased.tookOver)
|
|
491
|
+
console.error(formatInfo(`took over the rows of run ${h.run}, which is gone`));
|
|
492
|
+
console.error(formatInfo(`${label} holds ${leased.lease.keys.length} row${leased.lease.keys.length === 1 ? "" : "s"} of ${p.gate} while it applies`));
|
|
493
|
+
return leased.lease;
|
|
494
|
+
}
|
|
495
|
+
/** `applyPrSet`'s `leaseRound` (#4594): a round after the first leases the rows its own plan locks. */
|
|
496
|
+
export function leaseRoundRows(p) {
|
|
497
|
+
return ({ round, set }) => leaseRowsOf(p, set, `round ${round}`);
|
|
498
|
+
}
|
|
397
499
|
/**
|
|
398
500
|
* How a stage's report settles its run's events (#4041): a refusal waits on
|
|
399
501
|
* a person, as a gate does, and exits the same way.
|
|
@@ -449,7 +551,7 @@ async function publish(forge, report, note) {
|
|
|
449
551
|
if (report.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length)
|
|
450
552
|
return;
|
|
451
553
|
try {
|
|
452
|
-
await forge
|
|
554
|
+
await upsertPlanNote(forge, report.pr, prNoteMarker(report.env, report.member), note);
|
|
453
555
|
}
|
|
454
556
|
catch (err) {
|
|
455
557
|
console.error(formatWarning({ message: `could not post the note on #${report.pr}: ${err instanceof Error ? err.message : String(err)}` }));
|
|
@@ -479,6 +581,15 @@ async function finish(ctx, p, report, upload) {
|
|
|
479
581
|
report = { ...report, policy: p.policyReport };
|
|
480
582
|
if (p.beforeMerge)
|
|
481
583
|
report = { ...report, beforeMerge: p.beforeMerge };
|
|
584
|
+
// #4617: with a checkout of the control repo named, its entries and apply records mark the cross-stack edges.
|
|
585
|
+
if (report.crossStackEdges?.length && process.env.CHANT_CONTROL_DIR) {
|
|
586
|
+
const { controlEdgeFactsFromEnv, remarkCrossStackEdges } = await import("../../control/edges.js");
|
|
587
|
+
report = remarkCrossStackEdges(report, await controlEdgeFactsFromEnv());
|
|
588
|
+
}
|
|
589
|
+
// #4573: each member's section its lexicon renders from its own part of the change set.
|
|
590
|
+
const details = await memberDetails(p, report);
|
|
591
|
+
if (details.length > 0)
|
|
592
|
+
report = { ...report, details };
|
|
482
593
|
const note = noteFor(report, p.forge);
|
|
483
594
|
writeOutputs(ctx, report, note, upload);
|
|
484
595
|
if (!ctx.args.noStatus)
|
|
@@ -570,9 +681,9 @@ async function judgePolicy(p, at) {
|
|
|
570
681
|
const why = err instanceof Error ? err.message : String(err);
|
|
571
682
|
if (at.stage === "plan") {
|
|
572
683
|
console.error(formatWarning({ message: `could not read the override ledger, so no override reads as standing: ${why}` }));
|
|
573
|
-
return { held, stop: { refusal: "policy-denied", code:
|
|
684
|
+
return { held, stop: { refusal: "policy-denied", code: CHANT_EXIT.denied, message: `The policy denied this plan: ${denied}.` } };
|
|
574
685
|
}
|
|
575
|
-
return { held, stop: { refusal: "policy-denied", code:
|
|
686
|
+
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.` } };
|
|
576
687
|
}
|
|
577
688
|
if (decided.status === "overridden") {
|
|
578
689
|
report.override = decided.override;
|
|
@@ -588,7 +699,7 @@ async function judgePolicy(p, at) {
|
|
|
588
699
|
held,
|
|
589
700
|
stop: {
|
|
590
701
|
refusal: "policy-denied",
|
|
591
|
-
code:
|
|
702
|
+
code: CHANT_EXIT.denied,
|
|
592
703
|
message: `The policy denied this plan: ${denied}.${moved} Nothing was applied. ${who} override it: ${decided.command}`,
|
|
593
704
|
},
|
|
594
705
|
};
|
|
@@ -619,6 +730,9 @@ async function prPlan(ctx, stage) {
|
|
|
619
730
|
const p = await prepare(ctx, "plan");
|
|
620
731
|
if (typeof p === "number")
|
|
621
732
|
return p;
|
|
733
|
+
const narrowed = narrowToTargets(p, ctx.args.targets);
|
|
734
|
+
if (narrowed !== undefined)
|
|
735
|
+
return narrowed;
|
|
622
736
|
const op = prOp(ctx.args.pr, p.member);
|
|
623
737
|
placeHooks(ctx, p, "plan", op);
|
|
624
738
|
const upload = openUpload(stage, "plan", ctx.args.pr, p);
|
|
@@ -667,11 +781,47 @@ async function prPlan(ctx, stage) {
|
|
|
667
781
|
printMembers(report);
|
|
668
782
|
if (status === "planned") {
|
|
669
783
|
console.error(formatInfo(`plan : ${report.digest}`));
|
|
670
|
-
console.error(formatInfo(approval.status === "approved" ? `approved by ${(approval.approvedBy ?? []).join(", ")}` : `approve : ${
|
|
784
|
+
console.error(formatInfo(approval.status === "approved" ? `approved by ${(approval.approvedBy ?? []).join(", ")}` : `approve : ${prApproveCommands(report).join("; ")}`));
|
|
671
785
|
}
|
|
672
786
|
if (judged.stop)
|
|
673
787
|
console.error(formatWarning({ message: judged.stop.message }));
|
|
674
|
-
|
|
788
|
+
// #4550: a capability's policy denial (pulumi-up's CrossGuard) exits as a denial, 7, not as a failed plan.
|
|
789
|
+
if (status === "plan-failed" && set.policyDenied)
|
|
790
|
+
return CHANT_EXIT.denied;
|
|
791
|
+
return status === "plan-failed" ? CHANT_EXIT.failed : judged.stop ? judged.stop.code : CHANT_EXIT.done;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* The member detail sections (#4573): each lexicon the project lists that
|
|
795
|
+
* renders one (`prNoteDetail`) gets each member's part of the change set. A
|
|
796
|
+
* lexicon that cannot load, or throws, leaves the note as it was.
|
|
797
|
+
*/
|
|
798
|
+
async function memberDetails(p, report) {
|
|
799
|
+
if (report.changeSet.members.length === 0)
|
|
800
|
+
return [];
|
|
801
|
+
const { loadPlugin } = await import("../plugins.js");
|
|
802
|
+
const out = [];
|
|
803
|
+
for (const name of lexiconNames(p.config.lexicons ?? [])) {
|
|
804
|
+
let plugin;
|
|
805
|
+
try {
|
|
806
|
+
plugin = await loadPlugin(name);
|
|
807
|
+
}
|
|
808
|
+
catch {
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if (!plugin.prNoteDetail)
|
|
812
|
+
continue;
|
|
813
|
+
for (const member of report.changeSet.members) {
|
|
814
|
+
try {
|
|
815
|
+
const detail = await plugin.prNoteDetail({ member: member.member, changeSet: report.changeSet, stage: report.stage });
|
|
816
|
+
if (detail && detail.lines.length > 0)
|
|
817
|
+
out.push({ member: member.member, ...(detail.title ? { title: detail.title } : {}), lines: detail.lines });
|
|
818
|
+
}
|
|
819
|
+
catch (err) {
|
|
820
|
+
console.error(formatWarning({ message: `the ${name} lexicon could not render ${member.member}'s detail: ${err instanceof Error ? err.message : String(err)}` }));
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
return out;
|
|
675
825
|
}
|
|
676
826
|
/**
|
|
677
827
|
* The migration files the pull request adds in a migration-directory member
|
|
@@ -720,13 +870,15 @@ async function overdueOps(forge, member) {
|
|
|
720
870
|
const { overdueOpsAt } = await import("../../op/schedule-overdue.js");
|
|
721
871
|
return overdueOpsAt({ forge, cwd: resolve("."), ...(member ? { member } : {}), log: (line) => console.error(formatWarning({ message: line })) });
|
|
722
872
|
}
|
|
723
|
-
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
873
|
+
/** 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>] */
|
|
724
874
|
export function runComponentsPrApply(ctx) {
|
|
725
875
|
if (refusesEventsWithJson(ctx.args, "the stage's report"))
|
|
726
876
|
return Promise.resolve(1);
|
|
727
877
|
return withStageEvents("pr-apply", ctx, async (events) => {
|
|
728
878
|
// #4301: an apply before merge asks the forge its requires checks before any of the head's code loads, the config included.
|
|
729
879
|
let beforeMerge;
|
|
880
|
+
if (ctx.args.requires && !ctx.args.beforeMerge)
|
|
881
|
+
return fail("--requires names the checks of an apply before merge, so it needs --before-merge --pr <n>");
|
|
730
882
|
if (ctx.args.beforeMerge) {
|
|
731
883
|
const checked = await beforeMergeChecks(ctx);
|
|
732
884
|
if (typeof checked === "number")
|
|
@@ -792,7 +944,7 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
792
944
|
return held;
|
|
793
945
|
if (held) {
|
|
794
946
|
const set = { doc: composeChangeSet([]), members: [], plans: {}, outputs: {}, failed: false };
|
|
795
|
-
return stopper(ctx, p, events, upload)(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 }),
|
|
947
|
+
return stopper(ctx, p, events, upload)(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 }), CHANT_EXIT.held);
|
|
796
948
|
}
|
|
797
949
|
}
|
|
798
950
|
if (args.waveGate)
|
|
@@ -845,8 +997,19 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
845
997
|
...base,
|
|
846
998
|
approval: { status: "pending" },
|
|
847
999
|
status: "plan-failed",
|
|
848
|
-
message:
|
|
849
|
-
|
|
1000
|
+
message: set.policyDenied
|
|
1001
|
+
? "The policy denied a member's plan, so nothing was applied."
|
|
1002
|
+
: "A member failed to plan, so there is no plan to compare with the approved one. Nothing was applied.",
|
|
1003
|
+
}), set.policyDenied ? CHANT_EXIT.denied : 1);
|
|
1004
|
+
}
|
|
1005
|
+
// #4552, ruling D: on the resource grain a pull request's locks name row keys, which only the plan knows.
|
|
1006
|
+
const lockTargets = lockTargetsOf(p.plan.order, set.locks);
|
|
1007
|
+
if (locks && anyResourceGrain(set.locks)) {
|
|
1008
|
+
const held = await heldLocksOf(p, pr, lockTargets);
|
|
1009
|
+
if (typeof held === "number")
|
|
1010
|
+
return held;
|
|
1011
|
+
if (held)
|
|
1012
|
+
return stop(prReport({ ...base, approval: { status: "pending" }, status: "refused", refusal: "locked", message: held }), CHANT_EXIT.held);
|
|
850
1013
|
}
|
|
851
1014
|
// #4022: keep the change set the gate binds on chant/lifecycle under its
|
|
852
1015
|
// digest before deciding the gate, so the plan an approval bound, or the
|
|
@@ -870,7 +1033,7 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
870
1033
|
if (afterGate && decided.satisfied)
|
|
871
1034
|
return stop(prReport({ ...base, approval, status: "failed", message: afterGate }), 1);
|
|
872
1035
|
if (!decided.satisfied)
|
|
873
|
-
return stop(prReport({ ...base, approval, status: "refused", refusal: decided.refusal, message: decided.message }),
|
|
1036
|
+
return stop(prReport({ ...base, approval, status: "refused", refusal: decided.refusal, message: decided.message }), decided.refusal === "plan-changed" ? CHANT_EXIT.moved : CHANT_EXIT.waiting);
|
|
874
1037
|
via = decided.via;
|
|
875
1038
|
}
|
|
876
1039
|
const reviewOf = reviewFor(args, p, pr, green);
|
|
@@ -886,12 +1049,18 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
886
1049
|
return stop(prReport({ ...base, approval, status: "refused", refusal: "policy-denied", message: unspent }), 1);
|
|
887
1050
|
// #4293, #4301: under ci.locks an apply before merge holds its targets until the pull request merges or closes.
|
|
888
1051
|
if (locks && beforeMerge && pr !== null) {
|
|
889
|
-
const taken = await takeApplyLocks(p, pr);
|
|
1052
|
+
const taken = await takeApplyLocks(p, pr, lockTargets);
|
|
890
1053
|
if (typeof taken === "number")
|
|
891
1054
|
return taken;
|
|
892
1055
|
if (taken)
|
|
893
|
-
return stop(prReport({ ...base, approval, status: "refused", refusal: "locked", message: taken }),
|
|
894
|
-
}
|
|
1056
|
+
return stop(prReport({ ...base, approval, status: "refused", refusal: "locked", message: taken }), CHANT_EXIT.held);
|
|
1057
|
+
}
|
|
1058
|
+
// #4552: on the resource grain the apply leases the rows it changes, whatever ci.locks says, and lets go when it ends.
|
|
1059
|
+
const lease = await leaseSetRows(p, set);
|
|
1060
|
+
if (typeof lease === "number")
|
|
1061
|
+
return lease;
|
|
1062
|
+
if ("held" in lease)
|
|
1063
|
+
return stop(prReport({ ...base, approval, status: "refused", refusal: "locked", message: lease.held }), CHANT_EXIT.held);
|
|
895
1064
|
// The record is written before the first component runs and again as each
|
|
896
1065
|
// one settles, so a run killed partway still knows what applied.
|
|
897
1066
|
const prior = resumed ? { completed: resumed.completed, outputs: resumed.outputs } : { completed: [], outputs: {} };
|
|
@@ -925,8 +1094,10 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
925
1094
|
// #4288: the before-apply hooks, once the gate and the review let the apply through.
|
|
926
1095
|
const toApply = (resumed?.plan ?? p.plan).order.filter((name) => !completedSoFar.has(name));
|
|
927
1096
|
const beforeFailed = await runStageHook(p, "before-apply", toApply);
|
|
928
|
-
if (beforeFailed)
|
|
1097
|
+
if (beforeFailed) {
|
|
1098
|
+
await lease.release();
|
|
929
1099
|
return stop(prReport({ ...base, approval, status: "failed", message: beforeFailed }), 1);
|
|
1100
|
+
}
|
|
930
1101
|
// #3999: a round planned after an upstream applied waits on a gate of its
|
|
931
1102
|
// own, under the same identity.gates rule and the same review checks.
|
|
932
1103
|
const roundLedger = gitGateLedgerPort();
|
|
@@ -949,40 +1120,51 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
949
1120
|
}
|
|
950
1121
|
return { satisfied: true, approval: roundApproval };
|
|
951
1122
|
};
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1123
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
1124
|
+
let applied;
|
|
1125
|
+
try {
|
|
1126
|
+
applied = await applyPrSet({
|
|
1127
|
+
components: p.components,
|
|
1128
|
+
plan: resumed?.plan ?? p.plan,
|
|
1129
|
+
registry: p.registry,
|
|
1130
|
+
env: p.env,
|
|
1131
|
+
set,
|
|
1132
|
+
...(lockGrain ? { lockGrain } : {}),
|
|
1133
|
+
policyBase: p.base,
|
|
1134
|
+
gate: p.gate,
|
|
1135
|
+
approval,
|
|
1136
|
+
decideRound,
|
|
1137
|
+
// #4594: a later round's plan may change rows the first did not, so it leases its own.
|
|
1138
|
+
leaseRound: leaseRoundRows(p),
|
|
1139
|
+
...(resumed ? { resumed: prior } : {}),
|
|
1140
|
+
// The apply is this run's waves, so the fan-out's own run framing is
|
|
1141
|
+
// dropped. The log's lines go to stderr with or without --events-json.
|
|
1142
|
+
onRunEvent: (body) => {
|
|
1143
|
+
events?.nested(body);
|
|
1144
|
+
log(body);
|
|
1145
|
+
},
|
|
1146
|
+
...(resumePath
|
|
1147
|
+
? {
|
|
1148
|
+
onComponentSettled: (settled, outputs) => {
|
|
1149
|
+
if (settled.status === "ok") {
|
|
1150
|
+
completedSoFar.add(settled.component);
|
|
1151
|
+
if (inputsNow[settled.component] !== undefined)
|
|
1152
|
+
inputsSoFar[settled.component] = inputsNow[settled.component];
|
|
1153
|
+
if (outputs)
|
|
1154
|
+
outputsSoFar[settled.component] = outputs;
|
|
1155
|
+
}
|
|
1156
|
+
else if (settled.status === "fail") {
|
|
1157
|
+
failedSoFar.push(settled.component);
|
|
1158
|
+
}
|
|
1159
|
+
recordAttempt();
|
|
1160
|
+
},
|
|
1161
|
+
}
|
|
1162
|
+
: {}),
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
finally {
|
|
1166
|
+
await lease.release();
|
|
1167
|
+
}
|
|
986
1168
|
recordAttempt();
|
|
987
1169
|
// #4288: the after-apply hooks, for the components that applied.
|
|
988
1170
|
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");
|
|
@@ -994,12 +1176,23 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
994
1176
|
members: applied.members,
|
|
995
1177
|
...(resumed ? { resumed: resumed.completed } : {}),
|
|
996
1178
|
...(applied.rounds ? { rounds: applied.rounds } : {}),
|
|
997
|
-
...(applied.status === "waiting" ? { message: waitingMessage(op, applied.rounds) } : {}),
|
|
1179
|
+
...(applied.held ? { message: applied.held } : applied.leaseFailed ? { message: applied.leaseFailed } : applied.status === "waiting" ? { message: waitingMessage(op, applied.rounds) } : {}),
|
|
998
1180
|
});
|
|
999
1181
|
// A component that stopped at a gate of its own leaves the apply waiting on
|
|
1000
1182
|
// a person. A step that refused its plan because the target moved since
|
|
1001
|
-
// the approval exits
|
|
1002
|
-
|
|
1183
|
+
// the approval exits 4 (moved), as a moved digest does before anything applies (#3997, #4553).
|
|
1184
|
+
// A later round whose rows another run holds exits 5 (held, #4594).
|
|
1185
|
+
const exit = afterFailed
|
|
1186
|
+
? 1
|
|
1187
|
+
: applied.held
|
|
1188
|
+
? CHANT_EXIT.held
|
|
1189
|
+
: applied.status === "applied"
|
|
1190
|
+
? 0
|
|
1191
|
+
: applied.status === "waiting"
|
|
1192
|
+
? GATED_EXIT_CODE
|
|
1193
|
+
: applied.leaseFailed
|
|
1194
|
+
? 1
|
|
1195
|
+
: failedRunExitCode(applied.run.results);
|
|
1003
1196
|
if (green && applied.status === "applied")
|
|
1004
1197
|
await recordGreenApplied(p, green, set.doc.digest, approval, via);
|
|
1005
1198
|
const code = await stop(report, exit, applied.run.status === "gated" ? "gated" : undefined);
|
|
@@ -1015,12 +1208,12 @@ async function prApply(ctx, stage, beforeMerge) {
|
|
|
1015
1208
|
* `--forge` every lock counts. A lock file that cannot be read stops the
|
|
1016
1209
|
* apply, since nothing then says the targets are free.
|
|
1017
1210
|
*/
|
|
1018
|
-
async function heldLocksOf(p, pr) {
|
|
1211
|
+
async function heldLocksOf(p, pr, targets = p.plan.order) {
|
|
1019
1212
|
const { heldTargetLocks, describeHeldTargetLocks } = await import("../../lifecycle/target-lock.js");
|
|
1020
1213
|
const isOpen = p.forge?.pullRequestOpen?.bind(p.forge);
|
|
1021
1214
|
let held;
|
|
1022
1215
|
try {
|
|
1023
|
-
held = await heldTargetLocks(p.gate,
|
|
1216
|
+
held = await heldTargetLocks(p.gate, targets, pr, { ...(isOpen ? { isOpen } : {}) });
|
|
1024
1217
|
}
|
|
1025
1218
|
catch (err) {
|
|
1026
1219
|
return fail(`could not read the target locks of ${p.gate}, so nothing was applied: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -1050,6 +1243,11 @@ async function beforeMergeChecks(ctx) {
|
|
|
1050
1243
|
return fail("--before-merge asks the forge whether the pull request is ready, so it needs --forge github|gitlab|forgejo");
|
|
1051
1244
|
if (!args.base)
|
|
1052
1245
|
return fail("pr-apply needs the commit the change is measured from: --base <ref>", "Before merge, the target branch's commit.");
|
|
1246
|
+
const { checkPrRequires, unmetRequires, parseRequiresList } = await import("../../pr-requires.js");
|
|
1247
|
+
// #4607: a product's `apply.requires` names the checks to ask; absent, all four.
|
|
1248
|
+
const only = args.requires ? parseRequiresList(args.requires) : undefined;
|
|
1249
|
+
if (only && "error" in only)
|
|
1250
|
+
return fail(only.error);
|
|
1053
1251
|
const cwd = resolve(".");
|
|
1054
1252
|
let forge;
|
|
1055
1253
|
let head;
|
|
@@ -1066,16 +1264,16 @@ async function beforeMergeChecks(ctx) {
|
|
|
1066
1264
|
const gate = args.gate ?? PR_APPLY_GATE;
|
|
1067
1265
|
const { ciWorkflowAt } = await import("../../workspace/ci-workflow-at.js");
|
|
1068
1266
|
const { appliesBeforeMerge } = await import("../../workspace/ci-workflow.js");
|
|
1069
|
-
const { checkPrRequires, unmetRequires } = await import("../../pr-requires.js");
|
|
1070
1267
|
const workflow = ciWorkflowAt(cwd, args.base, member);
|
|
1071
1268
|
const early = earlyStop(ctx, forge, { pr: args.pr, base, head, gate, ...(member ? { member } : {}) });
|
|
1072
1269
|
if (!appliesBeforeMerge(workflow)) {
|
|
1073
1270
|
return early({ requires: [] }, "before-merge-off", `The declaration at base sets ci.workflow to ${workflow ?? "nothing"}${member ? ` for ${member}` : ""}, and only apply-before-merge applies a pull request before it merges (ws-106). Nothing was applied.`, 1);
|
|
1074
1271
|
}
|
|
1075
1272
|
// The apply's own statuses never hold it back: chant ci run's, and the report's.
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1273
|
+
// #4550: under a product's words its own prefix too.
|
|
1274
|
+
const ignore = [...new Set([productContext(activeProductWords(), gate), productContext(activeProductWords(), PR_APPLY_GATE), `chant/${gate}`, `chant/${PR_APPLY_GATE}`, prStatusContext("apply", member)])];
|
|
1275
|
+
// ws-106 gives the declaration no way to leave a check out, so with no --requires all four are asked (#4336, #4607).
|
|
1276
|
+
const requires = await checkPrRequires(forge, args.pr, head, { ignore, ...(only ? { only: only.checks } : {}) });
|
|
1079
1277
|
for (const r of requires)
|
|
1080
1278
|
console.error(formatInfo(`${r.name}: ${r.passed ? "passed" : r.pending ? "pending" : "unmet"}, ${r.reason}`));
|
|
1081
1279
|
const unmet = unmetRequires(requires);
|
|
@@ -1101,13 +1299,13 @@ function earlyStop(ctx, forge, at) {
|
|
|
1101
1299
|
* refusal when another open pull request holds one, null once taken, or the
|
|
1102
1300
|
* exit code when the locks could not be written.
|
|
1103
1301
|
*/
|
|
1104
|
-
async function takeApplyLocks(p, pr) {
|
|
1302
|
+
async function takeApplyLocks(p, pr, targets = p.plan.order) {
|
|
1105
1303
|
const { takeTargetLocks, describeHeldTargetLocks } = await import("../../lifecycle/target-lock.js");
|
|
1106
1304
|
const isOpen = p.forge?.pullRequestOpen?.bind(p.forge);
|
|
1107
1305
|
const by = process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER ?? "unknown";
|
|
1108
1306
|
let result;
|
|
1109
1307
|
try {
|
|
1110
|
-
result = await takeTargetLocks(p.gate,
|
|
1308
|
+
result = await takeTargetLocks(p.gate, targets, { pr, by, at: new Date().toISOString(), stage: "apply", head: p.head }, { ...(isOpen ? { isOpen } : {}) });
|
|
1111
1309
|
}
|
|
1112
1310
|
catch (err) {
|
|
1113
1311
|
return fail(`could not take the target locks of ${p.gate}, so nothing was applied: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -1445,6 +1643,10 @@ function settleWords(body) {
|
|
|
1445
1643
|
* pr-apply's job log (#4007): a line on stderr as each wave starts and as
|
|
1446
1644
|
* each component settles, so the log shows the waves in order while they run.
|
|
1447
1645
|
*/
|
|
1646
|
+
/** One wave's fan-out numbers its wave 1; the events and the log carry the derivation's number (#4003). */
|
|
1647
|
+
function inWave(body, wave) {
|
|
1648
|
+
return "wave" in body && typeof body.wave === "number" ? { ...body, wave } : body;
|
|
1649
|
+
}
|
|
1448
1650
|
function applyLog() {
|
|
1449
1651
|
let waves = 0;
|
|
1450
1652
|
return (body) => {
|
|
@@ -1553,8 +1755,10 @@ async function tryResume(p, attempt, file, op, inputsNow) {
|
|
|
1553
1755
|
registry: p.registry,
|
|
1554
1756
|
env: p.env,
|
|
1555
1757
|
seededOutputs: p.seededOutputs,
|
|
1758
|
+
policyBase: p.base,
|
|
1556
1759
|
record,
|
|
1557
1760
|
completed,
|
|
1761
|
+
applied: outputs,
|
|
1558
1762
|
});
|
|
1559
1763
|
if (!resumed.ok)
|
|
1560
1764
|
return skip(`what is left is not what was approved. ${resumed.reasons.join("; ")}`);
|
|
@@ -1606,21 +1810,20 @@ async function carryWaves(p, attempt, file, op, inputsNow) {
|
|
|
1606
1810
|
const outputs = Object.fromEntries(Object.entries(attempt.outputs).filter(([name]) => completed.includes(name)));
|
|
1607
1811
|
return { record, check, approval: approvalOf(check), completed, outputs };
|
|
1608
1812
|
}
|
|
1609
|
-
/** A run event with its wave renumbered to `wave`: the fan-out that applies one wave numbers it 1. */
|
|
1610
|
-
function inWave(body, wave) {
|
|
1611
|
-
return "wave" in body && typeof body.wave === "number" ? { ...body, wave } : body;
|
|
1612
|
-
}
|
|
1613
1813
|
/**
|
|
1614
1814
|
* `pr-apply --wave-gate <gate>` (#4003): apply the pull request's approved
|
|
1615
1815
|
* set a wave at a time, each wave planned after the one before it applied.
|
|
1616
1816
|
*
|
|
1617
1817
|
* The first job plans every member, as pr-apply does, and decides the pull
|
|
1618
|
-
* request's gate against that digest.
|
|
1619
|
-
*
|
|
1620
|
-
*
|
|
1621
|
-
* (`
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1818
|
+
* request's gate against that digest. The waves then run on op waves
|
|
1819
|
+
* (#4588): the component waves spec (`componentWavesSpec`), each run a
|
|
1820
|
+
* component, planned and applied through the component plan-wave and
|
|
1821
|
+
* apply-wave steps (`chant components plan-wave|apply-wave`). Each wave is
|
|
1822
|
+
* planned against the outputs the waves before it left. When the approved
|
|
1823
|
+
* change set covers its plan (`planCoveredBy`, the op waves' `pull-request`
|
|
1824
|
+
* approval) it applies under the pull request's approval; when it does not,
|
|
1825
|
+
* it waits at `<gate>-wave-<k>` under the pull request's op for an approval
|
|
1826
|
+
* of its new plan, and exits 3.
|
|
1624
1827
|
*
|
|
1625
1828
|
* With `--wave <k>` the job runs wave k and no other, reading the approved
|
|
1626
1829
|
* set and the progress from the `--resume` record the job before it left.
|
|
@@ -1734,7 +1937,6 @@ async function prApplyWaves(ctx, p, at) {
|
|
|
1734
1937
|
`Nothing was applied. Run wave ${left}'s job first, with the same --resume record.`,
|
|
1735
1938
|
}), 1);
|
|
1736
1939
|
}
|
|
1737
|
-
let planned;
|
|
1738
1940
|
let judged = { held: false };
|
|
1739
1941
|
if (carry) {
|
|
1740
1942
|
// What the earlier waves applied settles first (#4007), each in its own wave, as a resumed apply's does.
|
|
@@ -1751,6 +1953,8 @@ async function prApplyWaves(ctx, p, at) {
|
|
|
1751
1953
|
const set = await planAll(p, events?.emit);
|
|
1752
1954
|
approved = set;
|
|
1753
1955
|
if (set.failed) {
|
|
1956
|
+
if (set.policyDenied)
|
|
1957
|
+
return stop(report({ status: "plan-failed", message: "The policy denied a member's plan, so nothing was applied." }), CHANT_EXIT.denied);
|
|
1754
1958
|
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);
|
|
1755
1959
|
}
|
|
1756
1960
|
await storeChangeSetForGate(ctx, p, set.doc);
|
|
@@ -1765,9 +1969,8 @@ async function prApplyWaves(ctx, p, at) {
|
|
|
1765
1969
|
if (afterGate && decided.satisfied)
|
|
1766
1970
|
return stop(report({ status: "failed", message: afterGate }), 1);
|
|
1767
1971
|
if (!decided.satisfied)
|
|
1768
|
-
return stop(report({ status: "refused", refusal: decided.refusal, message: decided.message }),
|
|
1972
|
+
return stop(report({ status: "refused", refusal: decided.refusal, message: decided.message }), decided.refusal === "plan-changed" ? CHANT_EXIT.moved : CHANT_EXIT.waiting);
|
|
1769
1973
|
via = decided.via;
|
|
1770
|
-
planned = set;
|
|
1771
1974
|
}
|
|
1772
1975
|
const approvedSet = approved;
|
|
1773
1976
|
const review = reviewFor(args, p, pr, green);
|
|
@@ -1813,6 +2016,9 @@ async function prApplyWaves(ctx, p, at) {
|
|
|
1813
2016
|
/** The last apply in this job that failed (#4291): its results give the exit code once every wave ran. */
|
|
1814
2017
|
let lastFailure;
|
|
1815
2018
|
let planFailedIn;
|
|
2019
|
+
// #4588: the outputs file the waves' plan-wave and apply-wave steps hand outputs on in.
|
|
2020
|
+
const { componentWaveOutputsFile } = await import("../../components/product-pipeline.js");
|
|
2021
|
+
const outputsFile = componentWaveOutputsFile(op);
|
|
1816
2022
|
for (let k = from; k <= to; k++) {
|
|
1817
2023
|
// #4291: a component of this wave whose upstream failed, or was blocked by a failure, is blocked; the rest of the wave runs.
|
|
1818
2024
|
const before = new Set(p.plan.waves.slice(0, k - 1).flat());
|
|
@@ -1835,137 +2041,63 @@ async function prApplyWaves(ctx, p, at) {
|
|
|
1835
2041
|
recordAttempt();
|
|
1836
2042
|
continue;
|
|
1837
2043
|
}
|
|
1838
|
-
|
|
1839
|
-
//
|
|
1840
|
-
|
|
1841
|
-
// the outputs the waves before it left.
|
|
1842
|
-
let set;
|
|
1843
|
-
let entry;
|
|
1844
|
-
if (planned && k === 1) {
|
|
1845
|
-
set = {
|
|
1846
|
-
...planned,
|
|
1847
|
-
members: planned.members.filter((m) => inThisWave.has(m.component)),
|
|
1848
|
-
plans: Object.fromEntries(Object.entries(planned.plans).filter(([name]) => inThisWave.has(name))),
|
|
1849
|
-
};
|
|
1850
|
-
entry = { wave: k, components: wavePlan.order, status: "applied", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest, ...(approval.approvedBy ? { approvedBy: approval.approvedBy } : {}) };
|
|
1851
|
-
}
|
|
1852
|
-
else {
|
|
1853
|
-
const notApplied = Object.fromEntries(Object.entries(approvedSet.outputs).filter(([name]) => !completed.has(name)));
|
|
1854
|
-
const fresh = await hookedPlan(p, wavePlan.order, () => planPrSet({
|
|
1855
|
-
components: p.components,
|
|
1856
|
-
plan: wavePlan,
|
|
1857
|
-
registry: p.registry,
|
|
1858
|
-
env: p.env,
|
|
1859
|
-
seededOutputs: { ...p.seededOutputs, ...notApplied, ...outputsSoFar },
|
|
1860
|
-
...(events ? { onRunEvent: (body) => events.emit(body) } : {}),
|
|
1861
|
-
}));
|
|
1862
|
-
if (fresh.failed) {
|
|
1863
|
-
for (const m of fresh.members) {
|
|
1864
|
-
after.set(m.member, m);
|
|
1865
|
-
if (m.status === "plan-failed")
|
|
1866
|
-
failedSoFar.add(m.component);
|
|
1867
|
-
}
|
|
1868
|
-
setWave({ wave: k, components: wavePlan.order, status: "plan-failed", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest });
|
|
1869
|
-
// #4291: the later waves still run what does not depend on this wave.
|
|
1870
|
-
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 + "." }));
|
|
1871
|
-
planFailedIn ?? (planFailedIn = k);
|
|
1872
|
-
continue;
|
|
1873
|
-
}
|
|
1874
|
-
const moved = waveNotCovered(approvedSet.doc, fresh.doc, approvedSet.members, { approved: approvedSet.shapes, fresh: fresh.shapes });
|
|
1875
|
-
set = fresh;
|
|
1876
|
-
if (moved.length === 0) {
|
|
1877
|
-
console.error(formatInfo(`wave ${k}: the approved plan covers what it plans now, so it applies under the pull request's approval`));
|
|
1878
|
-
entry = { wave: k, components: wavePlan.order, status: "applied", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest, ...(approval.approvedBy ? { approvedBy: approval.approvedBy } : {}) };
|
|
1879
|
-
}
|
|
1880
|
-
else {
|
|
1881
|
-
const gate = waveGateName(waveGate, k);
|
|
1882
|
-
const digest = fresh.doc.digest;
|
|
1883
|
-
console.error(formatInfo(`wave ${k}: its plan moved since the pull request's (${moved.join("; ")}), so it needs an approval of ${gate}`));
|
|
1884
|
-
await storeChangeSetForGate(ctx, p, fresh.doc);
|
|
1885
|
-
writeWaveChangeSet(ctx, k, fresh.doc, upload);
|
|
1886
|
-
const approveLine = prApproveCommand({ op, gate, digest });
|
|
1887
|
-
const check = await emitGateStep(events?.emit, { op, gate }, () => decidePrGate(gitGateLedgerPort(), { op, gate, digest, description: `${changeLabel(pr, green)}, wave ${k} of ${total}: ${wavePlan.order.join(", ")}` }), (unapproved) => unapproved.mismatch
|
|
1888
|
-
? `wave ${k}'s plan changed after its approval. Approve the plan now: ${approveLine}`
|
|
1889
|
-
: `wave ${k}'s plan is not the one the pull request approved. Approve it: ${approveLine}`);
|
|
1890
|
-
const waveApproval = approvalOf(check);
|
|
1891
|
-
const waiting = {
|
|
1892
|
-
wave: k,
|
|
1893
|
-
components: wavePlan.order,
|
|
1894
|
-
status: "waiting",
|
|
1895
|
-
approval: "wave",
|
|
1896
|
-
gate,
|
|
1897
|
-
digest,
|
|
1898
|
-
moved,
|
|
1899
|
-
...(waveApproval.approved ? { approved: waveApproval.approved } : {}),
|
|
1900
|
-
};
|
|
1901
|
-
if (!check.satisfied) {
|
|
1902
|
-
setWave(waiting);
|
|
1903
|
-
const message = waveApproval.status === "changed"
|
|
1904
|
-
? `Wave ${k}'s plan changed after its approval, so nothing in it was applied. approved: ${waveApproval.approved ?? "(none)"}; planned now: ${digest}. ` +
|
|
1905
|
-
`Read the new plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`
|
|
1906
|
-
: `Wave ${k} was planned after the waves before it applied, and the pull request's approved plan does not cover it: ${moved.join("; ")}. ` +
|
|
1907
|
-
`Nothing in wave ${k} was applied. Read its plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`;
|
|
1908
|
-
return stop(report({ status: "refused", refusal: waveApproval.status === "changed" ? "wave-plan-changed" : "wave-not-approved", message }), GATED_EXIT_CODE);
|
|
1909
|
-
}
|
|
1910
|
-
const waveReview = await review(waveApproval.approvedBy ?? [], `Wave ${k}'s plan`);
|
|
1911
|
-
if (waveReview && "error" in waveReview)
|
|
1912
|
-
return fail(waveReview.error);
|
|
1913
|
-
if (waveReview) {
|
|
1914
|
-
setWave(waiting);
|
|
1915
|
-
emitReviewStop(events, waveReview.message);
|
|
1916
|
-
return stop(report({ status: "refused", refusal: waveReview.refusal, message: waveReview.message }), GATED_EXIT_CODE);
|
|
1917
|
-
}
|
|
1918
|
-
entry = { wave: k, components: wavePlan.order, status: "applied", approval: "wave", gate, digest, moved, ...(waveApproval.approvedBy ? { approvedBy: waveApproval.approvedBy } : {}) };
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
2044
|
+
// #4588: the wave plans, waits or passes its gate, and applies on op waves: the component waves spec,
|
|
2045
|
+
// each run a component, through the component plan-wave and apply-wave steps.
|
|
2046
|
+
const pending = { wave: k, components: wavePlan.order, status: "applied", approval: "pull-request", gate: p.gate, digest: approvedSet.doc.digest };
|
|
1921
2047
|
// #4288: the wave's apply-side hooks, around its apply.
|
|
1922
2048
|
const waveBefore = await runStageHook(p, "before-apply", wavePlan.order, undefined, `nothing in wave ${k} was applied`);
|
|
1923
2049
|
if (waveBefore) {
|
|
1924
|
-
setWave({ ...
|
|
2050
|
+
setWave({ ...pending, status: "failed" });
|
|
1925
2051
|
return stop(report({ status: "failed", message: waveBefore }), 1);
|
|
1926
2052
|
}
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
if (settled.status === "ok") {
|
|
1942
|
-
completed.add(settled.component);
|
|
1943
|
-
failedSoFar.delete(settled.component);
|
|
1944
|
-
if (inputsNow[settled.component] !== undefined)
|
|
1945
|
-
inputsSoFar[settled.component] = inputsNow[settled.component];
|
|
1946
|
-
if (outputs)
|
|
1947
|
-
outputsSoFar[settled.component] = outputs;
|
|
1948
|
-
}
|
|
1949
|
-
else if (settled.status === "fail") {
|
|
1950
|
-
failedSoFar.add(settled.component);
|
|
1951
|
-
}
|
|
1952
|
-
recordAttempt();
|
|
1953
|
-
},
|
|
1954
|
-
});
|
|
1955
|
-
for (const m of applied.members)
|
|
1956
|
-
after.set(m.member, m);
|
|
1957
|
-
for (const name of applied.run.completed) {
|
|
2053
|
+
// The outputs the waves before this one left, and the approved set's for what has not applied yet, seed its plans.
|
|
2054
|
+
const notApplied = Object.fromEntries(Object.entries(approvedSet.outputs).filter(([name]) => !completed.has(name)));
|
|
2055
|
+
mkdirSync(dirname(resolve(outputsFile)), { recursive: true });
|
|
2056
|
+
writeFileSync(resolve(outputsFile), JSON.stringify({ ...p.seededOutputs, ...notApplied, ...outputsSoFar }, null, 2) + "\n");
|
|
2057
|
+
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 });
|
|
2058
|
+
const entry = ran.entry;
|
|
2059
|
+
if (ran.review && "error" in ran.review)
|
|
2060
|
+
return fail(ran.review.error);
|
|
2061
|
+
if (ran.review && ran.exitCode === CHANT_EXIT.waiting) {
|
|
2062
|
+
setWave(entry);
|
|
2063
|
+
emitReviewStop(events, ran.review.message);
|
|
2064
|
+
return stop(report({ status: "refused", refusal: ran.review.refusal, message: ran.review.message }), GATED_EXIT_CODE);
|
|
2065
|
+
}
|
|
2066
|
+
for (const name of ran.applied) {
|
|
1958
2067
|
completed.add(name);
|
|
1959
|
-
|
|
1960
|
-
if (
|
|
1961
|
-
|
|
2068
|
+
failedSoFar.delete(name);
|
|
2069
|
+
if (inputsNow[name] !== undefined)
|
|
2070
|
+
inputsSoFar[name] = inputsNow[name];
|
|
2071
|
+
if (ran.outputs[name])
|
|
2072
|
+
outputsSoFar[name] = ran.outputs[name];
|
|
2073
|
+
}
|
|
2074
|
+
for (const name of ran.failed)
|
|
2075
|
+
failedSoFar.add(name);
|
|
2076
|
+
if (ran.exitCode === CHANT_EXIT.waiting || ran.exitCode === CHANT_EXIT.moved) {
|
|
2077
|
+
setWave(entry);
|
|
2078
|
+
// #4003: the wave's new plan beside the report, for whoever approves its gate.
|
|
2079
|
+
if (ran.changeSet)
|
|
2080
|
+
writeWaveChangeSet(ctx, k, ran.changeSet, upload);
|
|
2081
|
+
const approveLine = prApproveCommand({ op, gate: entry.gate, digest: entry.digest });
|
|
2082
|
+
const message = ran.exitCode === CHANT_EXIT.moved
|
|
2083
|
+
? `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.`
|
|
2084
|
+
: `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("; ")}` : ""}. ` +
|
|
2085
|
+
`Nothing in wave ${k} was applied. Read its plan, and if it is right, approve it: ${approveLine}; then run the wave's apply again.`;
|
|
2086
|
+
return stop(report({ status: "refused", refusal: ran.exitCode === CHANT_EXIT.moved ? "wave-plan-changed" : "wave-not-approved", message }), ran.exitCode);
|
|
2087
|
+
}
|
|
2088
|
+
if (ran.exitCode === CHANT_EXIT.held) {
|
|
2089
|
+
setWave({ ...entry, status: "waiting" });
|
|
2090
|
+
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);
|
|
1962
2091
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2092
|
+
if (ran.exitCode === CHANT_EXIT.denied || ran.exitCode === CHANT_EXIT.declined || ran.exitCode === CHANT_EXIT.superseded) {
|
|
2093
|
+
setWave({ ...entry, status: "failed" });
|
|
2094
|
+
return stop(report({ status: "failed", message: `Wave ${k} stopped on op waves with exit ${ran.exitCode}; nothing more was applied.` }), ran.exitCode);
|
|
2095
|
+
}
|
|
2096
|
+
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`);
|
|
2097
|
+
setWave({ ...entry, status: ran.exitCode === CHANT_EXIT.done && !waveAfter ? "applied" : "failed" });
|
|
2098
|
+
if (ran.exitCode !== CHANT_EXIT.done) {
|
|
1967
2099
|
// #4291: a failed member blocks only its dependents, so the later waves still run.
|
|
1968
|
-
lastFailure = {
|
|
2100
|
+
lastFailure = { exitCode: ran.exitCode };
|
|
1969
2101
|
recordAttempt();
|
|
1970
2102
|
continue;
|
|
1971
2103
|
}
|
|
@@ -1980,13 +2112,342 @@ async function prApplyWaves(ctx, p, at) {
|
|
|
1980
2112
|
const message = planFailedIn !== undefined && !lastFailure
|
|
1981
2113
|
? `A member of wave ${planFailedIn} failed to plan, so nothing in wave ${planFailedIn} was applied.${blockedLine}`
|
|
1982
2114
|
: blockedLine ? blockedLine.trim() : undefined;
|
|
1983
|
-
return stop(report({ status: "failed", ...(message ? { message } : {}) }), lastFailure ?
|
|
2115
|
+
return stop(report({ status: "failed", ...(message ? { message } : {}) }), lastFailure ? lastFailure.exitCode : 1);
|
|
1984
2116
|
}
|
|
1985
2117
|
const done = p.plan.order.every((name) => completed.has(name));
|
|
1986
2118
|
if (green && done)
|
|
1987
2119
|
await recordGreenApplied(p, green, approvedSet.doc.digest, approval, via);
|
|
1988
2120
|
return stop(report({ status: done ? "applied" : "wave-applied" }), 0);
|
|
1989
2121
|
}
|
|
2122
|
+
// ── The component plan-wave and apply-wave steps (#4588) ─────────────────────
|
|
2123
|
+
/** The outputs earlier waves' components left, from `--wave-outputs`; empty when the file is not there yet. */
|
|
2124
|
+
function readWaveOutputs(file) {
|
|
2125
|
+
if (!file || !existsSync(resolve(file)))
|
|
2126
|
+
return { outputs: {} };
|
|
2127
|
+
try {
|
|
2128
|
+
const parsed = JSON.parse(readFileSync(resolve(file), "utf8"));
|
|
2129
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
2130
|
+
return { error: `--wave-outputs ${file} must hold { "<component>": { ...outputs } }` };
|
|
2131
|
+
return { outputs: parsed };
|
|
2132
|
+
}
|
|
2133
|
+
catch (err) {
|
|
2134
|
+
return { error: `--wave-outputs: could not read "${file}": ${err instanceof Error ? err.message : String(err)}` };
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
/** The runs `chant run wave` wrote to `{runs}`: their targets, each a component, and on apply-wave the digest each was approved at. */
|
|
2138
|
+
function readWaveRuns(file) {
|
|
2139
|
+
if (!file)
|
|
2140
|
+
return { error: "the step needs --runs <file>, which chant run wave fills in as {runs}" };
|
|
2141
|
+
try {
|
|
2142
|
+
const parsed = JSON.parse(readFileSync(resolve(file), "utf8"));
|
|
2143
|
+
if (!Array.isArray(parsed?.runs))
|
|
2144
|
+
return { error: `--runs ${file} has no runs` };
|
|
2145
|
+
return parsed.runs.flatMap((r) => typeof r?.target === "string" ? [{ target: r.target, ...(typeof r.planDigest === "string" ? { planDigest: r.planDigest } : {}) }] : []);
|
|
2146
|
+
}
|
|
2147
|
+
catch (err) {
|
|
2148
|
+
return { error: `--runs: could not read "${file}": ${err instanceof Error ? err.message : String(err)}` };
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
/** The fan-out plan of `names`, one wave of the derivation, with the rest of that wave counted as done. */
|
|
2152
|
+
function namedWavePlan(p, names) {
|
|
2153
|
+
const unknown = names.filter((n) => !p.plan.order.includes(n));
|
|
2154
|
+
if (unknown.length > 0)
|
|
2155
|
+
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"}` };
|
|
2156
|
+
const k = p.plan.waves.findIndex((w) => w.includes(names[0])) + 1;
|
|
2157
|
+
const wave = p.plan.waves[k - 1] ?? [];
|
|
2158
|
+
const across = names.filter((n) => !wave.includes(n));
|
|
2159
|
+
if (across.length > 0)
|
|
2160
|
+
return { error: `${names[0]} and ${across.join(", ")} are in different waves of the derivation, so one wave step cannot plan them together` };
|
|
2161
|
+
return prWavePlan(p.plan, p.components, k, wave.filter((n) => !names.includes(n)));
|
|
2162
|
+
}
|
|
2163
|
+
/** One component's entry in the op-waves plans file: the digest over its members' plans, and whether it changes or destroys anything. */
|
|
2164
|
+
function componentPlanEntry(set, component) {
|
|
2165
|
+
const members = set.members.filter((m) => m.component === component).sort((a, b) => a.member.localeCompare(b.member));
|
|
2166
|
+
const names = new Set(members.map((m) => m.member));
|
|
2167
|
+
const entries = set.doc.entries.filter((e) => names.has(e.member));
|
|
2168
|
+
const changes = entries.filter((e) => e.action !== "no-op" && e.action !== "read");
|
|
2169
|
+
const destructive = changes.some((e) => e.action === "delete" || e.action === "replace");
|
|
2170
|
+
return {
|
|
2171
|
+
target: component,
|
|
2172
|
+
planDigest: computePlanDigest("component-wave", members.map((m) => ({ member: m.member, planDigest: m.planDigest }))),
|
|
2173
|
+
...(changes.length === 0 ? { empty: true } : {}),
|
|
2174
|
+
...(destructive ? { destructive: true } : {}),
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
/** Read the step's runs and outputs files from its flags. */
|
|
2178
|
+
function waveStepFiles(args) {
|
|
2179
|
+
const runs = readWaveRuns(args.runsFile);
|
|
2180
|
+
if ("error" in runs)
|
|
2181
|
+
return runs;
|
|
2182
|
+
if (!args.plansFile)
|
|
2183
|
+
return { error: "the step needs --plans <file>, which chant run wave fills in as {plans}" };
|
|
2184
|
+
const read = readWaveOutputs(args.waveOutputs);
|
|
2185
|
+
if ("error" in read)
|
|
2186
|
+
return read;
|
|
2187
|
+
return { runs, plansFile: args.plansFile, ...(args.waveOutputs ? { outputsFile: args.waveOutputs } : {}), outputs: read.outputs };
|
|
2188
|
+
}
|
|
2189
|
+
/** Plan the step's runs, each a component, against the outputs the earlier waves left. */
|
|
2190
|
+
async function planComponentRuns(p, files) {
|
|
2191
|
+
const names = files.runs.map((r) => r.target);
|
|
2192
|
+
const plan = names.length > 0 ? namedWavePlan(p, names) : { ...p.plan, order: [], waves: [] };
|
|
2193
|
+
if ("error" in plan)
|
|
2194
|
+
return plan;
|
|
2195
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
2196
|
+
const set = await planPrSet({ components: p.components, plan, registry: p.registry, env: p.env, seededOutputs: { ...p.seededOutputs, ...files.outputs }, ...(lockGrain ? { lockGrain } : {}), policyBase: p.base });
|
|
2197
|
+
return { set, plan };
|
|
2198
|
+
}
|
|
2199
|
+
/** The plan step over `p`: write `{plans}`, one digest per component and the wave's change set. */
|
|
2200
|
+
async function planComponentWave(p, files) {
|
|
2201
|
+
const planned = await planComponentRuns(p, files);
|
|
2202
|
+
if ("error" in planned)
|
|
2203
|
+
return fail(planned.error);
|
|
2204
|
+
const { set } = planned;
|
|
2205
|
+
if (set.failed) {
|
|
2206
|
+
for (const m of set.members.filter((x) => x.status === "plan-failed"))
|
|
2207
|
+
console.error(formatError({ message: `${m.member} (${m.component}) failed to plan${m.error ? `: ${m.error}` : ""}` }));
|
|
2208
|
+
return set.policyDenied ? CHANT_EXIT.denied : 1;
|
|
2209
|
+
}
|
|
2210
|
+
const file = { runs: files.runs.map((r) => componentPlanEntry(set, r.target)), changeSet: set.doc };
|
|
2211
|
+
mkdirSync(dirname(resolve(files.plansFile)), { recursive: true });
|
|
2212
|
+
writeFileSync(resolve(files.plansFile), JSON.stringify(file, null, 2) + "\n");
|
|
2213
|
+
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}`));
|
|
2214
|
+
return 0;
|
|
2215
|
+
}
|
|
2216
|
+
/** 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. */
|
|
2217
|
+
async function applyComponentWave(p, files, opts = {}) {
|
|
2218
|
+
if (files.runs.length === 0)
|
|
2219
|
+
return 0;
|
|
2220
|
+
const planned = await planComponentRuns(p, files);
|
|
2221
|
+
if ("error" in planned)
|
|
2222
|
+
return fail(planned.error);
|
|
2223
|
+
const { set, plan } = planned;
|
|
2224
|
+
if (set.failed)
|
|
2225
|
+
return fail("A component of the wave failed to plan again, so nothing in it was applied.");
|
|
2226
|
+
const moved = files.runs.filter((r) => r.planDigest !== undefined && !samePlanDigest(componentPlanEntry(set, r.target).planDigest, r.planDigest));
|
|
2227
|
+
if (moved.length > 0) {
|
|
2228
|
+
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." }));
|
|
2229
|
+
return CHANT_EXIT.moved;
|
|
2230
|
+
}
|
|
2231
|
+
const lease = await leaseSetRows(p, set);
|
|
2232
|
+
if (typeof lease === "number")
|
|
2233
|
+
return lease;
|
|
2234
|
+
if ("held" in lease) {
|
|
2235
|
+
console.error(formatError({ message: lease.held }));
|
|
2236
|
+
return CHANT_EXIT.held;
|
|
2237
|
+
}
|
|
2238
|
+
const lockGrain = await declaredLockGrainOf(p);
|
|
2239
|
+
const release = autoReleaseRun(`wave-${Date.now()}`);
|
|
2240
|
+
let applied;
|
|
2241
|
+
try {
|
|
2242
|
+
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 } : {}) });
|
|
2243
|
+
}
|
|
2244
|
+
finally {
|
|
2245
|
+
await lease.release();
|
|
2246
|
+
}
|
|
2247
|
+
await recordAutoReleasesForRun(applied.run.results, p.env, release.runId, resolveAutoReleaseDisabled(p.config, opts.noReleaseRecord), release.runOrigin, undefined, undefined, prAppliedDigests(p, applied.members));
|
|
2248
|
+
if (files.outputsFile) {
|
|
2249
|
+
const next = { ...files.outputs };
|
|
2250
|
+
for (const name of applied.run.completed)
|
|
2251
|
+
next[name] = applied.run.componentOutputs[name] ?? {};
|
|
2252
|
+
mkdirSync(dirname(resolve(files.outputsFile)), { recursive: true });
|
|
2253
|
+
writeFileSync(resolve(files.outputsFile), JSON.stringify(next, null, 2) + "\n");
|
|
2254
|
+
}
|
|
2255
|
+
for (const m of applied.members)
|
|
2256
|
+
console.error(m.status === "applied" ? formatSuccess(`applied ${m.member} (${m.component})`) : formatWarning({ message: `${m.member} (${m.component}): ${m.status}${m.error ? `, ${m.error}` : ""}` }));
|
|
2257
|
+
// #4291: the components that applied, so op waves fails only the others and blocks only what depends on them.
|
|
2258
|
+
const runsResult = opts.runsResult ?? (process.env.CHANT_APPLY_RUNS_RESULT ? resolve(process.env.CHANT_APPLY_RUNS_RESULT) : undefined);
|
|
2259
|
+
if (runsResult && applied.status !== "applied") {
|
|
2260
|
+
mkdirSync(dirname(runsResult), { recursive: true });
|
|
2261
|
+
writeFileSync(runsResult, JSON.stringify({ applied: [...applied.run.completed].sort() }, null, 2) + "\n");
|
|
2262
|
+
}
|
|
2263
|
+
return applied.status === "applied" ? 0 : applied.status === "waiting" ? CHANT_EXIT.waiting : 1;
|
|
2264
|
+
}
|
|
2265
|
+
/**
|
|
2266
|
+
* `chant components plan-wave --runs <file> --plans <file> --base <ref>
|
|
2267
|
+
* --env <env> [--member <m>] [--wave-outputs <file>]` (#4588): the
|
|
2268
|
+
* component plan step of a component waves spec. Plans each run, a
|
|
2269
|
+
* component, through the project's capabilities against the outputs the
|
|
2270
|
+
* waves before it left, and writes `{plans}`: one digest per component over
|
|
2271
|
+
* its members' plans, and the wave's change set, which a `pull-request`
|
|
2272
|
+
* wave checks the pull request's approval against.
|
|
2273
|
+
*/
|
|
2274
|
+
export async function runComponentsPlanWave(ctx) {
|
|
2275
|
+
const files = waveStepFiles(ctx.args);
|
|
2276
|
+
if ("error" in files)
|
|
2277
|
+
return fail(files.error);
|
|
2278
|
+
const p = await prepare(ctx, "apply");
|
|
2279
|
+
if (typeof p === "number")
|
|
2280
|
+
return p;
|
|
2281
|
+
return planComponentWave(p, files);
|
|
2282
|
+
}
|
|
2283
|
+
/**
|
|
2284
|
+
* `chant components apply-wave --runs <file> --plans <file> --base <ref>
|
|
2285
|
+
* --env <env> [--member <m>] [--wave-outputs <file>]` (#4588): the
|
|
2286
|
+
* component apply step. Plans the approved runs again and exits 4 when a
|
|
2287
|
+
* component's plan is not the one approved; else leases its rows on the
|
|
2288
|
+
* resource grain, applies, records the releases, and adds each applied
|
|
2289
|
+
* component's outputs to `--wave-outputs` for the next wave.
|
|
2290
|
+
*/
|
|
2291
|
+
export async function runComponentsApplyWave(ctx) {
|
|
2292
|
+
const files = waveStepFiles(ctx.args);
|
|
2293
|
+
if ("error" in files)
|
|
2294
|
+
return fail(files.error);
|
|
2295
|
+
const p = await prepare(ctx, "apply");
|
|
2296
|
+
if (typeof p === "number")
|
|
2297
|
+
return p;
|
|
2298
|
+
return applyComponentWave(p, files, { noReleaseRecord: ctx.args.noReleaseRecord });
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* The component steps in this process (#4588): `pr-apply --wave-gate`
|
|
2302
|
+
* already holds the prepared project, so the plan-wave and apply-wave lines
|
|
2303
|
+
* of its spec run here against it, rather than in a process that would
|
|
2304
|
+
* derive the change again.
|
|
2305
|
+
*/
|
|
2306
|
+
function componentWaveExec(p, noReleaseRecord, onRunEvent) {
|
|
2307
|
+
return async (argv, cwd, env) => {
|
|
2308
|
+
const at = argv.findIndex((a, i) => a === "components" && (argv[i + 1] === "plan-wave" || argv[i + 1] === "apply-wave"));
|
|
2309
|
+
if (at < 0)
|
|
2310
|
+
return fail(`not a component wave step: ${argv.join(" ")}`);
|
|
2311
|
+
let args;
|
|
2312
|
+
try {
|
|
2313
|
+
args = parseArgs(argv.slice(at));
|
|
2314
|
+
}
|
|
2315
|
+
catch (err) {
|
|
2316
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
2317
|
+
}
|
|
2318
|
+
const files = waveStepFiles(args);
|
|
2319
|
+
if ("error" in files)
|
|
2320
|
+
return fail(files.error);
|
|
2321
|
+
const runsResult = env?.CHANT_APPLY_RUNS_RESULT ? resolve(cwd, env.CHANT_APPLY_RUNS_RESULT) : undefined;
|
|
2322
|
+
return argv[at + 1] === "plan-wave" ? planComponentWave(p, files) : applyComponentWave(p, files, { noReleaseRecord, ...(onRunEvent ? { onRunEvent } : {}), ...(runsResult ? { runsResult } : {}) });
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* A gate ledger that holds the approval `pr-apply` already decided (#4588):
|
|
2327
|
+
* an approval of the pull request's gate under its op, for the approved
|
|
2328
|
+
* change set, so an op wave of the component waves spec finds the approval
|
|
2329
|
+
* a pull request (or a green commit's merges) gave and checks its own plan
|
|
2330
|
+
* against it. Everything else is the real ledger's.
|
|
2331
|
+
*/
|
|
2332
|
+
function withDecidedApproval(port, at) {
|
|
2333
|
+
return {
|
|
2334
|
+
...port,
|
|
2335
|
+
appendPending: (input) => port.appendPending(input),
|
|
2336
|
+
async read(op) {
|
|
2337
|
+
const got = await port.read(op);
|
|
2338
|
+
if (op !== at.op)
|
|
2339
|
+
return got;
|
|
2340
|
+
const decided = { 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 };
|
|
2341
|
+
return { ...got, resolutions: [...got.resolutions, decided] };
|
|
2342
|
+
},
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
/**
|
|
2346
|
+
* The review rule on a wave's own gate (#4000, #4588): `--require-review`
|
|
2347
|
+
* judges an approval of the wave's gate as it judges the pull request's, so
|
|
2348
|
+
* an approval it refuses never reaches the op wave, which then waits. The
|
|
2349
|
+
* refusal is kept in `refused` for pr-apply's report. The pull request's gate
|
|
2350
|
+
* was judged before the waves ran, so its approvals pass as they are.
|
|
2351
|
+
*/
|
|
2352
|
+
function withWaveReview(port, at) {
|
|
2353
|
+
return {
|
|
2354
|
+
...port,
|
|
2355
|
+
async read(op) {
|
|
2356
|
+
var _a;
|
|
2357
|
+
const got = await port.read(op);
|
|
2358
|
+
const resolutions = [];
|
|
2359
|
+
for (const r of got.resolutions) {
|
|
2360
|
+
const stop = r.gate === at.prGate ? undefined : await at.review([r.resolvedBy], at.what);
|
|
2361
|
+
if (stop)
|
|
2362
|
+
(_a = at.refused).stop ?? (_a.stop = stop);
|
|
2363
|
+
else
|
|
2364
|
+
resolutions.push(r);
|
|
2365
|
+
}
|
|
2366
|
+
return { ...got, resolutions };
|
|
2367
|
+
},
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* Run wave `k` of `pr-apply --wave-gate` on op waves (#4588): the component
|
|
2372
|
+
* waves spec with the wave's runs left to apply, read at base as chant
|
|
2373
|
+
* wrote it (the spec is chant's, never the change's), decided under the
|
|
2374
|
+
* approval pr-apply holds, planned and applied through the component
|
|
2375
|
+
* plan-wave and apply-wave steps.
|
|
2376
|
+
*/
|
|
2377
|
+
async function runComponentWave(p, at) {
|
|
2378
|
+
const { componentWavesSpec, componentWaveSteps, PRODUCT_WAVES_SPEC_DIR: PRODUCT_WAVES_DIR } = await import("../../components/product-pipeline.js");
|
|
2379
|
+
const { runOpWave, opWavePlansPath } = await import("../../op/op-waves-run.js");
|
|
2380
|
+
const words = activeProductWords();
|
|
2381
|
+
const cwd = resolve(".");
|
|
2382
|
+
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 });
|
|
2383
|
+
const waves = p.plan.waves.map((w, i) => (i === at.k - 1 ? at.runs : w));
|
|
2384
|
+
const spec = componentWavesSpec(p.components, words, steps, { op: at.op, gate: at.waveGate, prGate: p.gate, waves });
|
|
2385
|
+
const specFile = `${PRODUCT_WAVES_DIR}/${at.op}.spec.json`;
|
|
2386
|
+
const refused = {};
|
|
2387
|
+
const result = await runOpWave({
|
|
2388
|
+
spec,
|
|
2389
|
+
specFile,
|
|
2390
|
+
wave: at.k,
|
|
2391
|
+
base: p.base,
|
|
2392
|
+
head: p.head,
|
|
2393
|
+
cwd,
|
|
2394
|
+
show: () => ({ sha: p.base, text: JSON.stringify(spec) }),
|
|
2395
|
+
gates: withWaveReview(withDecidedApproval(gitGateLedgerPort(), { op: at.op, gate: p.gate, digest: at.approved.digest, approvedBy: at.approvedBy, timestamp: new Date().toISOString() }), {
|
|
2396
|
+
prGate: p.gate,
|
|
2397
|
+
what: `Wave ${at.k}'s plan`,
|
|
2398
|
+
review: at.review,
|
|
2399
|
+
refused,
|
|
2400
|
+
}),
|
|
2401
|
+
// 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.
|
|
2402
|
+
runs: { append: async () => { } },
|
|
2403
|
+
changeSets: async (digest) => {
|
|
2404
|
+
if (samePlanDigest(digest, at.approved.digest))
|
|
2405
|
+
return at.approved;
|
|
2406
|
+
const { readStoredChangeSet } = await import("../../lifecycle/change-set-store.js");
|
|
2407
|
+
const got = await readStoredChangeSet(digest, { cwd });
|
|
2408
|
+
return got.status === "found" ? got.document : undefined;
|
|
2409
|
+
},
|
|
2410
|
+
lockGate: p.gate,
|
|
2411
|
+
// The apply's run events nest in pr-apply's stream with the derivation's wave number, as its log does.
|
|
2412
|
+
waveExec: componentWaveExec(p, at.noReleaseRecord, (body) => {
|
|
2413
|
+
const numbered = inWave(body, at.k);
|
|
2414
|
+
at.events?.nested(numbered);
|
|
2415
|
+
if (numbered.type !== "run-start")
|
|
2416
|
+
at.log(numbered);
|
|
2417
|
+
}),
|
|
2418
|
+
// The outcome files of this commit's waves alone, so a run of another commit on the same checkout blocks nothing here.
|
|
2419
|
+
outcomeDir: `${PRODUCT_WAVES_DIR}/${at.op}/outcomes-${p.head.slice(0, 12)}`,
|
|
2420
|
+
});
|
|
2421
|
+
const d = result.decision;
|
|
2422
|
+
const byPullRequest = d?.via === "pull-request";
|
|
2423
|
+
// #4553: an approval of the wave's own gate stands, but for another plan: the plan moved after its approval.
|
|
2424
|
+
const exitCode = result.exitCode === CHANT_EXIT.waiting && !byPullRequest && d?.mismatch && !refused.stop ? CHANT_EXIT.moved : result.exitCode;
|
|
2425
|
+
const entry = {
|
|
2426
|
+
wave: at.k,
|
|
2427
|
+
components: at.runs,
|
|
2428
|
+
status: exitCode === CHANT_EXIT.done ? "applied" : exitCode === CHANT_EXIT.waiting || exitCode === CHANT_EXIT.moved ? "waiting" : "failed",
|
|
2429
|
+
approval: byPullRequest || !d ? "pull-request" : "wave",
|
|
2430
|
+
gate: byPullRequest || !d ? p.gate : d.gate,
|
|
2431
|
+
digest: byPullRequest || !d ? at.approved.digest : d.digest,
|
|
2432
|
+
...(byPullRequest ? (at.approvedBy.length > 0 ? { approvedBy: at.approvedBy } : {}) : d?.approvedBy ? { approvedBy: [d.approvedBy] } : {}),
|
|
2433
|
+
...(!byPullRequest && d?.coveredBy?.reason ? { moved: [d.coveredBy.reason] } : {}),
|
|
2434
|
+
...(!byPullRequest && d?.mismatch?.approved ? { approved: d.mismatch.approved } : {}),
|
|
2435
|
+
};
|
|
2436
|
+
// A wave that waits at its own gate is the stream's gate step there, as before op waves (#4003).
|
|
2437
|
+
if (d && !byPullRequest && (exitCode === CHANT_EXIT.waiting || exitCode === CHANT_EXIT.moved)) {
|
|
2438
|
+
const waiting = { satisfied: false, pending: { op: at.op }, ...(d.mismatch ? { mismatch: d.mismatch } : {}) };
|
|
2439
|
+
await emitGateStep(at.events?.emit, { op: at.op, gate: d.gate }, async () => waiting, () => 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 })}`);
|
|
2440
|
+
}
|
|
2441
|
+
const read = readWaveOutputs(at.outputsFile);
|
|
2442
|
+
let changeSet;
|
|
2443
|
+
try {
|
|
2444
|
+
changeSet = JSON.parse(readFileSync(join(cwd, opWavePlansPath(spec, at.k)), "utf8")).changeSet;
|
|
2445
|
+
}
|
|
2446
|
+
catch {
|
|
2447
|
+
// The wave stopped before it planned.
|
|
2448
|
+
}
|
|
2449
|
+
return { exitCode, applied: result.applied, failed: result.failed, entry, outputs: "error" in read ? {} : read.outputs, ...(changeSet ? { changeSet } : {}), ...(refused.stop ? { review: refused.stop } : {}) };
|
|
2450
|
+
}
|
|
1990
2451
|
/** A wave's new plan (#4003), beside the report as `change-set-wave-<k>.json`, for whoever approves its gate. */
|
|
1991
2452
|
function writeWaveChangeSet(ctx, wave, doc, upload) {
|
|
1992
2453
|
const dir = resolve(ctx.args.output ?? PR_REPORT_DIR);
|