# Attempts and durable truth

> Understand interrupted execution, script and durable modes, yields, safe points, replay, and explicit failure semantics.

An execution is an attempt, not the Agent. Constal accepts input before execution, records operations at stable positions, and applies a response only when it still belongs to the accepted Run. Losing an attempt therefore loses compute, not acknowledged truth.

## Two durability modes {#two-modes}

In `script` mode, the handler begins at the top after every suspension. Completed journal positions replay their recorded result. Truth advances when the Agent commits or returns. Script mode is appropriate when ordinary control flow is the clearest expression of the workflow.

In `durable` mode, `init()` creates serializable state and each completed `step()` advances a versioned cursor and durable turn fact. The next invocation begins at that cursor rather than replaying earlier turns. Use it when explicit workflow state is itself part of the design.

Both modes use the same seven primitives, Resource boundary, Policy, ledger, and failure model.

## Yields and safe points {#safe-points}

Committing and waiting on an unresolved Handle end the current invocation. Pause, safe interrupt, Policy or Resource rebind, branch, truncate, and related controls take effect at safe points. An abort control may stop active work immediately. Agent code must not swallow runtime suspension or continue using `Ctx` after a selected yield.

Every attempt is bound to the accepted deployment, Policy, Resources, cursor, and journal position. A stale or duplicate response cannot append a fact or settle an effect under different authority.

## Failure model {#failure-model}

Failures preserve prior facts, journal entries, events, and audit evidence. A nondeterministic replay fails instead of borrowing a result recorded for other arguments. An unsafe external operation with a missing result becomes `outcome-unknown` rather than an invented failure or an automatic retry. See [Resources, effects, and recovery](/docs/foundations/resources-effects.md) for how the destination contract determines safe recovery.
