@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.
Files changed (210) hide show
  1. package/dist/ci-jobs.d.ts +41 -1
  2. package/dist/ci-jobs.d.ts.map +1 -1
  3. package/dist/ci-jobs.js +48 -1
  4. package/dist/cli/commands/build.d.ts.map +1 -1
  5. package/dist/cli/commands/build.js +14 -0
  6. package/dist/cli/handlers/approve.d.ts.map +1 -1
  7. package/dist/cli/handlers/approve.js +9 -0
  8. package/dist/cli/handlers/emulator.d.ts +13 -2
  9. package/dist/cli/handlers/emulator.d.ts.map +1 -1
  10. package/dist/cli/handlers/emulator.js +63 -3
  11. package/dist/cli/handlers/promote.d.ts.map +1 -1
  12. package/dist/cli/handlers/promote.js +7 -1
  13. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  14. package/dist/cli/handlers/run-wave.js +5 -4
  15. package/dist/cli/handlers/run.d.ts +4 -3
  16. package/dist/cli/handlers/run.d.ts.map +1 -1
  17. package/dist/cli/handlers/run.js +73 -9
  18. package/dist/cli/main.d.ts.map +1 -1
  19. package/dist/cli/main.js +38 -11
  20. package/dist/cli/mcp/workspace-tools.d.ts +3 -3
  21. package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
  22. package/dist/cli/mcp/workspace-tools.js +27 -4
  23. package/dist/cli/parse-args.d.ts.map +1 -1
  24. package/dist/cli/parse-args.js +31 -0
  25. package/dist/cli/registry.d.ts +12 -0
  26. package/dist/cli/registry.d.ts.map +1 -1
  27. package/dist/components/cli-support.d.ts +45 -6
  28. package/dist/components/cli-support.d.ts.map +1 -1
  29. package/dist/components/cli-support.js +97 -22
  30. package/dist/components/driver.d.ts.map +1 -1
  31. package/dist/components/driver.js +25 -10
  32. package/dist/effect-receipt.d.ts +13 -0
  33. package/dist/effect-receipt.d.ts.map +1 -1
  34. package/dist/effect-receipt.js +19 -0
  35. package/dist/graph-detail.d.ts.map +1 -1
  36. package/dist/graph-detail.js +24 -2
  37. package/dist/lexicon-module.d.ts +7 -1
  38. package/dist/lexicon-module.d.ts.map +1 -1
  39. package/dist/lexicon-module.js +7 -2
  40. package/dist/lifecycle/git.d.ts +11 -0
  41. package/dist/lifecycle/git.d.ts.map +1 -1
  42. package/dist/lifecycle/git.js +62 -6
  43. package/dist/lifecycle/no-record.d.ts +59 -0
  44. package/dist/lifecycle/no-record.d.ts.map +1 -0
  45. package/dist/lifecycle/no-record.js +88 -0
  46. package/dist/lifecycle/receipt-plan.d.ts.map +1 -1
  47. package/dist/lifecycle/receipt-plan.js +4 -2
  48. package/dist/op/activities/shell.d.ts.map +1 -1
  49. package/dist/op/activities/shell.js +30 -9
  50. package/dist/op/emulator-lifecycle.d.ts +23 -0
  51. package/dist/op/emulator-lifecycle.d.ts.map +1 -1
  52. package/dist/op/emulator-lifecycle.js +39 -2
  53. package/dist/op/gate.d.ts.map +1 -1
  54. package/dist/op/gate.js +3 -0
  55. package/dist/op/index.d.ts +1 -1
  56. package/dist/op/index.d.ts.map +1 -1
  57. package/dist/op/index.js +1 -1
  58. package/dist/op/local-executor.d.ts +10 -0
  59. package/dist/op/local-executor.d.ts.map +1 -1
  60. package/dist/op/local-executor.js +71 -7
  61. package/dist/op/op-waves-notify.d.ts +2 -0
  62. package/dist/op/op-waves-notify.d.ts.map +1 -1
  63. package/dist/op/op-waves-notify.js +9 -3
  64. package/dist/op/op-waves-run.d.ts +8 -2
  65. package/dist/op/op-waves-run.d.ts.map +1 -1
  66. package/dist/op/op-waves-run.js +36 -11
  67. package/dist/op/op-waves.d.ts +85 -1
  68. package/dist/op/op-waves.d.ts.map +1 -1
  69. package/dist/op/op-waves.js +153 -1
  70. package/dist/op/receipt-store.d.ts +5 -0
  71. package/dist/op/receipt-store.d.ts.map +1 -1
  72. package/dist/op/receipt-store.js +4 -3
  73. package/dist/op/runtimes/local.d.ts.map +1 -1
  74. package/dist/op/runtimes/local.js +6 -0
  75. package/dist/op/step-console.d.ts +65 -0
  76. package/dist/op/step-console.d.ts.map +1 -0
  77. package/dist/op/step-console.js +140 -0
  78. package/dist/op/step-output-ref.d.ts +26 -18
  79. package/dist/op/step-output-ref.d.ts.map +1 -1
  80. package/dist/op/step-output-ref.js +86 -63
  81. package/dist/point-decision.d.ts.map +1 -1
  82. package/dist/point-decision.js +3 -0
  83. package/dist/wave-runtime.mjs +239 -239
  84. package/dist/workspace/agent-cli.d.ts.map +1 -1
  85. package/dist/workspace/agent-cli.js +3 -0
  86. package/dist/workspace/compose-graph.d.ts +22 -3
  87. package/dist/workspace/compose-graph.d.ts.map +1 -1
  88. package/dist/workspace/compose-graph.js +18 -5
  89. package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
  90. package/dist/workspace/conformance/writer.js +1 -1
  91. package/dist/workspace/decide.d.ts +51 -9
  92. package/dist/workspace/decide.d.ts.map +1 -1
  93. package/dist/workspace/decide.js +125 -14
  94. package/dist/workspace/graph.schema.json +68 -1
  95. package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
  96. package/dist/workspace/lineage-upgrade.js +20 -11
  97. package/dist/workspace/nested-graph.d.ts +1 -1
  98. package/dist/workspace/nested-graph.d.ts.map +1 -1
  99. package/dist/workspace/nested-graph.js +5 -1
  100. package/dist/workspace/point-answer.schema.json +16 -1
  101. package/dist/workspace/points-cli.d.ts +5 -3
  102. package/dist/workspace/points-cli.d.ts.map +1 -1
  103. package/dist/workspace/points-cli.js +16 -7
  104. package/dist/workspace/points-write.schema.json +39 -4
  105. package/dist/workspace/points.schema.json +42 -3
  106. package/dist/workspace/reason-codes.d.ts +2 -1
  107. package/dist/workspace/reason-codes.d.ts.map +1 -1
  108. package/dist/workspace/reason-codes.js +2 -1
  109. package/dist/workspace/records-cli.d.ts +12 -2
  110. package/dist/workspace/records-cli.d.ts.map +1 -1
  111. package/dist/workspace/records-cli.js +27 -7
  112. package/dist/workspace/records-write.d.ts.map +1 -1
  113. package/dist/workspace/records-write.js +2 -3
  114. package/dist/workspace/records.d.ts +10 -4
  115. package/dist/workspace/records.d.ts.map +1 -1
  116. package/dist/workspace/records.js +16 -3
  117. package/dist/workspace/records.schema.json +2 -1
  118. package/dist/workspace/runs.d.ts.map +1 -1
  119. package/dist/workspace/runs.js +4 -2
  120. package/dist/workspace/trust/verify-cli.d.ts.map +1 -1
  121. package/dist/workspace/trust/verify-cli.js +2 -1
  122. package/dist/workspace/trust/verify.d.ts +22 -0
  123. package/dist/workspace/trust/verify.d.ts.map +1 -1
  124. package/dist/workspace/trust/verify.js +94 -14
  125. package/dist/workspace/write-scope.d.ts +3 -1
  126. package/dist/workspace/write-scope.d.ts.map +1 -1
  127. package/dist/workspace/write-scope.js +11 -4
  128. package/package.json +1 -1
  129. package/src/ci-jobs.ts +58 -1
  130. package/src/cli/commands/build.ts +18 -0
  131. package/src/cli/compiled-cli.e2e.test.ts +45 -1
  132. package/src/cli/handlers/approve.ts +9 -0
  133. package/src/cli/handlers/emulator.test.ts +61 -1
  134. package/src/cli/handlers/emulator.ts +65 -4
  135. package/src/cli/handlers/promote.test.ts +7 -0
  136. package/src/cli/handlers/promote.ts +7 -1
  137. package/src/cli/handlers/run-no-record.e2e.test.ts +87 -0
  138. package/src/cli/handlers/run-wave.ts +5 -4
  139. package/src/cli/handlers/run.test.ts +126 -0
  140. package/src/cli/handlers/run.ts +69 -9
  141. package/src/cli/main.test.ts +34 -0
  142. package/src/cli/main.ts +38 -11
  143. package/src/cli/mcp/workspace-tools.e2e.test.ts +1 -1
  144. package/src/cli/mcp/workspace-tools.ts +27 -4
  145. package/src/cli/parse-args.ts +21 -0
  146. package/src/cli/registry.ts +12 -0
  147. package/src/components/cli-support.test.ts +75 -0
  148. package/src/components/cli-support.ts +130 -25
  149. package/src/components/driver.test.ts +28 -0
  150. package/src/components/driver.ts +23 -10
  151. package/src/components/generate-disabled.test.ts +56 -0
  152. package/src/effect-receipt.ts +22 -0
  153. package/src/graph-ci-edges.test.ts +50 -0
  154. package/src/graph-detail.ts +21 -2
  155. package/src/lexicon-module.ts +9 -2
  156. package/src/lifecycle/git.ts +61 -6
  157. package/src/lifecycle/no-record.test.ts +175 -0
  158. package/src/lifecycle/no-record.ts +108 -0
  159. package/src/lifecycle/receipt-plan.test.ts +9 -0
  160. package/src/lifecycle/receipt-plan.ts +4 -1
  161. package/src/op/activities/shell.ts +28 -6
  162. package/src/op/effect-step.test.ts +95 -1
  163. package/src/op/emulator-lifecycle.test.ts +24 -1
  164. package/src/op/emulator-lifecycle.ts +58 -2
  165. package/src/op/gate.ts +3 -0
  166. package/src/op/index.ts +1 -1
  167. package/src/op/local-executor.test.ts +65 -0
  168. package/src/op/local-executor.ts +88 -8
  169. package/src/op/op-waves-jobs.test.ts +213 -0
  170. package/src/op/op-waves-notify.ts +11 -5
  171. package/src/op/op-waves-run.ts +42 -11
  172. package/src/op/op-waves.ts +202 -2
  173. package/src/op/receipt-store.ts +13 -3
  174. package/src/op/runtimes/local.ts +6 -0
  175. package/src/op/step-console.test.ts +150 -0
  176. package/src/op/step-console.ts +155 -0
  177. package/src/op/step-output-ref.test.ts +68 -24
  178. package/src/op/step-output-ref.ts +85 -65
  179. package/src/point-decision-bundle.test.ts +1 -0
  180. package/src/point-decision.ts +3 -0
  181. package/src/workspace/agent-cli.ts +2 -0
  182. package/src/workspace/compose-graph.test.ts +55 -0
  183. package/src/workspace/compose-graph.ts +28 -6
  184. package/src/workspace/conformance/__writer_fixture__/answers/answer.schema.json +16 -1
  185. package/src/workspace/conformance/writer.ts +1 -1
  186. package/src/workspace/decide.test.ts +87 -3
  187. package/src/workspace/decide.ts +142 -17
  188. package/src/workspace/graph-contract.test.ts +26 -1
  189. package/src/workspace/graph.schema.json +68 -1
  190. package/src/workspace/lineage-upgrade.test.ts +21 -0
  191. package/src/workspace/lineage-upgrade.ts +19 -11
  192. package/src/workspace/nested-graph.test.ts +14 -0
  193. package/src/workspace/nested-graph.ts +7 -2
  194. package/src/workspace/point-answer.schema.json +16 -1
  195. package/src/workspace/points-cli.ts +16 -8
  196. package/src/workspace/points-write.schema.json +39 -4
  197. package/src/workspace/points.schema.json +42 -3
  198. package/src/workspace/reason-codes.ts +2 -1
  199. package/src/workspace/record-assets.test.ts +14 -0
  200. package/src/workspace/records-cli.ts +28 -7
  201. package/src/workspace/records-write-commands.e2e.test.ts +32 -0
  202. package/src/workspace/records-write.ts +2 -3
  203. package/src/workspace/records.schema.json +2 -1
  204. package/src/workspace/records.ts +17 -4
  205. package/src/workspace/runs.ts +4 -2
  206. package/src/workspace/trust/trust.test.ts +105 -0
  207. package/src/workspace/trust/verify-cli.ts +2 -1
  208. package/src/workspace/trust/verify.ts +106 -13
  209. package/src/workspace/write-scope.test.ts +18 -0
  210. package/src/workspace/write-scope.ts +16 -5
@@ -23,15 +23,20 @@
23
23
  * Scope, kept deliberately tight (see the issue's "Open questions"):
24
24
  * - same-Op only — no cross-Op plumbing (that needs a durable place to put
25
25
  * the value, which #1290 explicitly defers).
26
- * - main `phases` only — a step inside `onFailure` or nested inside an
27
- * `EffectStep` can neither produce nor consume a step-output reference.
28
- * `onFailure` compensation runs only when something upstream already
29
- * failed, so a main-phase step's captured result isn't reliably
30
- * available there; an effect step's nested steps run only when the
31
- * receipt comparison mismatches, so a value it produces isn't reliably
32
- * available to anything outside it either. Both are conditional
33
- * execution paths, which is exactly the class of thing #1290 keeps out
34
- * of an Op's inert-data model.
26
+ * - producers are the top-level activity steps of the main `phases`. A step
27
+ * in `onFailure` or nested inside an `EffectStep` produces nothing another
28
+ * step may reference: an effect's nested steps run only when the receipt
29
+ * comparison mismatches, so a value one of them returns isn't reliably
30
+ * there for anything else (#3948 decision A7, "for now").
31
+ * - consumers are those producers, plus (#3948) every activity step in
32
+ * `onFailure` and every activity step nested inside an effect. An
33
+ * `onFailure` step may reference any main-phase producer. Compensation
34
+ * runs after a failure, so its producer may never have completed; the
35
+ * executor then skips the compensation step and records why (decision
36
+ * A6), rather than calling it with an `undefined` in place of the value.
37
+ * A step nested inside an effect may reference a producer that runs
38
+ * before the effect, and the executor folds the resolved values into the
39
+ * effect's expectation, so a changed value re-fires the effect.
35
40
  * - producer must run to completion before the consumer starts: an earlier
36
41
  * phase, or an earlier step within the same non-parallel phase. Two
37
42
  * steps in the same parallel phase run concurrently (`Promise.all`) with
@@ -179,20 +184,58 @@ function locateStepOutputRefPath(value, target, path = []) {
179
184
  }
180
185
  return undefined;
181
186
  }
182
- /** Top-level `ActivityStep`s of `phases`, in authored (phase, then step) order — gates, effects, and steps nested inside an effect are not producers or consumers (see the module doc's scope note). */
187
+ /** Top-level `ActivityStep`s of `phases`, in authored (phase, then step) order: the producers (see the module doc's scope note). */
183
188
  function locateActivitySteps(phases) {
184
189
  const locations = [];
185
190
  phases.forEach((phase, phaseIndex) => {
186
- let stepIndex = 0;
187
- for (const step of phase.steps) {
191
+ phase.steps.forEach((step, stepIndex) => {
188
192
  if (step.kind !== "activity")
189
- continue;
190
- locations.push({ phaseIndex, stepIndex, parallel: phase.parallel === true, step });
191
- stepIndex++;
192
- }
193
+ return;
194
+ locations.push({ phaseIndex, stepIndex, parallel: phase.parallel === true, step, phaseName: phase.name });
195
+ });
193
196
  });
194
197
  return locations;
195
198
  }
199
+ /**
200
+ * Every activity step that may hold a reference (#3948): the producers, each
201
+ * step nested inside an effect of a main phase, and every activity step of
202
+ * `onFailure`, effect-nested ones included. An `onFailure` step is placed after
203
+ * every main phase, so any main-phase producer precedes it.
204
+ */
205
+ function locateConsumers(config) {
206
+ const consumers = [];
207
+ const visit = (phases, offset) => {
208
+ phases.forEach((phase, i) => {
209
+ const at = { phaseIndex: offset + i, parallel: phase.parallel === true, phaseName: phase.name };
210
+ phase.steps.forEach((step, stepIndex) => {
211
+ if (step.kind === "activity")
212
+ consumers.push({ ...at, stepIndex, step });
213
+ if (step.kind === "effect") {
214
+ for (const nested of step.steps)
215
+ if (nested.kind === "activity")
216
+ consumers.push({ ...at, stepIndex, step: nested });
217
+ }
218
+ });
219
+ });
220
+ };
221
+ visit(config.phases, 0);
222
+ visit(config.onFailure ?? [], config.phases.length);
223
+ return consumers;
224
+ }
225
+ /** Ids of the activity steps nested inside an effect, in any phase. Nothing may reference them (#3948 decision A7). */
226
+ function effectNestedIds(config) {
227
+ const ids = new Set();
228
+ for (const phase of [...config.phases, ...(config.onFailure ?? [])]) {
229
+ for (const step of phase.steps) {
230
+ if (step.kind !== "effect")
231
+ continue;
232
+ for (const nested of step.steps)
233
+ if (nested.kind === "activity" && nested.id)
234
+ ids.add(nested.id);
235
+ }
236
+ }
237
+ return ids;
238
+ }
196
239
  /** True when `producer` is guaranteed to have completed before `consumer` starts. */
197
240
  function producerPrecedes(producer, consumer) {
198
241
  if (producer.phaseIndex !== consumer.phaseIndex)
@@ -201,9 +244,6 @@ function producerPrecedes(producer, consumer) {
201
244
  return false; // same parallel phase — Promise.all, no ordering guarantee
202
245
  return producer.stepIndex < consumer.stepIndex;
203
246
  }
204
- function effectNestedActivitySteps(phase) {
205
- return phase.steps.flatMap((s) => (s.kind === "effect" ? s.steps.filter((n) => n.kind === "activity") : []));
206
- }
207
247
  /** `byId`/`duplicateIds` over an Op's top-level main-phase activity steps — shared by {@link validateStepOutputRefScope} and {@link validateStepOutputRefs}. */
208
248
  function indexById(locations) {
209
249
  const byId = new Map();
@@ -230,41 +270,24 @@ function indexById(locations) {
230
270
  * a public export a caller can invoke directly, bypassing that lint pass —
231
271
  * this is its own defense-in-depth.
232
272
  *
233
- * Flags:
234
- * - a reference authored inside `onFailure`, or inside an `EffectStep`'s
235
- * nested steps — out of scope by design (see the module doc); flagged
236
- * explicitly here rather than left to fall through as "unknown producer",
273
+ * Consumers are the main-phase activity steps, the steps nested inside an
274
+ * effect, and every `onFailure` activity step (#3948). Flags:
275
+ * - a reference to a step nested inside an effect step, from anywhere
276
+ * (#3948 decision A7) — flagged explicitly here rather than left to fall
277
+ * through as "unknown producer",
237
278
  * - a reference to an unregistered step id (no step in scope declares it),
238
279
  * - a duplicate step id (ambiguous producer),
239
280
  * - a reference to a step that does not precede the referencing step
240
281
  * (a later phase, a later step in the same phase, itself, or a step in
241
- * the same parallel phase).
282
+ * the same parallel phase). A step nested inside an effect takes the
283
+ * effect's position, so it may reference only a step that runs before
284
+ * the effect. An `onFailure` step comes after every main phase.
242
285
  */
243
286
  export function validateStepOutputRefScope(config) {
244
287
  const issues = [];
245
- const flagOutOfScope = (steps, phaseName, reason) => {
246
- for (const step of steps) {
247
- for (const ref of collectStepOutputRefs(step.args)) {
248
- issues.push({
249
- opName: config.name,
250
- phase: phaseName,
251
- fn: step.fn,
252
- message: `references step "${ref.step}"'s output, but ${reason}`,
253
- });
254
- }
255
- }
256
- };
257
- for (const phase of config.onFailure ?? []) {
258
- const steps = phase.steps.filter((s) => s.kind === "activity").concat(effectNestedActivitySteps(phase));
259
- flagOutOfScope(steps, phase.name, "step-output references are not supported in onFailure compensation phases");
260
- }
261
- for (const phase of config.phases) {
262
- flagOutOfScope(effectNestedActivitySteps(phase), phase.name, "step-output references are not supported for a step nested inside an effect step");
263
- }
264
- const locations = locateActivitySteps(config.phases);
265
- const { byId, duplicateIds } = indexById(locations);
266
- const phaseNameOf = (loc) => config.phases[loc.phaseIndex].name;
267
- for (const consumer of locations) {
288
+ const { byId, duplicateIds } = indexById(locateActivitySteps(config.phases));
289
+ const nestedIds = effectNestedIds(config);
290
+ for (const consumer of locateConsumers(config)) {
268
291
  const refs = collectStepOutputRefs(consumer.step.args);
269
292
  for (const ref of refs) {
270
293
  // The run's work lease (#2748) is published under a reserved id once it
@@ -274,7 +297,7 @@ export function validateStepOutputRefScope(config) {
274
297
  if (duplicateIds.has(ref.step)) {
275
298
  issues.push({
276
299
  opName: config.name,
277
- phase: phaseNameOf(consumer),
300
+ phase: consumer.phaseName,
278
301
  fn: consumer.step.fn,
279
302
  message: `references step id "${ref.step}", but that id is used by more than one step in this Op — ids must be unique`,
280
303
  });
@@ -284,9 +307,11 @@ export function validateStepOutputRefScope(config) {
284
307
  if (!producer) {
285
308
  issues.push({
286
309
  opName: config.name,
287
- phase: phaseNameOf(consumer),
310
+ phase: consumer.phaseName,
288
311
  fn: consumer.step.fn,
289
- message: `references unknown step id "${ref.step}" — no step in this Op's main phases declares that id`,
312
+ message: nestedIds.has(ref.step)
313
+ ? `references step "${ref.step}", which is nested inside an effect step — a step inside an effect runs only when the effect fires, so no other step can reference its output`
314
+ : `references unknown step id "${ref.step}" — no step in this Op's main phases declares that id`,
290
315
  });
291
316
  continue;
292
317
  }
@@ -298,7 +323,7 @@ export function validateStepOutputRefScope(config) {
298
323
  : `step "${ref.step}" does not run before this step`;
299
324
  issues.push({
300
325
  opName: config.name,
301
- phase: phaseNameOf(consumer),
326
+ phase: consumer.phaseName,
302
327
  fn: consumer.step.fn,
303
328
  message: `references ${reason} — a step can only reference an earlier step's output`,
304
329
  });
@@ -308,10 +333,10 @@ export function validateStepOutputRefScope(config) {
308
333
  return issues;
309
334
  }
310
335
  /**
311
- * Validate every step-output reference in an Op's main phases against a
312
- * contract map and the Op's own step ordering. Scope: `config.phases` only
313
- * (never `onFailure`, never a step nested inside an `EffectStep` — see the
314
- * module doc). Layers contract-based checks on top of {@link
336
+ * Validate every step-output reference in an Op against a contract map and
337
+ * the Op's own step ordering, over the consumers {@link
338
+ * validateStepOutputRefScope} covers (see the module doc). Layers
339
+ * contract-based checks on top of {@link
315
340
  * validateStepOutputRefScope}'s scope/ordering checks.
316
341
  *
317
342
  * Flags everything {@link validateStepOutputRefScope} does, plus:
@@ -323,10 +348,8 @@ export function validateStepOutputRefScope(config) {
323
348
  */
324
349
  export function validateStepOutputRefs(config, contracts) {
325
350
  const issues = validateStepOutputRefScope(config);
326
- const locations = locateActivitySteps(config.phases);
327
- const { byId, duplicateIds } = indexById(locations);
328
- const phaseNameOf = (loc) => config.phases[loc.phaseIndex].name;
329
- for (const consumer of locations) {
351
+ const { byId, duplicateIds } = indexById(locateActivitySteps(config.phases));
352
+ for (const consumer of locateConsumers(config)) {
330
353
  const refs = collectStepOutputRefs(consumer.step.args);
331
354
  for (const ref of refs) {
332
355
  // Already flagged by validateStepOutputRefScope — nothing to validate
@@ -340,7 +363,7 @@ export function validateStepOutputRefs(config, contracts) {
340
363
  if (!producerContract) {
341
364
  issues.push({
342
365
  opName: config.name,
343
- phase: phaseNameOf(consumer),
366
+ phase: consumer.phaseName,
344
367
  fn: consumer.step.fn,
345
368
  message: `references step "${ref.step}"'s output, but "${producer.step.fn}" has no registered activity contract to validate the reference against`,
346
369
  });
@@ -349,7 +372,7 @@ export function validateStepOutputRefs(config, contracts) {
349
372
  if (!producerContract.returns) {
350
373
  issues.push({
351
374
  opName: config.name,
352
- phase: phaseNameOf(consumer),
375
+ phase: consumer.phaseName,
353
376
  fn: consumer.step.fn,
354
377
  message: `references step "${ref.step}"'s output, but "${producer.step.fn}"'s contract declares no return schema`,
355
378
  });
@@ -358,7 +381,7 @@ export function validateStepOutputRefs(config, contracts) {
358
381
  if (ref.path && !pathExistsInSchema(producerContract.returns, ref.path)) {
359
382
  issues.push({
360
383
  opName: config.name,
361
- phase: phaseNameOf(consumer),
384
+ phase: consumer.phaseName,
362
385
  fn: consumer.step.fn,
363
386
  message: `references step "${ref.step}"'s output path "${ref.path}", which does not exist on "${producer.step.fn}"'s declared return type`,
364
387
  });
@@ -384,7 +407,7 @@ export function validateStepOutputRefs(config, contracts) {
384
407
  if (consumerKind && producerKind && consumerKind !== producerKind) {
385
408
  issues.push({
386
409
  opName: config.name,
387
- phase: phaseNameOf(consumer),
410
+ phase: consumer.phaseName,
388
411
  fn: consumer.step.fn,
389
412
  message: `references step "${ref.step}"'s output path "${ref.path}" (${producerKind}), but arg "${argPath.join(".")}" on "${consumer.step.fn}" declares ${consumerKind} — type mismatch`,
390
413
  });
@@ -1 +1 @@
1
- {"version":3,"file":"point-decision.d.ts","sourceRoot":"","sources":["../src/point-decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAoB,iBAAiB,E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AAM,CAAC;CACd;AAqBD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,cAAc,CAqCpF;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAMpH"}
@@ -33,6 +33,7 @@ import { samePlanDigest } from "./lifecycle/plan-digest.js";
33
33
  import { parseDuration } from "./op/duration.js";
34
34
  import { DEFAULT_GATE_POINT_PASS, defaultGatePointStore, gatePointInputs, gateSubject } from "./op/gate-point.js";
35
35
  import { resolveGateRunLocator } from "./op/gate-run-locator.js";
36
+ import { refuseGateWithoutRecording } from "./lifecycle/no-record.js";
36
37
  export { DEFAULT_GATE_POINT_PASS, GATE_POINT_INPUTS, defaultGatePointStore, gatePointInputs, gatePointOf, gatePointProblems, gateSubject, parseGateSubject, } from "./op/gate-point.js";
37
38
  export { isGateRunLocator, resolveGateRunLocator } from "./op/gate-run-locator.js";
38
39
  /** Who a resolution written for an answer is by: the people who answered, or the decider that did. */
@@ -41,6 +42,8 @@ function resolvedByOf(q) {
41
42
  }
42
43
  /** Decide a gate that asks a point: ask it, then record the pending fact or the resolution that cites the answer. */
43
44
  export async function evaluatePointGate(port, asker, input) {
45
+ // #3955: refused before the point is asked, which would itself write to the ledger.
46
+ refuseGateWithoutRecording(input.op, input.gate);
44
47
  const now = input.now ?? new Date().toISOString();
45
48
  const facts = { component: input.op, name: input.gate, env: input.env ?? null, planDigest: input.planDigest ?? null };
46
49
  const q = await asker.ask({ point: input.point.name, inputs: input.inputs ?? {}, facts, subject: gateSubject(input.op, input.gate, input.env), ...(input.point.store ? { store: input.point.store } : {}) });