Architecture
MySQL as the durable system of record; a small stdlib HTTP API on top; everything scoped to a tenant, and now a workspace and an agent, at every layer.
The shape of it
Design principles
| Principle | What it means in practice |
|---|---|
| Multi-tenant from the start | Every table that holds tenant data carries tenant_id, and every uniqueness rule is scoped to it — not a global key that could silently merge two customers' records. |
| Append-only where it's evidence | Memories, audit entries, and job events are never overwritten in place. An "edit" inserts a new, linked row. |
| Hash-chained logs | The audit log and job-event log are hash-chained, so a dropped or reordered entry is detectable, not just assumed absent. |
| Fail-closed identity | Who's asking is always resolved server-side from the API key. A request can never claim a different tenant or agent and have it take effect. |
| Relational source of truth | MySQL holds the authoritative data. Any future vector/semantic index is an optional, rebuildable accelerator — losing it costs ranking quality, never data. |
Security
Built and tested today:
- Tenant isolation on every read/write path.
- Permission-aware retrieval within a tenant (private / workspace / tenant visibility, plus explicit shares) — see Privacy.
- Fail-closed authorization: a missing, invalid, or revoked key never grants access.
- Hashed API keys (SHA-256; plaintext is never stored).
- Append-only, hash-chained audit trail of every write and every authorization decision.
- A cross-boundary read of a real object ID returns 404, not 403 — so a caller can never confirm something exists that they're not allowed to see.
Not yet built — required before any real customer data is stored:
- Encryption at rest (an infrastructure concern for a real deployment, not yet applicable to a schema/API foundation).
- Formal data-processing and privacy terms, reviewed by counsel.
- Self-service API-key rotation and revocation (today this is a direct database operation).
- Rate limiting / abuse protection on the public API surface.
No compliance certification (SOC 2, ISO 27001, HIPAA, or otherwise) is claimed anywhere — none has been pursued or obtained.
Testing, honestly stated
54 automated tests pass as of this writing: 28 unit tests with no database involved, and 26 integration tests against a real, disposable, 127.0.0.1-only MySQL 8.0 container created and torn down by the test suite itself — never a persistent host install. Coverage specifically includes cross-tenant isolation, cross-workspace write denial, and the private/workspace/tenant visibility and explicit-sharing rules.