@intentius/chant 0.124.23 → 0.124.25
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/ci-jobs.d.ts +41 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +48 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +14 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +9 -0
- package/dist/cli/handlers/emulator.d.ts +13 -2
- package/dist/cli/handlers/emulator.d.ts.map +1 -1
- package/dist/cli/handlers/emulator.js +63 -3
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +7 -1
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +5 -4
- package/dist/cli/handlers/run.d.ts +4 -3
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +73 -9
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +38 -11
- package/dist/cli/mcp/workspace-tools.d.ts +3 -3
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.js +27 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +31 -0
- package/dist/cli/registry.d.ts +12 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +45 -6
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +97 -22
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +25 -10
- package/dist/effect-receipt.d.ts +13 -0
- package/dist/effect-receipt.d.ts.map +1 -1
- package/dist/effect-receipt.js +19 -0
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-detail.js +24 -2
- package/dist/lexicon-module.d.ts +7 -1
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +7 -2
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +62 -6
- package/dist/lifecycle/no-record.d.ts +59 -0
- package/dist/lifecycle/no-record.d.ts.map +1 -0
- package/dist/lifecycle/no-record.js +88 -0
- package/dist/lifecycle/receipt-plan.d.ts.map +1 -1
- package/dist/lifecycle/receipt-plan.js +4 -2
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/shell.js +30 -9
- package/dist/op/emulator-lifecycle.d.ts +23 -0
- package/dist/op/emulator-lifecycle.d.ts.map +1 -1
- package/dist/op/emulator-lifecycle.js +39 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +3 -0
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/local-executor.d.ts +10 -0
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +71 -7
- package/dist/op/op-waves-notify.d.ts +2 -0
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +9 -3
- package/dist/op/op-waves-run.d.ts +8 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +36 -11
- package/dist/op/op-waves.d.ts +85 -1
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +153 -1
- package/dist/op/receipt-store.d.ts +5 -0
- package/dist/op/receipt-store.d.ts.map +1 -1
- package/dist/op/receipt-store.js +4 -3
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/runtimes/local.js +6 -0
- package/dist/op/step-console.d.ts +65 -0
- package/dist/op/step-console.d.ts.map +1 -0
- package/dist/op/step-console.js +140 -0
- package/dist/op/step-output-ref.d.ts +26 -18
- package/dist/op/step-output-ref.d.ts.map +1 -1
- package/dist/op/step-output-ref.js +86 -63
- package/dist/point-decision.d.ts.map +1 -1
- package/dist/point-decision.js +3 -0
- package/dist/wave-runtime.mjs +239 -239
- package/dist/workspace/agent-cli.d.ts.map +1 -1
- package/dist/workspace/agent-cli.js +3 -0
- package/dist/workspace/compose-graph.d.ts +22 -3
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +18 -5
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
- package/dist/workspace/conformance/writer.js +1 -1
- package/dist/workspace/decide.d.ts +51 -9
- package/dist/workspace/decide.d.ts.map +1 -1
- package/dist/workspace/decide.js +125 -14
- package/dist/workspace/graph.schema.json +68 -1
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.js +20 -11
- package/dist/workspace/nested-graph.d.ts +1 -1
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +5 -1
- package/dist/workspace/point-answer.schema.json +16 -1
- package/dist/workspace/points-cli.d.ts +5 -3
- package/dist/workspace/points-cli.d.ts.map +1 -1
- package/dist/workspace/points-cli.js +16 -7
- package/dist/workspace/points-write.schema.json +39 -4
- package/dist/workspace/points.schema.json +42 -3
- package/dist/workspace/reason-codes.d.ts +2 -1
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +2 -1
- package/dist/workspace/records-cli.d.ts +12 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +27 -7
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records-write.js +2 -3
- package/dist/workspace/records.d.ts +10 -4
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +16 -3
- package/dist/workspace/records.schema.json +2 -1
- package/dist/workspace/runs.d.ts.map +1 -1
- package/dist/workspace/runs.js +4 -2
- package/dist/workspace/trust/verify-cli.d.ts.map +1 -1
- package/dist/workspace/trust/verify-cli.js +2 -1
- package/dist/workspace/trust/verify.d.ts +22 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -1
- package/dist/workspace/trust/verify.js +94 -14
- package/dist/workspace/write-scope.d.ts +3 -1
- package/dist/workspace/write-scope.d.ts.map +1 -1
- package/dist/workspace/write-scope.js +11 -4
- package/package.json +1 -1
- package/src/ci-jobs.ts +58 -1
- package/src/cli/commands/build.ts +18 -0
- package/src/cli/compiled-cli.e2e.test.ts +45 -1
- package/src/cli/handlers/approve.ts +9 -0
- package/src/cli/handlers/emulator.test.ts +61 -1
- package/src/cli/handlers/emulator.ts +65 -4
- package/src/cli/handlers/promote.test.ts +7 -0
- package/src/cli/handlers/promote.ts +7 -1
- package/src/cli/handlers/run-no-record.e2e.test.ts +87 -0
- package/src/cli/handlers/run-wave.ts +5 -4
- package/src/cli/handlers/run.test.ts +126 -0
- package/src/cli/handlers/run.ts +69 -9
- package/src/cli/main.test.ts +34 -0
- package/src/cli/main.ts +38 -11
- package/src/cli/mcp/workspace-tools.e2e.test.ts +1 -1
- package/src/cli/mcp/workspace-tools.ts +27 -4
- package/src/cli/parse-args.ts +21 -0
- package/src/cli/registry.ts +12 -0
- package/src/components/cli-support.test.ts +75 -0
- package/src/components/cli-support.ts +130 -25
- package/src/components/driver.test.ts +28 -0
- package/src/components/driver.ts +23 -10
- package/src/components/generate-disabled.test.ts +56 -0
- package/src/effect-receipt.ts +22 -0
- package/src/graph-ci-edges.test.ts +50 -0
- package/src/graph-detail.ts +21 -2
- package/src/lexicon-module.ts +9 -2
- package/src/lifecycle/git.ts +61 -6
- package/src/lifecycle/no-record.test.ts +175 -0
- package/src/lifecycle/no-record.ts +108 -0
- package/src/lifecycle/receipt-plan.test.ts +9 -0
- package/src/lifecycle/receipt-plan.ts +4 -1
- package/src/op/activities/shell.ts +28 -6
- package/src/op/effect-step.test.ts +95 -1
- package/src/op/emulator-lifecycle.test.ts +24 -1
- package/src/op/emulator-lifecycle.ts +58 -2
- package/src/op/gate.ts +3 -0
- package/src/op/index.ts +1 -1
- package/src/op/local-executor.test.ts +65 -0
- package/src/op/local-executor.ts +88 -8
- package/src/op/op-waves-jobs.test.ts +213 -0
- package/src/op/op-waves-notify.ts +11 -5
- package/src/op/op-waves-run.ts +42 -11
- package/src/op/op-waves.ts +202 -2
- package/src/op/receipt-store.ts +13 -3
- package/src/op/runtimes/local.ts +6 -0
- package/src/op/step-console.test.ts +150 -0
- package/src/op/step-console.ts +155 -0
- package/src/op/step-output-ref.test.ts +68 -24
- package/src/op/step-output-ref.ts +85 -65
- package/src/point-decision-bundle.test.ts +1 -0
- package/src/point-decision.ts +3 -0
- package/src/workspace/agent-cli.ts +2 -0
- package/src/workspace/compose-graph.test.ts +55 -0
- package/src/workspace/compose-graph.ts +28 -6
- package/src/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
- package/src/workspace/conformance/writer.ts +1 -1
- package/src/workspace/decide.test.ts +87 -3
- package/src/workspace/decide.ts +142 -17
- package/src/workspace/graph-contract.test.ts +26 -1
- package/src/workspace/graph.schema.json +68 -1
- package/src/workspace/lineage-upgrade.test.ts +21 -0
- package/src/workspace/lineage-upgrade.ts +19 -11
- package/src/workspace/nested-graph.test.ts +14 -0
- package/src/workspace/nested-graph.ts +7 -2
- package/src/workspace/point-answer.schema.json +16 -1
- package/src/workspace/points-cli.ts +16 -8
- package/src/workspace/points-write.schema.json +39 -4
- package/src/workspace/points.schema.json +42 -3
- package/src/workspace/reason-codes.ts +2 -1
- package/src/workspace/record-assets.test.ts +14 -0
- package/src/workspace/records-cli.ts +28 -7
- package/src/workspace/records-write-commands.e2e.test.ts +32 -0
- package/src/workspace/records-write.ts +2 -3
- package/src/workspace/records.schema.json +2 -1
- package/src/workspace/records.ts +17 -4
- package/src/workspace/runs.ts +4 -2
- package/src/workspace/trust/trust.test.ts +105 -0
- package/src/workspace/trust/verify-cli.ts +2 -1
- package/src/workspace/trust/verify.ts +106 -13
- package/src/workspace/write-scope.test.ts +18 -0
- package/src/workspace/write-scope.ts +16 -5
|
@@ -134,6 +134,25 @@ export async function computeComponentGraph(path, sandbox, buildParams) {
|
|
|
134
134
|
throw err;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* The components an "all" run takes, in `discovered` order (chant #1522). A
|
|
139
|
+
* seam-gated component (`enabled: false`, computed from this run's own
|
|
140
|
+
* params) sits out: the run deploys the estate the parameters describe, not
|
|
141
|
+
* the units the seams turned off. A disabled dependency is satisfied
|
|
142
|
+
* vacuously, since ordering is dependsOn's only meaning, so it is also
|
|
143
|
+
* stripped from the survivors' dependsOn rather than failing wave resolution
|
|
144
|
+
* as an unknown name. `chant run --components all`, a component list's
|
|
145
|
+
* dependency closure (#3950) and the generated pipelines (#3951) all select
|
|
146
|
+
* through this.
|
|
147
|
+
*/
|
|
148
|
+
export function withoutDisabled(discovered, components) {
|
|
149
|
+
const disabled = new Set(discovered.filter((c) => c.enabled === false).map((c) => c.name));
|
|
150
|
+
if (disabled.size === 0)
|
|
151
|
+
return components;
|
|
152
|
+
return components
|
|
153
|
+
.filter((c) => !disabled.has(c.name))
|
|
154
|
+
.map((c) => (c.dependsOn?.some((d) => disabled.has(d)) ? { ...c, dependsOn: c.dependsOn.filter((d) => !disabled.has(d)) } : c));
|
|
155
|
+
}
|
|
137
156
|
/**
|
|
138
157
|
* Load a lexicon's plugin (`@intentius/chant-lexicon-<name>`) to reach its
|
|
139
158
|
* `generateComponentPipeline`. Tolerant: returns null when the package can't be
|
|
@@ -185,11 +204,10 @@ buildParams) {
|
|
|
185
204
|
if (result.errors.length > 0) {
|
|
186
205
|
return { success: false, error: result.errors.map((e) => e.message).join("\n") };
|
|
187
206
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}));
|
|
207
|
+
// #3951: the pipeline holds the jobs `chant run --components all` would
|
|
208
|
+
// run, so a disabled component has no job and no other job needs it.
|
|
209
|
+
const discovered = [...result.components.values()].map(({ component }) => component);
|
|
210
|
+
const driverComponents = withoutDisabled(discovered, discovered.map((component) => ({ name: component.name, dependsOn: component.dependsOn, deploy: component.deploy })));
|
|
193
211
|
try {
|
|
194
212
|
const { yaml, stages, jobs, env } = plugin.generateComponentPipeline(driverComponents, options);
|
|
195
213
|
return { success: true, yaml, stages, jobs, ...(env ? { env } : {}), buildParams };
|
|
@@ -243,10 +261,14 @@ export function findComponentGate(component) {
|
|
|
243
261
|
};
|
|
244
262
|
return search(component.deploy) ?? search(component.rollback);
|
|
245
263
|
}
|
|
264
|
+
/** Whether `selector` is a comma-separated component list (#3950), as opposed to `all` or one name. */
|
|
265
|
+
export function isComponentList(selector) {
|
|
266
|
+
return selector.includes(",");
|
|
267
|
+
}
|
|
246
268
|
/**
|
|
247
|
-
* Discover every component under `path` and resolve `selector` (`"all"
|
|
248
|
-
* single component name
|
|
249
|
-
* check and no dispatch — just discovery + selection, factored out of
|
|
269
|
+
* Discover every component under `path` and resolve `selector` (`"all"`, a
|
|
270
|
+
* single component name, or a comma-separated list, #3950) to the
|
|
271
|
+
* `DriverComponent`(s) to run, with no gate check and no dispatch — just discovery + selection, factored out of
|
|
250
272
|
* `runComponents` so another entrypoint can reuse the exact same selection
|
|
251
273
|
* semantics without inheriting the run itself.
|
|
252
274
|
*/
|
|
@@ -259,19 +281,10 @@ buildParams) {
|
|
|
259
281
|
}
|
|
260
282
|
const discovered = [...result.components.values()].map(({ component }) => component);
|
|
261
283
|
const all = discovered.map((component) => toDriverComponent(component));
|
|
262
|
-
if (selector
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
// dependency is satisfied vacuously — ordering is dependsOn's only
|
|
267
|
-
// semantics — so it is also stripped from the survivors' dependsOn,
|
|
268
|
-
// rather than failing wave resolution as an unknown name.
|
|
269
|
-
const disabled = new Set(discovered.filter((c) => c.enabled === false).map((c) => c.name));
|
|
270
|
-
const targets = all
|
|
271
|
-
.filter((c) => !disabled.has(c.name))
|
|
272
|
-
.map((c) => (c.dependsOn?.some((d) => disabled.has(d)) ? { ...c, dependsOn: c.dependsOn.filter((d) => !disabled.has(d)) } : c));
|
|
273
|
-
return { success: true, targets };
|
|
274
|
-
}
|
|
284
|
+
if (isComponentList(selector))
|
|
285
|
+
return resolveComponentList(selector, discovered, all);
|
|
286
|
+
if (selector === "all")
|
|
287
|
+
return { success: true, targets: withoutDisabled(discovered, all) };
|
|
275
288
|
const found = all.find((c) => c.name === selector);
|
|
276
289
|
const disabledByName = discovered.find((c) => c.name === selector && c.enabled === false);
|
|
277
290
|
if (disabledByName) {
|
|
@@ -293,6 +306,61 @@ buildParams) {
|
|
|
293
306
|
}
|
|
294
307
|
return { success: true, targets: [found] };
|
|
295
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* A list selector (`a,b,c`, #3950): the named components plus every component
|
|
311
|
+
* they depend on, transitively, so the list runs as one dependency-ordered
|
|
312
|
+
* set. Refused before anything runs when a name is unknown, disabled, or `all`
|
|
313
|
+
* (which already means every component). Dependencies are followed through
|
|
314
|
+
* `withoutDisabled`, the selection `"all"` uses, so a disabled *dependency*
|
|
315
|
+
* is dropped and stripped from dependsOn exactly as `"all"` drops it. A
|
|
316
|
+
* dependsOn name that matches no discovered component is left in place, so
|
|
317
|
+
* wave resolution reports it as `"all"` would.
|
|
318
|
+
*/
|
|
319
|
+
function resolveComponentList(selector, discovered, all) {
|
|
320
|
+
const names = [...new Set(selector.split(",").map((n) => n.trim()).filter((n) => n.length > 0))];
|
|
321
|
+
if (names.length === 0) {
|
|
322
|
+
return { success: false, targets: [], error: `Component list "${selector}" names no components.` };
|
|
323
|
+
}
|
|
324
|
+
if (names.includes("all")) {
|
|
325
|
+
return { success: false, targets: [], error: `"all" cannot be part of a component list; pass --components all on its own, or name the components.` };
|
|
326
|
+
}
|
|
327
|
+
// An explicit ask for a unit the parameters excluded is a mistake to
|
|
328
|
+
// surface, not to skip silently, as it is for a single name.
|
|
329
|
+
const off = names.filter((n) => discovered.some((c) => c.name === n && c.enabled === false));
|
|
330
|
+
if (off.length > 0) {
|
|
331
|
+
const one = off.length === 1;
|
|
332
|
+
return {
|
|
333
|
+
success: false,
|
|
334
|
+
targets: [],
|
|
335
|
+
error: `${one ? "Component" : "Components"} ${off.map((n) => `"${n}"`).join(", ")} ${one ? "is" : "are"} disabled under this run's parameters (enabled: false). Enable the seam ${one ? "it is" : "they are"} gated on, or leave ${one ? "it" : "them"} out of the list.`,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const unknown = names.filter((n) => !all.some((c) => c.name === n));
|
|
339
|
+
if (unknown.length > 0) {
|
|
340
|
+
const known = all.map((c) => c.name).sort().join(", ");
|
|
341
|
+
return {
|
|
342
|
+
success: false,
|
|
343
|
+
targets: [],
|
|
344
|
+
error: `${unknown.length === 1 ? "Component" : "Components"} ${unknown.map((n) => `"${n}"`).join(", ")} not found.${known ? ` Known components: ${known}` : " No components discovered."}`,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
const enabled = withoutDisabled(discovered, all);
|
|
348
|
+
const byName = new Map(enabled.map((c) => [c.name, c]));
|
|
349
|
+
const included = new Set();
|
|
350
|
+
const visit = (name) => {
|
|
351
|
+
const component = byName.get(name);
|
|
352
|
+
if (!component || included.has(name))
|
|
353
|
+
return;
|
|
354
|
+
included.add(name);
|
|
355
|
+
for (const dep of component.dependsOn ?? [])
|
|
356
|
+
visit(dep);
|
|
357
|
+
};
|
|
358
|
+
for (const name of names)
|
|
359
|
+
visit(name);
|
|
360
|
+
const targets = enabled.filter((c) => included.has(c.name));
|
|
361
|
+
const named = new Set(names);
|
|
362
|
+
return { success: true, targets, added: targets.map((c) => c.name).filter((n) => !named.has(n)) };
|
|
363
|
+
}
|
|
296
364
|
export async function runComponents(path, selector, options = {}) {
|
|
297
365
|
const resolved = await resolveComponentTargets(path, selector, options.sandbox, options.buildParams);
|
|
298
366
|
if (!resolved.success) {
|
|
@@ -331,7 +399,14 @@ export async function runComponents(path, selector, options = {}) {
|
|
|
331
399
|
: await getHeadCommit({ cwd: existsSync(path) && statSync(path).isDirectory() ? path : dirname(path) }).catch(() => undefined);
|
|
332
400
|
const releaseIdentity = () => (revision ? { revision } : {});
|
|
333
401
|
try {
|
|
334
|
-
if (selector === "all") {
|
|
402
|
+
if (selector === "all" || isComponentList(selector)) {
|
|
403
|
+
if (isComponentList(selector) && options.onPlan) {
|
|
404
|
+
// Resolved here, before dispatch, so the order is printed before any
|
|
405
|
+
// component runs. A cycle or unknown dependency throws the same error
|
|
406
|
+
// `runInterpretDriver` would, caught below.
|
|
407
|
+
const graph = resolveComponentGraph(resolvedTargets);
|
|
408
|
+
options.onPlan({ order: graph.order, waves: graph.waves, added: resolved.added ?? [] });
|
|
409
|
+
}
|
|
335
410
|
const run = await runInterpretDriver(resolvedTargets, registry, {
|
|
336
411
|
env,
|
|
337
412
|
releaseIdentity,
|
|
@@ -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;
|
|
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;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAE1E,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,oG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AAmB;IAClC,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ,iIAAiI;IACjI,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,qKAAqK;IACrK,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,8KAA8K;IAC9K,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8HAA8H;IAC9H,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,yGAAyG;AACzG,wBAAgB,aAAa,CAC3B,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAA;CAAE,EAC9H,SAAS,EAAE,MAAM,GAChB,aAAa,CAGf;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,eAAe,EAAE,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,eAAe,CAAC,CAkE1B"}
|
|
@@ -49,6 +49,7 @@ import { topoSort } from "../codegen/topo-sort.js";
|
|
|
49
49
|
import { kahnLayers } from "./layers.js";
|
|
50
50
|
import { evaluateGate, gitGateLedgerPort } from "../op/gate.js";
|
|
51
51
|
import { gateName } from "../op/gate-name.js";
|
|
52
|
+
import { GateNotRecordableError } from "../lifecycle/no-record.js";
|
|
52
53
|
import { componentPlanDigest } from "./gate-plan.js";
|
|
53
54
|
import { isPromotedArtifact } from "./auto-release.js";
|
|
54
55
|
function isGateStep(step) {
|
|
@@ -275,17 +276,31 @@ async function runPhase(phaseDef, ctx, registry, phaseOutputs, componentOutputs,
|
|
|
275
276
|
const gateRecords = [];
|
|
276
277
|
for (const gate of phaseDef.steps.filter(isGateStep)) {
|
|
277
278
|
const start = Date.now();
|
|
278
|
-
const check = await evaluateGate(gates.port, {
|
|
279
|
-
op: ctx.component,
|
|
280
|
-
gate: gateName(gate),
|
|
281
|
-
// #2574: an approval counts only for this environment and this plan.
|
|
282
|
-
environment: ctx.env,
|
|
283
|
-
...(gates.planDigest !== undefined ? { planDigest: gates.planDigest } : {}),
|
|
284
|
-
...(gate.description ? { description: gate.description } : {}),
|
|
285
|
-
...(gate.timeout ? { timeout: gate.timeout } : {}),
|
|
286
|
-
...(gates.now ? { now: gates.now } : {}),
|
|
287
|
-
});
|
|
288
279
|
const base = { component: ctx.component, phase: phaseDef.phase, kind: `gate:${gateName(gate)}` };
|
|
280
|
+
let check;
|
|
281
|
+
try {
|
|
282
|
+
check = await evaluateGate(gates.port, {
|
|
283
|
+
op: ctx.component,
|
|
284
|
+
gate: gateName(gate),
|
|
285
|
+
// #2574: an approval counts only for this environment and this plan.
|
|
286
|
+
environment: ctx.env,
|
|
287
|
+
...(gates.planDigest !== undefined ? { planDigest: gates.planDigest } : {}),
|
|
288
|
+
...(gate.description ? { description: gate.description } : {}),
|
|
289
|
+
...(gate.timeout ? { timeout: gate.timeout } : {}),
|
|
290
|
+
...(gates.now ? { now: gates.now } : {}),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
catch (err) {
|
|
294
|
+
// #3955: a run that records nothing fails at the gate, as the Op
|
|
295
|
+
// executor's gate step does, and the component unwinds like any failure.
|
|
296
|
+
if (!(err instanceof GateNotRecordableError))
|
|
297
|
+
throw err;
|
|
298
|
+
gateRecords.push({ ...base, status: "fail", durationMs: Date.now() - start, error: err.message });
|
|
299
|
+
for (const skipped of phaseDef.steps.filter((s) => !isGateStep(s))) {
|
|
300
|
+
gateRecords.push(skippedRecord(skipped));
|
|
301
|
+
}
|
|
302
|
+
throw new StepFailure(gateRecords, []);
|
|
303
|
+
}
|
|
289
304
|
if (!check.satisfied) {
|
|
290
305
|
gateRecords.push({ ...base, status: "skipped", durationMs: Date.now() - start });
|
|
291
306
|
for (const skipped of phaseDef.steps.filter((s) => !isGateStep(s))) {
|
package/dist/effect-receipt.d.ts
CHANGED
|
@@ -58,6 +58,19 @@ export declare const EFFECT_RECEIPT_ENTITY_TYPE = "Chant::EffectReceipt";
|
|
|
58
58
|
* effect has run; anything else renders an effect-will-fire row (#1832).
|
|
59
59
|
*/
|
|
60
60
|
export declare const EXISTENCE_EXPECTATION = "chant.effect-receipt:exists";
|
|
61
|
+
/**
|
|
62
|
+
* A receipt expectation with the digest of the step outputs its effect read
|
|
63
|
+
* appended (#3948). The effect step writes this value, so the next run fires
|
|
64
|
+
* again when one of those outputs changed, though the declared inputs did not.
|
|
65
|
+
*/
|
|
66
|
+
export declare function withStepOutputs(expectation: string, outputs: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* The part of a stored receipt value that the declared inputs determine: the
|
|
69
|
+
* value without any step-output digest {@link withStepOutputs} appended. The
|
|
70
|
+
* plan and `receiptStaleness` compare this part, since step outputs exist only
|
|
71
|
+
* while the Op runs.
|
|
72
|
+
*/
|
|
73
|
+
export declare function declaredExpectation(value: string): string;
|
|
61
74
|
/**
|
|
62
75
|
* An effect receipt declaration — a Declarable, so discovery collects it,
|
|
63
76
|
* `chant list` shows it, and (unlike a secret declaration) serialization
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect-receipt.d.ts","sourceRoot":"","sources":["../src/effect-receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;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GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;CACjD,CAQA;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMpD;AA4DD;;8EAE8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,EAAE,CAI/E;AAmBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAW5E;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,oBAAoB,GAC7B,MAAM,CAIR"}
|
package/dist/effect-receipt.js
CHANGED
|
@@ -57,6 +57,25 @@ export const EFFECT_RECEIPT_ENTITY_TYPE = "Chant::EffectReceipt";
|
|
|
57
57
|
* effect has run; anything else renders an effect-will-fire row (#1832).
|
|
58
58
|
*/
|
|
59
59
|
export const EXISTENCE_EXPECTATION = "chant.effect-receipt:exists";
|
|
60
|
+
const OUTPUTS_SEPARATOR = "+outputs=";
|
|
61
|
+
/**
|
|
62
|
+
* A receipt expectation with the digest of the step outputs its effect read
|
|
63
|
+
* appended (#3948). The effect step writes this value, so the next run fires
|
|
64
|
+
* again when one of those outputs changed, though the declared inputs did not.
|
|
65
|
+
*/
|
|
66
|
+
export function withStepOutputs(expectation, outputs) {
|
|
67
|
+
return `${expectation}${OUTPUTS_SEPARATOR}${outputs}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The part of a stored receipt value that the declared inputs determine: the
|
|
71
|
+
* value without any step-output digest {@link withStepOutputs} appended. The
|
|
72
|
+
* plan and `receiptStaleness` compare this part, since step outputs exist only
|
|
73
|
+
* while the Op runs.
|
|
74
|
+
*/
|
|
75
|
+
export function declaredExpectation(value) {
|
|
76
|
+
const at = value.indexOf(OUTPUTS_SEPARATOR);
|
|
77
|
+
return at < 0 ? value : value.slice(0, at);
|
|
78
|
+
}
|
|
60
79
|
/**
|
|
61
80
|
* Declare an effect receipt. The returned object is a locked Declarable:
|
|
62
81
|
* declared fields are immutable, plain-data input structures are frozen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-detail.d.ts","sourceRoot":"","sources":["../src/graph-detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAkB,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAExC,eAAO,MAAM,MAAM;aACjB,MAAM,EAAE,CAAC;aACT,UAAU,EAAE,CAAC;aACb,WAAW,EAAE,CAAC;aACd,UAAU,EAAE,CAAC;CACL,CAAC;AAEX,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAYpE;
|
|
1
|
+
{"version":3,"file":"graph-detail.d.ts","sourceRoot":"","sources":["../src/graph-detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAkB,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAExC,eAAO,MAAM,MAAM;aACjB,MAAM,EAAE,CAAC;aACT,UAAU,EAAE,CAAC;aACb,WAAW,EAAE,CAAC;aACd,UAAU,EAAE,CAAC;CACL,CAAC;AAEX,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAYpE;AA+LD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAYtF"}
|
package/dist/graph-detail.js
CHANGED
|
@@ -63,7 +63,9 @@ function byLexiconOf(nodes) {
|
|
|
63
63
|
sorted[k] = out[k].sort();
|
|
64
64
|
return sorted;
|
|
65
65
|
}
|
|
66
|
-
/** T0 — collapse every resource to its lexicon; edges become cross-lexicon deps.
|
|
66
|
+
/** T0 — collapse every resource to its lexicon; edges become cross-lexicon deps.
|
|
67
|
+
* No groups: a pipeline never spans lexicons, so `byPipeline` would put every
|
|
68
|
+
* pipeline of a lexicon around that lexicon's one stack node (#3921). */
|
|
67
69
|
function toStacks(ir) {
|
|
68
70
|
const lexOf = new Map(ir.nodes.map((n) => [n.id, n.lexicon]));
|
|
69
71
|
const lexicons = [...new Set(ir.nodes.map((n) => n.lexicon))].sort();
|
|
@@ -141,10 +143,30 @@ function toComposites(ir) {
|
|
|
141
143
|
const imports = ir.imports?.filter((i) => surviving.has(i.node));
|
|
142
144
|
// Unresolved references (#3910) stay with whichever node now holds them.
|
|
143
145
|
const dangling = ir.dangling?.map((d) => ({ ...d, from: idMap.get(d.from) ?? d.from }));
|
|
146
|
+
// Pipeline membership (#3921) follows each member to the node that now holds
|
|
147
|
+
// it: a job inside a collapsed composite is drawn as that composite. A
|
|
148
|
+
// composite that spans two pipelines sits in both; a pipeline whose members
|
|
149
|
+
// all fell away is dropped.
|
|
150
|
+
const groups = { byLexicon: byLexiconOf(nodes) };
|
|
151
|
+
if (ir.groups.byPipeline) {
|
|
152
|
+
const byPipeline = {};
|
|
153
|
+
for (const name of Object.keys(ir.groups.byPipeline).sort()) {
|
|
154
|
+
const kept = new Set();
|
|
155
|
+
for (const m of ir.groups.byPipeline[name]) {
|
|
156
|
+
const id = idMap.get(m) ?? m;
|
|
157
|
+
if (surviving.has(id))
|
|
158
|
+
kept.add(id);
|
|
159
|
+
}
|
|
160
|
+
if (kept.size)
|
|
161
|
+
byPipeline[name] = [...kept].sort();
|
|
162
|
+
}
|
|
163
|
+
if (Object.keys(byPipeline).length)
|
|
164
|
+
groups.byPipeline = byPipeline;
|
|
165
|
+
}
|
|
144
166
|
return {
|
|
145
167
|
nodes,
|
|
146
168
|
edges: sortEdges([...seen.values()]),
|
|
147
|
-
groups
|
|
169
|
+
groups,
|
|
148
170
|
...(imports && imports.length ? { imports } : {}),
|
|
149
171
|
...(dangling && dangling.length ? { dangling } : {}),
|
|
150
172
|
};
|
package/dist/lexicon-module.d.ts
CHANGED
|
@@ -93,8 +93,14 @@ export declare function resetLexiconModules(): void;
|
|
|
93
93
|
* Import the module a path-declared lexicon names. Returns `undefined` when
|
|
94
94
|
* `name` is package-backed, so a caller falls through to its package import.
|
|
95
95
|
* An import failure is thrown with the declared path in the message.
|
|
96
|
+
*
|
|
97
|
+
* `typeScript: false` imports it with plain node, without registering tsx
|
|
98
|
+
* (#3276): tsx's ESM hooks run on a thread of their own, which costs the
|
|
99
|
+
* compiled CLI about 200 MB, so a caller whose module is JavaScript says so.
|
|
96
100
|
*/
|
|
97
|
-
export declare function importLexiconModule(name: string
|
|
101
|
+
export declare function importLexiconModule(name: string, options?: {
|
|
102
|
+
typeScript?: boolean;
|
|
103
|
+
}): Promise<Record<string, unknown> | undefined>;
|
|
98
104
|
/**
|
|
99
105
|
* chant#2578 — how a message should name a lexicon. A package-backed name is
|
|
100
106
|
* its npm package; a lexicon declared by path is that path, relative to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon-module.d.ts","sourceRoot":"","sources":["../src/lexicon-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,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AAO,CAAC,CAAC,CAW1H"}
|
package/dist/lexicon-module.js
CHANGED
|
@@ -150,13 +150,18 @@ export function resetLexiconModules() {
|
|
|
150
150
|
* Import the module a path-declared lexicon names. Returns `undefined` when
|
|
151
151
|
* `name` is package-backed, so a caller falls through to its package import.
|
|
152
152
|
* An import failure is thrown with the declared path in the message.
|
|
153
|
+
*
|
|
154
|
+
* `typeScript: false` imports it with plain node, without registering tsx
|
|
155
|
+
* (#3276): tsx's ESM hooks run on a thread of their own, which costs the
|
|
156
|
+
* compiled CLI about 200 MB, so a caller whose module is JavaScript says so.
|
|
153
157
|
*/
|
|
154
|
-
export async function importLexiconModule(name) {
|
|
158
|
+
export async function importLexiconModule(name, options = {}) {
|
|
155
159
|
const path = modulePaths.get(name);
|
|
156
160
|
if (path === undefined)
|
|
157
161
|
return undefined;
|
|
158
162
|
try {
|
|
159
|
-
|
|
163
|
+
if (options.typeScript !== false)
|
|
164
|
+
ensureTypeScriptLoader();
|
|
160
165
|
return esModuleNamespace((await import(path)));
|
|
161
166
|
}
|
|
162
167
|
catch (err) {
|
package/dist/lifecycle/git.d.ts
CHANGED
|
@@ -241,6 +241,10 @@ export type LifecyclePushStatus = {
|
|
|
241
241
|
commit: string;
|
|
242
242
|
} | {
|
|
243
243
|
status: "no-remote";
|
|
244
|
+
}
|
|
245
|
+
/** Recording is off for this process (#3955, ./no-record.ts): nothing was written to the branch, so nothing was pushed. */
|
|
246
|
+
| {
|
|
247
|
+
status: "not-recorded";
|
|
244
248
|
} | {
|
|
245
249
|
status: "stale";
|
|
246
250
|
remote: string;
|
|
@@ -578,6 +582,13 @@ export declare function fetchRef(ref: string, opts?: {
|
|
|
578
582
|
export declare function getHeadCommit(opts?: {
|
|
579
583
|
cwd?: string;
|
|
580
584
|
}): Promise<string>;
|
|
585
|
+
/**
|
|
586
|
+
* What a read names to see the ledger: `chant/lifecycle`, or, in a run that
|
|
587
|
+
* records nothing (#3955), the in-memory tip its own writes built, once it
|
|
588
|
+
* has written. Reads outside this module that name the branch themselves go
|
|
589
|
+
* through here so they see the run's writes too.
|
|
590
|
+
*/
|
|
591
|
+
export declare function ledgerRevision(cwd?: string): Promise<string>;
|
|
581
592
|
/**
|
|
582
593
|
* The branch's read side as a {@link LedgerReadPort} for the member `opts`
|
|
583
594
|
* names (#3865): what the bundle-safe readers (`./release-read.ts`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yHAAyH;IACzH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACpC,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAmFD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC1D,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,0GAA0G;IAC1G,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OA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,CAAC,OAAO,CAAC,CAElB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,cAAc,CAAC,CAQzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAErF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5E;AAyBD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGlE;AA0DD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,cAAc,CAMvE"}
|
package/dist/lifecycle/git.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { getRuntime } from "../runtime-adapter.js";
|
|
8
8
|
import { memberLedgerPrefix, resolveMemberLedger } from "./member-ledger.js";
|
|
9
9
|
import { LIFECYCLE_LOCAL_NOTE } from "./local-note.js";
|
|
10
|
+
import { ledgerRecordingOff, NO_RECORD_PUSH_NOTE, overlayTip, setOverlayTip } from "./no-record.js";
|
|
10
11
|
const STATE_BRANCH = "chant/lifecycle";
|
|
11
12
|
/**
|
|
12
13
|
* The branch path of `dir` for the project at `cwd` (#2538): `dir` itself at
|
|
@@ -288,6 +289,23 @@ export async function writeLedgerFiles(files, commitMessage, opts) {
|
|
|
288
289
|
// local race two concurrent writers used to hit silently (whoever called
|
|
289
290
|
// update-ref last simply overwrote the other's tree, no error). A
|
|
290
291
|
// conflict here throws RefCASConflictError instead of clobbering.
|
|
292
|
+
// #3955: a run that records nothing moves its in-memory tip instead of
|
|
293
|
+
// the branch, under the same compare-and-swap: nothing awaits between the
|
|
294
|
+
// read of the tip and the move, so two writes in this process cannot both
|
|
295
|
+
// parent on the same commit.
|
|
296
|
+
if (ledgerRecordingOff()) {
|
|
297
|
+
const key = await overlayKey(cwd);
|
|
298
|
+
const branch = overlayTip(key) === undefined ? await readRefSha(`refs/heads/${STATE_BRANCH}`, { cwd }) : null;
|
|
299
|
+
// Read again after the await: another write may have moved the tip meanwhile.
|
|
300
|
+
const moved = overlayTip(key);
|
|
301
|
+
const current = moved !== undefined ? moved : branch;
|
|
302
|
+
if (current === parentRef) {
|
|
303
|
+
setOverlayTip(key, commitSha, files.map((f) => f.path), commitMessage);
|
|
304
|
+
return commitSha;
|
|
305
|
+
}
|
|
306
|
+
lastErr = new RefCASConflictError(`refs/heads/${STATE_BRANCH}`, parentRef, `the run's unrecorded tip is ${current ?? "(none)"}`);
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
291
309
|
try {
|
|
292
310
|
await updateRefCAS(`refs/heads/${STATE_BRANCH}`, commitSha, parentRef, { cwd });
|
|
293
311
|
return commitSha;
|
|
@@ -312,7 +330,7 @@ export async function writeLedgerFiles(files, commitMessage, opts) {
|
|
|
312
330
|
export async function readBlobFromPath(environment, filename, opts) {
|
|
313
331
|
const rt = getRuntime();
|
|
314
332
|
const dir = await ledgerDir(environment, opts);
|
|
315
|
-
const result = await rt.spawn(["git", "show", `${
|
|
333
|
+
const result = await rt.spawn(["git", "show", `${await ledgerRevision(opts?.cwd)}:${dir}/${filename}`], { cwd: opts?.cwd });
|
|
316
334
|
if (result.exitCode !== 0)
|
|
317
335
|
return null;
|
|
318
336
|
return result.stdout;
|
|
@@ -327,7 +345,7 @@ export async function readBlobFromPath(environment, filename, opts) {
|
|
|
327
345
|
export async function readPathSha(environment, filename, opts) {
|
|
328
346
|
const rt = getRuntime();
|
|
329
347
|
const dir = await ledgerDir(environment, opts);
|
|
330
|
-
const result = await rt.spawn(["git", "rev-parse", "--verify", `${
|
|
348
|
+
const result = await rt.spawn(["git", "rev-parse", "--verify", `${await ledgerRevision(opts?.cwd)}:${dir}/${filename}`], { cwd: opts?.cwd });
|
|
331
349
|
if (result.exitCode !== 0)
|
|
332
350
|
return null;
|
|
333
351
|
return result.stdout.trim() || null;
|
|
@@ -468,7 +486,7 @@ export async function listLedgerTrees(opts) {
|
|
|
468
486
|
const base = await ledgerDir("", opts);
|
|
469
487
|
// `--full-tree`: from a subdirectory, a bare `ls-tree` lists only that
|
|
470
488
|
// subdirectory's part of the tree (#2550).
|
|
471
|
-
const rootResult = await rt.spawn(["git", "ls-tree", "--full-tree", base === "" ?
|
|
489
|
+
const rootResult = await rt.spawn(["git", "ls-tree", "--full-tree", base === "" ? tip : `${tip}:${base}`], { cwd: opts?.cwd });
|
|
472
490
|
if (rootResult.exitCode !== 0)
|
|
473
491
|
return [];
|
|
474
492
|
const trees = [];
|
|
@@ -493,7 +511,7 @@ export async function listFilesInDir(dir, opts) {
|
|
|
493
511
|
return [];
|
|
494
512
|
const rt = getRuntime();
|
|
495
513
|
const path = await ledgerDir(dir, opts);
|
|
496
|
-
const lsResult = await rt.spawn(["git", "ls-tree", "--full-tree", "--name-only", `${
|
|
514
|
+
const lsResult = await rt.spawn(["git", "ls-tree", "--full-tree", "--name-only", `${tip}:${path}/`], { cwd: opts?.cwd });
|
|
497
515
|
if (lsResult.exitCode !== 0)
|
|
498
516
|
return [];
|
|
499
517
|
return lsResult.stdout.trim().split("\n").filter(Boolean);
|
|
@@ -506,7 +524,7 @@ export async function readEnvironmentSnapshots(environment, opts) {
|
|
|
506
524
|
const snapshots = new Map();
|
|
507
525
|
// List files in the environment directory
|
|
508
526
|
const dir = await ledgerDir(environment, opts);
|
|
509
|
-
const lsResult = await rt.spawn(["git", "ls-tree", "--full-tree", "--name-only", `${
|
|
527
|
+
const lsResult = await rt.spawn(["git", "ls-tree", "--full-tree", "--name-only", `${await ledgerRevision(opts?.cwd)}:${dir}/`], { cwd: opts?.cwd });
|
|
510
528
|
if (lsResult.exitCode !== 0)
|
|
511
529
|
return snapshots;
|
|
512
530
|
const files = lsResult.stdout.trim().split("\n").filter(Boolean);
|
|
@@ -530,7 +548,7 @@ export async function listSnapshots(opts) {
|
|
|
530
548
|
const base = await ledgerDir("", opts);
|
|
531
549
|
const result = await rt.spawn(
|
|
532
550
|
// `:(top)`: a pathspec is otherwise relative to the directory git runs in.
|
|
533
|
-
["git", "log", "--format=%H %aI %s",
|
|
551
|
+
["git", "log", "--format=%H %aI %s", await ledgerRevision(opts?.cwd), ...(base === "" ? [] : ["--", `:(top)${base}`])], { cwd: opts?.cwd });
|
|
534
552
|
if (result.exitCode !== 0)
|
|
535
553
|
return [];
|
|
536
554
|
return result.stdout
|
|
@@ -595,6 +613,8 @@ async function trackRemoteLifecycle(remote, sha, cwd) {
|
|
|
595
613
|
* is the throwing form most callers use.
|
|
596
614
|
*/
|
|
597
615
|
export async function pushLifecycleStatus(opts) {
|
|
616
|
+
if (ledgerRecordingOff())
|
|
617
|
+
return { status: "not-recorded" };
|
|
598
618
|
const rt = getRuntime();
|
|
599
619
|
const cwd = opts?.cwd;
|
|
600
620
|
const found = await ledgerRemote(cwd);
|
|
@@ -655,6 +675,8 @@ export function describeLifecyclePush(result) {
|
|
|
655
675
|
return null;
|
|
656
676
|
case "no-remote":
|
|
657
677
|
return `this repository has no remote, so ${STATE_BRANCH} stays local`;
|
|
678
|
+
case "not-recorded":
|
|
679
|
+
return NO_RECORD_PUSH_NOTE;
|
|
658
680
|
case "stale":
|
|
659
681
|
return `"${result.remote}" holds ${STATE_BRANCH} commits this checkout has not fetched, so the push was refused; fetch ${STATE_BRANCH} and write again${said(result.stderr)}`;
|
|
660
682
|
case "failed":
|
|
@@ -675,6 +697,8 @@ export async function pushLifecycleReport(opts) {
|
|
|
675
697
|
return { pushed: true };
|
|
676
698
|
case "no-remote":
|
|
677
699
|
return { pushed: false, pushWarning: LIFECYCLE_LOCAL_NOTE };
|
|
700
|
+
case "not-recorded":
|
|
701
|
+
return { pushed: false, pushWarning: NO_RECORD_PUSH_NOTE };
|
|
678
702
|
case "stale":
|
|
679
703
|
return { pushed: false, pushWarning: new StaleLifecycleBranchError(result.expected, result.stderr).message };
|
|
680
704
|
case "failed":
|
|
@@ -1039,6 +1063,10 @@ export async function pushRef(ref, opts) {
|
|
|
1039
1063
|
* `pushed`.
|
|
1040
1064
|
*/
|
|
1041
1065
|
export async function pushRefStatus(ref, opts) {
|
|
1066
|
+
// #3955: a run that records nothing pushes nothing, a lease ref included.
|
|
1067
|
+
// The lease still holds in this checkout, the way it does in one with no remote.
|
|
1068
|
+
if (ledgerRecordingOff())
|
|
1069
|
+
return "no-remote";
|
|
1042
1070
|
const rt = getRuntime();
|
|
1043
1071
|
const remoteResult = await rt.spawn(["git", "remote"], { cwd: opts?.cwd });
|
|
1044
1072
|
if (remoteResult.exitCode !== 0 || !remoteResult.stdout.trim())
|
|
@@ -1120,12 +1148,40 @@ export async function getHeadCommit(opts) {
|
|
|
1120
1148
|
return result.stdout.trim();
|
|
1121
1149
|
}
|
|
1122
1150
|
async function getStateBranchTip(cwd) {
|
|
1151
|
+
if (ledgerRecordingOff()) {
|
|
1152
|
+
const tip = overlayTip(await overlayKey(cwd));
|
|
1153
|
+
if (tip !== undefined)
|
|
1154
|
+
return tip;
|
|
1155
|
+
}
|
|
1123
1156
|
const rt = getRuntime();
|
|
1124
1157
|
const result = await rt.spawn(["git", "rev-parse", "--verify", `refs/heads/${STATE_BRANCH}`], { cwd });
|
|
1125
1158
|
if (result.exitCode !== 0)
|
|
1126
1159
|
return null;
|
|
1127
1160
|
return result.stdout.trim();
|
|
1128
1161
|
}
|
|
1162
|
+
/**
|
|
1163
|
+
* What a read names to see the ledger: `chant/lifecycle`, or, in a run that
|
|
1164
|
+
* records nothing (#3955), the in-memory tip its own writes built, once it
|
|
1165
|
+
* has written. Reads outside this module that name the branch themselves go
|
|
1166
|
+
* through here so they see the run's writes too.
|
|
1167
|
+
*/
|
|
1168
|
+
export async function ledgerRevision(cwd) {
|
|
1169
|
+
if (!ledgerRecordingOff())
|
|
1170
|
+
return STATE_BRANCH;
|
|
1171
|
+
return overlayTip(await overlayKey(cwd)) ?? STATE_BRANCH;
|
|
1172
|
+
}
|
|
1173
|
+
/** The repository a run's in-memory ledger tip belongs to (#3955): its common git directory, so worktrees and members share one. */
|
|
1174
|
+
const overlayKeys = new Map();
|
|
1175
|
+
async function overlayKey(cwd) {
|
|
1176
|
+
const from = cwd ?? process.cwd();
|
|
1177
|
+
const cached = overlayKeys.get(from);
|
|
1178
|
+
if (cached !== undefined)
|
|
1179
|
+
return cached;
|
|
1180
|
+
const result = await getRuntime().spawn(["git", "rev-parse", "--path-format=absolute", "--git-common-dir"], { cwd: from, env: C_LOCALE_ENV });
|
|
1181
|
+
const key = result.exitCode === 0 && result.stdout.trim() !== "" ? result.stdout.trim() : from;
|
|
1182
|
+
overlayKeys.set(from, key);
|
|
1183
|
+
return key;
|
|
1184
|
+
}
|
|
1129
1185
|
/**
|
|
1130
1186
|
* The entries of directory `dir` (branch-relative, `""` for the root) in
|
|
1131
1187
|
* commit `tip`, or an empty map when it does not exist. Always pinned to the
|