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

refactor(mongo): decompose mongo-core into layered packages - #298

Merged
wmadden merged 28 commits into
mainfrom
tml-2201-mongo-family-layering-reorganization
Apr 6, 2026
Merged

wmadden merged 28 commits into
mainfrom
tml-2201-mongo-family-layering-reorganization

Conversation

@wmadden

@wmadden wmadden commented Apr 5, 2026 •

Copy link
Copy Markdown
Contributor

closes TML-2201

Key snippet

Before / After

// BEFORE — packages/2-mongo-family/1-core/src/adapter-types.ts
export interface MongoQueryPlanLike {
  readonly collection: string;
  readonly command: { readonly kind: string; readonly collection: string };
  readonly meta: PlanMeta;
}

export interface MongoAdapter {
  lower(plan: MongoQueryPlanLike): AnyMongoWireCommand;
}
// AFTER — packages/2-mongo-family/6-transport/mongo-lowering/src/adapter-types.ts
import type { MongoQueryPlan } from '@prisma-next/mongo-query-ast';
import type { AnyMongoWireCommand } from '@prisma-next/mongo-wire';

export interface MongoAdapter {
  lower(plan: MongoQueryPlan): AnyMongoWireCommand;
}

The adapter interface moves from layer 1 (1-core) to layer 6 (6-transport), where it can directly reference the real query plan type — eliminating the structural shim.

Intent

Decompose the @prisma-next/mongo-core monolith into properly layered packages so that each package has a bounded responsibility and the adapter interface can reference real query-layer types — eliminating the MongoQueryPlanLike structural shim that existed solely to work around a layering constraint. Additionally, record the codec-owned value serialization design (ADR 184) that emerged during this work.

Change map

The story

  1. Document design decisions before implementing. Two docs commits record the execution plan and update the layering design with decisions made during shaping (executor stays in ORM, codec-types owned by adapter, validate-domain deleted). These establish expectations for the implementation.

  2. Extract foundation packages from 1-core. Three packages are carved out of the monolith bottom-up — mongo-value (no deps), mongo-codec (no deps), mongo-contract (depends on framework contract types). Each commit moves source files, creates the package boilerplate, writes the new exports/index.ts, and updates all imports across the repo. After this, 1-core retains only wire/transport concerns.

  3. Move codec-type ownership to the adapter. The CodecTypes import pointer is removed from the family's mongoTargetDescriptor and added to the adapter descriptor in adapter-mongo. The duplicate codec-types.ts in 1-core is deleted. This follows the SQL precedent where the adapter declares its own codec types.

  4. Extract transport packages and delete 1-core. Wire command classes and result types move to mongo-wire; adapter and driver interfaces move to mongo-lowering. After both are extracted, 1-core is empty and deleted.

  5. Eliminate the MongoQueryPlanLike shim. With the adapter interface now in the transport layer (above query), MongoAdapter.lower() can accept MongoQueryPlan directly. The adapter implementation no longer needs the plan.command as AnyMongoCommand cast — it destructures plan.command with full type safety. MongoRuntime.execute() upgrades from MongoQueryPlanLike to MongoQueryPlan<Row>, gaining row-type propagation.

  6. Renumber directories and update architecture config. Directories are renumbered to match the target layer ordering (2-query -> 4-query, 4-orm -> 5-query-builders, 5-runtime -> 7-runtime). The architecture.config.json layer order for mongo is updated to the eight-layer sequence, and all package globs are adjusted.

  7. Record ADR 184 — codec-owned value serialization. During the layering work, a design question surfaced: how should typed values (column defaults, discriminator values) be serialized across boundaries? ADR 184 establishes that the codec owning a type is responsible for all its serialization boundaries (contract JSON, wire, DDL, PSL), eliminating the hardcoded bigint/Date branches and the tagged type system. This supersedes ADR 167's deferred v2 design and resolves ADR 173's open question about discriminator value encoding.

Behavior changes & evidence

Compatibility / migration / risk

  • Package rename: @prisma-next/mongo-core no longer exists. All internal consumers are updated. No external consumers exist (prototype).
  • Generated artifacts change: contract.d.ts files now import from @prisma-next/mongo-contract and @prisma-next/adapter-mongo/codec-types. Existing generated contracts will need re-emission.
  • API change: MongoRuntime.execute() signature changes from execute<Row>(plan: MongoQueryPlanLike) to execute<Row>(plan: MongoQueryPlan<Row>). Source-compatible for existing call sites.

Follow-ups / open questions

  • ADR 184 is a design record only — implementation is future work.
  • The ORM consolidation project continues with Phase 1.75 (polymorphism) and Phase 2 (shared Collection extraction).

Non-goals / intentionally out of scope

  • Further decomposition of mongo-query-ast — explicitly deferred.
  • Moving MongoQueryExecutor from ORM to query layer — decided against.
  • Changes to the SQL family layering — Mongo-only refactor.
  • Implementing ADR 184's codec interface extensions — design record only.

Summary by CodeRabbit

  • Refactor
    • Reorganized MongoDB family into smaller, layered packages (foundation, query, transport, runtime) for clearer boundaries and safer APIs.
  • New Features
    • Introduced codec-owned value serialization to standardize literal encoding across authoring, contract, migration, and runtime.
  • Documentation
    • Added and updated ADRs, design docs, READMEs, and planning notes to reflect new architecture and API contracts.

@coderabbitai

coderabbitai Bot commented Apr 5, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: b16b4145-b742-4fda-855e-17d7e72c648a

📥 Commits

Reviewing files that changed from the base of the PR and between 570be0b and 45c95c1.

📒 Files selected for processing (1)
  • docs/architecture docs/subsystems/10. MongoDB Family.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/architecture docs/subsystems/10. MongoDB Family.md

📝 Walkthrough

Walkthrough

Restructures the MongoDB family by splitting mongo-core into focused packages (mongo-codec, mongo-contract, mongo-value, mongo-lowering, mongo-wire), updates package-to-layer mappings and layer order in architecture.config.json, tightens adapter/runtime signatures (use MongoQueryPlan), and updates imports, docs, tests, and build configs accordingly.

Changes

Cohort / File(s) Summary
Architecture config & docs
architecture.config.json, docs/architecture/subsystems/10. MongoDB Family.md, docs/planning/mongo-target/1-design-docs/mongo-execution-components.md
Remapped package globs into new layers (foundation, query, query-builders, transport, runtime), updated layerOrder.mongo, and documented tightened adapter/runtime signatures (MongoQueryPlan).
Foundation packages (new & renamed)
packages/2-mongo-family/1-foundation/mongo-{codec,contract,value}/**, packages/2-mongo-family/1-core/**
Added mongo-codec, mongo-contract, mongo-value; removed/trimmed old 1-core exports/README; created exports, package.json, tsconfigs, vitest configs, and README docs.
Transport packages (new)
packages/2-mongo-family/6-transport/{mongo-lowering,mongo-wire}/**
Added mongo-lowering (defines MongoAdapter/MongoDriver) and mongo-wire (wire command/result types), plus package manifests, exports, build/test configs and READMEs.
Query / query-builders
packages/2-mongo-family/4-query/query-ast/**, packages/2-mongo-family/5-query-builders/**
Renumbered/reorganized packages, replaced @prisma-next/mongo-core imports with mongo-value/mongo-contract, added tsconfig/vitest/tsdown entries.
Adapter / Target / Driver
packages/3-mongo-target/2-mongo-adapter/**, packages/3-mongo-target/3-mongo-driver/**
Switched imports to granular packages (mongo-codec, mongo-lowering, mongo-value, mongo-wire); changed MongoAdapter.lower signature to accept MongoQueryPlan; removed prior MongoQueryPlanLike artifacts.
Runtime
packages/2-mongo-family/7-runtime/**, packages/2-mongo-family/7-runtime/src/mongo-runtime.ts
Updated MongoRuntime.execute<Row> signature to accept MongoQueryPlan<Row>; switched imports to mongo-lowering and mongo-value; added tsdown/tsconfig files.
Family descriptors & examples/tests
packages/2-mongo-family/9-family/**, examples/mongo-demo/**, test/integration/**, various tests across packages
Removed codec-types mapping in family descriptor, updated many import paths in examples/tests/fixtures to new packages (mongo-contract, mongo-value, @prisma-next/adapter-mongo/codec-types) and adjusted test expectations/fixtures.
ADRs & architecture docs
docs/architecture/adrs/ADR 167.md, ADR 173.md, ADR 184.md, ADR 185.md, docs/planning/april-milestone.md
Added ADR 184 (codec-owned value serialization), marked ADR 167 superseded, resolved discriminator codec usage in ADR 173, renamed ADR 183→185, and updated planning milestone text.
Build & config files
**/tsconfig.json, **/tsdown.config.ts, **/vitest.config.ts, removed biome.jsonc entries`
Added per-package TypeScript/Vitest/tsdown configs for new packages; removed obsolete Biome config; adjusted tsdown entries (removed codec-types entry).

Sequence Diagram(s)

sequenceDiagram
  participant Runtime as MongoRuntime
  participant Adapter as MongoAdapter
  participant Driver as MongoDriver
  participant DB as MongoDB

  Runtime->>Adapter: execute(plan: MongoQueryPlan) -> adapter.lower(plan)
  Adapter-->>Runtime: AnyMongoWireCommand
  Runtime->>Driver: driver.execute(wireCommand)
  Driver->>DB: run wire command
  DB-->>Driver: results (cursor/iterable)
  Driver-->>Runtime: AsyncIterableResult<Row>
  Runtime-->>Client: AsyncIterableResult<Row>
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hopped through packages, tidy and bright,

Split core into codecs, contracts, and light,
Adapters now lower, drivers reply,
Plans flow like carrots beneath the sky,
A soft thump — clean layers take flight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main refactoring: decomposing the monolithic mongo-core package into multiple layered packages with bounded responsibilities.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2201-mongo-family-layering-reorganization

Comment @coderabbitai help to get the list of available commands and usage tips.

@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

🧹 Nitpick comments (3)
packages/2-mongo-family/1-foundation/mongo-codec/package.json (1)

30-36: Expose module-level subpaths for the shared codec surface.

Only exporting . here means internal callers have to come through the root package instead of explicit modules. For a shared-plane package, it would be better to publish the stable surfaces separately—at least the type surface and the factory surface—so consumers can import them directly.

As per coding guidelines, "Create explicit export paths in package.json following the pattern: ./types, ./validators, ./factories for shared plane packages" and "Import directly from the specific module ... instead of barrel imports."

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

In `@packages/2-mongo-family/1-foundation/mongo-codec/package.json` around lines
30 - 36, The package currently only exports the root ("."), forcing consumers to
import from the package barrel; add explicit export subpaths for the stable
shared surfaces so callers can import modules directly. Update the "exports"
block in package.json to include "./types", "./validators", and "./factories"
keys mapped to their built JS (e.g., dist/types.mjs, dist/validators.mjs,
dist/factories.mjs) and corresponding type entries (e.g., types:
"./dist/index.d.mts" or matching per-subpath), and ensure the "types" and
"main"/"module" fields align with those subpath entries so consumers can import
from "mongo-codec/types", "mongo-codec/validators", and "mongo-codec/factories"
instead of the root.
packages/2-mongo-family/6-transport/mongo-wire/package.json (1)

31-37: Expose the wire modules as explicit package subpaths.

Right now consumers only have the root barrel, which encourages imports like @prisma-next/mongo-wire instead of explicit module boundaries. Publishing the stable modules separately—e.g. commands and results—would keep the new layering more explicit.

As per coding guidelines, "Create explicit export paths in package.json following the pattern: ./types, ./validators, ./factories for shared plane packages" and "Import directly from the specific module ... instead of barrel imports."

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

In `@packages/2-mongo-family/6-transport/mongo-wire/package.json` around lines 31
- 37, Update the package.json "exports" to add explicit subpath exports for the
wire modules (e.g., "./commands", "./results", "./types", "./validators",
"./factories") so consumers can import specific modules instead of the barrel;
point each export to the compiled ESM entry in dist (e.g.,
"./dist/commands/index.mjs", "./dist/results/index.mjs") and add corresponding
type entries pointing to their declaration files (e.g.,
"./dist/commands/index.d.mts"), and mirror these subpaths under "types" or
include "./package.json" as already present—modify the existing "exports" map
(and ensure "main"/"module"/"types" remain consistent) so each unique symbol
(the export keys like "./commands" and "./results") resolves to the right dist
and type files.
docs/architecture docs/adrs/ADR 184 - Codec-owned value serialization.md (1)

92-101: Minor: Consider varying sentence structure for readability.

Three sentences in this section begin with "PSL" which reads slightly repetitively. Consider rephrasing for variety:

📝 Suggested rewording
-PSL is an authoring-specific concern. PSL's grammar constrains what literal syntax is possible — not every codec can have a PSL literal representation. Contributed through the authoring layer, keyed by codec ID:
+PSL is an authoring-specific concern. The grammar constrains what literal syntax is possible — not every codec can have a PSL literal representation. Contributed through the authoring layer, keyed by codec ID:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/architecture` docs/adrs/ADR 184 - Codec-owned value serialization.md
around lines 92 - 101, The opening sentences in the PSL literal interface
section have repetitive structure, with multiple sentences beginning with "PSL"
which reduces readability. Rephrase the sentences that start with "PSL is an
authoring-specific concern" and "PSL's grammar constrains what literal syntax is
possible" to vary the sentence structure and improve flow, while maintaining the
same technical meaning and information content.
🤖 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/2-mongo-family/4-query/query-ast/tsconfig.json`:
- Line 7: Update the tsconfig "exclude" array to also exclude fixture files by
adding the pattern "test/fixtures/**/*" so fixture-only types won't be pulled
into project typechecking; modify the existing "exclude" entry (the "exclude"
key in tsconfig.json) to include that string alongside "dist", "dist-tsc",
"dist-tsc-prod", and "node_modules".

---

Nitpick comments:
In `@docs/architecture` docs/adrs/ADR 184 - Codec-owned value serialization.md:
- Around line 92-101: The opening sentences in the PSL literal interface section
have repetitive structure, with multiple sentences beginning with "PSL" which
reduces readability. Rephrase the sentences that start with "PSL is an
authoring-specific concern" and "PSL's grammar constrains what literal syntax is
possible" to vary the sentence structure and improve flow, while maintaining the
same technical meaning and information content.

In `@packages/2-mongo-family/1-foundation/mongo-codec/package.json`:
- Around line 30-36: The package currently only exports the root ("."), forcing
consumers to import from the package barrel; add explicit export subpaths for
the stable shared surfaces so callers can import modules directly. Update the
"exports" block in package.json to include "./types", "./validators", and
"./factories" keys mapped to their built JS (e.g., dist/types.mjs,
dist/validators.mjs, dist/factories.mjs) and corresponding type entries (e.g.,
types: "./dist/index.d.mts" or matching per-subpath), and ensure the "types" and
"main"/"module" fields align with those subpath entries so consumers can import
from "mongo-codec/types", "mongo-codec/validators", and "mongo-codec/factories"
instead of the root.

In `@packages/2-mongo-family/6-transport/mongo-wire/package.json`:
- Around line 31-37: Update the package.json "exports" to add explicit subpath
exports for the wire modules (e.g., "./commands", "./results", "./types",
"./validators", "./factories") so consumers can import specific modules instead
of the barrel; point each export to the compiled ESM entry in dist (e.g.,
"./dist/commands/index.mjs", "./dist/results/index.mjs") and add corresponding
type entries pointing to their declaration files (e.g.,
"./dist/commands/index.d.mts"), and mirror these subpaths under "types" or
include "./package.json" as already present—modify the existing "exports" map
(and ensure "main"/"module"/"types" remain consistent) so each unique symbol
(the export keys like "./commands" and "./results") resolves to the right dist
and type files.
🪄 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: d4f513a9-47f7-44c9-8ac4-1b23ae6fe3be

📥 Commits

Reviewing files that changed from the base of the PR and between d4a3694 and 38cceae.

⛔ Files ignored due to path filters (5)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/orm-consolidation/plan.md is excluded by !projects/**
  • projects/orm-consolidation/plans/mongo-family-layering-execution.md is excluded by !projects/**
  • projects/orm-consolidation/plans/mongo-family-layering.md is excluded by !projects/**
  • test/integration/test/mongo/fixtures/generated/contract.d.ts is excluded by !**/generated/**
📒 Files selected for processing (143)
  • architecture.config.json
  • docs/architecture docs/adrs/ADR 167 - Typed default literal pipeline and extensibility.md
  • docs/architecture docs/adrs/ADR 173 - Polymorphism via discriminator and variants.md
  • docs/architecture docs/adrs/ADR 184 - Codec-owned value serialization.md
  • docs/architecture docs/subsystems/10. MongoDB Family.md
  • docs/planning/april-milestone.md
  • docs/planning/mongo-target/1-design-docs/mongo-execution-components.md
  • examples/mongo-demo/package.json
  • examples/mongo-demo/src/contract.d.ts
  • examples/mongo-demo/src/db.ts
  • examples/mongo-demo/test/blog.test.ts
  • examples/mongo-demo/test/crud-lifecycle.test.ts
  • packages/1-framework/1-core/shared/framework-components/test/control-stack.test.ts
  • packages/2-mongo-family/1-core/README.md
  • packages/2-mongo-family/1-core/src/adapter-types.ts
  • packages/2-mongo-family/1-core/src/exports/codec-types.ts
  • packages/2-mongo-family/1-core/src/exports/index.ts
  • packages/2-mongo-family/1-core/src/validate-domain.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/package.json
  • packages/2-mongo-family/1-foundation/mongo-codec/src/codec-registry.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/src/codecs.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/test/codecs.test-d.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/test/codecs.test.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/tsconfig.json
  • packages/2-mongo-family/1-foundation/mongo-codec/tsdown.config.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/vitest.config.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/package.json
  • packages/2-mongo-family/1-foundation/mongo-contract/src/contract-schema.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/contract-types.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/validate-mongo-contract.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/validate-storage.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/fixtures/orm-contract.d.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/fixtures/orm-contract.json
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate-domain.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate-storage.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/tsconfig.json
  • packages/2-mongo-family/1-foundation/mongo-contract/tsdown.config.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/vitest.config.ts
  • packages/2-mongo-family/1-foundation/mongo-value/package.json
  • packages/2-mongo-family/1-foundation/mongo-value/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-value/src/param-ref.ts
  • packages/2-mongo-family/1-foundation/mongo-value/src/values.ts
  • packages/2-mongo-family/1-foundation/mongo-value/tsconfig.json
  • packages/2-mongo-family/1-foundation/mongo-value/tsdown.config.ts
  • packages/2-mongo-family/1-foundation/mongo-value/vitest.config.ts
  • packages/2-mongo-family/3-tooling/emitter/package.json
  • packages/2-mongo-family/3-tooling/emitter/src/index.ts
  • packages/2-mongo-family/3-tooling/emitter/test/emitter-hook.e2e.test.ts
  • packages/2-mongo-family/3-tooling/emitter/test/emitter-hook.generation.test.ts
  • packages/2-mongo-family/3-tooling/emitter/test/generate-orm-fixture.ts
  • packages/2-mongo-family/4-query/query-ast/README.md
  • packages/2-mongo-family/4-query/query-ast/biome.jsonc
  • packages/2-mongo-family/4-query/query-ast/package.json
  • packages/2-mongo-family/4-query/query-ast/src/ast-node.ts
  • packages/2-mongo-family/4-query/query-ast/src/commands.ts
  • packages/2-mongo-family/4-query/query-ast/src/exports/index.ts
  • packages/2-mongo-family/4-query/query-ast/src/filter-expressions.ts
  • packages/2-mongo-family/4-query/query-ast/src/query-plan.ts
  • packages/2-mongo-family/4-query/query-ast/src/stages.ts
  • packages/2-mongo-family/4-query/query-ast/src/visitors.ts
  • packages/2-mongo-family/4-query/query-ast/test/filter-expressions.test.ts
  • packages/2-mongo-family/4-query/query-ast/test/stages.test.ts
  • packages/2-mongo-family/4-query/query-ast/tsconfig.json
  • packages/2-mongo-family/4-query/query-ast/tsconfig.prod.json
  • packages/2-mongo-family/4-query/query-ast/tsdown.config.ts
  • packages/2-mongo-family/4-query/query-ast/vitest.config.ts
  • packages/2-mongo-family/5-query-builders/README.md
  • packages/2-mongo-family/5-query-builders/package.json
  • packages/2-mongo-family/5-query-builders/src/collection-state.ts
  • packages/2-mongo-family/5-query-builders/src/collection.ts
  • packages/2-mongo-family/5-query-builders/src/compile.ts
  • packages/2-mongo-family/5-query-builders/src/executor.ts
  • packages/2-mongo-family/5-query-builders/src/exports/index.ts
  • packages/2-mongo-family/5-query-builders/src/mongo-orm.ts
  • packages/2-mongo-family/5-query-builders/src/types.ts
  • packages/2-mongo-family/5-query-builders/test/collection.test.ts
  • packages/2-mongo-family/5-query-builders/test/compile.test.ts
  • packages/2-mongo-family/5-query-builders/test/orm-types.test-d.ts
  • packages/2-mongo-family/5-query-builders/tsconfig.json
  • packages/2-mongo-family/5-query-builders/tsconfig.prod.json
  • packages/2-mongo-family/5-query-builders/tsdown.config.ts
  • packages/2-mongo-family/5-query-builders/vitest.config.ts
  • packages/2-mongo-family/5-runtime/biome.jsonc
  • packages/2-mongo-family/5-runtime/tsconfig.prod.json
  • packages/2-mongo-family/6-transport/mongo-lowering/package.json
  • packages/2-mongo-family/6-transport/mongo-lowering/src/adapter-types.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/src/driver-types.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/src/exports/index.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/tsconfig.json
  • packages/2-mongo-family/6-transport/mongo-lowering/tsdown.config.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/vitest.config.ts
  • packages/2-mongo-family/6-transport/mongo-wire/package.json
  • packages/2-mongo-family/6-transport/mongo-wire/src/exports/index.ts
  • packages/2-mongo-family/6-transport/mongo-wire/src/results.ts
  • packages/2-mongo-family/6-transport/mongo-wire/src/wire-commands.ts
  • packages/2-mongo-family/6-transport/mongo-wire/tsconfig.json
  • packages/2-mongo-family/6-transport/mongo-wire/tsdown.config.ts
  • packages/2-mongo-family/6-transport/mongo-wire/vitest.config.ts
  • packages/2-mongo-family/7-runtime/README.md
  • packages/2-mongo-family/7-runtime/biome.jsonc
  • packages/2-mongo-family/7-runtime/package.json
  • packages/2-mongo-family/7-runtime/src/exports/index.ts
  • packages/2-mongo-family/7-runtime/src/mongo-runtime.ts
  • packages/2-mongo-family/7-runtime/test/aggregate.test.ts
  • packages/2-mongo-family/7-runtime/test/contract-types.test-d.ts
  • packages/2-mongo-family/7-runtime/test/delete-many.test.ts
  • packages/2-mongo-family/7-runtime/test/delete.test.ts
  • packages/2-mongo-family/7-runtime/test/find-one-and-delete.test.ts
  • packages/2-mongo-family/7-runtime/test/find-one-and-update.test.ts
  • packages/2-mongo-family/7-runtime/test/fixtures/contract.d.ts
  • packages/2-mongo-family/7-runtime/test/fixtures/contract.json
  • packages/2-mongo-family/7-runtime/test/insert-many.test.ts
  • packages/2-mongo-family/7-runtime/test/insert.test.ts
  • packages/2-mongo-family/7-runtime/test/orm-contract-types.test-d.ts
  • packages/2-mongo-family/7-runtime/test/read-plan.test.ts
  • packages/2-mongo-family/7-runtime/test/setup.ts
  • packages/2-mongo-family/7-runtime/test/update-many.test.ts
  • packages/2-mongo-family/7-runtime/test/update.test.ts
  • packages/2-mongo-family/7-runtime/tsconfig.json
  • packages/2-mongo-family/7-runtime/tsconfig.prod.json
  • packages/2-mongo-family/7-runtime/tsdown.config.ts
  • packages/2-mongo-family/7-runtime/vitest.config.ts
  • packages/2-mongo-family/9-family/package.json
  • 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/test/control.test.ts
  • packages/3-mongo-target/1-mongo-target/package.json
  • packages/3-mongo-target/2-mongo-adapter/package.json
  • packages/3-mongo-target/2-mongo-adapter/src/core/codecs.ts
  • packages/3-mongo-target/2-mongo-adapter/src/exports/control.ts
  • packages/3-mongo-target/2-mongo-adapter/src/lowering.ts
  • packages/3-mongo-target/2-mongo-adapter/src/mongo-adapter.ts
  • packages/3-mongo-target/2-mongo-adapter/src/resolve-value.ts
  • packages/3-mongo-target/2-mongo-adapter/test/lowering.test.ts
  • packages/3-mongo-target/2-mongo-adapter/test/mongo-adapter.test.ts
  • packages/3-mongo-target/3-mongo-driver/package.json
  • packages/3-mongo-target/3-mongo-driver/src/mongo-driver.ts
  • packages/3-mongo-target/3-mongo-driver/test/mongo-driver.test.ts
  • test/integration/package.json
  • test/integration/test/mongo/orm.test.ts
💤 Files with no reviewable changes (11)
  • packages/2-mongo-family/9-family/test/control.test.ts
  • packages/2-mongo-family/1-foundation/mongo-value/tsdown.config.ts
  • packages/2-mongo-family/1-core/README.md
  • packages/2-mongo-family/1-foundation/mongo-codec/vitest.config.ts
  • packages/2-mongo-family/1-core/src/exports/codec-types.ts
  • packages/2-mongo-family/1-core/src/validate-domain.ts
  • packages/2-mongo-family/5-runtime/tsconfig.prod.json
  • packages/2-mongo-family/5-runtime/biome.jsonc
  • packages/2-mongo-family/1-core/src/adapter-types.ts
  • packages/2-mongo-family/9-family/src/core/mongo-target-descriptor.ts
  • packages/2-mongo-family/1-core/src/exports/index.ts

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/mongo-orm

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

@prisma-next/mongo-runtime

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

@prisma-next/family-mongo

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

@prisma-next/sql-runtime

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

@prisma-next/family-sql

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

@prisma-next/extension-paradedb

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

@prisma-next/extension-pgvector

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

@prisma-next/postgres

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

@prisma-next/sql-orm-client

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

@prisma-next/target-mongo

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

@prisma-next/adapter-mongo

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

@prisma-next/driver-mongo

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

@prisma-next/contract

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

@prisma-next/utils

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

@prisma-next/config

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

@prisma-next/core-control-plane

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

@prisma-next/core-execution-plane

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

@prisma-next/framework-components

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

@prisma-next/operations

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

@prisma-next/contract-authoring

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

@prisma-next/ids

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

@prisma-next/psl-parser

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

@prisma-next/psl-printer

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

@prisma-next/cli

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

@prisma-next/emitter

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

@prisma-next/migration-tools

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

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

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

@prisma-next/runtime-executor

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

@prisma-next/mongo-codec

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-codec@298

@prisma-next/mongo-contract

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

@prisma-next/mongo-value

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-value@298

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-contract-psl@298

@prisma-next/mongo-emitter

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

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-query-ast@298

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-lowering@298

@prisma-next/mongo-wire

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-wire@298

@prisma-next/sql-contract

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

@prisma-next/sql-errors

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

@prisma-next/sql-operations

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

@prisma-next/sql-schema-ir

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

@prisma-next/sql-contract-psl

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

@prisma-next/sql-contract-ts

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

@prisma-next/sql-contract-emitter

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

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

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

@prisma-next/sql-relational-core

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

@prisma-next/sql-builder

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

@prisma-next/target-postgres

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

@prisma-next/adapter-postgres

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

@prisma-next/driver-postgres

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

commit: 45c95c1

@wmadden
wmadden force-pushed the tml-2201-mongo-family-layering-reorganization branch from 643d2f8 to b7976cd Compare April 6, 2026 08:41
wmadden added 26 commits April 6, 2026 10:48
Record implementation phases (foundation split, transport layer,
shim elimination, renumber) and design decisions: MongoQueryExecutor
stays in ORM, codec-types moves to adapter descriptor, mongo-codec
has no codec-types entrypoint.
validate-domain.ts is a pure re-export — delete it, import directly
from @prisma-next/contract. Update MongoQueryExecutor rationale with
the SQL ORM client precedent (consumer owns the interface).
Move MongoValue, Document, MongoParamRef, and related value types
into a dedicated foundation package. Update all consumers to import
from the new package directly.
Move MongoCodec interface, mongoCodec() factory, MongoCodecRegistry,
and related types into a dedicated foundation package. Update adapter
codecs import to use the new package.
Move contract types (MongoContract, MongoStorage, etc.), validation
(validateMongoContract, validateMongoStorage), and related schemas
into a dedicated foundation package. Update the emitter template
string, ORM, family, runtime fixtures, examples, and integration
tests to import from the new package. Delete validate-domain.ts
re-export in favor of direct imports from @prisma-next/contract.
Delete the hand-maintained CodecTypes duplicate from mongo-core,
remove types.codecTypes.import from the target descriptor, and add
it to the mongo adapter descriptor following the postgres pattern.
Update all generated contract.d.ts fixtures and emitter tests to
reference @prisma-next/adapter-mongo/codec-types.
Remove all re-exports of value, codec, contract, and validation
types from mongo-core exports. mongo-core now only exports wire
command types and lowering interfaces (adapter/driver types).
Move wire command classes (InsertOneWireCommand, etc.) and result
types into a dedicated transport-layer package. Update adapter,
driver, and their tests to import from the new package.
Move MongoAdapter and MongoDriver interfaces (with MongoQueryPlanLike)
into a dedicated transport-layer package. Update runtime, adapter,
and driver to import from the new package.
All contents have been extracted to dedicated packages:
- mongo-value, mongo-codec, mongo-contract (foundation)
- mongo-wire, mongo-lowering (transport)

Remove all @prisma-next/mongo-core dependency declarations and
update remaining test imports to reference the new packages.
Align WS4 task 3 with the updated ORM consolidation plan: implement
polymorphism independently in both ORM clients before extracting the
shared Collection interface (Phase 2). The two families diverge in
query compilation for polymorphism, so both concrete implementations
are needed to discover the right abstraction boundary (ADR 175).
Replace the structural MongoQueryPlanLike interface with the concrete
MongoQueryPlan type from @prisma-next/mongo-query-ast in the adapter
interface, runtime, and adapter implementation. This is possible now
that the transport layer sits above the query layer in the package
hierarchy.
Rename 2-query -> 4-query, 4-orm -> 5-query-builders,
5-runtime -> 7-runtime to match the layer order defined in the
layering plan. Update architecture.config.json with new layer names
and globs for the mongo domain. Fix test fixtures and imports that
referenced the deleted 1-core directory.
Codecs own all representations of their values (wire, contract JSON,
DDL, PSL) instead of hardcoding bigint/Date branches across five
pipeline stages. Eliminates the tagged type system ($type wrappers)
by relying on the codec ID from context.

Supersedes ADR 167 v2. Resolves ADR 173 open question on untyped
discriminator values.
Lead with the concrete pain (six hardcoded branches for bigint),
build to the key insight (codec ID is always in context), then
present the decision and walk through an end-to-end example.
Add migration operations as an additional boundary. Move
alternatives considered to the end.
Address code review feedback F01 and F02: update the package layout
section to match the current directory structure after renumbering,
and fix the MongoRuntimeCore name to MongoRuntime (the public interface
name, not the private implementation class).
Codec-owned value serialization is a prerequisite for Phase 1.75
(polymorphism): the emitter and runtime need codec dispatch to
serialize/decode discriminator values in contract.json. Sequenced
after Phase 1.5 and before Phase 1.75 with updated dependency chain.
Split coarse whole-package plane globs into per-entrypoint assignments
to match the SQL/Postgres precedent. This allows lint:deps to enforce
the migration-runtime boundary within these packages.

- 9-family: src/core/** -> shared, src/exports/control.ts -> migration
- 2-mongo-adapter: control.ts -> migration, index.ts -> runtime,
  codec-types.ts -> shared
…lification in Phase 1.75

Value objects and typed JSON columns serve different purposes but share
infrastructure. This spec defines the end-to-end implementation of value
objects (ADR 178) and the simplification of typed JSON column machinery
to use codec-dispatched type rendering (ADR 184 pattern) instead of
bespoke parameterizedRenderers.
…n orm-contract fixture

The orm-contract.d.ts test fixture imports CodecTypes from
@prisma-next/adapter-mongo/codec-types. TypeScript resolves module
imports relative to the file location (mongo-contract), not the
importing package (mongo-orm). Both packages need the dependency:
mongo-contract for resolution and mongo-orm for completeness.
Phase 1.75a: typed JSON simplification (TML-2204)
Phase 1.75b: polymorphism in both families (TML-2205)
Phase 1.75c: value objects & embedded documents (TML-2206)

1.75a and 1.75b are independent and can run in parallel.
1.75c depends on 1.75a (codec-dispatched renderType).
Replaces cancelled TML-2203.
ADR 183 (aggregation pipeline only) was created first and has
widespread references. The SPI types ADR was created a day later
on a different branch, unaware of the collision.
validateContractDomain now returns void (warnings and orphan
detection were removed from main). Align mongo-contract validation
and tests accordingly.
@wmadden
wmadden force-pushed the tml-2201-mongo-family-layering-reorganization branch from b7976cd to 570be0b Compare April 6, 2026 08:51

@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: 2

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

Inline comments:
In `@architecture.config.json`:
- Around line 316-329: Update the package exports for
packages/3-mongo-target/2-mongo-adapter and packages/2-mongo-family/9-family so
they expose the standardized subpath keys ./runtime, ./adapter and ./control (or
./ as appropriate) instead of mapping default or wrong subpaths: open each
package.json and add/replace the "exports" map to include "./runtime" pointing
to the runtime entry (e.g., src/exports/index.ts), "./adapter" pointing to
shared/codec or adapter types (e.g., src/exports/codec-types.ts), and
"./control" pointing to control entry (e.g., src/exports/control.ts); then
update architecture.config.json globs to exactly match those source files
(ensure entries reference
packages/3-mongo-target/2-mongo-adapter/src/exports/control.ts, .../index.ts,
.../codec-types.ts and the corresponding files under
packages/2-mongo-family/9-family) so the domain/layer/plane mapping aligns with
the new subpath names.

In `@docs/architecture` docs/subsystems/10. MongoDB Family.md:
- Line 255: The docs incorrectly show MongoRuntime.execute as execute(plan:
MongoQueryPlan): AsyncIterableResult<Row>; update the signature to include the
generic type parameter by documenting it as execute<Row>(plan:
MongoQueryPlan<Row>): AsyncIterableResult<Row>, ensuring the generic appears on
the method and on the MongoQueryPlan type argument (referencing
MongoRuntime.execute, MongoQueryPlan and AsyncIterableResult) so the
documentation matches the actual interface.
🪄 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: 5ba65237-a4d5-4558-8560-20e020fbb167

📥 Commits

Reviewing files that changed from the base of the PR and between b7976cd and 570be0b.

📒 Files selected for processing (109)
  • architecture.config.json
  • docs/architecture docs/adrs/ADR 167 - Typed default literal pipeline and extensibility.md
  • docs/architecture docs/adrs/ADR 173 - Polymorphism via discriminator and variants.md
  • docs/architecture docs/adrs/ADR 184 - Codec-owned value serialization.md
  • docs/architecture docs/adrs/ADR 185 - SPI types live at the lowest consuming layer.md
  • docs/architecture docs/subsystems/10. MongoDB Family.md
  • docs/planning/april-milestone.md
  • docs/planning/mongo-target/1-design-docs/mongo-execution-components.md
  • examples/mongo-demo/package.json
  • examples/mongo-demo/src/contract.d.ts
  • examples/mongo-demo/src/db.ts
  • examples/mongo-demo/test/blog.test.ts
  • examples/mongo-demo/test/crud-lifecycle.test.ts
  • packages/1-framework/0-foundation/contract/README.md
  • packages/1-framework/1-core/framework-components/README.md
  • packages/1-framework/1-core/framework-components/test/control-stack.test.ts
  • packages/2-mongo-family/1-core/README.md
  • packages/2-mongo-family/1-core/src/adapter-types.ts
  • packages/2-mongo-family/1-core/src/exports/codec-types.ts
  • packages/2-mongo-family/1-core/src/exports/index.ts
  • packages/2-mongo-family/1-core/src/validate-domain.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/README.md
  • packages/2-mongo-family/1-foundation/mongo-codec/package.json
  • packages/2-mongo-family/1-foundation/mongo-codec/src/codec-registry.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/src/codecs.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/test/codecs.test-d.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/test/codecs.test.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/tsconfig.json
  • packages/2-mongo-family/1-foundation/mongo-codec/tsconfig.prod.json
  • packages/2-mongo-family/1-foundation/mongo-codec/tsdown.config.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/vitest.config.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/README.md
  • packages/2-mongo-family/1-foundation/mongo-contract/package.json
  • packages/2-mongo-family/1-foundation/mongo-contract/src/contract-schema.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/contract-types.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/validate-mongo-contract.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/validate-storage.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/fixtures/orm-contract.d.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/fixtures/orm-contract.json
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate-domain.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate-storage.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/tsconfig.json
  • packages/2-mongo-family/1-foundation/mongo-contract/tsconfig.prod.json
  • packages/2-mongo-family/1-foundation/mongo-contract/tsdown.config.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/vitest.config.ts
  • packages/2-mongo-family/1-foundation/mongo-value/README.md
  • packages/2-mongo-family/1-foundation/mongo-value/package.json
  • packages/2-mongo-family/1-foundation/mongo-value/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-value/src/param-ref.ts
  • packages/2-mongo-family/1-foundation/mongo-value/src/values.ts
  • packages/2-mongo-family/1-foundation/mongo-value/tsconfig.json
  • packages/2-mongo-family/1-foundation/mongo-value/tsconfig.prod.json
  • packages/2-mongo-family/1-foundation/mongo-value/tsdown.config.ts
  • packages/2-mongo-family/1-foundation/mongo-value/vitest.config.ts
  • packages/2-mongo-family/3-tooling/emitter/package.json
  • packages/2-mongo-family/3-tooling/emitter/src/index.ts
  • packages/2-mongo-family/3-tooling/emitter/test/emitter-hook.e2e.test.ts
  • packages/2-mongo-family/3-tooling/emitter/test/emitter-hook.generation.test.ts
  • packages/2-mongo-family/3-tooling/emitter/test/generate-orm-fixture.ts
  • packages/2-mongo-family/4-query/query-ast/README.md
  • packages/2-mongo-family/4-query/query-ast/biome.jsonc
  • packages/2-mongo-family/4-query/query-ast/package.json
  • packages/2-mongo-family/4-query/query-ast/src/ast-node.ts
  • packages/2-mongo-family/4-query/query-ast/src/commands.ts
  • packages/2-mongo-family/4-query/query-ast/src/exports/index.ts
  • packages/2-mongo-family/4-query/query-ast/src/filter-expressions.ts
  • packages/2-mongo-family/4-query/query-ast/src/query-plan.ts
  • packages/2-mongo-family/4-query/query-ast/src/stages.ts
  • packages/2-mongo-family/4-query/query-ast/src/visitors.ts
  • packages/2-mongo-family/4-query/query-ast/test/filter-expressions.test.ts
  • packages/2-mongo-family/4-query/query-ast/test/stages.test.ts
  • packages/2-mongo-family/4-query/query-ast/tsconfig.json
  • packages/2-mongo-family/4-query/query-ast/tsconfig.prod.json
  • packages/2-mongo-family/4-query/query-ast/tsdown.config.ts
  • packages/2-mongo-family/4-query/query-ast/vitest.config.ts
  • packages/2-mongo-family/5-query-builders/README.md
  • packages/2-mongo-family/5-query-builders/package.json
  • packages/2-mongo-family/5-query-builders/src/collection-state.ts
  • packages/2-mongo-family/5-query-builders/src/collection.ts
  • packages/2-mongo-family/5-query-builders/src/compile.ts
  • packages/2-mongo-family/5-query-builders/src/executor.ts
  • packages/2-mongo-family/5-query-builders/src/exports/index.ts
  • packages/2-mongo-family/5-query-builders/src/mongo-orm.ts
  • packages/2-mongo-family/5-query-builders/src/types.ts
  • packages/2-mongo-family/5-query-builders/test/collection.test.ts
  • packages/2-mongo-family/5-query-builders/test/compile.test.ts
  • packages/2-mongo-family/5-query-builders/test/orm-types.test-d.ts
  • packages/2-mongo-family/5-query-builders/tsconfig.json
  • packages/2-mongo-family/5-query-builders/tsconfig.prod.json
  • packages/2-mongo-family/5-query-builders/tsdown.config.ts
  • packages/2-mongo-family/5-query-builders/vitest.config.ts
  • packages/2-mongo-family/5-runtime/biome.jsonc
  • packages/2-mongo-family/6-transport/mongo-lowering/README.md
  • packages/2-mongo-family/6-transport/mongo-lowering/package.json
  • packages/2-mongo-family/6-transport/mongo-lowering/src/adapter-types.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/src/driver-types.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/src/exports/index.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/tsconfig.json
  • packages/2-mongo-family/6-transport/mongo-lowering/tsconfig.prod.json
  • packages/2-mongo-family/6-transport/mongo-lowering/tsdown.config.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/vitest.config.ts
  • packages/2-mongo-family/6-transport/mongo-wire/README.md
  • packages/2-mongo-family/6-transport/mongo-wire/package.json
  • packages/2-mongo-family/6-transport/mongo-wire/src/exports/index.ts
  • packages/2-mongo-family/6-transport/mongo-wire/src/results.ts
  • packages/2-mongo-family/6-transport/mongo-wire/src/wire-commands.ts
💤 Files with no reviewable changes (8)
  • packages/2-mongo-family/1-foundation/mongo-codec/vitest.config.ts
  • packages/2-mongo-family/1-foundation/mongo-value/tsdown.config.ts
  • packages/2-mongo-family/1-core/src/exports/codec-types.ts
  • packages/2-mongo-family/5-runtime/biome.jsonc
  • packages/2-mongo-family/1-core/README.md
  • packages/2-mongo-family/1-core/src/validate-domain.ts
  • packages/2-mongo-family/1-core/src/adapter-types.ts
  • packages/2-mongo-family/1-core/src/exports/index.ts
✅ Files skipped from review due to trivial changes (49)
  • docs/architecture docs/adrs/ADR 185 - SPI types live at the lowest consuming layer.md
  • packages/1-framework/1-core/framework-components/README.md
  • examples/mongo-demo/src/db.ts
  • examples/mongo-demo/package.json
  • packages/2-mongo-family/6-transport/mongo-wire/src/wire-commands.ts
  • examples/mongo-demo/test/crud-lifecycle.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/test/validate-domain.test.ts
  • packages/2-mongo-family/5-query-builders/src/types.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/validate-mongo-contract.ts
  • packages/2-mongo-family/4-query/query-ast/src/commands.ts
  • packages/2-mongo-family/5-query-builders/src/mongo-orm.ts
  • packages/2-mongo-family/4-query/query-ast/package.json
  • packages/2-mongo-family/1-foundation/mongo-value/tsconfig.json
  • packages/1-framework/0-foundation/contract/README.md
  • examples/mongo-demo/test/blog.test.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/tsconfig.prod.json
  • packages/2-mongo-family/5-query-builders/test/orm-types.test-d.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/tsconfig.json
  • packages/2-mongo-family/6-transport/mongo-lowering/src/driver-types.ts
  • packages/2-mongo-family/3-tooling/emitter/package.json
  • packages/2-mongo-family/5-query-builders/test/collection.test.ts
  • packages/2-mongo-family/5-query-builders/tsconfig.prod.json
  • packages/2-mongo-family/6-transport/mongo-lowering/src/exports/index.ts
  • packages/2-mongo-family/5-query-builders/src/collection.ts
  • packages/2-mongo-family/5-query-builders/package.json
  • packages/2-mongo-family/1-foundation/mongo-contract/test/fixtures/orm-contract.d.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/tsdown.config.ts
  • packages/2-mongo-family/4-query/query-ast/README.md
  • packages/2-mongo-family/3-tooling/emitter/src/index.ts
  • packages/2-mongo-family/1-foundation/mongo-codec/README.md
  • packages/2-mongo-family/4-query/query-ast/tsconfig.json
  • packages/2-mongo-family/6-transport/mongo-lowering/README.md
  • packages/2-mongo-family/3-tooling/emitter/test/generate-orm-fixture.ts
  • packages/2-mongo-family/6-transport/mongo-lowering/vitest.config.ts
  • examples/mongo-demo/src/contract.d.ts
  • packages/2-mongo-family/4-query/query-ast/vitest.config.ts
  • packages/2-mongo-family/6-transport/mongo-wire/README.md
  • packages/2-mongo-family/1-foundation/mongo-value/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-value/README.md
  • packages/2-mongo-family/1-foundation/mongo-value/vitest.config.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/README.md
  • packages/2-mongo-family/6-transport/mongo-wire/package.json
  • packages/2-mongo-family/1-foundation/mongo-codec/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/src/exports/index.ts
  • packages/2-mongo-family/1-foundation/mongo-value/package.json
  • packages/2-mongo-family/6-transport/mongo-lowering/package.json
  • packages/2-mongo-family/1-foundation/mongo-codec/package.json
  • packages/2-mongo-family/6-transport/mongo-wire/src/exports/index.ts
  • docs/architecture docs/adrs/ADR 167 - Typed default literal pipeline and extensibility.md
🚧 Files skipped from review as they are similar to previous changes (9)
  • docs/architecture docs/adrs/ADR 173 - Polymorphism via discriminator and variants.md
  • packages/2-mongo-family/3-tooling/emitter/test/emitter-hook.e2e.test.ts
  • packages/2-mongo-family/4-query/query-ast/src/filter-expressions.ts
  • docs/planning/mongo-target/1-design-docs/mongo-execution-components.md
  • packages/2-mongo-family/6-transport/mongo-lowering/src/adapter-types.ts
  • packages/2-mongo-family/5-query-builders/tsdown.config.ts
  • packages/2-mongo-family/3-tooling/emitter/test/emitter-hook.generation.test.ts
  • packages/2-mongo-family/1-foundation/mongo-contract/package.json
  • docs/architecture docs/adrs/ADR 184 - Codec-owned value serialization.md

Comment thread architecture.config.json Resolved
@wmadden
wmadden merged commit 45b8948 into main Apr 6, 2026
15 checks passed
@wmadden
wmadden deleted the tml-2201-mongo-family-layering-reorganization branch April 6, 2026 09:05
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