Skip to main content

Module bundles

Module bundles 

Source
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.
GlobalMemorySection
One section of the Global Memory block: one global bundle with instructions, rendered as the startup file carries it.

Enums§

BundleReseedOutcome
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_mcp clears it once, and this keeps it clear and unreadable from this build on, whichever client writes.
RETIREMENT_TOMBSTONE_SOURCE 🔒
The source sentinel bundle_delete_system_if_owned stamps 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_system sections (see Bundle::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 by bundle_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 order bundle_list_global returns them. Bundles with no instructions are skipped.
manifest_generation_from_source_detail 🔒
Extracts a {"manifest_version": N} field from a version row’s source_detail JSON, defaulting to 0 when 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 between bundle_reseed_system_if_ owned’s own generation guard and any seeder populating source_detail (see operator_config_seed.rs).
map_memory_row 🔒