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§
- Agent
Seat - An agent’s seat: its role, whom it reports to and what it owns
(
SPEC_AGENT_SEATS_IN_THE_UI_2026_10_23.md§2). Set by the operator (agent.setSeat) or by an agent (Agents set_seat);backend::agent_seatvalidates it. Every field butroleis optional, androleis kept as text, so a seat written by a newer build with a role this one doesn’t know still loads. - 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. - Former
Slug - A slug a definition answered to before a rename. Only the shared record
carries these (
SPEC_FORK_SLUG_MIGRATION_2026_10_22.md§4);retired_atis epoch ms, like the record’s other timestamps. - Handover
- That an agent was handed to another computer (spec
SPEC_MOVE_AN_AGENT_TO_ANOTHER_COMPUTER_2026_11_24.mdsection 5). While it is set, no start path on any instance sharing this record launches the agent: the one admission gate every start passes through refuses and says where the agent went.
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. A definition below it is
skipped, not migrated: raise the repo’s
UPGRADE_FLOORwith it, as forMIN_SUPPORTED_SCHEMA.
Functions§
- 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.