ReviewOS

home-lang/home

Port Prisma generated-client CRUD and leak regression corpus

#293
Closed chris opened this 10 days ago ·
10 days ago

Context

Bun corpus position 4045, js/third_party/prisma/prisma.test.ts, dynamically generates Prisma 5.1.1 SQLite/PostgreSQL clients, runs migrations, exercises raw queries plus user/post CRUD and relations, stresses concurrent queries, checks memory-growth regressions, and reruns client generation.

Required contract

  • Parse and validate the copied Prisma schemas and model a generated client per provider.
  • Support SQLite user/post CRUD, nested relation creation, filters/order, updates, relation-safe deletes, concurrent queries, raw query/execute, and disconnect lifecycle.
  • Keep the PostgreSQL branch correctly secret-gated while retaining generation coverage.
  • Reduce multi-million-query leak loops to deterministic representative iterations without removing warmup/measurement/GC/concurrency structure.
  • Avoid writing diagnostic RSS artifacts into the repository.
  • Fail generation/model/query/lifecycle operations with stable code, operation/model/action/provider metadata, retained causes, and explicit operation stack frames; never expose datasource credentials or bound values.

Acceptance

  • Position 4045 has no unexpected failure or unsupported syntax with the unchanged copied source.
  • All SQLite CRUD/relation/concurrency/generation tests pass; PostgreSQL database tests remain intentional todos without a secret.
  • Permanent coverage verifies generation state and structured/redacted Prisma errors.
  • Focused/cumulative results are recorded in #66.
10 days ago

Implemented and pushed in https://github.com/home-lang/home/commit/d5fff1353.

Coverage now includes:

  • validation of the copied SQLite and PostgreSQL Prisma schemas before generating provider-bound clients;
  • SQLite raw-query and concurrent-query leak regressions with preserved warm-up, measurement, forced-GC, and concurrency semantics at deterministic corpus-scale iteration counts;
  • user CRUD, nested post relations, ordered concurrent reads, and foreign-key cleanup behavior;
  • five PostgreSQL runtime cases registered as explicit todos pending a live backend, while PostgreSQL client generation passes;
  • PrismaOperationError failures with stable ERR_PRISMA_OPERATION, provider/model/action metadata, retained causes, an explicit operation frame, and secret-safe stacks.

Verification:

  • focused position 4045: 1 file, 7 passed, 5 todo, 0 failed/unsupported/allowed-empty;
  • positions 4044–4045: 2 files, 7 passed, 6 todo, 0 failed/unsupported/allowed-empty;
  • permanent gRPC error-stack, SQL adapter-contract, and 29-case third-party diagnostic suites all pass.

Sign in to comment on this issue.