Upgrading
An upgrade never asks you to wipe the cache. basemind keeps its index in a machine-global cache
(BASEMIND_DATA_HOME, default ~/.local/share/basemind): per-workspace views, LanceDB tables and git
history under cache/workspaces/<key>/, and one content-addressed blob store under cache/blobs/
shared by every workspace. The next scan migrates what changed and cleans up what it displaced.
Upgrading from 0.28 to 0.29
Section titled “Upgrading from 0.28 to 0.29”0.29 bumps the release minor, so the first scan rebuilds the index, and it reshapes the CLI.
- Stop the old daemon before the first scan:
basemind comms stop(add--allto stop every daemon on the machine). Otherwise the previous binary’s daemon keeps running with the old schema and still owns the index. - Run
basemind scan. Each view’sindex.msgpackand Fjall index are reset on open and every file is re-extracted, overwriting stale blobs in place; the git cache refills lazily. The LanceDB document tables and the blob store are not wiped, and the scan’s cleanup pass reclaims orphaned blobs. Expect a full-scan duration once. - Re-run
basemind hook install. The new hook honourscore.hooksPathand linked worktrees, fails open, and it will not overwrite a pre-commit hook it did not write unless you pass--force(the old one is kept aspre-commit.bak). - Update scripts for the renamed commands. No aliases remain:
| 0.28 | 0.29 |
|---|---|
admin status |
status |
admin rescan |
rescan |
admin cache-stats |
cache stats |
admin gc |
cache gc (deletes; --dry-run reports) |
admin cache-clear |
cache clear (needs --yes outside a terminal) |
admin delta |
delta |
admin checkpoint |
checkpoint |
admin waste |
detect-waste |
graph map --include-churn |
graph map --no-churn |
serve --git-cache-mem, --no-git-cache-disk, --no-watch, --documents-* |
removed (serve takes no flags) |
Also check scripts for these behaviour changes:
- Exit codes are
0ok,1error,2usage,3writer lock held,4daemon unreachable,130interrupted.scanandrescanexit3(not0) when another process holds the lock. - The timing footer is on stderr; stdout carries only the answer. Human output no longer truncates values to 200 characters.
--formatoncode semanticandmemory documentstakes onlyjsonortoon.agentsandworkspace--jsonnow use the MCP response shapes.- MCP logging is gone, and the
memorytool no longer accepts thedocuments.*/llm.*override fields.
What changes on upgrade
Section titled “What changes on upgrade”| Change | How it migrates | Cost |
|---|---|---|
| Prose, data and config files (Markdown, JSON, YAML, TOML, XML, CSV, INI, …) left the code map for the document tier | The next scan, full or incremental, notices a path indexed in the other tier, purges its code-map rows and indexes it as a document | Documents are chunked, and embedded when [documents] embed is on |
Symbol signature now ends at the grammar’s body field instead of embedding the body |
Only files whose entry or blob predates the new extractor epoch are re-extracted, in the normal memory-bounded scan | One parse per affected file, no wipe |
Release-minor schema bump (for example 0.28.x to 0.29.x) |
Each view’s index is reset on open and every file is re-extracted, overwriting stale blobs in place | Full re-extraction, by design |
| Resident term index, name dictionaries, macOS heap retag | In memory only | None |
Daemon IndexRead forwarding for references, callers, implementations |
Wire protocol only | None |
Code map is code-only; find / files cover documents |
Same tier migration as the first row | See above |
| Grep bloom filters | Built on the next scan; until then code grep runs the full sweep |
Small, at scan time |
Patch releases keep the persisted format. A change that alters what an unchanged file’s blob should
contain, without changing how it is serialized, bumps an internal extractor epoch instead of the
release minor. Every file entry and blob records the epoch it was produced under, so only stale
files are re-extracted, and the scan summary reports them as refreshed (and tier_migrated for
tier moves).
Automatic cleanup
Section titled “Automatic cleanup”Content-addressed blobs are shared and never rewritten on their own, so a migration can orphan some
of them. For example, the old .fm, .chunk and .rref blobs of a Markdown file that became a
document kept the same content hash as its live document blob and were pinned forever.
- The sweep is tier-aware: a document blob is live only if some workspace’s document table references the hash; code-lane blobs are live only if a code-map file entry does.
- It reference-counts against every workspace on the machine, keeps blobs younger than six hours (a
concurrent scan may be about to reference them), and takes a machine-wide
cache/gc.lockso two sweeps never run at once.BASEMIND_BLOB_GC_GRACE_SECSoverrides the six hours;0reclaims every unreferenced blob immediately. - A scan that migrated a path, refreshed an extraction, or reset a view for a schema bump runs the
sweep itself and prints
cleanup: reclaimed N orphaned blob(s), B bytes. In the daemon the same condition triggers a sweep a minute later, and the daemon also sweeps hourly. basemind cache gcperforms the same sweep;--dry-runonly reports. It used to be report-only.cache statsshows the result aslast_gc, and itsorphan_blob_countis tier-aware and drops to0after the sweep.
A second scan after the upgrade is a no-op: nothing is migrated, refreshed or reclaimed.
Clearing and downgrading
Section titled “Clearing and downgrading”basemind cache clear --component blobs|views|lance|git-cache|telemetry|all --yes covers every on-disk
component a migration touches. The term index and name dictionaries are memory only. The sweep lock
is an empty file removed with the cache root, and git-history.fjall is removed only by all
because the daemon holds it open.
Opening upgraded data with an older binary fails safe. The index extras are ignored; a binary on the same schema minor re-maps the files it still treats as code (and drops their document entries), and one on a different minor resets the view and re-extracts, as for any schema change. Going back and forth costs re-extraction, never correctness, and the next sweep reclaims what is left.
Plugin binaries
Section titled “Plugin binaries”The plugin launcher keeps one ~/.cache/basemind/bin/<version>/ per release, reaps processes of
other versions and removes older version directories on every launch of the current one. That cache
is a few tens of MB per version and is not touched by the migration above.