Skip to content

feat!: pin @corbits/mailbox 1.0 (native MailboxStore); chat sends mail; inbox route deleted (CL-8174, CL-8209) - #795

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-8174-mailbox-1-0
Sep 17, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-8174-mailbox-1-0

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Bumps every github:corbitsdev/corbits-mailbox pin to e85b81e4 (1.0.0, breaking) across apps/hub, packages/chat, packages/inbox.
  • apps/hub/src/index.ts: the mountMailbox call is rewritten for the new resolvePrincipal/senderAddressFor/deliver mount contract — senderAddressFor derives <principalId>@<tenant domain>, and deliver reuses the same dual-write lookups.persistMail (createMailboxPersist) every outbound agent frame already goes through, so a human's POST /me/inbox/send and an agent's own outbound mail share one delivery path (live run via the vendored session/mail routing, human recipients via the mailbox dual-write). apps/hub/src/mailbox-persist.ts drops the retired resolveRefs seam (refs no longer exists on the package).
  • The @corbits/inbox product-inbox routes (createInboxRoutes, mounted at ${TENANT_PREFIX}/inbox) are deleted (CL-8209): they sat entirely on removed @corbits/mailbox APIs (listUserMailbox, refs, classification), and no web surface reads them any more — /inbox in the web app only bounces old links home (CL-6151).
  • packages/chat/src/mailbox-fanout.ts: writes one writeMailboxMessage append per recipient (outbound → Sent, inbound → INBOX) instead of the retired batch writeMailboxMessages transaction — the native store has no multi-row batch. refs stamping is gone.
  • packages/chat-ui/src/mailbox-timeline.ts (the single browser-side mailbox adapter) now reads GET /me/inbox/threads instead of the retired /me/threads + refs API. Since a workbench is a plain tenant (CL-8083), a tenant's own mailbox already is that one room's mail, so there's no per-room ref filter to apply any more.
  • packages/inbox is trimmed to just the @corbits/notify → @corbits/mailbox delivery adapter (delivery.ts, rewritten against deliverInboxItems's new no-refs InboxItem shape) and its own migration ledger (migrations.ts). Deleted: routes.ts, thread-client.ts, client.ts, vocabulary.ts, group.ts, project.ts, bulk.ts, bulk-run.ts, cursor.ts, walk.ts, and their tests — all built on removed @corbits/mailbox exports.

What's left on the old chat send path

The composer's send action (useOptimisticSends → sendMessage in packages/chat-ui/src/api.ts) still posts through the existing chat message route, not POST /me/inbox/send directly — that route's server-side fan-out (writeChatMailboxFanout) already lands the mailbox copy via the rewritten mailbox-fanout.ts above. Wiring the composer to call /me/inbox/send directly (with inReplyTo set to the thread root Message-ID) is follow-up work, not done here.

Test plan

  • bun run typecheck — green
  • bun run lint / bun run fmt:check — green
  • bun run check:structural — green
  • bun test — green except 7 packages with pre-existing failures unrelated to this change (@intx/hub-agent, @corbits/workbench-digest-workflow, @corbits/workflows, @corbits/webhook-triggers, @workbench/onboarding, @corbits/chat's platform-adapter.test.ts launch/deploy fixtures, @corbits/chat-ui's act()/happy-dom teardown flakiness) — none reference mailbox/inbox and none touch files this PR changes
  • DB-gated mailbox suites (packages/inbox/test/delivery.test.ts, apps/hub/test/mailbox-persist.test.ts, apps/hub/test/notify-delivery.test.ts) were rewritten for the new API but not run against live Postgres in this session (port 5432 was already bound by another worktree's compose); CI's db-suites/e2e-suite jobs will exercise them

Bumps every github:corbitsdev/corbits-mailbox pin to e85b81e4 (1.0.0,
breaking): mountMailbox now takes resolvePrincipal/senderAddressFor/deliver
instead of a vocabulary, routes live under /me/inbox*, and refs, triage,
snooze, and batch writeMailboxMessages are gone in favor of a single-append
NativeMailboxStore.

- apps/hub: mailbox-persist.ts drops the retired resolveRefs seam; the
  mailbox mount's own deliver reuses the same dual-write persistMail path
  every outbound agent frame already goes through, and senderAddressFor
  resolves a human's `<principalId>@<tenant domain>`. The @corbits/inbox
  product-inbox routes are deleted (CL-8209): they sat on removed
  @corbits/mailbox APIs and no web surface reads them any more.
- packages/chat: mailbox-fanout.ts writes one writeMailboxMessage append
  per recipient (outbound to Sent, inbound to INBOX) instead of a batch
  transaction, since the native store has no multi-row batch.
- packages/chat-ui: mailbox-timeline.ts (the only mailbox reader UI-side)
  reads GET /me/inbox/threads instead of the retired /me/threads+refs
  API. A workbench is a plain tenant now, so a tenant's own mailbox is
  already its one room's mail — there is no ref to filter by any more.
- packages/inbox: deletes the thread-client, routes, and every module
  built on removed @corbits/mailbox exports (vocabulary, group,
  bulk/bulk-run, cursor, project, walk); keeps only the @corbits/notify
  delivery adapter and this package's own migration ledger.

Tests exercising retired behavior (batch-transaction atomicity, ref
stamping, triage grouping) are deleted rather than adapted, per the
hard-cutover rule.
Rebasing onto main's CL-8217 tools/workflows/agents/skills restructuring
moved package paths the lockfile and report-error baseline both track.
@linear-code

linear-code Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

CL-8174

CL-8209

@TheGreatAxios
TheGreatAxios merged commit 4b59f68 into main Sep 17, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant