Harden API-cost production substrate and deployment gates - #1721
Draft
groupthinking with Copilot wants to merge 1 commit into
Draft
Harden API-cost production substrate and deployment gates#1721groupthinking with Copilot wants to merge 1 commit into
groupthinking with Copilot wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
16 tasks
Copilot
AI
changed the title
[WIP] Prove durable API-cost production substrate
Harden API-cost production substrate and deployment gates
Sep 8, 2026
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.
Canonical issue
Outcome
This PR makes the API-cost runtime and migration path explicitly production-safe: it requires a Cloud SQL-backed PostgreSQL substrate, enforces a narrow runtime role, blocks schema drift, and keeps delivery fail-closed when the protected preview/deployment conditions are not satisfied.
Scope
api_usage,daily_budgets, andwebhook_outboxRisk
Verification
pytest tests/unit/test_api_cost_database_substrate.py tests/unit/test_api_cost_migrate.py tests/unit/test_api_cost_schema.py tests/unit/test_api_cost_worker.py -qpytest tests/unit -q --no-covProduction evidence
Production evidence is intentionally limited to runtime policy and deployment gating. The implementation requires a Cloud SQL socket-backed PostgreSQL URL, a non-elevated runtime role with only the API-cost DML grants, and a separate migration path that reconciles grants after
alembic upgrade head. Preview delivery remains blocked until the protected bypass secret and exact-head deployment evidence are available; no live production delivery is enabled by this PR.Agent handoff