@prisma-next/cli 0.14.0-dev.39 → 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 (80) hide show
  1. package/dist/cli.mjs +8 -8
  2. package/dist/{client-VA66WgBx.mjs → client-CWTNqJdj.mjs} +68 -67
  3. package/dist/client-CWTNqJdj.mjs.map +1 -0
  4. package/dist/commands/contract-infer.mjs +1 -1
  5. package/dist/commands/db-init.mjs +2 -2
  6. package/dist/commands/db-schema.mjs +2 -2
  7. package/dist/commands/db-sign.mjs +2 -2
  8. package/dist/commands/db-update.mjs +2 -2
  9. package/dist/commands/db-verify.mjs +1 -1
  10. package/dist/commands/migrate.d.mts +1 -1
  11. package/dist/commands/migrate.d.mts.map +1 -1
  12. package/dist/commands/migrate.mjs +31 -31
  13. package/dist/commands/migrate.mjs.map +1 -1
  14. package/dist/commands/migration-check.d.mts +1 -1
  15. package/dist/commands/migration-check.mjs +1 -1
  16. package/dist/commands/migration-graph.d.mts +1 -1
  17. package/dist/commands/migration-graph.mjs +5 -5
  18. package/dist/commands/migration-graph.mjs.map +1 -1
  19. package/dist/commands/migration-list.d.mts +6 -6
  20. package/dist/commands/migration-list.d.mts.map +1 -1
  21. package/dist/commands/migration-list.mjs +1 -1
  22. package/dist/commands/migration-log.d.mts +1 -1
  23. package/dist/commands/migration-log.mjs +1 -1
  24. package/dist/commands/migration-plan.mjs +1 -1
  25. package/dist/commands/migration-show.mjs +1 -1
  26. package/dist/commands/migration-status.d.mts +1 -1
  27. package/dist/commands/migration-status.mjs +1 -1
  28. package/dist/commands/ref.d.mts +1 -1
  29. package/dist/{contract-infer-Bmq_szvX.mjs → contract-infer-B__56PGb.mjs} +2 -2
  30. package/dist/{contract-infer-Bmq_szvX.mjs.map → contract-infer-B__56PGb.mjs.map} +1 -1
  31. package/dist/{db-verify-r157atLp.mjs → db-verify-DlqHvkkA.mjs} +65 -48
  32. package/dist/db-verify-DlqHvkkA.mjs.map +1 -0
  33. package/dist/exports/control-api.d.mts +3 -3
  34. package/dist/exports/control-api.mjs +1 -1
  35. package/dist/extension-pack-inputs-1ySHqxKG.mjs.map +1 -1
  36. package/dist/{inspect-live-schema-DBF3Rx17.mjs → inspect-live-schema-Dd1Ft0dw.mjs} +2 -2
  37. package/dist/{inspect-live-schema-DBF3Rx17.mjs.map → inspect-live-schema-Dd1Ft0dw.mjs.map} +1 -1
  38. package/dist/{migration-check-CTcJfCC4.mjs → migration-check-UoHMvsP3.mjs} +6 -6
  39. package/dist/migration-check-UoHMvsP3.mjs.map +1 -0
  40. package/dist/{migration-command-scaffold-bxooJ8Jl.mjs → migration-command-scaffold-DW2BpjZW.mjs} +2 -2
  41. package/dist/{migration-command-scaffold-bxooJ8Jl.mjs.map → migration-command-scaffold-DW2BpjZW.mjs.map} +1 -1
  42. package/dist/{migration-list-DVHVmMrf.mjs → migration-list-BOzQzJK4.mjs} +12 -12
  43. package/dist/migration-list-BOzQzJK4.mjs.map +1 -0
  44. package/dist/{migration-log-CBYftWK1.mjs → migration-log-q50rqMiU.mjs} +2 -2
  45. package/dist/{migration-log-CBYftWK1.mjs.map → migration-log-q50rqMiU.mjs.map} +1 -1
  46. package/dist/{migration-plan-o2aqjnfd.mjs → migration-plan-BwJLPkwV.mjs} +19 -19
  47. package/dist/migration-plan-BwJLPkwV.mjs.map +1 -0
  48. package/dist/{migration-status-BLa0SheI.mjs → migration-status-27NzO2SC.mjs} +10 -10
  49. package/dist/migration-status-27NzO2SC.mjs.map +1 -0
  50. package/dist/{types-qETCCNbe.d.mts → types-CKgJmH02.d.mts} +25 -19
  51. package/dist/types-CKgJmH02.d.mts.map +1 -0
  52. package/dist/{verify-CLw3YRbl.mjs → verify-DC14_nPu.mjs} +23 -5
  53. package/dist/verify-DC14_nPu.mjs.map +1 -0
  54. package/package.json +21 -21
  55. package/src/commands/db-verify.ts +31 -19
  56. package/src/commands/migrate.ts +44 -41
  57. package/src/commands/migration-check.ts +5 -5
  58. package/src/commands/migration-graph.ts +4 -4
  59. package/src/commands/migration-list.ts +12 -12
  60. package/src/commands/migration-plan.ts +3 -3
  61. package/src/commands/migration-status.ts +9 -9
  62. package/src/control-api/operations/db-init.ts +2 -2
  63. package/src/control-api/operations/db-run.ts +7 -7
  64. package/src/control-api/operations/db-verify.ts +37 -33
  65. package/src/control-api/operations/migrate.ts +66 -66
  66. package/src/control-api/operations/run-migration.ts +2 -2
  67. package/src/control-api/types.ts +7 -7
  68. package/src/utils/combine-verify-results.ts +113 -0
  69. package/src/utils/extension-pack-inputs.ts +1 -1
  70. package/src/utils/formatters/verify.ts +36 -3
  71. package/src/utils/plan-resolution.ts +18 -18
  72. package/dist/client-VA66WgBx.mjs.map +0 -1
  73. package/dist/db-verify-r157atLp.mjs.map +0 -1
  74. package/dist/migration-check-CTcJfCC4.mjs.map +0 -1
  75. package/dist/migration-list-DVHVmMrf.mjs.map +0 -1
  76. package/dist/migration-plan-o2aqjnfd.mjs.map +0 -1
  77. package/dist/migration-status-BLa0SheI.mjs.map +0 -1
  78. package/dist/types-qETCCNbe.d.mts.map +0 -1
  79. package/dist/verify-CLw3YRbl.mjs.map +0 -1
  80. package/src/utils/combine-schema-results.ts +0 -87
package/dist/cli.mjs CHANGED
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import { D as isCI, O as formatCommandHelp, g as parseGlobalFlagsOrExit, h as parseGlobalFlags, k as formatRootHelp, l as setCommandDescriptions, m as deriveCanPrompt, t as addGlobalOptions, u as setCommandExamples, v as installShutdownHandlers } from "./command-helpers-6cNJZ863.mjs";
3
3
  import { t as createContractEmitCommand } from "./contract-emit-klH7zzaV.mjs";
4
- import { t as createContractInferCommand } from "./contract-infer-Bmq_szvX.mjs";
4
+ import { t as createContractInferCommand } from "./contract-infer-B__56PGb.mjs";
5
5
  import { createDbInitCommand } from "./commands/db-init.mjs";
6
6
  import { createDbSchemaCommand } from "./commands/db-schema.mjs";
7
7
  import { createDbSignCommand } from "./commands/db-sign.mjs";
8
8
  import { createDbUpdateCommand } from "./commands/db-update.mjs";
9
- import { t as createDbVerifyCommand } from "./db-verify-r157atLp.mjs";
9
+ import { t as createDbVerifyCommand } from "./db-verify-DlqHvkkA.mjs";
10
10
  import { t as createFormatCommand } from "./format-C3XdaDuA.mjs";
11
- import { t as createMigrationListCommand } from "./migration-list-DVHVmMrf.mjs";
11
+ import { t as createMigrationListCommand } from "./migration-list-BOzQzJK4.mjs";
12
12
  import { createMigrateCommand } from "./commands/migrate.mjs";
13
- import { t as createMigrationCheckCommand } from "./migration-check-CTcJfCC4.mjs";
13
+ import { t as createMigrationCheckCommand } from "./migration-check-UoHMvsP3.mjs";
14
14
  import { createMigrationGraphCommand } from "./commands/migration-graph.mjs";
15
- import { t as createMigrationLogCommand } from "./migration-log-CBYftWK1.mjs";
15
+ import { t as createMigrationLogCommand } from "./migration-log-q50rqMiU.mjs";
16
16
  import { createMigrationNewCommand } from "./commands/migration-new.mjs";
17
- import { t as createMigrationPlanCommand } from "./migration-plan-o2aqjnfd.mjs";
17
+ import { t as createMigrationPlanCommand } from "./migration-plan-BwJLPkwV.mjs";
18
18
  import { createMigrationShowCommand } from "./commands/migration-show.mjs";
19
- import { r as createMigrationStatusCommand } from "./migration-status-BLa0SheI.mjs";
19
+ import { r as createMigrationStatusCommand } from "./migration-status-27NzO2SC.mjs";
20
20
  import { createRefCommand } from "./commands/ref.mjs";
21
21
  import { t as createTelemetryCommand } from "./telemetry-BckOSUWG.mjs";
22
22
  import { Command } from "commander";
@@ -25,7 +25,7 @@ import { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, user
25
25
  import { distance } from "closest-match";
26
26
  import { fileURLToPath } from "node:url";
27
27
  //#region package.json
28
- var version = "0.14.0-dev.39";
28
+ var version = "0.14.0-dev.40";
29
29
  //#endregion
30
30
  //#region src/commands/init/templates/code-templates.ts
31
31
  function targetPackageName(target) {
@@ -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,
@@ -696,7 +697,7 @@ function buildSkippedSchemaResult(member) {
696
697
  root: {
697
698
  status: "pass",
698
699
  kind: "skipped",
699
- name: member.spaceId,
700
+ name: space.spaceId,
700
701
  contractPath: "",
701
702
  code: "SKIPPED",
702
703
  message: "Schema verification skipped",
@@ -757,16 +758,16 @@ function mapMarkerCheckFailures(appSpaceId, section) {
757
758
  /**
758
759
  * Apply pending migrations across every contract space (app +
759
760
  * extensions). Replay-only: graph-walk against the on-disk graph for
760
- * every member; no synth, no introspection.
761
+ * every contract space; no synth, no introspection.
761
762
  *
762
763
  * Pipeline:
763
764
  *
764
765
  * 1. Load aggregate from disk (loader hydrates extension graphs;
765
766
  * caller provides app-space packages).
766
767
  * 2. Read live marker rows per space (`familyInstance.readAllMarkers`).
767
- * 3. Per member: `graphWalkStrategy` plots the path from the live
768
- * marker to `member.headRef.hash` (or `refHash` for the app
769
- * 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
770
771
  * "never planned" space is a user-error condition for replay.
771
772
  * 4. Hand off to {@link runMigration} (the runner-driving tail
772
773
  * shared with `db init` / `db update`). Marker advancement is
@@ -787,29 +788,29 @@ async function executeMigrate(options) {
787
788
  if (!loaded.ok) throw loaded.failure;
788
789
  const aggregate = loaded.value;
789
790
  const markerRows = await familyInstance.readAllMarkers({ driver });
790
- const allMembers = [aggregate.app, ...aggregate.extensions];
791
+ const allSpaces = [aggregate.app, ...aggregate.extensions];
791
792
  const perSpacePlans = /* @__PURE__ */ new Map();
792
793
  const atHeadResolutions = /* @__PURE__ */ new Map();
793
- for (const member of allMembers) {
794
- const isAppMember = member.spaceId === aggregate.app.spaceId;
795
- const headRef = requireHeadRef(member);
796
- const memberTargetHash = isAppMember && refHash !== void 0 ? refHash : headRef.hash;
797
- const outcome = planMemberPath({
798
- 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,
799
800
  aggregate,
800
- targetHash: memberTargetHash,
801
- refInvariants: isAppMember && refHash !== void 0 ? refInvariants : void 0,
802
- liveMarker: markerRows.get(member.spaceId) ?? null,
803
- ...isAppMember ? { refName } : {}
801
+ targetHash: spaceTargetHash,
802
+ refInvariants: isAppSpace && refHash !== void 0 ? refInvariants : void 0,
803
+ liveMarker: markerRows.get(space.spaceId) ?? null,
804
+ ...isAppSpace ? { refName } : {}
804
805
  });
805
806
  if (outcome.kind === "at-head") {
806
- atHeadResolutions.set(member.spaceId, outcome.plan);
807
+ atHeadResolutions.set(space.spaceId, outcome.plan);
807
808
  continue;
808
809
  }
809
810
  if (outcome.kind === "never-planned") return notOk(buildNeverPlannedFailure(outcome.spaceId, outcome.targetHash));
810
811
  if (outcome.kind === "unreachable") return notOk(buildPathNotFoundFailure(outcome.spaceId, outcome.liveMarker, outcome.targetHash));
811
812
  if (outcome.kind === "unsatisfiable") {
812
- 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() });
813
814
  const structuralPath = structural.kind === "ok" ? structural.decision.selectedPath.map((edge) => ({
814
815
  dirName: edge.dirName,
815
816
  migrationHash: edge.migrationHash,
@@ -824,7 +825,7 @@ async function executeMigrate(options) {
824
825
  structuralPath
825
826
  });
826
827
  }
827
- perSpacePlans.set(member.spaceId, outcome.plan);
828
+ perSpacePlans.set(space.spaceId, outcome.plan);
828
829
  }
829
830
  const canonicalOrder = [...aggregate.extensions.map((m) => m.spaceId), aggregate.app.spaceId];
830
831
  const applyOrder = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId));
@@ -893,7 +894,7 @@ async function executeMigrate(options) {
893
894
  }));
894
895
  }
895
896
  /**
896
- * Compute the graph-walk path for one contract-space member.
897
+ * Compute the graph-walk path for one contract space.
897
898
  *
898
899
  * Encapsulates the invariant-correct input assembly that both
899
900
  * `executeMigrate` and `executeMigrateShowCommand` must use:
@@ -902,34 +903,34 @@ async function executeMigrate(options) {
902
903
  * - `targetInvariants` uses the caller-supplied `refInvariants` when a
903
904
  * `--to` ref was resolved (not always the file head ref's invariants).
904
905
  *
905
- * Both callers map the returned `MemberPathOutcome` to their own error
906
+ * Both callers map the returned `SpacePathOutcome` to their own error
906
907
  * representation; the path-compute logic is shared and identical.
907
908
  *
908
909
  * @internal Exported for `executeMigrateShowCommand`.
909
910
  */
910
- function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMarker, refName }) {
911
- const isAppMember = member.spaceId === aggregate.app.spaceId;
912
- const headRef = requireHeadRef(member);
913
- 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) {
914
915
  const liveHash = liveMarker?.storageHash;
915
916
  if (targetHash === liveHash || liveHash === void 0 && targetHash === EMPTY_CONTRACT_HASH) return {
916
917
  kind: "at-head",
917
918
  plan: buildAtHeadResolution({
918
919
  aggregateTargetId: aggregate.targetId,
919
- member,
920
+ space,
920
921
  targetHash,
921
922
  liveMarker
922
923
  })
923
924
  };
924
925
  return {
925
926
  kind: "never-planned",
926
- spaceId: member.spaceId,
927
+ spaceId: space.spaceId,
927
928
  targetHash
928
929
  };
929
930
  }
930
- const targetInvariants = isAppMember && refInvariants !== void 0 ? refInvariants : headRef.invariants;
931
- const targetMember = targetHash === headRef.hash && targetInvariants === headRef.invariants ? member : {
932
- ...member,
931
+ const targetInvariants = isAppSpace && refInvariants !== void 0 ? refInvariants : headRef.invariants;
932
+ const targetSpace = targetHash === headRef.hash && targetInvariants === headRef.invariants ? space : {
933
+ ...space,
933
934
  headRef: {
934
935
  hash: targetHash,
935
936
  invariants: targetInvariants
@@ -937,13 +938,13 @@ function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMark
937
938
  };
938
939
  const walked = graphWalkStrategy({
939
940
  aggregateTargetId: aggregate.targetId,
940
- member: targetMember,
941
+ space: targetSpace,
941
942
  currentMarker: liveMarker,
942
- ...isAppMember && refName !== void 0 ? { refName } : {}
943
+ ...isAppSpace && refName !== void 0 ? { refName } : {}
943
944
  });
944
945
  if (walked.kind === "unreachable") return {
945
946
  kind: "unreachable",
946
- spaceId: member.spaceId,
947
+ spaceId: space.spaceId,
947
948
  liveMarker,
948
949
  targetHash
949
950
  };
@@ -951,11 +952,11 @@ function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMark
951
952
  const liveHash = liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;
952
953
  return {
953
954
  kind: "unsatisfiable",
954
- spaceId: member.spaceId,
955
- isAppMember,
955
+ spaceId: space.spaceId,
956
+ isAppSpace,
956
957
  missing: walked.missing,
957
958
  targetInvariants,
958
- targetMember,
959
+ targetSpace,
959
960
  liveHash,
960
961
  refName
961
962
  };
@@ -967,24 +968,24 @@ function planMemberPath({ member, aggregate, targetHash, refInvariants, liveMark
967
968
  }
968
969
  /**
969
970
  * Build a zero-op {@link PerSpacePlan} for an empty-graph
970
- * member whose live marker already matches the target. Lets the apply
971
- * 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`
972
973
  * -> the success envelope's `perSpace[]` block so the result reflects
973
974
  * every loaded space, even when there is nothing to execute.
974
975
  */
975
976
  function buildAtHeadResolution(args) {
976
- const { aggregateTargetId, member, targetHash, liveMarker } = args;
977
+ const { aggregateTargetId, space, targetHash, liveMarker } = args;
977
978
  return {
978
979
  plan: {
979
980
  targetId: aggregateTargetId,
980
- spaceId: member.spaceId,
981
+ spaceId: space.spaceId,
981
982
  origin: liveMarker === null ? null : { storageHash: liveMarker.storageHash },
982
983
  destination: { storageHash: targetHash },
983
984
  operations: [],
984
985
  providedInvariants: []
985
986
  },
986
987
  displayOps: [],
987
- destinationContract: member.contract(),
988
+ destinationContract: space.contract(),
988
989
  strategy: "graph-walk",
989
990
  migrationEdges: [buildSynthMigrationEdge({
990
991
  currentMarkerStorageHash: liveMarker?.storageHash,
@@ -1609,6 +1610,6 @@ var ControlClientImpl = class {
1609
1610
  }
1610
1611
  };
1611
1612
  //#endregion
1612
- 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 };
1613
1614
 
1614
- //# sourceMappingURL=client-VA66WgBx.mjs.map
1615
+ //# sourceMappingURL=client-CWTNqJdj.mjs.map