Schema Packs
A schema pack tells modusbrain what shape your brain takes — which directories exist, what types live in them, how the agent should infer types from paths, and which link verbs connect what to what. The schema pack is the dynamic, always-consulted artifact every skill reads when filing, querying, or routing experts. It is the single source of truth for “what’s in your brain.” The v0.39.0.0 wave shipped a full schema-pack cathedral. This doc is the user-facing reference; for implementation details seedocs/designs/V038_SCHEMA_PACKS.md (CEO plan) and the engine layer in
src/core/schema-pack/.
What ships in the box
Two bundled packs:-
gbrain-base(default) — reproduces pre-v0.38 hardcoded behavior byte-for-byte. Existing brains see zero behavior change after upgrade. Covers: person, company, deal, meeting, project, place, concept, writing, analysis, guide, hardware, architecture, etc. (the originalALL_PAGE_TYPESlist). -
modusbrain-recommended— extendsgbrain-basewith the 13 additional directories described indocs/MODUSBRAIN_RECOMMENDED_SCHEMA.md: deal, meeting, concept, project, source, daily, personal, civic, original, place, trip, conversation, writing. If you like the documented operational-brain pattern, activate this with:
~/.modusbrain/schema-packs/<name>/pack.yaml
that you author with modusbrain schema init or modusbrain schema fork.
CLI surface
Five inspection verbs (shipped in v0.38):experimental are demand-gated per D14: their usage is
tracked via T15’s schema-events audit, and v0.40+ retro decides whether
to deprecate any that stay <5% usage.
Resolution chain (7 tiers)
When the engine decides “which pack is active for this query?”, it walks this chain top-down. First match wins.How the agent uses the active pack
Every read + write path consults the active pack at runtime:parseMarkdowninfers pagetypefrom path prefixes declared in the active pack (page_types[].path_prefixes). Without an active pack threaded, falls back to the legacy hardcodedinferType()so the byte-for-byte parity gate stays green.whoknows/find_expertsscopes candidates toexpert_routing: truetypes in the active pack.extract_factsruns only onextractable: truetypes.enrichment-serviceroutes person/company enrichment based on the pack’s primitive declarations.- Search hybrid cache (
knobsHash) folds in pack name + version (v0.39 T21). A cache row written under pack A is unreachable when pack B is active. Cross-pack contamination is structurally impossible.
The magical moment (T2-T4 + T10)
Persona A (Notion refugee) installs modusbrain, imports her exports, and the brain looks unfamiliar — the defaultgbrain-base pack expects
people/, companies/, etc., but her files live under Projects/,
Reading/, Daily Notes/. The friction signal fires in two places:
- Import warn (T7): the end of
modusbrain importprints[schema] X of Y pages (Z%) have no type matching the active schema pack. Run modusbrain schema detect to propose a pack matching your content shape. modusbrain doctorschema_pack_consistency check keeps surfacing the warning persistently after the import session ends.
Authoring your own pack
Recovery + revert
The single-PR cathedral is hard to revert atomically. Per codex finding #4 from plan-eng-review, T20 shipsmodusbrain schema downgrade to restore
the active-pack config field:
git revert <merge-commit>— restores the code.modusbrain schema downgrade --to gbrain-base— restores config.- (Optional)
modusbrain pages purge-deleted --older-than 0h— drops v0.39-typed pages that no longer have a matching type in the active pack.
knobsHash pack-folding (T21) — they become unreachable under the
restored pack so no eviction is needed.
Distribution
.modusbrain-schema tarballs ride the same v0.37 skillpack pipeline as
.modusbrain-skillpack tarballs (T14 artifact abstraction). The
discriminator is api_version in the manifest:
modusbrain-schema-pack-v1→ schemapackgbrain-skillpack-v1→ skillpack
~/.modusbrain/schema-packs/<name>/ and ~/.modusbrain/skillpacks/<name>/
respectively.
Publication to the public registries (thebuildceo/modusbrain-schema-registry,
thebuildceo/modusbrain-skillpack-registry) follows the same publish-as-PR
workflow as v0.37 skillpack publishing.
What’s deferred to v0.40+
- Per-source pack federation across mounts. A query crossing multiple
sources currently rejects with
permission_deniedwhen those sources have divergent active packs (T19 + codex finding #2). The v0.40+ work computes a true per-source closure via the existingbuildSourceClosureCteengine surface. extendschain semver compatibility checks between pack versions.skillpack ↔ schemapackcross-reference declarations — a skillpack can declare “I work best with these primitives present in your pack.”- Live schema migration helpers — when you add a type, auto-suggest backfill of existing pages.
- Authoring vs derivation thesis reframe (D14). v0.39.0.0 ships the full 11-verb cathedral with 6 verbs marked experimental-tier. v0.40+ retro reads T23 usage telemetry to decide which to deprecate.
TODOS.md v0.40+ section for the full deferred list.