Supabase Spine
The spine is SABLE's owned system of record. It lives in Supabase Postgres and is defined by migrations in:
sable-agents-demo/supabase/migrations
Core Tables
| Table | Purpose |
|---|---|
orgs | Tenant boundary |
clients | Client/account records |
projects | Project records and cross-system IDs |
people | Users, roles, auth mapping |
project_members | Project visibility for non-leads |
sources | Meeting/email/document/manual provenance |
decisions | Extracted or entered decisions |
promises | Commitments with owner/due/status |
tasks | Work items, including optional asana_gid |
documents | Indexed/stored client documents |
approvals | Proposed actions waiting for human approval |
project_categories | Estimate taxonomy and service categories |
rate_cards | Bill/cost rate assumptions |
budget_lines | Structured SOW and budget scope |
estimate_cases | Saved outcome estimates for variance learning |
scope_events | Scope-change and overrun signals |
client_memberships | Client/person access grants |
client_updates | Portal-visible updates after curation |
client_requests | Client portal intake/request rows |
deliverables | Portal-visible deliverables |
board_feedback | Accept/reject/edit feedback |
audit | Executed external action trail |
Recent Migration State
0008_act_layer_approvals.sql adds:
sources.metadataapprovals.payloadapprovals.resultapprovals.source_idapprovals.confidenceapprovals.edited_payload- Expanded approval status constraint
- Source lookup index for
(org_id, type, external_id) - Fathom webhook replay index on audit detail
0010_agency_os_spine.sql adds the Agency OS layer:
- Pricing fields on
projects: category, budget hours/amount, actual revenue/cost, and rate card. - Portal tables for client memberships, curated updates, requests, and deliverables.
- Pricing-learning tables for budget lines, estimate cases, scope events, rate cards, and categories.
- RLS policies that let admin/lead users read the internal spine while client users see only curated portal rows for their client memberships.
Scoping
The database includes RLS helpers, but server-side routes often use a service-role client. Those routes must explicitly scope by:
person.org_id- project membership for non-leads
- restricted document rules
Do not assume service-role queries are protected by RLS.