Architecture
One codebase. Two engines. One security boundary.
Ports-and-adapters throughout, so the same policy engine, catalog, auth, and agent layers run on embedded SQLite or Postgres — selected by config, not a rewrite.
Components
A request, end to end
Principles (as constraints)
- Ports & adapters. Every external capability sits behind an interface; adapters are chosen at startup. One build serves solo → enterprise.
- Authorization in the app layer, not scattered. A single enforcer compiles policy to parameterized predicates — identical on both engines — so there's one place to get security right.
- Contract-first. The API is specified in OpenAPI; the error envelope is a versioned contract every handler honors.
- Secure by default. Deny-by-default access, secrets hashed, the signing key and DB file locked down, non-solo tiers fail closed without an explicit admin key.
- Parity is tested, not assumed. A cross-engine conformance suite runs the security + correctness behaviors against real Postgres in CI.
The policy engine is the crown jewel and the stated highest-risk component. It's fuzz-tested (the compiler never emits a raw literal) and has been through repeated adversarial review. It still warrants an independent audit before storing real data.