docs(chord): slice 6b D7, job.abort as Durable's abortTask

This commit is contained in:
Mario Zechner 2026-10-28 11:44:13 +00:00
parent cf4920c827
commit 97622a8f1e
3 changed files with 11 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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:**