1.3 Architecture

Domain services own validation, authority, and behavioral storage operations. PostgreSQL implements those operations; HTTP and MCP adapt their results to transport-specific envelopes.

The implementation boundaries are:

SourceResponsibility
internal/accounts, internal/authIdentity, effective permissions, authentication, and session policy.
internal/workspaces, internal/tasksWorkspace and work-record validation and behavior.
internal/postgresSQL transactions, migrations, consistent reads, and persistence.
internal/httpapiRouting, origins, cookies, transport validation, and safe errors.
internal/notifications, internal/pushTask inbox contracts and browser push delivery.
internal/clientShared command-line HTTP transport and response handling.
web/src/libShared forms, typed clients, task views, and browser state.

Migrations are embedded, ordered, and checksummed. Startup applies them in a transaction under a database advisory lock. An altered applied migration or an unknown migration fails startup. A release migration can retire stored data; operators review migration effects before upgrading.

Edit this page