Detect architecture drift
Goal: find out whether current code still matches what Project Memory records, and handle the two kinds of mismatch correctly.
Skills: Memory (check) or Architecture · Walkthrough: WT-07
Two kinds of mismatch
Section titled “Two kinds of mismatch”| Mismatch | Example | Correct outcome |
|---|---|---|
| Stale observation | Memory says a service lives in src/billing/, but it moved to src/payments/ |
STALE → propose an evidence-backed factual correction |
| Conflict with an approved decision | ADR-007 requires Mapperly; call sites use AutoMapper | Architecture Drift, Memory impact CONFLICT; the decision is preserved and a human decision is required |
Code never “wins” over an approved decision automatically, and a decision never silently rewrites facts about code.
1. Run a read-only check
Section titled “1. Run a read-only check”Select Memory and name the entries:
Check these two Memory entries against this branch. Report factual corrections separately from decision conflicts; do not write.Or select Architecture for a decision-centric question:
Compare ADR-007 with this module; report deviations only.Both are read-only. Neither changes a status field or a date.
2. Read the comparison
Section titled “2. Read the comparison”For each decision, the drift report shows:
- Decision ID and its approval source and scope
- Files, symbols, and config actually inspected
- Observed difference: Match, Deviation, or Insufficient evidence
- Potential impact and Confidence, with its basis
- Possible interpretations, e.g. unauthorized drift, an unrecorded approved exception, or an unused dependency
- Required human decision
3. Resolve
Section titled “3. Resolve”| Decision | Next step |
|---|---|
| The code is wrong | Select Implement to align the code with the decision |
| The decision should change | Revise the decision through its real approval process; an agent cannot approve it |
| An exception was approved but not recorded | Record the exception with its actual approval source |
For stale observations, apply the correction with an explicit sync:
Apply only these evidence-backed observation corrections.The agent rereads the latest entries before writing and preserves decisions and human edits. A no-delta sync writes nothing.
After manual code changes
Section titled “After manual code changes”You do not need to rerun Init after editing code by hand. Run Memory check on the affected entries. There is no watcher, so drift is found only when you ask.