Skip to content

fix(gateway): prune retired quota state during reconciliation - #64

Merged
iamjr15 merged 1 commit into
mainfrom
fix/gateway-retired-quota-reconciliation
Jul 25, 2026
Merged

fix(gateway): prune retired quota state during reconciliation#64
iamjr15 merged 1 commit into
mainfrom
fix/gateway-retired-quota-reconciliation

Conversation

@iamjr15

@iamjr15 iamjr15 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prune only product-retired quota feature rows during lazy Durable Object reconciliation
  • preserve and structurally validate all current sandbox_hours and composio_calls data
  • perform pruning, strict-schema rebuild, version marking, and exact-schema verification in one rollback-safe transaction

Why

Production quota objects still contain dormant rows for quota features that were removed from the product. The exact-schema reconciler correctly rejected those rows, leaving /v1/me/usage, activity, and run admission unavailable. Earlier runtime code intentionally deleted these retired rows, so the forward migration must retain that product policy while continuing to reject malformed data.

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm build
  • pnpm --filter @cheatcode/gateway-worker typecheck
  • pnpm --filter @cheatcode/gateway-worker build
  • pnpm knip

Risk and rollback

The migration deletes only rows whose text feature key is outside the two current quota features. It validates current rows, proves their counts survive the rebuild, and runs entirely inside one Durable Object SQLite transaction. Any error rolls back the migration.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
cheatcode Skipped Skipped Jul 25, 2026 8:02am

@iamjr15
iamjr15 merged commit c2b8dd4 into main Jul 25, 2026
7 checks passed
@iamjr15
iamjr15 deleted the fix/gateway-retired-quota-reconciliation branch July 25, 2026 08:04
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