Back to Prisma

Brief: D1 R1 — establish versioned discovery semantics

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

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

Brief: D1 R1 — establish versioned discovery semantics

Task

Change @prisma/config automatic discovery so the complete supported prisma7.config.* family at the project root, then .config/prisma7.*, is authoritative before the existing legacy prisma.config.* / .config/prisma.* behavior. Preserve exact explicit configFile semantics and existing path transformation. The implementation must distinguish family absence from selected-file load/parse/validation failure so a broken Prisma 7-specific config never falls through to a valid legacy file.

Scope

In: packages/config loader implementation, internal/exported candidate-selection surface if required for the later bootstrap consumer, config fixtures, and loadConfigFromFile tests. Error attribution for Prisma 7-specific filenames is in scope.

Out: CLI bootstrap consumption, init generation, completion/help/migrate/internals guidance, packed E2E changes, Prisma 8 behavior, dependency upgrades, fallback warnings, and config-content conversion.

Completed when

  • Tests prove every supported JS/TS extension is discoverable under both versioned locations and that documented root/location/family precedence is deterministic.
  • Tests prove explicit configFile remains authoritative, an invalid selected Prisma 7 config hard-fails beside a valid legacy config, and legacy/default fallback remains unchanged and warning-free when the versioned family is absent.
  • Relative schema, migrations, Typed SQL, and views paths still resolve from whichever config file was selected; error results identify the selected Prisma 7 path.
  • pnpm --filter @prisma/config build and pnpm --filter @prisma/config test loadConfigFromFile.test.ts pass; affected files are formatted; git diff --check and the transient-ID scan are clean.
  • The implementation and tests are committed with explicit staging and an intent-driven commit message.

Standing instruction

Stay focused on the goal; control scope. Trivial-and-related fixes that obviously serve the goal go in the same dispatch with a one-line note in your wrap-up message. Anything that pulls you off the goal — even if it looks useful — halts and surfaces.

References

  • Slice spec: projects/prisma7-config/slices/versioned-config-coexistence/spec.md.
  • Slice plan: projects/prisma7-config/slices/versioned-config-coexistence/plan.md § Dispatch 1.
  • Project spec: projects/prisma7-config/spec.md.
  • Review log: projects/prisma7-config/reviews/code-review.md (read-only for implementer).
  • Repository guidance: AGENTS.md.

Operational metadata

  • Model tier: orchestrator — config discovery precedence and failure semantics are load-bearing and c12 behavior needs careful investigation.
  • Time-box: 60 minutes wall clock. Overrun halts and surfaces rather than silently extending.
  • Halt conditions: Halt if the agreed precedence cannot be implemented without a dependency upgrade; if completing runtime discovery requires touching an out-of-scope CLI consumer; if a public API expansion is necessary but cannot be kept narrowly candidate-selection-specific; if the spec's assumptions about c12 or supported locations are false; or if any named gate cannot run or remains red for an unrelated reason.

Carry-over

None — first dispatch and first round.

Return shape

Report reconnaissance, decisions, diff highlights with paths, every validation command/result, commit SHA(s), surprises, deferral requests, and pushback. Do not edit project specs/plans/reviews. Write heartbeats to wip/heartbeats/implementer.txt per the implementer protocol.