work step was cut short. The first attempt's calls and actions may be repeated; the budget and the ledger show both.Diagram as text
- Before the crash: the
startstep was acknowledged (the move toassigned); theworkstep was cut short. resume(run_id, plan)runs only when the previous engine is gone. It writesrun.resumedand closes reservations the crash left open.- An acknowledged step is never run again.
- The step that was cut short runs again from its start, in a new epoch, recorded first as a
step_restarteddecision. - Then the
gatesstep runs.
A run can be interrupted by a crash or a restart. A durable run keeps enough to continue.
Status: Coming soon. Durable runs are not offered until a real crash-and-resume test passes: a durable run killed mid-run, restarted, and resumed from its recorded state with the ledger intact.
What is built today: a run that is interrupted resumes from its last acknowledged step: finished
steps are not run again, the step that was cut short runs again from its start, and the ledger records it
(step_restarted). The light engine (SQLite or PostgreSQL) and an optional Temporal engine are supported;
Temporal’s dev server is for evaluation only.
Coming soon
Section titled “Coming soon”These three parts of durable runs are not built yet:
- A decision route for tasks that need a person (
needs_human). - CLI sign-in for starting runs.
- Starting runs with an API token.
Each task goes through three steps. A step is acknowledged by one transaction that also writes its ledger entry.
| Step | Starts when the task is | Acknowledged by |
|---|---|---|
| start | proposed |
the move to assigned |
| work | assigned or in_progress |
the move to submitted, which stores the output |
| gates | submitted or verifying |
the move out of verifying |
Resume
Section titled “Resume”The engine’s resume(run_id, plan) continues a run that has run.started and no run.ended, and
only when the previous engine is gone (see “Precondition” below). It
writes run.resumed, closes reservations the crash left open, and runs each task from its step.
- An acknowledged step is never run again: a task found in
submittedorverifyingdoes not call its worker again. - A step that was cut short runs again from its start, in a new epoch, recorded first as a
step_restarteddecision. The calls and actions of the first attempt may be repeated, and the budget and the ledger show both. No model responses are stored for replay. - Without stored content (an in-process run), a task found
submittedgoes to a human.
Precondition
Section titled “Precondition”Resume is allowed only when the engine that was running the run is gone. Nothing in the engine can
prove that, so a caller who knows passes previous_engine_gone=True. Without it, resume refuses if
the run wrote to its ledger a moment ago or has a model call reserved less than the reconcile age ago
(a call that may still be in flight). This keeps two engines from working on one run.
Choosing the engine
Section titled “Choosing the engine”A durable run is driven by one of two engines, and the run records which one in run.started.
| Engine | Use it for | Limits |
|---|---|---|
| light (the engine for a self-hosted server with no Temporal address) | Self-hosting and evaluation. No cluster: it runs on your own database. | One light engine per database, no horizontal scale, failover no faster than the 60 second lease, second-level timers, and a stopped server runs nothing. Not for production load. |
temporal (NURAMESH_TEMPORAL_ADDRESS set) |
Production, and always for a hosted deployment. | Needs the temporal extra (installed from the wheel, see the Temporal quickstart) and a Temporal cluster. |
The Temporal dev server is for evaluation only; production needs a real Temporal cluster.
Both engines call the same engine methods with the same clock, so a run behaves the same on either. On the temporal engine, and on a runner started with the fake model only, a durable run uses the fake model only: a plan that names a real model is refused. The light engine admits a real model only when the plan passes its start checks: an approved model, a current key, a known price, a budget that covers it, the data class you state, and a sandbox for any test-command gate.
Choosing and switching the engine
Section titled “Choosing and switching the engine”On this version the engine follows from your setup: a server with a Temporal address
(NURAMESH_TEMPORAL_ADDRESS) uses Temporal; the light engine is the one for a server without it.
There is no separate setting to pick the engine yet.
Switching the engine is not supported in this release. A run belongs to the engine that started it; after a switch the new engine does not pick it up, so the run is stranded (it stays unfinished and does nothing). There is no startup check that warns you and no supported way to move runs between engines yet. Finish or stop all runs first, then switch.
Waiting for a person
Section titled “Waiting for a person”A task that waits for a human decision keeps its input for at most 90 days from the moment it
was captured. This applies to tasks waiting in verifying, on both engines:
- 14 days and 3 days before the end, the approvers are warned. A warning is a ledger entry
(
human_wait_warning); it shows as await_warningfield on the run’s detail (GET /v1/runs/{id}) for people who may decide (the approvals list and the app do not show it yet), and, when email is configured, one short mail with fixed words (no task title, no output) to each person who may answer the gate: the approvers the gate names, or every member who may decide when it names none. A mail that fails never blocks the wait. With email off, nothing tells the approvers except that field and the ledger entry. The mail can arrive twice in a rare crash window, never more than twice. - At 90 days the wait stops: a
human_wait_expiredentry is written and the task is cancelled with a plain reason; tasks that depend on it are cancelled too. A decision that arrives later is refused as expired. The check uses the store clock and the stored times, so a clock that jumps forward cannot stop a task early. - A halted organization gets no warning mail and no stop while it is halted; the clock keeps running, and when the organization resumes the stop is applied if the deadline has passed.
Tasks that end in needs_human have no warning and no 90-day stop yet; the retention sweep does
not remove them yet.
Temporal
Section titled “Temporal”Durable runs on Temporal are an optional extra (the temporal extra of the wheel, the nuramesh.temporal module). The library, the command line and the in-process engine need no Temporal. The Temporal dev server is for evaluation only; production needs a real Temporal cluster.
resume is an engine call. There is no nuramesh resume command yet.
Related pages
Section titled “Related pages”- Content store and retention: where a durable run keeps outputs.
- Tasks and gates: the task states the steps move through.
- Stopping a run.
Was this page helpful?