Architecture overview¶
Colossus uses ports and adapters with explicit inward dependency direction. Domain contracts do not depend on infrastructure, and user interfaces never own model, tool, policy, workflow, or persistence behavior.
flowchart LR
subgraph Interfaces
CLI["CLI"]
TUI["TUI"]
SDK["Application SDKs"]
end
subgraph Transport
GRPC["Authenticated loopback gRPC"]
Worker["Worker host"]
end
subgraph Composition
Runtime["Runtime composition"]
end
subgraph Application
Agent["Agent and application services"]
Ports["Application ports"]
Contracts["Contracts"]
Domain["Domain"]
end
subgraph Adapters
Provider["Providers"]
Journal["ephemeral/file redb or PostgreSQL"]
Sandbox["Sandbox and effect adapters"]
Extensions["Integrations, MCP, Agent Plugins"]
end
CLI --> Runtime
TUI --> Runtime
SDK --> GRPC
GRPC --> Worker
Worker --> Runtime
Runtime --> Agent
Agent --> Ports
Ports --> Contracts
Contracts --> Domain
Runtime --> Provider
Runtime --> Journal
Runtime --> Sandbox
Runtime --> Extensions
Provider --> Ports
Journal --> Ports
Sandbox --> Ports
Extensions --> Ports
Reading the diagram without color: interfaces enter the composition root; application services depend inward through ports, contracts, and the dependency-free domain; infrastructure adapters implement ports and are assembled only by the runtime.
Workspace layers¶
| Layer | Representative crates | Responsibility |
|---|---|---|
| Domain and contracts | colossus-domain, colossus-contracts |
Dependency-free domain and stable typed contracts |
| Ports | colossus-ports |
Application-owned interfaces for providers, state, tools, policy-adjacent services, and adapters |
| Application services | colossus-agent, colossus-session, colossus-context, colossus-work, colossus-memory, colossus-workflow, colossus-research, colossus-telemetry, colossus-browser |
Use cases and durable behavior |
| Security and catalog | colossus-access, colossus-policy, colossus-tools |
Capability metadata, decisions, permits, and strict tool schemas |
| Infrastructure | colossus-provider, colossus-codex-auth, colossus-credentials, journal/projection crates, colossus-sandbox, colossus-browser-bridge, colossus-browser-presentation, colossus-integrations, colossus-mcp, colossus-plugins, colossus-bundles, colossus-search |
External systems, authentication, private browser transport and presentation, plugin OCI/lifecycle, release bundles, and storage adapters |
| Public API and SDK | colossus-api-proto, colossus-api, colossus-api-runtime, colossus-grpc, colossus-sdk |
Version public resources, authenticate applications, host durable runs, and provide transport-neutral clients |
| Control Plane application | colossus-cloud, colossus-cloud-protocol, colossus-cloud-server, colossus-connector |
Project and personal resource authority, durable fixed-node placement, browser access, and authenticated runtime connections through the public SDK |
| Hosted execution composition | colossus-cloud-chat, server hosted modules |
Bind an authenticated project/user to protected state, purpose-bound credentials and on-demand runtime ownership under the controlled-tools ceiling |
| Shared Cloud execution | colossus-cloud-executor |
Execute the closed Cloud command/resource set through caller-bound SDK clients and retain common released-output bounds for Hosted and Fleet |
| Composition and interfaces | colossus-runtime, colossus-worker-protocol, colossus-worker, colossus-cli, colossus-tui, colossus-presentation |
Narrow private transport contracts, wire services, host application contracts, and released-data rendering |
Boundary rules¶
The cloud control plane is a separate application composition.
Its Diesel/diesel-async PostgreSQL schema and database-backed user and project authority are independent
of runtime journals and policy. colossus-cloud-postgres owns pooled relational storage,
transactional outbox/audit records, shared browser sessions and fenced connection leases.
Host/agent/workspace grouping and thread history do not grant local execution authority.
Each connector uses a dedicated native application grant; it cannot borrow the Desktop
primary or approval-broker credential. Cloud roles intersect that grant and never
expand local tool, policy, or sandbox authority. The closed remote operation set does
not expose private worker RPC, arbitrary network forwarding, or renderer credentials.
Fleet human terminals add a separately opted-in public SDK operation, not an agent
tool or private worker tunnel. The native colossus-terminal supervisor owns PTYs
outside provider/run lifetimes. Browser WebSockets use the fenced connector owner;
an authenticated internal gRPC relay joins different replicas without sticky sessions.
Expiring SQL replica routes contain metadata only. See
ADR 0011 for authority and reconnect decisions.
Hosted Execution is an optional application composition consumed by Chat and task
submission. colossus-cloud-chat opens the ordinary runtime separately for each
authenticated project/user and exposes its caller-bound SDK. The server's hosted
modules supervise bounded runtime capacity, direct SDK dispatch, idle retirement and
shared owner-routed management. Hosted targets have an explicit placement kind, no
client certificate and no Fleet enrollment. The existing target/namespace IDs are
retained to preserve conversations and journals. See ADR 0009.
Durable Cloud task/command records own admission and dispatch; runtime journals own canonical execution and effects. A process-wide supervisor discovers unfinished work, including after restart. Configuration/history reads do not require a loaded runtime. Active runs, queued work, children, management operations and pending OAuth flows prevent idle retirement. Waiting agent runs remain resident under the current recovery contract; they are not advertised as suspendable checkpoints.
Managed attachments reuse the caller-owned artifact journal and never interpret a file name as a worker path. Controlled Hosted execution permits reviewed provider and remote HTTP MCP effects and runtime-owned conversation services. Filesystem/process grants, stdio MCP, browser/computer hosts, plugin execution and hosted workspace provisioning remain unavailable. Fleet continues to supply explicitly selected connected environments.
Personal nodes, invitations and conversations retain immutable owner identities. Absent ownership preserves existing shared project history. Every human read, list, event stream, receipt, control and operational aggregate checks personal visibility; SQL filters it before pagination and counts. Project and global administration do not convey another user's personal history or runtime access. Internal authenticated connector recovery retains its separate fixed-node authority. An owner with current Execute and Control can answer the exact interaction in their own personal node and thread; shared execution keeps the independent project Approve requirement. Both paths still intersect the runtime application grant and one-use interaction binding.
Hosted provider/MCP definitions are managed at project scope within an operator-owned origin ceiling. Personal authentication is the default; shared static credentials require an explicit project choice. Named credentials can exist independently within their personal/project vault. Explicit attachments bind project, user or shared project scope, provider/MCP purpose, connection generation and endpoint; a bare credential ID cannot be resolved by an agent. MCP OAuth uses a per-user protected vault; missing or corrupt personal custody never selects a shared identity. Shared hosted mode stores partitioned journals/projections, settings, credential envelopes, OAuth coordination and target placement in PostgreSQL. Any API replica can serve an account; database-clock execution leases assign one project/user runtime owner with monotonic fencing, and existing durable command transport routes operations to that owner. Local lexical indexes are disposable. External masters derive keys by runtime namespace/purpose; an independently administered anchor service preserves rollback detection outside the journal database. The compatibility single-host mode retains local private state and remains limited to one replica. See hosted chat operation.
Manual Desktop credentials and platform-backed MCP OAuth share the
colossus-credentials adapter. HostSecret (64 KiB) and VaultRecord (1 MiB) are
non-serializable, zeroizing contracts. CredentialVault and its opaque record
identities belong to the ports surface; categorical credential errors are shared
with contract validation. Runtime composition injects the vault into MCP; the
adapter owns neither OAuth protocol behavior nor authorization policy.
Each owner lazily opens one credentials-v1.redb and companion lease file within
its validated private root. Desktop manual credentials use the global Desktop
directory; platform OAuth uses the isolated runtime state directory. Conversation,
journal, and settings databases contain no credential records. Native Windows and
macOS entry lives in the private apps/desktop/native-credential-ui crate; Tauri
commands dispatch it without receiving secret values from the renderer.
colossus-domainhas no dependencies.- Ports are owned by the application, not infrastructure.
- The runtime owns adapter construction and opaque permit-bearing executors.
- Runtime composition canonicalizes one explicit workspace. CLI
-w, --workspace, embedded open options, and worker workspace matching all feed the same repository context and state identity. An isolating execution boundary may confine resources to it; acknowledged full access deliberately does not. - Shared CLI and TUI home resolution selects absolute
COLOSSUS_HOMEor the platform user home, validates its owner-private no-follow boundary, and derives one opaque partition from canonical workspace path and object identity. Linux keeps the birthtime-based identity when available; an NFS workspace that does not report birthtime uses a distinct filesystem-scoped opaque-handle identity captured from the same opened directory. Missing, malformed, inconsistent, or unsupported identity evidence fails closed. Windows Desktop honors an explicitCOLOSSUS_HOME; otherwise its native composition selects the fixed owner-privateColossusDesktopHomebeneath the user's local application-data directory. Interfaces consume the resolved context; renderer code never invents configuration or state paths. - Configuration resolution selects one explicit, repository-local, or user-level
document without merging. Runtime composition receives the selected source and
resolved storage path after
storage.locationconfinement has succeeded. - CLI/TUI and Desktop use distinct children of the same workspace partition. Their database leases, worker identities, provider credentials, and lifecycle ownership do not cross interface boundaries.
- Access resolution produces visibility and action decisions; execution-boundary and sandbox-profile resolution independently produce explicit, derived, or ambient resource obligations. Ambient obligations remain request-bound and require the acknowledged danger runtime envelope.
- CLI and TUI construct requests, invoke application services, and render typed results.
- A released
ToolResultis the complete run-facing result used by terminal events and run evidence. The agent derives a separate bounded, parseable tool observation for model continuation and session history. Each observation is limited to 64 KiB and every tool observation between two user messages shares one 256 KiB logical-turn budget, including results separated by assistant continuations.colossus-toolsowns that projection;colossus-contextreapplies it when preparing legacy session history so sequential tool batches cannot make the newest logical turn impossible to compact. - Desktop persists folder-backed
WorkspaceProfilerecords and presents them as Workspaces. One natively selected Workspace projects its workspace, provider/model, access, execution-boundary, and terminal configuration into the existing command boundary; renderer actions cannot nominate a background Workspace. A native manager may retain up to four independently supervised sidecars and evicts only the least-recently-used idle entry. - Desktop Asides create a separate session through the exact canonical end of the selected source run. The renderer supplies only that owned run identity; the runtime resolves the message boundary so a visible final response cannot be omitted by an incomplete activity-feed projection. The sidecar materializes a conversation projection containing visible user and assistant messages only; system messages, assistant tool-call records, tool results, and their payloads are not copied into the Aside.
- Desktop workspace browsing remains an interface-only, read-only view. Its native commands accept the opaque selected-Workspace identity plus a validated relative path; they do not add model, tool, policy, state, or mutation logic to the renderer.
- Desktop Git inspection is a read-only human surface with a private native Git reader. Repository handles bind the selected workspace and validated metadata directories; no Git execution or write capability is exposed. See ADR 0004.
- Human-managed Git worktrees use the separate
colossus-worktreesservice from Desktop and the offline CLI. Private ownership records and native cross-process shared-use leases guard checkout lifecycle operations. The renderer supplies an owned ID, not a deletion path, and no runtime agent tool exposes this authority. See ADR 0012. - Desktop file search and text diffs reuse the same native workspace/Git authority. The read-only renderer owns presentation and bounded document lifetimes; see ADR 0005.
- Desktop's opt-in browser preview is a separate human browsing surface. Native session/tab state and engine integration stay in the Desktop browser manager and private native adapter. Guests receive no application capability. Browser automation uses the shared runtime port, owned coordinator, and mandatory policy release; native Chromium preview and shipping human browsing retain separate acceptance gates. See ADR 0003 and ADR 0008.
colossus-browser-bridgeauthenticates independently supervised action and cancellation channels and retains per-session host obligations. Its admission pool does not prove process or network containment. Linux's OCI browser factory incolossus-sandboxowns those boundaries and the private egress lease;RuntimeBrowserHostcomposes it with the existing runtime effect gateway. Native CEF FFI lives in the separatenative/browser/driverworkspace.colossus-browser-presentationvalidates bounded native frames and input leases; native parent handles and frame-channel keys never become web IPC authority.- Managed Desktop browser admission uses an independent native parent/sidecar key and rechecks the primary application grant on every private request. The worker owns canonical conversation/session attachment and cleanup; the renderer supplies no host identity, native lease or input-fence receipt. Native human-to-agent transfer passes through the runtime gateway and atomic coordinator handoff. Platform availability remains disabled until accepted supervision and packaging; same-page agent-to-human transfer is still absent. See current browser readiness.
- Desktop's native Managed Local permission selector uses the narrow authenticated
colossus-worker-protocolcontrol client. The Desktop process does not link runtime, model, tool, policy, or worker-host implementation crates. - Desktop Codex account commands remain native interface adapters: they delegate login
and logout to
colossus-codex-auth, while runtime/provider construction stays in the sidecar andcolossus-runtime. The renderer receives status only. - Provider setup choices belong to the shared credential-free contracts catalog. CLI and Desktop expose these presets separately from Chat Completions, Responses, and Codex protocols. Catalog discovery runs through the existing runtime provider effect gateway, including before a model is selected; an offline echo route allows the connection to be inspected without a fabricated model ID or generation. Provider adapters normalize bounded, optional model-card metadata. Missing limits or capabilities remain distinguishable from provider-declared values, and model selection never grants tools or changes policy based on remote descriptions.
- Desktop setup packages are native interface imports:
setup_packagebounds and reviews an offline ZIP manifest, assets, and provider/model YAML. The verified sidecar's existing inspection API validates runtime semantics; no runtime crate is linked into Desktop. Saved setup metadata is separate from active workspace configuration. Credentials, trust changes, and model activation reuse existing native services and persist through the version-7 Desktop settings envelope. - Disposable Desktop setup diagnostics bind their protected journal identity to the canonical runtime directory and its filesystem identity. Versioned migration moves setup to a new namespace without resetting or bypassing workspace journal anchors. Windows NSIS cleanup is a native-only entry point with a fixed default-home scope; it reads bounded ownership metadata, removes exact OS key accounts, and refuses reparse points, active files, or shared CLI state. Plugin cache hard links are allowed only when every filesystem name belongs to an inspected blob in that cache; external aliases and links involving other data remain protected. It is not a renderer command.
- Top-level user-facing runs snapshot bounded home and repository
AGENTS.mdinstructions before provider execution. Goal iterations and delegated subagents carry that immutable snapshot and provenance; internal risk, summarization, and diagnostic model roles do not consume it. - Delegated child jobs remain durable work records, while their scheduler runs alongside the
parent provider/tool loop instead of suspending it. The scheduler continuously fills newly
available
subagents.maxConcurrentslots as later delegates arrive. Streaming parent runs receive bounded durable child lifecycle updates, including the released terminal result, over the same ordered run-event boundary used by CLI, TUI, worker, and public application adapters. - External applications enter through the authenticated public worker API or a caller-bound embedded SDK backend; they never depend on agent internals.
- Crate roots expose a focused API or composition surface; nontrivial logic belongs in named modules.
- Runtime canonical writes append journal events. Runtime read models and indexes are replaceable. Cloud domain state uses independent relational transactions with audit, outbox, and source cursors.
- Event-sourced repositories discover aggregate streams through bounded pages of the journal-maintained stream identifier index. Listing integrations, plugin installations, sessions, work, research, memory, or workflows must not rescan the global event history.
- Public run creation atomically appends its per-application owner-index entry;
ListRunstraverses that index newest-first instead of scanning the shared journal. - The complete effect path is centralized; an adapter cannot mint its own authority.
See Rust crate structure for module and public-surface conventions, Runtime and ports for service ownership, and Public API and application SDKs for external application integration. See Security architecture for the effect boundary.