Skip to main content

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

TablePurpose
orgsTenant boundary
clientsClient/account records
projectsProject records and cross-system IDs
peopleUsers, roles, auth mapping
project_membersProject visibility for non-leads
sourcesMeeting/email/document/manual provenance
decisionsExtracted or entered decisions
promisesCommitments with owner/due/status
tasksWork items, including optional asana_gid
documentsIndexed/stored client documents
approvalsProposed actions waiting for human approval
project_categoriesEstimate taxonomy and service categories
rate_cardsBill/cost rate assumptions
budget_linesStructured SOW and budget scope
estimate_casesSaved outcome estimates for variance learning
scope_eventsScope-change and overrun signals
client_membershipsClient/person access grants
client_updatesPortal-visible updates after curation
client_requestsClient portal intake/request rows
deliverablesPortal-visible deliverables
board_feedbackAccept/reject/edit feedback
auditExecuted external action trail

Recent Migration State

0008_act_layer_approvals.sql adds:

  • sources.metadata
  • approvals.payload
  • approvals.result
  • approvals.source_id
  • approvals.confidence
  • approvals.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.