Skip to content

Complete client surfaces close-out: ADRs 274 and 277 accepted, the final retro, and the project files removed - #30816

Merged
wmadden merged 2 commits into
mainfrom
client-surfaces-closeout
Oct 21, 2026
Merged

wmadden merged 2 commits into
mainfrom
client-surfaces-closeout

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
export const contract = contractFromJson<Contract>(contractJson);
export const db = postgres({ contract, url, collections: { Post: PostCollection } });

await db.transaction(async (tx) => tx.orm.public.Post.published().forUpdate().all());
db.toSql(db.orm.public.Post.published().prepared.all().plan); // no database needed

The "Complete client surfaces" project is finished. This PR closes it out: ADRs 274 and 277 become Accepted, the final retro is recorded, one stale README line is fixed, and projects/client-surfaces/ is removed.

What the project delivered

Slice Pull request
Clients take a typed contract value from contractFromJson<Contract>(json); no client call names a type #30748 (TML-3602)
Every SQL client takes collections, used by db.orm, every tx.orm, serverless connections and Supabase role-bound clients #30776 (TML-3546)
A transaction offers the client's query members: sql, orm, raw, prepare, query, execute #30789 (TML-3603)
A client loads with no database, renders plans with toSql, runs them with query/execute, and takes mode #30802 (TML-3604)

Definition of done

  • orm init writes the new form. The template in packages/1-framework/3-tooling/cli/src/commands/init/templates/code-templates.ts uses contractFromJson and passes { contract } with no type argument on the client. Met.
  • The examples use custom classes through db.orm and inside transactions, with no createOrmClient and no hand-built orm(). A search of examples, READMEs, docs and skills finds none outside published upgrade guides, which are history. Met.
  • The demo's SQL can be printed with no database. examples/prisma-8-demo/test/print-sql.test.ts imports the real db.ts and checks the SQL of a custom class method's plan. Met.
  • Upgrade instructions move a db.ts to the new form and cover each slice's changed types (upgrade-instructions/pending/client-takes-contract-value, transaction-query-members, client-query-and-to-sql, and slice 2's). Met.
  • ADR 274 is Accepted and matches the shipped code. Accepted in this PR; slice 4's reviews checked it against the code. ADR 277, which records the rejected declaration-file approach, is Accepted too. Met.
  • TML-3546 is closed. All four tickets are Done. Met.

Changes in this PR

  • ADR 274 and ADR 277: status Proposed → Accepted.
  • drive/retro/README.md: the final retro.
  • examples/prisma-8-demo/README.md: the last user-facing postgres<Contract>({ contractJson, … }) becomes postgres({ contract, … }).
  • upgrade-instructions/pending/client-surfaces-demo-readme/: declares, for both audiences, that the README fix asks nothing of users (changes: []).
  • projects/client-surfaces/ deleted. Nothing outside it linked to it. Its decisions and alternatives already live in ADRs 274 and 277; the rest was coordination material.

Deferred work, now in Linear

Item Ticket
cursor on SQLite and Supabase TML-3682
MongoDB prepare and extensions TML-3683
Custom collection classes for MongoDB PRS-153 (existing, comment added)
Plan forms for create, update, delete TML-3684
Supabase pg option ignores a pg.Client TML-3685
mongoQuery({ contract }) does not validate TML-3686
enums and nativeEnums on Supabase role-bound clients TML-3687
One forRole(binding) object in SupabaseRuntime TML-3688
Members throw synchronously after close() TML-3345 (existing, comment added)
SqlExecutionStackWithDriver is misnamed TML-3689
RuntimeMode belongs in the framework TML-3690
Supabase close() and in-flight service-role work TML-3411 (existing, comment added)

Not filed: pool options on the serverless connect(). ADR 263 leaves them out on purpose; revisit if a user asks.

Found during the project and filed separately: TML-3655 (the SQL builder's insert type makes every column optional).

Retro, in short

  • A mechanical rewrite of call sites in docs needs a check per site, because README samples are not type-checked and db.execute(plan) accepts a plan that returns rows.
  • When a local branch built on a queued pull request meets that request's squash commit, keep the branch's side of each conflict after checking main's copy matches the base tip.
  • What worked: framing the static half of a client as the contract value, which removed the explicit type argument instead of working around it; independent system-design and code reviews; manual QA against a dev database.

Checks

pnpm lint, lint:docs, check:upgrade-coverage --mode pr and lint:rules:symlinks pass.

Agent: raskolnikov-51

Summary by CodeRabbit

  • Documentation
    • Accepted ADR 274, documenting typed contract values with inferred options.
    • Accepted ADR 277, documenting contract typing through contractFromJson.
    • Added a retro entry covering complete client surfaces, execution, conflict handling, events, review findings, and manual QA.
    • Updated the Prisma 8 troubleshooting example to use the current inferred client configuration for cache invalidation.
    • Added pending instruction documents for the client-surfaces demo’s application and extension areas.

…retro, demo README on the new client call, project folder removed

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner October 21, 2026 12:08
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: prisma/orm/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a49c4a7-3cc0-4166-bb0a-a75e4fbb7875
📥 Commits

Reviewing files that changed from the base of the PR and between dda01ea and e5ecbc2.

📒 Files selected for processing: 2
  • upgrade-instructions/pending/client-surfaces-demo-readme/app/instructions.md
  • upgrade-instructions/pending/client-surfaces-demo-readme/extension/instructions.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

📝 Walkthrough

Two ADRs changed from Proposed to Accepted. The Prisma example now passes the contract directly. A retrospective entry was added. Two pending instruction documents define empty change lists.

Changes: Client contract documentation

Layer / File(s) Summary
Contract decisions, example, retrospective, and instructions
docs/architecture docs/adrs/*, examples/prisma-8-demo/README.md, drive/retro/README.md, upgrade-instructions/pending/client-surfaces-demo-readme/*/instructions.md
The ADRs changed to Accepted. The example removes the Contract generic and contractJson option and passes contract directly. The retrospective records complete-client-surface work. Two instruction files add empty frontmatter with empty changes lists.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: tensordreams

Merge Risk: ⚪ Minimal · up to e5ecb

The documentation-only changes are mergeable.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: accepting ADRs 274 and 277, recording the final retro, and closing the client-surfaces project by removing its project files.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…needs no upgrade action

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden
wmadden enabled auto-merge October 21, 2026 12:21
@wmadden
wmadden added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 40459b3 Oct 21, 2026
20 checks passed
@wmadden
wmadden deleted the client-surfaces-closeout branch October 21, 2026 12:30
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