Build Log · 2026-07-30

Alloy multi-tenancy Phase 0 — workspace-as-tenant schema + migration

What shipped

  • products/alloy/lib/db/schema.ts — added workspaces + workspace_memberships tables; added workspaceId (NOT NULL, FK to workspaces) to all 15 previously ownerId-scoped tables plus products, mission_products, mission_workpieces

  • products/alloy/docs/multi-tenancy-design-v4.md — the full Council-reviewed design document (domain model, table classification, authorization model, migration plan, test matrix, phased implementation)

  • Live DB (Neon, Alloy's real database): created 1 workspace + 1 membership, backfilled all 15 tables + products from a human-classified ownership census (3 distinct owner_id values, all classified as Zeb's own identities), applied 17 NOT NULL constraints and 19 composite FK constraints enforcing tenant-consistent parent/child relationships

  • products/alloy/lib/work-history-projection.test.ts — updated one pre-existing test fixture to include the new required workspaceId field