DOCS / ARCHITECTURE

Ports and adapters

Trace the dependency direction that keeps incident and recovery semantics independent of infrastructure vendors.

PHASE 1 · PRE-1.0PYTHON 3.11+EDIT ON GITHUB ↗

Dependency direction

Dependencies point inward; adapters implement ports, never the reverse

Domain depends only on Python, Pydantic, and standard-library types. Application coordinates domain and ports. Adapters implement local or provider-specific behavior. The CLI selects concrete adapters. Nothing in domain or application knows which database, model provider, or observability vendor is in play.

What belongs where

LayerOwnsMust not own
DomainIncidents, evidence, diagnoses, playbooks, proposals, approvals, verification, truthDatabase, HTTP, CLI, cloud, agent SDK
ApplicationUse-case orchestration, collection budgets, lifecycle orderSQLite, hosted products, provider SDKs
PortsProvider-neutral capability protocolsConcrete credentials or clients
AdaptersDeterministic rules, SQLite, Markdown/JSON, webhook, plugin catalogCore business semantics
CLIComposition and user commandsReusable domain policy

Extension rule

Substantial vendor connectors ship as independent packages when practical—the repository already proves this with lumis-sdk-postgres-memory and lumis-sdk-http-json-evidence, neither of which adds its driver to core. This keeps core installation small and makes permissions, trust, maintenance, and compatibility visible per connector.