checkpoint()on the control plane for the durable main-path snapshot- core session create / commit / drop for reversible what-if branches
Decision model
| Requirement | Primitive |
|---|---|
| Preserve the current durable task state before compaction or divergence | checkpoint() |
| Try a temporary branch and discard it later | core.create_session, core.commit_session, core.drop_session |
| Reload a saved scratch path | core.snapshot_session, core.load_session |
Minimal implementation example
- Python
- Node / TS
branch_what_if.py
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| Main path gets overwritten by experimentation | No durable checkpoint before branching | Always checkpoint the primary path first |
| Scratch changes vanish too early | Branch was dropped before review | Snapshot or commit only after inspection |
| Compaction loses the decision context | Branching happened without checkpointing | Save a checkpoint before diverging |
Next steps
- Apply the durable path in Sessions and branching.
- Combine branching with planner state at Stateful task trees.