Skip to content

v8.0.0-rc.9-dev.4

@StevenMcClankerton StevenMcClankerton tagged this 10 Sep 15:45
Expose inspectable attribute combinators so tooling can consume the same
grammar used by PSL interpretation, without maintaining a second
descriptor tree.

## Changes

- **Parser API:** replace open argument kinds with a closed
discriminated union exposing fixed values, collection children, union
alternatives, and function signatures. Optional wrappers preserve
metadata and output types.
- **Context safety:** distinguish local and referenced field arguments
and enforce mixed-alternative/nested-wrapper placement constraints
through TypeScript parse-context inference only; no runtime context tags
or reducers are part of the metadata surface.
- **Family evidence:** use actual SQL/Mongo factories to verify dynamic
defaults, index signatures, references, and non-completable empty-enum
rejection.

## Why

The combinators already describe accepted grammar. Exposing that
structure directly keeps interpretation and future editor consumers
aligned without parsing labels or hardcoding family-specific signatures.

**Scope:** first of three attribute-autocomplete slices. No
language-server completion behavior, accepted PSL syntax, contract
emission, or runtime changes.

## Verification

- Parser, SQL PSL, and Mongo PSL tests/typechecks/lint passed during
implementation; independent review passed all five slice criteria.
- Full package testing repeatedly hit known concurrent tarball/prepack
skill-sync filesystem flakes. All three affected suites passed
individually; the operator accepted this specific exception. The full
suite is **not** reported green.
- After fetching `origin/main`: `pnpm build` (85 tasks), `pnpm
typecheck` (166 tasks), and `pnpm lint:deps` passed. Parser/SQL/Mongo
lint passed; parser lint's 31 informational findings do not fail the
command (verified exit 0).
- The language server reports unresolved internal imports, but package
typechecking passes and compiler resolution tracing resolves both parser
entrypoints to their built declarations. No source suppressions were
added.

**Manual QA:** N/A for editor behavior: this slice changes inspectable
grammar metadata, not user-observable PSL behavior. Actual
contribution-consumer metadata is covered by family factory tests.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Improved attribute specification typing and validation for strings,
numbers, lists, references, records, JSON, function calls, and unions.
* Attribute metadata now more accurately reflects configured
constraints, defaults, alternatives, reference kinds, and nested
structures.
* List specifications now use clearer empty-list controls while
preserving uniqueness and non-empty validation.
* Enhanced context handling improves validation across model- and
field-level specifications.
* SQL enum exclusions now provide clearer rejecting behavior and
diagnostics.
* **Tests**
* Expanded coverage for metadata preservation, parsing contexts,
optional values, and database-specific attribute specifications.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Co-authored-by: Steven McClankerton <tatarintsev@prisma.io>
Assets 2
Loading