What healthy looks like
Each tier gets its own line: the graph file’s path, its line count, its size, and confirmation that it ends with a newline. Then an overall verdict. Why the newline check matters. The graph is a line-oriented text format. A file that does not end cleanly is a file something was interrupted while writing, and that is the shape almost every corruption takes. Next rung.base doctor --json gives the same report machine-readable. Pair it with base commands list, base project list and base ast list when you want a full picture: healthy graph, star commands loaded, workspace registered, code maps present.
Repairing
--repair is what turns that degraded state back into a clean one.
The gotcha. Repair is not a substitute for knowing what went wrong. If a graph goes unhealthy repeatedly, something is writing to it that is not base.
Rolling back
--restore lists the snapshots available. Naming one restores it.
Where the backups are
Every repair, restore, compact and purge snapshots the graph first, as a sibling file namedgraph.nq.bak-<operation>-<timestamp>. The newest ten are kept and older ones are rotated out.
Why it works. This is one backup path shared by every mutating operation, rather than each command inventing its own. Verified from source at 4866996, the commit the shipped 0.13.2 binary was built from.
The gotcha. Ten is not many on a busy machine. If you want to keep a particular state, copy that snapshot somewhere else; it will rotate out.
Maintenance that runs on its own
Tier graphs auto-compact at session start once they pass a size threshold, and a cooldown stops that from happening repeatedly.graph.auto_compact off for the duration rather than being surprised by it.
Manual maintenance
compact deduplicates and canonicalizes. purge --stale removes notes that have gone unread past a threshold, and previews until you pass --apply.
The gotcha. The purge clock is recency of reading, not age. A note’s lastRead is stamped every time base recall returns it, so this removes what you have not needed rather than what is old. See Decisions and recall.
Next
Debugging injection
When the graph is fine and things still are not arriving.
Setup reference
Every
base doctor flag.