Context integrity

Context integrity is the property that a team’s recorded knowledge about a codebase still matches what the code actually does — and stays that way as the code changes.

Context integrity is the property that the knowledge a team has written down about its codebase — the decisions, invariants, and gotchas — still describes the system as it exists right now. It is the inverse of context drift: where drift is the slow divergence between notes and reality, integrity is the maintained state in which the two have not come apart.

The reason it has become a first-class concern is that AI-assisted engineering widens that gap faster than people can close it. Code is generated and merged at a pace that outruns any manual effort to keep notes current, so the assumptions an engineer or agent relies on quietly go out of date. Confidence in documentation does not decay as fast as its accuracy does, which is exactly what makes silent staleness dangerous.

Integrity is preserved not by writing better docs once, but by anchoring knowledge to the code it describes and re-checking it whenever that code moves. When the anchored files change, the affected note is flagged and routed back to a human to confirm or correct — so the recorded context is continuously reconciled against the system that actually exists, instead of aging independently of it.