@intentius/chant 0.124.28 → 0.124.29
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 +15 -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 +40 -3
- 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 +61 -10
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +24 -2
- package/dist/cli/registry.d.ts +15 -3
- 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 +25 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +22 -4
- 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 +5 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +10 -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-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/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -2
- package/dist/pr-loop.d.ts +7 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +23 -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 +2 -1
- package/dist/run-event-stream.d.ts.map +1 -1
- package/dist/run-event-stream.js +5 -1
- package/dist/run-event.d.ts +19 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +2 -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.d.ts +8 -0
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +10 -3
- 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/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 +10 -3
- package/dist/workspace/status-gates.d.ts +8 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- 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 +198 -1
- 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 +15 -0
- package/src/cli/handlers/build.ts +17 -4
- package/src/cli/handlers/fan-out.test.ts +180 -1
- package/src/cli/handlers/fan-out.ts +38 -3
- 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 +139 -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 +61 -10
- package/src/cli/parse-args.ts +19 -2
- package/src/cli/registry.ts +15 -3
- 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 +35 -4
- 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 +15 -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-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/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/pr-loop.ts +25 -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 +4 -1
- package/src/run-event.ts +21 -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.ts +14 -3
- 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/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 +10 -3
- 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.schema.json +198 -1
- package/src/workspace/status.ts +254 -3
- package/src/workspace/wip.ts +11 -2
package/dist/build-params.d.ts
CHANGED
|
@@ -68,6 +68,30 @@ export interface BuildParamsInput {
|
|
|
68
68
|
fromFile?: Record<string, unknown>;
|
|
69
69
|
/** The process environment, consulted only for a parameter that declares an `env` mapping, and only once `cli`/`fromFile` have no value for it. */
|
|
70
70
|
env?: Record<string, string | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* The workspace flags that back parameters in this build's environment
|
|
73
|
+
* (#4024), read by `./flag-params.ts`. A flag-backed parameter takes the
|
|
74
|
+
* flag's value for the environment, recorded with `source: "flag:<id>"`,
|
|
75
|
+
* ahead of its `env` mapping and its default. Absent outside a workspace
|
|
76
|
+
* and without `--env`.
|
|
77
|
+
*/
|
|
78
|
+
flags?: BuildParamFlags;
|
|
79
|
+
}
|
|
80
|
+
/** The flags that back parameters in one environment (#4024). */
|
|
81
|
+
export interface BuildParamFlags {
|
|
82
|
+
/** The environment the build is for. */
|
|
83
|
+
env: string;
|
|
84
|
+
/** Each flag-backed parameter by name: the flag's name, and its value in `env` (undefined when the flag gives it none). */
|
|
85
|
+
byParam: Record<string, {
|
|
86
|
+
flag: string;
|
|
87
|
+
value: BuildParamValue | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* The environment has a gate (#4024's precedence rule): a `--param`,
|
|
91
|
+
* `--params-file` or env-var value for a flag-backed parameter is refused,
|
|
92
|
+
* so no path flips a flag around the gate.
|
|
93
|
+
*/
|
|
94
|
+
gated?: boolean;
|
|
71
95
|
}
|
|
72
96
|
/** Result of resolving a project's declared parameters against one build invocation's inputs. */
|
|
73
97
|
export interface BuildParamsResolution {
|
|
@@ -86,7 +110,11 @@ export interface BuildParamsResolution {
|
|
|
86
110
|
* Resolve a project's declared build-time parameters against one build's
|
|
87
111
|
* supplied inputs. Precedence per parameter, most to least specific:
|
|
88
112
|
* `cli` (`--param name=value`) > `fromFile` (`--params-file`) > the
|
|
89
|
-
* parameter's own declared `env` mapping (only if set) >
|
|
113
|
+
* parameter's own declared `env` mapping (only if set) > a workspace flag's
|
|
114
|
+
* value for the build's environment (`input.flags`, #4024) > `def.default`.
|
|
115
|
+
* When `input.flags.gated` is set, a flag-backed parameter takes none of the
|
|
116
|
+
* first three: a value from any of them is a build error, so a flag can't be
|
|
117
|
+
* flipped around the environment's gate.
|
|
90
118
|
*
|
|
91
119
|
* A parameter with no declared `default` and no value from any source is a
|
|
92
120
|
* build error, not a silently-`undefined` value — a build-time parameter
|
|
@@ -103,6 +131,11 @@ export interface BuildParamsResolution {
|
|
|
103
131
|
* `process.env.X || undefined`.
|
|
104
132
|
*/
|
|
105
133
|
export declare function resolveBuildParams(defs: BuildParamsConfig | undefined, input: BuildParamsInput): BuildParamsResolution;
|
|
134
|
+
/**
|
|
135
|
+
* The build error for a flag-backed parameter that `around` (`--param`,
|
|
136
|
+
* `--params-file` or an env var) set in an environment with a gate (#4024).
|
|
137
|
+
*/
|
|
138
|
+
export declare function flagGateRefusal(name: string, flag: string, env: string, around: string): string;
|
|
106
139
|
/** Project the resolved provenance records down to a plain `{ name: value }` map — what actually gets bound to `params.<name>` (see ./params.ts). */
|
|
107
140
|
export declare function buildParamValues(provenance: readonly BuildParamProvenance[]): Record<string, BuildParamValue>;
|
|
108
141
|
//# sourceMappingURL=build-params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-params.d.ts","sourceRoot":"","sources":["../src/build-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEzD;;;;;;;;;;;;;;;;;GAiBG;AAEH,6FAA6F;AAC7F,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,+GAA+G;IAC/G,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,mIAAmI;IACnI,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE9D,gIAAgI;AAChI,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,mJAAmJ;IACnJ,GAAG,CAAC,EAAE,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IACZ,2HAA2H;IAC3H,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAC9E;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,iGAAiG;AACjG,MAAM,WAAW,qBAAqB;IACpC,sHAAsH;IACtH,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AA2BD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,EAAE,KAAK,EAAE,gBAAgB,GAAG,qBAAqB,CAqFtH;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED,qJAAqJ;AACrJ,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAE7G"}
|
package/dist/build-params.js
CHANGED
|
@@ -27,7 +27,11 @@ function coerce(name, raw, def, errors) {
|
|
|
27
27
|
* Resolve a project's declared build-time parameters against one build's
|
|
28
28
|
* supplied inputs. Precedence per parameter, most to least specific:
|
|
29
29
|
* `cli` (`--param name=value`) > `fromFile` (`--params-file`) > the
|
|
30
|
-
* parameter's own declared `env` mapping (only if set) >
|
|
30
|
+
* parameter's own declared `env` mapping (only if set) > a workspace flag's
|
|
31
|
+
* value for the build's environment (`input.flags`, #4024) > `def.default`.
|
|
32
|
+
* When `input.flags.gated` is set, a flag-backed parameter takes none of the
|
|
33
|
+
* first three: a value from any of them is a build error, so a flag can't be
|
|
34
|
+
* flipped around the environment's gate.
|
|
31
35
|
*
|
|
32
36
|
* A parameter with no declared `default` and no value from any source is a
|
|
33
37
|
* build error, not a silently-`undefined` value — a build-time parameter
|
|
@@ -60,9 +64,24 @@ export function resolveBuildParams(defs, input) {
|
|
|
60
64
|
errors.push(`unknown build parameter "${key}" (from --params-file) — not declared in chant.config.ts's buildParams`);
|
|
61
65
|
}
|
|
62
66
|
}
|
|
67
|
+
const flags = input.flags;
|
|
68
|
+
for (const [name, binding] of Object.entries(flags?.byParam ?? {})) {
|
|
69
|
+
if (!(name in declared)) {
|
|
70
|
+
errors.push(`flag "${binding.flag}" sets build parameter "${name}", which chant.config.ts's buildParams does not declare`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
63
73
|
for (const [name, def] of Object.entries(declared)) {
|
|
64
74
|
let raw;
|
|
65
75
|
let source;
|
|
76
|
+
const binding = flags?.byParam[name];
|
|
77
|
+
if (binding && flags?.gated) {
|
|
78
|
+
// #4024: in an environment with a gate, the flag record is the only way to set the parameter.
|
|
79
|
+
const around = name in cli ? "--param" : name in fromFile ? "--params-file" : def.env && env[def.env] !== undefined ? `the env var ${def.env}` : null;
|
|
80
|
+
if (around !== null) {
|
|
81
|
+
errors.push(flagGateRefusal(name, binding.flag, flags.env, around));
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
66
85
|
if (name in cli) {
|
|
67
86
|
raw = cli[name];
|
|
68
87
|
source = "cli";
|
|
@@ -80,6 +99,10 @@ export function resolveBuildParams(defs, input) {
|
|
|
80
99
|
raw = env[def.env];
|
|
81
100
|
source = "env";
|
|
82
101
|
}
|
|
102
|
+
else if (binding && binding.value !== undefined) {
|
|
103
|
+
raw = binding.value;
|
|
104
|
+
source = `flag:${binding.flag}`;
|
|
105
|
+
}
|
|
83
106
|
else if (def.default !== undefined) {
|
|
84
107
|
raw = def.default;
|
|
85
108
|
source = "default";
|
|
@@ -102,6 +125,13 @@ export function resolveBuildParams(defs, input) {
|
|
|
102
125
|
}
|
|
103
126
|
return { provenance, errors };
|
|
104
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* The build error for a flag-backed parameter that `around` (`--param`,
|
|
130
|
+
* `--params-file` or an env var) set in an environment with a gate (#4024).
|
|
131
|
+
*/
|
|
132
|
+
export function flagGateRefusal(name, flag, env, around) {
|
|
133
|
+
return `build parameter "${name}" is backed by the flag "${flag}", and "${env}" has a gate, so ${around} can't set it; change the flag record and let the change go through the gate`;
|
|
134
|
+
}
|
|
105
135
|
/** Project the resolved provenance records down to a plain `{ name: value }` map — what actually gets bound to `params.<name>` (see ./params.ts). */
|
|
106
136
|
export function buildParamValues(provenance) {
|
|
107
137
|
return Object.fromEntries(provenance.map((p) => [p.name, p.value]));
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* {@link changeSetNodeCandidates} lists the ids an entry's address can have,
|
|
14
14
|
* by planner. {@link mapChangeSetToGraph} keeps the first that the graph
|
|
15
15
|
* holds and puts the member's name in front, as `chant workspace graph`
|
|
16
|
-
* does
|
|
16
|
+
* does, with the node's source file as `source` when the graph gives one
|
|
17
|
+
* (#4025). An entry whose address the graph does not hold gets `node: null`:
|
|
17
18
|
* a delete of a block the source no longer declares, or a warden or sql
|
|
18
19
|
* change outside the graph.
|
|
19
20
|
*
|
|
@@ -29,6 +30,12 @@ export interface ChangeSetGraphNodes {
|
|
|
29
30
|
at: string | null;
|
|
30
31
|
/** Every node id of the member's `chant graph --format ir`, without the member in front. */
|
|
31
32
|
ids: Iterable<string>;
|
|
33
|
+
/**
|
|
34
|
+
* The source file of each node that has one (#4025), by the same ids, as a
|
|
35
|
+
* path from the repository root. An entry mapped onto such a node gets it
|
|
36
|
+
* as `source`.
|
|
37
|
+
*/
|
|
38
|
+
sources?: ReadonlyMap<string, string>;
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
34
41
|
* The block key the terraform lexicon gives an address in its root:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set-graph.d.ts","sourceRoot":"","sources":["../src/change-set-graph.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"change-set-graph.d.ts","sourceRoot":"","sources":["../src/change-set-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtE,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,0HAA0H;IAC1H,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8DAA8D;IAC9D,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,4FAA4F;IAC5F,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AA+BD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,GAAG,MAAM,EAAE,CAW/G;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,iBAAiB,CAehH"}
|
package/dist/change-set-graph.js
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* {@link changeSetNodeCandidates} lists the ids an entry's address can have,
|
|
14
14
|
* by planner. {@link mapChangeSetToGraph} keeps the first that the graph
|
|
15
15
|
* holds and puts the member's name in front, as `chant workspace graph`
|
|
16
|
-
* does
|
|
16
|
+
* does, with the node's source file as `source` when the graph gives one
|
|
17
|
+
* (#4025). An entry whose address the graph does not hold gets `node: null`:
|
|
17
18
|
* a delete of a block the source no longer declares, or a warden or sql
|
|
18
19
|
* change outside the graph.
|
|
19
20
|
*
|
|
@@ -121,7 +122,8 @@ export function mapChangeSetToGraph(doc, graph) {
|
|
|
121
122
|
...doc,
|
|
122
123
|
entries: doc.entries.map((e) => {
|
|
123
124
|
const id = changeSetNodeCandidates(e).find((c) => ids.has(c));
|
|
124
|
-
|
|
125
|
+
const source = id === undefined ? undefined : graph.sources?.get(id);
|
|
126
|
+
return { ...e, node: id === undefined ? null : `${prefix}${id}`, ...(source !== undefined ? { source } : {}) };
|
|
125
127
|
}),
|
|
126
128
|
graph: { member: graph.member, at: graph.at },
|
|
127
129
|
};
|
package/dist/change-set.d.ts
CHANGED
|
@@ -111,6 +111,16 @@ export interface ChangeSetEntry {
|
|
|
111
111
|
* part of the digest.
|
|
112
112
|
*/
|
|
113
113
|
node?: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* The source file that declares the entry's node, from the repository
|
|
116
|
+
* root (#4025): the node's `sourceLoc.file` in the member's graph IR, with
|
|
117
|
+
* the member's directory in front. Set beside `node` when a stored change
|
|
118
|
+
* set is mapped onto a graph whose node has a source location, absent
|
|
119
|
+
* otherwise. Like `node`, never part of the digest. The overlap report
|
|
120
|
+
* attributes the entry to a work item through the commits that changed
|
|
121
|
+
* this file.
|
|
122
|
+
*/
|
|
123
|
+
source?: string;
|
|
114
124
|
}
|
|
115
125
|
/** Something a planner could not read, so the plan says nothing about it. */
|
|
116
126
|
export interface ChangeSetHole {
|
package/dist/change-set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,KAAK,EAAE,SAAS,IAAI,kBAAkB,EAAoC,MAAM,wBAAwB,CAAC;AAChH,OAAO,KAAK,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEnE,2DAA2D;AAC3D,e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;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,EAAE,kBAAkB,CAAC;IACzB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,aAAa,CAkD9E;AAID,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IAChD,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,aAAa,CAyC9E;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAsB/H"}
|
package/dist/change-set.js
CHANGED
|
@@ -96,12 +96,13 @@ export function changeSetDocumentDigest(doc) {
|
|
|
96
96
|
.filter((m) => !provisional.has(m.member))
|
|
97
97
|
.map((m) => ({ member: m.member, status: m.status, holes: m.holes }))
|
|
98
98
|
.sort((a, b) => byString(a.member, b.member));
|
|
99
|
-
// An entry's graph node (#4022)
|
|
100
|
-
// not what the plan does, so
|
|
99
|
+
// An entry's graph node (#4022) and its source file (#4025) say where on
|
|
100
|
+
// the graph the change is, not what the plan does, so they stay outside
|
|
101
|
+
// the digest: mapping a stored
|
|
101
102
|
// document onto a graph never moves the value its gate bound.
|
|
102
103
|
const entries = doc.entries
|
|
103
104
|
.filter((e) => !provisional.has(e.member))
|
|
104
|
-
.map(({ node: _node, ...e }) => e)
|
|
105
|
+
.map(({ node: _node, source: _source, ...e }) => e)
|
|
105
106
|
.sort((a, b) => byString(entryKey(a), entryKey(b)));
|
|
106
107
|
const sideEffects = (doc.sideEffects ?? []).filter((s) => !provisional.has(s.member)).sort(bySideEffect);
|
|
107
108
|
const planned = doc.releaseDigest !== undefined || doc.environment !== undefined
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuildParamsConfig } from "../build-params.js";
|
|
1
|
+
import { type BuildParamFlags, type BuildParamsConfig } from "../build-params.js";
|
|
2
2
|
import type { BuildParamProvenance } from "../provenance.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared CLI-layer wiring for chant #1064's build-time parameters, factored
|
|
@@ -26,6 +26,10 @@ export interface CliBuildParamsArgs {
|
|
|
26
26
|
paramsFile?: string;
|
|
27
27
|
/** `--verbose` — list every resolved parameter one per line instead of the one-line count (#1424). */
|
|
28
28
|
verbose?: boolean;
|
|
29
|
+
/** The workspace flags backing parameters in this build's environment (#4024), from `../flag-params.ts`. */
|
|
30
|
+
flags?: BuildParamFlags;
|
|
31
|
+
/** `false` to resolve without printing the summary line, for a caller that checks more before it prints ({@link echoBuildParams}). */
|
|
32
|
+
echo?: boolean;
|
|
29
33
|
}
|
|
30
34
|
export interface CliBuildParamsResolution {
|
|
31
35
|
success: boolean;
|
|
@@ -56,6 +60,8 @@ export interface CliBuildParamsResolution {
|
|
|
56
60
|
* `[param] <name> = <value> (<source>)` instead (#1424).
|
|
57
61
|
*/
|
|
58
62
|
export declare function resolveCliBuildParams(buildParamsConfig: BuildParamsConfig | undefined, args: CliBuildParamsArgs): CliBuildParamsResolution;
|
|
63
|
+
/** Print a successful resolution: the one-line summary, or every value under `--verbose` or `CHANT_PARAM_ECHO=all` (#1424). */
|
|
64
|
+
export declare function echoBuildParams(provenance: readonly BuildParamProvenance[], verboseFlag?: boolean): void;
|
|
59
65
|
/**
|
|
60
66
|
* `N build parameters resolved (1 from cli, 3 default); --verbose to list` —
|
|
61
67
|
* the non-verbose echo of a successful resolution (#1424). Sources appear in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-params-cli.d.ts","sourceRoot":"","sources":["../../src/cli/build-params-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-params-cli.d.ts","sourceRoot":"","sources":["../../src/cli/build-params-cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D;;;;;;;;;;;;;;;GAeG;AAEH,4SAA4S;AAC5S,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAQtF;AAED,qOAAqO;AACrO,MAAM,WAAW,kBAAkB;IACjC,mNAAmN;IACnN,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4GAA4G;IAC5G,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,sIAAsI;IACtI,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,iHAAiH;IACjH,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,4FAA4F;IAC5F,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CACnC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,EAChD,IAAI,EAAE,kBAAkB,GACvB,wBAAwB,CAgC1B;AAED,+HAA+H;AAC/H,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAcxG;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CActF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,kBAAkB,CACtC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,EAChD,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAAC,oBAAoB,EAAE,GAAG,SAAS,CAAC,CAU7C"}
|
|
@@ -65,6 +65,7 @@ export function resolveCliBuildParams(buildParamsConfig, args) {
|
|
|
65
65
|
cli: args.cli,
|
|
66
66
|
fromFile,
|
|
67
67
|
env: process.env,
|
|
68
|
+
...(args.flags ? { flags: args.flags } : {}),
|
|
68
69
|
});
|
|
69
70
|
for (const message of resolution.errors) {
|
|
70
71
|
errors.push(formatError({ message }));
|
|
@@ -72,21 +73,26 @@ export function resolveCliBuildParams(buildParamsConfig, args) {
|
|
|
72
73
|
if (errors.length > 0) {
|
|
73
74
|
return { success: false, provenance: [], errors };
|
|
74
75
|
}
|
|
76
|
+
if (args.echo !== false)
|
|
77
|
+
echoBuildParams(resolution.provenance, args.verbose);
|
|
78
|
+
return { success: true, provenance: resolution.provenance, errors: [] };
|
|
79
|
+
}
|
|
80
|
+
/** Print a successful resolution: the one-line summary, or every value under `--verbose` or `CHANT_PARAM_ECHO=all` (#1424). */
|
|
81
|
+
export function echoBuildParams(provenance, verboseFlag) {
|
|
75
82
|
// #1424 — one line by default. A project with two dozen declared
|
|
76
83
|
// parameters printed two dozen grey lines on every build, ahead of the
|
|
77
84
|
// warnings the reader actually needed. The count by source still answers
|
|
78
85
|
// "did my override reach the build" (the failure mode
|
|
79
86
|
// warnIfParamsCannotReachProject exists for); --verbose names every value.
|
|
80
|
-
const verbose =
|
|
87
|
+
const verbose = verboseFlag === true || process.env.CHANT_PARAM_ECHO === "all";
|
|
81
88
|
if (verbose) {
|
|
82
|
-
for (const p of
|
|
89
|
+
for (const p of provenance) {
|
|
83
90
|
console.error(formatInfo(`[param] ${p.name} = ${JSON.stringify(p.value)} (${p.source})`));
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
|
-
else if (
|
|
87
|
-
console.error(formatInfo(summarizeBuildParams(
|
|
93
|
+
else if (provenance.length > 0) {
|
|
94
|
+
console.error(formatInfo(summarizeBuildParams(provenance)));
|
|
88
95
|
}
|
|
89
|
-
return { success: true, provenance: resolution.provenance, errors: [] };
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
92
98
|
* `N build parameters resolved (1 from cli, 3 default); --verbose to list` —
|
|
@@ -95,9 +101,12 @@ export function resolveCliBuildParams(buildParamsConfig, args) {
|
|
|
95
101
|
*/
|
|
96
102
|
export function summarizeBuildParams(provenance) {
|
|
97
103
|
const counts = new Map();
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
// Every flag source (`flag:<name>`, #4024) counts as one, "from flags".
|
|
105
|
+
for (const p of provenance) {
|
|
106
|
+
const source = p.source.startsWith("flag:") ? "flags" : p.source;
|
|
107
|
+
counts.set(source, (counts.get(source) ?? 0) + 1);
|
|
108
|
+
}
|
|
109
|
+
const order = ["cli", "params-file", "env", "flags", "default"];
|
|
101
110
|
const rank = (s) => (order.includes(s) ? order.indexOf(s) : order.length);
|
|
102
111
|
const parts = [...counts.keys()]
|
|
103
112
|
.sort((a, b) => rank(a) - rank(b))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAepC,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE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AED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAItD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GACxC,MAAM,IAAI,CAmCZ"}
|
|
@@ -4,7 +4,7 @@ import { resolveBuildModes, resolveProjectBuildOptions } from "../build-options.
|
|
|
4
4
|
import { resolveTelemetryAttribution } from "../../telemetry-attribution.js";
|
|
5
5
|
import { loadOkfBundle } from "../../okf-read.js";
|
|
6
6
|
import { unknownEnvError } from "../../env.js";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveFlaggedBuildParams } from "../../flag-params.js";
|
|
8
8
|
import { runPostSynthChecks } from "../../lint/post-synth.js";
|
|
9
9
|
import { loadActivityContracts } from "../../op/activity-contract-registry.js";
|
|
10
10
|
import { isOpEntity } from "../../op/resource.js";
|
|
@@ -152,11 +152,14 @@ export async function buildCommand(options) {
|
|
|
152
152
|
// project's own `params.ts` does before migrating to this mechanism). Also
|
|
153
153
|
// logs a one-line count on success, or every resolved value (`[param] name =
|
|
154
154
|
// value (source)`) under --verbose (#1424).
|
|
155
|
-
|
|
155
|
+
// #4024: in a workspace member, a build for an environment also reads the
|
|
156
|
+
// flag records that back its parameters, and refuses an override of one
|
|
157
|
+
// where the environment has a gate (../../flag-params.ts).
|
|
158
|
+
const paramsResolution = await resolveFlaggedBuildParams(configDir, config.buildParams, {
|
|
156
159
|
cli: options.params,
|
|
157
160
|
paramsFile: options.paramsFile,
|
|
158
161
|
verbose: options.verbose,
|
|
159
|
-
});
|
|
162
|
+
}, options.env);
|
|
160
163
|
if (!paramsResolution.success) {
|
|
161
164
|
errors.push(...paramsResolution.errors);
|
|
162
165
|
return { success: false, resourceCount: 0, fileCount: 0, errors, warnings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve.d.ts","sourceRo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CAAC;CACjC;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC3D;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC;AA0ClB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAmX9B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,oBAAoB,EAC5B,KAAK,EAAE,oBAAoB,EAAE,EAC7B,QAAQ,EAAE,iBAAiB,GAAG,SAAS,EACvC,OAAO,GAAE,SAAS,iBAAiB,EAA+B,GACjE,MAAM,EAAE,CA8BV"}
|
|
@@ -163,6 +163,43 @@ export async function runApprove(ctx) {
|
|
|
163
163
|
: `Run \`chant run ${opName}\` and it walks through gate "${gate}".`)));
|
|
164
164
|
return 0;
|
|
165
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Refuse the approval of a release gate whose release is revoked (#4033,
|
|
168
|
+
* ws-105): its commit carries a `ci/revoked/<sha>` tag that counts, read from
|
|
169
|
+
* local tags as `release cut` reads them. Prints the refusal and returns true
|
|
170
|
+
* when it refuses. A release file that can't be read, or tags that can't be
|
|
171
|
+
* judged, refuse too, since whether the release is revoked is then unknown.
|
|
172
|
+
*/
|
|
173
|
+
async function refuseRevokedRelease(opName, gate, releaseDigest, cwd) {
|
|
174
|
+
const { readRelease, readCuts, labelsByDigest } = await import("../../lifecycle/release-store.js");
|
|
175
|
+
const { readRevokedCommits, revocationOf, revokedRefusal } = await import("../../lifecycle/release-revocation.js");
|
|
176
|
+
const release = await readRelease(releaseDigest, { cwd }).catch(() => null);
|
|
177
|
+
if (!release) {
|
|
178
|
+
console.error(formatError({
|
|
179
|
+
message: `Gate "${gate}" on "${opName}" binds release ${releaseDigest}, which can't be read from ${LIFECYCLE_BRANCH}, so whether it is revoked is unknown [release-unreadable]`,
|
|
180
|
+
hint: `Fetch the ledger branch (git fetch origin ${LIFECYCLE_BRANCH}:${LIFECYCLE_BRANCH}) and approve again from the member's directory.`,
|
|
181
|
+
}));
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
let revoked;
|
|
185
|
+
try {
|
|
186
|
+
revoked = await readRevokedCommits(cwd);
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
console.error(formatError({
|
|
190
|
+
message: `Gate "${gate}" on "${opName}" binds release ${releaseDigest}, and the ci tags can't be judged: ${err instanceof Error ? err.message : String(err)} [declaration-invalid]`,
|
|
191
|
+
hint: "Fix ci.green in chant.workspace.json at base; chant workspace check names the problem.",
|
|
192
|
+
}));
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
const r = revocationOf(release, revoked);
|
|
196
|
+
if (!r)
|
|
197
|
+
return false;
|
|
198
|
+
const label = labelsByDigest((await readCuts({ cwd }).catch(() => ({ cuts: [] }))).cuts).get(releaseDigest) ?? null;
|
|
199
|
+
console.error(formatError(revokedRefusal({ releaseDigest, label }, r, `Clear the pending gate with \`chant approve ${opName} ${gate} --expire\`, then promote a release cut from a green commit: ` +
|
|
200
|
+
"`chant ci last-green` names the newest, and `chant release list` marks the revoked releases.")));
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
166
203
|
/**
|
|
167
204
|
* The ledger write behind `chant approve` — extracted so `chant run approve`
|
|
168
205
|
* (#2121) records the identical fact before waking the runtime that hosts the
|
|
@@ -294,6 +331,14 @@ export async function recordGateApproval(opName, gate, opts) {
|
|
|
294
331
|
// planned for. An approval of that fact's plan is for that release too; an
|
|
295
332
|
// approval of another plan names none, and no release gate counts it.
|
|
296
333
|
const releaseDigest = standing?.releaseDigest !== undefined && samePlanDigest(planDigest, standing.planDigest) ? standing.releaseDigest : undefined;
|
|
334
|
+
// #4033 (ws-105): a release gate whose release was cut from a revoked
|
|
335
|
+
// commit is superseded. Its promote refuses the release, so an approval of
|
|
336
|
+
// it would count for nothing; refuse it here, whatever plan is named.
|
|
337
|
+
if (standing?.releaseDigest !== undefined) {
|
|
338
|
+
const refused = await refuseRevokedRelease(opName, gate, standing.releaseDigest, opts.cwd ?? process.cwd());
|
|
339
|
+
if (refused)
|
|
340
|
+
return { ok: false };
|
|
341
|
+
}
|
|
297
342
|
// chant#2384 — the gate's whole value is that its two halves have different
|
|
298
343
|
// authors. At a shell they do: a person runs, reads the plan, and approves.
|
|
299
344
|
// On MCP and ACP the person's only act was launching the server, and every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAyLlD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkJnE"}
|
|
@@ -7,6 +7,19 @@ import { loadChantConfigUpward } from "../../config.js";
|
|
|
7
7
|
import { resolveCliBuildParams, parseParamFlags } from "../build-params-cli.js";
|
|
8
8
|
import { findWorkspaceRoot } from "../../project-root.js";
|
|
9
9
|
import { resolvePromotionSource } from "../../components/promote-order.js";
|
|
10
|
+
/**
|
|
11
|
+
* The `prLoop` generator option from `--pr-loop`'s flags (#3183): the gate
|
|
12
|
+
* and the branch, and with `--events-json` and `--report-url` (#4007) the
|
|
13
|
+
* flags the generated jobs pass to pr-plan and pr-apply.
|
|
14
|
+
*/
|
|
15
|
+
function prLoopOption(args) {
|
|
16
|
+
return {
|
|
17
|
+
...(args.gate ? { gate: args.gate } : {}),
|
|
18
|
+
...(args.branch ? { branch: args.branch } : {}),
|
|
19
|
+
...(args.eventsJson ? { events: true } : {}),
|
|
20
|
+
...(args.reportUrl ? { reportUrl: args.reportUrl } : {}),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
10
23
|
/**
|
|
11
24
|
* `chant build --components --generate <lexicon>` — generate mode (#563,
|
|
12
25
|
* epic #551 Phase 3). Discovers `Component` declarations under `args.path`
|
|
@@ -82,7 +95,7 @@ async function runGenerateComponents(ctx) {
|
|
|
82
95
|
params: args.param,
|
|
83
96
|
paramsFile: args.paramsFile,
|
|
84
97
|
...(args.waveGate ? { waveGate: { gate: args.waveGate, ...(args.canary?.length ? { canary: args.canary } : {}), ...(args.base ? { base: args.base } : {}) } } : {}),
|
|
85
|
-
...(args.prLoop ? { prLoop:
|
|
98
|
+
...(args.prLoop ? { prLoop: prLoopOption(args) } : {}),
|
|
86
99
|
...(args.image ? { image: args.image } : {}),
|
|
87
100
|
...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
|
|
88
101
|
});
|
|
@@ -109,9 +122,7 @@ async function runGenerateComponents(ctx) {
|
|
|
109
122
|
? { gatedWaves: { gate: args.waveGate, ...(args.canary?.length ? { canary: args.canary } : {}), ...(args.base ? { base: args.base } : {}) } }
|
|
110
123
|
: {}),
|
|
111
124
|
// #3183: a plan job per pull request and an apply job per merge.
|
|
112
|
-
...(args.prLoop
|
|
113
|
-
? { prLoop: { ...(args.gate ? { gate: args.gate } : {}), ...(args.branch ? { branch: args.branch } : {}) } }
|
|
114
|
-
: {}),
|
|
125
|
+
...(args.prLoop ? { prLoop: prLoopOption(args) } : {}),
|
|
115
126
|
// #4002: the job image and the lines that install what it lacks, chant itself included.
|
|
116
127
|
...(args.image ? { image: args.image } : {}),
|
|
117
128
|
...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
|
|
@@ -34,6 +34,15 @@
|
|
|
34
34
|
* the plan before the gate is decided, and the digest is carried rather than
|
|
35
35
|
* recomputed, so the approval still stands.
|
|
36
36
|
*
|
|
37
|
+
* The approval and the progress are bound to different things (#4081). The
|
|
38
|
+
* approval is bound to the plan digest, the derivation: who runs, in what
|
|
39
|
+
* order, off which edges. The progress is bound to each component's input
|
|
40
|
+
* digest (../../components/fan-out-inputs.ts): a component the earlier
|
|
41
|
+
* attempt applied stays `already-applied` only while what it would apply is
|
|
42
|
+
* the same, and one whose template, step inputs or upstream moved runs again
|
|
43
|
+
* with a line saying so. The fix after a failure keeps the approval, and a
|
|
44
|
+
* different change of the same shape does not inherit the progress.
|
|
45
|
+
*
|
|
37
46
|
* `--wave-gate <name>` (#3049) swaps the one gate for one per wave: the same
|
|
38
47
|
* repeated command stops at each wave's gate in turn, each planned after the
|
|
39
48
|
* wave before it applied, and `chant approve fan-out <name>-wave-<n>` answers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fan-out.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/fan-out.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fan-out.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/fan-out.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,OAAO,EAA+C,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAe7F,OAAO,EAAmB,KAAK,YAAY,EAAuB,MAAM,0BAA0B,CAAC;AAMnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE;IACJ,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;CACjB,GACL,OAAO,CAAC;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA+ErE;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwT9E"}
|
|
@@ -34,6 +34,15 @@
|
|
|
34
34
|
* the plan before the gate is decided, and the digest is carried rather than
|
|
35
35
|
* recomputed, so the approval still stands.
|
|
36
36
|
*
|
|
37
|
+
* The approval and the progress are bound to different things (#4081). The
|
|
38
|
+
* approval is bound to the plan digest, the derivation: who runs, in what
|
|
39
|
+
* order, off which edges. The progress is bound to each component's input
|
|
40
|
+
* digest (../../components/fan-out-inputs.ts): a component the earlier
|
|
41
|
+
* attempt applied stays `already-applied` only while what it would apply is
|
|
42
|
+
* the same, and one whose template, step inputs or upstream moved runs again
|
|
43
|
+
* with a line saying so. The fix after a failure keeps the approval, and a
|
|
44
|
+
* different change of the same shape does not inherit the progress.
|
|
45
|
+
*
|
|
37
46
|
* `--wave-gate <name>` (#3049) swaps the one gate for one per wave: the same
|
|
38
47
|
* repeated command stops at each wave's gate in turn, each planned after the
|
|
39
48
|
* wave before it applied, and `chant approve fan-out <name>-wave-<n>` answers
|
|
@@ -48,6 +57,7 @@ import { changedFilesBetween, lexiconChangedUnits } from "../../components/chang
|
|
|
48
57
|
import { deriveFanOut, fanOutRegistry } from "../../components/fan-out-support.js";
|
|
49
58
|
import { EarlierWaveNotAppliedError, runFanOut } from "../../components/fan-out-run.js";
|
|
50
59
|
import { readFanOutAttempt, writeFanOutAttempt } from "../../components/fan-out-record.js";
|
|
60
|
+
import { componentInputDigests, progressThatCarries } from "../../components/fan-out-inputs.js";
|
|
51
61
|
import { describeChangedWave, withWaveRecord } from "../../gated-waves.js";
|
|
52
62
|
import { renderFanOutHuman, renderFanOutJson, renderFanOutPlan } from "../../components/fan-out-output.js";
|
|
53
63
|
import { ndjsonProgressSink } from "../../components/run-progress.js";
|
|
@@ -233,7 +243,12 @@ export async function runComponentsFanOut(ctx) {
|
|
|
233
243
|
// real run happens inside `runFanOut`, before the gate is decided, so an
|
|
234
244
|
// approval survives the resume rather than being re-asked for.
|
|
235
245
|
const resumePath = args.resume ? resolve(args.resume) : undefined;
|
|
246
|
+
// What each component would apply now (#4081). The record keeps it for
|
|
247
|
+
// every component that applies, and a later attempt carries progress only
|
|
248
|
+
// where it is unchanged.
|
|
249
|
+
const inputsNow = resumePath ? componentInputDigests(derived.components, { projectRoot: projectPath, env: args.env ?? "local" }) : {};
|
|
236
250
|
let priorCompleted = [];
|
|
251
|
+
let priorInputs = {};
|
|
237
252
|
let priorOutputs = {};
|
|
238
253
|
let priorWaves = [];
|
|
239
254
|
let priorCarried = {};
|
|
@@ -259,9 +274,27 @@ export async function runComponentsFanOut(ctx) {
|
|
|
259
274
|
// as progress would block their subtrees again on the very run that
|
|
260
275
|
// exists to retry them — the operator repeated the command precisely
|
|
261
276
|
// because the thing that failed is now expected to work.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
277
|
+
//
|
|
278
|
+
// And only the part of `completed` whose input is the same now (#4081).
|
|
279
|
+
// The plan digest identifies the derivation, which a different change
|
|
280
|
+
// of the same shape shares; the input digest says what was applied.
|
|
281
|
+
const split = progressThatCarries(attempt, inputsNow);
|
|
282
|
+
if (split.unrecorded && split.changed.length > 0) {
|
|
283
|
+
console.error(formatWarning({
|
|
284
|
+
message: `--resume: "${args.resume}" does not record what each component applied, so none of its progress carries`,
|
|
285
|
+
hint: "It was written before chant recorded component inputs. Everything selected will run.",
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
for (const name of split.changed) {
|
|
290
|
+
console.error(formatInfo(`${name}: changed since the earlier attempt, so it runs again`));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const carried = new Set(split.carried);
|
|
294
|
+
priorCompleted = split.carried;
|
|
295
|
+
priorInputs = Object.fromEntries(split.carried.map((name) => [name, inputsNow[name]]));
|
|
296
|
+
priorOutputs = Object.fromEntries(Object.entries(attempt.outputs).filter(([name]) => carried.has(name)));
|
|
297
|
+
progress = { completed: split.carried };
|
|
265
298
|
priorWaves = attempt.waves ?? [];
|
|
266
299
|
// What steps kept per member (#3459), such as a choudoufu root's wave
|
|
267
300
|
// resume file. Each step decides whether what it kept still applies.
|
|
@@ -298,6 +331,7 @@ export async function runComponentsFanOut(ctx) {
|
|
|
298
331
|
// runner, ctrl-c) then still knows that the first two applied, and the
|
|
299
332
|
// repeated command picks up from there instead of redoing them.
|
|
300
333
|
const completedSoFar = new Set(priorCompleted);
|
|
334
|
+
const inputsSoFar = { ...priorInputs };
|
|
301
335
|
const failedSoFar = [];
|
|
302
336
|
const outputsSoFar = { ...priorOutputs };
|
|
303
337
|
let wavesSoFar = priorWaves;
|
|
@@ -310,6 +344,7 @@ export async function runComponentsFanOut(ctx) {
|
|
|
310
344
|
completed: [...completedSoFar].sort(),
|
|
311
345
|
failed: [...failedSoFar].sort(),
|
|
312
346
|
outputs: outputsSoFar,
|
|
347
|
+
inputs: Object.fromEntries(Object.entries(inputsSoFar).sort(([a], [b]) => a.localeCompare(b))),
|
|
313
348
|
...(wavesSoFar.length > 0 ? { waves: wavesSoFar } : {}),
|
|
314
349
|
...(Object.keys(carriedSoFar).length > 0 ? { carried: carriedSoFar } : {}),
|
|
315
350
|
};
|
|
@@ -355,6 +390,8 @@ export async function runComponentsFanOut(ctx) {
|
|
|
355
390
|
onComponentSettled: (settled, outputs) => {
|
|
356
391
|
if (settled.status === "ok") {
|
|
357
392
|
completedSoFar.add(settled.component);
|
|
393
|
+
if (inputsNow[settled.component] !== undefined)
|
|
394
|
+
inputsSoFar[settled.component] = inputsNow[settled.component];
|
|
358
395
|
if (outputs)
|
|
359
396
|
outputsSoFar[settled.component] = outputs;
|
|
360
397
|
}
|