Repository navigation
Release 0.15.0 - #91
Merged
Merged
Conversation
Revision 3 of the boundary spec records the corrections from mapping it against the 0.14.0 code and the decisions taken while planning.
…g columns to tenants
The Stripe webhook, the trial cron and the register trial now also write the entitlements column, derived from the legacy plan row. Nothing reads it yet. The cron and the register trial write it only while legacy billing is active.
describeTarget now throws unless the URL names host, port and database explicitly and has no host, hostaddr, port, dbname or service query parameter, so the printed and confirmed target is where pg really connects. The database name and host are printed decoded. The CLI argument checks move into parseBackfillArgs so they can be tested; it also accepts --dry-run and rejects --dry-run with --apply and --confirm without --apply. The CLI checks every column planBackfill reads, including asset and user. Tests cover assertColumns, qualified and parseBackfillArgs; the DB test measures limits against active users.
Phase 1a of the SaaS boundary: changelog entry with upgrade notes for the entitlements backfill, debt register cross-reference in item 8a, and the version bump to 0.15.0.
- describeTarget requires the postgres: or postgresql: scheme (pg reads socket: URLs differently) and rejects a percent escape in the host or database name when the string holds a space or a malformed escape, the case where pg-connection-string re-encodes the whole string. - applyBackfill only updates a row while plan, maxAssets and maxUsers still equal what planning read, so a row changed in between is skipped. - planBackfill classifies stored entitlements against the strict schema; the summary line gains an invalid count, and invalid values are never overwritten. The summary is now a tested pure function. - The credential leak assertions pair .not.toThrow with a positive toThrow on the same call.
bun build compiles scripts/backfill-entitlements.ts without running it, so a broken @/ alias in the script fails the type check job instead of the production run.
…guide - CHANGELOG: enforcement is unchanged apart from the API change, one fenced command per block with the flag rules after them, all rejected DATABASE_URL parameters, the SQL route for per-organization entitlements, the invalid count, the full gate 1a to 1b list and the migration order for Preview. - TECHNICAL_DEBT: item 81 records the response-level test gap on the organization routes and that the backfill has never run under Bun. - DEVELOPER_GUIDE: entitlements and lockedAt on the Organization model.
- 1a plan: describeTarget's interface line and the quoted db-target code and test now match the committed files (scheme, explicit port, rejected query parameters, percent rule; no default port). - 1b task-02 and task-13: the quoted before-blocks of the register route and the organizations route match the committed files, indentation included (marked prettier-ignore so the formatter keeps it), and the nested register test replacement is described as nested. - 1b task-05 and task-18: explicit-port DATABASE_URL for the cut-over script; the gate also needs "invalid":0; the new debt items start at 82 because 1a took item 81.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Release 0.15.0: phase 1a of the SaaS boundary
(
docs/superpowers/specs/2026-10-05-saas-boundary-design.md, plandocs/superpowers/plans/2026-10-12-saas-boundary-1a.md). The database gains the columns thecontrol plane will drive, and the legacy billing code starts recording entitlements. Nothing
reads the new columns yet, so enforcement is unchanged.
Merging deploys production, and the production build runs
prisma migrate deploy: oneadditive migration (
20261012_org_entitlements_locked_at, two nullable columns, no default,no backfill) on the shared database.
Changes
Full detail and upgrade notes:
CHANGELOG.md, section 0.15.0.organizations.entitlements(JSONB) andorganizations.lockedAt(timestamp), both nullable.GET/POST /api/organizationsandGET/PUT /api/organizations/[id]return an allow-listof fields: no more
plan, Stripe ids,trialEndsAt,maxAssets,maxUsersorsuspendedAtfor org admins, and never the new columns.entitlementsalongsidethe legacy plan columns while Stripe is configured.
scripts/backfill-entitlements.ts: maps each org's legacy plan to entitlements. Dry run bydefault, explicit
--schema, printed target,--apply --confirm "<target>", never touchesrows that already hold a value, skips a row whose plan changed since planning, reports
invalid stored values.
Before merging
developmentfail on organization reads until this release hasmigrated the shared database (they run 0.15.0 code against the old schema).
After deploying (production database only)
SELF_HOSTEDvalue:bun scripts/backfill-entitlements.ts --schema public --deployment-self-hosted <true|false>currentAccess,proposed,losesFeatures, usage,overLimit), then apply with the printed target:... --apply --confirm "46.62.169.116:5432/postgres/public""unset":0and"invalid":0.Verification
development(cf140e6) green, including theDB-backed backfill tests against a throwaway Postgres (5/5) and the Bun bundle check.
🤖 Generated with Claude Code