# Long-Horizon & Multi-Session Tasks

Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.

Patterns for tasks that span multiple sessions or phases.

---

## Checkpoint / Resume

- ! **On resume, read the checkpoint — don't replay history.** The checkpoint file is the source of truth, not the conversation that produced it.
- ~ Write checkpoints to `./vbrief/plan.vbrief.json` in the workspace
- ~ Use vBRIEF status lifecycle: `pending` → `running` → `completed` / `blocked` / `cancelled`
- ~ Include a `plan` object with a `title` summarizing the overall objective, `status`, and an `items` array
- ! When scope vBRIEFs exist, `plan.vbrief.json` MUST carry a `planRef` to the scope vBRIEF(s) being implemented — this enables the resuming agent to load the durable scope record from `./vbrief/active/`
- ? Add a `narrative` to tasks that need explanation for a future session or agent

## Task Dependencies (DAG Edges)

When tasks have dependencies, express them as vBRIEF edges:

| Edge type      | Meaning                                    |
|----------------|--------------------------------------------|
| `blocks`       | Target cannot start until source completes |
| `informs`      | Target should consider source's output     |
| `invalidates`  | Source completion may require target redo   |
| `suggests`     | Source outcome may spawn target            |

- ~ Use edges when task order matters or when agents need to coordinate
- ≉ Adding edges for trivially sequential tasks — a list order is sufficient

## Context Summarization Between Phases

- ~ **Summarize before moving on** — when completing a phase, write a brief summary of decisions made, files changed, and open questions
- ~ Carry the summary forward, not the full history
- ≉ Re-reading entire conversation history when a checkpoint exists

## Partition → recurse → combine

For large codebases or long documents, **partition** the work into slices,
**recurse** (or re-enter) with focused context per slice, then **combine**
results at a higher checkpoint — rather than stuffing the whole surface into
one window. This is the long-horizon form of human-curated context
partitioning ([context.md](./context.md) Strategy 2 Select; research framing
on #487). Prefer handles and slice summaries over pasting full subtree
contents. Hierarchical compression of *what already happened* remains
[fractal-summaries.md](./fractal-summaries.md); do not treat that file as a
rebrand of external RLM identity.

## Progress Tracking

- ~ Maintain `./vbrief/plan.vbrief.json` for multi-phase work — this is the session-level tactical plan (the *how right now*)
- ~ Update task statuses as work progresses
- ! Mark tasks `blocked` with a narrative explaining the blocker
- ~ On task completion, review for learnings worth persisting to [meta/lessons.md](../../meta/lessons.md)
- ! On scope completion, use `task scope:complete` to move the scope vBRIEF from `active/` to `completed/` and update the origin (close the GitHub issue, etc.)
- ⊗ Use a separate `progress.vbrief.json` — progress tracking lives in `plan.vbrief.json`
- ⊗ Use scope vBRIEFs as session scratchpads — use `plan.vbrief.json` for tactical session work
