The only way the harness performs an effect outside thread state (design ยง4.24, runtime rule 4). A task can run more than once - recover, a retry, a re-run after approval or an answer - so each effect keeps evidence in the thread's store under its EffectKey: an intent before the effect and the outcome after it. A completed effect replays its stored outcome, decoded with A's codec; what a replay of an intent alone does depends on the target's ReplaySupport, one entry point each. The evidence lives exactly as long as the task can run again: the commit that ends that releases it (Commit.releasesEffect), never age.
Every Left is either GraphError.EffectReplayRefused - a refusal the model should see, which a tool maps to ToolOutcome.Error - or a failure that leaves the outcome unknown or unrecorded (the store, or the effect itself), which a tool maps to ToolOutcome.Fatal and a hook to a failed node, so the task commits nothing and recover replays it from the evidence. An effect returns Left only when it did not take effect, or cannot tell: the guard never stores it.
Intents and outcomes are capped at maxOutcomeBytes encoded. An oversized intent refuses the effect before it runs; an oversized outcome is recorded as omitted, and its replay is refused, never run again.
A Verifiable effect about to run: the target's digest before and after it, the outcome it reports when it lands (presumed, returned by a replay that finds it landed), and the effect.
A Verifiable effect about to run: the target's digest before and after it, the outcome it reports when it lands (presumed, returned by a replay that finds it landed), and the effect.
The effect must be a compare-and-set against before: atomically at the target - under a lock every writer of the target takes, an OS file lock across processes - it checks that the digest is still before, and only then writes; otherwise it writes nothing and returns GraphError.EffectReplayRefused. That is what fences a run that lost its claim with its effect already under way: whichever of it and its successor writes second finds the digest moved and changes nothing. A target that cannot compare and set atomically is not Verifiable.
Performs effect on a target that records (key, outcome) in its own transaction, fenced by the run's claim token (AppliedKeys): effect is given that token, and must refuse it, changing nothing, if it is older than the newest the target has seen for key.scope. A completed effect replays its stored outcome; a begun one runs effect again, which the target answers with its recorded outcome if the first attempt applied. The target's applied key lives only until the outcome is recorded in the thread's store: a key with no begun record is stale and is forgotten, fenced like everything else, before the effect begins. Outside a runtime the token is 0.
Performs effect on a target that records (key, outcome) in its own transaction, fenced by the run's claim token (AppliedKeys): effect is given that token, and must refuse it, changing nothing, if it is older than the newest the target has seen for key.scope. A completed effect replays its stored outcome; a begun one runs effect again, which the target answers with its recorded outcome if the first attempt applied. The target's applied key lives only until the outcome is recorded in the thread's store: a key with no begun record is stale and is forgotten, fenced like everything else, before the effect begins. Outside a runtime the token is 0.
Performs an effect nothing can check. A completed effect replays its stored outcome; one that began and recorded no outcome may have run, so its replay is GraphError.EffectReplayRefused - unless idempotent (the tool's ToolHints.idempotent), when it runs again.
Performs an effect nothing can check. A completed effect replays its stored outcome; one that began and recorded no outcome may have run, so its replay is GraphError.EffectReplayRefused - unless idempotent (the tool's ToolHints.idempotent), when it runs again.
Performs a Verifiable effect. plan reads the target once and returns its digests, the outcome it will report and the effect; it runs only when the effect must run, so a check against the current state (an edit's "old not found", a quota) belongs inside it. probe reads the target's current digest; it runs only on a replay of an effect that began and did not record its outcome: matching before, it did not land, and it is planned and run again; matching after, it landed and presumed is returned; anything else is GraphError.EffectReplayRefused naming the conflict. before is checked first, so a plan whose two digests are equal (a write of what is already there) is run again rather than presumed: the probe cannot tell whether it ran, and running it again changes no digest.
Performs a Verifiable effect. plan reads the target once and returns its digests, the outcome it will report and the effect; it runs only when the effect must run, so a check against the current state (an edit's "old not found", a quota) belongs inside it. probe reads the target's current digest; it runs only on a replay of an effect that began and did not record its outcome: matching before, it did not land, and it is planned and run again; matching after, it landed and presumed is returned; anything else is GraphError.EffectReplayRefused naming the conflict. before is checked first, so a plan whose two digests are equal (a write of what is already there) is run again rather than presumed: the probe cannot tell whether it ran, and running it again changes no digest.