Repository navigation
v0.22.0
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 parkingSend's own context andcore.Metadatapairs. 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.revisionandweft.build.vcs.modified, read fromdebug.ReadBuildInfo(nothing when the binary has no stamp). No option and no hashing: a platform that identifies a deployable by its digest stamps it withotel.ResourceorOTEL_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: theIdempotencyKeys(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 wrappingErrNotDispatched. ASubagent'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.IdempotencyKeycarries it on a parked call (empty on a mirrored child request). ASubagent's child calls keep run-scoped keys. -
core:
ReplayKeyed— a tool that deduplicates onCall.IdempotencyKey;weft/threadretries 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
ReplaySafestarts only when the step entry holding it is durably appended, else it fails closed with an error result wrappingcore.ErrNotDispatched(a storage error, orErrLocked/ErrStalefor a writer whose session another process took over), and only after its dispatch record — anapproval_auditentry with the new stepStepDispatch— is appended and flushed (one append per such call; the step entry carriesMessageEntry.DispatchRecorded). After a crash, a cut-off turn whose call of unknown outcome (notReplaySafe, dispatched, no recorded result) is on file refusesSend,Continue,Resumeand every path that would arm a resume withErrRecoveryRequired;Session.RecoverTurn(ctx)handles it once: a continuation when no call is left, a re-ask when onlyReplaySafecalls 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 dispatchedReplayKeyedcall retried by the session with its same key (Viarecovery); a dispatchedReplayNevercall as a recovery request (Request.Recovery,ApprovalRequestEntry.Recovery) that a person approves (retry, same key) or denies (skip); aReplaySafecall answered "not run again". In a step written before dispatch records nothing runs on the session's own say. An edit orApproveAlwaysof a recovery request isErrInvalidDecision.TurnEntry.CutOffmarks a cut-off turn; the audit stepStepRecoverrecords each recovery. Boot recovery is Open → Claim → RecoverTurn. -
thread: one resumer —
OnReady(fn func(Ready))hands the session's pending work tofninstead of starting it (Ready{Session, Kind, RunID};ReadyResume,ReadyQueued,ReadyRecover): a settled boundary is not resumed (it impliesAutoResume(false)) and sends queued behind a turn are not drained;fnruns 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. UnderOnReady,Continuestarts one queued send. -
thread, thread/pool: shutdown is a cause, not a method.
ErrShutdown(a cancellation:errors.Is(err, context.Canceled), namedthread.shutdownon the run's span): a turn felled by aClosewhose 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, notCanceled) and its calls of unknown outcome stay unanswered without synthetic text, forRecoverTurn.pool.Closegiven a context already canceled with it cuts running children off and leaves their receipts unsettled forpool.Recover. -
core: an unknown outcome is said, not guessed (ADR 0032, WR-6). A call of a tool that is not
ReplaySafewhose handler started and gave no answer of its own — itsTimeoutpassed, or the run was canceled under it — readsOUTCOME_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 (aReplayKeyedcall retried with its same key, aReplayNevercall as a recovery request), never answered "interrupted"; the step's other results are kept. A turn aClosefells with such a call is recorded cut off, forRecoverTurn. -
thread: the dispatch gate flushes the session (
Flusher) before a call that is notReplaySafe(WR-1): underFsyncOnFlusha 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 notReplaySafethe 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.CallToolfrom inside a tool handler dispatches under the run's park rule (ParkOn,ParkAllExcept, an agentParkSource): a call the rule parks returns an error wrappingErrApprovalRequiredto 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 allReplaySafere-runs as before. -
thread: the dispatch gate refuses a call once an Interrupt, a Rollback or
Closehas 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 causethread.not_dispatched, the turn's error wrapping the refusal (ErrLockedfor a lost lease), instead of feedingErrNotDispatchedto the model untilMaxSteps. 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
Timeoutshorter 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 aReplayNevercall goes to a person. A skipped (denied) recovery request readsOUTCOME_UNKNOWN: tool "X" may have run; it was skipped, not retried: do not repeat it (skipped: <reason>)to the model, neverDENIED: …. -
thread/pool:
Recoverno longer settles a child that a crash or a shutdown cut off asfailed(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:
Recoverreads 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 itsrecoveraudit) — with no turn entry, or one recorded cut off, that no recovery handled. Before, a continuation cut off again settled the childfailedwith 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 settlescanceled, neverfailed), 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, reasoncut off while it delegated: the delegated work may have run; approve to delegate it again, deny to skip it. Approve delegates again; deny readsOUTCOME_UNKNOWN … do not repeat itin the child. -
core: a call a handler dispatches with
Agent.CallToolis keyed and gated like the loop's own (review P1-5): itsIdempotencyKeyis derived from the dispatching call's key and its position among that handler'sCallToolcalls (so an inner MCP call carries one), it passes the run'sBeforeDispatchgate with the newCall.Outernaming the dispatching call, and a handler cut off by the run's cancellation before it answered returns an error wrappingErrOutcomeUnknown.weft/thread's gate lets an inner call start only under an outer call it recorded as dispatched — aReplaySafetool's handler starts no effect.Subagentpanics when markedReplay(ReplayKeyed): its child's calls carry run-scoped keys. -
thread: a
CallToolnested under an innerCallToolcall 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 aReplaySafetool's call is still refused. -
core:
AfterDispatch(fn)(AfterDispatchFunc), a run option besideBeforeDispatch: called on the call's goroutine once a handler that started has returned or panicked — also a handler the loop abandoned at itsTimeoutor the run's cancellation, when it finally returns. ACallToolinner call inherits it; aSubagentchild 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
ReplayNevercall abandoned at itsTimeoutwas offered as a recovery request at once, and a fastApprovestarted 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 orReplayNever) 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 readsoutcome 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 newthread.ErrStillRunninguntil the handler returns; a deny or a resolve is taken. -
thread:
Resumerefuses withErrRecoveryRequiredwhile a recovery request is undecided (final review P1-3): its default would deny itno decision, a plainDENIEDthe 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: itsWaiterror matchesErrRecoveryRequiredbeside the cancellation (final review P2-2). Sends queued behind it — an Interrupt's own turn — wait until a person decides, unbounded by design (documented onInterruptand 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, aSend's settled-boundary pickup, the runner's own hand-offs,RecoverTurn,ReplayDecisionsand the pool's replay. Before, anInterruptthat felled a resume while its approved call with effects ran re-armed the resume with no check: the call's new recovery request was deniedDENIED: no decisionand 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). AClosethenOpenof the same session in one process (a server evicting an idle session) lost it, and anApproveof 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 (aForkthat 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 bycore.AfterDispatchwhen 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
Closethat 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 aClosegave up on was left running with the turn recorded cut off and the handler filed nowhere; aClose,Open,RecoverTurnin the same process then retried a keyed call at once beside it, asked aReplayNevercall'sReconcilewhile it ran, and took anApprovethat 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, andRecoverTurntreats a filed, still-running call as still running: no keyed retry, noReconcile, the call parked for a person (outcome unknown: the call's handler is still running past its bound; …),Approverefused withErrStillRunninguntil 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
Closegave up while the child's handler ignored the cancellation; reopened in the same process,RecoverTurnrun before the pool'sRecoversaw no mirror yet and parked the delegating call as anapprove to retryrecovery request beside the child's mirrored still-running request — approving it delegated a second time.RecoverTurnnow 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, itsReasonsaying the delegation is still open, and anApproveof it is refused withErrStillRunninguntil 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.Closecut off has itsClosefinished by the closed pool once the cut-off landed, releasing its hold on the storage: a pool rebuilt in the same process canRecoverit (it readErrLockedfor 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.DecideandPool.DecideSignedrefuse an approval of a mirrored recovery request whose child handler still runs withthread.ErrStillRunningbefore the parent records anything (before, the parent recorded it, the child's replay was refused, and the delegation settledfailed—SUBAGENT_FAILEDto the parent's model). A child'sErrStillRunningorErrRecoveryRequired— 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:
RecoverTurnleaves a delegating call whose child is alive and mirrored to the pool (final review P1-1): afterOpen → pool.Recover → RecoverTurnit 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.Outerset) is refused before any child exists, with the newpool.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(aRequireApprovalor 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").CallToolstill returns an error matchingErrApprovalRequiredto the handler; returned, the model readstool "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 ownErrApprovalRequiredstill 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 sameretryaudit 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).FsyncOnFlushwassynchronous=NORMALwithFlusha 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.FsyncOnFlushis now accepted and changes nothing for sqlite;Flushonly 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-offReplayNevercall into "not run again" (ReplaySafe) or a session-approved retry (ReplayKeyed); it parks for a person. The reverse (aReplaySafetool relabeled, dropped, or served by aToolSourcethat 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
ReplaySafehas an unknown outcome —OUTCOME_UNKNOWN: tool "X" panicked before it answered (v); it may have run; outcome unknown, parked underParkUnknown— instead oftool "X" panicked: v(model-visible; aReplaySafetool 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
Pendingwith a deterministicRequest.ID(r_and 26 hex digits, no entry's), so a bound decision can decide it; before, its empty ID made every boundDeciderefuse it. -
thread: a Rollback never hides an effect (WR-35). A
SendunderRollbackwhose running turn has started a call that is notReplaySafeis accepted as anInterruptinstead — the felled turn's entries and results stay on the line — and returns itsTurnwith an error wrapping the newErrRollbackRefused. -
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 aReplayNevercall 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 (Viareconcile) and the tool does not run; missing → the call runs again under the same key; an error → a recovery request. Audited (recoverstepsreconcile_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: underQuorum(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 withcore.ApproveEdited(callID, args, by), whose result starts with the pinnedEDITED: the call ran with the arguments …line, under an idempotency key that covers them —thread.IdempotencyKeytakes 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'sQuorum. -
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 notReplaySafeis then treated as of unknown outcome (OUTCOME_UNKNOWN, or parked underParkUnknownfor a session's ladder). weft/mcp wraps every tools/call transport failure in it, and always sends the call's idempotency key in_metaundermcp.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 theBeforeDispatchgate, insideAfterDispatch— 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 notReplaySafecut off in it has an unknown outcome). It may answer instead of the handler. The manifest lists it after the tool'sWrapToolsmiddleware. 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).
Wrapdelegated in tool middleware, ahead of the approval boundary and the dispatch gate: under a session a wrapped tool'sRequireApproval(pool.ToolOptions), the run'sParkOn/ParkAllExcept, an agent'sParkSourceand 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 throughpool.ToolOptions(core.WrapTools(…))now runs outside the delegation (before the approval boundary); a sync delegation of a tool that is notReplaySafecut off before it answered readsOUTCOME_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_auditstepdispatch) are written with"v":6— the v0.21.0 reader refuses each (checked against that release); a reader from 0.21 fails withErrNewerFormaton 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:
DecisionandApprovalDecisionEntryare no longer comparable with==(they carryEditedArgsandCosigners); 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
ReplaySafewhose handler outlived itsTimeout, or was cut off by a cancel, readsOUTCOME_UNKNOWN: …instead oftool "X" timed out after D/ the cancellation's text (model-visible; ADR 0032). Mark read-only toolsReplay(ReplaySafe)to keep the old texts. - thread: every
Decidedecision is bound to the request it answers —RequestIDandArgsSHA256, set with the newDecision.Bind(r Request); an unbound one isErrInvalidDecision(WR-12; pool'sDecideincluded). Writes.Decide(ctx, thread.Approve(r.CallID).Bind(r))withrfromPending(). 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
Quorumwhile 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 ofErrReplay, so a platform that records first and re-forwards may forward again. A different decision on a decided request is stillErrNotPending; a different one under a spent nonceErrReplay. - 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) andRecoverTurnparks it as a recovery request;thread/pool'sRecoverdoes 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.Metadataon the parent'sPending).