Skip to content

Commit 15037f6

Browse files
committed
🧪 Keep the answer-delivery suite out of Node and Bun
The suite opens a real node:sqlite run database and takes the Deno lifecycle adapter's advisory lock, like every other Deno-adapter workflow suite. It was not listed in the exclusion manifest, so test-node ran it and failed eleven ways on the executor lock, and test-bun failed to resolve node:sqlite at all. Its tier is renamed WAD, because Tier WA already names the ACP server lifecycle suite in packages/test-agent.
1 parent 69ace71 commit 15037f6

3 files changed

Lines changed: 30 additions & 24 deletions

File tree

‎packages/workflow/tests/workflow-suspension-answer.test.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Tier WA — delivering one typed value to one durable wait, and spending it.
2+
* Tier WAD — delivering one typed value to one durable wait, and spending it.
33
*
44
* Two operations that must not be confused, proved against a real run in a real
55
* file. **Delivery** happens while nothing is running: it judges a value against
@@ -257,8 +257,8 @@ function eventsOfType(events: readonly DurableEvent[], type: string): DurableEve
257257
return events.filter((event) => event.type === "yield" && event.description.type === type);
258258
}
259259

260-
describe("Tier WA — a delivered answer, and the resume that spends it", () => {
261-
it("WA1: one value correlates to the exact wait it names", function* () {
260+
describe("Tier WAD — a delivered answer, and the resume that spends it", () => {
261+
it("WAD1: one value correlates to the exact wait it names", function* () {
262262
const root = yield* useStorageRoot();
263263
const id = yield* suspendedRun(root);
264264

@@ -283,7 +283,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
283283
expect(JSON.parse(String(rows[0]?.["answer"]))).toEqual(ANSWER);
284284
});
285285

286-
it("WA2: a value the retained schema refuses is not retained", function* () {
286+
it("WAD2: a value the retained schema refuses is not retained", function* () {
287287
const root = yield* useStorageRoot();
288288
const id = yield* suspendedRun(root);
289289

@@ -303,7 +303,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
303303
expect((yield* deliver(root, { suspensionId: id })).ok).toBe(true);
304304
});
305305

306-
it("WA3: a credential-shaped answer crosses the gate, and only an explicit opt-out lets it past", function* () {
306+
it("WAD3: a credential-shaped answer crosses the gate, and only an explicit opt-out lets it past", function* () {
307307
const root = yield* useStorageRoot();
308308
const id = yield* suspendedRun(root);
309309
const value: Json = { approved: true, note: CANARY };
@@ -321,7 +321,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
321321
expect(JSON.parse(String(answerRows(root)[0]?.["answer"]))).toEqual(value);
322322
});
323323

324-
it("WA4: delivery changes no status, no history and no execution record", function* () {
324+
it("WAD4: delivery changes no status, no history and no execution record", function* () {
325325
const root = yield* useStorageRoot();
326326
const id = yield* suspendedRun(root);
327327

@@ -336,7 +336,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
336336
expect((yield* attemptEvents(root)).length).toBe(events);
337337
});
338338

339-
it("WA5: a run somebody else holds the executor lock for is still answerable", function* () {
339+
it("WAD5: a run somebody else holds the executor lock for is still answerable", function* () {
340340
const root = yield* useStorageRoot();
341341
const id = yield* suspendedRun(root);
342342

@@ -354,7 +354,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
354354
expect(answerRows(root)).toHaveLength(1);
355355
});
356356

357-
it("WA6: a duplicate, and an answer already spent, are both refused unchanged", function* () {
357+
it("WAD6: a duplicate, and an answer already spent, are both refused unchanged", function* () {
358358
const root = yield* useStorageRoot();
359359
const id = yield* suspendedRun(root);
360360

@@ -376,7 +376,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
376376
expect(!late.ok && late.error.message).toContain("only a suspended run is waiting");
377377
});
378378

379-
it("WA7: a run that is not waiting is refused, whatever state it is in", function* () {
379+
it("WAD7: a run that is not waiting is refused, whatever state it is in", function* () {
380380
for (const terminal of ["completed", "cancelled"] as const) {
381381
const root = yield* useStorageRoot();
382382
const id = yield* suspendedRun(root);
@@ -400,14 +400,14 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
400400
}
401401
});
402402

403-
it("WA8: a run nothing is stored for is reported rather than created", function* () {
403+
it("WAD8: a run nothing is stored for is reported rather than created", function* () {
404404
const root = yield* useStorageRoot();
405405
const refused = yield* deliver(root, { runId: "never-started", suspensionId: "a".repeat(32) });
406406
expect(refused.ok).toBe(false);
407407
expect(!refused.ok && refused.error.name).toBe("WorkflowRunNotFoundError");
408408
});
409409

410-
it("WA9: the resume publishes one answer event, consumes the delivery, and returns the value", function* () {
410+
it("WAD9: the resume publishes one answer event, consumes the delivery, and returns the value", function* () {
411411
const root = yield* useStorageRoot();
412412
const id = yield* suspendedRun(root);
413413
expect((yield* deliver(root, { suspensionId: id })).ok).toBe(true);
@@ -433,7 +433,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
433433
expect(rows[0]?.["consumed_at"]).toEqual(expect.any(String));
434434
});
435435

436-
it("WA10: a resume replays a published answer without publishing or consuming again", function* () {
436+
it("WAD10: a resume replays a published answer without publishing or consuming again", function* () {
437437
const root = yield* useStorageRoot();
438438
const seen: unknown[] = [];
439439
const twoWaits = function* (): Operation<unknown> {
@@ -473,7 +473,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
473473
expect(answerRows(root)[0]?.["consumed_at"]).toEqual(consumedAt);
474474
});
475475

476-
it("WA11: a failure before the publication commits leaves the answer pending", function* () {
476+
it("WAD11: a failure before the publication commits leaves the answer pending", function* () {
477477
const root = yield* useStorageRoot();
478478
const id = yield* suspendedRun(root);
479479
expect((yield* deliver(root, { suspensionId: id })).ok).toBe(true);
@@ -499,7 +499,7 @@ describe("Tier WA — a delivered answer, and the resume that spends it", () =>
499499
expect(answerRows(root)[0]?.["state"]).toBe("consumed");
500500
});
501501

502-
it("WA12: a consume that fails takes its publication back with it", function* () {
502+
it("WAD12: a consume that fails takes its publication back with it", function* () {
503503
const root = yield* useStorageRoot();
504504
const id = yield* suspendedRun(root);
505505
expect((yield* deliver(root, { suspensionId: id })).ok).toBe(true);

‎scripts/runtime-test-exclusions.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ const DENO_ONLY_TOOLING: RuntimeExclusion[] = [
240240
"publishes and replays durable suspension requests against a real node:sqlite run database through the Deno lifecycle adapter; node:sqlite remains behind --experimental-sqlite on Node 22 and Bun has none",
241241
issue: "https://github.com/taras/executable.md/issues/367",
242242
},
243+
{
244+
path: "packages/workflow/tests/workflow-suspension-answer.test.ts",
245+
reason:
246+
"delivers and spends typed answers against a real node:sqlite run database, taking the Deno lifecycle adapter's advisory lock and planting SQLite triggers in the run file; node:sqlite remains behind --experimental-sqlite on Node 22 and Bun has none",
247+
issue: "https://github.com/taras/executable.md/issues/300",
248+
},
243249
{
244250
path: "packages/cli/tests/workflow-suspension.test.ts",
245251
reason:

‎specs/executable-mdx-spec.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8762,22 +8762,22 @@ Defined in [Workflow workspaces](./workflow-workspace-spec.md) §3.
87628762
| WFH2 | One grammar | Every runtime renders the same `xmd workflow` help |
87638763
| WFH4 | Unsupported delivery | Node and Bun refuse `answer` with the same sentence, write no delivery line and create no run store |
87648764

8765-
### Tier WA — Delivering an answer to a durable wait
8765+
### Tier WAD — Delivering an answer to a durable wait
87668766

87678767
Defined in [Workflow workspaces](./workflow-workspace-spec.md) §3.5. Runs
87688768
against the production Deno adapter, on real run files.
87698769

87708770
| # | Test | Verify |
87718771
|---|------|--------|
8772-
| WA1 | Correlation | A value is retained only for the exact wait it names; a wait this run is not at, and a run that holds no such wait, are refused with nothing written |
8773-
| WA2 | The retained schema judges | Every value the response schema refuses is refused before persistence, and a value it describes still goes in afterwards |
8774-
| WA3 | The secret gate | A credential-shaped answer is refused with neither the value nor the match in the diagnostic; `--no-secret-detection` retains the same value |
8775-
| WA4 | Delivery is not execution | Status, stop reason, document-execution records and retained history are byte-for-byte what the suspension left |
8776-
| WA5 | No executor lock | A delivery succeeds while a live workflow executor holds the run's lock |
8777-
| WA6/WA7/WA8 | Refusals | A duplicate, an answer already spent, a completed run, a cancelled run and a run nothing is stored for are each refused, and none of them writes |
8778-
| WA9 | The resume spends it | One `suspension_answer` event naming the wait, the pending state consumed, and `suspendFor()` returning the delivered value |
8779-
| WA10 | Replay | A later resume restores the answer from its retained event, reaching no live controller, publishing no second event and consuming nothing again |
8780-
| WA11/WA12 | One transaction | A journal insertion that fails, and a consumption that fails, each leave the answer pending and no answer event; the next resume publishes exactly one |
8772+
| WAD1 | Correlation | A value is retained only for the exact wait it names; a wait this run is not at, and a run that holds no such wait, are refused with nothing written |
8773+
| WAD2 | The retained schema judges | Every value the response schema refuses is refused before persistence, and a value it describes still goes in afterwards |
8774+
| WAD3 | The secret gate | A credential-shaped answer is refused with neither the value nor the match in the diagnostic; `--no-secret-detection` retains the same value |
8775+
| WAD4 | Delivery is not execution | Status, stop reason, document-execution records and retained history are byte-for-byte what the suspension left |
8776+
| WAD5 | No executor lock | A delivery succeeds while a live workflow executor holds the run's lock |
8777+
| WAD6/WAD7/WAD8 | Refusals | A duplicate, an answer already spent, a completed run, a cancelled run and a run nothing is stored for are each refused, and none of them writes |
8778+
| WAD9 | The resume spends it | One `suspension_answer` event naming the wait, the pending state consumed, and `suspendFor()` returning the delivered value |
8779+
| WAD10 | Replay | A later resume restores the answer from its retained event, reaching no live controller, publishing no second event and consuming nothing again |
8780+
| WAD11/WAD12 | One transaction | A journal insertion that fails, and a consumption that fails, each leave the answer pending and no answer event; the next resume publishes exactly one |
87818781

87828782
### Tier WFX — A killed run resumes from its frontier
87838783

0 commit comments

Comments
 (0)