@prisma-next/cli 0.14.0-dev.4 → 0.14.0-dev.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.mjs +27 -13
  3. package/dist/cli.mjs.map +1 -1
  4. package/dist/{client-CJzuo5wX.mjs → client-CWTNqJdj.mjs} +76 -72
  5. package/dist/client-CWTNqJdj.mjs.map +1 -0
  6. package/dist/{command-helpers-DGMvGBeX.mjs → command-helpers-6cNJZ863.mjs} +3 -3
  7. package/dist/{command-helpers-DGMvGBeX.mjs.map → command-helpers-6cNJZ863.mjs.map} +1 -1
  8. package/dist/commands/contract-emit.mjs +1 -1
  9. package/dist/commands/contract-infer.mjs +1 -1
  10. package/dist/commands/db-init.mjs +3 -3
  11. package/dist/commands/db-schema.mjs +3 -3
  12. package/dist/commands/db-sign.mjs +5 -5
  13. package/dist/commands/db-sign.mjs.map +1 -1
  14. package/dist/commands/db-update.mjs +4 -4
  15. package/dist/commands/db-verify.mjs +1 -1
  16. package/dist/commands/migrate.d.mts +1 -1
  17. package/dist/commands/migrate.d.mts.map +1 -1
  18. package/dist/commands/migrate.mjs +35 -35
  19. package/dist/commands/migrate.mjs.map +1 -1
  20. package/dist/commands/migration-check.d.mts +1 -1
  21. package/dist/commands/migration-check.mjs +1 -1
  22. package/dist/commands/migration-graph.d.mts +1 -1
  23. package/dist/commands/migration-graph.mjs +8 -8
  24. package/dist/commands/migration-graph.mjs.map +1 -1
  25. package/dist/commands/migration-list.d.mts +6 -6
  26. package/dist/commands/migration-list.d.mts.map +1 -1
  27. package/dist/commands/migration-list.mjs +1 -1
  28. package/dist/commands/migration-log.d.mts +1 -1
  29. package/dist/commands/migration-log.mjs +1 -1
  30. package/dist/commands/migration-new.mjs +4 -4
  31. package/dist/commands/migration-new.mjs.map +1 -1
  32. package/dist/commands/migration-plan.mjs +1 -1
  33. package/dist/commands/migration-show.mjs +4 -4
  34. package/dist/commands/migration-show.mjs.map +1 -1
  35. package/dist/commands/migration-status.d.mts +1 -1
  36. package/dist/commands/migration-status.mjs +1 -1
  37. package/dist/commands/ref.d.mts +1 -1
  38. package/dist/commands/ref.mjs +3 -3
  39. package/dist/commands/ref.mjs.map +1 -1
  40. package/dist/commands/telemetry/index.mjs +1 -1
  41. package/dist/{contract-at-errors-CFXsstzm.mjs → contract-at-errors-DdxWRjMc.mjs} +2 -2
  42. package/dist/{contract-at-errors-CFXsstzm.mjs.map → contract-at-errors-DdxWRjMc.mjs.map} +1 -1
  43. package/dist/{contract-emit-C8HmtboH.mjs → contract-emit-CMwCj7_m.mjs} +8 -6
  44. package/dist/contract-emit-CMwCj7_m.mjs.map +1 -0
  45. package/dist/{contract-emit-B_qriF8B.mjs → contract-emit-klH7zzaV.mjs} +6 -6
  46. package/dist/contract-emit-klH7zzaV.mjs.map +1 -0
  47. package/dist/{contract-infer-BYT_ra_U.mjs → contract-infer-B__56PGb.mjs} +3 -3
  48. package/dist/{contract-infer-BYT_ra_U.mjs.map → contract-infer-B__56PGb.mjs.map} +1 -1
  49. package/dist/{contract-space-aggregate-loader-ClI1KN6d.mjs → contract-space-aggregate-loader-Bu2fjSWV.mjs} +2 -2
  50. package/dist/{contract-space-aggregate-loader-ClI1KN6d.mjs.map → contract-space-aggregate-loader-Bu2fjSWV.mjs.map} +1 -1
  51. package/dist/{db-verify-C24FKhb7.mjs → db-verify-DlqHvkkA.mjs} +69 -49
  52. package/dist/db-verify-DlqHvkkA.mjs.map +1 -0
  53. package/dist/exports/control-api.d.mts +3 -3
  54. package/dist/exports/control-api.mjs +2 -2
  55. package/dist/exports/index.mjs +2 -2
  56. package/dist/extension-pack-inputs-1ySHqxKG.mjs.map +1 -1
  57. package/dist/{format-C8yv6mXH.mjs → format-C3XdaDuA.mjs} +3 -3
  58. package/dist/format-C3XdaDuA.mjs.map +1 -0
  59. package/dist/{framework-components-YVQHhPH7.mjs → framework-components-5RljWT7Q.mjs} +2 -2
  60. package/dist/{framework-components-YVQHhPH7.mjs.map → framework-components-5RljWT7Q.mjs.map} +1 -1
  61. package/dist/{init-a3-ljrL3.mjs → init-BF3s9NcB.mjs} +3 -3
  62. package/dist/{init-a3-ljrL3.mjs.map → init-BF3s9NcB.mjs.map} +1 -1
  63. package/dist/{inspect-live-schema-DF6IwcDl.mjs → inspect-live-schema-Dd1Ft0dw.mjs} +4 -4
  64. package/dist/inspect-live-schema-Dd1Ft0dw.mjs.map +1 -0
  65. package/dist/{migration-check-VwM8xCZV.mjs → migration-check-UoHMvsP3.mjs} +10 -11
  66. package/dist/migration-check-UoHMvsP3.mjs.map +1 -0
  67. package/dist/migration-cli.mjs +1 -1
  68. package/dist/migration-cli.mjs.map +1 -1
  69. package/dist/{migration-command-scaffold-DA-Lhx6o.mjs → migration-command-scaffold-DW2BpjZW.mjs} +4 -4
  70. package/dist/migration-command-scaffold-DW2BpjZW.mjs.map +1 -0
  71. package/dist/{migration-list-DlJJ_38Z.mjs → migration-list-BOzQzJK4.mjs} +15 -15
  72. package/dist/migration-list-BOzQzJK4.mjs.map +1 -0
  73. package/dist/{migration-log-CG0qQAFm.mjs → migration-log-q50rqMiU.mjs} +4 -4
  74. package/dist/migration-log-q50rqMiU.mjs.map +1 -0
  75. package/dist/{migration-path-target-Ce6OZImp.mjs → migration-path-target-zK6RG6JY.mjs} +2 -2
  76. package/dist/{migration-path-target-Ce6OZImp.mjs.map → migration-path-target-zK6RG6JY.mjs.map} +1 -1
  77. package/dist/{migration-plan-W_E8FQOk.mjs → migration-plan-BwJLPkwV.mjs} +24 -24
  78. package/dist/migration-plan-BwJLPkwV.mjs.map +1 -0
  79. package/dist/{migration-status-CD-LC2Ip.mjs → migration-status-27NzO2SC.mjs} +13 -14
  80. package/dist/migration-status-27NzO2SC.mjs.map +1 -0
  81. package/dist/{telemetry-BIM4beEO.mjs → telemetry-BckOSUWG.mjs} +2 -2
  82. package/dist/{telemetry-BIM4beEO.mjs.map → telemetry-BckOSUWG.mjs.map} +1 -1
  83. package/dist/{types-C_tYiJYx.d.mts → types-CKgJmH02.d.mts} +26 -20
  84. package/dist/types-CKgJmH02.d.mts.map +1 -0
  85. package/dist/{verify-DcOYZ1tH.mjs → verify-DC14_nPu.mjs} +29 -6
  86. package/dist/verify-DC14_nPu.mjs.map +1 -0
  87. package/package.json +21 -24
  88. package/src/cli.ts +3 -0
  89. package/src/commands/contract-emit.ts +1 -1
  90. package/src/commands/db-sign.ts +1 -1
  91. package/src/commands/db-verify.ts +32 -20
  92. package/src/commands/inspect-live-schema.ts +1 -1
  93. package/src/commands/lsp.ts +32 -0
  94. package/src/commands/migrate.ts +45 -42
  95. package/src/commands/migration-check.ts +6 -6
  96. package/src/commands/migration-graph.ts +5 -5
  97. package/src/commands/migration-list.ts +13 -13
  98. package/src/commands/migration-log.ts +1 -1
  99. package/src/commands/migration-new.ts +1 -1
  100. package/src/commands/migration-plan.ts +4 -4
  101. package/src/commands/migration-show.ts +1 -1
  102. package/src/commands/migration-status.ts +10 -10
  103. package/src/commands/ref.ts +1 -1
  104. package/src/control-api/client.ts +5 -3
  105. package/src/control-api/operations/contract-emit.ts +8 -7
  106. package/src/control-api/operations/db-init.ts +2 -2
  107. package/src/control-api/operations/db-run.ts +7 -7
  108. package/src/control-api/operations/db-verify.ts +38 -33
  109. package/src/control-api/operations/format.ts +1 -2
  110. package/src/control-api/operations/migrate.ts +66 -66
  111. package/src/control-api/operations/run-migration.ts +2 -2
  112. package/src/control-api/types.ts +7 -7
  113. package/src/migration-cli.ts +1 -1
  114. package/src/utils/combine-verify-results.ts +113 -0
  115. package/src/utils/extension-pack-inputs.ts +1 -1
  116. package/src/utils/formatters/verify.ts +44 -3
  117. package/src/utils/migration-command-scaffold.ts +1 -1
  118. package/src/utils/plan-resolution.ts +18 -18
  119. package/dist/client-CJzuo5wX.mjs.map +0 -1
  120. package/dist/config-loader-p9JMrekQ.mjs +0 -88
  121. package/dist/config-loader-p9JMrekQ.mjs.map +0 -1
  122. package/dist/config-loader.d.mts +0 -16
  123. package/dist/config-loader.d.mts.map +0 -1
  124. package/dist/config-loader.mjs +0 -2
  125. package/dist/contract-emit-B_qriF8B.mjs.map +0 -1
  126. package/dist/contract-emit-C8HmtboH.mjs.map +0 -1
  127. package/dist/db-verify-C24FKhb7.mjs.map +0 -1
  128. package/dist/format-C8yv6mXH.mjs.map +0 -1
  129. package/dist/inspect-live-schema-DF6IwcDl.mjs.map +0 -1
  130. package/dist/migration-check-VwM8xCZV.mjs.map +0 -1
  131. package/dist/migration-command-scaffold-DA-Lhx6o.mjs.map +0 -1
  132. package/dist/migration-list-DlJJ_38Z.mjs.map +0 -1
  133. package/dist/migration-log-CG0qQAFm.mjs.map +0 -1
  134. package/dist/migration-plan-W_E8FQOk.mjs.map +0 -1
  135. package/dist/migration-status-CD-LC2Ip.mjs.map +0 -1
  136. package/dist/types-C_tYiJYx.d.mts.map +0 -1
  137. package/dist/verify-DcOYZ1tH.mjs.map +0 -1
  138. package/src/config-loader.ts +0 -92
  139. package/src/config-path-validation.ts +0 -74
  140. package/src/utils/combine-schema-results.ts +0 -84
@@ -1,8 +1,8 @@
1
- import { F as CliStructuredError } from "./command-helpers-DGMvGBeX.mjs";
1
+ import { F as CliStructuredError } from "./command-helpers-6cNJZ863.mjs";
2
2
  import { n as toExtensionInputs } from "./extension-pack-inputs-1ySHqxKG.mjs";
3
- import { t as assertFrameworkComponentsCompatible } from "./framework-components-YVQHhPH7.mjs";
3
+ import { t as assertFrameworkComponentsCompatible } from "./framework-components-5RljWT7Q.mjs";
4
4
  import { t as enrichContract } from "./contract-enrichment-gn9sWbPw.mjs";
5
- import { t as buildContractSpaceAggregate } from "./contract-space-aggregate-loader-ClI1KN6d.mjs";
5
+ import { t as buildContractSpaceAggregate } from "./contract-space-aggregate-loader-Bu2fjSWV.mjs";
6
6
  import { emit } from "@prisma-next/emitter";
7
7
  import { ifDefined } from "@prisma-next/utils/defined";
8
8
  import { notOk, ok } from "@prisma-next/utils/result";
@@ -144,7 +144,7 @@ function buildPerSpaceBreakdown(orderedResolutions, appSpaceId, options) {
144
144
  }
145
145
  /**
146
146
  * Materialise the `applyOrder` ordering into resolved per-space
147
- * entries. Throws if the planner output is missing a member listed
147
+ * entries. Throws if the planner output is missing a contract space listed
148
148
  * in `applyOrder` — a wiring bug that should never reach runtime.
149
149
  *
150
150
  * Exported so callers building their own success envelopes after a
@@ -197,9 +197,9 @@ const SPAN_IDS$1 = {
197
197
  * 2. **Read DB state**: marker rows (`familyInstance.readAllMarkers`)
198
198
  * + introspected schema (`familyInstance.introspect`).
199
199
  * 3. **Plan**: {@link planMigration} chooses graph-walk vs synth per
200
- * member according to `callerPolicy.ignoreGraphFor`. The app member
200
+ * space according to `callerPolicy.ignoreGraphFor`. The app space
201
201
  * is forced through synth (today's daily-driver behaviour); every
202
- * extension member walks its on-disk graph.
202
+ * extension space walks its on-disk graph.
203
203
  * 4. **Apply** (when `mode === 'apply'`): every per-space `MigrationPlan`
204
204
  * feeds into the runner's `execute` — one outer
205
205
  * transaction across every space; failure on any space rolls back
@@ -273,7 +273,7 @@ async function executeRun(options) {
273
273
  const orderedResolutions = collectOrdered(planResult.value.applyOrder, planResult.value.perSpace);
274
274
  const plannerWarnings = aggregatePlannerWarnings(orderedResolutions);
275
275
  const appResolution = orderedResolutions.find((r) => r.spaceId === aggregate.app.spaceId);
276
- if (!appResolution) throw new Error("Aggregate planner returned no plan for the app member — the planner is supposed to always emit one.");
276
+ if (!appResolution) throw new Error("Aggregate planner returned no plan for the app space — the planner is supposed to always emit one.");
277
277
  const appPlan = appResolution.entry.plan;
278
278
  if (mode === "plan") {
279
279
  const aggregateOps = orderedResolutions.flatMap((r) => r.entry.displayOps);
@@ -325,22 +325,22 @@ function aggregatePlannerWarnings(orderedResolutions) {
325
325
  }
326
326
  /**
327
327
  * Compare the live `_prisma_marker` rows against the aggregate's
328
- * declared members. Any marker row whose `space` is not a member of
328
+ * declared contract spaces. Any marker row whose `space` is not a space of
329
329
  * the aggregate is an "orphan" — typically a marker left behind by
330
330
  * an extension that was removed from `extensionPacks` without first
331
331
  * cleaning up its on-disk migrations / database tables.
332
332
  *
333
333
  * Returns a {@link CliStructuredError} envelope (code `5002`,
334
334
  * `kind: 'orphanMarker'`) for the first orphan it finds, or `null`
335
- * when every marker row maps to a declared member. Mirrors the M2
335
+ * when every marker row maps to a declared contract space. Mirrors the M2
336
336
  * `runContractSpaceVerifierMarkerCheck` envelope so downstream
337
337
  * tooling (integration tests, JSON consumers) keeps asserting on the
338
338
  * same shape.
339
339
  */
340
340
  function detectOrphanMarkers(aggregate, markerRows) {
341
- const memberSpaceIds = new Set([aggregate.app.spaceId, ...aggregate.extensions.map((m) => m.spaceId)]);
341
+ const aggregateSpaceIds = new Set([aggregate.app.spaceId, ...aggregate.extensions.map((m) => m.spaceId)]);
342
342
  const orphans = [];
343
- for (const [spaceId, row] of markerRows) if (row !== null && row !== void 0 && !memberSpaceIds.has(spaceId)) orphans.push(spaceId);
343
+ for (const [spaceId, row] of markerRows) if (row !== null && row !== void 0 && !aggregateSpaceIds.has(spaceId)) orphans.push(spaceId);
344
344
  if (orphans.length === 0) return null;
345
345
  orphans.sort((a, b) => a.localeCompare(b));
346
346
  return new CliStructuredError("5002", orphans.length === 1 ? `Orphan contract-space marker detected for "${orphans[0]}"` : `Orphan contract-space markers detected for ${orphans.length} spaces`, {
@@ -544,11 +544,11 @@ const SPAN_IDS = {
544
544
  * structured CLI error.
545
545
  * 2. **Read DB state**: marker rows + (when `skipSchema` is `false`)
546
546
  * schema introspection.
547
- * 3. **Verify**: {@link verifyMigration} returns per-space
548
- * `markerCheck` + per-space pre-projected `schemaCheck` (closes F23).
549
- * Marker mismatches map to `CliStructuredError` (code `5002`) so
550
- * callers (CLI command) can render and exit. Schema results are
551
- * returned to the caller verbatim.
547
+ * 3. **Verify**: {@link verifyMigration} returns per-space `markerCheck` +
548
+ * per-space `schemaCheck` (each contract space verified against the full schema,
549
+ * then scoped to its own contract space). Marker mismatches map to
550
+ * `CliStructuredError` (code `5002`) so callers (CLI command) can render
551
+ * and exit. Verify results are returned to the caller verbatim.
552
552
  */
553
553
  async function executeDbVerify(options) {
554
554
  const { driver, familyInstance, onProgress, skipSchema, skipMarker } = options;
@@ -569,7 +569,7 @@ async function executeDbVerify(options) {
569
569
  markersBySpaceId,
570
570
  schemaIntrospection,
571
571
  mode: options.mode,
572
- verifySchemaForMember: createPerMemberVerifier(options)
572
+ verifySchemaForSpace: createPerSpaceVerifier(options)
573
573
  }),
574
574
  aggregate,
575
575
  skipMarker,
@@ -616,18 +616,18 @@ async function runIntrospection(args) {
616
616
  }
617
617
  }
618
618
  /**
619
- * Build the per-member schema callback handed to the aggregate verifier.
619
+ * Build the per-space schema callback handed to the aggregate verifier.
620
620
  * When `skipSchema` is true the callback short-circuits with a synthetic
621
621
  * `ok` result so the verifier still runs the (cheap) schemaCheck loop
622
622
  * without invoking the family's verification path.
623
623
  */
624
- function createPerMemberVerifier(options) {
624
+ function createPerSpaceVerifier(options) {
625
625
  const { skipSchema, familyInstance, frameworkComponents } = options;
626
- return (projectedSchema, member, verifyMode) => {
627
- if (skipSchema) return buildSkippedSchemaResult(member);
626
+ return (schema, space, verifyMode) => {
627
+ if (skipSchema) return buildSkippedSchemaResult(space);
628
628
  return familyInstance.verifySchema({
629
- contract: member.contract(),
630
- schema: blindCast(projectedSchema),
629
+ contract: space.contract(),
630
+ schema,
631
631
  strict: verifyMode === "strict",
632
632
  frameworkComponents
633
633
  });
@@ -674,13 +674,14 @@ function finaliseVerifyResult(args) {
674
674
  emitVerifySpan(onProgress, "spanEndOk");
675
675
  return ok({
676
676
  schemaResults: verifyResult.value.schemaCheck.perSpace,
677
- memberOrder: [aggregate.app.spaceId, ...aggregate.extensions.map((e) => e.spaceId)],
677
+ unclaimed: verifyResult.value.schemaCheck.unclaimed,
678
+ spaceOrder: [aggregate.app.spaceId, ...aggregate.extensions.map((e) => e.spaceId)],
678
679
  appSpaceId: aggregate.app.spaceId
679
680
  });
680
681
  }
681
- function buildSkippedSchemaResult(member) {
682
- const contract = member.contract();
683
- const headRef = requireHeadRef(member);
682
+ function buildSkippedSchemaResult(space) {
683
+ const contract = space.contract();
684
+ const headRef = requireHeadRef(space);
684
685
  const profileHash = castAs(contract).profileHash;
685
686
  return {
686
687
  ok: true,
@@ -692,10 +693,11 @@ function buildSkippedSchemaResult(member) {
692
693
  target: { expected: contract.target },
693
694
  schema: {
694
695
  issues: [],
696
+ schemaDiffIssues: [],
695
697
  root: {
696
698
  status: "pass",
697
699
  kind: "skipped",
698
- name: member.spaceId,
700
+ name: space.spaceId,
699
701
  contractPath: "",
700
702
  code: "SKIPPED",
701
703
  message: "Schema verification skipped",
@@ -756,16 +758,16 @@ function mapMarkerCheckFailures(appSpaceId, section) {
756
758
  /**
757
759
  * Apply pending migrations across every contract space (app +
758
760
  * extensions). Replay-only: graph-walk against the on-disk graph for
759
- * every member; no synth, no introspection.
761
+ * every contract space; no synth, no introspection.
760
762
  *
761
763
  * Pipeline:
762
764
  *
763
765
  * 1. Load aggregate from disk (loader hydrates extension graphs;
764
766
  * caller provides app-space packages).
765
767
  * 2. Read live marker rows per space (`familyInstance.readAllMarkers`).
766
- * 3. Per member: `graphWalkStrategy` plots the path from the live
767
- * marker to `member.headRef.hash` (or `refHash` for the app
768
- * member when provided). Empty-graph members fail loudly — a
768
+ * 3. Per space: `graphWalkStrategy` plots the path from the live
769
+ * marker to `space.headRef.hash` (or `refHash` for the app
770
+ * space when provided). Empty-graph spaces fail loudly — a
769
771
  * "never planned" space is a user-error condition for replay.
770
772
  * 4. Hand off to {@link runMigration} (the runner-driving tail
771
773
  * shared with `db init` / `db update`). Marker advancement is
@@ -786,29 +788,29 @@ async function executeMigrate(options) {
786
788
  if (!loaded.ok) throw loaded.failure;
787
789
  const aggregate = loaded.value;
788
790
  const markerRows = await familyInstance.readAllMarkers({ driver });
789
- const allMembers = [aggregate.app, ...aggregate.extensions];
791
+ const allSpaces = [aggregate.app, ...aggregate.extensions];
790
792
  const perSpacePlans = /* @__PURE__ */ new Map();
791
793
  const atHeadResolutions = /* @__PURE__ */ new Map();
792
- for (const member of allMembers) {
793
- const isAppMember = member.spaceId === aggregate.app.spaceId;
794
- const headRef = requireHeadRef(member);
795
- const memberTargetHash = isAppMember && refHash !== void 0 ? refHash : headRef.hash;
796
- const outcome = planMemberPath({
797
- member,
794
+ for (const space of allSpaces) {
795
+ const isAppSpace = space.spaceId === aggregate.app.spaceId;
796
+ const headRef = requireHeadRef(space);
797
+ const spaceTargetHash = isAppSpace && refHash !== void 0 ? refHash : headRef.hash;
798
+ const outcome = planSpacePath({
799
+ space,
798
800
  aggregate,
799
- targetHash: memberTargetHash,
800
- refInvariants: isAppMember && refHash !== void 0 ? refInvariants : void 0,
801
- liveMarker: markerRows.get(member.spaceId) ?? null,
802
- ...isAppMember ? { refName } : {}
801
+ targetHash: spaceTargetHash,
802
+ refInvariants: isAppSpace && refHash !== void 0 ? refInvariants : void 0,
803
+ liveMarker: markerRows.get(space.spaceId) ?? null,
804
+ ...isAppSpace ? { refName } : {}
803
805
  });
804
806
  if (outcome.kind === "at-head") {
805
- atHeadResolutions.set(member.spaceId, outcome.plan);
807
+ atHeadResolutions.set(space.spaceId, outcome.plan);
806
808
  continue;
807
809
  }
808
810
  if (outcome.kind === "never-planned") return notOk(buildNeverPlannedFailure(outcome.spaceId, outcome.targetHash));
809
811
  if (outcome.kind === "unreachable") return notOk(buildPathNotFoundFailure(outcome.spaceId, outcome.liveMarker, outcome.targetHash));
810
812
  if (outcome.kind === "unsatisfiable") {
811
- const structural = findPathWithDecision(outcome.targetMember.graph(), outcome.liveHash, memberTargetHash, { required: /* @__PURE__ */ new Set() });
813
+ const structural = findPathWithDecision(outcome.targetSpace.graph(), outcome.liveHash, spaceTargetHash, { required: /* @__PURE__ */ new Set() });
812
814
  const structuralPath = structural.kind === "ok" ? structural.decision.selectedPath.map((edge) => ({
813
815
  dirName: edge.dirName,
814
816
  migrationHash: edge.migrationHash,
@@ -823,7 +825,7 @@ async function executeMigrate(options) {
823
825
  structuralPath
824
826
  });
825
827
  }
826
- perSpacePlans.set(member.spaceId, outcome.plan);
828
+ perSpacePlans.set(space.spaceId, outcome.plan);
827
829
  }
828
830
  const canonicalOrder = [...aggregate.extensions.map((m) => m.spaceId), aggregate.app.spaceId];
829
831
  const applyOrder = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId));
@@ -892,7 +894,7 @@ async function executeMigrate(options) {
892
894
  }));
893
895
  }
894
896
  /**
895
- * Compute the graph-walk path for one contract-space member.
897
+ * Compute the graph-walk path for one contract space.
896
898
  *
897
899
  * Encapsulates the invariant-correct input assembly that both
898
900
  * `executeMigrate` and `executeMigrateShowCommand` must use:
@@ -901,34 +903,34 @@ async function executeMigrate(options) {
901
903
  * - `targetInvariants` uses the caller-supplied `refInvariants` when a
902
904
  * `--to` ref was resolved (not always the file head ref's invariants).
903
905
  *
904
- * Both callers map the returned `MemberPathOutcome` to their own error
906
+ * Both callers map the returned `SpacePathOutcome` to their own error
905
907
  * representation; the path-compute logic is shared and identical.
906
908
  *
907
909
  * @internal Exported for `executeMigrateShowCommand`.
908
910
  */
909
- function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMarker, refName }) {
910
- const isAppMember = member.spaceId === aggregate.app.spaceId;
911
- const headRef = requireHeadRef(member);
912
- if (member.graph().nodes.size === 0) {
911
+ function planSpacePath({ space, aggregate, targetHash, refInvariants, liveMarker, refName }) {
912
+ const isAppSpace = space.spaceId === aggregate.app.spaceId;
913
+ const headRef = requireHeadRef(space);
914
+ if (space.graph().nodes.size === 0) {
913
915
  const liveHash = liveMarker?.storageHash;
914
916
  if (targetHash === liveHash || liveHash === void 0 && targetHash === EMPTY_CONTRACT_HASH) return {
915
917
  kind: "at-head",
916
918
  plan: buildAtHeadResolution({
917
919
  aggregateTargetId: aggregate.targetId,
918
- member,
920
+ space,
919
921
  targetHash,
920
922
  liveMarker
921
923
  })
922
924
  };
923
925
  return {
924
926
  kind: "never-planned",
925
- spaceId: member.spaceId,
927
+ spaceId: space.spaceId,
926
928
  targetHash
927
929
  };
928
930
  }
929
- const targetInvariants = isAppMember && refInvariants !== void 0 ? refInvariants : headRef.invariants;
930
- const targetMember = targetHash === headRef.hash && targetInvariants === headRef.invariants ? member : {
931
- ...member,
931
+ const targetInvariants = isAppSpace && refInvariants !== void 0 ? refInvariants : headRef.invariants;
932
+ const targetSpace = targetHash === headRef.hash && targetInvariants === headRef.invariants ? space : {
933
+ ...space,
932
934
  headRef: {
933
935
  hash: targetHash,
934
936
  invariants: targetInvariants
@@ -936,13 +938,13 @@ function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMark
936
938
  };
937
939
  const walked = graphWalkStrategy({
938
940
  aggregateTargetId: aggregate.targetId,
939
- member: targetMember,
941
+ space: targetSpace,
940
942
  currentMarker: liveMarker,
941
- ...isAppMember && refName !== void 0 ? { refName } : {}
943
+ ...isAppSpace && refName !== void 0 ? { refName } : {}
942
944
  });
943
945
  if (walked.kind === "unreachable") return {
944
946
  kind: "unreachable",
945
- spaceId: member.spaceId,
947
+ spaceId: space.spaceId,
946
948
  liveMarker,
947
949
  targetHash
948
950
  };
@@ -950,11 +952,11 @@ function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMark
950
952
  const liveHash = liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;
951
953
  return {
952
954
  kind: "unsatisfiable",
953
- spaceId: member.spaceId,
954
- isAppMember,
955
+ spaceId: space.spaceId,
956
+ isAppSpace,
955
957
  missing: walked.missing,
956
958
  targetInvariants,
957
- targetMember,
959
+ targetSpace,
958
960
  liveHash,
959
961
  refName
960
962
  };
@@ -966,24 +968,24 @@ function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMark
966
968
  }
967
969
  /**
968
970
  * Build a zero-op {@link PerSpacePlan} for an empty-graph
969
- * member whose live marker already matches the target. Lets the apply
970
- * pipeline thread the member through `perSpacePlans` -> `applyOrder`
971
+ * space whose live marker already matches the target. Lets the apply
972
+ * pipeline thread the space through `perSpacePlans` -> `applyOrder`
971
973
  * -> the success envelope's `perSpace[]` block so the result reflects
972
974
  * every loaded space, even when there is nothing to execute.
973
975
  */
974
976
  function buildAtHeadResolution(args) {
975
- const { aggregateTargetId, member, targetHash, liveMarker } = args;
977
+ const { aggregateTargetId, space, targetHash, liveMarker } = args;
976
978
  return {
977
979
  plan: {
978
980
  targetId: aggregateTargetId,
979
- spaceId: member.spaceId,
981
+ spaceId: space.spaceId,
980
982
  origin: liveMarker === null ? null : { storageHash: liveMarker.storageHash },
981
983
  destination: { storageHash: targetHash },
982
984
  operations: [],
983
985
  providedInvariants: []
984
986
  },
985
987
  displayOps: [],
986
- destinationContract: member.contract(),
988
+ destinationContract: space.contract(),
987
989
  strategy: "graph-walk",
988
990
  migrationEdges: [buildSynthMigrationEdge({
989
991
  currentMarkerStorageHash: liveMarker?.storageHash,
@@ -1503,7 +1505,8 @@ var ControlClientImpl = class {
1503
1505
  authoringContributions: stack.authoringContributions,
1504
1506
  codecLookup: stack.codecLookup,
1505
1507
  controlMutationDefaults: stack.controlMutationDefaults,
1506
- resolvedInputs: contractConfig.source.inputs ?? []
1508
+ resolvedInputs: contractConfig.source.inputs ?? [],
1509
+ capabilities: stack.capabilities
1507
1510
  };
1508
1511
  const providerResult = await contractConfig.source.load(sourceContext);
1509
1512
  if (!providerResult.ok) {
@@ -1558,9 +1561,10 @@ var ControlClientImpl = class {
1558
1561
  });
1559
1562
  try {
1560
1563
  const enrichedIR = enrichContract(contractRaw, this.frameworkComponents ?? []);
1564
+ const rawContractJson = this.options.target.contractSerializer.serializeContract(enrichedIR);
1561
1565
  let deserializedContract;
1562
1566
  try {
1563
- deserializedContract = this.familyInstance.deserializeContract(enrichedIR);
1567
+ deserializedContract = this.familyInstance.deserializeContract(rawContractJson);
1564
1568
  } catch (error) {
1565
1569
  onProgress?.({
1566
1570
  action: "emit",
@@ -1606,6 +1610,6 @@ var ControlClientImpl = class {
1606
1610
  }
1607
1611
  };
1608
1612
  //#endregion
1609
- export { executeDbInit as a, executeDbUpdate as i, planMemberPath as n, ContractValidationError as o, executeDbVerify as r, createControlClient as t };
1613
+ export { executeDbInit as a, executeDbUpdate as i, planSpacePath as n, ContractValidationError as o, executeDbVerify as r, createControlClient as t };
1610
1614
 
1611
- //# sourceMappingURL=client-CJzuo5wX.mjs.map
1615
+ //# sourceMappingURL=client-CWTNqJdj.mjs.map