@intentius/chant 0.124.54 → 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/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.map +1 -1
- package/dist/capabilities/templates.js +1 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +2 -3
- 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 +82 -7
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +87 -15
- 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/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/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/fan-out.js +4 -0
- 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/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 +6 -2
- package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle-drift.js +7 -2
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +64 -5
- 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 +653 -205
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +21 -2
- 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/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 +124 -13
- 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/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/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-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 +57 -3
- package/dist/cli/registry.d.ts +35 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/sigv4.d.ts +42 -7
- package/dist/cloud-lister/sigv4.d.ts.map +1 -1
- package/dist/cloud-lister/sigv4.js +72 -22
- 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.d.ts +122 -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 +13 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +10 -2
- package/dist/components/driver.d.ts +20 -3
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +24 -4
- package/dist/components/fan-out-run.d.ts +12 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +56 -16
- package/dist/components/groups.d.ts.map +1 -1
- package/dist/components/groups.js +19 -2
- 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 +63 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +82 -3
- 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.d.ts +6 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +4 -1
- 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-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/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/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/discovery/sandbox/bundle.d.ts.map +1 -1
- package/dist/discovery/sandbox/bundle.js +25 -1
- package/dist/engine-facts.d.ts.map +1 -1
- package/dist/engine-facts.js +1 -2
- 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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lexicon.d.ts +106 -6
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.d.ts +24 -0
- package/dist/lifecycle/adoption-file.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.js +1 -2
- package/dist/lifecycle/cloud-index.d.ts.map +1 -1
- package/dist/lifecycle/cloud-index.js +1 -2
- 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/identity-match.d.ts +15 -0
- package/dist/lifecycle/identity-match.d.ts.map +1 -1
- package/dist/lifecycle/identity-match.js +11 -6
- package/dist/lifecycle/index-diff.d.ts +40 -0
- package/dist/lifecycle/index-diff.d.ts.map +1 -1
- package/dist/lifecycle/index-diff.js +1 -2
- package/dist/lifecycle/index-document.d.ts.map +1 -1
- package/dist/lifecycle/index-document.js +1 -2
- package/dist/lifecycle/index-import.d.ts +4 -1
- package/dist/lifecycle/index-import.d.ts.map +1 -1
- package/dist/lifecycle/index-import.js +29 -32
- 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/query.d.ts +50 -3
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +97 -6
- 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/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/snapshot-store-s3.d.ts +36 -3
- package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store-s3.js +9 -44
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store.js +1 -2
- 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/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/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/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 +12 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +7 -1
- 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 +149 -11
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +283 -44
- 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/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- 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/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/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-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/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.map +1 -1
- package/dist/workspace/drift-cli.js +8 -3
- 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/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/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/pr-report.schema.json +74 -3
- package/dist/workspace/promote.d.ts +1 -1
- package/dist/workspace/promote.d.ts.map +1 -1
- package/dist/workspace/promote.js +2 -1
- 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/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 +21 -1
- 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/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.test.ts +2 -3
- package/src/capabilities/templates.ts +1 -2
- package/src/cdk/advise.test.ts +1 -1
- package/src/change-set-bundle.test.ts +0 -1
- package/src/change-set.ts +2 -3
- 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 +6 -2
- package/src/ci-identity.ts +124 -22
- 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/init.ts +3 -1
- 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/fan-out.test.ts +10 -10
- package/src/cli/handlers/fan-out.ts +5 -0
- package/src/cli/handlers/gate-pending.ts +46 -0
- package/src/cli/handlers/init.ts +1 -0
- package/src/cli/handlers/ledger.ts +1 -1
- package/src/cli/handlers/lifecycle-drift.ts +7 -2
- package/src/cli/handlers/lock.test.ts +29 -2
- package/src/cli/handlers/lock.ts +66 -6
- 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 +5 -0
- 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 +655 -205
- package/src/cli/handlers/promote.test.ts +5 -5
- package/src/cli/handlers/promote.ts +22 -2
- package/src/cli/handlers/release.ts +2 -0
- package/src/cli/handlers/run-components-exit.test.ts +7 -7
- 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/serve.ts +10 -1
- package/src/cli/main.ts +126 -13
- package/src/cli/mcp/ledger-tools.ts +126 -0
- 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/server.test.ts +5 -4
- package/src/cli/mcp/server.ts +90 -16
- package/src/cli/mcp-config.ts +8 -3
- package/src/cli/parse-args.ts +42 -2
- package/src/cli/registry.ts +35 -0
- package/src/cloud-lister/sigv4.ts +80 -23
- 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.ts +130 -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 +23 -2
- package/src/components/driver.test.ts +3 -3
- package/src/components/driver.ts +38 -5
- package/src/components/fan-out-run.ts +68 -18
- package/src/components/groups.ts +17 -2
- 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 +8 -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 +1 -1
- package/src/components/pr-run.ts +121 -5
- 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.ts +10 -1
- package/src/components/release-compile.ts +87 -1
- 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/wave-plan-policy.test.ts +19 -0
- package/src/components/wave-plan.ts +78 -4
- 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/discovery/sandbox/bundle.ts +25 -1
- package/src/engine-facts.test.ts +2 -3
- package/src/engine-facts.ts +1 -2
- 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 +0 -1
- package/src/index.ts +2 -0
- package/src/lexicon.ts +95 -6
- package/src/lifecycle/adoption-file.ts +1 -2
- package/src/lifecycle/cloud-index.test.ts +2 -3
- package/src/lifecycle/cloud-index.ts +1 -2
- package/src/lifecycle/control-entries-ledger.test.ts +70 -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/identity-match.ts +25 -6
- package/src/lifecycle/index-diff.ts +1 -2
- package/src/lifecycle/index-document.ts +1 -2
- package/src/lifecycle/index-import.test.ts +14 -0
- package/src/lifecycle/index-import.ts +54 -34
- 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/publish-target-context.test.ts +108 -0
- package/src/lifecycle/query.test.ts +2 -3
- package/src/lifecycle/query.ts +109 -7
- 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/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/snapshot-store-s3.ts +9 -45
- package/src/lifecycle/snapshot-store.ts +1 -2
- package/src/lifecycle/target-lock.ts +24 -9
- 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/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/gate.ts +81 -22
- package/src/op/generate-pipeline.ts +7 -1
- package/src/op/index.ts +21 -0
- 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 +6 -2
- package/src/pr-loop-words.test.ts +155 -0
- package/src/pr-loop.ts +371 -52
- 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/release-floors.ts +1 -1
- package/src/run-event.ts +29 -1
- 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/chant-migrations/chud-lexicon-exit.ts +4 -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/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.ts +8 -3
- package/src/workspace/exit-cli.ts +2 -1
- package/src/workspace/import-fetch.ts +4 -2
- package/src/workspace/import-init.ts +4 -2
- package/src/workspace/ledger.schema.json +7 -3
- package/src/workspace/lineage-upgrade-cli.ts +2 -1
- package/src/workspace/pr-report.schema.json +74 -3
- package/src/workspace/promote.ts +2 -1
- 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/work-cli.ts +8 -2
- package/src/workspace/workspace-run.ts +2 -1
|
@@ -88,6 +88,8 @@ import type { ForgeKind } from "../pr-forge.js";
|
|
|
88
88
|
import type { DriverComponent } from "./driver.js";
|
|
89
89
|
import type { GatedWavePipelineOptions } from "./gated-wave-pipeline.js";
|
|
90
90
|
import type { CloudTradeSpec, PipelineCloudIdentity } from "../ci-identity.js";
|
|
91
|
+
import { type CiProductWords, type CiProductWordsInput } from "../ci-product-words.js";
|
|
92
|
+
import type { ControlTarget } from "../control/dispatch.js";
|
|
91
93
|
/** Where both jobs write their reports, kept as a CI artifact. */
|
|
92
94
|
export declare const PR_LOOP_REPORT_DIR = ".chant/pr";
|
|
93
95
|
/**
|
|
@@ -105,8 +107,20 @@ export declare const PR_APPLY_RECORD = ".chant/pr-resume/pr-apply.json";
|
|
|
105
107
|
export declare const PR_LOOP_IMAGE = "node:22";
|
|
106
108
|
/** Installs OpenTofu into `PR_LOOP_IMAGE`. */
|
|
107
109
|
export declare const PR_LOOP_SETUP: string[];
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
+
/**
|
|
111
|
+
* The setup lines for a pipeline running in `image`: the install when it is
|
|
112
|
+
* the default image, none otherwise. `engine` is the lines the project's
|
|
113
|
+
* lexicons give (#4550, `LexiconPlugin.ciSetup`, {@link engineSetupLines}):
|
|
114
|
+
* Pulumi or plunge for a Pulumi member, OpenTofu for a Terraform one. Absent,
|
|
115
|
+
* OpenTofu, as before.
|
|
116
|
+
*/
|
|
117
|
+
export declare function prLoopSetup(image: string, engine?: readonly string[]): string[];
|
|
118
|
+
/**
|
|
119
|
+
* Join the setup lines each lexicon gives (#4550), each line once, in the
|
|
120
|
+
* order the lexicons come. A project whose lexicons give none gets none, and
|
|
121
|
+
* {@link prLoopSetup} then falls back to OpenTofu.
|
|
122
|
+
*/
|
|
123
|
+
export declare function engineSetupLines(perLexicon: ReadonlyArray<readonly string[] | undefined>): string[];
|
|
110
124
|
/**
|
|
111
125
|
* Where the jobs keep their run-event files with `events` (#4007), as
|
|
112
126
|
* `CHANT_RUN_EVENTS_DIR`: inside the report directory, so the report
|
|
@@ -142,6 +156,12 @@ export interface PrLoopPipelineOptions {
|
|
|
142
156
|
* `waveGate` nor `build`.
|
|
143
157
|
*/
|
|
144
158
|
applyBeforeMerge?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* The requires checks the apply before merge asks (#4607): a product's
|
|
161
|
+
* `apply.requires`, passed as `pr-apply --requires <list>`. Absent: all
|
|
162
|
+
* four. Only with `applyBeforeMerge`.
|
|
163
|
+
*/
|
|
164
|
+
applyRequires?: readonly string[];
|
|
145
165
|
/**
|
|
146
166
|
* Stream each job's run events (#4007): `--events-json` on both commands,
|
|
147
167
|
* and `CHANT_RUN_EVENTS_DIR` set to {@link PR_LOOP_EVENTS_DIR}. Default false.
|
|
@@ -203,6 +223,14 @@ export interface PrLoopPipelineOptions {
|
|
|
203
223
|
* base; GitHub and Forgejo only. Absent: neither job.
|
|
204
224
|
*/
|
|
205
225
|
locks?: "plan";
|
|
226
|
+
/**
|
|
227
|
+
* `ci.lockGrain: repo` (#4552): one apply at a time in the repository.
|
|
228
|
+
* GitHub's apply jobs share the concurrency group `chant-apply-repo`,
|
|
229
|
+
* GitLab's the resource group of that name, and Forgejo's take the lock
|
|
230
|
+
* tag `refs/tags/chant-apply-lock` in the apply step (./repo-lock.ts). Set
|
|
231
|
+
* from the declaration at base. Absent: per environment and member.
|
|
232
|
+
*/
|
|
233
|
+
lockGrain?: "repo";
|
|
206
234
|
/**
|
|
207
235
|
* The cloud identity a pull request environment's jobs take (#4330), from
|
|
208
236
|
* `ci.identity.cloud` (`resolvePrEnvCloudIdentity` in ../ci-identity.ts):
|
|
@@ -212,6 +240,40 @@ export interface PrLoopPipelineOptions {
|
|
|
212
240
|
* Absent: they request no OIDC token.
|
|
213
241
|
*/
|
|
214
242
|
prEnvIdentity?: CloudTradeSpec;
|
|
243
|
+
/**
|
|
244
|
+
* The product's words (#4550, `@intentius/chant/ci-product`): the comment
|
|
245
|
+
* a job answers, and with `bin` the command every job runs in place of
|
|
246
|
+
* `chant`, whose bin passes the rest to chant in process with the words.
|
|
247
|
+
* The statuses and the note take the words in the running job, from the
|
|
248
|
+
* bin. Absent: chant's.
|
|
249
|
+
*/
|
|
250
|
+
words?: CiProductWordsInput | CiProductWords;
|
|
251
|
+
/** The engine install lines of the project's lexicons (#4550), for {@link prLoopSetup}. */
|
|
252
|
+
engineSetup?: string[];
|
|
253
|
+
/**
|
|
254
|
+
* The control repo (#4568, `@intentius/chant/ci-control`): after the last
|
|
255
|
+
* apply on merge succeeds, a `control-dispatch` job tells the control
|
|
256
|
+
* repo this member applied, and the control repo runs its dependents.
|
|
257
|
+
* The job maps the target's secret into `CHANT_CONTROL_TOKEN` for its one
|
|
258
|
+
* step; on GitLab, where a CI/CD variable reaches every job, the plan job
|
|
259
|
+
* unsets it with the forge tokens. `sentCheck` and `markSent` are the
|
|
260
|
+
* product's shell lines that find and set the commit's control status.
|
|
261
|
+
* Needs `applyOnMerge` or `waveGate`; ignored under `applyBeforeMerge`,
|
|
262
|
+
* which applies no default branch.
|
|
263
|
+
*/
|
|
264
|
+
control?: {
|
|
265
|
+
target: ControlTarget;
|
|
266
|
+
sentCheck?: string;
|
|
267
|
+
markSent?: string;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* A comment preview (#4620): `/<product> <plan word>` on a pull request
|
|
271
|
+
* plans its head again in a job that holds only a read token, and a job
|
|
272
|
+
* after it posts the note ({@link prCommentPreviewJob}). The words must
|
|
273
|
+
* name a `plan` command. Set from `--preview-comment` beside `--pr-loop`.
|
|
274
|
+
* Default false.
|
|
275
|
+
*/
|
|
276
|
+
previewComment?: boolean;
|
|
215
277
|
}
|
|
216
278
|
/** The lock job's step names and commands (#4327), shared by the GitHub-shaped generators. */
|
|
217
279
|
export declare const PR_LOCK_JOB = "lock";
|
|
@@ -220,6 +282,102 @@ export declare const PR_UNLOCK_JOB = "unlock";
|
|
|
220
282
|
export declare function prLockCommand(forge: ForgeKind): string;
|
|
221
283
|
/** `chant unlock` for the pull request that closed; reads `PR_NUMBER`. */
|
|
222
284
|
export declare const PR_UNLOCK_COMMAND = "chant unlock --pr \"$PR_NUMBER\"";
|
|
285
|
+
/** The job answering `/<product> lock` (#4588). */
|
|
286
|
+
export declare const PR_COMMENT_LOCK_JOB = "comment-lock";
|
|
287
|
+
/** The job answering `/<product> unlock` (#4588). */
|
|
288
|
+
export declare const PR_COMMENT_UNLOCK_JOB = "comment-unlock";
|
|
289
|
+
/** The GitLab variables a pipeline of the target branch is started with to lock or unlock a merge request (#4588), as `CHANT_APPLY_PR` applies one. */
|
|
290
|
+
export declare const GITLAB_LOCK_PR_VAR = "CHANT_LOCK_PR";
|
|
291
|
+
export declare const GITLAB_UNLOCK_PR_VAR = "CHANT_UNLOCK_PR";
|
|
292
|
+
/** A comment lock or unlock job (#4588): the comment it answers, its command, and the values the command reads. */
|
|
293
|
+
export interface PrCommentLockJob {
|
|
294
|
+
jobName: typeof PR_COMMENT_LOCK_JOB | typeof PR_COMMENT_UNLOCK_JOB;
|
|
295
|
+
/** Which comment command it answers. */
|
|
296
|
+
command: "lock" | "unlock";
|
|
297
|
+
/** The comment, `/<product> <word>`. */
|
|
298
|
+
comment: string;
|
|
299
|
+
/** The command line. Reads `$PR_NUMBER`. */
|
|
300
|
+
line: string;
|
|
301
|
+
/** The values it reads, as the forge spells them. On GitLab `PR_NUMBER` comes from {@link GITLAB_LOCK_PR_VAR} or {@link GITLAB_UNLOCK_PR_VAR}. */
|
|
302
|
+
env: Record<string, string>;
|
|
303
|
+
/** On GitLab, the variable a pipeline of the target branch is started with. */
|
|
304
|
+
gitlabVar?: string;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* The comment lock and unlock jobs (#4588), under `ci.locks: plan` when the
|
|
308
|
+
* words name the `lock` and `unlock` commands. `/<product> lock` runs `chant
|
|
309
|
+
* lock --keep`, which keeps the locks the pull request's plan took until it
|
|
310
|
+
* closes; `/<product> unlock` runs `chant unlock`, which releases them. Both
|
|
311
|
+
* run at the target branch's commit, so no code of the change runs, and
|
|
312
|
+
* GitHub asks for a commenter who can write as it does for the apply
|
|
313
|
+
* comment. GitLab starts no pipeline on a note, so there each job runs in a
|
|
314
|
+
* pipeline of the target branch started with {@link GITLAB_LOCK_PR_VAR} or
|
|
315
|
+
* {@link GITLAB_UNLOCK_PR_VAR} set to the merge request's iid.
|
|
316
|
+
*/
|
|
317
|
+
export declare function prCommentLockJobs(forge: ForgeKind, options?: Pick<PrLoopPipelineOptions, "locks" | "words">): PrCommentLockJob[];
|
|
318
|
+
/** The job answering `/<product> <plan word>` (#4620). */
|
|
319
|
+
export declare const PR_COMMENT_PREVIEW_JOB = "comment-preview";
|
|
320
|
+
/** The job that posts the comment preview's note and status (#4620). */
|
|
321
|
+
export declare const PR_COMMENT_PREVIEW_NOTE_JOB = "comment-preview-note";
|
|
322
|
+
/** The GitLab variable a pipeline of the target branch is started with to preview a merge request again (#4620). */
|
|
323
|
+
export declare const GITLAB_PREVIEW_PR_VAR = "CHANT_PREVIEW_PR";
|
|
324
|
+
/** The variable the GitHub-shaped preview job's checkout script reads the pull request's head ref from (#4620). */
|
|
325
|
+
export declare const PREVIEW_REF_ENV = "CHANT_PREVIEW_REF";
|
|
326
|
+
/** The preview job's output that carries the commit it checked out, set before any of the change's code runs (#4620). */
|
|
327
|
+
export declare const PREVIEW_HEAD_OUTPUT = "head";
|
|
328
|
+
/** The comment preview's two jobs (#4620): the plan at the pull request's head, and the post after it. */
|
|
329
|
+
export interface PrCommentPreviewJob {
|
|
330
|
+
jobName: typeof PR_COMMENT_PREVIEW_JOB;
|
|
331
|
+
noteJobName: typeof PR_COMMENT_PREVIEW_NOTE_JOB;
|
|
332
|
+
/** The comment it answers, `/<product> <plan word>`. */
|
|
333
|
+
comment: string;
|
|
334
|
+
/**
|
|
335
|
+
* The plan job's command, as the pull request's plan job runs it, with
|
|
336
|
+
* `PR_NUMBER` from the comment (or {@link GITLAB_PREVIEW_PR_VAR}) and
|
|
337
|
+
* `BASE_SHA` left to {@link base}.
|
|
338
|
+
*/
|
|
339
|
+
plan: PrLoopJob;
|
|
340
|
+
/** The shell line that sets `BASE_SHA` to the target branch's commit, run after the checkout. */
|
|
341
|
+
base: string;
|
|
342
|
+
/**
|
|
343
|
+
* GitHub and Forgejo: the ref the checkout script fetches through
|
|
344
|
+
* {@link PREVIEW_REF_ENV}. GitLab: the line that checks out the merge
|
|
345
|
+
* request's head, in the job's own clone.
|
|
346
|
+
*/
|
|
347
|
+
head: {
|
|
348
|
+
ref: string;
|
|
349
|
+
} | {
|
|
350
|
+
line: string;
|
|
351
|
+
};
|
|
352
|
+
/** The post job's command, the values it reads, and on GitLab the line that finds the head it posts for. */
|
|
353
|
+
post: {
|
|
354
|
+
command: string;
|
|
355
|
+
env: Record<string, string>;
|
|
356
|
+
setup?: string[];
|
|
357
|
+
};
|
|
358
|
+
/** On GitLab, the variable a pipeline of the target branch is started with. */
|
|
359
|
+
gitlabVar?: string;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The comment preview (#4620), with `previewComment`: `/<product> <plan
|
|
363
|
+
* word>` on an open pull request runs the plan job's `pr-plan` again at the
|
|
364
|
+
* pull request's head, in a job that holds only a read token and drops it
|
|
365
|
+
* before the change's code runs, as the plan job does (#4295). The job after
|
|
366
|
+
* it checks out the target branch's commit, takes the report back and posts
|
|
367
|
+
* the note and the plan status with `pr-post`, as `plan-note` does.
|
|
368
|
+
*
|
|
369
|
+
* On GitHub the commenter must be able to write, as for the lock and unlock
|
|
370
|
+
* comments (#4588); Forgejo's payload says nothing of the commenter. GitLab
|
|
371
|
+
* starts no pipeline on a note, so there both jobs run in a pipeline of the
|
|
372
|
+
* target branch started with {@link GITLAB_PREVIEW_PR_VAR} set to the merge
|
|
373
|
+
* request's iid. The plan job unsets the forge tokens before it checks out
|
|
374
|
+
* the merge request's head, and the post job finds that head again with `git
|
|
375
|
+
* ls-remote`; a report for another head is refused by `pr-post`.
|
|
376
|
+
*
|
|
377
|
+
* Undefined without `previewComment`. Throws when the words name no `plan`
|
|
378
|
+
* command, since no comment would start the job.
|
|
379
|
+
*/
|
|
380
|
+
export declare function prCommentPreviewJob(forge: ForgeKind, env: string, options?: PrLoopPipelineOptions, member?: string): PrCommentPreviewJob | undefined;
|
|
223
381
|
/** One job's command and the forge values it reads, as environment variables for its step. */
|
|
224
382
|
export interface PrLoopJob {
|
|
225
383
|
/** `plan`, `apply` or `record` (#4168). */
|
|
@@ -293,7 +451,7 @@ export declare const PR_PLAN_NOTE_JOB = "plan-note";
|
|
|
293
451
|
* asks GitLab for each open merge request's plan job and reads its report
|
|
294
452
|
* from the job's artifacts.
|
|
295
453
|
*/
|
|
296
|
-
export declare function prLoopPostJob(forge: ForgeKind, env: string, member?: string): {
|
|
454
|
+
export declare function prLoopPostJob(forge: ForgeKind, env: string, member?: string, words?: Pick<CiProductWordsInput, "bin">): {
|
|
297
455
|
command: string;
|
|
298
456
|
env: Record<string, string>;
|
|
299
457
|
};
|
|
@@ -358,6 +516,14 @@ export declare function prApplyRecordKey(env: string, commit: string, member?: s
|
|
|
358
516
|
export declare const GITLAB_APPLY_PR_VAR = "CHANT_APPLY_PR";
|
|
359
517
|
/** The comment that starts the apply before merge on GitHub and Forgejo (#4301). */
|
|
360
518
|
export declare const APPLY_COMMENT = "/chant apply";
|
|
519
|
+
/** The comment that starts the apply before merge under the pipeline's words (#4550): `/plywood up`, else {@link APPLY_COMMENT}. */
|
|
520
|
+
export declare function prApplyComment(options?: Pick<PrLoopPipelineOptions, "words">): string;
|
|
521
|
+
/**
|
|
522
|
+
* A command line with the product's bin in place of `chant` (#4550): `npx
|
|
523
|
+
* --no-install plywood components pr-plan ...`. A `chant ci run` line also
|
|
524
|
+
* passes `--chant <bin>`, so the command it runs goes through the bin too.
|
|
525
|
+
*/
|
|
526
|
+
export declare function withProductBin(line: string, bin: string | undefined): string;
|
|
361
527
|
/**
|
|
362
528
|
* The line that checks out pull request `$PR_NUMBER`'s head (#4301) in a job
|
|
363
529
|
* of the target branch: the forge's `refs/pull/<n>/head`, or GitLab's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/pr-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"pr-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/pr-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAO7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACh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W,QAAQ;IACvB,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;IAC1D,8FAA8F;IAC9F,OAAO,EAAE,MAAM,CAAC;IAChB,yGAAyG;IACzG,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,gGAAgG;AAChG,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,GAAE,qBAA0B,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,EAAE,CAkC5G"}
|
|
@@ -85,10 +85,12 @@
|
|
|
85
85
|
* that one of its units reaches selects that unit.
|
|
86
86
|
*/
|
|
87
87
|
import { PR_APPLY_GATE } from "../pr-loop.js";
|
|
88
|
+
import { parseRequiresList } from "../pr-requires.js";
|
|
88
89
|
import { CI_IMAGE, GITHUB_JOB_TOKEN } from "../ci-jobs.js";
|
|
89
90
|
import { withoutForgeTokens } from "../ci-handover.js";
|
|
90
91
|
import { EMPTY_TREE_SHA } from "./changed-files.js";
|
|
91
92
|
import { layerWaves } from "../gated-waves.js";
|
|
93
|
+
import { commentLine, resolveProductWords } from "../ci-product-words.js";
|
|
92
94
|
/** The variable `chant ci run` reads its runner key from (`RUNNER_KEY_ENV` in ../workspace/ci-green.ts). */
|
|
93
95
|
const RUNNER_KEY_ENV = "CHANT_RUNNER_KEY";
|
|
94
96
|
/** Where both jobs write their reports, kept as a CI artifact. */
|
|
@@ -110,9 +112,25 @@ export const PR_LOOP_IMAGE = CI_IMAGE;
|
|
|
110
112
|
export const PR_LOOP_SETUP = [
|
|
111
113
|
"command -v tofu >/dev/null 2>&1 || (curl -fsSL https://get.opentofu.org/install-opentofu.sh -o /tmp/install-opentofu.sh && sh /tmp/install-opentofu.sh --install-method standalone)",
|
|
112
114
|
];
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
/**
|
|
116
|
+
* The setup lines for a pipeline running in `image`: the install when it is
|
|
117
|
+
* the default image, none otherwise. `engine` is the lines the project's
|
|
118
|
+
* lexicons give (#4550, `LexiconPlugin.ciSetup`, {@link engineSetupLines}):
|
|
119
|
+
* Pulumi or plunge for a Pulumi member, OpenTofu for a Terraform one. Absent,
|
|
120
|
+
* OpenTofu, as before.
|
|
121
|
+
*/
|
|
122
|
+
export function prLoopSetup(image, engine) {
|
|
123
|
+
if (image !== PR_LOOP_IMAGE)
|
|
124
|
+
return [];
|
|
125
|
+
return engine && engine.length > 0 ? [...engine] : PR_LOOP_SETUP;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Join the setup lines each lexicon gives (#4550), each line once, in the
|
|
129
|
+
* order the lexicons come. A project whose lexicons give none gets none, and
|
|
130
|
+
* {@link prLoopSetup} then falls back to OpenTofu.
|
|
131
|
+
*/
|
|
132
|
+
export function engineSetupLines(perLexicon) {
|
|
133
|
+
return [...new Set(perLexicon.flatMap((lines) => lines ?? []))];
|
|
116
134
|
}
|
|
117
135
|
/**
|
|
118
136
|
* Where the jobs keep their run-event files with `events` (#4007), as
|
|
@@ -129,6 +147,127 @@ export function prLockCommand(forge) {
|
|
|
129
147
|
}
|
|
130
148
|
/** `chant unlock` for the pull request that closed; reads `PR_NUMBER`. */
|
|
131
149
|
export const PR_UNLOCK_COMMAND = 'chant unlock --pr "$PR_NUMBER"';
|
|
150
|
+
/** The job answering `/<product> lock` (#4588). */
|
|
151
|
+
export const PR_COMMENT_LOCK_JOB = "comment-lock";
|
|
152
|
+
/** The job answering `/<product> unlock` (#4588). */
|
|
153
|
+
export const PR_COMMENT_UNLOCK_JOB = "comment-unlock";
|
|
154
|
+
/** The GitLab variables a pipeline of the target branch is started with to lock or unlock a merge request (#4588), as `CHANT_APPLY_PR` applies one. */
|
|
155
|
+
export const GITLAB_LOCK_PR_VAR = "CHANT_LOCK_PR";
|
|
156
|
+
export const GITLAB_UNLOCK_PR_VAR = "CHANT_UNLOCK_PR";
|
|
157
|
+
/**
|
|
158
|
+
* The comment lock and unlock jobs (#4588), under `ci.locks: plan` when the
|
|
159
|
+
* words name the `lock` and `unlock` commands. `/<product> lock` runs `chant
|
|
160
|
+
* lock --keep`, which keeps the locks the pull request's plan took until it
|
|
161
|
+
* closes; `/<product> unlock` runs `chant unlock`, which releases them. Both
|
|
162
|
+
* run at the target branch's commit, so no code of the change runs, and
|
|
163
|
+
* GitHub asks for a commenter who can write as it does for the apply
|
|
164
|
+
* comment. GitLab starts no pipeline on a note, so there each job runs in a
|
|
165
|
+
* pipeline of the target branch started with {@link GITLAB_LOCK_PR_VAR} or
|
|
166
|
+
* {@link GITLAB_UNLOCK_PR_VAR} set to the merge request's iid.
|
|
167
|
+
*/
|
|
168
|
+
export function prCommentLockJobs(forge, options = {}) {
|
|
169
|
+
if (options.locks !== "plan")
|
|
170
|
+
return [];
|
|
171
|
+
const words = resolveProductWords(options.words);
|
|
172
|
+
const github = forge !== "gitlab";
|
|
173
|
+
const out = [];
|
|
174
|
+
for (const command of ["lock", "unlock"]) {
|
|
175
|
+
const comment = commentLine(words, command);
|
|
176
|
+
if (!comment)
|
|
177
|
+
continue;
|
|
178
|
+
const gitlabVar = command === "lock" ? GITLAB_LOCK_PR_VAR : GITLAB_UNLOCK_PR_VAR;
|
|
179
|
+
const line = command === "lock" ? ["chant", "lock", "--keep", "--pr", '"$PR_NUMBER"', "--forge", forge].join(" ") : PR_UNLOCK_COMMAND;
|
|
180
|
+
out.push({
|
|
181
|
+
jobName: command === "lock" ? PR_COMMENT_LOCK_JOB : PR_COMMENT_UNLOCK_JOB,
|
|
182
|
+
command,
|
|
183
|
+
comment,
|
|
184
|
+
line: withProductBin(line, words.bin),
|
|
185
|
+
env: github ? { PR_NUMBER: "${{ github.event.issue.number }}", GITHUB_TOKEN: GITHUB_JOB_TOKEN } : { PR_NUMBER: `$${gitlabVar}` },
|
|
186
|
+
...(github ? {} : { gitlabVar }),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
/** The job answering `/<product> <plan word>` (#4620). */
|
|
192
|
+
export const PR_COMMENT_PREVIEW_JOB = "comment-preview";
|
|
193
|
+
/** The job that posts the comment preview's note and status (#4620). */
|
|
194
|
+
export const PR_COMMENT_PREVIEW_NOTE_JOB = "comment-preview-note";
|
|
195
|
+
/** The GitLab variable a pipeline of the target branch is started with to preview a merge request again (#4620). */
|
|
196
|
+
export const GITLAB_PREVIEW_PR_VAR = "CHANT_PREVIEW_PR";
|
|
197
|
+
/** The variable the GitHub-shaped preview job's checkout script reads the pull request's head ref from (#4620). */
|
|
198
|
+
export const PREVIEW_REF_ENV = "CHANT_PREVIEW_REF";
|
|
199
|
+
/** The preview job's output that carries the commit it checked out, set before any of the change's code runs (#4620). */
|
|
200
|
+
export const PREVIEW_HEAD_OUTPUT = "head";
|
|
201
|
+
/**
|
|
202
|
+
* The comment preview (#4620), with `previewComment`: `/<product> <plan
|
|
203
|
+
* word>` on an open pull request runs the plan job's `pr-plan` again at the
|
|
204
|
+
* pull request's head, in a job that holds only a read token and drops it
|
|
205
|
+
* before the change's code runs, as the plan job does (#4295). The job after
|
|
206
|
+
* it checks out the target branch's commit, takes the report back and posts
|
|
207
|
+
* the note and the plan status with `pr-post`, as `plan-note` does.
|
|
208
|
+
*
|
|
209
|
+
* On GitHub the commenter must be able to write, as for the lock and unlock
|
|
210
|
+
* comments (#4588); Forgejo's payload says nothing of the commenter. GitLab
|
|
211
|
+
* starts no pipeline on a note, so there both jobs run in a pipeline of the
|
|
212
|
+
* target branch started with {@link GITLAB_PREVIEW_PR_VAR} set to the merge
|
|
213
|
+
* request's iid. The plan job unsets the forge tokens before it checks out
|
|
214
|
+
* the merge request's head, and the post job finds that head again with `git
|
|
215
|
+
* ls-remote`; a report for another head is refused by `pr-post`.
|
|
216
|
+
*
|
|
217
|
+
* Undefined without `previewComment`. Throws when the words name no `plan`
|
|
218
|
+
* command, since no comment would start the job.
|
|
219
|
+
*/
|
|
220
|
+
export function prCommentPreviewJob(forge, env, options = {}, member) {
|
|
221
|
+
if (!options.previewComment)
|
|
222
|
+
return undefined;
|
|
223
|
+
const words = resolveProductWords(options.words);
|
|
224
|
+
const comment = commentLine(words, "plan");
|
|
225
|
+
if (!comment)
|
|
226
|
+
throw new Error(`--preview-comment answers /${words.product} <plan command>, and the words name no plan command; name one in the words' commands, or drop --preview-comment`);
|
|
227
|
+
// The plan job's own command: the apply side's options never reach it, so they are left out here.
|
|
228
|
+
const { applyBeforeMerge: _early, applyRequires: _requires, applyOnMerge: _onMerge, ...planSide } = options;
|
|
229
|
+
const [plan] = prLoopJobs(forge, env, planSide, member);
|
|
230
|
+
const github = forge !== "gitlab";
|
|
231
|
+
const prNumber = github ? "${{ github.event.issue.number }}" : `$${GITLAB_PREVIEW_PR_VAR}`;
|
|
232
|
+
const fromComment = (jobEnv) => {
|
|
233
|
+
const { BASE_SHA: _base, ...rest } = jobEnv;
|
|
234
|
+
return github ? { ...rest, PR_NUMBER: prNumber } : { ...rest, PR_NUMBER: prNumber, BASE_SHA: "$CI_COMMIT_SHA" };
|
|
235
|
+
};
|
|
236
|
+
const branch = options.branch ?? "main";
|
|
237
|
+
const base = github
|
|
238
|
+
? `BASE_SHA="$(git rev-parse --verify "refs/remotes/origin/${branch.replace(/"/g, "")}^{commit}")" && export BASE_SHA`
|
|
239
|
+
: 'BASE_SHA="$CI_COMMIT_SHA" && export BASE_SHA';
|
|
240
|
+
const postCommand = withProductBin([
|
|
241
|
+
"chant", "components", "pr-post", "--pr", '"$PR_NUMBER"', "--head", '"$HEAD_SHA"',
|
|
242
|
+
"--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge,
|
|
243
|
+
...(member ? ["--member", member] : []),
|
|
244
|
+
...(github ? ["--result", '"$PLAN_RESULT"'] : []),
|
|
245
|
+
].join(" "), words.bin);
|
|
246
|
+
return {
|
|
247
|
+
jobName: PR_COMMENT_PREVIEW_JOB,
|
|
248
|
+
noteJobName: PR_COMMENT_PREVIEW_NOTE_JOB,
|
|
249
|
+
comment,
|
|
250
|
+
plan: { ...plan, env: fromComment(plan.env), run: { ...plan.run, env: fromComment(plan.run.env) } },
|
|
251
|
+
base,
|
|
252
|
+
head: github ? { ref: `refs/pull/${prNumber}/head` } : { line: pullRequestCheckout("gitlab") },
|
|
253
|
+
post: github
|
|
254
|
+
? {
|
|
255
|
+
command: postCommand,
|
|
256
|
+
env: {
|
|
257
|
+
PR_NUMBER: prNumber,
|
|
258
|
+
HEAD_SHA: `\${{ needs.${PR_COMMENT_PREVIEW_JOB}.outputs.${PREVIEW_HEAD_OUTPUT} }}`,
|
|
259
|
+
PLAN_RESULT: `\${{ needs.${PR_COMMENT_PREVIEW_JOB}.result }}`,
|
|
260
|
+
GITHUB_TOKEN: GITHUB_JOB_TOKEN,
|
|
261
|
+
},
|
|
262
|
+
}
|
|
263
|
+
: {
|
|
264
|
+
command: postCommand,
|
|
265
|
+
env: { PR_NUMBER: prNumber },
|
|
266
|
+
setup: ['HEAD_SHA="$(git ls-remote origin "refs/merge-requests/$PR_NUMBER/head" | cut -f1)" && export HEAD_SHA'],
|
|
267
|
+
},
|
|
268
|
+
...(github ? {} : { gitlabVar: GITLAB_PREVIEW_PR_VAR }),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
132
271
|
/** The lines `build` (#4088) runs before a job's command: the build, then the lint. Empty without the option. */
|
|
133
272
|
export function prLoopBuildLines(env, options = {}) {
|
|
134
273
|
if (!options.build && !options.buildCommand)
|
|
@@ -150,6 +289,12 @@ export function prLoopJobs(forge, env, options = {}, member) {
|
|
|
150
289
|
throw new Error("--apply-before-merge applies the pull request's plan in one job, so it takes no --wave-gate");
|
|
151
290
|
if (early && (options.build || options.buildCommand))
|
|
152
291
|
throw new Error("--apply-before-merge runs no build before its requires checks, so it takes no --pr-build or --pr-build-command yet");
|
|
292
|
+
if (options.applyRequires && !early)
|
|
293
|
+
throw new Error("--requires names the checks of an apply before merge, so it needs --apply-before-merge");
|
|
294
|
+
const asked = options.applyRequires ? parseRequiresList(options.applyRequires) : undefined;
|
|
295
|
+
if (asked && "error" in asked)
|
|
296
|
+
throw new Error(asked.error);
|
|
297
|
+
const requires = early && asked ? ["--requires", asked.checks.join(",")] : [];
|
|
153
298
|
const common = [
|
|
154
299
|
"--env", env, "--gate", gate, "--output", PR_LOOP_REPORT_DIR, "--forge", forge,
|
|
155
300
|
...(member ? ["--member", member] : []),
|
|
@@ -167,7 +312,7 @@ export function prLoopJobs(forge, env, options = {}, member) {
|
|
|
167
312
|
const ciRun = (job) => [
|
|
168
313
|
"chant", "ci", "run", job, "--in-place", ...(job === "plan" ? ["--no-push"] : []),
|
|
169
314
|
...(job === "apply" && !early ? [] : ["--base", '"$BASE_SHA"']), ...(job === "plan" || (job === "apply" && early) ? ["--pr", '"$PR_NUMBER"'] : []),
|
|
170
|
-
...(job === "apply" && early ? ["--apply-before-merge"] : []),
|
|
315
|
+
...(job === "apply" && early ? ["--apply-before-merge", ...requires] : []),
|
|
171
316
|
"--env", env, "--gate", gate, "--forge", forge,
|
|
172
317
|
...(job !== "record" && options.waveGate ? ["--wave-gate", options.waveGate] : []),
|
|
173
318
|
...(job !== "plan" && options.branch ? ["--branch", JSON.stringify(options.branch)] : []),
|
|
@@ -207,7 +352,7 @@ export function prLoopJobs(forge, env, options = {}, member) {
|
|
|
207
352
|
// #4301: the requires checks run inside pr-apply, before any of the head's code loads.
|
|
208
353
|
jobName: "apply",
|
|
209
354
|
command: [
|
|
210
|
-
"chant", "components", "pr-apply", "--before-merge", "--base", '"$BASE_SHA"', "--pr", '"$PR_NUMBER"', ...common,
|
|
355
|
+
"chant", "components", "pr-apply", "--before-merge", ...requires, "--base", '"$BASE_SHA"', "--pr", '"$PR_NUMBER"', ...common,
|
|
211
356
|
...(options.requireReview === true ? ["--require-review"] : []),
|
|
212
357
|
"--resume", PR_APPLY_RECORD,
|
|
213
358
|
].join(" "),
|
|
@@ -215,6 +360,7 @@ export function prLoopJobs(forge, env, options = {}, member) {
|
|
|
215
360
|
checkout: [pullRequestCheckout(forge)],
|
|
216
361
|
run: { command: ciRun("apply").join(" "), env: runEnv(earlyEnv) },
|
|
217
362
|
};
|
|
363
|
+
const bin = options.words?.bin;
|
|
218
364
|
return [
|
|
219
365
|
{
|
|
220
366
|
jobName: "plan",
|
|
@@ -234,7 +380,7 @@ export function prLoopJobs(forge, env, options = {}, member) {
|
|
|
234
380
|
...build,
|
|
235
381
|
run: { command: ciRun("record").join(" "), env: runEnv(applyEnv) },
|
|
236
382
|
},
|
|
237
|
-
];
|
|
383
|
+
].map((job) => jobWithBin(job, bin));
|
|
238
384
|
}
|
|
239
385
|
/** The name of the job that posts the plan's note and status (#4295). */
|
|
240
386
|
export const PR_PLAN_NOTE_JOB = "plan-note";
|
|
@@ -254,10 +400,10 @@ export const PR_PLAN_NOTE_JOB = "plan-note";
|
|
|
254
400
|
* asks GitLab for each open merge request's plan job and reads its report
|
|
255
401
|
* from the job's artifacts.
|
|
256
402
|
*/
|
|
257
|
-
export function prLoopPostJob(forge, env, member) {
|
|
403
|
+
export function prLoopPostJob(forge, env, member, words) {
|
|
258
404
|
if (forge === "gitlab") {
|
|
259
405
|
return {
|
|
260
|
-
command: ["chant", "components", "pr-post", "--open", "--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge, ...(member ? ["--member", member] : [])].join(" "),
|
|
406
|
+
command: withProductBin(["chant", "components", "pr-post", "--open", "--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge, ...(member ? ["--member", member] : [])].join(" "), words?.bin),
|
|
261
407
|
env: {},
|
|
262
408
|
};
|
|
263
409
|
}
|
|
@@ -268,7 +414,7 @@ export function prLoopPostJob(forge, env, member) {
|
|
|
268
414
|
"--result", '"$PLAN_RESULT"',
|
|
269
415
|
].join(" ");
|
|
270
416
|
return {
|
|
271
|
-
command,
|
|
417
|
+
command: withProductBin(command, words?.bin),
|
|
272
418
|
env: { PR_NUMBER: "${{ github.event.pull_request.number }}", HEAD_SHA: "${{ github.sha }}", PLAN_RESULT: "${{ needs.plan.result }}", GITHUB_TOKEN: GITHUB_JOB_TOKEN },
|
|
273
419
|
};
|
|
274
420
|
}
|
|
@@ -381,6 +527,35 @@ function pushBaseFallback(target, commit, diffBase) {
|
|
|
381
527
|
export const GITLAB_APPLY_PR_VAR = "CHANT_APPLY_PR";
|
|
382
528
|
/** The comment that starts the apply before merge on GitHub and Forgejo (#4301). */
|
|
383
529
|
export const APPLY_COMMENT = "/chant apply";
|
|
530
|
+
/** The comment that starts the apply before merge under the pipeline's words (#4550): `/plywood up`, else {@link APPLY_COMMENT}. */
|
|
531
|
+
export function prApplyComment(options = {}) {
|
|
532
|
+
return commentLine(resolveProductWords(options.words), "apply") ?? APPLY_COMMENT;
|
|
533
|
+
}
|
|
534
|
+
/** `chant` at the start of a command, or after a shell `$(`, `(`, `&&` or space. */
|
|
535
|
+
const CHANT_WORD = /(^|[\s"(]|\$\()chant (?=[a-z])/g;
|
|
536
|
+
/**
|
|
537
|
+
* A command line with the product's bin in place of `chant` (#4550): `npx
|
|
538
|
+
* --no-install plywood components pr-plan ...`. A `chant ci run` line also
|
|
539
|
+
* passes `--chant <bin>`, so the command it runs goes through the bin too.
|
|
540
|
+
*/
|
|
541
|
+
export function withProductBin(line, bin) {
|
|
542
|
+
if (!bin)
|
|
543
|
+
return line;
|
|
544
|
+
const swapped = line.replace(CHANT_WORD, (_m, before) => `${before}${bin} `);
|
|
545
|
+
return swapped.replace(new RegExp(`^${bin.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")} ci run ([a-z-]+) `), (m) => `${m}--chant ${JSON.stringify(bin)} `);
|
|
546
|
+
}
|
|
547
|
+
/** Every command of `job` through {@link withProductBin}. */
|
|
548
|
+
function jobWithBin(job, bin) {
|
|
549
|
+
if (!bin)
|
|
550
|
+
return job;
|
|
551
|
+
return {
|
|
552
|
+
...job,
|
|
553
|
+
command: withProductBin(job.command, bin),
|
|
554
|
+
run: { ...job.run, command: withProductBin(job.run.command, bin) },
|
|
555
|
+
...(job.build ? { build: job.build.map((l) => withProductBin(l, bin)) } : {}),
|
|
556
|
+
...(job.checkout ? { checkout: job.checkout.map((l) => withProductBin(l, bin)) } : {}),
|
|
557
|
+
};
|
|
558
|
+
}
|
|
384
559
|
/**
|
|
385
560
|
* The line that checks out pull request `$PR_NUMBER`'s head (#4301) in a job
|
|
386
561
|
* of the target branch: the forge's `refs/pull/<n>/head`, or GitLab's
|
|
@@ -23,8 +23,15 @@
|
|
|
23
23
|
*
|
|
24
24
|
* A policy also reads `input.review` (#4326): the risk the pull request's
|
|
25
25
|
* review note names, when the review agent posted one ({@link policyReviewOf}).
|
|
26
|
+
*
|
|
27
|
+
* `ci.policy.source` (#4613) names a shared repository and ref instead of
|
|
28
|
+
* the workspace's own directory. The source is named at base, fetched once
|
|
29
|
+
* per job (`../policy-source.ts`), and the commit its ref named goes on the
|
|
30
|
+
* verdict and the report, so a decision names the rules it used. A source
|
|
31
|
+
* that cannot be fetched is an error, and nothing applies.
|
|
26
32
|
*/
|
|
27
33
|
import type { WorkspaceTree } from "../workspace/tree.js";
|
|
34
|
+
import { type ResolvedGatePolicySource } from "../policy-source.js";
|
|
28
35
|
import { type GatePolicyExec, type GatePolicySettings, type GatePolicyVerdict } from "../gate-policy.js";
|
|
29
36
|
import type { ChangeSetDocument } from "../change-set.js";
|
|
30
37
|
import type { GateLedgerPort } from "../op/gate.js";
|
|
@@ -37,8 +44,16 @@ export interface PrLoopPolicy {
|
|
|
37
44
|
settings?: GatePolicySettings;
|
|
38
45
|
/** The commit it was read at. */
|
|
39
46
|
base: string;
|
|
40
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Where the policy directory is read: the tree of the declaration's
|
|
49
|
+
* directory at base, or with `ci.policy.source` the shared repository's
|
|
50
|
+
* tree at the commit its ref named.
|
|
51
|
+
*/
|
|
41
52
|
tree?: WorkspaceTree;
|
|
53
|
+
/** The shared source the tree is (#4613), with the commit fetched. */
|
|
54
|
+
source?: ResolvedGatePolicySource;
|
|
55
|
+
/** Why the source named at base could not be read. Every policy run is then an error. */
|
|
56
|
+
error?: string;
|
|
42
57
|
/** A line for the log when no policy runs because the base has no declaration, or could not be read. */
|
|
43
58
|
note?: string;
|
|
44
59
|
}
|
|
@@ -93,7 +108,16 @@ export declare const REVIEW_NOTE_AUTHORS: readonly string[];
|
|
|
93
108
|
* all give `found: false`, which a policy sees as `risk: "unknown"`.
|
|
94
109
|
*/
|
|
95
110
|
export declare function policyReviewOf(forge: PrForge | undefined, pr: number | null): Promise<PolicyReview>;
|
|
96
|
-
/**
|
|
111
|
+
/** The Rego directory a read names: the source's `path`, else `ci.policy.path`, else the default, and whether one was named. */
|
|
112
|
+
export declare function prPolicyPath(read: Pick<PrLoopPolicy, "settings" | "source">): {
|
|
113
|
+
path: string;
|
|
114
|
+
named: boolean;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Run the policy over `input`. Undefined when the base sets no policy, or
|
|
118
|
+
* sets only `packs` (CrossGuard, run by the pulumi lexicon's preview) and
|
|
119
|
+
* names no Rego directory that exists.
|
|
120
|
+
*/
|
|
97
121
|
export declare function runPrPolicy(read: PrLoopPolicy, input: PrPolicyInput, exec?: GatePolicyExec): GatePolicyVerdict | undefined;
|
|
98
122
|
/** The verdict as the report keeps it. */
|
|
99
123
|
export declare function prPolicyReport(verdict: GatePolicyVerdict, base: string): PrPolicyReport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-policy.d.ts","sourceRoot":"","sources":["../../src/components/pr-policy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pr-policy.d.ts","sourceRoot":"","sources":["../../src/components/pr-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,OAAO,KAAK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