Skip to content

Provenance & Context Drift

Every derived document under .codearbiter/ traces its claims to source files in the repo. codeArbiter records this mapping as provenance: which files back a given doc, and the git hash-object hash of each file at the time the doc was authored. When a tracked source changes, the stored hash no longer matches. That mismatch is context drift.

Drift is surfaced once, passively, as a single line at SessionStart. It does not interrupt work. .codearbiter/code-map.md provides a coarse orientation map: it names the main source files and the docs that depend on them. /ca:context-check runs the same detection on demand, as a manual audit.

When a commit lands, the commit-gate auto-heal step checks whether any staged source files have drifted their dependent docs. If they have, it re-baselines the provenance in the same commit or proposes a doc update to accompany the work, so a stale claim gets flagged and corrected before it can be read as current. Auto-heal is commit-gate’s Phase 5.5, per the commit-gate skill; on an ordinary commit with an empty worklist, it costs nothing.

Per-document provenance records live under .codearbiter/.provenance/. /ca:context-check runs the same drift detection as a manual, on-demand audit, and offers three dispositions per stale doc: re-scout it from the current source, re-baseline the stored hash without re-scouting, or defer.

ChoiceUse it whenResult
Re-scoutThe source change may make the document’s claims incomplete or false.Rebuild the document from current evidence, then record new hashes.
Re-baselineYou inspected the source change and proved the existing claims remain true.Keep the document and update only its source hashes.
DeferThe document needs work that is out of scope for the current change.Leave the mismatch visible with an explicit reopen condition.

Re-baselining is an evidence claim, not a way to silence the warning. If you cannot explain why the text remains correct, re-scout or defer.

Context-drift provenance flow: a tracked source change is detected by a git hash-object mismatch, surfaced at SessionStart, and healed by commit-gate which re-baselines or proposes a doc update with the work commit.
Provenance tracks source hashes. A mismatch is detected at SessionStart and healed when the commit lands.

Run the host-native context-check command to inspect drift without changing ordinary project files: Claude Code /ca:context-check, Codex $ca-context-check, Pi /ca-context-check.

Read the report one document at a time. A clean result names no stale provenance records. A stale result should name the derived document, changed source, old hash, and current hash; if it cannot, treat the record as untrustworthy and re-scout rather than blindly re-baseline.

After a disposition, run context-check again. Re-scouted and proven re-baselined documents should leave the stale set. Deferred documents should remain visible with the condition that will reopen them; defer is tracked debt, not a green result.