@intentius/chant 0.124.30 → 0.124.32
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/bin/chant +7 -2
- package/dist/cli/commands/check-lexicon-plugin.d.ts +7 -4
- package/dist/cli/commands/check-lexicon-plugin.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-plugin.js +10 -7
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.js +18 -12
- package/dist/cli/commands/import.d.ts +10 -0
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +37 -0
- package/dist/cli/commands/init-lexicon/templates/project.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/project.js +4 -3
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/commands/onboard.js +8 -4
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +2 -1
- package/dist/cli/dependencies.d.ts +18 -0
- package/dist/cli/dependencies.d.ts.map +1 -0
- package/dist/cli/dependencies.js +120 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +23 -4
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +12 -4
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +16 -6
- package/dist/cli/handlers/lint.d.ts.map +1 -1
- package/dist/cli/handlers/lint.js +6 -0
- package/dist/cli/handlers/operator.d.ts +2 -2
- package/dist/cli/handlers/operator.js +3 -3
- package/dist/cli/handlers/pr.d.ts +14 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +488 -32
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +3 -1
- package/dist/cli/handlers/run.d.ts +13 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +38 -15
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +74 -12
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +65 -0
- package/dist/cli/registry.d.ts +29 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/registry.js +6 -2
- package/dist/codegen/generate-post-synth-barrel.js +2 -2
- package/dist/codegen/lexicon-regen.d.ts +4 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -1
- package/dist/codegen/lexicon-regen.js +1 -1
- package/dist/codegen/pinned-upgrade.js +2 -2
- package/dist/components/capability.d.ts +44 -3
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +21 -0
- package/dist/components/changed-files.d.ts +7 -1
- package/dist/components/changed-files.d.ts.map +1 -1
- package/dist/components/changed-files.js +9 -1
- package/dist/components/driver.d.ts +38 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +47 -6
- package/dist/components/fan-out-record.d.ts +6 -1
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +24 -0
- package/dist/components/fan-out-run.d.ts +20 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +21 -1
- package/dist/components/pr-pipeline.d.ts +65 -2
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +107 -15
- package/dist/components/pr-run.d.ts +127 -29
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +290 -70
- package/dist/components/wave-plan.d.ts +5 -2
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +12 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +16 -6
- package/dist/discovery/sandbox/bundle.d.ts.map +1 -1
- package/dist/discovery/sandbox/bundle.js +6 -0
- package/dist/discovery/specifier-resolve.d.ts.map +1 -1
- package/dist/discovery/specifier-resolve.js +8 -2
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/fold/fold.js +68 -1
- package/dist/fold/subset.d.ts +37 -0
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/fold/subset.js +88 -0
- package/dist/lexicon-module.d.ts +10 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +53 -8
- package/dist/lexicon-plugin-helpers.d.ts.map +1 -1
- package/dist/lexicon-plugin-helpers.js +6 -4
- package/dist/lexicon.d.ts +2 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/affected.d.ts.map +1 -1
- package/dist/lifecycle/affected.js +7 -1
- package/dist/lifecycle/release-ledger.d.ts +21 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +24 -0
- package/dist/lifecycle/work-dir.d.ts +45 -0
- package/dist/lifecycle/work-dir.d.ts.map +1 -0
- package/dist/lifecycle/work-dir.js +78 -0
- package/dist/lint/discover.d.ts +17 -9
- package/dist/lint/discover.d.ts.map +1 -1
- package/dist/lint/discover.js +62 -54
- package/dist/module-source.d.ts +57 -0
- package/dist/module-source.d.ts.map +1 -0
- package/dist/module-source.js +104 -0
- package/dist/op/activities/factory.js +1 -1
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/discover.js +13 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +3 -0
- package/dist/op/local-executor.d.ts +12 -0
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +22 -3
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +20 -5
- package/dist/op/operator.d.ts +2 -2
- package/dist/op/operator.js +2 -2
- package/dist/op/redact.d.ts +34 -0
- package/dist/op/redact.d.ts.map +1 -0
- package/dist/op/redact.js +94 -0
- package/dist/op/step-console.d.ts +2 -0
- package/dist/op/step-console.d.ts.map +1 -1
- package/dist/op/step-console.js +5 -2
- package/dist/op/steward.d.ts +6 -4
- package/dist/op/steward.d.ts.map +1 -1
- package/dist/op/steward.js +5 -3
- package/dist/op/work-lease-run.d.ts +20 -7
- package/dist/op/work-lease-run.d.ts.map +1 -1
- package/dist/op/work-lease-run.js +56 -12
- package/dist/pr-forge.d.ts +27 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +51 -6
- package/dist/pr-loop.d.ts +141 -4
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +122 -6
- package/dist/pr-report-url.d.ts +10 -2
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +52 -6
- package/dist/ts-loader.d.ts +38 -4
- package/dist/ts-loader.d.ts.map +1 -1
- package/dist/ts-loader.js +190 -16
- package/dist/wave-runtime.mjs +208 -208
- package/dist/workspace/chant-migrations/fountain-retired-kinds.d.ts +34 -0
- package/dist/workspace/chant-migrations/fountain-retired-kinds.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/fountain-retired-kinds.js +176 -0
- package/dist/workspace/chant-migrations.d.ts.map +1 -1
- package/dist/workspace/chant-migrations.js +2 -0
- package/dist/workspace/checks/boxes.d.ts +6 -6
- package/dist/workspace/checks/boxes.js +9 -9
- package/dist/workspace/ci-green-forge.d.ts +6 -4
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green.d.ts +28 -12
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +49 -21
- package/dist/workspace/ci-list.schema.json +12 -6
- package/dist/workspace/ci-report-url.d.ts +18 -0
- package/dist/workspace/ci-report-url.d.ts.map +1 -0
- package/dist/workspace/ci-report-url.js +33 -0
- package/dist/workspace/ci-run-index.d.ts +108 -0
- package/dist/workspace/ci-run-index.d.ts.map +1 -0
- package/dist/workspace/ci-run-index.js +164 -0
- package/dist/workspace/ci-run-index.schema.json +52 -0
- package/dist/workspace/ci-run.d.ts +159 -9
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +419 -50
- package/dist/workspace/ci-runner-key.d.ts +133 -0
- package/dist/workspace/ci-runner-key.d.ts.map +1 -0
- package/dist/workspace/ci-runner-key.js +237 -0
- package/dist/workspace/ci-secrets.d.ts +65 -0
- package/dist/workspace/ci-secrets.d.ts.map +1 -0
- package/dist/workspace/ci-secrets.js +211 -0
- package/dist/workspace/ci-serve.d.ts +67 -4
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +240 -35
- package/dist/workspace/declaration.d.ts +8 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +11 -2
- package/dist/workspace/declaration.schema.json +7 -2
- package/dist/workspace/export.d.ts +1 -1
- package/dist/workspace/export.d.ts.map +1 -1
- package/dist/workspace/export.js +7 -3
- package/dist/workspace/ls.d.ts +6 -1
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +1 -0
- package/dist/workspace/ls.schema.json +7 -1
- package/dist/workspace/pin-integrity.d.ts.map +1 -1
- package/dist/workspace/pin-integrity.js +3 -2
- package/dist/workspace/pr-report.schema.json +74 -7
- package/dist/workspace/reason-codes.d.ts +7 -3
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +9 -4
- package/dist/workspace/run-event.schema.json +3 -1
- package/dist/workspace/status.schema.json +3 -1
- package/dist/workspace/trust/trust-write.d.ts +109 -0
- package/dist/workspace/trust/trust-write.d.ts.map +1 -0
- package/dist/workspace/trust/trust-write.js +320 -0
- package/dist/workspace/trust-write.schema.json +265 -0
- package/dist/workspace/write-scope.d.ts +9 -0
- package/dist/workspace/write-scope.d.ts.map +1 -1
- package/dist/workspace/write-scope.js +11 -1
- package/package.json +1 -1
- package/src/__fixtures__/pr-loop/pr-apply-wave-waiting.note.golden.md +48 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/package.json +3 -3
- package/src/cli/commands/audit.test.ts +2 -2
- package/src/cli/commands/check-lexicon-plugin.test.ts +9 -0
- package/src/cli/commands/check-lexicon-plugin.ts +11 -8
- package/src/cli/commands/check-lexicon.test.ts +1 -1
- package/src/cli/commands/check-lexicon.ts +16 -11
- package/src/cli/commands/import.ts +40 -0
- package/src/cli/commands/init-lexicon/templates/project.ts +4 -3
- package/src/cli/commands/init-lexicon.test.ts +8 -5
- package/src/cli/commands/onboard.test.ts +45 -0
- package/src/cli/commands/onboard.ts +8 -4
- package/src/cli/commands/update.test.ts +6 -0
- package/src/cli/commands/update.ts +4 -1
- package/src/cli/compiled-cli.e2e.test.ts +76 -11
- package/src/cli/dependencies.e2e.test.ts +101 -0
- package/src/cli/dependencies.test.ts +93 -0
- package/src/cli/dependencies.ts +122 -0
- package/src/cli/handlers/build.test.ts +69 -0
- package/src/cli/handlers/build.ts +20 -4
- package/src/cli/handlers/fan-out.test.ts +73 -0
- package/src/cli/handlers/fan-out.ts +11 -4
- package/src/cli/handlers/graph.test.ts +76 -0
- package/src/cli/handlers/graph.ts +19 -12
- package/src/cli/handlers/lint.test.ts +42 -0
- package/src/cli/handlers/lint.ts +6 -0
- package/src/cli/handlers/operator.ts +3 -3
- package/src/cli/handlers/pr-waves.test.ts +449 -0
- package/src/cli/handlers/pr.test.ts +134 -0
- package/src/cli/handlers/pr.ts +523 -31
- package/src/cli/handlers/promote.test.ts +26 -1
- package/src/cli/handlers/promote.ts +3 -2
- package/src/cli/handlers/run-components-exit.test.ts +99 -0
- package/src/cli/handlers/run-signer.test.ts +79 -0
- package/src/cli/handlers/run.ts +34 -16
- package/src/cli/main.test.ts +19 -0
- package/src/cli/main.ts +73 -12
- package/src/cli/parse-args.ts +48 -0
- package/src/cli/registry.ts +35 -4
- package/src/codegen/generate-post-synth-barrel.ts +2 -2
- package/src/codegen/lexicon-regen.ts +1 -1
- package/src/codegen/pinned-upgrade.ts +2 -2
- package/src/codegen/post-synth-barrel-guards.test.ts +6 -11
- package/src/components/capability.ts +51 -3
- package/src/components/changed-files.test.ts +16 -1
- package/src/components/changed-files.ts +9 -1
- package/src/components/driver.test.ts +36 -1
- package/src/components/driver.ts +76 -4
- package/src/components/fan-out-record.ts +29 -1
- package/src/components/fan-out-run.test.ts +35 -0
- package/src/components/fan-out-run.ts +40 -1
- package/src/components/pr-pipeline.test.ts +100 -0
- package/src/components/pr-pipeline.ts +132 -17
- package/src/components/pr-run.test.ts +323 -18
- package/src/components/pr-run.ts +354 -75
- package/src/components/wave-plan.ts +16 -4
- package/src/discovery/fold-host-method.test.ts +87 -0
- package/src/discovery/fold-import.ts +15 -5
- package/src/discovery/fold-package-composite.test.ts +27 -0
- package/src/discovery/fold-specifiers.test.ts +8 -0
- package/src/discovery/sandbox/bundle.ts +6 -0
- package/src/discovery/specifier-resolve.ts +8 -2
- package/src/fold/fold.test.ts +72 -0
- package/src/fold/fold.ts +71 -0
- package/src/fold/subset.test.ts +31 -0
- package/src/fold/subset.ts +99 -0
- package/src/lexicon-dist.e2e.test.ts +254 -0
- package/src/lexicon-module.test.ts +47 -0
- package/src/lexicon-module.ts +49 -7
- package/src/lexicon-plugin-helpers.ts +6 -4
- package/src/lexicon.ts +2 -0
- package/src/lifecycle/affected.test.ts +7 -0
- package/src/lifecycle/affected.ts +6 -1
- package/src/lifecycle/release-ledger.ts +34 -0
- package/src/lifecycle/work-dir.test.ts +77 -0
- package/src/lifecycle/work-dir.ts +82 -0
- package/src/lint/discover.test.ts +46 -2
- package/src/lint/discover.ts +55 -49
- package/src/module-source.test.ts +85 -0
- package/src/module-source.ts +112 -0
- package/src/op/activities/factory.ts +1 -1
- package/src/op/discover-root.test.ts +31 -2
- package/src/op/discover.ts +14 -4
- package/src/op/gate.test.ts +30 -0
- package/src/op/gate.ts +3 -0
- package/src/op/local-executor.ts +31 -3
- package/src/op/op-waves-run.ts +20 -5
- package/src/op/op-waves.test.ts +49 -0
- package/src/op/operator.ts +2 -2
- package/src/op/redact.ts +93 -0
- package/src/op/step-console.ts +7 -2
- package/src/op/steward.ts +6 -4
- package/src/op/work-lease-run.test.ts +88 -2
- package/src/op/work-lease-run.ts +52 -12
- package/src/pr-forge-bundle.test.ts +2 -2
- package/src/pr-forge.test.ts +71 -0
- package/src/pr-forge.ts +70 -6
- package/src/pr-loop-bundle.test.ts +2 -1
- package/src/pr-loop.test.ts +117 -1
- package/src/pr-loop.ts +252 -10
- package/src/pr-report-url.ts +58 -6
- package/src/terraform/__fixtures__/advise.test.ts +21 -2
- package/src/ts-loader.test.ts +89 -1
- package/src/ts-loader.ts +180 -13
- package/src/workspace/changes.test.ts +1 -1
- package/src/workspace/chant-migrations/fountain-retired-kinds.test.ts +33 -0
- package/src/workspace/chant-migrations/fountain-retired-kinds.ts +190 -0
- package/src/workspace/chant-migrations.e2e.test.ts +5 -0
- package/src/workspace/chant-migrations.ts +2 -0
- package/src/workspace/checks/boxes.ts +9 -9
- package/src/workspace/ci-green-forge.ts +6 -4
- package/src/workspace/ci-green-runs.test.ts +53 -11
- package/src/workspace/ci-green.test.ts +1 -1
- package/src/workspace/ci-green.ts +50 -22
- package/src/workspace/ci-list.schema.json +12 -6
- package/src/workspace/ci-report-url.test.ts +220 -0
- package/src/workspace/ci-report-url.ts +33 -0
- package/src/workspace/ci-run-index.schema.json +52 -0
- package/src/workspace/ci-run-index.test.ts +392 -0
- package/src/workspace/ci-run-index.ts +206 -0
- package/src/workspace/ci-run.test.ts +520 -42
- package/src/workspace/ci-run.ts +483 -51
- package/src/workspace/ci-runner-key.test.ts +204 -0
- package/src/workspace/ci-runner-key.ts +275 -0
- package/src/workspace/ci-secrets.test.ts +106 -0
- package/src/workspace/ci-secrets.ts +213 -0
- package/src/workspace/ci-serve.test.ts +282 -39
- package/src/workspace/ci-serve.ts +231 -34
- package/src/workspace/declaration.schema.json +7 -2
- package/src/workspace/declaration.test.ts +23 -0
- package/src/workspace/declaration.ts +19 -3
- package/src/workspace/export.ts +6 -3
- package/src/workspace/ls.schema.json +7 -1
- package/src/workspace/ls.ts +7 -2
- package/src/workspace/pin-integrity.test.ts +5 -0
- package/src/workspace/pin-integrity.ts +3 -2
- package/src/workspace/pr-report.schema.json +74 -7
- package/src/workspace/reason-codes.test.ts +2 -0
- package/src/workspace/reason-codes.ts +9 -4
- package/src/workspace/run-event.schema.json +3 -1
- package/src/workspace/status.schema.json +3 -1
- package/src/workspace/trust/trust-write.test.ts +179 -0
- package/src/workspace/trust/trust-write.ts +377 -0
- package/src/workspace/trust-write.schema.json +265 -0
- package/src/workspace/write-scope.test.ts +29 -1
- package/src/workspace/write-scope.ts +12 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon-regen.d.ts","sourceRoot":"","sources":["../../src/codegen/lexicon-regen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,qFAAqF;IACrF,EAAE,EAAE,OAAO,CAAC;IACZ,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,sEAAsE;IACtE,QAAQ,EAAE,cAAc,CAAC;IACzB,6DAA6D;IAC7D,KAAK,EAAE,YAAY,CAAC;IACpB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,0EAA0E;IAC1E,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IACl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AQ,EAAE,YAAY,EAAE,CAAC;IACzB,0EAA0E;IAC1E,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAID,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA+H3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAGxF;AAgID;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAoC9E"}
|
|
@@ -266,7 +266,7 @@ function runExampleHarness(lexiconDir, verbose) {
|
|
|
266
266
|
/**
|
|
267
267
|
* Extract the fresh surface from the generated artifacts in the lexicon directory.
|
|
268
268
|
*/
|
|
269
|
-
function extractFreshSurface(lexiconDir) {
|
|
269
|
+
export function extractFreshSurface(lexiconDir) {
|
|
270
270
|
const generatedDir = join(lexiconDir, "src", "generated");
|
|
271
271
|
if (!existsSync(generatedDir))
|
|
272
272
|
return null;
|
|
@@ -28,7 +28,7 @@ import { regenLexicon } from "./lexicon-regen.js";
|
|
|
28
28
|
import { fetchWithRetry } from "./fetch.js";
|
|
29
29
|
import { isLexiconPlugin } from "../lexicon.js";
|
|
30
30
|
import { importLexiconPackage } from "../lexicon-module.js";
|
|
31
|
-
import {
|
|
31
|
+
import { ensureTypeScriptLoaderFor } from "../ts-loader.js";
|
|
32
32
|
// ── Version comparison ────────────────────────────────────────────────
|
|
33
33
|
/**
|
|
34
34
|
* Parse a version string into numeric segments.
|
|
@@ -166,7 +166,7 @@ export async function loadUpstreamPins(lexicon, lexiconDir) {
|
|
|
166
166
|
const entry = lexiconDir ? lexiconEntry(lexiconDir) : null;
|
|
167
167
|
if (entry) {
|
|
168
168
|
try {
|
|
169
|
-
|
|
169
|
+
ensureTypeScriptLoaderFor(entry);
|
|
170
170
|
const pins = pinsOf((await import(pathToFileURL(entry).href)));
|
|
171
171
|
if (pins.length > 0)
|
|
172
172
|
return pins;
|
|
@@ -41,7 +41,9 @@ export interface DeployContext {
|
|
|
41
41
|
* (#3049), keyed by {@link CapabilityPlan.member}. Set by a gated-wave
|
|
42
42
|
* fan-out and by a pull request's apply (#3183). A capability whose `run`
|
|
43
43
|
* finds its own member here applies that plan, the one the approver
|
|
44
|
-
* approved, instead of planning again.
|
|
44
|
+
* approved, instead of planning again. A `run` that finds the target moved
|
|
45
|
+
* since that plan refuses with an error {@link isPlanMovedError} accepts
|
|
46
|
+
* (#3997), and the command that applied it exits 3, as for a moved digest.
|
|
45
47
|
*/
|
|
46
48
|
plans?: Record<string, unknown>;
|
|
47
49
|
/**
|
|
@@ -87,6 +89,26 @@ export interface CapabilityPlan {
|
|
|
87
89
|
* still counts toward the digest, with no entries.
|
|
88
90
|
*/
|
|
89
91
|
changeSet?: ChangeSetPart;
|
|
92
|
+
/**
|
|
93
|
+
* The outputs `run` will expose once it applies this plan (#3999), as far
|
|
94
|
+
* as the plan can tell. A pull request's plan reads a dependent's
|
|
95
|
+
* `stackOutput()` references into this member from here when both are in
|
|
96
|
+
* the change, instead of from the outputs standing now. Absent when the
|
|
97
|
+
* plan cannot say: every output of the step is then known only after it
|
|
98
|
+
* applies.
|
|
99
|
+
*/
|
|
100
|
+
outputs?: PlannedOutputs;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* What a plan says about the outputs its apply will leave (#3999). An
|
|
104
|
+
* output named in neither field is known only after apply, the same as one
|
|
105
|
+
* in `unknown`.
|
|
106
|
+
*/
|
|
107
|
+
export interface PlannedOutputs {
|
|
108
|
+
/** Each output whose value the plan knows, by name: what `run` will expose. */
|
|
109
|
+
known: Record<string, unknown>;
|
|
110
|
+
/** Outputs the plan names whose value is known only after apply, sorted. */
|
|
111
|
+
unknown: string[];
|
|
90
112
|
}
|
|
91
113
|
/**
|
|
92
114
|
* A typed leaf behavior. `kind` is the verb string components reference in
|
|
@@ -132,8 +154,11 @@ export interface Capability<In = unknown, Out = unknown> {
|
|
|
132
154
|
/**
|
|
133
155
|
* Optional: the outputs `run` exposed when it last ran, read without
|
|
134
156
|
* changing anything (#3183). A pull request's plan reads them for each
|
|
135
|
-
* component a planned one depends on
|
|
136
|
-
*
|
|
157
|
+
* component a planned one depends on that the change does not plan
|
|
158
|
+
* (#4104), so a `stackOutput()` wiring resolves to the value standing now.
|
|
159
|
+
* A dependency the change plans is read from its plan's
|
|
160
|
+
* {@link CapabilityPlan.outputs} instead (#3999). The shape is `run`'s
|
|
161
|
+
* `outputs` field.
|
|
137
162
|
*/
|
|
138
163
|
outputs?(ctx: DeployContext, input: In): Promise<Record<string, unknown>>;
|
|
139
164
|
/**
|
|
@@ -153,6 +178,22 @@ export type RollbackPolicy = "native" | "none-by-design" | "needs-opt-out";
|
|
|
153
178
|
export type CapabilityInput<C> = C extends Capability<infer In, unknown> ? In : never;
|
|
154
179
|
/** Extract a capability's `Out` type. */
|
|
155
180
|
export type CapabilityOutput<C> = C extends Capability<unknown, infer Out> ? Out : never;
|
|
181
|
+
/**
|
|
182
|
+
* The exit code of a command whose capability step refused a plan that moved
|
|
183
|
+
* since it was approved: 3, the code `pr-apply` gives a moved digest and a
|
|
184
|
+
* run gives a gate (#3997).
|
|
185
|
+
*/
|
|
186
|
+
export declare const PLAN_MOVED_EXIT_CODE = 3;
|
|
187
|
+
/**
|
|
188
|
+
* Whether `err` is a `run`'s refusal to apply a plan from
|
|
189
|
+
* `DeployContext.plans` because the target moved since it was planned
|
|
190
|
+
* (#3997). The mark is a `planMoved: true` property, not a class, so a
|
|
191
|
+
* lexicon built against an older core can set it. An `exitCode` of
|
|
192
|
+
* {@link PLAN_MOVED_EXIT_CODE} on the error is the same mark. Any other
|
|
193
|
+
* `exitCode` is ignored: a failed step exits 1, so a capability can't pick
|
|
194
|
+
* the process's exit code.
|
|
195
|
+
*/
|
|
196
|
+
export declare function isPlanMovedError(err: unknown): boolean;
|
|
156
197
|
/**
|
|
157
198
|
* Thrown by a stub `run`/`rollback` — the verb is specified and typed but has
|
|
158
199
|
* no cloud implementation yet. Distinguishes "not implemented" from a runtime
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/components/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,qGAAqG;IACrG,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/components/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAY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,CAItD;AAED;;;;GAIG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;aAC1B,IAAI,EAAE,MAAM;IAAxC,YAA4B,IAAI,EAAE,MAAM,EAGvC;CACF;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiD;IAE9E,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI,CAMvD;IAED,6FAA6F;IAC7F,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAOhD;IAED,qDAAqD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzB;IAED,oCAAoC;IACpC,KAAK,IAAI,MAAM,EAAE,CAEhB;CACF"}
|
|
@@ -11,6 +11,27 @@
|
|
|
11
11
|
* live under `./verbs/*` as typed stubs — no cloud calls, no side effects.
|
|
12
12
|
* Cloud implementations are a later phase (see epic #551, issue #554).
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* The exit code of a command whose capability step refused a plan that moved
|
|
16
|
+
* since it was approved: 3, the code `pr-apply` gives a moved digest and a
|
|
17
|
+
* run gives a gate (#3997).
|
|
18
|
+
*/
|
|
19
|
+
export const PLAN_MOVED_EXIT_CODE = 3;
|
|
20
|
+
/**
|
|
21
|
+
* Whether `err` is a `run`'s refusal to apply a plan from
|
|
22
|
+
* `DeployContext.plans` because the target moved since it was planned
|
|
23
|
+
* (#3997). The mark is a `planMoved: true` property, not a class, so a
|
|
24
|
+
* lexicon built against an older core can set it. An `exitCode` of
|
|
25
|
+
* {@link PLAN_MOVED_EXIT_CODE} on the error is the same mark. Any other
|
|
26
|
+
* `exitCode` is ignored: a failed step exits 1, so a capability can't pick
|
|
27
|
+
* the process's exit code.
|
|
28
|
+
*/
|
|
29
|
+
export function isPlanMovedError(err) {
|
|
30
|
+
if (typeof err !== "object" || err === null)
|
|
31
|
+
return false;
|
|
32
|
+
const e = err;
|
|
33
|
+
return e.planMoved === true || e.exitCode === PLAN_MOVED_EXIT_CODE;
|
|
34
|
+
}
|
|
14
35
|
/**
|
|
15
36
|
* Thrown by a stub `run`/`rollback` — the verb is specified and typed but has
|
|
16
37
|
* no cloud implementation yet. Distinguishes "not implemented" from a runtime
|
|
@@ -8,11 +8,17 @@
|
|
|
8
8
|
* changed paths instead (`LexiconPlugin.changedUnits`).
|
|
9
9
|
*/
|
|
10
10
|
import type { LexiconPlugin } from "../lexicon.js";
|
|
11
|
+
/**
|
|
12
|
+
* Git's empty tree. A root commit has no parent, so a push of one is measured
|
|
13
|
+
* from this (#4004): every file it holds counts as changed.
|
|
14
|
+
*/
|
|
15
|
+
export declare const EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
11
16
|
/**
|
|
12
17
|
* The commit a change is measured from: the merge base of `base` and `head`.
|
|
13
18
|
* A pull request's head that branched before `base` moved is measured from
|
|
14
19
|
* where it branched, so the other changes on `base` are not counted as its
|
|
15
|
-
* own; a merge commit's first parent is its own merge base.
|
|
20
|
+
* own; a merge commit's first parent is its own merge base. The empty tree
|
|
21
|
+
* has no merge base with anything and is returned as it is.
|
|
16
22
|
*/
|
|
17
23
|
export declare function resolveMergeBase(cwd: string, base: string, head?: string): Promise<string>;
|
|
18
24
|
/** The full commit `ref` names. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changed-files.d.ts","sourceRoot":"","sources":["../../src/components/changed-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAShD
|
|
1
|
+
{"version":3,"file":"changed-files.d.ts","sourceRoot":"","sources":["../../src/components/changed-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAShD;;;GAGG;AACH,eAAO,MAAM,cAAc,6CAA6C,CAAC;AAEzE;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAWhG;AAED,mCAAmC;AACnC,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAWrG;AAED,iEAAiE;AACjE,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,SAAS,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,EACvD,GAAG,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GACpF,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB"}
|
|
@@ -15,13 +15,21 @@ async function git(cwd, args) {
|
|
|
15
15
|
const { stdout } = await execFileAsync("git", args, { cwd, maxBuffer: 64 * 1024 * 1024 });
|
|
16
16
|
return stdout;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Git's empty tree. A root commit has no parent, so a push of one is measured
|
|
20
|
+
* from this (#4004): every file it holds counts as changed.
|
|
21
|
+
*/
|
|
22
|
+
export const EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
18
23
|
/**
|
|
19
24
|
* The commit a change is measured from: the merge base of `base` and `head`.
|
|
20
25
|
* A pull request's head that branched before `base` moved is measured from
|
|
21
26
|
* where it branched, so the other changes on `base` are not counted as its
|
|
22
|
-
* own; a merge commit's first parent is its own merge base.
|
|
27
|
+
* own; a merge commit's first parent is its own merge base. The empty tree
|
|
28
|
+
* has no merge base with anything and is returned as it is.
|
|
23
29
|
*/
|
|
24
30
|
export async function resolveMergeBase(cwd, base, head = "HEAD") {
|
|
31
|
+
if (base === EMPTY_TREE_SHA)
|
|
32
|
+
return base;
|
|
25
33
|
try {
|
|
26
34
|
return (await git(cwd, ["merge-base", base, head])).trim();
|
|
27
35
|
}
|
|
@@ -116,6 +116,8 @@ export interface DriverStepRecord {
|
|
|
116
116
|
durationMs: number;
|
|
117
117
|
output?: unknown;
|
|
118
118
|
error?: string;
|
|
119
|
+
/** Set on a failed step whose capability refused a plan that moved since it was approved (`isPlanMovedError`, #3997). */
|
|
120
|
+
planMoved?: true;
|
|
119
121
|
/** Set on a `gate` step that passed (#2119): who resolved it, when, and at what address. */
|
|
120
122
|
approval?: {
|
|
121
123
|
gate: string;
|
|
@@ -228,6 +230,34 @@ export declare function resolveStepInput(input: Record<string, unknown>, phaseOu
|
|
|
228
230
|
* `undefined`; a plan uses this to say whose outputs it is waiting on.
|
|
229
231
|
*/
|
|
230
232
|
export declare function unresolvedWiringSources(input: Record<string, unknown>, componentOutputs: Record<string, Record<string, unknown>>): string[];
|
|
233
|
+
/** One cross-component reference a step input makes: whose output, and which. */
|
|
234
|
+
export interface WiringReference {
|
|
235
|
+
/** The component or stack whose output it reads. */
|
|
236
|
+
source: string;
|
|
237
|
+
/** `<stack>.<name>` for `stackOutput()`, `<component>.publish.<field>` for an artifact. */
|
|
238
|
+
ref: string;
|
|
239
|
+
/**
|
|
240
|
+
* Whether it reads a published artifact's identity (#3999): an
|
|
241
|
+
* `@<component>.publish.*` reference, or a `stackOutput()` whose name is
|
|
242
|
+
* under `publish`. The driver namespaces every publish-family output there
|
|
243
|
+
* (`collectComponentOutputs`), whatever capability wrote it.
|
|
244
|
+
*/
|
|
245
|
+
publish: boolean;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Every cross-component reference in `input` that has no value in
|
|
249
|
+
* `componentOutputs`, sorted by `ref` and each once (#3999). A pull
|
|
250
|
+
* request's plan names these when the output is known only after its
|
|
251
|
+
* upstream applies.
|
|
252
|
+
*/
|
|
253
|
+
export declare function unresolvedWiringReferences(input: Record<string, unknown>, componentOutputs: Record<string, Record<string, unknown>>): WiringReference[];
|
|
254
|
+
/**
|
|
255
|
+
* The cross-component references in `input` that resolve to another value
|
|
256
|
+
* against `now` than against `read`, sorted (#3999). A pull request's apply
|
|
257
|
+
* holds back a member whose plan read `read` when its upstream applied and
|
|
258
|
+
* left `now`.
|
|
259
|
+
*/
|
|
260
|
+
export declare function movedWiringReferences(input: Record<string, unknown>, read: Record<string, Record<string, unknown>>, now: Record<string, Record<string, unknown>>): WiringReference[];
|
|
231
261
|
/** How a component's run reaches the gate ledger — see `../op/gate.ts`. */
|
|
232
262
|
export interface GateContext {
|
|
233
263
|
port: GateLedgerPort;
|
|
@@ -317,6 +347,14 @@ export declare function collectComponentOutputs(phaseOutputs: Record<string, Rec
|
|
|
317
347
|
* when the component exposed nothing.
|
|
318
348
|
*/
|
|
319
349
|
export declare function accumulateComponentOutputs(componentOutputs: Record<string, Record<string, unknown>>, componentName: string, phaseOutputs: Record<string, Record<string, unknown>>): Record<string, Record<string, unknown>>;
|
|
350
|
+
/** Whether a step in `results` refused a plan that moved since it was approved (#3997). */
|
|
351
|
+
export declare function planMovedIn(results: readonly DriverComponentResult[]): boolean;
|
|
352
|
+
/**
|
|
353
|
+
* The exit code of a run that failed: {@link PLAN_MOVED_EXIT_CODE} when a
|
|
354
|
+
* step refused a plan that moved since it was approved, 1 otherwise. Every
|
|
355
|
+
* command that runs capability steps ends a failed run with it.
|
|
356
|
+
*/
|
|
357
|
+
export declare function failedRunExitCode(results: readonly DriverComponentResult[]): number;
|
|
320
358
|
export interface InterpretRunOptions {
|
|
321
359
|
/** Target environment name, threaded into every capability's `DeployContext`. */
|
|
322
360
|
env: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/components/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH,OAAO,EAAmC,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAI3G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/components/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH,OAAO,EAAmC,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAI3G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAmD,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEzG,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,oGAAoG;AACpG,MAAM,MAAM,WAAW,GACnB,MAAM,GACN;IAAE,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAChD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,uFAAuF;AACvF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,K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1B"}
|
|
@@ -51,6 +51,7 @@ import { evaluateGate, gitGateLedgerPort } from "../op/gate.js";
|
|
|
51
51
|
import { gateName } from "../op/gate-name.js";
|
|
52
52
|
import { GateNotRecordableError } from "../lifecycle/no-record.js";
|
|
53
53
|
import { componentPlanDigest } from "./gate-plan.js";
|
|
54
|
+
import { isPlanMovedError, PLAN_MOVED_EXIT_CODE } from "./capability.js";
|
|
54
55
|
import { isPromotedArtifact } from "./auto-release.js";
|
|
55
56
|
import { gateEventsOf, joinRunEventSinks, progressSinkOf } from "../run-event-stream.js";
|
|
56
57
|
function isGateStep(step) {
|
|
@@ -194,14 +195,32 @@ export function resolveStepInput(input, phaseOutputs, componentOutputs) {
|
|
|
194
195
|
* `undefined`; a plan uses this to say whose outputs it is waiting on.
|
|
195
196
|
*/
|
|
196
197
|
export function unresolvedWiringSources(input, componentOutputs) {
|
|
197
|
-
|
|
198
|
+
return [...new Set(unresolvedWiringReferences(input, componentOutputs).map((r) => r.source))].sort();
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Every cross-component reference in `input` that has no value in
|
|
202
|
+
* `componentOutputs`, sorted by `ref` and each once (#3999). A pull
|
|
203
|
+
* request's plan names these when the output is known only after its
|
|
204
|
+
* upstream applies.
|
|
205
|
+
*/
|
|
206
|
+
export function unresolvedWiringReferences(input, componentOutputs) {
|
|
207
|
+
return wiringReferences(input).filter((r) => r.value(componentOutputs) === undefined).map(({ source, ref, publish }) => ({ source, ref, publish }));
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Every cross-component reference in `input`, each once, sorted by `ref`,
|
|
211
|
+
* with the value it resolves to against a given outputs map.
|
|
212
|
+
*/
|
|
213
|
+
function wiringReferences(input) {
|
|
214
|
+
const found = new Map();
|
|
198
215
|
const walk = (value) => {
|
|
199
216
|
if (typeof value === "string") {
|
|
200
217
|
if (PRIOR_STEP_REF.test(value))
|
|
201
218
|
return;
|
|
202
219
|
const ref = value.match(COMPONENT_ARTIFACT_REF);
|
|
203
|
-
if (ref
|
|
204
|
-
|
|
220
|
+
if (ref) {
|
|
221
|
+
const [, source, field] = ref;
|
|
222
|
+
found.set(`${source}.publish.${field}`, { source, ref: `${source}.publish.${field}`, publish: true, value: (o) => resolvePath(o[source]?.publish, field) });
|
|
223
|
+
}
|
|
205
224
|
return;
|
|
206
225
|
}
|
|
207
226
|
if (Array.isArray(value)) {
|
|
@@ -211,15 +230,24 @@ export function unresolvedWiringSources(input, componentOutputs) {
|
|
|
211
230
|
if (value && typeof value === "object") {
|
|
212
231
|
if ("stackOutput" in value) {
|
|
213
232
|
const { stack, name } = value.stackOutput;
|
|
214
|
-
|
|
215
|
-
found.add(stack);
|
|
233
|
+
found.set(`${stack}.${name}`, { source: stack, ref: `${stack}.${name}`, publish: name === "publish" || name.startsWith("publish."), value: (o) => resolvePath(o[stack], name) });
|
|
216
234
|
return;
|
|
217
235
|
}
|
|
218
236
|
Object.values(value).forEach(walk);
|
|
219
237
|
}
|
|
220
238
|
};
|
|
221
239
|
walk(input);
|
|
222
|
-
return [...found].sort();
|
|
240
|
+
return [...found.values()].sort((a, b) => a.ref.localeCompare(b.ref));
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The cross-component references in `input` that resolve to another value
|
|
244
|
+
* against `now` than against `read`, sorted (#3999). A pull request's apply
|
|
245
|
+
* holds back a member whose plan read `read` when its upstream applied and
|
|
246
|
+
* left `now`.
|
|
247
|
+
*/
|
|
248
|
+
export function movedWiringReferences(input, read, now) {
|
|
249
|
+
const same = (a, b) => JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
|
|
250
|
+
return wiringReferences(input).filter((r) => !same(r.value(read), r.value(now))).map(({ source, ref, publish }) => ({ source, ref, publish }));
|
|
223
251
|
}
|
|
224
252
|
class StepFailure extends Error {
|
|
225
253
|
constructor(records, executed) {
|
|
@@ -280,6 +308,7 @@ async function runCapabilityStep(step, phaseName, ctx, registry, phaseOutputs, c
|
|
|
280
308
|
status: "fail",
|
|
281
309
|
durationMs: Date.now() - start,
|
|
282
310
|
error: errMessage(err),
|
|
311
|
+
...(isPlanMovedError(err) ? { planMoved: true } : {}),
|
|
283
312
|
},
|
|
284
313
|
resolvedInput,
|
|
285
314
|
};
|
|
@@ -718,6 +747,18 @@ function findStackOutputs(phaseOutputs) {
|
|
|
718
747
|
}
|
|
719
748
|
return found;
|
|
720
749
|
}
|
|
750
|
+
/** Whether a step in `results` refused a plan that moved since it was approved (#3997). */
|
|
751
|
+
export function planMovedIn(results) {
|
|
752
|
+
return results.some((r) => r.records.some((s) => s.planMoved === true));
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* The exit code of a run that failed: {@link PLAN_MOVED_EXIT_CODE} when a
|
|
756
|
+
* step refused a plan that moved since it was approved, 1 otherwise. Every
|
|
757
|
+
* command that runs capability steps ends a failed run with it.
|
|
758
|
+
*/
|
|
759
|
+
export function failedRunExitCode(results) {
|
|
760
|
+
return planMovedIn(results) ? PLAN_MOVED_EXIT_CODE : 1;
|
|
761
|
+
}
|
|
721
762
|
function errMessage(err) {
|
|
722
763
|
return err instanceof Error ? err.message : String(err);
|
|
723
764
|
}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { type WaveRecord } from "../wave-engine.js";
|
|
38
38
|
import type { ChangeSetDocument } from "../change-set.js";
|
|
39
|
-
import type { PrMember } from "../pr-loop.js";
|
|
39
|
+
import type { PrMember, PrWave } from "../pr-loop.js";
|
|
40
40
|
/** What a pull request's apply approved, kept so a re-run can finish it (#3464). */
|
|
41
41
|
export interface PrApplyRecord {
|
|
42
42
|
/** The gate's op and name: `pr-<n>` and `pr-apply` unless the pipeline names another. */
|
|
@@ -56,6 +56,11 @@ export interface PrApplyRecord {
|
|
|
56
56
|
* against them again, so an unchanged member plans to the same digest.
|
|
57
57
|
*/
|
|
58
58
|
planOutputs: Record<string, Record<string, unknown>>;
|
|
59
|
+
/**
|
|
60
|
+
* With `--wave-gate` (#4003): each wave reached so far and the approval it
|
|
61
|
+
* applied or waits under, so the next wave's job reports every wave.
|
|
62
|
+
*/
|
|
63
|
+
waves?: PrWave[];
|
|
59
64
|
}
|
|
60
65
|
export interface FanOutAttempt {
|
|
61
66
|
digest: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fan-out-record.d.ts","sourceRoot":"","sources":["../../src/components/fan-out-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fan-out-record.d.ts","sourceRoot":"","sources":["../../src/components/fan-out-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEnD,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC5B,yFAAyF;IACzF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,qGAAqG;IACrG,SAAS,EAAE,iBAAiB,CAAC;IAC7B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,2CAA2C;IAC3C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAsDD,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAwBzE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAE7E"}
|
|
@@ -55,6 +55,7 @@ function readPrApplyRecord(value) {
|
|
|
55
55
|
if (isRecord(v))
|
|
56
56
|
outputs[name] = v;
|
|
57
57
|
}
|
|
58
|
+
const waves = Array.isArray(value.waves) ? value.waves.map(readPrWave).filter((w) => w !== undefined) : [];
|
|
58
59
|
return {
|
|
59
60
|
op,
|
|
60
61
|
gate,
|
|
@@ -64,6 +65,29 @@ function readPrApplyRecord(value) {
|
|
|
64
65
|
members: members,
|
|
65
66
|
changeSet: changeSet,
|
|
66
67
|
planOutputs: outputs,
|
|
68
|
+
...(waves.length > 0 ? { waves } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const WAVE_STATUSES = new Set(["applied", "failed", "plan-failed", "waiting"]);
|
|
72
|
+
/** One `prApply.waves` entry, or `undefined` when it is malformed. */
|
|
73
|
+
function readPrWave(value) {
|
|
74
|
+
if (!isRecord(value))
|
|
75
|
+
return undefined;
|
|
76
|
+
const { wave, components, status, approval, gate, digest } = value;
|
|
77
|
+
if (typeof wave !== "number" || !isStringArray(components) || typeof status !== "string" || !WAVE_STATUSES.has(status))
|
|
78
|
+
return undefined;
|
|
79
|
+
if ((approval !== "pull-request" && approval !== "wave") || typeof gate !== "string" || typeof digest !== "string")
|
|
80
|
+
return undefined;
|
|
81
|
+
return {
|
|
82
|
+
wave,
|
|
83
|
+
components,
|
|
84
|
+
status: status,
|
|
85
|
+
approval,
|
|
86
|
+
gate,
|
|
87
|
+
digest,
|
|
88
|
+
...(isStringArray(value.approvedBy) ? { approvedBy: value.approvedBy } : {}),
|
|
89
|
+
...(typeof value.approved === "string" ? { approved: value.approved } : {}),
|
|
90
|
+
...(isStringArray(value.moved) ? { moved: value.moved } : {}),
|
|
67
91
|
};
|
|
68
92
|
}
|
|
69
93
|
/** Read an attempt record, or `undefined` when there is none yet. Throws on a file that is not JSON. */
|
|
@@ -138,6 +138,24 @@ export interface FanOutRunOptions {
|
|
|
138
138
|
* the returned result cannot do.
|
|
139
139
|
*/
|
|
140
140
|
onComponentSettled?: (result: DriverComponentResult, outputs: Record<string, unknown> | undefined) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Asked as each component's wave starts, with the outputs standing then
|
|
143
|
+
* (#3999). A reason holds the component back: it does not run, and nothing
|
|
144
|
+
* downstream of it runs either; each is listed in `held` and settles
|
|
145
|
+
* `waiting`. A pull request's apply holds a member whose plan read an
|
|
146
|
+
* upstream output that applied as another value, or that was known only
|
|
147
|
+
* after apply. Not with `waveGate`, which plans each wave after the one
|
|
148
|
+
* before it applied.
|
|
149
|
+
*/
|
|
150
|
+
hold?: (component: string, componentOutputs: Record<string, Record<string, unknown>>) => string | undefined;
|
|
151
|
+
}
|
|
152
|
+
/** A component {@link FanOutRunOptions.hold} held back, or one downstream of it. */
|
|
153
|
+
export interface FanOutHeld {
|
|
154
|
+
component: string;
|
|
155
|
+
/** Why the hook held it, or, downstream, why it held the component named in `heldBy`. */
|
|
156
|
+
reason: string;
|
|
157
|
+
/** Downstream of a held component: that component. */
|
|
158
|
+
heldBy?: string;
|
|
141
159
|
}
|
|
142
160
|
export interface FanOutRunResult {
|
|
143
161
|
/** The plan actually dispatched — `plan` narrowed by `options.progress`. */
|
|
@@ -155,6 +173,8 @@ export interface FanOutRunResult {
|
|
|
155
173
|
gate?: PendingGateRecord;
|
|
156
174
|
/** With `waveGate`: each wave this attempt planned, in order, the one it stopped at included. */
|
|
157
175
|
waves?: WaveRecord[];
|
|
176
|
+
/** What {@link FanOutRunOptions.hold} held back, in plan order. Absent when nothing was. */
|
|
177
|
+
held?: FanOutHeld[];
|
|
158
178
|
}
|
|
159
179
|
/**
|
|
160
180
|
* Dispatch a fan-out plan.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fan-out-run.d.ts","sourceRoot":"","sources":["../../src/components/fan-out-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAE3B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAqC,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACrH,OAAO,EAAmD,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAmD,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,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U,EAAE,CAAC;IACrB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,eAAe,EAAE,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAuK1B"}
|
|
@@ -159,8 +159,21 @@ export async function runFanOut(plan, components, registry, options) {
|
|
|
159
159
|
const completed = [];
|
|
160
160
|
const failed = [];
|
|
161
161
|
const blockedBy = new Map();
|
|
162
|
+
const held = new Map();
|
|
162
163
|
let gatedFact;
|
|
163
164
|
const inPlan = new Set(active.order);
|
|
165
|
+
const waveOf = waveNumbers(active.waves);
|
|
166
|
+
/** Hold `root` and everything downstream of it that has not settled otherwise. */
|
|
167
|
+
const markHeld = (root, reason) => {
|
|
168
|
+
held.set(root, { component: root, reason });
|
|
169
|
+
emit?.({ type: "component-settle", wave: waveOf.get(root), component: root, status: "waiting" });
|
|
170
|
+
for (const [component] of downstreamWithin(components, inPlan, [root])) {
|
|
171
|
+
if (held.has(component) || blockedBy.has(component) || failed.includes(component))
|
|
172
|
+
continue;
|
|
173
|
+
held.set(component, { component, reason, heldBy: root });
|
|
174
|
+
emit?.({ type: "component-settle", wave: waveOf.get(component), component, status: "waiting" });
|
|
175
|
+
}
|
|
176
|
+
};
|
|
164
177
|
/** Skip everything downstream of `root`, blaming `root` rather than the nearest edge. */
|
|
165
178
|
const markBlocked = (root) => {
|
|
166
179
|
for (const [component, by] of downstreamWithin(components, inPlan, [root])) {
|
|
@@ -172,7 +185,13 @@ export async function runFanOut(plan, components, registry, options) {
|
|
|
172
185
|
for (const [waveIndex, wave] of active.waves.entries()) {
|
|
173
186
|
const waveNum = waveIndex + 1;
|
|
174
187
|
// A component whose upstream failed in an earlier wave is not dispatched.
|
|
175
|
-
const
|
|
188
|
+
const candidates = wave.filter((name) => inPlan.has(name) && !blockedBy.has(name) && !held.has(name));
|
|
189
|
+
for (const name of candidates) {
|
|
190
|
+
const reason = options.hold?.(name, componentOutputs);
|
|
191
|
+
if (reason !== undefined)
|
|
192
|
+
markHeld(name, reason);
|
|
193
|
+
}
|
|
194
|
+
const runnable = candidates.filter((name) => !held.has(name));
|
|
176
195
|
if (runnable.length === 0)
|
|
177
196
|
continue;
|
|
178
197
|
emit?.({ type: "wave-start", wave: waveNum, components: runnable });
|
|
@@ -231,6 +250,7 @@ export async function runFanOut(plan, components, registry, options) {
|
|
|
231
250
|
blocked,
|
|
232
251
|
componentOutputs,
|
|
233
252
|
...(gatedFact ? { gate: gatedFact } : {}),
|
|
253
|
+
...(held.size > 0 ? { held: active.order.filter((name) => held.has(name)).map((name) => held.get(name)) } : {}),
|
|
234
254
|
};
|
|
235
255
|
}
|
|
236
256
|
/** The run's `deployContext`, with the carried state and the carry callback (#3459) when the caller gave them. */
|