Expand description
Global agent-definition registry file format + per-row validation.
Sibling of schema.rs (which describes the named instance record).
This record carries a full agent definition so the roster can be
reconstructed from any channel/version without joining the local
channel’s SQLite — the foundation of cross-channel agent persistence
(docs/specs/SPEC_CROSS_CHANNEL_AGENT_PERSISTENCE_2026-06-13.md, P0.2).
Layering: the registry module must NOT depend on backend::storage
(which already depends on registry — that would cycle). So the fields
of AgentDefinition are mirrored here as a self-contained struct; the
AgentDefinition <-> DefinitionRecordV1 conversion lives in
backend::storage (the dependent side). Bumping
DEF_MAX_SUPPORTED_SCHEMA is the additive-evolution path, exactly like
the instance record.
Structs§
- DefContent
Blob - A content blob (system prompt / mcp / env / soul / startup) attached to
a definition — mirrors a
db_agent_contentrow. Carried in the global record so a cross-channel agent launches with its instructions even thoughdb_agent_contentis per-version. (codex P1 on #1384.) - DefSkill
Blob - A skill attached to a definition — mirrors a
db_agent_skillsrow. - Definition
Record - On-disk envelope for a global agent-definition record. Stored at
<shared>/agents/definitions/<id>.json. - Definition
Record V1 - v1 definition payload — a faithful mirror of
AgentDefinition’s columns, PLUS the per-definition content + skills blobs (which live in separate per-version tables and must travel with the definition for a cross-channel agent to launch with its instructions). New fields go here under#[serde(default)](so older files still deserialize) paired with aDEF_MAX_SUPPORTED_SCHEMAbump.
Enums§
Constants§
- DEF_
MAX_ SUPPORTED_ SCHEMA - Highest envelope schema this binary will write or read. Bumped per release that adds fields to the definition payload.
- DEF_
MIN_ SUPPORTED_ SCHEMA - Lowest envelope schema this binary will load.
Functions§
- default_
container_ 🔒volumes - Serde default for
container_volumes— preserves the db invariant that an omitted value is the empty JSON array"[]", not""(which would surface via the read-path overlay). (reagent P2 on #1385.) - validate
- Per-row validation. Mirrors
schema::validate: reject anything that would surface a malformed definition to the roster. Failures are skipped (not auto-fixed), logged, and the file stays on disk for ops triage.