From 97622a8f1e48a97e93e33cd73d0f5625dd53e3b7 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 28 Oct 2026 11:44:13 +0000 Subject: [PATCH] docs(chord): slice 6b D7, job.abort as Durable's abortTask --- packages/chord/docs/next/decisions.md | 4 ++++ packages/chord/docs/next/design.md | 2 +- packages/chord/docs/next/slice-6b.md | 11 ++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/chord/docs/next/decisions.md b/packages/chord/docs/next/decisions.md index 8e4fa1f44..e1807c69a 100644 --- a/packages/chord/docs/next/decisions.md +++ b/packages/chord/docs/next/decisions.md @@ -1675,6 +1675,10 @@ validation and copies the v2 kernel added around Delta. resets the count; at five in a row the run ends `failed { kind: "restart_limit", restarts }` (a new `JobError`), `finish` runs, `job_interrupted` is reported. Supersedes design ยง15's `blocked { restart_limit }` (no parking, as Durable since #11139). +- **Slice 6b D7: `job.abort(id, ctx): Promise<"marked" | "terminal">` (owner, 2026-10-27: "yes"):** Durable's words + and behaviour (`abortTask`): a running run's abort is stored and its signal fired, resolving `"marked"` once `run` + settled; a finishing run is only marked; a blocked run is dropped (`"marked"`, as Durable's orphan); no unsettled run + with that id resolves `"terminal"` (Chord keeps no settled runs, Q9). Supersedes "job.abort stays until 6b". - **The performance and memory bar, and converging reviews (owner, 2026-10-27: "yes"):** supersedes "as good as HEAD in everything" for Chord v2 slices and pi changes. CPU: each hot path (calls, changes, watches, links) within about 5% of HEAD, measured in bursts with alternating processes pinned to one CPU; worse is fixed or goes to the diff --git a/packages/chord/docs/next/design.md b/packages/chord/docs/next/design.md index 13ab30dc0..d98f43e86 100644 --- a/packages/chord/docs/next/design.md +++ b/packages/chord/docs/next/design.md @@ -1371,7 +1371,7 @@ host.serve(ChatStore, ({ conversation }, self) => { // local: no princi slice 6. `self.job(Job, { run, finish? })` is declared in an object's factory (not in a facet) and returns the job handle: `start(args, ctx, { key? })` (a `Run { id, outcome(ctx) }` after the commit), `tx.start(job, args, { key? })` inside `self.tx` (a `Run` handle at once, whose `outcome` rejects if the transaction is discarded), `outcome(id, ctx)` - (unsettled runs only), `abort(id)` (async and stored with persisted jobs, slice 6b) and `running`. + (unsettled runs only), `abort(id, ctx)` (`"marked" | "terminal"`, as Durable's `abortTask`: stored, resolves once `run` settled; slice 6b) and `running`. - **1. Intent:** one transaction on the owner's line. Arguments are checked against `args` (closed schema, like method arguments). Dedupe first: a run with the same `key` that is not settled is returned as it is (the run whose `finish` this transaction is never counts, so `finish` can start the same job again with the same key). Then the diff --git a/packages/chord/docs/next/slice-6b.md b/packages/chord/docs/next/slice-6b.md index 8d4e7bb1f..1800397d1 100644 --- a/packages/chord/docs/next/slice-6b.md +++ b/packages/chord/docs/next/slice-6b.md @@ -179,11 +179,12 @@ reload) writes its stopped runs back so the next activation counts nothing (Dura - **Abort** (owner, 2026-10-27: async and stored in 6b): -> **Decision needed (D7): `job.abort(id, ctx)`'s result.** Cases: a running run (its signal fires, the abort is -> stored so a rerun after a crash does not run again but finishes `aborted`); a finishing run (its outcome is decided, -> nothing to do); a blocked run (dropped); an unknown or settled id. Durable's `abortTask` returns `"marked" | -> "terminal"` and throws for an unknown id. Proposal: `Promise<"marked" | "finishing" | "dropped">`, rejecting `gone` -> for an unknown or settled id (as `outcome(id)` does). +**`job.abort(id, ctx): Promise<"marked" | "terminal">` (D7, owner, 2026-10-27), Durable's words and behaviour:** +a running run gets its abort stored (a rerun after a crash then finishes `aborted` instead of running again) and its +signal fired, and `abort` resolves `"marked"` once `run` settled (as `abortTask` joins the run); a finishing run is only +marked (`"marked"`, as Durable's `completing`); a blocked run is dropped at once (`"marked"`, as Durable's orphan); an id +with no unsettled run resolves `"terminal"` (Chord keeps no settled runs, Q9, so a settled and an unknown id are the +same; Durable throws for an unknown one). - **Deferred state persistence:**