feat: raw inbox — provider-agnostic message ingestion with triage + promotion lineage - #39
Merged
Conversation
…+ promotion lineage
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a purely-additive raw inbox staging layer so messages from any network (email, Twitter/X, LinkedIn, Discord, Slack, SMS, …) can be dumped raw, triaged, and only then promoted into the curated tables — no existing table is modified.
New blueprint
packages/provision/src/schemas/inbox.ts(registered afterStaginginprovision.ts), mirroring theraw_contactspattern:raw_messages:provider(required) +external_id/external_thread_id, normalized common shape (sender_handle,sender_display_name,recipients jsonb,subject,body_text,sent_at), full provider payload inraw_data jsonb, and triage fields (triage_statusdefault'pending',triage_score,triage_notes,labels citext[],ingested_at). No SearchUnified nodes — nothing enters the embedding/RAG pipeline until promoted.raw_message_attachments(HasMany, cascade).sender_contact_id → contacts(identity matched at triage),promoted_email_id → emails,promoted_conversation_id → conversations(promotion lineage; the curated targets auto-embed via their existing triggers).provider,external_id,external_thread_id,triage_status,sent_at.Everything else is regenerated, not hand-edited: exported pgpm packages (
packages/agentic-db,packages/agentic-db-services— service IDs churn because export ran from a freshly provisioned DB),sdk/schemas/agentic-db.graphql, SDK/CLI (RawMessage,RawMessageAttachmentmodels + commands), and skills references. README gains a Raw inbox bullet; table count 95 → 97.Verified locally: RLS-stripped export deploys clean to a fresh DB (21 cols on
raw_messages, 0 policies); suites green — agentic-db 21/21, orm 36/36, rag 10/10, documents-loader 74/74, cli-e2e 16/16.Link to Devin session: https://app.devin.ai/sessions/bd82f3b68a6348b6b3527a6a9c399f15
Requested by: @pyramation