docs(email): record send API evidence
CI and Deploy / test (pull_request) Failing after 1m34s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-10 00:02:29 +02:00
parent 123fc5555a
commit 90f9bf576c
7 changed files with 51 additions and 28 deletions
+19 -8
View File
@@ -1,8 +1,8 @@
# MAIL-001 consolidated job-email hub
Updated: 2026-08-09
Updated: 2026-08-10
Status: `IN PROGRESS`. Canonical hub routing and provider-neutral read capability discovery are implemented and locally verified; provider actions and draft/send work remain.
Status: `IN PROGRESS`. Canonical hub routing, provider-neutral reads and the explicit-confirmed send API are implemented and locally verified; the editable UI and remaining provider actions remain.
## Revalidated current boundaries
@@ -53,22 +53,33 @@ Status: `IN PROGRESS`. Canonical hub routing and provider-neutral read capabilit
- Gmail builds an RFC MIME plain-text message, supports the existing Gmail thread ID, and uses the documented send endpoint. Graph sends plain-text JSON through `sendMail`.
- HTTP rejection is a known failed-before-delivery category; 401/403 requires reauthorization. Network interruption/cancellation is marked uncertain because acceptance cannot be disproved.
- Provider response bodies and transport exception details are not returned to callers. Recipient/body fixtures and HTTP transport are synthetic/mocked; no provider was contacted.
- No application send route exists yet. Consent and adapters cannot be triggered by a JobTracker send button until ledger integration lands.
- The adapters are reachable only through the later explicit-confirmed API; no JobTracker send button exists yet.
## Implemented explicit-send API increment
- Added one authenticated, rate-limited `POST /api/email/send` route. It requires an owned job, a send-capable connected provider, an explicit `confirmed=true`, and valid bounded recipient/subject/body/thread fields.
- Client UUIDs are canonicalized before the tenant ledger reservation. Reusing a UUID with different content is rejected; sent duplicates return the original result; pending, failed or uncertain attempts are never redelivered automatically.
- The ledger is reserved and moved to sending before provider I/O. Provider rejection is failed, transport ambiguity is uncertain, and connection failure before delivery is failed.
- Successful delivery writes the outbound correspondence, a content-free job event and the ledger terminal state in one local database transaction. Provider acceptance followed by local persistence failure is surfaced as uncertain.
- The audit event and ledger omit recipient, subject and body. Full content exists only in the intended job correspondence record.
- Tests use owner-isolated SQLite and a fake provider; no email, OAuth flow, provider service or external network was invoked.
## Verification
- Focused delivery/provider/capability: 18/18; send ledger: 3/3; provider/correspondence controllers: 5/5; hub detail: 5/5.
- Full backend: 613/613; full frontend: 49/49 suites, 188/188 tests.
- Explicit-send controller/store/read focused tests: 12/12.
- Full backend: 619/619; full frontend: 49/49 suites, 188/188 tests.
- Production build/TypeScript and `git diff --check`: pass.
- Implementation commits: `6008b4a`, `536d403`, `a20775c`, `653f011`, `e9937ac`.
- Implementation commits: `6008b4a`, `536d403`, `a20775c`, `653f011`, `e9937ac`, `123fc55`.
## Remaining MAIL-001 work
- Extend shared provider-neutral thread navigation and application embedding while preserving provider capability differences.
- Surface provider identity, reauthorization, read/unread, pin/read-later/archive/spam/trash only where the provider supports it.
- Share thread detail and link/unlink actions between hub and job workspace.
- Design editable provider drafts with recipient/subject/thread/provider review and explicit confirmed, idempotent send; uncertain failures must not be retried blindly.
- Include non-sensitive send-attempt metadata in user export and verify account/job deletion coverage before enabling the send API.
- Add editable provider drafts with recipient/subject/thread/provider review and a final confirmation dialog; reuse one client UUID per reviewed draft and show uncertain results without blind retry.
- Reconcile abandoned `sending` attempts to an explicit uncertain/manual-review state after process failure; never auto-resend them.
- Include non-sensitive send-attempt metadata in user export and verify account/job deletion coverage before production rollout.
- Preserve minimal audit metadata without sensitive body logging; verify Free non-AI access and Pro-only AI assistance.
- Complete link/unlink/dismiss/draft/send/failure/two-user/application-embed tests plus browser/production provider gates. No real email may be sent during repository verification.
@@ -78,4 +89,4 @@ The first focused Jest invocation exhibited the repository's open-handle delay.
## Rollback
Revert `e9937ac` to remove send consent/adapters, then `653f011` (after migration downgrade) for the ledger, followed by the earlier read/routing commits. Existing provider grants are not revoked by a code rollback; disconnect/reconnect is an explicit user action.
Disable the UI/admission path before rollback. Revert `123fc55` to remove the send route, then `e9937ac` for send consent/adapters and `653f011` (after migration downgrade) for the ledger, followed by earlier read/routing commits. Existing provider grants are not revoked by a code rollback; disconnect/reconnect is an explicit user action.