Repository navigation
feat(email): health and cost view, reply check, retention purge, setup docs (EA-8) - #642
Open
privatejoel wants to merge 1 commit into
Open
privatejoel wants to merge 1 commit into
privatejoel wants to merge 1 commit into
Conversation
…p docs (EA-8) GET /api/email/health (email.rules): mailbox totals against the budget, schedulers, evidence waiting for a person, failed notices, actions by state, observe-mode counts and the effective policy. POST /api/email/check: the onboarding check reads the newest sent messages and reports whether replies carry In-Reply-To/References or an Outlook index step. The daily email/purge clears previews past the tenant's retention. docs/EMAIL_ACCOUNTABILITY_SETUP.md: architecture, files, migrations, provider setup, env vars, dependencies and cost, safeguards, onboarding, known limits and the acceptance checklist. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
EA-8 is the last PR of the email accountability plan (#634, phase 6). It adds operations and the deliverables document.
Stacked on #641 (EA-7) ← #640 ← #639 ← #638 ← #637 ← #636 ← #635 ← #619.
GET /api/email/health(email.rules, admin) returns the module's health and cost for the tenant:email/sync,email/sweep,email/sweep_daily,email/purge,cron/tick,cron/daily);It returns safe columns only, with no token and no checkpoint. A card on Email Actions > Mailboxes shows it to admins.
POST /api/email/check { id }is the onboarding check for known limit 1. The owner or an admin can run it.conversationIndex.headers_ok,index_only,headers_missingandno_replies_in_sample, each with a plain sentence.email/purgeruns daily as a newcron/dailyentry with a 30-hour heartbeat bound. It clearspreviewon actions older thanemail_content_retention_days(default 30) and stampscontent_purged_at. The subject, the IDs and the reasons stay. Anvil never stores a body or an attachment.docs/EMAIL_ACCOUNTABILITY_SETUP.mdholds the final deliverables of the request:docs/CRONS.mdlists the four email handlers.Deploy notes
email/purgedaily entry needs no setting. It runs only for tenants with the module on.docs/EMAIL_ACCOUNTABILITY_SETUP.mdto onboard a customer. Run check replies on each mailbox before you switch the tenant tocreate.Tests
src/v3-app/api-email-ops.test.js(12 tests):headers_ok. Headers on only some replies are not ok.index_only, and a root index is not a step.with_index0).email.rulescan read it.screens/email-actions.test.tsxadds 1 test (13 in total): check replies shows the verdict, and the health card is for an admin only.The whole module: 12 test files, 212 tests, all pass.
Mutation check: I broke each rule, ran the files and restored the code. All 13 mutations failed the tests:
One of these mutations ("Gmail counts an index") first survived. I made its test stronger.
Gates:
npm run check: pass.npm run lint: 0 errors. The new files add no warnings.npm run build: pass.npm run verify: pass. I restored the unrelated rewrites of the audit docs.npm run eval:golden: pass.NODE_OPTIONS=--no-experimental-webstorage npx vitest run: 640 files, 7,689 tests, all pass.Not covered
PUT /api/email/policysets it.more: true.🤖 Generated with Claude Code