@intentius/chant 0.124.52 → 0.124.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__fixtures__/estate-ledger.d.ts +13 -0
- package/dist/__fixtures__/estate-ledger.d.ts.map +1 -0
- package/dist/__fixtures__/estate-ledger.js +67 -0
- package/dist/__fixtures__/oidc-emulator.d.ts +11 -1
- package/dist/__fixtures__/oidc-emulator.d.ts.map +1 -1
- package/dist/__fixtures__/oidc-emulator.js +26 -2
- package/dist/__fixtures__/product-words.d.ts +78 -0
- package/dist/__fixtures__/product-words.d.ts.map +1 -0
- package/dist/__fixtures__/product-words.js +43 -0
- package/dist/__golden__/wave-loop/op-by-apply-after-fails.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +20 -4
- package/dist/__golden__/wave-loop/op-by-apply-ignored.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-pass.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-skip.json +10 -2
- package/dist/__golden__/wave-loop/op-discover-rest-stops.json +22 -6
- package/dist/__golden__/wave-loop/op-discover-rest.json +44 -12
- package/dist/__golden__/wave-loop/op-discover-wide.json +12 -3
- package/dist/__golden__/wave-loop/op-held-on.json +28 -7
- package/dist/__golden__/wave-loop/op-hooks-apply-fails.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-fail-after-apply.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-fail-before-apply.json +4 -2
- package/dist/__golden__/wave-loop/op-hooks-held.json +26 -8
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +18 -4
- package/dist/__golden__/wave-loop/op-hooks-pass.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-share.json +20 -7
- package/dist/__golden__/wave-loop/op-outcome-held.json +12 -3
- package/dist/__golden__/wave-loop/op-outcome-replan-approved.json +16 -5
- package/dist/__golden__/wave-loop/op-outcome-replan-forever.json +48 -21
- package/dist/__golden__/wave-loop/op-outcome-replan.json +16 -5
- package/dist/__golden__/wave-loop/op-outcome-stood-down.json +12 -3
- package/dist/__golden__/wave-loop/op-outcome-unreadable.json +12 -3
- package/dist/__golden__/wave-loop/op-overridden.json +28 -7
- package/dist/__golden__/wave-loop/op-per-run.json +20 -4
- package/dist/__golden__/wave-loop/op-point.json +18 -4
- package/dist/__golden__/wave-loop/op-pr-review.json +10 -2
- package/dist/__golden__/wave-loop/op-spend-change-only.json +10 -2
- package/dist/__golden__/wave-loop/op-spend.json +10 -2
- package/dist/__golden__/wave-loop/op-wave-commands.json +56 -13
- package/dist/__golden__/wave-loop/op-wide.json +20 -4
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/discover.js +3 -1
- package/dist/behaviour.d.ts +1 -1
- package/dist/behaviour.d.ts.map +1 -1
- package/dist/bucket-check/azure.d.ts +108 -0
- package/dist/bucket-check/azure.d.ts.map +1 -0
- package/dist/bucket-check/azure.js +258 -0
- package/dist/bucket-check/fixtures/azure.json +153 -0
- package/dist/bucket-check/fixtures/gcs.json +148 -0
- package/dist/bucket-check/fixtures/s3.json +277 -0
- package/dist/bucket-check/gcs.d.ts +77 -0
- package/dist/bucket-check/gcs.d.ts.map +1 -0
- package/dist/bucket-check/gcs.js +202 -0
- package/dist/bucket-check/index.d.ts +48 -0
- package/dist/bucket-check/index.d.ts.map +1 -0
- package/dist/bucket-check/index.js +44 -0
- package/dist/bucket-check/s3.d.ts +116 -0
- package/dist/bucket-check/s3.d.ts.map +1 -0
- package/dist/bucket-check/s3.js +362 -0
- package/dist/bucket-check/types.d.ts +66 -0
- package/dist/bucket-check/types.d.ts.map +1 -0
- package/dist/bucket-check/types.js +31 -0
- package/dist/bucket-check/wire.d.ts +27 -0
- package/dist/bucket-check/wire.d.ts.map +1 -0
- package/dist/bucket-check/wire.js +32 -0
- package/dist/bucket-check.d.ts +6 -0
- package/dist/bucket-check.d.ts.map +1 -0
- package/dist/bucket-check.js +5 -0
- package/dist/capabilities/templates.d.ts +65 -0
- package/dist/capabilities/templates.d.ts.map +1 -0
- package/dist/capabilities/templates.js +192 -0
- package/dist/capabilities/templates.json +145 -0
- package/dist/change-set-graph.d.ts +35 -3
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +60 -9
- package/dist/change-set.d.ts +65 -7
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +22 -12
- package/dist/ci-agent.d.ts +381 -0
- package/dist/ci-agent.d.ts.map +1 -0
- package/dist/ci-agent.js +833 -0
- package/dist/ci-control.d.ts +42 -0
- package/dist/ci-control.d.ts.map +1 -0
- package/dist/ci-control.js +42 -0
- package/dist/ci-estate/delivery.d.ts +137 -0
- package/dist/ci-estate/delivery.d.ts.map +1 -0
- package/dist/ci-estate/delivery.js +311 -0
- package/dist/ci-estate/overdue.d.ts +34 -0
- package/dist/ci-estate/overdue.d.ts.map +1 -0
- package/dist/ci-estate/overdue.js +58 -0
- package/dist/ci-estate/page.d.ts +134 -0
- package/dist/ci-estate/page.d.ts.map +1 -0
- package/dist/ci-estate/page.js +233 -0
- package/dist/ci-estate/rows.d.ts +118 -0
- package/dist/ci-estate/rows.d.ts.map +1 -0
- package/dist/ci-estate/rows.js +126 -0
- package/dist/ci-estate.d.ts +68 -0
- package/dist/ci-estate.d.ts.map +1 -0
- package/dist/ci-estate.js +83 -0
- package/dist/ci-handover.d.ts +29 -5
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +50 -16
- package/dist/ci-identity.d.ts +89 -9
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +91 -16
- package/dist/ci-product-words.d.ts +290 -0
- package/dist/ci-product-words.d.ts.map +1 -0
- package/dist/ci-product-words.js +373 -0
- package/dist/ci-product.d.ts +82 -0
- package/dist/ci-product.d.ts.map +1 -0
- package/dist/ci-product.js +78 -0
- package/dist/cli/commands/audit.d.ts +2 -2
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +3 -2
- package/dist/cli/commands/carve.js +2 -2
- package/dist/cli/commands/import-index.d.ts +52 -0
- package/dist/cli/commands/import-index.d.ts.map +1 -0
- package/dist/cli/commands/import-index.js +226 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +4 -2
- package/dist/cli/handlers/agent.d.ts +17 -0
- package/dist/cli/handlers/agent.d.ts.map +1 -0
- package/dist/cli/handlers/agent.js +114 -0
- package/dist/cli/handlers/approve-confirm.d.ts +84 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -0
- package/dist/cli/handlers/approve-confirm.js +142 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +19 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +43 -1
- package/dist/cli/handlers/ci-check.d.ts +3 -0
- package/dist/cli/handlers/ci-check.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check.js +34 -0
- package/dist/cli/handlers/ci-forge-check.d.ts +3 -0
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -0
- package/dist/cli/handlers/ci-forge-check.js +89 -0
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +11 -2
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +20 -3
- package/dist/cli/handlers/gate-pending.d.ts +11 -0
- package/dist/cli/handlers/gate-pending.d.ts.map +1 -0
- package/dist/cli/handlers/gate-pending.js +44 -0
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +22 -4
- package/dist/cli/handlers/index-cloud.d.ts +14 -0
- package/dist/cli/handlers/index-cloud.d.ts.map +1 -0
- package/dist/cli/handlers/index-cloud.js +22 -0
- package/dist/cli/handlers/index-diff.d.ts +18 -0
- package/dist/cli/handlers/index-diff.d.ts.map +1 -0
- package/dist/cli/handlers/index-diff.js +142 -0
- package/dist/cli/handlers/init.d.ts.map +1 -1
- package/dist/cli/handlers/init.js +1 -0
- package/dist/cli/handlers/ledger.js +1 -1
- package/dist/cli/handlers/lifecycle-drift.d.ts +29 -0
- package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-drift.js +69 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +188 -28
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +64 -5
- package/dist/cli/handlers/misc.d.ts +9 -0
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/misc.js +77 -0
- package/dist/cli/handlers/notify-relay.d.ts +15 -0
- package/dist/cli/handlers/notify-relay.d.ts.map +1 -0
- package/dist/cli/handlers/notify-relay.js +130 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +42 -11
- package/dist/cli/handlers/pr.d.ts +38 -3
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +668 -207
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +110 -17
- package/dist/cli/handlers/query.d.ts.map +1 -1
- package/dist/cli/handlers/query.js +28 -4
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +3 -0
- package/dist/cli/handlers/run-wave.d.ts +8 -0
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +71 -1
- package/dist/cli/handlers/run.d.ts +6 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +86 -1
- package/dist/cli/handlers/scenario.d.ts.map +1 -1
- package/dist/cli/handlers/scenario.js +8 -7
- package/dist/cli/handlers/search.d.ts +34 -4
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +216 -36
- package/dist/cli/handlers/serve.d.ts.map +1 -1
- package/dist/cli/handlers/serve.js +10 -1
- package/dist/cli/main.d.ts +11 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +179 -14
- package/dist/cli/mcp/ledger-tools.d.ts +36 -0
- package/dist/cli/mcp/ledger-tools.d.ts.map +1 -0
- package/dist/cli/mcp/ledger-tools.js +122 -0
- package/dist/cli/mcp/lifecycle-tools.d.ts.map +1 -1
- package/dist/cli/mcp/lifecycle-tools.js +3 -2
- package/dist/cli/mcp/product-tools.d.ts +78 -0
- package/dist/cli/mcp/product-tools.d.ts.map +1 -0
- package/dist/cli/mcp/product-tools.js +93 -0
- package/dist/cli/mcp/read-only.d.ts +34 -0
- package/dist/cli/mcp/read-only.d.ts.map +1 -0
- package/dist/cli/mcp/read-only.js +61 -0
- package/dist/cli/mcp/report-tools.d.ts +48 -0
- package/dist/cli/mcp/report-tools.d.ts.map +1 -0
- package/dist/cli/mcp/report-tools.js +128 -0
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/resource-handlers.js +4 -3
- package/dist/cli/mcp/server.d.ts +28 -1
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/server.js +86 -15
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/mcp-config.d.ts +9 -2
- package/dist/cli/mcp-config.d.ts.map +1 -1
- package/dist/cli/mcp-config.js +8 -3
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +112 -5
- package/dist/cli/registry.d.ts +54 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/aws.d.ts +35 -0
- package/dist/cloud-lister/aws.d.ts.map +1 -0
- package/dist/cloud-lister/aws.js +203 -0
- package/dist/cloud-lister/azure.d.ts +34 -0
- package/dist/cloud-lister/azure.d.ts.map +1 -0
- package/dist/cloud-lister/azure.js +129 -0
- package/dist/cloud-lister/common.d.ts +40 -0
- package/dist/cloud-lister/common.d.ts.map +1 -0
- package/dist/cloud-lister/common.js +83 -0
- package/dist/cloud-lister/credentials.d.ts +50 -0
- package/dist/cloud-lister/credentials.d.ts.map +1 -0
- package/dist/cloud-lister/credentials.js +86 -0
- package/dist/cloud-lister/fakes.d.ts +27 -0
- package/dist/cloud-lister/fakes.d.ts.map +1 -0
- package/dist/cloud-lister/fakes.js +50 -0
- package/dist/cloud-lister/gcp.d.ts +42 -0
- package/dist/cloud-lister/gcp.d.ts.map +1 -0
- package/dist/cloud-lister/gcp.js +143 -0
- package/dist/cloud-lister/guard.d.ts +49 -0
- package/dist/cloud-lister/guard.d.ts.map +1 -0
- package/dist/cloud-lister/guard.js +103 -0
- package/dist/cloud-lister/ids.d.ts +23 -0
- package/dist/cloud-lister/ids.d.ts.map +1 -0
- package/dist/cloud-lister/ids.js +42 -0
- package/dist/cloud-lister/index.d.ts +67 -0
- package/dist/cloud-lister/index.d.ts.map +1 -0
- package/dist/cloud-lister/index.js +102 -0
- package/dist/cloud-lister/kubernetes.d.ts +64 -0
- package/dist/cloud-lister/kubernetes.d.ts.map +1 -0
- package/dist/cloud-lister/kubernetes.js +276 -0
- package/dist/cloud-lister/markers.d.ts +31 -0
- package/dist/cloud-lister/markers.d.ts.map +1 -0
- package/dist/cloud-lister/markers.js +73 -0
- package/dist/cloud-lister/mask.d.ts +31 -0
- package/dist/cloud-lister/mask.d.ts.map +1 -0
- package/dist/cloud-lister/mask.js +74 -0
- package/dist/cloud-lister/sigv4.d.ts +64 -0
- package/dist/cloud-lister/sigv4.d.ts.map +1 -0
- package/dist/cloud-lister/sigv4.js +104 -0
- package/dist/cloud-lister/transport.d.ts +55 -0
- package/dist/cloud-lister/transport.d.ts.map +1 -0
- package/dist/cloud-lister/transport.js +86 -0
- package/dist/cloud-lister/types.d.ts +121 -0
- package/dist/cloud-lister/types.d.ts.map +1 -0
- package/dist/cloud-lister/types.js +24 -0
- package/dist/components/adoption.d.ts +69 -0
- package/dist/components/adoption.d.ts.map +1 -0
- package/dist/components/adoption.js +93 -0
- package/dist/components/apply-lease.d.ts +19 -0
- package/dist/components/apply-lease.d.ts.map +1 -0
- package/dist/components/apply-lease.js +41 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.js +6 -0
- package/dist/components/capability-plugin.d.ts +9 -0
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/capability.d.ts +337 -5
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +14 -6
- package/dist/components/check-hooks.d.ts +113 -0
- package/dist/components/check-hooks.d.ts.map +1 -0
- package/dist/components/check-hooks.js +192 -0
- package/dist/components/ci-services.d.ts +57 -0
- package/dist/components/ci-services.d.ts.map +1 -0
- package/dist/components/ci-services.js +61 -0
- package/dist/components/cli-support.d.ts +34 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +67 -15
- package/dist/components/declared-reads.d.ts +38 -0
- package/dist/components/declared-reads.d.ts.map +1 -0
- package/dist/components/declared-reads.js +131 -0
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/deploy-units.js +4 -0
- package/dist/components/driver.d.ts +54 -4
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +90 -7
- package/dist/components/fan-out-run.d.ts +35 -1
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +138 -30
- package/dist/components/fan-out-support.d.ts +6 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out-support.js +4 -1
- package/dist/components/fan-out.d.ts +28 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/groups.d.ts +229 -0
- package/dist/components/groups.d.ts.map +1 -0
- package/dist/components/groups.js +777 -0
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/plan-shape-conformance.d.ts +48 -0
- package/dist/components/plan-shape-conformance.d.ts.map +1 -0
- package/dist/components/plan-shape-conformance.js +122 -0
- package/dist/components/pr-env-ledger.d.ts +32 -0
- package/dist/components/pr-env-ledger.d.ts.map +1 -0
- package/dist/components/pr-env-ledger.js +39 -0
- package/dist/components/pr-env-ports.d.ts +12 -0
- package/dist/components/pr-env-ports.d.ts.map +1 -1
- package/dist/components/pr-env-ports.js +13 -3
- package/dist/components/pr-env-run.d.ts +6 -0
- package/dist/components/pr-env-run.d.ts.map +1 -1
- package/dist/components/pr-env-run.js +3 -2
- package/dist/components/pr-environment.d.ts +31 -3
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +25 -7
- package/dist/components/pr-pipeline.d.ts +169 -3
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +184 -9
- package/dist/components/pr-policy.d.ts +26 -2
- package/dist/components/pr-policy.d.ts.map +1 -1
- package/dist/components/pr-policy.js +41 -7
- package/dist/components/pr-run.d.ts +104 -4
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +290 -41
- package/dist/components/pr-targets.d.ts +24 -0
- package/dist/components/pr-targets.d.ts.map +1 -0
- package/dist/components/pr-targets.js +48 -0
- package/dist/components/product-pipeline.d.ts +217 -0
- package/dist/components/product-pipeline.d.ts.map +1 -0
- package/dist/components/product-pipeline.js +193 -0
- package/dist/components/promote-rounds.d.ts +9 -0
- package/dist/components/promote-rounds.d.ts.map +1 -1
- package/dist/components/promote-rounds.js +23 -2
- package/dist/components/promote.d.ts +23 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +39 -6
- package/dist/components/release-compile.d.ts +22 -1
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +85 -0
- package/dist/components/release-gate.d.ts +23 -1
- package/dist/components/release-gate.d.ts.map +1 -1
- package/dist/components/release-gate.js +97 -33
- package/dist/components/release-promote.d.ts +15 -1
- package/dist/components/release-promote.d.ts.map +1 -1
- package/dist/components/release-promote.js +67 -2
- package/dist/components/repo-lock.d.ts +27 -0
- package/dist/components/repo-lock.d.ts.map +1 -0
- package/dist/components/repo-lock.js +49 -0
- package/dist/components/row-lease.d.ts +84 -0
- package/dist/components/row-lease.d.ts.map +1 -0
- package/dist/components/row-lease.js +110 -0
- package/dist/components/run-groups.d.ts +58 -0
- package/dist/components/run-groups.d.ts.map +1 -0
- package/dist/components/run-groups.js +78 -0
- package/dist/components/starter-plugin.d.ts +1 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/starter-plugin.js +6 -1
- package/dist/components/verbs/index.d.ts +1 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/index.js +1 -0
- package/dist/components/verbs/member-outputs.d.ts +187 -0
- package/dist/components/verbs/member-outputs.d.ts.map +1 -0
- package/dist/components/verbs/member-outputs.js +218 -0
- package/dist/components/wave-plan.d.ts +34 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +54 -2
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +27 -0
- package/dist/control/applied.d.ts +89 -0
- package/dist/control/applied.d.ts.map +1 -0
- package/dist/control/applied.js +175 -0
- package/dist/control/consumers.d.ts +78 -0
- package/dist/control/consumers.d.ts.map +1 -0
- package/dist/control/consumers.js +172 -0
- package/dist/control/dispatch.d.ts +334 -0
- package/dist/control/dispatch.d.ts.map +1 -0
- package/dist/control/dispatch.js +519 -0
- package/dist/control/edges.d.ts +75 -0
- package/dist/control/edges.d.ts.map +1 -0
- package/dist/control/edges.js +133 -0
- package/dist/control/reconcile.d.ts +120 -0
- package/dist/control/reconcile.d.ts.map +1 -0
- package/dist/control/reconcile.js +178 -0
- package/dist/control/records.d.ts +187 -0
- package/dist/control/records.d.ts.map +1 -0
- package/dist/control/records.js +307 -0
- package/dist/deep-observation.d.ts +1 -13
- package/dist/deep-observation.d.ts.map +1 -1
- package/dist/deep-observation.js +5 -22
- package/dist/discovery/sandbox/bundle.d.ts.map +1 -1
- package/dist/discovery/sandbox/bundle.js +25 -1
- package/dist/drift-record.d.ts +542 -0
- package/dist/drift-record.d.ts.map +1 -0
- package/dist/drift-record.js +886 -0
- package/dist/engine-facts.d.ts +144 -0
- package/dist/engine-facts.d.ts.map +1 -0
- package/dist/engine-facts.js +13 -0
- package/dist/exit-codes.d.ts +48 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +49 -0
- package/dist/forge-check/check.d.ts +63 -0
- package/dist/forge-check/check.d.ts.map +1 -0
- package/dist/forge-check/check.js +139 -0
- package/dist/forge-check/contract.d.ts +152 -0
- package/dist/forge-check/contract.d.ts.map +1 -0
- package/dist/forge-check/contract.js +118 -0
- package/dist/forge-check/forge.d.ts +42 -0
- package/dist/forge-check/forge.d.ts.map +1 -0
- package/dist/forge-check/forge.js +338 -0
- package/dist/forge-check/index.d.ts +24 -0
- package/dist/forge-check/index.d.ts.map +1 -0
- package/dist/forge-check/index.js +23 -0
- package/dist/forge-check/pulumi.d.ts +44 -0
- package/dist/forge-check/pulumi.d.ts.map +1 -0
- package/dist/forge-check/pulumi.js +184 -0
- package/dist/forge-check/read-only.d.ts +26 -0
- package/dist/forge-check/read-only.d.ts.map +1 -0
- package/dist/forge-check/read-only.js +53 -0
- package/dist/forge-check/trust.d.ts +94 -0
- package/dist/forge-check/trust.d.ts.map +1 -0
- package/dist/forge-check/trust.js +532 -0
- package/dist/forge-check/types.d.ts +80 -0
- package/dist/forge-check/types.d.ts.map +1 -0
- package/dist/forge-check/types.js +18 -0
- package/dist/forge-check.d.ts +6 -0
- package/dist/forge-check.d.ts.map +1 -0
- package/dist/forge-check.js +5 -0
- package/dist/gate-decision.d.ts +1 -0
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +2 -0
- package/dist/gate-policy.d.ts +47 -1
- package/dist/gate-policy.d.ts.map +1 -1
- package/dist/gate-policy.js +50 -2
- package/dist/graph-ir.d.ts +153 -2
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ir.js +224 -6
- package/dist/graph-refs.d.ts +145 -0
- package/dist/graph-refs.d.ts.map +1 -1
- package/dist/graph-refs.js +305 -0
- package/dist/graph-schema/fixtures/adopt.json +15 -0
- package/dist/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/dist/graph-schema/fixtures/index.json +68 -0
- package/dist/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/dist/graph-schema/fixtures.d.ts +23 -0
- package/dist/graph-schema/fixtures.d.ts.map +1 -0
- package/dist/graph-schema/fixtures.js +246 -0
- package/dist/graph-schema/generate.d.ts +15 -0
- package/dist/graph-schema/generate.d.ts.map +1 -0
- package/dist/graph-schema/generate.js +267 -0
- package/dist/graph-schema/graph.schema.json +1387 -0
- package/dist/health.schema.json +2 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/instance-nodes.d.ts +159 -0
- package/dist/instance-nodes.d.ts.map +1 -0
- package/dist/instance-nodes.js +231 -0
- package/dist/lexicon.d.ts +178 -6
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.d.ts +80 -0
- package/dist/lifecycle/adoption-file.d.ts.map +1 -0
- package/dist/lifecycle/adoption-file.js +122 -0
- package/dist/lifecycle/cloud-index.d.ts +186 -0
- package/dist/lifecycle/cloud-index.d.ts.map +1 -0
- package/dist/lifecycle/cloud-index.js +617 -0
- package/dist/lifecycle/derive-edges.d.ts +59 -0
- package/dist/lifecycle/derive-edges.d.ts.map +1 -0
- package/dist/lifecycle/derive-edges.js +126 -0
- package/dist/lifecycle/gate-applied.d.ts +6 -0
- package/dist/lifecycle/gate-applied.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +29 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +11 -1
- package/dist/lifecycle/gate-pending-by-plan.d.ts +75 -0
- package/dist/lifecycle/gate-pending-by-plan.d.ts.map +1 -0
- package/dist/lifecycle/gate-pending-by-plan.js +96 -0
- package/dist/lifecycle/gated-request-digest.d.ts +28 -0
- package/dist/lifecycle/gated-request-digest.d.ts.map +1 -0
- package/dist/lifecycle/gated-request-digest.js +35 -0
- package/dist/lifecycle/gated-request.d.ts +126 -0
- package/dist/lifecycle/gated-request.d.ts.map +1 -0
- package/dist/lifecycle/gated-request.js +205 -0
- package/dist/lifecycle/git.d.ts +10 -9
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +7 -1
- package/dist/lifecycle/identity-match.d.ts +148 -0
- package/dist/lifecycle/identity-match.d.ts.map +1 -0
- package/dist/lifecycle/identity-match.js +152 -0
- package/dist/lifecycle/index-diff.d.ts +264 -0
- package/dist/lifecycle/index-diff.d.ts.map +1 -0
- package/dist/lifecycle/index-diff.js +326 -0
- package/dist/lifecycle/index-document.d.ts +130 -0
- package/dist/lifecycle/index-document.d.ts.map +1 -0
- package/dist/lifecycle/index-document.js +188 -0
- package/dist/lifecycle/index-drift.d.ts +121 -0
- package/dist/lifecycle/index-drift.d.ts.map +1 -0
- package/dist/lifecycle/index-drift.js +178 -0
- package/dist/lifecycle/index-import.d.ts +171 -0
- package/dist/lifecycle/index-import.d.ts.map +1 -0
- package/dist/lifecycle/index-import.js +512 -0
- package/dist/lifecycle/index-join.d.ts +129 -0
- package/dist/lifecycle/index-join.d.ts.map +1 -0
- package/dist/lifecycle/index-join.js +248 -0
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/ledger-read.d.ts.map +1 -1
- package/dist/lifecycle/ledger-read.js +7 -3
- package/dist/lifecycle/lock-rows.d.ts +76 -0
- package/dist/lifecycle/lock-rows.d.ts.map +1 -0
- package/dist/lifecycle/lock-rows.js +140 -0
- package/dist/lifecycle/observation-baseline.d.ts +61 -21
- package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
- package/dist/lifecycle/observation-baseline.js +144 -19
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/observe.js +6 -1
- package/dist/lifecycle/query.d.ts +94 -6
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +182 -9
- package/dist/lifecycle/release-catalog-site.d.ts +66 -0
- package/dist/lifecycle/release-catalog-site.d.ts.map +1 -0
- package/dist/lifecycle/release-catalog-site.js +232 -0
- package/dist/lifecycle/release-catalog.d.ts +201 -0
- package/dist/lifecycle/release-catalog.d.ts.map +1 -0
- package/dist/lifecycle/release-catalog.js +198 -0
- package/dist/lifecycle/release-changelog.d.ts +41 -0
- package/dist/lifecycle/release-changelog.d.ts.map +1 -0
- package/dist/lifecycle/release-changelog.js +38 -0
- package/dist/lifecycle/release-cut.d.ts +1 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +1 -1
- package/dist/lifecycle/release-ledger.d.ts +16 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +10 -0
- package/dist/lifecycle/release-publish.d.ts +43 -22
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-read.d.ts.map +1 -1
- package/dist/lifecycle/release-read.js +3 -0
- package/dist/lifecycle/release-status.d.ts +86 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -0
- package/dist/lifecycle/release-status.js +136 -0
- package/dist/lifecycle/replay.d.ts +10 -3
- package/dist/lifecycle/replay.d.ts.map +1 -1
- package/dist/lifecycle/replay.js +10 -6
- package/dist/lifecycle/resource-lock.d.ts +120 -0
- package/dist/lifecycle/resource-lock.d.ts.map +1 -0
- package/dist/lifecycle/resource-lock.js +317 -0
- package/dist/lifecycle/retention.d.ts.map +1 -1
- package/dist/lifecycle/retention.js +3 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +9 -1
- package/dist/lifecycle/scenario.d.ts +4 -3
- package/dist/lifecycle/scenario.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store-fake.d.ts +9 -0
- package/dist/lifecycle/snapshot-store-fake.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-fake.js +21 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts +135 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-s3.js +219 -0
- package/dist/lifecycle/snapshot-store.d.ts +170 -0
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store.js +831 -0
- package/dist/lifecycle/snapshot.d.ts +11 -0
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.js +18 -5
- package/dist/lifecycle/target-lock.d.ts +15 -0
- package/dist/lifecycle/target-lock.d.ts.map +1 -1
- package/dist/lifecycle/target-lock.js +25 -10
- package/dist/lifecycle/type-listing.d.ts +148 -0
- package/dist/lifecycle/type-listing.d.ts.map +1 -0
- package/dist/lifecycle/type-listing.js +166 -0
- package/dist/lint/component-checks.d.ts +15 -1
- package/dist/lint/component-checks.d.ts.map +1 -1
- package/dist/lint/component-checks.js +1 -0
- package/dist/lint/presets/relaxed.json +2 -1
- package/dist/lint/presets/strict.json +2 -1
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.js +13 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.js +8 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts +33 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.js +123 -0
- package/dist/lint/rules/comp/index.d.ts +2 -1
- package/dist/lint/rules/comp/index.d.ts.map +1 -1
- package/dist/lint/rules/comp/index.js +4 -1
- package/dist/mcp/types.d.ts +7 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/notify-product.d.ts +43 -0
- package/dist/notify-product.d.ts.map +1 -0
- package/dist/notify-product.js +58 -0
- package/dist/notify-relay.d.ts +197 -0
- package/dist/notify-relay.d.ts.map +1 -0
- package/dist/notify-relay.js +321 -0
- package/dist/notify.d.ts +44 -4
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +77 -14
- package/dist/object-store/azure-blob.d.ts +129 -0
- package/dist/object-store/azure-blob.d.ts.map +1 -0
- package/dist/object-store/azure-blob.js +341 -0
- package/dist/object-store/common.d.ts +108 -0
- package/dist/object-store/common.d.ts.map +1 -0
- package/dist/object-store/common.js +80 -0
- package/dist/object-store/errors.d.ts +28 -0
- package/dist/object-store/errors.d.ts.map +1 -0
- package/dist/object-store/errors.js +21 -0
- package/dist/object-store/from-env.d.ts +18 -0
- package/dist/object-store/from-env.d.ts.map +1 -0
- package/dist/object-store/from-env.js +22 -0
- package/dist/object-store/gcs.d.ts +106 -0
- package/dist/object-store/gcs.d.ts.map +1 -0
- package/dist/object-store/gcs.js +393 -0
- package/dist/object-store/index.d.ts +9 -0
- package/dist/object-store/index.d.ts.map +1 -0
- package/dist/object-store/index.js +8 -0
- package/dist/object-store/s3.d.ts +146 -0
- package/dist/object-store/s3.d.ts.map +1 -0
- package/dist/object-store/s3.js +306 -0
- package/dist/observation.d.ts +19 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +18 -1
- package/dist/op/activities/activity-contracts.d.ts +1 -1
- package/dist/op/activities/activity-contracts.js +1 -1
- package/dist/op/activities/change-set.d.ts +6 -4
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +4 -2
- package/dist/op/activities/converge.d.ts.map +1 -1
- package/dist/op/activities/converge.js +2 -1
- package/dist/op/activities/index.d.ts +1 -1
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/index.js +1 -1
- package/dist/op/activities/review-agent.d.ts +55 -2
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +65 -5
- package/dist/op/activity-failure.d.ts +27 -0
- package/dist/op/activity-failure.d.ts.map +1 -1
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/gate.d.ts +29 -1
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +59 -23
- package/dist/op/generate-pipeline.d.ts.map +1 -1
- package/dist/op/generate-pipeline.js +7 -1
- package/dist/op/index.d.ts +14 -2
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +8 -2
- package/dist/op/local-executor.d.ts +5 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +22 -8
- package/dist/op/op-waves-after-plan.d.ts +137 -0
- package/dist/op/op-waves-after-plan.d.ts.map +1 -0
- package/dist/op/op-waves-after-plan.js +163 -0
- package/dist/op/op-waves-capability-spec.d.ts +55 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -0
- package/dist/op/op-waves-capability-spec.js +94 -0
- package/dist/op/op-waves-capability.d.ts +197 -0
- package/dist/op/op-waves-capability.d.ts.map +1 -0
- package/dist/op/op-waves-capability.js +311 -0
- package/dist/op/op-waves-events.d.ts +54 -0
- package/dist/op/op-waves-events.d.ts.map +1 -0
- package/dist/op/op-waves-events.js +122 -0
- package/dist/op/op-waves-notify.d.ts +7 -1
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +35 -16
- package/dist/op/op-waves-release-port.d.ts +18 -0
- package/dist/op/op-waves-release-port.d.ts.map +1 -0
- package/dist/op/op-waves-release-port.js +61 -0
- package/dist/op/op-waves-release.d.ts +92 -0
- package/dist/op/op-waves-release.d.ts.map +1 -0
- package/dist/op/op-waves-release.js +97 -0
- package/dist/op/op-waves-run.d.ts +175 -4
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +981 -41
- package/dist/op/op-waves-stand-down.d.ts +60 -0
- package/dist/op/op-waves-stand-down.d.ts.map +1 -0
- package/dist/op/op-waves-stand-down.js +97 -0
- package/dist/op/op-waves.d.ts +152 -8
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +161 -17
- package/dist/op/runtime.d.ts +91 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +19 -0
- package/dist/op/stage-hooks.d.ts +45 -7
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +61 -3
- package/dist/op/steward-beside.d.ts.map +1 -1
- package/dist/op/steward-beside.js +2 -1
- package/dist/op/types.d.ts +2 -2
- package/dist/op/types.d.ts.map +1 -1
- package/dist/op/types.js +3 -2
- package/dist/otlp-metrics.d.ts +38 -0
- package/dist/otlp-metrics.d.ts.map +1 -0
- package/dist/otlp-metrics.js +82 -0
- package/dist/otlp.d.ts +249 -0
- package/dist/otlp.d.ts.map +1 -0
- package/dist/otlp.js +426 -0
- package/dist/override-gate.d.ts.map +1 -1
- package/dist/override-gate.js +5 -0
- package/dist/policy-packs.d.ts +69 -0
- package/dist/policy-packs.d.ts.map +1 -0
- package/dist/policy-packs.js +205 -0
- package/dist/policy-source.d.ts +51 -0
- package/dist/policy-source.d.ts.map +1 -0
- package/dist/policy-source.js +103 -0
- package/dist/pr-forge.d.ts +40 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +92 -0
- package/dist/pr-loop.d.ts +205 -12
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +330 -41
- package/dist/pr-post.d.ts +16 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +26 -1
- package/dist/pr-report-url.d.ts +32 -4
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +46 -5
- package/dist/pr-requires.d.ts +13 -2
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +14 -0
- package/dist/pulumi-urn.d.ts +101 -0
- package/dist/pulumi-urn.d.ts.map +1 -0
- package/dist/pulumi-urn.js +131 -0
- package/dist/release-floors.d.ts +23 -0
- package/dist/release-floors.d.ts.map +1 -0
- package/dist/release-floors.js +22 -0
- package/dist/run-event.d.ts +26 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +4 -1
- package/dist/sensitive-key.d.ts +23 -0
- package/dist/sensitive-key.d.ts.map +1 -0
- package/dist/sensitive-key.js +31 -0
- package/dist/sorted-json.d.ts +10 -0
- package/dist/sorted-json.d.ts.map +1 -0
- package/dist/sorted-json.js +14 -0
- package/dist/terraform/credentials.d.ts +59 -0
- package/dist/terraform/credentials.d.ts.map +1 -0
- package/dist/terraform/credentials.js +149 -0
- package/dist/utils.d.ts +1 -4
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -9
- package/dist/wave-runtime.d.ts +1 -1
- package/dist/wave-runtime.js +2 -2
- package/dist/wave-runtime.mjs +390 -285
- package/dist/workspace/adoption-report.d.ts +53 -0
- package/dist/workspace/adoption-report.d.ts.map +1 -0
- package/dist/workspace/adoption-report.js +76 -0
- package/dist/workspace/capabilities-contract.d.ts +7 -0
- package/dist/workspace/capabilities-contract.d.ts.map +1 -1
- package/dist/workspace/capabilities-contract.js +2 -1
- package/dist/workspace/capabilities.schema.json +98 -0
- package/dist/workspace/change-set.schema.json +42 -3
- package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -1
- package/dist/workspace/chant-migrations/chud-lexicon-exit.js +4 -1
- package/dist/workspace/ci-cloud-identity.d.ts +13 -1
- package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
- package/dist/workspace/ci-cloud-identity.js +30 -1
- package/dist/workspace/ci-lock-grain.d.ts +12 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -0
- package/dist/workspace/ci-lock-grain.js +27 -0
- package/dist/workspace/ci-run.d.ts +2 -1
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +6 -3
- package/dist/workspace/compose-graph.d.ts +10 -1
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +6 -1
- package/dist/workspace/conformance/index.d.ts +1 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/index.js +6 -1
- package/dist/workspace/declaration.d.ts +16 -4
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +5 -2
- package/dist/workspace/declaration.schema.json +27 -3
- package/dist/workspace/drift-cli.d.ts +81 -0
- package/dist/workspace/drift-cli.d.ts.map +1 -0
- package/dist/workspace/drift-cli.js +322 -0
- package/dist/workspace/drift.schema.json +672 -0
- package/dist/workspace/exit-cli.d.ts +1 -1
- package/dist/workspace/exit-cli.d.ts.map +1 -1
- package/dist/workspace/exit-cli.js +2 -1
- package/dist/workspace/graph-cli.d.ts +2 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +3 -0
- package/dist/workspace/graph.schema.json +72 -0
- package/dist/workspace/import-fetch.d.ts +4 -2
- package/dist/workspace/import-fetch.d.ts.map +1 -1
- package/dist/workspace/import-fetch.js +4 -2
- package/dist/workspace/import-init.d.ts.map +1 -1
- package/dist/workspace/import-init.js +4 -2
- package/dist/workspace/init.d.ts +5 -1
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +55 -9
- package/dist/workspace/ledger.schema.json +7 -3
- package/dist/workspace/lineage-upgrade-cli.d.ts +1 -1
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade-cli.js +2 -1
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +125 -5
- package/dist/workspace/promote-waves.d.ts +112 -0
- package/dist/workspace/promote-waves.d.ts.map +1 -0
- package/dist/workspace/promote-waves.js +290 -0
- package/dist/workspace/promote.d.ts +85 -3
- package/dist/workspace/promote.d.ts.map +1 -1
- package/dist/workspace/promote.js +349 -62
- package/dist/workspace/reason-codes.d.ts +12 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +14 -0
- package/dist/workspace/records-cli.d.ts +2 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +3 -2
- package/dist/workspace/release-catalog.schema.json +277 -0
- package/dist/workspace/run-event.schema.json +18 -1
- package/dist/workspace/search-contract.d.ts +3 -3
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/search-contract.js +2 -0
- package/dist/workspace/search.schema.json +103 -5
- package/dist/workspace/work-cli.d.ts +3 -1
- package/dist/workspace/work-cli.d.ts.map +1 -1
- package/dist/workspace/work-cli.js +7 -2
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +34 -1
- package/src/__fixtures__/drift-record/README.md +58 -0
- package/src/__fixtures__/drift-record/choudoufu-cone.ndjson +4 -0
- package/src/__fixtures__/drift-record/choudoufu-resource.ndjson +3 -0
- package/src/__fixtures__/drift-record/component-status-ledger.json +65 -0
- package/src/__fixtures__/drift-record/component-status.json +91 -0
- package/src/__fixtures__/drift-record/deep-diff.json +259 -0
- package/src/__fixtures__/drift-record/lifecycle-diff-live.json +825 -0
- package/src/__fixtures__/drift-record/live-diff.json +125 -0
- package/src/__fixtures__/estate-ledger.ts +101 -0
- package/src/__fixtures__/oidc-emulator.ts +31 -2
- package/src/__fixtures__/product-words.ts +44 -0
- package/src/__golden__/wave-loop/op-by-apply-after-fails.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-hold.json +20 -4
- package/src/__golden__/wave-loop/op-by-apply-ignored.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-pass.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-skip.json +10 -2
- package/src/__golden__/wave-loop/op-discover-rest-stops.json +22 -6
- package/src/__golden__/wave-loop/op-discover-rest.json +44 -12
- package/src/__golden__/wave-loop/op-discover-wide.json +12 -3
- package/src/__golden__/wave-loop/op-held-on.json +28 -7
- package/src/__golden__/wave-loop/op-hooks-apply-fails.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-fail-after-apply.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-fail-before-apply.json +4 -2
- package/src/__golden__/wave-loop/op-hooks-held.json +26 -8
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +18 -4
- package/src/__golden__/wave-loop/op-hooks-pass.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-share.json +20 -7
- package/src/__golden__/wave-loop/op-outcome-held.json +12 -3
- package/src/__golden__/wave-loop/op-outcome-replan-approved.json +16 -5
- package/src/__golden__/wave-loop/op-outcome-replan-forever.json +48 -21
- package/src/__golden__/wave-loop/op-outcome-replan.json +16 -5
- package/src/__golden__/wave-loop/op-outcome-stood-down.json +12 -3
- package/src/__golden__/wave-loop/op-outcome-unreadable.json +12 -3
- package/src/__golden__/wave-loop/op-overridden.json +28 -7
- package/src/__golden__/wave-loop/op-per-run.json +20 -4
- package/src/__golden__/wave-loop/op-point.json +18 -4
- package/src/__golden__/wave-loop/op-pr-review.json +10 -2
- package/src/__golden__/wave-loop/op-spend-change-only.json +10 -2
- package/src/__golden__/wave-loop/op-spend.json +10 -2
- package/src/__golden__/wave-loop/op-wave-commands.json +56 -13
- package/src/__golden__/wave-loop/op-wide.json +20 -4
- package/src/audit/discover.e2e.test.ts +14 -0
- package/src/audit/discover.ts +3 -1
- package/src/behaviour.ts +1 -1
- package/src/bucket-check/azure.ts +307 -0
- package/src/bucket-check/bucket-check.test.ts +210 -0
- package/src/bucket-check/fixtures/azure.json +153 -0
- package/src/bucket-check/fixtures/gcs.json +148 -0
- package/src/bucket-check/fixtures/s3.json +277 -0
- package/src/bucket-check/gcs.ts +257 -0
- package/src/bucket-check/index.ts +61 -0
- package/src/bucket-check/s3.ts +433 -0
- package/src/bucket-check/types.ts +75 -0
- package/src/bucket-check/wire.ts +50 -0
- package/src/bucket-check.ts +5 -0
- package/src/capabilities/templates.json +145 -0
- package/src/capabilities/templates.test.ts +211 -0
- package/src/capabilities/templates.ts +203 -0
- package/src/cdk/advise.test.ts +1 -1
- package/src/change-set-bundle.test.ts +82 -0
- package/src/change-set-graph.ts +80 -9
- package/src/change-set.test.ts +24 -0
- package/src/change-set.ts +76 -14
- package/src/ci-agent.test.ts +348 -0
- package/src/ci-agent.ts +1026 -0
- package/src/ci-control.ts +174 -0
- package/src/ci-estate/delivery.ts +433 -0
- package/src/ci-estate/overdue.ts +81 -0
- package/src/ci-estate/page.ts +343 -0
- package/src/ci-estate/rows.ts +251 -0
- package/src/ci-estate.test.ts +281 -0
- package/src/ci-estate.ts +176 -0
- package/src/ci-handover.ts +67 -16
- package/src/ci-identity-database.test.ts +55 -0
- package/src/ci-identity-pulumi.test.ts +163 -0
- package/src/ci-identity-targets.test.ts +29 -2
- package/src/ci-identity.ts +134 -26
- package/src/ci-product-words.test.ts +101 -0
- package/src/ci-product-words.ts +536 -0
- package/src/ci-product.ts +174 -0
- package/src/ci-shared-reads.test.ts +145 -0
- package/src/cli/commands/audit.test.ts +1 -1
- package/src/cli/commands/audit.ts +3 -2
- package/src/cli/commands/carve.test.ts +1 -1
- package/src/cli/commands/carve.ts +2 -2
- package/src/cli/commands/import-index.test.ts +117 -0
- package/src/cli/commands/import-index.ts +265 -0
- package/src/cli/commands/init.ts +3 -1
- package/src/cli/commands/lint.ts +4 -2
- package/src/cli/component-wave-args.test.ts +16 -0
- package/src/cli/handlers/agent.ts +126 -0
- package/src/cli/handlers/approve-confirm.test.ts +276 -0
- package/src/cli/handlers/approve-confirm.ts +200 -0
- package/src/cli/handlers/approve.ts +18 -1
- package/src/cli/handlers/build.test.ts +7 -0
- package/src/cli/handlers/build.ts +44 -1
- package/src/cli/handlers/ci-check.ts +33 -0
- package/src/cli/handlers/ci-forge-check.ts +91 -0
- package/src/cli/handlers/components.test.ts +9 -0
- package/src/cli/handlers/components.ts +12 -2
- package/src/cli/handlers/fan-out.test.ts +10 -10
- package/src/cli/handlers/fan-out.ts +22 -3
- package/src/cli/handlers/gate-pending.ts +46 -0
- package/src/cli/handlers/graph.test.ts +42 -0
- package/src/cli/handlers/graph.ts +26 -4
- package/src/cli/handlers/index-cloud.ts +32 -0
- package/src/cli/handlers/index-diff.test.ts +68 -0
- package/src/cli/handlers/index-diff.ts +146 -0
- package/src/cli/handlers/init.ts +1 -0
- package/src/cli/handlers/ledger-root-member.test.ts +161 -0
- package/src/cli/handlers/ledger.ts +1 -1
- package/src/cli/handlers/lifecycle-drift.ts +73 -0
- package/src/cli/handlers/lifecycle.test.ts +33 -11
- package/src/cli/handlers/lifecycle.ts +205 -30
- package/src/cli/handlers/lock.test.ts +29 -2
- package/src/cli/handlers/lock.ts +66 -6
- package/src/cli/handlers/misc.ts +73 -0
- package/src/cli/handlers/notify-relay.ts +130 -0
- package/src/cli/handlers/pr-before-merge.test.ts +2 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +7 -7
- package/src/cli/handlers/pr-env.ts +48 -11
- package/src/cli/handlers/pr-plan-targets.test.ts +155 -0
- package/src/cli/handlers/pr-waves-blocked.test.ts +42 -2
- package/src/cli/handlers/pr-waves.test.ts +8 -2
- package/src/cli/handlers/pr.test.ts +8 -8
- package/src/cli/handlers/pr.ts +669 -207
- package/src/cli/handlers/promote.test.ts +69 -5
- package/src/cli/handlers/promote.ts +103 -8
- package/src/cli/handlers/query.ts +27 -4
- package/src/cli/handlers/release.ts +2 -0
- package/src/cli/handlers/run-components-exit.test.ts +7 -7
- package/src/cli/handlers/run-declared-reads-cli.test.ts +187 -0
- package/src/cli/handlers/run-groups-cli.test.ts +229 -0
- package/src/cli/handlers/run-wave.ts +65 -1
- package/src/cli/handlers/run.test.ts +6 -4
- package/src/cli/handlers/run.ts +86 -1
- package/src/cli/handlers/scenario.test.ts +13 -0
- package/src/cli/handlers/scenario.ts +8 -7
- package/src/cli/handlers/search-index.test.ts +255 -0
- package/src/cli/handlers/search-json.test.ts +1 -1
- package/src/cli/handlers/search-ownership.test.ts +194 -0
- package/src/cli/handlers/search.ts +271 -38
- package/src/cli/handlers/serve.ts +10 -1
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +182 -14
- package/src/cli/mcp/ledger-tools.ts +126 -0
- package/src/cli/mcp/lifecycle-tools.ts +3 -2
- package/src/cli/mcp/product-tools.test.ts +123 -0
- package/src/cli/mcp/product-tools.ts +129 -0
- package/src/cli/mcp/read-only.test.ts +134 -0
- package/src/cli/mcp/read-only.ts +68 -0
- package/src/cli/mcp/report-tools.ts +135 -0
- package/src/cli/mcp/resource-handlers.ts +4 -3
- package/src/cli/mcp/server.test.ts +5 -4
- package/src/cli/mcp/server.ts +90 -16
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/mcp-config.ts +8 -3
- package/src/cli/parse-args.ts +82 -4
- package/src/cli/registry.ts +54 -1
- package/src/cloud-lister/aws.test.ts +202 -0
- package/src/cloud-lister/aws.ts +226 -0
- package/src/cloud-lister/azure.test.ts +132 -0
- package/src/cloud-lister/azure.ts +142 -0
- package/src/cloud-lister/common.ts +115 -0
- package/src/cloud-lister/credentials.ts +110 -0
- package/src/cloud-lister/fakes.ts +66 -0
- package/src/cloud-lister/gcp.test.ts +121 -0
- package/src/cloud-lister/gcp.ts +159 -0
- package/src/cloud-lister/guard.test.ts +198 -0
- package/src/cloud-lister/guard.ts +111 -0
- package/src/cloud-lister/ids.ts +54 -0
- package/src/cloud-lister/index.ts +134 -0
- package/src/cloud-lister/kubernetes.test.ts +160 -0
- package/src/cloud-lister/kubernetes.ts +284 -0
- package/src/cloud-lister/markers.ts +74 -0
- package/src/cloud-lister/mask.ts +77 -0
- package/src/cloud-lister/shape.test.ts +81 -0
- package/src/cloud-lister/sigv4.ts +127 -0
- package/src/cloud-lister/transport.ts +118 -0
- package/src/cloud-lister/types.ts +135 -0
- package/src/components/adoption.test.ts +140 -0
- package/src/components/adoption.ts +141 -0
- package/src/components/apply-lease.ts +49 -0
- package/src/components/capability-plugin-loader.ts +4 -0
- package/src/components/capability-plugin.ts +10 -0
- package/src/components/capability.ts +359 -6
- package/src/components/check-hooks.test.ts +66 -0
- package/src/components/check-hooks.ts +252 -0
- package/src/components/ci-services.test.ts +51 -0
- package/src/components/ci-services.ts +83 -0
- package/src/components/cli-support.ts +92 -15
- package/src/components/declared-reads.test.ts +103 -0
- package/src/components/declared-reads.ts +134 -0
- package/src/components/deploy-units.ts +4 -0
- package/src/components/driver.test.ts +3 -3
- package/src/components/driver.ts +127 -9
- package/src/components/fan-out-run.ts +163 -33
- package/src/components/fan-out-support.ts +10 -1
- package/src/components/fan-out.ts +30 -0
- package/src/components/groups.test.ts +320 -0
- package/src/components/groups.ts +895 -0
- package/src/components/index.ts +42 -0
- package/src/components/plan-shape-conformance.ts +130 -0
- package/src/components/pr-comment-preview.test.ts +54 -0
- package/src/components/pr-env-ledger.test.ts +9 -0
- package/src/components/pr-env-ledger.ts +43 -0
- package/src/components/pr-env-ports.ts +29 -4
- package/src/components/pr-env-run-bundle.test.ts +10 -0
- package/src/components/pr-env-run.test.ts +19 -0
- package/src/components/pr-env-run.ts +12 -2
- package/src/components/pr-environment.test.ts +29 -0
- package/src/components/pr-environment.ts +39 -7
- package/src/components/pr-pipeline.test.ts +15 -0
- package/src/components/pr-pipeline.ts +274 -9
- package/src/components/pr-policy.ts +45 -7
- package/src/components/pr-run.test.ts +516 -3
- package/src/components/pr-run.ts +350 -44
- package/src/components/pr-targets.test.ts +35 -0
- package/src/components/pr-targets.ts +45 -0
- package/src/components/product-pipeline.test.ts +200 -0
- package/src/components/product-pipeline.ts +341 -0
- package/src/components/promote-rounds.ts +25 -2
- package/src/components/promote.ts +64 -5
- package/src/components/registry.test.ts +1 -1
- package/src/components/release-compile.ts +87 -1
- package/src/components/release-gate.ts +115 -30
- package/src/components/release-groups.test.ts +362 -0
- package/src/components/release-promote.ts +65 -1
- package/src/components/repo-lock.ts +52 -0
- package/src/components/row-lease.test.ts +490 -0
- package/src/components/row-lease.ts +167 -0
- package/src/components/run-groups.ts +113 -0
- package/src/components/starter-plugin.ts +6 -0
- package/src/components/verbs/index.ts +1 -0
- package/src/components/verbs/member-outputs.test.ts +205 -0
- package/src/components/verbs/member-outputs.ts +308 -0
- package/src/components/wave-plan-policy.test.ts +19 -0
- package/src/components/wave-plan.ts +78 -4
- package/src/config.ts +44 -0
- package/src/control/__fixtures__/consumers/apps/consumers.json +15 -0
- package/src/control/__fixtures__/consumers/infra/consumers.json +23 -0
- package/src/control/applied.test.ts +148 -0
- package/src/control/applied.ts +191 -0
- package/src/control/consumers.test.ts +129 -0
- package/src/control/consumers.ts +192 -0
- package/src/control/control.test.ts +302 -0
- package/src/control/dispatch.ts +699 -0
- package/src/control/edges.test.ts +112 -0
- package/src/control/edges.ts +164 -0
- package/src/control/note-checkout.test.ts +91 -0
- package/src/control/reconcile.ts +250 -0
- package/src/control/records.ts +395 -0
- package/src/deep-observation.ts +5 -23
- package/src/discovery/sandbox/bundle.ts +25 -1
- package/src/drift-record.test.ts +596 -0
- package/src/drift-record.ts +1206 -0
- package/src/engine-facts.guard.test.ts +111 -0
- package/src/engine-facts.test.ts +177 -0
- package/src/engine-facts.ts +153 -0
- package/src/exit-codes.test.ts +31 -0
- package/src/exit-codes.ts +55 -0
- package/src/forge-check/check.ts +155 -0
- package/src/forge-check/contract.ts +215 -0
- package/src/forge-check/forge-check.test.ts +427 -0
- package/src/forge-check/forge.ts +318 -0
- package/src/forge-check/index.ts +43 -0
- package/src/forge-check/pulumi.ts +192 -0
- package/src/forge-check/read-only.ts +56 -0
- package/src/forge-check/trust.ts +527 -0
- package/src/forge-check/types.ts +78 -0
- package/src/forge-check.ts +5 -0
- package/src/gate-decision-bundle.test.ts +13 -0
- package/src/gate-decision.ts +3 -0
- package/src/gate-policy.ts +92 -3
- package/src/gated-waves-bundle.test.ts +1 -0
- package/src/graph-ir-live.test.ts +92 -0
- package/src/graph-ir.ts +317 -7
- package/src/graph-refs.ts +416 -0
- package/src/graph-schema/fixtures/adopt.json +15 -0
- package/src/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/src/graph-schema/fixtures/index.json +68 -0
- package/src/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/src/graph-schema/fixtures.ts +267 -0
- package/src/graph-schema/generate.ts +263 -0
- package/src/graph-schema/graph-schema.test.ts +153 -0
- package/src/graph-schema/graph.schema.json +1387 -0
- package/src/health.schema.json +2 -1
- package/src/identity.ts +2 -0
- package/src/index.ts +4 -0
- package/src/instance-nodes.ts +288 -0
- package/src/lexicon.ts +171 -6
- package/src/lifecycle/__fixtures__/index-diff/20261026T120000Z-aaaaaaaaaaaa.json +149 -0
- package/src/lifecycle/__fixtures__/index-diff/20261026T130000Z-bbbbbbbbbbbb.json +127 -0
- package/src/lifecycle/adoption-file.test.ts +100 -0
- package/src/lifecycle/adoption-file.ts +153 -0
- package/src/lifecycle/cloud-index.test.ts +516 -0
- package/src/lifecycle/cloud-index.ts +735 -0
- package/src/lifecycle/control-entries-ledger.test.ts +70 -0
- package/src/lifecycle/derive-edges.test.ts +193 -0
- package/src/lifecycle/derive-edges.ts +182 -0
- package/src/lifecycle/gate-applied.ts +6 -0
- package/src/lifecycle/gate-ledger.ts +36 -1
- package/src/lifecycle/gate-pending-by-plan.test.ts +69 -0
- package/src/lifecycle/gate-pending-by-plan.ts +133 -0
- package/src/lifecycle/gated-request-digest.ts +49 -0
- package/src/lifecycle/gated-request-ledger.test.ts +53 -0
- package/src/lifecycle/gated-request.ts +280 -0
- package/src/lifecycle/git.ts +10 -4
- package/src/lifecycle/identity-match.test.ts +308 -0
- package/src/lifecycle/identity-match.ts +276 -0
- package/src/lifecycle/index-diff.test.ts +198 -0
- package/src/lifecycle/index-diff.ts +475 -0
- package/src/lifecycle/index-document.test.ts +64 -0
- package/src/lifecycle/index-document.ts +298 -0
- package/src/lifecycle/index-drift.test.ts +191 -0
- package/src/lifecycle/index-drift.ts +304 -0
- package/src/lifecycle/index-import.test.ts +269 -0
- package/src/lifecycle/index-import.ts +654 -0
- package/src/lifecycle/index-join.test.ts +250 -0
- package/src/lifecycle/index-join.ts +304 -0
- package/src/lifecycle/index-store-load-bearing.test.ts +187 -0
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/ledger-read.ts +7 -3
- package/src/lifecycle/lock-rows.test.ts +109 -0
- package/src/lifecycle/lock-rows.ts +167 -0
- package/src/lifecycle/member-ledger.test.ts +25 -7
- package/src/lifecycle/observation-baseline.test.ts +72 -1
- package/src/lifecycle/observation-baseline.ts +190 -27
- package/src/lifecycle/observe.ts +6 -1
- package/src/lifecycle/publish-target-context.test.ts +108 -0
- package/src/lifecycle/query.test.ts +68 -1
- package/src/lifecycle/query.ts +208 -13
- package/src/lifecycle/release-catalog-site.test.ts +142 -0
- package/src/lifecycle/release-catalog-site.ts +291 -0
- package/src/lifecycle/release-catalog.test.ts +193 -0
- package/src/lifecycle/release-catalog.ts +353 -0
- package/src/lifecycle/release-changelog.test.ts +70 -0
- package/src/lifecycle/release-changelog.ts +71 -0
- package/src/lifecycle/release-cut.ts +2 -2
- package/src/lifecycle/release-ledger.ts +20 -0
- package/src/lifecycle/release-publish.ts +45 -22
- package/src/lifecycle/release-read.ts +2 -0
- package/src/lifecycle/release-status.test.ts +186 -0
- package/src/lifecycle/release-status.ts +176 -0
- package/src/lifecycle/replay.test.ts +9 -5
- package/src/lifecycle/replay.ts +9 -5
- package/src/lifecycle/resource-lock.test.ts +175 -0
- package/src/lifecycle/resource-lock.ts +354 -0
- package/src/lifecycle/retention.ts +2 -0
- package/src/lifecycle/run-ledger.ts +7 -1
- package/src/lifecycle/scenario.ts +4 -3
- package/src/lifecycle/snapshot-store-fake.ts +29 -0
- package/src/lifecycle/snapshot-store-s3.ts +280 -0
- package/src/lifecycle/snapshot-store.test.ts +385 -0
- package/src/lifecycle/snapshot-store.ts +980 -0
- package/src/lifecycle/snapshot.test.ts +13 -0
- package/src/lifecycle/snapshot.ts +23 -6
- package/src/lifecycle/target-lock.ts +24 -9
- package/src/lifecycle/type-listing.test.ts +166 -0
- package/src/lifecycle/type-listing.ts +309 -0
- package/src/lint/component-checks.ts +17 -1
- package/src/lint/config.test.ts +3 -0
- package/src/lint/presets/relaxed.json +2 -1
- package/src/lint/presets/strict.json +2 -1
- package/src/lint/rules/__fixtures__/comp/comp008/fail/dns.component.ts +15 -0
- package/src/lint/rules/__fixtures__/comp/comp008/pass/dns.component.ts +10 -0
- package/src/lint/rules/comp/comp.test.ts +2 -1
- package/src/lint/rules/comp/comp008-applies-signal-only-root.ts +121 -0
- package/src/lint/rules/comp/comp008.test.ts +77 -0
- package/src/lint/rules/comp/index.ts +4 -1
- package/src/mcp/types.ts +7 -0
- package/src/notify-product.ts +76 -0
- package/src/notify-relay.test.ts +213 -0
- package/src/notify-relay.ts +407 -0
- package/src/notify.ts +95 -14
- package/src/object-store/azure-blob.ts +374 -0
- package/src/object-store/common.ts +133 -0
- package/src/object-store/errors.ts +26 -0
- package/src/object-store/from-env.ts +36 -0
- package/src/object-store/gcs.ts +436 -0
- package/src/object-store/index.ts +8 -0
- package/src/object-store/object-store.test.ts +130 -0
- package/src/object-store/s3.ts +350 -0
- package/src/observation-edges.test.ts +33 -0
- package/src/observation.ts +36 -1
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +8 -5
- package/src/op/activities/converge.ts +2 -1
- package/src/op/activities/index.ts +1 -1
- package/src/op/activities/review-agent.open.test.ts +78 -0
- package/src/op/activities/review-agent.test.ts +13 -0
- package/src/op/activities/review-agent.ts +89 -5
- package/src/op/activity-failure.ts +36 -0
- package/src/op/gate.ts +81 -22
- package/src/op/generate-pipeline.ts +7 -1
- package/src/op/index.ts +23 -1
- package/src/op/local-executor.test.ts +80 -0
- package/src/op/local-executor.ts +27 -9
- package/src/op/op-waves-after-plan.test.ts +276 -0
- package/src/op/op-waves-after-plan.ts +238 -0
- package/src/op/op-waves-capability-spec.ts +113 -0
- package/src/op/op-waves-capability.test.ts +217 -0
- package/src/op/op-waves-capability.ts +370 -0
- package/src/op/op-waves-events.ts +135 -0
- package/src/op/op-waves-notify-words.test.ts +149 -0
- package/src/op/op-waves-notify.ts +41 -16
- package/src/op/op-waves-pull-request.test.ts +142 -0
- package/src/op/op-waves-release-port.ts +64 -0
- package/src/op/op-waves-release.test.ts +209 -0
- package/src/op/op-waves-release.ts +133 -0
- package/src/op/op-waves-run-record.test.ts +32 -0
- package/src/op/op-waves-run.ts +1142 -49
- package/src/op/op-waves-stand-down.test.ts +240 -0
- package/src/op/op-waves-stand-down.ts +108 -0
- package/src/op/op-waves-trace.test.ts +205 -0
- package/src/op/op-waves.test.ts +112 -0
- package/src/op/op-waves.ts +261 -20
- package/src/op/runtime.ts +104 -0
- package/src/op/stage-hooks-hold-record.test.ts +41 -0
- package/src/op/stage-hooks.ts +91 -12
- package/src/op/steward-beside.ts +2 -1
- package/src/op/types.ts +3 -2
- package/src/otlp-metrics.ts +96 -0
- package/src/otlp.test.ts +243 -0
- package/src/otlp.ts +544 -0
- package/src/override-gate-bundle.test.ts +2 -0
- package/src/override-gate.ts +4 -0
- package/src/policy-packs.ts +230 -0
- package/src/policy-source.test.ts +256 -0
- package/src/policy-source.ts +112 -0
- package/src/pr-forge.ts +123 -0
- package/src/pr-loop-bundle.test.ts +9 -2
- package/src/pr-loop-words.test.ts +155 -0
- package/src/pr-loop.test.ts +43 -0
- package/src/pr-loop.ts +478 -50
- package/src/pr-post.ts +32 -1
- package/src/pr-report-url.ts +62 -6
- package/src/pr-requires.test.ts +37 -1
- package/src/pr-requires.ts +16 -2
- package/src/product-subpaths-plain-node.e2e.test.ts +211 -0
- package/src/pulumi-urn.ts +151 -0
- package/src/release-floors.ts +22 -0
- package/src/run-event.ts +29 -1
- package/src/sensitive-key.ts +34 -0
- package/src/sorted-json.ts +17 -0
- package/src/stage-hooks-bundle.test.ts +8 -0
- package/src/terraform/credentials.test.ts +77 -0
- package/src/terraform/credentials.ts +162 -0
- package/src/utils.ts +2 -11
- package/src/wave-loop-golden.test.ts +2 -1
- package/src/wave-runtime.ts +2 -2
- package/src/workspace/adoption-report.test.ts +61 -0
- package/src/workspace/adoption-report.ts +103 -0
- package/src/workspace/capabilities-contract.test.ts +4 -0
- package/src/workspace/capabilities-contract.ts +9 -1
- package/src/workspace/capabilities.schema.json +98 -0
- package/src/workspace/change-set.schema.json +42 -3
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +4 -1
- package/src/workspace/ci-cloud-identity.ts +31 -1
- package/src/workspace/ci-lock-grain.test.ts +31 -0
- package/src/workspace/ci-lock-grain.ts +30 -0
- package/src/workspace/ci-report-url.test.ts +1 -1
- package/src/workspace/ci-run.test.ts +1 -1
- package/src/workspace/ci-run.ts +6 -3
- package/src/workspace/compose-graph.test.ts +12 -0
- package/src/workspace/compose-graph.ts +12 -1
- package/src/workspace/conformance/conformance.e2e.test.ts +2 -1
- package/src/workspace/conformance/index.ts +6 -1
- package/src/workspace/declaration.schema.json +27 -3
- package/src/workspace/declaration.test.ts +1 -1
- package/src/workspace/declaration.ts +26 -10
- package/src/workspace/drift-cli.test.ts +65 -0
- package/src/workspace/drift-cli.ts +370 -0
- package/src/workspace/drift.schema.json +672 -0
- package/src/workspace/exit-cli.ts +2 -1
- package/src/workspace/graph-cli.ts +5 -0
- package/src/workspace/graph.schema.json +72 -0
- package/src/workspace/import-fetch.ts +4 -2
- package/src/workspace/import-init.ts +4 -2
- package/src/workspace/init.test.ts +38 -1
- package/src/workspace/init.ts +50 -8
- package/src/workspace/intent-gaps.test.ts +18 -2
- package/src/workspace/ledger.schema.json +7 -3
- package/src/workspace/lineage-upgrade-cli.ts +2 -1
- package/src/workspace/nested-graph.ts +1 -0
- package/src/workspace/pr-report.schema.json +125 -5
- package/src/workspace/promote-waves.test.ts +296 -0
- package/src/workspace/promote-waves.ts +340 -0
- package/src/workspace/promote.test.ts +158 -4
- package/src/workspace/promote.ts +400 -58
- package/src/workspace/reason-codes.test.ts +4 -1
- package/src/workspace/reason-codes.ts +14 -0
- package/src/workspace/records-cli.ts +3 -2
- package/src/workspace/release-catalog.schema.json +277 -0
- package/src/workspace/run-event.schema.json +18 -1
- package/src/workspace/search-contract.ts +2 -0
- package/src/workspace/search.schema.json +103 -5
- package/src/workspace/work-cli.ts +8 -2
- package/src/workspace/workspace-run.ts +2 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy packs read at base (#4613): the CrossGuard packs a Pulumi preview
|
|
3
|
+
* runs, copied out of the commit the change is measured from, as the Rego of
|
|
4
|
+
* `ci.policy` is (`./components/pr-policy.ts`). A pull request cannot loosen
|
|
5
|
+
* or delete a pack that judges it, nor its `--policy-pack-config` file.
|
|
6
|
+
*
|
|
7
|
+
* Two lists meet here:
|
|
8
|
+
*
|
|
9
|
+
* - `ci.policy.packs` in the declaration at base: each `dir` relative to the
|
|
10
|
+
* declaration's directory, or to the top of `ci.policy.source` when one is
|
|
11
|
+
* set. A listed pack that is not there is an error, and the preview does
|
|
12
|
+
* not run: a pack the base requires is never skipped.
|
|
13
|
+
* - The step's own packs (`pulumi-up`'s `policyPacks`), from the step input
|
|
14
|
+
* the head's component file gives. Each one inside the repository is
|
|
15
|
+
* copied from base. One the base does not have was added by the change and
|
|
16
|
+
* runs once it merges; one that differs on the head runs as the base has
|
|
17
|
+
* it. Each case is a note. A pack outside the repository (an install the
|
|
18
|
+
* job's image holds) is no part of the change and runs where it is.
|
|
19
|
+
*
|
|
20
|
+
* A copy holds the files git tracks. A pack's installed dependencies are
|
|
21
|
+
* not policy, so when the checkout's pack directory has `node_modules`,
|
|
22
|
+
* `venv` or `.venv`, the copy links to it.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
26
|
+
import { existsSync, mkdirSync, mkdtempSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
27
|
+
import { tmpdir } from "node:os";
|
|
28
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
29
|
+
import type { GatePolicyPack } from "./gate-policy";
|
|
30
|
+
import type { ResolvedGatePolicySource } from "./policy-source";
|
|
31
|
+
import { gitTop, gitTree, resolveCommit, type WorkspaceTree } from "./workspace/tree";
|
|
32
|
+
|
|
33
|
+
/** One pack as the preview runs it: copied from base, or outside the repository as it stands. */
|
|
34
|
+
export interface PolicyPackAtBase {
|
|
35
|
+
/** The directory the engine reads. */
|
|
36
|
+
dir: string;
|
|
37
|
+
/** The `--policy-pack-config` file the engine reads. */
|
|
38
|
+
config?: string;
|
|
39
|
+
/** Where the pack came from, for notes and the plan: `ci.policy.packs` or the step. */
|
|
40
|
+
from: "declaration" | "step";
|
|
41
|
+
/** The pack as named: its path in the repository or the source, or the absolute path outside it. */
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The packs a preview runs, the lines saying what changed hands, and how to remove the copies. */
|
|
46
|
+
export interface PolicyPacksAtBase {
|
|
47
|
+
/** The commit the packs were read at. */
|
|
48
|
+
base: string;
|
|
49
|
+
packs: PolicyPackAtBase[];
|
|
50
|
+
/** One line per step pack that was left out or read from base in place of the head's copy. */
|
|
51
|
+
notes: string[];
|
|
52
|
+
/** The shared source `ci.policy.packs` was read from, with its commit. */
|
|
53
|
+
source?: ResolvedGatePolicySource;
|
|
54
|
+
/** The scratch directory holding the copies. */
|
|
55
|
+
scratch: string;
|
|
56
|
+
cleanup: () => void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface PolicyPacksAtBaseOptions {
|
|
60
|
+
/** Where the step runs: the stack's directory. The workspace and its repository are found from here. */
|
|
61
|
+
cwd: string;
|
|
62
|
+
/** The commit the caller reads policy at, `DeployContext.policyBase`. */
|
|
63
|
+
base: string;
|
|
64
|
+
/** The step's packs, each `dir` and `config` absolute or relative to `cwd`. */
|
|
65
|
+
stepPacks?: readonly GatePolicyPack[];
|
|
66
|
+
/** Where the scratch directory goes, such as the step's own scratch, which then removes the copies with it. Default the OS temp dir. */
|
|
67
|
+
tmp?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const posix = (p: string): string => p.split("\\").join("/");
|
|
71
|
+
const LINKED = ["node_modules", "venv", ".venv"];
|
|
72
|
+
|
|
73
|
+
/** Whether the working tree's `rel` (under `top`) differs from `commit`'s, tracked or untracked. */
|
|
74
|
+
function differsOnHead(top: string, commit: string, rel: string): boolean {
|
|
75
|
+
const diff = spawnSync("git", ["-C", top, "diff", "--quiet", commit, "--", rel], { stdio: "ignore" });
|
|
76
|
+
if (diff.status !== 0) return true;
|
|
77
|
+
try {
|
|
78
|
+
return execFileSync("git", ["-C", top, "ls-files", "--others", "--exclude-standard", "--", rel], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim() !== "";
|
|
79
|
+
} catch {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Link the installs a checkout's pack directory holds into its copy. */
|
|
85
|
+
function linkInstalls(copy: string, checkoutDir: string | undefined): void {
|
|
86
|
+
if (!checkoutDir) return;
|
|
87
|
+
for (const name of LINKED) {
|
|
88
|
+
const there = join(checkoutDir, name);
|
|
89
|
+
if (existsSync(there) && !existsSync(join(copy, name))) {
|
|
90
|
+
try {
|
|
91
|
+
symlinkSync(there, join(copy, name), "dir");
|
|
92
|
+
} catch {
|
|
93
|
+
// A pack that cannot see its installs fails in the engine, which names it.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let copied = 0;
|
|
100
|
+
|
|
101
|
+
/** Copy directory `from` of `tree` to `to` on disk. */
|
|
102
|
+
function copyTree(tree: WorkspaceTree, from: string, to: string): void {
|
|
103
|
+
mkdirSync(to, { recursive: true });
|
|
104
|
+
for (const entry of tree.list(from) ?? []) {
|
|
105
|
+
const src = from === "" ? entry.name : `${from}/${entry.name}`;
|
|
106
|
+
const dest = join(to, entry.name);
|
|
107
|
+
if (entry.type === "dir") copyTree(tree, src, dest);
|
|
108
|
+
else writeFileSync(dest, tree.bytes ? tree.bytes(src) : tree.read(src));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Copy one file out of `tree` into `dir`, keeping its name. */
|
|
113
|
+
function copyFile(tree: WorkspaceTree, path: string, dir: string): string {
|
|
114
|
+
const out = join(dir, `${copied++}-${path.split("/").pop()!}`);
|
|
115
|
+
writeFileSync(out, tree.bytes ? tree.bytes(path) : tree.read(path));
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The packs a preview at `cwd` runs, read at `base`: `ci.policy.packs` from
|
|
121
|
+
* the declaration (or its source) and the step's own, each copied from
|
|
122
|
+
* there. Returns why none can be read when the base or the source cannot
|
|
123
|
+
* be, or a pack `ci.policy.packs` lists is missing.
|
|
124
|
+
*/
|
|
125
|
+
export async function policyPacksAtBase(options: PolicyPacksAtBaseOptions): Promise<PolicyPacksAtBase | { error: string }> {
|
|
126
|
+
const cwd = resolve(options.cwd);
|
|
127
|
+
const top = gitTop(cwd);
|
|
128
|
+
if (!top) return { error: `policy packs are read at base ${options.base.slice(0, 12)}, and ${cwd} is not in a git repository` };
|
|
129
|
+
const commit = resolveCommit(top, options.base);
|
|
130
|
+
if (!commit) return { error: `policy packs are read at base, and ${options.base} names no commit in ${top}` };
|
|
131
|
+
const scratch = mkdtempSync(join(options.tmp ?? tmpdir(), "chant-policy-packs-"));
|
|
132
|
+
const cleanup = (): void => rmSync(scratch, { recursive: true, force: true });
|
|
133
|
+
const fail = (error: string): { error: string } => {
|
|
134
|
+
cleanup();
|
|
135
|
+
return { error };
|
|
136
|
+
};
|
|
137
|
+
const packs: PolicyPackAtBase[] = [];
|
|
138
|
+
const notes: string[] = [];
|
|
139
|
+
const realCwd = realpathSync(cwd);
|
|
140
|
+
const whole = gitTree(top, commit);
|
|
141
|
+
const export1 = (tree: WorkspaceTree, path: string): string | { error: string } => {
|
|
142
|
+
const into = join(scratch, `pack-${packs.length}-${path.split("/").pop() || "root"}`);
|
|
143
|
+
try {
|
|
144
|
+
copyTree(tree, path, into);
|
|
145
|
+
} catch (err) {
|
|
146
|
+
return { error: `the policy pack ${path} could not be read: ${err instanceof Error ? err.message : String(err)}` };
|
|
147
|
+
}
|
|
148
|
+
return into;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// ci.policy.packs, from the declaration at base or its source.
|
|
152
|
+
let source: ResolvedGatePolicySource | undefined;
|
|
153
|
+
const taken = new Set<string>();
|
|
154
|
+
try {
|
|
155
|
+
const { prLoopPolicyAt } = await import("./components/pr-policy");
|
|
156
|
+
const read = prLoopPolicyAt(cwd, commit);
|
|
157
|
+
const declared = read.settings?.packs ?? [];
|
|
158
|
+
if (declared.length > 0) {
|
|
159
|
+
if (read.error !== undefined) return fail(read.error);
|
|
160
|
+
if (!read.tree) return fail(`ci.policy.packs at ${commit.slice(0, 12)} could not be read`);
|
|
161
|
+
source = read.source;
|
|
162
|
+
const { locateWorkspace } = await import("./workspace/which-chant");
|
|
163
|
+
const located = locateWorkspace(cwd, commit);
|
|
164
|
+
const where = source ? `${source.repo}@${source.ref} (${source.commit.slice(0, 12)})` : `the declaration at ${commit.slice(0, 12)}`;
|
|
165
|
+
for (const p of declared) {
|
|
166
|
+
const dir = p.dir.replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
167
|
+
if (read.tree.stat(dir) !== "dir") return fail(`ci.policy.packs names ${p.dir}, which is not a directory in ${where}`);
|
|
168
|
+
const copy = export1(read.tree, dir);
|
|
169
|
+
if (typeof copy !== "string") return fail(copy.error);
|
|
170
|
+
let config: string | undefined;
|
|
171
|
+
if (p.config) {
|
|
172
|
+
if (read.tree.stat(p.config) !== "file") return fail(`ci.policy.packs names the config ${p.config}, which is not a file in ${where}`);
|
|
173
|
+
config = copyFile(read.tree, p.config, scratch);
|
|
174
|
+
}
|
|
175
|
+
// A pack in the workspace links the checkout's installs; one from the source has none here.
|
|
176
|
+
const checkoutDir = source ? undefined : join(located.rootOnDisk, dir);
|
|
177
|
+
linkInstalls(copy, checkoutDir);
|
|
178
|
+
if (!source) taken.add(posix(join(located.root === "." ? "" : located.root, dir)));
|
|
179
|
+
packs.push({ dir: copy, ...(config ? { config } : {}), from: "declaration", name: dir });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
} catch (err) {
|
|
183
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// The step's own packs, each from base when it is in the repository.
|
|
187
|
+
for (const p of options.stepPacks ?? []) {
|
|
188
|
+
const abs = isAbsolute(p.dir) ? p.dir : resolve(cwd, p.dir);
|
|
189
|
+
let real: string;
|
|
190
|
+
try {
|
|
191
|
+
real = realpathSync(abs);
|
|
192
|
+
} catch {
|
|
193
|
+
real = abs;
|
|
194
|
+
}
|
|
195
|
+
const rel = posix(relative(top, real));
|
|
196
|
+
if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) {
|
|
197
|
+
packs.push({ dir: abs, ...(p.config ? { config: isAbsolute(p.config) ? p.config : resolve(cwd, p.config) } : {}), from: "step", name: abs });
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (taken.has(rel)) continue;
|
|
201
|
+
const shown = posix(relative(realCwd, real)) || ".";
|
|
202
|
+
if (whole.stat(rel) !== "dir") {
|
|
203
|
+
notes.push(`the policy pack ${shown} is not at base ${commit.slice(0, 12)}, so it runs once this change merges`);
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (differsOnHead(top, commit, rel)) notes.push(`the policy pack ${shown} differs on this change; the copy at base ${commit.slice(0, 12)} runs`);
|
|
207
|
+
const copy = export1(whole, rel);
|
|
208
|
+
if (typeof copy !== "string") return fail(copy.error);
|
|
209
|
+
linkInstalls(copy, real);
|
|
210
|
+
let config: string | undefined;
|
|
211
|
+
if (p.config) {
|
|
212
|
+
const cabs = isAbsolute(p.config) ? p.config : resolve(cwd, p.config);
|
|
213
|
+
let creal: string;
|
|
214
|
+
try {
|
|
215
|
+
creal = realpathSync(cabs);
|
|
216
|
+
} catch {
|
|
217
|
+
creal = cabs;
|
|
218
|
+
}
|
|
219
|
+
const crel = posix(relative(top, creal));
|
|
220
|
+
if (crel.startsWith("..") || isAbsolute(crel)) config = cabs;
|
|
221
|
+
else if (whole.stat(crel) !== "file") notes.push(`the policy pack config ${posix(relative(realCwd, creal))} is not at base ${commit.slice(0, 12)}, so ${shown} runs with its own defaults`);
|
|
222
|
+
else {
|
|
223
|
+
if (differsOnHead(top, commit, crel)) notes.push(`the policy pack config ${posix(relative(realCwd, creal))} differs on this change; the copy at base ${commit.slice(0, 12)} runs`);
|
|
224
|
+
config = copyFile(whole, crel, scratch);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
packs.push({ dir: copy, ...(config ? { config } : {}), from: "step", name: rel });
|
|
228
|
+
}
|
|
229
|
+
return { base: commit, packs, notes, ...(source ? { source } : {}), scratch, cleanup };
|
|
230
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ci.policy.source` and policy packs read at base (#4613). The shared
|
|
3
|
+
* policy repository is a local bare repository reached through file://, so
|
|
4
|
+
* nothing reaches a network. The engine is a fake that reads the policy
|
|
5
|
+
* directory it is handed and prints opa's result shape, so a test sees which
|
|
6
|
+
* copy of a rule judged the change.
|
|
7
|
+
*/
|
|
8
|
+
import { afterAll, describe, expect, test } from "vitest";
|
|
9
|
+
import { execFileSync } from "node:child_process";
|
|
10
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { tmpdir } from "node:os";
|
|
13
|
+
import { composeChangeSet } from "./change-set";
|
|
14
|
+
import { assertGatePolicySettings, type GatePolicyExec } from "./gate-policy";
|
|
15
|
+
import { assertGatePolicySource, fetchGatePolicySource, shownPolicyRepo } from "./policy-source";
|
|
16
|
+
import { policyPacksAtBase } from "./policy-packs";
|
|
17
|
+
import { prLoopPolicyAt, prPolicyReport, runPrPolicy, type PrPolicyInput } from "./components/pr-policy";
|
|
18
|
+
|
|
19
|
+
const scratch: string[] = [];
|
|
20
|
+
afterAll(() => {
|
|
21
|
+
for (const d of scratch) rmSync(d, { recursive: true, force: true });
|
|
22
|
+
});
|
|
23
|
+
const tmp = (): string => {
|
|
24
|
+
const d = realpathSync(mkdtempSync(join(tmpdir(), "policy-source-")));
|
|
25
|
+
scratch.push(d);
|
|
26
|
+
return d;
|
|
27
|
+
};
|
|
28
|
+
const git = (cwd: string, ...args: string[]): string => execFileSync("git", args, { cwd, encoding: "utf-8" }).trim();
|
|
29
|
+
const ident = (repo: string): void => {
|
|
30
|
+
git(repo, "config", "user.email", "t@example.com");
|
|
31
|
+
git(repo, "config", "user.name", "t");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** A bare policy repository with tag v1 (`deny_bucket_delete`), then main moved on to v2 (no rule). */
|
|
35
|
+
function policyRepo(): { bare: string; url: string; v1: string; v2: string } {
|
|
36
|
+
const work = tmp();
|
|
37
|
+
git(work, "init", "-q", "-b", "main");
|
|
38
|
+
ident(work);
|
|
39
|
+
mkdirSync(join(work, "rego"));
|
|
40
|
+
mkdirSync(join(work, "packs", "aws-guard"), { recursive: true });
|
|
41
|
+
writeFileSync(join(work, "rego", "main.rego"), "package main\n# deny_bucket_delete\n");
|
|
42
|
+
writeFileSync(join(work, "packs", "aws-guard", "index.ts"), "// shared no-public-bucket v1\n");
|
|
43
|
+
git(work, "add", ".");
|
|
44
|
+
git(work, "commit", "-q", "-m", "v1");
|
|
45
|
+
git(work, "tag", "v1");
|
|
46
|
+
const v1 = git(work, "rev-parse", "HEAD");
|
|
47
|
+
writeFileSync(join(work, "rego", "main.rego"), "package main\n# nothing\n");
|
|
48
|
+
git(work, "commit", "-q", "-am", "v2");
|
|
49
|
+
const v2 = git(work, "rev-parse", "HEAD");
|
|
50
|
+
const bare = join(tmp(), "policy.git");
|
|
51
|
+
git(work, "clone", "-q", "--bare", work, bare);
|
|
52
|
+
return { bare, url: `file://${bare}`, v1, v2 };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const declaration = (policy: unknown) => ({
|
|
56
|
+
name: "acme",
|
|
57
|
+
schema: 1,
|
|
58
|
+
members: [{ name: "infra", dir: "infra", kind: "other", because: "test" }],
|
|
59
|
+
ci: { policy },
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/** A workspace repo whose base declares `policy`, and whose head commit rewrites it to `headPolicy`. */
|
|
63
|
+
function workspace(policy: unknown, files: Record<string, string> = {}, headPolicy?: unknown, headFiles: Record<string, string> = {}): { repo: string; base: string } {
|
|
64
|
+
const repo = tmp();
|
|
65
|
+
git(repo, "init", "-q", "-b", "main");
|
|
66
|
+
ident(repo);
|
|
67
|
+
mkdirSync(join(repo, "infra"), { recursive: true });
|
|
68
|
+
writeFileSync(join(repo, "infra", "Pulumi.yaml"), "name: infra\nruntime: nodejs\n");
|
|
69
|
+
writeFileSync(join(repo, "chant.workspace.json"), JSON.stringify(declaration(policy)));
|
|
70
|
+
for (const [p, text] of Object.entries(files)) {
|
|
71
|
+
mkdirSync(join(repo, p, ".."), { recursive: true });
|
|
72
|
+
writeFileSync(join(repo, p), text);
|
|
73
|
+
}
|
|
74
|
+
git(repo, "add", ".");
|
|
75
|
+
git(repo, "commit", "-q", "-m", "base");
|
|
76
|
+
const base = git(repo, "rev-parse", "HEAD");
|
|
77
|
+
if (headPolicy !== undefined) writeFileSync(join(repo, "chant.workspace.json"), JSON.stringify(declaration(headPolicy)));
|
|
78
|
+
for (const [p, text] of Object.entries(headFiles)) {
|
|
79
|
+
mkdirSync(join(repo, p, ".."), { recursive: true });
|
|
80
|
+
writeFileSync(join(repo, p), text);
|
|
81
|
+
}
|
|
82
|
+
if (headPolicy !== undefined || Object.keys(headFiles).length > 0) {
|
|
83
|
+
git(repo, "add", ".");
|
|
84
|
+
git(repo, "commit", "-q", "-m", "head");
|
|
85
|
+
}
|
|
86
|
+
return { repo, base };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const input = (base: string): PrPolicyInput => ({ version: 1, stage: "apply", op: "pr-7", gate: "pr-apply", env: "prod", pr: 7, base, head: "h".repeat(40), changeSet: composeChangeSet([]) });
|
|
90
|
+
|
|
91
|
+
/** An opa stand-in: the rules it finds named in the policy directory's main.rego match. */
|
|
92
|
+
const readsRego: GatePolicyExec = (argv) => {
|
|
93
|
+
const dir = argv[argv.indexOf("--data") + 1]!;
|
|
94
|
+
const text = readFileSync(join(dir, "main.rego"), "utf-8");
|
|
95
|
+
const value: Record<string, unknown> = {};
|
|
96
|
+
if (text.includes("deny_bucket_delete")) value.deny_bucket_delete = ["the bucket is deleted"];
|
|
97
|
+
return { status: 0, stdout: JSON.stringify({ result: [{ expressions: [{ value }] }] }), stderr: "" };
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
describe("the settings (#4613)", () => {
|
|
101
|
+
test("a source is { repo, ref, path? } and refuses anything else", () => {
|
|
102
|
+
expect(() => assertGatePolicySource("s", { repo: "https://git.example.com/org/policy.git", ref: "v1" })).not.toThrow();
|
|
103
|
+
expect(() => assertGatePolicySource("s", { repo: "git@git.example.com:org/policy.git", ref: "main", path: "rego" })).not.toThrow();
|
|
104
|
+
expect(() => assertGatePolicySource("s", { repo: "file:///srv/policy.git", ref: "0123456789abcdef0123456789abcdef01234567" })).not.toThrow();
|
|
105
|
+
expect(() => assertGatePolicySource("s", { repo: "--upload-pack=x", ref: "v1" })).toThrow(/git URL/);
|
|
106
|
+
expect(() => assertGatePolicySource("s", { repo: "https://git.example.com/p.git", ref: "-x" })).toThrow(/tag, a branch or a commit/);
|
|
107
|
+
expect(() => assertGatePolicySource("s", { repo: "https://git.example.com/p.git", ref: "a..b" })).toThrow(/tag, a branch or a commit/);
|
|
108
|
+
expect(() => assertGatePolicySource("s", { repo: "https://git.example.com/p.git", ref: "v1", path: "../x" })).toThrow(/inside the source/);
|
|
109
|
+
expect(() => assertGatePolicySource("s", { repo: "https://git.example.com/p.git", ref: "v1", branch: "x" })).toThrow(/not a setting/);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("ci.policy takes source and packs, and refuses path beside source", () => {
|
|
113
|
+
const source = { repo: "https://git.example.com/p.git", ref: "v1" };
|
|
114
|
+
expect(() => assertGatePolicySettings("ci.policy", { engine: "opa", source })).not.toThrow();
|
|
115
|
+
expect(() => assertGatePolicySettings("ci.policy", { packs: [{ dir: "packs/aws-guard", config: "packs/aws-guard.json" }] })).not.toThrow();
|
|
116
|
+
expect(() => assertGatePolicySettings("ci.policy", { path: "policy", source })).toThrow(/cannot both be set/);
|
|
117
|
+
expect(() => assertGatePolicySettings("ci.policy", { packs: [] })).toThrow(/non-empty list/);
|
|
118
|
+
expect(() => assertGatePolicySettings("ci.policy", { packs: [{ dir: "/abs" }] })).toThrow(/inside the workspace/);
|
|
119
|
+
expect(() => assertGatePolicySettings("ci.policy", { packs: [{ config: "x.json" }] })).toThrow(/dir is required/);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test("a repository's user and password stay out of what is shown", () => {
|
|
123
|
+
expect(shownPolicyRepo("https://bot:s3cret@git.example.com/org/policy.git")).toBe("https://git.example.com/org/policy.git");
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
describe("fetching the source over a local bare repository", () => {
|
|
128
|
+
test("a tag, a branch and a commit each give the commit they name", () => {
|
|
129
|
+
const p = policyRepo();
|
|
130
|
+
const tag = fetchGatePolicySource({ repo: p.url, ref: "v1", path: "rego" });
|
|
131
|
+
const branch = fetchGatePolicySource({ repo: p.url, ref: "main", path: "rego" });
|
|
132
|
+
const commit = fetchGatePolicySource({ repo: p.url, ref: p.v1, path: "rego" });
|
|
133
|
+
for (const f of [tag, branch, commit]) if ("error" in f) throw new Error(f.error);
|
|
134
|
+
if ("error" in tag || "error" in branch || "error" in commit) return;
|
|
135
|
+
expect(tag.source).toEqual({ repo: p.url, ref: "v1", commit: p.v1, path: "rego" });
|
|
136
|
+
expect(branch.source.commit).toBe(p.v2);
|
|
137
|
+
expect(commit.source.commit).toBe(p.v1);
|
|
138
|
+
expect(tag.tree.read("rego/main.rego")).toContain("deny_bucket_delete");
|
|
139
|
+
for (const f of [tag, branch, commit]) f.cleanup();
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test("a ref the repository lacks, or a repository that is not there, is an error naming the source", () => {
|
|
143
|
+
const p = policyRepo();
|
|
144
|
+
const missing = fetchGatePolicySource({ repo: p.url, ref: "v9" });
|
|
145
|
+
expect("error" in missing && missing.error).toMatch(/v9 is not a tag, branch or commit there/);
|
|
146
|
+
const gone = fetchGatePolicySource({ repo: `file://${join(tmp(), "nothing.git")}`, ref: "v1" });
|
|
147
|
+
expect("error" in gone && gone.error).toMatch(/^ci\.policy\.source: could not read/);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe("the Rego of a source judges the change (#4613)", () => {
|
|
152
|
+
test("the source's rule at its ref judges, and the report names the commit", () => {
|
|
153
|
+
const p = policyRepo();
|
|
154
|
+
const ws = workspace({ engine: "opa", source: { repo: p.url, ref: "v1", path: "rego" } });
|
|
155
|
+
const read = prLoopPolicyAt(join(ws.repo, "infra"), ws.base);
|
|
156
|
+
expect(read.source).toEqual({ repo: p.url, ref: "v1", commit: p.v1, path: "rego" });
|
|
157
|
+
const verdict = runPrPolicy(read, input(ws.base), readsRego)!;
|
|
158
|
+
expect(verdict.result).toBe("denied");
|
|
159
|
+
expect(verdict.rules).toEqual(["main.deny_bucket_delete"]);
|
|
160
|
+
expect(prPolicyReport(verdict, ws.base).source).toEqual({ repo: p.url, ref: "v1", commit: p.v1, path: "rego" });
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test("a head that repoints the source at a looser ref is still judged by the base's", () => {
|
|
164
|
+
const p = policyRepo();
|
|
165
|
+
const ws = workspace({ engine: "opa", source: { repo: p.url, ref: "v1", path: "rego" } }, {}, { engine: "opa", source: { repo: p.url, ref: "main", path: "rego" } });
|
|
166
|
+
const read = prLoopPolicyAt(join(ws.repo, "infra"), ws.base);
|
|
167
|
+
expect(read.source?.commit).toBe(p.v1);
|
|
168
|
+
expect(runPrPolicy(read, input(ws.base), readsRego)!.result).toBe("denied");
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test("a workspace rule changed on the head is judged by the base rule", () => {
|
|
172
|
+
const ws = workspace({ engine: "opa", path: "policy" }, { "policy/main.rego": "package main\n# deny_bucket_delete\n" }, undefined, { "policy/main.rego": "package main\n# loosened\n" });
|
|
173
|
+
const read = prLoopPolicyAt(join(ws.repo, "infra"), ws.base);
|
|
174
|
+
expect(read.source).toBeUndefined();
|
|
175
|
+
const verdict = runPrPolicy(read, input(ws.base), readsRego)!;
|
|
176
|
+
expect(verdict.result).toBe("denied");
|
|
177
|
+
expect(verdict.source).toBeUndefined();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
test("a source that cannot be fetched is an error verdict, so nothing applies", () => {
|
|
181
|
+
const ws = workspace({ engine: "opa", source: { repo: `file://${join(tmp(), "nothing.git")}`, ref: "v1" } });
|
|
182
|
+
const read = prLoopPolicyAt(join(ws.repo, "infra"), ws.base);
|
|
183
|
+
expect(read.error).toMatch(/could not read/);
|
|
184
|
+
expect(runPrPolicy(read, input(ws.base), readsRego)!.result).toBe("error");
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test("a source with no Rego directory at the ref is an error", () => {
|
|
188
|
+
const p = policyRepo();
|
|
189
|
+
const ws = workspace({ engine: "opa", source: { repo: p.url, ref: "v1", path: "missing" } });
|
|
190
|
+
const verdict = runPrPolicy(prLoopPolicyAt(join(ws.repo, "infra"), ws.base), input(ws.base), readsRego)!;
|
|
191
|
+
expect(verdict.result).toBe("error");
|
|
192
|
+
expect(verdict.error).toMatch(/missing does not exist in .*@v1/);
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test("ci.policy with only packs runs no Rego when there is no policy directory", () => {
|
|
196
|
+
const ws = workspace({ packs: [{ dir: "packs/aws-guard" }] }, { "packs/aws-guard/index.ts": "// v1\n" });
|
|
197
|
+
expect(runPrPolicy(prLoopPolicyAt(join(ws.repo, "infra"), ws.base), input(ws.base), readsRego)).toBeUndefined();
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
describe("CrossGuard packs read at base (#4613)", () => {
|
|
202
|
+
test("a step pack changed on the head runs as the base has it, with a note", async () => {
|
|
203
|
+
const ws = workspace({ engine: "opa" }, { "infra/guard/index.ts": "// mandatory no-public-bucket\n", "infra/guard.json": '{"no-public-bucket":"mandatory"}' }, undefined, {
|
|
204
|
+
"infra/guard/index.ts": "// advisory no-public-bucket\n",
|
|
205
|
+
"infra/guard.json": '{"no-public-bucket":"advisory"}',
|
|
206
|
+
});
|
|
207
|
+
const got = await policyPacksAtBase({ cwd: join(ws.repo, "infra"), base: ws.base, stepPacks: [{ dir: "guard", config: "guard.json" }], tmp: tmp() });
|
|
208
|
+
if ("error" in got) throw new Error(got.error);
|
|
209
|
+
expect(got.packs).toHaveLength(1);
|
|
210
|
+
expect(readFileSync(join(got.packs[0]!.dir, "index.ts"), "utf-8")).toContain("mandatory");
|
|
211
|
+
expect(readFileSync(got.packs[0]!.config!, "utf-8")).toContain("mandatory");
|
|
212
|
+
expect(got.notes.join("\n")).toMatch(/guard differs on this change/);
|
|
213
|
+
expect(got.notes.join("\n")).toMatch(/guard\.json differs on this change/);
|
|
214
|
+
got.cleanup();
|
|
215
|
+
expect(existsSync(got.scratch)).toBe(false);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test("a step pack the base does not have runs once the change merges", async () => {
|
|
219
|
+
const ws = workspace({ engine: "opa" }, {}, undefined, { "infra/new-guard/index.ts": "// new\n" });
|
|
220
|
+
const got = await policyPacksAtBase({ cwd: join(ws.repo, "infra"), base: ws.base, stepPacks: [{ dir: "new-guard" }], tmp: tmp() });
|
|
221
|
+
if ("error" in got) throw new Error(got.error);
|
|
222
|
+
expect(got.packs).toEqual([]);
|
|
223
|
+
expect(got.notes).toEqual([expect.stringMatching(/new-guard is not at base .*runs once this change merges/)]);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
test("a pack outside the repository is used where it stands", async () => {
|
|
227
|
+
const outside = tmp();
|
|
228
|
+
const ws = workspace({ engine: "opa" });
|
|
229
|
+
const got = await policyPacksAtBase({ cwd: join(ws.repo, "infra"), base: ws.base, stepPacks: [{ dir: outside }], tmp: tmp() });
|
|
230
|
+
if ("error" in got) throw new Error(got.error);
|
|
231
|
+
expect(got.packs).toEqual([{ dir: outside, from: "step", name: outside }]);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
test("ci.policy.packs at base runs even when the head drops it from the declaration", async () => {
|
|
235
|
+
const ws = workspace({ packs: [{ dir: "packs/aws-guard" }] }, { "packs/aws-guard/index.ts": "// base pack\n" }, { engine: "opa" }, { "packs/aws-guard/index.ts": "// head pack\n" });
|
|
236
|
+
const got = await policyPacksAtBase({ cwd: join(ws.repo, "infra"), base: ws.base, tmp: tmp() });
|
|
237
|
+
if ("error" in got) throw new Error(got.error);
|
|
238
|
+
expect(got.packs.map((p) => [p.from, p.name])).toEqual([["declaration", "packs/aws-guard"]]);
|
|
239
|
+
expect(readFileSync(join(got.packs[0]!.dir, "index.ts"), "utf-8")).toContain("base pack");
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
test("ci.policy.packs comes from the source when one is set, at the ref the base names", async () => {
|
|
243
|
+
const p = policyRepo();
|
|
244
|
+
const ws = workspace({ source: { repo: p.url, ref: "v1", path: "rego" }, packs: [{ dir: "packs/aws-guard" }] });
|
|
245
|
+
const got = await policyPacksAtBase({ cwd: join(ws.repo, "infra"), base: ws.base, tmp: tmp() });
|
|
246
|
+
if ("error" in got) throw new Error(got.error);
|
|
247
|
+
expect(got.source?.commit).toBe(p.v1);
|
|
248
|
+
expect(readFileSync(join(got.packs[0]!.dir, "index.ts"), "utf-8")).toContain("shared no-public-bucket v1");
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
test("a pack ci.policy.packs lists that is not there is an error, so the preview does not run", async () => {
|
|
252
|
+
const ws = workspace({ packs: [{ dir: "packs/gone" }] });
|
|
253
|
+
const got = await policyPacksAtBase({ cwd: join(ws.repo, "infra"), base: ws.base, tmp: tmp() });
|
|
254
|
+
expect("error" in got && got.error).toMatch(/packs\/gone, which is not a directory/);
|
|
255
|
+
});
|
|
256
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A shared policy source (#4613): `ci.policy.source`, a git repository and
|
|
3
|
+
* ref that several workspaces read one rule set from.
|
|
4
|
+
*
|
|
5
|
+
* The source is named in the declaration, which the jobs read at base, so a
|
|
6
|
+
* pull request cannot point its own policy at another repository or ref.
|
|
7
|
+
* The ref is fetched once per job into a scratch repository under the OS
|
|
8
|
+
* temp dir, never the working tree, and the commit it named is kept, so the
|
|
9
|
+
* report and the wave's decision name the rules a verdict used.
|
|
10
|
+
*
|
|
11
|
+
* A tag or branch is fetched alone, at depth 1. A commit the server does not
|
|
12
|
+
* hand out by itself is found after fetching every branch and tag. The
|
|
13
|
+
* job's own git credentials, if any, reach the repository; a URL's user and
|
|
14
|
+
* password are left out of every message and record.
|
|
15
|
+
*
|
|
16
|
+
* Like `./gate-policy.ts`, this module imports only node built-ins and the
|
|
17
|
+
* git tree reader, so a product can bundle it.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { spawnSync } from "node:child_process";
|
|
21
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
22
|
+
import { tmpdir } from "node:os";
|
|
23
|
+
import { join } from "node:path";
|
|
24
|
+
import { NEXT_RELEASE } from "./release-floors";
|
|
25
|
+
import { gitTree, type WorkspaceTree } from "./workspace/tree";
|
|
26
|
+
import type { GatePolicySource, ResolvedGatePolicySource } from "./gate-policy";
|
|
27
|
+
|
|
28
|
+
// The source's shape and its check live in `./gate-policy.ts`, so the gate
|
|
29
|
+
// policy bundles alone (#4294) without this module's git fetch.
|
|
30
|
+
export { assertGatePolicySource, type GatePolicySource, type ResolvedGatePolicySource } from "./gate-policy";
|
|
31
|
+
|
|
32
|
+
/** The first chant that reads `ci.policy.source` and `ci.policy.packs`; a declaration that sets either needs this `minReader`. */
|
|
33
|
+
export const CI_POLICY_SOURCE_FLOOR = NEXT_RELEASE;
|
|
34
|
+
|
|
35
|
+
/** A fetched source: its record, and its tree at the commit, rooted at the repository's top. */
|
|
36
|
+
export interface FetchedGatePolicySource {
|
|
37
|
+
source: ResolvedGatePolicySource;
|
|
38
|
+
tree: WorkspaceTree;
|
|
39
|
+
/** Removes the scratch repository. The tree reads nothing after it. */
|
|
40
|
+
cleanup: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The repository URL with its user and password left out. */
|
|
44
|
+
export function shownPolicyRepo(url: string): string {
|
|
45
|
+
return url.replace(/^([a-z+]+:\/\/)[^/@]*@/, "$1");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function gitIn(dir: string, args: string[]): { status: number | null; stdout: string; stderr: string } {
|
|
49
|
+
const r = spawnSync("git", ["-C", dir, "-c", "init.defaultBranch=main", "-c", "advice.detachedHead=false", ...args], {
|
|
50
|
+
encoding: "utf-8",
|
|
51
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
52
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
53
|
+
});
|
|
54
|
+
return { status: r.error ? null : r.status, stdout: r.stdout ?? "", stderr: `${r.stderr ?? ""}${r.error ? r.error.message : ""}` };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Fetch `source` at its ref into a scratch repository. Returns its tree at
|
|
59
|
+
* the commit the ref named, or why it could not be read. A missing Rego
|
|
60
|
+
* directory is not an error here: the caller decides whether it needs one.
|
|
61
|
+
*/
|
|
62
|
+
export function fetchGatePolicySource(source: GatePolicySource, opts: { tmp?: string } = {}): FetchedGatePolicySource | { error: string } {
|
|
63
|
+
const repo = shownPolicyRepo(source.repo);
|
|
64
|
+
const shown = `${repo}@${source.ref}`;
|
|
65
|
+
const dest = mkdtempSync(join(opts.tmp ?? tmpdir(), "chant-policy-source-"));
|
|
66
|
+
const cleanup = (): void => rmSync(dest, { recursive: true, force: true });
|
|
67
|
+
const fail = (why: string): { error: string } => {
|
|
68
|
+
cleanup();
|
|
69
|
+
return { error: `ci.policy.source: could not read ${shown}: ${why.split(source.repo).join(repo)}` };
|
|
70
|
+
};
|
|
71
|
+
if (gitIn(dest, ["init", "-q", "--bare"]).status !== 0) return fail("git init failed");
|
|
72
|
+
let fetched = gitIn(dest, ["fetch", "-q", "--no-tags", "--depth", "1", "--", source.repo, source.ref]);
|
|
73
|
+
let commit = fetched.status === 0 ? gitIn(dest, ["rev-parse", "--verify", "--quiet", "FETCH_HEAD^{commit}"]).stdout.trim() : "";
|
|
74
|
+
if (!commit) {
|
|
75
|
+
fetched = gitIn(dest, ["fetch", "-q", "--", source.repo, "+refs/heads/*:refs/remotes/source/*", "+refs/tags/*:refs/tags/*"]);
|
|
76
|
+
if (fetched.status !== 0) return fail(fetched.stderr.trim().split("\n").pop() || `git fetch exited ${fetched.status}`);
|
|
77
|
+
commit = gitIn(dest, ["rev-parse", "--verify", "--quiet", `${source.ref}^{commit}`]).stdout.trim();
|
|
78
|
+
if (!commit) commit = gitIn(dest, ["rev-parse", "--verify", "--quiet", `refs/remotes/source/${source.ref}^{commit}`]).stdout.trim();
|
|
79
|
+
if (!commit) return fail(`${source.ref} is not a tag, branch or commit there`);
|
|
80
|
+
}
|
|
81
|
+
let tree: WorkspaceTree;
|
|
82
|
+
try {
|
|
83
|
+
tree = gitTree(dest, commit);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
return fail(`could not list ${commit.slice(0, 12)}: ${err instanceof Error ? err.message : String(err)}`);
|
|
86
|
+
}
|
|
87
|
+
const path = (source.path ?? "policy").replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
88
|
+
return { source: { repo, ref: source.ref, commit, path }, tree, cleanup };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const fetchedOnce = new Map<string, FetchedGatePolicySource | { error: string }>();
|
|
92
|
+
let exitHooked = false;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* {@link fetchGatePolicySource}, once per repository and ref in this
|
|
96
|
+
* process: a job that judges many runs, or plans many stacks, fetches the
|
|
97
|
+
* source one time. The scratch repositories go when the process exits.
|
|
98
|
+
*/
|
|
99
|
+
export function fetchGatePolicySourceOnce(source: GatePolicySource): FetchedGatePolicySource | { error: string } {
|
|
100
|
+
const key = `${source.repo}\0${source.ref}\0${source.path ?? ""}`;
|
|
101
|
+
const known = fetchedOnce.get(key);
|
|
102
|
+
if (known) return known;
|
|
103
|
+
const got = fetchGatePolicySource(source);
|
|
104
|
+
fetchedOnce.set(key, got);
|
|
105
|
+
if (!exitHooked) {
|
|
106
|
+
exitHooked = true;
|
|
107
|
+
process.once("exit", () => {
|
|
108
|
+
for (const f of fetchedOnce.values()) if ("cleanup" in f) f.cleanup();
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return got;
|
|
112
|
+
}
|