Skip to content

feat(email): align platform email with authoritative gateway design - #331

Merged
Brooooooklyn merged 6 commits into
mainfrom
codex/email-design-alignment
Sep 19, 2026
Merged

Brooooooklyn merged 6 commits into
mainfrom
codex/email-design-alignment

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Platform email now follows the revised first-release design: a dedicated gateway authenticates zone ingress and bounds tenant dispatch, while PostgreSQL authorizes routing, consent, policy, suspension, quotas, and recorded outcomes.

  • Share one ingress per Cloudflare account and zone across exact-domain project assignments. Persist provisioning intent, scoped credentials and expiry, secret generations, and ambiguous outcomes. Blocked operations resume safely, including orphaned project cleanup with a verified replacement token; uncertain provider writes require matching read-back or audited operator recovery of the exact recorded attempt.
  • Use one per-recipient admission ledger for direct sends and inbound actions. Revalidate exact route ownership and suspension when receipts are created and enforce suspension when attempts start. Preserve monthly usage through log expiry, refund only reservations that never started, and never replay an uncertain send. Shared-sender replies use the platform binding; customer senders use their scoped account credential.
  • Bound MIME, recipient counts, receipt verification, internal calls, provider responses, and SDK waits. Record provider references and keep cancellation separate from an attempt whose outcome is unknown.
  • Package the gateway with platform installation. Require the shared zone and sender identity before upgrading an email-enabled installation. Bootstrap and verify shared inbound routing before opening traffic; retain the verified Worker set and operation ID when setup needs recovery. Support Access-protected installations, upgrades, repair, and rollback with the gateway's required JWT secret only.
  • Expose paginated outcome metadata to project owners and platform administrators, including administrator access by deleted project ID during retention. Update the existing design, CLI, and guides. Remove obsolete OAuth, per-domain relay, KV authorization, unused helpers, stale comments, compatibility branches, and redundant tests. Retain historical database schema needed to roll back published platform runtimes.

Validation: vpr test:all passed formatting, lint, package/playground builds, platform lint, typechecking, and all 549 test files (10,388 passed, 20 skipped). A separate PostgreSQL 18 run passed all 252 tests across admission, connection lifecycle, operator domain management, operator outcome logs, browser administration, audit, and owner email APIs, including the real transaction-lock regressions.

Email remains unreleased. Live Cloudflare acceptance gates must pass before production enablement. Customer-zone relayed forwarding reports UNSUPPORTED_ACTION without consuming quota because a REST resend does not preserve native forwarding semantics; relayed replies and native forwarding remain supported.

@Brooooooklyn
Brooooooklyn marked this pull request as ready for review September 18, 2026 17:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-19T12:21:54.637630Z a6612c3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f147f09d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5909aaacdd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread platform/packages/api/src/index.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e269fb2a48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/platform-plan.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6612c363a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/router/compile.ts Resolved
@Brooooooklyn
Brooooooklyn merged commit 09b4887 into main Sep 19, 2026
19 checks passed
@Brooooooklyn
Brooooooklyn deleted the codex/email-design-alignment branch September 19, 2026 14:32
cpojer pushed a commit that referenced this pull request Nov 16, 2026
…les (#836)

Two lint settings in `vite.config.ts` look active but check nothing, and
unused code goes unreported in the platform:

- `jest/no-focused-tests` is dropped from the effective config because
the Jest plugin isn't enabled, so `it.only` and `describe.only` pass `vp
lint` and the pre-commit hook. Vitest rejects `.only` in CI, but a local
run passes while it skips the file's other tests.
- `vp run lint:platform` passes `--type-aware`, but the config enables
no type-aware rule, so it reports the same as a plain `vp lint`. An
unawaited promise passes.
- `no-unused-vars` is off: the `correctness` category is off and the
rule was never re-enabled. The SDK packages catch unused locals with
TypeScript's `noUnusedLocals`, but the platform packages,
`packages/isr`, and `.mjs` scripts have no check, and 17 unused imports,
variables, and test helpers had built up in the platform.

## Fix

- Use `vitest/no-focused-tests`. The `vitest` plugin is already enabled.
- Enable `no-floating-promises`. Plain `vp lint` skips type-aware rules,
so only `vp run lint:platform` applies it. The platform has no
violations. With a type-aware rule enabled, that task now runs the type
checker: about 3 s locally instead of 1 s.
- Enable `no-unused-vars` without checking parameters, matching the SDK
packages, where TypeScript's `noUnusedLocals` is on and
`noUnusedParameters` is off. An options object turns off oxlint's
default `^_` ignore pattern, and the code uses `_` names on purpose, so
`varsIgnorePattern: '^_'` restates it. Without it, the rule reports 98
of those names.
- Leave `platform/packages/api/src/admin/fate/client.generated.ts` out
of lint, as `fmt` already does. `@nkzw/fate` imports `mutation` there
without using it.
- Remove what the rule found. Behavior doesn't change:
- `dispatch/src/isr.ts` imported six names that it only re-exports with
a separate `export { … } from '@void/isr/core'`.
- The proxy's inbound-email test helpers (`streamOf`,
`createInboundMessage`, `createCtx`, `routeInboundMessage`) have had no
callers since inbound handling moved to the email gateway in #331. The
proxy Worker only exports `fetch`.
- `routeRelayed` in the email gateway still requires
`authoritative.slug`; only an unused copy of it is gone.
- The rest are unused imports, a destructured variable, a type alias,
and one more test helper.

## Verification

- Temporary files confirmed that each rule reports its case: `it.only`
and an unused import in an `.mjs` file in `vp lint`, and an unawaited
call under `platform/` in `vp run lint:platform` only.
- `vp lint`, `vp run lint:platform`, `vp fmt --check`, and `vp run
check` pass.
- Full suite after a package rebuild: 806 files and 17,064 tests pass; 1
file and 32 tests are skipped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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