/packages/db/src/schema/
├── organizations.ts # Organizations and platform connections
├── users.ts # Users (+ mustChangePassword), platform identities, ramp-up config
├── projects.ts # Projects with Slack channel links and overdue escalation config
├── clients.ts # Clients (+ slackChannelId, description, contextNotes), deploy schedules, assigned members
├── tasks.ts # Tasks (+ stageId, displayId), drafts, and task logs (+ taskType, size, weight, clientId, carryForwardCount)
├── pipeline-stages.ts # Kanban pipeline stages per org (name, slug, color, position, WIP limit)
├── moods.ts # Mood entries and journals
├── flags.ts # Flags, inquiries, and messages
├── audit.ts # Audit logs and security events
├── notifications.ts # Notifications and deliveries
├── memory.ts # Conversation sessions and user memory
├── reminders.ts # User reminders (set via LLM, fired via BullMQ delayed jobs)
├── cards.ts # Yellow/red accountability cards
├── morning-threads.ts # Daily morning threads
├── thread-submissions.ts # User replies to morning threads
├── task-statuses.ts # Daily task status snapshots (done/carry-forward/dropped)
├── ooo-records.ts # Out-of-office records (manual + parsed)
├── task-type-map.ts # Task type → size/weight keyword mapping
├── blockers.ts # Blocker tracking with escalation ladder
├── reports.ts # Generated reports (daily, weekly, monthly)
├── interventions.ts # Invisible labor / intervention logs
├── action-items.ts # Action items from reports
├── reinforcements.ts # Positive reinforcement records
├── kpi-targets.ts # KPI target configuration per org
├── kpi-snapshots.ts # Weekly KPI snapshot history
├── checklists.ts # Role-based checklists and completions
├── sops.ts # SOPs and SOP compliance records
├── channel-messages.ts # Raw Slack channel messages for context extraction
├── context-observations.ts # Extracted facts with pgvector embeddings
├── context-summaries.ts # Entity profile summaries with embeddings
└── backfill-state.ts # Channel message backfill progress tracking