Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

feat(framework): extract assembly, add Mongo control plane - #288

Merged
wmadden merged 53 commits into
mainfrom
tml-2181-build-mongo-psl-interpreter-and-wire-into-demo-app-m3-task-39
Apr 3, 2026
Merged

wmadden merged 53 commits into
mainfrom
tml-2181-build-mongo-psl-interpreter-and-wire-into-demo-app-m3-task-39

Conversation

@wmadden

@wmadden wmadden commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

closes TML-2182

Walkthrough — Tasks 3.9 + 3.10 + 3.12 + 3.13

Key snippet

Before — assembly trapped in SQL family

// packages/2-sql/3-tooling/family/src/core/assembly.ts
// These functions operate on framework-level ComponentMetadata, but live in the SQL package.
// A second family (Mongo) cannot reuse them without depending on the SQL family.
export function extractCodecTypeImports(descriptors: ...) { ... }
export function extractOperationTypeImports(descriptors: ...) { ... }
export function extractParameterizedRenderers(descriptors: ...) { ... }
export function assembleAuthoringContributions(descriptors: ...) { ... }

After — assembly is framework-level, families just compose

// Any family creates a fully assembled control stack in one call:
import { createControlStack } from '@prisma-next/framework-components/control';

const controlStack = createControlStack({
  family: mongoFamilyDescriptor,
  target: mongoTargetDescriptor,
});
// controlStack carries both descriptors AND aggregated metadata
// (type imports, renderers, authoring contributions, extension IDs)

const instance = mongoFamilyDescriptor.create(controlStack);

Intent

Establish @prisma-next/framework-components as the single canonical source for all framework component types, assembly logic, and stack creation across both control and execution planes. Introduce a Mongo control plane that proves the framework assembly path works end-to-end. Unify the control-plane stack so callers work with a single struct instead of managing two parallel representations.

Change map

The story

  1. Extract family-agnostic assembly into the framework. The extract*() functions and assembleAuthoringContributions() were SQL-family implementation details but operated on framework-level types. Moved them to a new @prisma-next/framework-components package with a ./control subpath.

  2. Build a Mongo control plane. Created @prisma-next/family-mongo at layer 9 with mongoFamilyDescriptor (singleton), mongoTargetDescriptor (spreads identity from @prisma-next/target-mongo), and a private MongoFamilyInstance class. The Mongo demo's generate-contract.ts calls the control plane for contract emission, closing the ContractIR → emitter → runtime loop.

  3. Absorb execution-plane types. @prisma-next/core-execution-plane had drifted from its name — it contained framework component types, not runtime pipeline logic. Moved all source files into framework-components/execution and converted the original package to a re-export shim.

  4. Eliminate the contract → framework-components dependency inversion. Migrated ~65 consumers of @prisma-next/contract/framework-components to import from @prisma-next/framework-components/{components,authoring} directly, deleted the re-export module and the dependency from contract.

  5. Move control-plane descriptor/instance/result types to framework-components. ControlFamilyDescriptor, ControlFamilyInstance, ControlDriverInstance, VerifyDatabaseResult, EmitContractResult, and related types moved from @prisma-next/core-control-plane/types.ts to framework-components/control. Introduced dependency-inverted capability interfaces (MigratableTargetDescriptor, SchemaViewCapable) with type predicates so framework-components has no knowledge of migrations or schema views. Converted core-control-plane/types.ts and config/types.ts to re-export shims.

  6. Unify ControlStack with ControlPlaneStack. Extended ControlStack to carry both component descriptors (family, target, adapter, driver, extensions) and aggregated metadata (type imports, renderers, authoring contributions). Changed ControlFamilyDescriptor.create() to accept a single ControlStack argument. Deprecated ControlPlaneStack as a Pick<ControlStack, ...> alias. Eliminated the as never cast from the Mongo demo.

Behavior changes & evidence

Compatibility / migration / risk

  • No breaking changes for downstream consumers. All moved types are re-exported from their original locations via shims. Existing import paths continue to resolve.
  • ControlPlaneStack is deprecated. The type alias works but should be migrated away from in future tasks.
  • framework-components depends on @prisma-next/contract. This is a new dependency (for ContractIR, ContractMarkerRecord, TargetFamilyHook). It's correct directionally — both are 1-core/shared peers. Task 5.11 plans to move contract to 0-foundation, making this a downward dependency.
  • SQL family duplicates assembly. createSqlFamilyInstance() re-calls all extract*() functions on descriptors that createControlStack() already processed. Expected interim state — task 5.8 will restructure the SQL family to read from ControlStack directly.

Follow-ups / open questions

  • F05: Inline AssembledAuthoringContributions into ControlStack (cosmetic).
  • F12: Generalize PSL interpretation and mutation default assembly when Mongo PSL interpreter needs them (task 3.11).
  • F14: Consolidate TypesImportSpec/RenderTypeContext duplication (task 5.11).
  • Task 5.8: Control flow inversion — SQL family reads from ControlStack aggregations instead of re-calling extract*().
  • Task 5.11: Remove re-export shims, migrate remaining consumers to canonical framework-components imports.
  • N03: Mongo family imports from core-control-plane/types shim rather than canonical framework-components/control.

Non-goals / intentionally out of scope

  • Migrating the ~60 consumers of core-control-plane/types to import from framework-components/control directly (deferred — shims provide backward compat).
  • SQL family control-flow inversion (task 5.8).
  • Mongo PSL interpreter (task 3.11).
  • Emission SPI extraction from contract (task 5.11).

Summary by CodeRabbit

  • New Features

    • Added @prisma-next/framework-components package for composing control stacks with families, targets, adapters, drivers, and extensions
    • Introduced Mongo family descriptor for MongoDB support
    • Added control-stack assembly utilities for execution and control plane integration
  • Documentation

    • Added architecture glossary entries (Plane, Descriptor, Instance, Stack, Contract IR, Emission, Framework Component)
    • Added package README and API documentation
  • Chores

    • Reorganized framework component definitions into centralized package
    • Updated internal import paths across codebase

wmadden added 30 commits April 3, 2026 06:35
…trol flow inversion)

Task 3.9: extract family-agnostic assembly from SQL family package
into @prisma-next/contract/assembly, build Mongo family package at
layer 9 using the inverted pattern (framework drives assembly).

Task 3.11: complete the inversion for SQL — framework orchestration
(ControlClient, CLI) calls assembleComponents() and emit() directly,
move SQL family package to layer 9.

Detailed plans in projects/contract-domain-extraction/plans/.
…ssembly

Move extractCodecTypeImports, extractOperationTypeImports,
extractQueryOperationTypeImports, extractExtensionIds,
extractParameterizedRenderers, extractParameterizedTypeImports,
assembleAuthoringContributions, and supporting helpers from the SQL
family package into the framework contract package.

Add assembleComponents() with structured input (family, target,
adapter?, extensionPacks?) and AssembledComponentState output.

Export via @prisma-next/contract/assembly subpath.
Replace local assembly function definitions with re-exports from
@prisma-next/contract/assembly. Update extractExtensionIds call sites
to use the new (family, target, adapter, extensions) signature.

SQL-specific functions (assembleOperationRegistry, extractCodecControlHooks,
mutation defaults, PSL interpretation) remain in the SQL package.
Create @prisma-next/family-mongo with MongoFamilyDescriptor,
createMongoFamilyInstance, and mongoTargetDescriptor. The descriptor
uses the inverted control-flow pattern: assembledState is passed in
by the caller rather than assembled internally.

Update ControlFamilyDescriptor.create to accept optional
assembledState parameter. Register the package in
architecture.config.json at the family layer.
Replace direct emit() call with MongoFamilyDescriptor +
assembleComponents() + emitContract() flow, demonstrating the
inverted control-flow pattern. Remove direct emitter/mongo-emitter
dev dependencies in favor of @prisma-next/family-mongo.
…ntrolHooks, note assembledState required in 5.8

- Remove review artifacts from git tracking (local-only)
- Add .gitignore entries for review artifact filenames
- 3.9 plan: move extractCodecControlHooks to SQL-specific list
  (operates on TargetBoundComponentDescriptor<sql>)
- 3.9 plan: correct plane from "shared" to "migration"
- 5.8 plan: note that assembledState should become required
  once SQL family is migrated
The family package at layer 9 is a top-level entry point that nothing
should import from. Placing it at the end of the layer order enforces
this invariant.
The function collects IDs from all component types (family, target,
adapter, extensions), not just extensions. The new name accurately
reflects its behavior.
Remove re-exports of framework assembly functions from
packages/2-sql/3-tooling/family/src/core/assembly.ts (non-exports
folder). Update test-utils.ts to import from @prisma-next/contract/assembly.
Remove unused NormalizedTypeRenderer import.
The helper was defined identically in both the framework assembly
and SQL assembly. Export from @prisma-next/contract/assembly and
import in the SQL package to eliminate duplication.
Move raw string template, raw function, structured function,
CodecTypes interpolation, and missing-parameter tests from the SQL
assembly test into the framework assembly test. Delete the SQL
assembly.test.ts since all its tests are now covered at the
framework level (extractCodecTypeImports and extractComponentIds
were already duplicate coverage).
Cover MongoFamilyDescriptor.create (missing state throws, valid state
returns instance), descriptor shape, mongoTargetDescriptor shape, and
stub methods throwing not-implemented errors.
Document why the double cast (MongoContract -> unknown -> ContractIR)
and the emitContract contractIR cast are safe.
Add a new M5 task to extract component descriptors, assembly,
authoring types, and emission SPI types from @prisma-next/contract
into a dedicated @prisma-next/framework-components package. Introduces
a foundation layer below core, making contract a true leaf package
with zero framework-domain dependencies (Clean Architecture DIP).
- assembly.ts: import authoring types from framework-authoring (not
  framework-components, which no longer re-exports them after the
  base branch restructured authoring types)
- SQL exports/control.ts: re-export assembleAuthoringContributions
  from @prisma-next/contract/assembly (removed from core/assembly)
- SQL emitter tests: import extractCodecTypeImports and
  extractOperationTypeImports from @prisma-next/contract/assembly
  (removed re-exports from SQL core/assembly)
Task 3.10 extracts @prisma-next/framework-components, renames
assembly to createControlStack()/createExecutionStack(), and wires
the Mongo demo through both planes. Tasks 5.8 and 5.11 now list
3.10 as a prerequisite and reference the new naming/package. The
old 3.10 (Mongo PSL interpreter) is renumbered to 3.11.
New framework-level package for component types, authoring logic,
assembly, and stack creation. Will receive code moved from
@prisma-next/contract in subsequent commits.
Copy framework-components.ts and framework-authoring.ts from
@prisma-next/contract into @prisma-next/framework-components,
updating the types import to use @prisma-next/contract/types.
Create barrel exports for ./components and ./authoring subpaths.
Rename assembleComponents -> createControlStack,
AssembledComponentState -> ControlStack,
AssembleComponentsInput -> CreateControlStackInput.
Update imports to use @prisma-next/contract/types for TypesImportSpec.
Copy ExecutionStack, ExecutionStackInstance, createExecutionStack,
and instantiateExecutionStack from @prisma-next/core-execution-plane
into @prisma-next/framework-components with import path updates.
Contract package re-exports assembly and framework-components from
@prisma-next/framework-components with old names mapped.
Execution-plane re-exports stack from the new package.
Delete original source files from contract package.
Replace exported MongoFamilyDescriptor class with a private class
and exported const mongoFamilyDescriptor singleton value.
Replace the object-literal factory with a private MongoFamilyInstance
class for cleaner encapsulation of assembled state.
…onents

Update Mongo family to import ControlStack from the new package.
Update demo generate-contract.ts to use createControlStack and
mongoFamilyDescriptor const value.
Move test files from @prisma-next/contract to
@prisma-next/framework-components, updating imports to use
local src paths and renamed functions.
wmadden added 15 commits April 3, 2026 06:55
…ontrolPlaneStack divergence, use Framework Component term
Move all execution-plane types, stack functions, and requirements check
into framework-components/src/execution-*.ts, split types.ts into
execution-instances.ts and execution-descriptors.ts for clarity.

Add ./execution subpath export. Convert core-execution-plane to a
backward-compatible re-export shim pointing at framework-components/execution.
Update all imports to use @prisma-next/framework-components/{components,authoring}
directly. Delete the contract/framework-components re-export module and
remove framework-components from contract dependencies.

This breaks the dependency inversion: contract no longer depends on
framework-components.
Move TypeRendererTemplate, TypeRendererFunction, TypeRenderer,
NormalizedTypeRenderer, interpolateTypeTemplate, normalizeRenderer into
type-renderers.ts. Move RenderTypeContext from types.ts into
type-renderers.ts where it belongs (with renderers).

framework-components.ts retains component descriptors, metadata, and
requirements checking. TypesImportSpec stays in types.ts.
…es (F06)

Delete the ad-hoc AssemblyInput interface. CreateControlStackInput and
all extract* functions now accept ComponentDescriptor<string> directly.
Add queryOperationTypes to ComponentMetadata.types to match the field
already used by extension descriptors (e.g. pgvector).
…F02/F10, F09)

Update the as-never cast TODO in generate-contract.ts to reference F13
stack consolidation. Deduplicate mongo-target-descriptor.ts by spreading
from @prisma-next/target-mongo meta instead of redeclaring identity fields.
Task 3.12 (core-execution-plane absorption + contract/framework-components
consumer migration) is now done. Note F12 for task 3.11, F13 for a
follow-up pass.
The extract* functions in control-stack.ts only access types? and id,
not kind/version. Use Pick<ComponentMetadata, 'types'> as the
parameter type so callers with intermediate descriptor types
(SqlControlDescriptorWithContributions) can pass them directly.
CreateControlStackInput still requires full ComponentDescriptor types.
Move ControlFamilyInstance, ControlTargetDescriptor, ControlPlaneStack, and
result types from core-control-plane into framework-components as the canonical
home. core-control-plane and config become re-export shims.

Extract migrations and schema-view into dependency-inverted capability
interfaces (MigratableTargetDescriptor + hasMigrations, SchemaViewCapable +
hasSchemaView) so framework-components stays free of migration/view domain
knowledge. Update CLI consumers to use type predicates.
Extend ControlStack<TFamilyId, TTargetId> with descriptor fields (family,
target, adapter, driver, extensionPacks) so it subsumes ControlPlaneStack.
ControlPlaneStack becomes a deprecated Pick type alias.

Change ControlFamilyDescriptor.create() from dual-arg (stack, controlStack?)
to single-arg (controlStack) since ControlStack now carries both descriptors
and aggregated metadata. Update all family implementations and call sites.

Remove the as-never cast from the Mongo demo generate-contract script.
Re-export createControlStack from framework-components through
core-control-plane. Mark createControlPlaneStack as deprecated while
keeping it functional for backward compatibility.
@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Created a new @prisma-next/framework-components package consolidating framework/component/control/execution types, control-stack assembly, type-renderer utilities, and runtime guards. Replaced many local type/stack implementations and re-exports across framework, tooling, families, targets, examples, and tests to import from this new package; added a Mongo family package and updated tests/fixtures.

Changes

Cohort / File(s) Summary
New package: framework-components
packages/1-framework/1-core/shared/framework-components/*
Added new package with control/execution descriptors & instances, control-stack (createControlStack), execution-stack, type-renderers, TypesImportSpec, assembly helpers, runtime guards, and comprehensive tests.
Control-plane type migration
packages/1-framework/1-core/migration/control-plane/src/..., packages/1-framework/1-core/shared/config/src/types.ts
Replaced many local control types with re-exports from @prisma-next/framework-components/control; added ControlStack/createControlStack, hasMigrations, hasSchemaView; deprecated createControlPlaneStack.
Execution-plane consolidation
packages/1-framework/1-core/runtime/execution-plane/src/*
Removed local ExecutionStack/types and runtime-check impls; now re-export types and functions from @prisma-next/framework-components/execution and runtime assertion from framework-components.
Contract package cleanup
packages/1-framework/1-core/shared/contract/*
Removed ./framework-components export subpath and its re-export barrel; consumer code updated to import from new framework-components package.
Add Mongo family package
packages/2-mongo-family/9-family/*, examples/mongo-demo/*
New @prisma-next/family-mongo package: mongoFamilyDescriptor, family instance factory, mongoTargetDescriptor; example updated to use createControlStack and updated contract hashes.
Tooling & CLI updates
packages/1-framework/3-tooling/cli/src/**, test/integration/test/*
Replaced createControlPlaneStack calls with createControlStack({ family, ... }); switched migration capability checks to hasMigrations(...); updated many imports and test fixtures to use control-stack composition.
Type-import/path migrations
numerous packages (authoring, sql, targets, extensions, tests) e.g. packages/2-sql/**, packages/3-targets/**, packages/3-extensions/**
Systematic refactor of type-only imports to @prisma-next/framework-components/{authoring,components,control,execution} and added package dependencies where needed.
Assembly & extraction relocation
packages/2-sql/3-tooling/family/src/core/*, packages/2-sql/3-tooling/family/src/exports/*
Moved/removed local extraction helpers; now use extract* and assembleAuthoringContributions from @prisma-next/framework-components/control; adjusted exports and tests accordingly.
Tests & CI inputs
packages/1-framework/.../test/*, packages/1-framework/.../tsdown.config.ts, test/integration/*
Updated or added many tests to validate control-stack, execution stack, runtime guards, and family behavior; tsdown/tsconfig entries adjusted to include new package exports.
Repository metadata & docs
.gitignore, architecture.config.json, docs/glossary.md
Added review-artifact ignores; registered mongo family layer in architecture config; expanded glossary with Framework Component, Contract IR, Emission, Plane/Stack/Descriptor/Instance concepts.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer Script
  participant Stack as ControlStack (createControlStack)
  participant Family as FamilyDescriptor
  participant Instance as FamilyInstance
  participant Emitter as Emit Pipeline

  Dev->>Stack: createControlStack({ family, target, adapter, driver?, extensionPacks? })
  Stack->>Family: passed into family.create(stack)
  Family->>Instance: create(stack) -> returns FamilyInstance
  Dev->>Instance: instance.emitContract({ contractIR })
  Instance->>Emitter: emit(contractIR, codecImports, renderers, ids)
  Emitter-->>Dev: { contractJson, contractDts, storageHash, profileHash }
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • jkomyno

Poem

🐰 Hooray! I hopped through code and found a nest,
Types gathered tidy, no more scattered mess,
Stacks assembled, renderers primed,
Guards in place — the build's aligned! 🥕✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2181-build-mongo-psl-interpreter-and-wire-into-demo-app-m3-task-39

@pkg-pr-new

pkg-pr-new Bot commented Apr 3, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/runtime-executor

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/runtime-executor@288

@prisma-next/mongo-core

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-core@288

@prisma-next/mongo-orm

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-orm@288

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-runtime@288

@prisma-next/family-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/family-mongo@288

@prisma-next/sql-runtime

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-runtime@288

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-paradedb@288

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-pgvector@288

@prisma-next/postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/postgres@288

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-orm-client@288

@prisma-next/target-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/target-mongo@288

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/adapter-mongo@288

@prisma-next/driver-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/driver-mongo@288

@prisma-next/contract-authoring

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract-authoring@288

@prisma-next/contract-ts

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract-ts@288

@prisma-next/ids

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/ids@288

@prisma-next/psl-parser

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/psl-parser@288

@prisma-next/psl-printer

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/psl-printer@288

@prisma-next/cli

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/cli@288

@prisma-next/emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/emitter@288

@prisma-next/migration-tools

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/migration-tools@288

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/vite-plugin-contract-emit@288

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-emitter@288

@prisma-next/sql-contract

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract@288

@prisma-next/sql-errors

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-errors@288

@prisma-next/sql-operations

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-operations@288

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-schema-ir@288

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-psl@288

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-ts@288

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-emitter@288

@prisma-next/family-sql

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/family-sql@288

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-lane-query-builder@288

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-relational-core@288

@prisma-next/sql-builder

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-builder@288

@prisma-next/target-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/target-postgres@288

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/adapter-postgres@288

@prisma-next/driver-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/driver-postgres@288

@prisma-next/core-control-plane

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/core-control-plane@288

@prisma-next/core-execution-plane

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/core-execution-plane@288

@prisma-next/config

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/config@288

@prisma-next/contract

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract@288

@prisma-next/framework-components

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/framework-components@288

@prisma-next/operations

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/operations@288

@prisma-next/plan

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/plan@288

@prisma-next/utils

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/utils@288

commit: 554199a

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/1-framework/1-core/migration/control-plane/src/stack.ts (1)

1-27: 🛠️ Refactor suggestion | 🟠 Major

Remove the parallel stack constructor instead of keeping both surfaces alive.

createControlStack() and createControlPlaneStack() are not equivalent: the new stack carries assembled state, while the legacy wrapper still returns the older, smaller shape. Keeping both here will keep downstream code pinned to the deprecated API and makes src/stack.ts act as a compatibility shim.

As per coding guidelines, "Never add backward-compatibility shims; update call sites instead", "packages/**: Do not add backward-compatibility shims ... remove old code entirely instead of preserving it with backward-compatibility shims", and "Do not reexport things from one file in another, except in the exports/ folders."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/1-framework/1-core/migration/control-plane/src/stack.ts` around
lines 1 - 27, The file currently re-exports createControlStack while also
defining a deprecated createControlPlaneStack shim; remove the legacy shim so
only the new surface remains: delete the createControlPlaneStack function and
its JSDoc, remove or adjust the now-unused type imports (ControlPlaneStack and
any types used solely by the removed function), and keep the export {
createControlStack } from '@prisma-next/framework-components/control'; ensure no
other declarations referencing createControlPlaneStack remain so callers are
forced to use createControlStack.
packages/1-framework/1-core/migration/control-plane/src/types.ts (1)

8-49: 🛠️ Refactor suggestion | 🟠 Major

Keep re-exports in src/exports/control.ts, not src/types.ts.

This file is acting as another barrel for both framework and migration types, which adds a parallel entrypoint outside the migration-plane export surface. Import the source modules directly here and let src/exports/control.ts own the public re-export.

As per coding guidelines, "Import control plane/tooling only from src/exports/control.ts" and "Do not reexport things from one file in another, except in the exports/ folders."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/1-framework/1-core/migration/control-plane/src/types.ts` around
lines 8 - 49, This file is incorrectly re-exporting control and migration types
(e.g., ControlAdapterDescriptor, ControlDriverInstance, ControlPlaneStack,
MigrationPlanner, MigrationPlan, MigrationRunnerResult) creating a parallel
public entrypoint; remove these export blocks from this types.ts and instead
import the original modules directly where needed, and centralize the public
re-exports in the project's control exports barrel (the exports/control module)
so all consumers import control-plane/tooling from that single exports barrel.
🧹 Nitpick comments (13)
architecture.config.json (1)

243-248: Consider more granular glob patterns for multi-plane extensibility.

The SQL family package (packages/2-sql/3-tooling/family/...) uses separate globs for different planes: src/core/** (shared), exports/control.ts (migration), exports/runtime.ts (runtime). The Mongo family registration uses a single broad glob packages/2-mongo-family/9-family/** mapped entirely to the migration plane.

If this package will eventually include shared core types or runtime exports (similar to the SQL family pattern), consider adding granular globs now to avoid rework. If the package is intentionally migration-plane-only with no anticipated multi-plane support, this is fine as-is.

As per coding guidelines: "Architecture configuration in architecture.config.json must define multiple globs for multi-plane packages, with one glob per plane (shared, migration, runtime)."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@architecture.config.json` around lines 243 - 248, The current registration
uses one broad glob "packages/2-mongo-family/9-family/**" mapped to the
migration plane; instead, split this into separate architecture entries
mirroring the SQL pattern by adding distinct globs for shared core (e.g.
"packages/2-mongo-family/9-family/src/core/**" with plane "shared"), migration
exports (e.g. "packages/2-mongo-family/9-family/exports/control.ts" with plane
"migration"), and runtime exports (e.g.
"packages/2-mongo-family/9-family/exports/runtime.ts" with plane "runtime"); if
the package truly is migration-only, explicitly document that intent (or keep
the single migration-only entry) — update the object containing the glob
"packages/2-mongo-family/9-family/**" accordingly.
packages/2-mongo-family/9-family/tsconfig.json (2)

9-9: Add fixture exclusion to align with tsconfig rule.

Line 9 should also exclude test/fixtures/**/* to avoid fixture typechecking bleed-through.

As per coding guidelines: "**/tsconfig.json: Exclude test fixture files from TypeScript typechecking in tsconfig.json using 'exclude': ['test/fixtures/**/*'] because fixtures often use internal types that aren't exported from packages."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/2-mongo-family/9-family/tsconfig.json` at line 9, Update the
tsconfig.json "exclude" array to also include the test fixture path so fixture
files are not typechecked; specifically modify the existing "exclude" entry (the
"exclude" key in tsconfig.json) to add "test/fixtures/**/*" alongside "dist".

5-5: Use dedicated TypeScript emit directory instead of dist.

Line 5 sets outDir to ./dist, which can collide with bundler artifacts; use dist-tsc for base config and keep prod config for dist-tsc-prod.

Based on learnings: "Ensure TypeScript emit outputs are configured to dedicated output directories (e.g., dist-tsc for regular builds and dist-tsc-prod for production builds) via tsconfig settings."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/2-mongo-family/9-family/tsconfig.json` at line 5, The tsconfig.json
currently sets the TypeScript emit directory to "./dist" via the "outDir"
property; change "outDir" in this base tsconfig (the "outDir" setting) to a
dedicated emit directory like "./dist-tsc" and ensure any production/override
tsconfig uses "./dist-tsc-prod" so compiled TS output won't collide with bundler
artifacts.
packages/1-framework/3-tooling/cli/src/utils/migration-command-scaffold.ts (1)

2-2: Use pathe instead of node:path in CLI tooling files.

This CLI source file imports from node:path, but per coding guidelines, CLI commands and tooling files should use pathe for consistent cross-platform behavior.

♻️ Suggested fix
-import { relative, resolve } from 'node:path';
+import { relative, resolve } from 'pathe';

Based on learnings: "In the Prisma-next repository, prefer importing and using 'pathe' over the built-in 'node:path' module for path operations across the codebase (including CLI commands and tooling files)."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/1-framework/3-tooling/cli/src/utils/migration-command-scaffold.ts`
at line 2, Replace the import from node:path with pathe to follow CLI tooling
guidelines: change the import of the path helpers (relative, resolve) currently
imported from 'node:path' to be imported from 'pathe' (the rest of the file's
uses of relative and resolve can remain unchanged because pathe exposes the same
functions).
test/integration/test/family.introspect.integration.test.ts (1)

66-74: LGTM with optional suggestion: Consider extracting repeated control-stack creation.

The control-stack migration is correct and consistent across all 10 test cases. However, the identical createControlStack({ family: sql, target: postgres, adapter: postgresAdapter, driver: postgresDriver, extensionPacks: [] }) pattern is repeated in each test.

♻️ Optional: Extract to a helper function
// At the top of the describe block or in a shared helper
const createSqlFamilyInstance = () =>
  sql.create(
    createControlStack({
      family: sql,
      target: postgres,
      adapter: postgresAdapter,
      driver: postgresDriver,
      extensionPacks: [],
    }),
  );

Then use const familyInstance = createSqlFamilyInstance(); in each test.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/integration/test/family.introspect.integration.test.ts` around lines 66
- 74, The repeated creation of the control-stack using
sql.create(createControlStack({...})) across tests should be extracted into a
small helper to reduce duplication; add a function (e.g.,
createSqlFamilyInstance) near the top of the describe block or in a shared test
helper that returns sql.create(createControlStack({ family: sql, target:
postgres, adapter: postgresAdapter, driver: postgresDriver, extensionPacks: []
})), then replace each direct use where familyInstance is assigned with a call
to createSqlFamilyInstance(); this targets the sql.create and createControlStack
usage and the familyInstance assignments to centralize the setup.
packages/1-framework/3-tooling/cli/test/control-api/client.test.ts (1)

79-84: Make these target mocks descriptor-shaped.

The arity update is fine, but both casts still widen partial objects into ControlTargetDescriptor<any, any, any>. That hides missing descriptor fields and makes the tests less sensitive to regressions in control-stack assembly that start reading more of the target contract.

As per coding guidelines "All control plane descriptors must include id property as a string identifier", "manifest property of type ExtensionPackManifest", and a "create() factory method", and "Never use any type in TypeScript".

Also applies to: 620-626

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/1-framework/3-tooling/cli/test/control-api/client.test.ts` around
lines 79 - 84, The test's mockTarget currently casts a partial object to
ControlTargetDescriptor<any, any, any>, hiding missing fields; update the mock
to be a full descriptor-shaped object by adding the required id (string),
manifest (ExtensionPackManifest) and a create() factory method that returns the
expected target instance, and remove the use of any in the descriptor generics
(use concrete generics or unknown) so the mock type enforces shape; apply the
same change to the other mocks mentioned (the ones around the other occurrence)
so tests exercise the real descriptor contract instead of widening with any.
test/integration/test/family.schema-verify.dependencies.integration.test.ts (1)

66-74: Collapse the repeated SQL stack setup into a helper.

These seven createControlStack(...) blocks all encode the same SQL/Postgres fixture, while the file also mirrors enabled components separately in frameworkComponents. A small helper that builds both from one input would make future stack or extension changes a single edit instead of several.

Also applies to: 136-144, 191-199, 226-234, 259-267, 309-317, 398-406

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/integration/test/family.schema-verify.dependencies.integration.test.ts`
around lines 66 - 74, Multiple test blocks duplicate the same
createControlStack(...) configuration (used to build familyInstance via
sql.create and mirrored in frameworkComponents); extract a small helper function
(e.g., buildPgTestStack or makeSqlPostgresFixture) that accepts the common
inputs (sql, postgres, postgresAdapter, postgresDriver, pgvector) and returns
both the control stack object for sql.create (used where familyInstance is
created) and the corresponding frameworkComponents array so each test uses the
single helper to produce both values; update all occurrences referencing
createControlStack, familyInstance, and frameworkComponents to call the helper
instead of repeating the seven-argument literal.
examples/mongo-demo/scripts/generate-contract.ts (1)

2-2: Use pathe instead of node:path for path operations.

Per coding guidelines, pathe should be used for consistent cross-platform behavior.

Suggested fix
-import { resolve } from 'node:path';
+import { resolve } from 'pathe';

Based on learnings: "In the Prisma-next repository, prefer importing and using 'pathe' over the built-in 'node:path' module for path operations across the codebase."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/mongo-demo/scripts/generate-contract.ts` at line 2, Replace the
import of resolve from the Node core module with the pathe package to ensure
cross-platform path handling: change the import statement that currently imports
resolve from 'node:path' to import resolve from 'pathe' (update the top-level
import where resolve is referenced in this file, i.e., the import line in
generate-contract.ts).
packages/1-framework/1-core/shared/framework-components/README.md (1)

19-23: Keep the README focused on the supported API.

The backward-compatibility note and the ~70 consumers on main count are rollout details that will go stale quickly. For a package README, it’s clearer to document the canonical import path only and move migration notes elsewhere if they still matter.

✏️ Suggested wording
 ## Relationship to other packages
 
-This package is the canonical source for framework component types and assembly logic. `@prisma-next/contract/framework-components` re-exports `./components` and `./authoring` for backward compatibility (~70 consumers on main).
-
-New code should import directly from `@prisma-next/framework-components`.
+This package is the canonical source for framework component types and assembly logic.
+
+Import from `@prisma-next/framework-components` and its documented subpaths directly.

As per coding guidelines, "packages/**/*.md: Update design docs to reflect the current state only, not the transition history or legacy approaches" and "**/README.md: For user-facing packages, keep README.md focused on what the package does, when to use it, and a few concrete examples. Avoid internal implementation detail unless it materially affects usage."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/1-framework/1-core/shared/framework-components/README.md` around
lines 19 - 23, Update the README to remove the backward-compatibility rollout
details and stale consumer counts: keep only the supported API and canonical
import guidance by stating that this package is the canonical source for
framework component types and assembly logic and that new code should import
from "@prisma-next/framework-components"; remove the sentence mentioning
"@prisma-next/contract/framework-components" re-exports and the "~70 consumers
on main" note, and if migration guidance is needed, move it to a separate
migration or release note document instead of the README.
packages/2-mongo-family/9-family/package.json (1)

7-13: Clean the TypeScript emit directories too.

tsc in this repo can leave artifacts in dist-tsc and dist-tsc-prod; keeping those out of the clean step makes local rebuilds and publish checks less reliable. Based on learnings, TypeScript outputs are configured to emit to dist-tsc (regular builds via base tsconfig) and dist-tsc-prod (production builds via prod tsconfig). Ensure clean scripts remove dist, dist-tsc, and dist-tsc-prod directories so a full clean is performed.

Suggested cleanup update
-    "clean": "rm -rf dist coverage"
+    "clean": "rm -rf dist dist-tsc dist-tsc-prod coverage"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/2-mongo-family/9-family/package.json` around lines 7 - 13, Update
the "clean" npm script in package.json to remove TypeScript emit dirs too:
modify the scripts.clean entry (currently "clean") to delete dist, dist-tsc, and
dist-tsc-prod so tsc artifacts are fully removed; ensure the command removes all
three directories (e.g., using rm -rf or cross-platform equivalent) to guarantee
a full clean before rebuilds/publishes.
packages/2-sql/3-tooling/family/src/core/control-instance.ts (1)

14-17: Use the control target descriptor at this boundary.

CreateSqlFamilyInstanceOptions.target is still built on the shared TargetDescriptor, so this factory no longer enforces the control-plane descriptor contract at compile time. Please switch it to the SQL control target descriptor type instead of the base component type. As per coding guidelines, Use ControlTargetDescriptor<TFamilyId, TTargetId, TTargetInstance> type for target descriptors in control plane implementations and Do not use legacy descriptor types (FamilyDescriptor, TargetDescriptor, AdapterDescriptor, DriverDescriptor, ExtensionDescriptor, ControlPlaneDriver).

Also applies to: 221-228

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/2-sql/3-tooling/family/src/core/control-instance.ts` around lines 14
- 17, CreateSqlFamilyInstanceOptions.target currently uses the legacy
TargetDescriptor type; change it to the control-plane descriptor by importing
and using ControlTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>
(replace the TargetDescriptor reference in the CreateSqlFamilyInstanceOptions
type with ControlTargetDescriptor and update the import to pull
ControlTargetDescriptor from the control-plane types module), and apply the same
replacement for the other occurrences mentioned (the block around the current
lines 221-228) so the factory enforces the SQL control target descriptor
contract at compile time.
packages/1-framework/1-core/shared/framework-components/src/execution-requirements.ts (1)

42-46: Only the first missing extension pack is reported.

The loop throws on the first missing extension pack ID, so users won't see all missing dependencies at once. Consider collecting all missing IDs and throwing a single comprehensive error.

♻️ Proposed improvement to report all missing packs
-  for (const packId of result.missingExtensionPackIds) {
-    throw new Error(
-      `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,
-    );
-  }
+  if (result.missingExtensionPackIds.length > 0) {
+    const packList = result.missingExtensionPackIds.map((id) => `'${id}'`).join(', ');
+    throw new Error(
+      `Contract requires extension pack(s) ${packList}, but runtime descriptors do not provide matching component(s).`,
+    );
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/1-framework/1-core/shared/framework-components/src/execution-requirements.ts`
around lines 42 - 46, The current loop throws on the first
missingExtensionPackIds entry (result.missingExtensionPackIds/packId), so only
one missing pack shows; instead, gather all missing IDs from
result.missingExtensionPackIds and throw a single Error that lists them all
(e.g., join the array into a comma-separated string) so the error message
reports every missing extension pack at once.
packages/2-mongo-family/9-family/src/core/control-instance.ts (1)

68-75: Use ifDefined() for conditional object spread.

As per coding guidelines, use ifDefined() from @prisma-next/utils/defined for conditional object spreads instead of inline conditional spread patterns.

♻️ Proposed fix using ifDefined
+import { ifDefined } from '@prisma-next/utils/defined';
...
     return {
       contractJson: result.contractJson,
       contractDts: result.contractDts,
       storageHash: result.storageHash,
-      ...(result.executionHash ? { executionHash: result.executionHash } : {}),
+      ...ifDefined(result.executionHash, (h) => ({ executionHash: h })),
       profileHash: result.profileHash,
     };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/2-mongo-family/9-family/src/core/control-instance.ts` around lines
68 - 75, The returned object uses an inline conditional spread for
result.executionHash; replace that pattern with ifDefined to follow the
guideline: import ifDefined from '@prisma-next/utils/defined' (if not already
imported) and change the spread ...(result.executionHash ? { executionHash:
result.executionHash } : {}) to using ifDefined('executionHash',
result.executionHash) while keeping the other properties (contractJson,
contractDts, storageHash, profileHash) unchanged; ensure you reference the same
result variable and property name executionHash so the returned shape is
identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/glossary.md`:
- Around line 147-187: Update the "Divergence" note to state that consolidation
is complete: replace the "Status: pending." sentence with a short note that
ControlStack and ControlPlaneStack have been consolidated in task 3.13,
ControlStack now carries both descriptors and aggregated contributions,
ControlPlaneStack remains only as a deprecated type alias, and the canonical
factory is createControlStack() from `@prisma-next/framework-components/control`;
ensure you reference the symbols ControlStack, ControlPlaneStack, and
createControlStack() in the revised sentence.

In `@packages/1-framework/1-core/migration/control-plane/src/types.ts`:
- Around line 67-70: The hasMigrations predicate currently uses truthiness and
can falsely narrow malformed descriptors; update hasMigrations to verify the
migrations capability shape rather than just truthiness: ensure
target.migrations is a non-null object and contains the expected capability
methods/keys (e.g. check typeof migrations === 'object' && migrations !== null
&& typeof migrations.<expectedMethod> === 'function' or presence of required
keys) so it reliably narrows target to MigratableTargetDescriptor<TFamilyId,
TTargetId> / TargetMigrationsCapability in callers like hasMigrations.

In `@packages/1-framework/1-core/runtime/execution-plane/src/types.ts`:
- Around line 1-12: This file is merely re-exporting public types from
`@prisma-next/framework-components/execution` which creates an unnecessary
indirection; update the repository to stop re-exporting that barrel from runtime
plane: either remove these exports from
packages/1-framework/1-core/runtime/execution-plane/src/types.ts and import
RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeDriverDescriptor,
RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance,
RuntimeFamilyDescriptor, RuntimeFamilyInstance, RuntimeTargetDescriptor,
RuntimeTargetInstance directly where they are used, or move any
runtime-plane-specific type subsets into this file (src/core/) and expose them
through the designated plane entrypoint (src/exports/runtime.ts) so the runtime
plane does not reexport another package's barrel.

In `@packages/1-framework/1-core/shared/framework-components/package.json`:
- Line 12: The npm "clean" script currently only removes "dist"; update the
"clean" script in package.json (the "clean" script entry) to also remove
TypeScript emit directories "dist-tsc" and "dist-tsc-prod" so stale type-build
artifacts are removed; modify the "clean" script value to include both
"dist-tsc" and "dist-tsc-prod" alongside "dist" (ensuring it still works
cross-platform or follows the repo's existing shell convention).
- Around line 14-17: The package.json in framework-components incorrectly lists
"@prisma-next/utils" under "dependencies", violating shared-plane rules; remove
"@prisma-next/utils" from the dependencies block and either move it to
"devDependencies" if it's only used at build/test time or replace its usage with
an allowed shared-plane dependency (e.g., refactor imports to use
"@prisma-next/contract" or "@prisma-next/operations"); update any code
referencing "@prisma-next/utils" accordingly to the chosen replacement and run a
local build to verify.

In
`@packages/1-framework/1-core/shared/framework-components/src/control-descriptors.ts`:
- Around line 18-25: Remove the deprecated compatibility alias
ControlPlaneStack: delete the exported type alias named
ControlPlaneStack<TFamilyId extends string, TTargetId extends string> (the Pick
of ControlStack) and any direct export of that symbol; replace any internal
usages that import or reference ControlPlaneStack to use ControlStack<TFamilyId,
TTargetId> directly, and run tests/build to ensure no remaining references; do
not add any shim or deprecation comments—fully remove the declaration and its
export.

In
`@packages/1-framework/1-core/shared/framework-components/src/control-instances.ts`:
- Around line 64-70: The shared ControlDriverInstance interface currently
includes a SQL-specific query method; remove query from ControlDriverInstance so
it remains family-neutral (leave ControlDriverInstance<TFamilyId, TTargetId>
extending DriverInstance only), and introduce a new family-specific interface
(e.g., SqlControlDriverInstance<TFamilyId, TTargetId>) that declares
query<Row=...>(sql: string, params?: readonly unknown[]): Promise<{ readonly
rows: Row[] }> and close(): Promise<void>; update any SQL-family drivers to
implement SqlControlDriverInstance instead of the base ControlDriverInstance and
adjust uses to rely on the family-specific interface where SQL execution is
required.
- Line 55: Change the emitContract signature to accept a single unknown-typed
parameter instead of the redundant union; update the declaration
emitContract(options: { readonly contractIR: ContractIR | unknown }):
Promise<EmitContractResult> to use unknown for contractIR (e.g. contractIR:
unknown) so callers see the intended flexible input type, and ensure the
implementation continues to validate using normalizeProviderContractIR() as
documented.

In
`@packages/1-framework/1-core/shared/framework-components/src/control-stack.ts`:
- Around line 38-40: The assembled control stack currently omits the driver by
building allDescriptors without the driver and populates extensionIds from
extractComponentIds (which omits driver), causing driver-owned imports/metadata
and the driver's id to be lost or mislabeled; fix by including the driver
descriptor when computing allDescriptors (or adjust the driver into the source
list used by allDescriptors), and either change extractComponentIds to include
the driver or, preferably, populate extensionIds from only extension descriptors
so the field is clearly extension-only; update usages around allDescriptors,
extractComponentIds, and extensionIds (also present in the other affected
blocks) to ensure driver imports, authoring helpers, renderer ownership and id
are folded into the stack correctly.
- Around line 294-304: The code currently holds the caller's extensionPacks
array by reference which can be mutated later and desynchronize derived fields;
fix it by snapshotting a shallow copy of extensionPacks up-front (e.g., create a
const extensionPacksSnapshot = [...extensionPacks] and use that snapshot
everywhere) so that allDescriptors, derived imports/rendererMap/ids/authoring
contributions and the returned extensionPacks property reference the immutable
snapshot (apply the same readonly typing/cast used on extensionPacks when
returning).

In
`@packages/1-framework/1-core/shared/framework-components/src/execution-descriptors.ts`:
- Around line 20-24: The create signature on RuntimeFamilyDescriptor.create
requires a driver but ExecutionStack/createExecutionStack allow omitting it;
make the contracts consistent by making the driver optional in the create
options (change the parameter type for driver to
RuntimeDriverDescriptor<TFamilyId, TTargetId> | undefined / mark as readonly
driver?: RuntimeDriverDescriptor<...>), and update any internal handling in
RuntimeFamilyDescriptor.create to accept and correctly handle a missing driver
(e.g., treat as undefined or null-safe path). Ensure references in code that
construct or pass ExecutionStack objects to RuntimeFamilyDescriptor.create no
longer need casts by aligning the driver optionality with ExecutionStack and
createExecutionStack.

In `@packages/1-framework/1-core/shared/framework-components/tsconfig.json`:
- Line 7: Update the tsconfig.json exclude list to also exclude test fixture
files so they aren't typechecked: add the glob pattern "test/fixtures/**/*" to
the existing "exclude" array (which currently contains "dist" and
"node_modules") ensuring the array preserves existing entries and formatting.

In `@packages/2-mongo-family/9-family/package.json`:
- Around line 33-45: The package currently publishes the control-plane at the
package root (the "." export and root "main"/"module"/"types" fields pointing to
dist/control.*); change the exports to publish the control surface under the
subpath "./control" (e.g. add "./control": "./dist/control.mjs" and remove the
"." root export), and update the package metadata entries ("main", "module",
"types") or add corresponding entries so the control-plane files are exposed
only via "./control" and include the matching architecture metadata under that
subpath in package.json. Ensure "./package.json" export stays and that no
plane-specific files are exported from the package root.

In `@packages/2-mongo-family/9-family/src/core/mongo-target-descriptor.ts`:
- Around line 4-15: Replace the current type assertion on mongoTargetDescriptor
that uses TargetDescriptor<'mongo','mongo'> with
ControlTargetDescriptor<'mongo','mongo', MongoTargetInstance> and add the
necessary import for ControlTargetDescriptor and MongoTargetInstance from
'@prisma-next/framework-components/components'; specifically update the trailing
"as const satisfies ..." expression on mongoTargetDescriptor to satisfy
ControlTargetDescriptor<'mongo','mongo', MongoTargetInstance> so the descriptor
uses the control-plane-specific type.

In `@packages/2-mongo-family/9-family/test/control.test.ts`:
- Around line 8-21: The test's createMinimalControlStack() constructs an
unrealistic ControlStack (extensionPacks empty but extensionIds contains
duplicates), so replace its manual assembly by calling the real factory
createControlStack() to produce a production-consistent stack; ensure the test
invokes createControlStack() (or the same factory used by
createMongoFamilyInstance) and then use that returned object's
extensionPacks/extensionIds rather than hand-crafting them, so the
createMongoFamilyInstance() is exercised against a realistic, assembled state.

In `@packages/2-sql/3-tooling/family/src/core/control-instance.ts`:
- Around line 18-25: extractComponentIds() returns all component IDs (family,
target, adapter, and extensions) but the emitter's extensionIds parameter should
only contain extension pack IDs; update the code that passes
extractComponentIds() to the emitter (the extensionIds argument) to filter the
result to extension descriptors only (e.g., call extractComponentIds(), then
filter by the extension-type predicate or helper you have for identifying
extension descriptors) before emitting, or rename the helper/parameter if the
intent is to pass all component IDs instead of just extensions.

In `@packages/2-sql/3-tooling/family/test/emit-parameterized.test.ts`:
- Line 3: Replace the legacy TargetDescriptor import and usages with the
control-plane type: import and use ControlTargetDescriptor<'sql','postgres',
TTargetInstance> instead of TargetDescriptor, and update the createMockTarget()
typing to return ControlTargetDescriptor<'sql','postgres', ...> (match the
appropriate TTargetInstance used in this test) so the test uses the
ControlTargetDescriptor contract; update any variable/type annotations that
reference TargetDescriptor to the new ControlTargetDescriptor type and remove
the old import.

In `@packages/3-extensions/pgvector/package.json`:
- Line 22: The package.json currently lists "@prisma-next/framework-components"
under "dependencies" but it is only used for TypeScript types; move the
"@prisma-next/framework-components": "workspace:*" entry from "dependencies"
into "devDependencies" in package.json so it’s treated as a dev-only, type-only
dependency, then run the package manager install to update lockfiles; keep the
exact version spec ("workspace:*") when moving to "devDependencies".

---

Outside diff comments:
In `@packages/1-framework/1-core/migration/control-plane/src/stack.ts`:
- Around line 1-27: The file currently re-exports createControlStack while also
defining a deprecated createControlPlaneStack shim; remove the legacy shim so
only the new surface remains: delete the createControlPlaneStack function and
its JSDoc, remove or adjust the now-unused type imports (ControlPlaneStack and
any types used solely by the removed function), and keep the export {
createControlStack } from '@prisma-next/framework-components/control'; ensure no
other declarations referencing createControlPlaneStack remain so callers are
forced to use createControlStack.

In `@packages/1-framework/1-core/migration/control-plane/src/types.ts`:
- Around line 8-49: This file is incorrectly re-exporting control and migration
types (e.g., ControlAdapterDescriptor, ControlDriverInstance, ControlPlaneStack,
MigrationPlanner, MigrationPlan, MigrationRunnerResult) creating a parallel
public entrypoint; remove these export blocks from this types.ts and instead
import the original modules directly where needed, and centralize the public
re-exports in the project's control exports barrel (the exports/control module)
so all consumers import control-plane/tooling from that single exports barrel.

---

Nitpick comments:
In `@architecture.config.json`:
- Around line 243-248: The current registration uses one broad glob
"packages/2-mongo-family/9-family/**" mapped to the migration plane; instead,
split this into separate architecture entries mirroring the SQL pattern by
adding distinct globs for shared core (e.g.
"packages/2-mongo-family/9-family/src/core/**" with plane "shared"), migration
exports (e.g. "packages/2-mongo-family/9-family/exports/control.ts" with plane
"migration"), and runtime exports (e.g.
"packages/2-mongo-family/9-family/exports/runtime.ts" with plane "runtime"); if
the package truly is migration-only, explicitly document that intent (or keep
the single migration-only entry) — update the object containing the glob
"packages/2-mongo-family/9-family/**" accordingly.

In `@examples/mongo-demo/scripts/generate-contract.ts`:
- Line 2: Replace the import of resolve from the Node core module with the pathe
package to ensure cross-platform path handling: change the import statement that
currently imports resolve from 'node:path' to import resolve from 'pathe'
(update the top-level import where resolve is referenced in this file, i.e., the
import line in generate-contract.ts).

In `@packages/1-framework/1-core/shared/framework-components/README.md`:
- Around line 19-23: Update the README to remove the backward-compatibility
rollout details and stale consumer counts: keep only the supported API and
canonical import guidance by stating that this package is the canonical source
for framework component types and assembly logic and that new code should import
from "@prisma-next/framework-components"; remove the sentence mentioning
"@prisma-next/contract/framework-components" re-exports and the "~70 consumers
on main" note, and if migration guidance is needed, move it to a separate
migration or release note document instead of the README.

In
`@packages/1-framework/1-core/shared/framework-components/src/execution-requirements.ts`:
- Around line 42-46: The current loop throws on the first
missingExtensionPackIds entry (result.missingExtensionPackIds/packId), so only
one missing pack shows; instead, gather all missing IDs from
result.missingExtensionPackIds and throw a single Error that lists them all
(e.g., join the array into a comma-separated string) so the error message
reports every missing extension pack at once.

In `@packages/1-framework/3-tooling/cli/src/utils/migration-command-scaffold.ts`:
- Line 2: Replace the import from node:path with pathe to follow CLI tooling
guidelines: change the import of the path helpers (relative, resolve) currently
imported from 'node:path' to be imported from 'pathe' (the rest of the file's
uses of relative and resolve can remain unchanged because pathe exposes the same
functions).

In `@packages/1-framework/3-tooling/cli/test/control-api/client.test.ts`:
- Around line 79-84: The test's mockTarget currently casts a partial object to
ControlTargetDescriptor<any, any, any>, hiding missing fields; update the mock
to be a full descriptor-shaped object by adding the required id (string),
manifest (ExtensionPackManifest) and a create() factory method that returns the
expected target instance, and remove the use of any in the descriptor generics
(use concrete generics or unknown) so the mock type enforces shape; apply the
same change to the other mocks mentioned (the ones around the other occurrence)
so tests exercise the real descriptor contract instead of widening with any.

In `@packages/2-mongo-family/9-family/package.json`:
- Around line 7-13: Update the "clean" npm script in package.json to remove
TypeScript emit dirs too: modify the scripts.clean entry (currently "clean") to
delete dist, dist-tsc, and dist-tsc-prod so tsc artifacts are fully removed;
ensure the command removes all three directories (e.g., using rm -rf or
cross-platform equivalent) to guarantee a full clean before rebuilds/publishes.

In `@packages/2-mongo-family/9-family/src/core/control-instance.ts`:
- Around line 68-75: The returned object uses an inline conditional spread for
result.executionHash; replace that pattern with ifDefined to follow the
guideline: import ifDefined from '@prisma-next/utils/defined' (if not already
imported) and change the spread ...(result.executionHash ? { executionHash:
result.executionHash } : {}) to using ifDefined('executionHash',
result.executionHash) while keeping the other properties (contractJson,
contractDts, storageHash, profileHash) unchanged; ensure you reference the same
result variable and property name executionHash so the returned shape is
identical.

In `@packages/2-mongo-family/9-family/tsconfig.json`:
- Line 9: Update the tsconfig.json "exclude" array to also include the test
fixture path so fixture files are not typechecked; specifically modify the
existing "exclude" entry (the "exclude" key in tsconfig.json) to add
"test/fixtures/**/*" alongside "dist".
- Line 5: The tsconfig.json currently sets the TypeScript emit directory to
"./dist" via the "outDir" property; change "outDir" in this base tsconfig (the
"outDir" setting) to a dedicated emit directory like "./dist-tsc" and ensure any
production/override tsconfig uses "./dist-tsc-prod" so compiled TS output won't
collide with bundler artifacts.

In `@packages/2-sql/3-tooling/family/src/core/control-instance.ts`:
- Around line 14-17: CreateSqlFamilyInstanceOptions.target currently uses the
legacy TargetDescriptor type; change it to the control-plane descriptor by
importing and using ControlTargetDescriptor<TFamilyId, TTargetId,
TTargetInstance> (replace the TargetDescriptor reference in the
CreateSqlFamilyInstanceOptions type with ControlTargetDescriptor and update the
import to pull ControlTargetDescriptor from the control-plane types module), and
apply the same replacement for the other occurrences mentioned (the block around
the current lines 221-228) so the factory enforces the SQL control target
descriptor contract at compile time.

In `@test/integration/test/family.introspect.integration.test.ts`:
- Around line 66-74: The repeated creation of the control-stack using
sql.create(createControlStack({...})) across tests should be extracted into a
small helper to reduce duplication; add a function (e.g.,
createSqlFamilyInstance) near the top of the describe block or in a shared test
helper that returns sql.create(createControlStack({ family: sql, target:
postgres, adapter: postgresAdapter, driver: postgresDriver, extensionPacks: []
})), then replace each direct use where familyInstance is assigned with a call
to createSqlFamilyInstance(); this targets the sql.create and createControlStack
usage and the familyInstance assignments to centralize the setup.

In `@test/integration/test/family.schema-verify.dependencies.integration.test.ts`:
- Around line 66-74: Multiple test blocks duplicate the same
createControlStack(...) configuration (used to build familyInstance via
sql.create and mirrored in frameworkComponents); extract a small helper function
(e.g., buildPgTestStack or makeSqlPostgresFixture) that accepts the common
inputs (sql, postgres, postgresAdapter, postgresDriver, pgvector) and returns
both the control stack object for sql.create (used where familyInstance is
created) and the corresponding frameworkComponents array so each test uses the
single helper to produce both values; update all occurrences referencing
createControlStack, familyInstance, and frameworkComponents to call the helper
instead of repeating the seven-argument literal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 4c1ab214-5644-49a5-8785-aced2bdec070

📥 Commits

Reviewing files that changed from the base of the PR and between 27ccefc and 84b8b18.

⛔ Files ignored due to path filters (11)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/contract-domain-extraction/plan.md is excluded by !projects/**
  • projects/contract-domain-extraction/plans/3.10-extract-framework-components-and-unify-stacks-plan.md is excluded by !projects/**
  • projects/contract-domain-extraction/plans/3.13-consolidate-control-plane-types-into-framework-components-plan.md is excluded by !projects/**
  • projects/contract-domain-extraction/plans/3.8-hook-up-mongo-demo-to-emitter.md is excluded by !projects/**
  • projects/contract-domain-extraction/plans/3.9-extract-assembly-mongo-control-plane-plan.md is excluded by !projects/**
  • projects/contract-domain-extraction/plans/5.11-extract-framework-components-package-plan.md is excluded by !projects/**
  • projects/contract-domain-extraction/plans/5.8-control-flow-inversion-plan.md is excluded by !projects/**
  • projects/contract-domain-extraction/reviews/code-review.md is excluded by !projects/**
  • projects/contract-domain-extraction/reviews/system-design-review.md is excluded by !projects/**
  • projects/contract-domain-extraction/reviews/walkthrough.md is excluded by !projects/**
📒 Files selected for processing (158)
  • .gitignore
  • architecture.config.json
  • docs/glossary.md
  • examples/mongo-demo/package.json
  • examples/mongo-demo/scripts/generate-contract.ts
  • examples/mongo-demo/src/contract.d.ts
  • examples/mongo-demo/src/contract.json
  • packages/1-framework/1-core/migration/control-plane/package.json
  • packages/1-framework/1-core/migration/control-plane/src/exports/stack.ts
  • packages/1-framework/1-core/migration/control-plane/src/exports/types.ts
  • packages/1-framework/1-core/migration/control-plane/src/migrations.ts
  • packages/1-framework/1-core/migration/control-plane/src/stack.ts
  • packages/1-framework/1-core/migration/control-plane/src/types.ts
  • packages/1-framework/1-core/runtime/execution-plane/package.json
  • packages/1-framework/1-core/runtime/execution-plane/src/framework-components.ts
  • packages/1-framework/1-core/runtime/execution-plane/src/stack.ts
  • packages/1-framework/1-core/runtime/execution-plane/src/types.ts
  • packages/1-framework/1-core/shared/config/package.json
  • packages/1-framework/1-core/shared/config/src/types.ts
  • packages/1-framework/1-core/shared/contract/package.json
  • packages/1-framework/1-core/shared/contract/src/exports/framework-components.ts
  • packages/1-framework/1-core/shared/contract/tsdown.config.ts
  • packages/1-framework/1-core/shared/framework-components/README.md
  • packages/1-framework/1-core/shared/framework-components/package.json
  • packages/1-framework/1-core/shared/framework-components/src/control-descriptors.ts
  • packages/1-framework/1-core/shared/framework-components/src/control-instances.ts
  • packages/1-framework/1-core/shared/framework-components/src/control-result-types.ts
  • packages/1-framework/1-core/shared/framework-components/src/control-stack.ts
  • packages/1-framework/1-core/shared/framework-components/src/execution-descriptors.ts
  • packages/1-framework/1-core/shared/framework-components/src/execution-instances.ts
  • packages/1-framework/1-core/shared/framework-components/src/execution-requirements.ts
  • packages/1-framework/1-core/shared/framework-components/src/execution-stack.ts
  • packages/1-framework/1-core/shared/framework-components/src/exports/authoring.ts
  • packages/1-framework/1-core/shared/framework-components/src/exports/components.ts
  • packages/1-framework/1-core/shared/framework-components/src/exports/control.ts
  • packages/1-framework/1-core/shared/framework-components/src/exports/execution.ts
  • packages/1-framework/1-core/shared/framework-components/src/framework-authoring.ts
  • packages/1-framework/1-core/shared/framework-components/src/framework-components.ts
  • packages/1-framework/1-core/shared/framework-components/src/type-renderers.ts
  • packages/1-framework/1-core/shared/framework-components/src/types.ts
  • packages/1-framework/1-core/shared/framework-components/test/control-stack.test.ts
  • packages/1-framework/1-core/shared/framework-components/test/execution-requirements.test.ts
  • packages/1-framework/1-core/shared/framework-components/test/execution-stack.test.ts
  • packages/1-framework/1-core/shared/framework-components/test/execution-stack.types.test-d.ts
  • packages/1-framework/1-core/shared/framework-components/test/framework-components.authoring.test.ts
  • packages/1-framework/1-core/shared/framework-components/test/framework-components.renderer.test.ts
  • packages/1-framework/1-core/shared/framework-components/test/framework-components.requirements.test.ts
  • packages/1-framework/1-core/shared/framework-components/tsconfig.json
  • packages/1-framework/1-core/shared/framework-components/tsconfig.prod.json
  • packages/1-framework/1-core/shared/framework-components/tsdown.config.ts
  • packages/1-framework/2-authoring/contract/package.json
  • packages/1-framework/2-authoring/contract/src/contract-builder.ts
  • packages/1-framework/2-authoring/contract/test/contract-builder.test.ts
  • packages/1-framework/3-tooling/cli/package.json
  • packages/1-framework/3-tooling/cli/src/commands/migration-plan.ts
  • packages/1-framework/3-tooling/cli/src/control-api/client.ts
  • packages/1-framework/3-tooling/cli/src/control-api/contract-enrichment.ts
  • packages/1-framework/3-tooling/cli/src/control-api/operations/contract-emit.ts
  • packages/1-framework/3-tooling/cli/src/control-api/operations/db-init.ts
  • packages/1-framework/3-tooling/cli/src/control-api/operations/db-update.ts
  • packages/1-framework/3-tooling/cli/src/control-api/operations/migration-apply.ts
  • packages/1-framework/3-tooling/cli/src/control-api/types.ts
  • packages/1-framework/3-tooling/cli/src/utils/command-helpers.ts
  • packages/1-framework/3-tooling/cli/src/utils/framework-components.ts
  • packages/1-framework/3-tooling/cli/src/utils/migration-command-scaffold.ts
  • packages/1-framework/3-tooling/cli/test/control-api/client.test.ts
  • packages/1-framework/3-tooling/cli/test/control-api/contract-enrichment.test.ts
  • packages/1-framework/3-tooling/cli/test/control-api/progress.test.ts
  • packages/1-framework/3-tooling/cli/test/helpers/postgres-pack.ts
  • packages/2-mongo-family/9-family/package.json
  • packages/2-mongo-family/9-family/src/core/control-descriptor.ts
  • packages/2-mongo-family/9-family/src/core/control-instance.ts
  • packages/2-mongo-family/9-family/src/core/mongo-target-descriptor.ts
  • packages/2-mongo-family/9-family/src/exports/control.ts
  • packages/2-mongo-family/9-family/test/control.test.ts
  • packages/2-mongo-family/9-family/tsconfig.json
  • packages/2-mongo-family/9-family/tsconfig.prod.json
  • packages/2-mongo-family/9-family/tsdown.config.ts
  • packages/2-sql/2-authoring/contract-psl/package.json
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/2-authoring/contract-psl/src/provider.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-field-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/test/fixtures.ts
  • packages/2-sql/2-authoring/contract-psl/test/ts-psl-parity.test.ts
  • packages/2-sql/2-authoring/contract-ts/package.json
  • packages/2-sql/2-authoring/contract-ts/src/authoring-helper-runtime.ts
  • packages/2-sql/2-authoring/contract-ts/src/authoring-type-utils.ts
  • packages/2-sql/2-authoring/contract-ts/src/composed-authoring-helpers.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-builder.ts
  • packages/2-sql/2-authoring/contract-ts/src/semantic-contract.ts
  • packages/2-sql/2-authoring/contract-ts/src/staged-contract-dsl.ts
  • packages/2-sql/2-authoring/contract-ts/src/staged-contract-types.ts
  • packages/2-sql/2-authoring/contract-ts/test/authoring-helper-runtime.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.constraints.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.methods.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.normalization.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.semantic-contract.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.staged-contract-dsl.helpers.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.staged-contract-dsl.parity.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.staged-contract-dsl.portability.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.staged-contract-dsl.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-parity.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/staged-contract-dsl.runtime.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/staged-contract-lowering.runtime.test.ts
  • packages/2-sql/3-tooling/emitter/package.json
  • packages/2-sql/3-tooling/emitter/test/emitter-hook.generation.advanced.test.ts
  • packages/2-sql/3-tooling/emitter/test/emitter-hook.generation.basic.test.ts
  • packages/2-sql/3-tooling/family/package.json
  • packages/2-sql/3-tooling/family/src/core/assembly.ts
  • packages/2-sql/3-tooling/family/src/core/authoring-field-presets.ts
  • packages/2-sql/3-tooling/family/src/core/control-descriptor.ts
  • packages/2-sql/3-tooling/family/src/core/control-instance.ts
  • packages/2-sql/3-tooling/family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/3-tooling/family/src/core/migrations/types.ts
  • packages/2-sql/3-tooling/family/src/core/schema-verify/verify-sql-schema.ts
  • packages/2-sql/3-tooling/family/src/exports/control.ts
  • packages/2-sql/3-tooling/family/src/exports/pack.ts
  • packages/2-sql/3-tooling/family/src/exports/test-utils.ts
  • packages/2-sql/3-tooling/family/test/assembly.codec-control-hooks.test.ts
  • packages/2-sql/3-tooling/family/test/assembly.test.ts
  • packages/2-sql/3-tooling/family/test/emit-parameterized.test.ts
  • packages/2-sql/3-tooling/family/test/mutation-default-assembly.test.ts
  • packages/2-sql/3-tooling/family/test/schema-verify.dependencies.test.ts
  • packages/2-sql/3-tooling/family/test/schema-verify.helpers.ts
  • packages/2-sql/3-tooling/family/test/schema-verify.storage-types.test.ts
  • packages/2-sql/3-tooling/family/test/schema-view.test.ts
  • packages/2-sql/5-runtime/package.json
  • packages/2-sql/5-runtime/src/sql-context.ts
  • packages/3-extensions/pgvector/package.json
  • packages/3-extensions/pgvector/src/core/authoring.ts
  • packages/3-extensions/pgvector/src/exports/pack.ts
  • packages/3-targets/3-targets/postgres/package.json
  • packages/3-targets/3-targets/postgres/src/core/authoring.ts
  • packages/3-targets/3-targets/postgres/src/exports/control.ts
  • packages/3-targets/3-targets/postgres/src/exports/pack.ts
  • packages/3-targets/3-targets/postgres/test/migrations/fixtures/runner-fixtures.ts
  • packages/3-targets/3-targets/postgres/test/migrations/planner.behavior.test.ts
  • packages/3-targets/3-targets/postgres/test/migrations/planner.contract-to-schema-ir.test.ts
  • packages/3-targets/3-targets/postgres/test/migrations/planner.storage-types.test.ts
  • test/integration/package.json
  • test/integration/test/authoring/cli.emit-parity-fixtures.test.ts
  • test/integration/test/authoring/psl.pgvector-dbinit.test.ts
  • test/integration/test/cli.emit-contract.test.ts
  • test/integration/test/cli.emit.test.ts
  • test/integration/test/contract-builder.types.test-d.ts
  • test/integration/test/contract-imports.test.ts
  • test/integration/test/control-api.test.ts
  • test/integration/test/family.introspect.integration.test.ts
  • test/integration/test/family.introspect.test.ts
  • test/integration/test/family.schema-verify.basic.integration.test.ts
  • test/integration/test/family.schema-verify.dependencies.integration.test.ts
  • test/integration/test/family.schema-verify.helpers.ts
  • test/integration/test/family.schema-verify.mismatches.integration.test.ts
  • test/integration/test/family.sign-database.test.ts
  • test/integration/test/family.verify-database.basic.test.ts
  • test/integration/test/family.verify-database.errors.test.ts
  • test/integration/test/referential-actions.integration.test.ts
💤 Files with no reviewable changes (3)
  • packages/1-framework/1-core/shared/contract/package.json
  • packages/2-sql/3-tooling/family/test/assembly.test.ts
  • packages/1-framework/1-core/shared/contract/src/exports/framework-components.ts

Comment thread docs/glossary.md Resolved
wmadden added 2 commits April 3, 2026 10:45
- Update glossary: mark ControlStack/ControlPlaneStack consolidation complete
- Expand framework-components clean script to remove dist-tsc dirs
- Simplify emitContract param type from ContractIR | unknown to unknown
- Use createControlStack() factory in mongo family test instead of hand-built stub

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@packages/1-framework/1-core/shared/framework-components/src/control-instances.ts`:
- Around line 14-16: The schemaVerify options currently accept the legacy
TargetBoundComponentDescriptor; update the type surface to use the corresponding
Control* types instead: replace TargetBoundComponentDescriptor with the
appropriate Control*Descriptor (and any related TargetInstance uses with
Control*Instance) in the schemaVerify options and any exported types so
discriminators/manifest/create guarantees are preserved; search for
schemaVerify, TargetBoundComponentDescriptor and TargetInstance in this module
and swap to the matching Control*Descriptor / Control*Instance types across all
option shapes and signatures to satisfy the coding guideline banning legacy
descriptor types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d1bfc33f-b4d1-47f1-b885-07835cedac02

📥 Commits

Reviewing files that changed from the base of the PR and between 84b8b18 and 554199a.

📒 Files selected for processing (5)
  • docs/glossary.md
  • packages/1-framework/1-core/shared/framework-components/package.json
  • packages/1-framework/1-core/shared/framework-components/src/control-instances.ts
  • packages/2-mongo-family/9-family/README.md
  • packages/2-mongo-family/9-family/test/control.test.ts
✅ Files skipped from review due to trivial changes (3)
  • packages/2-mongo-family/9-family/test/control.test.ts
  • packages/2-mongo-family/9-family/README.md
  • packages/1-framework/1-core/shared/framework-components/package.json

@wmadden

wmadden commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Merging without review because everyone is on holiday

@wmadden
wmadden merged commit 5c14cf7 into main Apr 3, 2026
14 checks passed
@wmadden
wmadden deleted the tml-2181-build-mongo-psl-interpreter-and-wire-into-demo-app-m3-task-39 branch April 3, 2026 12:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant