Drift capture
When implementation diverges from specification, the difference is captured as a drift document rather than silently ignoring the gap.
Drift lifecycle
- Detection — Agent or engineer notices spec says X but implementation does Y
- Documentation — Create
.context/drift/drift-{topic}.mddescribing the gap - Resolution — Either update the spec to match reality, or fix the code to match spec
- Archival — Move resolved drift doc to
.context/drift/archive/
Drift document format
# Drift: {topic}
## Spec says
What the specification describes.
## Implementation does
What actually exists.
## Recommended resolution
Update spec / fix code / accept drift with rationale.
CI enforcement
When a drift doc is archived, the archival PR must also include:
- Updated spec (if spec was wrong)
- Updated context files (if architecture changed)
- Updated docs (if docs/ content needs updating)
What's next
- Spec-driven development — The planning pipeline
- Context maintenance rules — Keeping docs in sync