A dormant session whose root cannot replay its log is woken past each event the replay raises on, by whoever may send it input, with an appended log_repaired and never a rewrite; the failure is said once, and the clients offer the wake where the refusal is shown¶
Decision 1053 · accepted · 2026-11-18 · issue #1053
D48 and D135. A log the root's replay raised on could not be woken: every activating command
failed its start again and wrote another agent_failed, and nothing let a person past it.
- Skip, with the log kept.
session.repair(Troupe.repair/2) wakes the session with the root folding tolerantly: each of its events up to the log's head now that its fold raises on is skipped, andlog_repaired {event, at, by}appended under the root for it. Every replay from then on drops the events alog_repairednames; a later event is folded as it is, so a restart never skips what nobody was asked about. The event stays, and the chain verifies. A raise outside the fold (the turn taken up) is not this: that turn is not taken up again on a wake (Decision 727), so such a session already wakes. - Who. Whoever may send it input:
control, asinput.sendis. Not a pod: there the plane wakes a session, andsession.repairanswersunavailablewith that sentence. - What the person is told. An activating command's
unavailablecarries what the root raised andrepairable: true. The desktop's composer gives way to "Wake it anyway", the TUI's line under the screen says "Wake it anyway? [w]", and a headless run that could not send namestroupe resume ID --repair. Each sends the message once woken. The transcript shows "An event fromcould not be read and was skipped", where it was in the desktop app and where the wake was in the terminal, which draws lines in arrival order. - Said once. A root whose last word is already the same
agent_failedis not made to say it again on each failed wake. Which agents have started under a tree is kept in a table the session's supervisor owns, so aLogthe tree restarts does not count the root's next start as its first (cold), which wroteagent_failedone start early and dropped an interrupted turn as if the whole session had come back.
Not chosen: rewriting or deleting the event (the chain would break, and an audit would lose
it); starting fresh with the log kept (everything after the event is lost too); recording the
failing seq at the crash (a log written before this has none; the tolerant fold finds it).
Undone, a session whose log its agent cannot read is stuck dormant again, with an
agent_failed for every try.
Governs: apps/troupe_core/lib/troupe/agent/server.ex, apps/troupe_core/lib/troupe.ex, apps/troupe_core/lib/troupe/session/log.ex, apps/troupe_gateway/lib/troupe/gateway/dispatch.ex, clients/tui/lib/troupe/ui/tui/server.ex, clients/tui/lib/troupe/cli/runner.ex, clients/gui/apps/desktop/src/views/Session.tsx, clients/gui/packages/client/src/transcript.ts