On this page

ADR-0312: Stateful Time-Travel App & TUI Workbench (tenon session)

Context

Agents iterating on interactive Tenon App / ActionApp programs previously paid a full compile-and-restart cycle on every UI or reducer tweak: editing view() or apply() forced a fresh process launch and manual re-navigation back to the deep state (rev #5+) under inspection. Meanwhile, tenon_compiler::interp already executes lowered pure Core IR in sub-millisecond trap-isolated domains (script_serve::serve_program) with deterministic JSON <-> Value marshaling.

Decision

Introduce tenon session [<pkg_or_file>] (crates/tenon/src/session/) as a persistent JSONL stdio workbench host over tenon_compiler::interp, plus six first-class MCP operations (session.start, session.step, session.render, session.rewind, session.fork, session.reload) in tenon-dev-mcp.

1. In-Memory Revision Checkpoints & Branching

2. Layout-Hash-Aware Hot Reload

3. Diagnostics & Sandbox Guarantees

4. MCP Surface (tenon-dev-mcp)

Expose session.start, session.step, session.render, session.rewind, session.fork, and session.reload in ops/session.tn, core/registry.tn, and core/router.tn following the ops/app.tn pattern (with strict argument validation, redaction, and effect gating).

Consequences