Expand description
Bundles — the agent’s personality and capability stack (provider, model, instructions, context files, MCP servers, skills).
Extracted from store.rs in Phase R.3 of the storage
modularization plan
(docs/specs/SPEC_STORE_MODULARIZATION_2026_05_27.md). The
method surface is unchanged — Store::bundle_* still
lives on Store via this impl block; callers stay on
storage::store::Bundle thanks to the re-export.
Structs§
- Bundle
- A Bundle — the agent’s personality and capability stack. Provider, model, instructions, and JSON-encoded arrays of context files / MCP servers / skills. Agent definitions shadow-migrate into this table during the v7 migration.
- Global
Memory Section - One section of the Global Memory block: one global bundle with instructions, rendered as the startup file carries it.
Enums§
- Bundle
Reseed Outcome - Outcome of
Store::bundle_reseed_system_if_owned— see that method’s own doc comment for what each variant means and why the decision is made atomically rather than by the caller.
Constants§
- GLOBAL_
SECTION_ SEPARATOR - The rule between two sections of the Global Memory block.
- NO_
INLINE_ 🔒MCP_ SERVERS - What every bundle write stores in
db_bundles.mcp_servers, and what every read returns, whatever the caller sent or an older build wrote. A bundle carries no MCP servers (SPEC_BUNDLE_CONTENTS_MEMORY_NOT_MCP_2026_10_07.md§3.1), and the column held server configs, credentials included:m0036_drop_bundle_mcpclears it once, and this keeps it clear and unreadable from this build on, whichever client writes. - RETIREMENT_
TOMBSTONE_ 🔒SOURCE - The
sourcesentinelbundle_delete_system_if_ownedstamps on the tombstone version row it appends after deleting a row — distinguishes a deliberate, generation-aware retirement (pruned because a manifest no longer lists this id) from an ordinary human delete in Memory (bundle_delete_system, which records no version at all).bundle_ reseed_system_if_owned’s missing-row branch checks for this sentinel specifically — see that method’s own doc comment. - SYSTEM_
TIER_ 🔒PREAMBLE - The override wording that opens the system (
is_system) part of the block.
Functions§
- check_
bundle_ 🔒base_ tx - The base check behind
bundle_upsert_with_version_based/bundle_upsert_system_if_changed_based, run inside the caller’s own transaction so nothing can land between the check and the write. - default_
json_ 🔒array_ string - default_
json_ 🔒object_ string - format_
global_ bundle_ block - Format global bundles into the block injected into an agent’s
CLAUDE.md.
is_systemsections (seeBundle::is_system) are split out and rendered FIRST, wrapped in explicit override wording, so they outrank every ordinary# [Workspace] <name>section that follows — see docs/specs/SPEC_GLOBAL_MEMORY_SYSTEM_TIER_2026_08_24.md §3.4. Bundles arrive already ordered bybundle_list_global(is_system DESC, sort_order, name), so this only needs to partition, not re-sort. Sections are separated by a---rule (GLOBAL_SECTION_SEPARATOR). Returns an empty string when no section has instructions. - global_
bundle_ sections - The sections of the Global Memory block, system (
is_system) first, each in the orderbundle_list_globalreturns them. Bundles with no instructions are skipped. - manifest_
generation_ 🔒from_ source_ detail - Extracts a
{"manifest_version": N}field from a version row’ssource_detailJSON, defaulting to0when absent or unparseable — so a pre-existing row seeded before this field existed is always treated as generation 0, never blocking a real (>=1) manifest generation from writing over it. Shared convention betweenbundle_reseed_system_if_ owned’s own generation guard and any seeder populatingsource_detail(seeoperator_config_seed.rs). - map_
memory_ 🔒row