Skip to content

v0.22.0

Choose a tag to compare

@wajihtba wajihtba released this 05 Nov 10:03
· 117 commits to main since this release

Added

  • thread: Request.Metadata — the run metadata a parked run ran under, as its request recorded it: the session's run metadata (WithRunMetadata) merged under the parking Send's own context and core.Metadata pairs. The caller's labels, under its own keys, are readable by whichever process reopens the session, whatever run metadata that process opened it with. weft never reads them.

  • otel: the default resource carries the build's version-control stamp, weft.build.vcs.revision and weft.build.vcs.modified, read from debug.ReadBuildInfo (nothing when the binary has no stamp). No option and no hashing: a platform that identifies a deployable by its digest stamps it with otel.Resource or OTEL_RESOURCE_ATTRIBUTES.

  • core: the dispatch seam (ADR 0031). Call.IdempotencyKey — every call the loop executes carries a key to pass to an API that deduplicates: the IdempotencyKeys(fn) run option's, else a run-scoped key (32 hex digits of the SHA-256 of the run id and the call id). BeforeDispatch(fn) (DispatchFunc) — a gate called right before each call's handler, past the middleware and the approval check; a refusal stops the call with an error result wrapping ErrNotDispatched. A Subagent's child run inherits neither. Facade: weft.IdempotencyKeys, weft.BeforeDispatch, weft.DispatchFunc, weft.ErrNotDispatched.

  • thread: recovery-stable idempotency keys — every turn names each call's key thread.IdempotencyKey(sessionID, entryID, callID) from the assistant message entry holding the call (the running attempt's own step, or its resume boundary — never an older message that reused the call id), so the same call keeps its key across a crash, a restart, a resume and a recovery retry, while a call id the model re-issues in a later turn gets a new one. Request.IdempotencyKey carries it on a parked call (empty on a mirrored child request). A Subagent's child calls keep run-scoped keys.

  • core: ReplayKeyed — a tool that deduplicates on Call.IdempotencyKey; weft/thread retries such a call on its own when a crash cut it off. The manifest records it (replay_policy: keyed). Facade: weft.ReplayKeyed.

  • thread: crash recovery (ADR 0032). Rule A: a call that is not ReplaySafe starts only when the step entry holding it is durably appended, else it fails closed with an error result wrapping core.ErrNotDispatched (a storage error, or ErrLocked/ErrStale for a writer whose session another process took over), and only after its dispatch record — an approval_audit entry with the new step StepDispatch — is appended and flushed (one append per such call; the step entry carries MessageEntry.DispatchRecorded). After a crash, a cut-off turn whose call of unknown outcome (not ReplaySafe, dispatched, no recorded result) is on file refuses Send, Continue, Resume and every path that would arm a resume with ErrRecoveryRequired; Session.RecoverTurn(ctx) handles it once: a continuation when no call is left, a re-ask when only ReplaySafe calls were cut off, else each call parks — a call with no dispatch record (held by a park rule or a middleware, or never reached) as an ordinary request for a person; a dispatched ReplayKeyed call retried by the session with its same key (Via recovery); a dispatched ReplayNever call as a recovery request (Request.Recovery, ApprovalRequestEntry.Recovery) that a person approves (retry, same key) or denies (skip); a ReplaySafe call answered "not run again". In a step written before dispatch records nothing runs on the session's own say. An edit or ApproveAlways of a recovery request is ErrInvalidDecision. TurnEntry.CutOff marks a cut-off turn; the audit step StepRecover records each recovery. Boot recovery is Open → Claim → RecoverTurn.

  • thread: one resumer — OnReady(fn func(Ready)) hands the session's pending work to fn instead of starting it (Ready{Session, Kind, RunID}; ReadyResume, ReadyQueued, ReadyRecover): a settled boundary is not resumed (it implies AutoResume(false)) and sends queued behind a turn are not drained; fn runs after the append, off the lock, in order — an in-process, best-effort hint, not a durable event. Session.Ready() lists the work from the journal: a cut-off turn alone (ReadyRecover), a boundary whose requests are all decided or lapsed (ReadyResume, reading only), waiting sends (ReadyQueued). Boot recovery is Open → Claim → Ready → act. Under OnReady, Continue starts one queued send.

  • thread, thread/pool: shutdown is a cause, not a method. ErrShutdown (a cancellation: errors.Is(err, context.Canceled), named thread.shutdown on the run's span): a turn felled by a Close whose context ended with that cause (context.WithTimeoutCause(ctx, d, thread.ErrShutdown)), or whose own context was canceled with it, is recorded cut off (TurnEntry.CutOff, not Canceled) and its calls of unknown outcome stay unanswered without synthetic text, for RecoverTurn. pool.Close given a context already canceled with it cuts running children off and leaves their receipts unsettled for pool.Recover.

  • core: an unknown outcome is said, not guessed (ADR 0032, WR-6). A call of a tool that is not ReplaySafe whose handler started and gave no answer of its own — its Timeout passed, or the run was canceled under it — reads OUTCOME_UNKNOWN: … (CodeOutcomeUnknown), never "timed out" or "context canceled"; ParkUnknown() parks such a call instead (weft.tool.pending.source outcome_unknown). Facade: weft.ParkUnknown, weft.CodeOutcomeUnknown.

  • thread: every turn carries core.ParkUnknown(): a call of unknown outcome — a timeout, an Interrupt or Rollback send, a canceled turn — goes down the recovery ladder at the turn's end (a ReplayKeyed call retried with its same key, a ReplayNever call as a recovery request), never answered "interrupted"; the step's other results are kept. A turn a Close fells with such a call is recorded cut off, for RecoverTurn.

  • thread: the dispatch gate flushes the session (Flusher) before a call that is not ReplaySafe (WR-1): under FsyncOnFlush a step appended but not synced starts no side effect; a failed flush fails the call closed. The docs say weft sets no default request expiry (R12): RequestExpiry(d) is the caller's choice.

  • thread: the self-fence (WR-4) — Fencer (Fence(ctx, session) error), an optional Storage capability, implemented by jsonl (the locked file is still the session's) and sqlite (one read of the lock row). Before every call that is not ReplaySafe the gate checks the writer still holds the session; a writer whose lock was broken, released or taken over starts no side effect (ErrNotDispatched).

  • core: Agent.CallTool from inside a tool handler dispatches under the run's park rule (ParkOn, ParkAllExcept, an agent ParkSource): a call the rule parks returns an error wrapping ErrApprovalRequired to the handler instead of running unasked (WR-7: approval no longer fails open through a hand dispatch).

  • thread: a turn that overflows the context after starting a call with effects is not re-run from its start (WR-5): the re-run would not see the effect and could repeat it. The turn ends with ErrContextOverflow, its steps and results kept on the line; a turn whose calls were all ReplaySafe re-runs as before.

  • thread: the dispatch gate refuses a call once an Interrupt, a Rollback or Close has felled its turn, or once the run's context has ended; the gate and a Rollback serialize on the session lock, so a call held in middleware while a Rollback is accepted never starts. Any other gate refusal (a step or dispatch record not durable, a lost lease) ends the run with the cause thread.not_dispatched, the turn's error wrapping the refusal (ErrLocked for a lost lease), instead of feeding ErrNotDispatched to the model until MaxSteps. The fence is read last, after the dispatch record is flushed.

  • thread: the recovery ladder is bounded and never guesses in a live process. The session's own keyed retries of one call are capped at 3, counted from the audit steps on file (so the cap survives a restart), with a backoff of 1 s doubling from the first (1 s, 2 s, 4 s, capped at 30 s); past the cap the call waits for a person (a Timeout shorter than the provider no longer loops). A call of unknown outcome in a live process is never reconciled: its abandoned handler may still be running, so a ReplayNever call goes to a person. A skipped (denied) recovery request reads OUTCOME_UNKNOWN: tool "X" may have run; it was skipped, not retried: do not repeat it (skipped: <reason>) to the model, never DENIED: ….

  • thread/pool: Recover no longer settles a child that a crash or a shutdown cut off as failed (a parent could delegate the work again over the child's effect): the child is reattached and recovered on its own ladder (RecoverTurn) — its calls of unknown outcome park and are mirrored onto the parent as recovery requests, or it continues to its answer — and the receipt stays open meanwhile. A cut-off child that was itself delegating is ended depth first as before. A recovery that finds the child held by another writer (ErrLocked) leaves the receipt unsettled.

  • thread/pool: Recover reads a child cut off by a second crash as cut off, by the session's own rule: the last run started — a prompt, a resume (a person's approval or the session's own keyed retry), a recovery's continuation (named only by its recover audit) — with no turn entry, or one recorded cut off, that no recovery handled. Before, a continuation cut off again settled the child failed with the first cut-off turn's error, and a crash inside the session's own keyed retry left the receipt parked with nothing to decide; both are now recovered again (RecoverTurn): the keyed call runs once more under its key (up to the bound, then a person).

  • thread/pool: a child cut off while it was itself delegating is no longer settled failed (the parent read "failed" over effects its delegation may have had). Its own delegations are ended depth first (a cut-off grandchild settles canceled, never failed), the child is recovered like any cut-off child, and its delegating call — its dispatch record says it may have run — parks for a person whatever its replay class: a recovery request mirrored onto the parent, reason cut off while it delegated: the delegated work may have run; approve to delegate it again, deny to skip it. Approve delegates again; deny reads OUTCOME_UNKNOWN … do not repeat it in the child.

  • core: a call a handler dispatches with Agent.CallTool is keyed and gated like the loop's own (review P1-5): its IdempotencyKey is derived from the dispatching call's key and its position among that handler's CallTool calls (so an inner MCP call carries one), it passes the run's BeforeDispatch gate with the new Call.Outer naming the dispatching call, and a handler cut off by the run's cancellation before it answered returns an error wrapping ErrOutcomeUnknown. weft/thread's gate lets an inner call start only under an outer call it recorded as dispatched — a ReplaySafe tool's handler starts no effect. Subagent panics when marked Replay(ReplayKeyed): its child's calls carry run-scoped keys.

  • thread: a CallTool nested under an inner CallTool call is no longer always refused under a session (review 3 P2-1): the gate records the inner calls it let start, so one can be the outer call of a nested one (its key derived from the outer inner call's and its position, recursively); a call nested under a ReplaySafe tool's call is still refused.

  • core: AfterDispatch(fn) (AfterDispatchFunc), a run option beside BeforeDispatch: called on the call's goroutine once a handler that started has returned or panicked — also a handler the loop abandoned at its Timeout or the run's cancellation, when it finally returns. A CallTool inner call inherits it; a Subagent child run does not. Facade: weft.AfterDispatch.

  • thread: a keyed call is never retried while its abandoned handler may still be running (review 3 P2-2). The end of the turn waits for the handler to return (core.AfterDispatch), at most 30 s, before the session approves its own retry; still running past that, the call parks as a recovery request for a person (outcome unknown: the call's handler is still running past its bound; …).

  • thread: no retry of any class starts beside its abandoned handler (final review P2-1, P2-4). A ReplayNever call abandoned at its Timeout was offered as a recovery request at once, and a fast Approve started a second handler while the first still ran. The end of the turn now waits for every abandoned handler whose call may be retried (keyed or ReplayNever) before it retries or offers the call, in parallel under one shared 30 s deadline (N calls: 30 s, not N × 30 s). Still running past it, the reason reads outcome unknown: the call's handler is still running past its bound; approve to retry it with the same idempotency key once it has returned, deny to skip it (model-visible) and an approval is refused with the new thread.ErrStillRunning until the handler returns; a deny or a resolve is taken.

  • thread: Resume refuses with ErrRecoveryRequired while a recovery request is undecided (final review P1-3): its default would deny it no decision, a plain DENIED the model answers by asking again for a call that may have run. A person approves (retry) or denies (skip) it.

  • thread: a turn whose cancellation (an Interrupt, its own context) parks a call that may have run as a recovery request reports it: its Wait error matches ErrRecoveryRequired beside the cancellation (final review P2-2). Sends queued behind it — an Interrupt's own turn — wait until a person decides, unbounded by design (documented on Interrupt and in docs/thread-operations.md).

  • thread: one choke point refuses every resume over an undecided recovery request (release-gate review P1-A). The check lives where a resume is minted (mintResumeLocked, beside the cut-off check) and again where the runner starts one (runResume), so every arming path inherits it — Decide, DecideSigned, Resume, Continue, a Send's settled-boundary pickup, the runner's own hand-offs, RecoverTurn, ReplayDecisions and the pool's replay. Before, an Interrupt that felled a resume while its approved call with effects ran re-armed the resume with no check: the call's new recovery request was denied DENIED: no decision and the model asked again. The boundary now stays parked, the Interrupt's turn queued behind it, until a person approves (retry) or denies (skip) the request.

  • thread: an abandoned handler is known to the process, not to the Session (release-gate review P2-1, P2-2). A Close then Open of the same session in one process (a server evicting an idle session) lost it, and an Approve of the still-running call started a second handler beside the first. A process-wide registry, keyed by the call's run id and call id — run ids embed their origin session, so every session holding the request asks under the same key (a Fork that copied it too: its approval was taken beside the running handler, last-round P2-1); a collision of two stores' pinned session ids can only refuse — is filled when the end of a turn leaves a handler running and emptied by core.AfterDispatch when the handler returns — whatever became of the request — so it holds only handlers that run. thread.AbandonedHandler(runID, callID) <-chan struct{} reads it (nil when none runs).

  • thread: a Close that gives up never lets a retry start beside the handler it abandoned (release-gate review, last round, P1-1). A handler that ignored the cancellation of a turn a Close gave up on was left running with the turn recorded cut off and the handler filed nowhere; a Close, Open, RecoverTurn in the same process then retried a keyed call at once beside it, asked a ReplayNever call's Reconcile while it ran, and took an Approve that started a second handler. The cut-off turn's end now files every unknown-outcome call's live handler in the registry under the cut-off run, and RecoverTurn treats a filed, still-running call as still running: no keyed retry, no Reconcile, the call parked for a person (outcome unknown: the call's handler is still running past its bound; …), Approve refused with ErrStillRunning until the handler returns. TestCloseGiveUpThenRecoverTurnWaitsForTheStillRunningHandler, TestForkRefusesApprovingAStillRunningCall, TestStillRunningRunIDCollisionOnlyRefuses.

  • thread: a delegating call whose thread/pool delegation may still be live is never offered as a retry (release gate, last round). A sync delegation's parent Close gave up while the child's handler ignored the cancellation; reopened in the same process, RecoverTurn run before the pool's Recover saw no mirror yet and parked the delegating call as an approve to retry recovery request beside the child's mirrored still-running request — approving it delegated a second time. RecoverTurn now reads the durable delegation state, the pool's acceptance receipt with no settlement, as well as the mirror, and leaves such a call to the pool in either order. While the delegation is open the call stays offered as its boundary's own call, its Reason saying the delegation is still open, and an Approve of it is refused with ErrStillRunning until the delegation settles (the case where the pool still holds the ending delegate and takes nothing up). TestCloseGiveUpSyncDelegationIsNotOfferedAsARetry.

  • thread/pool: a child a shutdown Pool.Close cut off has its Close finished by the closed pool once the cut-off landed, releasing its hold on the storage: a pool rebuilt in the same process can Recover it (it read ErrLocked for the life of the process), and the recovered call waits for the handler still running (last-round P1-1). A refused pump waits for a child's abandoned handler with at most one goroutine per handler, not one per refusal (last-round P2-2). TestPoolCloseGiveUpThenRecoverWaitsForTheStillRunningHandler, TestPumpWhenReturnedKeepsOneWaiterPerHandler.

  • thread/pool: a child's refusal to resume is never a failed delegation (release-gate review P1-B). Pool.Decide and Pool.DecideSigned refuse an approval of a mirrored recovery request whose child handler still runs with thread.ErrStillRunning before the parent records anything (before, the parent recorded it, the child's replay was refused, and the delegation settled failed — SUBAGENT_FAILED to the parent's model). A child's ErrStillRunning or ErrRecoveryRequired — a replay it refused (an approval recorded on the parent session directly), or a turn of its that parked a call of unknown outcome while the delegation's own context is live — parks the delegation again on its mirrors, in one place (refusedReplay), and the pool replays a refused approval when the handler returns. A run its own context ended (Cancel, Close, a shutdown) settles as before.

  • thread: RecoverTurn leaves a delegating call whose child is alive and mirrored to the pool (final review P1-1): after Open → pool.Recover → RecoverTurn it also parked that call as a recovery request, and approving both delegated twice.

  • thread/pool: under a session a delegation dispatched from a handler's Agent.CallTool (core.Call.Outer set) is refused before any child exists, with the new pool.ErrNestedDelegation (final review P1-2): its receipt, lineage and mirrors named an inner call the parent's transcript does not hold, the outer call was offered as an unknown outcome beside the parked child, and approving both delegated twice.

  • core: a handler that returns the park of a call it dispatched with Agent.CallTool (a RequireApproval or park-rule tool) fails its own call instead of parking it (final review P2-3): an approval never carries to the dispatched call, so the rerun parked again for ever (under a session it was offered as "may have run"). CallTool still returns an error matching ErrApprovalRequired to the handler; returned, the model reads tool "X", dispatched by this call's handler, requires approval and did not run: a dispatched call is never parked for one (model-visible). A handler's own ErrApprovalRequired still parks its call.

  • thread: a Reconcile "missing" answer's rerun counts toward the session's cap of 3 automatic retries (review 3 P2-3): it writes the same retry audit step, and past the cap the call goes to a person — a handler that takes the process down every time no longer loops across restarts.

  • thread/sqlite: every commit fsyncs the write-ahead log (synchronous=FULL) under either fsync policy (review 3 P2-4). FsyncOnFlush was synchronous=NORMAL with Flush a passive WAL checkpoint, whose busy and partial results were ignored — a reader holding an old snapshot left it nothing to sync, so the dispatch record the gate flushed was not durable before the handler. FsyncOnFlush is now accepted and changes nothing for sqlite; Flush only answers whether the session exists.

  • thread: recovery reads a call's replay class as of its dispatch (review 3 P2-5): the dispatch record names the class (Detail), so a tool relabeled across a deploy no longer turns a cut-off ReplayNever call into "not run again" (ReplaySafe) or a session-approved retry (ReplayKeyed); it parks for a person. The reverse (a ReplaySafe tool relabeled, dropped, or served by a ToolSource that is gone) is a deploy rule in ADR 0032: its unrecorded cut-off call reads "cut off before it started".

  • core: a handler that panics in a tool that is not ReplaySafe has an unknown outcome — OUTCOME_UNKNOWN: tool "X" panicked before it answered (v); it may have run; outcome unknown, parked under ParkUnknown — instead of tool "X" panicked: v (model-visible; a ReplaySafe tool keeps the old text).

  • mcp: a tools/call that provably never left the client — a refused dial, arguments that are not valid JSON — is a plain failure, not ErrOutcomeUnknown; every failure after the request may have been sent stays unknown.

  • thread: a dangling call with no request entry (a tail the decision chain never saw) is offered by Pending with a deterministic Request.ID (r_ and 26 hex digits, no entry's), so a bound decision can decide it; before, its empty ID made every bound Decide refuse it.

  • thread: a Rollback never hides an effect (WR-35). A Send under Rollback whose running turn has started a call that is not ReplaySafe is accepted as an Interrupt instead — the felled turn's entries and results stay on the line — and returns its Turn with an error wrapping the new ErrRollbackRefused.

  • core, thread: the ladder's second rung — core.Reconcile(fn) (ReconcileFunc, (*ToolDef).Reconciler()): a tool that can ask its system of record whether a call with a given idempotency key took effect. For a ReplayNever call of unknown outcome the session asks it (under the session's lock, 30 s bound) before a person: found → its result is recorded as the call's (Via reconcile) and the tool does not run; missing → the call runs again under the same key; an error → a recovery request. Audited (recover steps reconcile_found, reconcile_missing, reconcile_error). Facade: weft.Reconcile, weft.ReconcileFunc.

  • thread, core: an edit is a revision (D1, G1). thread.Edit(callID, args) (OutcomeEdit, Decision.EditedArgs) closes the request and opens a revision — a new request for the same call on the edited arguments, Request.RevisionOf / ApprovalRequestEntry.RevisionOf — which the editor's decision approves once: under Quorum(n) it needs n distinct approvers, the editor counted, and approvals of the old arguments never count. Edited arguments are canonical JSON (sorted keys, no space, no HTML escaping) wherever they are hashed, signed (SignedDecision.EditedArgs, MAC-covered), recorded (ApprovalDecisionEntry.EditedArgs, EditedArgsSHA256) and run; the resume runs them with core.ApproveEdited(callID, args, by), whose result starts with the pinned EDITED: the call ran with the arguments … line, under an idempotency key that covers them — thread.IdempotencyKey takes the edited arguments' hash as a fourth argument (breaking; "" for every other call). A recovery request takes no edit. Facade: weft.ApproveEdited.

  • thread: Decision.Cosigners, SignedDecision.Cosigners (MAC-covered when present), ApprovalDecisionEntry.Cosigners (D2): the deciders external approvers counted for one forwarded decision, recorded and never counted toward weft's Quorum.

  • core, mcp: a lost answer is an unknown outcome (WR-8). core.ErrOutcomeUnknown: a handler that cannot tell whether its effect happened returns it, wrapped, and a call that is not ReplaySafe is then treated as of unknown outcome (OUTCOME_UNKNOWN, or parked under ParkUnknown for a session's ladder). weft/mcp wraps every tools/call transport failure in it, and always sends the call's idempotency key in _meta under mcp.MetaIdempotencyKey (dev.weftgo/idempotency_key), whether or not the caller link is sent. Facade: weft.ErrOutcomeUnknown.

  • core: WrapHandler(mw...), a tool option: middleware on the handler's side of the chain — after the approval boundary and the BeforeDispatch gate, inside AfterDispatch — reached only by a call allowed to start, and the handler as far as the run is concerned (its panic is the handler's; a call of a tool that is not ReplaySafe cut off in it has an unknown outcome). It may answer instead of the handler. The manifest lists it after the tool's WrapTools middleware. Facade: weft.WrapHandler.

  • thread/pool: a delegation is a call like any other — it no longer fails open (ADR 0022, ADR 0032 amendments 2026-11-04). Wrap delegated in tool middleware, ahead of the approval boundary and the dispatch gate: under a session a wrapped tool's RequireApproval (pool.ToolOptions), the run's ParkOn / ParkAllExcept, an agent's ParkSource and a middleware's park were ignored and the child ran unapproved, with no dispatch record, no felled check and no fence. The delegation now runs as the subagent tool's handler middleware (core.WrapHandler): a parked call creates no child (approve delegates once, deny never starts one), and the gate records (with the replay class), flushes and fences the delegation before its child session and acceptance receipt exist — a felled turn or a lost lease starts no child. A crash between the dispatch record and the acceptance receipt parks the call for a person as a recovery request (it may have run). The acceptance receipt no longer stands in for the dispatch record in recovery. Behaviour changes: middleware given through pool.ToolOptions(core.WrapTools(…)) now runs outside the delegation (before the approval boundary); a sync delegation of a tool that is not ReplaySafe cut off before it answered reads OUTCOME_UNKNOWN: … (under a session it parks for the recovery ladder), as any handler's does.

Format

  • Format 6 (ADR 0011 §6, ADR 0032, ADR 0021): a cut-off turn entry (cut_off), a recovery request (recovery), an edit decision (outcome: edit), its revision request (revision_of), a tool step that records its dispatches (dispatch_recorded) and a dispatch record (approval_audit step dispatch) are written with "v":6 — the v0.21.0 reader refuses each (checked against that release); a reader from 0.21 fails with ErrNewerFormat on a session this version wrote a tool step to, so a rolling deploy never hands a crash file to an older worker that would answer a call that may have run "interrupted". Every older file reads as before. Upgrade rule: drain the v0.21 workers before running this version — every assistant step that calls a tool is format 6, so a v0.21 worker refuses (ErrNewerFormat) every session that ran a tool under this version; never run the two side by side on one store, and a rollback to v0.21 strands those sessions (docs/thread-operations.md §4, "Consequences for a deployment").

Changed (breaking)

  • thread: Decision and ApprovalDecisionEntry are no longer comparable with == (they carry EditedArgs and Cosigners); compare the fields you need.
  • thread: IdempotencyKey(sessionID, entryID, callID, editedArgsSHA256) takes the edited arguments' hash ("" for a call that was not edited).
  • core: a call of a tool that is not ReplaySafe whose handler outlived its Timeout, or was cut off by a cancel, reads OUTCOME_UNKNOWN: … instead of tool "X" timed out after D / the cancellation's text (model-visible; ADR 0032). Mark read-only tools Replay(ReplaySafe) to keep the old texts.
  • thread: every Decide decision is bound to the request it answers — RequestID and ArgsSHA256, set with the new Decision.Bind(r Request); an unbound one is ErrInvalidDecision (WR-12; pool's Decide included). Write s.Decide(ctx, thread.Approve(r.CallID).Bind(r)) with r from Pending(). Signed decisions are bound by their challenge already.

Changed

  • thread: deciding is idempotent (G3, G4). The same bound decision again — same request, outcome, reason, content, decider, arguments and key — returns nil and records nothing, also under Quorum while the request still waits for its other approvals; the same signed bytes again (same nonce and MAC-covered fields) return nil without an audit entry instead of ErrReplay, so a platform that records first and re-forwards may forward again. A different decision on a decided request is still ErrNotPending; a different one under a spent nonce ErrReplay.
  • thread, thread/pool: an approved call whose resume a crash cut short is no longer run again on its own when it is not ReplaySafe: the resume is refused (ErrRecoveryRequired) and RecoverTurn parks it as a recovery request; thread/pool's Recover does this at any depth of a chain and mirrors the request to the parent.
  • thread: a parked request (ApprovalRequestEntry.Run) and a queued receipt (ReceiptEntry.Run) record the session's run metadata beside the send's own, so the resume or the restored send runs under the labels it was started with — the recorded pairs winning over the reopening Session's, as the parked settings already did. Before, only the send's own pairs were recorded and a reopen by a process with other run metadata lost them.
  • thread/pool: a child session runs under its parent's run metadata, as a fork does — written into its header at Submit, held over it when the pool reopens it — and a mirrored child request carries the child run's metadata (Request.Metadata on the parent's Pending).