Back to Prisma

Brief: D1 R3 — narrow discovery to the requested filename

projects/prisma7-config/briefs/D1-R3.md

7.10.0-integration-fix-prisma-publish-token.13.2 KB
Original Source

Brief: D1 R3 — narrow discovery to the requested filename

Task

Address PR review feedback by removing unrequested automatic discovery for alternate Prisma 7 extensions and .config/ locations. Automatic Prisma 7 discovery must recognize exactly the root-level prisma7.config.ts, then delegate unchanged to c12's existing legacy prisma.config.* discovery when that exact file is absent. Keep explicit --config semantics unchanged. Also apply the review naming cleanup in the Bun E2E test.

Reduce the non-executing bootstrap selector to the same requested surface: prefer root prisma7.config.ts, otherwise preserve its pre-PR root prisma.config.ts behavior. Remove public/internal candidate-family machinery and tests that existed only for the unrequested extension/location expansion.

Scope

In:

  • packages/config/src/loadConfigFromFile.ts, its exports, and focused tests.
  • packages/cli/src/bootstrap/project-state.ts and its focused tests.
  • packages/client/tests/e2e/prisma-init-bun/tests/prisma7.config.test.ts test-description wording only.

Out: Init filename/guidance, exact-file precedence and hard-failure semantics, legacy c12 runtime behavior, explicit path behavior, compatibility E2E scenarios, project docs/review ledger, and unrelated cleanup.

Completed when

  • Automatic versioned discovery checks only <configRoot>/prisma7.config.ts; prisma7.config.js, other suffixes, and .config/prisma7.ts are not special automatic candidates.
  • Exact prisma7.config.ts wins over legacy discovery and its load/validation errors do not fall through.
  • When exact prisma7.config.ts is absent, runtime legacy discovery remains c12-backed and unchanged; explicit configFile remains authoritative.
  • Bootstrap recognizes/prefer exact root prisma7.config.ts, then root prisma.config.ts, without executing either; extension-family and c12-parity machinery added by this PR is removed.
  • Added exports that expose the unrequested candidate family are removed.
  • Bun E2E description reads prisma7.config.ts matches snapshot.
  • Focused config and bootstrap suites, package builds/typechecks as needed, lint/Prettier, diff check, and transient-ID scan pass; changes are staged and committed.

Operational metadata

  • Model tier: high — review correction crosses runtime discovery, bootstrap, and extensive tests; simplification must preserve legacy and explicit semantics.
  • Time-box: 60 minutes.
  • Halt conditions: Halt if exact-file loading cannot be implemented without changing legacy c12 behavior, if another package consumes the new candidate exports outside this PR, or if focused tests expose ambiguity about .config/ support.

Carry-over

Human review on packages/config/src/loadConfigFromFile.ts asks why alternate extensions were added and states they were not requested. Treat this as a settled design correction: only root prisma7.config.ts receives special automatic discovery. CodeRabbit separately requests removal of “should” from the Bun snapshot test description.

Return shape

Report exact simplifications, tests retained/removed/added, validation, commit SHA, and surprises. Write heartbeat; do not edit project/review artifacts, amend, push, or reply on GitHub.