Architecture · 11.06
Codebase Shape & the Boundary Rails
The monorepo layout across apps and packages, and the dependency-free boundary checker that fails CI on illegal cross-layer imports.
Ten packages, each with one job
| Package | Responsibility |
|---|---|
apps/api | The runtime: engine, domain-bounded services, routes, adapters, the bootstrap composition root. |
apps/web | The dashboard: canvas, chat, apps, Brain, settings. |
packages/core | Shared types — the workflow graph, the view tree, capabilities — plus constants and pure logic. Deliberately browser-safe: no node:crypto or other Node-only imports. |
packages/db | SQLite schema and migrations (Drizzle). |
packages/integrations | Connector manifests and templated HTTP connectors. |
packages/cli | The launcher / embedder entry point. |
packages/app | The App primitive's shared logic — datastore, lifecycle, packager, surface store — used by both the API and the web dashboard. |
packages/app-client, packages/runtime, packages/sdk | Internal shared packages, each private: true — not published externally today. See The Internal Packages. |
Modularity enforced by CI, not just convention
A dependency-free boundary checker runs as part of pnpm lint and fails the build outright on an illegal cross-layer import — a rule enforced by tooling, not just a convention written in a README that erodes the moment someone's in a hurry. A companion file-size budget rail blocks new god-files from forming in the first place, the same discipline that motivated splitting the engine's cognitive loop and node executors out from the core WorkflowEngine file behind typed host facades rather than letting one file keep absorbing every new responsibility indefinitely.
Continue
Agent, Subject, Connection, Orchestration, Experiment, Interface — the backing systems behind each, and why there's no seventh.
Why an unchanged workflow graph resumes without re-validation, and how assets get deduplicated by SHA-256.