@prisma/orm-toolchain 8.0.0-rc.24-dev.22 → 8.0.0-rc.24-dev.24

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 (74) hide show
  1. package/dist/{aggregate-BmhAhXYL.d.mts → aggregate-C6PGBKyb.d.mts} +7 -3
  2. package/dist/aggregate-C6PGBKyb.d.mts.map +1 -0
  3. package/dist/{aggregate-BIjV2dM9.mjs → aggregate-CRIdmKmq.mjs} +12 -8
  4. package/dist/aggregate-CRIdmKmq.mjs.map +1 -0
  5. package/dist/{caught-errors-Cll-zcA1-MXR0HE1V.mjs → caught-errors-I1l50iPc-D_-F2M3t.mjs} +21 -5
  6. package/dist/caught-errors-I1l50iPc-D_-F2M3t.mjs.map +1 -0
  7. package/dist/cli.d.mts +1 -1
  8. package/dist/cli.mjs +187 -67
  9. package/dist/cli.mjs.map +1 -1
  10. package/dist/cli__control-api.d.mts +17 -5
  11. package/dist/cli__control-api.d.mts.map +1 -1
  12. package/dist/cli__control-api.mjs +2 -2
  13. package/dist/cli__control-api__testing.d.mts +1 -1
  14. package/dist/cli__migration-cli.mjs +3 -3
  15. package/dist/cli__migration-cli.mjs.map +1 -1
  16. package/dist/{contract-snapshot-store-nWnsWPPQ-rJ94UCcE.mjs → contract-snapshot-store-B0fRbVHB-BN2g8BKh.mjs} +3 -3
  17. package/dist/{contract-snapshot-store-nWnsWPPQ-rJ94UCcE.mjs.map → contract-snapshot-store-B0fRbVHB-BN2g8BKh.mjs.map} +1 -1
  18. package/dist/{db-sign-DGSaPRQ--B_9CmDng.d.mts → db-sign-Bv-FZMAD-uQhMNCC7.d.mts} +42 -26
  19. package/dist/db-sign-Bv-FZMAD-uQhMNCC7.d.mts.map +1 -0
  20. package/dist/{errors-DXha_4l--relAaiI4.mjs → errors-BMq40nYH-Cg8PBect.mjs} +33 -4
  21. package/dist/errors-BMq40nYH-Cg8PBect.mjs.map +1 -0
  22. package/dist/{errors-CLwhWJiz.d.mts → errors-oP9FaWWm.d.mts} +5 -2
  23. package/dist/errors-oP9FaWWm.d.mts.map +1 -0
  24. package/dist/{graph-membership-DxpNgxfZ-BfqA-H7V.mjs → graph-membership-D7m41lWA-B68g1CRS.mjs} +3 -3
  25. package/dist/{graph-membership-DxpNgxfZ-BfqA-H7V.mjs.map → graph-membership-D7m41lWA-B68g1CRS.mjs.map} +1 -1
  26. package/dist/{invariants-DrF9p5Gd-BF70vGl1.mjs → invariants-DxCj82g2-DhGkStla.mjs} +3 -3
  27. package/dist/{invariants-DrF9p5Gd-BF70vGl1.mjs.map → invariants-DxCj82g2-DhGkStla.mjs.map} +1 -1
  28. package/dist/{io-4O31S6Ei-DvsFKW_Y.mjs → io-B39zsxMm-D5Wcf6cf.mjs} +5 -5
  29. package/dist/{io-4O31S6Ei-DvsFKW_Y.mjs.map → io-B39zsxMm-D5Wcf6cf.mjs.map} +1 -1
  30. package/dist/{migration-CWyjX9vz.mjs → migration-DTmtOJ0n.mjs} +3 -3
  31. package/dist/{migration-CWyjX9vz.mjs.map → migration-DTmtOJ0n.mjs.map} +1 -1
  32. package/dist/migration-tools.d.mts +6 -5
  33. package/dist/migration-tools.mjs +12 -12
  34. package/dist/migration-tools__aggregate.d.mts +1 -1
  35. package/dist/migration-tools__aggregate.mjs +1 -1
  36. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  37. package/dist/migration-tools__errors.d.mts +2 -2
  38. package/dist/migration-tools__errors.mjs +2 -2
  39. package/dist/migration-tools__invariants.mjs +1 -1
  40. package/dist/migration-tools__io.mjs +1 -1
  41. package/dist/migration-tools__migration-graph.mjs +1 -1
  42. package/dist/migration-tools__migration.mjs +1 -1
  43. package/dist/migration-tools__ref-resolution.d.mts +1 -1
  44. package/dist/migration-tools__ref-resolution.mjs +1 -1
  45. package/dist/migration-tools__refs.d.mts +3 -2
  46. package/dist/migration-tools__refs.mjs +2 -2
  47. package/dist/migration-tools__spaces.mjs +2 -2
  48. package/dist/{ref-D4GWEHQU-BOqb4i_E.mjs → ref-DfuqRCA7-CPPoVHY9.mjs} +459 -101
  49. package/dist/ref-DfuqRCA7-CPPoVHY9.mjs.map +1 -0
  50. package/dist/{ref-resolution-Eo0QHp4f.mjs → ref-resolution-C9j2SSb6.mjs} +2 -2
  51. package/dist/{ref-resolution-Eo0QHp4f.mjs.map → ref-resolution-C9j2SSb6.mjs.map} +1 -1
  52. package/dist/{ref-resolution-BPhR-kta.d.mts → ref-resolution-UwnXbc9M.d.mts} +2 -2
  53. package/dist/{ref-resolution-BPhR-kta.d.mts.map → ref-resolution-UwnXbc9M.d.mts.map} +1 -1
  54. package/dist/refs-B5N_vHH7.d.mts +1 -0
  55. package/dist/{refs-BNCUu58Y-BIso5Jfg.d.mts → refs-CkGjbosE-CLkrSkQ4.d.mts} +18 -3
  56. package/dist/refs-CkGjbosE-CLkrSkQ4.d.mts.map +1 -0
  57. package/dist/{refs-DM3q3IZC-BC6H6P0X.mjs → refs-t_JbIjGo-CRpBRRkq.mjs} +79 -20
  58. package/dist/refs-t_JbIjGo-CRpBRRkq.mjs.map +1 -0
  59. package/dist/{spaces-BIABdklg.mjs → spaces-OVZ0QzWJ.mjs} +5 -5
  60. package/dist/{spaces-BIABdklg.mjs.map → spaces-OVZ0QzWJ.mjs.map} +1 -1
  61. package/dist/{verify-contract-spaces-BmnQiKDj-JwT2fAPh.mjs → verify-contract-spaces-BOnqhfQs-BBq5YOKo.mjs} +11 -7
  62. package/dist/verify-contract-spaces-BOnqhfQs-BBq5YOKo.mjs.map +1 -0
  63. package/dist/vite-plugin-contract-emit.mjs +1 -1
  64. package/package.json +12 -12
  65. package/dist/aggregate-BIjV2dM9.mjs.map +0 -1
  66. package/dist/aggregate-BmhAhXYL.d.mts.map +0 -1
  67. package/dist/caught-errors-Cll-zcA1-MXR0HE1V.mjs.map +0 -1
  68. package/dist/db-sign-DGSaPRQ--B_9CmDng.d.mts.map +0 -1
  69. package/dist/errors-CLwhWJiz.d.mts.map +0 -1
  70. package/dist/errors-DXha_4l--relAaiI4.mjs.map +0 -1
  71. package/dist/ref-D4GWEHQU-BOqb4i_E.mjs.map +0 -1
  72. package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts.map +0 -1
  73. package/dist/refs-DM3q3IZC-BC6H6P0X.mjs.map +0 -1
  74. package/dist/verify-contract-spaces-BmnQiKDj-JwT2fAPh.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-DfuqRCA7-CPPoVHY9.mjs","names":["errorConfigValidation"],"sources":["../../../../1-framework/3-tooling/cli/dist/ref-DfuqRCA7.mjs"],"sourcesContent":["import { $ as errorStatementDidNotResolveLoss, C as errorAmbiguousMigrationRef, D as errorContractConfigMissing, G as errorRefSetBundleNotFound, H as errorPlanForgotTheFlag, J as errorRuntime, K as errorRefSetEmptySentinel, L as errorMigrationHasUnfilledPlaceholders, M as errorFileNotFound, O as errorContractValidationFailed, P as errorInvalidSpaceId, Q as errorStatementAnswersNoQuestion, St as statementFlag, T as errorConsentUnused, U as errorPlanOriginUnknown, V as errorPathUnreachable, W as errorPlanProducedNoOperations, X as errorSnapshotMissing, Z as errorSpaceNotFound, _t as writtenMigrationRunCommand, a as getTargetMigrations, b as CliStructuredError$1, bt as runCommandAction, c as resolveContractPath, ct as requireLiveDatabase, d as toStructuralEdge, dt as dbMigrateRerun, et as errorStatementInvalid, ft as dbUpdateRerun, gt as selfEmitCommand, i as collectDeclaredInvariants, it as errorTargetMigrationNotSupported, l as resolveMigrationPaths, lt as cliCommand, mt as printedPlanCommand, n as errorFromCaught, nt as errorStatementOriginUnknown, ot as errorUnexpected, pt as printedPath, q as errorRefSetHashNotInGraph, r as closeQuietly, rt as errorStatementUnresolved, s as readContractEnvelope, st as mapRefResolutionError, t as cliErrorFromStructured, tt as errorStatementNeedsMigrationFile, v as migrationsDirFor, vt as chooseAction, w as errorConfigValidation, x as STORE_ORIGIN_SNAPSHOT_STEPS, xt as shellQuoted, y as ActionableCliError, yt as editFileAction, z as errorMigrationPlanningFailed } from \"./caught-errors-I1l50iPc.mjs\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { emit, getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME, createControlStack, databasePoliciesOf, databasePolicyDifferences, databasePolicyValueText, describeMigrationStatement, enumValueCoordinateFromJson, enumValueStatementText, fieldStatementText, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, isStorageHashHex, migrationStatementJson, migrationSubjectJson, migrationSubjectKey, modelDisplayName, modelStatementText, movedDatabasePoliciesWhy, planOriginOf, valueObjectFieldStatementText, withDeclaredDatabasePolicies } from \"@internal/framework-components/control\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { docsUrlFor, isStructuredError, isStructuredErrorCode, structuredError } from \"@internal/utils/structured-error\";\nimport { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { basename, dirname, isAbsolute, join, relative, resolve } from \"pathe\";\nimport { errorMarkerPoliciesCorrupt } from \"@internal/errors/execution\";\nimport { contractSnapshotDir, createSnapshotContentVerifier, readContractSnapshotJson, snapshotsImportPathFrom, writeContractSnapshot } from \"@internal/migration-tools/contract-snapshot-store\";\nimport { allStorageElementsExternal, buildFabricatedMigrationEdge, collectAggregateNamespaces, contractHashAtMarker, loadContractSpaceAggregate, planMigration, requireHeadRef, resolveRecordedPath, spacesInApplyOrder, verifyMigration } from \"@internal/migration-tools/aggregate\";\nimport { MigrationToolsError, errorContractDeserializationFailed, errorInvalidRefFile, errorInvalidRefName, errorNoInvariantPath, errorUnknownInvariant } from \"@internal/migration-tools/errors\";\nimport { formatMigrationTs, writeMigrationTs } from \"@internal/migration-tools/migration-ts\";\nimport { asNamespaceId, valueObjectAt, valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { UNBOUND_NAMESPACE_ID, changedElementCoordinates } from \"@internal/framework-components/ir\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { mkdir, readFile, rename, rm, writeFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID as APP_SPACE_ID$1, emitContractSpaceArtifacts, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory } from \"@internal/migration-tools/spaces\";\nimport { assertHashIsGraphNode, findPath, findPathWithDecision, isGraphNode } from \"@internal/migration-tools/migration-graph\";\nimport { expandContractInputs } from \"@internal/config-loader\";\nimport { abortable } from \"@internal/utils/abortable\";\nimport { ImportRootError, createImportSpecifierResolver, importRootForDependencies, internalImportRoot } from \"@internal/publish-surface/import-roots\";\nimport { resolve as resolve$1 } from \"node:path\";\nimport { formatMigrationDirName, materialiseExtensionMigrationPackageIfMissing, writeMigrationPackage } from \"@internal/migration-tools/io\";\nimport { HEAD_REF_NAME, advanceRef, deleteRef, readRefs, refsByContractHash, validateRefName, validateRefValue } from \"@internal/migration-tools/refs\";\nimport { EMPTY_CONTRACT_REF, LIVE_MARKER_REF, RESERVED_CONTRACT_REFS, isLiveMarkerRef, isReservedContractRef, parseContractRef, parseMigrationRef } from \"@internal/migration-tools/ref-resolution\";\nimport { type } from \"arktype\";\nimport { computeMigrationHash, verifyMigrationHash } from \"@internal/migration-tools/hash\";\nimport { deriveProvidedInvariants } from \"@internal/migration-tools/invariants\";\n//#region src/utils/contract-validation-meta.ts\n/**\n* The meta of a contract that failed to load because the family refused it, such as the columns whose defaults it refused, for the command to report: the refusal's own meta, or the `refusedDefaults` a migration-tools error kept from it.\n*/\nfunction contractValidationMeta(error) {\n\tif (!isStructuredError(error)) return void 0;\n\tif (error.code === \"CONTRACT.VALIDATION_FAILED\") return error.meta;\n\tconst refusedDefaults = error.meta?.[\"refusedDefaults\"];\n\treturn refusedDefaults === void 0 ? void 0 : { refusedDefaults };\n}\n//#endregion\n//#region src/utils/framework-components.ts\n/**\n* Asserts that all framework components are compatible with the expected family and target.\n*\n* This function validates that each component in the framework components array:\n* - Has kind 'target', 'adapter', 'extension', or 'driver'\n* - Has familyId matching expectedFamilyId\n* - Has targetId matching expectedTargetId\n*\n* This validation happens at the CLI composition boundary, before passing components\n* to typed planner/runner instances. It fills the gap between runtime validation\n* (the `orm` config schema's diagnostics) and compile-time\n* type enforcement.\n*\n* @param expectedFamilyId - The expected family ID (e.g., 'sql')\n* @param expectedTargetId - The expected target ID (e.g., 'postgres')\n* @param frameworkComponents - Array of framework components to validate\n* @returns The same array typed as TargetBoundComponentDescriptor\n* @throws CliStructuredError if any component is incompatible\n*\n* @example\n* ```ts\n* const configResult = await loadConfigForSections(undefined, ['family', 'target', 'adapter', 'extensions']);\n* const config = configResult.assertOk();\n* const frameworkComponents = [config.target, config.adapter, ...(config.extensions ?? [])];\n*\n* // Validate and type-narrow components before passing to planner\n* const typedComponents = assertFrameworkComponentsCompatible(\n* config.family.familyId,\n* config.target.targetId,\n* frameworkComponents\n* );\n*\n* const planner = target.migrations.createPlanner(familyInstance);\n* planner.plan({ contract, schema, policy, frameworkComponents: typedComponents });\n* ```\n*/\nfunction assertFrameworkComponentsCompatible(expectedFamilyId, expectedTargetId, frameworkComponents) {\n\tfor (let i = 0; i < frameworkComponents.length; i++) {\n\t\tconst component = frameworkComponents[i];\n\t\tif (typeof component !== \"object\" || component === null) throw errorConfigValidation(\"frameworkComponents[]\", { why: `Framework component at index ${i} must be an object` });\n\t\tconst record = component;\n\t\tif (!Object.hasOwn(record, \"kind\")) throw errorConfigValidation(\"frameworkComponents[].kind\", { why: `Framework component at index ${i} must have 'kind' property` });\n\t\tconst kind = record[\"kind\"];\n\t\tif (kind !== \"target\" && kind !== \"adapter\" && kind !== \"extension\" && kind !== \"driver\") throw errorConfigValidation(\"frameworkComponents[].kind\", { why: `Framework component at index ${i} has invalid kind '${String(kind)}' (must be 'target', 'adapter', 'extension', or 'driver')` });\n\t\tif (!Object.hasOwn(record, \"familyId\")) throw errorConfigValidation(\"frameworkComponents[].familyId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'familyId' property` });\n\t\tconst familyId = record[\"familyId\"];\n\t\tif (familyId !== expectedFamilyId) throw errorConfigValidation(\"frameworkComponents[].familyId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) has familyId '${String(familyId)}' but expected '${expectedFamilyId}'` });\n\t\tif (!Object.hasOwn(record, \"targetId\")) throw errorConfigValidation(\"frameworkComponents[].targetId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'targetId' property` });\n\t\tconst targetId = record[\"targetId\"];\n\t\tif (targetId !== expectedTargetId) throw errorConfigValidation(\"frameworkComponents[].targetId\", { why: `Framework component at index ${i} (kind: ${String(kind)}) has targetId '${String(targetId)}' but expected '${expectedTargetId}'` });\n\t}\n\treturn frameworkComponents;\n}\n//#endregion\n//#region src/utils/snapshot-content-verification.ts\n/**\n* Build the per-command snapshot content verifier from the target\n* serializer's `hashCanonicalizationHooks` — the hooks the family's emit\n* pipeline computed the published storage hash with. The serializer's own\n* `shouldPreserveEmpty` / `sortStorage` must NOT be used here: they govern\n* on-disk serialization and may be broader per target (Postgres preserves\n* required entity-kind fields at default values), so recomputing with them\n* would reject untampered snapshots. A serializer that does not declare its\n* hashing hooks (structural test stand-ins) reads without content\n* verification. Build one verifier per command run and share it across\n* every load, so each snapshot hash is recomputed at most once per run.\n*/\nfunction snapshotVerifierFor(config) {\n\tconst hooks = config.target.contractSerializer?.hashCanonicalizationHooks;\n\tif (hooks === void 0) return;\n\treturn createSnapshotContentVerifier(hooks);\n}\n//#endregion\n//#region src/control-api/contract-enrichment.ts\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction sortDeep(value) {\n\tif (Array.isArray(value)) return value.map(sortDeep);\n\tif (!isPlainObject(value)) return value;\n\tconst entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));\n\tconst next = {};\n\tfor (const [key, child] of entries) next[key] = sortDeep(child);\n\treturn next;\n}\nfunction sortDeepTyped(value) {\n\treturn sortDeep(value);\n}\n/**\n* The keys of a pack's `types` metadata that a contract carries. Any other key stays out of the contract, such as the `storage` list that a pack built for an earlier framework still declares.\n*/\nconst CONTRACT_TYPES_KEYS = /* @__PURE__ */ new Set([\n\t\"aggregateDescriptors\",\n\t\"codecTypes\",\n\t\"operationTypes\",\n\t\"queryOperationTypes\"\n]);\nfunction extractExtensionPackMeta(component) {\n\tconst { kind, id, version, capabilities, types } = component;\n\tconst base = {\n\t\tkind,\n\t\tid,\n\t\tfamilyId: component.familyId,\n\t\ttargetId: component.targetId,\n\t\tversion\n\t};\n\tif (capabilities) base[\"capabilities\"] = capabilities;\n\tif (types) {\n\t\tconst carried = Object.fromEntries(Object.entries(types).filter(([key]) => CONTRACT_TYPES_KEYS.has(key)));\n\t\tif (types.codecTypes) {\n\t\t\tconst { controlPlaneHooks: _, codecDescriptors: _cd, ...cleanedCodecTypes } = types.codecTypes;\n\t\t\tbase[\"types\"] = {\n\t\t\t\t...carried,\n\t\t\t\tcodecTypes: cleanedCodecTypes\n\t\t\t};\n\t\t} else base[\"types\"] = carried;\n\t}\n\treturn base;\n}\n/**\n* Enriches a raw contract with framework-derived metadata: capabilities from all component descriptors and extension pack metadata from extension descriptors. Produces deterministically sorted output.\n*/\nfunction enrichContract(ir, components) {\n\tconst mergedCapabilities = mergeCapabilityMatrices(ir.capabilities, components);\n\tconst extensionsMeta = {};\n\tfor (const component of components) if (component.kind === \"extension\") extensionsMeta[component.id] = extractExtensionPackMeta(component);\n\tconst extensions = Object.keys(extensionsMeta).length > 0 ? {\n\t\t...ir.extensions,\n\t\t...extensionsMeta\n\t} : ir.extensions;\n\treturn {\n\t\t...ir,\n\t\tcapabilities: sortDeepTyped(mergedCapabilities),\n\t\textensions: sortDeepTyped(extensions)\n\t};\n}\n//#endregion\n//#region src/utils/calls-as-written.ts\nconst OPEN = \" return [\\n \";\nconst CLOSE = \",\\n ];\";\n/**\n* `calls`, a call or calls separated by commas, as a written `migration.ts` holds them in its\n* `operations` list: formatted as `migration plan` formats the file, with the indentation it gives\n* each line after the first.\n*/\nasync function asWritten(calls) {\n\tconst formatted = await formatMigrationTs(`class M {\\n get operations() {\\n return [${calls}];\\n }\\n}\\n`);\n\tconst start = formatted.indexOf(OPEN);\n\tconst end = formatted.lastIndexOf(CLOSE);\n\treturn start === -1 || end === -1 ? calls : formatted.slice(start + 19, end);\n}\n/** The facts, with each edit that keeps data quoted as the written `migration.ts` holds its calls. */\nasync function withEditsAsWritten(facts) {\n\tif (facts.rowsHoldingValue === void 0) return facts;\n\tconst written = async (edit) => ({\n\t\t...edit,\n\t\tremove: await asWritten(edit.remove),\n\t\treplaceWith: await asWritten(edit.replaceWith)\n\t});\n\treturn {\n\t\t...facts,\n\t\trowsHoldingValue: await Promise.all(facts.rowsHoldingValue.map(async (report) => report.keepDataEdit === void 0 ? report : {\n\t\t\t...report,\n\t\t\tkeepDataEdit: await written(report.keepDataEdit)\n\t\t}))\n\t};\n}\n//#endregion\n//#region src/control-api/operations/db-update-policy.ts\n/** The operation classes `db update` applies. */\nconst DB_UPDATE_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\"\n] };\n//#endregion\n//#region src/utils/failed-precheck-advice.ts\n/** The way out of a failed check before an operation of `db migrate`. */\nfunction migrateFailedPrecheckAdvice(report, invocation) {\n\tif (report.planStartsFromMarker) return [chooseAction(`The database has drifted from its migration history: it is not in the state the migrations before this one leave. See how it differs from the contract with \\`${cliCommand(invocation, \"db verify\")}\\`, change the database or the migration so they agree, and run \\`${dbMigrateRerun(invocation)}\\` again`)];\n\treturn [runCommandAction(`The database has no migration marker, so \\`${cliCommand(invocation, \"db migrate\")}\\` applies every migration from the first, and the database may already be ahead of this one. If its schema already matches the contract, adopt it instead`, cliCommand(invocation, \"db sign\"))];\n}\n/** The way out of a failed check before an operation of `db init`, which runs only on a database with no marker. */\nfunction dbInitFailedPrecheckAdvice(invocation) {\n\treturn [runCommandAction(`The database already holds part of the schema \\`${cliCommand(invocation, \"db init\")}\\` would create. If its schema already matches the contract, adopt it instead`, cliCommand(invocation, \"db sign\"))];\n}\n//#endregion\n//#region src/utils/schema-check-issues.ts\n/** The issues a failed schema check after apply reported; a check that reported none counts as none. */\nfunction schemaCheckIssues(failure) {\n\tconst issues = failure.meta.schemaIssues;\n\treturn issues === void 0 || issues.length === 0 ? void 0 : issues;\n}\n//#endregion\n//#region src/utils/runner-failure-advice.ts\n/** What a runner failure says of a type change that failed: who converted the values, and how it failed. */\nfunction failedTypeChangeText(change) {\n\tif (change.by === \"cast\") return change.reason === \"noCast\" ? `The database has no cast from the old type of field \"${change.field}\" to its new type.` : `A value of field \"${change.field}\" cannot be converted to its new type by the database's cast.`;\n\tswitch (change.reason) {\n\t\tcase \"value\": return `The conversion of field \"${change.field}\" failed on a value its new type cannot hold.`;\n\t\tcase \"invalidResult\": return `The conversion of field \"${change.field}\" left a value its new type cannot hold.`;\n\t\tcase \"expressionError\": return `The conversion of field \"${change.field}\" failed with an error in its expression.`;\n\t}\n}\nfunction quoted$1(command) {\n\treturn `\\`${command}\\``;\n}\n/** A `db migrate` command as advice prints it, for a migration that is not the one the user ran. */\nfunction dbMigrateCommand(invocation) {\n\treturn quoted$1(cliCommand(invocation, \"db migrate\"));\n}\n/** The `db migrate` the user ran, as advice that repeats it prints it. */\nfunction dbMigrateAgain(invocation) {\n\treturn quoted$1(dbMigrateRerun(invocation));\n}\n/** The steps after filling the migration.ts a `migration plan` wrote with no placeholders: run it, which writes its operations, and apply it. */\nfunction runWrittenFile(invocation) {\n\treturn `run ${quoted$1(writtenMigrationRunCommand(invocation))} for the directory it writes, and apply it with ${dbMigrateCommand(invocation)}`;\n}\n/** The step between filling a planned migration.ts and applying it, which writes its operations. */\nconst RUN_PLANNED_FILE = \"run that migration.ts with the `node` command `migration plan` prints\";\n/** What advice that plans a migration again says of the statements it was planned with, which the CLI does not store. */\nconst OTHER_STATEMENTS = \"adding any other statements you planned it with\";\nfunction backfillFlags(reports) {\n\treturn [...new Set(reports.flatMap(({ field }) => field === void 0 ? [] : [statementFlag({\n\t\tverb: \"backfill\",\n\t\ttext: field\n\t})]))];\n}\n/** The way out of a cast that met a value it cannot cast without changing the migration: change that value, then `rerun`. */\nfunction changeValueAdvice(change, rerun) {\n\treturn change.by === \"cast\" && change.reason === \"value\" ? [chooseAction(`Change the value the failure names so the database's cast accepts it, then re-run ${rerun}`)] : [];\n}\n/** The way out of a failed cast for `db update`, which plans and applies in one step. */\nfunction dbUpdateFailedTypeChangeAdvice(change, databaseStorageHash, invocation) {\n\tconst plan = printedPlanCommand(invocation, databaseStorageHash, [statementFlag({\n\t\tverb: \"convert\",\n\t\ttext: change.field\n\t})]);\n\treturn [chooseAction(`${failedTypeChangeText(change)} Plan the change with ${quoted$1(plan)}, write the conversion in the migration.ts it writes, ${RUN_PLANNED_FILE}, and apply it with ${dbMigrateCommand(invocation)}`), ...changeValueAdvice(change, quoted$1(dbUpdateRerun(invocation)))];\n}\n/** The way out of rows without a value for `db update`, which plans and applies in one step. */\nfunction dbUpdateRowsWithoutValueAdvice(reports, databaseStorageHash, invocation) {\n\tconst flags = backfillFlags(reports);\n\tconst planned = flags.length === 0 ? [] : [chooseAction(`Plan it with ${quoted$1(printedPlanCommand(invocation, databaseStorageHash, flags))}, fill the backfill steps in the migration.ts it writes, ${RUN_PLANNED_FILE}, and apply it with ${dbMigrateCommand(invocation)}`)];\n\tconst [first] = reports;\n\tif (first?.reason === \"nullValues\") {\n\t\tconst keep = optionalFields([first], \"the field\");\n\t\treturn [\n\t\t\tchooseAction(`Set a value in ${theRows(first.rows)}`),\n\t\t\t...keep === void 0 ? [] : [editFileAction(`Keep ${keep.text} optional in the contract source`)],\n\t\t\t...planned\n\t\t];\n\t}\n\tconst optional = optionalFields(reports, theFields(reports));\n\treturn [...planned, ...optional === void 0 ? [] : [editFileAction(`Make ${optional.text} optional in the contract source`)]];\n}\n/**\n* The fields of the reports the contract can make optional, which leaves out discriminators: in the words the caller\n* gives for all of them, or by name when a discriminator is left out. Undefined when every field is a discriminator.\n*/\nfunction optionalFields(reports, allOfThem) {\n\tconst optional = reports.filter(({ discriminator }) => !discriminator);\n\tif (optional.length === 0) return;\n\tconst named = distinct(optional.flatMap(({ field }) => field === void 0 ? [] : [field]));\n\tif (optional.length === reports.length || named.length === 0) return {\n\t\ttext: allOfThem,\n\t\tone: reports.length === 1\n\t};\n\tconst [only] = named;\n\treturn named.length === 1 && only !== void 0 ? {\n\t\ttext: `field \"${only}\"`,\n\t\tone: true\n\t} : {\n\t\ttext: `fields ${named.map((field) => `\"${field}\"`).join(\", \")}`,\n\t\tone: false\n\t};\n}\nfunction theFields(reports) {\n\treturn new Set(reports.flatMap(({ field }) => field === void 0 ? [] : [field])).size > 1 ? \"the fields\" : \"the field\";\n}\nfunction distinct(values) {\n\treturn [...new Set(values)];\n}\n/** The first report of each enum value, in the order the reports name them. */\nfunction onePerEnumValue(reports) {\n\treturn reports.filter((report, index) => reports.findIndex(({ enumValue }) => enumValue === report.enumValue) === index);\n}\nfunction renameFlags(reports) {\n\treturn onePerEnumValue(reports).map(({ enumValue, enumName }) => statementFlag({\n\t\tverb: \"rename\",\n\t\ttext: `${enumValue}:${enumName}.<new member>`\n\t}));\n}\nfunction deleteFlags(reports) {\n\treturn onePerEnumValue(reports).map(({ enumValue }) => statementFlag({\n\t\tverb: \"delete\",\n\t\ttext: enumValue\n\t}));\n}\nfunction newMember(reports, invocation) {\n\tconst enumNames = distinct(reports.map(({ enumName }) => `\"${enumName}\"`));\n\treturn `To keep that data under a new enum value, add a member to ${enumNames.length === 1 ? `enum ${enumNames[0]}` : `each of enums ${enumNames.join(\", \")}`} in the contract source, run ${quoted$1(cliCommand(invocation, \"contract emit\"))}`;\n}\n/** The edits the target gives that keep the data, each call on its own lines as the migration.ts holds it; undefined when it gives none. */\nfunction swapCalls(reports) {\n\tconst swaps = reports.flatMap(({ keepDataEdit }) => keepDataEdit === void 0 ? [] : [`Replace:\\n${keepDataEdit.remove}\\nwith:\\n${keepDataEdit.replaceWith}`]);\n\treturn swaps.length === 0 ? void 0 : swaps.join(\"\\n\");\n}\nconst KEPT_VALUE = \"where <stored value> is a stored value the enum keeps\";\n/** The run's statements, without the deletes of the enum values that failed. */\nfunction otherStatements$1(invocation, reports) {\n\tconst failed = deleteFlags(reports);\n\treturn (invocation.statementArgs ?? []).filter((flag) => !failed.includes(flag));\n}\nfunction storedValuesText(reports) {\n\tconst values = distinct(reports.map(({ value }) => JSON.stringify(value)));\n\treturn values.length === 1 ? `the stored value ${values[0]} to one the enum keeps` : `each of the stored values ${values.join(\", \")} to one its enum keeps`;\n}\n/** The way out when the data of required columns holds stored values `db update` removes. */\nfunction dbUpdateRowsHoldingValueAdvice(reports, databaseStorageHash, invocation) {\n\tconst others = otherStatements$1(invocation, reports);\n\tconst deletes = deleteFlags(reports);\n\tconst rename = chooseAction(`${newMember(reports, invocation)}, then run ${quoted$1(cliCommand(invocation, \"db update\", [...others, ...renameFlags(reports)]))}`);\n\tif (databaseStorageHash === void 0) return [rename, chooseAction(`To keep that data under another stored value, change ${storedValuesText(reports)} in the database yourself, then re-run ${quoted$1(dbUpdateRerun(invocation, [...others, ...deletes]))}`)];\n\tconst swaps = swapCalls(reports);\n\tif (swaps === void 0) return [rename];\n\treturn [rename, chooseAction(`To keep that data by hand, plan the change with ${quoted$1(printedPlanCommand(invocation, databaseStorageHash, [...others, ...deletes]))}, make the edits below in the migration.ts it writes, ${KEPT_VALUE}, ${runWrittenFile(invocation)}.\\n${swaps}`)];\n}\nfunction migrateRowsHoldingValueAdvice(reports, failedMigration, invocation) {\n\tconst { file, run } = failedMigrationFile(failedMigration);\n\tconst swaps = swapCalls(reports);\n\tconst byHand = swaps === void 0 ? [] : [editFileAction(`To keep that data by hand, make the edits below in ${file}, ${KEPT_VALUE}, ${run}, and re-run ${dbMigrateAgain(invocation)}.\\n${swaps}`)];\n\tif (failedMigration === void 0) return byHand;\n\treturn [replan(`${newMember(reports, invocation)}, delete`, renameFlags(reports), failedMigration, deleteFlags(reports).map((flag) => `\\`${flag}\\``).join(\" or \"), `put any code you copied into the migration.ts it writes, ${runWrittenFile(invocation)}`), ...byHand];\n}\n/** Where the operation that updates the rows goes among the operations of a migration.ts that replaces a check. */\nfunction betweenTheChecks(report, replacedCheck) {\n\treturn `after the operation that drops check \"${replacedCheck}\" and before the operation that adds check \"${report.check}\"`;\n}\nfunction updateOperation(report) {\n\treturn `an operation that updates those rows to fit check \"${report.check}\"`;\n}\nfunction fixRowsFirst(report, rerun) {\n\treturn chooseAction(`Update or delete those rows so they fit check \"${report.check}\", then re-run ${quoted$1(rerun)}`);\n}\n/** The way out when existing rows fail a check `db update` adds: it cannot keep the data while the check it replaces holds. */\nfunction dbUpdateRowsFailingCheckAdvice(report, databaseStorageHash, invocation) {\n\tconst update = dbUpdateRerun(invocation);\n\tconst { replacedCheck } = report;\n\tif (replacedCheck === void 0) return [fixRowsFirst(report, update)];\n\tconst cannotKeep = `${quoted$1(cliCommand(invocation, \"db update\"))} cannot keep this data`;\n\tif (databaseStorageHash === void 0) return [chooseAction(`${cannotKeep}, and no migration ends at the contract the database is at, so ${quoted$1(cliCommand(invocation, \"migration plan\"))} cannot plan from it. Drop check \"${replacedCheck}\" in the database yourself, update those rows to fit check \"${report.check}\", then re-run ${quoted$1(update)}`)];\n\treturn [chooseAction(`${cannotKeep}. Plan the change with ${quoted$1(printedPlanCommand(invocation, databaseStorageHash, invocation.statementArgs ?? []))}, add ${updateOperation(report)} to the migration.ts it writes, ${betweenTheChecks(report, replacedCheck)}, ${runWrittenFile(invocation)}`)];\n}\nfunction migrateRowsFailingCheckAdvice(report, failedMigration, invocation) {\n\tconst { replacedCheck } = report;\n\tif (replacedCheck === void 0) return [fixRowsFirst(report, dbMigrateRerun(invocation))];\n\tconst { file, run } = failedMigrationFile(failedMigration);\n\treturn [editFileAction(`To keep the data, add ${updateOperation(report)} to ${file}, ${betweenTheChecks(report, replacedCheck)}, ${run}, and re-run ${dbMigrateAgain(invocation)}`)];\n}\n/**\n* The way out of rows without a value for `db init`: a migration plan needs an origin contract,\n* which a database that `db init` never initialized does not have.\n*/\nfunction dbInitRowsWithoutValueAdvice(reports, invocation) {\n\tconst field = reports[0]?.field;\n\treturn [editFileAction(`Make ${field === void 0 ? \"it\" : `field \"${field}\"`} optional in the contract source, run ${quoted$1(cliCommand(invocation, \"db init\"))}, then make it required with ${quoted$1(cliCommand(invocation, \"db update\"))}, which says how to give the rows a value`)];\n}\nfunction failedMigrationText(failed, invocation) {\n\tconst dirName = basename(failed.directory);\n\treturn {\n\t\tdirectory: printedPath(invocation, failed.directory),\n\t\tname: dirName.slice(dirName.indexOf(\"_\") + 1),\n\t\tfrom: failed.from === EMPTY_CONTRACT_HASH ? void 0 : failed.from,\n\t\tnodeCommand: selfEmitCommand(invocation, join(failed.directory, \"migration.ts\")),\n\t\tinvocation\n\t};\n}\n/**\n* Planning the failed migration again with `flags`. `opening` is the words before the directory,\n* so the sentence can start the advice or follow why it is needed.\n*/\nfunction replan(opening, flags, failed, except = void 0, afterPlan = `fill in the migration.ts it writes, ${RUN_PLANNED_FILE}, and run ${dbMigrateAgain(failed.invocation)}`) {\n\tconst others = except === void 0 ? OTHER_STATEMENTS : `${OTHER_STATEMENTS} except any ${except}`;\n\tconst plan = printedPlanCommand(failed.invocation, failed.from, [\n\t\t\"--name\",\n\t\tfailed.name,\n\t\t...flags\n\t]);\n\treturn chooseAction(`${opening} \\`${failed.directory}\\` (copy any code you wrote in its migration.ts first), plan it again with ${quoted$1(plan)}, ${others}, ${afterPlan}`);\n}\n/**\n* Where to fix code written in the failed migration's `migration.ts`, and the command that runs the\n* file again.\n*/\nfunction failedMigrationFile(failedMigration) {\n\tif (failedMigration === void 0) return {\n\t\tfile: \"the migration.ts of the failed migration\",\n\t\trun: \"run that file with node\"\n\t};\n\treturn {\n\t\tfile: `\\`${failedMigration.directory}/migration.ts\\``,\n\t\trun: `run \\`${failedMigration.nodeCommand}\\``\n\t};\n}\nfunction migrateFailedTypeChangeAdvice(change, failedMigration, invocation) {\n\tconst changeText = failedTypeChangeText(change);\n\tconst { file, run } = failedMigrationFile(failedMigration);\n\tif (change.by === \"conversion\") return [editFileAction(`${changeText} Fix the conversion in ${file}, ${run}, and re-run ${dbMigrateAgain(invocation)}`)];\n\tconst convert = statementFlag({\n\t\tverb: \"convert\",\n\t\ttext: change.field\n\t});\n\tif (failedMigration === void 0) return [chooseAction(`${changeText} Plan the type change again with ${quoted$1(printedPlanCommand(invocation, void 0, [convert]))}, write the conversion in the migration.ts it writes, ${RUN_PLANNED_FILE}, and apply it with ${dbMigrateAgain(invocation)}`), ...changeValueAdvice(change, dbMigrateAgain(invocation))];\n\tconst deleted = `\\`${statementFlag({\n\t\tverb: \"delete\",\n\t\ttext: change.field\n\t})}\\``;\n\treturn [\n\t\teditFileAction(`${changeText} ${file} changes field \"${change.field}\" ${change.reason === \"noCast\" ? \"with a cast the database does not have between these types: replace it\" : \"with the database's cast, which met a value it cannot cast: replace that cast\"} with your own conversion of the values there, ${run}, and re-run ${dbMigrateAgain(invocation)}`),\n\t\t...changeValueAdvice(change, dbMigrateAgain(invocation)),\n\t\treplan(\"Delete\", [convert], failedMigration, deleted)\n\t];\n}\nfunction migrateRowsWithoutValueAdvice(reports, failedMigration, invocation) {\n\tconst [first] = reports;\n\tif (first?.reason === \"backfillMissedRows\") {\n\t\tconst { file, run } = failedMigrationFile(failedMigration);\n\t\treturn [editFileAction(`${first.field === void 0 ? \"The backfill step\" : `The backfill step of field \"${first.field}\"`} left those rows without a value. Make its run fill every row in ${file}, ${run}, and re-run ${dbMigrateAgain(invocation)}`)];\n\t}\n\tconst flags = backfillFlags(reports);\n\tconst again = (opening) => flags.length === 0 || failedMigration === void 0 ? void 0 : replan(opening, flags, failedMigration);\n\tconst one = reports.length === 1;\n\tif (reports.every(({ reason }) => reason === \"nullValues\")) {\n\t\tconst rerun = chooseAction(one ? `Set a value in ${theRows(first?.rows ?? 0)} and re-run ${dbMigrateAgain(invocation)}` : `Set a value in the rows that hold NULL in each of ${fieldList(reports)} and re-run ${dbMigrateAgain(invocation)}`);\n\t\tconst backfill = again(\"Delete\");\n\t\tconst fields = optionalFields(reports, one ? \"the field\" : \"those fields\");\n\t\tconst keep = fields === void 0 ? [] : [failedMigration === void 0 ? editFileAction(`Keep ${fields.text} optional in the contract source, and plan the migration again`) : keepOptional(fields.text, fields.one ? \"it\" : \"them\", failedMigration, invocation)];\n\t\treturn [\n\t\t\trerun,\n\t\t\t...backfill === void 0 ? [] : [backfill],\n\t\t\t...keep\n\t\t];\n\t}\n\tif (first?.reason === \"nullValues\") {\n\t\tconst notEnough = \"The migration also adds a required field the existing rows have no value for, so setting values is not enough.\";\n\t\tconst backfill = again(`${notEnough} Delete`);\n\t\tif (backfill !== void 0) return [backfill];\n\t\tconst newFields = optionalFields(reports.filter(({ reason }) => reason === \"newField\"), \"the new fields\");\n\t\treturn newFields === void 0 ? [resolveTheCause(invocation)] : [editFileAction(`${notEnough} Make ${newFields.text} optional in the contract source, and plan the migration again`)];\n\t}\n\tconst fields = theFields(reports);\n\tconst required = again(`To keep ${fields} required, delete`);\n\tconst optional = optionalFields(reports, fields);\n\tif (required === void 0) return [optional === void 0 ? resolveTheCause(invocation) : editFileAction(`Make ${optional.text} optional in the contract source, and plan the migration again`)];\n\treturn [required, ...optional === void 0 ? [] : [editFileAction(`Make ${optional.text} optional in the contract source, and plan it again`)]];\n}\nfunction resolveTheCause(invocation) {\n\treturn chooseAction(`Resolve the cause the failure names, then re-run ${dbMigrateAgain(invocation)}`);\n}\nfunction keepOptional(fields, pronoun, failedMigration, invocation) {\n\tconst plan = printedPlanCommand(invocation, failedMigration.from, [\"--name\", failedMigration.name]);\n\treturn editFileAction(`Keep ${fields} optional: make ${pronoun} optional in the contract source again, delete \\`${failedMigration.directory}\\` (copy any code you wrote in its migration.ts first), and plan it again with ${quoted$1(plan)}, ${OTHER_STATEMENTS}, put back any code you copied, ${RUN_PLANNED_FILE}, and apply it with ${dbMigrateCommand(invocation)}`);\n}\nfunction theRows(rows) {\n\treturn rows === 1 ? \"that row\" : `those ${rows} rows`;\n}\nfunction fieldList(reports) {\n\treturn reports.map(({ field }) => field === void 0 ? void 0 : `\"${field}\"`).filter((field) => field !== void 0).join(\", \");\n}\nfunction migrateSchemaCheckAdvice(failedMigration, invocation) {\n\tconst emit = quoted$1(cliCommand(invocation, \"contract emit\"));\n\tconst plan = printedPlanCommand(invocation, failedMigration?.from, failedMigration === void 0 ? [] : [\"--name\", failedMigration.name]);\n\tconst directory = failedMigration === void 0 ? \"the failed migration's directory\" : `\\`${failedMigration.directory}\\``;\n\tconst { file, run } = failedMigrationFile(failedMigration);\n\treturn [editFileAction(`If the contract source does not describe the schema you want, change it to resolve the issues listed, re-run ${emit}, delete ${directory} (copy any code you wrote in its migration.ts first), plan it again with ${quoted$1(plan)}, put any code you copied into the migration.ts it writes, ${RUN_PLANNED_FILE}, and run ${dbMigrateCommand(invocation)}`), editFileAction(`If ${file} does not reach its destination contract, for example after a hand edit, change its operations to resolve the issues listed, ${run}, and run ${dbMigrateAgain(invocation)}`)];\n}\n/** The way out when objects in the database keep an operation from running. */\nfunction blockingObjectsAdvice(objects, rerun) {\n\tconst named = objects.map(({ kind, name }) => `${kind} ${name}`);\n\treturn [chooseAction(`Drop or change ${named.length === 1 ? named[0] : `${named.slice(0, -1).join(\", \")} and ${named.at(-1)}`} in the database yourself, then re-run \\`${rerun}\\``)];\n}\n/**\n* The way out of a failed `db migrate` apply: every path and command it prints works from where the\n* CLI ran, with the `--config` it was given.\n*/\nfunction migrateAdvice(failure, facts, failedOnDisk, invocation) {\n\tconst failedMigration = failedOnDisk === void 0 ? void 0 : failedMigrationText(failedOnDisk, invocation);\n\tconst { blockingObjects } = failure.meta;\n\tif (blockingObjects !== void 0) return blockingObjectsAdvice(blockingObjects, dbMigrateRerun(invocation));\n\tif (facts.failedTypeChange !== void 0) return migrateFailedTypeChangeAdvice(facts.failedTypeChange, failedMigration, invocation);\n\tif (facts.rowsWithoutValue !== void 0) return migrateRowsWithoutValueAdvice(facts.rowsWithoutValue, failedMigration, invocation);\n\tif (facts.rowsHoldingValue !== void 0) return migrateRowsHoldingValueAdvice(facts.rowsHoldingValue, failedMigration, invocation);\n\tif (facts.rowsFailingCheck !== void 0) return migrateRowsFailingCheckAdvice(facts.rowsFailingCheck, failedMigration, invocation);\n\tif (schemaCheckIssues(failure) !== void 0) return migrateSchemaCheckAdvice(failedMigration, invocation);\n\tif (facts.failedPrecheck !== void 0) return migrateFailedPrecheckAdvice(facts.failedPrecheck, invocation);\n\treturn [resolveTheCause(invocation)];\n}\n//#endregion\n//#region src/utils/runner-advice.ts\n/** The ways out as prose: each label as a sentence, every one after the first after \"Or:\". */\nfunction adviceText(advice) {\n\treturn advice.map(({ label }, index) => index === 0 ? `${label}.` : `Or: ${label}.`).join(\" \");\n}\n//#endregion\n//#region src/utils/runner-failure-error.ts\n/** The runner's why, naming the contract space the apply stopped in when it is not the application's own. */\nfunction whyNamingSpace(failure) {\n\tconst { failingSpace } = failure.meta;\n\tif (failingSpace === void 0 || failingSpace === APP_SPACE_ID) return failure.why;\n\tconst stopped = `The apply stopped in contract space \"${failingSpace}\".`;\n\treturn failure.why === void 0 ? stopped : `${failure.why} ${stopped}`;\n}\n/**\n* A runner failure as the CLI reports it: the runner's code, message, why and meta, and the failure\n* itself as `cause`, with the CLI's advice: each way out as a next action, and all of them as `fix`\n* prose. When the apply stopped in a space other than the application's, the why names it.\n*/\nfunction runnerFailureError(failure, advice) {\n\treturn new ActionableCliError(failure.code, failure.message, {\n\t\t...ifDefined(\"why\", whyNamingSpace(failure)),\n\t\tfix: adviceText(advice),\n\t\tnextActions: advice,\n\t\tmeta: failure.meta,\n\t\tdocsUrl: docsUrlFor(failure.code),\n\t\tcause: failure\n\t});\n}\n//#endregion\n//#region src/utils/db-init-failure.ts\nconst DB_INIT_ADDITIVE_ONLY_FIX = \"`db init` applies only additive changes. Run `{bin} db update`, which also applies widening and destructive ones once you answer what each operation that would lose data means, with `--delete` or `--rename`.\";\nconst DB_INIT_NEEDS_MIGRATION_FIX = \"`db init` applies only additive changes, and `db update` does not apply data operations. Plan a migration with `{bin} migration plan`, which can include them, and apply it with `{bin} db migrate`.\";\n/**\n* What to do instead of `db init` when its additive-only policy refused operations of the given classes: `db update` when its policy allows all of them, otherwise a planned migration.\n*/\nfunction adviceForRefusedClasses(refused) {\n\tconst allowedByDbUpdate = new Set(DB_UPDATE_POLICY.allowedOperationClasses);\n\tif (![...refused].every((operationClass) => allowedByDbUpdate.has(operationClass))) return {\n\t\tfix: DB_INIT_NEEDS_MIGRATION_FIX,\n\t\tnextAction: runCommandAction(\"Plan a migration, since db update does not apply data operations\", \"{bin} migration plan\")\n\t};\n\treturn {\n\t\tfix: DB_INIT_ADDITIVE_ONLY_FIX,\n\t\tnextAction: runCommandAction(refused.has(\"destructive\") ? \"Apply the change with db update, which asks what each operation that would lose data means\" : \"Apply the change with db update\", \"{bin} db update\")\n\t};\n}\n/**\n* `db init`'s planning failure: when its additive-only policy refused operations, it says to use\n* `db update` or a planned migration instead.\n*/\nfunction dbInitPlanningFailedError(conflicts) {\n\tconst planningFailed = errorMigrationPlanningFailed({ conflicts });\n\tconst refused = new Set(conflicts.flatMap((conflict) => conflict.refusedOperationClass === void 0 ? [] : [conflict.refusedOperationClass]));\n\tif (refused.size === 0) return planningFailed;\n\tconst { fix, nextAction } = adviceForRefusedClasses(refused);\n\treturn new ActionableCliError(planningFailed.code, planningFailed.message, {\n\t\twhy: planningFailed.why,\n\t\tfix,\n\t\tnextActions: [nextAction],\n\t\t...ifDefined(\"meta\", planningFailed.meta),\n\t\t...ifDefined(\"docsUrl\", planningFailed.docsUrl)\n\t});\n}\n/** A failed `db init` apply as the CLI reports it. */\nfunction dbInitRunnerFailureError(failure, facts, invocation) {\n\tconst init = cliCommand(invocation, \"db init\");\n\treturn runnerFailureError(failure, facts.rowsWithoutValue !== void 0 ? dbInitRowsWithoutValueAdvice(facts.rowsWithoutValue, invocation) : schemaCheckIssues(failure) !== void 0 ? [editFileAction(`Change the contract source to resolve the issues listed, re-run \\`${cliCommand(invocation, \"contract emit\")}\\`, then re-run \\`${init}\\``)] : facts.failedPrecheck !== void 0 ? dbInitFailedPrecheckAdvice(invocation) : [chooseAction(`Fix the schema mismatch (db init is additive-only), or bring the database to the contract with \\`${cliCommand(invocation, \"db update\")}\\`, which moves the database without a reset and asks before losing data`)]);\n}\n//#endregion\n//#region src/utils/db-update-failure.ts\n/**\n* A failed `db update` apply as the CLI reports it. `databaseStorageHash` is the contract the\n* database is at when a migration of the graph ends at it: the origin a `migration plan` for this\n* database starts from.\n*/\nfunction dbUpdateRunnerFailureError(failure, facts, context) {\n\tconst { databaseStorageHash, invocation } = context;\n\tconst update = dbUpdateRerun(invocation);\n\tconst { blockingObjects } = failure.meta;\n\treturn runnerFailureError(failure, blockingObjects !== void 0 ? blockingObjectsAdvice(blockingObjects, update) : facts.failedTypeChange !== void 0 ? dbUpdateFailedTypeChangeAdvice(facts.failedTypeChange, databaseStorageHash, invocation) : facts.rowsWithoutValue !== void 0 ? dbUpdateRowsWithoutValueAdvice(facts.rowsWithoutValue, databaseStorageHash, invocation) : facts.rowsHoldingValue !== void 0 ? dbUpdateRowsHoldingValueAdvice(facts.rowsHoldingValue, databaseStorageHash, invocation) : facts.rowsFailingCheck !== void 0 ? dbUpdateRowsFailingCheckAdvice(facts.rowsFailingCheck, databaseStorageHash, invocation) : schemaCheckIssues(failure) !== void 0 ? [editFileAction(`Change the contract source to resolve the issues listed, re-run \\`${cliCommand(invocation, \"contract emit\")}\\`, then re-run \\`${update}\\``)] : [chooseAction(`Resolve the cause the failure names, then re-run \\`${update}\\``)]);\n}\n//#endregion\n//#region src/utils/extension-path-failure.ts\nfunction startText(fromHash) {\n\treturn fromHash === EMPTY_CONTRACT_HASH ? \"the empty contract (the space has no marker)\" : `the contract its marker names (\"${fromHash}\")`;\n}\nconst INSTALL_MATCHING = \"Install a version of the extension whose migrations start from the contract the database is at\";\n/** The way out for an extension space: only another version of the extension changes its migrations. */\nfunction extensionAdvice$1(space) {\n\tconst rerun = cliCommand(space.invocation, space.command);\n\tconst list = cliCommand(space.invocation, \"migration list\", [\"--space\", space.spaceId]);\n\treturn {\n\t\tfix: `The migrations of extension space \"${space.spaceId}\" come with the extension. ${INSTALL_MATCHING}, then run \\`${rerun}\\` again. List the space's migrations with \\`${list}\\`.`,\n\t\tnextActions: [\n\t\t\tchooseAction(INSTALL_MATCHING),\n\t\t\trunCommandAction(`List the migrations of extension space \"${space.spaceId}\"`, list),\n\t\t\trunCommandAction(`Run ${space.command} again`, rerun)\n\t\t]\n\t};\n}\n/** `MIGRATION.PATH_UNREACHABLE` for an extension space whose migrations do not lead from where the database is to the extension's head. */\nfunction errorExtensionPathUnreachable(space) {\n\treturn errorPathUnreachable({\n\t\tsummary: `Cannot resolve apply path for extension space \"${space.spaceId}\"`,\n\t\twhy: `No path in the on-disk migration graph for extension space \"${space.spaceId}\" leads from ${startText(space.fromHash)} to the on-disk head ref hash \"${space.targetHash}\".`,\n\t\tmeta: {\n\t\t\tkind: \"pathUnreachable\",\n\t\t\tspaceId: space.spaceId,\n\t\t\tfromHash: space.fromHash,\n\t\t\ttargetHash: space.targetHash\n\t\t}\n\t}, extensionAdvice$1(space));\n}\n/**\n* `MIGRATION.NO_INVARIANT_PATH` for an extension space whose migrations reach the extension's head\n* from where the database is, but not through the ones that provide the invariants its head requires.\n*/\nfunction errorExtensionNoInvariantPath(space) {\n\tconst missing = space.missing.map((id) => JSON.stringify(id)).join(\", \");\n\treturn errorNoInvariantPath({\n\t\trequired: space.required,\n\t\tmissing: space.missing,\n\t\tstructuralPath: space.structuralPath,\n\t\textensionSpace: {\n\t\t\tspaceId: space.spaceId,\n\t\t\twhy: `The head of extension space \"${space.spaceId}\" requires invariants that no path of its migrations from ${startText(space.fromHash)} provides: ${missing}.`,\n\t\t\t...extensionAdvice$1(space)\n\t\t}\n\t});\n}\n//#endregion\n//#region src/utils/keep-data-edit-advice.ts\nfunction editsText(edits) {\n\treturn edits.map(({ remove, replaceWith }) => `replace ${remove} with ${replaceWith}`).join(\", and \");\n}\nfunction quoted(command) {\n\treturn `\\`${command}\\``;\n}\n/** How `migration plan` says to keep the data of a subject: answer with a delete, then make the edits in the file it writes. */\nfunction migrationPlanKeepDataEditAdvice(invocation) {\n\treturn ({ text, edits }) => ({\n\t\tlead: void 0,\n\t\tways: edits.length === 0 ? [] : [`To keep that data, answer with ${statementFlag({\n\t\t\tverb: \"delete\",\n\t\t\ttext\n\t\t})}, then in the migration.ts this command writes ${editsText(edits)}, ${runWrittenFile(invocation)}.`]\n\t});\n}\n/** The run's statements, without the deletes that answer `subjects`. */\nfunction otherStatements(invocation, subjects) {\n\tconst answers = subjects.map((text) => statementFlag({\n\t\tverb: \"delete\",\n\t\ttext\n\t}));\n\treturn (invocation.statementArgs ?? []).filter((flag) => !answers.includes(flag));\n}\nfunction listed$1(words) {\n\treturn words.length < 2 ? words.join(\"\") : `${words.slice(0, -1).join(\", \")} and ${words[words.length - 1]}`;\n}\n/** The members of `kept` in the enum of `subject`, compared by namespace and enum, in the order given. */\nfunction sameEnum(subject, kept) {\n\treturn kept.flatMap(({ subject: each, text }) => each.kind === \"enumValue\" && each.namespaceId === subject.namespaceId && each.enum === subject.enum ? [{\n\t\tmember: each.member,\n\t\ttext\n\t}] : []);\n}\n/**\n* Two runs of `db update` that keep the data when members keep their names and only their stored values change, which no rename statement can name. The first run renames each member to a temporary member with a stored value the enum does not use, so its rename rewrites the stored values, and the second renames it back with its final stored value the same way. Passing through unused values means no rewrite writes a value another rewrite replaces, so members that swap values are kept too. `undefined` for a subject that is no enum value.\n*/\nfunction twoRuns(invocation, subject, kept) {\n\tif (subject.subject.kind !== \"enumValue\") return void 0;\n\tconst enumName = subject.text.slice(0, -(subject.subject.member.length + 1));\n\tconst same = sameEnum(subject.subject, kept);\n\tconst members = same.map(({ member }) => member);\n\tconst subjects = same.map(({ text }) => text);\n\tconst one = members.length === 1;\n\tconst temporary = (member) => `${enumName}.<temporary member${one ? \"\" : ` for ${member}`}>`;\n\tconst emit = quoted(cliCommand(invocation, \"contract emit\"));\n\tconst first = cliCommand(invocation, \"db update\", [...otherStatements(invocation, subjects), ...members.map((member) => statementFlag({\n\t\tverb: \"rename\",\n\t\ttext: `${enumName}.${member}:${temporary(member)}`\n\t}))]);\n\tconst second = cliCommand(invocation, \"db update\", members.map((member) => statementFlag({\n\t\tverb: \"rename\",\n\t\ttext: `${temporary(member)}:${enumName}.${member}`\n\t})));\n\tconst names = listed$1(members);\n\treturn one ? `To keep it with db update, change it in two runs. First rename member ${names} of enum ${enumName} in the contract source to a name the enum does not have and give it a stored value the enum does not use, run ${emit}, and run ${quoted(first)}. Then rename that member back to ${names} with its final stored value, run ${emit}, and run ${quoted(second)}.` : `To keep it with db update, change them in two runs. First rename members ${names} of enum ${enumName} in the contract source to names the enum does not have and give each a stored value the enum does not use, run ${emit}, and run ${quoted(first)}. Then rename those members back to ${names} with their final stored values, run ${emit}, and run ${quoted(second)}.`;\n}\n/**\n* How `db update` says to keep the data of a subject: it cannot in one run. It plans the change with `migration plan` from the contract the database is at, when a migration ends there and the target gives edits, answering with `--delete` each kept subject whose edits it gives, or changes the stored values in two runs through temporary members; members whose edits swap values do that only when no migration ends there.\n*/\nfunction dbUpdateKeepDataEditAdvice(invocation, databaseStorageHash) {\n\treturn (subject, kept) => {\n\t\tconst deleteFlag = statementFlag({\n\t\t\tverb: \"delete\",\n\t\t\ttext: subject.text\n\t\t});\n\t\tconst swaps = subject.edits.some(({ swapsValues }) => swapsValues === true);\n\t\tconst lead = swaps ? `db update cannot keep that data in one run, because members of the enum swap stored values, and ${deleteFlag} removes it.` : `db update cannot keep that data in one run, and ${deleteFlag} removes it.`;\n\t\tconst runs = twoRuns(invocation, subject, kept);\n\t\tconst runWays = runs === void 0 ? [] : [runs];\n\t\tif (databaseStorageHash === void 0 || subject.edits.length === 0) return {\n\t\t\tlead,\n\t\t\tways: runWays\n\t\t};\n\t\tconst edited = kept.filter(({ edits }) => edits.length > 0);\n\t\tconst deletes = edited.map(({ text }) => statementFlag({\n\t\t\tverb: \"delete\",\n\t\t\ttext\n\t\t}));\n\t\treturn {\n\t\t\tlead,\n\t\t\tways: [`To keep it, plan the change with ${quoted(printedPlanCommand(invocation, databaseStorageHash, [...otherStatements(invocation, [subject.text]).filter((flag) => !deletes.includes(flag)), ...deletes]))}, in the migration.ts it writes ${editsText(edited.flatMap(({ edits }) => edits))}, ${runWrittenFile(invocation)}.`, ...swaps ? [] : runWays]\n\t\t};\n\t};\n}\n//#endregion\n//#region src/utils/planning-refused-error.ts\n/**\n* The planner's refusal as the CLI reports it. When a conflict can be written by hand, its next\n* actions are the conflicts' own advice, which says what to write, then the plan to write it in:\n* the run's statements without the ones the conflict leaves out, from the contract the database is\n* at when that is known.\n*/\nfunction planningRefusedError(conflicts, context) {\n\tconst refused = errorMigrationPlanningFailed({ conflicts });\n\tconst leaveOut = new Set(conflicts.flatMap(({ leaveOut: statements }) => (statements ?? []).map((statement) => JSON.stringify(statement))));\n\tif (leaveOut.size === 0) return refused;\n\tconst left = context.statements.filter(({ verb }) => verb !== \"delete\" && verb !== \"allow\").filter((_, index) => {\n\t\tconst resolved = context.resolved[index];\n\t\treturn resolved !== void 0 && leaveOut.has(JSON.stringify(resolved));\n\t});\n\tconst kept = context.statements.filter((statement) => !left.includes(statement));\n\tconst plan = printedPlanCommand(context.invocation, context.from, [...context.to === void 0 ? [] : [\"--to\", context.to], ...kept.map(statementFlag)]);\n\tconst action = chooseAction(`To write the rewrites by hand, plan the change without ${left.map(statementFlag).join(\" and \")} with \\`${plan}\\`, add the rewrites the message describes to the migration.ts it writes, ${runWrittenFile(context.invocation)}`);\n\tconst reasons = conflicts.flatMap(({ why }) => why === void 0 ? [] : [why]);\n\treturn new ActionableCliError(refused.code, refused.message, {\n\t\twhy: refused.why,\n\t\tfix: refused.fix ?? action.label,\n\t\tnextActions: [...reasons.length === 0 ? [] : [chooseAction(reasons.join(\"\\n\"))], action],\n\t\t...ifDefined(\"meta\", refused.meta),\n\t\t...ifDefined(\"docsUrl\", refused.docsUrl)\n\t});\n}\n//#endregion\n//#region src/utils/policy-errors.ts\n/** `change: migrate; dataProtection.dataLoss: data-loss-forbidden`: the declared side of each difference. */\nfunction declaredSettingsText(differences) {\n\treturn differences.map(({ setting, declared }) => `${setting}: ${databasePolicyValueText(declared)}`).join(\"; \");\n}\n/** `MIGRATION.POLICY_MISMATCH`: the ref declares policies that differ from those the database's marker records. */\nfunction errorPolicyMismatch(args) {\n\tconst { spaceId, refName, differences } = args;\n\tconst why = differences.map(({ setting, declared, inForce }) => `${refName} declares ${setting}: ${databasePolicyValueText(declared)}; the database has ${setting}: ${databasePolicyValueText(inForce)}.`).join(\" \");\n\tconst recovery = \"Make the ref match the database, or have whoever owns the database apply the ref's policies.\";\n\treturn new ActionableCliError(\"MIGRATION.POLICY_MISMATCH\", \"The ref's policies differ from the database's\", {\n\t\twhy,\n\t\tfix: recovery,\n\t\tnextActions: [chooseAction(recovery)],\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\trefName,\n\t\t\tdifferences\n\t\t}\n\t});\n}\n/** `MIGRATION.CHANGE_POLICY_FORBIDS`: the change policy does not permit the command's way of changing the database. */\nfunction errorChangePolicyForbids(args) {\n\tconst { spaceId, command, change, invocation, source } = args;\n\tconst holder = source.kind === \"ref\" ? `${source.refName} declares` : \"The marker records\";\n\tconst policyHolder = source.kind === \"ref\" ? `${source.refName} declares a change policy that` : \"This database's change policy\";\n\tconst refusal = command === \"db sign\" ? \"may not sign it\" : \"may not move it\";\n\tconst why = `${holder} change: ${change.join(\", \")}, so ${command} ${refusal}.`;\n\tconst meta = {\n\t\tspaceId,\n\t\tcommand,\n\t\tchange\n\t};\n\tconst ref = source.kind === \"ref\" ? {\n\t\tname: source.refName,\n\t\tpermitPolicyChange: true\n\t} : args.ref;\n\tconst toRef = ref === void 0 ? [] : [\n\t\t\"--to\",\n\t\tshellQuoted(ref.name),\n\t\t...ref.permitPolicyChange ? [\"--permit-policy-change\"] : []\n\t];\n\tif (command === \"db migrate\") {\n\t\tconst reconcile = cliCommand(invocation, \"db update\", ref === void 0 ? [\"--to\", args.targetHash] : toRef);\n\t\treturn new ActionableCliError(\"MIGRATION.CHANGE_POLICY_FORBIDS\", `${policyHolder} permits only db update`, {\n\t\t\twhy,\n\t\t\tfix: `Reconcile the database: ${reconcile}`,\n\t\t\tnextActions: [runCommandAction(\"Reconcile the database\", reconcile)],\n\t\t\tmeta\n\t\t});\n\t}\n\tconst migrate = cliCommand(invocation, \"db migrate\", toRef);\n\tconst recovery = `Author a migration with ${cliCommand(invocation, \"migration plan\")}, then apply it with ${migrate}.`;\n\treturn new ActionableCliError(\"MIGRATION.CHANGE_POLICY_FORBIDS\", `${policyHolder} permits only migrations`, {\n\t\twhy,\n\t\tfix: recovery,\n\t\tnextActions: [chooseAction(recovery)],\n\t\tmeta\n\t});\n}\n/**\n* `CLI.INVALID_ARGUMENTS`: consent to write policies was given without a ref whose policies it could\n* write. `command` names the CLI command that was run, whose flags the error names; without it, the\n* error names the control API option `refOption` (`target` for `migrate`, `ref` for `dbUpdate`).\n*/\nfunction errorPermitPolicyChangeNeedsRef(args) {\n\tconst { to } = args;\n\tconst why = to === void 0 ? \"No ref was given, so there are no policies to write.\" : `${to} is not a ref, so it declares no policies to write.`;\n\tconst toMeta = to === void 0 ? {} : { to };\n\tif (\"command\" in args) {\n\t\tconst recovery = \"Name the ref whose policies to write with --to <ref>, or leave out --permit-policy-change.\";\n\t\treturn new ActionableCliError(\"CLI.INVALID_ARGUMENTS\", \"--permit-policy-change needs --to <ref>\", {\n\t\t\twhy,\n\t\t\tfix: recovery,\n\t\t\tnextActions: [chooseAction(recovery)],\n\t\t\tmeta: {\n\t\t\t\tcommand: args.command,\n\t\t\t\t...toMeta\n\t\t\t}\n\t\t});\n\t}\n\tconst [summary, recovery] = args.refOption === \"target\" ? [\"permitPolicyChange needs a target of kind ref\", \"Pass a target of kind ref whose policies to write, or leave out permitPolicyChange.\"] : [\"permitPolicyChange needs a ref\", \"Pass the ref whose policies to write, or leave out permitPolicyChange.\"];\n\treturn new ActionableCliError(\"CLI.INVALID_ARGUMENTS\", summary, {\n\t\twhy,\n\t\tfix: recovery,\n\t\tnextActions: [chooseAction(recovery)],\n\t\tmeta: toMeta\n\t});\n}\n/** `MIGRATION.MARKER_CAS_FAILURE` for `db sign`: the database's policies changed after it checked them, so it did not sign the application space. */\nfunction errorDatabasePoliciesMovedDuringSign(args) {\n\tconst rerun = cliCommand(args.invocation, \"db sign\", args.invocation.rerunArgs ?? []);\n\treturn new ActionableCliError(\"MIGRATION.MARKER_CAS_FAILURE\", \"The database's policies changed while db sign ran\", {\n\t\twhy: `${movedDatabasePoliciesWhy(\"db sign\", args.checked, args.found)} db sign did not sign the application space.`,\n\t\tfix: `Sign again, which checks the policies anew: ${rerun}`,\n\t\tnextActions: [runCommandAction(\"Sign again\", rerun)],\n\t\tmeta: {\n\t\t\treason: \"databasePolicies\",\n\t\t\tspace: args.spaceId,\n\t\t\tcheckedDatabasePolicies: args.checked,\n\t\t\tfoundDatabasePolicies: args.found\n\t\t}\n\t});\n}\n//#endregion\n//#region src/control-api/statements/parse-consent.ts\nfunction formsFix$1(verb) {\n\treturn verb === \"delete\" ? \"Write the statement as --delete <name>, where the name is Model, namespace.Model, Model.field or namespace.Model.field, or the storage name the refusal gave, for example --delete Legacy or --delete User.nickname.\" : \"Write the statement as --allow <name>, where the name is the model the refusal gave, for example --allow User.\";\n}\n/**\n* Checks the text of one delete or allow statement. The text stays unresolved: it names what a\n* plan would do to a subject, so it is matched by equality against the plan's subjects, not\n* resolved against the contracts. Any name a subject can have is accepted, since a storage name\n* may contain any character a quoted identifier can.\n*/\nfunction parseConsentStatement(statement) {\n\tif (statement.text.trim() === \"\") return notOk(errorStatementInvalid(statement, \"The statement names nothing.\", formsFix$1(statement.verb)));\n\treturn ok({\n\t\tverb: statement.verb,\n\t\ttext: statement.text\n\t});\n}\n//#endregion\n//#region src/control-api/statements/parse-field-statement.ts\nfunction formsFix(verb) {\n\treturn verb === \"convert\" ? \"Write the statement as --convert <field>, where the field is Model.field or namespace.Model.field as the destination contract names it, for example --convert User.age, or as --convert <variant>, Variant or namespace.Variant, for a variant whose discriminator value changed.\" : `Write the statement as --${verb} <field>, where the field is Model.field or namespace.Model.field as the destination contract names it, for example --${verb} User.age.`;\n}\n/** Parses the text of one convert or backfill statement, `Model.field` or `namespace.Model.field`, or a convert's `Variant`. */\nfunction parseFieldStatement(statement) {\n\tconst invalid = (why) => notOk(errorStatementInvalid(statement, why, formsFix(statement.verb)));\n\tif (statement.text.includes(\":\")) return invalid(\"The statement names one field, not an old and a new name.\");\n\tconst segments = statement.text.split(\".\");\n\tif (segments.some((segment) => segment === \"\")) return invalid(`\"${statement.text}\" has an empty name.`);\n\tconst [first, second, third] = segments;\n\tif (first === void 0) return invalid(`\"${statement.text}\" has an empty name.`);\n\tif (second === void 0 && statement.verb !== \"convert\") return invalid(`\"${statement.text}\" names a model; a --${statement.verb} statement names a field.`);\n\tif (segments.length > 3) return invalid(`\"${statement.text}\" has ${segments.length} names; at most three are allowed.`);\n\tconst field = second === void 0 ? [first] : third === void 0 ? [first, second] : [\n\t\tfirst,\n\t\tsecond,\n\t\tthird\n\t];\n\treturn ok({\n\t\tverb: statement.verb,\n\t\ttext: statement.text,\n\t\tfield\n\t});\n}\n//#endregion\n//#region src/control-api/statements/parse-rename.ts\nconst MAX_SEGMENTS = 3;\n/** The forms a statement takes, with an example of each. */\nfunction statementFormsFix(verb) {\n\treturn `Write the statement as --${verb} <old>:<new>, where each side is Model, namespace.Model, Model.field or namespace.Model.field, for example --${verb} Profile:User for a model or --${verb} User.name:User.fullName for a field.`;\n}\n/**\n* The two statements a user who named a model on one side and a field on the other may have\n* meant, written with their names.\n*/\nfunction mixedSidesFix(verb, from, to) {\n\tconst modelIsOld = from.length < to.length;\n\tconst field = modelIsOld ? to : from;\n\tconst model = (modelIsOld ? from : to).join(\".\");\n\tconst fieldModel = field.slice(0, -1).join(\".\");\n\tconst fieldName = field[field.length - 1];\n\tconst [modelStatement, fieldStatement] = modelIsOld ? [`${model}:${fieldModel}`, `${fieldModel}.<old field>:${field.join(\".\")}`] : [`${fieldModel}:${model}`, `${model}.${fieldName}:${model}.<new field>`];\n\treturn `To rename the model, write --${verb} ${modelStatement}. To rename a field, write --${verb} ${fieldStatement}, naming the field's model as the new contract names it.`;\n}\nfunction invalid(statement, why) {\n\treturn errorStatementInvalid(statement, why, statementFormsFix(statement.verb));\n}\nfunction parseSide(statement, side) {\n\tconst segments = side.split(\".\");\n\tif (segments.some((segment) => segment === \"\")) return notOk(invalid(statement, `\"${side}\" has an empty name.`));\n\tconst [first, second, third] = segments;\n\tif (first === void 0 || segments.length > MAX_SEGMENTS) return notOk(invalid(statement, `\"${side}\" has ${segments.length} names; at most three are allowed.`));\n\tif (second === void 0) return ok([first]);\n\tif (third === void 0) return ok([first, second]);\n\treturn ok([\n\t\tfirst,\n\t\tsecond,\n\t\tthird\n\t]);\n}\nfunction namesModelAndField(from, to) {\n\tconst lengths = [from.length, to.length];\n\treturn lengths.includes(1) && lengths.includes(MAX_SEGMENTS);\n}\n/** Parses the text of one rename statement, `<old>:<new>`. */\nfunction parseRenameStatement(statement) {\n\tconst sides = statement.text.split(\":\");\n\tconst [oldSide, newSide] = sides;\n\tif (oldSide === void 0 || newSide === void 0) return notOk(invalid(statement, \"The statement has no \\\":\\\" between the old and new name.\"));\n\tif (sides.length > 2) return notOk(invalid(statement, \"The statement has more than one \\\":\\\".\"));\n\tconst from = parseSide(statement, oldSide);\n\tif (!from.ok) return from;\n\tconst to = parseSide(statement, newSide);\n\tif (!to.ok) return to;\n\tif (namesModelAndField(from.value, to.value)) return notOk(errorStatementInvalid(statement, \"The statement names a model on one side and a field on the other.\", mixedSidesFix(statement.verb, from.value, to.value)));\n\treturn ok({\n\t\tverb: \"rename\",\n\t\ttext: statement.text,\n\t\tfrom: from.value,\n\t\tto: to.value\n\t});\n}\n//#endregion\n//#region src/control-api/statements/statement-text.ts\nconst STATEMENT_VERBS = [\n\t\"rename\",\n\t\"delete\",\n\t\"allow\",\n\t\"convert\",\n\t\"backfill\"\n];\nfunction isStatementVerb(verb) {\n\treturn STATEMENT_VERBS.includes(verb);\n}\nfunction isPlannedStatement(statement) {\n\treturn statement.verb === \"rename\" || statement.verb === \"convert\" || statement.verb === \"backfill\";\n}\n/** The field a `convert` and a `delete` of the same run both name, which conflict; `undefined` when none does. */\nfunction convertAndDelete(statements) {\n\tconst deleted = new Set(statements.filter(({ verb }) => verb === \"delete\").map(({ text }) => text));\n\treturn statements.find(({ verb, text }) => verb === \"convert\" && deleted.has(text))?.text;\n}\n/** Each kind of thing a statement or a question can name, as messages write it. */\nconst ENTITY_WORDS = {\n\tmodel: \"model\",\n\tfield: \"field\",\n\tenumValue: \"enum value\",\n\tvalueObjectField: \"value object field\",\n\tstorage: \"storage\"\n};\n//#endregion\n//#region src/control-api/statements/variants.ts\nfunction modelOf(contract, coordinate) {\n\tconst namespaces = contract.domain.namespaces;\n\tconst namespace = Object.hasOwn(namespaces, coordinate.namespaceId) ? namespaces[coordinate.namespaceId] : void 0;\n\treturn namespace !== void 0 && Object.hasOwn(namespace.models, coordinate.model) ? namespace.models[coordinate.model] : void 0;\n}\n/** Whether a field is the discriminator of its model in the contract. */\nfunction isDiscriminatorField(contract, coordinate) {\n\treturn modelOf(contract, coordinate)?.discriminator?.field === coordinate.field;\n}\n/** The discriminator value a variant has in its base model, or `undefined` when the model is no variant of the contract. */\nfunction variantValue(contract, coordinate) {\n\tconst base = modelOf(contract, coordinate)?.base;\n\tif (base === void 0) return void 0;\n\tconst variants = modelOf(contract, {\n\t\tnamespaceId: base.namespace,\n\t\tmodel: base.model\n\t})?.variants;\n\treturn Object.entries(variants ?? {}).find(([, variant]) => variant.namespace === coordinate.namespaceId && variant.model === coordinate.model)?.[0];\n}\n/** Whether a model is a variant in both contracts whose discriminator value changed between them. */\nfunction variantValueChanged(origin, originModel, destination, destinationModel) {\n\tconst from = variantValue(origin, originModel);\n\tconst to = variantValue(destination, destinationModel);\n\treturn from !== void 0 && to !== void 0 && from !== to;\n}\n/**\n* The variants a base model has in the destination and not in the origin, other than `renamedTo`:\n* the models a removed variant of that base can have been renamed to.\n*/\nfunction newVariantsOfBase(origin, destination, variant, renamedTo) {\n\tconst base = modelOf(origin, variant)?.base;\n\tif (base === void 0) return [];\n\tconst baseCoordinate = {\n\t\tnamespaceId: base.namespace,\n\t\tmodel: base.model\n\t};\n\tconst models = (contract) => Object.values(modelOf(contract, baseCoordinate)?.variants ?? {}).map((each) => ({\n\t\tnamespaceId: each.namespace,\n\t\tmodel: each.model\n\t}));\n\tconst before = models(origin);\n\tconst same = (left) => (right) => left.namespaceId === right.namespaceId && left.model === right.model;\n\treturn models(destination).filter((each) => !before.some(same(each)) && !renamedTo.some(same(each))).map((each) => ({\n\t\t...each,\n\t\tnamespaceId: asNamespaceId(each.namespaceId)\n\t}));\n}\n//#endregion\n//#region src/control-api/statements/resolve-statements.ts\nconst NAMESPACE_RENAMES = \"namespace\";\nconst ENUM_VALUE_RENAMES = \"enumValue\";\nconst VALUE_OBJECT_FIELD_RENAMES = \"valueObjectField\";\nconst MODEL_RENAMES = \"model\";\nconst FIELD_RENAMES = \"field\";\nconst LISTED_LIMIT = 20;\nconst CHECK_NAMES_FIX = \"The old name must exist in the origin contract and not in the destination contract, and the new name the other way round. Names match exactly, including case.\";\nconst STORED_NAME_ONLY = \"If only the stored name changed (@map or @@map), a statement cannot state that in this release, and a plan without it drops and creates what the model or field is stored in, with its data. With migration plan, edit the planned migration.ts to rename the stored name instead of dropping and creating it. With db update, rename it in the database yourself first, then run db update.\";\nconst REPEATED_NAME_FIX = \"Give each model, field or enum value at most one statement, and each new name to one model, field or enum value only.\";\nfunction qualifiedModel(coordinate) {\n\treturn modelDisplayName(coordinate);\n}\nfunction displayName(namespaceId, name) {\n\treturn modelDisplayName({\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel: name\n\t});\n}\nfunction qualifiedField(coordinate) {\n\treturn `${qualifiedModel(coordinate)}.${coordinate.field}`;\n}\n/** An enum as a contract names it in messages: with its namespace only when the contract has several. */\nfunction enumText(contract, namespaceId, name) {\n\treturn modelStatementText(contract.contract, {\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel: name\n\t});\n}\nfunction qualifiedEnumValue(coordinate) {\n\treturn `${displayName(coordinate.namespaceId, coordinate.enum)}.${coordinate.member}`;\n}\nfunction qualifiedValueObjectField(coordinate) {\n\treturn `${displayName(coordinate.namespaceId, coordinate.valueObject)}.${coordinate.field}`;\n}\nfunction listed(names) {\n\tif (names.length === 0) return \"(none)\";\n\tconst sorted = [...names].sort();\n\tconst shown = sorted.slice(0, LISTED_LIMIT).join(\", \");\n\treturn sorted.length > LISTED_LIMIT ? `${shown} and ${sorted.length - LISTED_LIMIT} more` : shown;\n}\nfunction sentence(reason) {\n\treturn `${reason.charAt(0).toUpperCase()}${reason.slice(1)}.`;\n}\nfunction unresolved(statement, refusal) {\n\treturn errorStatementUnresolved(statement, sentence(refusal.reason), refusal.fix);\n}\nfunction modelIn(namespace, name) {\n\treturn Object.hasOwn(namespace.models, name) ? namespace.models[name] : void 0;\n}\nfunction hasValueObject(storage, namespaceId, name) {\n\treturn valueObjectAt(storage, {\n\t\tplane: \"storage\",\n\t\tnamespaceId,\n\t\tentityKind: \"valueObject\",\n\t\tentityName: name\n\t}) !== void 0;\n}\nfunction modelAt(contract, coordinate) {\n\tconst namespaces = contract.domain.namespaces;\n\tconst namespace = Object.hasOwn(namespaces, coordinate.namespaceId) ? namespaces[coordinate.namespaceId] : void 0;\n\treturn namespace === void 0 ? void 0 : modelIn(namespace, coordinate.model);\n}\nfunction fieldNames(model) {\n\treturn [...Object.keys(model.fields), ...Object.keys(model.relations)];\n}\nfunction hasField(model, field) {\n\treturn Object.hasOwn(model.fields, field) || Object.hasOwn(model.relations, field);\n}\nfunction missing(reason) {\n\treturn {\n\t\treason,\n\t\tfix: CHECK_NAMES_FIX\n\t};\n}\nfunction valueObjectRefusal(name) {\n\treturn {\n\t\treason: `\"${name}\" is a value object, and value object renames are not supported in this release`,\n\t\tfix: `Leave the value object itself out of the statements. A statement can rename, delete or backfill its fields, as --rename ${name}.<field>:${name}.<new name>.`,\n\t\tvalueObject: name\n\t};\n}\nfunction lookupModelInNamespace(contract, namespaceId, namespace, name) {\n\tconst model = modelIn(namespace, name);\n\tif (model !== void 0) return {\n\t\tkind: \"found\",\n\t\tcoordinate: {\n\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\tmodel: name\n\t\t},\n\t\tmodel\n\t};\n\tif (hasValueObject(contract.contract.storage, namespaceId, name)) return {\n\t\tkind: \"refused\",\n\t\t...valueObjectRefusal(displayName(namespaceId, name))\n\t};\n\treturn {\n\t\tkind: \"missing\",\n\t\t...missing(`the ${contract.name} contract has no model \"${name}\" in namespace \"${namespaceId}\" (models there: ${listed(Object.keys(namespace.models))})`)\n\t};\n}\nfunction modelNames(contract) {\n\treturn Object.entries(contract.contract.domain.namespaces).flatMap(([id, namespace]) => Object.keys(namespace.models).map((model) => displayName(id, model)));\n}\nfunction lookupModel(contract, namespaceId, name) {\n\tconst namespaces = contract.contract.domain.namespaces;\n\tif (namespaceId !== void 0) {\n\t\tconst namespace = Object.hasOwn(namespaces, namespaceId) ? namespaces[namespaceId] : void 0;\n\t\tif (namespace === void 0) {\n\t\t\tconst named = Object.keys(namespaces).filter((id) => id !== UNBOUND_NAMESPACE_ID);\n\t\t\treturn {\n\t\t\t\tkind: \"missing\",\n\t\t\t\t...missing(named.length === 0 ? `the ${contract.name} contract has no namespaces` : `the ${contract.name} contract has no namespace \"${namespaceId}\" (namespaces: ${listed(named)})`)\n\t\t\t};\n\t\t}\n\t\treturn lookupModelInNamespace(contract, namespaceId, namespace, name);\n\t}\n\tconst declaring = Object.entries(namespaces).filter(([, namespace]) => modelIn(namespace, name) !== void 0);\n\tconst [only] = declaring;\n\tif (only !== void 0 && declaring.length === 1) return lookupModelInNamespace(contract, only[0], only[1], name);\n\tif (declaring.length > 1) {\n\t\tconst candidates = declaring.map(([id]) => `${id}.${name}`).sort();\n\t\treturn {\n\t\t\tkind: \"refused\",\n\t\t\treason: `\"${name}\" is a model in more than one namespace of the ${contract.name} contract (${listed(candidates)})`,\n\t\t\tfix: `Name the model with its namespace, for example ${candidates[0]}.`\n\t\t};\n\t}\n\tif (Object.keys(contract.contract.storage.namespaces).some((namespaceId) => hasValueObject(contract.contract.storage, namespaceId, name))) return {\n\t\tkind: \"refused\",\n\t\t...valueObjectRefusal(name)\n\t};\n\treturn {\n\t\tkind: \"missing\",\n\t\t...missing(`the ${contract.name} contract has no model \"${name}\" (models: ${listed(modelNames(contract))})`)\n\t};\n}\nfunction enumsOf(namespace) {\n\treturn namespace.enum ?? {};\n}\nfunction lookupEnum(contract, namespaceId, name) {\n\tconst namespaces = contract.contract.domain.namespaces;\n\tconst declaring = Object.entries(namespaces).filter(([id, namespace]) => (namespaceId === void 0 || id === namespaceId) && Object.hasOwn(enumsOf(namespace), name));\n\tconst [only] = declaring;\n\tif (only !== void 0 && declaring.length === 1) {\n\t\tconst members = enumsOf(only[1])[name]?.members.map((member) => member.name) ?? [];\n\t\treturn {\n\t\t\tkind: \"found\",\n\t\t\tnamespaceId: only[0],\n\t\t\tmembers\n\t\t};\n\t}\n\tif (declaring.length > 1) {\n\t\tconst candidates = declaring.map(([id]) => `${id}.${name}`).sort();\n\t\treturn {\n\t\t\tkind: \"refused\",\n\t\t\treason: `\"${name}\" is an enum in more than one namespace of the ${contract.name} contract (${listed(candidates)})`,\n\t\t\tfix: `Name the enum with its namespace, for example ${candidates[0]}.`\n\t\t};\n\t}\n\tconst enums = Object.entries(namespaces).flatMap(([id, namespace]) => namespaceId === void 0 || id === namespaceId ? Object.keys(enumsOf(namespace)) : []);\n\tconst within = namespaceId === void 0 ? \"\" : ` in namespace \"${namespaceId}\"`;\n\tconst there = namespaceId === void 0 ? \"\" : \" there\";\n\tconst known = enums.length === 0 ? \"\" : ` (enums${there}: ${listed([...new Set(enums)])})`;\n\treturn {\n\t\tkind: \"missing\",\n\t\t...missing(`the ${contract.name} contract has no enum \"${name}\"${within}${known}`)\n\t};\n}\nfunction readEnumValue(state, side, namespaceId, name, member) {\n\tconst contract = side === \"old\" ? state.origin : state.destination;\n\tconst lookup = lookupEnum(contract, (side === \"old\" && namespaceId !== void 0 ? state.originOfRenamedNamespace.get(namespaceId) : void 0) ?? namespaceId, name);\n\tif (lookup.kind !== \"found\") return notOk(lookup);\n\tif (!lookup.members.includes(member)) return notOk(missing(`the ${contract.name} enum \"${enumText(contract, lookup.namespaceId, name)}\" has no value \"${member}\" (values: ${listed(lookup.members)})`));\n\treturn ok({\n\t\tentity: \"enumValue\",\n\t\tcoordinate: {\n\t\t\tnamespaceId: asNamespaceId(lookup.namespaceId),\n\t\t\tenum: name,\n\t\t\tmember\n\t\t},\n\t\tmembers: lookup.members\n\t});\n}\nfunction declaresEnums(contract) {\n\treturn Object.values(contract.contract.domain.namespaces).some((namespace) => Object.keys(enumsOf(namespace)).length > 0);\n}\nfunction lookupValueObject(contract, namespaceId, name) {\n\tconst storage = contract.contract.storage;\n\tconst declaring = Object.keys(storage.namespaces).flatMap((id) => {\n\t\tif (namespaceId !== void 0 && id !== namespaceId) return [];\n\t\tconst valueObject = valueObjectAt(storage, {\n\t\t\tplane: \"storage\",\n\t\t\tnamespaceId: id,\n\t\t\tentityKind: \"valueObject\",\n\t\t\tentityName: name\n\t\t});\n\t\treturn valueObject === void 0 ? [] : [{\n\t\t\tnamespaceId: id,\n\t\t\tvalueObject\n\t\t}];\n\t});\n\tconst [only] = declaring;\n\tif (only !== void 0 && declaring.length === 1) return {\n\t\tkind: \"found\",\n\t\t...only\n\t};\n\tif (declaring.length > 1) {\n\t\tconst candidates = declaring.map(({ namespaceId: id }) => `${id}.${name}`).sort();\n\t\treturn {\n\t\t\tkind: \"refused\",\n\t\t\treason: `\"${name}\" is a value object in more than one namespace of the ${contract.name} contract (${listed(candidates)})`,\n\t\t\tfix: `Name the value object with its namespace, for example ${candidates[0]}.`\n\t\t};\n\t}\n\tconst within = namespaceId === void 0 ? \"\" : ` in namespace \"${namespaceId}\"`;\n\treturn {\n\t\tkind: \"missing\",\n\t\t...missing(`the ${contract.name} contract has no value object \"${name}\"${within}`)\n\t};\n}\nfunction readValueObjectField(state, side, namespaceId, name, field) {\n\tconst contract = side === \"old\" ? state.origin : state.destination;\n\tconst lookup = lookupValueObject(contract, (side === \"old\" && namespaceId !== void 0 ? state.originOfRenamedNamespace.get(namespaceId) : void 0) ?? namespaceId, name);\n\tif (lookup.kind !== \"found\") return notOk(lookup);\n\tconst fields = Object.keys(lookup.valueObject.fields);\n\tif (!fields.includes(field)) return notOk(missing(`the ${contract.name} value object \"${enumText(contract, lookup.namespaceId, name)}\" has no field \"${field}\" (fields: ${listed(fields)})`));\n\treturn ok({\n\t\tentity: \"valueObjectField\",\n\t\tcoordinate: {\n\t\t\tnamespaceId: asNamespaceId(lookup.namespaceId),\n\t\t\tvalueObject: name,\n\t\t\tfield\n\t\t},\n\t\tfields\n\t});\n}\nfunction readingText(reading) {\n\tswitch (reading.entity) {\n\t\tcase \"model\": return `namespace \"${reading.coordinate.namespaceId}\" model \"${reading.coordinate.model}\"`;\n\t\tcase \"field\": return `model \"${reading.coordinate.model}\" field \"${reading.coordinate.field}\"`;\n\t\tcase \"enumValue\": return `enum \"${reading.coordinate.enum}\" value \"${reading.coordinate.member}\"`;\n\t\tcase \"valueObjectField\": return `value object \"${reading.coordinate.valueObject}\" field \"${reading.coordinate.field}\"`;\n\t}\n}\nfunction qualifiedReading(reading) {\n\tswitch (reading.entity) {\n\t\tcase \"model\": return qualifiedModel(reading.coordinate);\n\t\tcase \"field\": return qualifiedField(reading.coordinate);\n\t\tcase \"enumValue\": return qualifiedEnumValue(reading.coordinate);\n\t\tcase \"valueObjectField\": return qualifiedValueObjectField(reading.coordinate);\n\t}\n}\n/** What a reading sits in, which a rename can give another name so that the reading stops colliding. */\nfunction readingContainer(reading) {\n\tswitch (reading.entity) {\n\t\tcase \"model\": return `namespace \"${reading.coordinate.namespaceId}\"`;\n\t\tcase \"field\": return `model \"${reading.coordinate.model}\"`;\n\t\tcase \"enumValue\": return `enum \"${reading.coordinate.enum}\"`;\n\t\tcase \"valueObjectField\": return `value object \"${reading.coordinate.valueObject}\"`;\n\t}\n}\nfunction joinedAs(texts) {\n\treturn texts.length === 2 ? `both as ${texts[0]} and as ${texts[1]}` : `as ${texts.slice(0, -1).join(\", as \")} and as ${texts.at(-1)}`;\n}\n/**\n* The enum value and value object field readings beside the model or field reading of the same\n* name: the one that resolves, `primary`'s failure when none does, or a refusal naming each\n* reading when more than one does.\n*/\nfunction oneReading(text, primary, others) {\n\tconst readings = [primary, ...others].flatMap((reading) => reading.ok ? [reading.value] : []);\n\tconst [only] = readings;\n\tif (only === void 0) return primary;\n\tif (readings.length === 1) return ok(only);\n\tconst nameable = readings.filter((reading) => qualifiedReading(reading) !== text);\n\tconst unnameable = readings.find((reading) => qualifiedReading(reading) === text);\n\tconst written = nameable.map((reading) => `${qualifiedReading(reading)} for the ${ENTITY_WORDS[reading.entity]}`);\n\treturn notOk({\n\t\treason: `\"${text}\" resolves ${joinedAs(readings.map(readingText))}`,\n\t\tfix: unnameable === void 0 ? `Name it with its namespace: ${written.join(\", \")}.` : `Write ${written.join(\", \")}. The ${ENTITY_WORDS[unnameable.entity]} cannot be named apart from it: rename ${readings.map(readingContainer).join(\" or \")} so that only one reading resolves.`\n\t});\n}\nfunction readModel(state, side, namespaceId, name) {\n\tconst lookup = lookupModel(side === \"old\" ? state.origin : state.destination, namespaceId, name);\n\tif (lookup.kind !== \"found\") return notOk(lookup);\n\treturn ok({\n\t\tentity: \"model\",\n\t\tcoordinate: lookup.coordinate,\n\t\tmodel: lookup.model\n\t});\n}\nfunction readFieldOf(contract, found, field, destinationModel) {\n\tif (!hasField(found.model, field)) return notOk(missing(`the ${contract.name} model \"${qualifiedModel(found.coordinate)}\" has no field \"${field}\" (fields: ${listed(fieldNames(found.model))})`));\n\treturn ok({\n\t\tentity: \"field\",\n\t\tcoordinate: {\n\t\t\t...found.coordinate,\n\t\t\tfield\n\t\t},\n\t\tmodel: found.model,\n\t\tdestinationModel\n\t});\n}\nfunction originCounterpart(state, destinationModel) {\n\tconst namespaceOrigin = state.originOfRenamedNamespace.get(destinationModel.namespaceId);\n\tconst coordinate = state.originOfRenamedModel.get(qualifiedModel(destinationModel)) ?? (namespaceOrigin === void 0 ? destinationModel : {\n\t\tnamespaceId: asNamespaceId(namespaceOrigin),\n\t\tmodel: destinationModel.model\n\t});\n\tconst model = modelAt(state.origin.contract, coordinate);\n\treturn model === void 0 ? void 0 : {\n\t\tcoordinate,\n\t\tmodel\n\t};\n}\n/**\n* The old side of a field rename names the model as the destination spells\n* it, and the field as the origin counterpart of that model has it. When the\n* model is not in the destination but the origin has it with that field, the\n* reading still resolves so the caller can say the field would move between\n* models.\n*/\nfunction readOldField(state, namespaceId, modelName, field) {\n\tconst destination = lookupModel(state.destination, namespaceId, modelName);\n\tif (destination.kind === \"found\") {\n\t\tconst counterpart = originCounterpart(state, destination.coordinate);\n\t\tif (counterpart === void 0) {\n\t\t\tconst name = qualifiedModel(destination.coordinate);\n\t\t\treturn notOk({\n\t\t\t\treason: `the destination model \"${name}\" has no counterpart in the origin contract: the origin has no model \"${name}\" and no earlier statement renames a model to it`,\n\t\t\t\tfix: `Rename the origin model to \"${name}\" with its own --rename statement before this one, or check the names.`,\n\t\t\t\tmodelWithoutCounterpart: name\n\t\t\t});\n\t\t}\n\t\treturn readFieldOf(state.origin, counterpart, field, destination.coordinate);\n\t}\n\tif (destination.kind === \"refused\") return notOk(destination);\n\tconst origin = lookupModel(state.origin, namespaceId, modelName);\n\tif (origin.kind === \"found\" && hasField(origin.model, field)) return readFieldOf(state.origin, origin, field, void 0);\n\treturn notOk(destination);\n}\nfunction readNewField(state, namespaceId, modelName, field) {\n\tconst destination = lookupModel(state.destination, namespaceId, modelName);\n\tif (destination.kind !== \"found\") return notOk(destination);\n\treturn readFieldOf(state.destination, destination, field, destination.coordinate);\n}\nfunction readField(state, side, namespaceId, modelName, field) {\n\treturn side === \"old\" ? readOldField(state, namespaceId, modelName, field) : readNewField(state, namespaceId, modelName, field);\n}\n/** A value object field named as `Model.field.valueObjectField`, which a statement names through its value object instead. */\nfunction valueObjectFieldThroughModel(contract, modelName, fieldName, valueObjectField) {\n\tconst lookup = lookupModel(contract, void 0, modelName);\n\tif (lookup.kind !== \"found\" || !hasField(lookup.model, fieldName)) return void 0;\n\tconst type = lookup.model.fields[fieldName]?.type;\n\tif (type?.kind !== \"valueObject\") return void 0;\n\treturn {\n\t\treason: `\"${modelName}.${fieldName}\" holds value object \"${type.entityName}\", and a statement names a value object field through its value object, not through a model field`,\n\t\tfix: `Name the field as ${type.entityName}.${valueObjectField}.`\n\t};\n}\nfunction readSide(state, side, segments) {\n\tif (segments.length === 1) return readModel(state, side, void 0, segments[0]);\n\tconst contract = side === \"old\" ? state.origin : state.destination;\n\tif (segments.length === 3) {\n\t\tconst [first, second, third] = segments;\n\t\tconst qualified = readField(state, side, first, second, third);\n\t\tconst dotted = readField(state, side, void 0, first, `${second}.${third}`);\n\t\tif (qualified.ok && dotted.ok) return notOk({\n\t\t\treason: `\"${first}.${second}.${third}\" resolves both as namespace \"${first}\" model \"${second}\" field \"${third}\" and as model \"${first}\" field \"${second}.${third}\"`,\n\t\t\tfix: `Give the field a stored name without \".\" with @map, or rename namespace \"${first}\" or model \"${first}\", so that only one reading resolves.`\n\t\t});\n\t\tconst asField = qualified.ok || !dotted.ok ? qualified : dotted;\n\t\tconst asEnumValue = readEnumValue(state, side, first, second, third);\n\t\tconst asValueObjectField = readValueObjectField(state, side, first, second, third);\n\t\tif (asField.ok || asEnumValue.ok || asValueObjectField.ok) return oneReading(segments.join(\".\"), asField, [asEnumValue, asValueObjectField]);\n\t\tconst throughModel = valueObjectFieldThroughModel(contract, first, second, third);\n\t\tif (throughModel !== void 0) return notOk(throughModel);\n\t\tif (containerNames(contract).valueObjects.has(second)) return asValueObjectField;\n\t\tif (!declaresEnums(contract)) return asField;\n\t\treturn notOk({\n\t\t\t...missing(`\"${segments.join(\".\")}\" resolves neither as namespace.Model.field (${asField.failure.reason}) nor as namespace.Enum.value (${asEnumValue.failure.reason})`),\n\t\t\t...ifDefined(\"modelWithoutCounterpart\", asField.failure.modelWithoutCounterpart)\n\t\t});\n\t}\n\tconst [first, second] = segments;\n\tconst asModel = readModel(state, side, first, second);\n\tconst asField = readField(state, side, void 0, first, second);\n\tconst asEnumValue = readEnumValue(state, side, void 0, first, second);\n\tconst asValueObjectField = readValueObjectField(state, side, void 0, first, second);\n\tif (asModel.ok && asField.ok) return notOk({\n\t\treason: `\"${first}.${second}\" resolves both as namespace \"${first}\" model \"${second}\" and as model \"${first}\" field \"${second}\"`,\n\t\tfix: \"Write the field as namespace.Model.field if you mean the field.\"\n\t});\n\tif (asModel.ok || asField.ok || asEnumValue.ok || asValueObjectField.ok) return oneReading(`${first}.${second}`, asModel.ok ? asModel : asField, [asEnumValue, asValueObjectField]);\n\tconst names = containerNames(contract);\n\tif (names.valueObjects.has(first) && !names.namespaces.has(first) && !names.models.has(first)) return asValueObjectField;\n\tif (names.enums.has(first) && !names.namespaces.has(first) && !names.models.has(first)) return asEnumValue;\n\tconst hasNamespaces = names.namespaces.size > 0;\n\tconst hasEnums = declaresEnums(contract);\n\tif (!hasNamespaces && !hasEnums) return asField;\n\tconst readings = [\n\t\t...hasNamespaces ? [`as namespace.Model (${asModel.failure.reason})`] : [],\n\t\t`as Model.field (${asField.failure.reason})`,\n\t\t...hasEnums ? [`as Enum.value (${asEnumValue.failure.reason})`] : []\n\t];\n\tconst sameButCase = [\n\t\t...names.namespaces,\n\t\t...names.models,\n\t\t...names.enums\n\t].find((name) => name !== first && name.toLowerCase() === first.toLowerCase());\n\treturn notOk({\n\t\treason: `\"${first}.${second}\" resolves neither ${readings.slice(0, -1).join(\", \")}${readings.length > 2 ? \",\" : \"\"} nor ${readings.at(-1)}`,\n\t\tfix: sameButCase === void 0 ? CHECK_NAMES_FIX : `Names match exactly, including case: write ${sameButCase}, not ${first}.`,\n\t\t...ifDefined(\"modelWithoutCounterpart\", asField.failure.modelWithoutCounterpart)\n\t});\n}\n/** The names a side's first segment can be: a namespace, a model, an enum or a value object of the contract. */\nfunction containerNames(contract) {\n\tconst namespaces = Object.entries(contract.contract.domain.namespaces);\n\treturn {\n\t\tnamespaces: new Set(namespaces.flatMap(([id]) => id === UNBOUND_NAMESPACE_ID ? [] : [id])),\n\t\tmodels: new Set(namespaces.flatMap(([, namespace]) => Object.keys(namespace.models))),\n\t\tenums: new Set(namespaces.flatMap(([, namespace]) => Object.keys(enumsOf(namespace)))),\n\t\tvalueObjects: new Set(valueObjectsWithCoordinates(contract.contract.storage).map(({ coordinate }) => coordinate.entityName))\n\t};\n}\nfunction resolveModelRename(state, statement, from, to) {\n\tconst fromKey = `${MODEL_RENAMES}:${qualifiedModel(from)}`;\n\tconst toKey = `${MODEL_RENAMES}:${qualifiedModel(to)}`;\n\tif (state.renamedFrom.has(fromKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames \"${qualifiedModel(from)}\".`, REPEATED_NAME_FIX));\n\tif (state.renamedTo.has(toKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames a model to \"${qualifiedModel(to)}\".`, REPEATED_NAME_FIX));\n\tif (qualifiedModel(from) === qualifiedModel(to)) return notOk(errorStatementInvalid(statement, `The statement renames model \"${qualifiedModel(from)}\" to itself.`, `Leave out --${statement.verb} ${statement.text}. ${STORED_NAME_ONLY}`));\n\tif (modelAt(state.origin.contract, to) !== void 0 && modelAt(state.destination.contract, from) !== void 0) return notOk(swapRefusal(statement, \"model\", qualifiedModel(from), qualifiedModel(to)));\n\tif (modelAt(state.origin.contract, to) !== void 0) return notOk(errorStatementUnresolved(statement, `\"${qualifiedModel(to)}\" already exists in the origin contract, so it cannot be the new name of a model.`, CHECK_NAMES_FIX));\n\tif (modelAt(state.destination.contract, from) !== void 0) return notOk(errorStatementUnresolved(statement, `\"${qualifiedModel(from)}\" still exists in the destination contract, so it was not renamed.`, CHECK_NAMES_FIX));\n\tstate.renamedFrom.add(fromKey);\n\tstate.renamedTo.add(toKey);\n\tstate.originOfRenamedModel.set(qualifiedModel(to), from);\n\treturn ok({\n\t\tkind: \"rename\",\n\t\tentity: \"model\",\n\t\tfrom,\n\t\tto\n\t});\n}\nfunction modelPart(side) {\n\treturn side.slice(0, -1).join(\".\");\n}\n/**\n* The old side names a model the destination contract does not have. The\n* user most likely named the field's model by its old name, so the error\n* writes the statement with the model named as the destination names it.\n*/\nfunction oldModelNotInDestination(state, statement, from, toModel) {\n\tconst oldModel = modelPart(statement.from);\n\tconst newModel = modelPart(statement.to);\n\tconst corrected = `${newModel}.${from.coordinate.field}:${statement.to.join(\".\")}`;\n\tconst renamedEarlier = state.originOfRenamedModel.get(toModel);\n\tconst modelRenamed = renamedEarlier !== void 0 && qualifiedModel(renamedEarlier) === qualifiedModel(from.coordinate);\n\tconst modelStatement = `${oldModel}:${newModel}`;\n\treturn errorStatementInvalid(statement, [\n\t\t`\"${qualifiedModel(from.coordinate)}\" is not a model of the destination contract, and a field cannot move between models.`,\n\t\t`Name a field's model as the destination contract names it: --${statement.verb} ${corrected}.`,\n\t\t...modelRenamed ? [] : [`The model also needs its own statement, --rename ${modelStatement}, before it.`]\n\t].join(\" \"), modelRenamed ? `Write the statement as --${statement.verb} ${corrected}.` : `Write the statements as --rename ${modelStatement} --${statement.verb} ${corrected}.`);\n}\nfunction fieldMovesBetweenModels(statement, fromModel, toModel) {\n\treturn errorStatementInvalid(statement, `The old name is a field of \"${fromModel}\" and the new name a field of \"${toModel}\"; a field cannot move between models.`, \"Rename a field within one model, and name that model as the destination contract names it.\");\n}\n/**\n* True when the old side most likely names the new side's model by its old\n* name: no earlier statement renamed the old model to some other model or\n* some other model to the new model, and the origin does not have the new\n* model.\n*/\nfunction oldSideNamesNewModel(state, from, to) {\n\tconst oldModel = qualifiedModel(from.coordinate);\n\tconst renamedTo = [...state.originOfRenamedModel.entries()].find(([, origin]) => qualifiedModel(origin) === oldModel)?.[0];\n\tif (renamedTo !== void 0) return renamedTo === qualifiedModel(to.coordinate);\n\tif (state.originOfRenamedModel.has(qualifiedModel(to.coordinate))) return false;\n\treturn modelAt(state.origin.contract, to.coordinate) === void 0;\n}\nfunction resolveFieldRename(state, statement, from, to) {\n\tconst toModel = qualifiedModel(to.coordinate);\n\tif (from.destinationModel === void 0) return notOk(oldSideNamesNewModel(state, from, to) ? oldModelNotInDestination(state, statement, from, toModel) : fieldMovesBetweenModels(statement, qualifiedModel(from.coordinate), toModel));\n\tif (qualifiedModel(from.destinationModel) !== toModel) return notOk(fieldMovesBetweenModels(statement, qualifiedModel(from.destinationModel), toModel));\n\tconst fromKey = `${FIELD_RENAMES}:${qualifiedField(from.coordinate)}`;\n\tconst toKey = `${FIELD_RENAMES}:${qualifiedField(to.coordinate)}`;\n\tif (state.renamedFrom.has(fromKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames \"${qualifiedField(from.coordinate)}\".`, REPEATED_NAME_FIX));\n\tif (state.renamedTo.has(toKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames a field to \"${qualifiedField(to.coordinate)}\".`, REPEATED_NAME_FIX));\n\tif (from.coordinate.field === to.coordinate.field) return notOk(errorStatementInvalid(statement, `The statement renames field \"${toModel}.${to.coordinate.field}\" to itself.`, `Leave out --${statement.verb} ${statement.text}. ${STORED_NAME_ONLY}`));\n\tif (hasField(from.model, to.coordinate.field) && hasField(to.model, from.coordinate.field)) return notOk(swapRefusal(statement, \"field\", `${toModel}.${from.coordinate.field}`, `${toModel}.${to.coordinate.field}`));\n\tif (hasField(from.model, to.coordinate.field)) return notOk(errorStatementUnresolved(statement, `The field \"${to.coordinate.field}\" already exists on the origin model \"${qualifiedModel(from.coordinate)}\", so it cannot be the new name of a field.`, newNameTakenFix(statement, from.coordinate.field, to.coordinate.field)));\n\tif (hasField(to.model, from.coordinate.field)) return notOk(errorStatementUnresolved(statement, `The field \"${from.coordinate.field}\" still exists on the destination model \"${toModel}\", so it was not renamed.`, oldNameReusedFix(statement, from.coordinate.field, to.coordinate.field)));\n\tstate.renamedFrom.add(fromKey);\n\tstate.renamedTo.add(toKey);\n\tstate.originOfRenamedField.set(qualifiedField(to.coordinate), from.coordinate);\n\treturn ok({\n\t\tkind: \"rename\",\n\t\tentity: \"field\",\n\t\tfrom: from.coordinate,\n\t\tto: to.coordinate\n\t});\n}\nfunction resolveEnumValueRename(state, statement, from, to) {\n\tconst oldEnum = enumText(state.origin, from.coordinate.namespaceId, from.coordinate.enum);\n\tconst newEnum = enumText(state.destination, to.coordinate.namespaceId, to.coordinate.enum);\n\tconst toNamespaceInOrigin = state.originOfRenamedNamespace.get(to.coordinate.namespaceId) ?? to.coordinate.namespaceId;\n\tif (from.coordinate.namespaceId !== toNamespaceInOrigin || from.coordinate.enum !== to.coordinate.enum) return notOk(errorStatementInvalid(statement, `The old name is a value of enum \"${oldEnum}\" and the new name a value of enum \"${newEnum}\"; a value cannot move between enums.`, `Rename a value within one enum: --${statement.verb} ${statement.from.join(\".\")}:${statement.from.slice(0, -1).join(\".\")}.<new name>.`));\n\tconst oldMember = from.coordinate.member;\n\tconst newMember = to.coordinate.member;\n\tconst fromKey = `${ENUM_VALUE_RENAMES}:${qualifiedEnumValue(from.coordinate)}`;\n\tconst toKey = `${ENUM_VALUE_RENAMES}:${qualifiedEnumValue(to.coordinate)}`;\n\tif (state.renamedFrom.has(fromKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames \"${qualifiedEnumValue(from.coordinate)}\".`, REPEATED_NAME_FIX));\n\tif (state.renamedTo.has(toKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames a value to \"${qualifiedEnumValue(to.coordinate)}\".`, REPEATED_NAME_FIX));\n\tif (oldMember === newMember) return notOk(errorStatementInvalid(statement, `The statement renames enum value \"${qualifiedEnumValue(from.coordinate)}\" to itself.`, `Leave out --${statement.verb} ${statement.text}.`));\n\tconst newInOrigin = from.members.includes(newMember);\n\tconst oldInDestination = to.members.includes(oldMember);\n\tif (newInOrigin && oldInDestination) return notOk(swapRefusal(statement, \"enumValue\", `${newEnum}.${oldMember}`, `${newEnum}.${newMember}`));\n\tif (newInOrigin) return notOk(errorStatementUnresolved(statement, `The value \"${newMember}\" already exists in the origin enum \"${oldEnum}\", so it cannot be the new name of a value.`, CHECK_NAMES_FIX));\n\tif (oldInDestination) return notOk(errorStatementUnresolved(statement, `The value \"${oldMember}\" still exists in the destination enum \"${newEnum}\", so it was not renamed.`, CHECK_NAMES_FIX));\n\tstate.renamedFrom.add(fromKey);\n\tstate.renamedTo.add(toKey);\n\treturn ok({\n\t\tkind: \"rename\",\n\t\tentity: \"enumValue\",\n\t\tfrom: from.coordinate,\n\t\tto: to.coordinate\n\t});\n}\nfunction resolveValueObjectFieldRename(state, statement, from, to) {\n\tconst oldValueObject = enumText(state.origin, from.coordinate.namespaceId, from.coordinate.valueObject);\n\tconst newValueObject = enumText(state.destination, to.coordinate.namespaceId, to.coordinate.valueObject);\n\tconst toNamespaceInOrigin = state.originOfRenamedNamespace.get(to.coordinate.namespaceId) ?? to.coordinate.namespaceId;\n\tif (from.coordinate.namespaceId !== toNamespaceInOrigin || from.coordinate.valueObject !== to.coordinate.valueObject) return notOk(errorStatementInvalid(statement, `The old name is a field of value object \"${oldValueObject}\" and the new name a field of value object \"${newValueObject}\"; a field cannot move between value objects.`, `Rename a field within one value object: --${statement.verb} ${statement.from.join(\".\")}:${statement.from.slice(0, -1).join(\".\")}.<new name>.`));\n\tconst oldField = from.coordinate.field;\n\tconst newField = to.coordinate.field;\n\tconst fromKey = `${VALUE_OBJECT_FIELD_RENAMES}:${qualifiedValueObjectField(from.coordinate)}`;\n\tconst toKey = `${VALUE_OBJECT_FIELD_RENAMES}:${qualifiedValueObjectField(to.coordinate)}`;\n\tif (state.renamedFrom.has(fromKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames \"${qualifiedValueObjectField(from.coordinate)}\".`, REPEATED_NAME_FIX));\n\tif (state.renamedTo.has(toKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames a field to \"${qualifiedValueObjectField(to.coordinate)}\".`, REPEATED_NAME_FIX));\n\tif (oldField === newField) return notOk(errorStatementInvalid(statement, `The statement renames value object field \"${qualifiedValueObjectField(from.coordinate)}\" to itself.`, `Leave out --${statement.verb} ${statement.text}.`));\n\tconst newInOrigin = from.fields.includes(newField);\n\tconst oldInDestination = to.fields.includes(oldField);\n\tif (newInOrigin && oldInDestination) return notOk(swapRefusal(statement, \"valueObjectField\", `${newValueObject}.${oldField}`, `${newValueObject}.${newField}`));\n\tif (newInOrigin) return notOk(errorStatementUnresolved(statement, `The field \"${newField}\" already exists in the origin value object \"${oldValueObject}\", so it cannot be the new name of a field.`, newNameTakenFix(statement, oldField, newField)));\n\tif (oldInDestination) return notOk(errorStatementUnresolved(statement, `The field \"${oldField}\" still exists in the destination value object \"${newValueObject}\", so it was not renamed.`, oldNameReusedFix(statement, oldField, newField)));\n\tstate.renamedFrom.add(fromKey);\n\tstate.renamedTo.add(toKey);\n\tstate.originOfRenamedValueObjectField.set(qualifiedValueObjectField(to.coordinate), from.coordinate);\n\treturn ok({\n\t\tkind: \"rename\",\n\t\tentity: \"valueObjectField\",\n\t\tfrom: from.coordinate,\n\t\tto: to.coordinate\n\t});\n}\n/** How to rename a field onto a name another field of the origin holds: free the name in one migration, then rename. */\nfunction newNameTakenFix(statement, oldName, newName) {\n\treturn `${CHECK_NAMES_FIX} If another field holds the name \"${newName}\" in the origin and this change renames or removes it, make the change in two migrations: first change the contract so that field has its new name or is gone, and plan only that; then give \"${oldName}\" the name \"${newName}\" and plan it with ${statementFlag(statement)}.`;\n}\n/** How to give a renamed field's old name to another field: rename in one migration, then add or rename the other. */\nfunction oldNameReusedFix(statement, oldName, newName) {\n\treturn `${CHECK_NAMES_FIX} If \"${oldName}\" in the destination is another field that takes the name, make the change in two migrations: first change the contract so that \"${oldName}\" is renamed to \"${newName}\" and no field has the name \"${oldName}\", and plan it with ${statementFlag(statement)}; then add or rename the field that takes the name \"${oldName}\" and plan that.`;\n}\n/**\n* Two names that trade places: each is an old name and a new name, which one plan cannot do.\n* Statements resolve against contracts, so the swap takes three plans through a temporary name.\n*/\nfunction swapRefusal(statement, entity, first, second) {\n\tconst verb = statement.verb;\n\tconst oldName = statement.from.join(\".\");\n\tconst newName = statement.to.join(\".\");\n\tconst temporary = entity === \"model\" ? \"<temporary name>\" : `${statement.to.slice(0, -1).join(\".\")}.<temporary name>`;\n\tconst keptNames = entity === \"enumValue\" ? \" If the members keep their names and only their stored values trade places, leave out the statement: the plan asks about each value and names the edits that keep its data.\" : \"\";\n\treturn errorStatementInvalid(statement, `\"${first}\" and \"${second}\" swap names: each is both an old name and a new name, and statements cannot swap names in one plan.`, `Make the swap in three plans. First change the contract so that \"${first}\" has a temporary name, and plan it with --${verb} ${oldName}:${temporary}. Then give \"${second}\" the name \"${first}\", and plan it with --${verb} ${newName}:${oldName}. Then give the temporary name the name \"${second}\", and plan it with --${verb} ${temporary}:${newName}.${keptNames}`);\n}\n/**\n* The old side does not resolve. Says so in terms of what the user can do next when the statement\n* is the wrong way round, when the rename has already happened, or when a later statement renames\n* the field's model.\n*/\nfunction oldSideRefusal(state, statement, later, refusal) {\n\tconst oldText = statement.from.join(\".\");\n\tconst newText = statement.to.join(\".\");\n\tconst newIsInOrigin = readSide(state, \"old\", statement.to).ok;\n\tconst newIsInDestination = readSide(state, \"new\", statement.to).ok;\n\tconst oldIsInDestination = readSide(state, \"new\", statement.from).ok;\n\tif (newIsInOrigin && oldIsInDestination && !newIsInDestination) return errorStatementUnresolved(statement, `The statement is the wrong way round: \"${newText}\" is the old name, in the origin contract, and \"${oldText}\" the new name, in the destination contract.`, `Write the old name first: --${statement.verb} ${newText}:${oldText}.`);\n\tif (newIsInOrigin && newIsInDestination && !oldIsInDestination) return errorStatementUnresolved(statement, `The origin contract already has \"${newText}\" and has no \"${oldText}\", so this rename has already happened. For db update, the database is already at the new name.`, `Leave out --${statement.verb} ${statement.text}.`);\n\tconst model = refusal.modelWithoutCounterpart;\n\tconst renamesModel = model === void 0 ? void 0 : later.find((candidate) => candidate.to.length < 3 && readSide(state, \"new\", candidate.to).ok && [model, model.split(\".\").pop()].includes(candidate.to.join(\".\")));\n\tif (renamesModel !== void 0) return errorStatementUnresolved(statement, `${sentence(refusal.reason)} A later statement, --${renamesModel.verb} ${renamesModel.text}, renames it, and statements apply in the order given.`, `Put --${renamesModel.verb} ${renamesModel.text} before --${statement.verb} ${statement.text}.`);\n\treturn unresolved(statement, refusal);\n}\nfunction namespacesOf(contract) {\n\treturn Object.keys(contract.contract.domain.namespaces).filter((id) => id !== UNBOUND_NAMESPACE_ID);\n}\n/**\n* The namespace reading of a statement with one name on each side: `undefined` when the old name\n* is no namespace of the origin contract, so the statement is not about a namespace.\n*/\nfunction readNamespaceRename(state, from, to) {\n\tif (!namespacesOf(state.origin).includes(from)) return void 0;\n\tif (namespacesOf(state.destination).includes(from)) return notOk(missing(`namespace \"${from}\" still exists in the destination contract, so it was not renamed`));\n\tconst destinationNamespaces = namespacesOf(state.destination);\n\tif (!destinationNamespaces.includes(to)) return notOk(missing(`the destination contract has no namespace \"${to}\" (namespaces: ${listed(destinationNamespaces)})`));\n\tif (namespacesOf(state.origin).includes(to)) return notOk(missing(`namespace \"${to}\" already exists in the origin contract, so it cannot be the new name of a namespace`));\n\treturn ok({\n\t\tfrom,\n\t\tto\n\t});\n}\nfunction resolveNamespaceRename(state, statement, rename) {\n\tconst fromKey = `${NAMESPACE_RENAMES}:${rename.from}`;\n\tconst toKey = `${NAMESPACE_RENAMES}:${rename.to}`;\n\tif (state.renamedFrom.has(fromKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames namespace \"${rename.from}\".`, REPEATED_NAME_FIX));\n\tif (state.renamedTo.has(toKey)) return notOk(errorStatementInvalid(statement, `An earlier statement already renames a namespace to \"${rename.to}\".`, REPEATED_NAME_FIX));\n\tstate.renamedFrom.add(fromKey);\n\tstate.renamedTo.add(toKey);\n\tstate.originOfRenamedNamespace.set(rename.to, rename.from);\n\treturn ok({\n\t\tkind: \"rename\",\n\t\tentity: \"namespace\",\n\t\tfrom: asNamespaceId(rename.from),\n\t\tto: asNamespaceId(rename.to)\n\t});\n}\n/** Whether an earlier or a later statement of the run renames the model with its namespace. */\nfunction renamedElsewhere(state, later, model) {\n\tif (state.renamedFrom.has(`${MODEL_RENAMES}:${qualifiedModel(model)}`)) return true;\n\treturn later.some((candidate) => {\n\t\tif (candidate.from.length !== 2) return false;\n\t\tconst reading = readSide(state, \"old\", candidate.from);\n\t\treturn reading.ok && reading.value.entity === \"model\" && qualifiedModel(reading.value.coordinate) === qualifiedModel(model);\n\t});\n}\n/**\n* A statement with one name on each side reads as a namespace rename or a model rename. Exactly\n* one reading must resolve; `undefined` leaves the statement to the model reading.\n*/\n/**\n* A one-name statement whose new name is a namespace of the destination, and whose old name is no\n* namespace or model of the origin, as when a namespace rename is given again.\n*/\nfunction neitherNamespaceNorModel(state, statement, from, to) {\n\tif (!namespacesOf(state.destination).includes(to)) return void 0;\n\tif (lookupModel(state.origin, void 0, from).kind !== \"missing\") return void 0;\n\treturn notOk(unresolved(statement, missing(`the origin contract has no namespace or model \"${from}\" (namespaces: ${listed(namespacesOf(state.origin))}; models: ${listed(modelNames(state.origin))})`)));\n}\nfunction resolveOneNameStatement(state, statement, later, from, to) {\n\tconst asNamespace = readNamespaceRename(state, from, to);\n\tif (asNamespace === void 0) return neitherNamespaceNorModel(state, statement, from, to);\n\tconst fromModel = readModel(state, \"old\", void 0, from);\n\tconst toModel = readModel(state, \"new\", void 0, to);\n\tif (asNamespace.ok && fromModel.ok && renamedElsewhere(state, later, fromModel.value.coordinate)) return resolveNamespaceRename(state, statement, asNamespace.value);\n\tif (asNamespace.ok && fromModel.ok && toModel.ok) {\n\t\tconst oldModel = qualifiedModel(fromModel.value.coordinate);\n\t\tconst newModel = qualifiedModel(toModel.value.coordinate);\n\t\treturn notOk(errorStatementUnresolved(statement, `\"${statement.text}\" reads both as a rename of namespace \"${from}\" to \"${to}\" and as a rename of model \"${oldModel}\" to \"${newModel}\".`, `To rename the model, name it with its namespace: --${statement.verb} ${oldModel}:${newModel}. To rename both the namespace and the model, give both statements: --${statement.verb} ${oldModel}:${newModel} --${statement.verb} ${statement.text}.`));\n\t}\n\tif (asNamespace.ok) return resolveNamespaceRename(state, statement, asNamespace.value);\n\tif (fromModel.ok) return void 0;\n\treturn notOk(unresolved(statement, asNamespace.failure));\n}\nfunction resolveStatement(state, statement, later) {\n\tif (statement.from.length === 1 && statement.to.length === 1) {\n\t\tconst oneName = resolveOneNameStatement(state, statement, later, statement.from[0], statement.to[0]);\n\t\tif (oneName !== void 0) return oneName;\n\t}\n\tconst from = readSide(state, \"old\", statement.from);\n\tif (!from.ok) return notOk(oldSideRefusal(state, statement, later, from.failure));\n\tconst to = readSide(state, \"new\", statement.to);\n\tif (!to.ok && (from.value.entity === \"enumValue\" || from.value.entity === \"valueObjectField\") && statement.to.length === 1) {\n\t\tconst container = statement.from.slice(0, -1).join(\".\");\n\t\tconst word = from.value.entity === \"enumValue\" ? \"enum\" : \"value object\";\n\t\treturn notOk(errorStatementUnresolved(statement, sentence(to.failure.reason), `Write the new name with its ${word}: --${statement.verb} ${statement.from.join(\".\")}:${container}.${statement.to[0]}.`));\n\t}\n\tif (!to.ok) return notOk(unresolved(statement, to.failure));\n\tif (from.value.entity === \"model\" && to.value.entity === \"model\") return resolveModelRename(state, statement, from.value.coordinate, to.value.coordinate);\n\tif (from.value.entity === \"field\" && to.value.entity === \"field\") return resolveFieldRename(state, statement, from.value, to.value);\n\tif (from.value.entity === \"enumValue\" && to.value.entity === \"enumValue\") return resolveEnumValueRename(state, statement, from.value, to.value);\n\tif (from.value.entity === \"valueObjectField\" && to.value.entity === \"valueObjectField\") return resolveValueObjectFieldRename(state, statement, from.value, to.value);\n\tif (from.value.entity === \"valueObjectField\" || to.value.entity === \"valueObjectField\") return notOk(errorStatementInvalid(statement, \"The statement names a value object field on one side and something else on the other.\", \"Rename a value object field to another field of the same value object, as ValueObject.field:ValueObject.<new name>.\"));\n\tif (from.value.entity === \"enumValue\" || to.value.entity === \"enumValue\") return notOk(errorStatementInvalid(statement, \"The statement names an enum value on one side and a model or field on the other.\", \"Rename an enum value to another value of the same enum, as Enum.value:Enum.<new name>.\"));\n\treturn notOk(errorStatementInvalid(statement, \"The statement names a model on one side and a field on the other.\", mixedSidesFix(statement.verb, statement.from, statement.to)));\n}\nfunction typeText(type) {\n\tswitch (type.kind) {\n\t\tcase \"scalar\": return type.typeParams === void 0 ? type.codecId : `${type.codecId}(${JSON.stringify(type.typeParams)})`;\n\t\tcase \"valueObject\": return type.entityName;\n\t\tcase \"union\": return type.members.map(typeText).join(\" | \");\n\t}\n}\nfunction fieldTypeText(field) {\n\treturn `${typeText(field.type)}${field.many ? \"[]\" : \"\"}${field.dict ? \" dict\" : \"\"}`;\n}\nfunction sameType(origin, destination) {\n\tconst shape = (field) => ({\n\t\ttype: field.type,\n\t\tmany: field.many ?? false,\n\t\tdict: field.dict ?? false\n\t});\n\treturn isDeepStrictEqual(shape(origin), shape(destination));\n}\n/**\n* A convert of a variant: the model must be a variant in both contracts, followed through a rename,\n* and its discriminator value must have changed.\n*/\nfunction resolveVariantConvert(state, statement, variant) {\n\tconst flag = statementFlag(statement);\n\tconst refuse = (reason) => notOk(unresolved(statement, {\n\t\treason,\n\t\tfix: `Leave out ${flag}.`\n\t}));\n\tconst shown = modelStatementText(state.destination.contract, variant.coordinate);\n\tconst key = `convert:${qualifiedModel(variant.coordinate)}`;\n\tif (state.fieldStatements.has(key)) return notOk(errorStatementInvalid(statement, `An earlier statement already converts \"${shown}\".`, \"Give each variant at most one --convert statement.\"));\n\tconst counterpart = originCounterpart(state, variant.coordinate);\n\tconst from = counterpart === void 0 ? void 0 : variantValue(state.origin.contract, counterpart.coordinate);\n\tconst to = variantValue(state.destination.contract, variant.coordinate);\n\tif (from === void 0 || to === void 0) return refuse(`the model \"${shown}\" is not a variant in both contracts; a --convert statement names a field, or a variant whose discriminator value changed`);\n\tif (from === to) return refuse(`the variant \"${shown}\" has the discriminator value \"${to}\" in the origin and destination contracts, so it has no values to convert`);\n\tstate.fieldStatements.add(key);\n\treturn ok({\n\t\tkind: \"convert\",\n\t\tentity: \"model\",\n\t\tmodel: variant.coordinate\n\t});\n}\n/** A convert with one name, which names a variant as the destination contract names it. */\nfunction resolveOneNameConvert(state, statement, name) {\n\tconst lookup = lookupModel(state.destination, void 0, name);\n\tif (lookup.kind === \"found\") return resolveVariantConvert(state, statement, lookup);\n\treturn notOk(unresolved(statement, {\n\t\treason: lookup.reason,\n\t\tfix: lookup.kind === \"missing\" ? \"A --convert statement with one name names a variant as the destination contract names it, Variant or namespace.Variant. Names match exactly, including case.\" : lookup.fix\n\t}));\n}\n/**\n* The variant a two-name convert reads as, `namespace.Variant`, when the destination has that\n* model: `undefined` leaves the statement to the field reading, and a refusal names both readings\n* when the field reading resolves too.\n*/\nfunction readNamespaceVariant(state, statement, first, second) {\n\tconst asVariant = lookupModel(state.destination, first, second);\n\tif (asVariant.kind !== \"found\") return void 0;\n\tconst asFieldModel = lookupModel(state.destination, void 0, first);\n\tif (asFieldModel.kind !== \"found\" || !hasField(asFieldModel.model, second)) return ok(asVariant);\n\tconst field = qualifiedField({\n\t\t...asFieldModel.coordinate,\n\t\tfield: second\n\t});\n\treturn notOk(unresolved(statement, {\n\t\treason: `\"${statement.text}\" reads both as variant \"${qualifiedModel(asVariant.coordinate)}\" and as field \"${field}\"`,\n\t\tfix: `Write the field as namespace.Model.field if you mean the field: --convert ${field}.`\n\t}));\n}\n/**\n* A backfill of a value object's field: the field must be required in the destination value object,\n* and absent or optional in the origin one, under its origin name when a rename gave it a new one.\n*/\nfunction resolveValueObjectFieldBackfill(state, statement, namespaceId, name, field) {\n\tconst leaveOut = `Leave out ${statementFlag(statement)}.`;\n\tconst refuse = (reason, fix = leaveOut) => notOk(unresolved(statement, {\n\t\treason,\n\t\tfix\n\t}));\n\tconst destination = lookupValueObject(state.destination, namespaceId, name);\n\tif (destination.kind !== \"found\") return refuse(destination.reason, destination.fix);\n\tconst coordinate = {\n\t\tnamespaceId: asNamespaceId(destination.namespaceId),\n\t\tvalueObject: name,\n\t\tfield\n\t};\n\tconst shown = valueObjectFieldStatementText(state.destination.contract, coordinate);\n\tconst destinationFields = destination.valueObject.fields;\n\tconst destinationField = Object.hasOwn(destinationFields, field) ? destinationFields[field] : void 0;\n\tif (destinationField === void 0) return refuse(`the destination value object \"${enumText(state.destination, destination.namespaceId, name)}\" has no field \"${field}\" (fields: ${listed(Object.keys(destinationFields))})`, \"A --backfill statement names the field as the destination contract names it. Names match exactly, including case.\");\n\tconst key = `backfill:${qualifiedValueObjectField(coordinate)}`;\n\tif (state.fieldStatements.has(key)) return notOk(errorStatementInvalid(statement, `An earlier statement already backfills \"${shown}\".`, \"Give each field at most one --backfill statement.\"));\n\tif (destinationField.nullable) return refuse(`the field \"${shown}\" is optional in the destination contract, so no existing value needs it`, `${leaveOut} A --backfill statement fills a required field.`);\n\tconst originNamespace = state.originOfRenamedNamespace.get(destination.namespaceId) ?? destination.namespaceId;\n\tconst origin = valueObjectAt(state.origin.contract.storage, {\n\t\tplane: \"storage\",\n\t\tnamespaceId: originNamespace,\n\t\tentityKind: \"valueObject\",\n\t\tentityName: name\n\t});\n\tif (origin === void 0) return refuse(`the origin contract has no value object \"${enumText(state.origin, originNamespace, name)}\", so no existing value lacks the field`);\n\tconst originName = state.originOfRenamedValueObjectField.get(qualifiedValueObjectField(coordinate))?.field ?? field;\n\tconst originField = Object.hasOwn(origin.fields, originName) ? origin.fields[originName] : void 0;\n\tif (originField !== void 0 && !originField.nullable) return refuse(`the field \"${shown}\" is already required in the origin contract, so every existing value has it`);\n\tstate.fieldStatements.add(key);\n\treturn ok({\n\t\tkind: \"backfill\",\n\t\tentity: \"valueObjectField\",\n\t\tfield: coordinate\n\t});\n}\n/**\n* A convert or backfill statement names a field as the destination contract names it. A convert\n* needs the field in the origin contract, under its origin name when a rename gave it a new one,\n* with another type; a convert with one name, or a two-name convert that reads as\n* `namespace.Variant`, names a variant instead. A backfill needs the field required in the\n* destination contract and, on a model the origin has, either new or optional there; a backfill\n* whose first name is a value object names a field of the value object.\n*/\nfunction resolveFieldStatement(state, statement) {\n\tconst { verb } = statement;\n\tconst names = statement.field;\n\tif (names.length === 1) return resolveOneNameConvert(state, statement, names[0]);\n\tif (verb === \"convert\" && names.length === 2) {\n\t\tconst variant = readNamespaceVariant(state, statement, names[0], names[1]);\n\t\tif (variant !== void 0) return variant.ok ? resolveVariantConvert(state, statement, variant.value) : variant;\n\t}\n\tconst [namespaceId, modelName, field] = names.length === 3 ? names : [void 0, ...names];\n\tconst flag = statementFlag(statement);\n\tconst leaveOut = `Leave out ${flag}.`;\n\tconst refuse = (reason, fix = leaveOut) => notOk(unresolved(statement, {\n\t\treason,\n\t\tfix\n\t}));\n\tconst destination = lookupModel(state.destination, namespaceId, modelName);\n\tif (destination.kind !== \"found\") {\n\t\tif (destination.valueObject !== void 0 && verb === \"backfill\") return resolveValueObjectFieldBackfill(state, statement, namespaceId, modelName, field);\n\t\tif (destination.valueObject !== void 0) return refuse(`\"${destination.valueObject}\" is a value object; a --${verb} statement names a field of a model or a variant`);\n\t\treturn refuse(destination.reason, destination.kind === \"missing\" ? `A --${verb} statement names a field as the destination contract names it, Model.field or namespace.Model.field. Names match exactly, including case.` : destination.fix);\n\t}\n\tconst coordinate = {\n\t\t...destination.coordinate,\n\t\tfield\n\t};\n\tconst name = qualifiedField(coordinate);\n\tconst shown = fieldStatementText(state.destination.contract, coordinate);\n\tif (Object.hasOwn(destination.model.relations, field)) return refuse(`\"${shown}\" is a relation, which holds no values of its own to ${verb}`);\n\tconst destinationField = Object.hasOwn(destination.model.fields, field) ? destination.model.fields[field] : void 0;\n\tif (destinationField === void 0) return refuse(`the destination model \"${modelStatementText(state.destination.contract, destination.coordinate)}\" has no field \"${field}\" (fields: ${listed(fieldNames(destination.model))})`, `A --${verb} statement names the field as the destination contract names it: after --rename User.age:User.years, write --${verb} User.years. Names match exactly, including case.`);\n\tconst key = `${verb}:${name}`;\n\tif (state.fieldStatements.has(key)) return notOk(errorStatementInvalid(statement, `An earlier statement already ${verb}s \"${shown}\".`, `Give each field at most one --${verb} statement.`));\n\tif (verb === \"backfill\" && destinationField.nullable) return refuse(`the field \"${shown}\" is optional in the destination contract, so no existing row needs a value`, `${leaveOut} A --backfill statement fills a required field.`);\n\tconst counterpart = originCounterpart(state, destination.coordinate);\n\tif (counterpart === void 0) {\n\t\tconst model = modelStatementText(state.destination.contract, destination.coordinate);\n\t\treturn refuse(`the destination model \"${model}\" has no counterpart in the origin contract: the origin has no model \"${model}\" and no rename statement renames a model to it`, verb === \"convert\" ? `If the model was renamed, add --rename <old name>:${model}. A new model has no values to convert, so leave out ${flag}.` : `A new model has no existing rows to backfill. ${leaveOut}`);\n\t}\n\tconst originName = state.originOfRenamedField.get(name)?.field ?? field;\n\tconst originField = Object.hasOwn(counterpart.model.fields, originName) ? counterpart.model.fields[originName] : void 0;\n\tif (verb === \"convert\") {\n\t\tif (originField === void 0) {\n\t\t\tconst model = statement.field.slice(0, -1).join(\".\");\n\t\t\treturn refuse(`the origin model \"${modelStatementText(state.origin.contract, counterpart.coordinate)}\" has no field \"${field}\" (fields: ${listed(fieldNames(counterpart.model))}), and no rename statement renames a field to it`, `If the field was renamed, add --rename ${model}.<old name>:${model}.${field}. A new field has no values to convert, so leave out ${flag}.`);\n\t\t}\n\t\tif (sameType(originField, destinationField)) return refuse(`the field \"${shown}\" has the same type, ${fieldTypeText(destinationField)}, in the origin and destination contracts, so it has no values to convert`);\n\t} else if (originField !== void 0 && !originField.nullable) return refuse(`the field \"${shown}\" is already required in the origin contract, so every existing row has a value`);\n\tstate.fieldStatements.add(key);\n\treturn ok({\n\t\tkind: verb,\n\t\tentity: \"field\",\n\t\tfield: coordinate\n\t});\n}\n/** A delete that names what a rename of the same run renames: both cannot happen. */\nfunction deleteOfRenamed(deletes, renames) {\n\tfor (const deleted of deletes) {\n\t\tconst renamed = renames.find((rename) => rename.from.join(\".\") === deleted.text);\n\t\tif (renamed === void 0) continue;\n\t\treturn errorStatementInvalid(deleted, `--delete ${deleted.text} names what --rename ${renamed.text} renames in the same run, so it cannot also be deleted.`, `Leave out --delete ${deleted.text} to keep the data under its new name, or leave out --rename ${renamed.text} to delete it.`);\n\t}\n}\n/**\n* A delete that names what a rename among `statements` renames, which contradict each other: the\n* commands check it before they plan, since they hand the deletes to their questions, not here.\n*/\nfunction renamedAndDeleted(statements) {\n\tconst renames = statements.flatMap((entry) => {\n\t\tif (entry.verb !== \"rename\") return [];\n\t\tconst parsed = parseRenameStatement({\n\t\t\t...entry,\n\t\t\tverb: entry.verb\n\t\t});\n\t\treturn parsed.ok ? [parsed.value] : [];\n\t});\n\treturn deleteOfRenamed(statements.filter(({ verb }) => verb === \"delete\"), renames);\n}\nfunction namesFieldOnly(destination, names) {\n\tconst namespaces = destination.domain.namespaces;\n\tconst modelAtName = (namespaceId, model) => {\n\t\tconst namespace = Object.hasOwn(namespaces, namespaceId) ? namespaces[namespaceId] : void 0;\n\t\treturn namespace === void 0 ? void 0 : modelIn(namespace, model);\n\t};\n\tconst modelHasField = (namespaceId, model, field) => {\n\t\tconst found = modelAtName(namespaceId, model);\n\t\treturn found !== void 0 && hasField(found, field);\n\t};\n\tif (names.length === 3) return modelHasField(...names);\n\tif (names.length === 1) return false;\n\tconst [model, field] = names;\n\treturn Object.keys(namespaces).some((namespaceId) => modelHasField(namespaceId, model, field)) && modelAtName(model, field) === void 0;\n}\n/** The convert statements the destination contract reads only as a field, which need no origin contract to be told apart from a variant convert. */\nfunction fieldConvertsInDestination(statements, destination) {\n\treturn statements.filter((entry) => {\n\t\tif (entry.verb !== \"convert\") return false;\n\t\tconst parsed = parseFieldStatement({\n\t\t\t...entry,\n\t\t\tverb: entry.verb\n\t\t});\n\t\treturn parsed.ok && namesFieldOnly(destination, parsed.value.field);\n\t});\n}\n/**\n* Resolves the statements a user gave against the origin and destination contracts. Renames\n* resolve first, in the order given, so a convert or backfill statement can name a renamed field\n* by its new name wherever it is given; the result keeps the order given. A delete or allow\n* statement is checked and left out: it names what a plan would do to a subject, so it is matched\n* against the plan, and it needs no origin contract.\n*/\nfunction resolveStatements(input) {\n\tconst renames = [];\n\tconst deletes = [];\n\tconst fieldStatements = [];\n\tfor (const [index, entry] of input.statements.entries()) {\n\t\tif (entry.verb === \"delete\" || entry.verb === \"allow\") {\n\t\t\tconst statement = parseConsentStatement({\n\t\t\t\t...entry,\n\t\t\t\tverb: entry.verb\n\t\t\t});\n\t\t\tif (!statement.ok) return statement;\n\t\t\tif (entry.verb === \"delete\") deletes.push(entry);\n\t\t\tcontinue;\n\t\t}\n\t\tif (input.origin.kind === \"missing\") return notOk(errorStatementOriginUnknown(input.origin));\n\t\tif (entry.verb === \"rename\") {\n\t\t\tconst statement = parseRenameStatement({\n\t\t\t\t...entry,\n\t\t\t\tverb: entry.verb\n\t\t\t});\n\t\t\tif (!statement.ok) return statement;\n\t\t\trenames.push({\n\t\t\t\tindex,\n\t\t\t\tstatement: statement.value\n\t\t\t});\n\t\t} else {\n\t\t\tconst statement = parseFieldStatement({\n\t\t\t\t...entry,\n\t\t\t\tverb: entry.verb\n\t\t\t});\n\t\t\tif (!statement.ok) return statement;\n\t\t\tfieldStatements.push({\n\t\t\t\tindex,\n\t\t\t\tstatement: statement.value\n\t\t\t});\n\t\t}\n\t}\n\tif (input.origin.kind === \"missing\") return ok([]);\n\tconst state = {\n\t\torigin: {\n\t\t\tname: \"origin\",\n\t\t\tcontract: input.origin.contract\n\t\t},\n\t\tdestination: {\n\t\t\tname: \"destination\",\n\t\t\tcontract: input.destination\n\t\t},\n\t\toriginOfRenamedModel: /* @__PURE__ */ new Map(),\n\t\toriginOfRenamedField: /* @__PURE__ */ new Map(),\n\t\toriginOfRenamedValueObjectField: /* @__PURE__ */ new Map(),\n\t\toriginOfRenamedNamespace: /* @__PURE__ */ new Map(),\n\t\trenamedFrom: /* @__PURE__ */ new Set(),\n\t\trenamedTo: /* @__PURE__ */ new Set(),\n\t\tfieldStatements: /* @__PURE__ */ new Set()\n\t};\n\tconst resolved = [];\n\tconst parsedRenames = renames.map(({ statement }) => statement);\n\tconst contradicted = deleteOfRenamed(deletes, parsedRenames);\n\tif (contradicted !== void 0) return notOk(contradicted);\n\tfor (const [position, { index, statement }] of renames.entries()) {\n\t\tconst result = resolveStatement(state, statement, parsedRenames.slice(position + 1));\n\t\tif (!result.ok) return result;\n\t\tresolved.push({\n\t\t\tindex,\n\t\t\tstatement: result.value\n\t\t});\n\t}\n\tfor (const { index, statement } of fieldStatements) {\n\t\tconst result = resolveFieldStatement(state, statement);\n\t\tif (!result.ok) return result;\n\t\tresolved.push({\n\t\t\tindex,\n\t\t\tstatement: result.value\n\t\t});\n\t}\n\treturn ok([...resolved].sort((left, right) => left.index - right.index).map(({ statement }) => statement));\n}\n//#endregion\n//#region src/control-api/statements/plan-questions.ts\n/** The plan's renames, resolved; empty when there are none or they do not resolve. */\nfunction resolvedRenames(contracts) {\n\tconst renames = contracts.statements.filter((statement) => statement.verb === \"rename\");\n\tif (contracts.destination === void 0 || renames.length === 0) return [];\n\tconst resolved = resolveStatements({\n\t\tstatements: renames,\n\t\torigin: {\n\t\t\tkind: \"contract\",\n\t\t\tcontract: contracts.origin\n\t\t},\n\t\tdestination: contracts.destination\n\t});\n\treturn resolved.ok ? resolved.value : [];\n}\nfunction sameModel(left, right) {\n\treturn left.namespaceId === right.namespaceId && left.model === right.model;\n}\n/**\n* The model a rename statement of `contracts` gives `coordinate` in the destination, if any: a\n* rename of the model, or else a rename of its namespace, under which the model keeps its name when\n* the destination has it there.\n*/\nfunction renamedModel(coordinate, contracts) {\n\tconst renames = resolvedRenames(contracts);\n\tfor (const statement of renames) if (statement.kind === \"rename\" && statement.entity === \"model\" && sameModel(statement.from, coordinate)) return statement.to;\n\tfor (const statement of renames) if (statement.kind === \"rename\" && statement.entity === \"namespace\" && statement.from === coordinate.namespaceId) {\n\t\tconst moved = {\n\t\t\tnamespaceId: statement.to,\n\t\t\tmodel: coordinate.model\n\t\t};\n\t\treturn contracts.destination?.domain.namespaces[moved.namespaceId]?.models[moved.model] !== void 0 ? moved : void 0;\n\t}\n}\n/** The field of the origin contract at `coordinate`, as the destination names it after the plan's renames. */\nfunction destinationField(coordinate, contracts) {\n\tfor (const statement of resolvedRenames(contracts)) if (statement.kind === \"rename\" && statement.entity === \"field\" && sameModel(statement.from, coordinate) && statement.from.field === coordinate.field) return statement.to;\n\treturn {\n\t\t...renamedModel(coordinate, contracts) ?? coordinate,\n\t\tfield: coordinate.field\n\t};\n}\n/** An enum value under the namespace a namespace rename of `contracts` gives its enum, when the destination has the enum there. */\nfunction renamedEnumValue(value, contracts) {\n\tfor (const statement of resolvedRenames(contracts)) if (statement.kind === \"rename\" && statement.entity === \"namespace\" && statement.from === value.namespaceId) {\n\t\tconst renamed = {\n\t\t\t...value,\n\t\t\tnamespaceId: statement.to\n\t\t};\n\t\treturn contracts.destination?.domain.namespaces[statement.to]?.enum?.[value.enum] === void 0 ? void 0 : renamed;\n\t}\n}\n/** The fields of a value object in a contract's storage; `undefined` when the contract has no such value object. */\nfunction valueObjectFields(contract, field) {\n\tconst valueObject = valueObjectAt(contract.storage, {\n\t\tplane: \"storage\",\n\t\tnamespaceId: field.namespaceId,\n\t\tentityKind: \"valueObject\",\n\t\tentityName: field.valueObject\n\t});\n\treturn valueObject === void 0 ? void 0 : Object.keys(valueObject.fields);\n}\n/** A value object field under the namespace a namespace rename of `contracts` gives its value object, when the destination has the value object there. */\nfunction renamedValueObjectField(field, contracts) {\n\tfor (const statement of resolvedRenames(contracts)) if (statement.kind === \"rename\" && statement.entity === \"namespace\" && statement.from === field.namespaceId) {\n\t\tconst renamed = {\n\t\t\t...field,\n\t\t\tnamespaceId: statement.to\n\t\t};\n\t\treturn contracts.destination === void 0 || valueObjectFields(contracts.destination, renamed) === void 0 ? void 0 : renamed;\n\t}\n}\n/**\n* The subject as a statement names it: `Model` or `Model.field`, with the namespace when its\n* contract has several, or the storage name when no model stores what the operation is about. A\n* model the plan renames or moves, and a field of it, are named through the model's new name, as a\n* rename of the field is written.\n*/\nfunction subjectText(subject, contracts) {\n\tswitch (subject.kind) {\n\t\tcase \"model\": {\n\t\t\tconst renamed = renamedModel(subject, contracts);\n\t\t\treturn renamed === void 0 || contracts.destination === void 0 ? modelStatementText(contracts.origin, subject) : modelStatementText(contracts.destination, renamed);\n\t\t}\n\t\tcase \"field\": {\n\t\t\tconst renamed = renamedModel(subject, contracts);\n\t\t\treturn `${renamed === void 0 || contracts.destination === void 0 ? modelStatementText(contracts.origin, subject) : modelStatementText(contracts.destination, renamed)}.${subject.field}`;\n\t\t}\n\t\tcase \"enumValue\": {\n\t\t\tconst renamed = renamedEnumValue(subject, contracts);\n\t\t\treturn renamed === void 0 || contracts.destination === void 0 ? enumValueStatementText(contracts.origin, subject) : enumValueStatementText(contracts.destination, renamed);\n\t\t}\n\t\tcase \"valueObjectField\": {\n\t\t\tconst renamed = renamedValueObjectField(subject, contracts);\n\t\t\treturn renamed === void 0 || contracts.destination === void 0 ? valueObjectFieldStatementText(contracts.origin, subject) : valueObjectFieldStatementText(contracts.destination, renamed);\n\t\t}\n\t\tcase \"storage\": return subject.name;\n\t}\n}\n/**\n* The statement's description, written as its question names the subject: `delete field\n* \"User.nickname\"`, or `accept lossy type change of field \"User.age\"` for a delete that answers a\n* type change, which keeps the field and lets the database cast its values, cutting or rounding some.\n*/\nfunction consentDescription(verb, subject, text, loss) {\n\tconst kind = ENTITY_WORDS[subject.kind];\n\treturn verb === \"delete\" && loss === \"typeChange\" ? `accept lossy type change of ${kind} \"${text}\"` : `${verb} ${kind} \"${text}\"`;\n}\nconst DELETE_CASTS = \"--delete keeps the field and lets the database cast its values, which can change or lose some.\";\n/** What each answer to a type change does: `--convert`, where the command writes a migration to fill in, and `--delete`. */\nfunction typeChangeNote(loss, canConvert) {\n\tif (loss.loss !== \"typeChange\") return [];\n\treturn loss.subject.kind === \"field\" && canConvert ? [`--convert writes a conversion for you to fill in; ${DELETE_CASTS}`] : [DELETE_CASTS];\n}\nfunction lossText(subject, text, originKnown, loss) {\n\tswitch (subject.kind) {\n\t\tcase \"model\": return `would lose the data of model \"${text}\"`;\n\t\tcase \"field\": return loss === \"typeChange\" ? `would change the type of field \"${text}\" and can change or lose its values` : `would lose the values of field \"${text}\"`;\n\t\tcase \"enumValue\": return `would lose enum value \"${text}\" from the data that holds it`;\n\t\tcase \"valueObjectField\": return `would lose the values of value object field \"${text}\"`;\n\t\tcase \"storage\": {\n\t\t\tconst named = originKnown ? \"which no model of the origin contract stores\" : \"named by its storage name because the origin contract is unknown\";\n\t\t\tif (loss === \"typeChange\") return `would change the type of \"${text}\", ${named}, and can change or lose its values`;\n\t\t\treturn originKnown ? `would lose the data in \"${text}\", ${named}` : `would lose the data in \"${text}\", ${named}; --delete loses that data`;\n\t\t}\n\t}\n}\n/**\n* How to keep the data of a storage subject that was renamed, when the origin contract is unknown:\n* store the snapshot of the contract the database is at, as `MIGRATION.STATEMENT_ORIGIN_UNKNOWN`\n* advises, then answer with a rename. The refusal gives it once, on its first storage question. The\n* engine does not put the CLI's name in a question's text, so the steps name `prisma`.\n*/\nconst ORIGIN_SNAPSHOT_RECOVERY = [\"If it was renamed, keep its data instead: store the snapshot of the contract the database is at, then run this command again and answer with --rename.\", ...STORE_ORIGIN_SNAPSHOT_STEPS.map((step) => step.replaceAll(\"{bin}\", \"prisma\"))].join(\"\\n\");\nfunction sameCoordinate(statement, subject) {\n\tif (statement.kind !== \"rename\" || statement.entity === \"namespace\" || subject.kind === \"storage\") return false;\n\tif (statement.entity === \"valueObjectField\" || subject.kind === \"valueObjectField\") return statement.entity === \"valueObjectField\" && subject.kind === \"valueObjectField\" && statement.from.namespaceId === subject.namespaceId && statement.from.valueObject === subject.valueObject && statement.from.field === subject.field;\n\tif (statement.entity === \"enumValue\" || subject.kind === \"enumValue\") return statement.entity === \"enumValue\" && subject.kind === \"enumValue\" && statement.from.namespaceId === subject.namespaceId && statement.from.enum === subject.enum && statement.from.member === subject.member;\n\tconst { from } = statement;\n\tif (from.namespaceId !== subject.namespaceId || from.model !== subject.model) return false;\n\treturn subject.kind === \"field\" ? statement.entity === \"field\" && statement.from.field === subject.field : statement.entity === \"model\";\n}\nfunction namesSubject(verb, subject) {\n\treturn (text) => text === subject ? void 0 : `${verb} names \"${subject}\": --${verb} ${subject}.`;\n}\nfunction modelRenameAdvice(model, contracts) {\n\tconst name = modelStatementText(contracts.origin, model);\n\treturn `The destination contract has no model \"${name}\"; to keep the values instead, also pass --rename ${name}:<new model name>, naming the model that stores them now, and the question then offers to rename the field.`;\n}\n/** A rename as a statement is written: a field's new name keeps the model, `User.nickname:User.<new name>`. */\n/**\n* The member an enum value can only have been renamed to: the one member of the destination enum\n* that the origin enum does not have and no rename of the plan names.\n*/\nfunction onlyNewMember(subject, contracts) {\n\tconst value = renamedEnumValue(subject, contracts) ?? subject;\n\tconst originMembers = contracts.origin.domain.namespaces[subject.namespaceId]?.enum?.[subject.enum]?.members ?? [];\n\tconst renamedTo = new Set(resolvedRenames(contracts).flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"enumValue\" ? [statement.to.member] : []));\n\tconst added = (contracts.destination.domain.namespaces[value.namespaceId]?.enum?.[value.enum]?.members ?? []).filter(({ name }) => !renamedTo.has(name) && !originMembers.some((member) => member.name === name));\n\treturn added.length === 1 ? added[0]?.name : void 0;\n}\n/**\n* The field a value object field can only have been renamed to: the one field of the destination\n* value object that the origin one does not have and no rename of the plan names.\n*/\nfunction newValueObjectFields(subject, contracts) {\n\tconst field = renamedValueObjectField(subject, contracts) ?? subject;\n\tconst originFields = valueObjectFields(contracts.origin, subject) ?? [];\n\tconst renamedTo = new Set(resolvedRenames(contracts).flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"valueObjectField\" ? [statement.to.field] : []));\n\treturn (valueObjectFields(contracts.destination, field) ?? []).filter((name) => !renamedTo.has(name) && !originFields.includes(name));\n}\nfunction onlyNewValueObjectField(subject, contracts) {\n\tconst added = newValueObjectFields(subject, contracts);\n\treturn added.length === 1 ? added[0] : void 0;\n}\n/** The plan's backfill statements, resolved; empty when they do not resolve. */\nfunction resolvedBackfills(contracts) {\n\tif (!contracts.statements.some((statement) => statement.verb === \"backfill\")) return [];\n\tconst resolved = resolveStatements({\n\t\tstatements: contracts.statements,\n\t\torigin: {\n\t\t\tkind: \"contract\",\n\t\t\tcontract: contracts.origin\n\t\t},\n\t\tdestination: contracts.destination\n\t});\n\treturn resolved.ok ? resolved.value.filter((statement) => statement.kind === \"backfill\") : [];\n}\n/** The fields of a model's field's destination model that the origin model does not have and no rename of the plan names. */\nfunction newModelFields(subject, contracts) {\n\tconst model = renamedModel(subject, contracts) ?? subject;\n\tconst originFields = Object.keys(contracts.origin.domain.namespaces[subject.namespaceId]?.models[subject.model]?.fields ?? {});\n\tconst renamedTo = new Set(resolvedRenames(contracts).flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"field\" && sameModel(statement.to, model) ? [statement.to.field] : []));\n\treturn Object.keys(contracts.destination.domain.namespaces[model.namespaceId]?.models[model.model]?.fields ?? {}).filter((name) => !renamedTo.has(name) && !originFields.includes(name));\n}\n/**\n* The field a model's field can only have been renamed to: the one field of the destination model\n* that the origin model does not have and no rename of the plan names.\n*/\nfunction onlyNewModelField(subject, contracts) {\n\tconst added = newModelFields(subject, contracts);\n\treturn added.length === 1 ? added[0] : void 0;\n}\nfunction renameForm(subject, text, contracts) {\n\tif (subject.kind === \"storage\") return `${text}:<new name>`;\n\tif (subject.kind === \"model\") {\n\t\tconst renamedTo = resolvedRenames(contracts).flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"model\" ? [statement.to] : []);\n\t\tconst added = newVariantsOfBase(contracts.origin, contracts.destination, subject, renamedTo);\n\t\tconst [only] = added;\n\t\treturn `${text}:${only !== void 0 && added.length === 1 ? modelStatementText(contracts.destination, only) : \"<new name>\"}`;\n\t}\n\treturn `${text}:${text.slice(0, text.lastIndexOf(\".\"))}.${(subject.kind === \"enumValue\" ? onlyNewMember(subject, contracts) : subject.kind === \"valueObjectField\" ? onlyNewValueObjectField(subject, contracts) : onlyNewModelField(subject, contracts)) ?? \"<new name>\"}`;\n}\n/** The labels of the operations a question is about, as one phrase. */\nfunction labelsText(labels) {\n\tconst [first, ...rest] = [...new Set(labels)];\n\tconst lowered = rest.map((label) => label.charAt(0).toLowerCase() + label.slice(1));\n\tconst all = [first ?? \"\", ...lowered];\n\treturn all.length === 1 ? all.join(\"\") : `${all.slice(0, -1).join(\", \")} and ${all.at(-1)}`;\n}\n/** Whether a rename statement of the plan already gives the subject a new name. */\nfunction renamedByPlan(subject, contracts) {\n\tif (subject.kind === \"storage\") return false;\n\treturn resolvedRenames(contracts).some((statement) => sameCoordinate(statement, subject));\n}\n/** Whether the destination still has the subject's model or field, under the name a rename gives it. */\nfunction inDestination(subject, contracts) {\n\tif (subject.kind === \"storage\") return false;\n\tif (subject.kind === \"enumValue\") {\n\t\tconst value = renamedEnumValue(subject, contracts) ?? subject;\n\t\treturn (contracts.destination.domain.namespaces[value.namespaceId]?.enum?.[value.enum])?.members.some(({ name }) => name === subject.member) === true;\n\t}\n\tif (subject.kind === \"valueObjectField\") {\n\t\tconst field = renamedValueObjectField(subject, contracts) ?? subject;\n\t\treturn valueObjectFields(contracts.destination, field)?.includes(subject.field) === true;\n\t}\n\tconst model = renamedModel(subject, contracts) ?? subject;\n\tconst destinationModel = contracts.destination.domain.namespaces[model.namespaceId]?.models[model.model];\n\tif (destinationModel === void 0) return false;\n\treturn subject.kind === \"model\" || Object.hasOwn(destinationModel.fields, subject.field);\n}\n/** Checks a statement typed at a question against the plan's other statements. */\nfunction resolvesWith(statement, contracts) {\n\tconst resolved = resolveStatements({\n\t\tstatements: [...contracts.statements, statement],\n\t\torigin: {\n\t\t\tkind: \"contract\",\n\t\t\tcontract: contracts.origin\n\t\t},\n\t\tdestination: contracts.destination\n\t});\n\tif (!resolved.ok) return notOk(`${resolved.failure.message}. ${resolved.failure.why ?? \"\"}`.trim());\n\treturn ok(resolved.value.at(-1));\n}\nfunction enumMembers(contract, value) {\n\treturn contract.domain.namespaces[value.namespaceId]?.enum?.[value.enum]?.members ?? [];\n}\nfunction booleanEnum(contract, value) {\n\treturn enumMembers(contract, value).some((member) => typeof member.value === \"boolean\");\n}\n/**\n* Whether a command may say how to keep the subject's data: the target gives edits that keep it, or\n* it is an enum value whose member keeps its name with a new stored value, in an enum whose values\n* are not booleans, since a boolean enum has no unused value to pass through.\n*/\nfunction keepsDataByCommand(subject, edits, contracts) {\n\treturn edits.length > 0 || subject.kind === \"enumValue\" && inDestination(subject, contracts) && !booleanEnum(contracts.origin, subject);\n}\nfunction sameStoredValue(left, right) {\n\treturn left !== void 0 && JSON.stringify(left) === JSON.stringify(right);\n}\n/**\n* Whether an enum member takes the stored value of another member the destination still has, under\n* its name or the name a rename gives it, or gives its own stored value to one: the overlap for which\n* a target advises two migrations, since one rewrite writes a value another reads. A command's own\n* route for the members changes them all together.\n*/\nfunction sharesValueWithKeptMember(subject, contracts) {\n\tif (subject.kind !== \"enumValue\") return false;\n\tconst destinationEnum = renamedEnumValue(subject, contracts) ?? subject;\n\tconst renamedTo = new Map(resolvedRenames(contracts).flatMap((statement) => statement.kind === \"rename\" && statement.entity === \"enumValue\" && statement.from.namespaceId === subject.namespaceId && statement.from.enum === subject.enum ? [[statement.from.member, statement.to.member]] : []));\n\tconst destinationMembers = enumMembers(contracts.destination, destinationEnum);\n\tconst newValue = (member) => destinationMembers.find(({ name }) => name === (renamedTo.get(member) ?? member))?.value;\n\tconst originMembers = enumMembers(contracts.origin, subject);\n\tconst oldValue = originMembers.find(({ name }) => name === subject.member)?.value;\n\treturn originMembers.some((other) => other.name !== subject.member && newValue(other.name) !== void 0 && (sameStoredValue(newValue(subject.member), other.value) || sameStoredValue(oldValue, newValue(other.name))));\n}\n/**\n* The model of a field subject, under the name a rename of the plan gives it, when the destination\n* has no model of that name: a rename of the field cannot be written until a statement renames the\n* model.\n*/\nfunction missingFieldModel(subject, contracts) {\n\tif (subject.kind !== \"field\") return void 0;\n\tconst model = renamedModel(subject, contracts) ?? subject;\n\treturn contracts.destination.domain.namespaces[model.namespaceId]?.models[model.model] === void 0 ? model : void 0;\n}\n/** What changed for a variant whose discriminator value changed, and what `--convert` does about it. */\nfunction changedVariantNote(subject, contracts) {\n\tconst variant = changedVariant(subject, contracts);\n\tif (variant === void 0 || subject.kind !== \"model\") return [];\n\tconst from = variantValue(contracts.origin, subject);\n\tconst to = variantValue(contracts.destination, variant);\n\tconst convert = statementFlag({\n\t\tverb: \"convert\",\n\t\ttext: modelStatementText(contracts.destination, variant)\n\t});\n\treturn [`Its discriminator value changes from ${JSON.stringify(from)} to ${JSON.stringify(to)}: ${convert} rewrites the stored value to ${JSON.stringify(to)} and keeps the data.`];\n}\n/**\n* The variant a model subject is in the destination, under the name a rename of the plan gives it,\n* when it is a variant in both contracts whose discriminator value changed: a convert rewrites its\n* stored value instead of deleting its rows.\n*/\nfunction changedVariant(subject, contracts) {\n\tif (subject.kind !== \"model\") return void 0;\n\tconst model = renamedModel(subject, contracts) ?? subject;\n\treturn variantValueChanged(contracts.origin, subject, contracts.destination, model) ? model : void 0;\n}\n/**\n* The new required fields beside a removed field of a value object or of a model another model\n* embeds, in the destination contract, without those the run backfills: the fields of its value object\n* or model that the origin does not have and no rename of the plan names.\n*/\nfunction newRequiredFieldsBeside(subject, contracts) {\n\tif (inDestination(subject, contracts)) return [];\n\tconst backfills = contracts.canConvert ? resolvedBackfills(contracts) : [];\n\tif (subject.kind === \"valueObjectField\") {\n\t\tconst field = renamedValueObjectField(subject, contracts) ?? subject;\n\t\tconst valueObject = valueObjectAt(contracts.destination.storage, {\n\t\t\tplane: \"storage\",\n\t\t\tnamespaceId: field.namespaceId,\n\t\t\tentityKind: \"valueObject\",\n\t\t\tentityName: field.valueObject\n\t\t});\n\t\treturn newValueObjectFields(subject, contracts).filter((name) => valueObject?.fields[name]?.nullable === false && !backfills.some((backfill) => backfill.kind === \"backfill\" && backfill.entity === \"valueObjectField\" && backfill.field.namespaceId === field.namespaceId && backfill.field.valueObject === field.valueObject && backfill.field.field === name)).map((name) => ({\n\t\t\t...field,\n\t\t\tkind: \"valueObjectField\",\n\t\t\tfield: name\n\t\t}));\n\t}\n\tif (subject.kind !== \"field\") return [];\n\tif ((contracts.origin.domain.namespaces[subject.namespaceId]?.models[subject.model])?.owner === void 0) return [];\n\tconst model = renamedModel(subject, contracts) ?? subject;\n\tconst fields = contracts.destination.domain.namespaces[model.namespaceId]?.models[model.model]?.fields ?? {};\n\treturn newModelFields(subject, contracts).filter((name) => fields[name]?.nullable === false && !backfills.some((backfill) => backfill.kind === \"backfill\" && backfill.entity === \"field\" && sameModel(backfill.field, model) && backfill.field.field === name)).map((name) => ({\n\t\t...model,\n\t\tkind: \"field\",\n\t\tfield: name\n\t}));\n}\nfunction newFieldText(field, destination) {\n\tswitch (field.kind) {\n\t\tcase \"field\": return fieldStatementText(destination, field);\n\t\tcase \"valueObjectField\": return valueObjectFieldStatementText(destination, field);\n\t\tdefault: throw new InternalError(`A new required field is a field or a value object field, not a ${field.kind}`);\n\t}\n}\n/**\n* What a delete leaves in the new required fields beside a removed field of a value object or an\n* embedded model: a temporary value the plan gives, or none, which a backfill writes.\n*/\nfunction newRequiredFieldNote(subject, contracts) {\n\tconst added = newRequiredFieldsBeside(subject, contracts);\n\tif (added.length === 0) return [];\n\tconst filledKeys = new Set(contracts.temporaryValues.map((value) => migrationSubjectKey(value.subject)));\n\tconst filled = (each) => filledKeys.has(migrationSubjectKey(each));\n\tconst temporary = added.filter(filled).map((each) => newFieldText(each, contracts.destination));\n\tconst needed = added.filter((each) => !filled(each)).map((each) => newFieldText(each, contracts.destination));\n\tconst named = (fields) => `${fields.length === 1 ? \"field\" : \"fields\"} ${quotedList(fields)}`;\n\tconst backfills = needed.map((each) => statementFlag({\n\t\tverb: \"backfill\",\n\t\ttext: each\n\t})).join(\" \");\n\treturn [...temporary.length === 0 ? [] : [`If you answer delete, the existing objects get a temporary value in the new required ${named(temporary)}.`], ...needed.length === 0 ? [] : !contracts.canConvert ? [`If you answer delete, the new required ${named(needed)} ${needed.length === 1 ? \"gets\" : \"get\"} no temporary value: plan the change with migration plan ${backfills} to write ${needed.length === 1 ? \"its value\" : \"their values\"} in migration.ts.`] : needed.length === 1 ? [`If you answer delete, the new required ${named(needed)} still needs a value: add ${backfills} to write it in migration.ts.`] : [`If you answer delete, the new required ${named(needed)} still need a value: add ${backfills} to write them in migration.ts.`]];\n}\nfunction quotedList(items) {\n\tconst quoted = items.map((item) => `\"${item}\"`);\n\treturn quoted.length === 1 ? quoted.join(\"\") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\n/**\n* The question for one operation that would lose data. A field whose type changes may be converted\n* where the command writes a migration to fill in; the convert names the field as the destination\n* names it. A variant whose discriminator value changed may be converted by any command, since\n* the convert needs no code the user writes. A model or field the destination no longer has, and no rename of the plan renamed, may\n* be renamed instead of deleted; a rename is resolved against the two contracts after the plan's\n* other renames, and its old name must be the subject. Anything else, and data no model stores,\n* can only be deleted. A field whose model the destination names differently can be renamed only\n* after a statement renames the model, so the question says to pass one. The question ends with\n* the planner's advice on keeping the data, when it gives any, except for enum members that share\n* stored values when the command gives its own route for them.\n*/\nfunction dataLossQuestion(loss, contracts, edits = [], labels = [loss.label]) {\n\tconst subject = subjectText(loss.subject, contracts);\n\tconst deleteNames = namesSubject(\"delete\", subject);\n\tconst missingModel = missingFieldModel(loss.subject, contracts);\n\tconst keepData = contracts.keepDataEditAdvice === void 0 || !keepsDataByCommand(loss.subject, edits, contracts) ? void 0 : contracts.keepDataEditAdvice({\n\t\tsubject: loss.subject,\n\t\ttext: subject,\n\t\tedits\n\t}, contracts.keptSubjects ?? [{\n\t\tsubject: loss.subject,\n\t\ttext: subject,\n\t\tedits\n\t}]);\n\tconst commandRoutesSharedValues = keepData !== void 0 && keepData.ways.length > 0 && sharesValueWithKeptMember(loss.subject, contracts);\n\tconst lost = lossText(loss.subject, subject, contracts.originKnown, loss.loss);\n\tconst operations = [...new Set(labels)];\n\tconst advice = [\n\t\t...typeChangeNote(loss, contracts.canConvert),\n\t\t...changedVariantNote(loss.subject, contracts),\n\t\t...missingModel === void 0 ? [] : [modelRenameAdvice(missingModel, contracts)],\n\t\t...loss.keepDataAdvice === void 0 || commandRoutesSharedValues ? [] : [loss.keepDataAdvice],\n\t\t...keepData?.lead === void 0 ? [] : [keepData.lead],\n\t\t...keepData?.ways ?? [],\n\t\t...newRequiredFieldNote(loss.subject, contracts)\n\t];\n\tconst question = operations.length > 1 ? [\n\t\t`These operations ${lost}:`,\n\t\t...operations.map((label) => `- ${label}`),\n\t\t...advice.length === 0 ? [] : [advice.join(\" \")]\n\t].join(\"\\n\") : [`${labelsText(operations)} ${lost}.`, ...advice].join(\" \");\n\tif (loss.loss === \"typeChange\" && loss.subject.kind === \"field\") {\n\t\tif (!contracts.canConvert) return {\n\t\t\tquestion,\n\t\t\t...ifDefined(\"keepDataWays\", keepData?.ways),\n\t\t\tsubject,\n\t\t\tverbs: [\"delete\"],\n\t\t\tforms: {},\n\t\t\tvalidate: (_verb, text) => deleteNames(text)\n\t\t};\n\t\tconst field = destinationField(loss.subject, contracts);\n\t\tconst convert = fieldStatementText(contracts.destination, field);\n\t\treturn {\n\t\t\tquestion,\n\t\t\t...ifDefined(\"keepDataWays\", keepData?.ways),\n\t\t\tsubject,\n\t\t\tverbs: [\"convert\", \"delete\"],\n\t\t\tforms: { convert },\n\t\t\tvalidate: (verb, text) => {\n\t\t\t\tif (verb !== \"convert\") return deleteNames(text);\n\t\t\t\tif (text !== convert) return `convert names the field as the destination contract names it: ${statementFlag({\n\t\t\t\t\tverb: \"convert\",\n\t\t\t\t\ttext: convert\n\t\t\t\t})}.`;\n\t\t\t\tconst resolved = resolvesWith({\n\t\t\t\t\tverb: \"convert\",\n\t\t\t\t\ttext\n\t\t\t\t}, contracts);\n\t\t\t\treturn resolved.ok ? void 0 : resolved.failure;\n\t\t\t}\n\t\t};\n\t}\n\tconst variant = changedVariant(loss.subject, contracts);\n\tif (variant !== void 0) {\n\t\tconst convert = modelStatementText(contracts.destination, variant);\n\t\treturn {\n\t\t\tquestion,\n\t\t\t...ifDefined(\"keepDataWays\", keepData?.ways),\n\t\t\tsubject,\n\t\t\tverbs: [\"convert\", \"delete\"],\n\t\t\tforms: { convert },\n\t\t\tvalidate: (verb, text) => {\n\t\t\t\tif (verb !== \"convert\") return deleteNames(text);\n\t\t\t\tif (text !== convert) return `convert names the variant as the destination contract names it: ${statementFlag({\n\t\t\t\t\tverb: \"convert\",\n\t\t\t\t\ttext: convert\n\t\t\t\t})}.`;\n\t\t\t\tconst resolved = resolvesWith({\n\t\t\t\t\tverb: \"convert\",\n\t\t\t\t\ttext\n\t\t\t\t}, contracts);\n\t\t\t\treturn resolved.ok ? void 0 : resolved.failure;\n\t\t\t}\n\t\t};\n\t}\n\tconst renamable = missingModel === void 0 && loss.subject.kind !== \"storage\" && !inDestination(loss.subject, contracts) && !renamedByPlan(loss.subject, contracts);\n\treturn {\n\t\tquestion,\n\t\t...ifDefined(\"keepDataWays\", keepData?.ways),\n\t\tsubject,\n\t\tverbs: renamable ? [\"rename\", \"delete\"] : [\"delete\"],\n\t\tforms: renamable ? { rename: renameForm(loss.subject, subject, contracts) } : {},\n\t\tvalidate: (verb, text) => {\n\t\t\tif (verb !== \"rename\") return deleteNames(text);\n\t\t\tif (!text.includes(\":\")) return `rename needs the new name: type rename ${renameForm(loss.subject, subject, contracts)}.`;\n\t\t\tconst resolved = resolvesWith({\n\t\t\t\tverb: \"rename\",\n\t\t\t\ttext\n\t\t\t}, contracts);\n\t\t\tif (!resolved.ok) return resolved.failure;\n\t\t\treturn resolved.value !== void 0 && sameCoordinate(resolved.value, loss.subject) ? void 0 : `The rename's old name is not \"${subject}\". Write it as ${renameForm(loss.subject, subject, contracts)}.`;\n\t\t}\n\t};\n}\n/**\n* The question for one operation that changes who can read or write its subject's data: it widens\n* access, or changes it in a way that can go either way. Each such operation is its own question,\n* answered by its own `allow`.\n*/\nfunction accessChangeQuestion(change, contracts) {\n\tconst subject = subjectText(change.subject, contracts);\n\treturn {\n\t\tquestion: `${change.label} would ${change.widens ? \"widen\" : \"change\"} who can read and write its data.`,\n\t\tsubject,\n\t\tverbs: [\"allow\"],\n\t\tforms: {},\n\t\tvalidate: (_verb, text) => namesSubject(\"allow\", subject)(text)\n\t};\n}\nconst keyOf = (planned) => migrationSubjectKey(planned.subject);\n/**\n* The namespace of the model or field a subject names, when the planner removes that namespace: a\n* `delete` of the namespace answers the question too.\n*/\nfunction removedNamespaceOf(subject, namespaces) {\n\tif (subject.kind === \"storage\") return void 0;\n\treturn namespaces?.removed.includes(subject.namespaceId) === true ? subject.namespaceId : void 0;\n}\n/**\n* A `delete` answers for its subject; an `allow` for its one operation, known by its label and\n* subject, since a re-plan moves every operation's position.\n*/\nfunction questionKey(verb, entry) {\n\treturn verb === \"allow\" ? `allow:${entry.label}:${keyOf(entry)}` : `delete:${keyOf(entry)}`;\n}\nfunction checkAnswers(questions, answers) {\n\tconst plansAgain = answers.some((answer) => answer?.verb === \"rename\" || answer?.verb === \"convert\");\n\tconst open = answers.findIndex((answer) => answer === void 0);\n\tif (open !== -1 && !plansAgain) throw new InternalError(`answerQuestions left \"${questions[open]?.question}\" open, which it may do only beside a rename or convert answer that plans again.`, { cause: {\n\t\tquestions: questions.map(({ subject }) => subject),\n\t\tanswers\n\t} });\n\tif (answers.length !== questions.length) {\n\t\tconst noun = (count, word) => `${count} ${word}${count === 1 ? \"\" : \"s\"}`;\n\t\tthrow new InternalError(`answerQuestions gave ${noun(answers.length, \"answer\")} for ${noun(questions.length, \"question\")}; answer each question in order, or throw to refuse.`, { cause: {\n\t\t\tquestions: questions.map(({ subject }) => subject),\n\t\t\tanswers\n\t\t} });\n\t}\n\tquestions.forEach((question, index) => {\n\t\tconst answer = answers[index];\n\t\tif (answer === void 0) return;\n\t\tconst cause = { cause: {\n\t\t\tquestion: question.subject,\n\t\t\tverbs: question.verbs,\n\t\t\tanswer\n\t\t} };\n\t\tif (!question.verbs.includes(answer.verb)) throw new InternalError(`answerQuestions answered \"${question.question}\" with ${answer.verb}, which it does not accept; it accepts ${question.verbs.join(\" or \")}.`, cause);\n\t\tconst rejected = question.validate(answer.verb, answer.text);\n\t\tif (rejected !== void 0) throw new InternalError(`answerQuestions answered \"${question.question}\" wrongly: ${rejected}`, cause);\n\t});\n}\nfunction namespaceRenameAdvice(removed, added) {\n\tconst [only] = added;\n\tif (only === void 0) return void 0;\n\tconst lead = `If namespace \"${removed}\" was renamed, --rename ${removed}:`;\n\tif (added.length === 1) return `${lead}${only} renames it instead.`;\n\treturn `${lead}<new namespace> renames it instead, where <new namespace> is ${`${added.slice(0, -1).join(\", \")} or ${added.at(-1)}`}.`;\n}\n/**\n* The first question about a model or field of a namespace the destination contract no longer has\n* says that a `delete` of the namespace answers every question about it, and, when the destination\n* adds a namespace, how to rename the namespace instead.\n*/\nfunction withNamespaceDeleteOnFirstQuestion(questions, added) {\n\tconst told = /* @__PURE__ */ new Set();\n\treturn questions.map((question) => {\n\t\tconst { removedNamespace } = question;\n\t\tif (removedNamespace === void 0 || told.has(removedNamespace)) return question;\n\t\ttold.add(removedNamespace);\n\t\tconst lines = [\n\t\t\tquestion.question,\n\t\t\t`--delete ${removedNamespace} answers this question and every other about a model or field of namespace \"${removedNamespace}\", which the destination contract no longer has.`,\n\t\t\tnamespaceRenameAdvice(removedNamespace, added)\n\t\t];\n\t\treturn {\n\t\t\t...question,\n\t\t\tquestion: lines.filter((line) => line !== void 0).join(\"\\n\")\n\t\t};\n\t});\n}\n/**\n* A question about a model or field of a namespace the destination removed, which also accepts the\n* namespace's own answers: a `delete` of the namespace, or a `rename` of it to another one.\n*/\nfunction acceptingNamespaceAnswers(question, removedNamespace, contracts) {\n\tif (removedNamespace === void 0) return question;\n\tconst namespaceAnswer = (verb, text) => {\n\t\tif (verb === \"delete\") return text === removedNamespace ? \"delete\" : void 0;\n\t\tif (verb !== \"rename\") return void 0;\n\t\tconst resolved = resolvesWith({\n\t\t\tverb,\n\t\t\ttext\n\t\t}, contracts);\n\t\treturn resolved.ok && resolved.value?.kind === \"rename\" && resolved.value.entity === \"namespace\" && resolved.value.from === removedNamespace ? \"rename\" : void 0;\n\t};\n\treturn {\n\t\t...question,\n\t\tremovedNamespace,\n\t\tnamespaceAnswer,\n\t\tvalidate: (verb, text) => namespaceAnswer(verb, text) !== void 0 ? void 0 : question.validate(verb, text)\n\t};\n}\nfunction withRecoveryOnFirstStorageQuestion(asked, recoveryApplies) {\n\tconst first = recoveryApplies ? asked.findIndex(({ loss }) => loss.subject.kind === \"storage\") : -1;\n\treturn asked.map(({ question }, index) => index === first ? {\n\t\t...question,\n\t\tquestion: `${question.question}\\n${ORIGIN_SNAPSHOT_RECOVERY}`\n\t} : question);\n}\n/**\n* Asks about every operation of a plan that would lose data and, when `askAccess`, every one that\n* would change access, until each is answered. A `delete` or `allow` text in `preAnswers`, or\n* `consentAll` for its verb, answers its question without asking. A rename or convert typed at the\n* prompt is a statement the plan did not have, so the plan is made again with every statement, and\n* the operation it answered must be gone; a loss the new plan has on the same subject, such as a\n* type change on the renamed field, is asked in the next round. The first round asks even when\n* nothing is in question, so a statement no question consumed is refused before anything is done.\n*/\nasync function askPlanQuestions(input) {\n\tlet plan = input.plan;\n\tlet statements = input.statements;\n\tconst consented = /* @__PURE__ */ new Map();\n\tconst usedPreAnswers = /* @__PURE__ */ new Set();\n\tfor (let round = 0;; round += 1) {\n\t\tconst contracts = {\n\t\t\torigin: input.origin,\n\t\t\toriginKnown: input.originKnown,\n\t\t\tdestination: input.destination,\n\t\t\tcanConvert: input.canConvert,\n\t\t\tstatements,\n\t\t\t...ifDefined(\"keepDataEditAdvice\", input.keepDataEditAdvice),\n\t\t\ttemporaryValues: plan.temporaryValues\n\t\t};\n\t\tconst pending = (verb, planned) => [...new Map(planned.filter((entry) => !consented.has(questionKey(verb, entry))).map((entry) => [questionKey(verb, entry), entry])).values()];\n\t\tconst consent = (verb, entry, text) => consented.set(questionKey(verb, entry), {\n\t\t\tverb,\n\t\t\tsubject: entry.subject,\n\t\t\ttext,\n\t\t\toperationIndex: entry.operationIndex,\n\t\t\tloss: verb === \"delete\" && \"loss\" in entry ? entry.loss : void 0\n\t\t});\n\t\tfor (const [verb, entries] of [[\"delete\", pending(\"delete\", plan.dataLoss)], [\"allow\", input.askAccess ? pending(\"allow\", plan.accessChanges) : []]]) {\n\t\t\tconst texts = entries.map((entry) => subjectText(entry.subject, contracts));\n\t\t\tconst given = input.preAnswers.filter((statement) => statement.verb === verb && (verb === \"delete\" || !usedPreAnswers.has(statement)));\n\t\t\tconst matched = matchConsents(verb, entries.map((entry, index) => ({\n\t\t\t\ttext: texts[index] ?? \"\",\n\t\t\t\tremovedNamespace: removedNamespaceOf(entry.subject, plan.namespaces)\n\t\t\t})), given.map(({ text }) => text));\n\t\t\tfor (const position of matched.used) {\n\t\t\t\tconst statement = given[position];\n\t\t\t\tif (statement !== void 0) usedPreAnswers.add(statement);\n\t\t\t}\n\t\t\tentries.forEach((entry, index) => {\n\t\t\t\tif (input.consentAll[verb] || matched.answered.has(index)) consent(verb, entry, texts[index] ?? \"\");\n\t\t\t});\n\t\t}\n\t\tconst losses = pending(\"delete\", plan.dataLoss);\n\t\tconst sameSubject = (loss) => plan.dataLoss.filter((entry) => questionKey(\"delete\", entry) === questionKey(\"delete\", loss));\n\t\tconst editsOf = (loss) => sameSubject(loss).flatMap((entry) => entry.keepDataEdit === void 0 ? [] : [entry.keepDataEdit]);\n\t\tconst roundContracts = {\n\t\t\t...contracts,\n\t\t\tkeptSubjects: losses.filter((loss) => keepsDataByCommand(loss.subject, editsOf(loss), contracts)).map((loss) => ({\n\t\t\t\tsubject: loss.subject,\n\t\t\t\ttext: subjectText(loss.subject, contracts),\n\t\t\t\tedits: editsOf(loss)\n\t\t\t}))\n\t\t};\n\t\tconst accessChanges = input.askAccess ? pending(\"allow\", plan.accessChanges) : [];\n\t\tif (losses.length + accessChanges.length === 0 && round > 0) break;\n\t\tconst questions = [...withNamespaceDeleteOnFirstQuestion(withRecoveryOnFirstStorageQuestion(losses.map((loss) => ({\n\t\t\tloss,\n\t\t\tquestion: acceptingNamespaceAnswers(dataLossQuestion(loss, roundContracts, editsOf(loss), sameSubject(loss).map(({ label }) => label)), removedNamespaceOf(loss.subject, plan.namespaces), contracts)\n\t\t})), !input.originKnown), plan.namespaces?.added ?? []), ...accessChanges.map((change) => accessChangeQuestion(change, contracts))];\n\t\tconst answers = await input.answer(questions);\n\t\tcheckAnswers(questions, answers);\n\t\tconst typed = [];\n\t\tanswers.forEach((answer, index) => {\n\t\t\tconst entry = [...losses, ...accessChanges][index];\n\t\t\tconst question = questions[index];\n\t\t\tif (answer === void 0 || entry === void 0 || question === void 0) return;\n\t\t\tif (answer.verb === \"rename\" || answer.verb === \"convert\") typed.push({\n\t\t\t\tstatement: {\n\t\t\t\t\tverb: answer.verb,\n\t\t\t\t\ttext: answer.text\n\t\t\t\t},\n\t\t\t\tloss: entry,\n\t\t\t\tofNamespace: question.namespaceAnswer?.(answer.verb, answer.text) === \"rename\"\n\t\t\t});\n\t\t\telse consent(answer.verb, entry, question.subject);\n\t\t});\n\t\tif (typed.length === 0) {\n\t\t\tif (losses.length + accessChanges.length === 0) break;\n\t\t\tcontinue;\n\t\t}\n\t\tconst given = new Set(statements.map(({ verb, text }) => `${verb} ${text}`));\n\t\tfor (const { statement } of typed) {\n\t\t\tconst key = `${statement.verb} ${statement.text}`;\n\t\t\tif (given.has(key)) continue;\n\t\t\tgiven.add(key);\n\t\t\tstatements = [...statements, statement];\n\t\t}\n\t\tconst replanned = await input.replan(statements);\n\t\tif (!replanned.ok) return replanned;\n\t\tplan = replanned.value;\n\t\tfor (const entry of plan.accessChanges) {\n\t\t\tconst allowed = consented.get(questionKey(\"allow\", entry));\n\t\t\tif (allowed !== void 0) consented.set(questionKey(\"allow\", entry), {\n\t\t\t\t...allowed,\n\t\t\t\toperationIndex: entry.operationIndex\n\t\t\t});\n\t\t}\n\t\tconst operationOf = (entry) => `${entry.label}:${keyOf(entry)}`;\n\t\tconst stillPlanned = new Set(plan.dataLoss.map(operationOf));\n\t\tconst unresolved = typed.find(({ loss, ofNamespace }) => !ofNamespace && stillPlanned.has(operationOf(loss)));\n\t\tif (unresolved !== void 0) return notOk(errorStatementDidNotResolveLoss(unresolved.statement, subjectText(unresolved.loss.subject, contracts)));\n\t}\n\tconst unused = input.preAnswers.filter((statement) => !usedPreAnswers.has(statement));\n\tif (unused.length > 0) return notOk(errorStatementAnswersNoQuestion(unused, questionSubjects(plan, input.askAccess, {\n\t\t...input,\n\t\tstatements\n\t})));\n\treturn ok({\n\t\tplan,\n\t\tstatements,\n\t\tconsented: [...consented.values()]\n\t});\n}\nfunction questionSubjects(plan, askAccess, contracts) {\n\tconst subjects = [...plan.dataLoss, ...askAccess ? plan.accessChanges : []].map((entry) => subjectText(entry.subject, contracts));\n\treturn [...new Set(subjects)];\n}\n/**\n* Refuses the `delete` and `allow` statements that name no subject a plan asks about, without\n* asking anything: a run that only plans still says which statements would consent to nothing.\n* The plan carries out its other statements, so they are not checked here.\n*/\nfunction refuseUnusedConsents(input) {\n\tconst subjects = questionSubjects(input.plan, true, input.contracts);\n\tconst unused = [];\n\tfor (const [verb, entries] of [[\"delete\", input.plan.dataLoss], [\"allow\", input.plan.accessChanges]]) {\n\t\tconst questions = entries.map((entry) => ({\n\t\t\ttext: subjectText(entry.subject, input.contracts),\n\t\t\tremovedNamespace: verb === \"delete\" ? removedNamespaceOf(entry.subject, input.plan.namespaces) : void 0\n\t\t}));\n\t\tconst given = input.statements.filter((statement) => statement.verb === verb);\n\t\tunused.push(...matchConsents(verb, verb === \"delete\" ? [...new Map(questions.map((q) => [q.text, q])).values()] : questions, given.map(({ text }) => text)).unused);\n\t}\n\tconst answersNothing = unused.filter(({ alreadyAnsweredBy }) => alreadyAnsweredBy === void 0);\n\tif (answersNothing.length > 0) return notOk(errorStatementAnswersNoQuestion(answersNothing, subjects));\n\treturn unused.length === 0 ? ok(void 0) : notOk(errorConsentUnused(unused, subjects));\n}\n/**\n* The subjects the `delete` and `allow` flags a run was given consent to, or every subject of a\n* verb `consentAll` names: what an apply would consent to without asking, which a dry run reports.\n*/\nfunction givenConsents(input) {\n\tconst consented = [];\n\tfor (const [verb, planned] of [[\"delete\", input.plan.dataLoss], [\"allow\", input.plan.accessChanges]]) {\n\t\tconst entries = [...new Map(planned.map((entry) => [questionKey(verb, entry), entry])).values()];\n\t\tconst texts = entries.map((entry) => subjectText(entry.subject, input.contracts));\n\t\tconst matched = matchConsents(verb, entries.map((entry, index) => ({\n\t\t\ttext: texts[index] ?? \"\",\n\t\t\tremovedNamespace: removedNamespaceOf(entry.subject, input.plan.namespaces)\n\t\t})), input.statements.filter((statement) => statement.verb === verb).map(({ text }) => text));\n\t\tentries.forEach((entry, index) => {\n\t\t\tif (!input.consentAll[verb] && !matched.answered.has(index)) return;\n\t\t\tconsented.push({\n\t\t\t\tverb,\n\t\t\t\tsubject: entry.subject,\n\t\t\t\ttext: texts[index] ?? \"\",\n\t\t\t\toperationIndex: entry.operationIndex,\n\t\t\t\tloss: verb === \"delete\" && \"loss\" in entry ? entry.loss : void 0\n\t\t\t});\n\t\t});\n\t}\n\treturn consented;\n}\n/**\n* Matches `--delete` or `--allow` flags to questions as an apply does, whatever their order. A\n* `delete` naming a subject answers every question about it; then a `delete` naming a removed\n* namespace answers the questions of the namespace still open. An `allow` answers one operation,\n* so each question takes a flag of its own. A flag no question took is unused, and says what had\n* already answered its question, if anything had. Every path that matches consent flags asks this,\n* so a dry run and an apply refuse the same flags.\n*/\nfunction matchConsents(verb, questions, texts) {\n\tconst answered = /* @__PURE__ */ new Map();\n\tconst used = /* @__PURE__ */ new Set();\n\tconst take = (index, position) => {\n\t\tconst text = texts[position];\n\t\tif (text === void 0) return;\n\t\tanswered.set(index, text);\n\t\tused.add(position);\n\t};\n\tquestions.forEach((question, index) => {\n\t\tconst position = texts.findIndex((text, at) => text === question.text && (verb === \"delete\" || !used.has(at)));\n\t\tif (position !== -1) take(index, position);\n\t});\n\tif (verb === \"delete\") questions.forEach((question, index) => {\n\t\tif (answered.has(index) || question.removedNamespace === void 0) return;\n\t\tconst position = texts.indexOf(question.removedNamespace);\n\t\tif (position !== -1) take(index, position);\n\t});\n\treturn {\n\t\tanswered,\n\t\tused,\n\t\tunused: texts.flatMap((text, position) => {\n\t\t\tif (used.has(position)) return [];\n\t\t\treturn [{\n\t\t\t\tverb,\n\t\t\t\ttext,\n\t\t\t\talreadyAnsweredBy: questions.find((question) => question.text === text) !== void 0 ? {\n\t\t\t\t\tkind: \"subject\",\n\t\t\t\t\tsubject: text,\n\t\t\t\t\tflag: {\n\t\t\t\t\t\tverb,\n\t\t\t\t\t\ttext\n\t\t\t\t\t}\n\t\t\t\t} : questions.some(({ removedNamespace }) => removedNamespace === text) ? {\n\t\t\t\t\tkind: \"namespace\",\n\t\t\t\t\tnamespace: text\n\t\t\t\t} : void 0\n\t\t\t}];\n\t\t})\n\t};\n}\n//#endregion\n//#region src/control-api/statements/report-applied-statements.ts\n/**\n* `operationOffset` is the number of operations the result lists before the plan that applied the\n* statements, so that each position indexes the result's `operations`.\n*/\nfunction reportAppliedStatements(applied, fromContract, contract, operationOffset) {\n\treturn applied.map((entry) => ({\n\t\tverb: entry.statement.kind,\n\t\tstatement: migrationStatementJson(entry.statement),\n\t\toperationIndexes: entry.operationIndexes.map((index) => operationOffset + index),\n\t\tdescription: describeMigrationStatement(entry.statement, fromContract ?? contract, contract)\n\t}));\n}\n/** A delete or allow statement a plan applied, with the positions of the operations it consented to. */\nfunction reportConsentStatement(consented, operationIndexes) {\n\treturn {\n\t\tverb: consented.verb,\n\t\tstatement: {\n\t\t\tkind: consented.verb,\n\t\t\tsubject: migrationSubjectJson(consented.subject)\n\t\t},\n\t\toperationIndexes,\n\t\tdescription: consentDescription(consented.verb, consented.subject, consented.text, consented.loss)\n\t};\n}\n//#endregion\n//#region src/control-api/statements/temporary-values.ts\nfunction statementText(subject, destination) {\n\tswitch (subject.kind) {\n\t\tcase \"field\": return fieldStatementText(destination, subject);\n\t\tcase \"valueObjectField\": return valueObjectFieldStatementText(destination, subject);\n\t\tdefault: return;\n\t}\n}\n/** The fields of `values` named as `destination` names them, each field and value once however many columns it fills; a column no field stores is left out. */\nfunction reportTemporaryValues(values, destination) {\n\tconst reports = values.flatMap(({ subject, value }) => {\n\t\tconst field = statementText(subject, destination);\n\t\treturn field === void 0 ? [] : [{\n\t\t\tfield,\n\t\t\tvalue\n\t\t}];\n\t});\n\treturn reports.filter((report, index) => reports.findIndex(({ field, value }) => field === report.field && value === report.value) === index);\n}\n//#endregion\n//#region src/control-api/operations/changed-storage-entities.ts\n/** The storage entities that differ between two contracts, as a result reports them. */\nfunction changedStorageEntities(fromContract, toContract) {\n\treturn changedElementCoordinates(fromContract?.storage ?? null, toContract.storage).map(withoutUnboundNamespaceId);\n}\n/** The sentence that names what changed in storage, such as `What changed: value object \"public.Home\".` */\nfunction whatChangedSentence(fromContract, toContract) {\n\tconst changed = changedElementCoordinates(fromContract?.storage ?? null, toContract.storage);\n\treturn changed.length === 0 ? `No storage entity changed; what changed is ${changedStorageKeys(fromContract, toContract).join(\", \") || \"outside the storage entities\"}.` : `What changed: ${changed.map(storageEntityText).join(\", \")}.`;\n}\nfunction withoutUnboundNamespaceId({ namespaceId, ...rest }) {\n\treturn namespaceId === UNBOUND_NAMESPACE_ID ? rest : {\n\t\tnamespaceId,\n\t\t...rest\n\t};\n}\n/** The top-level storage keys whose content differs between two contracts, such as `storage.types`, in key order. */\nfunction changedStorageKeys(fromContract, toContract) {\n\tconst plain = (storage) => typeof storage === \"object\" && storage !== null ? JSON.parse(JSON.stringify(storage)) : {};\n\tconst from = plain(fromContract?.storage);\n\tconst to = plain(toContract.storage);\n\treturn [.../* @__PURE__ */ new Set([...Object.keys(from), ...Object.keys(to)])].filter((key) => key !== \"storageHash\").filter((key) => canonicalStringify(from[key]) !== canonicalStringify(to[key])).sort().map((key) => `storage.${key}`);\n}\nfunction storageEntityText(coordinate) {\n\tconst name = coordinate.namespaceId === UNBOUND_NAMESPACE_ID ? coordinate.entityName : `${coordinate.namespaceId}.${coordinate.entityName}`;\n\treturn `${kindInWords(coordinate.entityKind)} \"${name}\"`;\n}\n/** An entity kind as words, such as `value object` for `valueObject`. */\nfunction kindInWords(entityKind) {\n\treturn entityKind.replace(/[A-Z]/g, (letter) => ` ${letter.toLowerCase()}`);\n}\n//#endregion\n//#region src/utils/extension-pack-inputs.ts\n/**\n* Project the CLI's `Config.extensions` array into the canonical\n* {@link ExtensionPackInput} shape. The single `as ExtensionPackLike`\n* structural cast in the CLI lives inside this function.\n*/\nfunction toExtensionInputs(extensions) {\n\treturn extensions.map((raw) => {\n\t\tconst pack = raw;\n\t\tif (pack.contractSpace === void 0) return {\n\t\t\tid: pack.id,\n\t\t\ttargetId: pack.targetId\n\t\t};\n\t\treturn {\n\t\t\tid: pack.id,\n\t\t\ttargetId: pack.targetId,\n\t\t\tcontractSpace: {\n\t\t\t\tcontractJson: pack.contractSpace.contractJson,\n\t\t\t\theadRef: pack.contractSpace.headRef,\n\t\t\t\tmigrations: pack.contractSpace.migrations ?? []\n\t\t\t}\n\t\t};\n\t});\n}\n/**\n* Minimal aggregate-loader projection that extracts `id` + `targetId`\n* from raw extension pack descriptors **without invoking any\n* `contractSpace` accessor**. Inspects the own-property descriptor so\n* that getter-backed `contractSpace` declarations are detected but\n* never called.\n*\n* Inclusion semantics match {@link toDeclaredExtensions}: a data\n* property whose value is explicitly `undefined` is treated as \"no\n* contract-space declaration\" and skipped, mirroring the\n* `pack.contractSpace === undefined` check used on canonicalised\n* inputs. Prototype-chain `contractSpace` properties (no own\n* descriptor) are also skipped.\n*\n* This variant must be used by `buildContractSpaceAggregate` so that\n* the aggregate path (including `db verify`) never reads\n* `contractSpace.contractJson` from extension descriptors — the loader\n* always reads the contract from on-disk artefacts instead.\n*/\nfunction toDeclaredExtensionsFromRaw(extensions) {\n\tconst entries = [];\n\tfor (const raw of extensions) {\n\t\tif (typeof raw !== \"object\" || raw === null) continue;\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(raw, \"contractSpace\");\n\t\tif (descriptor === void 0) continue;\n\t\tif (\"value\" in descriptor && descriptor.value === void 0) continue;\n\t\tconst pack = raw;\n\t\tentries.push({\n\t\t\tid: pack.id,\n\t\t\ttargetId: pack.targetId\n\t\t});\n\t}\n\treturn entries;\n}\n//#endregion\n//#region src/control-api/operations/contract-space-aggregate-loader.ts\nconst CONTRACT_SPACES_DOCS_URL = \"https://pris.ly/contract-spaces\";\nfunction contractSpaceViolationError(summary, options) {\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", summary, {\n\t\twhy: options.why,\n\t\tfix: options.fix,\n\t\tdocsUrl: CONTRACT_SPACES_DOCS_URL,\n\t\tmeta: { violations: options.violations }\n\t});\n}\n/**\n* Build the `MIGRATION.CONTRACT_SPACE_VIOLATION` structured-error envelope for a contract-space\n* target mismatch. Shared between the declared-extension precheck (the\n* descriptor's configured target disagrees with the project target) and\n* the on-disk-contract check surfaced by `checkIntegrity`.\n*/\nfunction targetMismatchError(spaceId, expected, actual) {\n\treturn contractSpaceViolationError(`Contract-space target mismatch for \"${spaceId}\"`, {\n\t\twhy: `Space \"${spaceId}\" targets \"${actual}\" but the project's adapter targets \"${expected}\".`,\n\t\tfix: \"Update the extension descriptor to target the configured database, or change the project adapter.\",\n\t\tviolations: [{\n\t\t\tkind: \"targetMismatch\",\n\t\t\tspaceId,\n\t\t\texpected,\n\t\t\tactual\n\t\t}]\n\t});\n}\n/**\n* Human-readable detail for an integrity violation, used as the `why`\n* of the `integrityFailure` envelope. Mirrors the messages the prior\n* throw-on-load loader produced so downstream consumers see the same\n* text for the same on-disk state.\n*/\nfunction describeIntegrityViolation(violation) {\n\tswitch (violation.kind) {\n\t\tcase \"hashMismatch\": return `Migration \"${violation.dirName}\" stored hash \"${violation.stored}\" does not match computed hash \"${violation.computed}\".`;\n\t\tcase \"providedInvariantsMismatch\": return `Migration \"${violation.dirName}\" providedInvariants in migration.json disagrees with ops.json.`;\n\t\tcase \"packageUnloadable\": return `Migration \"${violation.dirName}\" could not be loaded: ${violation.detail}`;\n\t\tcase \"sameSourceAndTarget\": return `Migration \"${violation.dirName}\" has source equal to target (${violation.hash}) with no data invariant — a true no-op self-edge.`;\n\t\tcase \"headRefMissing\": return `Head ref \\`refs/head.json\\` is missing for contract space \"${violation.spaceId}\".`;\n\t\tcase \"headRefNotInGraph\": return `Head ref ${violation.hash} for contract space \"${violation.spaceId}\" is not present in the migration graph.`;\n\t\tcase \"refUnreadable\": return `Ref \"${violation.refName}\" for contract space \"${violation.spaceId}\" is unreadable: ${violation.detail}`;\n\t\tcase \"duplicateMigrationHash\": return `Multiple migrations in space \"${violation.spaceId}\" share migrationHash \"${violation.migrationHash}\" (${violation.dirNames.join(\", \")}).`;\n\t\tdefault: {\n\t\t\tconst spaceId = \"spaceId\" in violation ? violation.spaceId : \"*\";\n\t\t\treturn `Integrity violation \"${violation.kind}\" for contract space \"${spaceId}\".`;\n\t\t}\n\t}\n}\n/**\n* Map the integrity violations `checkIntegrity` reports into a single\n* CLI structured-error envelope, preserving the error codes the prior\n* throw-on-load loader emitted: `MIGRATION.CONTRACT_SPACE_LAYOUT_VIOLATION`\n* (layout drift, bundled) and `MIGRATION.CONTRACT_SPACE_VIOLATION` (target /\n* disjointness / contract-validation / structural integrity). Returns\n* `null` when there is nothing to refuse on.\n*\n* Precedence reproduces the prior loader's first-failure ordering:\n* layout drift first (every offence bundled into one envelope), then\n* target mismatch, then disjointness, then a contract-validation\n* failure, then any remaining structural integrity violation.\n*/\nfunction layoutFix(layout, migrationsDir) {\n\tconst spaceDir = `\\`${migrationsDir}/<space>/\\``;\n\treturn [layout.some((v) => v.kind === \"declaredButUnmigrated\") ? `Run \\`prisma contract emit\\` or \\`prisma migration plan\\` to write the pinned files of each declared extension pack under ${spaceDir}.` : [], layout.some((v) => v.kind === \"orphanSpaceDir\") ? `For a directory no extension declares, declare its extension in \\`extensions\\` or remove ${spaceDir}.` : []].flat().join(\" \");\n}\nfunction mapIntegrityViolations(violations, migrationsDir) {\n\tif (violations.length === 0) return null;\n\tconst layout = violations.filter((v) => v.kind === \"orphanSpaceDir\" || v.kind === \"declaredButUnmigrated\");\n\tif (layout.length > 0) {\n\t\tconst lines = layout.map((v) => `- [${v.kind}] ${v.spaceId}`);\n\t\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_LAYOUT_VIOLATION\", layout.length === 1 ? \"Contract-space layout violation detected\" : `Contract-space layout violations detected (${layout.length})`, {\n\t\t\twhy: `The on-disk \\`${migrationsDir}/\\` directory and your \\`extensions\\` declaration are not in agreement.\\n${lines.join(\"\\n\")}`,\n\t\t\tfix: layoutFix(layout, migrationsDir),\n\t\t\tdocsUrl: CONTRACT_SPACES_DOCS_URL,\n\t\t\tmeta: { violations: layout }\n\t\t});\n\t}\n\tconst targetMismatch = violations.find((v) => v.kind === \"targetMismatch\");\n\tif (targetMismatch && targetMismatch.kind === \"targetMismatch\") return targetMismatchError(targetMismatch.spaceId, targetMismatch.expected, targetMismatch.actual);\n\tconst disjointness = violations.find((v) => v.kind === \"disjointness\");\n\tif (disjointness && disjointness.kind === \"disjointness\") return contractSpaceViolationError(`Contract-space disjointness violation: storage element \"${disjointness.element}\" claimed by multiple spaces`, {\n\t\twhy: `Spaces ${disjointness.claimedBy.map((s) => `\"${s}\"`).join(\", \")} all claim the storage element \"${disjointness.element}\". Each storage element must be owned by exactly one contract space.`,\n\t\tfix: \"Update the conflicting contracts so each storage element is claimed by exactly one space.\",\n\t\tviolations: [disjointness]\n\t});\n\tconst contractUnreadable = violations.find((v) => v.kind === \"contractUnreadable\");\n\tif (contractUnreadable && contractUnreadable.kind === \"contractUnreadable\") return contractSpaceViolationError(`Contract-space contract validation failed for \"${contractUnreadable.spaceId}\"`, {\n\t\twhy: contractUnreadable.detail,\n\t\tfix: \"Re-emit the extension contract with `{bin} contract emit`, or fix the extension pack descriptor producing the invalid contract.\",\n\t\tviolations: [contractUnreadable]\n\t});\n\tconst refUnreadable = violations.find((v) => v.kind === \"refUnreadable\");\n\tif (refUnreadable && refUnreadable.kind === \"refUnreadable\") return errorInvalidRefFile(refUnreadable.path, refUnreadable.detail, refUnreadable.policyIssues);\n\tconst structural = violations[0];\n\treturn contractSpaceViolationError(`Contract-space integrity failure for \"${\"spaceId\" in structural ? structural.spaceId : \"*\"}\"`, {\n\t\twhy: describeIntegrityViolation(structural),\n\t\tfix: `Re-emit the affected migration package(s) or restore the on-disk \\`${migrationsDir}\\` directory from version control.`,\n\t\tviolations: [structural]\n\t});\n}\nfunction declaredExtensionsFromInputs(extensions) {\n\treturn toDeclaredExtensionsFromRaw(extensions);\n}\n/**\n* Reject extension descriptors whose configured target disagrees with\n* the project target before any on-disk read.\n*/\nfunction refuseDeclaredExtensionTargetMismatch(inputs) {\n\tfor (const declared of declaredExtensionsFromInputs(inputs.extensions)) if (declared.targetId !== inputs.targetId) return targetMismatchError(declared.id, inputs.targetId, declared.targetId);\n\treturn null;\n}\n/**\n* Load the tolerant {@link ContractSpaceAggregate} once at the CLI\n* surface. Construction never throws on disk content; callers query\n* {@link ContractSpaceAggregate.app} / extension facets instead of\n* re-reading `migrations/`.\n*/\nasync function loadContractSpaceAggregateForCli(inputs) {\n\tconst targetFailure = refuseDeclaredExtensionTargetMismatch(inputs);\n\tif (targetFailure) return notOk(targetFailure);\n\treturn ok(await loadContractSpaceAggregate({\n\t\tmigrationsDir: inputs.migrationsDir,\n\t\tdeserializeContract: inputs.deserializeContract,\n\t\tappContract: inputs.appContract,\n\t\t...ifDefined(\"verifySnapshotContent\", inputs.verifySnapshotContent)\n\t}));\n}\n/**\n* Run `checkIntegrity` on a loaded aggregate and map violations into\n* the contract-space refusal envelope, or return `null` when the model\n* is acceptable for the requested check scope.\n*/\nfunction refuseContractSpaceIntegrity(aggregate, options, migrationsDir) {\n\treturn mapIntegrityViolations(aggregate.checkIntegrity(options), migrationsDir);\n}\nconst PACKAGE_CORRUPTION_KINDS = /* @__PURE__ */ new Set([\n\t\"hashMismatch\",\n\t\"providedInvariantsMismatch\",\n\t\"packageUnloadable\"\n]);\n/**\n* Reader-subset integrity refusal for `migration status`: package\n* corruptions only (`hashMismatch`, `providedInvariantsMismatch`,\n* `packageUnloadable`).\n*/\nfunction refusePackageCorruptionOnAggregate(aggregate, migrationsDir) {\n\treturn mapIntegrityViolations(aggregate.checkIntegrity().filter((v) => PACKAGE_CORRUPTION_KINDS.has(v.kind)), migrationsDir);\n}\n/**\n* Construct the tolerant {@link ContractSpaceAggregate} at the CLI\n* surface and apply the explicit integrity refusal.\n*\n* App-space migration packages are read from `migrations/<app>/` by the\n* loader itself; callers no longer thread them through.\n*/\nasync function buildContractSpaceAggregate(inputs) {\n\tconst declaredExtensions = declaredExtensionsFromInputs(inputs.extensions);\n\tconst loaded = await loadContractSpaceAggregateForCli(inputs);\n\tif (!loaded.ok) return loaded;\n\tconst failure = refuseContractSpaceIntegrity(loaded.value, {\n\t\tdeclaredExtensions,\n\t\tcheckContracts: true\n\t}, inputs.migrationsDir);\n\tif (failure) return notOk(failure);\n\treturn ok(loaded.value);\n}\n/**\n* Build a minimal app {@link Contract} carrying only the project's\n* contract-identity (`storage.storageHash` + `target` / `targetFamily`)\n* when the real `contract.json` is absent or undeserializable.\n*\n* `loadContractSpaceAggregate` requires an `appContract` to synthesise the\n* app space's head ref from its storage hash. Read commands query only that\n* hash and the target — never `models` — so an empty-`models` stand-in is\n* sufficient for them. It is *not* a valid contract for any consumer that\n* reads schema, which is why this is confined to the read-aggregate path.\n*/\nfunction appContractStandInFromIdentity(args) {\n\treturn blindCast({\n\t\tstorage: { storageHash: args.contractHash },\n\t\tschemaVersion: \"0.0.0\",\n\t\ttarget: args.targetId,\n\t\ttargetFamily: args.targetFamily,\n\t\tmodels: {},\n\t\tprofileHash: EMPTY_CONTRACT_HASH\n\t});\n}\nasync function loadContractRawSafely(config) {\n\ttry {\n\t\tconst raw = await readFile(resolveContractPath(config), \"utf-8\");\n\t\treturn JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Tolerant {@link ContractSpaceAggregate} assembly for read-only CLI\n* commands. No integrity gate — callers query `aggregate.app` (or other\n* facets) without re-reading `migrations/`. When `contract.json` is absent\n* or undeserializable, the app contract falls back to an identity-only\n* stand-in ({@link appContractStandInFromIdentity}), so these commands\n* load without requiring a readable contract.\n*/\nasync function buildReadAggregate(config, options) {\n\tlet contractHash = EMPTY_CONTRACT_HASH;\n\ttry {\n\t\tcontractHash = (await readContractEnvelope(config)).storageHash;\n\t} catch {}\n\ttry {\n\t\tconst contractRawForAggregate = await loadContractRawSafely(config);\n\t\tconst stack = createControlStack(config);\n\t\tconst familyInstance = config.family.create(stack);\n\t\tconst deserializeContract = (json) => familyInstance.deserializeContract(json);\n\t\tlet appContractForLoad = appContractStandInFromIdentity({\n\t\t\tcontractHash,\n\t\t\ttargetId: config.target.id,\n\t\t\ttargetFamily: config.target.familyId\n\t\t});\n\t\tif (contractRawForAggregate !== null) try {\n\t\t\tappContractForLoad = deserializeContract(contractRawForAggregate);\n\t\t} catch {}\n\t\tconst loaded = await loadContractSpaceAggregateForCli({\n\t\t\ttargetId: config.target.id,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\tappContract: appContractForLoad,\n\t\t\textensions: config.extensions ?? [],\n\t\t\tdeserializeContract,\n\t\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent ?? snapshotVerifierFor(config))\n\t\t});\n\t\tif (!loaded.ok) return loaded;\n\t\treturn ok({\n\t\t\taggregate: loaded.value,\n\t\t\tcontractHash,\n\t\t\tstorageNameOf: (operation) => familyInstance.storageNameOf(operation),\n\t\t\tmarkerLocation: familyInstance.markerLocation\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => `Failed to read migrations directory: ${message}`));\n\t}\n}\n//#endregion\n//#region src/control-api/operations/database-policies.ts\n/**\n* The database's policies in force: what the application space's marker records, filled from\n* the defaults. A marker whose recorded policies are not valid is a corrupt marker row.\n*/\nfunction databasePoliciesInForce(markers, appSpaceId, markerLocation) {\n\tconst inForce = databasePoliciesOf(markers.get(appSpaceId));\n\tif (!inForce.ok) throw errorMarkerPoliciesCorrupt({\n\t\twhy: inForce.failure.why,\n\t\tspace: appSpaceId,\n\t\tmarkerLocation\n\t});\n\treturn inForce.value;\n}\nconst STRATEGY_OF = {\n\t\"db migrate\": \"migrate\",\n\t\"db update\": \"reconcile\",\n\t\"db sign\": \"reconcile\"\n};\n/**\n* Checks a run against the database's policies, once, before it plans anything. A ref whose\n* declared policies differ refuses the run unless `permitPolicyChange` consents to recording\n* them. Then the change policy the run would leave in force must permit the command.\n*/\nfunction checkRunPolicies(args) {\n\tconst { appSpaceId, inForce, ref } = args;\n\tconst declared = ref?.policies;\n\tconst differences = declared === void 0 ? [] : databasePolicyDifferences(declared, inForce);\n\tif (ref !== void 0 && differences.length > 0 && !args.permitPolicyChange) return notOk(errorPolicyMismatch({\n\t\tspaceId: appSpaceId,\n\t\trefName: ref.name,\n\t\tdifferences\n\t}));\n\tconst toWrite = declared !== void 0 && differences.length > 0 ? {\n\t\tpolicies: withDeclaredDatabasePolicies(inForce, declared),\n\t\tdifferences\n\t} : void 0;\n\tconst required = STRATEGY_OF[args.command];\n\tconst declaresChange = toWrite !== void 0 && declared?.change !== void 0;\n\tconst change = toWrite?.policies.change ?? inForce.change;\n\tif (!change.includes(required)) return notOk(errorChangePolicyForbids({\n\t\tspaceId: appSpaceId,\n\t\tcommand: args.command,\n\t\tchange,\n\t\tsource: declaresChange && ref !== void 0 ? {\n\t\t\tkind: \"ref\",\n\t\t\trefName: ref.name\n\t\t} : { kind: \"marker\" },\n\t\ttargetHash: args.targetHash,\n\t\tref: ref === void 0 ? void 0 : {\n\t\t\tname: ref.name,\n\t\t\tpermitPolicyChange: args.permitPolicyChange\n\t\t},\n\t\tinvocation: args.invocation\n\t}));\n\treturn ok({\n\t\tinForce,\n\t\ttoWrite\n\t});\n}\n//#endregion\n//#region src/control-api/operations/migration-helpers.ts\n/**\n* Strips operation objects to their public shape (id, label, operationClass).\n* Used at the API boundary to avoid leaking internal fields (precheck, execute, postcheck, etc.).\n*/\nfunction stripOperations(operations) {\n\treturn operations.map((op) => ({\n\t\tid: op.id,\n\t\tlabel: op.label,\n\t\toperationClass: op.operationClass\n\t}));\n}\n//#endregion\n//#region src/control-api/operations/no-invariant-path.ts\n/**\n* The path from `fromHash` to `targetHash` when invariants are ignored, or none. A space with no\n* marker starts from the empty contract's hash, so the path is found even then.\n*/\nfunction structuralPathOf(graph, fromHash, targetHash) {\n\tconst structural = findPathWithDecision(graph, fromHash, targetHash, { required: /* @__PURE__ */ new Set() });\n\treturn structural.kind === \"ok\" ? structural.decision.selectedPath.map((edge) => ({\n\t\tdirName: edge.dirName,\n\t\tmigrationHash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tinvariants: edge.invariants\n\t})) : [];\n}\n/**\n* `MIGRATION.NO_INVARIANT_PATH` for a space whose graph reaches `targetHash` from `fromHash` but\n* provides none of `missing`, naming the path that ignores invariants.\n*/\nfunction noInvariantPathError(input) {\n\treturn errorNoInvariantPath({\n\t\t...input.refName !== void 0 ? { refName: input.refName } : {},\n\t\trequired: input.required,\n\t\tmissing: input.missing,\n\t\tstructuralPath: structuralPathOf(input.graph, input.fromHash, input.targetHash)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/run-migration.ts\n/**\n* Span id emitted via `onProgress` for the run phase. Stable\n* identifier consumed by the structured-output renderer and by tests.\n*/\nconst RUN_SPAN_ID = \"apply\";\nfunction edgeOfOperation(edges, operationIndex) {\n\tlet end = 0;\n\treturn edges.find((edge) => {\n\t\tend += edge.operationCount;\n\t\treturn operationIndex < end;\n\t});\n}\nfunction failedTypeChangeReport(change, field) {\n\treturn change.by === \"cast\" ? {\n\t\tfield,\n\t\tby: \"cast\",\n\t\treason: change.reason\n\t} : {\n\t\tfield,\n\t\tby: \"conversion\",\n\t\treason: change.reason\n\t};\n}\nfunction rowsHoldingValueReport(fact, contract) {\n\tconst enumValue = enumValueCoordinateFromJson(fact.enumValue);\n\treturn {\n\t\tenumValue: enumValueStatementText(contract, enumValue),\n\t\tenumName: modelStatementText(contract, {\n\t\t\tnamespaceId: enumValue.namespaceId,\n\t\t\tmodel: enumValue.enum\n\t\t}),\n\t\tvalue: fact.value,\n\t\trows: fact.rows,\n\t\t...ifDefined(\"keepDataEdit\", fact.keepDataEdit)\n\t};\n}\nfunction rowsFailingCheckReport(fact) {\n\tif (fact === void 0) return void 0;\n\tconst { operationIndex: _operationIndex, ...report } = fact;\n\treturn report;\n}\n/** What the runner said blocked the failed operation, named as the advice names it. */\nfunction failureReports(failure, resolutions) {\n\tconst resolution = resolutions.find(({ spaceId }) => spaceId === failure.meta.failingSpace);\n\tif (resolution === void 0) return {};\n\tconst fieldText = (field) => subjectText(field, {\n\t\torigin: resolution.entry.destinationContract,\n\t\tstatements: []\n\t});\n\tconst { failedTypeChange, rowsWithoutValue, rowsHoldingValue, rowsFailingCheck } = failure.meta;\n\tconst operationIndex = failedTypeChange?.operationIndex ?? rowsWithoutValue?.[0]?.operationIndex ?? rowsHoldingValue?.[0]?.operationIndex ?? rowsFailingCheck?.operationIndex;\n\tconst edge = operationIndex !== void 0 ? edgeOfOperation(resolution.entry.migrationEdges, operationIndex) : schemaCheckIssues(failure) !== void 0 ? resolution.entry.migrationEdges.at(-1) : void 0;\n\treturn {\n\t\t...ifDefined(\"failedTypeChange\", failedTypeChange === void 0 ? void 0 : failedTypeChangeReport(failedTypeChange, fieldText(failedTypeChange.field))),\n\t\t...ifDefined(\"rowsWithoutValue\", rowsWithoutValue?.map(({ field, reason, rows }) => ({\n\t\t\tfield: field === void 0 ? void 0 : fieldText(field),\n\t\t\treason,\n\t\t\trows,\n\t\t\tdiscriminator: field?.kind === \"field\" && isDiscriminatorField(resolution.entry.destinationContract, field)\n\t\t}))),\n\t\t...ifDefined(\"rowsHoldingValue\", rowsHoldingValue?.map((fact) => rowsHoldingValueReport(fact, resolution.entry.destinationContract))),\n\t\t...ifDefined(\"rowsFailingCheck\", rowsFailingCheckReport(rowsFailingCheck)),\n\t\t...ifDefined(\"failedMigration\", edge === void 0 ? void 0 : {\n\t\t\tspaceId: resolution.spaceId,\n\t\t\tedge\n\t\t})\n\t};\n}\nfunction failedPrecheckOf(failure, resolutions) {\n\tconst check = failure.meta.failedCheck;\n\tif (check === void 0 || check.phase !== \"precheck\") return;\n\tconst resolution = resolutions.find(({ spaceId }) => spaceId === failure.meta.failingSpace);\n\treturn {\n\t\toperationId: check.operationId,\n\t\tdescription: check.description,\n\t\tplanStartsFromMarker: resolution !== void 0 && resolution.entry.plan.origin !== null\n\t};\n}\n/** The facts the advice for `failure` names, found in the plans of `resolutions`. */\nfunction runnerFailureFacts(failure, resolutions) {\n\treturn {\n\t\t...failureReports(failure, resolutions),\n\t\t...ifDefined(\"failedPrecheck\", failedPrecheckOf(failure, resolutions))\n\t};\n}\n/**\n* Runner-driving tail shared by every run caller — `db init`,\n* `db update`, and `migrate`. Consumes already-resolved per-space\n* plans (the planner-vs-replay distinction is owned by the caller) and\n* dispatches them to the runner in canonical order.\n*\n* The runner writes each space's marker as the last step of applying that\n* space, so this primitive does not advance markers separately — by the time\n* `execute` returns ok, every space's marker has been advanced to its plan's\n* destination. A failure is returned as the runner reported it; its `why`\n* says whether the database changed.\n*\n* Span emission (`spanStart 'apply'` / `spanEnd 'apply'`) is owned here\n* so callers don't have to duplicate it; the `action` field on each\n* progress event is taken from the caller's `action` argument.\n*/\nasync function runMigration(inputs) {\n\tconst { aggregate, perSpacePlans, applyOrder, driver, familyInstance, migrations, frameworkComponents, policy, databasePolicies, expectedDatabasePolicies, action, onProgress } = inputs;\n\tconst orderedResolutions = collectOrdered(applyOrder, perSpacePlans);\n\tconst runner = migrations.createRunner(familyInstance);\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: RUN_SPAN_ID,\n\t\tlabel: progressLabelForAction(action)\n\t});\n\tconst perSpaceOptions = orderedResolutions.map((r) => ({\n\t\tspace: r.spaceId,\n\t\tplan: r.entry.plan,\n\t\tdriver,\n\t\tdestinationContract: r.entry.destinationContract,\n\t\tpolicy,\n\t\t...r.spaceId === aggregate.app.spaceId ? ifDefined(\"databasePolicies\", databasePolicies) : {},\n\t\tframeworkComponents,\n\t\tmigrationEdges: r.entry.migrationEdges,\n\t\tstrictVerification: false\n\t}));\n\tconst runnerResult = await runner.execute({\n\t\tdriver,\n\t\tperSpaceOptions,\n\t\t...ifDefined(\"expectedDatabasePolicies\", expectedDatabasePolicies)\n\t});\n\tif (!runnerResult.ok) {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: RUN_SPAN_ID,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\treturn notOk(runnerResult.failure);\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: RUN_SPAN_ID,\n\t\toutcome: \"ok\"\n\t});\n\treturn ok({\n\t\torderedResolutions,\n\t\ttotalOpsPlanned: runnerResult.value.perSpaceResults.reduce((sum, r) => sum + r.value.operationsPlanned, 0),\n\t\ttotalOpsExecuted: runnerResult.value.perSpaceResults.reduce((sum, r) => sum + r.value.operationsExecuted, 0),\n\t\tperSpace: buildPerSpaceBreakdown(orderedResolutions, aggregate.app.spaceId, { includeMarkers: true })\n\t});\n}\n/**\n* Project the planner's per-space resolutions into the\n* `PerSpaceExecutionEntry[]` shape the CLI surfaces.\n*\n* `includeMarkers` is `true` for apply-mode (each space's marker is\n* the `destination.storageHash` of its plan, which the runner\n* advances as the last step of applying each space) and `false`\n* for plan-mode (no marker has been written yet).\n*\n* Exported alongside {@link runMigration} so plan-mode callers can\n* assemble the same per-space block without going through the runner.\n*/\nfunction buildPerSpaceBreakdown(orderedResolutions, appSpaceId, options) {\n\treturn orderedResolutions.map((r) => {\n\t\tconst operations = r.entry.displayOps.map((op) => ({\n\t\t\tid: op.id,\n\t\t\tlabel: op.label,\n\t\t\toperationClass: op.operationClass\n\t\t}));\n\t\tconst base = {\n\t\t\tspaceId: r.spaceId,\n\t\t\tkind: r.spaceId === appSpaceId ? \"app\" : \"extension\",\n\t\t\toperations\n\t\t};\n\t\tif (!options.includeMarkers) return base;\n\t\treturn {\n\t\t\t...base,\n\t\t\tmarker: { storageHash: r.entry.plan.destination.storageHash }\n\t\t};\n\t});\n}\n/**\n* Materialise the `applyOrder` ordering into resolved per-space\n* entries. Throws if the planner output is missing a contract space listed\n* in `applyOrder` — a wiring bug that should never reach runtime.\n*\n* Exported so callers building their own success envelopes after a\n* plan-mode dispatch can replay the same ordering.\n*/\nfunction collectOrdered(applyOrder, perSpace) {\n\treturn applyOrder.map((spaceId) => {\n\t\tconst entry = perSpace.get(spaceId);\n\t\tif (!entry) throw new InternalError(`planner output missing per-space plan for \"${spaceId}\"`);\n\t\treturn {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t};\n\t});\n}\n/**\n* Action-appropriate label for the `spanStart` event the run\n* primitive emits. `runMigration` is shared by `db init`, `db update`,\n* and `migrate`; the span label tracks the user-visible action\n* so structured-progress output reads naturally for each surface.\n*/\nfunction progressLabelForAction(action) {\n\tswitch (action) {\n\t\tcase \"dbInit\": return \"Initialising database across spaces\";\n\t\tcase \"dbUpdate\": return \"Updating database across spaces\";\n\t\tcase \"migrate\": return \"Running migration plan across spaces\";\n\t}\n}\n//#endregion\n//#region src/control-api/operations/db-run.ts\n/**\n* Span IDs emitted via `onProgress` during the run flow.\n* Stable identifiers consumed by the structured-output renderer and by\n* tests asserting on span ids. The `apply` span itself is owned by\n* the {@link runMigration} primitive — only the introspect / plan\n* spans are emitted directly here.\n*/\nconst SPAN_IDS$1 = {\n\tintrospect: \"introspect\",\n\tplan: \"plan\"\n};\n/**\n* Loader → planner → runner pipeline shared by `db init` and `db update`.\n*\n* The pipeline:\n*\n* 1. **Load**: build a {@link ContractSpaceAggregate} from the descriptor\n* set + on-disk on-disk artefacts. Any layout / drift / disjointness /\n* integrity violation short-circuits with a structured error.\n* 2. **Read DB state**: marker rows (`familyInstance.readAllMarkers`)\n* + introspected schema (`familyInstance.introspect`).\n* 3. **Plan**: {@link planMigration} chooses `resolveRecordedPath` vs\n* `planFromDiff` per space according to `callerPolicy.ignoreGraphFor`.\n* The app space is forced through `planFromDiff` (today's daily-driver\n* behaviour); every extension space walks its on-disk graph via\n* `resolveRecordedPath`.\n* 4. **Apply** (when `mode === 'apply'`): every per-space `MigrationPlan`\n* feeds into the runner's `execute`. On a target whose DDL is\n* transactional a failure rolls back every space's writes; otherwise\n* the operations that already ran stay applied.\n*/\nasync function executeRun(options) {\n\tconst { driver, adapter, familyInstance, contract, mode, migrations, frameworkComponents, migrationsDir, extensions, targetId, policy, action, onProgress } = options;\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId,\n\t\tmigrationsDir,\n\t\tappContract: contract,\n\t\textensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent)\n\t});\n\tif (!loaded.ok) throw loaded.failure;\n\tconst aggregate = loaded.value;\n\tconst markerRows = await familyInstance.readAllMarkers({ driver });\n\tlet checkedPolicies;\n\tif (options.action === \"dbUpdate\") {\n\t\tconst checked = checkRunPolicies({\n\t\t\tcommand: \"db update\",\n\t\t\tappSpaceId: aggregate.app.spaceId,\n\t\t\tinForce: databasePoliciesInForce(markerRows, aggregate.app.spaceId, familyInstance.markerLocation),\n\t\t\tref: options.ref,\n\t\t\tpermitPolicyChange: options.permitPolicyChange,\n\t\t\ttargetHash: contract.storage.storageHash,\n\t\t\tinvocation: options.invocation\n\t\t});\n\t\tif (!checked.ok) return notOk(checked.failure);\n\t\tcheckedPolicies = checked.value;\n\t}\n\tconst policiesToWrite = checkedPolicies?.toWrite;\n\tconst appOrigin = options.action === \"dbUpdate\" ? await readAppOrigin({\n\t\tmarker: markerRows.get(aggregate.app.spaceId) ?? null,\n\t\tmigrationsDir,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent)\n\t}) : void 0;\n\tconst fromContract = appOrigin?.contract ?? null;\n\tconst statementTexts = options.action === \"dbUpdate\" ? options.statements : [];\n\tconst resolveRenames = (texts) => {\n\t\tif (texts.length === 0 || appOrigin === void 0) return [];\n\t\tconst resolved = resolveStatements({\n\t\t\tstatements: texts,\n\t\t\torigin: appOrigin.origin,\n\t\t\tdestination: contract\n\t\t});\n\t\tif (!resolved.ok) throw resolved.failure;\n\t\treturn resolved.value;\n\t};\n\tconst consentTexts = statementTexts.filter((statement) => !isPlannedStatement(statement));\n\tconst fieldConverts = appOrigin?.origin.kind === \"missing\" ? fieldConvertsInDestination(statementTexts, contract) : [];\n\tconst firstResolved = fieldConverts.length > 0 ? [] : resolveRenames(statementTexts);\n\tconst needsMigrationFile = fieldConverts.length > 0 ? fieldConverts : statementsNeedingMigrationFile(statementTexts, firstResolved);\n\tif (needsMigrationFile.length > 0) {\n\t\tconst markerHash = markerRows.get(aggregate.app.spaceId)?.storageHash;\n\t\tthrow errorStatementNeedsMigrationFile(statementTexts, needsMigrationFile, options.invocation, aggregate.app.packages.some(({ metadata }) => metadata.to === markerHash) ? markerHash : void 0);\n\t}\n\tif (mode === \"apply\") {\n\t\tconst orphanMarkerError = detectOrphanMarkers(aggregate, markerRows, familyInstance.markerLocation);\n\t\tif (orphanMarkerError !== null) throw orphanMarkerError;\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS$1.introspect,\n\t\tlabel: \"Introspecting database schema\"\n\t});\n\tconst schemaIR = await familyInstance.introspect({\n\t\tdriver,\n\t\tcontract: collectAggregateNamespaces(aggregate, fromContract)\n\t});\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS$1.introspect,\n\t\toutcome: \"ok\"\n\t});\n\tconst plan = async (texts, resolved) => {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: SPAN_IDS$1.plan,\n\t\t\tlabel: \"Planning migration\"\n\t\t});\n\t\tconst planned = await planMigration({\n\t\t\taggregate,\n\t\t\tcurrentDBState: {\n\t\t\t\tmarkersBySpaceId: markerRows,\n\t\t\t\tschemaIntrospection: schemaIR\n\t\t\t},\n\t\t\tadapter,\n\t\t\tmigrations,\n\t\t\tframeworkComponents,\n\t\t\tcallerPolicy: { ignoreGraphFor: /* @__PURE__ */ new Set([aggregate.app.spaceId]) },\n\t\t\toperationPolicy: policy,\n\t\t\tappSpace: {\n\t\t\t\tfromContract,\n\t\t\t\tstatements: resolved\n\t\t\t},\n\t\t\tstorageNameOf: (operation) => familyInstance.storageNameOf(operation)\n\t\t});\n\t\tif (!planned.ok) {\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: SPAN_IDS$1.plan,\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\treturn notOk({ refused: mapPlannerError(planned.failure, {\n\t\t\t\taction,\n\t\t\t\taggregate,\n\t\t\t\tmarkerRows,\n\t\t\t\tinvocation: options.invocation,\n\t\t\t\tstatements: texts,\n\t\t\t\tresolved\n\t\t\t}) });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS$1.plan,\n\t\t\toutcome: \"ok\"\n\t\t});\n\t\tconst orderedResolutions = collectOrdered(planned.value.applyOrder, planned.value.perSpace);\n\t\tconst subjects = action === \"dbUpdate\" ? subjectsAcrossSpaces(orderedResolutions) : {\n\t\t\tdataLoss: [],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tconst operations = orderedResolutions.flatMap((r) => r.entry.displayOps);\n\t\tconst labelled = (entries) => entries.map((entry) => ({\n\t\t\t...entry,\n\t\t\tlabel: operations[entry.operationIndex]?.label ?? JSON.stringify(entry.subject)\n\t\t}));\n\t\treturn ok({\n\t\t\tplanned: planned.value,\n\t\t\torderedResolutions,\n\t\t\tsubjects,\n\t\t\tdataLoss: labelled(subjects.dataLoss).map((entry) => ({\n\t\t\t\t...entry,\n\t\t\t\tloss: entry.loss\n\t\t\t})),\n\t\t\taccessChanges: labelled(subjects.accessChanges),\n\t\t\ttemporaryValues: subjects.temporaryValues,\n\t\t\t...ifDefined(\"namespaces\", orderedResolutions.find(({ spaceId }) => spaceId === aggregate.app.spaceId)?.entry.namespaces)\n\t\t});\n\t};\n\tconst first = await plan(statementTexts, firstResolved);\n\tif (!first.ok) return notOk(first.failure.refused);\n\tlet run = first.value;\n\tlet plannedTexts = statementTexts.filter(isPlannedStatement);\n\tlet consented = [];\n\tif (options.action === \"dbUpdate\" && mode === \"apply\") {\n\t\tconst answered = await askPlanQuestions({\n\t\t\tplan: run,\n\t\t\taskAccess: true,\n\t\t\tcanConvert: false,\n\t\t\tstatements: plannedTexts,\n\t\t\tpreAnswers: consentTexts,\n\t\t\tconsentAll: {\n\t\t\t\tdelete: options.acceptDataLoss,\n\t\t\t\tallow: options.acceptAccessChanges\n\t\t\t},\n\t\t\torigin: fromContract ?? EMPTY_ORIGIN$1,\n\t\t\toriginKnown: fromContract !== null,\n\t\t\tdestination: contract,\n\t\t\tanswer: options.answerQuestions,\n\t\t\tkeepDataEditAdvice: dbUpdateKeepDataEditAdvice(options.invocation, recordedDatabaseContract(aggregate, markerRows)),\n\t\t\treplan: (planned) => plan([...consentTexts, ...planned], resolveRenames(planned))\n\t\t});\n\t\tif (!answered.ok) {\n\t\t\tif (CliStructuredError$1.is(answered.failure)) throw answered.failure;\n\t\t\treturn notOk(answered.failure.refused);\n\t\t}\n\t\trun = answered.value.plan;\n\t\tplannedTexts = answered.value.statements;\n\t\tconsented = answered.value.consented;\n\t}\n\tif (options.action === \"dbUpdate\" && mode === \"plan\") {\n\t\tconst refused = refuseUnusedConsents({\n\t\t\tplan: run,\n\t\t\tstatements: statementTexts,\n\t\t\tcontracts: {\n\t\t\t\torigin: fromContract ?? EMPTY_ORIGIN$1,\n\t\t\t\tdestination: contract,\n\t\t\t\tstatements: plannedTexts\n\t\t\t}\n\t\t});\n\t\tif (!refused.ok) throw refused.failure;\n\t\tconsented = givenConsents({\n\t\t\tplan: run,\n\t\t\tstatements: statementTexts,\n\t\t\tconsentAll: {\n\t\t\t\tdelete: options.acceptDataLoss,\n\t\t\t\tallow: options.acceptAccessChanges\n\t\t\t},\n\t\t\tcontracts: {\n\t\t\t\torigin: fromContract ?? EMPTY_ORIGIN$1,\n\t\t\t\tdestination: contract,\n\t\t\t\tstatements: plannedTexts\n\t\t\t}\n\t\t});\n\t}\n\tconst { planned, orderedResolutions } = run;\n\tconst plannerWarnings = aggregatePlannerWarnings(orderedResolutions);\n\tif (plannerWarnings !== void 0) options.onPlannerWarnings?.(plannerWarnings);\n\tconst appResolution = orderedResolutions.find((r) => r.spaceId === aggregate.app.spaceId);\n\tif (!appResolution) throw new InternalError(\"Aggregate planner returned no plan for the app space — the planner is supposed to always emit one.\");\n\tconst appPlan = appResolution.entry.plan;\n\tconst appliedStatements = action === \"dbUpdate\" ? [...reportAppliedStatements(appResolution.entry.appliedStatements, fromContract, contract, operationsBefore(orderedResolutions, aggregate.app.spaceId)), ...consented.map((entry) => reportConsentStatement(entry, entry.verb === \"allow\" && entry.operationIndex !== void 0 ? [entry.operationIndex] : run.subjects.dataLoss.filter(({ subject }) => migrationSubjectKey(subject) === migrationSubjectKey(entry.subject)).map(({ operationIndex }) => operationIndex)))] : void 0;\n\tconst contractsAsked = {\n\t\torigin: fromContract ?? EMPTY_ORIGIN$1,\n\t\tdestination: contract,\n\t\tstatements: plannedTexts\n\t};\n\tconst namespaceAnswersOf = (subject) => ifDefined(\"removedNamespace\", removedNamespaceOf(subject, run.namespaces));\n\tconst asked = (entries) => entries.map((entry) => ({\n\t\t...entry,\n\t\ttext: subjectText(entry.subject, contractsAsked),\n\t\t...namespaceAnswersOf(entry.subject)\n\t}));\n\tconst databaseStorageHash = action === \"dbUpdate\" ? recordedDatabaseContract(aggregate, markerRows) : void 0;\n\tconst subjects = action === \"dbUpdate\" ? {\n\t\tdataLoss: asked(run.subjects.dataLoss),\n\t\taccessChanges: asked(run.subjects.accessChanges),\n\t\ttemporaryValues: reportTemporaryValues(run.subjects.temporaryValues, contract),\n\t\t...ifDefined(\"namespaces\", run.namespaces)\n\t} : void 0;\n\tif (mode === \"plan\") {\n\t\tconst aggregateOps = orderedResolutions.flatMap((r) => r.entry.displayOps);\n\t\tconst preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(aggregateOps) : void 0;\n\t\tconst perSpace = buildPerSpaceBreakdown(orderedResolutions, aggregate.app.spaceId, { includeMarkers: false });\n\t\tconst summary = `Planned ${aggregateOps.length} operation(s) across ${orderedResolutions.length} space(s)`;\n\t\treturn wrapPlanResult({\n\t\t\toperations: aggregateOps,\n\t\t\tdestination: appPlan.destination,\n\t\t\tpreview,\n\t\t\tperSpace,\n\t\t\tsummary,\n\t\t\tappliedStatements,\n\t\t\tsubjects,\n\t\t\tdatabaseStorageHash\n\t\t});\n\t}\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans: planned.perSpace,\n\t\tapplyOrder: planned.applyOrder,\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tpolicy,\n\t\t...ifDefined(\"databasePolicies\", policiesToWrite?.policies),\n\t\t...ifDefined(\"expectedDatabasePolicies\", checkedPolicies?.inForce),\n\t\taction,\n\t\t...ifDefined(\"onProgress\", onProgress)\n\t});\n\tif (!applied.ok) {\n\t\tconst facts = await withEditsAsWritten(runnerFailureFacts(applied.failure, orderedResolutions));\n\t\treturn notOk(action === \"dbInit\" ? dbInitRunnerFailureError(applied.failure, facts, options.invocation) : dbUpdateRunnerFailureError(applied.failure, facts, {\n\t\t\tdatabaseStorageHash,\n\t\t\tinvocation: options.invocation\n\t\t}));\n\t}\n\tconst aggregateOps = applied.value.orderedResolutions.flatMap((r) => r.entry.displayOps);\n\tconst signedWithoutOperations = action === \"dbUpdate\" && applied.value.totalOpsExecuted === 0 && markerRows.get(aggregate.app.spaceId)?.storageHash !== appPlan.destination.storageHash;\n\tconst runSummary = action === \"dbInit\" ? `Applied ${applied.value.totalOpsExecuted} operation(s) across ${applied.value.orderedResolutions.length} space(s), database signed` : signedWithoutOperations ? `The storage the contract describes changed, but the database needs no operation for it, so none ran and the database was signed with the new contract. ${whatChangedSentence(fromContract, contract)}` : applied.value.totalOpsExecuted === 0 ? `Database already matches contract across ${applied.value.orderedResolutions.length} space(s), signature updated` : `Applied ${applied.value.totalOpsExecuted} operation(s) across ${applied.value.orderedResolutions.length} space(s), signature updated`;\n\tconst policiesText = policiesToWrite === void 0 ? void 0 : declaredSettingsText(policiesToWrite.differences);\n\tconst summary = policiesText === void 0 ? runSummary : signedWithoutOperations ? `${runSummary} Policies updated: ${policiesText}.` : `${runSummary}; policies updated: ${policiesText}`;\n\treturn wrapApplyResult({\n\t\toperations: aggregateOps,\n\t\tdestination: appPlan.destination,\n\t\toperationsPlanned: applied.value.totalOpsPlanned,\n\t\toperationsExecuted: applied.value.totalOpsExecuted,\n\t\tperSpace: applied.value.perSpace,\n\t\tsummary,\n\t\tappliedStatements,\n\t\tsubjects,\n\t\tdatabaseStorageHash,\n\t\tchangedStorageEntities: signedWithoutOperations ? changedStorageEntities(fromContract, contract) : void 0,\n\t\tdatabasePoliciesUpdated: policiesToWrite?.differences\n\t});\n}\n/** The origin of a database whose marker names no readable contract: no models. */\nconst EMPTY_ORIGIN$1 = {\n\tdomain: { namespaces: {} },\n\tstorage: { namespaces: {} }\n};\n/**\n* The contract the application space's marker names, from the local snapshot\n* store, or where it was looked for and why it could not be used.\n*/\nasync function readAppOrigin(input) {\n\tconst snapshotsDir = join(input.migrationsDir, CONTRACT_SNAPSHOTS_DIRNAME);\n\tif (input.marker === null) return {\n\t\torigin: {\n\t\t\tkind: \"missing\",\n\t\t\thash: null,\n\t\t\tsnapshotDirectory: snapshotsDir,\n\t\t\tunreadable: void 0\n\t\t},\n\t\tcontract: null\n\t};\n\tconst hash = input.marker.storageHash;\n\tif (!isStorageHashHex(hash)) return {\n\t\torigin: {\n\t\t\tkind: \"missing\",\n\t\t\thash,\n\t\t\tsnapshotDirectory: snapshotsDir,\n\t\t\tunreadable: void 0\n\t\t},\n\t\tcontract: null\n\t};\n\tconst snapshotDirectory = contractSnapshotDir(input.migrationsDir, hash);\n\tlet json;\n\ttry {\n\t\tjson = await readContractSnapshotJson(input.migrationsDir, hash, input.verifySnapshotContent);\n\t} catch (error) {\n\t\tif (!MigrationToolsError.is(error)) throw error;\n\t\treturn {\n\t\t\torigin: {\n\t\t\t\tkind: \"missing\",\n\t\t\t\thash,\n\t\t\t\tsnapshotDirectory,\n\t\t\t\tunreadable: error.code === \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\" ? void 0 : error.why\n\t\t\t},\n\t\t\tcontract: null\n\t\t};\n\t}\n\ttry {\n\t\tconst contract = input.deserializeContract(json);\n\t\treturn {\n\t\t\torigin: {\n\t\t\t\tkind: \"contract\",\n\t\t\t\tcontract\n\t\t\t},\n\t\t\tcontract\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\torigin: {\n\t\t\t\tkind: \"missing\",\n\t\t\t\thash,\n\t\t\t\tsnapshotDirectory,\n\t\t\t\tunreadable: error instanceof Error ? error.message : String(error)\n\t\t\t},\n\t\t\tcontract: null\n\t\t};\n\t}\n}\n/** How many operations the spaces applied before `spaceId` list ahead of it in `operations`. */\nfunction operationsBefore(orderedResolutions, spaceId) {\n\tconst position = orderedResolutions.findIndex((resolution) => resolution.spaceId === spaceId);\n\treturn orderedResolutions.slice(0, position).reduce((count, resolution) => count + resolution.entry.displayOps.length, 0);\n}\n/**\n* What the planned operations lose and whose access they change, across every space, each at its\n* position in the operations the result reports.\n*/\nfunction subjectsAcrossSpaces(orderedResolutions) {\n\tconst offset = (resolution, entries) => entries.map((entry) => ({\n\t\t...entry,\n\t\toperationIndex: entry.operationIndex + operationsBefore(orderedResolutions, resolution.spaceId)\n\t}));\n\treturn {\n\t\tdataLoss: orderedResolutions.flatMap((resolution) => offset(resolution, resolution.entry.dataLoss)),\n\t\taccessChanges: orderedResolutions.flatMap((resolution) => offset(resolution, resolution.entry.accessChanges)),\n\t\ttemporaryValues: orderedResolutions.flatMap((resolution) => offset(resolution, resolution.entry.temporaryValues))\n\t};\n}\nfunction aggregatePlannerWarnings(orderedResolutions) {\n\tconst warnings = orderedResolutions.flatMap((r) => r.entry.warnings ?? []);\n\treturn warnings.length > 0 ? warnings : void 0;\n}\n/**\n* Compare the live marker rows, kept in `markerLocation`, against the aggregate's\n* declared contract spaces. Any marker row whose `space` is not a space of\n* the aggregate is an \"orphan\" — typically a marker left behind by\n* an extension that was removed from `extensions` without first\n* cleaning up its on-disk migrations / database tables.\n*\n* Returns a {@link CliStructuredError} envelope (code\n* `MIGRATION.CONTRACT_SPACE_VIOLATION`, `kind: 'orphanMarker'`) for the\n* first orphan it finds, or `null`\n* when every marker row maps to a declared contract space. Mirrors the M2\n* `runContractSpaceVerifierMarkerCheck` envelope so downstream\n* tooling (integration tests, JSON consumers) keeps asserting on the\n* same shape.\n*/\nfunction detectOrphanMarkers(aggregate, markerRows, markerLocation) {\n\tconst aggregateSpaceIds = /* @__PURE__ */ new Set([aggregate.app.spaceId, ...aggregate.extensions.map((m) => m.spaceId)]);\n\tconst orphans = [];\n\tfor (const [spaceId, row] of markerRows) if (row !== null && row !== void 0 && !aggregateSpaceIds.has(spaceId)) orphans.push(spaceId);\n\tif (orphans.length === 0) return null;\n\torphans.sort((a, b) => a.localeCompare(b));\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", orphans.length === 1 ? `Orphan contract-space marker detected for \"${orphans[0]}\"` : `Orphan contract-space markers detected for ${orphans.length} spaces`, {\n\t\twhy: `The database has \\`${markerLocation}\\` rows for spaces (${orphans.map((s) => `\"${s}\"`).join(\", \")}) that are not declared in the project's \\`extensions\\`. The aggregate pipeline refuses to advance markers it cannot account for.`,\n\t\tfix: `Either re-declare the missing extension(s) in \\`extensions\\` (so the aggregate owns them again), or remove the orphan marker row(s) from \\`${markerLocation}\\` once you have confirmed the corresponding tables can be safely retired.`,\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\",\n\t\tmeta: { violations: orphans.map((spaceId) => ({\n\t\t\tkind: \"orphanMarker\",\n\t\t\tspaceId\n\t\t})) }\n\t});\n}\nfunction mapPlannerError(error, context) {\n\tif (error.kind === \"planFromDiffFailed\") return context.action === \"dbInit\" ? dbInitPlanningFailedError(error.conflicts) : planningRefusedError(error.conflicts, {\n\t\tinvocation: context.invocation,\n\t\tfrom: recordedDatabaseContract(context.aggregate, context.markerRows),\n\t\tto: void 0,\n\t\tstatements: context.statements,\n\t\tresolved: context.resolved\n\t});\n\tif (error.kind === \"policyConflict\") throw new InternalError(`The planner refused the planning policy db init and db update give it, which plans the app space from the diff and walks every extension space's graph: ${error.detail}`);\n\tconst space = context.aggregate.extensions.find(({ spaceId }) => spaceId === error.spaceId);\n\tif (space === void 0) throw new InternalError(`The planner named extension space \"${error.spaceId}\", which the aggregate does not hold.`);\n\tconst headRef = requireHeadRef(space);\n\tconst unplannable = {\n\t\tspaceId: error.spaceId,\n\t\tfromHash: context.markerRows.get(error.spaceId)?.storageHash ?? EMPTY_CONTRACT_HASH,\n\t\ttargetHash: headRef.hash,\n\t\tcommand: context.action === \"dbInit\" ? \"db init\" : \"db update\",\n\t\tinvocation: context.invocation\n\t};\n\tif (error.kind === \"extensionPathUnreachable\") return errorExtensionPathUnreachable(unplannable);\n\treturn errorExtensionNoInvariantPath({\n\t\t...unplannable,\n\t\trequired: headRef.invariants,\n\t\tmissing: error.missingInvariants,\n\t\tstructuralPath: structuralPathOf(space.graph(), unplannable.fromHash, unplannable.targetHash)\n\t});\n}\nfunction wrapPlanResult(args) {\n\treturn ok({\n\t\tmode: \"plan\",\n\t\t...ifDefined(\"databaseStorageHash\", args.databaseStorageHash),\n\t\t...ifDefined(\"appliedStatements\", args.appliedStatements),\n\t\t...args.subjects,\n\t\tplan: {\n\t\t\toperations: stripOperations(args.operations),\n\t\t\t...ifDefined(\"preview\", args.preview)\n\t\t},\n\t\tdestination: {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\t...ifDefined(\"profileHash\", args.destination.profileHash)\n\t\t},\n\t\tperSpace: args.perSpace,\n\t\tsummary: args.summary\n\t});\n}\nfunction wrapApplyResult(args) {\n\treturn ok({\n\t\tmode: \"apply\",\n\t\t...ifDefined(\"databasePoliciesUpdated\", args.databasePoliciesUpdated),\n\t\t...ifDefined(\"databaseStorageHash\", args.databaseStorageHash),\n\t\t...ifDefined(\"changedStorageEntities\", args.changedStorageEntities),\n\t\t...ifDefined(\"appliedStatements\", args.appliedStatements),\n\t\t...args.subjects,\n\t\tplan: { operations: stripOperations(args.operations) },\n\t\tdestination: {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\t...ifDefined(\"profileHash\", args.destination.profileHash)\n\t\t},\n\t\texecution: {\n\t\t\toperationsPlanned: args.operationsPlanned,\n\t\t\toperationsExecuted: args.operationsExecuted\n\t\t},\n\t\tmarker: args.destination.profileHash ? {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\tprofileHash: args.destination.profileHash\n\t\t} : { storageHash: args.destination.storageHash },\n\t\tperSpace: args.perSpace,\n\t\tsummary: args.summary\n\t});\n}\n/**\n* The storage hash of the contract the application space's database is at, when the migration\n* graph has it: `migration plan --from` then resolves it. Without a migration that ends at it,\n* `migration plan` starts from the `db` ref that `db update` keeps.\n*/\nfunction recordedDatabaseContract(aggregate, markerRows) {\n\tconst hash = markerRows.get(aggregate.app.spaceId)?.storageHash;\n\treturn hash !== void 0 && aggregate.app.graph().nodes.has(hash) ? hash : void 0;\n}\n/**\n* The convert and backfill statements of `texts` that ask for code the user writes in a migration\n* file: every one but a variant convert, which rewrites a stored value the contracts already give.\n* `resolved` are the planned statements of `texts`, resolved in the order given.\n*/\nfunction statementsNeedingMigrationFile(texts, resolved) {\n\treturn texts.filter(isPlannedStatement).filter((_, index) => {\n\t\tconst statement = resolved[index];\n\t\treturn statement !== void 0 && statement.kind !== \"rename\" && !(statement.kind === \"convert\" && statement.entity === \"model\");\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-init.ts\n/**\n* Execute `db init` against the configured contract.\n*\n* Routes through the loader → planner → runner pipeline (sub-spec\n* \"Commit-by-commit § Commit 4\"). Always additive-only; destructive\n* changes belong to `db update`.\n*/\nasync function executeDbInit(options) {\n\treturn await executeRun({\n\t\tdriver: options.driver,\n\t\tadapter: options.adapter,\n\t\tfamilyInstance: options.familyInstance,\n\t\tcontract: options.contract,\n\t\tmode: options.mode,\n\t\tmigrations: options.migrations,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tmigrationsDir: options.migrationsDir,\n\t\ttargetId: options.targetId,\n\t\textensions: options.extensions ?? [],\n\t\tpolicy: { allowedOperationClasses: [\"additive\"] },\n\t\tinvocation: options.invocation,\n\t\taction: \"dbInit\",\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent),\n\t\t...ifDefined(\"onPlannerWarnings\", options.onPlannerWarnings),\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-verify.ts\n/**\n* Span IDs emitted via `onProgress` during the aggregate verify flow.\n* Mirrors the span identifiers used by the legacy precheck / marker-check\n* helpers so structured-output renderers and progress tests keep working.\n*/\nconst SPAN_IDS = {\n\tintrospect: \"introspect\",\n\tverify: \"verify\"\n};\n/**\n* Loader → verifier pipeline shared by `db verify` modes (`full`,\n* `marker-only`, `schema-only`).\n*\n* 1. **Load**: build a {@link import('@internal/migration-tools/aggregate').ContractSpaceAggregate}\n* from descriptors + on-disk on-disk artefacts. Layout / drift /\n* integrity / disjointness violations short-circuit with a\n* structured CLI error.\n* 2. **Read DB state**: marker rows + (when `skipSchema` is `false`)\n* schema introspection.\n* 3. **Verify**: {@link verifyMigration} returns per-space `markerCheck` +\n* per-space `schemaCheck` (each contract space verified against the full schema,\n* then scoped to its own contract space). Marker drift is returned as the\n* success value's `markerDrift` envelope for callers to settle as a\n* finding. Verify results are returned to the caller verbatim.\n*/\nasync function executeDbVerify(options) {\n\tconst { driver, familyInstance, onProgress, skipSchema, skipMarker } = options;\n\tconst loaded = await buildContractSpaceAggregate(buildLoadInputs(options));\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst aggregate = loaded.value;\n\tconst markersBySpaceId = await familyInstance.readAllMarkers({ driver });\n\tconst schemaIntrospection = skipSchema ? null : await runIntrospection({\n\t\taction: \"dbVerify\",\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tonProgress,\n\t\tcontract: collectAggregateNamespaces(aggregate)\n\t});\n\tconst classifySubjectGranularity = hasSchemaSubjectClassifier(familyInstance) ? (issue) => familyInstance.classifySubjectGranularity(issue) : void 0;\n\tconst classifyEntityKind = hasSchemaSubjectClassifier(familyInstance) ? (issue) => familyInstance.classifyEntityKind(issue) : void 0;\n\temitVerifySpan(onProgress, \"spanStart\");\n\treturn finaliseVerifyResult({\n\t\tverifyResult: verifyMigration({\n\t\t\taggregate,\n\t\t\tmarkersBySpaceId,\n\t\t\tschemaIntrospection,\n\t\t\tmode: options.mode,\n\t\t\tverifySchemaForSpace: createPerSpaceVerifier(options),\n\t\t\t...ifDefined(\"classifySubjectGranularity\", classifySubjectGranularity),\n\t\t\t...ifDefined(\"classifyEntityKind\", classifyEntityKind)\n\t\t}),\n\t\taggregate,\n\t\tskipMarker,\n\t\tonProgress,\n\t\tmigrationsDir: options.migrationsDir\n\t});\n}\nfunction buildLoadInputs(options) {\n\treturn {\n\t\ttargetId: options.targetId,\n\t\tmigrationsDir: options.migrationsDir,\n\t\tappContract: options.contract,\n\t\textensions: options.extensions,\n\t\tdeserializeContract: (json) => options.familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent)\n\t};\n}\nasync function runIntrospection(args) {\n\tconst { action, driver, familyInstance, onProgress, contract } = args;\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS.introspect,\n\t\tlabel: \"Introspecting database schema\"\n\t});\n\ttry {\n\t\tconst result = await familyInstance.introspect({\n\t\t\tdriver,\n\t\t\tcontract\n\t\t});\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS.introspect,\n\t\t\toutcome: \"ok\"\n\t\t});\n\t\treturn result;\n\t} catch (error) {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS.introspect,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\tthrow error;\n\t}\n}\n/**\n* Build the per-space schema callback handed to the aggregate verifier.\n* When `skipSchema` is true the callback short-circuits with a synthetic\n* `ok` result so the verifier still runs the (cheap) schemaCheck loop\n* without invoking the family's verification path.\n*/\nfunction createPerSpaceVerifier(options) {\n\tconst { skipSchema, familyInstance, frameworkComponents } = options;\n\treturn (schema, space, verifyMode) => {\n\t\tif (skipSchema) return buildSkippedSchemaResult(space);\n\t\treturn familyInstance.verifySchema({\n\t\t\tcontract: space.contract(),\n\t\t\tschema,\n\t\t\tstrict: verifyMode === \"strict\",\n\t\t\tframeworkComponents\n\t\t});\n\t};\n}\nfunction emitVerifySpan(onProgress, kind) {\n\tif (kind === \"spanStart\") {\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: SPAN_IDS.verify,\n\t\t\tlabel: \"Verifying contract spaces\"\n\t\t});\n\t\treturn;\n\t}\n\tonProgress?.({\n\t\taction: \"dbVerify\",\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS.verify,\n\t\toutcome: kind === \"spanEndOk\" ? \"ok\" : \"error\"\n\t});\n}\n/**\n* Map an {@link VerifierOutput} to the operation's\n* {@link ExecuteDbVerifyResult}, applying the `skipMarker` policy used\n* by the CLI's `--schema-only` mode.\n*/\nfunction finaliseVerifyResult(args) {\n\tconst { verifyResult, aggregate, skipMarker, onProgress, migrationsDir } = args;\n\tif (!verifyResult.ok) {\n\t\temitVerifySpan(onProgress, \"spanEndError\");\n\t\treturn notOk(new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", \"Aggregate verifier introspection failed\", {\n\t\t\twhy: verifyResult.failure.detail,\n\t\t\tfix: \"Check database connectivity and the introspection tooling.\",\n\t\t\tdocsUrl: \"https://pris.ly/contract-spaces\"\n\t\t}));\n\t}\n\tconst markerDrift = skipMarker ? null : mapMarkerCheckFailures(aggregate.app.spaceId, verifyResult.value.markerCheck, migrationsDir);\n\temitVerifySpan(onProgress, markerDrift === null ? \"spanEndOk\" : \"spanEndError\");\n\treturn ok({\n\t\tschemaResults: verifyResult.value.schemaCheck.perSpace,\n\t\tunclaimed: verifyResult.value.schemaCheck.unclaimed,\n\t\tspaceOrder: [aggregate.app.spaceId, ...aggregate.extensions.map((e) => e.spaceId)],\n\t\tappSpaceId: aggregate.app.spaceId,\n\t\tmarkerDrift\n\t});\n}\nfunction buildSkippedSchemaResult(space) {\n\tconst contract = space.contract();\n\tconst headRef = requireHeadRef(space);\n\tconst profileHash = castAs(contract).profileHash;\n\treturn {\n\t\tok: true,\n\t\tsummary: \"Schema verification skipped\",\n\t\tcontract: {\n\t\t\tstorageHash: headRef.hash,\n\t\t\t...profileHash ? { profileHash } : {}\n\t\t},\n\t\ttarget: { expected: contract.target },\n\t\tschema: { issues: [] },\n\t\ttimings: { total: 0 }\n\t};\n}\n/**\n* Translate per-space marker check failures and orphan markers into a\n* single CLI structured error envelope. Preserves the legacy code\n* `MIGRATION.CONTRACT_SPACE_VIOLATION` (was emitted by\n* `runContractSpaceVerifierMarkerCheck`).\n*/\nfunction mapMarkerCheckFailures(appSpaceId, section, migrationsDir) {\n\tconst violations = [];\n\tfor (const [spaceId, result] of section.perSpace) {\n\t\tif (result.kind === \"ok\" || result.kind === \"absent\") continue;\n\t\tif (result.kind === \"hashMismatch\") {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: spaceId === appSpaceId ? \"Run `{bin} db update` to advance the marker, or roll the database back to the recorded hash.\" : `Apply on-disk migrations under \\`${migrationsDir}/${spaceId}/\\` to advance the marker, or remove the conflicting marker row.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (result.kind === \"missingInvariants\") violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tremediation: `Re-apply the migrations under \\`${migrationsDir}/${spaceId}/\\` so the marker carries invariants: ${result.missing.join(\", \")}.`\n\t\t});\n\t}\n\tfor (const orphan of section.orphanMarkers) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: orphan.spaceId,\n\t\tremediation: `Add the corresponding extension to \\`extensions\\` in \\`prisma.config.ts\\`, or delete the orphan marker row for \"${orphan.spaceId}\".`\n\t});\n\tif (violations.length === 0) return null;\n\tconst lines = violations.map((v) => `- [${v.kind}] ${v.spaceId}: ${v.remediation}`);\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", violations.length === 1 ? \"Contract-space verifier found a violation\" : `Contract-space verifier found violations (${violations.length})`, {\n\t\twhy: `The on-disk \\`${migrationsDir}/\\` directory, the \\`extensions\\` declaration, and the live database marker rows are not in agreement.\\n${lines.join(\"\\n\")}`,\n\t\tfix: violations[0]?.remediation ?? \"Review and reconcile the violations listed above.\",\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\",\n\t\tmeta: { violations }\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-sign.ts\n/**\n* Loads the contract-space aggregate and signs it with {@link signContractSpaces}.\n*/\nasync function executeDbSign(options) {\n\tconst { familyInstance } = options;\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId: options.targetId,\n\t\tmigrationsDir: options.migrationsDir,\n\t\tappContract: options.contract,\n\t\textensions: options.extensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent)\n\t});\n\tif (!loaded.ok) return notOk(loaded.failure);\n\treturn signContractSpaces({\n\t\tdriver: options.driver,\n\t\tfamilyInstance,\n\t\taggregate: loaded.value,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tinvocation: options.invocation,\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t});\n}\nfunction markerHashes(marker) {\n\treturn marker === void 0 ? null : {\n\t\tstorageHash: marker.storageHash,\n\t\tprofileHash: marker.profileHash\n\t};\n}\nfunction missingInvariants(space, marker) {\n\tconst recorded = new Set(marker?.invariants ?? []);\n\treturn requireHeadRef(space).invariants.filter((id) => !recorded.has(id)).sort();\n}\nfunction contractHashes(space) {\n\tconst contract = space.contract();\n\treturn {\n\t\tstorageHash: contract.storage.storageHash,\n\t\tprofileHash: contract.profileHash\n\t};\n}\n/**\n* Reads every space's marker, verifies every contract space of the aggregate against the live schema without strict mode, then writes the marker of every space that verified in one call to the family, each only while it still holds the hashes read here. A space that fails verification is reported with its schema result and keeps its marker; a space whose marker another process wrote in the meantime is reported as a conflict and keeps that marker. The family gets the spaces in the order `migrate` applies them ({@link spacesInApplyOrder}).\n*\n* A space whose head ref requires invariants its marker does not record is refused and keeps its marker, since only running the migrations that provide them can record them.\n*/\nasync function signContractSpaces(options) {\n\tconst { driver, familyInstance, aggregate, frameworkComponents, onProgress } = options;\n\tconst markers = await familyInstance.readAllMarkers({ driver });\n\tconst appSpaceId = aggregate.app.spaceId;\n\tconst inForce = markers.has(appSpaceId) ? databasePoliciesInForce(markers, appSpaceId, familyInstance.markerLocation) : void 0;\n\tif (inForce !== void 0) {\n\t\tconst permitted = checkRunPolicies({\n\t\t\tcommand: \"db sign\",\n\t\t\tappSpaceId,\n\t\t\tinForce,\n\t\t\tref: void 0,\n\t\t\tpermitPolicyChange: false,\n\t\t\ttargetHash: aggregate.app.contract().storage.storageHash,\n\t\t\tinvocation: options.invocation\n\t\t});\n\t\tif (!permitted.ok) return notOk(permitted.failure);\n\t}\n\tconst verified = verifyMigration({\n\t\taggregate,\n\t\tmarkersBySpaceId: markers,\n\t\tschemaIntrospection: await runIntrospection({\n\t\t\taction: \"dbSign\",\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tonProgress,\n\t\t\tcontract: collectAggregateNamespaces(aggregate)\n\t\t}),\n\t\tmode: \"lenient\",\n\t\tverifySchemaForSpace: (schema, space) => familyInstance.verifySchema({\n\t\t\tcontract: space.contract(),\n\t\t\tschema,\n\t\t\tstrict: false,\n\t\t\tframeworkComponents\n\t\t})\n\t});\n\tif (!verified.ok) return notOk(new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", \"Aggregate verifier failed\", {\n\t\twhy: verified.failure.detail,\n\t\tfix: \"Check database connectivity and the introspection tooling.\",\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\"\n\t}));\n\tconst schemaOf = (space) => {\n\t\tconst schema = verified.value.schemaCheck.perSpace.get(space.spaceId);\n\t\tif (schema === void 0) throw new InternalError(`the aggregate verifier returned no schema result for contract space \"${space.spaceId}\"`);\n\t\treturn schema;\n\t};\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst missingBySpace = new Map(allSpaces.map((space) => [space.spaceId, missingInvariants(space, markers.get(space.spaceId))]).filter(([, missing]) => missing.length > 0));\n\tconst toSign = spacesInApplyOrder(aggregate).filter((space) => schemaOf(space).ok && !missingBySpace.has(space.spaceId)).map((space) => ({\n\t\tspace: space.spaceId,\n\t\tcontract: space.contract(),\n\t\texpected: markerHashes(markers.get(space.spaceId))\n\t}));\n\tonProgress?.({\n\t\taction: \"dbSign\",\n\t\tkind: \"spanStart\",\n\t\tspanId: \"sign\",\n\t\tlabel: \"Signing database\"\n\t});\n\tconst signatures = await familyInstance.signSpaces({\n\t\tdriver,\n\t\tspaces: toSign,\n\t\t...ifDefined(\"expectedDatabasePolicies\", inForce)\n\t});\n\tconst policiesConflict = signatures.find((signature) => signature.status === \"conflict\" && signature.reason === \"databasePolicies\");\n\tonProgress?.({\n\t\taction: \"dbSign\",\n\t\tkind: \"spanEnd\",\n\t\tspanId: \"sign\",\n\t\toutcome: policiesConflict === void 0 ? \"ok\" : \"error\"\n\t});\n\tif (policiesConflict !== void 0) {\n\t\tconst { comparison } = policiesConflict;\n\t\tif (comparison.kind === \"unreadable\") throw errorMarkerPoliciesCorrupt({\n\t\t\twhy: comparison.why,\n\t\t\tspace: appSpaceId,\n\t\t\tmarkerLocation: familyInstance.markerLocation\n\t\t});\n\t\treturn notOk(errorDatabasePoliciesMovedDuringSign({\n\t\t\tspaceId: appSpaceId,\n\t\t\tchecked: policiesConflict.checked,\n\t\t\tfound: comparison.found,\n\t\t\tinvocation: options.invocation\n\t\t}));\n\t}\n\tconst signatureOf = new Map(signatures.flatMap((signature) => signature.status === \"conflict\" && signature.reason === \"databasePolicies\" ? [] : [[signature.space, signature]]));\n\treturn ok({ spaces: allSpaces.map((space) => {\n\t\tconst signature = signatureOf.get(space.spaceId);\n\t\tif (signature !== void 0) return signature;\n\t\tconst missing = missingBySpace.get(space.spaceId);\n\t\tconst schema = schemaOf(space);\n\t\treturn missing === void 0 ? {\n\t\t\tspace: space.spaceId,\n\t\t\tstatus: \"failed\",\n\t\t\tcontract: contractHashes(space),\n\t\t\tschema\n\t\t} : {\n\t\t\tspace: space.spaceId,\n\t\t\tstatus: \"missing-invariants\",\n\t\t\tcontract: contractHashes(space),\n\t\t\tmissingInvariants: missing,\n\t\t\t...schema.ok ? {} : { schema }\n\t\t};\n\t}) });\n}\n//#endregion\n//#region src/control-api/operations/db-update.ts\n/** Execute `db update` against the configured contract. */\nasync function executeDbUpdate(options) {\n\tif (options.permitPolicyChange === true && options.ref === void 0) return notOk(errorPermitPolicyChangeNeedsRef({\n\t\trefOption: \"ref\",\n\t\tto: void 0\n\t}));\n\tconst contractStorageHash = options.contract.storage.storageHash;\n\tif (options.ref !== void 0 && options.ref.hash !== contractStorageHash) {\n\t\tconst fix = `Pass the contract the ref names, or a ref whose hash is ${contractStorageHash}.`;\n\t\treturn notOk(new ActionableCliError(\"CLI.INVALID_ARGUMENTS\", \"The ref names another contract than the one db update reconciles to\", {\n\t\t\twhy: `db update was given ref \"${options.ref.name}\" at ${options.ref.hash}, but the contract it reconciles to is ${contractStorageHash}.`,\n\t\t\tfix,\n\t\t\tnextActions: [chooseAction(fix)],\n\t\t\tmeta: {\n\t\t\t\trefName: options.ref.name,\n\t\t\t\trefHash: options.ref.hash,\n\t\t\t\tcontractStorageHash\n\t\t\t}\n\t\t}));\n\t}\n\treturn await executeRun({\n\t\tdriver: options.driver,\n\t\tadapter: options.adapter,\n\t\tfamilyInstance: options.familyInstance,\n\t\tcontract: options.contract,\n\t\tmigrations: options.migrations,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tmigrationsDir: options.migrationsDir,\n\t\ttargetId: options.targetId,\n\t\textensions: options.extensions ?? [],\n\t\tpolicy: DB_UPDATE_POLICY,\n\t\tinvocation: options.invocation,\n\t\taction: \"dbUpdate\",\n\t\tmode: options.mode,\n\t\tstatements: options.statements ?? [],\n\t\tanswerQuestions: options.answerQuestions,\n\t\tacceptDataLoss: options.acceptDataLoss ?? false,\n\t\tacceptAccessChanges: options.acceptAccessChanges ?? false,\n\t\t...ifDefined(\"ref\", options.ref),\n\t\tpermitPolicyChange: options.permitPolicyChange ?? false,\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent),\n\t\t...ifDefined(\"onPlannerWarnings\", options.onPlannerWarnings),\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/load-contract-source.ts\nfunction isRecord$2(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction failedToResolveContractSource(why, fix, meta, cause, diagnostics) {\n\treturn errorRuntime(\"CONTRACT.SOURCE_LOAD_FAILED\", \"Failed to resolve contract source\", {\n\t\twhy,\n\t\tfix,\n\t\t...ifDefined(\"diagnostics\", diagnostics),\n\t\t...ifDefined(\"meta\", meta),\n\t\t...ifDefined(\"cause\", cause)\n\t});\n}\nfunction diagnosticLocation(diagnostic) {\n\tconst sourceId = typeof diagnostic[\"sourceId\"] === \"string\" ? diagnostic[\"sourceId\"] : void 0;\n\tconst span = isRecord$2(diagnostic[\"span\"]) ? diagnostic[\"span\"] : void 0;\n\tconst start = span && isRecord$2(span[\"start\"]) ? span[\"start\"] : void 0;\n\treturn {\n\t\tsourceId,\n\t\tline: start && typeof start[\"line\"] === \"number\" ? start[\"line\"] : void 0,\n\t\tcharacter: start && typeof start[\"column\"] === \"number\" ? start[\"column\"] : void 0\n\t};\n}\n/** A file the source names by its absolute path is shown relative to the working directory, as a user would type it. */\nfunction displayLocation(location, cwd) {\n\tconst { sourceId } = location;\n\treturn cwd !== void 0 && sourceId !== void 0 && isAbsolute(sourceId) ? {\n\t\t...location,\n\t\tsourceId: relative(cwd, sourceId)\n\t} : location;\n}\nfunction formatLocation({ sourceId, line, character }) {\n\tif (sourceId === void 0) return void 0;\n\treturn line !== void 0 && character !== void 0 ? `${sourceId}:${line}:${character}` : sourceId;\n}\n/** One source diagnostic as a line of text: `<sourceId>:<line>:<column> <code> <message>`. */\nfunction formatSourceDiagnostic(raw) {\n\tif (!isRecord$2(raw)) return String(raw);\n\tconst code = typeof raw[\"code\"] === \"string\" ? raw[\"code\"] : \"diagnostic\";\n\tconst message = typeof raw[\"message\"] === \"string\" ? raw[\"message\"] : \"\";\n\treturn [\n\t\tformatLocation(diagnosticLocation(raw)),\n\t\tcode,\n\t\tmessage\n\t].filter((part) => part !== void 0 && part !== \"\").join(\" \");\n}\n/**\n* The finding the CLI prints under the error, one per source diagnostic. The\n* terminal renderer prints a finding's code and summary and nothing of its\n* `where`, so the summary starts with the location. A source code that is not\n* yet dotted is wrapped as `CONTRACT.SOURCE_DIAGNOSTIC` and named in the summary.\n*/\nfunction sourceDiagnosticToFinding(raw, severity, cwd) {\n\tif (!isRecord$2(raw)) return void 0;\n\tconst code = typeof raw[\"code\"] === \"string\" ? raw[\"code\"] : \"diagnostic\";\n\tconst message = typeof raw[\"message\"] === \"string\" ? raw[\"message\"] : \"\";\n\tconst location = displayLocation(diagnosticLocation(raw), cwd);\n\tconst formatted = formatLocation(location);\n\tconst locatedSummary = (text) => formatted === void 0 ? text : `${formatted} ${text}`;\n\tconst finding = {\n\t\tseverity,\n\t\tnextActions: [],\n\t\t...ifDefined(\"where\", location.sourceId === void 0 ? void 0 : {\n\t\t\tpath: location.sourceId,\n\t\t\t...ifDefined(\"line\", location.line)\n\t\t})\n\t};\n\treturn isStructuredErrorCode(code) ? {\n\t\tcode,\n\t\tsummary: locatedSummary(message),\n\t\t...finding\n\t} : {\n\t\tcode: \"CONTRACT.SOURCE_DIAGNOSTIC\",\n\t\tsummary: locatedSummary(`${code}: ${message}`),\n\t\t...finding,\n\t\tmeta: { code }\n\t};\n}\nfunction sourceDiagnosticsToFindings(diagnostics, cwd) {\n\tconst findings = [];\n\tfor (const raw of diagnostics) {\n\t\tconst finding = sourceDiagnosticToFinding(raw, \"error\", cwd);\n\t\tif (finding !== void 0) findings.push(finding);\n\t}\n\treturn findings;\n}\n/**\n* A warning the contract source reported, as a `warn` diagnostic of the command's result: its summary starts with the location, `where` names the file and line, and `meta` keeps the source's own code and its span, which carries the column.\n*/\nfunction sourceWarningDiagnostic(raw, cwd) {\n\tconst finding = sourceDiagnosticToFinding(raw, \"warn\", cwd);\n\tif (finding === void 0) return void 0;\n\treturn {\n\t\t...finding,\n\t\tmeta: {\n\t\t\t...finding.meta,\n\t\t\t...ifDefined(\"span\", raw.span)\n\t\t}\n\t};\n}\nfunction diagnosticLocationSuffix(diagnostic) {\n\tconst formatted = formatLocation(diagnosticLocation(diagnostic));\n\treturn formatted === void 0 ? \"\" : ` (${formatted})`;\n}\nfunction mapDiagnosticsToIssues(diagnostics) {\n\tconst issues = [];\n\tfor (const raw of diagnostics) {\n\t\tif (!isRecord$2(raw)) continue;\n\t\tconst code = typeof raw[\"code\"] === \"string\" ? raw[\"code\"] : \"diagnostic\";\n\t\tconst message = typeof raw[\"message\"] === \"string\" ? raw[\"message\"] : \"\";\n\t\tissues.push({\n\t\t\tkind: code,\n\t\t\tmessage: `${message}${diagnosticLocationSuffix(raw)}`\n\t\t});\n\t}\n\treturn issues;\n}\nfunction failedWith(error) {\n\treturn notOk({ error });\n}\n/**\n* Checks the shape of what `load` returned. A source may be plain JavaScript,\n* so its declared type is not trusted.\n*/\nfunction validateProviderResult(providerResult, cwd) {\n\tconst raw = providerResult;\n\tif (!isRecord$2(raw) || typeof raw[\"ok\"] !== \"boolean\") return failedWith(failedToResolveContractSource(\"Contract source provider returned malformed result shape.\", \"Ensure contract.source.load resolves to ok(Contract) or notOk({ summary, diagnostics }).\"));\n\tif (providerResult.ok) {\n\t\tconst value = providerResult.value;\n\t\tif (value === void 0 || value === null) return failedWith(failedToResolveContractSource(\"Contract source provider returned malformed success result: missing value.\", \"Ensure contract.source.load success payload is ok(Contract).\"));\n\t\treturn ok(providerResult.value);\n\t}\n\tconst failure = providerResult.failure;\n\tif (!isRecord$2(failure) || typeof failure[\"summary\"] !== \"string\" || !Array.isArray(failure[\"diagnostics\"])) return failedWith(failedToResolveContractSource(\"Contract source provider returned malformed failure result: expected summary and diagnostics.\", \"Ensure contract.source.load failure payload is notOk({ summary, diagnostics, meta? }).\"));\n\tif (failure[\"diagnostics\"].some((diagnostic) => !isRecord$2(diagnostic) || typeof diagnostic[\"sourceId\"] !== \"string\")) return failedWith(failedToResolveContractSource(\"Contract source provider returned malformed failure result: each diagnostic must include a string sourceId.\", \"Include the source filename in each diagnostic returned by contract.source.load.\"));\n\treturn notOk({\n\t\terror: failedToResolveContractSource(failure[\"summary\"], \"Edit the source where each finding points, then run the command again.\", {\n\t\t\tdiagnostics: failure[\"diagnostics\"],\n\t\t\tissues: mapDiagnosticsToIssues(failure[\"diagnostics\"]),\n\t\t\t...ifDefined(\"providerMeta\", failure[\"meta\"])\n\t\t}, void 0, sourceDiagnosticsToFindings(failure[\"diagnostics\"], cwd)),\n\t\tsourceDiagnostics: providerResult.failure\n\t});\n}\n/**\n* Asks the configured contract source for the contract, with a source context\n* built from `stack`. A structured error the source throws, such as\n* `CONTRACT.DEFAULT_INVALID` from a TypeScript builder, is reported under its\n* own code; every other failure becomes `CONTRACT.SOURCE_LOAD_FAILED`.\n* Every command that loads a contract source goes through here, so each\n* reports a bad source the same way.\n*\n* The warnings the source reports come back on both sides of the result, for the caller to report as it reports the rest of its output.\n*\n* @throws {DOMException} `AbortError` if cancelled via `signal`\n*/\nasync function loadContractSourceWithStack(inputs) {\n\tconst warnings = [];\n\tconst loaded = await askSource(inputs, (diagnostic) => {\n\t\twarnings.push(diagnostic);\n\t});\n\treturn loaded.ok ? ok({\n\t\tcontract: loaded.value,\n\t\twarnings\n\t}) : notOk({\n\t\t...loaded.failure,\n\t\twarnings\n\t});\n}\n/** The error with the source's warnings added after its own findings, as `warn` findings. */\nfunction withWarningFindings(error, warnings, cwd) {\n\tif (warnings.length === 0) return error;\n\tconst warningFindings = warnings.flatMap((warning) => sourceWarningDiagnostic(warning, cwd) ?? []);\n\treturn new CliStructuredError(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tdiagnostics: [...error.diagnostics ?? [], ...warningFindings],\n\t\t...ifDefined(\"why\", error.why),\n\t\t...ifDefined(\"fix\", error.fix),\n\t\t...ifDefined(\"nextActions\", error.nextActions),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl),\n\t\t...ifDefined(\"cause\", error.cause)\n\t});\n}\nasync function askSource(inputs, reportWarning) {\n\tconst { stack, source } = inputs;\n\tconst signal = inputs.signal ?? new AbortController().signal;\n\tconst unlessAborted = abortable(signal);\n\tconst sourceContext = {\n\t\treportWarning,\n\t\tcomposedExtensions: stack.extensions.map((p) => p.id),\n\t\tcomposedExtensionContracts: stack.extensionContracts,\n\t\tauthoringContributions: stack.authoringContributions,\n\t\t...ifDefined(\"pslDiagnostics\", stack.family?.pslDiagnostics),\n\t\tcodecLookup: stack.codecLookup,\n\t\tcontrolMutationDefaults: stack.controlMutationDefaults,\n\t\tgeneratorFunctions: stack.generatorFunctions,\n\t\tdataTypes: stack.dataTypes,\n\t\tresolvedInputs: await unlessAborted(expandContractInputs(source.inputs)),\n\t\tcapabilities: stack.capabilities,\n\t\tdefaultNamespaceId: stack.target.defaultNamespaceId\n\t};\n\tlet providerResult;\n\ttry {\n\t\tproviderResult = await unlessAborted(source.load(sourceContext));\n\t} catch (error) {\n\t\tif (signal.aborted || isRecord$2(error) && error[\"name\"] === \"AbortError\") throw error;\n\t\tif (isStructuredError(error)) return failedWith(cliErrorFromStructured(error));\n\t\treturn failedWith(failedToResolveContractSource(error instanceof Error ? error.message : String(error), \"Ensure contract.source.load resolves to ok(Contract) or returns structured diagnostics.\", void 0, error));\n\t}\n\treturn validateProviderResult(providerResult, inputs.cwd);\n}\n/** @throws {CliStructuredError} `CONFIG.CONTRACT_MISSING` when the config has no contract section */\nfunction requireContractConfig(config) {\n\tif (!config.contract) throw errorContractConfigMissing({ why: \"Config.contract is required for emit. Define it in your config: contract: { source: ..., output: ... }\" });\n\treturn config.contract;\n}\n/** @throws {CliStructuredError} `CONFIG.CONTRACT_MISSING` when the contract source has no `load` function */\nfunction requireSourceProvider(contractConfig) {\n\tif (typeof contractConfig.source?.load !== \"function\") throw errorContractConfigMissing({ why: \"Contract config must include a valid source provider object\" });\n}\n/**\n* Runs the config's contract source and stops there: nothing is emitted or\n* written. A source that reports diagnostics is a `notOk` carrying them.\n* Either side carries the warnings the source reported.\n*\n* @throws {CliStructuredError} the error `contract emit` raises, when the\n* config has no contract source or the source is malformed or throws; the\n* source's warnings follow its findings as `warn` findings\n* @throws {DOMException} `AbortError` if cancelled via `signal`\n*/\nasync function loadContractSource(config, options = {}) {\n\tconst contractConfig = requireContractConfig(config);\n\trequireSourceProvider(contractConfig);\n\tconst loaded = await loadContractSourceWithStack({\n\t\tstack: createControlStack(config),\n\t\tsource: contractConfig.source,\n\t\tcwd: void 0,\n\t\t...ifDefined(\"signal\", options.signal)\n\t});\n\tif (loaded.ok) return loaded;\n\tconst { error, sourceDiagnostics, warnings } = loaded.failure;\n\tif (sourceDiagnostics === void 0) throw withWarningFindings(error, warnings, void 0);\n\treturn notOk({\n\t\tsummary: sourceDiagnostics.summary,\n\t\tdiagnostics: sourceDiagnostics.diagnostics,\n\t\tmeta: sourceDiagnostics.meta,\n\t\twarnings\n\t});\n}\n//#endregion\n//#region src/utils/applied-summary.ts\n/**\n* What `db migrate` says it applied. The runner skips an operation whose postcheck already holds\n* before it runs, so when it ran fewer operations than the migrations hold, the summary says why.\n*/\nfunction appliedSummary(counts) {\n\tconst { migrations, planned, executed, spaces } = counts;\n\treturn `Applied ${migrations} migration(s) (${executed < planned ? `${executed} of ${planned} operation(s); ${skippedOperationsText(planned - executed)}` : `${executed} operation(s)`}) across ${spaces} contract space(s)`;\n}\n/** Why an apply ran fewer operations than it planned: the runner skipped those whose postcheck already held. */\nfunction skippedOperationsText(skipped) {\n\treturn `the other ${skipped} had nothing to do, since their postchecks already held`;\n}\n//#endregion\n//#region src/utils/marker-mismatch.ts\n/** The ledger as `read` gives it, or undefined when the read fails: the error it explains must not fail with it. */\nasync function readLedgerQuietly(read) {\n\ttry {\n\t\treturn await read();\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction ledgerAfterGraph(ledger, graph) {\n\tconst lastOnGraph = ledger.findLastIndex((applied) => isGraphNode(applied.to, graph));\n\tconst last = ledger[lastOnGraph];\n\tif (last === void 0) return;\n\tconst after = ledger.slice(lastOnGraph + 1);\n\tconst named = after.flatMap((applied) => applied.migrationName === \"\" ? [] : [applied.migrationName]);\n\tconst onDisk = new Set([...graph.migrationByHash.values()].map((edge) => edge.dirName));\n\treturn {\n\t\tlastGraphHash: last.to,\n\t\tmissingMigrations: named.filter((name) => !onDisk.has(name)),\n\t\treplannedMigrations: named.filter((name) => onDisk.has(name)),\n\t\tmovedWithoutMigration: after.some((applied) => applied.migrationName === \"\")\n\t};\n}\nconst NAMES_IN_WHY = 5;\nfunction nameList(names) {\n\tconst shown = names.slice(0, NAMES_IN_WHY).join(\", \");\n\tconst hidden = names.length - NAMES_IN_WHY;\n\treturn hidden > 0 ? `${shown}, and ${hidden} more` : shown;\n}\nconst MOVED_BY_DB_UPDATE = \"`db update` or `db init` moved it outside the migration graph.\";\nfunction whichIs(names, singular, plural) {\n\treturn `${nameList(names)}, which ${names.length === 1 ? singular : plural}`;\n}\nfunction historySentence(history) {\n\tconst { lastGraphHash, missingMigrations, replannedMigrations, movedWithoutMigration } = history;\n\tconst migrations = [...missingMigrations.length === 0 ? [] : [whichIs(missingMigrations, \"is no longer on disk\", \"are no longer on disk\")], ...replannedMigrations.length === 0 ? [] : [whichIs(replannedMigrations, \"has since been planned again with different content\", \"have since been planned again with different content\")]];\n\tconst opening = `After ${lastGraphHash}, the last graph contract it reached,`;\n\tif (migrations.length === 0) return movedWithoutMigration ? `${opening} ${MOVED_BY_DB_UPDATE}` : `${opening} its marker was moved without a migration, for example by \\`db sign\\`.`;\n\tconst applied = `${opening} it applied ${migrations.join(\", and \")}.`;\n\treturn movedWithoutMigration ? `${applied} After that, ${MOVED_BY_DB_UPDATE}` : applied;\n}\nconst CAUSE_UNKNOWN = \"A migration it applied was planned again or deleted, or `db update` moved it to a contract no migration ends at.\";\nfunction extensionCause(spaceId) {\n\treturn `The migrations of extension space \"${spaceId}\" come with the extension; it was changed to a version whose migrations do not include that contract.`;\n}\nconst MOVE_WITH_DB_UPDATE = \"Move it with db update; its data stays:\";\n/** The `db update` arguments that name the target as the command was given it, or undefined when `db update` cannot reach it. */\nfunction reconcileArgs(found, owner) {\n\tif (!(found.graph.reverseChain.has(found.targetHash) || found.targetHash === owner.emittedContractHash)) return void 0;\n\tif (found.targetRefName !== void 0) return [\"--to\", found.targetRefName];\n\treturn found.graph.reverseChain.has(found.targetHash) ? [\"--to\", found.targetHash] : [];\n}\nfunction applicationAdvice(found, owner, history) {\n\tconst from = history?.lastGraphHash ?? (found.graph.nodes.size === 0 ? \"the empty contract\" : \"the nearest contract in the migration graph\");\n\tif (found.markerHash === found.targetHash) {\n\t\tconst authorOne = `The database is already at the target, but no migration ends there: author a migration from ${from} to ${found.targetHash}, commit it, and deploy again.`;\n\t\treturn {\n\t\t\tfix: authorOne,\n\t\t\tnextActions: [chooseAction(authorOne)]\n\t\t};\n\t}\n\tif (!found.change.includes(\"reconcile\")) {\n\t\tconst migrationsOnly = `This database's change policy permits only migrations. Author migrations that bring it back onto the graph: one from ${from} to its current contract, then one from there to ${found.targetHash}. Commit them and deploy again.`;\n\t\treturn {\n\t\t\tfix: migrationsOnly,\n\t\t\tnextActions: [chooseAction(migrationsOnly)]\n\t\t};\n\t}\n\tconst toTarget = reconcileArgs(found, owner);\n\tif (toTarget === void 0) {\n\t\tconst migrationsOnly = `Plan a migration from ${from} to the database's current contract, then one to ${found.targetHash}, commit them, and deploy again.`;\n\t\treturn {\n\t\t\tfix: migrationsOnly,\n\t\t\tnextActions: [chooseAction(migrationsOnly)]\n\t\t};\n\t}\n\tconst dryRun = cliCommand(found.invocation, \"db update\", [...toTarget, \"--dry-run\"]);\n\tconst reconcile = cliCommand(found.invocation, \"db update\", toTarget);\n\treturn {\n\t\tfix: [\n\t\t\tMOVE_WITH_DB_UPDATE,\n\t\t\t` ${dryRun}`,\n\t\t\t` ${reconcile}`\n\t\t].join(\"\\n\"),\n\t\tnextActions: [runCommandAction(\"Preview the changes\", dryRun), runCommandAction(\"Reconcile the database\", reconcile)]\n\t};\n}\nfunction extensionAdvice(found) {\n\tconst install = `Install a version of the extension whose migrations include the contract the database is at (${found.markerHash}), or ask the extension's maintainers for one.`;\n\tconst list = cliCommand(found.invocation, \"migration list\", [\"--space\", found.spaceId]);\n\treturn {\n\t\tfix: [install, `List the space's migrations with \\`${list}\\`.`].join(\"\\n\"),\n\t\tnextActions: [chooseAction(install), runCommandAction(`List the migrations of extension space \"${found.spaceId}\"`, list)]\n\t};\n}\n/**\n* `MIGRATION.MARKER_MISMATCH`: the database's marker names a contract no migration of the space\n* starts or ends at. It explains the cause from the ledger and gives the ways back onto the graph,\n* none of which resets the database.\n*/\nfunction errorMarkerMismatch(found) {\n\tconst { spaceId, markerHash, targetHash, invocation, owner } = found;\n\tconst history = found.ledger === void 0 ? void 0 : ledgerAfterGraph(found.ledger, found.graph);\n\tconst why = `The database's marker names ${markerHash}, which no migration in ${printedPath(invocation, join(found.migrationsDir, spaceId))} starts or ends at. ${owner.kind === \"extension\" ? extensionCause(spaceId) : history === void 0 ? CAUSE_UNKNOWN : historySentence(history)}`;\n\tconst advice = owner.kind === \"extension\" ? extensionAdvice(found) : applicationAdvice(found, owner, history);\n\treturn new ActionableCliError(\"MIGRATION.MARKER_MISMATCH\", \"The database is at a contract that is not in the migration graph\", {\n\t\twhy,\n\t\tfix: advice.fix,\n\t\tnextActions: [...advice.nextActions],\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\tmarkerHash,\n\t\t\ttargetHash,\n\t\t\tchange: found.change,\n\t\t\t...ifDefined(\"lastGraphHash\", history?.lastGraphHash),\n\t\t\t...found.ledger === void 0 ? {} : { missingMigrations: [...history?.missingMigrations ?? []] }\n\t\t}\n\t});\n}\n//#endregion\n//#region src/utils/migrate-failure.ts\n/**\n* A failed `db migrate` apply as the CLI reports it; its advice prints paths and commands that work\n* from where the CLI ran, with the `--config` it was given.\n*/\nfunction migrateRunnerFailureError(failure, facts, failedMigration, invocation) {\n\treturn runnerFailureError(failure, migrateAdvice(failure, facts, failedMigration, invocation));\n}\n//#endregion\n//#region src/control-api/operations/unfilled-placeholders.ts\n/**\n* The directory of the first migration to apply whose `migration.ts` still calls `placeholder(...)`.\n* `migration plan` writes such a migration with an empty `ops.json`, and `node migration.ts` writes\n* none until every placeholder is filled, so only a migration with no operations is read. A call of\n* `placeholder` from another file the migration imports is not found.\n*/\nasync function migrationWithUnfilledPlaceholders(plans, applyOrder, migrationsDir) {\n\tfor (const spaceId of applyOrder) for (const edge of plans.get(spaceId)?.migrationEdges ?? []) {\n\t\tif (edge.operationCount !== 0) continue;\n\t\tconst directory = join(migrationsDir, spaceId, edge.dirName);\n\t\tif (callsPlaceholder(await migrationSource(directory))) return directory;\n\t}\n}\nasync function migrationSource(directory) {\n\ttry {\n\t\treturn await readFile(join(directory, \"migration.ts\"), \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && \"code\" in error && error.code === \"ENOENT\") return \"\";\n\t\tthrow error;\n\t}\n}\nconst PRISMA_MIGRATION_MODULE = /^@(prisma|internal)\\/.+\\/migration$/;\nconst NAME_START = /[A-Za-z_$]/;\nconst NAME_PART = /[\\w$]/;\n/**\n* Whether the source calls the `placeholder` it imports from a Prisma migration module, by the\n* local name it imports it under or through a namespace import. Comments and the text of strings\n* are not code, so a `placeholder(` there is not a call.\n*/\nfunction callsPlaceholder(source) {\n\tconst tokens = tokenize(source);\n\tconst { names, namespaces } = placeholderImports(tokens);\n\treturn tokens.some((token, index) => {\n\t\tif (tokens[index + 1]?.text !== \"(\" || token.kind !== \"name\") return false;\n\t\tif (tokens[index - 1]?.text !== \".\") return names.has(token.text);\n\t\tconst owner = tokens[index - 2];\n\t\treturn token.text === \"placeholder\" && owner?.kind === \"name\" && namespaces.has(owner.text);\n\t});\n}\nfunction placeholderImports(tokens) {\n\tconst names = /* @__PURE__ */ new Set();\n\tconst namespaces = /* @__PURE__ */ new Set();\n\ttokens.forEach((token, index) => {\n\t\tif (token.kind !== \"name\" || token.text !== \"import\") return;\n\t\tconst fromAt = tokens.findIndex((each, at) => at > index && each.kind === \"name\" && each.text === \"from\");\n\t\tconst module = tokens[fromAt + 1];\n\t\tif (fromAt < 0 || module?.kind !== \"string\" || !PRISMA_MIGRATION_MODULE.test(module.text)) return;\n\t\tconst clause = tokens.slice(index + 1, fromAt);\n\t\tif (clause[0]?.text === \"*\" && clause[1]?.text === \"as\" && clause[2] !== void 0) {\n\t\t\tnamespaces.add(clause[2].text);\n\t\t\treturn;\n\t\t}\n\t\tclause.forEach((each, at) => {\n\t\t\tif (each.text !== \"placeholder\") return;\n\t\t\tconst alias = clause[at + 1]?.text === \"as\" ? clause[at + 2] : void 0;\n\t\t\tnames.add(alias?.text ?? each.text);\n\t\t});\n\t});\n\treturn {\n\t\tnames,\n\t\tnamespaces\n\t};\n}\n/** The names, strings and punctuation of the source, with comments left out and template expressions read as code. */\nfunction tokenize(source) {\n\tconst tokens = [];\n\tlet at = 0;\n\tconst templateDepths = [];\n\tlet depth = 0;\n\tconst readTemplate = () => {\n\t\twhile (at < source.length) {\n\t\t\tconst char = source[at];\n\t\t\tif (char === \"\\\\\") at += 2;\n\t\t\telse if (char === \"`\") {\n\t\t\t\tat += 1;\n\t\t\t\treturn;\n\t\t\t} else if (char === \"$\" && source[at + 1] === \"{\") {\n\t\t\t\tat += 2;\n\t\t\t\ttemplateDepths.push(depth);\n\t\t\t\tdepth += 1;\n\t\t\t\treturn;\n\t\t\t} else at += 1;\n\t\t}\n\t};\n\twhile (at < source.length) {\n\t\tconst char = source[at] ?? \"\";\n\t\tconst next = source[at + 1];\n\t\tif (char === \"/\" && next === \"/\") {\n\t\t\tconst end = source.indexOf(\"\\n\", at);\n\t\t\tat = end < 0 ? source.length : end;\n\t\t} else if (char === \"/\" && next === \"*\") {\n\t\t\tconst end = source.indexOf(\"*/\", at + 2);\n\t\t\tat = end < 0 ? source.length : end + 2;\n\t\t} else if (char === \"'\" || char === \"\\\"\") {\n\t\t\tlet text = \"\";\n\t\t\tat += 1;\n\t\t\twhile (at < source.length && source[at] !== char) {\n\t\t\t\tif (source[at] === \"\\\\\") at += 1;\n\t\t\t\ttext += source[at] ?? \"\";\n\t\t\t\tat += 1;\n\t\t\t}\n\t\t\tat += 1;\n\t\t\ttokens.push({\n\t\t\t\tkind: \"string\",\n\t\t\t\ttext\n\t\t\t});\n\t\t} else if (char === \"`\") {\n\t\t\tat += 1;\n\t\t\treadTemplate();\n\t\t} else if (NAME_START.test(char)) {\n\t\t\tconst start = at;\n\t\t\twhile (at < source.length && NAME_PART.test(source[at] ?? \"\")) at += 1;\n\t\t\ttokens.push({\n\t\t\t\tkind: \"name\",\n\t\t\t\ttext: source.slice(start, at)\n\t\t\t});\n\t\t} else if (/\\s/.test(char)) at += 1;\n\t\telse {\n\t\t\tat += 1;\n\t\t\tif (char === \"{\") depth += 1;\n\t\t\tif (char === \"}\") {\n\t\t\t\tdepth -= 1;\n\t\t\t\tif (templateDepths.at(-1) === depth) {\n\t\t\t\t\ttemplateDepths.pop();\n\t\t\t\t\treadTemplate();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttokens.push({\n\t\t\t\tkind: \"punctuation\",\n\t\t\t\ttext: char\n\t\t\t});\n\t\t}\n\t}\n\treturn tokens;\n}\n//#endregion\n//#region src/control-api/operations/migrate.ts\n/**\n* Apply pending migrations across every contract space (app +\n* extensions). Replay-only: graph-walk against the on-disk graph for\n* every contract space; no synth, no introspection.\n*\n* Pipeline:\n*\n* 1. Load aggregate from disk (loader hydrates extension graphs;\n* caller provides app-space packages).\n* 2. Read live marker rows per space (`familyInstance.readAllMarkers`).\n* 3. Per space: `resolveRecordedPath` plots the path from the live\n* marker to `space.headRef.hash` (or `refHash` for the app\n* space when provided). An empty-graph space whose elements are ALL\n* externally managed resolves declaratively (marker to head, zero\n* ops), mirroring the db-init aggregate planner: such a space ships\n* no DDL and has nothing to author. Every other empty-graph space\n* fails loudly — \"never planned\" is a user-error condition for\n* replay.\n* 4. Hand off to {@link runMigration} (the runner-driving tail\n* shared with `db init` / `db update`). The runner advances each\n* space's marker as the last step of applying it.\n*\n* Encodes the replay-only contract: the app contract space must have an\n* authored migration graph on disk before this operation can advance it.\n*/\nasync function executeMigrate(options) {\n\tconst { driver, familyInstance, contract, migrations, frameworkComponents, migrationsDir, extensions, targetId, target, onProgress } = options;\n\tconst ref = target?.kind === \"ref\" ? target.ref : void 0;\n\tif (options.permitPolicyChange === true && ref === void 0) return notOk(errorPermitPolicyChangeNeedsRef({\n\t\trefOption: \"target\",\n\t\tto: target?.kind === \"hash\" ? target.hash : void 0\n\t}));\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId,\n\t\tmigrationsDir,\n\t\tappContract: contract,\n\t\textensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", options.verifySnapshotContent)\n\t});\n\tif (!loaded.ok) throw loaded.failure;\n\tconst aggregate = loaded.value;\n\tconst markerRows = await familyInstance.readAllMarkers({ driver });\n\tconst appTargetHash = target === void 0 ? requireHeadRef(aggregate.app).hash : target.kind === \"ref\" ? target.ref.hash : target.hash;\n\tconst inForce = databasePoliciesInForce(markerRows, aggregate.app.spaceId, familyInstance.markerLocation);\n\tconst planned = await planEverySpace({\n\t\taggregate,\n\t\tmarkers: markerRows,\n\t\tappTarget: {\n\t\t\thash: appTargetHash,\n\t\t\tinvariants: ref?.invariants,\n\t\t\trefName: ref?.name\n\t\t},\n\t\tstorageNameOf: (operation) => familyInstance.storageNameOf(operation),\n\t\tmigrationsDir,\n\t\tinvocation: options.invocation,\n\t\treadLedger: (spaceId) => familyInstance.readLedger({\n\t\t\tdriver,\n\t\t\tspace: spaceId\n\t\t}),\n\t\tchange: inForce.change\n\t});\n\tif (!planned.ok) return notOk(planned.failure);\n\tconst checkedPolicies = checkRunPolicies({\n\t\tcommand: \"db migrate\",\n\t\tappSpaceId: aggregate.app.spaceId,\n\t\tinForce,\n\t\tref,\n\t\tpermitPolicyChange: options.permitPolicyChange ?? false,\n\t\ttargetHash: appTargetHash,\n\t\tinvocation: options.invocation\n\t});\n\tif (!checkedPolicies.ok) return notOk(checkedPolicies.failure);\n\tconst policiesToWrite = checkedPolicies.value.toWrite;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst perSpacePlans = /* @__PURE__ */ new Map();\n\tconst plansKeptFromRunner = /* @__PURE__ */ new Map();\n\tfor (const space of allSpaces) {\n\t\tconst outcome = planned.value.get(space.spaceId);\n\t\tif (outcome === void 0) throw new InternalError(`Unreachable: no planned outcome for space \"${space.spaceId}\"`);\n\t\tif (outcome.kind === \"at-head\") {\n\t\t\tplansKeptFromRunner.set(space.spaceId, outcome.plan);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"never-planned\") return notOk(buildNeverPlannedFailure(outcome.spaceId, outcome.targetHash, migrationsDir));\n\t\tif (outcome.kind === \"unreachable\") return notOk(buildPathNotFoundFailure(outcome.spaceId, outcome.liveMarker, outcome.targetHash));\n\t\tif (outcome.kind === \"unsatisfiable\") throw noInvariantPathError({\n\t\t\tgraph: outcome.targetSpace.graph(),\n\t\t\tfromHash: outcome.liveHash,\n\t\t\ttargetHash: outcome.targetHash,\n\t\t\trequired: outcome.targetInvariants,\n\t\t\tmissing: outcome.missing,\n\t\t\t...outcome.refName !== void 0 ? { refName: outcome.refName } : {}\n\t\t});\n\t\tif (leavesUnmarkedSpaceUntouched(outcome.plan)) plansKeptFromRunner.set(space.spaceId, outcome.plan);\n\t\telse perSpacePlans.set(space.spaceId, outcome.plan);\n\t}\n\tconst canonicalOrder = spacesInApplyOrder(aggregate).map((space) => space.spaceId);\n\tconst applyOrder = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId));\n\tconst hasPendingWork = applyOrder.some((spaceId) => {\n\t\tconst entry = perSpacePlans.get(spaceId);\n\t\treturn entry !== void 0 && planRequiresExecution(entry);\n\t});\n\tif (!hasPendingWork && policiesToWrite !== void 0) return runPolicyOnly({\n\t\t...options,\n\t\taggregate,\n\t\tplans: new Map([...plansKeptFromRunner, ...perSpacePlans]),\n\t\tcanonicalOrder,\n\t\tpoliciesToWrite,\n\t\tinForce\n\t});\n\tif (!hasPendingWork) {\n\t\tconst ordered = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId) || plansKeptFromRunner.has(spaceId)).map((spaceId) => {\n\t\t\tconst entry = perSpacePlans.get(spaceId) ?? plansKeptFromRunner.get(spaceId);\n\t\t\tif (entry === void 0) throw new InternalError(`Unreachable: missing per-space plan for \"${spaceId}\"`);\n\t\t\treturn {\n\t\t\t\tspaceId,\n\t\t\t\tentry\n\t\t\t};\n\t\t});\n\t\tconst perSpace = buildPerSpaceBreakdown(ordered, aggregate.app.spaceId, { includeMarkers: true });\n\t\tconst totalSpaces = ordered.length;\n\t\treturn ok(buildSuccess({\n\t\t\taggregate,\n\t\t\torderedResolutions: ordered,\n\t\t\tperSpace,\n\t\t\ttotalOpsExecuted: 0,\n\t\t\tsummary: totalSpaces === 0 ? \"Already up to date — no contract spaces are loaded\" : totalSpaces === 1 ? \"Already up to date\" : `Already up to date across ${totalSpaces} space(s)`\n\t\t}));\n\t}\n\tconst unfilled = await migrationWithUnfilledPlaceholders(perSpacePlans, applyOrder, migrationsDir);\n\tif (unfilled !== void 0) return notOk(errorMigrationHasUnfilledPlaceholders(unfilled, options.invocation));\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans,\n\t\tapplyOrder,\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tpolicy: MIGRATE_POLICY,\n\t\t...ifDefined(\"databasePolicies\", policiesToWrite?.policies),\n\t\texpectedDatabasePolicies: inForce,\n\t\taction: \"migrate\",\n\t\t...ifDefined(\"onProgress\", onProgress)\n\t});\n\tif (!applied.ok) {\n\t\tconst facts = await withEditsAsWritten(runnerFailureFacts(applied.failure, collectOrdered(applyOrder, perSpacePlans)));\n\t\treturn notOk(migrateRunnerFailureError(applied.failure, facts, facts.failedMigration === void 0 ? void 0 : failedMigrationOnDisk(facts.failedMigration, migrationsDir), options.invocation));\n\t}\n\tconst orderedAll = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId) || plansKeptFromRunner.has(spaceId)).map((spaceId) => {\n\t\tif (perSpacePlans.has(spaceId)) {\n\t\t\tconst fromRunner = applied.value.orderedResolutions.find((r) => r.spaceId === spaceId);\n\t\t\tif (fromRunner !== void 0) return fromRunner;\n\t\t}\n\t\tconst entry = plansKeptFromRunner.get(spaceId);\n\t\tif (entry === void 0) throw new InternalError(`Unreachable: missing per-space plan for \"${spaceId}\"`);\n\t\treturn {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t};\n\t});\n\tconst perSpaceAll = buildPerSpaceBreakdown(orderedAll, aggregate.app.spaceId, { includeMarkers: true });\n\tconst applySummary = appliedSummary({\n\t\tmigrations: applied.value.orderedResolutions.reduce((sum, r) => sum + r.entry.migrationEdges.length, 0),\n\t\tplanned: applied.value.totalOpsPlanned,\n\t\texecuted: applied.value.totalOpsExecuted,\n\t\tspaces: orderedAll.length\n\t});\n\tconst summary = policiesToWrite === void 0 ? applySummary : `${applySummary}; policies updated: ${declaredSettingsText(policiesToWrite.differences)}`;\n\treturn ok({\n\t\t...buildSuccess({\n\t\t\taggregate,\n\t\t\torderedResolutions: orderedAll,\n\t\t\tperSpace: perSpaceAll,\n\t\t\ttotalOpsExecuted: applied.value.totalOpsExecuted,\n\t\t\tsummary\n\t\t}),\n\t\t...ifDefined(\"databasePoliciesUpdated\", policiesToWrite?.differences)\n\t});\n}\nconst MIGRATE_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\",\n\t\"data\"\n] };\n/**\n* Nothing is pending, but the run has policies to record: the runner applies the application\n* space's plan, which runs no migration, so that its marker update records them.\n*/\nasync function runPolicyOnly(args) {\n\tconst { aggregate, plans, policiesToWrite } = args;\n\tconst appSpaceId = aggregate.app.spaceId;\n\tconst appPlan = plans.get(appSpaceId);\n\tif (appPlan === void 0) throw new InternalError(`Unreachable: no plan for the application space \"${appSpaceId}\"`);\n\tconst perSpacePlans = /* @__PURE__ */ new Map([[appSpaceId, appPlan]]);\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans,\n\t\tapplyOrder: [appSpaceId],\n\t\tdriver: args.driver,\n\t\tfamilyInstance: args.familyInstance,\n\t\tmigrations: args.migrations,\n\t\tframeworkComponents: args.frameworkComponents,\n\t\tpolicy: MIGRATE_POLICY,\n\t\tdatabasePolicies: policiesToWrite.policies,\n\t\texpectedDatabasePolicies: args.inForce,\n\t\taction: \"migrate\",\n\t\t...ifDefined(\"onProgress\", args.onProgress)\n\t});\n\tif (!applied.ok) {\n\t\tconst facts = runnerFailureFacts(applied.failure, collectOrdered([appSpaceId], perSpacePlans));\n\t\treturn notOk(migrateRunnerFailureError(applied.failure, facts, void 0, args.invocation));\n\t}\n\tconst orderedAll = args.canonicalOrder.flatMap((spaceId) => {\n\t\tconst entry = plans.get(spaceId);\n\t\tif (entry === void 0) return [];\n\t\treturn [applied.value.orderedResolutions.find((r) => r.spaceId === spaceId) ?? {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t}];\n\t});\n\treturn ok({\n\t\t...buildSuccess({\n\t\t\taggregate,\n\t\t\torderedResolutions: orderedAll,\n\t\t\tperSpace: buildPerSpaceBreakdown(orderedAll, appSpaceId, { includeMarkers: true }),\n\t\t\ttotalOpsExecuted: 0,\n\t\t\tsummary: `Policies updated: ${declaredSettingsText(policiesToWrite.differences)}`\n\t\t}),\n\t\tdatabasePoliciesUpdated: policiesToWrite.differences\n\t});\n}\n/**\n* Compute the graph-walk path for one contract space.\n*\n* Encapsulates the invariant-correct input assembly that both\n* `executeMigrate` and `executeMigrateShowCommand` must use:\n* - `currentMarker` carries the full live marker including `invariants`\n* (not a stripped `{ storageHash, invariants: [] }` shell).\n* - `targetInvariants` uses the caller-supplied `refInvariants` when a\n* `--to` ref was resolved (not always the file head ref's invariants).\n*\n* Both callers map the returned `SpacePathOutcome` to their own error\n* representation; the path-compute logic is shared and identical.\n*\n* @internal Exported for `executeMigrateShowCommand`.\n*/\nfunction planSpacePath({ space, aggregate, targetHash, refInvariants, liveMarker, refName, storageNameOf }) {\n\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\tconst headRef = requireHeadRef(space);\n\tconst graph = space.graph();\n\tconst extensionShipsNoMigrations = !isAppSpace && graph.nodes.size === 0;\n\tif (liveMarker !== null && !extensionShipsNoMigrations && !isGraphNode(liveMarker.storageHash, graph)) return {\n\t\tkind: \"marker-outside-graph\",\n\t\tspaceId: space.spaceId,\n\t\tmarkerHash: liveMarker.storageHash,\n\t\ttargetHash\n\t};\n\tif (graph.nodes.size === 0) {\n\t\tconst liveHash = liveMarker?.storageHash;\n\t\tif (targetHash === liveHash || liveHash === void 0 && targetHash === EMPTY_CONTRACT_HASH) return {\n\t\t\tkind: \"at-head\",\n\t\t\tplan: buildAtHeadResolution({\n\t\t\t\taggregateTargetId: aggregate.targetId,\n\t\t\t\tspace,\n\t\t\t\ttargetHash,\n\t\t\t\tliveMarker\n\t\t\t})\n\t\t};\n\t\tif (!isAppSpace && allStorageElementsExternal(space.contract())) {\n\t\t\tif (headRef.invariants.length > 0) return {\n\t\t\t\tkind: \"unsatisfiable\",\n\t\t\t\tspaceId: space.spaceId,\n\t\t\t\tisAppSpace,\n\t\t\t\ttargetHash,\n\t\t\t\tmissing: [...headRef.invariants].sort(),\n\t\t\t\ttargetInvariants: headRef.invariants,\n\t\t\t\ttargetSpace: space,\n\t\t\t\tliveHash: liveHash ?? EMPTY_CONTRACT_HASH,\n\t\t\t\trefName: void 0\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"ok\",\n\t\t\t\tplan: buildAtHeadResolution({\n\t\t\t\t\taggregateTargetId: aggregate.targetId,\n\t\t\t\t\tspace,\n\t\t\t\t\ttargetHash,\n\t\t\t\t\tliveMarker\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"never-planned\",\n\t\t\tspaceId: space.spaceId,\n\t\t\ttargetHash\n\t\t};\n\t}\n\tconst targetInvariants = isAppSpace && refInvariants !== void 0 ? refInvariants : headRef.invariants;\n\tconst targetSpace = targetHash === headRef.hash && targetInvariants === headRef.invariants ? space : {\n\t\t...space,\n\t\theadRef: {\n\t\t\thash: targetHash,\n\t\t\tinvariants: targetInvariants\n\t\t}\n\t};\n\tconst walked = resolveRecordedPath({\n\t\taggregateTargetId: aggregate.targetId,\n\t\tspace: targetSpace,\n\t\tcurrentMarker: liveMarker,\n\t\t...isAppSpace && refName !== void 0 ? { refName } : {},\n\t\tstorageNameOf\n\t});\n\tif (walked.kind === \"unreachable\") return {\n\t\tkind: \"unreachable\",\n\t\tspaceId: space.spaceId,\n\t\tliveMarker,\n\t\ttargetHash\n\t};\n\tif (walked.kind === \"unsatisfiable\") {\n\t\tconst liveHash = liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\t\treturn {\n\t\t\tkind: \"unsatisfiable\",\n\t\t\tspaceId: space.spaceId,\n\t\t\tisAppSpace,\n\t\t\ttargetHash,\n\t\t\tmissing: walked.missing,\n\t\t\ttargetInvariants,\n\t\t\ttargetSpace,\n\t\t\tliveHash,\n\t\t\trefName\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"ok\",\n\t\tplan: walked.result\n\t};\n}\n/** Every contract space's outcome, keyed by space, the application space first. */\nfunction planSpaces(args) {\n\tconst { aggregate, appTarget } = args;\n\treturn new Map([aggregate.app, ...aggregate.extensions].map((space) => {\n\t\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\t\tconst outcome = planSpacePath({\n\t\t\tspace,\n\t\t\taggregate,\n\t\t\ttargetHash: isAppSpace ? appTarget.hash : requireHeadRef(space).hash,\n\t\t\trefInvariants: isAppSpace ? appTarget.invariants : void 0,\n\t\t\tliveMarker: args.markers.get(space.spaceId) ?? null,\n\t\t\t...isAppSpace ? ifDefined(\"refName\", appTarget.refName) : {},\n\t\t\tstorageNameOf: args.storageNameOf\n\t\t});\n\t\treturn [space.spaceId, outcome];\n\t}));\n}\n/**\n* Plans every contract space from the database's markers and refuses with\n* `MIGRATION.MARKER_MISMATCH` for the first space, the application space first, whose marker is\n* outside its graph, before any other failure a space reports. `db migrate`, `db migrate --show`\n* and the control API's `migrate` all decide it here, so they refuse the same database with the\n* same envelope.\n*/\nasync function planEverySpace(args) {\n\tconst { aggregate } = args;\n\tconst planned = planSpaces(args);\n\tconst continuing = /* @__PURE__ */ new Map();\n\tfor (const space of [aggregate.app, ...aggregate.extensions]) {\n\t\tconst outcome = planned.get(space.spaceId);\n\t\tif (outcome === void 0) throw new InternalError(`Unreachable: no planned outcome for space \"${space.spaceId}\"`);\n\t\tif (outcome.kind !== \"marker-outside-graph\") {\n\t\t\tcontinuing.set(space.spaceId, outcome);\n\t\t\tcontinue;\n\t\t}\n\t\treturn notOk(errorMarkerMismatch({\n\t\t\tspaceId: space.spaceId,\n\t\t\towner: space.spaceId === aggregate.app.spaceId ? {\n\t\t\t\tkind: \"application\",\n\t\t\t\temittedContractHash: requireHeadRef(space).hash\n\t\t\t} : { kind: \"extension\" },\n\t\t\tmarkerHash: outcome.markerHash,\n\t\t\ttargetHash: outcome.targetHash,\n\t\t\tgraph: space.graph(),\n\t\t\tmigrationsDir: args.migrationsDir,\n\t\t\tledger: await readLedgerQuietly(() => args.readLedger(space.spaceId)),\n\t\t\tinvocation: args.invocation,\n\t\t\tchange: args.change,\n\t\t\ttargetRefName: space.spaceId === aggregate.app.spaceId ? args.appTarget.refName : void 0\n\t\t}));\n\t}\n\treturn ok(continuing);\n}\n/**\n* Build a zero-op {@link PerSpacePlan} for an empty-graph space —\n* either one whose live marker already matches the target (at-head), or\n* an all-external extension space whose marker must advance to the head\n* ref with no DDL (declared-state). Lets the apply pipeline thread the\n* space through `perSpacePlans` -> `applyOrder` -> the success\n* envelope's `perSpace[]` block so the result reflects every loaded\n* space, even when there is nothing to execute.\n*/\nfunction buildAtHeadResolution(args) {\n\tconst { aggregateTargetId, space, targetHash, liveMarker } = args;\n\treturn {\n\t\tplan: {\n\t\t\ttargetId: aggregateTargetId,\n\t\t\tspaceId: space.spaceId,\n\t\t\torigin: liveMarker === null ? null : { storageHash: liveMarker.storageHash },\n\t\t\tdestination: { storageHash: targetHash },\n\t\t\toperations: [],\n\t\t\tprovidedInvariants: []\n\t\t},\n\t\tdisplayOps: [],\n\t\tdestinationContract: space.contract(),\n\t\tstrategy: \"declared-state\",\n\t\tappliedStatements: [],\n\t\tdataLoss: [],\n\t\taccessChanges: [],\n\t\ttemporaryValues: [],\n\t\tmigrationEdges: [buildFabricatedMigrationEdge({\n\t\t\tcurrentMarkerStorageHash: liveMarker?.storageHash,\n\t\t\tdestinationStorageHash: targetHash,\n\t\t\toperationCount: 0\n\t\t})]\n\t};\n}\n/** Handing this plan to the runner would write a marker the database never had. */\nfunction leavesUnmarkedSpaceUntouched(entry) {\n\treturn !entry.plan.origin && !planRequiresExecution(entry);\n}\n/**\n* A plan needs the runner when it executes operations or advances the\n* space's marker (a declared-state resolution has zero operations but a\n* destination hash the live marker doesn't carry yet).\n*/\nfunction planRequiresExecution(entry) {\n\tif (entry.plan.operations.length > 0) return true;\n\treturn contractHashAtMarker(entry.plan.origin) !== entry.plan.destination.storageHash;\n}\nfunction buildSuccess(args) {\n\tconst appResolution = args.orderedResolutions.find((r) => r.spaceId === args.aggregate.app.spaceId);\n\tconst appMarkerHash = appResolution?.entry.plan.destination.storageHash ?? requireHeadRef(args.aggregate.app).hash;\n\tconst applied = args.orderedResolutions.flatMap((r) => {\n\t\treturn r.entry.migrationEdges.map((edge) => ({\n\t\t\tspaceId: r.spaceId,\n\t\t\tdirName: edge.dirName,\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to,\n\t\t\toperationsExecuted: edge.operationCount\n\t\t}));\n\t});\n\tconst appPlan = appResolution?.entry;\n\tconst pathDecision = appPlan?.pathDecision ? {\n\t\tfromHash: appPlan.pathDecision.fromHash,\n\t\ttoHash: appPlan.pathDecision.toHash,\n\t\talternativeCount: appPlan.pathDecision.alternativeCount,\n\t\ttieBreakReasons: appPlan.pathDecision.tieBreakReasons,\n\t\t...appPlan.pathDecision.refName !== void 0 ? { refName: appPlan.pathDecision.refName } : {},\n\t\trequiredInvariants: appPlan.pathDecision.requiredInvariants ?? [],\n\t\tsatisfiedInvariants: appPlan.pathDecision.satisfiedInvariants ?? [],\n\t\tselectedPath: appPlan.pathDecision.selectedPath.map((entry) => ({\n\t\t\tdirName: entry.dirName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tinvariants: entry.invariants\n\t\t}))\n\t} : void 0;\n\treturn {\n\t\tmigrationsApplied: applied.length,\n\t\tmarkerHash: appMarkerHash,\n\t\tapplied,\n\t\tsummary: args.summary,\n\t\tperSpace: args.perSpace,\n\t\t...pathDecision !== void 0 ? { pathDecision } : {}\n\t};\n}\n/**\n* Build the `neverPlanned` failure raised when a contract space that\n* declares managed storage elements has no on-disk migration graph but\n* migrate was asked to reach a target hash. All-external spaces never reach\n* this: they resolve declaratively (marker advances to the head ref with\n* zero operations). The `why` states only the condition; the recovery\n* sequence is composed by `errorPathUnreachable`'s `fix`.\n*\n* @internal Exported for testing only.\n*/\nfunction buildNeverPlannedFailure(spaceId, targetHash, migrationsDir) {\n\treturn errorPathUnreachable({\n\t\tsummary: `No on-disk migrations for contract space \"${spaceId}\"`,\n\t\twhy: `migrate is replay-only: a contract space that declares managed storage elements must have an authored migration graph on disk. Space \"${spaceId}\" has no migrations under \\`${migrationsDir}/${spaceId}/\\` but its head ref targets \"${targetHash}\".`,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\ttargetHash,\n\t\t\tkind: \"neverPlanned\"\n\t\t}\n\t});\n}\n/**\n* Build the `pathUnreachable` failure raised when an emitted contract has no\n* on-disk migration edge from the current marker to the target. The `why`\n* states only the condition (no edge between the two named states, and migrate\n* replays edges rather than inventing them); the recovery sequence — plan the\n* edge, then re-apply — is composed by `errorPathUnreachable`'s `fix`, so the\n* two read as one non-redundant plan-then-apply story.\n*\n* @internal Exported for testing only.\n*/\nfunction buildPathNotFoundFailure(spaceId, marker, targetHash) {\n\tconst fromHash = marker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\tconst fromText = marker === null ? \"the empty contract\" : `the current state \"${fromHash}\"`;\n\treturn errorPathUnreachable({\n\t\tsummary: spaceId === \"app\" ? \"Current contract has no planned migration path\" : `Current contract has no planned migration path for contract space \"${spaceId}\"`,\n\t\twhy: `No migration edge connects ${fromText} to the target \"${targetHash}\" in contract space \"${spaceId}\". The on-disk migration graph does not join the two, and migrate replays existing edges — it never invents one.`,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\tfromHash,\n\t\t\ttargetHash,\n\t\t\tkind: \"pathUnreachable\"\n\t\t}\n\t});\n}\nfunction failedMigrationOnDisk(failed, migrationsDir) {\n\treturn {\n\t\tdirectory: join(migrationsDir, failed.spaceId, failed.edge.dirName),\n\t\tfrom: failed.edge.from\n\t};\n}\n//#endregion\n//#region src/control-api/client.ts\n/**\n* Creates a programmatic control client for Prisma ORM operations.\n*\n* The client accepts framework component descriptors at creation time,\n* manages driver lifecycle via connect()/close(), and exposes domain\n* operations that delegate to the existing family instance methods.\n*\n* @see {@link ControlClient} for the client interface\n* @see README.md \"Programmatic Control API\" section for usage examples\n*/\nfunction sourceWarningsOf(warnings) {\n\treturn ifDefined(\"sourceWarnings\", warnings.length > 0 ? warnings : void 0);\n}\nfunction createControlClient(options) {\n\treturn new ControlClientImpl(options);\n}\n/**\n* Implementation of ControlClient.\n* Manages initialization and connection state, delegates operations to family instance.\n*/\nvar ControlClientImpl = class {\n\toptions;\n\tstack = null;\n\tdriver = null;\n\tfamilyInstance = null;\n\tframeworkComponents = null;\n\tinitialized = false;\n\tdefaultConnection;\n\t/** One per client so the verified-hash memo spans operations (e.g. db update's pre-plan + consented apply). */\n\tsnapshotVerifier;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.defaultConnection = options.connection;\n\t\tthis.snapshotVerifier = snapshotVerifierFor(options);\n\t}\n\tinit() {\n\t\tif (this.initialized) return;\n\t\tthis.stack = createControlStack({\n\t\t\tfamily: this.options.family,\n\t\t\ttarget: this.options.target,\n\t\t\tadapter: this.options.adapter,\n\t\t\tdriver: this.options.driver,\n\t\t\textensions: this.options.extensions\n\t\t});\n\t\tthis.familyInstance = this.options.family.create(this.stack);\n\t\tconst rawComponents = [\n\t\t\tthis.options.target,\n\t\t\tthis.options.adapter,\n\t\t\t...this.options.extensions ?? []\n\t\t];\n\t\tthis.frameworkComponents = assertFrameworkComponentsCompatible(this.options.family.familyId, this.options.target.targetId, rawComponents);\n\t\tthis.initialized = true;\n\t}\n\tasync connect(connection, options) {\n\t\tthis.init();\n\t\tif (this.driver) throw new CliStructuredError(\"DRIVER.ALREADY_CONNECTED\", \"Already connected. Call close() before reconnecting.\");\n\t\tconst resolvedConnection = connection ?? this.defaultConnection;\n\t\tif (resolvedConnection === void 0) throw new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"No connection provided. Pass a connection to connect() or provide a default connection when creating the client.\");\n\t\tif (!this.stack?.driver) throw new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is not configured. Pass a driver descriptor when creating the control client to enable database operations.\");\n\t\tthis.driver = await this.stack.driver.create(blindCast(resolvedConnection), options);\n\t}\n\tasync close() {\n\t\tif (this.driver) {\n\t\t\tawait this.driver.close();\n\t\t\tthis.driver = null;\n\t\t}\n\t}\n\t/**\n\t* Construct the control adapter once for a migration operation and return\n\t* it, mirroring how the runtime plane builds the execution adapter once in\n\t* `createExecutionStack`. Only `dbInit` / `dbUpdate` need it (it lowers the\n\t* planner's DDL); read-only operations never build it. The descriptor is\n\t* optional on the stack — targets without migrations omit it.\n\t*/\n\tbuildControlAdapter() {\n\t\tthis.init();\n\t\tif (!this.stack?.adapter) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" requires an adapter for migrations`);\n\t\treturn this.stack.adapter.create(this.stack);\n\t}\n\tasync ensureConnected() {\n\t\tthis.init();\n\t\tif (!this.driver && this.defaultConnection !== void 0) await this.connect(this.defaultConnection);\n\t\tif (!this.driver || !this.familyInstance || !this.frameworkComponents) throw new CliStructuredError(\"DRIVER.NOT_CONNECTED\", \"Not connected. Call connect(connection) first.\");\n\t\treturn {\n\t\t\tdriver: this.driver,\n\t\t\tfamilyInstance: this.familyInstance,\n\t\t\tframeworkComponents: this.frameworkComponents\n\t\t};\n\t}\n\tasync connectWithProgress(connection, action, onProgress) {\n\t\tif (connection === void 0) return;\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"connect\",\n\t\t\tlabel: \"Connecting to database...\"\n\t\t});\n\t\ttry {\n\t\t\tawait this.connect(connection);\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"connect\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"connect\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync verify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"verify\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\t...ifDefined(\"meta\", contractValidationMeta(error))\n\t\t\t});\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"verify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"verify\",\n\t\t\tlabel: \"Verifying database marker...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.verify({\n\t\t\t\tdriver,\n\t\t\t\tcontract,\n\t\t\t\texpectedTargetId: this.options.target.targetId,\n\t\t\t\tcontractPath: \"\"\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"verify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"verify\",\n\t\t\t\toutcome: result.ok ? \"ok\" : \"error\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"verify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"verify\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync schemaVerify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"schemaVerify\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\t...ifDefined(\"meta\", contractValidationMeta(error))\n\t\t\t});\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"schemaVerify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"schemaVerify\",\n\t\t\tlabel: \"Verifying database schema...\"\n\t\t});\n\t\ttry {\n\t\t\tconst schema = await familyInstance.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract\n\t\t\t});\n\t\t\tconst result = familyInstance.verifySchema({\n\t\t\t\tcontract,\n\t\t\t\tschema,\n\t\t\t\tstrict: options.strict ?? false,\n\t\t\t\tframeworkComponents\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"schemaVerify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"schemaVerify\",\n\t\t\t\toutcome: result.ok ? \"ok\" : \"error\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"schemaVerify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"schemaVerify\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync dbInit(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbInit\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tconst adapter = this.buildControlAdapter();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\t...ifDefined(\"meta\", contractValidationMeta(error))\n\t\t\t});\n\t\t}\n\t\treturn executeDbInit({\n\t\t\tdriver,\n\t\t\tinvocation: options.invocation,\n\t\t\t...ifDefined(\"onPlannerWarnings\", options.onPlannerWarnings),\n\t\t\tadapter,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmode: options.mode,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\t...ifDefined(\"verifySnapshotContent\", this.snapshotVerifier),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbUpdate(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbUpdate\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tconst adapter = this.buildControlAdapter();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\t...ifDefined(\"meta\", contractValidationMeta(error))\n\t\t\t});\n\t\t}\n\t\treturn executeDbUpdate({\n\t\t\tdriver,\n\t\t\tinvocation: options.invocation,\n\t\t\t...ifDefined(\"onPlannerWarnings\", options.onPlannerWarnings),\n\t\t\tadapter,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmode: options.mode,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\t...ifDefined(\"acceptDataLoss\", options.acceptDataLoss),\n\t\t\t...ifDefined(\"acceptAccessChanges\", options.acceptAccessChanges),\n\t\t\t...ifDefined(\"ref\", options.ref),\n\t\t\t...ifDefined(\"permitPolicyChange\", options.permitPolicyChange),\n\t\t\t...ifDefined(\"statements\", options.statements),\n\t\t\tanswerQuestions: options.answerQuestions,\n\t\t\t...ifDefined(\"verifySnapshotContent\", this.snapshotVerifier),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbVerify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbVerify\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\treturn executeDbVerify({\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tcontract: options.contract,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\tframeworkComponents,\n\t\t\tmode: options.strict ? \"strict\" : \"lenient\",\n\t\t\tskipSchema: options.skipSchema,\n\t\t\tskipMarker: options.skipMarker,\n\t\t\t...ifDefined(\"verifySnapshotContent\", this.snapshotVerifier),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbSign(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbSign\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\treturn executeDbSign({\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tcontract: options.contract,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\tframeworkComponents,\n\t\t\tinvocation: options.invocation,\n\t\t\t...ifDefined(\"verifySnapshotContent\", this.snapshotVerifier),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync readMarker() {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readMarker({\n\t\t\tdriver,\n\t\t\tspace: APP_SPACE_ID\n\t\t});\n\t}\n\tasync readAllMarkers() {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readAllMarkers({ driver });\n\t}\n\t/** Reads the per-migration journal; omit `space` to return every space. */\n\tasync readLedger(space) {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readLedger({\n\t\t\tdriver,\n\t\t\t...ifDefined(\"space\", space)\n\t\t});\n\t}\n\tasync migrate(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"migrate\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\t...ifDefined(\"meta\", contractValidationMeta(error))\n\t\t\t});\n\t\t}\n\t\treturn executeMigrate({\n\t\t\tdriver,\n\t\t\tinvocation: options.invocation,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\t...ifDefined(\"target\", options.target),\n\t\t\t...ifDefined(\"permitPolicyChange\", options.permitPolicyChange),\n\t\t\t...ifDefined(\"verifySnapshotContent\", this.snapshotVerifier),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync introspect(options) {\n\t\tconst onProgress = options?.onProgress;\n\t\tawait this.connectWithProgress(options?.connection, \"introspect\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\toptions?.schema;\n\t\tonProgress?.({\n\t\t\taction: \"introspect\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"introspect\",\n\t\t\tlabel: \"Introspecting database schema...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.introspect({ driver });\n\t\t\tonProgress?.({\n\t\t\t\taction: \"introspect\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"introspect\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"introspect\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"introspect\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\ttoSchemaView(schemaIR) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasSchemaView(this.familyInstance)) return this.familyInstance.toSchemaView(schemaIR);\n\t}\n\tasync inferPslContract(schemaIR) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasPslContractInfer(this.familyInstance)) return this.familyInstance.inferPslContract(schemaIR);\n\t}\n\tgetPslBlockDescriptors() {\n\t\tthis.init();\n\t\treturn this.stack.authoringContributions.pslBlockDescriptors;\n\t}\n\ttoOperationPreview(operations) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasOperationPreview(this.familyInstance)) return this.familyInstance.toOperationPreview(operations);\n\t}\n\tasync emit(options) {\n\t\tconst { onProgress, contractConfig } = options;\n\t\tthis.init();\n\t\tif (!this.familyInstance) throw new InternalError(\"Family instance was not initialized. This is a bug.\");\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"resolveSource\",\n\t\t\tlabel: \"Resolving contract source...\"\n\t\t});\n\t\tconst loaded = await loadContractSourceWithStack({\n\t\t\tstack: this.stack,\n\t\t\tsource: contractConfig.source,\n\t\t\tcwd: void 0\n\t\t});\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: \"resolveSource\",\n\t\t\toutcome: loaded.ok ? \"ok\" : \"error\"\n\t\t});\n\t\tif (!loaded.ok) {\n\t\t\tconst { error, sourceDiagnostics, warnings } = loaded.failure;\n\t\t\tconst thrownBySource = error.code !== \"CONTRACT.SOURCE_LOAD_FAILED\";\n\t\t\treturn notOk({\n\t\t\t\tcode: \"CONTRACT_SOURCE_INVALID\",\n\t\t\t\tsummary: sourceDiagnostics?.summary ?? error.message,\n\t\t\t\twhy: error.why,\n\t\t\t\tmeta: thrownBySource ? {\n\t\t\t\t\tcode: error.code,\n\t\t\t\t\t...error.meta\n\t\t\t\t} : sourceDiagnostics?.meta,\n\t\t\t\t...ifDefined(\"diagnostics\", sourceDiagnostics),\n\t\t\t\t...sourceWarningsOf(warnings)\n\t\t\t});\n\t\t}\n\t\tconst { contract, warnings } = loaded.value;\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"emit\",\n\t\t\tlabel: \"Emitting contract...\"\n\t\t});\n\t\ttry {\n\t\t\tconst enrichedIR = enrichContract(contract, this.frameworkComponents ?? []);\n\t\t\tconst rawContractJson = this.options.target.contractSerializer.serializeContract(enrichedIR);\n\t\t\tlet deserializedContract;\n\t\t\ttry {\n\t\t\t\tdeserializedContract = this.familyInstance.deserializeContract(rawContractJson);\n\t\t\t} catch (error) {\n\t\t\t\tonProgress?.({\n\t\t\t\t\taction: \"emit\",\n\t\t\t\t\tkind: \"spanEnd\",\n\t\t\t\t\tspanId: \"emit\",\n\t\t\t\t\toutcome: \"error\"\n\t\t\t\t});\n\t\t\t\treturn notOk({\n\t\t\t\t\tcode: \"CONTRACT_VALIDATION_FAILED\",\n\t\t\t\t\tsummary: \"Contract validation failed\",\n\t\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tmeta: void 0,\n\t\t\t\t\t...sourceWarningsOf(warnings)\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst result = await this.emitArtifacts(deserializedContract, keepInternalSpecifiers);\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"emit\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn ok({\n\t\t\t\tstorageHash: result.storageHash,\n\t\t\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\t\t\tprofileHash: result.profileHash,\n\t\t\t\tcontractJson: result.contractJson,\n\t\t\t\tcontractDts: result.contractDts,\n\t\t\t\t...sourceWarningsOf(warnings)\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"emit\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\treturn notOk({\n\t\t\t\tcode: \"EMIT_FAILED\",\n\t\t\t\tsummary: \"Failed to emit contract\",\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tmeta: void 0,\n\t\t\t\t...sourceWarningsOf(warnings)\n\t\t\t});\n\t\t}\n\t}\n\tasync renderContractDts(options) {\n\t\tthis.init();\n\t\tif (!this.familyInstance) throw new InternalError(\"Family instance was not initialized. This is a bug.\");\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = this.familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\treturn notOk({\n\t\t\t\tcode: \"CONTRACT_VALIDATION_FAILED\",\n\t\t\t\tsummary: \"Contract validation failed\",\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\ttry {\n\t\t\tconst { contractDts } = await this.emitArtifacts(contract, options.resolveImportSpecifier ?? keepInternalSpecifiers);\n\t\t\treturn ok({ contractDts });\n\t\t} catch (error) {\n\t\t\treturn notOk({\n\t\t\t\tcode: \"RENDER_FAILED\",\n\t\t\t\tsummary: \"Failed to render contract types\",\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n\temitArtifacts(contract, resolveImportSpecifier) {\n\t\tconst familyInstance = this.familyInstance;\n\t\tif (!familyInstance) throw new InternalError(\"Family instance was not initialized. This is a bug.\");\n\t\tconst { contractSerializer } = this.options.target;\n\t\treturn emit(contract, this.stack, this.options.family.emission, {\n\t\t\tserializeContract: (c) => contractSerializer.serializeContract(c),\n\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t\tresolveImportSpecifier,\n\t\t\t...ifDefined(\"shouldPreserveEmpty\", contractSerializer.shouldPreserveEmpty),\n\t\t\t...ifDefined(\"sortStorage\", contractSerializer.sortStorage),\n\t\t\t...ifDefined(\"supportsNamespaces\", this.options.target.supportsNamespaces)\n\t\t});\n\t}\n};\n//#endregion\n//#region src/utils/emit-queue.ts\n/**\n* Per-output FIFO queue for `executeContractEmit`.\n*\n* Ensures that at most one emit (load → resolve source → emit bytes → publish)\n* runs per output JSON path at a time. Concurrent calls for the same path\n* line up behind the in-flight one and run in submission order; the user-visible\n* outcome is \"last submission wins on disk\" without any supersession bookkeeping.\n*\n* Long-lived hosts (Vite dev server, watch CLIs) must call `disposeEmitQueue`\n* when they stop publishing to a path, otherwise the module-global `Map`\n* accumulates one entry per unique output path for the lifetime of the process.\n*/\nconst emitQueues = /* @__PURE__ */ new Map();\nfunction queueEmitByOutput(outputJsonPath, action) {\n\tconst next = (emitQueues.get(outputJsonPath) ?? Promise.resolve()).then(action, action);\n\temitQueues.set(outputJsonPath, next);\n\treturn next;\n}\nfunction disposeEmitQueue(outputJsonPath) {\n\temitQueues.delete(outputJsonPath);\n}\n//#endregion\n//#region src/utils/project-import-root.ts\n/**\n* The import root of the project being emitted for, read from its own\n* manifest.\n*\n* Generated files are kept by the application, so every package name in them\n* has to be one the application can resolve — which means one of its direct\n* dependencies (ADR 242). The application already states those in\n* `package.json`, so emission reads them instead of taking a mode from\n* configuration that could disagree with what is installed.\n*/\nconst DEPENDENCY_FIELDS = [\"dependencies\", \"devDependencies\"];\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** The error codes that mean \"no manifest here\", as opposed to \"cannot read it\". */\nconst MANIFEST_ABSENT_CODES = /* @__PURE__ */ new Set([\"ENOENT\", \"ENOTDIR\"]);\nfunction errorCode(error) {\n\tif (!isRecord$1(error)) return void 0;\n\tconst code = error[\"code\"];\n\treturn typeof code === \"string\" ? code : void 0;\n}\n/**\n* The nearest `package.json` at or above `from`, or `undefined` if there is\n* none. The nearest one wins: a package inside a workspace states its own\n* dependencies, and the workspace root's are somebody else's.\n*\n* @throws {CliStructuredError} when a manifest is there but cannot be used —\n* unreadable, not valid JSON, or not a JSON object. Only \"there is no manifest\n* at this level\" continues the walk up; treating a permissions failure that\n* way would silently emit against the wrong project's dependencies.\n*/\nfunction nearestManifest(from) {\n\tlet dir = from;\n\twhile (true) {\n\t\tconst path = join(dir, \"package.json\");\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = readFileSync(path, \"utf8\");\n\t\t} catch (cause) {\n\t\t\tif (!MANIFEST_ABSENT_CODES.has(errorCode(cause) ?? \"\")) throw errorRuntime(\"CLI.PROJECT_MANIFEST_UNREADABLE\", `Failed to read ${path}`, {\n\t\t\t\twhy: `\\`${path}\\` exists but could not be read: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: `Make \\`${path}\\` readable, then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\t\tmeta: { path },\n\t\t\t\tcause\n\t\t\t});\n\t\t\tconst parent = dirname(dir);\n\t\t\tif (parent === dir) return void 0;\n\t\t\tdir = parent;\n\t\t\tcontinue;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch (cause) {\n\t\t\tthrow errorRuntime(\"CLI.PROJECT_MANIFEST_INVALID\", `Failed to parse ${path}`, {\n\t\t\t\twhy: `\\`${path}\\` is not valid JSON: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: `Fix the JSON syntax in \\`${path}\\` (a missing comma or unbalanced brace is the most common cause), then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\t\tmeta: { path },\n\t\t\t\tcause\n\t\t\t});\n\t\t}\n\t\tif (!isRecord$1(parsed)) throw errorRuntime(\"CLI.PROJECT_MANIFEST_INVALID\", `Failed to read ${path}`, {\n\t\t\twhy: `\\`${path}\\` is valid JSON but not a JSON object, so it states no dependencies.`,\n\t\t\tfix: `Make \\`${path}\\` a JSON object with the usual manifest fields, then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\tmeta: { path }\n\t\t});\n\t\treturn {\n\t\t\tmanifest: parsed,\n\t\t\tpath\n\t\t};\n\t}\n}\nfunction declaredDependencies(manifest) {\n\treturn DEPENDENCY_FIELDS.flatMap((field) => {\n\t\tconst value = manifest[field];\n\t\treturn isRecord$1(value) ? Object.keys(value) : [];\n\t});\n}\n/**\n* The import root for the project at `projectDir`, or for the working\n* directory when no project directory is known.\n*\n* A project with no manifest, or one that names no published package, is on\n* the internal root — which emits every specifier exactly as authored, so a\n* project that has not moved to published names is unaffected.\n*/\nfunction projectImportRoot(projectDir) {\n\tconst nearest = nearestManifest(projectDir === void 0 ? resolve(\".\") : resolve(projectDir));\n\tif (nearest === void 0) return internalImportRoot;\n\ttry {\n\t\treturn importRootForDependencies(declaredDependencies(nearest.manifest));\n\t} catch (cause) {\n\t\tif (!(cause instanceof ImportRootError)) throw cause;\n\t\tthrow errorRuntime(\"CLI.PROJECT_MANIFEST_INVALID\", `Failed to read ${nearest.path}`, {\n\t\t\twhy: `\\`${nearest.path}\\` states dependencies emission cannot import from: ${cause.message}.`,\n\t\t\tfix: `Keep one database facade in \\`${nearest.path}\\`, then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\tmeta: { path: nearest.path },\n\t\t\tcause\n\t\t});\n\t}\n}\n/** The specifier resolver emission should use for the project at `projectDir`. */\nfunction createProjectSpecifierResolver(projectDir) {\n\treturn createImportSpecifierResolver(projectImportRoot(projectDir));\n}\n//#endregion\n//#region src/utils/publish-contract-artifact-pair.ts\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction createTempArtifactPath(path, publicationToken, phase) {\n\treturn join(dirname(path), `.${basename(path)}.${process.pid}.${publicationToken}.${phase}.tmp`);\n}\nasync function readExistingArtifact(path) {\n\ttry {\n\t\treturn { content: await readFile(path, \"utf-8\") };\n\t} catch (error) {\n\t\tif (isRecord(error) && error[\"code\"] === \"ENOENT\") return \"remove\";\n\t\tthrow error;\n\t}\n}\nasync function restoreArtifact(path, previous, publicationToken) {\n\tif (previous === \"remove\") {\n\t\tawait rm(path, { force: true });\n\t\treturn;\n\t}\n\tconst restorePath = createTempArtifactPath(path, publicationToken, \"rollback\");\n\tawait writeFile(restorePath, previous.content, \"utf-8\");\n\ttry {\n\t\tawait rename(restorePath, path);\n\t} finally {\n\t\tawait rm(restorePath, { force: true });\n\t}\n}\nfunction withRollbackFailureCause(error, rollbackFailures) {\n\tconst rollbackCause = new AggregateError(rollbackFailures, \"Failed to restore published artifacts\");\n\tif (error instanceof Error) {\n\t\tObject.defineProperty(error, \"cause\", {\n\t\t\tvalue: rollbackCause,\n\t\t\tconfigurable: true,\n\t\t\twritable: true\n\t\t});\n\t\treturn error;\n\t}\n\treturn new Error(String(error), { cause: rollbackCause });\n}\nasync function publishPairWithRollback(entries, publicationToken) {\n\tconst replaced = [];\n\ttry {\n\t\tfor (const entry of entries) {\n\t\t\tawait rename(entry.tempPath, entry.outputPath);\n\t\t\treplaced.push(entry);\n\t\t}\n\t} catch (error) {\n\t\tconst rollbackFailures = (await Promise.allSettled(replaced.map((entry) => restoreArtifact(entry.outputPath, entry.previous, publicationToken)))).flatMap((result) => result.status === \"rejected\" ? [result.reason] : []);\n\t\tif (rollbackFailures.length > 0) throw withRollbackFailureCause(error, rollbackFailures);\n\t\tthrow error;\n\t}\n}\nasync function publishContractArtifactPair({ outputJsonPath, outputDtsPath, contractJson, contractDts, publicationToken, beforePublish }) {\n\tconst tempJsonPath = createTempArtifactPath(outputJsonPath, publicationToken, \"next\");\n\tconst tempDtsPath = createTempArtifactPath(outputDtsPath, publicationToken, \"next\");\n\ttry {\n\t\tawait writeFile(tempJsonPath, contractJson, \"utf-8\");\n\t\tawait writeFile(tempDtsPath, contractDts, \"utf-8\");\n\t\tif (await beforePublish?.() === false) return false;\n\t\tconst previousJson = await readExistingArtifact(outputJsonPath);\n\t\tawait publishPairWithRollback([{\n\t\t\ttempPath: tempDtsPath,\n\t\t\toutputPath: outputDtsPath,\n\t\t\tprevious: await readExistingArtifact(outputDtsPath)\n\t\t}, {\n\t\t\ttempPath: tempJsonPath,\n\t\t\toutputPath: outputJsonPath,\n\t\t\tprevious: previousJson\n\t\t}], publicationToken);\n\t\treturn true;\n\t} finally {\n\t\tawait Promise.allSettled([rm(tempJsonPath, { force: true }), rm(tempDtsPath, { force: true })]);\n\t}\n}\n//#endregion\n//#region src/utils/validate-contract-deps.ts\nconst IMPORT_PATTERN = /import\\s+type\\s+.*?\\s+from\\s+['\"](@[^/]+\\/[^/'\"]+)/g;\nfunction extractPackageSpecifiers(dtsContent) {\n\tconst packages = /* @__PURE__ */ new Set();\n\tfor (const match of dtsContent.matchAll(IMPORT_PATTERN)) {\n\t\tconst pkg = match[1];\n\t\tif (pkg) packages.add(pkg);\n\t}\n\treturn [...packages];\n}\nfunction validateContractDeps(dtsContent, projectRoot) {\n\tconst packages = extractPackageSpecifiers(dtsContent);\n\tconst resolve = createRequire(resolve$1(projectRoot, \"package.json\"));\n\tconst missing = [];\n\tfor (const pkg of packages) try {\n\t\tresolve.resolve(`${pkg}/package.json`);\n\t} catch {\n\t\tmissing.push(pkg);\n\t}\n\tif (missing.length === 0) return { missing };\n\treturn {\n\t\tmissing,\n\t\twarning: [\n\t\t\t\"contract.d.ts imports types from packages that are not installed:\",\n\t\t\tmissing.map((p) => ` - ${p}`).join(\"\\n\"),\n\t\t\t\"\",\n\t\t\t\"Install them with your package manager:\",\n\t\t\t...missing.map((p) => ` ${p}`)\n\t\t].join(\"\\n\")\n\t};\n}\n//#endregion\n//#region src/control-api/operations/contract-space-seed-phase.ts\n/**\n* Phase-1 of the two-phase `migration plan` pipeline (sub-spec § 4), and the\n* step of `contract emit` that writes each pack's pinned files.\n*\n* For every extension that exposes a `contractSpace`:\n*\n* 1. Read the on-disk head ref (returns `null` on first emit).\n* 2. Write the head contract into the migrations-root snapshot store\n* (write-if-absent, keyed by hash) and unconditionally re-emit\n* `refs/head.json`, via {@link emitContractSpaceArtifacts}. The\n* framework owns `refs/head.json`; re-emit is the contract for that\n* file. The snapshot itself is only written once per distinct hash.\n* 3. Materialise any descriptor-shipped migration packages not yet on\n* disk via {@link materialiseExtensionMigrationPackageIfMissing}.\n* Existing packages are left untouched (by-existence skip).\n*\n* The return value lets the caller render a per-space status line and\n* lets the phase-2 aggregate loader run on a now-consistent disk state\n* (every loaded extension is guaranteed to have its head ref pinned\n* to the descriptor's hash and to ship every package the descriptor\n* declares).\n*\n* Output ordering is deterministic and alphabetical by spaceId (via\n* {@link planAllSpaces}, which also detects duplicate spaceIds). This\n* matches the canonical sort order used by every other aggregate\n* surface (`migrate`, `migration status`, the runner).\n*/\nasync function runContractSpaceSeedPhase(inputs) {\n\tconst planned = planAllSpaces(inputs.extensions.filter((pack) => pack.contractSpace !== void 0).map((pack) => ({\n\t\tspaceId: pack.id,\n\t\tpriorContract: null,\n\t\tnewContract: pack.contractSpace.contractJson,\n\t\t__pack: pack.contractSpace\n\t})), (input) => input.__pack.migrations);\n\tconst descriptorBySpace = /* @__PURE__ */ new Map();\n\tfor (const pack of inputs.extensions) if (pack.contractSpace !== void 0) descriptorBySpace.set(pack.id, pack.contractSpace);\n\tconst seeded = [];\n\tfor (const space of planned) {\n\t\tconst descriptor = descriptorBySpace.get(space.spaceId);\n\t\tif (descriptor === void 0) continue;\n\t\tinputs.signal?.throwIfAborted();\n\t\tconst priorHash = (await readContractSpaceHeadRef(inputs.migrationsDir, space.spaceId))?.hash ?? null;\n\t\tconst artifacts = await emitContractSpaceArtifacts(inputs.migrationsDir, space.spaceId, {\n\t\t\tcontract: descriptor.contractJson,\n\t\t\tcontractDts: buildPlaceholderContractDts(space.spaceId),\n\t\t\theadRef: {\n\t\t\t\thash: descriptor.headRef.hash,\n\t\t\t\tinvariants: descriptor.headRef.invariants\n\t\t\t}\n\t\t});\n\t\tconst spaceDir = spaceMigrationDirectory(inputs.migrationsDir, space.spaceId);\n\t\tconst newMigrationDirs = [];\n\t\tfor (const pkg of space.migrationPackages) {\n\t\t\tinputs.signal?.throwIfAborted();\n\t\t\tconst { written } = await materialiseExtensionMigrationPackageIfMissing(spaceDir, pkg);\n\t\t\tif (written) newMigrationDirs.push(pkg.dirName);\n\t\t}\n\t\tconst action = priorHash !== descriptor.headRef.hash || newMigrationDirs.length > 0 ? \"updated\" : \"unchanged\";\n\t\tseeded.push({\n\t\t\tspaceId: space.spaceId,\n\t\t\taction,\n\t\t\tpriorHash,\n\t\t\tnewHash: descriptor.headRef.hash,\n\t\t\tnewMigrationDirs,\n\t\t\twrittenPaths: [...artifacts.writtenPaths, ...newMigrationDirs.map((dirName) => join(spaceDir, dirName))]\n\t\t});\n\t}\n\treturn { seeded };\n}\n/**\n* Placeholder `.d.ts` content for an extension space's on-disk mirror.\n*\n* Rendering a fully-typed `.d.ts` for an extension contract requires\n* the SQL-family renderer with the codec / typemap registry threaded\n* through; until that integration ships, the on-disk `.d.ts` is a\n* stub `export {};` module that documents how consumers should\n* validate the sibling `contract.json`. The stub typechecks on its\n* own and does not need any TypeScript suppressions.\n*/\nfunction buildPlaceholderContractDts(spaceId) {\n\treturn [\n\t\t\"/**\",\n\t\t` * Placeholder \\`.d.ts\\` for extension space \"${spaceId}\".`,\n\t\t\" *\",\n\t\t\" * The framework re-emits this file on every `migration plan` run\",\n\t\t\" * alongside `contract.json` and `refs/head.json`. A typed `.d.ts`\",\n\t\t\" * rendering pass for extension contracts is tracked separately;\",\n\t\t\" * until that ships, consumers should import `contract.json`\",\n\t\t\" * and pass it through the target descriptor’s `contractSerializer`.\",\n\t\t\" */\",\n\t\t\"export {};\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/control-api/operations/validate-loaded-contract.ts\n/**\n* Validates a contract its source loaded, as `contract emit` and `contract print` both do before\n* they write anything: the contract is enriched with what the configured components declare,\n* serialized by the target, and read back through the family instance, which checks its structure.\n* Returns the contract that comes back.\n*\n* @throws {CliStructuredError} when a configured component does not match the family and target\n* @throws the family instance's error for a contract whose structure it rejects\n*/\nfunction validateLoadedContract(input) {\n\tconst { config } = input;\n\tconst frameworkComponents = assertFrameworkComponentsCompatible(config.family.familyId, config.target.targetId, [\n\t\tconfig.target,\n\t\tconfig.adapter,\n\t\t...config.extensions ?? []\n\t]);\n\tconst enriched = enrichContract(input.contract, frameworkComponents);\n\treturn input.familyInstance.deserializeContract(config.target.contractSerializer.serializeContract(enriched));\n}\n//#endregion\n//#region src/control-api/operations/contract-emit.ts\nconst EMIT_ACTION = \"emit\";\nconst defaultContractEmitDependencies = { emit };\nfunction startSpan(onProgress, spanId, label) {\n\tonProgress?.({\n\t\taction: EMIT_ACTION,\n\t\tkind: \"spanStart\",\n\t\tspanId,\n\t\tlabel\n\t});\n}\nfunction endSpan(onProgress, spanId, outcome) {\n\tonProgress?.({\n\t\taction: EMIT_ACTION,\n\t\tkind: \"spanEnd\",\n\t\tspanId,\n\t\toutcome\n\t});\n}\n/**\n* Canonical contract emit operation.\n*\n* This is the SINGLE publication path used by both the CLI command\n* (`prisma contract emit`) and the Vite plugin\n* (`@internal/vite-plugin-contract-emit`). New callers must go through this\n* function rather than re-implementing load → emit → publish.\n*\n* Before publishing, it writes each composed extension pack's pinned files\n* under `migrations/<space-id>/`, as `migration plan` does, so a project\n* that never plans a migration can still sign its database, and returns\n* each path it wrote there. An `outputPath` writes the contract somewhere\n* other than the project, so it writes no pinned files.\n*\n* The whole flow (load config → resolve source → emit bytes → atomic publish)\n* is serialized per output JSON path via `queueEmitByOutput`. Concurrent calls\n* for the same output line up FIFO; the user-visible outcome is \"last\n* submission wins on disk\" without any supersession bookkeeping. Within a\n* single emit, `publishContractArtifactPair` stages temp files, renames\n* `contract.d.ts` before `contract.json`, and attempts to restore the previous\n* pair if either rename fails — so type-only consumers never observe a\n* mismatched pair.\n*\n* @throws {CliStructuredError} on config/source/validation problems\n* @throws {DOMException} `AbortError` if cancelled via `signal`\n*/\nasync function executeContractEmit(options, dependencies = defaultContractEmitDependencies) {\n\tconst { config, cwd, projectDir, outputPath, signal = new AbortController().signal, onProgress } = options;\n\tconst unlessAborted = abortable(signal);\n\tconst contractConfig = requireContractConfig(config);\n\tconst effectiveOutput = outputPath !== void 0 ? join(outputPath, \"contract.json\") : contractConfig.output;\n\tif (!effectiveOutput) throw errorContractConfigMissing({ why: \"Contract config must have output path. This should not happen if defineConfig() was used.\" });\n\trequireSourceProvider(contractConfig);\n\tlet outputPaths;\n\ttry {\n\t\toutputPaths = getEmittedArtifactPaths(effectiveOutput);\n\t} catch (error) {\n\t\tthrow errorContractConfigMissing({ why: error instanceof Error ? error.message : String(error) });\n\t}\n\tconst { jsonPath: outputJsonPath, dtsPath: outputDtsPath } = outputPaths;\n\treturn queueEmitByOutput(outputJsonPath, async () => {\n\t\tstartSpan(onProgress, \"resolveSource\", \"Resolving contract source...\");\n\t\tlet stack;\n\t\tlet contract;\n\t\tlet sourceWarnings;\n\t\ttry {\n\t\t\tstack = createControlStack(config);\n\t\t\tconst loaded = await loadContractSourceWithStack({\n\t\t\t\tstack,\n\t\t\t\tsource: contractConfig.source,\n\t\t\t\tsignal,\n\t\t\t\tcwd\n\t\t\t});\n\t\t\tif (!loaded.ok) throw withWarningFindings(loaded.failure.error, loaded.failure.warnings, cwd);\n\t\t\t({contract, warnings: sourceWarnings} = loaded.value);\n\t\t} catch (error) {\n\t\t\tendSpan(onProgress, \"resolveSource\", \"error\");\n\t\t\tthrow error;\n\t\t}\n\t\tendSpan(onProgress, \"resolveSource\", \"ok\");\n\t\tstartSpan(onProgress, \"emit\", \"Emitting contract...\");\n\t\tlet emitResult;\n\t\ttry {\n\t\t\tconst familyInstance = config.family.create(stack);\n\t\t\tconst deserializedContract = validateLoadedContract({\n\t\t\t\tconfig,\n\t\t\t\tfamilyInstance,\n\t\t\t\tcontract\n\t\t\t});\n\t\t\tconst { contractSerializer } = config.target;\n\t\t\tconst serializeContract = (c) => contractSerializer.serializeContract(c);\n\t\t\temitResult = await unlessAborted(dependencies.emit(deserializedContract, stack, config.family.emission, {\n\t\t\t\toutputJsonPath,\n\t\t\t\tserializeContract,\n\t\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t\t\tresolveImportSpecifier: createProjectSpecifierResolver(projectDir ?? dirname(outputJsonPath)),\n\t\t\t\t...ifDefined(\"shouldPreserveEmpty\", contractSerializer.shouldPreserveEmpty),\n\t\t\t\t...ifDefined(\"sortStorage\", contractSerializer.sortStorage),\n\t\t\t\t...ifDefined(\"supportsNamespaces\", config.target.supportsNamespaces)\n\t\t\t}));\n\t\t} catch (error) {\n\t\t\tendSpan(onProgress, \"emit\", \"error\");\n\t\t\tthrow error;\n\t\t}\n\t\tendSpan(onProgress, \"emit\", \"ok\");\n\t\tsignal.throwIfAborted();\n\t\tconst pinnedFiles = outputPath === void 0 ? (await unlessAborted(runContractSpaceSeedPhase({\n\t\t\tmigrationsDir: migrationsDirFor(config, cwd),\n\t\t\textensions: toExtensionInputs(config.extensions ?? []),\n\t\t\tsignal\n\t\t}))).seeded.flatMap(({ spaceId, writtenPaths }) => writtenPaths.map((path) => ({\n\t\t\tspaceId,\n\t\t\tpath\n\t\t}))) : [];\n\t\tawait unlessAborted(mkdir(dirname(outputJsonPath), { recursive: true }));\n\t\tawait publishContractArtifactPair({\n\t\t\toutputJsonPath,\n\t\t\toutputDtsPath,\n\t\t\tcontractJson: emitResult.contractJson,\n\t\t\tcontractDts: emitResult.contractDts,\n\t\t\tpublicationToken: String(process.hrtime.bigint())\n\t\t});\n\t\tconst validationWarning = validateContractDeps(emitResult.contractDts, dirname(outputDtsPath)).warning;\n\t\treturn {\n\t\t\tstorageHash: emitResult.storageHash,\n\t\t\t...ifDefined(\"executionHash\", emitResult.executionHash),\n\t\t\tprofileHash: emitResult.profileHash,\n\t\t\tfiles: {\n\t\t\t\tjson: outputJsonPath,\n\t\t\t\tdts: outputDtsPath\n\t\t\t},\n\t\t\tpinnedFiles,\n\t\t\t...ifDefined(\"validationWarning\", validationWarning),\n\t\t\t...ifDefined(\"sourceWarnings\", sourceWarnings.length > 0 ? sourceWarnings : void 0)\n\t\t};\n\t});\n}\n//#endregion\n//#region src/control-api/operations/snapshot-declarations.ts\nfunction errorContractDtsRenderFailed(contractJsonPath, failure) {\n\tconst why = failure.why ?? failure.summary;\n\tif (failure.code === \"CONTRACT_VALIDATION_FAILED\") return errorContractValidationFailed(`Contract at ${contractJsonPath} failed to deserialize: ${why}`, {\n\t\twhere: { path: contractJsonPath },\n\t\t...ifDefined(\"cause\", failure.cause),\n\t\tmeta: contractValidationMeta(failure.cause)\n\t});\n\treturn new CliStructuredError$1(\"CONTRACT.TYPES_RENDER_FAILED\", \"Failed to render contract types\", {\n\t\twhy: `The types for the contract at ${contractJsonPath} could not be rendered: ${why}`,\n\t\tfix: \"Run {bin} contract emit to see why the contract does not emit, fix it, then run the command again.\",\n\t\twhere: { path: contractJsonPath },\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n}\n/**\n* The `contract.d.ts` half of a snapshot, rendered from the `contract.json`\n* half through the control client. Every snapshot writer renders before it\n* writes anything, so a contract that cannot be snapshotted refuses the\n* command with nothing on disk changed.\n*/\nasync function renderSnapshotDeclarations(args) {\n\tconst rendered = await args.client.renderContractDts({\n\t\tcontract: args.contractJson,\n\t\tresolveImportSpecifier: args.resolveImportSpecifier\n\t});\n\tif (!rendered.ok) return notOk(errorContractDtsRenderFailed(args.contractJsonPath, rendered.failure));\n\treturn ok(rendered.value.contractDts);\n}\n//#endregion\n//#region src/control-api/operations/ref-advancement.ts\nconst NO_REF_ADVANCEMENT = {\n\tadvancedRef: null,\n\tplannedAdvanceRef: null\n};\nfunction computeRefAdvancementName(options) {\n\tif (options.advanceRef !== void 0) return options.advanceRef;\n\tif (options.db === void 0) return \"db\";\n\treturn null;\n}\n/**\n* Everything `executeRefAdvancement` needs, produced before a command does the\n* work that precedes the ref write: the ref name is validated and the\n* declarations of the contract to snapshot are rendered from its JSON, with\n* the import names the project owning `configPath` can resolve. Nothing is\n* read or rendered after the database is touched, so a contract that cannot\n* be snapshotted refuses the command before it changes anything.\n*/\nasync function preflightRefAdvancement(args) {\n\tif (!validateRefName(args.name)) return notOk(errorInvalidRefName(args.name));\n\tlet resolveImportSpecifier;\n\ttry {\n\t\tresolveImportSpecifier = createProjectSpecifierResolver(args.projectDir);\n\t} catch (error) {\n\t\tif (CliStructuredError$1.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tconst rendered = await renderSnapshotDeclarations({\n\t\tclient: args.client,\n\t\tcontractJson: args.contractJson,\n\t\tcontractJsonPath: args.contractJsonPath,\n\t\tresolveImportSpecifier\n\t});\n\tif (!rendered.ok) return rendered;\n\treturn ok({\n\t\tcontract: args.contractJson,\n\t\tcontractDts: rendered.value\n\t});\n}\nasync function executeRefAdvancement(refsDir, migrationsDir, name, hash, contractIR) {\n\tif (!validateRefName(name)) throw errorInvalidRefName(name);\n\tawait writeContractSnapshot(migrationsDir, hash, {\n\t\tcontractJson: contractIR.contract,\n\t\tcontractDts: contractIR.contractDts\n\t});\n\tawait advanceRef(refsDir, name, hash);\n\treturn {\n\t\tname,\n\t\thash\n\t};\n}\n/**\n* The ref-advancement tail of db init / db update, run after the database\n* work with the `ContractIR` that `preflightRefAdvancement` produced before\n* it. Plan mode reports the ref that an apply would advance without writing.\n*/\nasync function buildRefAdvancementFields(options) {\n\tif (options.mode === \"plan\") return ok({\n\t\tadvancedRef: null,\n\t\tplannedAdvanceRef: {\n\t\t\tname: options.name,\n\t\t\thash: options.hash\n\t\t}\n\t});\n\tconst advanced = await advanceRefSafely({\n\t\trefsDir: options.refsDir,\n\t\tmigrationsDir: options.migrationsDir,\n\t\tname: options.name,\n\t\thash: options.hash,\n\t\tcontractIR: options.contractIR\n\t});\n\tif (!advanced.ok) return advanced;\n\treturn ok({\n\t\tadvancedRef: advanced.value,\n\t\tplannedAdvanceRef: null\n\t});\n}\n/**\n* The --advance-ref tail of migrate and db sign: executeRefAdvancement with\n* MigrationToolsError failures passed through as notOk, others rethrown.\n*/\nasync function advanceRefSafely(args) {\n\ttry {\n\t\treturn ok(await executeRefAdvancement(args.refsDir, args.migrationsDir, args.name, args.hash, args.contractIR));\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/utils/contract-ref-forms.ts\nconst RECORDED_FORMS = [\n\t\"hash\",\n\t\"prefix\",\n\t\"ref name\",\n\t\"migration dir name\",\n\t\"<dir>^\"\n];\nfunction listForms(forms) {\n\treturn `${forms.slice(0, -1).join(\", \")}, or ${forms.at(-1)}`;\n}\n/** The forms that name a contract recorded in the migrations directory. */\nconst RECORDED_CONTRACT_REF_FORMS = listForms(RECORDED_FORMS);\n/** The recorded forms plus `@empty`. */\nconst RECORDED_OR_EMPTY_CONTRACT_REF_FORMS = listForms([...RECORDED_FORMS, EMPTY_CONTRACT_REF]);\n/** The recorded forms plus every reserved reference. */\nconst ALL_CONTRACT_REF_FORMS = listForms([...RECORDED_FORMS, ...RESERVED_CONTRACT_REFS]);\n//#endregion\n//#region src/control-api/operations/contract-snapshot-resolution.ts\n/**\n* Resolves a user-supplied contract reference to an on-disk contract JSON (snapshot store or emitted contract), shared by db sign and db update --to.\n*/\nfunction isEnoent$1(error) {\n\treturn error instanceof Error && \"code\" in error && error.code === \"ENOENT\";\n}\nfunction reservedRefRefusal(options) {\n\tconst { refInput: input, argument } = options;\n\tconst accepted = `${options.fallbackToEmitted ? \"a contract\" : \"a migration destination\"} recorded in the migrations directory`;\n\treturn {\n\t\tkind: \"wrong-grammar\",\n\t\tinput,\n\t\texpectedGrammar: \"contract\",\n\t\tmessage: `\"${input}\" is a reserved reference; ${argument} takes ${accepted} (${RECORDED_CONTRACT_REF_FORMS})`,\n\t\tfix: `Name ${accepted}, or omit ${argument} to use the emitted contract.`\n\t};\n}\nasync function resolveContractRefToSnapshot(options) {\n\tif (isReservedContractRef(options.refInput)) return notOk(mapRefResolutionError(reservedRefRefusal(options)));\n\ttry {\n\t\tconst loaded = await buildReadAggregate(options.config, { migrationsDir: options.migrationsDir });\n\t\tif (!loaded.ok) return notOk(loaded.failure);\n\t\tconst graph = loaded.value.aggregate.app.graph();\n\t\tconst bundles = loaded.value.aggregate.app.packages;\n\t\tconst refs = loaded.value.aggregate.app.refs;\n\t\tconst refResult = parseContractRef(options.refInput, {\n\t\t\tgraph,\n\t\t\trefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));\n\t\tconst targetHash = refResult.value.hash;\n\t\tconst { provenance } = refResult.value;\n\t\tconst refEntry = provenance.kind === \"ref\" ? refs[provenance.refName] : void 0;\n\t\tconst namedRef = provenance.kind === \"ref\" && refEntry !== void 0 ? {\n\t\t\tname: provenance.refName,\n\t\t\t...refEntry\n\t\t} : void 0;\n\t\tif (bundles.find((p) => p.metadata.to === targetHash)) return ok({\n\t\t\thash: targetHash,\n\t\t\tcontractJson: blindCast(await readContractSnapshotJson(options.migrationsDir, targetHash, snapshotVerifierFor(options.config))),\n\t\t\tcontractJsonPath: join(contractSnapshotDir(options.migrationsDir, targetHash), \"contract.json\"),\n\t\t\tsource: \"snapshot\",\n\t\t\t...ifDefined(\"ref\", namedRef)\n\t\t});\n\t\tif (!options.fallbackToEmitted) return notOk(errorUnexpected(`No migration bundle found for ${options.argument} \"${options.refInput}\" (resolved hash: ${targetHash})`, {\n\t\t\twhy: `The ref resolved successfully but no on-disk migration package has a destination (\\`to\\`) hash matching ${targetHash}.`,\n\t\t\tfix: \"Provide a ref or hash that corresponds to an existing migration package, or run `migration list` to see available migrations.\"\n\t\t}));\n\t\tlet defaultRaw;\n\t\ttry {\n\t\t\tdefaultRaw = await readFile(options.contractPathAbsolute, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tif (isEnoent$1(error)) return notOk(errorFileNotFound(options.contractPathAbsolute, {\n\t\t\t\twhy: `Contract file not found at ${options.contractPathAbsolute}`,\n\t\t\t\tfix: \"Run `{bin} contract emit` first to generate the contract\",\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t\treturn notOk(errorFromCaught(error, (message) => `Failed to read contract file: ${message}`));\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = castAs(JSON.parse(defaultRaw));\n\t\t} catch (error) {\n\t\t\treturn notOk(errorContractDeserializationFailed(options.contractPathAbsolute, error instanceof Error ? error.message : String(error), { cause: error }));\n\t\t}\n\t\tif (parsed === null || typeof parsed !== \"object\" || Array.isArray(parsed)) return notOk(errorContractDeserializationFailed(options.contractPathAbsolute, `expected a JSON object, got ${parsed === null ? \"null\" : Array.isArray(parsed) ? \"an array\" : `a ${typeof parsed}`}`));\n\t\tconst defaultContract = blindCast(parsed);\n\t\tconst storage = defaultContract[\"storage\"];\n\t\tif ((storage !== null && typeof storage === \"object\" ? blindCast(storage)[\"storageHash\"] : void 0) === targetHash) return ok({\n\t\t\thash: targetHash,\n\t\t\tcontractJson: defaultContract,\n\t\t\tcontractJsonPath: options.contractPathAbsolute,\n\t\t\tsource: \"emitted\",\n\t\t\t...ifDefined(\"ref\", namedRef)\n\t\t});\n\t\treturn notOk(errorRuntime(\"MIGRATION.SNAPSHOT_MISSING\", `No contract file found for hash \"${targetHash}\"`, {\n\t\t\twhy: `Resolved contract reference \"${options.refInput}\" to hash \"${targetHash}\" but no migration produces that hash and the emitted contract does not match.`,\n\t\t\tfix: \"Ensure the target contract exists on disk — either as a migration endpoint or as the emitted contract.json.\"\n\t\t}));\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tif (CliStructuredError$1.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/control-api/operations/ref-resolution.ts\nfunction resolveContractRef$1(input, context) {\n\tconst result = parseContractRef(input, context);\n\treturn result.ok ? ok(result.value) : notOk(mapRefResolutionError(result.failure));\n}\nfunction resolveMigrationRef(input, context) {\n\tconst result = parseMigrationRef(input, context);\n\treturn result.ok ? ok(result.value) : notOk(mapRefResolutionError(result.failure));\n}\n/** Where `--from`/`--to` read the live marker: an omitted or `@db` origin, and an `@db` target. */\nfunction liveMarkerUse(flags) {\n\tconst liveOrigin = flags.from === void 0 || isLiveMarkerRef(flags.from);\n\tconst liveTarget = isLiveMarkerRef(flags.to);\n\treturn {\n\t\tliveOrigin,\n\t\tliveTarget,\n\t\tneedsDatabase: liveOrigin || liveTarget\n\t};\n}\n/** The command a missing-connection error suggests: the user's flags as given, plus what the retry needs to run. */\nfunction retryCommandFor(args) {\n\tconst namesLiveMarker = isLiveMarkerRef(args.from) || isLiveMarkerRef(args.to);\n\tconst suggestsOffline = args.canRunOffline && args.from === void 0 && !namesLiveMarker;\n\tconst needsConnection = !args.canRunOffline || namesLiveMarker;\n\treturn [\n\t\t`{bin} ${args.commandName}`,\n\t\t...args.from === void 0 ? [] : [`--from ${args.from}`],\n\t\t...suggestsOffline ? [\"--from <contract>\"] : [],\n\t\t...args.to === void 0 ? [] : [`--to ${args.to}`],\n\t\t...args.rerunArgs ?? [],\n\t\t...needsConnection ? [\"--db $DATABASE_URL\"] : []\n\t].join(\" \");\n}\n/** The missing-connection error for a command whose `--from`/`--to` read the live marker, or `null`. */\nfunction requireDatabaseForLiveMarkerUse(args) {\n\tif (!liveMarkerUse(args).needsDatabase) return null;\n\treturn requireLiveDatabase({\n\t\tdbConnection: args.dbConnection,\n\t\thasDriver: args.hasDriver,\n\t\twhy: isLiveMarkerRef(args.from) || isLiveMarkerRef(args.to) ? `${LIVE_MARKER_REF} resolves to the live database marker and requires a --db connection` : `${args.commandName} needs a database connection to read the live marker (or pass --from <contract> to run offline)`,\n\t\tcommandName: args.commandName,\n\t\tretryCommand: retryCommandFor({\n\t\t\tcommandName: args.commandName,\n\t\t\tfrom: args.from,\n\t\t\tto: args.to,\n\t\t\tcanRunOffline: true\n\t\t})\n\t});\n}\n//#endregion\n//#region src/control-api/operations/contract-at-errors.ts\nfunction mapContractAtError(error, options) {\n\tif (MigrationToolsError.is(error)) switch (error.code) {\n\t\tcase \"MIGRATION.REF_NOT_RESOLVABLE\": return notOk(errorSnapshotMissing(typeof error.meta?.[\"refName\"] === \"string\" ? error.meta[\"refName\"] : typeof error.meta?.[\"identifier\"] === \"string\" ? error.meta[\"identifier\"] : \"unknown\", { cause: error }));\n\t\tcase \"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\": {\n\t\t\tconst filePath = typeof error.meta?.[\"filePath\"] === \"string\" ? error.meta[\"filePath\"] : \"unknown\";\n\t\t\treturn notOk(errorContractValidationFailed(`Predecessor contract at ${filePath} failed to deserialize: ${typeof error.meta?.[\"message\"] === \"string\" ? error.meta[\"message\"] : error.message}`, {\n\t\t\t\twhere: { path: filePath },\n\t\t\t\tcause: error,\n\t\t\t\tmeta: contractValidationMeta(error)\n\t\t\t}));\n\t\t}\n\t\tcase \"MIGRATION.INVALID_JSON\": {\n\t\t\tconst filePath = typeof error.meta?.[\"filePath\"] === \"string\" ? error.meta[\"filePath\"] : \"unknown\";\n\t\t\tconst message = typeof error.meta?.[\"parseError\"] === \"string\" ? error.meta[\"parseError\"] : error.message;\n\t\t\treturn notOk(errorContractValidationFailed((options?.artifactRole ?? \"from\") === \"to\" ? `Target contract at ${filePath} failed to deserialize: ${message}` : `Predecessor contract at ${filePath} failed to deserialize: ${message}`, {\n\t\t\t\twhere: { path: filePath },\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t}\n\t\tcase \"MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE\": return notOk(errorUnexpected(error.message, {\n\t\t\twhy: error.why,\n\t\t\tfix: error.fix,\n\t\t\tcause: error\n\t\t}));\n\t\tcase \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\": {\n\t\t\tconst expectedPath = typeof error.meta?.[\"expectedPath\"] === \"string\" ? error.meta[\"expectedPath\"] : \"migrations/snapshots/\";\n\t\t\treturn notOk(errorFileNotFound(expectedPath, {\n\t\t\t\twhy: (options?.artifactRole ?? \"from\") === \"to\" ? `Target migration is missing its contract snapshot at ${expectedPath}` : `Predecessor migration is missing its contract snapshot at ${expectedPath}`,\n\t\t\t\tfix: \"Restore migrations/snapshots/ from version control, or re-run the command that produced this migration to regenerate its snapshot.\",\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t}\n\t\tdefault: return notOk(error);\n\t}\n\tif (CliStructuredError$1.is(error)) return notOk(error);\n\tthrow error;\n}\n//#endregion\n//#region src/control-api/operations/invariants.ts\n/**\n* Invariant refusals shared by migrate and migration status: unknown ref invariants and unsatisfiable invariant paths.\n*/\n/** Refuses ref invariants neither declared on any graph edge nor present on the live marker. */\nfunction refuseUnknownInvariants(args) {\n\tconst declared = collectDeclaredInvariants(args.graph);\n\tconst known = new Set(declared);\n\tfor (const id of args.markerInvariants) known.add(id);\n\tconst unknown = args.refInvariants.filter((id) => !known.has(id));\n\tif (unknown.length === 0) return null;\n\treturn errorUnknownInvariant({\n\t\t...ifDefined(\"refName\", args.refName),\n\t\tunknown,\n\t\tdeclared: [...declared].sort()\n\t});\n}\n/** Refuses a --to target whose missing invariants no path from originHash satisfies. */\nfunction refuseMissingInvariantPath(args) {\n\tconst outcome = findPathWithDecision(args.graph, args.originHash, args.targetHash, {\n\t\t...ifDefined(\"refName\", args.refName),\n\t\trequired: new Set(args.missing)\n\t});\n\tif (outcome.kind !== \"unsatisfiable\") return null;\n\treturn errorNoInvariantPath({\n\t\t...ifDefined(\"refName\", args.refName),\n\t\trequired: [...args.missing].sort(),\n\t\tmissing: outcome.missing,\n\t\tstructuralPath: outcome.structuralPath.map(toStructuralEdge)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/migrate-show.ts\n/**\n* Computes the path through the SAME seam as `executeMigrate`:\n* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving\n* the full marker including `invariants` (not just `storageHash`).\n* - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,\n* which feeds `resolveRecordedPath()` with the same target hash, target invariants,\n* and current marker as the real apply path uses.\n*\n* Returns BEFORE any write boundary (`runMigration` / marker / DDL). No\n* DB state is mutated.\n*/\nasync function executeMigrateShowPlan(options) {\n\tconst config = options.config;\n\tconst { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(config, options.cwd);\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tconst driver = config.driver;\n\tconst hasExplicitFrom = options.from !== void 0;\n\tconst { liveOrigin, liveTarget, needsDatabase } = liveMarkerUse({\n\t\tfrom: options.from,\n\t\tto: options.to\n\t});\n\tconst missingDb = requireDatabaseForLiveMarkerUse({\n\t\tfrom: options.from,\n\t\tto: options.to,\n\t\tdbConnection,\n\t\thasDriver: driver !== void 0,\n\t\tcommandName: \"db migrate --show\"\n\t});\n\tif (missingDb) return notOk(missingDb);\n\tlet allRefs = {};\n\ttry {\n\t\tallRefs = await readRefs(refsDir);\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst { aggregate, contractHash, storageNameOf, markerLocation } = loaded.value;\n\tconst appGraph = aggregate.app.graph();\n\tlet targetHash = contractHash;\n\tlet refInvariants;\n\tlet namedRef;\n\tconst refContext = {\n\t\tgraph: appGraph,\n\t\trefs: allRefs,\n\t\tcontractHash\n\t};\n\tif (options.to && !liveTarget) {\n\t\tconst toResult = resolveContractRef$1(options.to, refContext);\n\t\tif (!toResult.ok) return notOk(toResult.failure);\n\t\ttargetHash = toResult.value.hash;\n\t\tif (toResult.value.provenance.kind === \"ref\") {\n\t\t\tconst refName = toResult.value.provenance.refName;\n\t\t\tconst refEntry = allRefs[refName];\n\t\t\tif (refEntry) {\n\t\t\t\trefInvariants = refEntry.invariants;\n\t\t\t\tnamedRef = {\n\t\t\t\t\tname: refName,\n\t\t\t\t\t...refEntry\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\tif (options.permitPolicyChange === true && namedRef === void 0) return notOk(errorPermitPolicyChangeNeedsRef({\n\t\tcommand: \"db migrate\",\n\t\tto: options.to\n\t}));\n\toptions.onPreflightComplete?.({\n\t\tconfigPath,\n\t\tmigrationsRelative,\n\t\tdbConnection,\n\t\thasExplicitFrom\n\t});\n\tconst markerBySpace = /* @__PURE__ */ new Map();\n\tlet databaseMarkers;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst planInputs = () => ({\n\t\taggregate,\n\t\tmarkers: markerBySpace,\n\t\tappTarget: {\n\t\t\thash: targetHash,\n\t\t\tinvariants: refInvariants,\n\t\t\trefName: void 0\n\t\t},\n\t\tstorageNameOf\n\t});\n\tlet outcomes;\n\tif (options.from !== void 0 && !liveOrigin) {\n\t\tconst fromResult = resolveContractRef$1(options.from, refContext);\n\t\tif (!fromResult.ok) return notOk(fromResult.failure);\n\t\tconst fromHash = fromResult.value.hash;\n\t\tconst offlineMarker = fromHash === EMPTY_CONTRACT_HASH ? null : {\n\t\t\tstorageHash: fromHash,\n\t\t\tinvariants: []\n\t\t};\n\t\tmarkerBySpace.set(aggregate.app.spaceId, offlineMarker);\n\t}\n\tif (needsDatabase && driver !== void 0) {\n\t\tconst client = (options.createClient ?? createControlClient)({\n\t\t\tfamily: config.family,\n\t\t\ttarget: config.target,\n\t\t\tadapter: config.adapter,\n\t\t\tdriver,\n\t\t\textensions: config.extensions ?? []\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tconst allMarkers = await client.readAllMarkers();\n\t\t\tdatabaseMarkers = allMarkers;\n\t\t\tconst appMarker = allMarkers.get(aggregate.app.spaceId);\n\t\t\tif (liveOrigin) for (const space of allSpaces) {\n\t\t\t\tconst marker = allMarkers.get(space.spaceId);\n\t\t\t\tmarkerBySpace.set(space.spaceId, marker ?? null);\n\t\t\t}\n\t\t\tif (liveTarget) targetHash = contractHashAtMarker(appMarker);\n\t\t\tconst inForce = databasePoliciesInForce(allMarkers, aggregate.app.spaceId, markerLocation);\n\t\t\tconst checked = await planEverySpace({\n\t\t\t\t...planInputs(),\n\t\t\t\tmarkers: allMarkers,\n\t\t\t\tmigrationsDir,\n\t\t\t\tinvocation: options.invocation,\n\t\t\t\treadLedger: (spaceId) => client.readLedger(spaceId),\n\t\t\t\tchange: inForce.change\n\t\t\t});\n\t\t\tif (!checked.ok) return notOk(checked.failure);\n\t\t\tconst permitted = checkRunPolicies({\n\t\t\t\tcommand: \"db migrate\",\n\t\t\t\tappSpaceId: aggregate.app.spaceId,\n\t\t\t\tinForce,\n\t\t\t\tref: namedRef,\n\t\t\t\tpermitPolicyChange: options.permitPolicyChange ?? false,\n\t\t\t\ttargetHash,\n\t\t\t\tinvocation: options.invocation\n\t\t\t});\n\t\t\tif (!permitted.ok) return notOk(permitted.failure);\n\t\t\tif (liveOrigin) outcomes = checked.value;\n\t\t} catch (error) {\n\t\t\treturn notOk(errorFromCaught(error, (message) => `Failed to read live DB marker: ${message}`, { connection: typeof dbConnection === \"string\" ? dbConnection : void 0 }));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t}\n\tconst planned = outcomes ?? planSpaces(planInputs());\n\tconst orderedMigrations = [];\n\tfor (const space of spacesInApplyOrder(aggregate)) {\n\t\tconst outcome = planned.get(space.spaceId);\n\t\tif (outcome === void 0) throw new InternalError(`Unreachable: no planned outcome for space \"${space.spaceId}\"`);\n\t\tif (outcome.kind === \"at-head\") continue;\n\t\tif (outcome.kind === \"never-planned\") return notOk(errorPathUnreachable({\n\t\t\tsummary: `No on-disk migrations for contract space \"${outcome.spaceId}\"`,\n\t\t\twhy: `migrate is replay-only: space \"${outcome.spaceId}\" has no on-disk migrations but its head ref targets \"${outcome.targetHash}\".`,\n\t\t\tmeta: {\n\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\ttargetHash: outcome.targetHash,\n\t\t\t\tkind: \"neverPlanned\"\n\t\t\t}\n\t\t}));\n\t\tif (outcome.kind === \"unreachable\" || outcome.kind === \"marker-outside-graph\") {\n\t\t\tconst fromHash = outcome.kind === \"marker-outside-graph\" ? outcome.markerHash : outcome.liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\t\t\treturn notOk(errorPathUnreachable({\n\t\t\t\tsummary: `No migration path from ${fromHash.slice(0, 14)} to ${outcome.targetHash.slice(0, 14)} in space \"${outcome.spaceId}\".`,\n\t\t\t\twhy: `The migration graph has no path from the from-state to the target in space \"${outcome.spaceId}\".`,\n\t\t\t\tmeta: {\n\t\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\t\tfromHash,\n\t\t\t\t\ttargetHash: outcome.targetHash,\n\t\t\t\t\tkind: \"pathUnreachable\"\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\tif (outcome.kind === \"unsatisfiable\") return notOk(errorRuntime(\"MIGRATION.NO_INVARIANT_PATH\", `Missing required invariants for space \"${outcome.spaceId}\"`, {\n\t\t\twhy: `The path requires invariants not available on disk: ${outcome.missing.join(\", \")}`,\n\t\t\tfix: \"Add a migration on the path that runs `dataTransform({ invariantId: \\\"<id>\\\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.\",\n\t\t\tmeta: {\n\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\tmissing: [...outcome.missing]\n\t\t\t}\n\t\t}));\n\t\tfor (const edge of outcome.plan.migrationEdges) orderedMigrations.push({\n\t\t\tspaceId: space.spaceId,\n\t\t\tdirName: edge.dirName,\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to\n\t\t});\n\t}\n\tconst count = orderedMigrations.length;\n\tconst summary = count === 0 ? \"Already up to date — nothing to run\" : `${count} migration${count === 1 ? \"\" : \"s\"} will run`;\n\tconst spacesUsingMarker = liveOrigin ? allSpaces : [aggregate.app];\n\treturn ok({\n\t\taggregate,\n\t\tcontractHash,\n\t\tmigrations: orderedMigrations,\n\t\tsummary,\n\t\t...ifDefined(\"databaseMarkerHashBySpace\", databaseMarkers === void 0 ? void 0 : new Map(spacesUsingMarker.map((space) => [space.spaceId, contractHashAtMarker(databaseMarkers.get(space.spaceId))])))\n\t});\n}\n//#endregion\n//#region src/control-api/operations/migration-list.ts\nfunction compareSpaceIds(a, b) {\n\tif (a === APP_SPACE_ID$1) return b === APP_SPACE_ID$1 ? 0 : -1;\n\tif (b === APP_SPACE_ID$1) return 1;\n\tif (a < b) return -1;\n\tif (a > b) return 1;\n\treturn 0;\n}\nfunction compareDirNamesDescending(a, b) {\n\tif (a.name < b.name) return 1;\n\tif (a.name > b.name) return -1;\n\treturn 0;\n}\n/**\n* Ref names decorating a space's destination contract hashes. The\n* tolerant `space.refs` deliberately omits the structural `head.json`;\n* for extension spaces the old enumerator surfaced it as a `head`\n* decoration on the tip migration, so fold `space.headRef` back in to\n* keep that output. The app space synthesises its head, so it carries\n* no on-disk `head` ref to restore.\n*/\nfunction listRefsByContractHash(space) {\n\tconst byHash = new Map(refsByContractHash(space.refs));\n\tif (space.spaceId !== APP_SPACE_ID$1 && space.headRef !== null) {\n\t\tconst hash = space.headRef.hash;\n\t\tconst bucket = byHash.get(hash) ?? [];\n\t\tif (!bucket.includes(HEAD_REF_NAME)) byHash.set(hash, [...bucket, HEAD_REF_NAME].sort());\n\t}\n\treturn byHash;\n}\nasync function orderedOnDiskSpaceIds(projectMigrationsDir) {\n\treturn (await listContractSpaceDirectories(projectMigrationsDir)).filter(isValidSpaceId).sort(compareSpaceIds);\n}\n/**\n* Project the loaded {@link ContractSpaceAggregate} into the render-ready\n* {@link MigrationSpaceListEntry} rows `migration list` displays.\n*\n* Space membership matches the on-disk contract-space directories (not the\n* aggregate's always-present synthesized app space when `migrations/app/`\n* is absent); package and ref data come from `aggregate.space(id)`.\n*/\nasync function migrationSpaceListEntriesFromAggregate(aggregate, projectMigrationsDir) {\n\tconst spaceIds = await orderedOnDiskSpaceIds(projectMigrationsDir);\n\tconst spaces = [];\n\tfor (const spaceId of spaceIds) {\n\t\tconst space = aggregate.space(spaceId);\n\t\tif (space === void 0) continue;\n\t\tconst refsByHash = listRefsByContractHash(space);\n\t\tconst migrations = space.packages.map((pkg) => ({\n\t\t\tname: pkg.dirName,\n\t\t\thash: pkg.metadata.migrationHash,\n\t\t\tfromContract: pkg.metadata.from,\n\t\t\ttoContract: pkg.metadata.to,\n\t\t\toperationCount: pkg.ops.length,\n\t\t\tcreatedAt: pkg.metadata.createdAt,\n\t\t\trefs: [...refsByHash.get(pkg.metadata.to) ?? []],\n\t\t\tprovidedInvariants: [...pkg.metadata.providedInvariants]\n\t\t})).sort(compareDirNamesDescending);\n\t\tspaces.push({\n\t\t\tspace: spaceId,\n\t\t\tmigrations\n\t\t});\n\t}\n\treturn spaces;\n}\nfunction computeSummary(spaces) {\n\tconst totalMigrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\tif (spaces.length <= 1) return `${totalMigrations} migration(s) on disk`;\n\treturn `${totalMigrations} migration(s) across ${spaces.length} contract space(s)`;\n}\n/**\n* Policy core of `migration list`: validates `--space`, narrows the\n* pre-enumerated spaces, and assembles a {@link MigrationListResult}.\n*\n* - `migrations/` missing or contains no valid space directories →\n* caller passes `spaces: []`; this synthesizes `[{ spaceId: APP_SPACE_ID, migrations: [] }]`.\n* - `--space <id>` on an existing-but-empty space → `{ spaceId, migrations: [] }` in the input.\n* - `--space <id>` on a non-existent (or reserved) space → `SPACE_NOT_FOUND`.\n*/\nfunction runMigrationList(inputs) {\n\tconst { spaces, spaceFilter } = inputs;\n\tif (spaceFilter !== void 0 && !isValidSpaceId(spaceFilter)) return notOk(errorInvalidSpaceId(spaceFilter));\n\tif (spaceFilter !== void 0 && !spaces.some((s) => s.space === spaceFilter)) return notOk(errorSpaceNotFound(spaceFilter, spaces.map((s) => s.space).sort()));\n\tconst scopedSpaces = spaceFilter !== void 0 ? spaces.filter((s) => s.space === spaceFilter) : spaces;\n\tconst resultSpaces = scopedSpaces.length === 0 ? [{\n\t\tspace: APP_SPACE_ID$1,\n\t\tmigrations: []\n\t}] : scopedSpaces;\n\treturn ok({\n\t\tok: true,\n\t\tspaces: [...resultSpaces],\n\t\tsummary: computeSummary(resultSpaces)\n\t});\n}\n//#endregion\n//#region src/utils/migration-path-target.ts\nfunction looksLikePath(target) {\n\treturn target.includes(\"/\") || target.includes(\"\\\\\");\n}\nfunction resolveAppTargetPath(cwd, target, appMigrationsDir, appMigrationsRelative) {\n\tconst targetPath = resolve(cwd, target);\n\tconst relativeToApp = relative(appMigrationsDir, targetPath);\n\tif (relativeToApp === \"\" || relativeToApp === \".\" || relativeToApp.startsWith(\"..\") || isAbsolute(relativeToApp)) return notOk(errorRuntime(\"MIGRATION.TARGET_NOT_APP_SPACE\", \"Target must point to an app-space migration\", {\n\t\twhy: `Expected a path under ${appMigrationsRelative}, got ${target}`,\n\t\tfix: \"Pass an app-space migration directory or use a hash prefix.\"\n\t}));\n\treturn ok(targetPath);\n}\n/**\n* Resolve a filesystem-path target to the migration dir that contains it,\n* searching each in-scope space's `migrationsDir`. A path is explicit, so\n* it can belong to at most one space — returns the first match, or `null`\n* when the path falls outside every space dir.\n*/\nfunction resolveTargetPathAcrossSpaces(cwd, target, spaces) {\n\tconst targetPath = resolve(cwd, target);\n\tfor (const space of spaces) {\n\t\tconst rel = relative(space.migrationsDir, targetPath);\n\t\tif (!(rel === \"\" || rel === \".\" || rel.startsWith(\"..\") || isAbsolute(rel))) return targetPath;\n\t}\n\treturn null;\n}\nfunction findPackageByDirPath(packages, resolvedDirPath) {\n\tconst normalized = resolve(resolvedDirPath);\n\treturn packages.find((p) => resolve(p.dirPath) === normalized);\n}\n//#endregion\n//#region src/control-api/operations/migration-check.ts\n/**\n* Policy core of `migration check`: per-space explicit graph checks, aggregate-integrity loading, and single-target resolution.\n*/\nfunction migrationPathRelative(cwd, dirPath) {\n\treturn relative(cwd, dirPath);\n}\nfunction migrationFileRelative(cwd, dirPath, fileName) {\n\treturn join(migrationPathRelative(cwd, dirPath), fileName);\n}\nfunction checkFileExists(space, dirPath, dirName, fileName) {\n\tif (!existsSync(join(dirPath, fileName))) return {\n\t\tspace: space.spaceId,\n\t\tcode: \"MIGRATION.CHECK_FILE_MISSING\",\n\t\twhere: migrationFileRelative(space.cwd, dirPath, fileName),\n\t\twhy: `${fileName} is missing from ${dirName}`,\n\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t};\n\treturn null;\n}\n/**\n* Snapshot-store consistency check for one migration package (D6.5):\n* absent store entry is not an issue (runner independence, ADR 199 — a\n* package dir with only `migration.json` + `ops.json` is legitimate); a\n* present entry whose inner `storage.storageHash` disagrees with\n* `pkg.metadata.to` is `MIGRATION.CHECK_SNAPSHOT_HASH_MISMATCH`; an unparseable store\n* entry (or a malformed `to`) is `MIGRATION.CHECK_SNAPSHOT_UNPARSEABLE`; a parseable\n* entry whose declared hash agrees but whose content recomputes to a different\n* storage hash is `MIGRATION.CHECK_SNAPSHOT_CONTENT_MISMATCH`.\n*/\nasync function checkSnapshotConsistency(space, pkg, migrationsDir) {\n\tconst spaceId = space.spaceId;\n\tlet snapshotDir;\n\ttry {\n\t\tsnapshotDir = contractSnapshotDir(migrationsDir, pkg.metadata.to);\n\t} catch {\n\t\treturn {\n\t\t\tspace: spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_SNAPSHOT_UNPARSEABLE\",\n\t\t\twhere: migrationPathRelative(space.cwd, pkg.dirPath),\n\t\t\twhy: `Migration \"${pkg.dirName}\" declares to=\"${pkg.metadata.to}\", which is not a well-formed contract snapshot hash.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package so migration.json declares a valid 64-hex to-hash\")]\n\t\t};\n\t}\n\tlet raw;\n\ttry {\n\t\traw = await readContractSnapshotJson(migrationsDir, pkg.metadata.to);\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error) && error.code === \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\") return null;\n\t\treturn {\n\t\t\tspace: spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_SNAPSHOT_UNPARSEABLE\",\n\t\t\twhere: migrationPathRelative(space.cwd, pkg.dirPath),\n\t\t\twhy: `Migration \"${pkg.dirName}\" has an unparseable contract snapshot at ${snapshotDir}/contract.json.`,\n\t\t\tnextActions: [chooseAction(\"Restore migrations/snapshots/ from version control\"), chooseAction(\"Or re-run the command that produced this migration to regenerate its snapshot\")]\n\t\t};\n\t}\n\tconst snapshotHash = (raw !== null && typeof raw === \"object\" ? raw : {})[\"storage\"]?.[\"storageHash\"];\n\tif (typeof snapshotHash === \"string\" && snapshotHash !== pkg.metadata.to) return {\n\t\tspace: spaceId,\n\t\tcode: \"MIGRATION.CHECK_SNAPSHOT_HASH_MISMATCH\",\n\t\twhere: migrationPathRelative(space.cwd, pkg.dirPath),\n\t\twhy: `Migration \"${pkg.dirName}\" declares to=${pkg.metadata.to} but its contract snapshot has storageHash=${snapshotHash}`,\n\t\tnextActions: [chooseAction(\"Re-emit the migration package so migration.json and its contract snapshot agree\")]\n\t};\n\tif (space.verifySnapshotContent !== void 0) {\n\t\tconst jsonPath = join(snapshotDir, \"contract.json\");\n\t\ttry {\n\t\t\tspace.verifySnapshotContent.assertSnapshotContentMatches(raw, pkg.metadata.to, jsonPath);\n\t\t} catch (error) {\n\t\t\tif (!MigrationToolsError.is(error) || error.code !== \"MIGRATION.CONTRACT_SNAPSHOT_CONTENT_MISMATCH\") throw error;\n\t\t\treturn {\n\t\t\t\tspace: spaceId,\n\t\t\t\tcode: \"MIGRATION.CHECK_SNAPSHOT_CONTENT_MISMATCH\",\n\t\t\t\twhere: migrationPathRelative(space.cwd, jsonPath),\n\t\t\t\twhy: `Migration \"${pkg.dirName}\": ${error.why}`,\n\t\t\t\tnextActions: [chooseAction(\"Restore migrations/snapshots/ from version control\"), chooseAction(\"Or re-run the command that produced this migration to regenerate its snapshot\")]\n\t\t\t};\n\t\t}\n\t}\n\treturn null;\n}\n/**\n* Project the loaded {@link ContractSpaceAggregate} into the\n* {@link CheckSpace} rows the multi-space check iterates — one per on-disk\n* contract-space directory, in the aggregate's `app`-first ordering. Mirrors\n* `migration list`'s `migrationSpaceListEntriesFromAggregate`: space\n* membership matches the on-disk directories, package / ref / graph data come\n* from `aggregate.space(id)`.\n*/\nasync function enumerateCheckSpaces(aggregate, projectMigrationsDir, cwd, verifySnapshotContent) {\n\tconst candidateDirs = await listContractSpaceDirectories(projectMigrationsDir);\n\tconst onDiskSpaceIds = new Set(candidateDirs.filter(isValidSpaceId));\n\tconst spaces = [];\n\tfor (const space of aggregate.spaces()) {\n\t\tconst spaceId = space.spaceId;\n\t\tif (!isValidSpaceId(spaceId)) continue;\n\t\tif (!onDiskSpaceIds.has(spaceId)) continue;\n\t\tconst migrationsDir = spaceMigrationDirectory(projectMigrationsDir, spaceId);\n\t\tspaces.push({\n\t\t\tspaceId,\n\t\t\tpackages: space.packages,\n\t\t\trefs: space.refs,\n\t\t\tgraph: space.graph(),\n\t\t\tmigrationsDir,\n\t\t\trefsDir: spaceRefsDirectory(migrationsDir),\n\t\t\tprojectMigrationsDir,\n\t\t\tcwd,\n\t\t\t...ifDefined(\"verifySnapshotContent\", verifySnapshotContent)\n\t\t});\n\t}\n\treturn spaces;\n}\nfunction checkManifestFilesPresent(space) {\n\tif (!existsSync(space.migrationsDir)) return [];\n\tconst loadedDirNames = new Set(space.packages.map((p) => p.dirName));\n\tconst failures = [];\n\tlet entries;\n\ttry {\n\t\tentries = readdirSync(space.migrationsDir);\n\t} catch {\n\t\treturn failures;\n\t}\n\tfor (const entry of entries) {\n\t\tif (entry.startsWith(\".\") || entry.startsWith(\"_\") || entry === \"refs\") continue;\n\t\tconst entryPath = join(space.migrationsDir, entry);\n\t\ttry {\n\t\t\tif (!statSync(entryPath).isDirectory()) continue;\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!loadedDirNames.has(entry)) for (const f of [\"migration.json\", \"ops.json\"]) {\n\t\t\tconst fail = checkFileExists(space, entryPath, entry, f);\n\t\t\tif (fail) failures.push(fail);\n\t\t}\n\t}\n\treturn failures;\n}\nfunction checkReachability(space) {\n\tconst allToHashes = new Set(space.packages.map((p) => p.metadata.to));\n\tconst failures = [];\n\tfor (const pkg of space.packages) if (!(pkg.metadata.from === null || allToHashes.has(pkg.metadata.from) || pkg.metadata.from === EMPTY_CONTRACT_HASH)) failures.push({\n\t\tspace: space.spaceId,\n\t\tcode: \"MIGRATION.CHECK_UNREACHABLE_MIGRATION\",\n\t\twhere: migrationPathRelative(space.cwd, pkg.dirPath),\n\t\twhy: `Migration \"${pkg.dirName}\" starts from ${pkg.metadata.from} which no other migration produces`,\n\t\tnextActions: [chooseAction(\"Delete the unreachable migration\"), chooseAction(\"Or re-emit a migration that connects it to the graph\")]\n\t});\n\treturn failures;\n}\nfunction checkDanglingRefs(space) {\n\tconst failures = [];\n\tfor (const [name, entry] of Object.entries(space.refs)) if (!space.graph.nodes.has(entry.hash)) failures.push({\n\t\tspace: space.spaceId,\n\t\tcode: \"MIGRATION.CHECK_DANGLING_REF\",\n\t\twhere: relative(space.cwd, join(space.refsDir, `${name}.json`)),\n\t\twhy: `Ref \"${name}\" points at ${entry.hash} which does not exist in the migration graph`,\n\t\tnextActions: [runCommandAction(\"Point the ref at a graph node\", `{bin} migration ref set ${name} <valid-hash>`), chooseAction(\"Or delete the ref\")]\n\t});\n\treturn failures;\n}\nasync function checkSpace(space) {\n\tconst snapshotFailures = await Promise.all(space.packages.map((pkg) => checkSnapshotConsistency(space, pkg, space.projectMigrationsDir)));\n\treturn [\n\t\t...checkManifestFilesPresent(space),\n\t\t...snapshotFailures.filter((f) => f !== null),\n\t\t...checkReachability(space),\n\t\t...checkDanglingRefs(space)\n\t];\n}\n/**\n* Policy core of the holistic `migration check`: validates `--space`,\n* narrows the pre-enumerated spaces, and runs the per-space explicit graph\n* checks (file-existence, snapshot consistency, reachability, dangling\n* refs), aggregating every failure into one {@link MigrationCheckResult}.\n*\n* `--space` validation mirrors `migration list`: an invalid id →\n* {@link errorInvalidSpaceId}; an id with no on-disk space →\n* {@link errorSpaceNotFound}. Both map to exit `PRECONDITION` at the shell.\n* Aggregate-integrity violations (which already span every space) are folded\n* in by the caller, not here.\n*/\nasync function runMigrationCheck(inputs) {\n\tconst { spaces, spaceFilter } = inputs;\n\tif (spaceFilter !== void 0 && !isValidSpaceId(spaceFilter)) return notOk(errorInvalidSpaceId(spaceFilter));\n\tif (spaceFilter !== void 0 && !spaces.some((s) => s.spaceId === spaceFilter)) return notOk(errorSpaceNotFound(spaceFilter, spaces.map((s) => s.spaceId).sort()));\n\tconst scopedSpaces = spaceFilter !== void 0 ? spaces.filter((s) => s.spaceId === spaceFilter) : spaces;\n\tconst failures = (await Promise.all(scopedSpaces.map(checkSpace))).flat();\n\tif (failures.length === 0) return ok({\n\t\tok: true,\n\t\tfailures: [],\n\t\tsummary: \"All checks passed\"\n\t});\n\treturn ok({\n\t\tok: false,\n\t\tfailures,\n\t\tsummary: `${failures.length} integrity failure(s)`\n\t});\n}\n/**\n* The integrity violations of the project's contract spaces. A contract the family refuses to load, the app's or a snapshot's, such as one holding a default its column type does not hold, is the error, with the refusal's meta; any other failure to load the aggregate leaves the violations to the other checks.\n*/\nasync function loadAggregateIntegrityViolations(config, migrationsDir, verifySnapshotContent) {\n\tconst contractPath = resolveContractPath(config);\n\ttry {\n\t\tconst contractJsonContent = await readFile(contractPath, \"utf-8\");\n\t\tconst familyInstance = config.family.create(createControlStack(config));\n\t\tconst declaredExtensions = toDeclaredExtensionsFromRaw(config.extensions ?? []);\n\t\tconst parsedAppContract = JSON.parse(contractJsonContent);\n\t\treturn ok((await loadContractSpaceAggregate({\n\t\t\tmigrationsDir,\n\t\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t\tappContract: familyInstance.deserializeContract(parsedAppContract),\n\t\t\t...ifDefined(\"verifySnapshotContent\", verifySnapshotContent)\n\t\t})).checkIntegrity({\n\t\t\tdeclaredExtensions,\n\t\t\tcheckContracts: true\n\t\t}));\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error) && error.code === \"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\") return mapContractAtError(error);\n\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(errorContractValidationFailed(`Contract at ${contractPath} failed to deserialize: ${error.message}`, {\n\t\t\twhere: { path: contractPath },\n\t\t\tcause: error,\n\t\t\tmeta: contractValidationMeta(error)\n\t\t}));\n\t\treturn ok([]);\n\t}\n}\n/**\n* Ranks ref-resolution failure kinds by how informative they are, so a\n* single-target check surfaces the most useful failure across spaces instead of\n* whichever space failed first. `not-found` (the input matched nothing here)\n* says the least; a malformed input, a wrong grammar, or an in-space ambiguity\n* all say more.\n*/\nfunction refFailureSpecificity(error) {\n\tswitch (error.kind) {\n\t\tcase \"wrong-grammar\": return 3;\n\t\tcase \"ambiguous\": return 2;\n\t\tcase \"invalid-format\": return 1;\n\t\tcase \"not-found\": return 0;\n\t}\n}\n/**\n* Single-target (`check <ref/path>`) mode — resolves a migration reference\n* across all contract spaces (or the one space narrowed by `--space <id>`).\n*\n* Resolution:\n* - filesystem path → find the owning space by checking which space's\n* `migrationsDir` contains the resolved path; falls back to app-relative\n* validation when the path is outside every space dir.\n* - ref → `parseMigrationRef` against each in-scope space; collect every\n* (space, package) hit; 0 hits = not-found, 1 = check it, >1 = ambiguity\n* error (qualify with `--space`).\n*\n* `--space <id>` is validated the same way the holistic path does it:\n* invalid id → `errorInvalidSpaceId`; no on-disk space → `errorSpaceNotFound`.\n*/\nasync function checkSingleTarget(target, inputs) {\n\tconst { spaces, spaceFilter, appMigrationsDir, appMigrationsRelative, cwd } = inputs;\n\tif (spaceFilter !== void 0 && !isValidSpaceId(spaceFilter)) return {\n\t\terror: errorInvalidSpaceId(spaceFilter),\n\t\texitCode: 2\n\t};\n\tif (spaceFilter !== void 0 && !spaces.some((s) => s.spaceId === spaceFilter)) return {\n\t\terror: errorSpaceNotFound(spaceFilter, spaces.map((s) => s.spaceId).sort()),\n\t\texitCode: 2\n\t};\n\tconst scopedSpaces = spaceFilter !== void 0 ? spaces.filter((s) => s.spaceId === spaceFilter) : spaces;\n\tlet matchedSpace;\n\tlet matchedPkg;\n\tif (looksLikePath(target)) {\n\t\tconst resolvedPath = resolveTargetPathAcrossSpaces(cwd, target, scopedSpaces);\n\t\tif (resolvedPath !== null) for (const space of scopedSpaces) {\n\t\t\tconst found = findPackageByDirPath(space.packages, resolvedPath);\n\t\t\tif (found) {\n\t\t\t\tmatchedSpace = space;\n\t\t\t\tmatchedPkg = found;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconst resolved = resolveAppTargetPath(cwd, target, appMigrationsDir, appMigrationsRelative);\n\t\t\tif (!resolved.ok) return {\n\t\t\t\terror: resolved.failure,\n\t\t\t\texitCode: 2\n\t\t\t};\n\t\t\tconst appSpace = scopedSpaces.find((s) => s.spaceId === \"app\");\n\t\t\tif (appSpace) {\n\t\t\t\tmatchedSpace = appSpace;\n\t\t\t\tmatchedPkg = findPackageByDirPath(appSpace.packages, resolved.value);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst hits = [];\n\t\tlet bestParseFailure;\n\t\tfor (const space of scopedSpaces) {\n\t\t\tconst migResult = parseMigrationRef(target, {\n\t\t\t\tgraph: space.graph,\n\t\t\t\trefs: space.refs\n\t\t\t});\n\t\t\tif (!migResult.ok) {\n\t\t\t\tif (bestParseFailure === void 0 || refFailureSpecificity(migResult.failure) > refFailureSpecificity(bestParseFailure)) bestParseFailure = migResult.failure;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst pkg = space.packages.find((p) => p.metadata.migrationHash === migResult.value.migrationHash);\n\t\t\tif (pkg) hits.push({\n\t\t\t\tspace,\n\t\t\t\tpkg\n\t\t\t});\n\t\t}\n\t\tif (hits.length > 1) return {\n\t\t\terror: errorAmbiguousMigrationRef(target, hits.map((h) => h.space.spaceId)),\n\t\t\texitCode: 2\n\t\t};\n\t\tif (hits.length === 1) {\n\t\t\tmatchedSpace = hits[0].space;\n\t\t\tmatchedPkg = hits[0].pkg;\n\t\t} else if (bestParseFailure !== void 0) return {\n\t\t\terror: mapRefResolutionError(bestParseFailure),\n\t\t\texitCode: 2\n\t\t};\n\t}\n\tif (!matchedPkg || !matchedSpace) return {\n\t\tresult: {\n\t\t\tok: false,\n\t\t\tfailures: [],\n\t\t\tsummary: `Migration package for \"${target}\" not found on disk`\n\t\t},\n\t\texitCode: 2\n\t};\n\tconst failures = [...checkManifestFilesPresent(matchedSpace)];\n\tfor (const f of [\"migration.json\", \"ops.json\"]) {\n\t\tconst fail = checkFileExists(matchedSpace, matchedPkg.dirPath, matchedPkg.dirName, f);\n\t\tif (fail) failures.push(fail);\n\t}\n\tconst verification = verifyMigrationHash(matchedPkg);\n\tif (!verification.ok) failures.push({\n\t\tspace: matchedSpace.spaceId,\n\t\tcode: \"MIGRATION.CHECK_HASH_MISMATCH\",\n\t\twhere: migrationFileRelative(matchedSpace.cwd, matchedPkg.dirPath, \"migration.json\"),\n\t\twhy: `Stored hash ${verification.storedHash} does not match recomputed hash ${verification.computedHash}`,\n\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t});\n\tconst snapshotFailure = await checkSnapshotConsistency(matchedSpace, matchedPkg, matchedSpace.projectMigrationsDir);\n\tif (snapshotFailure) failures.push(snapshotFailure);\n\tconst resolvedSpaceId = matchedSpace.spaceId !== \"app\" ? matchedSpace.spaceId : void 0;\n\tif (failures.length === 0) return {\n\t\tresult: {\n\t\t\tok: true,\n\t\t\tfailures: [],\n\t\t\tsummary: \"All checks passed\"\n\t\t},\n\t\texitCode: 0,\n\t\t...ifDefined(\"resolvedSpaceId\", resolvedSpaceId)\n\t};\n\treturn {\n\t\tresult: {\n\t\t\tok: false,\n\t\t\tfailures,\n\t\t\tsummary: `${failures.length} integrity failure(s)`\n\t\t},\n\t\texitCode: 4,\n\t\t...ifDefined(\"resolvedSpaceId\", resolvedSpaceId)\n\t};\n}\n//#endregion\n//#region src/control-api/operations/migration-graph.ts\n/**\n* Project scoped list entries into the per-space contracts+migrations rows the migration\n* graph --json output serializes (EMPTY_CONTRACT_HASH from-hash → null). Skips space ids\n* the aggregate no longer resolves, mirroring the command loop.\n*/\nfunction buildMigrationSpaceGraphEntries(args) {\n\tconst spaces = [];\n\tfor (const spaceEntry of args.scopedSpaces) {\n\t\tconst space = args.aggregate.space(spaceEntry.space);\n\t\tif (space === void 0) continue;\n\t\tconst graph = space.graph();\n\t\tconst refsByHash = listRefsByContractHash(space);\n\t\tspaces.push({\n\t\t\tspace: spaceEntry.space,\n\t\t\tcontracts: [...graph.nodes].map((hash) => ({\n\t\t\t\thash,\n\t\t\t\trefs: [...refsByHash.get(hash) ?? []]\n\t\t\t})),\n\t\t\tmigrations: [...graph.migrationByHash.values()].map((edge) => ({\n\t\t\t\tname: edge.dirName,\n\t\t\t\thash: edge.migrationHash,\n\t\t\t\tfromContract: edge.from === EMPTY_CONTRACT_HASH ? null : edge.from,\n\t\t\t\ttoContract: edge.to\n\t\t\t}))\n\t\t});\n\t}\n\treturn spaces;\n}\n//#endregion\n//#region src/control-api/operations/plan-resolution.ts\nconst FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;\nfunction looksLikeFullHash(input) {\n\treturn FULL_HASH_PATTERN.test(input);\n}\nfunction graphIsEmpty(space) {\n\treturn space.packages.length === 0;\n}\nfunction outgoingDestinations(graph, hash) {\n\treturn [...new Set((graph.forwardChain.get(hash) ?? []).map((edge) => edge.to))].sort();\n}\nfunction getReachableRefs(refs, graph) {\n\treturn Object.entries(refs).flatMap(([name, entry]) => entry && isGraphNode(entry.hash, graph) ? [{\n\t\tname,\n\t\thash: entry.hash\n\t}] : []).sort((a, b) => a.name.localeCompare(b.name));\n}\nfunction assertFromIsGraphNode(fromHash, graph, refs) {\n\ttry {\n\t\tassertHashIsGraphNode(fromHash, graph);\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error) && error.code === \"MIGRATION.HASH_NOT_IN_GRAPH\") throw errorPlanForgotTheFlag(fromHash, getReachableRefs(refs, graph), { cause: error });\n\t\tthrow error;\n\t}\n}\n/**\n* The origin a command uses when `--from` is omitted, as a hash only. An empty\n* graph with no `db` ref plans from the empty database. An empty graph with a\n* `db` ref is `ref-needs-baseline`: the ref names a real contract that is not\n* a graph node yet (`migration plan` handles this by writing a baseline first).\n* Otherwise the `db` ref must exist and point at a graph node. `migration\n* plan` materialises the contract on top of this; `migration new` needs only\n* the hash.\n*/\nfunction resolveDefaultOriginHash(space) {\n\tconst refs = space.refs;\n\tconst dbRef = refs[\"db\"];\n\tif (graphIsEmpty(space)) return ok(dbRef ? {\n\t\tkind: \"ref-needs-baseline\",\n\t\trefName: \"db\",\n\t\tfromHash: dbRef.hash\n\t} : {\n\t\tkind: \"greenfield\",\n\t\tfromHash: null\n\t});\n\tconst graph = space.graph();\n\tif (!dbRef) return notOk(errorPlanOriginUnknown(getReachableRefs(refs, graph)));\n\ttry {\n\t\tassertFromIsGraphNode(dbRef.hash, graph, refs);\n\t} catch (error) {\n\t\tif (CliStructuredError$1.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\treturn ok({\n\t\tkind: \"ref\",\n\t\trefName: \"db\",\n\t\tfromHash: dbRef.hash\n\t});\n}\nasync function resolveContractRef(parsed, space, options) {\n\tconst { hash, provenance } = parsed;\n\tconst refName = provenance.kind === \"ref\" ? provenance.refName : void 0;\n\ttry {\n\t\tconst at = await space.contractAt(hash, refName !== void 0 ? { refName } : void 0);\n\t\tif (at.provenance === \"ref\") return ok({\n\t\t\tkind: \"ref\",\n\t\t\thash: at.hash,\n\t\t\tcontract: at.contract\n\t\t});\n\t\treturn ok({\n\t\t\tkind: \"graph-node\",\n\t\t\thash: at.hash,\n\t\t\tcontract: at.contract\n\t\t});\n\t} catch (error) {\n\t\treturn mapContractAtError(error, options?.artifactRole !== void 0 ? { artifactRole: options.artifactRole } : void 0);\n\t}\n}\nasync function resolveFromPolicy(parsed, input, refs, explicitFromLabel) {\n\tconst resolution = await resolveContractRef(parsed, input.space, {\n\t\t...explicitFromLabel !== void 0 ? { explicitLabel: explicitFromLabel } : {},\n\t\tartifactRole: \"from\"\n\t});\n\tif (!resolution.ok) return resolution;\n\tif (resolution.value.kind === \"graph-node\") return ok({\n\t\tkind: \"graph-node\",\n\t\tfromHash: resolution.value.hash,\n\t\tfromContract: resolution.value.contract\n\t});\n\tconst { hash, contract } = resolution.value;\n\tif (graphIsEmpty(input.space)) return ok({\n\t\tkind: \"auto-baseline\",\n\t\tfromHash: hash,\n\t\tfromContract: contract\n\t});\n\tconst graph = input.space.graph();\n\ttry {\n\t\tassertFromIsGraphNode(hash, graph, refs);\n\t} catch (error) {\n\t\tif (CliStructuredError$1.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\treturn ok({\n\t\tkind: \"ref\",\n\t\tfromHash: hash,\n\t\tfromContract: contract\n\t});\n}\nasync function resolveFromForPlan(input) {\n\tconst { optionsFrom, space } = input;\n\tconst graph = space.graph();\n\tconst refs = space.refs;\n\tif (optionsFrom === void 0) {\n\t\tconst dbRef = refs[\"db\"];\n\t\tif (!dbRef) {\n\t\t\tif (graphIsEmpty(space)) return ok({\n\t\t\t\tkind: \"greenfield\",\n\t\t\t\tfromHash: null,\n\t\t\t\tfromContract: null,\n\t\t\t\tdefaulted: true\n\t\t\t});\n\t\t\treturn notOk(errorPlanOriginUnknown(getReachableRefs(refs, graph)));\n\t\t}\n\t\tconst resolved = await resolveFromPolicy({\n\t\t\thash: dbRef.hash,\n\t\t\tprovenance: {\n\t\t\t\tkind: \"ref\",\n\t\t\t\trefName: \"db\"\n\t\t\t}\n\t\t}, input, refs);\n\t\tif (!resolved.ok) return resolved;\n\t\tconst value = resolved.value;\n\t\tif (value.kind === \"ref\" || value.kind === \"graph-node\") {\n\t\t\tconst outgoingTo = outgoingDestinations(graph, value.fromHash);\n\t\t\tif (outgoingTo.length > 0) return ok({\n\t\t\t\t...value,\n\t\t\t\tdefaultOriginForks: {\n\t\t\t\t\trefName: \"db\",\n\t\t\t\t\trefHash: value.fromHash,\n\t\t\t\t\toutgoingTo\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn resolved;\n\t}\n\tconst refResult = parseContractRef(optionsFrom, {\n\t\tgraph,\n\t\trefs\n\t});\n\tif (!refResult.ok) {\n\t\tif (looksLikeFullHash(optionsFrom)) {\n\t\t\tif (graphIsEmpty(space)) return notOk(errorSnapshotMissing(optionsFrom, { viaRef: false }));\n\t\t\treturn notOk(errorPlanForgotTheFlag(optionsFrom, getReachableRefs(refs, graph)));\n\t\t}\n\t\treturn notOk(mapRefResolutionError(refResult.failure));\n\t}\n\tif (refResult.value.provenance.kind === \"reserved-empty\") return ok({\n\t\tkind: \"greenfield\",\n\t\tfromHash: null,\n\t\tfromContract: null,\n\t\tdefaulted: false\n\t});\n\treturn resolveFromPolicy(refResult.value, input, refs, optionsFrom);\n}\nasync function resolveToForPlan(optionsTo, input) {\n\tconst { space } = input;\n\tconst graph = space.graph();\n\tconst refs = space.refs;\n\tconst refResult = parseContractRef(optionsTo, {\n\t\tgraph,\n\t\trefs\n\t});\n\tif (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));\n\tif (refResult.value.provenance.kind === \"reserved-empty\") return notOk(mapRefResolutionError({\n\t\tkind: \"wrong-grammar\",\n\t\tinput: optionsTo,\n\t\texpectedGrammar: \"contract\",\n\t\tmessage: \"`@empty` is only valid as an origin (`--from`); planning a migration to the empty contract is not supported through this shortcut\",\n\t\tfix: \"Pass `--to` a contract hash, ref name, or migration directory name. To plan starting from an empty database, use `--from @empty`.\"\n\t}));\n\tconst resolution = await resolveContractRef(refResult.value, space, {\n\t\texplicitLabel: optionsTo,\n\t\tartifactRole: \"to\"\n\t});\n\tif (!resolution.ok) return resolution;\n\tconst { hash, contract } = resolution.value;\n\treturn ok({\n\t\thash,\n\t\tcontract\n\t});\n}\n//#endregion\n//#region src/control-api/operations/migration-new.ts\n/**\n* Policy core of `migration new`: scaffolds a migration package with a `migration.ts` stub for manual authoring.\n*/\nasync function executeMigrationNewCommand(options) {\n\tconst config = options.config;\n\tconst cwd = options.cwd;\n\tconst { migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(config, cwd);\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst controlAdapter = config.adapter.create(stack);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tlet contractJsonContent;\n\ttry {\n\t\tcontractJsonContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorRuntime(\"CLI.FILE_NOT_FOUND\", `Contract file not found at ${contractPathAbsolute}`, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: \"Run `{bin} contract emit` first to generate the contract\"\n\t\t}));\n\t\tthrow error;\n\t}\n\tlet parsedContract;\n\tlet toContract;\n\ttry {\n\t\tparsedContract = JSON.parse(contractJsonContent);\n\t\ttoContract = familyInstance.deserializeContract(parsedContract);\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\", \"Contract JSON is invalid\", {\n\t\t\twhy: `Failed to deserialize ${contractPathAbsolute}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\tfix: \"Run `{bin} contract emit` to regenerate the contract\",\n\t\t\tcause: error,\n\t\t\t...ifDefined(\"meta\", contractValidationMeta(error))\n\t\t}));\n\t}\n\tconst toStorageHash = toContract.storage?.storageHash;\n\tif (typeof toStorageHash !== \"string\") return notOk(errorRuntime(\"CONTRACT.VALIDATION_FAILED\", \"Contract is missing storageHash\", {\n\t\twhy: `Contract at ${contractPathAbsolute} has no storageHash`,\n\t\tfix: \"Run `{bin} contract emit` to regenerate the contract\"\n\t}));\n\tconst verifySnapshotContent = snapshotVerifierFor(config);\n\tconst aggregate = await loadContractSpaceAggregate({\n\t\tmigrationsDir,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\tappContract: toContract,\n\t\t...ifDefined(\"verifySnapshotContent\", verifySnapshotContent)\n\t});\n\tconst packageCorruptionFailure = refusePackageCorruptionOnAggregate(aggregate, migrationsDir);\n\tif (packageCorruptionFailure) return notOk(packageCorruptionFailure);\n\tconst packages = aggregate.app.packages;\n\tlet fromHash = null;\n\tif (options.from !== void 0) {\n\t\tif (packages.length === 0) return notOk(errorRuntime(\"MIGRATION.HASH_NOT_IN_GRAPH\", \"--from has no meaning on an empty graph\", {\n\t\t\twhy: `--from \"${options.from}\" was passed, but ${appMigrationsRelative} contains no migrations, so there is no migration target hash it could name.`,\n\t\t\tfix: \"Omit --from to scaffold the first migration (it records a baseline origin). `migration new --from` accepts the full 64-hex target hash of an existing migration, or a unique prefix of one.\"\n\t\t}));\n\t\tconst matchedHashes = [...new Set(packages.filter((p) => p.metadata.to.startsWith(options.from ?? \"\")).map((p) => p.metadata.to))].sort();\n\t\tif (matchedHashes.length === 0) return notOk(errorRuntime(\"MIGRATION.HASH_NOT_IN_GRAPH\", \"Starting contract not found\", {\n\t\t\twhy: `No migration with to hash matching \"${options.from}\" exists in ${appMigrationsRelative}`,\n\t\t\tfix: \"Check that the --from hash matches a known migration target hash. `migration new --from` accepts the full 64-hex target hash of an existing migration, or a unique prefix of one.\"\n\t\t}));\n\t\tif (matchedHashes.length > 1) return notOk(errorRuntime(\"MIGRATION.REF_AMBIGUOUS\", `Ambiguous --from prefix: \"${options.from}\"`, {\n\t\t\twhy: `\"${options.from}\" is a prefix of ${matchedHashes.length} migration target hashes in ${appMigrationsRelative}: ${matchedHashes.join(\", \")}`,\n\t\t\tfix: \"Provide a longer prefix or the full 64-hex target hash to disambiguate.\",\n\t\t\tmeta: {\n\t\t\t\tinput: options.from,\n\t\t\t\tcandidates: matchedHashes\n\t\t\t}\n\t\t}));\n\t\tfromHash = matchedHashes[0] ?? null;\n\t} else {\n\t\tconst origin = resolveDefaultOriginHash(aggregate.app);\n\t\tif (!origin.ok) return notOk(origin.failure);\n\t\tif (origin.value.kind === \"ref-needs-baseline\") return notOk(errorRuntime(\"MIGRATION.HASH_NOT_IN_GRAPH\", \"The db ref is not a graph node yet\", {\n\t\t\twhy: `The db ref points at ${origin.value.fromHash}, but ${appMigrationsRelative} contains no migrations, so that contract is not a graph node and nothing can chain from it.`,\n\t\t\tfix: \"Run `{bin} migration plan` first: on an empty graph it writes the baseline migration for the db ref alongside the delta, after which `migration new` can chain from it.\",\n\t\t\tmeta: {\n\t\t\t\trefName: origin.value.refName,\n\t\t\t\tresolvedHash: origin.value.fromHash\n\t\t\t}\n\t\t}));\n\t\tfromHash = origin.value.fromHash;\n\t}\n\tif (fromHash === toStorageHash && !options.from) return notOk(errorRuntime(\"MIGRATION.NO_CHANGES\", \"No changes detected\", {\n\t\twhy: \"The from and to contract hashes are identical — there is nothing to migrate.\",\n\t\tfix: \"Change the contract and run `{bin} contract emit` before creating a new migration. To author a data-only migration on the current contract hash, pass `--from <hash>` explicitly.\"\n\t}));\n\tconst timestamp = /* @__PURE__ */ new Date();\n\tconst packageDir = join(appMigrationsDir, formatMigrationDirName(timestamp, options.name ?? \"migration\"));\n\tconst baseMetadata = {\n\t\tfrom: fromHash,\n\t\tto: toStorageHash,\n\t\tprovidedInvariants: [],\n\t\tcreatedAt: timestamp.toISOString()\n\t};\n\tconst metadata = {\n\t\t...baseMetadata,\n\t\tmigrationHash: computeMigrationHash(baseMetadata, [])\n\t};\n\tconst migrations = getTargetMigrations(config.target);\n\tif (!migrations) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.targetId}\" does not support migrations` }));\n\ttry {\n\t\tassertFrameworkComponentsCompatible(config.family.familyId, config.target.targetId, [\n\t\t\tconfig.target,\n\t\t\tconfig.adapter,\n\t\t\t...config.extensions ?? []\n\t\t]);\n\t\tconst resolveSpecifier = createProjectSpecifierResolver(options.projectDir);\n\t\tconst declarations = await renderSnapshotDeclarations({\n\t\t\tclient: options.client,\n\t\t\tcontractJson: parsedContract,\n\t\t\tcontractJsonPath: contractPathAbsolute,\n\t\t\tresolveImportSpecifier: resolveSpecifier\n\t\t});\n\t\tif (!declarations.ok) return notOk(declarations.failure);\n\t\tawait writeMigrationPackage(packageDir, metadata, []);\n\t\tawait writeContractSnapshot(migrationsDir, toStorageHash, {\n\t\t\tcontractJson: parsedContract,\n\t\t\tcontractDts: declarations.value\n\t\t});\n\t\tawait writeMigrationTs(packageDir, migrations.createPlanner(controlAdapter).emptyMigration({\n\t\t\tpackageDir,\n\t\t\tcontractJsonPath: join(contractSnapshotDir(migrationsDir, toStorageHash), \"contract.json\"),\n\t\t\tfromHash,\n\t\t\ttoHash: toStorageHash,\n\t\t\tsnapshotsImportPath: snapshotsImportPathFrom(packageDir, migrationsDir)\n\t\t}, APP_SPACE_ID).renderTypeScript(resolveSpecifier));\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tdir: relative(cwd, packageDir),\n\t\t\tfrom: fromHash,\n\t\t\tto: toStorageHash,\n\t\t\tsummary: `Scaffolded migration at ${relative(cwd, packageDir)}`\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => `Failed to scaffold migration: ${message}`));\n\t}\n}\n//#endregion\n//#region src/control-api/operations/migration-plan.ts\n/**\n* Policy core of `migration plan`: resolves from/to contracts, runs the planner legs, and writes the planned migration packages.\n*/\nfunction isEnoent(error) {\n\treturn error instanceof Error && \"code\" in error && error.code === \"ENOENT\";\n}\nfunction placeholderSummary(planned, packageDirs, invocation) {\n\treturn `Planned ${planned} with placeholder(s) — edit migration.ts, then run ${packageDirs.map((dir) => `\\`${selfEmitCommand(invocation, join(dir, \"migration.ts\"))}\\``).join(\" and \")} to self-emit`;\n}\n/** The invocation the plan's printed commands repeat: `migration plan` takes no `--db`. */\nfunction invocationOf(options) {\n\treturn {\n\t\tcwd: options.cwd,\n\t\tconfigPath: options.configPath,\n\t\tdbGiven: false\n\t};\n}\n/** The origin of a plan from an empty database: no models, so no statement resolves. */\nconst EMPTY_ORIGIN = {\n\tdomain: { namespaces: {} },\n\tstorage: { namespaces: {} }\n};\nasync function runPlannerLeg(planner, migrations, frameworkComponents, contract, origin, destination, statements, spaceId, ownership, snapshotsImportPath, resolveImportSpecifier, refused = (conflicts) => errorMigrationPlanningFailed({ conflicts: castAs(conflicts) })) {\n\tconst fromContract = origin.kind === \"contract\" ? origin.contract : null;\n\tconst fromSchema = migrations.contractToSchema(fromContract, frameworkComponents);\n\tconst plannerResult = planner.plan({\n\t\tcontract,\n\t\tschema: fromSchema,\n\t\tpolicy: { allowedOperationClasses: [\n\t\t\t\"additive\",\n\t\t\t\"widening\",\n\t\t\t\"destructive\",\n\t\t\t\"data\"\n\t\t] },\n\t\tfromContract,\n\t\torigin: planOriginOf(fromContract),\n\t\tstatements,\n\t\tframeworkComponents,\n\t\tspaceId,\n\t\townership,\n\t\tsnapshotsImportPath\n\t});\n\tif (plannerResult.kind === \"failure\") return notOk(refused(plannerResult.conflicts));\n\tlet resolved = [];\n\tlet standingFor = [];\n\tlet hasPlaceholders = false;\n\ttry {\n\t\tconst settled = await Promise.allSettled(plannerResult.plan.operations);\n\t\tfor (const entry of settled) {\n\t\t\tif (entry.status === \"fulfilled\") continue;\n\t\t\tconst reason = entry.reason;\n\t\t\tif (!CliStructuredError$1.is(reason)) throw reason;\n\t\t\tif (reason.code !== \"MIGRATION.UNFILLED_PLACEHOLDER\") throw reason;\n\t\t\thasPlaceholders = true;\n\t\t}\n\t\tresolved = settled.map((entry) => entry.status === \"fulfilled\" ? entry.value : void 0);\n\t\tstandingFor = settled.map((entry) => entry.status === \"rejected\" ? placeholderOperationOf(entry.reason) : void 0);\n\t} catch (e) {\n\t\tif (CliStructuredError$1.is(e) && e.code === \"MIGRATION.UNFILLED_PLACEHOLDER\") {\n\t\t\thasPlaceholders = true;\n\t\t\tresolved = [];\n\t\t} else throw e;\n\t}\n\tif (!hasPlaceholders && resolved.length === 0 && origin.kind === \"empty\") return notOk(errorPlanProducedNoOperations(destination));\n\tconst plannedOps = resolved.filter((op) => op !== void 0);\n\tconst listed = resolved.map((op, index) => op === void 0 ? standingFor[index] : {\n\t\tid: op.id,\n\t\tlabel: op.label,\n\t\toperationClass: op.operationClass\n\t});\n\tconst position = resolvedPositions(listed);\n\treturn ok({\n\t\tplannedOps,\n\t\tlistedOps: listed.filter((op) => op !== void 0),\n\t\tmigrationTsContent: plannerResult.plan.renderTypeScript(resolveImportSpecifier),\n\t\thasPlaceholders,\n\t\tdataLoss: plannerResult.dataLoss.map(({ operationIndex, subject, loss, label, keepDataAdvice, keepDataEdit }) => ({\n\t\t\toperationIndex: position(operationIndex),\n\t\t\tsubject,\n\t\t\tloss,\n\t\t\tlabel,\n\t\t\t...ifDefined(\"keepDataAdvice\", keepDataAdvice),\n\t\t\t...ifDefined(\"keepDataEdit\", keepDataEdit)\n\t\t})),\n\t\tappliedStatements: reportAppliedStatements(plannerResult.appliedStatements.map((applied) => ({\n\t\t\t...applied,\n\t\t\toperationIndexes: applied.operationIndexes.flatMap((index) => {\n\t\t\t\tconst at = position(index);\n\t\t\t\treturn at === void 0 ? [] : [at];\n\t\t\t})\n\t\t})), fromContract, contract, 0),\n\t\ttemporaryValues: reportTemporaryValues(plannerResult.temporaryValues, contract),\n\t\tplannedTemporaryValues: plannerResult.temporaryValues,\n\t\t...ifDefined(\"namespaces\", plannerResult.namespaces),\n\t\tplannerWarnings: plannerResult.warnings ?? []\n\t});\n}\n/**\n* Maps a position in the plan's operations to the position of that operation among those that\n* resolved, which is what a result's `operations` lists: `undefined` for an unfilled placeholder.\n*/\nfunction resolvedPositions(resolved) {\n\tconst positions = [];\n\tlet next = 0;\n\tfor (const op of resolved) {\n\t\tpositions.push(op === void 0 ? void 0 : next);\n\t\tif (op !== void 0) next += 1;\n\t}\n\treturn (planIndex) => positions[planIndex];\n}\nconst PlaceholderOperation = type({\n\tcode: \"'MIGRATION.UNFILLED_PLACEHOLDER'\",\n\tmeta: { operation: {\n\t\tid: \"string\",\n\t\tlabel: \"string\",\n\t\toperationClass: \"'additive' | 'widening' | 'destructive' | 'data'\"\n\t} }\n});\n/** The operation an unfilled placeholder's rejection says it stands for, when it says. */\nfunction placeholderOperationOf(reason) {\n\tif (!CliStructuredError$1.is(reason)) return void 0;\n\tconst read = PlaceholderOperation({\n\t\tcode: reason.code,\n\t\tmeta: reason.meta ?? {}\n\t});\n\treturn read instanceof type.errors ? void 0 : read.meta.operation;\n}\nasync function writePlannedMigrationPackage(packageDir, fromHash, toHash, createdAt, leg) {\n\tconst opsForWrite = leg.hasPlaceholders ? [] : leg.plannedOps;\n\tconst metadataWithInvariants = {\n\t\tfrom: fromHash,\n\t\tto: toHash,\n\t\tprovidedInvariants: deriveProvidedInvariants(opsForWrite),\n\t\tcreatedAt: createdAt.toISOString()\n\t};\n\tawait writeMigrationPackage(packageDir, {\n\t\t...metadataWithInvariants,\n\t\tmigrationHash: computeMigrationHash(metadataWithInvariants, opsForWrite)\n\t}, opsForWrite);\n\tawait writeMigrationTs(packageDir, leg.migrationTsContent);\n}\n/**\n* Asks about every operation of the planned legs that would lose data, until each is answered,\n* before anything is written. A delete answer consents to the loss of its subject. A rename or\n* convert typed at the prompt is a statement the plan did not have, so the delta is planned again\n* with every statement, and the loss it answered must be gone.\n*/\nasync function answerPlannedDataLoss(input) {\n\tconst legs = (delta) => ({\n\t\tdelta,\n\t\tdataLoss: [...input.baseline?.dataLoss ?? [], ...delta?.dataLoss ?? []],\n\t\taccessChanges: [],\n\t\t...ifDefined(\"namespaces\", delta?.namespaces),\n\t\ttemporaryValues: delta?.plannedTemporaryValues ?? []\n\t});\n\tconst answered = await askPlanQuestions({\n\t\tplan: legs(input.delta),\n\t\taskAccess: false,\n\t\tcanConvert: true,\n\t\tstatements: input.statements,\n\t\tpreAnswers: input.consents,\n\t\tconsentAll: {\n\t\t\tdelete: false,\n\t\t\tallow: false\n\t\t},\n\t\torigin: input.origin,\n\t\toriginKnown: input.originKnown,\n\t\tdestination: input.destination,\n\t\tanswer: input.answer,\n\t\tkeepDataEditAdvice: migrationPlanKeepDataEditAdvice(input.invocation),\n\t\treplan: async (statements) => {\n\t\t\tconst replanned = await input.planDelta(statements);\n\t\t\treturn replanned.ok ? ok(legs(replanned.value)) : replanned;\n\t\t}\n\t});\n\tif (!answered.ok) return answered;\n\tconst { delta } = answered.value.plan;\n\treturn ok({\n\t\tdelta,\n\t\tdeletes: answered.value.consented.map((consented) => reportConsentStatement(consented, (delta?.dataLoss ?? []).filter((loss) => migrationSubjectKey(loss.subject) === migrationSubjectKey(consented.subject)).flatMap(({ operationIndex }) => operationIndex === void 0 ? [] : [operationIndex])))\n\t});\n}\nasync function executeMigrationPlanCommand(options, startTime, callbacks) {\n\ttry {\n\t\treturn await executeMigrationPlanCommandInner(options, startTime, callbacks);\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => `Unexpected error during migration plan: ${message}`));\n\t}\n}\nasync function executeMigrationPlanCommandInner(options, startTime, callbacks) {\n\tconst config = options.config;\n\tconst cwd = options.cwd;\n\tconst { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(config, cwd);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tconst contractPath = relative(cwd, contractPathAbsolute);\n\tcallbacks?.onContextResolved?.({\n\t\tconfigPath,\n\t\tcontractPath,\n\t\tappMigrationsRelative\n\t});\n\tlet contractJsonContent;\n\ttry {\n\t\tcontractJsonContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (isEnoent(error)) return notOk(errorFileNotFound(contractPathAbsolute, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: `Run \\`{bin} contract emit\\` to generate ${contractPath}, or update \\`config.contract.output\\` in ${configPath}`\n\t\t}));\n\t\treturn notOk(errorFromCaught(error, (message) => `Failed to read contract file: ${message}`));\n\t}\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst controlAdapter = config.adapter.create(stack);\n\tlet emittedContractJson;\n\tlet toContract;\n\ttry {\n\t\temittedContractJson = castAs(JSON.parse(contractJsonContent));\n\t\ttoContract = familyInstance.deserializeContract(emittedContractJson);\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\twhere: { path: contractPathAbsolute },\n\t\t\tmeta: contractValidationMeta(error)\n\t\t}));\n\t}\n\tconst rawStorageHash = toContract.storage?.storageHash;\n\tif (typeof rawStorageHash !== \"string\") return notOk(errorContractValidationFailed(\"Contract is missing storageHash\", { where: { path: contractPathAbsolute } }));\n\tlet toStorageHash = rawStorageHash;\n\tlet destinationInStore = false;\n\tlet fromContract = null;\n\tlet fromHash = null;\n\tlet fromContractInStore = false;\n\tlet isAutoBaseline = false;\n\tlet fromDefaulted = false;\n\tconst verifySnapshotContent = snapshotVerifierFor(config);\n\tconst tolerantAggregateResult = await loadContractSpaceAggregateForCli({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract: toContract,\n\t\textensions: config.extensions ?? [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", verifySnapshotContent)\n\t});\n\tif (!tolerantAggregateResult.ok) return notOk(tolerantAggregateResult.failure);\n\tconst resolutionSpace = tolerantAggregateResult.value.app;\n\tconst resolutionResult = await resolveFromForPlan({\n\t\toptionsFrom: options.from,\n\t\tspace: resolutionSpace\n\t});\n\tif (!resolutionResult.ok) return notOk(resolutionResult.failure);\n\tconst warnings = [];\n\tconst plannerWarnings = [];\n\tconst warnForks = (forks) => {\n\t\twarnings.push(`The default origin ref '${forks.refName}' points at ${forks.refHash}, which already has a migration leading to ${forks.outgoingTo.join(\", \")}. Planning from it forks the migration graph; pass --from to choose the origin explicitly.`);\n\t};\n\tswitch (resolutionResult.value.kind) {\n\t\tcase \"greenfield\":\n\t\t\tfromDefaulted = resolutionResult.value.defaulted;\n\t\t\tbreak;\n\t\tcase \"graph-node\":\n\t\t\tfromHash = resolutionResult.value.fromHash;\n\t\t\tfromContract = resolutionResult.value.fromContract;\n\t\t\tif (resolutionResult.value.defaultOriginForks !== void 0) warnForks(resolutionResult.value.defaultOriginForks);\n\t\t\tbreak;\n\t\tcase \"ref\":\n\t\t\tfromHash = resolutionResult.value.fromHash;\n\t\t\tfromContract = resolutionResult.value.fromContract;\n\t\t\tfromContractInStore = true;\n\t\t\tif (resolutionResult.value.defaultOriginForks !== void 0) warnForks(resolutionResult.value.defaultOriginForks);\n\t\t\tbreak;\n\t\tcase \"auto-baseline\":\n\t\t\tfromHash = resolutionResult.value.fromHash;\n\t\t\tfromContract = resolutionResult.value.fromContract;\n\t\t\tfromContractInStore = true;\n\t\t\tisAutoBaseline = true;\n\t\t\tbreak;\n\t}\n\tconst resolvedFrom = resolutionResult.value;\n\tconst fromOrigin = resolvedFrom.kind === \"greenfield\" ? { kind: \"empty\" } : {\n\t\tkind: \"contract\",\n\t\tcontract: resolvedFrom.fromContract\n\t};\n\tif (options.to !== void 0) {\n\t\tconst toResolution = await resolveToForPlan(options.to, { space: resolutionSpace });\n\t\tif (!toResolution.ok) return notOk(toResolution.failure);\n\t\ttoContract = toResolution.value.contract;\n\t\ttoStorageHash = toResolution.value.hash;\n\t\tdestinationInStore = true;\n\t}\n\tlet statements = [];\n\tconst statementTexts = options.statements ?? [];\n\tconst consentTexts = statementTexts.filter((statement) => !isPlannedStatement(statement));\n\tif (statementTexts.length > 0) {\n\t\tconst resolved = resolveStatements({\n\t\t\tstatements: statementTexts,\n\t\t\torigin: {\n\t\t\t\tkind: \"contract\",\n\t\t\t\tcontract: fromContract ?? EMPTY_ORIGIN\n\t\t\t},\n\t\t\tdestination: toContract\n\t\t});\n\t\tif (!resolved.ok) return notOk(resolved.failure);\n\t\tstatements = resolved.value;\n\t}\n\tconst refusedWith = (texts, resolved) => (conflicts) => planningRefusedError(conflicts, {\n\t\tinvocation: invocationOf(options),\n\t\tfrom: fromHash ?? void 0,\n\t\tto: options.to,\n\t\tstatements: texts,\n\t\tresolved\n\t});\n\tconst resolveImportSpecifier = createProjectSpecifierResolver(options.projectDir);\n\tlet destinationDeclarations = null;\n\tif (!destinationInStore && fromHash !== toStorageHash) {\n\t\tconst rendered = await renderSnapshotDeclarations({\n\t\t\tclient: options.client,\n\t\t\tcontractJson: emittedContractJson,\n\t\t\tcontractJsonPath: contractPathAbsolute,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t\tif (!rendered.ok) return notOk(rendered.failure);\n\t\tdestinationDeclarations = rendered.value;\n\t}\n\tconst seedResult = await runContractSpaceSeedPhase({\n\t\tmigrationsDir,\n\t\textensions: toExtensionInputs(config.extensions ?? [])\n\t});\n\tfor (const record of seedResult.seeded) callbacks?.onSeeded?.(record);\n\tconst emittedExtensionDirs = seedResult.seeded.flatMap((r) => r.newMigrationDirs.map((dirName) => ({\n\t\tspaceId: r.spaceId,\n\t\tdirName\n\t})));\n\tif (fromHash === toStorageHash && !isAutoBaseline && statements.length === 0) return ok({\n\t\tok: true,\n\t\tnoOp: true,\n\t\tfrom: fromHash,\n\t\tto: toStorageHash,\n\t\toperations: [],\n\t\temittedExtensionDirs,\n\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\tappliedStatements: [],\n\t\ttemporaryValues: [],\n\t\tchangedStorageEntities: [],\n\t\tsummary: \"No changes detected between contracts\",\n\t\ttimings: { total: Date.now() - startTime }\n\t});\n\tconst migrations = getTargetMigrations(config.target);\n\tif (!migrations) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` }));\n\tconst aggregateResult = await buildContractSpaceAggregate({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract: toContract,\n\t\textensions: config.extensions ?? [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\t...ifDefined(\"verifySnapshotContent\", verifySnapshotContent)\n\t});\n\tif (!aggregateResult.ok) return notOk(aggregateResult.failure);\n\tconst aggregate = aggregateResult.value;\n\tconst frameworkComponents = assertFrameworkComponentsCompatible(config.family.familyId, config.target.targetId, [\n\t\tconfig.target,\n\t\tconfig.adapter,\n\t\t...config.extensions ?? []\n\t]);\n\tasync function writeDestinationSnapshot(destHash) {\n\t\tif (destinationDeclarations === null) return;\n\t\tawait writeContractSnapshot(migrationsDir, destHash, {\n\t\t\tcontractJson: emittedContractJson,\n\t\t\tcontractDts: destinationDeclarations\n\t\t});\n\t}\n\ttry {\n\t\tconst planner = migrations.createPlanner(controlAdapter);\n\t\tconst planDestination = {\n\t\t\thash: toStorageHash,\n\t\t\tisEmitted: options.to === void 0\n\t\t};\n\t\tconst answerDataLoss = (baseline, delta, planDelta) => answerPlannedDataLoss({\n\t\t\tbaseline,\n\t\t\tdelta,\n\t\t\tstatements: statementTexts.filter(isPlannedStatement),\n\t\t\tconsents: consentTexts,\n\t\t\torigin: fromContract ?? EMPTY_ORIGIN,\n\t\t\toriginKnown: true,\n\t\t\tdestination: toContract,\n\t\t\tanswer: options.answerQuestions,\n\t\t\tinvocation: invocationOf(options),\n\t\t\tplanDelta: async (planned) => {\n\t\t\t\tconst resolved = resolveStatements({\n\t\t\t\t\tstatements: planned,\n\t\t\t\t\torigin: {\n\t\t\t\t\t\tkind: \"contract\",\n\t\t\t\t\t\tcontract: fromContract ?? EMPTY_ORIGIN\n\t\t\t\t\t},\n\t\t\t\t\tdestination: toContract\n\t\t\t\t});\n\t\t\t\tif (!resolved.ok) return resolved;\n\t\t\t\treturn planDelta([...consentTexts, ...planned], resolved.value);\n\t\t\t}\n\t\t});\n\t\tif (isAutoBaseline && fromHash !== null && fromContract !== null && fromContractInStore) {\n\t\t\tconst deltaTimestamp = /* @__PURE__ */ new Date();\n\t\t\tconst baselineTimestamp = /* @__PURE__ */ new Date(deltaTimestamp.getTime() - 6e4);\n\t\t\tconst baselineDirName = formatMigrationDirName(baselineTimestamp, \"baseline\");\n\t\t\tconst deltaDirName = formatMigrationDirName(deltaTimestamp, options.name ?? \"migration\");\n\t\t\tconst baselinePackageDir = join(appMigrationsDir, baselineDirName);\n\t\t\tconst deltaPackageDir = join(appMigrationsDir, deltaDirName);\n\t\t\tconst baselineLeg = await runPlannerLeg(planner, migrations, frameworkComponents, fromContract, { kind: \"baseline\" }, {\n\t\t\t\thash: fromHash,\n\t\t\t\tisEmitted: false\n\t\t\t}, [], aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(baselinePackageDir, migrationsDir), resolveImportSpecifier);\n\t\t\tif (!baselineLeg.ok) return baselineLeg;\n\t\t\tconst planBaselineDelta = (texts, resolved) => runPlannerLeg(planner, migrations, frameworkComponents, aggregate.app.contract(), fromOrigin, planDestination, resolved, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(deltaPackageDir, migrationsDir), resolveImportSpecifier, refusedWith(texts, resolved));\n\t\t\tconst plannedDelta = fromHash === toStorageHash ? void 0 : await planBaselineDelta(statementTexts, statements);\n\t\t\tif (plannedDelta !== void 0 && !plannedDelta.ok) return plannedDelta;\n\t\t\tconst answered = await answerDataLoss(baselineLeg.value, plannedDelta?.ok === true ? plannedDelta.value : void 0, planBaselineDelta);\n\t\t\tif (!answered.ok) return notOk(answered.failure);\n\t\t\tconst deltaLeg = plannedDelta === void 0 ? void 0 : answered.value.delta ?? plannedDelta.value;\n\t\t\tconst deletes = answered.value.deletes;\n\t\t\tplannerWarnings.push(...baselineLeg.value.plannerWarnings, ...deltaLeg?.plannerWarnings ?? []);\n\t\t\tawait writePlannedMigrationPackage(baselinePackageDir, null, fromHash, baselineTimestamp, baselineLeg.value);\n\t\t\tif (deltaLeg === void 0) {\n\t\t\t\tconst statementsWithoutOperations = reportAppliedStatements(statements.map((statement) => ({\n\t\t\t\t\tstatement,\n\t\t\t\t\toperationIndexes: []\n\t\t\t\t})), fromContract, aggregate.app.contract(), 0);\n\t\t\t\tconst baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;\n\t\t\t\tif (baselineLeg.value.hasPlaceholders) {\n\t\t\t\t\tconst baselineDir = relative(cwd, baselinePackageDir);\n\t\t\t\t\treturn ok({\n\t\t\t\t\t\tok: true,\n\t\t\t\t\t\tnoOp: false,\n\t\t\t\t\t\tfrom: fromHash,\n\t\t\t\t\t\tto: toStorageHash,\n\t\t\t\t\t\tdir: baselineDir,\n\t\t\t\t\t\tbaselineDir,\n\t\t\t\t\t\toperations: baselineLeg.value.listedOps,\n\t\t\t\t\t\temittedExtensionDirs,\n\t\t\t\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\t\t\t\tpendingPlaceholders: true,\n\t\t\t\t\t\tplaceholderDirs: [baselineDir],\n\t\t\t\t\t\tappliedStatements: [...statementsWithoutOperations, ...deletes],\n\t\t\t\t\t\ttemporaryValues: baselineLeg.value.temporaryValues,\n\t\t\t\t\t\tchangedStorageEntities: changedStorageEntities(fromContract, toContract),\n\t\t\t\t\t\tsummary: placeholderSummary(\"baseline\", [baselinePackageDir], invocationOf(options)),\n\t\t\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(baselineOps) : void 0;\n\t\t\t\treturn ok({\n\t\t\t\t\tok: true,\n\t\t\t\t\tnoOp: false,\n\t\t\t\t\tfrom: fromHash,\n\t\t\t\t\tto: toStorageHash,\n\t\t\t\t\tbaselineDir: relative(cwd, baselinePackageDir),\n\t\t\t\t\toperations: baselineOps.map((op) => ({\n\t\t\t\t\t\tid: op.id,\n\t\t\t\t\t\tlabel: op.label,\n\t\t\t\t\t\toperationClass: op.operationClass\n\t\t\t\t\t})),\n\t\t\t\t\temittedExtensionDirs,\n\t\t\t\t\t...preview !== void 0 ? { preview } : {},\n\t\t\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\t\t\tappliedStatements: [...statementsWithoutOperations, ...deletes],\n\t\t\t\t\ttemporaryValues: baselineLeg.value.temporaryValues,\n\t\t\t\t\tchangedStorageEntities: changedStorageEntities(fromContract, toContract),\n\t\t\t\t\tsummary: buildAutoBaselinePlanSummary(baselineOps.length, 0, emittedExtensionDirs.length),\n\t\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t\t});\n\t\t\t}\n\t\t\tawait writePlannedMigrationPackage(deltaPackageDir, fromHash, toStorageHash, deltaTimestamp, deltaLeg);\n\t\t\tawait writeDestinationSnapshot(toStorageHash);\n\t\t\tconst baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;\n\t\t\tconst deltaOps = deltaLeg.hasPlaceholders ? [] : deltaLeg.plannedOps;\n\t\t\tif (baselineLeg.value.hasPlaceholders || deltaLeg.hasPlaceholders) {\n\t\t\t\tconst baselineDir = relative(cwd, baselinePackageDir);\n\t\t\t\tconst deltaDir = relative(cwd, deltaPackageDir);\n\t\t\t\treturn ok({\n\t\t\t\t\tok: true,\n\t\t\t\t\tnoOp: false,\n\t\t\t\t\tfrom: fromHash,\n\t\t\t\t\tto: toStorageHash,\n\t\t\t\t\tdir: deltaDir,\n\t\t\t\t\tbaselineDir,\n\t\t\t\t\toperations: deltaLeg.listedOps,\n\t\t\t\t\tbaselineOperations: baselineLeg.value.listedOps,\n\t\t\t\t\temittedExtensionDirs,\n\t\t\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\t\t\tpendingPlaceholders: true,\n\t\t\t\t\tplaceholderDirs: [...baselineLeg.value.hasPlaceholders ? [relative(cwd, baselinePackageDir)] : [], ...deltaLeg.hasPlaceholders ? [relative(cwd, deltaPackageDir)] : []],\n\t\t\t\t\tappliedStatements: [...deltaLeg.appliedStatements, ...deletes],\n\t\t\t\t\ttemporaryValues: deltaLeg.temporaryValues,\n\t\t\t\t\tchangedStorageEntities: changedStorageEntities(fromContract, toContract),\n\t\t\t\t\tsummary: placeholderSummary(\"baseline + migration\", [baselinePackageDir, deltaPackageDir], invocationOf(options)),\n\t\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview([...baselineOps, ...deltaOps]) : void 0;\n\t\t\treturn ok({\n\t\t\t\tok: true,\n\t\t\t\tnoOp: false,\n\t\t\t\tfrom: fromHash,\n\t\t\t\tto: toStorageHash,\n\t\t\t\tdir: relative(cwd, deltaPackageDir),\n\t\t\t\tbaselineDir: relative(cwd, baselinePackageDir),\n\t\t\t\toperations: deltaOps.map((op) => ({\n\t\t\t\t\tid: op.id,\n\t\t\t\t\tlabel: op.label,\n\t\t\t\t\toperationClass: op.operationClass\n\t\t\t\t})),\n\t\t\t\tbaselineOperations: baselineOps.map((op) => ({\n\t\t\t\t\tid: op.id,\n\t\t\t\t\tlabel: op.label,\n\t\t\t\t\toperationClass: op.operationClass\n\t\t\t\t})),\n\t\t\t\temittedExtensionDirs,\n\t\t\t\t...preview !== void 0 ? { preview } : {},\n\t\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\t\tappliedStatements: [...deltaLeg.appliedStatements, ...deletes],\n\t\t\t\ttemporaryValues: deltaLeg.temporaryValues,\n\t\t\t\t...withNoOperationsReport(buildAutoBaselinePlanSummary(baselineOps.length, deltaOps.length, emittedExtensionDirs.length), deltaOps.length === 0, fromContract, toContract),\n\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t});\n\t\t}\n\t\tconst timestamp = /* @__PURE__ */ new Date();\n\t\tconst packageDir = join(appMigrationsDir, formatMigrationDirName(timestamp, options.name ?? \"migration\"));\n\t\tconst planDelta = (texts, resolved) => runPlannerLeg(planner, migrations, frameworkComponents, aggregate.app.contract(), fromOrigin, planDestination, resolved, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(packageDir, migrationsDir), resolveImportSpecifier, refusedWith(texts, resolved));\n\t\tconst plannedDelta = await planDelta(statementTexts, statements);\n\t\tif (!plannedDelta.ok) return plannedDelta;\n\t\tconst answered = await answerDataLoss(void 0, plannedDelta.value, planDelta);\n\t\tif (!answered.ok) return notOk(answered.failure);\n\t\tconst deltaLeg = answered.value.delta ?? plannedDelta.value;\n\t\tconst deletes = answered.value.deletes;\n\t\tplannerWarnings.push(...deltaLeg.plannerWarnings);\n\t\tif (!deltaLeg.hasPlaceholders && deltaLeg.plannedOps.length === 0 && fromHash === toStorageHash) return ok({\n\t\t\tok: true,\n\t\t\tnoOp: true,\n\t\t\tfrom: fromHash,\n\t\t\tto: toStorageHash,\n\t\t\toperations: [],\n\t\t\temittedExtensionDirs,\n\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\tappliedStatements: [...deltaLeg.appliedStatements, ...deletes],\n\t\t\ttemporaryValues: deltaLeg.temporaryValues,\n\t\t\tchangedStorageEntities: [],\n\t\t\tsummary: \"No changes to plan: the statements need no operations\",\n\t\t\ttimings: { total: Date.now() - startTime }\n\t\t});\n\t\tawait writePlannedMigrationPackage(packageDir, fromHash, toStorageHash, timestamp, deltaLeg);\n\t\tawait writeDestinationSnapshot(toStorageHash);\n\t\tif (deltaLeg.hasPlaceholders) {\n\t\t\tconst dir = relative(cwd, packageDir);\n\t\t\treturn ok({\n\t\t\t\tok: true,\n\t\t\t\tnoOp: false,\n\t\t\t\tfrom: fromHash,\n\t\t\t\tto: toStorageHash,\n\t\t\t\tdir,\n\t\t\t\toperations: deltaLeg.listedOps,\n\t\t\t\temittedExtensionDirs,\n\t\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\t\tpendingPlaceholders: true,\n\t\t\t\tplaceholderDirs: [relative(cwd, packageDir)],\n\t\t\t\t...fromDefaulted ? { fromDefaulted } : {},\n\t\t\t\tappliedStatements: [...deltaLeg.appliedStatements, ...deletes],\n\t\t\t\ttemporaryValues: deltaLeg.temporaryValues,\n\t\t\t\tchangedStorageEntities: changedStorageEntities(fromContract, toContract),\n\t\t\t\tsummary: placeholderSummary(\"migration\", [packageDir], invocationOf(options)),\n\t\t\t\ttimings: { total: Date.now() - startTime }\n\t\t\t});\n\t\t}\n\t\tconst plannedOps = deltaLeg.plannedOps;\n\t\tconst preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(plannedOps) : void 0;\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tnoOp: false,\n\t\t\tfrom: fromHash,\n\t\t\tto: toStorageHash,\n\t\t\tdir: relative(cwd, packageDir),\n\t\t\toperations: plannedOps.map((op) => ({\n\t\t\t\tid: op.id,\n\t\t\t\tlabel: op.label,\n\t\t\t\toperationClass: op.operationClass\n\t\t\t})),\n\t\t\temittedExtensionDirs,\n\t\t\t...preview !== void 0 ? { preview } : {},\n\t\t\t...fromDefaulted ? { fromDefaulted } : {},\n\t\t\t...warnings.length > 0 ? { warnings } : {},\n\t\t\t...plannerWarnings.length > 0 ? { plannerWarnings } : {},\n\t\t\tappliedStatements: [...deltaLeg.appliedStatements, ...deletes],\n\t\t\ttemporaryValues: deltaLeg.temporaryValues,\n\t\t\t...withNoOperationsReport(buildPlanSummary(plannedOps.length, emittedExtensionDirs.length), plannedOps.length === 0, fromContract, toContract),\n\t\t\ttimings: { total: Date.now() - startTime }\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => `Unexpected error during migration plan: ${message}`));\n\t}\n}\n/**\n* The summary of a written migration and, when it has no operations, the storage entities that\n* changed, with a sentence added to the summary that says the database needs no operation for them.\n*/\nfunction withNoOperationsReport(summary, hasNoOperations, fromContract, toContract) {\n\tconst reported = { changedStorageEntities: changedStorageEntities(fromContract, toContract) };\n\tif (!hasNoOperations) return {\n\t\t...reported,\n\t\tsummary\n\t};\n\treturn {\n\t\t...reported,\n\t\tsummary: `${summary}. The storage the contract describes changed, but the database needs no operation for it, so the migration has none. ${whatChangedSentence(fromContract, toContract)}`\n\t};\n}\n/**\n* Compose the success-line summary so the cross-space side effect\n* (extension-space migration packages materialised on disk during\n* this `plan` run) is visible in the top line — not just in the\n* step log above it.\n*\n* Example outputs:\n* - `Planned 3 operation(s)` (app-space-only project)\n* - `Planned 3 operation(s); materialised 1 extension-space migration` (one extension)\n* - `Planned 3 operation(s); materialised 2 extension-space migrations` (two extensions)\n*\n* Locks AC3 at the summary-line level: a reader of the success line\n* can tell that something happened beyond the app space.\n*/\nfunction buildPlanSummary(plannedOpsCount, emittedExtensionDirsCount) {\n\tconst base = `Planned ${plannedOpsCount} operation(s)`;\n\tif (emittedExtensionDirsCount === 0) return base;\n\treturn `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? \"extension-space migration\" : \"extension-space migrations\"}`;\n}\nfunction buildAutoBaselinePlanSummary(baselineOpsCount, deltaOpsCount, emittedExtensionDirsCount) {\n\tconst base = `Planned baseline (${baselineOpsCount} operation(s)) + ${deltaOpsCount} operation(s)`;\n\tif (emittedExtensionDirsCount === 0) return base;\n\treturn `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? \"extension-space migration\" : \"extension-space migrations\"}`;\n}\n//#endregion\n//#region src/control-api/operations/graph-queries.ts\n/** True when the on-disk graph contains a path fromHash → toHash. */\nfunction hasMigrationPath(graph, fromHash, toHash) {\n\treturn findPath(graph, fromHash, toHash) !== null;\n}\n//#endregion\n//#region src/control-api/operations/migration-status-overlay.ts\nfunction deriveStatusEdgeAnnotations(input) {\n\tconst annotations = /* @__PURE__ */ new Map();\n\tif (input.showAppliedOverlay) {\n\t\tfor (const edge of input.graph.migrationByHash.values()) if (input.appliedMigrationHashes.has(edge.migrationHash)) annotations.set(edge.migrationHash, { status: \"applied\" });\n\t}\n\tif (!input.graph.nodes.has(input.originHash)) return annotations;\n\tconst pendingPath = findPath(input.graph, input.originHash, input.targetHash);\n\tif (!pendingPath) return annotations;\n\tfor (const edge of pendingPath) {\n\t\tif (input.appliedMigrationHashes.has(edge.migrationHash)) continue;\n\t\tif (annotations.get(edge.migrationHash)?.status === \"applied\") continue;\n\t\tannotations.set(edge.migrationHash, { status: \"pending\" });\n\t}\n\treturn annotations;\n}\nfunction appliedHashesFromLedger(ledgerEntries) {\n\treturn new Set(ledgerEntries.map((entry) => entry.migrationHash));\n}\nfunction statusForMigrationHash(migrationHash, annotations) {\n\treturn annotations.get(migrationHash)?.status ?? null;\n}\n//#endregion\n//#region src/control-api/operations/refs.ts\n/**\n* Reads the migrations refs index for commands, mapping MigrationToolsError into the CLI envelope.\n*/\n/** Reads migrations/<app>/refs, passing MigrationToolsError through; other errors rethrow. */\nasync function readMigrationRefs(refsDir) {\n\ttry {\n\t\treturn ok(await readRefs(refsDir));\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/control-api/operations/ref.ts\nfunction cliErrorInvalidRefName(name) {\n\treturn errorRuntime(\"MIGRATION.INVALID_REF_NAME\", `Invalid ref name \"${name}\"`, {\n\t\twhy: `Ref name \"${name}\" does not match the required format`,\n\t\tfix: \"Ref names must be lowercase alphanumeric with hyphens or forward slashes, no `.` or `..` segments\"\n\t});\n}\nasync function executeRefSetCommand(name, contractInput, options) {\n\tif (!validateRefName(name)) return notOk(cliErrorInvalidRefName(name));\n\tconst config = options.config;\n\ttry {\n\t\tconst { migrationsDir, refsDir } = resolveMigrationPaths(config, options.cwd);\n\t\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\t\tif (!loaded.ok) return notOk(loaded.failure);\n\t\tconst graph = loaded.value.aggregate.app.graph();\n\t\tconst bundles = loaded.value.aggregate.app.packages;\n\t\tconst refs = loaded.value.aggregate.app.refs;\n\t\tlet resolvedHash;\n\t\tif (validateRefValue(contractInput)) resolvedHash = contractInput;\n\t\telse {\n\t\t\tconst refResult = parseContractRef(contractInput, {\n\t\t\t\tgraph,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tif (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));\n\t\t\tresolvedHash = refResult.value.hash;\n\t\t}\n\t\tif (resolvedHash === EMPTY_CONTRACT_HASH) return notOk(errorRefSetEmptySentinel(resolvedHash));\n\t\tif (!isGraphNode(resolvedHash, graph)) return notOk(errorRefSetHashNotInGraph(resolvedHash, [...graph.nodes].sort()));\n\t\tif (!bundles.find((bundle) => bundle.metadata.to === resolvedHash)) return notOk(errorRefSetBundleNotFound(resolvedHash));\n\t\tconst contractJsonPath = join(contractSnapshotDir(migrationsDir, resolvedHash), \"contract.json\");\n\t\ttry {\n\t\t\tawait readContractSnapshotJson(migrationsDir, resolvedHash, snapshotVerifierFor(config));\n\t\t} catch (readError) {\n\t\t\tif (MigrationToolsError.is(readError) && readError.code === \"MIGRATION.CONTRACT_SNAPSHOT_MISSING\") return notOk(errorFileNotFound(contractJsonPath, {\n\t\t\t\twhy: `Migration bundle for hash ${resolvedHash} is missing its contract snapshot at ${contractJsonPath}`,\n\t\t\t\tfix: \"Restore migrations/snapshots/ from version control, or re-run the command that produced this migration to regenerate its snapshot.\"\n\t\t\t}));\n\t\t\tthrow readError;\n\t\t}\n\t\tconst written = await advanceRef(refsDir, name, resolvedHash);\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tref: name,\n\t\t\thash: written.hash,\n\t\t\tinvariants: written.invariants,\n\t\t\t...ifDefined(\"policies\", written.policies)\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => message));\n\t}\n}\nasync function executeRefDeleteCommand(name, options) {\n\ttry {\n\t\tconst { refsDir } = resolveMigrationPaths(options.config, options.cwd);\n\t\tawait deleteRef(refsDir, name);\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tref: name,\n\t\t\tdeleted: true\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => message));\n\t}\n}\nasync function executeRefListCommand(options) {\n\ttry {\n\t\tconst { refsDir } = resolveMigrationPaths(options.config, options.cwd);\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\trefs: await readRefs(refsDir)\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorFromCaught(error, (message) => message));\n\t}\n}\n//#endregion\nexport { sourceWarningDiagnostic as $, resolveContractRef$1 as A, computeRefAdvancementName as B, runMigrationList as C, errorPermitPolicyChangeNeedsRef as Ct, mapContractAtError as D, refuseUnknownInvariants as E, contractValidationMeta as Et, RECORDED_CONTRACT_REF_FORMS as F, runContractSpaceSeedPhase as G, preflightRefAdvancement as H, RECORDED_OR_EMPTY_CONTRACT_REF_FORMS as I, planEverySpace as J, disposeEmitQueue as K, NO_REF_ADVANCEMENT as L, retryCommandFor as M, resolveContractRefToSnapshot as N, liveMarkerUse as O, ALL_CONTRACT_REF_FORMS as P, loadContractSourceWithStack as Q, advanceRefSafely as R, migrationSpaceListEntriesFromAggregate as S, declaredSettingsText as St, refuseMissingInvariantPath as T, snapshotVerifierFor as Tt, executeContractEmit as U, executeRefAdvancement as V, validateLoadedContract as W, formatSourceDiagnostic as X, skippedOperationsText as Y, loadContractSource as Z, runMigrationCheck as _, matchConsents as _t, appliedHashesFromLedger as a, databasePoliciesInForce as at, resolveAppTargetPath as b, convertAndDelete as bt, hasMigrationPath as c, buildReadAggregate as ct, resolveFromForPlan as d, mapIntegrityViolations as dt, withWarningFindings as et, resolveToForPlan as f, refuseContractSpaceIntegrity as ft, loadAggregateIntegrityViolations as g, labelsText as gt, enumerateCheckSpaces as h, toDeclaredExtensionsFromRaw as ht, readMigrationRefs as i, executeDbInit as it, resolveMigrationRef as j, requireDatabaseForLiveMarkerUse as k, executeMigrationPlanCommand as l, loadContractRawSafely as lt, checkSingleTarget as m, refusePackageCorruptionOnAggregate as mt, executeRefListCommand as n, executeDbSign as nt, deriveStatusEdgeAnnotations as o, appContractStandInFromIdentity as ot, buildMigrationSpaceGraphEntries as p, refuseDeclaredExtensionTargetMismatch as pt, createControlClient as q, executeRefSetCommand as r, executeDbVerify as rt, statusForMigrationHash as s, buildContractSpaceAggregate as st, executeRefDeleteCommand as t, executeDbUpdate as tt, executeMigrationNewCommand as u, loadContractSpaceAggregateForCli as ut, findPackageByDirPath as v, renamedAndDeleted as vt, executeMigrateShowPlan as w, enrichContract as wt, listRefsByContractHash as x, isStatementVerb as xt, looksLikePath as y, resolveStatements as yt, buildRefAdvancementFields as z };\n\n//# sourceMappingURL=ref-DfuqRCA7.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAS,uBAAuB,OAAO;CACtC,IAAI,CAAC,kBAAkB,KAAK,GAAG,OAAO,KAAK;CAC3C,IAAI,MAAM,SAAS,8BAA8B,OAAO,MAAM;CAC9D,MAAM,kBAAkB,MAAM,OAAO;CACrC,OAAO,oBAAoB,KAAK,IAAI,KAAK,IAAI,EAAE,gBAAgB;AAChE;;;;;;;;;;;;;;;;;;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