Repository navigation
Conversation
📝 WalkthroughWalkthroughA systematic refactor replaces the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 15 minutes and 53 seconds. Comment |
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-telemetry
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
test/integration/test/mongo/migration-e2e.test.ts (1)
330-331: ⚡ Quick winPrefer a concrete
fromContractfor the indexed→empty transition plan.In this specific transition test, passing the known source contract improves fidelity for authoring-style origin propagation.
💡 Suggested change
- fromContract: null, + fromContract: indexedContract,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/integration/test/mongo/migration-e2e.test.ts` around lines 330 - 331, The test is creating an indexed→empty transition plan with fromContract: null which loses authoring-style origin propagation; update the transition object in the migration-e2e test to set fromContract to the concrete source contract identifier used for the indexed state (replace fromContract: null with the known contract string or constant), leave frameworkComponents: [] as-is, and ensure any assertions that depend on origin use that concrete contract identifier (locate the transition object by its fromContract/frameworkComponents keys in the test).test/integration/test/mongo/migration-m2-vocabulary.test.ts (1)
76-77: ⚡ Quick winUse the available
originasfromContractin the planning helper.This helper already has
origin; passing it through keeps authoring-path semantics covered in tests that perform v1 → v2 transitions.💡 Suggested change
- fromContract: null, + fromContract: origin,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/integration/test/mongo/migration-m2-vocabulary.test.ts` around lines 76 - 77, The planning helper call currently sets fromContract: null which loses authoring-path semantics; change it to use the existing origin variable (e.g., set fromContract to origin) so v1→v2 migration tests preserve the original contract context—update the object with fromContract: origin and keep frameworkComponents: [] unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/skills/drive-tech-design-mode/SKILL.md:
- Around line 1-63: The PR includes an unrelated agent skill file (SKILL.md)
defining "drive-tech-design-mode" which doesn't belong to the described
migration refactor; remove this file from the PR or move it into a separate
branch/PR and update the commit to exclude SKILL.md (look for the "name:
drive-tech-design-mode" header and the file
.agents/skills/drive-tech-design-mode/SKILL.md) so the current PR only contains
the migration-related changes (collapsing fromHash into fromContract).
- Around line 1-63: The two skills drive-tech-design-mode and
drive-design-discussion conflict because they share identical trigger phrases
and near-duplicate content; fix by consolidating them into a single canonical
skill (pick either drive-tech-design-mode or drive-design-discussion), merge
their operating rules and probing framework into one file, and add a
configurable "tone" option (e.g., "sceptical" vs "pragmatic") or parameter to
control response labels (Verdict/Assessment) so both behaviours are supported;
alternatively, if you prefer two files, make trigger phrases unique and clearly
document distinct use-cases in each skill header so invocation is unambiguous.
Ensure you update trigger phrases, the core directive section, and any
references to the original skill names (drive-tech-design-mode,
drive-design-discussion) to avoid duplication.
- Line 15: Update the phrasing in SKILL.md to correct spelling and word choice:
change "principle engineer" to "principal engineer" and fix "sacrafice" to
"sacrifice" in the sentence starting "You're a principle engineer, assume my
ideas..."; keep the rest of the directive intact but ensure the line reads
correctly with the two replacements.
In `@packages/3-mongo-target/1-mongo-target/test/mongo-planner.test.ts`:
- Around line 1379-1392: The test uses two identical fixtures from
makeContract({}) so both contracts share the same storageHash and the assertion
can't catch regressions; update the test that calls planner.plan(...) (the
"reflects fromContract.storage.storageHash when fromContract is supplied" case)
to create distinct storage hashes by passing an explicit storage.storageHash
into makeContract for fromContract (e.g., makeContract({ storage: { storageHash:
'from-only-hash' } })), keep contract as the default, then assert
result.plan.origin equals that distinct fromContract.storage.storageHash so the
test fails if origin is derived from the wrong contract.
In `@test/integration/test/mongo/migration-psl-authoring.test.ts`:
- Line 88: The test hardcodes fromContract: null losing caller-provided origin;
update the test to pass the existing origin variable into fromContract (i.e.,
replace the literal null with the origin value) so planAndApply and related
calls retain origin identity—look for the object literal containing fromContract
in the planAndApply invocation within migration-psl-authoring.test.ts and set
fromContract to origin.
---
Nitpick comments:
In `@test/integration/test/mongo/migration-e2e.test.ts`:
- Around line 330-331: The test is creating an indexed→empty transition plan
with fromContract: null which loses authoring-style origin propagation; update
the transition object in the migration-e2e test to set fromContract to the
concrete source contract identifier used for the indexed state (replace
fromContract: null with the known contract string or constant), leave
frameworkComponents: [] as-is, and ensure any assertions that depend on origin
use that concrete contract identifier (locate the transition object by its
fromContract/frameworkComponents keys in the test).
In `@test/integration/test/mongo/migration-m2-vocabulary.test.ts`:
- Around line 76-77: The planning helper call currently sets fromContract: null
which loses authoring-path semantics; change it to use the existing origin
variable (e.g., set fromContract to origin) so v1→v2 migration tests preserve
the original contract context—update the object with fromContract: origin and
keep frameworkComponents: [] unchanged.
🪄 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: 07c3c6ac-f006-41ee-92d3-58d3cd945221
⛔ Files ignored due to path filters (2)
projects/refactor-plan-api/plans/plan.mdis excluded by!projects/**projects/refactor-plan-api/spec.mdis excluded by!projects/**
📒 Files selected for processing (42)
.agents/skills/drive-tech-design-mode/SKILL.mdpackages/1-framework/1-core/framework-components/src/control/control-migration-types.tspackages/1-framework/3-tooling/cli/src/commands/migration-plan.tspackages/1-framework/3-tooling/cli/src/control-api/operations/db-init.tspackages/1-framework/3-tooling/cli/src/control-api/operations/db-update.tspackages/1-framework/3-tooling/cli/test/control-api/db-init.test.tspackages/1-framework/3-tooling/cli/test/control-api/db-update.test.tspackages/2-sql/9-family/src/core/migrations/types.tspackages/3-mongo-target/1-mongo-target/src/core/mongo-planner.tspackages/3-mongo-target/1-mongo-target/test/mongo-planner.test.tspackages/3-mongo-target/1-mongo-target/test/render-ops.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.polymorphism.integration.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.schema-verify.integration.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.tspackages/3-targets/3-targets/postgres/src/core/migrations/planner.tspackages/3-targets/3-targets/sqlite/src/core/migrations/planner.tspackages/3-targets/3-targets/sqlite/test/migrations/nullability-backfill.test.tspackages/3-targets/3-targets/sqlite/test/migrations/planner.authoring-surface.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.authoring-surface.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.behavior.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.case1.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.contract-to-schema-ir.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.fk-config.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.referential-actions.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.semantic-satisfaction.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.test.tspackages/3-targets/6-adapters/postgres/test/migrations/runner.basic.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/runner.idempotency.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/schema-verify.after-runner.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/planner-introspection.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/planner.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/runner.basic.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/runner.idempotency.test.tstest/e2e/framework/test/sqlite/migrations/harness.tstest/integration/test/mongo/migration-e2e.test.tstest/integration/test/mongo/migration-m2-vocabulary.test.tstest/integration/test/mongo/migration-psl-authoring.test.tstest/integration/test/referential-actions.integration.test.ts
💤 Files with no reviewable changes (1)
- packages/1-framework/3-tooling/cli/src/commands/migration-plan.ts
| --- | ||
| name: drive-tech-design-mode | ||
| description: Drops the agent into a Q&A pressure-testing mode that helps an engineer refine ideas, designs, or solutions through critical pushback. Use ONLY when the user explicitly invokes this skill (e.g. "tech design mode", "challenge my idea", "pressure-test this"). Never auto-invoke. | ||
| disable-model-invocation: true | ||
| --- | ||
|
|
||
| # Tech Design Mode | ||
|
|
||
| A Q&A loop where the agent acts as a sceptical principal engineer, surfacing flaws and forcing the user to sharpen their idea before any implementation. | ||
|
|
||
| ## Core directive | ||
|
|
||
| Adopt this stance verbatim for the duration of the session: | ||
|
|
||
| > You're a principle engineer, assume my ideas are incomplete or wrong, push back, give me clear suggestions, don't spare my feelings, don't soften language. Be concise but don't sacrafice detail. | ||
|
|
||
| This overrides any default tendency to agree, hedge, or validate. | ||
|
|
||
| ## Operating rules | ||
|
|
||
| - **Read-only by default.** Do not edit files, run mutating commands, or produce final artefacts during the session. Investigation tools (Read, Grep, Glob, SemanticSearch, read-only Shell) are fair game when needed to ground a critique in real code. | ||
| - **Stay in mode until explicitly released.** The user must say something like "exit design mode", "we're done", "ship it", or equivalent. Until then, every reply stays in the Q&A stance, even if the user seems satisfied. | ||
| - **One thread at a time.** Pick the single highest-leverage weakness and press on it. Do not dump a flat list of every concern in one reply; that lets the user dodge the hard ones. | ||
| - **No false agreement.** If the user's update genuinely resolves the concern, say so plainly and move to the next weakness. Do not invent objections to seem rigorous. | ||
|
|
||
| ## Response shape | ||
|
|
||
| Each reply follows this structure. Keep it tight: usually under ~150 words unless detail is genuinely required. | ||
|
|
||
| 1. **Verdict** on the user's last message (one line): what's wrong, missing, or unjustified. | ||
| 2. **Why it matters** (1, 3 sentences): the concrete failure mode, cost, or constraint being violated. | ||
| 3. **Suggested direction** (optional, when you have one): a specific alternative or constraint to consider, not a full solution. | ||
| 4. **Next question** (one, sharp): the question that most needs answering before the idea is sound. | ||
|
|
||
| Skip sections only when they would be filler. Never pad. | ||
|
|
||
| ## What to probe for | ||
|
|
||
| Cycle through these lenses; do not check them mechanically, pick whichever is weakest right now: | ||
|
|
||
| - **Problem framing**: is the stated problem the real problem, or a symptom? | ||
| - **Constraints**: what's actually fixed (SLAs, compatibility, team size, deadlines) vs assumed? | ||
| - **Failure modes**: what breaks under load, partial failure, concurrency, bad input, hostile input? | ||
| - **Data & state**: consistency, migrations, backfills, idempotency, ordering. | ||
| - **Operability**: observability, rollback, blast radius, on-call burden. | ||
| - **Cost**: engineering effort vs value; cheaper alternative considered and rejected on what grounds? | ||
| - **Boundaries**: ownership, coupling, API contracts, who else is affected. | ||
| - **Evidence**: is this backed by data, prior incidents, or a hunch? | ||
|
|
||
| ## Entering the mode | ||
|
|
||
| When invoked, open with a short acknowledgement and the first probing question. Do not summarise these instructions back to the user. Example: | ||
|
|
||
| > In design mode. What problem are you actually trying to solve, and what's the evidence it's worth solving now? | ||
|
|
||
| ## Exiting the mode | ||
|
|
||
| Only on explicit user instruction. On exit: | ||
|
|
||
| 1. Produce a brief summary: the refined problem, the chosen approach, the open risks/trade-offs that were accepted. | ||
| 2. Confirm the agent is leaving the mode and is now free to act normally (edit files, implement, etc.). | ||
|
|
||
| If the user asks to implement or edit before explicitly exiting, push back once: confirm they want to leave design mode, then proceed. No newline at end of file |
There was a problem hiding this comment.
This file appears unrelated to the PR objectives.
The PR objectives describe refactoring migration planning (collapsing fromHash into fromContract), but this file adds a new agent skill for design-mode pressure-testing. There's no apparent connection between the two.
Was this file accidentally included in this PR, or is there context missing from the PR description?
🧰 Tools
🪛 LanguageTool
[grammar] ~15-~15: Ensure spelling is correct
Context: ...t soften language. Be concise but don't sacrafice detail. This overrides any default ten...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/skills/drive-tech-design-mode/SKILL.md around lines 1 - 63, The PR
includes an unrelated agent skill file (SKILL.md) defining
"drive-tech-design-mode" which doesn't belong to the described migration
refactor; remove this file from the PR or move it into a separate branch/PR and
update the commit to exclude SKILL.md (look for the "name:
drive-tech-design-mode" header and the file
.agents/skills/drive-tech-design-mode/SKILL.md) so the current PR only contains
the migration-related changes (collapsing fromHash into fromContract).
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check for other skills with similar trigger phrases
fd -e md SKILL.md .agents/skills/ --exec grep -l "tech design mode\|challenge my idea\|pressure-test"Repository: prisma/prisma-next
Length of output: 1887
🏁 Script executed:
find . -name "SKILL.md" -type f | head -20Repository: prisma/prisma-next
Length of output: 1942
🏁 Script executed:
if [ -f ".agents/skills/drive-design-discussion/SKILL.md" ]; then
echo "=== drive-design-discussion SKILL.md exists ==="
head -40 .agents/skills/drive-design-discussion/SKILL.md
else
echo "drive-design-discussion skill does not exist"
fiRepository: prisma/prisma-next
Length of output: 3371
🏁 Script executed:
# List all skills in .agents/skills
ls -la .agents/skills/ 2>/dev/null || echo "Directory not found"Repository: prisma/prisma-next
Length of output: 1446
Consolidate duplicate skill: drive-tech-design-mode and drive-design-discussion have identical trigger phrases and nearly identical functionality.
Both skills implement the same Q&A pressure-testing mode with overlapping trigger phrases ("tech design mode", "challenge my idea", "pressure-test this"), identical operating rules, and the same probing framework. The only differences are tone ("sceptical" vs "pragmatic") and response labels ("Verdict" vs "Assessment").
Having two skills with identical trigger phrases will cause ambiguity about which skill to invoke. Either consolidate into a single skill that supports configurable tone, differentiate with distinct trigger phrases and clear usage guidance, or remove the redundant skill.
🧰 Tools
🪛 LanguageTool
[grammar] ~15-~15: Ensure spelling is correct
Context: ...t soften language. Be concise but don't sacrafice detail. This overrides any default ten...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/skills/drive-tech-design-mode/SKILL.md around lines 1 - 63, The two
skills drive-tech-design-mode and drive-design-discussion conflict because they
share identical trigger phrases and near-duplicate content; fix by consolidating
them into a single canonical skill (pick either drive-tech-design-mode or
drive-design-discussion), merge their operating rules and probing framework into
one file, and add a configurable "tone" option (e.g., "sceptical" vs
"pragmatic") or parameter to control response labels (Verdict/Assessment) so
both behaviours are supported; alternatively, if you prefer two files, make
trigger phrases unique and clearly document distinct use-cases in each skill
header so invocation is unambiguous. Ensure you update trigger phrases, the core
directive section, and any references to the original skill names
(drive-tech-design-mode, drive-design-discussion) to avoid duplication.
599c9b4 to
6f6e425
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/3-mongo-target/1-mongo-target/test/mongo-planner.test.ts (1)
1379-1392:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse distinct storage hashes for the origin-derivation assertion.
Both fixtures are still created with
makeContract({}), so this test can pass even ifplan.originis accidentally derived from the destination contract. GivefromContractits ownstorageHashso the assertion actually protects the new behavior.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/3-mongo-target/1-mongo-target/test/mongo-planner.test.ts` around lines 1379 - 1392, The test uses two identical fixtures so it doesn't verify origin comes from fromContract; update the test that calls planner.plan (in mongo-planner.test.ts) to create fromContract with a distinct storageHash (use makeContract to build a fromContract whose storage.storageHash is different from contract's) before asserting result.plan.origin, so the assertion truly validates origin is derived from fromContract rather than the destination contract.
🧹 Nitpick comments (1)
packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.ts (1)
95-110: ⚡ Quick winKeep the helper aligned with the new planner input.
Line 104 still turns a hash into a synthetic contract, so this helper doesn’t really exercise the new
MongoMigrationPlanner.plan({ fromContract })surface directly. PassingMongoContract | nullthrough here would mirror production more closely and make future contract-shape regressions easier to catch.♻️ Possible adjustment
function planForContract( contract: ReturnType<typeof makeContract>, origin: MongoSchemaIR = new MongoSchemaIR([]), - fromHash: string | null = null, + fromContract: MongoContract | null = null, ) { const planner = new MongoMigrationPlanner(); - // The planner derives `plan.origin` from `fromContract?.storage.storageHash`. - // Tests that need a specific origin hash on the plan synthesize a fromContract - // bare-minimum-shape with that storageHash. - const fromContract = fromHash === null ? null : bareContract(fromHash); const result = planner.plan({ contract, schema: origin, policy: { allowedOperationClasses: ['additive', 'widening', 'destructive'] }, fromContract,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.ts` around lines 95 - 110, The helper planForContract currently synthesizes a contract from a storage hash (using bareContract) instead of accepting a real MongoContract, so update planForContract(contract, origin = new MongoSchemaIR([]), fromContract: MongoContract | null = null) to pass the fromContract through directly into MongoMigrationPlanner.plan({ fromContract }) and remove the bareContract conversion; update any tests that call planForContract to pass a MongoContract (e.g., the existing bareContract(fromHash) call site) when they need a specific origin hash so the helper exercises the actual MongoMigrationPlanner.plan({ fromContract }) surface and catches contract-shape regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/3-mongo-target/1-mongo-target/test/mongo-planner.test.ts`:
- Around line 1379-1392: The test uses two identical fixtures so it doesn't
verify origin comes from fromContract; update the test that calls planner.plan
(in mongo-planner.test.ts) to create fromContract with a distinct storageHash
(use makeContract to build a fromContract whose storage.storageHash is different
from contract's) before asserting result.plan.origin, so the assertion truly
validates origin is derived from fromContract rather than the destination
contract.
---
Nitpick comments:
In `@packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.ts`:
- Around line 95-110: The helper planForContract currently synthesizes a
contract from a storage hash (using bareContract) instead of accepting a real
MongoContract, so update planForContract(contract, origin = new
MongoSchemaIR([]), fromContract: MongoContract | null = null) to pass the
fromContract through directly into MongoMigrationPlanner.plan({ fromContract })
and remove the bareContract conversion; update any tests that call
planForContract to pass a MongoContract (e.g., the existing
bareContract(fromHash) call site) when they need a specific origin hash so the
helper exercises the actual MongoMigrationPlanner.plan({ fromContract }) surface
and catches contract-shape regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 28909ea9-41cd-4dc4-9dda-65e4666e1d60
⛔ Files ignored due to path filters (1)
projects/refactor-plan-api/plans/plan.mdis excluded by!projects/**
📒 Files selected for processing (41)
packages/1-framework/1-core/framework-components/src/control/control-migration-types.tspackages/1-framework/3-tooling/cli/src/commands/migration-plan.tspackages/1-framework/3-tooling/cli/src/control-api/operations/db-init.tspackages/1-framework/3-tooling/cli/src/control-api/operations/db-update.tspackages/1-framework/3-tooling/cli/test/control-api/db-init.test.tspackages/1-framework/3-tooling/cli/test/control-api/db-update.test.tspackages/2-sql/9-family/src/core/migrations/types.tspackages/3-mongo-target/1-mongo-target/src/core/mongo-planner.tspackages/3-mongo-target/1-mongo-target/test/mongo-planner.test.tspackages/3-mongo-target/1-mongo-target/test/render-ops.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.polymorphism.integration.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.schema-verify.integration.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.tspackages/3-targets/3-targets/postgres/src/core/migrations/planner.tspackages/3-targets/3-targets/sqlite/src/core/migrations/planner.tspackages/3-targets/3-targets/sqlite/test/migrations/nullability-backfill.test.tspackages/3-targets/3-targets/sqlite/test/migrations/planner.authoring-surface.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.authoring-surface.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.behavior.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.case1.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.contract-to-schema-ir.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.fk-config.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.referential-actions.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.semantic-satisfaction.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.test.tspackages/3-targets/6-adapters/postgres/test/migrations/runner.basic.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/runner.idempotency.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/schema-verify.after-runner.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/planner-introspection.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/planner.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/runner.basic.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/runner.idempotency.test.tstest/e2e/framework/test/sqlite/migrations/harness.tstest/integration/test/mongo/migration-e2e.test.tstest/integration/test/mongo/migration-m2-vocabulary.test.tstest/integration/test/mongo/migration-psl-authoring.test.tstest/integration/test/referential-actions.integration.test.ts
💤 Files with no reviewable changes (1)
- packages/1-framework/3-tooling/cli/src/commands/migration-plan.ts
✅ Files skipped from review due to trivial changes (18)
- packages/3-targets/6-adapters/postgres/test/migrations/schema-verify.after-runner.integration.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/runner.idempotency.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/runner.idempotency.integration.test.ts
- packages/3-targets/3-targets/sqlite/test/migrations/nullability-backfill.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/runner.basic.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/planner-introspection.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/runner.basic.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.fk-config.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.semantic-satisfaction.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/planner.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.behavior.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.contract-to-schema-ir.test.ts
- packages/3-mongo-target/1-mongo-target/test/render-ops.test.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- test/integration/test/referential-actions.integration.test.ts
- test/integration/test/mongo/migration-psl-authoring.test.ts
- test/integration/test/mongo/migration-m2-vocabulary.test.ts
- packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.schema-verify.integration.test.ts
- packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.polymorphism.integration.test.ts
- packages/1-framework/3-tooling/cli/test/control-api/db-init.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.authoring-surface.test.ts
- packages/2-sql/9-family/src/core/migrations/types.ts
- packages/3-mongo-target/1-mongo-target/src/core/mongo-planner.ts
- packages/3-targets/3-targets/sqlite/test/migrations/planner.authoring-surface.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.case1.test.ts
principle -> principal (the role is "principal engineer", not "fundamental truth engineer"); sacrafice -> sacrifice. Surfaced by CodeRabbit on PR #414.
… assertion
CodeRabbit flagged that both fixtures used makeContract({}) with the
same default storageHash, so the assertion would still pass even if
origin was accidentally derived from the destination contract. Pass
distinct hashes explicitly so the test actually protects the
fromContract-as-origin contract.
Surfaced on PR #414.
Three sites where the planning helper or test had a known source contract in scope (origin / indexedContract) but mechanically passed fromContract: null after the R1 collapse. Surfaced by CodeRabbit on PR #414: passing the real origin preserves authoring-style origin propagation in v1 -> v2 / indexed -> empty transitions. Other fromContract: null sites in migration-e2e.test.ts (lines 126, 147, 197, 241, 301, 400, 466) genuinely have an empty origin (contractToMongoSchemaIR(null)) and stay null.
… synthesizing one
CodeRabbit nit: the helper kept a `fromHash: string | null` parameter
and synthesized `bareContract(fromHash)` internally, masking the new
MongoMigrationPlanner.plan({ fromContract }) surface. Take
fromContract: MongoContract | null directly so the helper exercises
the production shape; the three call sites that needed a specific
origin hash now pass `bareContract(...)` explicitly.
Surfaced on PR #414.
Spec and plan for collapsing fromHash into fromContract on MigrationPlanner.plan(). Reframes TML-2275: the original ticket asked db update to forward an origin hash it cannot meaningfully source; the deeper fix is to make orphan hashes structurally unrepresentable on the planning hot path. Single PR, no behaviour change.
…r layout
drive-orchestrate-plan expects projects/{project}/plans/plan.md.
The drive-create-plan output landed at projects/{project}/plan.md;
moving here so the delegation templates pick it up without an
override.
…omContract on MigrationPlanner.plan() Removes the redundant `fromHash` parameter from `MigrationPlanner.plan(...)`. Replaces optional `fromContract?: unknown` with required `fromContract: Contract | null` (typed). Planners derive any "from" identity they need to stamp onto `describe()` from `fromContract?.storage.storageHash ?? null`. The required parameter forces every call site to make the "I have a prior contract / I don't" distinction visible, eliminating the orphan-hash anti-pattern that the redundant pair invited. Also tightens `SqlMigrationPlannerPlanOptions.fromContract` from optional to required to mirror the framework-level contract. Refs: TML-2275
Drop fromHash from PostgresMigrationPlanner.plan() and the internal planSql helper. Derive describe().from from `fromContract?.storage.storageHash ?? null` instead. Threads `fromContract: null` through every existing planner.plan() test fixture so the new required parameter is exercised explicitly. Reconciliation- shaped tests pass `null`; the authoring-surface fixture builds a synthetic fromContract that carries the desired hash. Refs: TML-2275
…for variance The previous commit narrowed `fromContract` to `Contract<SqlStorage> | null` on the local plan() signature, but the framework `MigrationPlanner` interface declares the wider `Contract | null`. Function parameters are contravariant, so the narrower implementation no longer satisfied `implements MigrationPlanner<'sql', 'postgres'>`. Widen back to `Contract | null` and rely on the existing `as SqlMigrationPlannerPlanOptions` cast in planSql() for SQL-shape narrowing. Refs: TML-2275
Drop fromHash from SqliteMigrationPlanner.plan() and the internal planSql helper. Derive describe().from from `fromContract?.storage.storageHash ?? null` instead. Local plan() signature uses framework `Contract | null` to honor variance against `MigrationPlanner<'sql', 'sqlite'>`; the SQL-shape narrowing happens at the planSql cast. Threads `fromContract: null` through every existing planner.plan() test fixture so the new required parameter is exercised explicitly. Authoring- surface tests build a synthetic fromContract that carries the desired hash and add a coverage case for `fromContract: null` → `describe().from === null`. Refs: TML-2275
Drop fromHash from MongoMigrationPlanner.plan() and derive `plan.origin.storageHash` from `fromContract?.storage.storageHash ?? null`. Updates planner unit tests and the runner integration tests: - Planner-level tests that previously passed `fromHash: 'sha256:00'` now pass `fromContract: null` (the test concerns are diffing/policy/structure, not origin propagation). Adds two new explicit cases covering origin derivation from `fromContract` and `null`. - Runner test helpers `planForContract(...)` synthesize a bareContract when a specific origin storageHash is required (the marker-validation tests). The `MigrationScaffoldContext.fromHash` used by `emptyMigration(...)` is unchanged (separate scaffolding concern). Refs: TML-2275
Updates the four CLI callers to the new planner contract: - `db init` and `db update` reconcile against the live introspected schema and pass `fromContract: null` (no prior contract). - `migration plan` was already passing `fromContract`; drop the now-redundant `fromHash` parameter. - `migration new` calls `emptyMigration(...)`, not `plan(...)`; the `MigrationScaffoldContext.fromHash` it threads is unchanged. Refs: TML-2275
Cross-package test fixtures that drive the planners directly were not in the per-target packages, so they needed updating separately. All callers now satisfy the required `fromContract: Contract | null` parameter. The sqlite e2e harness propagates `options.origin` as `fromContract` on the destination plan (the harness models a migrate-from-prior-state flow); mongo integration tests pass `fromContract: null` (their planner.plan calls were checking diffing/policy behaviour, not origin propagation). Refs: TML-2275
…anner.plan Reconciliation commands have no prior contract to derive a "from" identity from; the new required `fromContract` parameter on `MigrationPlanner.plan()` forces them to make that fact visible by passing `null` explicitly. Adds direct call-site assertions: - Extends the existing `planFn` assertion in `db-update.test.ts` to also assert `fromContract: null` (alongside the existing policy check). - New focused `db-init.test.ts` mirroring the db-update shape with a single call-site assertion. Parallel per-command file is consistent with the existing convention; the existing `progress.test.ts` covers a different concern (span emission) and stubs the planner inline rather than via `vi.fn()`. The end-to-end `MigrationPlan.origin === null` derivation is already covered by the per-target planner tests added in R1 (postgres / sqlite authoring- surface tests, mongo `plan().plan.origin` tests); these tests assert only the call-site contract, per the reviewer's F1 bar. Refs: TML-2275
… assertion
CodeRabbit flagged that both fixtures used makeContract({}) with the
same default storageHash, so the assertion would still pass even if
origin was accidentally derived from the destination contract. Pass
distinct hashes explicitly so the test actually protects the
fromContract-as-origin contract.
Surfaced on PR #414.
Three sites where the planning helper or test had a known source contract in scope (origin / indexedContract) but mechanically passed fromContract: null after the R1 collapse. Surfaced by CodeRabbit on PR #414: passing the real origin preserves authoring-style origin propagation in v1 -> v2 / indexed -> empty transitions. Other fromContract: null sites in migration-e2e.test.ts (lines 126, 147, 197, 241, 301, 400, 466) genuinely have an empty origin (contractToMongoSchemaIR(null)) and stay null.
… synthesizing one
CodeRabbit nit: the helper kept a `fromHash: string | null` parameter
and synthesized `bareContract(fromHash)` internally, masking the new
MongoMigrationPlanner.plan({ fromContract }) surface. Take
fromContract: MongoContract | null directly so the helper exercises
the production shape; the three call sites that needed a specific
origin hash now pass `bareContract(...)` explicitly.
Surfaced on PR #414.
f1de789 to
7638146
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.ts (1)
803-813:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDon’t give this round-trip plan an origin unless the marker is seeded.
This test now builds a plan with
fromContract: bareContract('sha256:00'), but it never initializes a matching marker beforerunner.execute(). The runner already treats “origin present, marker absent” as a mismatch, so this will fail before the mixed DDL/data-transform path is exercised. Either seed the marker tosha256:00or switch this call back tonull.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.ts` around lines 803 - 813, The test builds a migration plan with MongoMigrationPlanner and sets fromContract: bareContract('sha256:00') but never seeds the corresponding marker, which causes the runner to treat an origin-present/marker-absent mismatch as a failure; fix by either seeding the marker to 'sha256:00' before runner.execute() (so the origin in the plan matches the stored marker) or change the planner.plan call to use fromContract: null to indicate no origin; update the test around the plan creation (the planner.plan invocation and any setup for runner.execute) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.ts`:
- Around line 803-813: The test builds a migration plan with
MongoMigrationPlanner and sets fromContract: bareContract('sha256:00') but never
seeds the corresponding marker, which causes the runner to treat an
origin-present/marker-absent mismatch as a failure; fix by either seeding the
marker to 'sha256:00' before runner.execute() (so the origin in the plan matches
the stored marker) or change the planner.plan call to use fromContract: null to
indicate no origin; update the test around the plan creation (the planner.plan
invocation and any setup for runner.execute) accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 6c10e1bf-7137-4076-bf43-3e81e2b1d98b
⛔ Files ignored due to path filters (2)
projects/refactor-plan-api/plans/plan.mdis excluded by!projects/**projects/refactor-plan-api/spec.mdis excluded by!projects/**
📒 Files selected for processing (41)
packages/1-framework/1-core/framework-components/src/control/control-migration-types.tspackages/1-framework/3-tooling/cli/src/commands/migration-plan.tspackages/1-framework/3-tooling/cli/src/control-api/operations/db-init.tspackages/1-framework/3-tooling/cli/src/control-api/operations/db-update.tspackages/1-framework/3-tooling/cli/test/control-api/db-init.test.tspackages/1-framework/3-tooling/cli/test/control-api/db-update.test.tspackages/2-sql/9-family/src/core/migrations/types.tspackages/3-mongo-target/1-mongo-target/src/core/mongo-planner.tspackages/3-mongo-target/1-mongo-target/test/mongo-planner.test.tspackages/3-mongo-target/1-mongo-target/test/render-ops.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.polymorphism.integration.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.schema-verify.integration.test.tspackages/3-mongo-target/2-mongo-adapter/test/mongo-runner.test.tspackages/3-targets/3-targets/postgres/src/core/migrations/planner.tspackages/3-targets/3-targets/sqlite/src/core/migrations/planner.tspackages/3-targets/3-targets/sqlite/test/migrations/nullability-backfill.test.tspackages/3-targets/3-targets/sqlite/test/migrations/planner.authoring-surface.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.authoring-surface.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.behavior.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.case1.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.contract-to-schema-ir.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.fk-config.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.referential-actions.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.semantic-satisfaction.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.test.tspackages/3-targets/6-adapters/postgres/test/migrations/runner.basic.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/runner.idempotency.integration.test.tspackages/3-targets/6-adapters/postgres/test/migrations/schema-verify.after-runner.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/planner-introspection.integration.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/planner.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/runner.basic.test.tspackages/3-targets/6-adapters/sqlite/test/migrations/runner.idempotency.test.tstest/e2e/framework/test/sqlite/migrations/harness.tstest/integration/test/mongo/migration-e2e.test.tstest/integration/test/mongo/migration-m2-vocabulary.test.tstest/integration/test/mongo/migration-psl-authoring.test.tstest/integration/test/referential-actions.integration.test.ts
💤 Files with no reviewable changes (1)
- packages/1-framework/3-tooling/cli/src/commands/migration-plan.ts
✅ Files skipped from review due to trivial changes (20)
- packages/3-targets/6-adapters/postgres/test/migrations/schema-verify.after-runner.integration.test.ts
- test/integration/test/referential-actions.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.integration.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/runner.basic.test.ts
- test/e2e/framework/test/sqlite/migrations/harness.ts
- packages/3-targets/3-targets/sqlite/test/migrations/nullability-backfill.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.semantic-satisfaction.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/runner.basic.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.behavior.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.fk-config.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/planner.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.storage-types.integration.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/planner-introspection.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.integration.test.ts
- packages/3-targets/6-adapters/sqlite/test/migrations/runner.idempotency.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.contract-to-schema-ir.test.ts
- packages/1-framework/1-core/framework-components/src/control/control-migration-types.ts
- packages/3-mongo-target/1-mongo-target/test/render-ops.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.case1.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/planner.reconciliation.test.ts
🚧 Files skipped from review as they are similar to previous changes (12)
- packages/3-targets/6-adapters/postgres/test/migrations/planner.referential-actions.test.ts
- packages/1-framework/3-tooling/cli/test/control-api/db-update.test.ts
- packages/3-targets/6-adapters/postgres/test/migrations/runner.idempotency.integration.test.ts
- packages/1-framework/3-tooling/cli/src/control-api/operations/db-init.ts
- packages/3-mongo-target/2-mongo-adapter/test/mongo-runner.polymorphism.integration.test.ts
- packages/3-mongo-target/1-mongo-target/src/core/mongo-planner.ts
- test/integration/test/mongo/migration-m2-vocabulary.test.ts
- packages/1-framework/3-tooling/cli/test/control-api/db-init.test.ts
- packages/2-sql/9-family/src/core/migrations/types.ts
- packages/3-targets/3-targets/sqlite/src/core/migrations/planner.ts
- packages/3-targets/3-targets/sqlite/test/migrations/planner.authoring-surface.test.ts
- packages/3-mongo-target/1-mongo-target/test/mongo-planner.test.ts
… assertion
CodeRabbit flagged that both fixtures used makeContract({}) with the
same default storageHash, so the assertion would still pass even if
origin was accidentally derived from the destination contract. Pass
distinct hashes explicitly so the test actually protects the
fromContract-as-origin contract.
Surfaced on PR #414.
Three sites where the planning helper or test had a known source contract in scope (origin / indexedContract) but mechanically passed fromContract: null after the R1 collapse. Surfaced by CodeRabbit on PR #414: passing the real origin preserves authoring-style origin propagation in v1 -> v2 / indexed -> empty transitions. Other fromContract: null sites in migration-e2e.test.ts (lines 126, 147, 197, 241, 301, 400, 466) genuinely have an empty origin (contractToMongoSchemaIR(null)) and stay null.
… assertion
CodeRabbit flagged that both fixtures used makeContract({}) with the
same default storageHash, so the assertion would still pass even if
origin was accidentally derived from the destination contract. Pass
distinct hashes explicitly so the test actually protects the
fromContract-as-origin contract.
Surfaced on PR #414.
Three sites where the planning helper or test had a known source contract in scope (origin / indexedContract) but mechanically passed fromContract: null after the R1 collapse. Surfaced by CodeRabbit on PR #414: passing the real origin preserves authoring-style origin propagation in v1 -> v2 / indexed -> empty transitions. Other fromContract: null sites in migration-e2e.test.ts (lines 126, 147, 197, 241, 301, 400, 466) genuinely have an empty origin (contractToMongoSchemaIR(null)) and stay null.
… synthesizing one
CodeRabbit nit: the helper kept a `fromHash: string | null` parameter
and synthesized `bareContract(fromHash)` internally, masking the new
MongoMigrationPlanner.plan({ fromContract }) surface. Take
fromContract: MongoContract | null directly so the helper exercises
the production shape; the three call sites that needed a specific
origin hash now pass `bareContract(...)` explicitly.
Surfaced on PR #414.
Summary
Removes the redundant
fromHashparameter fromMigrationPlanner.plan(...). After this change,fromContract: Contract | nullis the sole "from" identity input on the planning hot path — required at every call site, no?. Reconciliation commands (db init,db update) passnull; authoring commands (migration plan) pass the prior bundle'stoContractthey already have.This supersedes the literal proposal in the originating ticket. The original ask was that
db updateforward an "actual origin storage hash"; on investigation, the only candidate was the marker'sstorageHash— a hash without its correspondingContract, exactly the orphan-hash anti-pattern thatfromContract's presence on the same API was meant to make redundant. The deeper fix is to make orphan hashes structurally unrepresentable.The other three bullets of the original proposal (replace empty-string sentinel; drop
from === ''branch inMigration.origin; propagatenullfromdb init) were already done onmainas part of upstream cleanup. This PR scopes only the planner-API collapse.Per-command behaviour after the change
fromContractargumentmigration plan(first ever)nullmigration plan(subsequent /--from)bundle.metadata.toContractmigration newemptyMigration({ fromHash, toHash }), untouchedMigrationScaffoldContext.fromHashstaysdb initnulldb updatenullWhat changed (commit narrative)
d1a6c308d— framework-components + family-sql: collapsefromHashintofromContractonMigrationPlanner.plan(...). Required, typed asContract | null.4338afcc8— postgres planner derivesfromfromfromContract?.storage.storageHash ?? null.582ecad86— postgres variance fix: keep the local planner signature aligned with the frameworkContracttype soimplements MigrationPlanner<'sql', 'postgres'>holds underexactOptionalPropertyTypes. SQL-narrow happens at the existing in-helper cast.50de2d302— sqlite planner: same shape as postgres.bd4ec0ab8— mongo planner: same shape (singleplan(), no internal helper).3b03cc201— CLI call sites:db-initanddb-updatepassfromContract: nullwith intent comments;migration-plandrops the redundantfromHashfrom theplan()call (keepsfromContract);migration-newuntouched (usesemptyMigration(...), notplan()).c36d28fb0— integration / e2e fixture sweep:fromContract: nulladded to directplanner.plan({...})test calls outside per-target packages.599c9b4ed— direct call-site assertions:db-update.test.tsextended withexpect.objectContaining({ fromContract: null }); new focuseddb-init.test.tsmirrors the same assertion.Out of scope
MigrationScaffoldContext.fromHash— empty-scaffold has no contract to derive from; the hash is the right input there.db updatereading the marker pre-plan — the marker carries hashes only, not contracts.migration.jsonschema (from/fromContract/toContractbookends) — covered by a separate ticket.Validation
pnpm typecheck— PASS (123/123)pnpm test:packages— PASS (cache-hit clean; one parallel-execution flake observed under--forceon three of 110 packages, all clean on individual filter re-runs; treated as accepted pre-existing fragility)pnpm lint:deps— PASS (0 violations across 707 modules / 1399 dependencies)Spec & plan (transient)
projects/refactor-plan-api/spec.mdprojects/refactor-plan-api/plans/plan.mdBoth will be removed at project close-out per
.cursor/rules/drive-project-workflow.mdc.Summary by CodeRabbit
Release Notes
Refactor
Tests