@foldrun/core 14.3.4 → 14.3.5

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.
@@ -159,9 +159,12 @@ export async function decideApproval(tenant, workspace, runId, d) {
159
159
  d = { ...d, actor: check.approver ? { email: check.approver, role: null } : null };
160
160
  }
161
161
  assertMayDecide(tenant, workspace, run, d);
162
+ // With no step named, a decision is for the gates waiting on a person: a
163
+ // `wait: event` step waits on its event, and is approved by its payload or
164
+ // rejected by name (5 Nov 2026: an unnamed reject failed it too).
162
165
  const waiting = run.steps
163
166
  .map((s, i) => ({ s, i }))
164
- .filter(({ s, i }) => s.status === "awaiting-approval" && (d.step === undefined || d.step === i) && (allowed === null || allowed.includes(i)));
167
+ .filter(({ s, i }) => s.status === "awaiting-approval" && (d.step === undefined ? s.waitFor !== "event" : d.step === i) && (allowed === null || allowed.includes(i)));
165
168
  if (waiting.length === 0)
166
169
  throw new ApprovalError("nothing is awaiting approval", 409);
167
170
  const note = typeof d.note === "string" ? d.note.trim() : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldrun/core",
3
- "version": "14.3.4",
3
+ "version": "14.3.5",
4
4
  "description": "Agents are just folders. The format, the runner, the checks.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",
package/src/approvals.ts CHANGED
@@ -232,9 +232,12 @@ export async function decideApproval(
232
232
  }
233
233
  assertMayDecide(tenant, workspace, run, d);
234
234
 
235
+ // With no step named, a decision is for the gates waiting on a person: a
236
+ // `wait: event` step waits on its event, and is approved by its payload or
237
+ // rejected by name (5 Nov 2026: an unnamed reject failed it too).
235
238
  const waiting = run.steps
236
239
  .map((s, i) => ({ s, i }))
237
- .filter(({ s, i }) => s.status === "awaiting-approval" && (d.step === undefined || d.step === i) && (allowed === null || allowed.includes(i)));
240
+ .filter(({ s, i }) => s.status === "awaiting-approval" && (d.step === undefined ? s.waitFor !== "event" : d.step === i) && (allowed === null || allowed.includes(i)));
238
241
  if (waiting.length === 0) throw new ApprovalError("nothing is awaiting approval", 409);
239
242
 
240
243
  const note = typeof d.note === "string" ? d.note.trim() : "";