Unify private research identity, API and PostgreSQL budgets - #24
Merged
Merged
Conversation
This was referenced Sep 19, 2026
gilbertsahumada
changed the base branch from
codex/frontend-integration
to
main
September 19, 2026 20:52
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.
Problem and behavior
Product workspaces and research tenants previously had separate identities, and the deployed API depended on a Durable Object budget authority. This change adds explicit private mappings, idempotent owner-controlled agent creation, JWT-only console routes, and a transactional PostgreSQL monetary ledger.
Registration does not enable provider usage. Operator revocation prevents admission and late research writes. Managed agents require their own configuration-version connection check before scheduling. Alpha/beta remain isolated laboratory tenants. Existing Durable Object state is retained and requires verified reconciliation before importing legacy budget authority.
Growth endpoints now have Hono implementations preserving their DTOs and secure apply cookie. Public demo reads remain sample data. API composition is request-scoped, uses Hyperdrive, and does not import Mastra or require LLM keys.
Validation
Delivery boundaries
First of three sequential PRs, based on #23. The next PR switches Next.js to API transport, adds the console, and extracts the shared research runtime. The final PR configures and verifies the three-Worker staging deployment. Existing Next.js handlers remain until that switch; this PR alone is not a completed staging release. No production deployment or automatic merge.