@intentius/chant 0.124.54 → 0.124.56
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 +832 -0
- package/dist/ci-audit/attribution.d.ts +111 -0
- package/dist/ci-audit/attribution.d.ts.map +1 -0
- package/dist/ci-audit/attribution.js +194 -0
- package/dist/ci-audit/audit-log.d.ts +144 -0
- package/dist/ci-audit/audit-log.d.ts.map +1 -0
- package/dist/ci-audit/audit-log.js +149 -0
- package/dist/ci-audit/index.d.ts +12 -0
- package/dist/ci-audit/index.d.ts.map +1 -0
- package/dist/ci-audit/index.js +12 -0
- package/dist/ci-audit/unrecorded.d.ts +74 -0
- package/dist/ci-audit/unrecorded.d.ts.map +1 -0
- package/dist/ci-audit/unrecorded.js +95 -0
- package/dist/ci-audit.d.ts +3 -0
- package/dist/ci-audit.d.ts.map +1 -0
- package/dist/ci-audit.js +2 -0
- package/dist/ci-control.d.ts +42 -0
- package/dist/ci-control.d.ts.map +1 -0
- package/dist/ci-control.js +41 -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 +92 -0
- package/dist/ci-estate.d.ts.map +1 -0
- package/dist/ci-estate.js +82 -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 +86 -15
- package/dist/ci-job-guard.d.ts +139 -0
- package/dist/ci-job-guard.d.ts.map +1 -0
- package/dist/ci-job-guard.js +287 -0
- package/dist/ci-jobs.d.ts +7 -0
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -0
- package/dist/ci-product-words.d.ts +296 -0
- package/dist/ci-product-words.d.ts.map +1 -0
- package/dist/ci-product-words.js +407 -0
- package/dist/ci-product.d.ts +117 -0
- package/dist/ci-product.d.ts.map +1 -0
- package/dist/ci-product.js +113 -0
- package/dist/ci-respond-run.d.ts +73 -0
- package/dist/ci-respond-run.d.ts.map +1 -0
- package/dist/ci-respond-run.js +247 -0
- package/dist/ci-respond.d.ts +189 -0
- package/dist/ci-respond.d.ts.map +1 -0
- package/dist/ci-respond.js +285 -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/audit-log.d.ts +12 -0
- package/dist/cli/handlers/audit-log.d.ts.map +1 -0
- package/dist/cli/handlers/audit-log.js +81 -0
- package/dist/cli/handlers/build.d.ts +7 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +124 -1
- package/dist/cli/handlers/ci-check-job.d.ts +11 -0
- package/dist/cli/handlers/ci-check-job.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check-job.js +27 -0
- 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 +63 -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/e2e-safe-run.d.ts +12 -0
- package/dist/cli/handlers/e2e-safe-run.d.ts.map +1 -0
- package/dist/cli/handlers/e2e-safe-run.js +23 -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 +43 -3
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +908 -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 +160 -2
- 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 +178 -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 +164 -3
- package/dist/cli/registry.d.ts +73 -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 +92 -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 +159 -5
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +39 -6
- package/dist/components/check-hooks.d.ts +116 -0
- package/dist/components/check-hooks.d.ts.map +1 -0
- package/dist/components/check-hooks.js +192 -0
- package/dist/components/check-steps.d.ts +74 -0
- package/dist/components/check-steps.d.ts.map +1 -0
- package/dist/components/check-steps.js +102 -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 +60 -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 +32 -3
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +59 -5
- 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 +23 -5
- 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 +38 -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 +32 -4
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +26 -8
- package/dist/components/pr-pipeline.d.ts +297 -5
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +329 -18
- 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 +71 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +91 -7
- 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 +250 -0
- package/dist/components/product-pipeline.d.ts.map +1 -0
- package/dist/components/product-pipeline.js +212 -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 +42 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +72 -4
- 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/e2e-harness/bucket.d.ts +21 -0
- package/dist/e2e-harness/bucket.d.ts.map +1 -0
- package/dist/e2e-harness/bucket.js +61 -0
- package/dist/e2e-harness/claim.d.ts +70 -0
- package/dist/e2e-harness/claim.d.ts.map +1 -0
- package/dist/e2e-harness/claim.js +98 -0
- package/dist/e2e-harness/driver.d.ts +64 -0
- package/dist/e2e-harness/driver.d.ts.map +1 -0
- package/dist/e2e-harness/driver.js +243 -0
- package/dist/e2e-harness/forgejo.d.ts +77 -0
- package/dist/e2e-harness/forgejo.d.ts.map +1 -0
- package/dist/e2e-harness/forgejo.js +205 -0
- package/dist/e2e-harness/git.d.ts +32 -0
- package/dist/e2e-harness/git.d.ts.map +1 -0
- package/dist/e2e-harness/git.js +67 -0
- package/dist/e2e-harness/index.d.ts +22 -0
- package/dist/e2e-harness/index.d.ts.map +1 -0
- package/dist/e2e-harness/index.js +48 -0
- package/dist/e2e-harness/jobs.d.ts +8 -0
- package/dist/e2e-harness/jobs.d.ts.map +1 -0
- package/dist/e2e-harness/jobs.js +34 -0
- package/dist/e2e-harness/pins.d.ts +45 -0
- package/dist/e2e-harness/pins.d.ts.map +1 -0
- package/dist/e2e-harness/pins.js +44 -0
- package/dist/e2e-harness/ports.d.ts +113 -0
- package/dist/e2e-harness/ports.d.ts.map +1 -0
- package/dist/e2e-harness/ports.js +4 -0
- package/dist/e2e-harness/reports.d.ts +45 -0
- package/dist/e2e-harness/reports.d.ts.map +1 -0
- package/dist/e2e-harness/reports.js +57 -0
- package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
- package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run-cli.js +43 -0
- package/dist/e2e-harness/safe-run.d.ts +61 -0
- package/dist/e2e-harness/safe-run.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run.js +172 -0
- package/dist/e2e-harness/scenario.d.ts +11 -0
- package/dist/e2e-harness/scenario.d.ts.map +1 -0
- package/dist/e2e-harness/scenario.js +89 -0
- package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/dist/e2e-harness/schemas/index.d.ts +191 -0
- package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
- package/dist/e2e-harness/schemas/index.js +62 -0
- package/dist/e2e-harness/stack.d.ts +124 -0
- package/dist/e2e-harness/stack.d.ts.map +1 -0
- package/dist/e2e-harness/stack.js +207 -0
- package/dist/e2e-harness/steps.d.ts +11 -0
- package/dist/e2e-harness/steps.d.ts.map +1 -0
- package/dist/e2e-harness/steps.js +22 -0
- package/dist/e2e-harness.d.ts +3 -0
- package/dist/e2e-harness.d.ts.map +1 -0
- package/dist/e2e-harness.js +2 -0
- package/dist/engine-facts.d.ts.map +1 -1
- package/dist/engine-facts.js +1 -2
- package/dist/exit-codes.d.ts +54 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +55 -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 +152 -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 +10 -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 +204 -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 -7
- 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 +9 -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 +106 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -0
- package/dist/lifecycle/release-status.js +115 -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/lifecycle/wave-plans.d.ts +23 -7
- package/dist/lifecycle/wave-plans.d.ts.map +1 -1
- package/dist/lifecycle/wave-plans.js +9 -2
- 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/approval-status.d.ts +103 -0
- package/dist/op/approval-status.d.ts.map +1 -0
- package/dist/op/approval-status.js +197 -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 +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 +63 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -0
- package/dist/op/op-waves-capability-spec.js +115 -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 +96 -0
- package/dist/op/op-waves-run.d.ts +182 -6
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +1076 -44
- 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 +96 -0
- package/dist/op/op-waves.d.ts +187 -8
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +203 -19
- package/dist/op/runtime.d.ts +95 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +18 -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 +425 -0
- package/dist/override-gate.d.ts.map +1 -1
- package/dist/override-gate.js +5 -0
- package/dist/parallelism.d.ts +17 -0
- package/dist/parallelism.d.ts.map +1 -0
- package/dist/parallelism.js +33 -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 +102 -0
- package/dist/pr-forge.d.ts +40 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +146 -37
- package/dist/pr-loop.d.ts +158 -11
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +302 -44
- package/dist/pr-merge.d.ts +64 -0
- package/dist/pr-merge.d.ts.map +1 -0
- package/dist/pr-merge.js +78 -0
- package/dist/pr-post.d.ts +86 -1
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +141 -5
- 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 +45 -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 +3 -1
- package/dist/scheduled-op-cloud.d.ts +32 -0
- package/dist/scheduled-op-cloud.d.ts.map +1 -0
- package/dist/scheduled-op-cloud.js +69 -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 +405 -287
- 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 +17 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -0
- package/dist/workspace/ci-lock-grain.js +21 -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 +10 -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 +79 -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 +1025 -0
- package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
- package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
- package/src/ci-audit/attribution.ts +260 -0
- package/src/ci-audit/audit-log.ts +220 -0
- package/src/ci-audit/ci-audit.test.ts +175 -0
- package/src/ci-audit/index.ts +15 -0
- package/src/ci-audit/unrecorded.ts +140 -0
- package/src/ci-audit.ts +2 -0
- package/src/ci-control.ts +173 -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 +175 -0
- package/src/ci-handover.ts +67 -16
- package/src/ci-identity-database.test.ts +54 -0
- package/src/ci-identity-pulumi.test.ts +163 -0
- package/src/ci-identity-targets.test.ts +3 -1
- package/src/ci-identity.ts +123 -22
- package/src/ci-job-guard.test.ts +154 -0
- package/src/ci-job-guard.ts +319 -0
- package/src/ci-jobs.ts +8 -0
- package/src/ci-product-comment-targets.test.ts +45 -0
- package/src/ci-product-words.test.ts +101 -0
- package/src/ci-product-words.ts +565 -0
- package/src/ci-product.ts +226 -0
- package/src/ci-respond-run.ts +291 -0
- package/src/ci-respond.test.ts +264 -0
- package/src/ci-respond.ts +412 -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/audit-log.ts +74 -0
- package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
- package/src/cli/handlers/build.test.ts +7 -0
- package/src/cli/handlers/build.ts +113 -1
- package/src/cli/handlers/ci-check-job.test.ts +114 -0
- package/src/cli/handlers/ci-check-job.ts +33 -0
- package/src/cli/handlers/ci-check.ts +63 -0
- package/src/cli/handlers/ci-forge-check.ts +91 -0
- package/src/cli/handlers/e2e-safe-run.ts +27 -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-comment-targets.test.ts +166 -0
- package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
- 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 +879 -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 +144 -2
- 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.test.ts +1 -1
- package/src/cli/main.ts +180 -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 +119 -2
- package/src/cli/registry.ts +73 -0
- package/src/cloud-lister/sigv4.ts +80 -23
- package/src/components/adoption.test.ts +140 -0
- package/src/components/adoption.ts +140 -0
- package/src/components/apply-lease.ts +49 -0
- package/src/components/capability.ts +180 -6
- package/src/components/check-hooks.test.ts +66 -0
- package/src/components/check-hooks.ts +255 -0
- package/src/components/check-steps.test.ts +70 -0
- package/src/components/check-steps.ts +158 -0
- package/src/components/ci-services.test.ts +51 -0
- package/src/components/ci-services.ts +82 -0
- package/src/components/cli-support.ts +23 -2
- package/src/components/driver.test.ts +3 -3
- package/src/components/driver.ts +73 -6
- package/src/components/fan-out-run.ts +68 -18
- package/src/components/groups.ts +21 -4
- package/src/components/plan-flags.test.ts +46 -0
- package/src/components/pr-comment-preview-targets.test.ts +34 -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 +42 -0
- package/src/components/pr-env-ports.ts +29 -4
- package/src/components/pr-env-run-bundle.test.ts +2 -14
- 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 +40 -8
- package/src/components/pr-pipeline-runners.test.ts +80 -0
- package/src/components/pr-pipeline.test.ts +15 -0
- package/src/components/pr-pipeline.ts +498 -18
- package/src/components/pr-policy.ts +45 -7
- package/src/components/pr-run.test.ts +1 -1
- package/src/components/pr-run.ts +138 -11
- package/src/components/pr-stale-job.test.ts +34 -0
- 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 +383 -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 +96 -6
- 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/e2e-harness/__project__/chant.config.ts +4 -0
- package/src/e2e-harness/__project__/src/compose.ts +33 -0
- package/src/e2e-harness/bucket.ts +69 -0
- package/src/e2e-harness/claim.test.ts +150 -0
- package/src/e2e-harness/claim.ts +140 -0
- package/src/e2e-harness/driver.test.ts +304 -0
- package/src/e2e-harness/driver.ts +294 -0
- package/src/e2e-harness/forgejo.ts +267 -0
- package/src/e2e-harness/git.ts +96 -0
- package/src/e2e-harness/index.ts +50 -0
- package/src/e2e-harness/jobs.ts +35 -0
- package/src/e2e-harness/pins.ts +52 -0
- package/src/e2e-harness/ports.ts +130 -0
- package/src/e2e-harness/reports.ts +79 -0
- package/src/e2e-harness/safe-run-cli.test.ts +102 -0
- package/src/e2e-harness/safe-run-cli.ts +54 -0
- package/src/e2e-harness/safe-run.ts +198 -0
- package/src/e2e-harness/scenario.ts +89 -0
- package/src/e2e-harness/schemas/README.md +62 -0
- package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/src/e2e-harness/schemas/index.ts +220 -0
- package/src/e2e-harness/schemas.test.ts +145 -0
- package/src/e2e-harness/stack.test.ts +124 -0
- package/src/e2e-harness/stack.ts +306 -0
- package/src/e2e-harness/steps.ts +30 -0
- package/src/e2e-harness.ts +2 -0
- package/src/engine-facts.test.ts +2 -3
- package/src/engine-facts.ts +1 -2
- package/src/exit-codes.test.ts +32 -0
- package/src/exit-codes.ts +61 -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 +11 -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 +143 -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 +69 -0
- package/src/lifecycle/gate-applied.ts +6 -0
- package/src/lifecycle/gate-ledger.ts +35 -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 +279 -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 -8
- 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 +192 -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 +19 -0
- package/src/lifecycle/release-publish.ts +45 -22
- package/src/lifecycle/release-read.ts +2 -0
- package/src/lifecycle/release-status.test.ts +185 -0
- package/src/lifecycle/release-status.ts +175 -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/lifecycle/wave-plans.ts +33 -5
- 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/approval-status.test.ts +134 -0
- package/src/op/approval-status.ts +235 -0
- package/src/op/gate-review.test.ts +2 -1
- package/src/op/gate.ts +81 -22
- package/src/op/generate-pipeline.ts +7 -1
- package/src/op/index.ts +23 -0
- package/src/op/op-waves-after-plan.test.ts +288 -0
- package/src/op/op-waves-after-plan.ts +238 -0
- package/src/op/op-waves-capability-spec.ts +133 -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-parallelism.test.ts +89 -0
- package/src/op/op-waves-pull-request.test.ts +219 -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 +132 -0
- package/src/op/op-waves-run-record.test.ts +32 -0
- package/src/op/op-waves-run.ts +1235 -52
- package/src/op/op-waves-stand-down.test.ts +240 -0
- package/src/op/op-waves-stand-down.ts +107 -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 +320 -22
- package/src/op/runtime.ts +107 -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 +543 -0
- package/src/override-gate-bundle.test.ts +2 -0
- package/src/override-gate.ts +4 -0
- package/src/parallelism.test.ts +38 -0
- package/src/parallelism.ts +33 -0
- package/src/policy-packs.ts +230 -0
- package/src/policy-source.test.ts +256 -0
- package/src/policy-source.ts +111 -0
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +175 -33
- package/src/pr-loop-bundle.test.ts +7 -3
- package/src/pr-loop-narrowed.test.ts +63 -0
- package/src/pr-loop-words.test.ts +155 -0
- package/src/pr-loop.ts +398 -52
- package/src/pr-merge.test.ts +100 -0
- package/src/pr-merge.ts +105 -0
- package/src/pr-post-stale.test.ts +163 -0
- package/src/pr-post.ts +190 -5
- package/src/pr-report-url.ts +61 -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 +212 -0
- package/src/release-floors.ts +1 -1
- package/src/run-event.ts +28 -1
- package/src/scheduled-op-cloud.ts +68 -0
- package/src/sorted-json.ts +17 -0
- package/src/stage-hooks-bundle.test.ts +6 -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 +29 -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 +10 -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 +79 -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
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant ci forge-check [--env <env>] [--member <name>] [--forge <forge>]
|
|
3
|
+
* [--repo <owner/name>] [--branch <default>] [--require-clouds] [--json]`
|
|
4
|
+
* (#4608): read the live forge, the clouds and Pulumi Cloud against the
|
|
5
|
+
* pull-request pipelines `ci.identity.cloud` gives the workspace, one row
|
|
6
|
+
* per expected setting. Read-only. Exits chant's `failed` (1) on a
|
|
7
|
+
* mismatch, or with --require-clouds on a cloud left unchecked; `done` (0)
|
|
8
|
+
* otherwise. See ../../forge-check/index.ts.
|
|
9
|
+
*/
|
|
10
|
+
import { formatError } from "../format.js";
|
|
11
|
+
const USAGE = "chant ci forge-check [--env <env>] [--member <name>] [--forge github|gitlab|forgejo] [--repo <owner/name>] [--branch <default>] [--require-clouds] [--json]";
|
|
12
|
+
/** The environment chant's generated pull-request pipelines default to. */
|
|
13
|
+
const DEFAULT_ENV = "production";
|
|
14
|
+
export async function runCiForgeCheck(ctx) {
|
|
15
|
+
const { args } = ctx;
|
|
16
|
+
const [{ forgeCheck, forgeCheckExit, describeForgeCheck, forgeCheckTarget, pipelineContract }, { resolveCloudIdentity }, { CHANT_EXIT }, { activeProductWords }, { findWorkspaceRoot }] = await Promise.all([
|
|
17
|
+
import("../../forge-check/index.js"),
|
|
18
|
+
import("../../ci-identity.js"),
|
|
19
|
+
import("../../exit-codes.js"),
|
|
20
|
+
import("../../ci-product-words.js"),
|
|
21
|
+
import("../../project-root.js"),
|
|
22
|
+
]);
|
|
23
|
+
const fail = (message) => {
|
|
24
|
+
console.error(formatError({ message, hint: USAGE }));
|
|
25
|
+
return CHANT_EXIT.failed;
|
|
26
|
+
};
|
|
27
|
+
if (args.forge !== undefined && !["github", "gitlab", "forgejo"].includes(args.forge))
|
|
28
|
+
return fail(`--forge is ${args.forge}; give github, gitlab or forgejo`);
|
|
29
|
+
let target;
|
|
30
|
+
try {
|
|
31
|
+
target = forgeCheckTarget(process.env, { ...(args.forge ? { kind: args.forge } : {}), ...(args.ciRepo ? { repo: args.ciRepo } : {}) });
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
35
|
+
}
|
|
36
|
+
const found = findWorkspaceRoot(process.cwd());
|
|
37
|
+
let decl;
|
|
38
|
+
let memberNames = [];
|
|
39
|
+
if (found) {
|
|
40
|
+
const [{ readDeclaration, WorkspaceReadError }, { workingTree }] = await Promise.all([import("../../workspace/declaration.js"), import("../../workspace/tree.js")]);
|
|
41
|
+
try {
|
|
42
|
+
const declaration = readDeclaration(workingTree(found.dir));
|
|
43
|
+
decl = declaration.ci?.identity?.cloud;
|
|
44
|
+
memberNames = (declaration.members ?? []).map((m) => m.name);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
if (err instanceof WorkspaceReadError)
|
|
48
|
+
return fail(`${err.describe()} [${err.code}]`);
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const unknown = (args.members ?? []).filter((m) => !memberNames.includes(m));
|
|
53
|
+
if (unknown.length)
|
|
54
|
+
return fail(`--member names ${unknown.join(", ")}, which the workspace declaration does not list`);
|
|
55
|
+
const env = args.env ?? DEFAULT_ENV;
|
|
56
|
+
const members = args.members?.length ? args.members : memberNames.length ? memberNames : [undefined];
|
|
57
|
+
const pipelines = members.flatMap((member) => {
|
|
58
|
+
const identity = resolveCloudIdentity(decl, env, member);
|
|
59
|
+
return identity ? [{ name: member ? `${member}/${env}` : env, identity, ...(member ? { member } : {}) }] : [];
|
|
60
|
+
});
|
|
61
|
+
const words = activeProductWords();
|
|
62
|
+
const host = target.host;
|
|
63
|
+
const result = await forgeCheck({
|
|
64
|
+
target,
|
|
65
|
+
words,
|
|
66
|
+
...(args.requireClouds ? { requireClouds: true } : {}),
|
|
67
|
+
contract: (live) => pipelineContract({
|
|
68
|
+
forge: target.kind,
|
|
69
|
+
repository: {
|
|
70
|
+
host,
|
|
71
|
+
path: live.path ?? target.repo,
|
|
72
|
+
defaultBranch: args.branch ?? live.defaultBranch ?? "main",
|
|
73
|
+
...(live.ownerId ? { ownerId: live.ownerId } : {}),
|
|
74
|
+
...(live.repoId ? { repoId: live.repoId } : {}),
|
|
75
|
+
},
|
|
76
|
+
pipelines,
|
|
77
|
+
words,
|
|
78
|
+
}),
|
|
79
|
+
}, { fetch: globalThis.fetch, env: process.env });
|
|
80
|
+
if (args.json)
|
|
81
|
+
console.log(JSON.stringify(result, null, 2));
|
|
82
|
+
else
|
|
83
|
+
console.log(describeForgeCheck(result));
|
|
84
|
+
if (!decl)
|
|
85
|
+
console.error("ci forge-check: no ci.identity.cloud in the workspace declaration, so no trust was checked");
|
|
86
|
+
else if (pipelines.length === 0)
|
|
87
|
+
console.error(`ci forge-check: no rule of ci.identity.cloud covers environment ${env}, so no trust was checked`);
|
|
88
|
+
return forgeCheckExit(result);
|
|
89
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandContext } from "../registry.js";
|
|
2
|
+
/** `chant e2e <word>` with a word that is not a verb. */
|
|
3
|
+
export declare function runE2eUnknown(ctx: CommandContext): Promise<number>;
|
|
4
|
+
/**
|
|
5
|
+
* `chant e2e safe-run [--scan <dir>]... -- <command...>` (chant#4587, C1): the
|
|
6
|
+
* harness's no-real-cloud wrapper (`../../e2e-harness/safe-run.ts`) for a
|
|
7
|
+
* driver that is not TypeScript. Exit codes: the command's own code after a
|
|
8
|
+
* CLEAN scan, 3 when the scan rejects the run, 2 for a usage error or a
|
|
9
|
+
* refused environment.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runE2eSafeRun(ctx: CommandContext): Promise<number>;
|
|
12
|
+
//# sourceMappingURL=e2e-safe-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-safe-run.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/e2e-safe-run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,yDAAyD;AACzD,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxE;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { formatError } from "../format.js";
|
|
2
|
+
const USAGE = "chant e2e safe-run [--scan <dir>]... -- <command...>";
|
|
3
|
+
/** `chant e2e <word>` with a word that is not a verb. */
|
|
4
|
+
export async function runE2eUnknown(ctx) {
|
|
5
|
+
console.error(formatError({ message: `Unknown e2e command: ${ctx.args.path}`, hint: USAGE }));
|
|
6
|
+
return 2;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `chant e2e safe-run [--scan <dir>]... -- <command...>` (chant#4587, C1): the
|
|
10
|
+
* harness's no-real-cloud wrapper (`../../e2e-harness/safe-run.ts`) for a
|
|
11
|
+
* driver that is not TypeScript. Exit codes: the command's own code after a
|
|
12
|
+
* CLEAN scan, 3 when the scan rejects the run, 2 for a usage error or a
|
|
13
|
+
* refused environment.
|
|
14
|
+
*/
|
|
15
|
+
export async function runE2eSafeRun(ctx) {
|
|
16
|
+
const command = (ctx.args.positionals ?? []).slice(1);
|
|
17
|
+
if (command.length === 0) {
|
|
18
|
+
console.error(formatError({ message: "chant e2e safe-run needs a command after --", hint: USAGE }));
|
|
19
|
+
return 2;
|
|
20
|
+
}
|
|
21
|
+
const { runSafeRunCommand } = await import("../../e2e-harness/safe-run-cli.js");
|
|
22
|
+
return runSafeRunCommand({ command, scan: ctx.args.scanDirs ?? [] });
|
|
23
|
+
}
|
|
@@ -429,10 +429,14 @@ async function fanOut(ctx, projectPath, config) {
|
|
|
429
429
|
// ws-107 (#4465): the components a capability takes as one plan in their
|
|
430
430
|
// wave and apply as one group; under --wave-gate none forms (ruling 1).
|
|
431
431
|
const runPlan = await formRunGroups({ components: derived.components, plan: derived.plan, registry, env, ...(waveGate ? { waveGate: true } : {}) });
|
|
432
|
+
// #4594: ci.lockGrain, and on the resource grain the row lease each step, group or gated wave takes in the pull-request loop's rows file.
|
|
433
|
+
const { applyLeaseOptions } = await import("../../components/apply-lease.js");
|
|
434
|
+
const leasing = await applyLeaseOptions(process.cwd());
|
|
432
435
|
let result;
|
|
433
436
|
try {
|
|
434
437
|
result = await runFanOut(runPlan, derived.components, registry, {
|
|
435
438
|
env,
|
|
439
|
+
...leasing,
|
|
436
440
|
...(runPlan.groups?.length ? { planGroupsAtWave: true } : {}),
|
|
437
441
|
releaseIdentity: () => (revision ? { revision } : {}),
|
|
438
442
|
componentOutputs,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant run pending --plan <digest> [--op <op>] [--json]` (#4607): the
|
|
3
|
+
* standing pending gates waiting on a plan digest, with the pull request a
|
|
4
|
+
* pull request gate belongs to. A product's approve verb runs it (or calls
|
|
5
|
+
* `pendingGatesByPlan` from `@intentius/chant/ci-product`) to find the op and
|
|
6
|
+
* gate a digest waits at, so a person types the digest the note showed and
|
|
7
|
+
* nothing else.
|
|
8
|
+
*/
|
|
9
|
+
import type { CommandContext } from "../registry.js";
|
|
10
|
+
export declare function runPendingCommand(ctx: CommandContext): Promise<number>;
|
|
11
|
+
//# sourceMappingURL=gate-pending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-pending.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/gate-pending.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAYlD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB5E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant run pending --plan <digest> [--op <op>] [--json]` (#4607): the
|
|
3
|
+
* standing pending gates waiting on a plan digest, with the pull request a
|
|
4
|
+
* pull request gate belongs to. A product's approve verb runs it (or calls
|
|
5
|
+
* `pendingGatesByPlan` from `@intentius/chant/ci-product`) to find the op and
|
|
6
|
+
* gate a digest waits at, so a person types the digest the note showed and
|
|
7
|
+
* nothing else.
|
|
8
|
+
*/
|
|
9
|
+
import { formatError, formatInfo } from "../format.js";
|
|
10
|
+
import { requireLifecycleLedger } from "../../lifecycle/git.js";
|
|
11
|
+
import { pendingGatesByPlan } from "../../lifecycle/gate-pending-by-plan.js";
|
|
12
|
+
function describe(g) {
|
|
13
|
+
const where = g.pr !== undefined ? ` (pull request ${g.pr}${g.member ? `, member ${g.member}` : ""})` : "";
|
|
14
|
+
const env = g.environment ? ` in ${g.environment}` : "";
|
|
15
|
+
const by = g.matched === "changeSet" ? " by its change set" : "";
|
|
16
|
+
return `${g.op} / ${g.gate}${env}${where} waits on this plan${by}, since ${g.timestamp}, until ${g.expiresAt}`;
|
|
17
|
+
}
|
|
18
|
+
export async function runPendingCommand(ctx) {
|
|
19
|
+
const { args } = ctx;
|
|
20
|
+
const digest = args.plan;
|
|
21
|
+
if (!digest) {
|
|
22
|
+
console.error(formatError({ message: "chant run pending needs the digest a plan printed: --plan <digest>" }));
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
await requireLifecycleLedger();
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
console.error(formatError({ message: `Cannot read the gate ledgers: ${err instanceof Error ? err.message : String(err)}` }));
|
|
30
|
+
return 1;
|
|
31
|
+
}
|
|
32
|
+
const gates = await pendingGatesByPlan(digest, args.op ? { op: args.op } : {});
|
|
33
|
+
if (args.json) {
|
|
34
|
+
console.log(JSON.stringify({ plan: digest, gates }, null, 2));
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
if (gates.length === 0) {
|
|
38
|
+
console.error(formatInfo(`No gate is waiting on ${digest}: it was approved, it expired, or no run reached a gate with it.`));
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
for (const g of gates)
|
|
42
|
+
console.error(formatInfo(describe(g)));
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BlE;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBzE"}
|
|
@@ -9,7 +9,7 @@ import { existsSync } from "node:fs";
|
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
10
|
import { formatError, formatWarning } from "../format.js";
|
|
11
11
|
import { queryLedgers } from "./query.js";
|
|
12
|
-
const USAGE = "chant ledger <resources|snapshots|runs|gates|deploys|releases|cuts> [dir] [--member <name>] [--where <field><op><value>]... [--since <time>] [--at <rev>] [--json]";
|
|
12
|
+
const USAGE = "chant ledger <resources|snapshots|runs|gates|deploys|releases|cuts|applies|pr_envs|control_entries|release_status> [dir] [--member <name>] [--where <field><op><value>]... [--since <time>] [--at <rev>] [--json]";
|
|
13
13
|
const cell = (v) => (v === null || v === undefined ? "" : typeof v === "object" ? JSON.stringify(v) : String(v));
|
|
14
14
|
export async function runLedgerCommand(ctx) {
|
|
15
15
|
const { args } = ctx;
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
* refusal. No lexicon with a drift read is the refusal `no-drift-read`.
|
|
20
20
|
*/
|
|
21
21
|
import type { CommandContext } from "../registry.js";
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The exit status of a refused read: `CHANT_EXIT.failed` (#4553; 3 before).
|
|
24
|
+
* The `{"refused": ...}` line on stdout says why, and `chant workspace drift`
|
|
25
|
+
* reads that line, so the code carries nothing more.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DRIFT_REFUSED_EXIT: 1;
|
|
24
28
|
export declare function runLifecycleDrift(ctx: CommandContext): Promise<number>;
|
|
25
29
|
//# sourceMappingURL=lifecycle-drift.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-drift.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"lifecycle-drift.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAoB,CAAC;AASpD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B5E"}
|
|
@@ -19,11 +19,16 @@
|
|
|
19
19
|
* refusal. No lexicon with a drift read is the refusal `no-drift-read`.
|
|
20
20
|
*/
|
|
21
21
|
import { basename, resolve } from "node:path";
|
|
22
|
+
import { CHANT_EXIT } from "../../exit-codes.js";
|
|
22
23
|
import { loadChantConfig } from "../../config.js";
|
|
23
24
|
import { DRIFT_READS, encodeDriftLine } from "../../drift-record.js";
|
|
24
25
|
import { formatError } from "../format.js";
|
|
25
|
-
/**
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The exit status of a refused read: `CHANT_EXIT.failed` (#4553; 3 before).
|
|
28
|
+
* The `{"refused": ...}` line on stdout says why, and `chant workspace drift`
|
|
29
|
+
* reads that line, so the code carries nothing more.
|
|
30
|
+
*/
|
|
31
|
+
export const DRIFT_REFUSED_EXIT = CHANT_EXIT.failed;
|
|
27
32
|
const USAGE = "chant lifecycle drift [--member <name>] [--read <state|plan|refresh|live-read|ownership>] [--resource <addr>]";
|
|
28
33
|
function refuse(code, message) {
|
|
29
34
|
console.log(JSON.stringify({ refused: { code, message } }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lock.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkBlD,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,eAAe,CAAC;AA4DhD,iBAAiB;AACjB,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgHlE;AAED,mBAAmB;AACnB,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBpE"}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* ```
|
|
6
6
|
* chant lock <target>... --pr <n> [--stage plan|apply|lock] [--head <sha>] [--by <who>] [--gate <name>] [--forge <kind>] [--json]
|
|
7
7
|
* chant lock --from-report <pr-plan.json> --pr <n> [--stage plan] [--forge <kind>] [--json]
|
|
8
|
+
* chant lock --keep --pr <n> [--head <sha>] [--gate <name>] [--forge <kind>] [--json]
|
|
8
9
|
* chant lock --list [--gate <name>] [--json]
|
|
10
|
+
* chant lock --alive <run>
|
|
9
11
|
* chant unlock --pr <n> [<target>...] [--gate <name>] [--json]
|
|
10
12
|
* ```
|
|
11
13
|
*
|
|
@@ -13,7 +15,25 @@
|
|
|
13
15
|
* which are what `pr-apply` checks under `ci.locks`, or any other name a
|
|
14
16
|
* pipeline locks by. `--from-report` reads them from a pull-request report
|
|
15
17
|
* (`selection.waves`), so a lock job that runs the target branch's code can
|
|
16
|
-
* lock what the plan job, which ran the pull request's code, selected.
|
|
18
|
+
* lock what the plan job, which ran the pull request's code, selected. When
|
|
19
|
+
* a member is on the resource lock grain (#4552) the report carries
|
|
20
|
+
* `lockTargets`, its row keys, and those are locked instead.
|
|
21
|
+
*
|
|
22
|
+
* `--list` prints the target locks, then the apply rows of the gate's rows
|
|
23
|
+
* file (#4552, #4594), each with the run that holds it and when it took it.
|
|
24
|
+
*
|
|
25
|
+
* `--keep` (#4588) takes again, at stage `lock`, every lock the pull request
|
|
26
|
+
* holds now: the components (or row keys) its plan locked under `ci.locks:
|
|
27
|
+
* plan`. A plan lock is let go when a later plan no longer reaches the
|
|
28
|
+
* target; a kept one stays until the pull request closes or `chant unlock`.
|
|
29
|
+
* It is what a `/<product> lock` comment runs, on the target branch's
|
|
30
|
+
* commit, so no code of the change runs. A pull request that holds no lock
|
|
31
|
+
* yet fails with a line saying its plan has to run first.
|
|
32
|
+
*
|
|
33
|
+
* `--alive <run>` prints `alive` or `dead` for a run that holds rows or the
|
|
34
|
+
* Forgejo repo lock tag (#4552): `dead` when the forge says the run
|
|
35
|
+
* finished, `alive` while it runs or when nobody can say. The lock tag's
|
|
36
|
+
* shell asks it before taking a lease over.
|
|
17
37
|
*
|
|
18
38
|
* `--forge` reads which holders are still open, so a lock whose pull
|
|
19
39
|
* request merged or closed is taken over, and, with `--head`, posts the
|
|
@@ -23,13 +43,14 @@
|
|
|
23
43
|
* request holds a target (nothing is locked), 1 on an error.
|
|
24
44
|
*/
|
|
25
45
|
import { readFileSync } from "node:fs";
|
|
46
|
+
import { CHANT_EXIT } from "../../exit-codes.js";
|
|
26
47
|
import { resolve } from "node:path";
|
|
27
48
|
import { formatError, formatInfo, formatSuccess, formatWarning } from "../format.js";
|
|
28
49
|
import { FORGE_KINDS, forgeFromEnv } from "../../pr-forge.js";
|
|
29
50
|
import { PR_APPLY_GATE } from "../../pr-loop.js";
|
|
30
51
|
import { describeHeldTargetLocks, readTargetLocks, releaseTargetLocks, takeTargetLocks, targetLockGateProblem, targetLockPathAt, TARGET_LOCK_STAGES, } from "../../lifecycle/target-lock.js";
|
|
31
|
-
/** The exit for a target another open pull request holds:
|
|
32
|
-
const HELD_EXIT_CODE =
|
|
52
|
+
/** The exit for a target another open pull request holds: `CHANT_EXIT.held`, 5 (#4553). */
|
|
53
|
+
const HELD_EXIT_CODE = CHANT_EXIT.held;
|
|
33
54
|
/** The status `chant lock --head <sha> --forge <kind>` posts. */
|
|
34
55
|
export const LOCK_STATUS_CONTEXT = "chant/lock";
|
|
35
56
|
const fail = (message, hint) => {
|
|
@@ -70,6 +91,10 @@ function fromReport(file, pr) {
|
|
|
70
91
|
}
|
|
71
92
|
if (doc.pr !== pr)
|
|
72
93
|
return { error: `--from-report: "${file}" is the report of ${doc.pr === null || doc.pr === undefined ? "no pull request" : `pull request ${String(doc.pr)}`}, not ${pr}` };
|
|
94
|
+
// #4552: a member on the resource grain locks its row keys, which the report lists.
|
|
95
|
+
if (Array.isArray(doc.lockTargets) && doc.lockTargets.every((t) => typeof t === "string" && t !== "")) {
|
|
96
|
+
return { targets: doc.lockTargets, ...(typeof doc.head === "string" ? { head: doc.head } : {}) };
|
|
97
|
+
}
|
|
73
98
|
const waves = doc.selection?.waves;
|
|
74
99
|
if (!Array.isArray(waves) || !waves.every((w) => Array.isArray(w) && w.every((n) => typeof n === "string"))) {
|
|
75
100
|
return { error: `--from-report: "${file}" has no selection.waves; pass a pr-plan.json that chant components pr-plan wrote` };
|
|
@@ -92,25 +117,44 @@ export async function runLock(ctx) {
|
|
|
92
117
|
const gate = gateOf(ctx);
|
|
93
118
|
if (typeof gate !== "string")
|
|
94
119
|
return fail(gate.error);
|
|
120
|
+
if (args.aliveRun !== undefined) {
|
|
121
|
+
const { forgeLockLiveness } = await import("../../lifecycle/resource-lock.js");
|
|
122
|
+
// The lease's age is the caller's to judge (the tag carries its own), so only the forge and the process are asked here.
|
|
123
|
+
const verdict = await forgeLockLiveness(process.env)({ run: args.aliveRun, at: new Date().toISOString() });
|
|
124
|
+
console.log(verdict);
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
95
127
|
if (args.list) {
|
|
96
128
|
if (targetsOf(ctx).length > 0 || args.pr !== undefined)
|
|
97
129
|
return fail("--list prints every lock; drop the targets and --pr");
|
|
98
130
|
let file;
|
|
131
|
+
let held;
|
|
99
132
|
try {
|
|
100
133
|
file = await readTargetLocks(gate);
|
|
134
|
+
// #4594: the apply rows of the gate (#4552), each with the run that holds it.
|
|
135
|
+
const { readLockRows } = await import("../../lifecycle/resource-lock.js");
|
|
136
|
+
held = await readLockRows(gate);
|
|
101
137
|
}
|
|
102
138
|
catch (err) {
|
|
103
139
|
return fail(err instanceof Error ? err.message : String(err));
|
|
104
140
|
}
|
|
105
141
|
const rows = Object.entries(file.locks).sort(([a], [b]) => a.localeCompare(b));
|
|
142
|
+
const leased = Object.entries(held.rows)
|
|
143
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
144
|
+
.map(([key, run]) => ({ key, holder: held.holders[run] }));
|
|
106
145
|
if (args.json) {
|
|
107
|
-
|
|
146
|
+
const { lockRowsPath } = await import("../../lifecycle/resource-lock.js");
|
|
147
|
+
console.log(JSON.stringify({ gate, path: await targetLockPathAt(gate), locks: Object.fromEntries(rows), rowsPath: lockRowsPath(gate), rows: Object.fromEntries(leased.map((r) => [r.key, r.holder])) }, null, 2));
|
|
108
148
|
return 0;
|
|
109
149
|
}
|
|
110
150
|
if (rows.length === 0)
|
|
111
151
|
console.error(formatInfo(`no target locks on ${gate}`));
|
|
112
152
|
for (const [target, l] of rows)
|
|
113
153
|
console.log(`${target}\tpull request ${l.pr}\t${l.stage}\t${l.by}\t${l.at}`);
|
|
154
|
+
if (leased.length === 0)
|
|
155
|
+
console.error(formatInfo(`no apply rows held on ${gate}`));
|
|
156
|
+
for (const { key, holder } of leased)
|
|
157
|
+
console.log(`${key}\trun ${holder.run}\t${holder.at}${holder.url ? `\t${holder.url}` : ""}`);
|
|
114
158
|
return 0;
|
|
115
159
|
}
|
|
116
160
|
if (args.pr === undefined)
|
|
@@ -120,7 +164,22 @@ export async function runLock(ctx) {
|
|
|
120
164
|
return fail(`--stage ${args.lockStage} is not one of ${TARGET_LOCK_STAGES.join(", ")}`);
|
|
121
165
|
let targets = targetsOf(ctx);
|
|
122
166
|
let head = args.head;
|
|
123
|
-
if (args.
|
|
167
|
+
if (args.keepLocks) {
|
|
168
|
+
if (targets.length > 0 || args.fromReport)
|
|
169
|
+
return fail("--keep keeps the locks the pull request holds; drop the names and --from-report");
|
|
170
|
+
let file;
|
|
171
|
+
try {
|
|
172
|
+
file = await readTargetLocks(gate);
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
176
|
+
}
|
|
177
|
+
targets = Object.entries(file.locks).filter(([, l]) => l.pr === args.pr).map(([target]) => target).sort();
|
|
178
|
+
head ?? (head = Object.values(file.locks).find((l) => l.pr === args.pr)?.head);
|
|
179
|
+
if (targets.length === 0)
|
|
180
|
+
return fail(`pull request ${args.pr} holds no lock on ${gate} yet, so there is nothing to keep`, "Its plan takes the locks under ci.locks: plan; comment again once the plan job ran.");
|
|
181
|
+
}
|
|
182
|
+
else if (args.fromReport) {
|
|
124
183
|
if (targets.length > 0)
|
|
125
184
|
return fail("--from-report reads the targets from the report; drop the names");
|
|
126
185
|
const read = fromReport(args.fromReport, args.pr);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RelayDeps, type RelaySettings } from "../../notify-relay.js";
|
|
2
|
+
import type { CommandContext } from "../registry.js";
|
|
3
|
+
/** The relay's settings, read from `env`, or the first problem with them. */
|
|
4
|
+
export declare function relaySettingsFromEnv(env: NodeJS.ProcessEnv): {
|
|
5
|
+
settings: RelaySettings;
|
|
6
|
+
host: string;
|
|
7
|
+
port: number;
|
|
8
|
+
} | {
|
|
9
|
+
error: string;
|
|
10
|
+
};
|
|
11
|
+
/** The relay's reads and writes against the checkout at `cwd`. */
|
|
12
|
+
export declare function checkoutRelayDeps(cwd: string, principal: string): RelayDeps;
|
|
13
|
+
/** `chant notify relay`. Runs until the process is stopped. */
|
|
14
|
+
export declare function runNotifyRelay(_ctx: CommandContext): Promise<number>;
|
|
15
|
+
//# sourceMappingURL=notify-relay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-relay.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/notify-relay.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAuE,KAAK,SAAS,EAAqB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEhK,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG;IAAE,QAAQ,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAkBxI;AAYD,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAuD3E;AAED,+DAA+D;AAC/D,wBAAsB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAa1E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant notify relay` (#4611): serve the relay that turns a chat click into
|
|
3
|
+
* a `chant approve` (../../notify-relay.ts), from a checkout of the repo.
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* CHANT_RELAY_KEY=... SLACK_SIGNING_SECRET=... chant notify relay
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Settings come from the environment (`RELAY_ENV`), as a container or
|
|
10
|
+
* function host sets them: the relay key, the Slack signing secret, the
|
|
11
|
+
* Teams HMAC key, the relay's principal (default `<product>-relay`), the
|
|
12
|
+
* maximum age of a button (default a day), and the host and port (default
|
|
13
|
+
* 127.0.0.1:8787). The relay refuses to start with neither chat secret, or
|
|
14
|
+
* with no relay key, since it could then verify nothing.
|
|
15
|
+
*
|
|
16
|
+
* Each click fetches `chant/lifecycle`, reads the signers file at base, and
|
|
17
|
+
* records through `recordGateApproval`, one click at a time, so two clicks
|
|
18
|
+
* never race on the ledger.
|
|
19
|
+
*/
|
|
20
|
+
import { activeProductWords } from "../../ci-product-words.js";
|
|
21
|
+
import { CHANT_EXIT } from "../../exit-codes.js";
|
|
22
|
+
import { DEFAULT_RELAY_MAX_AGE_SECONDS } from "../../notify.js";
|
|
23
|
+
import { DEFAULT_RELAY_HOST, DEFAULT_RELAY_PORT, RELAY_ENV, startRelayServer } from "../../notify-relay.js";
|
|
24
|
+
import { formatError, formatInfo } from "../format.js";
|
|
25
|
+
/** The relay's settings, read from `env`, or the first problem with them. */
|
|
26
|
+
export function relaySettingsFromEnv(env) {
|
|
27
|
+
const key = env[RELAY_ENV.key];
|
|
28
|
+
if (!key)
|
|
29
|
+
return { error: `${RELAY_ENV.key} is not set; it holds the key notify signs the buttons with (notify.relay on the sending side)` };
|
|
30
|
+
const slackSecret = env[RELAY_ENV.slackSecret] || undefined;
|
|
31
|
+
const teamsSecret = env[RELAY_ENV.teamsSecret] || undefined;
|
|
32
|
+
if (!slackSecret && !teamsSecret)
|
|
33
|
+
return { error: `set ${RELAY_ENV.slackSecret}, ${RELAY_ENV.teamsSecret} or both, so the relay can verify a click` };
|
|
34
|
+
const maxAgeText = env[RELAY_ENV.maxAge];
|
|
35
|
+
const maxAge = maxAgeText === undefined || maxAgeText === "" ? DEFAULT_RELAY_MAX_AGE_SECONDS : Number(maxAgeText);
|
|
36
|
+
if (!Number.isInteger(maxAge) || maxAge <= 0)
|
|
37
|
+
return { error: `${RELAY_ENV.maxAge} is a whole number of seconds (got ${JSON.stringify(maxAgeText)})` };
|
|
38
|
+
const portText = env[RELAY_ENV.port];
|
|
39
|
+
const port = portText === undefined || portText === "" ? DEFAULT_RELAY_PORT : Number(portText);
|
|
40
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535)
|
|
41
|
+
return { error: `${RELAY_ENV.port} is a port number (got ${JSON.stringify(portText)})` };
|
|
42
|
+
const slackResponse = env[RELAY_ENV.slackResponse]?.split(",").map((s) => s.trim()).filter(Boolean);
|
|
43
|
+
return {
|
|
44
|
+
settings: { key, ...(slackSecret ? { slackSecret } : {}), ...(teamsSecret ? { teamsSecret } : {}), maxAgeSeconds: maxAge, ...(slackResponse?.length ? { slackResponse } : {}) },
|
|
45
|
+
host: env[RELAY_ENV.host] || DEFAULT_RELAY_HOST,
|
|
46
|
+
port,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** One at a time: each click's ledger read and write finish before the next starts. */
|
|
50
|
+
function serial() {
|
|
51
|
+
let tail = Promise.resolve();
|
|
52
|
+
return (fn) => {
|
|
53
|
+
const run = tail.then(fn, fn);
|
|
54
|
+
tail = run.catch(() => undefined);
|
|
55
|
+
return run;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** The relay's reads and writes against the checkout at `cwd`. */
|
|
59
|
+
export function checkoutRelayDeps(cwd, principal) {
|
|
60
|
+
const words = activeProductWords();
|
|
61
|
+
const one = serial();
|
|
62
|
+
return {
|
|
63
|
+
principal,
|
|
64
|
+
words,
|
|
65
|
+
async signers() {
|
|
66
|
+
const { scopeSource } = await import("../../workspace/write-scope.js");
|
|
67
|
+
const policy = scopeSource(cwd).policy;
|
|
68
|
+
return { signers: policy.signers, path: policy.signersPath };
|
|
69
|
+
},
|
|
70
|
+
pending: (digest) => one(async () => {
|
|
71
|
+
const { fetchLifecycle } = await import("../../lifecycle/git.js");
|
|
72
|
+
const { pendingGatesByPlan } = await import("../../lifecycle/gate-pending-by-plan.js");
|
|
73
|
+
const { readGateLedger } = await import("../../lifecycle/gate-ledger.js");
|
|
74
|
+
const { latestPendingGate } = await import("../../lifecycle/gate-ledger-select.js");
|
|
75
|
+
await fetchLifecycle({ cwd });
|
|
76
|
+
const out = [];
|
|
77
|
+
for (const p of await pendingGatesByPlan(digest, { cwd })) {
|
|
78
|
+
const digestAsked = p.planDigest ?? p.changeSet;
|
|
79
|
+
if (!digestAsked)
|
|
80
|
+
continue;
|
|
81
|
+
const fact = latestPendingGate((await readGateLedger(p.op, { cwd })).pending.filter((f) => f.environment === p.environment), p.gate);
|
|
82
|
+
out.push({ op: p.op, gate: p.gate, digest: digestAsked, ...(p.environment !== undefined ? { environment: p.environment } : {}), ...(fact?.request ? { request: fact.request } : {}) });
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}),
|
|
86
|
+
approve: (input) => one(async () => {
|
|
87
|
+
const { recordGateApproval } = await import("./approve.js");
|
|
88
|
+
// chant approve prints why it refused; the relay sends that line to the thread.
|
|
89
|
+
const said = [];
|
|
90
|
+
const was = console.error;
|
|
91
|
+
console.error = (...parts) => {
|
|
92
|
+
said.push(parts.map(String).join(" "));
|
|
93
|
+
was(...parts);
|
|
94
|
+
};
|
|
95
|
+
try {
|
|
96
|
+
const out = await recordGateApproval(input.op, input.gate, {
|
|
97
|
+
origin: "cli",
|
|
98
|
+
actor: input.actor,
|
|
99
|
+
relayedBy: input.relayedBy,
|
|
100
|
+
plan: input.digest,
|
|
101
|
+
...(input.environment !== undefined ? { environment: input.environment } : {}),
|
|
102
|
+
cwd,
|
|
103
|
+
});
|
|
104
|
+
if (out.ok)
|
|
105
|
+
return { ok: true };
|
|
106
|
+
// eslint-disable-next-line no-control-regex
|
|
107
|
+
const reason = said.map((l) => l.replace(/\u001b\[[0-9;]*m/g, "").trim()).filter(Boolean)[0];
|
|
108
|
+
return { ok: false, error: reason ?? `chant approve ${input.op} ${input.gate} refused the approval` };
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
console.error = was;
|
|
112
|
+
}
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** `chant notify relay`. Runs until the process is stopped. */
|
|
117
|
+
export async function runNotifyRelay(_ctx) {
|
|
118
|
+
const read = relaySettingsFromEnv(process.env);
|
|
119
|
+
if ("error" in read) {
|
|
120
|
+
console.error(formatError({ message: `chant notify relay did not start: ${read.error}` }));
|
|
121
|
+
return CHANT_EXIT.failed;
|
|
122
|
+
}
|
|
123
|
+
const words = activeProductWords();
|
|
124
|
+
const principal = process.env[RELAY_ENV.principal]?.trim() || `${words.product}-relay`;
|
|
125
|
+
const deps = checkoutRelayDeps(process.cwd(), principal);
|
|
126
|
+
const { url } = await startRelayServer(read.settings, deps, { host: read.host, port: read.port, log: (line) => console.error(formatInfo(line)) });
|
|
127
|
+
console.error(formatInfo(`${words.product} notify relay listens at ${url} (POST /slack, POST /teams, GET /healthz), recording approvals relayed by ${principal}`));
|
|
128
|
+
await new Promise(() => { });
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-env.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;
|
|
1
|
+
{"version":3,"file":"pr-env.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AA4CH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAUlD,8CAA8C;AAC9C,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAO7E"}
|