My architecture docs were wrong, so now I diff them

I run a crew of Hermes Agent profiles, and I keep a repo of docs that say which profile runs on which model, what each one falls back to and how many cards the dispatcher may run at once. I found the problem by chance, spot-checking the docs during a review. I moved three agents to a cheaper model tier and updated the two docs that define the tiers. Three days later the rest of the repo still described the old tiers, and the fix touched 27 files.

So I wrote a check. Each profile’s config.yaml is copied into the repo beside the docs, and a script compares every claim the docs make to that copy. One caveat up front: the check compares the docs to the copy, not to the live machine.

What drifted

The crew uses four tiers. A local 27B model does the mechanical work. Claude Haiku runs scripted deployments and is the fallback for the local agents. Claude Sonnet does reasoning, review, research and building. Opus belongs to the orchestrator, and any card can request it with a per-card override.

It was not always that tidy. The strategy, reviewer and red-team agents started on Opus. Their cards kept hitting the shared subscription limit, and research sessions had already run reasoning cards on Sonnet without a quality gap that mattered, so those three moved down. The local agents’ fallback moved from Sonnet to Haiku, so a busy GPU spends the cheapest Claude tier. The deployment agent moved to Haiku too.

The change merged on a Wednesday and updated the roster and the model-choice page. The routing page still put those three agents on Opus and the rest of Claude on an older Sonnet release. The model-choice page still counted “4 opus profiles + 7 sonnet profiles”. It also kept its old routes section, labelled “superseded by Cost tiers above where they differ”, which leaves the reader to work out where. Sixteen profile READMEs restated their own route. The alignment commit three days later touched 27 files: the README and seven docs pages, those sixteen READMEs, a settings template and two research-session files.

It was not the first time. Nine days earlier, a separate sweep had aligned the docs with the live crew. Two sweeps in nine days is the pattern a check is for.

The mirror, and what it is not

You cannot diff docs against a live Hermes install. The profile directory holds .env keys, session databases, logs, memory and caches. None of it belongs in git, and none of it is a claim a doc makes.

So the repo holds a mirror: for each profile, two files, config.yaml and profile.yaml, copied whole. Nothing is stripped out of them. The rule is file-level: those two files are allowed in, and everything else in the profile directory stays out. When I checked all 36 mirrored files against the live ones while writing this, one had already drifted: the orchestrator’s live config had picked up a plugin the mirror did not have. Which is the point of the next section.

The mirror is a manual copy, and that is the weak point. The tier change went to the live profiles with hermes config set on Wednesday. The mirror caught up on Friday, as a side effect of an unrelated commit that refreshed the mirror. Without that commit, the check would have compared stale docs to a stale mirror, seen agreement, and passed. Until this post, nothing triggered a copy-back but memory.

Claims, not files

My first instinct was to diff the whole mirror against the docs. That fails at once. A config file carries a schema version stamp, long toolset lists, a block of stock personalities, and dozens of keys no doc mentions. A whole-file diff is a wall of red that teaches you to ignore it.

The docs and config overlap on a small set of statements:

Those are the claims. Each one maps to a single key in a single file.

The last one is the reason a grep is not enough. The Hermes gateway runs as the default profile and reads kanban.max_in_progress from that profile’s config only. The same key in the orchestrator’s config is ignored. I learned this during an overnight run, when the cap I had set was not the one being read. So a setting has two separate properties: its value, and whether anything reads it. The check tests both. A gateway-read key set in any other profile is drift, even when the value matches.

The script

The claims live in docs/claims.yaml, which restates the roster table. A doc can also carry its own claims in a fenced docs-claims block beside the sentences they back. The script merges both, and fails if two sources claim different values for one key. I chose embedded blocks over parsing tables and prose, because a prose parser is one more thing that drifts.

Simplified from my setup; the real version reads my private config.

A claims file looks like this:

tiers:
  qwen: qwen3.8:27b
  Haiku: claude-haiku-5-5
  Sonnet: claude-sonnet-5-5[1m]
  legacy: claude-sonnet-<old>           # the default profile's, a deliberate exception

gateway:
  profile: default                      # the profile the gateway runs as
  reads: [kanban.max_in_progress, kanban.failure_limit]

profiles:
  default:
    model.default: legacy
    kanban.max_in_progress: 4
  reviewer:
    model.default: Sonnet
    fallback_providers.0.model: qwen
  worker:
    model.default: qwen
    fallback_providers.0.model: Haiku

counts:
  - {name: primary on local qwen, where: {model.provider: custom:ollama}, expect: 7}

The core is one lookup per claim:

for profile, keys in claims["profiles"].items():
    for key, (want, source) in keys.items():
        want, got = resolve(want), dig(configs[profile], key)
        if got != want:
            drift.append(f"DRIFT {profile} {key} docs={want!r} mirror={got!r} ({source})")

A second function handles the counts. “seven on local, eleven on Claude, nine of those falling back to local” is derived rather than a key, so it counts the mirrored configs that match a filter. A deliberate exception needs no special list: the default profile’s older Sonnet release is a claim like any other, under its own tier name. A mirrored profile with no claims is drift too, so a new agent cannot slip in undocumented.

It prints one line per disagreement and exits non-zero, so a pre-commit hook or CI step can stop the commit. It takes --rev, which reads the docs and mirror as of any commit. That made the next part possible.

Replaying the drift

The docs before the fix carried no claims block, so I transcribed what they stated into a claims file. Then I ran the script against the mirror at the commit just before the fix:

$ docs-diff --rev <before-the-fix> --claims claims-before.yaml
DRIFT red-team model.default docs='claude-opus-5-5[1m]' mirror='claude-sonnet-5-5[1m]' (claims.yaml)
DRIFT strategy model.default docs='claude-opus-5-5[1m]' mirror='claude-sonnet-5-5[1m]' (claims.yaml)
DRIFT reviewer model.default docs='claude-opus-5-5[1m]' mirror='claude-sonnet-5-5[1m]' (claims.yaml)
DRIFT deploy model.default docs='claude-sonnet-<old>' mirror='claude-haiku-5-5' (claims.yaml)
DRIFT infra fallback_providers.0.model docs='claude-sonnet-<old>' mirror='claude-haiku-5-5' (claims.yaml)
(11 more lines)
DRIFT count "on Opus" docs=4 mirror=1
DRIFT count "on claude-sonnet-<old>" docs=7 mirror=1

That is 18 lines in all. Three agents were still documented on Opus, five on an older Sonnet release, and the deployment agent on Sonnet instead of Haiku. Seven local agents had the wrong fallback, and two counts were off. (Profile ids in the output are relabelled by role, and an older Sonnet release is masked.) Against the fixed docs, the same run prints docs and mirror agree on all 75 claims.

The replay also proves the caveat. Run against the mirror as it stood at the Wednesday merge, the same stale claims show no wrong model or fallback for any mirrored profile, because the mirror was stale too. The check could not have caught this until Friday’s copy-back.

What already exists

The closest thing I found is architecture-drift-mcp. It extracts cited claims from documentation, compares them deterministically with facts observed in the source tree, and only then lets a model adjudicate. Zylos’s survey of documentation-contract drift in agent systems names the general problem: config keys and interfaces change, and the prose describing them does not. Others diff architecture models or check instruction files for drift.

This is narrower than any of them: the runtime config of a whole agent crew, meaning tiers, fallbacks, concurrency caps and which profile’s settings actually take effect. Those are the facts that change when you tune quota, and they change quietly.

What I would do differently

I would put the claims in one file from the start and write the check before the tuning pass, not after the second sweep.

And I would have closed the gap the replay found first. A second script now does the copy-back: it copies config.yaml and profile.yaml for every live profile into the mirror, then runs the check. It refuses the whole copy if any file holds a key that looks like a credential, because keys belong in .env, never in git. I run it after every hermes config set. Nothing schedules it yet, so the gap is now one command wide instead of open-ended.

For the failures from leaving the crew alone overnight, see what broke overnight. For the cost side, see how far one GPU and a $20 plan can go.

If you want the next one by email, subscribe. It is irregular, and nothing else gets sent.