Agent is the registered Mission capability that can perform work through exactly one AgentAdapter. It is the catalogue Entity operators and owning Entities use to select a provider capability such as Copilot CLI, Claude Code, Codex, Pi, or OpenCode before an AgentExecution is created.
Agent owns capability identity, display metadata, adapter availability, broad provider-neutral capability flags, adapter diagnostics, and repository-scoped Agent lookup through AgentRegistry. AgentExecution owns long-lived execution state and process lifecycle. AgentAdapter owns provider-specific launch translation and diagnostics behind the Agent boundary.
Accepted command-surface ADR for Agent connection tests. The current Agent implementation is entity-scoped, so this ADR now records a doctrine mismatch that needs follow-up.
Responsibilities
Responsibility
Agent rule
Identity
Owns canonical Agent Entity id in agent:<agentId> form and the stable agentId used by settings, registry lookup, and launch selection.
Catalogue entry
Exposes display name, icon, availability, capabilities, and diagnostics for one configured AgentAdapter.
Adapter ownership boundary
Holds exactly one attached AgentAdapter when materialized from configured adapter input.
Repository-context lookup
Uses repository runtime context to load AgentRegistry.createConfigured({ repositoryRootPath }) and resolve configured Agents for that repository.
Connection probe command
Implements testConnection as a bounded Agent instance mutation that delegates one-shot runtime probing to daemon-owned connection-test machinery.
Provider-neutral capability view
Presents broad capability flags without exposing raw provider protocol or AgentExecution message descriptors as Agent truth.
Non-Responsibilities
Surface
Owner
Agent boundary rule
Provider launch translation
AgentAdapter
Agent exposes adapter-derived catalogue data but does not translate launch configs, provider args, env, MCP provisioning, or provider protocol.
Managed execution lifecycle
AgentExecution
Agent can be selected for execution but does not own process lifecycle, structured messages, journal state, terminal attachment, or execution mutation.
Active execution lookup
AgentExecutionRegistry
AgentRegistry is the configured Agent catalogue only; it does not index live AgentExecutions or process handles.
Terminal state
Terminal and TerminalRegistry
Agent does not own PTY state, terminal input, terminal snapshots, resize, exit observation, or raw terminal recordings.
Repository settings persistence
Repository
AgentRegistry reads Repository settings to configure Agents; Agent does not own .open-mission/settings.json.
Connection probe mechanics
Daemon-provided agentConnectionTester capability
Agent.testConnection owns the Entity command seam and typed result parsing, while daemon runtime owns the one-shot probe implementation.
Adapter transport support and provisioning capability summary.
AgentAdapterDiagnosticsSchema.
AgentAdapterDiagnosticsSchema
Adapter diagnostic summary for catalogue and troubleshooting surfaces.
Optional diagnostics field.
AgentOwnerSettingsSchema
Repository/System preferences for enabled Agents and defaults.
Repository and System settings schemas.
AgentFindSchema
List Agents payload for the current repository runtime context.
find payload.
AgentLaunchModeSchema
Connection-test launch mode.
AgentTestConnectionInputSchema.
AgentTestConnectionInputSchema
One-shot readiness probe input.
testConnection payload.
AgentConnectionTestKindSchema
Bounded connection-test result classifier.
AgentConnectionTestResultSchema.
AgentConnectionTestResultSchema
Typed readiness probe result.
testConnection result.
AgentStorageSchema
Persistable Agent catalogue record shape.
Contract storage schema.
AgentSchema
Hydrated Agent Entity data returned by Agent boundary.
Contract data schema, read, find.
AgentCollectionSchema
Repository-scoped Agent catalogue collection.
find result.
Schema Metadata Audit
AgentSchema.ts carries Agent-local descriptions for declared schemas and fields, and AgentStorageSchema carries zod-surreal table and field metadata for the canonical Agent catalogue record.
Finding
Evidence
Status
Schema descriptions
AgentSchema.ts declares descriptions for Agent-owned schemas, fields, nested objects, and collection members.
Aligned for the Agent slice.
Storage metadata
AgentStorageSchema registers the agent table and Agent-owned fields with zod-surreal descriptions and the agent_agent_id_idx unique index.
Aligned for the Agent slice.
Adapter construction input
Non-serializable adapter construction input is owned by the daemon runtime adapter module, not exported from AgentSchema.ts.
Aligned; no schema alias or hand-written schema-module type remains.
Partial composition schemas
Identity, display, and metadata fields are declared directly on AgentStorageSchema; no primary-data field bundle is exported.
sequenceDiagram
participant Caller
participant Contract as AgentContract
participant Agent
participant Registry as AgentRegistry
participant Adapter as AgentAdapter
Caller->>Contract: entity.query Agent.read/find
Contract->>Agent: dispatch class method
Agent->>Agent: parse EntityIdSchema or AgentFindSchema
Agent->>Agent: require repositoryRootPath from context
Agent->>Registry: createConfigured(repositoryRootPath)
Registry->>Adapter: create adapters and read availability/capabilities
Adapter-->>Registry: capability, availability, diagnostics
Registry-->>Agent: configured Agent instances
Agent-->>Caller: AgentSchema or AgentCollectionSchema
Test Connection
sequenceDiagram
participant Surface
participant Contract as AgentContract
participant Agent
participant Registry as AgentRegistry
participant Context as EntityExecutionContext
participant Runner as agentConnectionTester
participant Adapter as AgentAdapter
Surface->>Contract: entity.command Agent.testConnection
Contract->>Agent: dispatch entity mutation
Agent->>Registry: resolve selected Agent by id
Registry-->>Agent: required Agent with adapter
Agent->>Agent: parse AgentTestConnectionInputSchema
Agent->>Agent: require repositoryRootPath from context
Agent->>Context: require agentConnectionTester capability
Context-->>Agent: daemon-owned runner
Agent->>Runner: test(agent, workingDirectory, launch options)
Runner->>Adapter: probe adapter readiness
Adapter-->>Runner: availability or diagnostic evidence
Runner-->>Agent: diagnostic result
Agent-->>Surface: AgentConnectionTestResultSchema
Cross-Control Checklist
Surface
Status
Notes
Class vs contract
Aligned
AgentContract declares read and find as class methods and testConnection as an entity method; Agent.ts implements the same split.
Accepted ADR 0006.12
Mismatch
docs/adr/0006.12-agent-connection-tests-as-agent-entity-commands.md still specifies testConnection as a class-level Agent command, while the current Agent contract and implementation expose it as an entity-level command. This needs a doctrine follow-up instead of local invention.
Contract vs schema
Aligned
Contract payload/result schemas are imported from AgentSchema.ts; no ad hoc contract-local Zod objects are present.
Class vs schema
Aligned
Agent parses data with AgentSchema, parses method inputs, and parses the connection-test result.
Repository context
Aligned
Agent methods require repositoryRootPath from the execution context to load repository-scoped settings without treating the repository root as Agent identity.
Registry boundary
Aligned
AgentRegistry is the configured catalogue; there is no separate AgentAdapter registry.
AgentExecution boundary
Aligned
testConnection delegates to one-shot tester and does not create AgentExecution state.
Event contract
Aligned
AgentContract.events is empty and no Agent event schemas are declared.
Schema descriptions
Aligned
Agent-owned schemas and fields declare domain descriptions.
Storage metadata
Aligned
AgentStorageSchema registers the agent table, Agent-owned fields, and unique Agent id index metadata.
Type inference discipline
Aligned
AgentSchema.ts exports schema-inferred types only; daemon-only adapter construction input lives in the daemon adapter module.
Partial schema discipline
Aligned
Agent identity and display fields live directly on AgentStorageSchema; no exported composition schema duplicates them.
Daemon dependency direction
Improved
Agent.ts depends on an Agent-owned AgentAdapterHandle shape and the agentConnectionTester context capability instead of importing daemon runtime adapter/tester classes. AgentRegistry still composes daemon adapter inputs and remains the next boundary to split if the registry is moved out of the Entity folder.
Specification Assessment
The Agent Entity model is small and well bounded: Agent is a catalogue and diagnostics Entity, AgentAdapter is provider translation, AgentRegistry is repository-scoped lookup, and AgentExecution is the execution owner. The implementation keeps the current method surface while aligning the Agent class with schema metadata, collection naming, and daemon dependency direction.
Two convergence items remain explicit. First, AgentRegistry still composes daemon adapter inputs from inside the Agent entity folder; that broader split should be handled as a separate adapter-registry relocation slice so runtime launch behavior remains stable. Second, accepted ADR 0006.12 still describes testConnection as a class command while the current implementation is entity-scoped; that doctrinal conflict should be resolved in the ADR rather than papered over in code or docs.