@intentius/chant 0.124.28 → 0.124.30
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/build-params.d.ts +34 -1
- package/dist/build-params.d.ts.map +1 -1
- package/dist/build-params.js +31 -1
- package/dist/change-set-graph.d.ts +8 -1
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +4 -2
- package/dist/change-set.d.ts +10 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +4 -3
- package/dist/cli/build-params-cli.d.ts +7 -1
- package/dist/cli/build-params-cli.d.ts.map +1 -1
- package/dist/cli/build-params-cli.js +17 -8
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +6 -3
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +45 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +18 -4
- package/dist/cli/handlers/fan-out.d.ts +9 -0
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +67 -8
- package/dist/cli/handlers/lifecycle-gc.d.ts +19 -0
- package/dist/cli/handlers/lifecycle-gc.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-gc.js +143 -0
- package/dist/cli/handlers/pr.d.ts +11 -3
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +134 -26
- package/dist/cli/handlers/promote.d.ts +7 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +210 -33
- package/dist/cli/handlers/release.d.ts +62 -5
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +414 -28
- package/dist/cli/handlers/run.d.ts +11 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +67 -6
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +91 -10
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +73 -2
- package/dist/cli/registry.d.ts +32 -4
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/run-events.d.ts +3 -2
- package/dist/cli/run-events.d.ts.map +1 -1
- package/dist/cli/run-events.js +5 -3
- package/dist/components/auto-release.d.ts +2 -0
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +1 -0
- package/dist/components/capability.d.ts +9 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/driver.d.ts +8 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +35 -0
- package/dist/components/fan-out-inputs.d.ts +69 -0
- package/dist/components/fan-out-inputs.d.ts.map +1 -0
- package/dist/components/fan-out-inputs.js +169 -0
- package/dist/components/fan-out-record.d.ts +13 -0
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +16 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +50 -0
- package/dist/components/fan-out.d.ts +4 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/pr-pipeline.d.ts +49 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +38 -4
- package/dist/components/pr-run.d.ts +20 -2
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +26 -13
- package/dist/components/promote.d.ts +23 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +60 -2
- package/dist/components/release-compile.d.ts +9 -0
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +9 -3
- package/dist/components/release-gate.d.ts +11 -1
- package/dist/components/release-gate.d.ts.map +1 -1
- package/dist/components/release-gate.js +10 -4
- package/dist/components/wave-plan.d.ts +16 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +36 -2
- package/dist/config.d.ts +38 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/flag-params.d.ts +54 -0
- package/dist/flag-params.d.ts.map +1 -0
- package/dist/flag-params.js +130 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +120 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +304 -0
- package/dist/lifecycle/change-set-store.d.ts +2 -1
- package/dist/lifecycle/change-set-store.d.ts.map +1 -1
- package/dist/lifecycle/change-set-store.js +2 -1
- package/dist/lifecycle/delivery-metrics.d.ts +139 -0
- package/dist/lifecycle/delivery-metrics.d.ts.map +1 -0
- package/dist/lifecycle/delivery-metrics.js +145 -0
- package/dist/lifecycle/deploy-outcome.d.ts +81 -0
- package/dist/lifecycle/deploy-outcome.d.ts.map +1 -0
- package/dist/lifecycle/deploy-outcome.js +101 -0
- package/dist/lifecycle/gate-change-set.d.ts +10 -1
- package/dist/lifecycle/gate-change-set.d.ts.map +1 -1
- package/dist/lifecycle/gate-change-set.js +35 -3
- package/dist/lifecycle/gate-ledger.d.ts +2 -3
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +30 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +31 -5
- 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/mixed-environment.d.ts +95 -0
- package/dist/lifecycle/mixed-environment.d.ts.map +1 -0
- package/dist/lifecycle/mixed-environment.js +154 -0
- package/dist/lifecycle/publish-attachments.d.ts +79 -0
- package/dist/lifecycle/publish-attachments.d.ts.map +1 -0
- package/dist/lifecycle/publish-attachments.js +179 -0
- package/dist/lifecycle/publish-credentials.d.ts +37 -0
- package/dist/lifecycle/publish-credentials.d.ts.map +1 -0
- package/dist/lifecycle/publish-credentials.js +69 -0
- package/dist/lifecycle/publish-declaration.d.ts +97 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -0
- package/dist/lifecycle/publish-declaration.js +83 -0
- package/dist/lifecycle/publish-forge.d.ts +53 -0
- package/dist/lifecycle/publish-forge.d.ts.map +1 -0
- package/dist/lifecycle/publish-forge.js +298 -0
- package/dist/lifecycle/publish-npm.d.ts +61 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -0
- package/dist/lifecycle/publish-npm.js +242 -0
- package/dist/lifecycle/publish-oci.d.ts +64 -0
- package/dist/lifecycle/publish-oci.d.ts.map +1 -0
- package/dist/lifecycle/publish-oci.js +383 -0
- package/dist/lifecycle/publish-record.d.ts +66 -0
- package/dist/lifecycle/publish-record.d.ts.map +1 -0
- package/dist/lifecycle/publish-record.js +84 -0
- package/dist/lifecycle/publish-targets.d.ts +45 -0
- package/dist/lifecycle/publish-targets.d.ts.map +1 -0
- package/dist/lifecycle/publish-targets.js +85 -0
- package/dist/lifecycle/release-cut.d.ts +48 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +116 -23
- package/dist/lifecycle/release-join.d.ts +95 -0
- package/dist/lifecycle/release-join.d.ts.map +1 -0
- package/dist/lifecycle/release-join.js +139 -0
- package/dist/lifecycle/release-ledger.d.ts +8 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +2 -0
- package/dist/lifecycle/release-publish.d.ts +312 -0
- package/dist/lifecycle/release-publish.d.ts.map +1 -0
- package/dist/lifecycle/release-publish.js +335 -0
- package/dist/lifecycle/release-revocation.d.ts +80 -0
- package/dist/lifecycle/release-revocation.d.ts.map +1 -0
- package/dist/lifecycle/release-revocation.js +123 -0
- package/dist/lifecycle/release-store.d.ts +12 -2
- package/dist/lifecycle/release-store.d.ts.map +1 -1
- package/dist/lifecycle/release-store.js +4 -2
- package/dist/lifecycle/release-verify.d.ts +61 -0
- package/dist/lifecycle/release-verify.d.ts.map +1 -0
- package/dist/lifecycle/release-verify.js +92 -0
- package/dist/lifecycle/release-workstation.d.ts +91 -0
- package/dist/lifecycle/release-workstation.d.ts.map +1 -0
- package/dist/lifecycle/release-workstation.js +180 -0
- package/dist/lifecycle/retention-policy.d.ts +45 -0
- package/dist/lifecycle/retention-policy.d.ts.map +1 -0
- package/dist/lifecycle/retention-policy.js +43 -0
- package/dist/lifecycle/retention.d.ts +185 -0
- package/dist/lifecycle/retention.d.ts.map +1 -0
- package/dist/lifecycle/retention.js +400 -0
- package/dist/lifecycle/run-ledger.d.ts +1 -1
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +9 -0
- package/dist/op/activities/activity-contracts.d.ts +1 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.js +1 -0
- package/dist/op/activities/shell.d.ts +6 -0
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/shell.js +1 -1
- package/dist/op/local-executor.d.ts +23 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +9 -3
- package/dist/op/runtime.d.ts +27 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +20 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -2
- package/dist/pr-forge.d.ts +23 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +44 -0
- package/dist/pr-loop.d.ts +17 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +30 -4
- package/dist/pr-report-url.d.ts +82 -0
- package/dist/pr-report-url.d.ts.map +1 -0
- package/dist/pr-report-url.js +174 -0
- package/dist/provenance.d.ts +2 -2
- package/dist/provenance.d.ts.map +1 -1
- package/dist/run-event-store.d.ts +29 -2
- package/dist/run-event-store.d.ts.map +1 -1
- package/dist/run-event-store.js +50 -3
- package/dist/run-event-stream.d.ts +4 -3
- package/dist/run-event-stream.d.ts.map +1 -1
- package/dist/run-event-stream.js +7 -3
- package/dist/run-event.d.ts +34 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +4 -0
- package/dist/wave-runtime.mjs +260 -229
- package/dist/workspace/__fixtures__/flag-workspace.d.ts +31 -0
- package/dist/workspace/__fixtures__/flag-workspace.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/flag-workspace.js +114 -0
- package/dist/workspace/change-set.schema.json +5 -1
- package/dist/workspace/check.schema.json +4 -2
- package/dist/workspace/checks/records.d.ts +9 -1
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks/records.js +35 -1
- package/dist/workspace/checks.d.ts +1 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +2 -1
- package/dist/workspace/ci-green-forge.d.ts +2 -0
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green.d.ts +10 -0
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +14 -5
- package/dist/workspace/ci-run.d.ts +222 -0
- package/dist/workspace/ci-run.d.ts.map +1 -0
- package/dist/workspace/ci-run.js +464 -0
- package/dist/workspace/ci-serve.d.ts +214 -0
- package/dist/workspace/ci-serve.d.ts.map +1 -0
- package/dist/workspace/ci-serve.js +412 -0
- package/dist/workspace/declaration.d.ts +16 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +26 -0
- package/dist/workspace/declaration.schema.json +64 -0
- package/dist/workspace/declared-kinds.d.ts +16 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -1
- package/dist/workspace/declared-kinds.js +25 -0
- package/dist/workspace/delivery-metrics.d.ts +91 -0
- package/dist/workspace/delivery-metrics.d.ts.map +1 -0
- package/dist/workspace/delivery-metrics.js +217 -0
- package/dist/workspace/delivery-metrics.schema.json +519 -0
- package/dist/workspace/flags-read.d.ts +37 -0
- package/dist/workspace/flags-read.d.ts.map +1 -0
- package/dist/workspace/flags-read.js +103 -0
- package/dist/workspace/flags.d.ts +100 -0
- package/dist/workspace/flags.d.ts.map +1 -0
- package/dist/workspace/flags.js +98 -0
- package/dist/workspace/graph-cli.js +1 -1
- package/dist/workspace/intent-cli.d.ts +11 -2
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.js +54 -5
- package/dist/workspace/intent-trace.d.ts +219 -0
- package/dist/workspace/intent-trace.d.ts.map +1 -0
- package/dist/workspace/intent-trace.js +314 -0
- package/dist/workspace/intent.d.ts +30 -6
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +141 -21
- package/dist/workspace/intent.schema.json +702 -6
- package/dist/workspace/overlap.d.ts +146 -0
- package/dist/workspace/overlap.d.ts.map +1 -0
- package/dist/workspace/overlap.js +276 -0
- package/dist/workspace/pr-report.schema.json +5 -0
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +3 -0
- package/dist/workspace/records.d.ts +15 -2
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +32 -0
- package/dist/workspace/records.schema.json +21 -2
- package/dist/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/dist/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/dist/workspace/releases.d.ts +9 -0
- package/dist/workspace/releases.d.ts.map +1 -1
- package/dist/workspace/releases.js +9 -0
- package/dist/workspace/releases.schema.json +123 -1
- package/dist/workspace/run-event.schema.json +24 -6
- package/dist/workspace/status-gates.d.ts +8 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status-stewards.d.ts +2 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -1
- package/dist/workspace/status-stewards.js +1 -0
- package/dist/workspace/status.d.ts +78 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +170 -3
- package/dist/workspace/status.schema.json +210 -2
- package/dist/workspace/wip.d.ts.map +1 -1
- package/dist/workspace/wip.js +11 -3
- package/package.json +1 -1
- package/src/build-params.test.ts +46 -0
- package/src/build-params.ts +55 -1
- package/src/change-set-graph.ts +10 -2
- package/src/change-set.ts +14 -3
- package/src/cli/build-params-cli.ts +22 -9
- package/src/cli/commands/build.ts +6 -3
- package/src/cli/handlers/approve-release.test.ts +5 -1
- package/src/cli/handlers/approve-revoked.test.ts +155 -0
- package/src/cli/handlers/approve.ts +47 -0
- package/src/cli/handlers/build.test.ts +30 -0
- package/src/cli/handlers/build.ts +20 -4
- package/src/cli/handlers/fan-out.test.ts +262 -1
- package/src/cli/handlers/fan-out.ts +72 -8
- package/src/cli/handlers/intent-trace.e2e.test.ts +201 -0
- package/src/cli/handlers/lifecycle-gc.test.ts +126 -0
- package/src/cli/handlers/lifecycle-gc.ts +146 -0
- package/src/cli/handlers/pr.test.ts +148 -1
- package/src/cli/handlers/pr.ts +144 -28
- package/src/cli/handlers/promote.test.ts +280 -2
- package/src/cli/handlers/promote.ts +210 -34
- package/src/cli/handlers/release-implicit.e2e.test.ts +12 -4
- package/src/cli/handlers/release-join.e2e.test.ts +185 -0
- package/src/cli/handlers/release-publish-targets.e2e.test.ts +295 -0
- package/src/cli/handlers/release-verify.e2e.test.ts +117 -0
- package/src/cli/handlers/release-workstation-ci.e2e.test.ts +135 -0
- package/src/cli/handlers/release.e2e.test.ts +146 -32
- package/src/cli/handlers/release.ts +415 -28
- package/src/cli/handlers/run-auto-release.test.ts +9 -0
- package/src/cli/handlers/run-release.test.ts +55 -0
- package/src/cli/handlers/run.ts +69 -5
- package/src/cli/main.test.ts +1 -0
- package/src/cli/main.ts +91 -10
- package/src/cli/parse-args.ts +54 -2
- package/src/cli/registry.ts +32 -4
- package/src/cli/run-events.ts +5 -2
- package/src/components/auto-release.test.ts +9 -0
- package/src/components/auto-release.ts +3 -0
- package/src/components/capability.ts +9 -0
- package/src/components/driver.test.ts +24 -0
- package/src/components/driver.ts +36 -0
- package/src/components/fan-out-inputs.test.ts +85 -0
- package/src/components/fan-out-inputs.ts +192 -0
- package/src/components/fan-out-record.test.ts +10 -0
- package/src/components/fan-out-record.ts +19 -0
- package/src/components/fan-out-run.ts +48 -0
- package/src/components/fan-out.ts +4 -0
- package/src/components/pr-pipeline.ts +67 -4
- package/src/components/pr-run.test.ts +127 -0
- package/src/components/pr-run.ts +32 -12
- package/src/components/promote.ts +68 -2
- package/src/components/release-compile.ts +17 -3
- package/src/components/release-gate.ts +18 -4
- package/src/components/wave-plan.ts +45 -2
- package/src/config.ts +8 -0
- package/src/flag-params.test.ts +144 -0
- package/src/flag-params.ts +134 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +351 -0
- package/src/lifecycle/change-set-store.ts +2 -1
- package/src/lifecycle/delivery-metrics.ts +263 -0
- package/src/lifecycle/deploy-outcome.ts +147 -0
- package/src/lifecycle/gate-change-set.ts +37 -6
- package/src/lifecycle/gate-ledger.ts +2 -2
- package/src/lifecycle/git.ts +61 -8
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/mixed-environment.test.ts +97 -0
- package/src/lifecycle/mixed-environment.ts +204 -0
- package/src/lifecycle/publish-attachments.ts +196 -0
- package/src/lifecycle/publish-credentials.ts +84 -0
- package/src/lifecycle/publish-declaration.ts +95 -0
- package/src/lifecycle/publish-forge.ts +325 -0
- package/src/lifecycle/publish-npm.ts +259 -0
- package/src/lifecycle/publish-oci.ts +396 -0
- package/src/lifecycle/publish-record.ts +113 -0
- package/src/lifecycle/publish-resume.test.ts +168 -0
- package/src/lifecycle/publish-targets.test.ts +494 -0
- package/src/lifecycle/publish-targets.ts +100 -0
- package/src/lifecycle/release-cut.test.ts +74 -2
- package/src/lifecycle/release-cut.ts +158 -22
- package/src/lifecycle/release-flag.test.ts +112 -0
- package/src/lifecycle/release-join.test.ts +68 -0
- package/src/lifecycle/release-join.ts +182 -0
- package/src/lifecycle/release-ledger.ts +9 -3
- package/src/lifecycle/release-publish.test.ts +225 -0
- package/src/lifecycle/release-publish.ts +568 -0
- package/src/lifecycle/release-revocation.ts +147 -0
- package/src/lifecycle/release-store.ts +15 -4
- package/src/lifecycle/release-verify.test.ts +110 -0
- package/src/lifecycle/release-verify.ts +120 -0
- package/src/lifecycle/release-workstation.test.ts +204 -0
- package/src/lifecycle/release-workstation.ts +216 -0
- package/src/lifecycle/retention-growth.e2e.test.ts +279 -0
- package/src/lifecycle/retention-policy.ts +63 -0
- package/src/lifecycle/retention.test.ts +363 -0
- package/src/lifecycle/retention.ts +508 -0
- package/src/lifecycle/run-ledger.ts +7 -1
- package/src/op/activities/activity-contracts.ts +1 -0
- package/src/op/activities/shell.ts +7 -1
- package/src/op/local-executor.ts +27 -4
- package/src/op/runtime.ts +42 -0
- package/src/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/pr-forge.test.ts +25 -0
- package/src/pr-forge.ts +62 -0
- package/src/pr-loop.test.ts +13 -1
- package/src/pr-loop.ts +41 -4
- package/src/pr-report-url.test.ts +131 -0
- package/src/pr-report-url.ts +209 -0
- package/src/provenance.ts +2 -2
- package/src/run-event-store.ts +63 -3
- package/src/run-event-stream.ts +8 -4
- package/src/run-event.ts +38 -1
- package/src/workspace/__fixtures__/flag-workspace.ts +132 -0
- package/src/workspace/__fixtures__/older-records/change-set-984534ea9.json +100 -0
- package/src/workspace/__fixtures__/older-records/older-records.json +326 -0
- package/src/workspace/change-set.schema.json +5 -1
- package/src/workspace/check.schema.json +4 -2
- package/src/workspace/checks/records.ts +35 -1
- package/src/workspace/checks.ts +2 -1
- package/src/workspace/ci-green-forge.ts +2 -0
- package/src/workspace/ci-green.ts +20 -5
- package/src/workspace/ci-run.test.ts +416 -0
- package/src/workspace/ci-run.ts +571 -0
- package/src/workspace/ci-serve.test.ts +268 -0
- package/src/workspace/ci-serve.ts +521 -0
- package/src/workspace/declaration.schema.json +64 -0
- package/src/workspace/declaration.test.ts +28 -0
- package/src/workspace/declaration.ts +38 -0
- package/src/workspace/declared-kinds.ts +40 -1
- package/src/workspace/delivery-metrics.schema.json +519 -0
- package/src/workspace/delivery-metrics.test.ts +236 -0
- package/src/workspace/delivery-metrics.ts +286 -0
- package/src/workspace/flags-read.ts +121 -0
- package/src/workspace/flags.test.ts +141 -0
- package/src/workspace/flags.ts +157 -0
- package/src/workspace/graph-cli.ts +1 -1
- package/src/workspace/intent-cli.ts +46 -5
- package/src/workspace/intent-trace.test.ts +173 -0
- package/src/workspace/intent-trace.ts +484 -0
- package/src/workspace/intent.schema.json +702 -6
- package/src/workspace/intent.ts +148 -25
- package/src/workspace/older-records.test.ts +412 -0
- package/src/workspace/overlap.test.ts +165 -0
- package/src/workspace/overlap.ts +340 -0
- package/src/workspace/pr-report.schema.json +5 -0
- package/src/workspace/read-contract.e2e.test.ts +2 -1
- package/src/workspace/reason-codes.test.ts +5 -0
- package/src/workspace/reason-codes.ts +3 -0
- package/src/workspace/record-assets.test.ts +2 -1
- package/src/workspace/records-contract.e2e.test.ts +2 -1
- package/src/workspace/records.schema.json +21 -2
- package/src/workspace/records.ts +36 -2
- package/src/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/src/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/src/workspace/releases.schema.json +123 -1
- package/src/workspace/releases.ts +11 -0
- package/src/workspace/run-event.schema.json +24 -6
- package/src/workspace/status-contract.test.ts +29 -0
- package/src/workspace/status-gates.ts +8 -0
- package/src/workspace/status-mixed.test.ts +152 -0
- package/src/workspace/status-revoked.test.ts +153 -0
- package/src/workspace/status-stewards.ts +3 -0
- package/src/workspace/status.schema.json +210 -2
- package/src/workspace/status.ts +254 -3
- package/src/workspace/wip.ts +11 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The publish record (#4048): what `chant release publish` has staged and
|
|
3
|
+
* revealed for a release, so a publish that failed part way resumes without
|
|
4
|
+
* publishing again what already went out.
|
|
5
|
+
*
|
|
6
|
+
* One line per target per step in `_releases/publishes.jsonl` on
|
|
7
|
+
* `chant/lifecycle`, under the member's prefix like `cuts.jsonl` beside it,
|
|
8
|
+
* append-only. A target that staged gets a `staged` line with its items and
|
|
9
|
+
* the state its reveal needs (a draft release's id); one that revealed gets
|
|
10
|
+
* a `revealed` line. Each line is pushed as soon as it is written, so a CI
|
|
11
|
+
* job that resumes on a fresh checkout reads it after `fetchLifecycle`.
|
|
12
|
+
*
|
|
13
|
+
* Why a record and not only the registries: a registry says whether a version
|
|
14
|
+
* or a digest is there, which each target's stage asks so that it never sends
|
|
15
|
+
* an item twice, but not whether a draft release, a version under `next` or
|
|
16
|
+
* a pushed digest belongs to this release's publish, nor whether every
|
|
17
|
+
* target of the set has staged, which is when the reveals may start. A
|
|
18
|
+
* record that was not written or not pushed costs only speed: the stage runs
|
|
19
|
+
* again, asks the registry, and sends nothing that is there.
|
|
20
|
+
*
|
|
21
|
+
* A line holds names, destinations, digests and draft ids. It never holds a
|
|
22
|
+
* credential, and every line is redacted before it is written.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { sortedJsonReplacer } from "../utils";
|
|
26
|
+
import { appendLedgerLine, readBlobFromPath, type LedgerLocation } from "./git";
|
|
27
|
+
import { RELEASES_DIR } from "./release-store";
|
|
28
|
+
import type { PublishedTarget, PublishItem, PublishTarget, StagedTarget } from "./release-publish";
|
|
29
|
+
import type { Redactor } from "./publish-credentials";
|
|
30
|
+
|
|
31
|
+
/** The file the record is appended to, under `_releases/`. */
|
|
32
|
+
export const PUBLISHES_FILE = "publishes.jsonl";
|
|
33
|
+
|
|
34
|
+
/** One line of `_releases/publishes.jsonl`. Version 1, written by chant 0.124.29 and newer. */
|
|
35
|
+
export interface PublishRecord {
|
|
36
|
+
version: 1;
|
|
37
|
+
releaseDigest: string;
|
|
38
|
+
label: string | null;
|
|
39
|
+
/** The target's key ({@link PublishTarget.key}). */
|
|
40
|
+
target: string;
|
|
41
|
+
kind: PublishTarget["kind"];
|
|
42
|
+
/** The target's name, for a reader. */
|
|
43
|
+
name: string;
|
|
44
|
+
step: "staged" | "revealed";
|
|
45
|
+
items: PublishItem[];
|
|
46
|
+
/** What the reveal needs, on a `staged` line; `{}` on a `revealed` one. */
|
|
47
|
+
state: Record<string, string>;
|
|
48
|
+
runId: string;
|
|
49
|
+
timestamp: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Parse the lines of `publishes.jsonl`. A line that is not a record is counted and skipped. */
|
|
53
|
+
export function parsePublishRecords(text: string | null): { records: PublishRecord[]; malformed: number } {
|
|
54
|
+
const records: PublishRecord[] = [];
|
|
55
|
+
let malformed = 0;
|
|
56
|
+
for (const line of (text ?? "").split("\n").map((l) => l.trim()).filter(Boolean)) {
|
|
57
|
+
try {
|
|
58
|
+
const r = JSON.parse(line) as Partial<PublishRecord>;
|
|
59
|
+
const ok =
|
|
60
|
+
r &&
|
|
61
|
+
r.version === 1 &&
|
|
62
|
+
typeof r.releaseDigest === "string" &&
|
|
63
|
+
typeof r.target === "string" &&
|
|
64
|
+
(r.step === "staged" || r.step === "revealed") &&
|
|
65
|
+
Array.isArray(r.items) &&
|
|
66
|
+
typeof r.timestamp === "string";
|
|
67
|
+
if (!ok) {
|
|
68
|
+
malformed++;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
records.push({ ...(r as PublishRecord), state: r.state && typeof r.state === "object" ? r.state : {} });
|
|
72
|
+
} catch {
|
|
73
|
+
malformed++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { records, malformed };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Every publish record of `releaseDigest`, oldest first. */
|
|
80
|
+
export async function readPublishRecords(releaseDigest: string, opts?: LedgerLocation): Promise<PublishRecord[]> {
|
|
81
|
+
const text = await readBlobFromPath(RELEASES_DIR, PUBLISHES_FILE, opts);
|
|
82
|
+
return parsePublishRecords(text).records.filter((r) => r.releaseDigest === releaseDigest);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Where each target of a release stands, by key: what it staged, and what it revealed. */
|
|
86
|
+
export interface PublishProgress {
|
|
87
|
+
staged: Map<string, StagedTarget>;
|
|
88
|
+
revealed: Map<string, PublishedTarget>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The progress `records` show. A later line for a target replaces an earlier one of the same step. */
|
|
92
|
+
export function publishProgress(records: readonly PublishRecord[]): PublishProgress {
|
|
93
|
+
const staged = new Map<string, StagedTarget>();
|
|
94
|
+
const revealed = new Map<string, PublishedTarget>();
|
|
95
|
+
for (const r of records) {
|
|
96
|
+
if (r.step === "staged") staged.set(r.target, { target: r.name, destination: "", items: r.items, state: r.state });
|
|
97
|
+
else revealed.set(r.target, { target: r.name, destination: "", items: r.items });
|
|
98
|
+
}
|
|
99
|
+
return { staged, revealed };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Where `target` stands in `progress`: `revealed`, `staged`, or `none`. */
|
|
103
|
+
export function progressOf(progress: PublishProgress, target: Pick<PublishTarget, "key">): "revealed" | "staged" | "none" {
|
|
104
|
+
if (progress.revealed.has(target.key)) return "revealed";
|
|
105
|
+
if (progress.staged.has(target.key)) return "staged";
|
|
106
|
+
return "none";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Append one record, redacted. Does not push. */
|
|
110
|
+
export async function appendPublishRecord(record: PublishRecord, redactor: Redactor, opts?: { cwd?: string }): Promise<void> {
|
|
111
|
+
const line = redactor.redact(JSON.stringify(record, sortedJsonReplacer));
|
|
112
|
+
await appendLedgerLine(RELEASES_DIR, PUBLISHES_FILE, line, "Release publish", opts);
|
|
113
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4048: a publish stages every target before it reveals any, records each
|
|
3
|
+
* step in `_releases/publishes.jsonl`, and run again after a failure resumes
|
|
4
|
+
* from that record without publishing anything again. The targets are npm
|
|
5
|
+
* (a fake `npm` with a registry in a file), OCI (a registry fake on
|
|
6
|
+
* 127.0.0.1) and GitHub release assets (a forge fake), and the record is on
|
|
7
|
+
* the `chant/lifecycle` branch of a temp repository.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { afterAll, describe, expect, test } from "vitest";
|
|
11
|
+
import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
12
|
+
import { dirname, join } from "node:path";
|
|
13
|
+
import { cutRelease } from "./release-cut";
|
|
14
|
+
import { createRedactor } from "./publish-credentials";
|
|
15
|
+
import { PublishDeclarationSchema } from "./publish-declaration";
|
|
16
|
+
import { parsePublishRecords, PUBLISHES_FILE } from "./publish-record";
|
|
17
|
+
import { createPublishTargets } from "./publish-targets";
|
|
18
|
+
import { PublishRunError, runPublish, type PublishContext, type PublishTarget } from "./release-publish";
|
|
19
|
+
import type { ReleaseArtifact } from "./release-store";
|
|
20
|
+
import { readFakeNpmRegistry, seedFakeNpmRegistry, startFakeForge, startFakeRegistry, writeFakeNpm, writeLockfile, writeOciLayout, writePackage } from "./__fixtures__/publish-fakes";
|
|
21
|
+
import type { CompiledTarget, TargetCompiler } from "../components/release-compile";
|
|
22
|
+
import { TestRepo } from "../workspace/trust/test-repo";
|
|
23
|
+
|
|
24
|
+
const repos: TestRepo[] = [];
|
|
25
|
+
afterAll(() => {
|
|
26
|
+
for (const r of repos) rmSync(dirname(r.dir), { recursive: true, force: true });
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const compiler: TargetCompiler = {
|
|
30
|
+
async compile(env): Promise<CompiledTarget> {
|
|
31
|
+
return {
|
|
32
|
+
env,
|
|
33
|
+
params: [],
|
|
34
|
+
components: ["api"],
|
|
35
|
+
buildSteps: {},
|
|
36
|
+
buildInputs: {},
|
|
37
|
+
componentFiles: { api: "api.component.ts" },
|
|
38
|
+
templates: [{ component: "api", path: "dist/api.json", content: `{"env":"${env}"}\n` }],
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
async buildArtifacts(): Promise<ReleaseArtifact[]> {
|
|
42
|
+
return [];
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const API = "https://api.github.test";
|
|
47
|
+
const NO_OIDC = { oidc: false, ci: null, reason: "this run is not in CI, and a workstation has no OIDC token" };
|
|
48
|
+
|
|
49
|
+
async function release(r: TestRepo) {
|
|
50
|
+
r.write("chant.config.ts", `export default { environments: ["dev"] };\n`);
|
|
51
|
+
r.write("api.component.ts", "export const api = {};\n");
|
|
52
|
+
writePackage(join(r.dir, "packages", "core"), "@acme/core", "2.0.0");
|
|
53
|
+
writePackage(join(r.dir, "packages", "cli"), "@acme/cli", "2.0.0");
|
|
54
|
+
writeOciLayout(join(r.dir, "image"));
|
|
55
|
+
r.write("dist/api.tar.gz", "asset bytes");
|
|
56
|
+
writeLockfile(r.dir);
|
|
57
|
+
const head = r.commit("init");
|
|
58
|
+
r.git(["tag", `ci/green/${head}`]);
|
|
59
|
+
const cut = await cutRelease({ cwd: r.dir, compiler, label: "v2", actor: "alice", env: {}, now: () => new Date("2026-10-17T10:00:00.000Z") });
|
|
60
|
+
return cut.release;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
describe("a publish that fails resumes", () => {
|
|
64
|
+
test("a stage failure leaves nothing visible; a reveal failure is resumed; neither run again publishes what went out", async () => {
|
|
65
|
+
const r = new TestRepo("publish-resume");
|
|
66
|
+
repos.push(r);
|
|
67
|
+
const rel = await release(r);
|
|
68
|
+
const reg = await startFakeRegistry({ username: "robot", password: "pw-resume-1", token: "tok-resume-1" });
|
|
69
|
+
try {
|
|
70
|
+
const log = join(dirname(r.dir), "npm.log");
|
|
71
|
+
seedFakeNpmRegistry(log, { packages: { "@acme/core": { versions: ["1.0.0"], distTags: { latest: "1.0.0" } }, "@acme/cli": { versions: ["1.0.0"], distTags: { latest: "1.0.0" } } } });
|
|
72
|
+
const npm = writeFakeNpm(join(dirname(r.dir), "bin"), log);
|
|
73
|
+
const forge = startFakeForge("github", API, "acme/api");
|
|
74
|
+
const decls = [
|
|
75
|
+
{ type: "npm", packages: ["packages/core", "packages/cli"] },
|
|
76
|
+
{ type: "oci", image: "image", repository: `${reg.host}/acme/api` },
|
|
77
|
+
{ type: "forge", forge: "github", repo: "acme/api", api: API, assets: ["dist/api.tar.gz"] },
|
|
78
|
+
].map((d) => PublishDeclarationSchema.parse(d));
|
|
79
|
+
// The OCI target speaks to the registry fake with the global fetch; the forge target to the forge fake.
|
|
80
|
+
const targets = [...(await createPublishTargets(decls.slice(0, 2), { npm })), ...(await createPublishTargets(decls.slice(2), { fetch: forge.fetch }))];
|
|
81
|
+
|
|
82
|
+
const lines: string[] = [];
|
|
83
|
+
const ctx = (env: Record<string, string> = {}): PublishContext => {
|
|
84
|
+
const full = { PATH: process.env.PATH, OCI_USERNAME: "robot", OCI_PASSWORD: "pw-resume-1", GITHUB_TOKEN: "ghs_resume", ...env };
|
|
85
|
+
const redactor = createRedactor(full);
|
|
86
|
+
return { release: rel, label: "v2", releaseTag: "release/v2", provenance: NO_OIDC, cwd: r.dir, tag: null, env: full, redactor, log: (l) => lines.push(redactor.redact(l)) };
|
|
87
|
+
};
|
|
88
|
+
const run = (env: Record<string, string> = {}) => runPublish({ cwd: r.dir, release: rel, label: "v2", targets, ctx: ctx(env), say: (l) => lines.push(l) });
|
|
89
|
+
const npmCalls = () => (existsSync(log) ? readFileSync(log, "utf-8").trim().split("\n").filter(Boolean).map((l) => (JSON.parse(l) as { args: string[] }).args) : []);
|
|
90
|
+
const visible = () => ({
|
|
91
|
+
npm: Object.fromEntries(Object.entries(readFakeNpmRegistry(log).packages).map(([n, p]) => [n, p.distTags.latest])),
|
|
92
|
+
ociTags: [...reg.manifests.keys()].filter((k) => !k.startsWith("sha256:")),
|
|
93
|
+
forge: forge.visible(),
|
|
94
|
+
});
|
|
95
|
+
const records = () => parsePublishRecords(r.git(["show", `chant/lifecycle:_releases/${PUBLISHES_FILE}`])).records;
|
|
96
|
+
const nothingVisible = { npm: { "@acme/core": "1.0.0", "@acme/cli": "1.0.0" }, ociTags: [], forge: [] };
|
|
97
|
+
|
|
98
|
+
// Run 1: the forge's draft can't be made, after npm and OCI staged. Nothing is visible.
|
|
99
|
+
forge.failOnce(`POST ${API}/repos/acme/api/releases`);
|
|
100
|
+
const first = await run().catch((e: unknown) => e);
|
|
101
|
+
expect(first).toBeInstanceOf(PublishRunError);
|
|
102
|
+
expect(first).toMatchObject({ code: "publish-forge-failed", step: "stage", staged: ["npm (2 packages)", `oci ${reg.host}/acme/api`], revealed: [] });
|
|
103
|
+
expect(visible()).toEqual(nothingVisible);
|
|
104
|
+
expect(records().map((x) => [x.kind, x.step])).toEqual([["npm", "staged"], ["oci", "staged"]]);
|
|
105
|
+
expect(readFakeNpmRegistry(log).packages["@acme/core"]!.distTags.next).toBe("2.0.0");
|
|
106
|
+
|
|
107
|
+
// Run 2: npm and OCI are not staged again; the forge stages, then npm's reveal fails at cli, after core's latest moved.
|
|
108
|
+
const npmBefore = npmCalls().length;
|
|
109
|
+
const ociBefore = { uploads: reg.uploads, puts: reg.requests.filter((q) => q.method === "PUT").length };
|
|
110
|
+
const second = await run({ FAKE_NPM_FAIL_TAG: "@acme/cli" }).catch((e: unknown) => e);
|
|
111
|
+
expect(second).toMatchObject({ code: "publish-npm-tag-failed", step: "reveal", revealed: [] });
|
|
112
|
+
expect(npmCalls().slice(npmBefore)).toEqual([
|
|
113
|
+
["dist-tag", "add", "@acme/core@2.0.0", "latest"],
|
|
114
|
+
["dist-tag", "add", "@acme/cli@2.0.0", "latest"],
|
|
115
|
+
]);
|
|
116
|
+
expect(reg.uploads).toBe(ociBefore.uploads);
|
|
117
|
+
expect(reg.requests.filter((q) => q.method === "PUT")).toHaveLength(ociBefore.puts);
|
|
118
|
+
expect(forge.releases).toMatchObject([{ draft: true }]);
|
|
119
|
+
expect(forge.releases[0]!.assets.map((a) => a.name)).toEqual(["api.tar.gz", "sbom.spdx.json", "release.intoto.json"]);
|
|
120
|
+
expect(lines).toContain(" npm (2 packages): staged by an earlier run; not staged again");
|
|
121
|
+
expect(records().map((x) => [x.kind, x.step])).toEqual([["npm", "staged"], ["oci", "staged"], ["forge", "staged"]]);
|
|
122
|
+
|
|
123
|
+
// Run 3: nothing is staged or uploaded again; every reveal runs, core's latest first.
|
|
124
|
+
const npm3 = npmCalls().length;
|
|
125
|
+
const forge3 = forge.calls.length;
|
|
126
|
+
const ociUploads = reg.uploads;
|
|
127
|
+
const done = await run();
|
|
128
|
+
expect(npmCalls().slice(npm3).every((a) => a[0] === "dist-tag")).toBe(true);
|
|
129
|
+
expect(npmCalls().slice(npm3).map((a) => a[2])).toEqual(["@acme/core@2.0.0", "@acme/cli@2.0.0"]);
|
|
130
|
+
expect(reg.uploads).toBe(ociUploads);
|
|
131
|
+
expect(forge.calls.slice(forge3).map((c) => c.method)).toEqual(["PATCH"]);
|
|
132
|
+
expect(visible()).toEqual({ npm: { "@acme/core": "2.0.0", "@acme/cli": "2.0.0" }, ociTags: ["v2"], forge: [{ tag: "release/v2", assets: ["api.tar.gz", "sbom.spdx.json", "release.intoto.json"] }] });
|
|
133
|
+
expect(done.resumed).toEqual([
|
|
134
|
+
{ target: "npm (2 packages)", step: "staged" },
|
|
135
|
+
{ target: `oci ${reg.host}/acme/api`, step: "staged" },
|
|
136
|
+
{ target: "github release assets acme/api", step: "staged" },
|
|
137
|
+
]);
|
|
138
|
+
expect(records().filter((x) => x.step === "revealed").map((x) => x.kind)).toEqual(["npm", "oci", "forge"]);
|
|
139
|
+
expect(records().find((x) => x.kind === "forge" && x.step === "staged")!.state).toEqual({ releaseId: "100" });
|
|
140
|
+
|
|
141
|
+
// Run 4: every target is published, so nothing is sent at all.
|
|
142
|
+
const sent = { npm: npmCalls().length, forge: forge.calls.length, oci: reg.requests.length };
|
|
143
|
+
const again = await run();
|
|
144
|
+
expect({ npm: npmCalls().length, forge: forge.calls.length, oci: reg.requests.length }).toEqual(sent);
|
|
145
|
+
expect(again.published.every((p) => p.items.every((i) => i.present))).toBe(true);
|
|
146
|
+
|
|
147
|
+
// No credential reached the record.
|
|
148
|
+
const branch = r.git(["log", "-p", "chant/lifecycle"]);
|
|
149
|
+
for (const secret of ["pw-resume-1", "tok-resume-1", "ghs_resume"]) expect(branch).not.toContain(secret);
|
|
150
|
+
} finally {
|
|
151
|
+
await reg.close();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
test("a target's key names its declaration, so a resume finds it, and holds no credential", async () => {
|
|
156
|
+
const [a, b, c] = await createPublishTargets(
|
|
157
|
+
[
|
|
158
|
+
{ type: "npm", packages: ["x"] },
|
|
159
|
+
{ type: "npm", packages: ["x"] },
|
|
160
|
+
{ type: "npm", packages: ["y"] },
|
|
161
|
+
].map((d) => PublishDeclarationSchema.parse(d)),
|
|
162
|
+
);
|
|
163
|
+
const keys = [a, b, c].map((t: PublishTarget | undefined) => t!.key);
|
|
164
|
+
expect(keys[0]).toMatch(/^npm:[0-9a-f]{16}$/);
|
|
165
|
+
expect(keys[0]).toBe(keys[1]);
|
|
166
|
+
expect(keys[0]).not.toBe(keys[2]);
|
|
167
|
+
});
|
|
168
|
+
});
|