OptionalrequestId: stringRecord the external resource the handler created, before its terminal is awaited.
Account for everything under a settled scope WITHOUT entering a branch.
A settled scope is delivered from its own entry, so the branches are never walked — and an entry nothing walks is an orphan, which on a migration means "the edit removed this step". The branches were not removed; they were decided. So the subtree is marked consumed explicitly.
A loser still sitting pending is settled cancelled in the same pass, because that is what
it is: the scope resolved without it. Settling the record is NOT the cancellation — the world
has to be told separately, which is what cancel.issued tracks — but leaving it pending would
make a resumed run try to recover work the scope already decided to abandon.
Optionalonly: ReadonlySet<string>
Restrict the accounting to these branch keys.
A resume passes nothing and takes the whole subtree, which is correct because the program hash is unchanged and nothing under the scope can have been removed. A MIGRATION passes the losers alone: the branches it does not name are walked instead, so that an effect the edited source removed still shows up as an orphan rather than being accounted for by a scope that never entered it.
How many EFFECTS this run has already dispatched, counted from what is recorded.
The effect ceiling is a RUN bound (L4009, "Run effect ceiling reached") and the interpreter's counter is per-instance, so without this a run got a fresh allowance at every activation and a runaway loop that crashed periodically could never reach the ceiling. The journal is the only thing that survives an activation, and it already holds the answer.
Distinct KEYS, not entries: a dispatch writes a pending entry and then a settled one under the same key, and the interpreter counts the dispatch once. A pending entry still counts — the effect was performed, which is exactly why it was written before the handler was called.
A conclave counts, because its open is a dispatch and the interpreter counts it as one; the
other scope kinds dispatch nothing of their own, so their entries do not.
Optionalkind: Every entry, in append order. The journal is the prompt context for repair.
Record a hold's own binding, beside the first attempt's external rather than over it.
Look the step up and say what the interpreter should do. Marks the key consumed, which is what lets a migration tell "this step was removed" from "this step has not run yet".
Record ONE OBSERVATION onto a pending entry, leaving it pending.
The counterpart to Journal.settle, and deliberately not a variant of it. settle says
"this step has an answer, and every later activation may use it". This says "this is what the
world looked like, and it is history rather than an answer": the entry stays pending, so a
resume takes the live path and looks again. The two differ in exactly the property #1459 is
about, so they are two methods rather than one with a flag — a flag is how the next edit makes
an observation settle.
DURABLE BEFORE IT IS VISIBLE, like every other transition here: the append is awaited before the in-memory entry moves, so a store that refuses leaves the journal exactly as it was.
Entries the current replay never looked up. On a migration these are the steps the edited program removed, and what happens next depends on what they DID: a removed sleep is nothing, a removed spawn leaks a live agent, a removed resolved checkpoint discards a human decision.
Point the pending entry at a NEW open identity, before the work under it is issued.
Escalation mints twice under one entry, so between the hops the row must name the attempt that is about to be open rather than the one that already settled. Without this a crash after the second mint leaves the far side holding work under an identity the journal never recorded, and recovery reissues the first attempt and gets its cached expiry.
The INDEX moves with the id, and it is the half that recovery reads: an id says what to submit under, the index says how much of the chain is already spent.
Start a fresh replay pass.
Append the settled half.
facts.cancel is for a scope that cancels siblings: the intent is recorded WITH the outcome
rather than after it, because a process dies between instructions and two appends are two
network operations however few keywords separate them. facts.closed is a conclave's
membership disposition, for the same reason and with the same rule: it goes down with the
outcome or not at all.
Append the
pendinghalf: the effect is about to be performed.AWAIT THIS BEFORE DISPATCHING. The entry carries the request id the handler will submit under, and an identity that is not durable when the work is issued names nothing a resume can find.