Skip to content

docs(email): record 0135 drop receipt and _rate_limits preflight - #1189

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/mailbox-drop-ops-note-0671
Aug 3, 2026
Merged

kentcdodds merged 2 commits into
mainfrom
cursor/mailbox-drop-ops-note-0671

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Aug 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Documents the production 0135 apply and the operational unblock for the frozen inventory CHECK: drop ephemeral _rate_limits before applying, never hand-edit approval rows.

Production status (done)

  • Legacy graph tables dropped; email_user_graph_authority.dropped_at = 2026-08-03T22:55:39.916Z
  • d1_migrations row 0135-drop-legacy-email-graph.sql id 140 @ 2026-08-03 22:55:40
  • Production deploy 30860556854 succeeded (migrations: no pending; healthcheck + smoke green)
  • Obsolete edit-0135 attempt #1187 closed (ledger immutability)

System recap

SYSTEM RECAP
mode: recap
overall: composes
risk: Low
primitives: (none — docs only)
paths:
  - docs/contributing/mailbox-legacy-graph-drop.md
notes:
  - Records applied receipt / timestamp and `_rate_limits` preflight guidance
Open in Web Open in Cursor 

Note the production apply time, the control-plane receipt that authorized it,
and that dropping the runtime `_rate_limits` scratch table is the supported
inventory unblock before 0135.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 40ab417a-1ba9-4c72-a1a1-b6e38ef548c9

📥 Commits

Reviewing files that changed from the base of the PR and between 6f1ce5e and 5689516.

📒 Files selected for processing (1)
  • docs/contributing/mailbox-legacy-graph-drop.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kentcdodds
kentcdodds marked this pull request as ready for review August 3, 2026 23:01
@github-actions

github-actions Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-1189.kody-a99.workers.dev

Worker: kody-pr-1189
D1: kody-pr-1189-db
KV: kody-pr-1189-oauth-kv

Mocks:

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds merged commit ffb8463 into main Aug 3, 2026
10 checks passed
@kentcdodds
kentcdodds deleted the cursor/mailbox-drop-ops-note-0671 branch August 3, 2026 23:15
kody-bot pushed a commit that referenced this pull request Aug 4, 2026
* feat(email): pass env to withAccountWriteLease at all four call sites

All four email paths (inbound, inbound-effects, outbound,
reconcile-inbound-deliveries) now supply env to withAccountWriteLease.
This is call-site coordination only; no behavior changes beyond
env/holder plumbing. Mailbox legacy graph is already dropped
(#1174/#1189).

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* refactor(deletion): make withAccountWriteLease and friends UserMeter-only

- withAccountWriteLease: env required; remove D1 acquire/release path,
  D1/DO union, waitUntil param, and active_write_count plumbing
- markAccountDeleting: env required; D1 deleting_at set first (gate),
  then UserMeter markDeleting; no D1 lease snapshot or loading
- listActiveAccountWriteLeases: (env, userId) only; UserMeter page walk;
  no D1 union
- repairAccountWriteLease: env required; DO-only prepare/finalize; D1
  audit row kept; no stale D1 clear
- Remove dead waitUntil params from all call sites
- D1 users.deleting_at remains the permanent point gate

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* refactor(user-meter): remove legacy authority machinery

- Remove shadow types: UserMeterWriteLeaseShadow (replaced by
  UserMeterWriteLeaseEntry without authority field)
- Remove listDoAuthorityWriteLeases, replaceLegacyWriteLeases, and
  assertWriteLeaseAuthority
- Remove authority discriminated union behavior from acquireWriteLease,
  releaseWriteLease, prepareWriteLeaseRepair, finalizeWriteLeaseRepair
- Keep warm authority column/shim for schema compatibility; code treats
  every row as authoritative DO; will drop after schema_version >= 7
- Simplify test-support/user-meter.ts to match: remove authority field
  from WriteLeaseRow, remove finalizeWriteLeaseRepair authority guard

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* refactor(parity): simplify deletion parity to meter-only, retire D1 lease query

- DeletionParity: drop d1ActiveLeaseCount/doAuthorityLeaseCount/doLegacyLeaseCount/
  tokenSetMismatches/temporaryMirrorRetired/mirrorLeaseParity; keep d1DeletingAt,
  meterDeletingAt, deletingAtParity, activeLeaseCount, truncated
- readDeletionParity: read D1 deleting_at + UserMeter deletingAt/countActiveWriteLeases;
  no D1 account_write_leases query
- admin-user-meter-parity: update deletionParitySchema, description, and keywords
  to match new DeletionParity type
- Tests: remove bootstrapDeletionState/UserMeterWriteLeaseShadow, rewrite to
  use meter.markDeleting and new parity shape; remove split-authority tests

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* test: update tests for UserMeter-only lease authority

- deletion-state.node.test.ts: rewrite for meter-only mark/list/repair;
  remove D1-only lease paths and waitUntil; add env-required tests; verify
  D1 deleting_at gate and races; add export/purge tombstone preservation test
- account-deletion.node.test.ts: acquire UserMeter lease to simulate active
  writer; verify deletion is blocked then proceeds after lease release
- user-meter.workers.test.ts: remove shadowAcquireWriteLease,
  listDoAuthorityWriteLeases, bootstrapDeletionState, authority field
- service.node.test.ts files: remove writeLeaseDb mock hooks; batch mock
  runs statements directly (no D1 account_write_leases queries on runtime path)

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* docs: update write-lease docs for DO-only authority (contract complete)

- account-write-lease-repair.md: remove legacy email / D1 lease paths;
  describe DO-only repair flow; note D1 account_write_leases quiescent
- data-storage.md: note authority column warm/ignored; all callers supply env;
  D1 account_write_leases quiescent; write-lease rows clear on release/repair/purge
- entitlements.md: rewrite Account-deletion write fencing section; mark contract
  complete 2026-08-03; remove split-authority/Phase-B/mirror-retired prose;
  update primitives table (activeLeaseCount replaces mirrorLeaseParity/doOnly)
- primitives.yaml: update User meter summary to reflect authoritative DO leases

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* style: apply formatter to modified source files

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* revert: stage lease path removal after email cutover

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

* style(email): format lease authority wiring

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.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.

2 participants