# Reset Handoff Pattern — Streaming App Phase 4 → Phase 5

Use this as a compact reference when a user asks to reset/start a fresh session and wants full continuity preserved.

## What made the handoff robust

- Updated the whole handoff set, not a single file:
  - `SESSION_HANDOFF.md`
  - `docs/PROJECT_CONTEXT.md`
  - `docs/NEXT_SESSION_START.md`
  - `docs/plans/<NEXT_PHASE>_PLAN.md`
  - `README.md`
- Replaced stale phase/test/commit references across docs.
- Put detailed state in project files, not persistent memory.
- Saved only a compact memory pointer: project path, current docs commit, code baseline, test count, and first next objective.
- Verified both code and docs before committing:
  - project lint command
  - project type-check command
  - full tests
  - `git diff --check`
  - `git status --short`
- Committed documentation handoff separately from code hardening.

## Recommended reset handoff structure

`SESSION_HANDOFF.md` should include:

- current UTC timestamp
- project path
- branch
- docs commit and code baseline commit if different
- exact startup commands and expected outputs
- architecture rules
- current capabilities
- recent completed work
- active decisions
- known issues/gaps
- best next steps in priority order

`docs/NEXT_SESSION_START.md` should be shorter and operational:

- enter project
- read files in order
- verify baseline
- first objective
- exact files to inspect first

`docs/plans/<NEXT_PHASE>_PLAN.md` should be actionable:

- first task is baseline verification
- then research/contract discovery if external APIs are involved
- then failing tests
- then implementation
- then verification and commit

## Pitfalls caught

- README and project context often lag behind code phases; check them explicitly.
- Test counts and source-file counts become stale after hardening passes.
- `git diff --check` catches trailing whitespace in Markdown handoffs before commit.
- Memory may be near full; replacing an old project pointer is better than adding a large new memory.
