Problem
The refinery patrol (and similar wisp-based loops) relies on each iteration pouring the next wisp before burning the current one. If the session crashes at the wrong moment — after starting work but before pouring the next wisp — the entire loop breaks permanently.
Failure scenario
- Refinery is processing work in wisp N
- Quota exhaustion (or any crash) kills the session
- Wisp N is still assigned but the session is dead
- No new wisp N+1 was poured
- When the session eventually restarts, it may find the old wisp but the chain is interrupted
- If the old wisp gets cleaned up (burn, timeout), there's no next iteration
Impact
The gascity refinery patrol loop broke during quota exhaustion. 6 work beads sat unprocessed for hours until manual intervention poured a fresh wisp.
Suggested fixes
Option A: External wisp watchdog
An order (not wisp-driven) that periodically checks: "does each always-on agent have an active wisp assigned?" If not, pour one. This is the NDI (nondeterministic idempotence) approach — multiple observers, convergent.
Option B: Reconciler-aware wisp management
The reconciler could detect named sessions with no active wisp and trigger formula dispatch.
Option C: Crash-safe pour-before-burn
Make the formula runner pour the next wisp at the START of each iteration (not the end), so crashes after pour are safe. The old wisp stays around as a no-op if the new one takes over.
Option A is most aligned with the existing architecture (NDI, no framework intelligence).
Problem
The refinery patrol (and similar wisp-based loops) relies on each iteration pouring the next wisp before burning the current one. If the session crashes at the wrong moment — after starting work but before pouring the next wisp — the entire loop breaks permanently.
Failure scenario
Impact
The gascity refinery patrol loop broke during quota exhaustion. 6 work beads sat unprocessed for hours until manual intervention poured a fresh wisp.
Suggested fixes
Option A: External wisp watchdog
An order (not wisp-driven) that periodically checks: "does each always-on agent have an active wisp assigned?" If not, pour one. This is the NDI (nondeterministic idempotence) approach — multiple observers, convergent.
Option B: Reconciler-aware wisp management
The reconciler could detect named sessions with no active wisp and trigger formula dispatch.
Option C: Crash-safe pour-before-burn
Make the formula runner pour the next wisp at the START of each iteration (not the end), so crashes after pour are safe. The old wisp stays around as a no-op if the new one takes over.
Option A is most aligned with the existing architecture (NDI, no framework intelligence).