Skip to content

docs(email): plan for the email accountability module - #634

Open
privatejoel wants to merge 2 commits into
mainfrom
claude/agitated-lamport-b295a9
Open

privatejoel wants to merge 2 commits into
mainfrom
claude/agitated-lamport-b295a9

Conversation

@privatejoel

Copy link
Copy Markdown
Collaborator

Summary

This is Phase 1 (EA-0) of the email accountability module. It adds one file, docs/EMAIL_ACCOUNTABILITY_SCOPE.md. It has no code.

The plan does these things:

  • It lists what Anvil has now and what the module reuses: the Graph OAuth and refresh pattern, secrets v2, the customer matcher (exact steps only), resolveAssignee, resolveInternalRecipients, datemath, cron-mux and the tick, recordAudit, SERVER_ACTIONS and notify() from feat(notifications): a notice per person and a bell for every role, on desktop and phone #624.
  • It shows the dependency map. The module adds no npm package and no paid service. Graph mail reads are not metered. The Gmail API has no charge inside its quota. A per-customer Internal Google app avoids Google verification and the yearly CASA assessment.
  • It defines one provider adapter interface, with an Outlook connector (Graph delta on Inbox and Sent, ImmutableId, a bounded first sync) and a Gmail connector (history checkpoint, metadata format only).
  • It defines deterministic rules with facts and inferences kept apart. It uses no LLM. Synced mail never enters inbound_emails, because the tick runs the LLM classifier and draft-order creation on that table.
  • It puts email actions in the designed work_items table (a subset of WM-5, migration 252) plus one email_actions table. The action state is separate from the business outcome.
  • The verifier links a sent message to an action only through In-Reply-To or References, or through the Outlook conversationIndex parent and child relation. A match on the conversation ID alone stays ambiguous. Each action type has a requirement. A manual path uses maker and checker.
  • Reminders and escalation run on a policy you can configure. A ledger table with a unique key prevents duplicate notices.
  • It sets cost limits per mailbox: a daily request budget, a page cap, a lookback cap, bounded retries, a pause and an admin alert.
  • It plans nine PRs (EA-1 to EA-8) that cover the 18 tests of the request, and it lists ten owner decisions (ED-1 to ED-10), each with a default.

Deploy notes

Tests

  • This PR has no code, so I ran no test suite.
  • I checked the file for em dashes and en dashes. It has none.
  • I checked every reuse claim against main 931eb143.
  • I checked the provider facts against the Microsoft and Google documents: the message delta filter and the Mail.ReadBasic limits, the Outlook throttling limits, the Gmail scope classes and the restricted-scope exemptions.

Not covered

  • I did not check the Outlook MAPI property IDs 0x1042 and 0x1039 on Sent Items against a live mailbox. Section 8, item 1 of the plan states this limit. EA-8 adds an onboarding check for it.
  • The URL format for a Gmail web link is not documented by Google. Section 5.2 of the plan states this.
  • Section 11 lists five defects that I found and did not fix here. One of them: matchInboundToCustomer matches on free-mail domains and does not escape ilike wildcards.

🤖 Generated with Claude Code

Phase 1: reuse inventory, dependency map, architecture, data model,
PR plan and owner decisions. No code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
anvil Ready Ready Preview Oct 22, 2026 3:03am UTC

This branch was successfully deployed

1 active deployment
Preview — 59860075 Deployed Oct 22, 2026 by vercel[bot]
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