# Ticket: Clean handover and context hygiene framework

## Metadata
- Type: Ticket
- Status: Done
- Project: Nimrod / Agent Operations
- Created: 2026-06-06
- Updated: 2026-06-06
- Priority: High

## Goal

Create a robust handover and context-hygiene process so new agents can continue work without inheriting context rot, overgrown prompts, poor assumptions, or ambiguous partial changes from prior agents.

## Why

A previous agent terminated mid-task during Vaultwarden setup, and a later over-contexted handover appears to have carried degraded reasoning into the next agent. Handoffs need to be factual, bounded, verifiable, and efficient.

## Scope

Included:
- Define clean handover rules
- Define terminated-agent recovery procedure
- Define compact ongoing documentation standards
- Define progressive-disclosure documentation layers
- Define when to use subagents for locator/research/review instead of loading broad context
- Define scripting/indexing/RAG/wiki options for context conservation

Not included:
- Building a full vector database immediately
- Migrating every existing note into a wiki immediately
- Autonomously trusting prior handovers without verification

## Acceptance Criteria

This ticket is done when:
- [x] A handover template exists — `docs/templates/handover-template.md`
- [x] A terminated-agent recovery checklist exists — `docs/templates/terminated-agent-recovery-template.md`
- [x] A context hygiene policy exists — `docs/context-hygiene-and-handover.md`
- [x] A progressive-disclosure documentation model is documented — included in the context-hygiene doc
- [x] Current Vaultwarden partial work has been recovered/triaged — restore test completed 2026-06-07; stale `.tar.gz.age` artifacts noted but no action required
- [x] AGENTS.md or operating docs point future agents to the process — AGENTS.md links to the context-hygiene doc from multiple sections

## Questions

- Should handovers live in `docs/session-summaries/`, per-ticket artifacts, or both?
- Should every handover include a machine-checkable state summary, e.g. `git status`, changed files, commands run, tests run?
- What tool should be used first for knowledge retrieval: linked markdown wiki, ripgrep scripts, SQLite index, or vector database?

All ACs satisfied. No remaining work on this ticket.

## Notes

- Prior agent claims should be treated as untrusted until verified against files, git diff, logs, or live system state.
