@prisma/orm-target-mongo 8.0.0-rc.20-dev.13 → 8.0.0-rc.20-dev.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"control-BOMgFmdt.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-DTj807jv.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { a as dropCollection, c as renameField, d as unsetField, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod, u as unrewritableFieldNameReason } from \"./migration-factories-BqROEHRs.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas, fieldRewriteOf } from \"@internal/family-mongo/control\";\nimport { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, describeMigrationStatement, expectAbsent, expectPresent, failedPostcheckWhy, failedPrecheckWhy, issueOutcome, migrationRunnerFailure, modelDisplayName, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoCollection, MongoStorage, collectionControlPoliciesOf, collectionControlPolicyOf, collectionRootModelsOf, hasOwnFieldStoredAs, modelAndBasesOf, mongoModelsOf, ownEmbedStoredNamesOf, ownStoredNameOf, ownStoredNamesOf, validatorFieldNamesOf, validatorRootShapesOf } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { asNamespaceId, governingControlPolicy } from \"@internal/contract/types\";\nimport { MongoSchemaCollection, MongoSchemaIR, canonicalize, deepEqual, indexLookupKey } from \"@internal/mongo-schema-ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, MongoOrExpr, RenameCollectionCommand, isMongoDmlOperation } from \"@internal/mongo-query-ast/control\";\nimport { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\nimport { Migration } from \"@internal/migration-tools/migration\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\nimport { verifyMongoSchema } from \"@internal/family-mongo/schema-verify\";\n//#region src/core/mongo-target-database.ts\n/**\n* Mongo target `Namespace` concretion. In Mongo the \"namespace\" concept\n* binds to the connection's `db` field — a `MongoTargetDatabase` instance\n* names the database the collections live under. `entries['collection']`\n* holds collection IR. The unbound singleton (below) is the late-bound\n* namespace whose binding the connection's `db` resolves at runtime rather\n* than at authoring time.\n*\n* Qualifier emission is the rendering seam: query / DDL emission asks the\n* namespace for its qualifier (e.g. `\"<db>.<collection>\"`) and consumes\n* the result polymorphically. The unbound singleton overrides these\n* methods to elide the prefix entirely — call sites stay polymorphic and\n* never branch on `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar MongoTargetDatabase = class extends NamespaceBase {\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst rawEntries = {\n\t\t\tcollection: {},\n\t\t\t...input.entries\n\t\t};\n\t\tthis.entries = Object.freeze(blindCast(hydrateNamespaceEntities(rawEntries, composeMongoEntityKinds(), \"carry\")));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"database\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget collection() {\n\t\treturn this.entries.collection ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare qualifier as it would appear in a rendered string. The\n\t* unbound-database singleton overrides this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn this.id;\n\t}\n\t/**\n\t* Qualify a collection name with the database prefix. The\n\t* unbound-database singleton overrides this to emit just the\n\t* collection name. Used by emission/introspection paths that need a\n\t* fully-qualified reference.\n\t*/\n\tqualifyCollection(collectionName) {\n\t\treturn `${this.id}.${collectionName}`;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound namespace whose binding the\n* connection's `db` resolves at runtime. Overrides qualifier emission\n* to elide the database prefix; call sites that consume `qualifier()`\n* / `qualifyCollection()` get unqualified output without branching on\n* the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Mongo decides what late-bound means here (the collection\n* name, naked — the database is supplied by the live connection).\n*/\nvar MongoTargetUnboundDatabase = class MongoTargetUnboundDatabase extends MongoTargetDatabase {\n\tstatic instance = new MongoTargetUnboundDatabase();\n\tconstructor() {\n\t\tsuper({ id: UNBOUND_NAMESPACE_ID });\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyCollection(collectionName) {\n\t\treturn collectionName;\n\t}\n};\n//#endregion\n//#region src/core/mongo-target-contract-serializer.ts\nvar MongoTargetContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\tconst { storage, ...rest } = validated;\n\t\tconst namespaces = Object.fromEntries(Object.entries(storage.namespaces).map(([nsId, nsData]) => {\n\t\t\tconst collectionCount = Object.keys(nsData.entries.collection ?? {}).length;\n\t\t\tconst valueSetCount = Object.keys(nsData.entries[\"valueSet\"] ?? {}).length;\n\t\t\tif (nsId === UNBOUND_NAMESPACE_ID && collectionCount === 0 && valueSetCount === 0) return [nsId, MongoTargetUnboundDatabase.instance];\n\t\t\tconst dbInput = { id: nsData.id };\n\t\t\tif (nsData.entries[\"collection\"] !== void 0 || nsData.entries[\"valueSet\"] !== void 0) dbInput.entries = {\n\t\t\t\tcollection: blindCast(nsData.entries[\"collection\"] ?? {}),\n\t\t\t\t...ifDefined(\"valueSet\", blindCast(nsData.entries[\"valueSet\"]))\n\t\t\t};\n\t\t\treturn [nsId, new MongoTargetDatabase(dbInput)];\n\t\t}));\n\t\tconst targetStorage = new MongoStorage({\n\t\t\tstorageHash: storage.storageHash,\n\t\t\tnamespaces\n\t\t});\n\t\treturn {\n\t\t\t...rest,\n\t\t\tstorage: targetStorage\n\t\t};\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst collectionsOut = {};\n\t\t\tfor (const [collName, coll] of Object.entries(ns.entries.collection ?? {})) collectionsOut[collName] = blindCast(JSON.parse(JSON.stringify(coll)));\n\t\t\tconst valueSetOut = {};\n\t\t\tfor (const [vsName, vs] of Object.entries(ns.entries.valueSet ?? {})) valueSetOut[vsName] = blindCast(JSON.parse(JSON.stringify(vs)));\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: \"mongo-database\",\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: collectionsOut,\n\t\t\t\t\t...ifDefined(\"valueSet\", Object.keys(valueSetOut).length > 0 ? valueSetOut : void 0)\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: {\n\t\t\t\tstorageHash: String(storage.storageHash),\n\t\t\t\tnamespaces: namespacesJson\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* The single module a scaffolded Mongo `migration.ts` imports from: the\n* operation factories below, plus the `Migration` base and `MigrationCLI`\n* that `render-typescript.ts` adds. The authored name; `render-typescript.ts`\n* maps it to whatever the consuming application's import root calls it,\n* once over the whole assembled import list.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/target-mongo/migration\";\nvar OpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction formatKeys(keys) {\n\treturn keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\nvar CreateIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\tcollection;\n\tkeys;\n\toptions;\n\tlabel;\n\tconstructor(collection, keys, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.options = options;\n\t\tthis.label = `Create index on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createIndex(this.collection, this.keys, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})` : `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)})`;\n\t}\n};\nvar DropIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"widening\";\n\tcollection;\n\tkeys;\n\tlabel;\n\tconstructor(collection, keys) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.label = `Drop index on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropIndex(this.collection, this.keys);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)})`;\n\t}\n};\nvar CreateCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createCollection\";\n\toperationClass = \"additive\";\n\tcollection;\n\toptions;\n\tlabel;\n\tconstructor(collection, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.label = `Create collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createCollection(this.collection, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createCollection(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})` : `createCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar DropCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropCollection\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tlabel;\n\tconstructor(collection) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.label = `Drop collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropCollection(this.collection);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar RenameCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameCollection\";\n\toperationClass = \"widening\";\n\tfrom;\n\tto;\n\tlabel;\n\tconstructor(from, to) {\n\t\tsuper();\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.label = `Rename collection ${from} to ${to}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameCollection(this.from, this.to);\n\t}\n\trenderTypeScript() {\n\t\treturn `renameCollection(${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)})`;\n\t}\n};\nfunction renderFilterOption(filter) {\n\treturn filter === void 0 ? \"\" : `, ${jsonToTsSource({ filter })}`;\n}\nvar RenameFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameField\";\n\toperationClass = \"widening\";\n\tcollection;\n\tfrom;\n\tto;\n\tfilter;\n\tlabel;\n\tconstructor(collection, from, to, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameField(this.collection, this.from, this.to, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `renameField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar UnsetFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"unsetField\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tfield;\n\tfilter;\n\tlabel;\n\tconstructor(collection, field, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.field = field;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn unsetField(this.collection, this.field, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `unsetField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.field)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar CollModCall = class extends OpFactoryCallNode {\n\tfactoryName = \"collMod\";\n\tcollection;\n\toptions;\n\tmeta;\n\toperationClass;\n\tlabel;\n\tconstructor(collection, options, meta) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.meta = meta;\n\t\tthis.operationClass = meta?.operationClass ?? \"widening\";\n\t\tthis.label = meta?.label ?? `Modify collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn collMod(this.collection, this.options, this.meta);\n\t}\n\trenderTypeScript() {\n\t\treturn this.meta ? `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)}, ${jsonToTsSource(this.meta)})` : `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nfunction schemaIndexToCreateIndexOptions(index) {\n\treturn {\n\t\t...index.unique ? { unique: true } : {},\n\t\t...ifDefined(\"sparse\", index.sparse),\n\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds),\n\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression),\n\t\t...ifDefined(\"wildcardProjection\", index.wildcardProjection),\n\t\t...ifDefined(\"collation\", index.collation),\n\t\t...ifDefined(\"weights\", index.weights),\n\t\t...ifDefined(\"default_language\", index.default_language),\n\t\t...ifDefined(\"language_override\", index.language_override)\n\t};\n}\nfunction schemaCollectionToCreateCollectionOptions(coll) {\n\tconst opts = coll.options;\n\tconst validator = coll.validator;\n\tif (!opts && !validator) return void 0;\n\treturn {\n\t\t...opts?.capped ? { capped: true } : {},\n\t\t...ifDefined(\"size\", opts?.capped?.size),\n\t\t...ifDefined(\"max\", opts?.capped?.max),\n\t\t...ifDefined(\"timeseries\", opts?.timeseries),\n\t\t...ifDefined(\"collation\", opts?.collation),\n\t\t...opts?.clusteredIndex ? { clusteredIndex: {\n\t\t\tkey: { _id: 1 },\n\t\t\tunique: true,\n\t\t\t...opts.clusteredIndex.name != null ? { name: opts.clusteredIndex.name } : {}\n\t\t} } : {},\n\t\t...validator ? { validator: { $jsonSchema: validator.jsonSchema } } : {},\n\t\t...ifDefined(\"validationLevel\", validator?.validationLevel),\n\t\t...ifDefined(\"validationAction\", validator?.validationAction),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts?.changeStreamPreAndPostImages)\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-statement-planning.ts\n/** The collection a model stores its documents in; a model without `@@map` names it verbatim. */\nfunction collectionOf(contract, coordinate) {\n\tconst collection = contract?.domain.namespaces[coordinate.namespaceId]?.models[coordinate.model]?.storage[\"collection\"];\n\treturn typeof collection === \"string\" ? collection : coordinate.model;\n}\nfunction modelAt(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn Object.hasOwn(models, coordinate.model) ? models[coordinate.model] : void 0;\n}\n/** The stored name of `field` of the model at `coordinate`, or undefined when the model does not declare it. */\nfunction storedFieldNameAt(contract, coordinate) {\n\tconst model = modelAt(contract, coordinate);\n\treturn model === void 0 || !Object.hasOwn(model.fields, coordinate.field) ? void 0 : ownStoredNameOf(model, coordinate.field);\n}\n/** The stored name of a field the statement's resolution found on the model at `coordinate`. */\nfunction resolvedStoredNameAt(contract, coordinate) {\n\tconst storedName = storedFieldNameAt(contract, coordinate);\n\tif (storedName === void 0) throw new InternalError(`Field \"${coordinate.model}.${coordinate.field}\" a statement names has no stored name`);\n\treturn storedName;\n}\n/**\n* The condition that selects a variant's documents in the collection it shares with its base: the\n* base's discriminator field holding the variant's value. A model that is not a variant has none.\n*/\nfunction variantFilter(contract, coordinate) {\n\tconst base = modelAt(contract, coordinate)?.base;\n\tif (base === void 0) return void 0;\n\tconst baseModel = modelAt(contract, {\n\t\tnamespaceId: asNamespaceId(base.namespace),\n\t\tmodel: base.model\n\t});\n\tconst field = baseModel?.discriminator?.field;\n\tconst value = Object.entries(baseModel?.variants ?? {}).find(([, variant]) => variant.namespace === coordinate.namespaceId && variant.model === coordinate.model)?.[0];\n\treturn baseModel === void 0 || field === void 0 || value === void 0 ? void 0 : { [ownStoredNameOf(baseModel, field)]: value };\n}\nfunction declaredCollection(contract, collection) {\n\treturn Object.values(contract.storage.namespaces).map((namespace) => namespace.entries[\"collection\"]?.[collection]).find((entry) => entry instanceof MongoCollection);\n}\n/**\n* The control policy of `collection`. A collection the contract leaves out keeps the policy `fromContract` gave it, when that was not `managed`, so leaving an `external` collection out of the contract does not drop it.\n*/\nfunction collectionControlOf(contract, fromContract, collection) {\n\tconst declared = declaredCollection(contract, collection);\n\tconst original = declared === void 0 && fromContract !== null ? declaredCollection(fromContract, collection) : void 0;\n\tconst policy = collectionControlPolicyOf(collection, collectionControlPoliciesOf(contract));\n\tif (original === void 0 || fromContract === null) return {\n\t\tpolicy,\n\t\tdeclared: declared?.control\n\t};\n\tconst originalPolicy = governingControlPolicy({ explicitNodeControlPolicy: original.control }, fromContract.defaultControlPolicy);\n\treturn {\n\t\tpolicy: originalPolicy === \"managed\" ? policy : originalPolicy,\n\t\tdeclared: original.control\n\t};\n}\nfunction collectionControlPolicy(contract, collection) {\n\treturn collectionControlOf(contract, null, collection).policy;\n}\n/** Why MongoDB would refuse a collection name, if it would. */\nfunction invalidCollectionNameReason(name) {\n\tif (name === \"\") return \"it is empty\";\n\tif (name.includes(\"$\")) return \"it contains \\\"$\\\"\";\n\tif (name.includes(\"\\0\")) return \"it contains a null character\";\n\tif (name.startsWith(\"system.\")) return \"it starts with \\\"system.\\\", which MongoDB reserves\";\n}\nfunction isEmbedRelation(relation) {\n\treturn !(\"on\" in relation) && !(\"through\" in relation);\n}\nfunction storedField(model, field) {\n\tif (model === void 0) return { kind: \"absent\" };\n\tif (Object.hasOwn(model.fields, field)) return { kind: \"field\" };\n\tconst relation = Object.hasOwn(model.relations, field) ? model.relations[field] : void 0;\n\tif (relation === void 0) return { kind: \"absent\" };\n\treturn isEmbedRelation(relation) ? { kind: \"embed\" } : { kind: \"reference\" };\n}\nfunction refused(statement, label, reason, why) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `${label}: ${reason}`,\n\t\twhy,\n\t\trefusedStatement: statement\n\t};\n}\nconst LEAVE_OUT = \"Leave out this statement.\";\nconst SEPARATE_THE_MODELS = \"move the models to separate collections, or carry out the change in a dataTransform operation of a migration.ts, with a filter that selects only their documents\";\n/**\n* The discriminator field and value a variant's filter selects, or `undefined` for a filter that selects by anything else, or no filter.\n*/\nfunction discriminatorValueOf(filter) {\n\tconst entries = Object.entries(filter ?? {});\n\tif (entries.length !== 1) return void 0;\n\tconst [entry] = entries;\n\tif (entry === void 0) return void 0;\n\tconst [field, value] = entry;\n\treturn typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" ? {\n\t\tfield,\n\t\tvalue\n\t} : void 0;\n}\n/**\n* The other models stored in `collection`, root models and their variants, whose documents a change of `storedName` with `filter` reaches, and which store the field themselves or through their base. No discriminator tells the documents of several root models apart, so without a filter, or with a base model's filter, every other root model's documents are reached. A variant's filter, one discriminator value, reaches a model only when its documents can hold that value: a variant of another root model with the same discriminator field and value, or a model that declares the discriminator field itself.\n*/\nfunction otherModelsReached(contract, model, collection, filter, storedName) {\n\tconst models = mongoModelsOf(contract.domain, model.namespaceId);\n\tconst baseOf = (name) => {\n\t\tconst base = models[name]?.base;\n\t\treturn base === void 0 ? void 0 : models[base.model];\n\t};\n\tconst storesOrInherits = (name, storedName) => modelAndBasesOf(models, name).some((each) => ownStores(each, storedName));\n\tconst selected = discriminatorValueOf(filter);\n\tconst canHold = (name) => {\n\t\tif (selected === void 0) return true;\n\t\tconst base = baseOf(name);\n\t\tconst discriminator = base?.discriminator?.field;\n\t\tif (base !== void 0 && discriminator !== void 0 && ownStoredNameOf(base, discriminator) === selected.field) return Object.entries(base.variants ?? {}).some(([value, variant]) => variant.model === name && value === selected.value);\n\t\treturn storesOrInherits(name, selected.field);\n\t};\n\tconst subjectRoot = modelAt(contract, model)?.base?.model ?? model.model;\n\treturn (collectionRootModelsOf(models)[collection] ?? []).filter((name) => name !== subjectRoot).flatMap((name) => [name, ...Object.values(models[name]?.variants ?? {}).map((variant) => variant.model)]).filter((name) => canHold(name) && storesOrInherits(name, storedName));\n}\nfunction sharedCollectionWhy(collection, others, change) {\n\tconst names = others.map((name) => JSON.stringify(name)).join(\", \");\n\treturn `Collection ${JSON.stringify(collection)} stores several models and no discriminator tells their documents apart, so ${change} of ${names} too.`;\n}\n/**\n* A removal the plan cannot carry out because another root model stored in the same collection still stores the field, and no discriminator selects the documents of the model that loses it.\n*/\nfunction sharedCollectionRemovalRefusals(removals, contract) {\n\treturn removals.flatMap((removal) => {\n\t\tconst { subject, call } = removal;\n\t\tif (subject.kind !== \"field\") return [];\n\t\tconst others = otherModelsReached(contract, subject, call.collection, call.filter, call.field);\n\t\tif (others.length === 0) return [];\n\t\treturn [{\n\t\t\tkind: \"fieldRemovalRefused\",\n\t\t\tsummary: `Cannot remove field ${JSON.stringify(call.field)} of model ${JSON.stringify(subject.model)} from collection ${JSON.stringify(call.collection)}: model ${others.map((name) => JSON.stringify(name)).join(\", \")} stores it in the same collection`,\n\t\t\twhy: `${sharedCollectionWhy(call.collection, others, \"removing the field would remove it from the documents\")} To keep it in ${others.map((name) => JSON.stringify(name)).join(\", \")} documents only, ${SEPARATE_THE_MODELS}.`\n\t\t}];\n\t});\n}\nconst TIME_SERIES_UPDATES = \"MongoDB updates the documents of a time-series collection only through its metaField\";\n/**\n* A removal the plan cannot carry out because its collection is a time-series collection, whose\n* documents MongoDB does not let an update change except through the metaField.\n*/\nfunction timeSeriesRemovalRefusals(removals, schema) {\n\treturn removals.filter((removal) => schema.collection(removal.call.collection)?.options?.timeseries !== void 0).map((removal) => ({\n\t\tkind: \"fieldRemovalRefused\",\n\t\tsummary: `Cannot remove field ${JSON.stringify(removal.call.field)} from collection ${JSON.stringify(removal.call.collection)}: it is a time-series collection`,\n\t\twhy: `${TIME_SERIES_UPDATES}, so the field cannot be removed from the documents that hold it. Keep the field in the contract, as an optional field if new documents leave it out, then run this command again.`\n\t}));\n}\n/**\n* Plans the rename each statement states, in order: a model statement whose collection changes renames the\n* collection in the schema the diff then starts from, and a field statement whose stored name\n* changes renames the field in the documents that hold it.\n*/\nfunction planStatements(input) {\n\tlet schema = input.schema;\n\tconst collectionRenames = [];\n\tconst fieldRenames = [];\n\tconst callOfStatement = [];\n\tconst conflicts = [];\n\tconst renamedCollections = /* @__PURE__ */ new Map();\n\tfor (const statement of input.statements) {\n\t\tconst label = `Cannot ${describeMigrationStatement(statement, input.fromContract, input.contract)}`;\n\t\tconst outcome = statement.entity === \"namespace\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename namespaces in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"enumValue\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename enum values in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"model\" ? planModelStatement(statement, label, schema, input) : planFieldStatement(statement, label, renamedCollections, schema, input);\n\t\tif (outcome.kind === \"refused\") {\n\t\t\tconflicts.push(outcome.conflict);\n\t\t\tcallOfStatement.push(void 0);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"renameCollection\") {\n\t\t\tschema = renameInSchema(schema, outcome.call.from, outcome.call.to);\n\t\t\trenamedCollections.set(outcome.call.from, outcome.call.to);\n\t\t\tcollectionRenames.push(outcome.call);\n\t\t}\n\t\tif (outcome.kind === \"renameField\") {\n\t\t\tconst same = fieldRenames.find((call) => sameFieldRename(call, outcome.call));\n\t\t\tif (same !== void 0) {\n\t\t\t\tcallOfStatement.push(same);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfieldRenames.push(outcome.call);\n\t\t}\n\t\tcallOfStatement.push(outcome.kind === \"unchanged\" ? void 0 : outcome.call);\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok({\n\t\tschema,\n\t\tcollectionRenames,\n\t\tfieldRenames,\n\t\tcallOfStatement\n\t});\n}\n/** Whether two field renames rewrite the same documents the same way, as when every root model of a shared collection renames a field together. */\nfunction sameFieldRename(a, b) {\n\treturn a.collection === b.collection && a.from === b.from && a.to === b.to && JSON.stringify(a.filter) === JSON.stringify(b.filter);\n}\nfunction renameInSchema(schema, from, to) {\n\treturn new MongoSchemaIR(schema.collections.map((collection) => collection.name === from ? new MongoSchemaCollection({\n\t\tname: to,\n\t\tindexes: collection.indexes,\n\t\t...collection.validator === void 0 ? {} : { validator: collection.validator },\n\t\t...collection.options === void 0 ? {} : { options: collection.options }\n\t}) : collection));\n}\nfunction controlPolicyRefusal(statement, label, contract, collection) {\n\tconst policy = collectionControlPolicy(contract, collection);\n\tif (policy === \"managed\") return void 0;\n\treturn {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, `collection \"${collection}\" has control policy \"${policy}\"`, `Statements rename only collections, and fields of collections, whose control policy is \"managed\". Make the change in the database yourself and leave out this statement.`)\n\t};\n}\n/**\n* The reason and advice when a statement renames a variant whose discriminator value changes: its\n* documents keep the old value, which the new validator does not accept.\n*/\nfunction discriminatorValueChange(statement, input) {\n\tconst before = variantFilter(input.fromContract, statement.from);\n\tconst after = variantFilter(input.contract, statement.to);\n\tconst base = modelAt(input.contract, statement.to)?.base;\n\tif (before === void 0 || after === void 0 || base === void 0) return void 0;\n\tconst [field, oldValue] = Object.entries(before)[0] ?? [];\n\tconst newValue = Object.values(after)[0];\n\tif (field === void 0 || oldValue === newValue) return void 0;\n\tconst fromName = modelDisplayName(statement.from);\n\tconst toName = modelDisplayName(statement.to);\n\treturn [`its discriminator value changes from ${JSON.stringify(oldValue)} to ${JSON.stringify(newValue)}`, `The documents of \"${fromName}\" hold ${field} ${JSON.stringify(oldValue)}, and this release does not rewrite a discriminator value, so they would no longer match \"${toName}\" and would fail validation. Keep the value: declare \"${toName}\" with @@base(${base.model}, ${JSON.stringify(oldValue)}). A later release changes a stored value with --convert.`];\n}\nfunction planModelStatement(statement, label, schema, input) {\n\tconst discriminatorChange = discriminatorValueChange(statement, input);\n\tif (discriminatorChange !== void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, ...discriminatorChange)\n\t};\n\tconst from = collectionOf(input.fromContract, statement.from);\n\tconst to = collectionOf(input.contract, statement.to);\n\tif (from === to) return { kind: \"unchanged\" };\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, to);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, reason, why)\n\t});\n\tconst source = schema.collection(from);\n\tif (source === void 0) return refuse(`the schema being planned from has no collection \"${from}\"`, `The database has no collection \"${from}\", or \"${from}\" is a view, which MongoDB cannot rename. Inspect it with prisma db schema, or ${LEAVE_OUT.toLowerCase()}`);\n\tif (source.options?.timeseries !== void 0) return refuse(`collection \"${from}\" is a time-series collection`, `MongoDB cannot rename a time-series collection. Leave out this statement. To keep the documents, first create collection \"${to}\" yourself with the same time-series options and copy them into it; the plan then drops \"${from}\" once --delete names the model.`);\n\tconst invalid = invalidCollectionNameReason(to);\n\tif (invalid !== void 0) return refuse(`MongoDB does not accept the collection name \"${to}\": ${invalid}`, \"Give the model a collection name MongoDB accepts with @@map, then run this command again.\");\n\tif (schema.collection(to) !== void 0) return refuse(`the schema being planned from already has a collection \"${to}\"`, `A rename cannot replace a collection that already exists. Rename or drop collection \"${to}\" first, or ${LEAVE_OUT.toLowerCase()}`);\n\treturn {\n\t\tkind: \"renameCollection\",\n\t\tcall: new RenameCollectionCall(from, to)\n\t};\n}\nfunction planFieldStatement(statement, label, renamedCollections, schema, input) {\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, reason, why)\n\t});\n\tconst fromField = storedField(modelAt(input.fromContract, statement.from), statement.from.field);\n\tconst toField = storedField(modelAt(input.contract, statement.to), statement.to.field);\n\tif (fromField.kind === \"embed\" || toField.kind === \"embed\") return refuse(\"the field is an embedded relation\", `Renaming an embedded relation is not supported in this release. ${LEAVE_OUT}`);\n\tif (fromField.kind !== \"field\" && toField.kind !== \"field\") return { kind: \"unchanged\" };\n\tif (fromField.kind !== \"field\" || toField.kind !== \"field\") return refuse(\"the field is stored in documents on one side of the statement only\", `A relation is not stored in documents, so a statement cannot rename a field to or from one. ${LEAVE_OUT}`);\n\tconst fromStored = resolvedStoredNameAt(input.fromContract, statement.from);\n\tconst toStored = resolvedStoredNameAt(input.contract, statement.to);\n\tconst originCollection = collectionOf(input.fromContract, statement.from);\n\tconst collection = renamedCollections.get(originCollection) ?? originCollection;\n\tconst destinationCollection = collectionOf(input.contract, statement.to);\n\tif (fromStored === toStored && collection === destinationCollection) return { kind: \"unchanged\" };\n\tif (fromStored === \"_id\" || toStored === \"_id\") return refuse(\"it renames _id\", `MongoDB does not let a document change its _id. ${LEAVE_OUT}`);\n\tconst unsafeFrom = unrewritableFieldNameReason(fromStored);\n\tif (unsafeFrom !== void 0) return refuse(`the stored name \"${fromStored}\" cannot be rewritten`, `${unsafeFrom}, so a statement cannot move its values. Rename it in the database yourself, or ${LEAVE_OUT.toLowerCase()}`);\n\tconst unsafeTo = unrewritableFieldNameReason(toStored);\n\tif (unsafeTo !== void 0) return refuse(`the stored name \"${toStored}\" cannot be written`, `${unsafeTo}. Give the field a stored name without \".\" that does not start with \"$\" (with @map), or ${LEAVE_OUT.toLowerCase()}`);\n\tif (collection !== destinationCollection) return refuse(`the model's collection changes from \"${originCollection}\" to \"${destinationCollection}\", and no statement renames it`, collectionChangeAdvice(statement, originCollection, destinationCollection));\n\tif (schema.collection(collection)?.options?.timeseries !== void 0) return refuse(`collection \"${collection}\" is a time-series collection`, `${TIME_SERIES_UPDATES}, so a statement cannot move the values of a field in them. Keep the stored name: store the field as ${JSON.stringify(fromStored)} (with @map(${JSON.stringify(fromStored)}) in PSL), then run this command again without this statement.`);\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, collection);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst variant = variantFilter(input.fromContract, statement.from);\n\tconst renamedTogether = new Set(input.statements.flatMap((other) => other.entity === \"field\" && other.from.namespaceId === statement.from.namespaceId && storedFieldNameAt(input.fromContract, other.from) === fromStored && storedFieldNameAt(input.contract, other.to) === toStored ? [other.from.model] : []));\n\tconst others = otherModelsReached(input.fromContract, statement.from, originCollection, variant, fromStored).filter((name) => !renamedTogether.has(name));\n\tif (others.length > 0) return refuse(`model ${others.map((name) => JSON.stringify(name)).join(\", \")} stores field ${JSON.stringify(fromStored)} in the same collection, ${JSON.stringify(collection)}`, `${sharedCollectionWhy(collection, others, \"renaming the field would rename it in the documents\")} To change it, ${SEPARATE_THE_MODELS}.`);\n\treturn {\n\t\tkind: \"renameField\",\n\t\tcall: new RenameFieldCall(collection, fromStored, toStored, variant ?? rootDocumentsLosing(input.contract, statement.to, fromStored)?.filter)\n\t};\n}\nfunction collectionChangeAdvice(statement, from, to) {\n\tif (!sameModel(statement.from, statement.to)) return `Add --rename ${modelDisplayName(statement.from)}:${modelDisplayName(statement.to)} before this statement, so the collection is renamed with its documents.`;\n\treturn `A statement cannot rename the collection of a model that keeps its name. Rename the collection in a step of its own first: change only @@map and emit the contract. ${renameCollectionByHandSteps(statement.from, from, to)} Then change the field and run this statement again.`;\n}\nfunction renameCollectionByHandSteps(model, from, to) {\n\treturn `With db update, rename the collection in the database yourself, for example db.getCollection(${JSON.stringify(from)}).renameCollection(${JSON.stringify(to)}) in mongosh, then run db update. With migration plan, plan it, passing --delete ${modelDisplayName(model)} to answer its question; in its migration.ts make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation, imported with the other operations, delete the drop of \"${from}\", and delete the create of \"${to}\" if there is one; run node on that migration.ts so it writes ops.json again; then apply it with prisma db migrate.`;\n}\n/**\n* How to keep the documents of a model that keeps its name while its collection changes from\n* `from` to `to`: no statement can rename that collection, so the user renames it by hand.\n*/\nfunction keepCollectionByHandAdvice(model, from, to) {\n\treturn `To keep its documents, rename collection \"${from}\" to \"${to}\" instead; a statement cannot rename the collection of a model that keeps its name. ${renameCollectionByHandSteps(model, from, to)}`;\n}\nfunction modelCoordinates(contract) {\n\treturn Object.entries(contract.domain?.namespaces ?? {}).flatMap(([namespaceId, namespace]) => Object.keys(namespace.models).map((model) => ({\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel\n\t})));\n}\nfunction sameModel(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model;\n}\n/**\n* The destination model an origin model became: the one a statement renamed it to, else the one of\n* the same name, else the only one stored the same way (same collection, same variant value).\n*/\nfunction destinationModelOf(origin, input) {\n\tconst renamed = input.statements.find((statement) => statement.entity === \"model\" && sameModel(statement.from, origin));\n\tif (renamed !== void 0) return renamed.to;\n\tif (modelAt(input.contract, origin) !== void 0) return origin;\n\tconst collection = input.collectionAfterRenames(collectionOf(input.fromContract, origin));\n\tconst filter = JSON.stringify(variantFilter(input.fromContract, origin) ?? null);\n\tconst stored = modelCoordinates(input.contract).filter((candidate) => collectionOf(input.contract, candidate) === collection && JSON.stringify(variantFilter(input.contract, candidate) ?? null) === filter);\n\tconst [only] = stored;\n\treturn stored.length === 1 ? only : void 0;\n}\nfunction renamedByStatement(input, field) {\n\treturn input.statements.some((statement) => statement.entity === \"field\" && sameModel(statement.from, field) && statement.from.field === field.field);\n}\n/** Whether one of `model`'s own fields or embed relations is stored under `storedName`. */\nfunction ownStores(model, storedName) {\n\treturn hasOwnFieldStoredAs(model, storedName) || Object.values(ownEmbedStoredNamesOf(model)).includes(storedName);\n}\n/** The stored names of the documents of the model at `coordinate`: its fields and embed relations, its own and those it inherits. */\nfunction storedFieldsOf(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn new Set(modelAndBasesOf(models, coordinate.model).flatMap((model) => [...Object.values(ownStoredNamesOf(model)), ...Object.values(ownEmbedStoredNamesOf(model))]));\n}\n/**\n* The documents of a root model that lose `field`: all of them, or, when some of its destination\n* variants now store the field themselves, those whose discriminator value is none of theirs.\n* `undefined` when the root model itself still stores it.\n*/\nfunction rootDocumentsLosing(contract, root, storedName) {\n\tconst model = modelAt(contract, root);\n\tif (model === void 0 || ownStores(model, storedName)) return void 0;\n\tconst discriminator = model.discriminator?.field;\n\tconst keeping = Object.entries(model.variants ?? {}).filter(([, variant]) => {\n\t\tconst variantModel = modelAt(contract, {\n\t\t\tnamespaceId: variant.namespace,\n\t\t\tmodel: variant.model\n\t\t});\n\t\treturn variantModel !== void 0 && ownStores(variantModel, storedName);\n\t}).map(([value]) => value).sort();\n\tif (discriminator === void 0 || keeping.length === 0) return { filter: void 0 };\n\treturn { filter: { [ownStoredNameOf(model, discriminator)]: { $nin: keeping } } };\n}\n/**\n* Each field an origin model stores that its destination model no longer stores, in a collection\n* the plan keeps: removing it is data loss, carried out by unsetting it from the documents that\n* hold it, in a collection whose control policy is `managed`. A variant's field is unset only from that variant's documents, unless its destination\n* base now stores it. A base field is unset from the documents of every variant that does not now\n* store it itself.\n*/\nfunction planFieldRemovals(input) {\n\treturn modelCoordinates(input.fromContract).flatMap((origin) => {\n\t\tconst collection = input.collectionAfterRenames(collectionOf(input.fromContract, origin));\n\t\tif (!input.keptCollections.has(collection)) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst destination = destinationModelOf(origin, input);\n\t\tif (destination === void 0) return [];\n\t\tconst model = modelAt(input.fromContract, origin);\n\t\tif (model === void 0) return [];\n\t\tconst variant = variantFilter(input.fromContract, origin);\n\t\tconst losing = (storedName) => {\n\t\t\tif (variant !== void 0) return storedFieldsOf(input.contract, destination).has(storedName) ? void 0 : { filter: variant };\n\t\t\treturn rootDocumentsLosing(input.contract, destination, storedName);\n\t\t};\n\t\treturn Object.entries(ownStoredNamesOf(model)).filter(([field, storedName]) => unrewritableFieldNameReason(storedName) === void 0 && !renamedByStatement(input, {\n\t\t\t...origin,\n\t\t\tfield\n\t\t})).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).flatMap(([field, storedName]) => {\n\t\t\tconst lost = losing(storedName);\n\t\t\treturn lost === void 0 ? [] : [{\n\t\t\t\tcall: new UnsetFieldCall(collection, storedName, lost.filter),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...origin,\n\t\t\t\t\tfield\n\t\t\t\t}\n\t\t\t}];\n\t\t});\n\t});\n}\n/**\n* Without an origin contract, a field is known removed when the origin validator declares it for a\n* root model and the destination validator declares it nowhere. It is named by its storage name.\n*/\nfunction planValidatorFieldRemovals(input) {\n\treturn input.origin.collections.flatMap((originCollection) => {\n\t\tif (collectionControlPolicy(input.contract, originCollection.name) !== \"managed\") return [];\n\t\tconst destination = input.destination.collection(originCollection.name);\n\t\tif (destination?.validator === void 0 || originCollection.validator === void 0) return [];\n\t\tconst kept = validatorFieldNamesOf(destination.validator.jsonSchema);\n\t\treturn [...new Set(validatorRootShapesOf(originCollection.validator.jsonSchema).flatMap((root) => Object.keys(root.properties)))].filter((field) => unrewritableFieldNameReason(field) === void 0 && !kept.has(field)).sort().map((field) => ({\n\t\t\tcall: new UnsetFieldCall(originCollection.name, field),\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: `${originCollection.name}.${field}`\n\t\t\t}\n\t\t}));\n\t});\n}\n//#endregion\n//#region src/core/migrations/render-ops.ts\nfunction renderOps(calls) {\n\treturn calls.map((call) => call.toOp());\n}\n//#endregion\n//#region src/core/migrations/render-typescript.ts\n/**\n* Always-present base imports for the rendered scaffold, both from the\n* target's own `migration` entry:\n*\n* - `Migration` — the user-facing Mongo `Migration` base, forwarded from\n* `@internal/family-mongo`; subclasses don't need to redeclare\n* `targetId` or thread family/target generics.\n* - `MigrationCLI` — the migration-file CLI entrypoint that loads\n* `prisma.config.ts`, assembles a `ControlStack`, and instantiates\n* the migration class. The migration file owns this dependency directly:\n* pulling CLI machinery in at script run time is acceptable because the\n* script's whole purpose is to be invoked from the project that owns the\n* config.\n*\n* Naming one package rather than three is what lets an application that\n* installed only `@prisma/orm-mongo` run a scaffolded migration: emitted\n* code may name only a direct dependency (ADR 242), and the facade carries\n* the target's `migration` entry but neither the family base nor the CLI.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"MigrationCLI\"\n}];\n/**\n* Render a list of Mongo `OpFactoryCall`s as a `migration.ts` source string.\n* The result is shebanged, imports the contract JSON from the shared\n* snapshot store (the destination contract, plus the source contract for a\n* non-baseline migration), extends `Migration<Start, End>` (or\n* `Migration<never, End>` for a baseline) from\n* `@internal/target-mongo/migration`,\n* assigns the JSON to `endContractJson` / `startContractJson`, and implements\n* `operations`. The `Migration` base derives `describe()` from those fields.\n*\n* The walk is polymorphic: each call node contributes its own\n* `renderTypeScript()` expression and declares its own `importRequirements()`.\n* The top-level renderer aggregates imports across all nodes and emits one\n* `import { … } from \"…\"` line per module. The `Migration` / `MigrationCLI`\n* base imports and the contract-JSON imports are always emitted, independent\n* of the call nodes.\n*/\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"export default M;\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/migrations/planner-produced-migration.ts\n/**\n* Planner-produced Mongo migration, returned by `MongoMigrationPlanner.plan(...)`\n* and `MongoMigrationPlanner.emptyMigration(...)`.\n*\n* Unlike user-authored migrations (which extend `MongoMigration` from\n* `@internal/family-mongo`), this class lives inside the target and holds\n* the richer authoring IR (`OpFactoryCall[]`) needed to render itself back to\n* TypeScript source. It implements `MigrationPlanWithAuthoringSurface` so\n* that the CLI can uniformly ask any planner result to serialize itself to a\n* `migration.ts`.\n*\n* It extends the framework `Migration` base directly and declares its own\n* `targetId` rather than inheriting `MongoMigration`, whose added value is\n* the lazily-built contract views a planner result never reads.\n*/\nvar PlannerProducedMongoMigration = class extends Migration {\n\tcalls;\n\tmeta;\n\tsnapshotsImportPath;\n\ttargetId = \"mongo\";\n\tconstructor(calls, meta, snapshotsImportPath) {\n\t\tsuper();\n\t\tthis.calls = calls;\n\t\tthis.meta = meta;\n\t\tthis.snapshotsImportPath = snapshotsImportPath;\n\t}\n\tget operations() {\n\t\treturn renderOps(this.calls);\n\t}\n\tdescribe() {\n\t\treturn this.meta;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.calls, {\n\t\t\tfrom: this.meta.from,\n\t\t\tto: this.meta.to,\n\t\t\tsnapshotsImportPath: this.snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-planner.ts\nfunction validatorsEqual(a, b) {\n\tif (!a && !b) return true;\n\tif (!a || !b) return false;\n\treturn a.validationLevel === b.validationLevel && a.validationAction === b.validationAction && canonicalize(a.jsonSchema) === canonicalize(b.jsonSchema);\n}\nfunction isPlainObject(v) {\n\treturn typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n/** Each field a root model of the validator declares, with the distinct schemas the root models give it, in canonical form. */\nfunction propertiesOf(schema) {\n\tconst schemas = /* @__PURE__ */ new Map();\n\tfor (const root of validatorRootShapesOf(schema)) for (const [field, fieldSchema] of Object.entries(root.properties)) schemas.set(field, (schemas.get(field) ?? /* @__PURE__ */ new Set()).add(canonicalize(fieldSchema)));\n\treturn Object.fromEntries([...schemas].map(([field, distinct]) => [field, [...distinct].sort().join(\"|\")]));\n}\n/**\n* A label naming the properties whose schema changed, so a dry run shows what a validator update does: `Update validator on items (changed: meta; added: note)`.\n*/\nfunction validatorUpdateLabel(collName, origin, dest) {\n\tconst originProps = propertiesOf(origin.jsonSchema);\n\tconst destProps = propertiesOf(dest.jsonSchema);\n\tconst changed = Object.keys(destProps).filter((field) => Object.hasOwn(originProps, field) && originProps[field] !== destProps[field]);\n\tconst added = Object.keys(destProps).filter((field) => !Object.hasOwn(originProps, field));\n\tconst removed = Object.keys(originProps).filter((field) => !Object.hasOwn(destProps, field));\n\tconst parts = [\n\t\t...changed.length > 0 ? [`changed: ${changed.join(\", \")}`] : [],\n\t\t...added.length > 0 ? [`added: ${added.join(\", \")}`] : [],\n\t\t...removed.length > 0 ? [`removed: ${removed.join(\", \")}`] : []\n\t];\n\treturn parts.length === 0 ? `Update validator on ${collName}` : `Update validator on ${collName} (${parts.join(\"; \")})`;\n}\n/**\n* The keys of an option MongoDB fills in when a collection is created without them, each with a\n* test for the value it fills in. `listCollections` reports a time-series collection's granularity\n* as \"seconds\" and its bucketMaxSpanSeconds when they were not given, and bucketRoundingSeconds only\n* for custom bucketing, which a contract cannot state; and a clustered index's v, key and unique, and\n* its name as \"_id_\".\n*/\nconst SERVER_FILLED = {\n\ttimeseries: {\n\t\tgranularity: (value) => value === \"seconds\",\n\t\tbucketMaxSpanSeconds: () => true,\n\t\tbucketRoundingSeconds: () => true\n\t},\n\tclusteredIndex: {\n\t\tv: () => true,\n\t\tkey: () => true,\n\t\tunique: () => true,\n\t\tname: (value) => value === \"_id_\"\n\t}\n};\n/** The origin's value of an option without the keys the server filled in and the destination leaves out. */\nfunction withoutServerFilled(option, origin, dest) {\n\tif (!isPlainObject(origin)) return origin;\n\tconst filled = SERVER_FILLED[option];\n\treturn Object.fromEntries(Object.entries(origin).filter(([key, value]) => isPlainObject(dest) && Object.hasOwn(dest, key) || !filled[key]?.(value)));\n}\nfunction hasImmutableOptionChange(origin, dest) {\n\tif (canonicalize(origin?.capped) !== canonicalize(dest?.capped)) return \"capped\";\n\tif (canonicalize(withoutServerFilled(\"timeseries\", origin?.timeseries, dest?.timeseries)) !== canonicalize(dest?.timeseries)) return \"timeseries\";\n\tif (canonicalize(origin?.collation) !== canonicalize(dest?.collation)) return \"collation\";\n\tif (canonicalize(withoutServerFilled(\"clusteredIndex\", origin?.clusteredIndex, dest?.clusteredIndex)) !== canonicalize(dest?.clusteredIndex)) return \"clusteredIndex\";\n}\nfunction collectionHasOptions(coll) {\n\treturn !!(coll.options || coll.validator);\n}\n/**\n* The model of `fromContract` that stores its documents in `collection`, if any: the root model\n* when variants share the collection with it.\n*/\nfunction modelStoredIn(fromContract, collection) {\n\tconst storing = Object.entries(fromContract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => {\n\t\tconst coordinate = {\n\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\tmodel\n\t\t};\n\t\treturn collectionOf(fromContract, coordinate) === collection ? [{\n\t\t\tcoordinate,\n\t\t\tisRoot: definition.base === void 0\n\t\t}] : [];\n\t}));\n\treturn (storing.find(({ isRoot }) => isRoot) ?? storing[0])?.coordinate;\n}\n/** A convert or backfill statement, which this release cannot carry out on MongoDB. */\nfunction unsupportedStatementConflict(statement, fromContract, contract) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `MongoDB does not apply ${statement.kind} statements in this release, so nothing was planned: ${describeMigrationStatement(statement, fromContract, contract)}`,\n\t\twhy: `MongoDB cannot carry out ${statement.kind} statements in this release. Leave out the statement.`,\n\t\trefusedStatement: statement\n\t};\n}\n/**\n* Each collection drop of the plan, with the model whose documents it loses. When that model keeps\n* its name and the plan brings its new collection into existence, the drop says how to rename the\n* collection by hand instead.\n*/\nfunction collectionDrops(calls, fromContract, contract, collections) {\n\tconst created = (collection) => collections.origin.collection(collection) === void 0 && collections.destination.collection(collection) !== void 0;\n\treturn calls.flatMap((call, operationIndex) => {\n\t\tif (!(call instanceof DropCollectionCall)) return [];\n\t\tconst model = fromContract === null ? void 0 : modelStoredIn(fromContract, call.collection);\n\t\tconst lost = {\n\t\t\toperationIndex,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: call.label\n\t\t};\n\t\tif (model === void 0) return [{\n\t\t\t...lost,\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: call.collection\n\t\t\t}\n\t\t}];\n\t\tconst subject = {\n\t\t\tkind: \"model\",\n\t\t\t...model\n\t\t};\n\t\tconst destinationCollection = modelStoredInDestination(contract, model);\n\t\treturn [destinationCollection !== void 0 && created(destinationCollection) ? {\n\t\t\t...lost,\n\t\t\tsubject,\n\t\t\tkeepDataAdvice: keepCollectionByHandAdvice(model, call.collection, destinationCollection)\n\t\t} : {\n\t\t\t...lost,\n\t\t\tsubject\n\t\t}];\n\t});\n}\n/** The collection the destination stores `model` in, when the destination still has that model. */\nfunction modelStoredInDestination(contract, model) {\n\tconst namespace = contract.domain.namespaces[model.namespaceId];\n\treturn namespace !== void 0 && Object.hasOwn(namespace.models, model.model) ? collectionOf(contract, model) : void 0;\n}\nfunction callsOf(diff) {\n\treturn [\n\t\t...diff.collCreates,\n\t\t...diff.drops,\n\t\t...diff.creates,\n\t\t...diff.validatorOps,\n\t\t...diff.mutableOptionOps,\n\t\t...diff.collDrops\n\t];\n}\nfunction planCollectionDiff(collName, originColl, destColl) {\n\tconst collCreates = [];\n\tconst drops = [];\n\tconst creates = [];\n\tconst validatorOps = [];\n\tconst mutableOptionOps = [];\n\tconst collDrops = [];\n\tconst conflicts = [];\n\tif (!originColl) {\n\t\tif (destColl && (collectionHasOptions(destColl) || destColl.indexes.length === 0)) {\n\t\t\tconst opts = collectionHasOptions(destColl) ? schemaCollectionToCreateCollectionOptions(destColl) : void 0;\n\t\t\tcollCreates.push(new CreateCollectionCall(collName, opts));\n\t\t}\n\t} else if (!destColl) collDrops.push(new DropCollectionCall(collName));\n\telse {\n\t\tconst immutableChange = hasImmutableOptionChange(originColl.options, destColl.options);\n\t\tif (immutableChange) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `Cannot change immutable collection option '${immutableChange}' on ${collName}`,\n\t\t\twhy: `MongoDB does not support modifying the '${immutableChange}' option after collection creation`\n\t\t});\n\t\tconst mutableCall = planMutableOptionsDiffCall(collName, originColl.options, destColl.options);\n\t\tif (mutableCall) mutableOptionOps.push(mutableCall);\n\t\tconst validatorCall = planValidatorDiffCall(collName, originColl.validator, destColl.validator);\n\t\tif (validatorCall) validatorOps.push(validatorCall);\n\t}\n\tconst originLookup = /* @__PURE__ */ new Map();\n\tif (originColl) for (const idx of originColl.indexes) originLookup.set(indexLookupKey(idx), idx);\n\tconst destLookup = /* @__PURE__ */ new Map();\n\tif (destColl) for (const idx of destColl.indexes) destLookup.set(indexLookupKey(idx), idx);\n\tfor (const [lookupKey, idx] of originLookup) if (!destLookup.has(lookupKey)) drops.push(new DropIndexCall(collName, idx.keys));\n\tfor (const [lookupKey, idx] of destLookup) if (!originLookup.has(lookupKey)) creates.push(new CreateIndexCall(collName, idx.keys, schemaIndexToCreateIndexOptions(idx)));\n\treturn {\n\t\tcollCreates,\n\t\tdrops,\n\t\tcreates,\n\t\tvalidatorOps,\n\t\tmutableOptionOps,\n\t\tcollDrops,\n\t\tconflicts\n\t};\n}\n/**\n* The warning for a change a collection's control policy left out of the plan, worded as the Postgres planner words a suppressed call.\n*/\nfunction suppressedCallWarning(call, collection, control) {\n\tconst declared = control.declared !== void 0 && control.declared !== control.policy ? ` but declared '${control.declared}'` : \"\";\n\treturn {\n\t\tkind: \"controlPolicySuppressedCall\",\n\t\tsummary: `control policy suppressed: ${call.label} — collection \"${collection}\" has effective control '${control.policy}'${declared}`,\n\t\tmeta: {\n\t\t\tcontrolPolicy: control.policy,\n\t\t\t...ifDefined(\"declaredControlPolicy\", control.declared)\n\t\t}\n\t};\n}\nvar MongoMigrationPlanner = class {\n\tplanCalls(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = options.statementCalls?.schema ?? blindCast(options.schema);\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst collCreates = [];\n\t\tconst drops = [];\n\t\tconst creates = [];\n\t\tconst validatorOps = [];\n\t\tconst mutableOptionOps = [];\n\t\tconst collDrops = [];\n\t\tconst conflicts = [];\n\t\tconst warnings = [];\n\t\tconst allCollectionNames = /* @__PURE__ */ new Set([...originIR.collectionNames, ...destinationIR.collectionNames]);\n\t\tfor (const collName of [...allCollectionNames].sort()) {\n\t\t\tconst originColl = originIR.collection(collName);\n\t\t\tconst planned = planCollectionDiff(collName, originColl, destinationIR.collection(collName));\n\t\t\tconst control = collectionControlOf(contract, options.fromContract, collName);\n\t\t\tif (!plansChangesTo(control.policy, originColl !== void 0)) {\n\t\t\t\twarnings.push(...callsOf(planned).map((call) => suppressedCallWarning(call, collName, control)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcollCreates.push(...planned.collCreates);\n\t\t\tdrops.push(...planned.drops);\n\t\t\tcreates.push(...planned.creates);\n\t\t\tvalidatorOps.push(...planned.validatorOps);\n\t\t\tmutableOptionOps.push(...planned.mutableOptionOps);\n\t\t\tcollDrops.push(...planned.collDrops);\n\t\t\tconflicts.push(...planned.conflicts);\n\t\t}\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\tconst allCalls = [\n\t\t\t...options.statementCalls?.collectionRenames ?? [],\n\t\t\t...collCreates,\n\t\t\t...drops,\n\t\t\t...options.statementCalls?.rewrites ?? [],\n\t\t\t...creates,\n\t\t\t...validatorOps,\n\t\t\t...mutableOptionOps,\n\t\t\t...collDrops\n\t\t];\n\t\tfor (const call of allCalls) if (!options.policy.allowedOperationClasses.includes(call.operationClass)) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `${call.operationClass} operation disallowed: ${call.label}`,\n\t\t\twhy: `Policy does not allow '${call.operationClass}' operations`,\n\t\t\trefusedOperationClass: call.operationClass\n\t\t});\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tcalls: allCalls,\n\t\t\twarnings\n\t\t};\n\t}\n\tplan(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = blindCast(options.schema);\n\t\tconst fromContract = options.fromContract;\n\t\tconst unsupported = options.statements.find((statement) => statement.kind !== \"rename\");\n\t\tif (unsupported !== void 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [unsupportedStatementConflict(unsupported, fromContract ?? contract, contract)]\n\t\t};\n\t\tconst renames = options.statements.filter((statement) => statement.kind === \"rename\");\n\t\tconst statementPlan = planStatements({\n\t\t\tstatements: renames,\n\t\t\tfromContract: fromContract ?? contract,\n\t\t\tcontract,\n\t\t\tschema: originIR\n\t\t});\n\t\tif (!statementPlan.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: statementPlan.failure\n\t\t};\n\t\tconst { schema, collectionRenames, fieldRenames, callOfStatement } = statementPlan.value;\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst renamedTo = new Map(collectionRenames.map((call) => [call.from, call.to]));\n\t\tconst removals = fromContract === null ? planValidatorFieldRemovals({\n\t\t\torigin: schema,\n\t\t\tdestination: destinationIR,\n\t\t\tcontract\n\t\t}) : planFieldRemovals({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0))\n\t\t});\n\t\tconst removalRefusals = [...timeSeriesRemovalRefusals(removals, schema), ...sharedCollectionRemovalRefusals(removals, contract)];\n\t\tif (removalRefusals.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: removalRefusals\n\t\t};\n\t\tconst result = this.planCalls({\n\t\t\t...options,\n\t\t\tstatementCalls: {\n\t\t\t\tschema,\n\t\t\t\tcollectionRenames,\n\t\t\t\trewrites: [...fieldRenames, ...removals.map((removal) => removal.call)]\n\t\t\t}\n\t\t});\n\t\tif (result.kind === \"failure\") return result;\n\t\tconst { calls, warnings } = result;\n\t\tconst fieldLoss = removals.map((removal) => ({\n\t\t\toperationIndex: calls.indexOf(removal.call),\n\t\t\tsubject: removal.subject,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: removal.call.label\n\t\t}));\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new PlannerProducedMongoMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: contract.storage.storageHash\n\t\t\t}, options.snapshotsImportPath),\n\t\t\tappliedStatements: options.statements.map((statement, index) => {\n\t\t\t\tconst call = callOfStatement[index];\n\t\t\t\treturn {\n\t\t\t\t\tstatement,\n\t\t\t\t\toperationIndexes: call === void 0 ? [] : [calls.indexOf(call)]\n\t\t\t\t};\n\t\t\t}),\n\t\t\tdataLoss: [...collectionDrops(calls, fromContract, contract, {\n\t\t\t\torigin: schema,\n\t\t\t\tdestination: destinationIR\n\t\t\t}), ...fieldLoss].sort((a, b) => a.operationIndex - b.operationIndex),\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: [],\n\t\t\t...warnings.length > 0 ? { warnings } : {}\n\t\t};\n\t}\n\t/**\n\t* Produce an empty `migration.ts` authoring surface for `migration new`.\n\t*\n\t* The \"empty migration\" is a `PlannerProducedMongoMigration` with no\n\t* operations; `renderTypeScript()` emits a stub class with the correct\n\t* `from`/`to` metadata that the user then fills in with operations. The\n\t* contract path on the context is unused — Mongo's emitted source does\n\t* not import from the generated contract `.d.ts`.\n\t*/\n\temptyMigration(context) {\n\t\treturn new PlannerProducedMongoMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, context.snapshotsImportPath);\n\t}\n};\nfunction plansChangesTo(policy, collectionExists) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return !collectionExists;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\nfunction planValidatorDiffCall(collName, originValidator, destValidator) {\n\tif (validatorsEqual(originValidator, destValidator)) return void 0;\n\tif (destValidator) return new CollModCall(collName, {\n\t\tvalidator: { $jsonSchema: destValidator.jsonSchema },\n\t\tvalidationLevel: destValidator.validationLevel,\n\t\tvalidationAction: destValidator.validationAction\n\t}, {\n\t\tid: `validator.${collName}.${originValidator ? \"update\" : \"add\"}`,\n\t\tlabel: originValidator ? validatorUpdateLabel(collName, originValidator, destValidator) : `Add validator on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n\treturn new CollModCall(collName, {\n\t\tvalidator: {},\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t}, {\n\t\tid: `validator.${collName}.remove`,\n\t\tlabel: `Remove validator on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\nfunction planMutableOptionsDiffCall(collName, origin, dest) {\n\tconst originCSPPI = origin?.changeStreamPreAndPostImages;\n\tconst destCSPPI = dest?.changeStreamPreAndPostImages;\n\tif (deepEqual(originCSPPI, destCSPPI)) return void 0;\n\treturn new CollModCall(collName, { changeStreamPreAndPostImages: destCSPPI ?? { enabled: false } }, {\n\t\tid: `options.${collName}.update`,\n\t\tlabel: `Update mutable options on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/filter-evaluator.ts\nfunction isRecord(value) {\n\treturn value !== null && typeof value === \"object\";\n}\nfunction getNestedField(doc, path) {\n\tconst parts = path.split(\".\");\n\tlet current = doc;\n\tfor (const part of parts) {\n\t\tif (!isRecord(current)) return;\n\t\tconst record = current;\n\t\tif (!Object.hasOwn(record, part)) return;\n\t\tcurrent = record[part];\n\t}\n\treturn blindCast(current);\n}\nfunction evaluateFieldOp(op, actual, expected) {\n\tswitch (op) {\n\t\tcase \"$eq\": return deepEqual(actual, expected);\n\t\tcase \"$ne\": return !deepEqual(actual, expected);\n\t\tcase \"$gt\": return typeof actual === typeof expected && blindCast(actual) > blindCast(expected);\n\t\tcase \"$gte\": return typeof actual === typeof expected && blindCast(actual) >= blindCast(expected);\n\t\tcase \"$lt\": return typeof actual === typeof expected && blindCast(actual) < blindCast(expected);\n\t\tcase \"$lte\": return typeof actual === typeof expected && blindCast(actual) <= blindCast(expected);\n\t\tcase \"$in\": return Array.isArray(expected) && expected.some((v) => deepEqual(actual, v));\n\t\tdefault: throw mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", `Unsupported filter operator in migration check: ${op}`, { meta: { operator: op } });\n\t}\n}\nvar FilterEvaluator = class {\n\tdoc = {};\n\tevaluate(filter, doc) {\n\t\tthis.doc = doc;\n\t\treturn filter.accept(this);\n\t}\n\tfield(expr) {\n\t\tconst value = getNestedField(this.doc, expr.field);\n\t\treturn evaluateFieldOp(expr.op, value, expr.value);\n\t}\n\tand(expr) {\n\t\treturn expr.exprs.every((child) => child.accept(this));\n\t}\n\tor(expr) {\n\t\treturn expr.exprs.some((child) => child.accept(this));\n\t}\n\tnot(expr) {\n\t\treturn !expr.expr.accept(this);\n\t}\n\texists(expr) {\n\t\tconst has = getNestedField(this.doc, expr.field) !== void 0;\n\t\treturn expr.exists ? has : !has;\n\t}\n\texpr(_expr) {\n\t\tthrow mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", \"Aggregation expression filters are not supported in migration checks\", { meta: { operator: \"$expr\" } });\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-ops-serializer.ts\nconst IndexKeyJson = type({\n\tfield: \"string\",\n\tdirection: type(\"1 | -1 | \\\"text\\\" | \\\"2dsphere\\\" | \\\"2d\\\" | \\\"hashed\\\"\")\n});\nconst CollationJson = type({\n\tlocale: \"string\",\n\t\"caseLevel?\": \"boolean\",\n\t\"caseFirst?\": \"string\",\n\t\"strength?\": \"number\",\n\t\"numericOrdering?\": \"boolean\",\n\t\"alternate?\": \"string\",\n\t\"maxVariable?\": \"string\",\n\t\"backwards?\": \"boolean\",\n\t\"normalization?\": \"boolean\"\n});\nconst CreateIndexJson = type({\n\tkind: \"\\\"createIndex\\\"\",\n\tcollection: \"string\",\n\tkeys: IndexKeyJson.array().atLeastLength(1),\n\t\"unique?\": \"boolean\",\n\t\"sparse?\": \"boolean\",\n\t\"expireAfterSeconds?\": \"number\",\n\t\"partialFilterExpression?\": \"Record<string, unknown>\",\n\t\"name?\": \"string\",\n\t\"wildcardProjection?\": \"Record<string, 0 | 1>\",\n\t\"collation?\": CollationJson,\n\t\"weights?\": \"Record<string, number>\",\n\t\"default_language?\": \"string\",\n\t\"language_override?\": \"string\"\n});\nconst DropIndexJson = type({\n\tkind: \"\\\"dropIndex\\\"\",\n\tcollection: \"string\",\n\tname: \"string\"\n});\nconst CreateCollectionJson = type({\n\tkind: \"\\\"createCollection\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"capped?\": \"boolean\",\n\t\"size?\": \"number\",\n\t\"max?\": \"number\",\n\t\"timeseries?\": {\n\t\ttimeField: \"string\",\n\t\t\"metaField?\": \"string\",\n\t\t\"granularity?\": \"\\\"seconds\\\" | \\\"minutes\\\" | \\\"hours\\\"\"\n\t},\n\t\"collation?\": CollationJson,\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" },\n\t\"clusteredIndex?\": {\n\t\tkey: \"Record<string, number>\",\n\t\tunique: \"boolean\",\n\t\t\"name?\": \"string\"\n\t}\n});\nconst DropCollectionJson = type({\n\tkind: \"\\\"dropCollection\\\"\",\n\tcollection: \"string\"\n});\nconst RenameCollectionJson = type({\n\tkind: \"\\\"renameCollection\\\"\",\n\tcollection: \"string\",\n\tto: \"string\"\n});\nconst CollModJson = type({\n\tkind: \"\\\"collMod\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" }\n});\nconst ListIndexesJson = type({\n\tkind: \"\\\"listIndexes\\\"\",\n\tcollection: \"string\"\n});\nconst ListCollectionsJson = type({ kind: \"\\\"listCollections\\\"\" });\nconst FieldFilterJson = type({\n\tkind: \"\\\"field\\\"\",\n\tfield: \"string\",\n\top: \"string\",\n\tvalue: \"unknown\"\n});\nconst AndFilterJson = type({\n\tkind: \"\\\"and\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst OrFilterJson = type({\n\tkind: \"\\\"or\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst NotFilterJson = type({\n\tkind: \"\\\"not\\\"\",\n\texpr: \"Record<string, unknown>\"\n});\nconst ExistsFilterJson = type({\n\tkind: \"\\\"exists\\\"\",\n\tfield: \"string\",\n\texists: \"boolean\"\n});\nconst RawInsertOneJson = type({\n\tkind: \"\\\"rawInsertOne\\\"\",\n\tcollection: \"string\",\n\tdocument: \"Record<string, unknown>\"\n});\nconst RawInsertManyJson = type({\n\tkind: \"\\\"rawInsertMany\\\"\",\n\tcollection: \"string\",\n\tdocuments: \"Record<string, unknown>[]\"\n});\nconst RawUpdateOneJson = type({\n\tkind: \"\\\"rawUpdateOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\"\n});\nconst RawUpdateManyJson = type({\n\tkind: \"\\\"rawUpdateMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\t\"bypassDocumentValidation?\": \"boolean\"\n});\nconst RawDeleteOneJson = type({\n\tkind: \"\\\"rawDeleteOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawDeleteManyJson = type({\n\tkind: \"\\\"rawDeleteMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawAggregateJson = type({\n\tkind: \"\\\"rawAggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst RawFindOneAndUpdateJson = type({\n\tkind: \"\\\"rawFindOneAndUpdate\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\tupsert: \"boolean\"\n});\nconst RawFindOneAndDeleteJson = type({\n\tkind: \"\\\"rawFindOneAndDelete\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst TypedAggregateJson = type({\n\tkind: \"\\\"aggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst QueryPlanJson = type({\n\tcollection: \"string\",\n\tcommand: \"Record<string, unknown>\",\n\tmeta: type({\n\t\ttarget: \"string\",\n\t\tstorageHash: \"string\",\n\t\tlane: \"string\",\n\t\t\"targetFamily?\": \"string\",\n\t\t\"profileHash?\": \"string\",\n\t\t\"annotations?\": \"Record<string, unknown>\"\n\t})\n});\nconst MatchStageJson = type({\n\tkind: \"\\\"match\\\"\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst LimitStageJson = type({\n\tkind: \"\\\"limit\\\"\",\n\tlimit: \"number\"\n});\nconst SortStageJson = type({\n\tkind: \"\\\"sort\\\"\",\n\tsort: \"Record<string, 1 | -1>\"\n});\nconst ProjectStageJson = type({\n\tkind: \"\\\"project\\\"\",\n\tprojection: \"Record<string, 0 | 1>\"\n});\nconst AddFieldsStageJson = type({\n\tkind: \"\\\"addFields\\\"\",\n\tfields: \"Record<string, unknown>\"\n});\nconst LookupStageJson = type({\n\tkind: \"\\\"lookup\\\"\",\n\tfrom: \"string\",\n\tas: \"string\",\n\t\"localField?\": \"string\",\n\t\"foreignField?\": \"string\",\n\t\"pipeline?\": \"Record<string, unknown>[]\",\n\t\"let_?\": \"Record<string, unknown>\"\n});\nconst CheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\",\n\t\"object?\": \"string > 0\"\n});\nconst StepJson = type({\n\tdescription: \"string\",\n\tcommand: \"Record<string, unknown>\"\n});\nconst DdlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\"\",\n\tprecheck: \"Record<string, unknown>[]\",\n\texecute: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nconst DmlCheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\"\n});\nconst DmlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\" | \\\"data\\\"\",\n\tname: \"string\",\n\tprecheck: \"Record<string, unknown>[]\",\n\trun: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nfunction recordValue(json, key, context) {\n\tif (json === null || typeof json !== \"object\") throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: expected object`, { meta: { context } });\n\treturn blindCast(Reflect.get(json, key));\n}\nfunction recordKind(json, context) {\n\tconst kind = recordValue(json, \"kind\", context);\n\treturn typeof kind === \"string\" ? kind : \"\";\n}\nfunction validate(schema, data, context) {\n\ttry {\n\t\treturn schema.assert(stripUndefinedDeep(data));\n\t} catch (error) {\n\t\t/* v8 ignore stop */\n\t\tthrow mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { context },\n\t\t\tcause: error\n\t\t});\n\t}\n}\n/**\n* Strip `undefined`-valued properties before they reach arktype's optional-key\n* assertions.\n*\n* Op IRs (e.g. `CreateCollectionCommand`) assign every optional field on\n* every instance — fields the caller did not provide land as\n* `undefined`-valued properties. arktype treats `{ foo?: 'boolean' }` as\n* \"key may be absent, but if present must be boolean\", so the bare instance\n* fails validation when it crosses the deserialize boundary in-process\n* (no JSON round-trip happens between planner → runner). This helper\n* recovers the JSON-round-tripped shape (undefined keys absent) without\n* forcing every caller to round-trip.\n*\n* Returns the original value reference whenever no change is needed.\n* That preserves prototype-bound payload values such as BSON wrappers\n* (`ObjectId`, `Decimal128`, `Binary`, …) which embed no `undefined`\n* own-enumerable properties and therefore never trigger a rebuild.\n* Top-level op IRs (class instances with `undefined` optional fields)\n* still get flattened to plain records as required by arktype.\n*/\nfunction stripUndefinedDeep(value) {\n\tif (Array.isArray(value)) {\n\t\tlet changed = false;\n\t\tconst next = value.map((item) => {\n\t\t\tconst stripped = stripUndefinedDeep(item);\n\t\t\tif (stripped !== item) changed = true;\n\t\t\treturn stripped;\n\t\t});\n\t\treturn changed ? next : value;\n\t}\n\tif (value === null || typeof value !== \"object\") return blindCast(value);\n\tconst entries = Object.entries(value);\n\tconst out = {};\n\tlet changed = false;\n\tfor (const [key, val] of entries) {\n\t\tif (val === void 0) {\n\t\t\tchanged = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst stripped = stripUndefinedDeep(val);\n\t\tif (stripped !== val) changed = true;\n\t\tout[key] = stripped;\n\t}\n\treturn changed ? out : blindCast(value);\n}\nfunction deserializeFilterExpr(json) {\n\tconst kind = recordKind(json, \"filter expression\");\n\tswitch (kind) {\n\t\tcase \"field\": {\n\t\t\tconst data = validate(FieldFilterJson, json, \"field filter\");\n\t\t\treturn MongoFieldFilter.of(data.field, data.op, blindCast(data.value));\n\t\t}\n\t\tcase \"and\": {\n\t\t\tconst data = validate(AndFilterJson, json, \"and filter\");\n\t\t\treturn MongoAndExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"or\": {\n\t\t\tconst data = validate(OrFilterJson, json, \"or filter\");\n\t\t\treturn MongoOrExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"not\": return new MongoNotExpr(deserializeFilterExpr(validate(NotFilterJson, json, \"not filter\").expr));\n\t\tcase \"exists\": {\n\t\t\tconst data = validate(ExistsFilterJson, json, \"exists filter\");\n\t\t\treturn new MongoExistsExpr(data.field, data.exists);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown filter expression kind: ${kind}`, { meta: {\n\t\t\tcontext: \"filter expression\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializePipelineStage(json) {\n\tconst kind = recordKind(json, \"pipeline stage\");\n\tswitch (kind) {\n\t\tcase \"match\": return new MongoMatchStage(deserializeFilterExpr(validate(MatchStageJson, json, \"match stage\").filter));\n\t\tcase \"limit\": return new MongoLimitStage(validate(LimitStageJson, json, \"limit stage\").limit);\n\t\tcase \"sort\": return new MongoSortStage(validate(SortStageJson, json, \"sort stage\").sort);\n\t\tcase \"project\": return new MongoProjectStage(validate(ProjectStageJson, json, \"project stage\").projection);\n\t\tcase \"addFields\": return new MongoAddFieldsStage(blindCast(validate(AddFieldsStageJson, json, \"addFields stage\").fields));\n\t\tcase \"lookup\": {\n\t\t\tconst data = validate(LookupStageJson, json, \"lookup stage\");\n\t\t\tconst opts = {\n\t\t\t\tfrom: data.from,\n\t\t\t\tas: data.as\n\t\t\t};\n\t\t\tif (data.localField !== void 0) opts.localField = data.localField;\n\t\t\tif (data.foreignField !== void 0) opts.foreignField = data.foreignField;\n\t\t\tif (data.pipeline !== void 0) opts.pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\tif (data.let_ !== void 0) opts.let_ = blindCast(data.let_);\n\t\t\treturn new MongoLookupStage(opts);\n\t\t}\n\t\tcase \"merge\": {\n\t\t\tconst whenMatched = recordValue(json, \"whenMatched\", \"merge stage\");\n\t\t\tconst opts = { into: blindCast(recordValue(json, \"into\", \"merge stage\")) };\n\t\t\tconst on = recordValue(json, \"on\", \"merge stage\");\n\t\t\tif (on !== void 0) opts.on = blindCast(on);\n\t\t\tif (whenMatched !== void 0) opts.whenMatched = typeof whenMatched === \"string\" ? whenMatched : blindCast(blindCast(whenMatched).map(deserializePipelineStage));\n\t\t\tconst whenNotMatched = recordValue(json, \"whenNotMatched\", \"merge stage\");\n\t\t\tif (whenNotMatched !== void 0) opts.whenNotMatched = blindCast(whenNotMatched);\n\t\t\treturn new MongoMergeStage(opts);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown pipeline stage kind: ${kind}`, { meta: {\n\t\t\tcontext: \"pipeline stage\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeDmlCommand(json) {\n\tconst kind = recordKind(json, \"DML command\");\n\tswitch (kind) {\n\t\tcase \"rawInsertOne\": {\n\t\t\tconst data = validate(RawInsertOneJson, json, \"rawInsertOne command\");\n\t\t\treturn new RawInsertOneCommand(data.collection, data.document);\n\t\t}\n\t\tcase \"rawInsertMany\": {\n\t\t\tconst data = validate(RawInsertManyJson, json, \"rawInsertMany command\");\n\t\t\treturn new RawInsertManyCommand(data.collection, data.documents);\n\t\t}\n\t\tcase \"rawUpdateOne\": {\n\t\t\tconst data = validate(RawUpdateOneJson, json, \"rawUpdateOne command\");\n\t\t\treturn new RawUpdateOneCommand(data.collection, data.filter, data.update);\n\t\t}\n\t\tcase \"rawUpdateMany\": {\n\t\t\tconst data = validate(RawUpdateManyJson, json, \"rawUpdateMany command\");\n\t\t\treturn new RawUpdateManyCommand(data.collection, data.filter, data.update, ifDefined(\"bypassDocumentValidation\", data.bypassDocumentValidation));\n\t\t}\n\t\tcase \"rawDeleteOne\": {\n\t\t\tconst data = validate(RawDeleteOneJson, json, \"rawDeleteOne command\");\n\t\t\treturn new RawDeleteOneCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawDeleteMany\": {\n\t\t\tconst data = validate(RawDeleteManyJson, json, \"rawDeleteMany command\");\n\t\t\treturn new RawDeleteManyCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawAggregate\": {\n\t\t\tconst data = validate(RawAggregateJson, json, \"rawAggregate command\");\n\t\t\treturn new RawAggregateCommand(data.collection, data.pipeline);\n\t\t}\n\t\tcase \"rawFindOneAndUpdate\": {\n\t\t\tconst data = validate(RawFindOneAndUpdateJson, json, \"rawFindOneAndUpdate command\");\n\t\t\treturn new RawFindOneAndUpdateCommand(data.collection, data.filter, data.update, data.upsert);\n\t\t}\n\t\tcase \"rawFindOneAndDelete\": {\n\t\t\tconst data = validate(RawFindOneAndDeleteJson, json, \"rawFindOneAndDelete command\");\n\t\t\treturn new RawFindOneAndDeleteCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"aggregate\": {\n\t\t\tconst data = validate(TypedAggregateJson, json, \"aggregate command\");\n\t\t\tconst pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\treturn new AggregateCommand(data.collection, pipeline);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DML command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DML command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeMongoQueryPlan(json) {\n\tconst data = validate(QueryPlanJson, json, \"Mongo query plan\");\n\tconst command = deserializeDmlCommand(data.command);\n\tconst m = data.meta;\n\tconst meta = {\n\t\ttarget: m.target,\n\t\tstorageHash: m.storageHash,\n\t\tlane: m.lane,\n\t\t...ifDefined(\"targetFamily\", m.targetFamily),\n\t\t...ifDefined(\"profileHash\", m.profileHash),\n\t\t...ifDefined(\"annotations\", m.annotations)\n\t};\n\treturn {\n\t\tcollection: data.collection,\n\t\tcommand,\n\t\tmeta\n\t};\n}\nfunction deserializeDdlCommand(json) {\n\tconst kind = recordKind(json, \"DDL command\");\n\tswitch (kind) {\n\t\tcase \"createIndex\": {\n\t\t\tconst data = validate(CreateIndexJson, json, \"createIndex command\");\n\t\t\treturn new CreateIndexCommand(data.collection, data.keys, {\n\t\t\t\t...ifDefined(\"unique\", data.unique),\n\t\t\t\t...ifDefined(\"sparse\", data.sparse),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", data.expireAfterSeconds),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", data.partialFilterExpression),\n\t\t\t\t...ifDefined(\"name\", data.name),\n\t\t\t\t...ifDefined(\"wildcardProjection\", data.wildcardProjection),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"weights\", data.weights),\n\t\t\t\t...ifDefined(\"default_language\", data.default_language),\n\t\t\t\t...ifDefined(\"language_override\", data.language_override)\n\t\t\t});\n\t\t}\n\t\tcase \"dropIndex\": {\n\t\t\tconst data = validate(DropIndexJson, json, \"dropIndex command\");\n\t\t\treturn new DropIndexCommand(data.collection, data.name);\n\t\t}\n\t\tcase \"createCollection\": {\n\t\t\tconst data = validate(CreateCollectionJson, json, \"createCollection command\");\n\t\t\treturn new CreateCollectionCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"capped\", data.capped),\n\t\t\t\t...ifDefined(\"size\", data.size),\n\t\t\t\t...ifDefined(\"max\", data.max),\n\t\t\t\t...ifDefined(\"timeseries\", data.timeseries),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages),\n\t\t\t\t...ifDefined(\"clusteredIndex\", data.clusteredIndex)\n\t\t\t});\n\t\t}\n\t\tcase \"dropCollection\": return new DropCollectionCommand(validate(DropCollectionJson, json, \"dropCollection command\").collection);\n\t\tcase \"renameCollection\": {\n\t\t\tconst data = validate(RenameCollectionJson, json, \"renameCollection command\");\n\t\t\treturn new RenameCollectionCommand(data.collection, data.to);\n\t\t}\n\t\tcase \"collMod\": {\n\t\t\tconst data = validate(CollModJson, json, \"collMod command\");\n\t\t\treturn new CollModCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages)\n\t\t\t});\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DDL command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DDL command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeInspectionCommand(json) {\n\tconst kind = recordKind(json, \"inspection command\");\n\tswitch (kind) {\n\t\tcase \"listIndexes\": return new ListIndexesCommand(validate(ListIndexesJson, json, \"listIndexes command\").collection);\n\t\tcase \"listCollections\":\n\t\t\tvalidate(ListCollectionsJson, json, \"listCollections command\");\n\t\t\treturn new ListCollectionsCommand();\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown inspection command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"inspection command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeCheck(json) {\n\tconst data = validate(CheckJson, json, \"migration check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeInspectionCommand(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect,\n\t\t...ifDefined(\"object\", data.object)\n\t};\n}\nfunction deserializeStep(json) {\n\tconst data = validate(StepJson, json, \"migration step\");\n\treturn {\n\t\tdescription: data.description,\n\t\tcommand: deserializeDdlCommand(data.command)\n\t};\n}\nfunction isDmlOperationJson(json) {\n\treturn Array.isArray(recordValue(json, \"run\", \"migration operation\"));\n}\nfunction deserializeDdlOp(json) {\n\tconst data = validate(DdlOperationJson, json, \"migration operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tprecheck: data.precheck.map(deserializeCheck),\n\t\texecute: data.execute.map(deserializeStep),\n\t\tpostcheck: data.postcheck.map(deserializeCheck)\n\t};\n}\nfunction deserializeDmlCheck(json) {\n\tconst data = validate(DmlCheckJson, json, \"DML operation check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeMongoQueryPlan(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect\n\t};\n}\nfunction deserializeDmlOp(json) {\n\tconst data = validate(DmlOperationJson, json, \"DML operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tname: data.name,\n\t\tprecheck: data.precheck.map(deserializeDmlCheck),\n\t\trun: data.run.map(deserializeMongoQueryPlan),\n\t\tpostcheck: data.postcheck.map(deserializeDmlCheck)\n\t};\n}\nfunction deserializeMongoOp(json) {\n\tif (isDmlOperationJson(json)) return deserializeDmlOp(json);\n\treturn deserializeDdlOp(json);\n}\nfunction deserializeMongoOps(json) {\n\treturn json.map(deserializeMongoOp);\n}\nfunction serializeMongoOps(ops) {\n\treturn JSON.stringify(ops, null, 2);\n}\n//#endregion\n//#region src/core/migrations/mongo-runner.ts\nconst READ_ONLY_CHECK_COMMAND_KINDS = /* @__PURE__ */ new Set([\"aggregate\", \"rawAggregate\"]);\nconst CHANGED_DOCUMENT_COUNTS = [\n\t\"insertedCount\",\n\t\"modifiedCount\",\n\t\"upsertedCount\",\n\t\"deletedCount\"\n];\n/** Whether a write command's result row says it changed no document: every count it carries is zero. */\nfunction reportsNoChangedDocuments(row) {\n\tif (typeof row !== \"object\" || row === null) return false;\n\tconst counts = CHANGED_DOCUMENT_COUNTS.map((field) => Reflect.get(row, field)).filter((count) => count !== void 0);\n\treturn counts.length > 0 && counts.every((count) => count === 0);\n}\nfunction failedCheckOf(operationId, phase, check) {\n\treturn {\n\t\toperationId,\n\t\tphase,\n\t\tdescription: check.description,\n\t\t...ifDefined(\"expectation\", check.object === void 0 ? void 0 : check.expect === \"exists\" ? expectPresent(check.object) : expectAbsent(check.object))\n\t};\n}\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(migrationRunnerFailure(code, summary, options));\n}\n/**\n* The failure when a field rename's before-check finds documents that already hold the new name,\n* which `$rename` would overwrite: what to look for and fix, and that the plan resumes.\n*/\nfunction renameOverwriteRefusal(op) {\n\tconst rewrite = fieldRewriteOf(op);\n\tif (rewrite === void 0) return void 0;\n\tconst renames = Reflect.get(rewrite.command.update, \"$rename\");\n\tconst to = typeof renames === \"object\" && renames !== null ? Reflect.get(renames, rewrite.field) : void 0;\n\tif (typeof to !== \"string\") return void 0;\n\tconst [check] = op.precheck;\n\tconst source = check?.source.command;\n\tconst match = source instanceof RawAggregateCommand ? Reflect.get(source.pipeline[0] ?? {}, \"$match\") : void 0;\n\tconst find = `db.getCollection(${JSON.stringify(rewrite.collection)}).find(${JSON.stringify(match ?? {})})`;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: some documents in collection ${rewrite.collection} already hold ${to} as well as ${rewrite.field}`, {\n\t\twhy: `Renaming ${rewrite.field} to ${to} would overwrite their ${to}. Find them with ${find} in mongosh, and move or remove one of the two values in each. Nothing was renamed. Once the documents are fixed, run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tname: op.name\n\t\t}\n\t});\n}\n/**\n* The failure when a collection rename's before-check finds that the new collection already exists.\n*/\nfunction renameTargetExistsRefusal(op, failed) {\n\tconst rename = op.execute.find((step) => step.command instanceof RenameCollectionCommand)?.command;\n\tif (!(rename instanceof RenameCollectionCommand) || failed.expect !== \"notExists\") return;\n\tconst { collection: from, to } = rename;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: collection ${to} already exists, so collection ${from} cannot be renamed to it`, {\n\t\twhy: `Nothing was renamed. If ${to} holds nothing you need, drop it, then run the command again; operations that already ran are skipped. If an earlier operation of the same migration created ${to}, as a createIndex on ${to} does, make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation of its migration.ts, run node on that migration.ts, and then drop ${to} and run the command again.`,\n\t\tmeta: { operationId: op.id }\n\t});\n}\nconst MONGO_UNAUTHORIZED = 13;\n/**\n* The failure for a rewrite that skips validation when the database user lacks the\n* `bypassDocumentValidation` action, as a `readWrite` user on a hosted cluster does.\n*/\nfunction bypassValidationRefusal(op, plan, error) {\n\tif (!(plan.command instanceof RawUpdateManyCommand) || !plan.command.bypassDocumentValidation) return;\n\tif (typeof error !== \"object\" || error === null) return void 0;\n\tif (Reflect.get(error, \"code\") !== MONGO_UNAUTHORIZED) return void 0;\n\tconst codeName = Reflect.get(error, \"codeName\");\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: the database user may not skip document validation`, {\n\t\twhy: `Renaming or removing a field rewrites documents with bypassDocumentValidation, because the old validator requires the old field. MongoDB refused it with error ${MONGO_UNAUTHORIZED} (${String(codeName)}). Grant the user the bypassDocumentValidation action on the database, for example with the dbAdmin or restore role, then run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode: MONGO_UNAUTHORIZED,\n\t\t\tcodeName\n\t\t}\n\t});\n}\nvar MongoMigrationRunner = class {\n\tdeps;\n\tconstructor(deps) {\n\t\tthis.deps = deps;\n\t}\n\tasync execute(options) {\n\t\tlet changedDatabase = false;\n\t\tconst result = await this.apply(options, () => {\n\t\t\tchangedDatabase = true;\n\t\t});\n\t\treturn result.ok ? ok({\n\t\t\t...result.value,\n\t\t\tchangedDatabase\n\t\t}) : notOk(withDatabaseUnchanged(result.failure, options.databaseChangedBefore !== true && !changedDatabase));\n\t}\n\t/** Applies the plan, calling `wrote` after each command that changes the database. */\n\tasync apply(options, wrote) {\n\t\tconst { inspectionExecutor, adapter, driver, executeDdl, markerOps } = this.deps;\n\t\tconst operations = deserializeMongoOps(blindCast(options.plan.operations));\n\t\tconst space = options.plan.spaceId ?? APP_SPACE_ID;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, operations);\n\t\tif (policyCheck) return policyCheck;\n\t\tconst existingMarker = await markerOps.readMarker(space);\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (markerCheck) return markerCheck;\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tconst filterEvaluator = new FilterEvaluator();\n\t\tlet operationsExecuted = 0;\n\t\tfor (const operation of operations) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (isMongoDmlOperation(operation)) {\n\t\t\t\t\tconst result = await this.executeDmlOperation(operation, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote);\n\t\t\t\t\tif (result.failure) return result.failure;\n\t\t\t\t\tif (result.executed) operationsExecuted += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.allChecksSatisfied(operation.postcheck, inspectionExecutor, filterEvaluator)) continue;\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.precheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"precheck\", failing);\n\t\t\t\t\t\treturn renameTargetExistsRefusal(operation, failing) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${operation.id} failed during precheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPrecheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: { failedCheck }\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const step of operation.execute) {\n\t\t\t\t\tawait executeDdl(step.command);\n\t\t\t\t\twrote();\n\t\t\t\t}\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.postcheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"postcheck\", failing);\n\t\t\t\t\t\treturn runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during postcheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPostcheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\t\t\t\tfailedCheck\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\tconst destination = options.plan.destination;\n\t\tconst profileHash = options.destinationContract.profileHash ?? destination.storageHash;\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariantSet = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariantSet.has(id));\n\t\tconst markerAlreadyAtDestination = existingMarker !== null && existingMarker.storageHash === destination.storageHash && existingMarker.profileHash === profileHash;\n\t\tif (!(operationsExecuted === 0 && markerAlreadyAtDestination && incomingIsSubsetOfExisting)) {\n\t\t\tconst liveSchema = await this.deps.introspectSchema();\n\t\t\tconst rawVerifyResult = verifyMongoSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: liveSchema,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\t...options.context ? { context: options.context } : {}\n\t\t\t});\n\t\t\tconst verifyResult = options.scopeVerifyResult ? options.scopeVerifyResult(rawVerifyResult) : rawVerifyResult;\n\t\t\tif (!verifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", verifyResult.summary, {\n\t\t\t\twhy: schemaCheckWhy(verifyResult.schema.issues),\n\t\t\t\tmeta: { schemaIssues: verifyResult.schema.issues }\n\t\t\t});\n\t\t\tif (existingMarker) {\n\t\t\t\tif (!await markerOps.updateMarker(space, existingMarker.storageHash, {\n\t\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\t\tprofileHash,\n\t\t\t\t\tinvariants: incomingInvariants\n\t\t\t\t})) {\n\t\t\t\t\tconst found = await markerOps.readMarker(space);\n\t\t\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\t\t\tdestinationStorageHash: destination.storageHash\n\t\t\t\t\t} });\n\t\t\t\t}\n\t\t\t} else await markerOps.initMarker(space, {\n\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\tprofileHash,\n\t\t\t\tinvariants: incomingInvariants\n\t\t\t});\n\t\t\twrote();\n\t\t\tawait this.recordLedgerEntries(markerOps, space, options);\n\t\t}\n\t\treturn ok({\n\t\t\toperationsPlanned: operations.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync recordLedgerEntries(markerOps, space, options) {\n\t\tconst plan = options.plan;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = plan.operations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait markerOps.writeLedgerEntry(space, {\n\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\tfrom: edge.from,\n\t\t\t\tto: edge.to,\n\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\toperations: edgeOps\n\t\t\t});\n\t\t}\n\t}\n\tasync executeDmlOperation(op, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote) {\n\t\tif (runPostchecks && runIdempotency && op.postcheck.length > 0) {\n\t\t\tif (await this.evaluateDmlChecks(op.postcheck, adapter, driver, filterEvaluator)) return { executed: false };\n\t\t}\n\t\tif (runPrechecks && op.precheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.precheck, adapter, driver, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: renameOverwriteRefusal(op) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} failed during precheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\tfor (const plan of op.run) {\n\t\t\tconst wireCommand = await adapter.lower(plan, {});\n\t\t\ttry {\n\t\t\t\tlet reportedNoChange = false;\n\t\t\t\tlet reportedChange = false;\n\t\t\t\tfor await (const row of driver.execute(wireCommand)) if (reportsNoChangedDocuments(row)) reportedNoChange = true;\n\t\t\t\telse reportedChange = true;\n\t\t\t\tif (reportedChange || !reportedNoChange) wrote();\n\t\t\t} catch (error) {\n\t\t\t\tconst refusal = bypassValidationRefusal(op, plan, error);\n\t\t\t\tif (refusal === void 0) throw error;\n\t\t\t\treturn {\n\t\t\t\t\texecuted: false,\n\t\t\t\t\tfailure: refusal\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (runPostchecks && op.postcheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.postcheck, adapter, driver, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${op.id} failed during postcheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\treturn { executed: true };\n\t}\n\tasync evaluateDmlChecks(checks, adapter, driver, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst commandKind = check.source.command.kind;\n\t\t\tif (!READ_ONLY_CHECK_COMMAND_KINDS.has(commandKind)) throw mongoTargetError(\"MIGRATION.DATA_TRANSFORM_CHECK_NOT_READ_ONLY\", `Data-transform check rejected: command kind \"${commandKind}\" is not read-only`, {\n\t\t\t\twhy: \"Data-transform checks must use aggregate or rawAggregate commands so the pre/postcheck path cannot mutate the database.\",\n\t\t\t\tfix: \"Author the check.source as an aggregate pipeline (or rawAggregate) rather than a DML write command.\",\n\t\t\t\tmeta: {\n\t\t\t\t\tcheckDescription: check.description,\n\t\t\t\t\tcommandKind,\n\t\t\t\t\tcollection: check.source.collection\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst wireCommand = await adapter.lower(check.source, {});\n\t\t\tlet matchFound = false;\n\t\t\tfor await (const row of driver.execute(wireCommand)) if (filterEvaluator.evaluate(check.filter, row)) {\n\t\t\t\tmatchFound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tasync evaluateChecks(checks, inspectionExecutor, filterEvaluator) {\n\t\treturn await this.firstFailingCheck(checks, inspectionExecutor, filterEvaluator) === void 0;\n\t}\n\tasync firstFailingCheck(checks, inspectionExecutor, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = (await check.source.accept(inspectionExecutor)).some((doc) => filterEvaluator.evaluate(check.filter, doc));\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return check;\n\t\t}\n\t}\n\tasync allChecksSatisfied(checks, inspectionExecutor, filterEvaluator) {\n\t\tif (checks.length === 0) return false;\n\t\treturn this.evaluateChecks(checks, inspectionExecutor, filterEvaluator);\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${[...allowedClasses].join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t}\n\t\t});\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return;\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-target-schema-verifier.ts\n/**\n* Mongo target `SchemaVerifier` concretion. Extends the family base's\n* namespace-walk scaffolding and contributes the per-namespace diff via\n* `verifyNamespace`; the diff body reuses the existing target-side\n* helpers (`contractToMongoSchemaIR`, `canonicalizeSchemasForVerification`,\n* `diffMongoSchemas`) so production verification behaviour is unchanged.\n*\n* Today's invariant: every Mongo contract carries exactly one\n* namespace (the unbound singleton, materialised as\n* `MongoTargetUnboundDatabase`), so the family-base namespace walk\n* dispatches exactly once and the per-namespace body runs the existing\n* whole-schema diff. Future per-collection namespace assignment will\n* have this hook project the diff to the namespace's owned collections.\n*\n* `verifyTargetExtensions` returns the empty list — Mongo has no\n* target-only kinds today.\n*\n* Strict diff mode is `false` for SPI-routed calls; production\n* verification today still goes through `verifyMongoSchema` which\n* receives strict from the CLI.\n*/\nvar MongoTargetSchemaVerifier = class extends MongoSchemaVerifierBase {\n\tverifyNamespace(options) {\n\t\tconst expectedIR = contractToMongoSchemaIR(options.contract);\n\t\tconst { live, expected } = canonicalizeSchemasForVerification(options.schema, expectedIR);\n\t\tconst collectionControlPolicy = (name) => this.collectionControlPolicyForName(options.contract, name);\n\t\tconst { failures, warnings } = diffMongoSchemas(live, expected, false, collectionControlPolicy);\n\t\treturn [...failures, ...warnings];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/migrations/scope-verify-result.ts\n/**\n* The bare entity names the given contracts declare, unioned. The Mongo runner\n* asks this of every OTHER contract space in a multi-space apply, so each\n* space's post-apply verify can drop the extras those siblings claim.\n*/\nfunction entityNamesDeclaredBy(contracts) {\n\tconst owned = /* @__PURE__ */ new Set();\n\tfor (const contract of contracts) for (const { entityName } of elementCoordinates(contract.storage)) owned.add(entityName);\n\treturn owned;\n}\n/**\n* True when an issue reports a whole collection present in the database but\n* declared by no contract (an extra) — its path is exactly the collection\n* name, never a deeper index/validator/options auxiliary.\n*/\nfunction extraCollectionName(issue) {\n\tif (issueOutcome(issue) !== \"not-expected\" || issue.path.length !== 1) return void 0;\n\treturn issue.path[0];\n}\n/**\n* Scope a per-space post-apply verify result to the contract space's own\n* elements: drop the `extra` findings for collections another contract space\n* claims. The runner verifies the destination contract against the full live\n* database, which holds sibling spaces' collections — without the scoping a\n* multi-space apply could never pass strict verify. Extras claimed by NO space\n* survive, so genuine drift still fails the runner's verdict.\n*\n* The result is issue-based, so the verdict recomputes directly from the\n* surviving list: `ok` holds exactly when it is empty.\n*/\nfunction scopeVerifyResultToSpace(result, ownedByOtherSpaces) {\n\tif (ownedByOtherSpaces.size === 0) return result;\n\tconst issues = result.schema.issues.filter((issue) => {\n\t\tconst name = extraCollectionName(issue);\n\t\treturn name === void 0 || !ownedByOtherSpaces.has(name);\n\t});\n\tif (issues.length === result.schema.issues.length) return result;\n\tconst ok = issues.length === 0;\n\tconst { code: staleCode, ...envelope } = result;\n\treturn {\n\t\t...envelope,\n\t\tok,\n\t\t...ok ? {} : { code: result.code ?? VERIFY_CODE_SCHEMA_FAILURE },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : result.summary,\n\t\tschema: {\n\t\t\t...result.schema,\n\t\t\tissues\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/control-target.ts\n/**\n* `migration.ts` default-exports a `Migration` subclass whose `operations`\n* getter returns the ordered list of operations and whose `describe()`\n* returns the manifest identity metadata. `MongoMigrationPlanner.plan()`\n* returns a `MigrationPlanWithAuthoringSurface` that knows how to render\n* itself back to such a file; `MongoMigrationPlanner.emptyMigration()`\n* returns the same shape for `migration new`. Users run the scaffolded\n* `migration.ts` directly (via `node migration.ts`) to self-emit\n* `ops.json` and attest the `migrationHash`.\n*/\nconst mongoTargetDescriptor = {\n\t...mongoTargetDescriptorMeta,\n\tcontractSerializer: new MongoTargetContractSerializer(),\n\tschemaVerifier: new MongoTargetSchemaVerifier(),\n\tmigrations: {\n\t\tcreatePlanner(_adapter) {\n\t\t\treturn new MongoMigrationPlanner();\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\tlet cachedDeps;\n\t\t\tconst runMongo = async (driver, runnerOptions) => {\n\t\t\t\tcachedDeps ??= family.createRunnerDependencies({ driver });\n\t\t\t\treturn new MongoMigrationRunner(cachedDeps).execute({\n\t\t\t\t\t...runnerOptions,\n\t\t\t\t\tdestinationContract: blindCast(runnerOptions.destinationContract)\n\t\t\t\t});\n\t\t\t};\n\t\t\treturn { async execute({ driver, perSpaceOptions }) {\n\t\t\t\tconst contracts = perSpaceOptions.map((opts) => blindCast(opts.destinationContract));\n\t\t\t\tconst perSpaceResults = [];\n\t\t\t\tlet changedDatabase = false;\n\t\t\t\tfor (let i = 0; i < perSpaceOptions.length; i++) {\n\t\t\t\t\tconst spaceOptions = perSpaceOptions[i];\n\t\t\t\t\tif (!spaceOptions) continue;\n\t\t\t\t\tconst ownedByOtherSpaces = entityNamesDeclaredBy(contracts.filter((_, j) => j !== i));\n\t\t\t\t\tconst scopeVerifyResult = (result) => scopeVerifyResultToSpace(result, ownedByOtherSpaces);\n\t\t\t\t\tconst { space, ...runnerOptions } = spaceOptions;\n\t\t\t\t\tconst result = await runMongo(driver, {\n\t\t\t\t\t\t...runnerOptions,\n\t\t\t\t\t\tscopeVerifyResult,\n\t\t\t\t\t\tdatabaseChangedBefore: changedDatabase\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk(withFailingSpace(result.failure, space));\n\t\t\t\t\tconst { changedDatabase: spaceChanged, ...value } = result.value;\n\t\t\t\t\tchangedDatabase ||= spaceChanged;\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok({ perSpaceResults });\n\t\t\t} };\n\t\t},\n\t\tcontractToSchema(contract) {\n\t\t\treturn contractToMongoSchemaIR(blindCast(contract));\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\"\n\t\t};\n\t}\n};\n//#endregion\nexport { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateI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,iBAAiB,UAAU;GAC1B,OAAO,wBAAwB,UAAU,QAAQ,CAAC;EACnD;CACD;CACA,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
1
+ {"version":3,"file":"control-DqUpXeJr.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/control.mjs"],"sourcesContent":["import { t as mongoTargetDescriptorMeta } from \"./descriptor-meta-DU1EhCii.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { a as dropCollection, c as renameField, d as unsetField, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod, u as unrewritableFieldNameReason } from \"./migration-factories-BqROEHRs.mjs\";\nimport { type } from \"arktype\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { NamespaceBase, UNBOUND_NAMESPACE_ID, elementCoordinates, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { canonicalizeSchemasForVerification, contractToMongoSchemaIR, diffMongoSchemas, fieldRewriteOf } from \"@internal/family-mongo/control\";\nimport { APP_SPACE_ID, VERIFY_CODE_SCHEMA_FAILURE, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, describeMigrationStatement, expectAbsent, expectPresent, failedPostcheckWhy, failedPrecheckWhy, issueOutcome, migrationRunnerFailure, modelDisplayName, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { MongoContractSerializerBase, MongoSchemaVerifierBase } from \"@internal/family-mongo/ir\";\nimport { MongoCollection, MongoStorage, collectionControlPoliciesOf, collectionControlPolicyOf, collectionRootModelsOf, hasOwnFieldStoredAs, modelAndBasesOf, mongoModelsOf, ownEmbedStoredNamesOf, ownStoredNameOf, ownStoredNamesOf, validatorFieldNamesOf, validatorRootShapesOf } from \"@internal/mongo-contract\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { asNamespaceId, governingControlPolicy } from \"@internal/contract/types\";\nimport { MongoSchemaCollection, MongoSchemaIR, canonicalize, deepEqual, indexLookupKey } from \"@internal/mongo-schema-ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, MongoOrExpr, RenameCollectionCommand, isMongoDmlOperation } from \"@internal/mongo-query-ast/control\";\nimport { AggregateCommand, MongoAddFieldsStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoProjectStage, MongoSortStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand } from \"@internal/mongo-query-ast/execution\";\nimport { TsExpression, jsonToTsSource, renderImports } from \"@internal/ts-render\";\nimport { Migration } from \"@internal/migration-tools/migration\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\nimport { verifyMongoSchema } from \"@internal/family-mongo/schema-verify\";\n//#region src/core/mongo-target-database.ts\n/**\n* Mongo target `Namespace` concretion. In Mongo the \"namespace\" concept\n* binds to the connection's `db` field — a `MongoTargetDatabase` instance\n* names the database the collections live under. `entries['collection']`\n* holds collection IR. The unbound singleton (below) is the late-bound\n* namespace whose binding the connection's `db` resolves at runtime rather\n* than at authoring time.\n*\n* Qualifier emission is the rendering seam: query / DDL emission asks the\n* namespace for its qualifier (e.g. `\"<db>.<collection>\"`) and consumes\n* the result polymorphically. The unbound singleton overrides these\n* methods to elide the prefix entirely — call sites stay polymorphic and\n* never branch on `id === UNBOUND_NAMESPACE_ID`.\n*/\nvar MongoTargetDatabase = class extends NamespaceBase {\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst rawEntries = {\n\t\t\tcollection: {},\n\t\t\t...input.entries\n\t\t};\n\t\tthis.entries = Object.freeze(blindCast(hydrateNamespaceEntities(rawEntries, composeMongoEntityKinds(), \"carry\")));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"database\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget collection() {\n\t\treturn this.entries.collection ?? Object.freeze({});\n\t}\n\t/**\n\t* The bare qualifier as it would appear in a rendered string. The\n\t* unbound-database singleton overrides this to return `''`.\n\t*/\n\tqualifier() {\n\t\treturn this.id;\n\t}\n\t/**\n\t* Qualify a collection name with the database prefix. The\n\t* unbound-database singleton overrides this to emit just the\n\t* collection name. Used by emission/introspection paths that need a\n\t* fully-qualified reference.\n\t*/\n\tqualifyCollection(collectionName) {\n\t\treturn `${this.id}.${collectionName}`;\n\t}\n};\n/**\n* Singleton subclass for the reserved sentinel namespace id\n* (`UNBOUND_NAMESPACE_ID`) — the late-bound namespace whose binding the\n* connection's `db` resolves at runtime. Overrides qualifier emission\n* to elide the database prefix; call sites that consume `qualifier()`\n* / `qualifyCollection()` get unqualified output without branching on\n* the namespace id.\n*\n* This is the target-side materialization of \"the framework provides\n* affordances; targets implement specifics\": the framework names the\n* sentinel; Mongo decides what late-bound means here (the collection\n* name, naked — the database is supplied by the live connection).\n*/\nvar MongoTargetUnboundDatabase = class MongoTargetUnboundDatabase extends MongoTargetDatabase {\n\tstatic instance = new MongoTargetUnboundDatabase();\n\tconstructor() {\n\t\tsuper({ id: UNBOUND_NAMESPACE_ID });\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyCollection(collectionName) {\n\t\treturn collectionName;\n\t}\n};\n//#endregion\n//#region src/core/mongo-target-contract-serializer.ts\nvar MongoTargetContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\tconst { storage, ...rest } = validated;\n\t\tconst namespaces = Object.fromEntries(Object.entries(storage.namespaces).map(([nsId, nsData]) => {\n\t\t\tconst collectionCount = Object.keys(nsData.entries.collection ?? {}).length;\n\t\t\tconst valueSetCount = Object.keys(nsData.entries[\"valueSet\"] ?? {}).length;\n\t\t\tif (nsId === UNBOUND_NAMESPACE_ID && collectionCount === 0 && valueSetCount === 0) return [nsId, MongoTargetUnboundDatabase.instance];\n\t\t\tconst dbInput = { id: nsData.id };\n\t\t\tif (nsData.entries[\"collection\"] !== void 0 || nsData.entries[\"valueSet\"] !== void 0) dbInput.entries = {\n\t\t\t\tcollection: blindCast(nsData.entries[\"collection\"] ?? {}),\n\t\t\t\t...ifDefined(\"valueSet\", blindCast(nsData.entries[\"valueSet\"]))\n\t\t\t};\n\t\t\treturn [nsId, new MongoTargetDatabase(dbInput)];\n\t\t}));\n\t\tconst targetStorage = new MongoStorage({\n\t\t\tstorageHash: storage.storageHash,\n\t\t\tnamespaces\n\t\t});\n\t\treturn {\n\t\t\t...rest,\n\t\t\tstorage: targetStorage\n\t\t};\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) {\n\t\t\tconst collectionsOut = {};\n\t\t\tfor (const [collName, coll] of Object.entries(ns.entries.collection ?? {})) collectionsOut[collName] = blindCast(JSON.parse(JSON.stringify(coll)));\n\t\t\tconst valueSetOut = {};\n\t\t\tfor (const [vsName, vs] of Object.entries(ns.entries.valueSet ?? {})) valueSetOut[vsName] = blindCast(JSON.parse(JSON.stringify(vs)));\n\t\t\tnamespacesJson[nsId] = {\n\t\t\t\tid: ns.id,\n\t\t\t\tkind: \"mongo-database\",\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: collectionsOut,\n\t\t\t\t\t...ifDefined(\"valueSet\", Object.keys(valueSetOut).length > 0 ? valueSetOut : void 0)\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: {\n\t\t\t\tstorageHash: String(storage.storageHash),\n\t\t\t\tnamespaces: namespacesJson\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* The single module a scaffolded Mongo `migration.ts` imports from: the\n* operation factories below, plus the `Migration` base and `MigrationCLI`\n* that `render-typescript.ts` adds. The authored name; `render-typescript.ts`\n* maps it to whatever the consuming application's import root calls it,\n* once over the whole assembled import list.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/target-mongo/migration\";\nvar OpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction formatKeys(keys) {\n\treturn keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\nvar CreateIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\tcollection;\n\tkeys;\n\toptions;\n\tlabel;\n\tconstructor(collection, keys, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.options = options;\n\t\tthis.label = `Create index on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createIndex(this.collection, this.keys, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)}, ${jsonToTsSource(this.options)})` : `createIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)})`;\n\t}\n};\nvar DropIndexCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"widening\";\n\tcollection;\n\tkeys;\n\tlabel;\n\tconstructor(collection, keys) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.keys = keys;\n\t\tthis.label = `Drop index on ${collection} (${formatKeys(keys)})`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropIndex(this.collection, this.keys);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropIndex(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.keys)})`;\n\t}\n};\nvar CreateCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"createCollection\";\n\toperationClass = \"additive\";\n\tcollection;\n\toptions;\n\tlabel;\n\tconstructor(collection, options) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.label = `Create collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn createCollection(this.collection, this.options);\n\t}\n\trenderTypeScript() {\n\t\treturn this.options ? `createCollection(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})` : `createCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar DropCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"dropCollection\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tlabel;\n\tconstructor(collection) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.label = `Drop collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn dropCollection(this.collection);\n\t}\n\trenderTypeScript() {\n\t\treturn `dropCollection(${jsonToTsSource(this.collection)})`;\n\t}\n};\nvar RenameCollectionCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameCollection\";\n\toperationClass = \"widening\";\n\tfrom;\n\tto;\n\tlabel;\n\tconstructor(from, to) {\n\t\tsuper();\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.label = `Rename collection ${from} to ${to}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameCollection(this.from, this.to);\n\t}\n\trenderTypeScript() {\n\t\treturn `renameCollection(${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)})`;\n\t}\n};\nfunction renderFilterOption(filter) {\n\treturn filter === void 0 ? \"\" : `, ${jsonToTsSource({ filter })}`;\n}\nvar RenameFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"renameField\";\n\toperationClass = \"widening\";\n\tcollection;\n\tfrom;\n\tto;\n\tfilter;\n\tlabel;\n\tconstructor(collection, from, to, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn renameField(this.collection, this.from, this.to, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `renameField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.from)}, ${jsonToTsSource(this.to)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar UnsetFieldCall = class extends OpFactoryCallNode {\n\tfactoryName = \"unsetField\";\n\toperationClass = \"destructive\";\n\tcollection;\n\tfield;\n\tfilter;\n\tlabel;\n\tconstructor(collection, field, filter) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.field = field;\n\t\tthis.filter = filter;\n\t\tthis.label = this.toOp().label;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn unsetField(this.collection, this.field, ifDefined(\"filter\", this.filter));\n\t}\n\trenderTypeScript() {\n\t\treturn `unsetField(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.field)}${renderFilterOption(this.filter)})`;\n\t}\n};\nvar CollModCall = class extends OpFactoryCallNode {\n\tfactoryName = \"collMod\";\n\tcollection;\n\toptions;\n\tmeta;\n\toperationClass;\n\tlabel;\n\tconstructor(collection, options, meta) {\n\t\tsuper();\n\t\tthis.collection = collection;\n\t\tthis.options = options;\n\t\tthis.meta = meta;\n\t\tthis.operationClass = meta?.operationClass ?? \"widening\";\n\t\tthis.label = meta?.label ?? `Modify collection ${collection}`;\n\t\tthis.freeze();\n\t}\n\ttoOp() {\n\t\treturn collMod(this.collection, this.options, this.meta);\n\t}\n\trenderTypeScript() {\n\t\treturn this.meta ? `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)}, ${jsonToTsSource(this.meta)})` : `collMod(${jsonToTsSource(this.collection)}, ${jsonToTsSource(this.options)})`;\n\t}\n};\nfunction schemaIndexToCreateIndexOptions(index) {\n\treturn {\n\t\t...index.unique ? { unique: true } : {},\n\t\t...ifDefined(\"sparse\", index.sparse),\n\t\t...ifDefined(\"expireAfterSeconds\", index.expireAfterSeconds),\n\t\t...ifDefined(\"partialFilterExpression\", index.partialFilterExpression),\n\t\t...ifDefined(\"wildcardProjection\", index.wildcardProjection),\n\t\t...ifDefined(\"collation\", index.collation),\n\t\t...ifDefined(\"weights\", index.weights),\n\t\t...ifDefined(\"default_language\", index.default_language),\n\t\t...ifDefined(\"language_override\", index.language_override)\n\t};\n}\nfunction schemaCollectionToCreateCollectionOptions(coll) {\n\tconst opts = coll.options;\n\tconst validator = coll.validator;\n\tif (!opts && !validator) return void 0;\n\treturn {\n\t\t...opts?.capped ? { capped: true } : {},\n\t\t...ifDefined(\"size\", opts?.capped?.size),\n\t\t...ifDefined(\"max\", opts?.capped?.max),\n\t\t...ifDefined(\"timeseries\", opts?.timeseries),\n\t\t...ifDefined(\"collation\", opts?.collation),\n\t\t...opts?.clusteredIndex ? { clusteredIndex: {\n\t\t\tkey: { _id: 1 },\n\t\t\tunique: true,\n\t\t\t...opts.clusteredIndex.name != null ? { name: opts.clusteredIndex.name } : {}\n\t\t} } : {},\n\t\t...validator ? { validator: { $jsonSchema: validator.jsonSchema } } : {},\n\t\t...ifDefined(\"validationLevel\", validator?.validationLevel),\n\t\t...ifDefined(\"validationAction\", validator?.validationAction),\n\t\t...ifDefined(\"changeStreamPreAndPostImages\", opts?.changeStreamPreAndPostImages)\n\t};\n}\n//#endregion\n//#region src/core/migrations/mongo-statement-planning.ts\n/** The collection a model stores its documents in; a model without `@@map` names it verbatim. */\nfunction collectionOf(contract, coordinate) {\n\tconst collection = contract?.domain.namespaces[coordinate.namespaceId]?.models[coordinate.model]?.storage[\"collection\"];\n\treturn typeof collection === \"string\" ? collection : coordinate.model;\n}\nfunction modelAt(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn Object.hasOwn(models, coordinate.model) ? models[coordinate.model] : void 0;\n}\n/** The stored name of `field` of the model at `coordinate`, or undefined when the model does not declare it. */\nfunction storedFieldNameAt(contract, coordinate) {\n\tconst model = modelAt(contract, coordinate);\n\treturn model === void 0 || !Object.hasOwn(model.fields, coordinate.field) ? void 0 : ownStoredNameOf(model, coordinate.field);\n}\n/** The stored name of a field the statement's resolution found on the model at `coordinate`. */\nfunction resolvedStoredNameAt(contract, coordinate) {\n\tconst storedName = storedFieldNameAt(contract, coordinate);\n\tif (storedName === void 0) throw new InternalError(`Field \"${coordinate.model}.${coordinate.field}\" a statement names has no stored name`);\n\treturn storedName;\n}\n/**\n* The condition that selects a variant's documents in the collection it shares with its base: the\n* base's discriminator field holding the variant's value. A model that is not a variant has none.\n*/\nfunction variantFilter(contract, coordinate) {\n\tconst base = modelAt(contract, coordinate)?.base;\n\tif (base === void 0) return void 0;\n\tconst baseModel = modelAt(contract, {\n\t\tnamespaceId: asNamespaceId(base.namespace),\n\t\tmodel: base.model\n\t});\n\tconst field = baseModel?.discriminator?.field;\n\tconst value = Object.entries(baseModel?.variants ?? {}).find(([, variant]) => variant.namespace === coordinate.namespaceId && variant.model === coordinate.model)?.[0];\n\treturn baseModel === void 0 || field === void 0 || value === void 0 ? void 0 : { [ownStoredNameOf(baseModel, field)]: value };\n}\nfunction declaredCollection(contract, collection) {\n\treturn Object.values(contract.storage.namespaces).map((namespace) => namespace.entries[\"collection\"]?.[collection]).find((entry) => entry instanceof MongoCollection);\n}\n/**\n* The control policy of `collection`. A collection the contract leaves out keeps the policy `fromContract` gave it, when that was not `managed`, so leaving an `external` collection out of the contract does not drop it.\n*/\nfunction collectionControlOf(contract, fromContract, collection) {\n\tconst declared = declaredCollection(contract, collection);\n\tconst original = declared === void 0 && fromContract !== null ? declaredCollection(fromContract, collection) : void 0;\n\tconst policy = collectionControlPolicyOf(collection, collectionControlPoliciesOf(contract));\n\tif (original === void 0 || fromContract === null) return {\n\t\tpolicy,\n\t\tdeclared: declared?.control\n\t};\n\tconst originalPolicy = governingControlPolicy({ explicitNodeControlPolicy: original.control }, fromContract.defaultControlPolicy);\n\treturn {\n\t\tpolicy: originalPolicy === \"managed\" ? policy : originalPolicy,\n\t\tdeclared: original.control\n\t};\n}\nfunction collectionControlPolicy(contract, collection) {\n\treturn collectionControlOf(contract, null, collection).policy;\n}\n/** Why MongoDB would refuse a collection name, if it would. */\nfunction invalidCollectionNameReason(name) {\n\tif (name === \"\") return \"it is empty\";\n\tif (name.includes(\"$\")) return \"it contains \\\"$\\\"\";\n\tif (name.includes(\"\\0\")) return \"it contains a null character\";\n\tif (name.startsWith(\"system.\")) return \"it starts with \\\"system.\\\", which MongoDB reserves\";\n}\nfunction isEmbedRelation(relation) {\n\treturn !(\"on\" in relation) && !(\"through\" in relation);\n}\nfunction storedField(model, field) {\n\tif (model === void 0) return { kind: \"absent\" };\n\tif (Object.hasOwn(model.fields, field)) return { kind: \"field\" };\n\tconst relation = Object.hasOwn(model.relations, field) ? model.relations[field] : void 0;\n\tif (relation === void 0) return { kind: \"absent\" };\n\treturn isEmbedRelation(relation) ? { kind: \"embed\" } : { kind: \"reference\" };\n}\nfunction refused(statement, label, reason, why) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `${label}: ${reason}`,\n\t\twhy,\n\t\trefusedStatement: statement\n\t};\n}\nconst LEAVE_OUT = \"Leave out this statement.\";\nconst SEPARATE_THE_MODELS = \"move the models to separate collections, or carry out the change in a dataTransform operation of a migration.ts, with a filter that selects only their documents\";\n/**\n* The discriminator field and value a variant's filter selects, or `undefined` for a filter that selects by anything else, or no filter.\n*/\nfunction discriminatorValueOf(filter) {\n\tconst entries = Object.entries(filter ?? {});\n\tif (entries.length !== 1) return void 0;\n\tconst [entry] = entries;\n\tif (entry === void 0) return void 0;\n\tconst [field, value] = entry;\n\treturn typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" ? {\n\t\tfield,\n\t\tvalue\n\t} : void 0;\n}\n/**\n* The other models stored in `collection`, root models and their variants, whose documents a change of `storedName` with `filter` reaches, and which store the field themselves or through their base. No discriminator tells the documents of several root models apart, so without a filter, or with a base model's filter, every other root model's documents are reached. A variant's filter, one discriminator value, reaches a model only when its documents can hold that value: a variant of another root model with the same discriminator field and value, or a model that declares the discriminator field itself.\n*/\nfunction otherModelsReached(contract, model, collection, filter, storedName) {\n\tconst models = mongoModelsOf(contract.domain, model.namespaceId);\n\tconst baseOf = (name) => {\n\t\tconst base = models[name]?.base;\n\t\treturn base === void 0 ? void 0 : models[base.model];\n\t};\n\tconst storesOrInherits = (name, storedName) => modelAndBasesOf(models, name).some((each) => ownStores(each, storedName));\n\tconst selected = discriminatorValueOf(filter);\n\tconst canHold = (name) => {\n\t\tif (selected === void 0) return true;\n\t\tconst base = baseOf(name);\n\t\tconst discriminator = base?.discriminator?.field;\n\t\tif (base !== void 0 && discriminator !== void 0 && ownStoredNameOf(base, discriminator) === selected.field) return Object.entries(base.variants ?? {}).some(([value, variant]) => variant.model === name && value === selected.value);\n\t\treturn storesOrInherits(name, selected.field);\n\t};\n\tconst subjectRoot = modelAt(contract, model)?.base?.model ?? model.model;\n\treturn (collectionRootModelsOf(models)[collection] ?? []).filter((name) => name !== subjectRoot).flatMap((name) => [name, ...Object.values(models[name]?.variants ?? {}).map((variant) => variant.model)]).filter((name) => canHold(name) && storesOrInherits(name, storedName));\n}\nfunction sharedCollectionWhy(collection, others, change) {\n\tconst names = others.map((name) => JSON.stringify(name)).join(\", \");\n\treturn `Collection ${JSON.stringify(collection)} stores several models and no discriminator tells their documents apart, so ${change} of ${names} too.`;\n}\n/**\n* A removal the plan cannot carry out because another root model stored in the same collection still stores the field, and no discriminator selects the documents of the model that loses it.\n*/\nfunction sharedCollectionRemovalRefusals(removals, contract) {\n\treturn removals.flatMap((removal) => {\n\t\tconst { subject, call } = removal;\n\t\tif (subject.kind !== \"field\") return [];\n\t\tconst others = otherModelsReached(contract, subject, call.collection, call.filter, call.field);\n\t\tif (others.length === 0) return [];\n\t\treturn [{\n\t\t\tkind: \"fieldRemovalRefused\",\n\t\t\tsummary: `Cannot remove field ${JSON.stringify(call.field)} of model ${JSON.stringify(subject.model)} from collection ${JSON.stringify(call.collection)}: model ${others.map((name) => JSON.stringify(name)).join(\", \")} stores it in the same collection`,\n\t\t\twhy: `${sharedCollectionWhy(call.collection, others, \"removing the field would remove it from the documents\")} To keep it in ${others.map((name) => JSON.stringify(name)).join(\", \")} documents only, ${SEPARATE_THE_MODELS}.`\n\t\t}];\n\t});\n}\nconst TIME_SERIES_UPDATES = \"MongoDB updates the documents of a time-series collection only through its metaField\";\n/**\n* A removal the plan cannot carry out because its collection is a time-series collection, whose\n* documents MongoDB does not let an update change except through the metaField.\n*/\nfunction timeSeriesRemovalRefusals(removals, schema) {\n\treturn removals.filter((removal) => schema.collection(removal.call.collection)?.options?.timeseries !== void 0).map((removal) => ({\n\t\tkind: \"fieldRemovalRefused\",\n\t\tsummary: `Cannot remove field ${JSON.stringify(removal.call.field)} from collection ${JSON.stringify(removal.call.collection)}: it is a time-series collection`,\n\t\twhy: `${TIME_SERIES_UPDATES}, so the field cannot be removed from the documents that hold it. Keep the field in the contract, as an optional field if new documents leave it out, then run this command again.`\n\t}));\n}\n/**\n* Plans the rename each statement states, in order: a model statement whose collection changes renames the\n* collection in the schema the diff then starts from, and a field statement whose stored name\n* changes renames the field in the documents that hold it.\n*/\nfunction planStatements(input) {\n\tlet schema = input.schema;\n\tconst collectionRenames = [];\n\tconst fieldRenames = [];\n\tconst callOfStatement = [];\n\tconst conflicts = [];\n\tconst renamedCollections = /* @__PURE__ */ new Map();\n\tfor (const statement of input.statements) {\n\t\tconst label = `Cannot ${describeMigrationStatement(statement, input.fromContract, input.contract)}`;\n\t\tconst outcome = statement.entity === \"namespace\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename namespaces in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"enumValue\" ? {\n\t\t\tkind: \"refused\",\n\t\t\tconflict: refused(statement, label, \"MongoDB does not rename enum values in this release\", LEAVE_OUT)\n\t\t} : statement.entity === \"model\" ? planModelStatement(statement, label, schema, input) : planFieldStatement(statement, label, renamedCollections, schema, input);\n\t\tif (outcome.kind === \"refused\") {\n\t\t\tconflicts.push(outcome.conflict);\n\t\t\tcallOfStatement.push(void 0);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"renameCollection\") {\n\t\t\tschema = renameInSchema(schema, outcome.call.from, outcome.call.to);\n\t\t\trenamedCollections.set(outcome.call.from, outcome.call.to);\n\t\t\tcollectionRenames.push(outcome.call);\n\t\t}\n\t\tif (outcome.kind === \"renameField\") {\n\t\t\tconst same = fieldRenames.find((call) => sameFieldRename(call, outcome.call));\n\t\t\tif (same !== void 0) {\n\t\t\t\tcallOfStatement.push(same);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfieldRenames.push(outcome.call);\n\t\t}\n\t\tcallOfStatement.push(outcome.kind === \"unchanged\" ? void 0 : outcome.call);\n\t}\n\treturn conflicts.length > 0 ? notOk(conflicts) : ok({\n\t\tschema,\n\t\tcollectionRenames,\n\t\tfieldRenames,\n\t\tcallOfStatement\n\t});\n}\n/** Whether two field renames rewrite the same documents the same way, as when every root model of a shared collection renames a field together. */\nfunction sameFieldRename(a, b) {\n\treturn a.collection === b.collection && a.from === b.from && a.to === b.to && JSON.stringify(a.filter) === JSON.stringify(b.filter);\n}\nfunction renameInSchema(schema, from, to) {\n\treturn new MongoSchemaIR(schema.collections.map((collection) => collection.name === from ? new MongoSchemaCollection({\n\t\tname: to,\n\t\tindexes: collection.indexes,\n\t\t...collection.validator === void 0 ? {} : { validator: collection.validator },\n\t\t...collection.options === void 0 ? {} : { options: collection.options }\n\t}) : collection));\n}\nfunction controlPolicyRefusal(statement, label, contract, collection) {\n\tconst policy = collectionControlPolicy(contract, collection);\n\tif (policy === \"managed\") return void 0;\n\treturn {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, `collection \"${collection}\" has control policy \"${policy}\"`, `Statements rename only collections, and fields of collections, whose control policy is \"managed\". Make the change in the database yourself and leave out this statement.`)\n\t};\n}\n/**\n* The reason and advice when a statement renames a variant whose discriminator value changes: its\n* documents keep the old value, which the new validator does not accept.\n*/\nfunction discriminatorValueChange(statement, input) {\n\tconst before = variantFilter(input.fromContract, statement.from);\n\tconst after = variantFilter(input.contract, statement.to);\n\tconst base = modelAt(input.contract, statement.to)?.base;\n\tif (before === void 0 || after === void 0 || base === void 0) return void 0;\n\tconst [field, oldValue] = Object.entries(before)[0] ?? [];\n\tconst newValue = Object.values(after)[0];\n\tif (field === void 0 || oldValue === newValue) return void 0;\n\tconst fromName = modelDisplayName(statement.from);\n\tconst toName = modelDisplayName(statement.to);\n\treturn [`its discriminator value changes from ${JSON.stringify(oldValue)} to ${JSON.stringify(newValue)}`, `The documents of \"${fromName}\" hold ${field} ${JSON.stringify(oldValue)}, and this release does not rewrite a discriminator value, so they would no longer match \"${toName}\" and would fail validation. Keep the value: declare \"${toName}\" with @@base(${base.model}, ${JSON.stringify(oldValue)}). A later release changes a stored value with --convert.`];\n}\nfunction planModelStatement(statement, label, schema, input) {\n\tconst discriminatorChange = discriminatorValueChange(statement, input);\n\tif (discriminatorChange !== void 0) return {\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, ...discriminatorChange)\n\t};\n\tconst from = collectionOf(input.fromContract, statement.from);\n\tconst to = collectionOf(input.contract, statement.to);\n\tif (from === to) return { kind: \"unchanged\" };\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, to);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, reason, why)\n\t});\n\tconst source = schema.collection(from);\n\tif (source === void 0) return refuse(`the schema being planned from has no collection \"${from}\"`, `The database has no collection \"${from}\", or \"${from}\" is a view, which MongoDB cannot rename. Inspect it with prisma db schema, or ${LEAVE_OUT.toLowerCase()}`);\n\tif (source.options?.timeseries !== void 0) return refuse(`collection \"${from}\" is a time-series collection`, `MongoDB cannot rename a time-series collection. Leave out this statement. To keep the documents, first create collection \"${to}\" yourself with the same time-series options and copy them into it; the plan then drops \"${from}\" once --delete names the model.`);\n\tconst invalid = invalidCollectionNameReason(to);\n\tif (invalid !== void 0) return refuse(`MongoDB does not accept the collection name \"${to}\": ${invalid}`, \"Give the model a collection name MongoDB accepts with @@map, then run this command again.\");\n\tif (schema.collection(to) !== void 0) return refuse(`the schema being planned from already has a collection \"${to}\"`, `A rename cannot replace a collection that already exists. Rename or drop collection \"${to}\" first, or ${LEAVE_OUT.toLowerCase()}`);\n\treturn {\n\t\tkind: \"renameCollection\",\n\t\tcall: new RenameCollectionCall(from, to)\n\t};\n}\nfunction planFieldStatement(statement, label, renamedCollections, schema, input) {\n\tconst refuse = (reason, why) => ({\n\t\tkind: \"refused\",\n\t\tconflict: refused(statement, label, reason, why)\n\t});\n\tconst fromField = storedField(modelAt(input.fromContract, statement.from), statement.from.field);\n\tconst toField = storedField(modelAt(input.contract, statement.to), statement.to.field);\n\tif (fromField.kind === \"embed\" || toField.kind === \"embed\") return refuse(\"the field is an embedded relation\", `Renaming an embedded relation is not supported in this release. ${LEAVE_OUT}`);\n\tif (fromField.kind !== \"field\" && toField.kind !== \"field\") return { kind: \"unchanged\" };\n\tif (fromField.kind !== \"field\" || toField.kind !== \"field\") return refuse(\"the field is stored in documents on one side of the statement only\", `A relation is not stored in documents, so a statement cannot rename a field to or from one. ${LEAVE_OUT}`);\n\tconst fromStored = resolvedStoredNameAt(input.fromContract, statement.from);\n\tconst toStored = resolvedStoredNameAt(input.contract, statement.to);\n\tconst originCollection = collectionOf(input.fromContract, statement.from);\n\tconst collection = renamedCollections.get(originCollection) ?? originCollection;\n\tconst destinationCollection = collectionOf(input.contract, statement.to);\n\tif (fromStored === toStored && collection === destinationCollection) return { kind: \"unchanged\" };\n\tif (fromStored === \"_id\" || toStored === \"_id\") return refuse(\"it renames _id\", `MongoDB does not let a document change its _id. ${LEAVE_OUT}`);\n\tconst unsafeFrom = unrewritableFieldNameReason(fromStored);\n\tif (unsafeFrom !== void 0) return refuse(`the stored name \"${fromStored}\" cannot be rewritten`, `${unsafeFrom}, so a statement cannot move its values. Rename it in the database yourself, or ${LEAVE_OUT.toLowerCase()}`);\n\tconst unsafeTo = unrewritableFieldNameReason(toStored);\n\tif (unsafeTo !== void 0) return refuse(`the stored name \"${toStored}\" cannot be written`, `${unsafeTo}. Give the field a stored name without \".\" that does not start with \"$\" (with @map), or ${LEAVE_OUT.toLowerCase()}`);\n\tif (collection !== destinationCollection) return refuse(`the model's collection changes from \"${originCollection}\" to \"${destinationCollection}\", and no statement renames it`, collectionChangeAdvice(statement, originCollection, destinationCollection));\n\tif (schema.collection(collection)?.options?.timeseries !== void 0) return refuse(`collection \"${collection}\" is a time-series collection`, `${TIME_SERIES_UPDATES}, so a statement cannot move the values of a field in them. Keep the stored name: store the field as ${JSON.stringify(fromStored)} (with @map(${JSON.stringify(fromStored)}) in PSL), then run this command again without this statement.`);\n\tconst policyRefusal = controlPolicyRefusal(statement, label, input.contract, collection);\n\tif (policyRefusal !== void 0) return policyRefusal;\n\tconst variant = variantFilter(input.fromContract, statement.from);\n\tconst renamedTogether = new Set(input.statements.flatMap((other) => other.entity === \"field\" && other.from.namespaceId === statement.from.namespaceId && storedFieldNameAt(input.fromContract, other.from) === fromStored && storedFieldNameAt(input.contract, other.to) === toStored ? [other.from.model] : []));\n\tconst others = otherModelsReached(input.fromContract, statement.from, originCollection, variant, fromStored).filter((name) => !renamedTogether.has(name));\n\tif (others.length > 0) return refuse(`model ${others.map((name) => JSON.stringify(name)).join(\", \")} stores field ${JSON.stringify(fromStored)} in the same collection, ${JSON.stringify(collection)}`, `${sharedCollectionWhy(collection, others, \"renaming the field would rename it in the documents\")} To change it, ${SEPARATE_THE_MODELS}.`);\n\treturn {\n\t\tkind: \"renameField\",\n\t\tcall: new RenameFieldCall(collection, fromStored, toStored, variant ?? rootDocumentsLosing(input.contract, statement.to, fromStored)?.filter)\n\t};\n}\nfunction collectionChangeAdvice(statement, from, to) {\n\tif (!sameModel(statement.from, statement.to)) return `Add --rename ${modelDisplayName(statement.from)}:${modelDisplayName(statement.to)} before this statement, so the collection is renamed with its documents.`;\n\treturn `A statement cannot rename the collection of a model that keeps its name. Rename the collection in a step of its own first: change only @@map and emit the contract. ${renameCollectionByHandSteps(statement.from, from, to)} Then change the field and run this statement again.`;\n}\nfunction renameCollectionByHandSteps(model, from, to) {\n\treturn `With db update, rename the collection in the database yourself, for example db.getCollection(${JSON.stringify(from)}).renameCollection(${JSON.stringify(to)}) in mongosh, then run db update. With migration plan, plan it, passing --delete ${modelDisplayName(model)} to answer its question; in its migration.ts make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation, imported with the other operations, delete the drop of \"${from}\", and delete the create of \"${to}\" if there is one; run node on that migration.ts so it writes ops.json again; then apply it with prisma db migrate.`;\n}\n/**\n* How to keep the documents of a model that keeps its name while its collection changes from\n* `from` to `to`: no statement can rename that collection, so the user renames it by hand.\n*/\nfunction keepCollectionByHandAdvice(model, from, to) {\n\treturn `To keep its documents, rename collection \"${from}\" to \"${to}\" instead; a statement cannot rename the collection of a model that keeps its name. ${renameCollectionByHandSteps(model, from, to)}`;\n}\nfunction modelCoordinates(contract) {\n\treturn Object.entries(contract.domain?.namespaces ?? {}).flatMap(([namespaceId, namespace]) => Object.keys(namespace.models).map((model) => ({\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel\n\t})));\n}\nfunction sameModel(a, b) {\n\treturn a.namespaceId === b.namespaceId && a.model === b.model;\n}\n/**\n* The destination model an origin model became: the one a statement renamed it to, else the one of\n* the same name, else the only one stored the same way (same collection, same variant value).\n*/\nfunction destinationModelOf(origin, input) {\n\tconst renamed = input.statements.find((statement) => statement.entity === \"model\" && sameModel(statement.from, origin));\n\tif (renamed !== void 0) return renamed.to;\n\tif (modelAt(input.contract, origin) !== void 0) return origin;\n\tconst collection = input.collectionAfterRenames(collectionOf(input.fromContract, origin));\n\tconst filter = JSON.stringify(variantFilter(input.fromContract, origin) ?? null);\n\tconst stored = modelCoordinates(input.contract).filter((candidate) => collectionOf(input.contract, candidate) === collection && JSON.stringify(variantFilter(input.contract, candidate) ?? null) === filter);\n\tconst [only] = stored;\n\treturn stored.length === 1 ? only : void 0;\n}\nfunction renamedByStatement(input, field) {\n\treturn input.statements.some((statement) => statement.entity === \"field\" && sameModel(statement.from, field) && statement.from.field === field.field);\n}\n/** Whether one of `model`'s own fields or embed relations is stored under `storedName`. */\nfunction ownStores(model, storedName) {\n\treturn hasOwnFieldStoredAs(model, storedName) || Object.values(ownEmbedStoredNamesOf(model)).includes(storedName);\n}\n/** The stored names of the documents of the model at `coordinate`: its fields and embed relations, its own and those it inherits. */\nfunction storedFieldsOf(contract, coordinate) {\n\tconst models = mongoModelsOf(contract.domain, coordinate.namespaceId);\n\treturn new Set(modelAndBasesOf(models, coordinate.model).flatMap((model) => [...Object.values(ownStoredNamesOf(model)), ...Object.values(ownEmbedStoredNamesOf(model))]));\n}\n/**\n* The documents of a root model that lose `field`: all of them, or, when some of its destination\n* variants now store the field themselves, those whose discriminator value is none of theirs.\n* `undefined` when the root model itself still stores it.\n*/\nfunction rootDocumentsLosing(contract, root, storedName) {\n\tconst model = modelAt(contract, root);\n\tif (model === void 0 || ownStores(model, storedName)) return void 0;\n\tconst discriminator = model.discriminator?.field;\n\tconst keeping = Object.entries(model.variants ?? {}).filter(([, variant]) => {\n\t\tconst variantModel = modelAt(contract, {\n\t\t\tnamespaceId: variant.namespace,\n\t\t\tmodel: variant.model\n\t\t});\n\t\treturn variantModel !== void 0 && ownStores(variantModel, storedName);\n\t}).map(([value]) => value).sort();\n\tif (discriminator === void 0 || keeping.length === 0) return { filter: void 0 };\n\treturn { filter: { [ownStoredNameOf(model, discriminator)]: { $nin: keeping } } };\n}\n/**\n* Each field an origin model stores that its destination model no longer stores, in a collection\n* the plan keeps: removing it is data loss, carried out by unsetting it from the documents that\n* hold it, in a collection whose control policy is `managed`. A variant's field is unset only from that variant's documents, unless its destination\n* base now stores it. A base field is unset from the documents of every variant that does not now\n* store it itself.\n*/\nfunction planFieldRemovals(input) {\n\treturn modelCoordinates(input.fromContract).flatMap((origin) => {\n\t\tconst collection = input.collectionAfterRenames(collectionOf(input.fromContract, origin));\n\t\tif (!input.keptCollections.has(collection)) return [];\n\t\tif (collectionControlPolicy(input.contract, collection) !== \"managed\") return [];\n\t\tconst destination = destinationModelOf(origin, input);\n\t\tif (destination === void 0) return [];\n\t\tconst model = modelAt(input.fromContract, origin);\n\t\tif (model === void 0) return [];\n\t\tconst variant = variantFilter(input.fromContract, origin);\n\t\tconst losing = (storedName) => {\n\t\t\tif (variant !== void 0) return storedFieldsOf(input.contract, destination).has(storedName) ? void 0 : { filter: variant };\n\t\t\treturn rootDocumentsLosing(input.contract, destination, storedName);\n\t\t};\n\t\treturn Object.entries(ownStoredNamesOf(model)).filter(([field, storedName]) => unrewritableFieldNameReason(storedName) === void 0 && !renamedByStatement(input, {\n\t\t\t...origin,\n\t\t\tfield\n\t\t})).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).flatMap(([field, storedName]) => {\n\t\t\tconst lost = losing(storedName);\n\t\t\treturn lost === void 0 ? [] : [{\n\t\t\t\tcall: new UnsetFieldCall(collection, storedName, lost.filter),\n\t\t\t\tsubject: {\n\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t...origin,\n\t\t\t\t\tfield\n\t\t\t\t}\n\t\t\t}];\n\t\t});\n\t});\n}\n/**\n* Without an origin contract, a field is known removed when the origin validator declares it for a\n* root model and the destination validator declares it nowhere. It is named by its storage name.\n*/\nfunction planValidatorFieldRemovals(input) {\n\treturn input.origin.collections.flatMap((originCollection) => {\n\t\tif (collectionControlPolicy(input.contract, originCollection.name) !== \"managed\") return [];\n\t\tconst destination = input.destination.collection(originCollection.name);\n\t\tif (destination?.validator === void 0 || originCollection.validator === void 0) return [];\n\t\tconst kept = validatorFieldNamesOf(destination.validator.jsonSchema);\n\t\treturn [...new Set(validatorRootShapesOf(originCollection.validator.jsonSchema).flatMap((root) => Object.keys(root.properties)))].filter((field) => unrewritableFieldNameReason(field) === void 0 && !kept.has(field)).sort().map((field) => ({\n\t\t\tcall: new UnsetFieldCall(originCollection.name, field),\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: `${originCollection.name}.${field}`\n\t\t\t}\n\t\t}));\n\t});\n}\n//#endregion\n//#region src/core/migrations/render-ops.ts\nfunction renderOps(calls) {\n\treturn calls.map((call) => call.toOp());\n}\n//#endregion\n//#region src/core/migrations/render-typescript.ts\n/**\n* Always-present base imports for the rendered scaffold, both from the\n* target's own `migration` entry:\n*\n* - `Migration` — the user-facing Mongo `Migration` base, forwarded from\n* `@internal/family-mongo`; subclasses don't need to redeclare\n* `targetId` or thread family/target generics.\n* - `MigrationCLI` — the migration-file CLI entrypoint that loads\n* `prisma.config.ts`, assembles a `ControlStack`, and instantiates\n* the migration class. The migration file owns this dependency directly:\n* pulling CLI machinery in at script run time is acceptable because the\n* script's whole purpose is to be invoked from the project that owns the\n* config.\n*\n* Naming one package rather than three is what lets an application that\n* installed only `@prisma/orm-mongo` run a scaffolded migration: emitted\n* code may name only a direct dependency (ADR 242), and the facade carries\n* the target's `migration` entry but neither the family base nor the CLI.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\tsymbol: \"MigrationCLI\"\n}];\n/**\n* Render a list of Mongo `OpFactoryCall`s as a `migration.ts` source string.\n* The result is shebanged, imports the contract JSON from the shared\n* snapshot store (the destination contract, plus the source contract for a\n* non-baseline migration), extends `Migration<Start, End>` (or\n* `Migration<never, End>` for a baseline) from\n* `@internal/target-mongo/migration`,\n* assigns the JSON to `endContractJson` / `startContractJson`, and implements\n* `operations`. The `Migration` base derives `describe()` from those fields.\n*\n* The walk is polymorphic: each call node contributes its own\n* `renderTypeScript()` expression and declares its own `importRequirements()`.\n* The top-level renderer aggregates imports across all nodes and emits one\n* `import { … } from \"…\"` line per module. The `Migration` / `MigrationCLI`\n* base imports and the contract-JSON imports are always emitted, independent\n* of the call nodes.\n*/\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"export default M;\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/migrations/planner-produced-migration.ts\n/**\n* Planner-produced Mongo migration, returned by `MongoMigrationPlanner.plan(...)`\n* and `MongoMigrationPlanner.emptyMigration(...)`.\n*\n* Unlike user-authored migrations (which extend `MongoMigration` from\n* `@internal/family-mongo`), this class lives inside the target and holds\n* the richer authoring IR (`OpFactoryCall[]`) needed to render itself back to\n* TypeScript source. It implements `MigrationPlanWithAuthoringSurface` so\n* that the CLI can uniformly ask any planner result to serialize itself to a\n* `migration.ts`.\n*\n* It extends the framework `Migration` base directly and declares its own\n* `targetId` rather than inheriting `MongoMigration`, whose added value is\n* the lazily-built contract views a planner result never reads.\n*/\nvar PlannerProducedMongoMigration = class extends Migration {\n\tcalls;\n\tmeta;\n\tsnapshotsImportPath;\n\ttargetId = \"mongo\";\n\tconstructor(calls, meta, snapshotsImportPath) {\n\t\tsuper();\n\t\tthis.calls = calls;\n\t\tthis.meta = meta;\n\t\tthis.snapshotsImportPath = snapshotsImportPath;\n\t}\n\tget operations() {\n\t\treturn renderOps(this.calls);\n\t}\n\tdescribe() {\n\t\treturn this.meta;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.calls, {\n\t\t\tfrom: this.meta.from,\n\t\t\tto: this.meta.to,\n\t\t\tsnapshotsImportPath: this.snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-planner.ts\nfunction validatorsEqual(a, b) {\n\tif (!a && !b) return true;\n\tif (!a || !b) return false;\n\treturn a.validationLevel === b.validationLevel && a.validationAction === b.validationAction && canonicalize(a.jsonSchema) === canonicalize(b.jsonSchema);\n}\nfunction isPlainObject(v) {\n\treturn typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n/** Each field a root model of the validator declares, with the distinct schemas the root models give it, in canonical form. */\nfunction propertiesOf(schema) {\n\tconst schemas = /* @__PURE__ */ new Map();\n\tfor (const root of validatorRootShapesOf(schema)) for (const [field, fieldSchema] of Object.entries(root.properties)) schemas.set(field, (schemas.get(field) ?? /* @__PURE__ */ new Set()).add(canonicalize(fieldSchema)));\n\treturn Object.fromEntries([...schemas].map(([field, distinct]) => [field, [...distinct].sort().join(\"|\")]));\n}\n/**\n* A label naming the properties whose schema changed, so a dry run shows what a validator update does: `Update validator on items (changed: meta; added: note)`.\n*/\nfunction validatorUpdateLabel(collName, origin, dest) {\n\tconst originProps = propertiesOf(origin.jsonSchema);\n\tconst destProps = propertiesOf(dest.jsonSchema);\n\tconst changed = Object.keys(destProps).filter((field) => Object.hasOwn(originProps, field) && originProps[field] !== destProps[field]);\n\tconst added = Object.keys(destProps).filter((field) => !Object.hasOwn(originProps, field));\n\tconst removed = Object.keys(originProps).filter((field) => !Object.hasOwn(destProps, field));\n\tconst parts = [\n\t\t...changed.length > 0 ? [`changed: ${changed.join(\", \")}`] : [],\n\t\t...added.length > 0 ? [`added: ${added.join(\", \")}`] : [],\n\t\t...removed.length > 0 ? [`removed: ${removed.join(\", \")}`] : []\n\t];\n\treturn parts.length === 0 ? `Update validator on ${collName}` : `Update validator on ${collName} (${parts.join(\"; \")})`;\n}\n/**\n* The keys of an option MongoDB fills in when a collection is created without them, each with a\n* test for the value it fills in. `listCollections` reports a time-series collection's granularity\n* as \"seconds\" and its bucketMaxSpanSeconds when they were not given, and bucketRoundingSeconds only\n* for custom bucketing, which a contract cannot state; and a clustered index's v, key and unique, and\n* its name as \"_id_\".\n*/\nconst SERVER_FILLED = {\n\ttimeseries: {\n\t\tgranularity: (value) => value === \"seconds\",\n\t\tbucketMaxSpanSeconds: () => true,\n\t\tbucketRoundingSeconds: () => true\n\t},\n\tclusteredIndex: {\n\t\tv: () => true,\n\t\tkey: () => true,\n\t\tunique: () => true,\n\t\tname: (value) => value === \"_id_\"\n\t}\n};\n/** The origin's value of an option without the keys the server filled in and the destination leaves out. */\nfunction withoutServerFilled(option, origin, dest) {\n\tif (!isPlainObject(origin)) return origin;\n\tconst filled = SERVER_FILLED[option];\n\treturn Object.fromEntries(Object.entries(origin).filter(([key, value]) => isPlainObject(dest) && Object.hasOwn(dest, key) || !filled[key]?.(value)));\n}\nfunction hasImmutableOptionChange(origin, dest) {\n\tif (canonicalize(origin?.capped) !== canonicalize(dest?.capped)) return \"capped\";\n\tif (canonicalize(withoutServerFilled(\"timeseries\", origin?.timeseries, dest?.timeseries)) !== canonicalize(dest?.timeseries)) return \"timeseries\";\n\tif (canonicalize(origin?.collation) !== canonicalize(dest?.collation)) return \"collation\";\n\tif (canonicalize(withoutServerFilled(\"clusteredIndex\", origin?.clusteredIndex, dest?.clusteredIndex)) !== canonicalize(dest?.clusteredIndex)) return \"clusteredIndex\";\n}\nfunction collectionHasOptions(coll) {\n\treturn !!(coll.options || coll.validator);\n}\n/**\n* The model of `fromContract` that stores its documents in `collection`, if any: the root model\n* when variants share the collection with it.\n*/\nfunction modelStoredIn(fromContract, collection) {\n\tconst storing = Object.entries(fromContract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => {\n\t\tconst coordinate = {\n\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\tmodel\n\t\t};\n\t\treturn collectionOf(fromContract, coordinate) === collection ? [{\n\t\t\tcoordinate,\n\t\t\tisRoot: definition.base === void 0\n\t\t}] : [];\n\t}));\n\treturn (storing.find(({ isRoot }) => isRoot) ?? storing[0])?.coordinate;\n}\n/** A convert or backfill statement, which this release cannot carry out on MongoDB. */\nfunction unsupportedStatementConflict(statement, fromContract, contract) {\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `MongoDB does not apply ${statement.kind} statements in this release, so nothing was planned: ${describeMigrationStatement(statement, fromContract, contract)}`,\n\t\twhy: `MongoDB cannot carry out ${statement.kind} statements in this release. Leave out the statement.`,\n\t\trefusedStatement: statement\n\t};\n}\n/**\n* Each collection drop of the plan, with the model whose documents it loses. When that model keeps\n* its name and the plan brings its new collection into existence, the drop says how to rename the\n* collection by hand instead.\n*/\nfunction collectionDrops(calls, fromContract, contract, collections) {\n\tconst created = (collection) => collections.origin.collection(collection) === void 0 && collections.destination.collection(collection) !== void 0;\n\treturn calls.flatMap((call, operationIndex) => {\n\t\tif (!(call instanceof DropCollectionCall)) return [];\n\t\tconst model = fromContract === null ? void 0 : modelStoredIn(fromContract, call.collection);\n\t\tconst lost = {\n\t\t\toperationIndex,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: call.label\n\t\t};\n\t\tif (model === void 0) return [{\n\t\t\t...lost,\n\t\t\tsubject: {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: call.collection\n\t\t\t}\n\t\t}];\n\t\tconst subject = {\n\t\t\tkind: \"model\",\n\t\t\t...model\n\t\t};\n\t\tconst destinationCollection = modelStoredInDestination(contract, model);\n\t\treturn [destinationCollection !== void 0 && created(destinationCollection) ? {\n\t\t\t...lost,\n\t\t\tsubject,\n\t\t\tkeepDataAdvice: keepCollectionByHandAdvice(model, call.collection, destinationCollection)\n\t\t} : {\n\t\t\t...lost,\n\t\t\tsubject\n\t\t}];\n\t});\n}\n/** The collection the destination stores `model` in, when the destination still has that model. */\nfunction modelStoredInDestination(contract, model) {\n\tconst namespace = contract.domain.namespaces[model.namespaceId];\n\treturn namespace !== void 0 && Object.hasOwn(namespace.models, model.model) ? collectionOf(contract, model) : void 0;\n}\nfunction callsOf(diff) {\n\treturn [\n\t\t...diff.collCreates,\n\t\t...diff.drops,\n\t\t...diff.creates,\n\t\t...diff.validatorOps,\n\t\t...diff.mutableOptionOps,\n\t\t...diff.collDrops\n\t];\n}\nfunction planCollectionDiff(collName, originColl, destColl) {\n\tconst collCreates = [];\n\tconst drops = [];\n\tconst creates = [];\n\tconst validatorOps = [];\n\tconst mutableOptionOps = [];\n\tconst collDrops = [];\n\tconst conflicts = [];\n\tif (!originColl) {\n\t\tif (destColl && (collectionHasOptions(destColl) || destColl.indexes.length === 0)) {\n\t\t\tconst opts = collectionHasOptions(destColl) ? schemaCollectionToCreateCollectionOptions(destColl) : void 0;\n\t\t\tcollCreates.push(new CreateCollectionCall(collName, opts));\n\t\t}\n\t} else if (!destColl) collDrops.push(new DropCollectionCall(collName));\n\telse {\n\t\tconst immutableChange = hasImmutableOptionChange(originColl.options, destColl.options);\n\t\tif (immutableChange) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `Cannot change immutable collection option '${immutableChange}' on ${collName}`,\n\t\t\twhy: `MongoDB does not support modifying the '${immutableChange}' option after collection creation`\n\t\t});\n\t\tconst mutableCall = planMutableOptionsDiffCall(collName, originColl.options, destColl.options);\n\t\tif (mutableCall) mutableOptionOps.push(mutableCall);\n\t\tconst validatorCall = planValidatorDiffCall(collName, originColl.validator, destColl.validator);\n\t\tif (validatorCall) validatorOps.push(validatorCall);\n\t}\n\tconst originLookup = /* @__PURE__ */ new Map();\n\tif (originColl) for (const idx of originColl.indexes) originLookup.set(indexLookupKey(idx), idx);\n\tconst destLookup = /* @__PURE__ */ new Map();\n\tif (destColl) for (const idx of destColl.indexes) destLookup.set(indexLookupKey(idx), idx);\n\tfor (const [lookupKey, idx] of originLookup) if (!destLookup.has(lookupKey)) drops.push(new DropIndexCall(collName, idx.keys));\n\tfor (const [lookupKey, idx] of destLookup) if (!originLookup.has(lookupKey)) creates.push(new CreateIndexCall(collName, idx.keys, schemaIndexToCreateIndexOptions(idx)));\n\treturn {\n\t\tcollCreates,\n\t\tdrops,\n\t\tcreates,\n\t\tvalidatorOps,\n\t\tmutableOptionOps,\n\t\tcollDrops,\n\t\tconflicts\n\t};\n}\n/**\n* The warning for a change a collection's control policy left out of the plan, worded as the Postgres planner words a suppressed call.\n*/\nfunction suppressedCallWarning(call, collection, control) {\n\tconst declared = control.declared !== void 0 && control.declared !== control.policy ? ` but declared '${control.declared}'` : \"\";\n\treturn {\n\t\tkind: \"controlPolicySuppressedCall\",\n\t\tsummary: `control policy suppressed: ${call.label} — collection \"${collection}\" has effective control '${control.policy}'${declared}`,\n\t\tmeta: {\n\t\t\tcontrolPolicy: control.policy,\n\t\t\t...ifDefined(\"declaredControlPolicy\", control.declared)\n\t\t}\n\t};\n}\nvar MongoMigrationPlanner = class {\n\tplanCalls(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = options.statementCalls?.schema ?? blindCast(options.schema);\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst collCreates = [];\n\t\tconst drops = [];\n\t\tconst creates = [];\n\t\tconst validatorOps = [];\n\t\tconst mutableOptionOps = [];\n\t\tconst collDrops = [];\n\t\tconst conflicts = [];\n\t\tconst warnings = [];\n\t\tconst allCollectionNames = /* @__PURE__ */ new Set([...originIR.collectionNames, ...destinationIR.collectionNames]);\n\t\tfor (const collName of [...allCollectionNames].sort()) {\n\t\t\tconst originColl = originIR.collection(collName);\n\t\t\tconst planned = planCollectionDiff(collName, originColl, destinationIR.collection(collName));\n\t\t\tconst control = collectionControlOf(contract, options.fromContract, collName);\n\t\t\tif (!plansChangesTo(control.policy, originColl !== void 0)) {\n\t\t\t\twarnings.push(...callsOf(planned).map((call) => suppressedCallWarning(call, collName, control)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcollCreates.push(...planned.collCreates);\n\t\t\tdrops.push(...planned.drops);\n\t\t\tcreates.push(...planned.creates);\n\t\t\tvalidatorOps.push(...planned.validatorOps);\n\t\t\tmutableOptionOps.push(...planned.mutableOptionOps);\n\t\t\tcollDrops.push(...planned.collDrops);\n\t\t\tconflicts.push(...planned.conflicts);\n\t\t}\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\tconst allCalls = [\n\t\t\t...options.statementCalls?.collectionRenames ?? [],\n\t\t\t...collCreates,\n\t\t\t...drops,\n\t\t\t...options.statementCalls?.rewrites ?? [],\n\t\t\t...creates,\n\t\t\t...validatorOps,\n\t\t\t...mutableOptionOps,\n\t\t\t...collDrops\n\t\t];\n\t\tfor (const call of allCalls) if (!options.policy.allowedOperationClasses.includes(call.operationClass)) conflicts.push({\n\t\t\tkind: \"policy-violation\",\n\t\t\tsummary: `${call.operationClass} operation disallowed: ${call.label}`,\n\t\t\twhy: `Policy does not allow '${call.operationClass}' operations`,\n\t\t\trefusedOperationClass: call.operationClass\n\t\t});\n\t\tif (conflicts.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tcalls: allCalls,\n\t\t\twarnings\n\t\t};\n\t}\n\tplan(options) {\n\t\tconst contract = blindCast(options.contract);\n\t\tconst originIR = blindCast(options.schema);\n\t\tconst fromContract = options.fromContract;\n\t\tconst unsupported = options.statements.find((statement) => statement.kind !== \"rename\");\n\t\tif (unsupported !== void 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: [unsupportedStatementConflict(unsupported, fromContract ?? contract, contract)]\n\t\t};\n\t\tconst renames = options.statements.filter((statement) => statement.kind === \"rename\");\n\t\tconst statementPlan = planStatements({\n\t\t\tstatements: renames,\n\t\t\tfromContract: fromContract ?? contract,\n\t\t\tcontract,\n\t\t\tschema: originIR\n\t\t});\n\t\tif (!statementPlan.ok) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: statementPlan.failure\n\t\t};\n\t\tconst { schema, collectionRenames, fieldRenames, callOfStatement } = statementPlan.value;\n\t\tconst destinationIR = contractToMongoSchemaIR(contract);\n\t\tconst renamedTo = new Map(collectionRenames.map((call) => [call.from, call.to]));\n\t\tconst removals = fromContract === null ? planValidatorFieldRemovals({\n\t\t\torigin: schema,\n\t\t\tdestination: destinationIR,\n\t\t\tcontract\n\t\t}) : planFieldRemovals({\n\t\t\tstatements: renames,\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\tcollectionAfterRenames: (collection) => renamedTo.get(collection) ?? collection,\n\t\t\tkeptCollections: new Set(schema.collectionNames.filter((name) => destinationIR.collection(name) !== void 0))\n\t\t});\n\t\tconst removalRefusals = [...timeSeriesRemovalRefusals(removals, schema), ...sharedCollectionRemovalRefusals(removals, contract)];\n\t\tif (removalRefusals.length > 0) return {\n\t\t\tkind: \"failure\",\n\t\t\tconflicts: removalRefusals\n\t\t};\n\t\tconst result = this.planCalls({\n\t\t\t...options,\n\t\t\tstatementCalls: {\n\t\t\t\tschema,\n\t\t\t\tcollectionRenames,\n\t\t\t\trewrites: [...fieldRenames, ...removals.map((removal) => removal.call)]\n\t\t\t}\n\t\t});\n\t\tif (result.kind === \"failure\") return result;\n\t\tconst { calls, warnings } = result;\n\t\tconst fieldLoss = removals.map((removal) => ({\n\t\t\toperationIndex: calls.indexOf(removal.call),\n\t\t\tsubject: removal.subject,\n\t\t\tloss: \"drop\",\n\t\t\tlabel: removal.call.label\n\t\t}));\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new PlannerProducedMongoMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: contract.storage.storageHash\n\t\t\t}, options.snapshotsImportPath),\n\t\t\tappliedStatements: options.statements.map((statement, index) => {\n\t\t\t\tconst call = callOfStatement[index];\n\t\t\t\treturn {\n\t\t\t\t\tstatement,\n\t\t\t\t\toperationIndexes: call === void 0 ? [] : [calls.indexOf(call)]\n\t\t\t\t};\n\t\t\t}),\n\t\t\tdataLoss: [...collectionDrops(calls, fromContract, contract, {\n\t\t\t\torigin: schema,\n\t\t\t\tdestination: destinationIR\n\t\t\t}), ...fieldLoss].sort((a, b) => a.operationIndex - b.operationIndex),\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: [],\n\t\t\t...warnings.length > 0 ? { warnings } : {}\n\t\t};\n\t}\n\t/**\n\t* Produce an empty `migration.ts` authoring surface for `migration new`.\n\t*\n\t* The \"empty migration\" is a `PlannerProducedMongoMigration` with no\n\t* operations; `renderTypeScript()` emits a stub class with the correct\n\t* `from`/`to` metadata that the user then fills in with operations. The\n\t* contract path on the context is unused — Mongo's emitted source does\n\t* not import from the generated contract `.d.ts`.\n\t*/\n\temptyMigration(context) {\n\t\treturn new PlannerProducedMongoMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, context.snapshotsImportPath);\n\t}\n};\nfunction plansChangesTo(policy, collectionExists) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return !collectionExists;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\nfunction planValidatorDiffCall(collName, originValidator, destValidator) {\n\tif (validatorsEqual(originValidator, destValidator)) return void 0;\n\tif (destValidator) return new CollModCall(collName, {\n\t\tvalidator: { $jsonSchema: destValidator.jsonSchema },\n\t\tvalidationLevel: destValidator.validationLevel,\n\t\tvalidationAction: destValidator.validationAction\n\t}, {\n\t\tid: `validator.${collName}.${originValidator ? \"update\" : \"add\"}`,\n\t\tlabel: originValidator ? validatorUpdateLabel(collName, originValidator, destValidator) : `Add validator on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n\treturn new CollModCall(collName, {\n\t\tvalidator: {},\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t}, {\n\t\tid: `validator.${collName}.remove`,\n\t\tlabel: `Remove validator on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\nfunction planMutableOptionsDiffCall(collName, origin, dest) {\n\tconst originCSPPI = origin?.changeStreamPreAndPostImages;\n\tconst destCSPPI = dest?.changeStreamPreAndPostImages;\n\tif (deepEqual(originCSPPI, destCSPPI)) return void 0;\n\treturn new CollModCall(collName, { changeStreamPreAndPostImages: destCSPPI ?? { enabled: false } }, {\n\t\tid: `options.${collName}.update`,\n\t\tlabel: `Update mutable options on ${collName}`,\n\t\toperationClass: \"widening\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/filter-evaluator.ts\nfunction isRecord(value) {\n\treturn value !== null && typeof value === \"object\";\n}\nfunction getNestedField(doc, path) {\n\tconst parts = path.split(\".\");\n\tlet current = doc;\n\tfor (const part of parts) {\n\t\tif (!isRecord(current)) return;\n\t\tconst record = current;\n\t\tif (!Object.hasOwn(record, part)) return;\n\t\tcurrent = record[part];\n\t}\n\treturn blindCast(current);\n}\nfunction evaluateFieldOp(op, actual, expected) {\n\tswitch (op) {\n\t\tcase \"$eq\": return deepEqual(actual, expected);\n\t\tcase \"$ne\": return !deepEqual(actual, expected);\n\t\tcase \"$gt\": return typeof actual === typeof expected && blindCast(actual) > blindCast(expected);\n\t\tcase \"$gte\": return typeof actual === typeof expected && blindCast(actual) >= blindCast(expected);\n\t\tcase \"$lt\": return typeof actual === typeof expected && blindCast(actual) < blindCast(expected);\n\t\tcase \"$lte\": return typeof actual === typeof expected && blindCast(actual) <= blindCast(expected);\n\t\tcase \"$in\": return Array.isArray(expected) && expected.some((v) => deepEqual(actual, v));\n\t\tdefault: throw mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", `Unsupported filter operator in migration check: ${op}`, { meta: { operator: op } });\n\t}\n}\nvar FilterEvaluator = class {\n\tdoc = {};\n\tevaluate(filter, doc) {\n\t\tthis.doc = doc;\n\t\treturn filter.accept(this);\n\t}\n\tfield(expr) {\n\t\tconst value = getNestedField(this.doc, expr.field);\n\t\treturn evaluateFieldOp(expr.op, value, expr.value);\n\t}\n\tand(expr) {\n\t\treturn expr.exprs.every((child) => child.accept(this));\n\t}\n\tor(expr) {\n\t\treturn expr.exprs.some((child) => child.accept(this));\n\t}\n\tnot(expr) {\n\t\treturn !expr.expr.accept(this);\n\t}\n\texists(expr) {\n\t\tconst has = getNestedField(this.doc, expr.field) !== void 0;\n\t\treturn expr.exists ? has : !has;\n\t}\n\texpr(_expr) {\n\t\tthrow mongoTargetError(\"MIGRATION.OPERATION_UNSUPPORTED\", \"Aggregation expression filters are not supported in migration checks\", { meta: { operator: \"$expr\" } });\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-ops-serializer.ts\nconst IndexKeyJson = type({\n\tfield: \"string\",\n\tdirection: type(\"1 | -1 | \\\"text\\\" | \\\"2dsphere\\\" | \\\"2d\\\" | \\\"hashed\\\"\")\n});\nconst CollationJson = type({\n\tlocale: \"string\",\n\t\"caseLevel?\": \"boolean\",\n\t\"caseFirst?\": \"string\",\n\t\"strength?\": \"number\",\n\t\"numericOrdering?\": \"boolean\",\n\t\"alternate?\": \"string\",\n\t\"maxVariable?\": \"string\",\n\t\"backwards?\": \"boolean\",\n\t\"normalization?\": \"boolean\"\n});\nconst CreateIndexJson = type({\n\tkind: \"\\\"createIndex\\\"\",\n\tcollection: \"string\",\n\tkeys: IndexKeyJson.array().atLeastLength(1),\n\t\"unique?\": \"boolean\",\n\t\"sparse?\": \"boolean\",\n\t\"expireAfterSeconds?\": \"number\",\n\t\"partialFilterExpression?\": \"Record<string, unknown>\",\n\t\"name?\": \"string\",\n\t\"wildcardProjection?\": \"Record<string, 0 | 1>\",\n\t\"collation?\": CollationJson,\n\t\"weights?\": \"Record<string, number>\",\n\t\"default_language?\": \"string\",\n\t\"language_override?\": \"string\"\n});\nconst DropIndexJson = type({\n\tkind: \"\\\"dropIndex\\\"\",\n\tcollection: \"string\",\n\tname: \"string\"\n});\nconst CreateCollectionJson = type({\n\tkind: \"\\\"createCollection\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"capped?\": \"boolean\",\n\t\"size?\": \"number\",\n\t\"max?\": \"number\",\n\t\"timeseries?\": {\n\t\ttimeField: \"string\",\n\t\t\"metaField?\": \"string\",\n\t\t\"granularity?\": \"\\\"seconds\\\" | \\\"minutes\\\" | \\\"hours\\\"\"\n\t},\n\t\"collation?\": CollationJson,\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" },\n\t\"clusteredIndex?\": {\n\t\tkey: \"Record<string, number>\",\n\t\tunique: \"boolean\",\n\t\t\"name?\": \"string\"\n\t}\n});\nconst DropCollectionJson = type({\n\tkind: \"\\\"dropCollection\\\"\",\n\tcollection: \"string\"\n});\nconst RenameCollectionJson = type({\n\tkind: \"\\\"renameCollection\\\"\",\n\tcollection: \"string\",\n\tto: \"string\"\n});\nconst CollModJson = type({\n\tkind: \"\\\"collMod\\\"\",\n\tcollection: \"string\",\n\t\"validator?\": \"Record<string, unknown>\",\n\t\"validationLevel?\": \"\\\"strict\\\" | \\\"moderate\\\"\",\n\t\"validationAction?\": \"\\\"error\\\" | \\\"warn\\\"\",\n\t\"changeStreamPreAndPostImages?\": { enabled: \"boolean\" }\n});\nconst ListIndexesJson = type({\n\tkind: \"\\\"listIndexes\\\"\",\n\tcollection: \"string\"\n});\nconst ListCollectionsJson = type({ kind: \"\\\"listCollections\\\"\" });\nconst FieldFilterJson = type({\n\tkind: \"\\\"field\\\"\",\n\tfield: \"string\",\n\top: \"string\",\n\tvalue: \"unknown\"\n});\nconst AndFilterJson = type({\n\tkind: \"\\\"and\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst OrFilterJson = type({\n\tkind: \"\\\"or\\\"\",\n\texprs: \"Record<string, unknown>[]\"\n});\nconst NotFilterJson = type({\n\tkind: \"\\\"not\\\"\",\n\texpr: \"Record<string, unknown>\"\n});\nconst ExistsFilterJson = type({\n\tkind: \"\\\"exists\\\"\",\n\tfield: \"string\",\n\texists: \"boolean\"\n});\nconst RawInsertOneJson = type({\n\tkind: \"\\\"rawInsertOne\\\"\",\n\tcollection: \"string\",\n\tdocument: \"Record<string, unknown>\"\n});\nconst RawInsertManyJson = type({\n\tkind: \"\\\"rawInsertMany\\\"\",\n\tcollection: \"string\",\n\tdocuments: \"Record<string, unknown>[]\"\n});\nconst RawUpdateOneJson = type({\n\tkind: \"\\\"rawUpdateOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\"\n});\nconst RawUpdateManyJson = type({\n\tkind: \"\\\"rawUpdateMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\t\"bypassDocumentValidation?\": \"boolean\"\n});\nconst RawDeleteOneJson = type({\n\tkind: \"\\\"rawDeleteOne\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawDeleteManyJson = type({\n\tkind: \"\\\"rawDeleteMany\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst RawAggregateJson = type({\n\tkind: \"\\\"rawAggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst RawFindOneAndUpdateJson = type({\n\tkind: \"\\\"rawFindOneAndUpdate\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\",\n\tupdate: \"Record<string, unknown> | Record<string, unknown>[]\",\n\tupsert: \"boolean\"\n});\nconst RawFindOneAndDeleteJson = type({\n\tkind: \"\\\"rawFindOneAndDelete\\\"\",\n\tcollection: \"string\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst TypedAggregateJson = type({\n\tkind: \"\\\"aggregate\\\"\",\n\tcollection: \"string\",\n\tpipeline: \"Record<string, unknown>[]\"\n});\nconst QueryPlanJson = type({\n\tcollection: \"string\",\n\tcommand: \"Record<string, unknown>\",\n\tmeta: type({\n\t\ttarget: \"string\",\n\t\tstorageHash: \"string\",\n\t\tlane: \"string\",\n\t\t\"targetFamily?\": \"string\",\n\t\t\"profileHash?\": \"string\",\n\t\t\"annotations?\": \"Record<string, unknown>\"\n\t})\n});\nconst MatchStageJson = type({\n\tkind: \"\\\"match\\\"\",\n\tfilter: \"Record<string, unknown>\"\n});\nconst LimitStageJson = type({\n\tkind: \"\\\"limit\\\"\",\n\tlimit: \"number\"\n});\nconst SortStageJson = type({\n\tkind: \"\\\"sort\\\"\",\n\tsort: \"Record<string, 1 | -1>\"\n});\nconst ProjectStageJson = type({\n\tkind: \"\\\"project\\\"\",\n\tprojection: \"Record<string, 0 | 1>\"\n});\nconst AddFieldsStageJson = type({\n\tkind: \"\\\"addFields\\\"\",\n\tfields: \"Record<string, unknown>\"\n});\nconst LookupStageJson = type({\n\tkind: \"\\\"lookup\\\"\",\n\tfrom: \"string\",\n\tas: \"string\",\n\t\"localField?\": \"string\",\n\t\"foreignField?\": \"string\",\n\t\"pipeline?\": \"Record<string, unknown>[]\",\n\t\"let_?\": \"Record<string, unknown>\"\n});\nconst CheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\",\n\t\"object?\": \"string > 0\"\n});\nconst StepJson = type({\n\tdescription: \"string\",\n\tcommand: \"Record<string, unknown>\"\n});\nconst DdlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\"\",\n\tprecheck: \"Record<string, unknown>[]\",\n\texecute: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nconst DmlCheckJson = type({\n\tdescription: \"string\",\n\tsource: \"Record<string, unknown>\",\n\tfilter: \"Record<string, unknown>\",\n\texpect: \"\\\"exists\\\" | \\\"notExists\\\"\"\n});\nconst DmlOperationJson = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"\\\"additive\\\" | \\\"widening\\\" | \\\"destructive\\\" | \\\"data\\\"\",\n\tname: \"string\",\n\tprecheck: \"Record<string, unknown>[]\",\n\trun: \"Record<string, unknown>[]\",\n\tpostcheck: \"Record<string, unknown>[]\"\n});\nfunction recordValue(json, key, context) {\n\tif (json === null || typeof json !== \"object\") throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: expected object`, { meta: { context } });\n\treturn blindCast(Reflect.get(json, key));\n}\nfunction recordKind(json, context) {\n\tconst kind = recordValue(json, \"kind\", context);\n\treturn typeof kind === \"string\" ? kind : \"\";\n}\nfunction validate(schema, data, context) {\n\ttry {\n\t\treturn schema.assert(stripUndefinedDeep(data));\n\t} catch (error) {\n\t\t/* v8 ignore stop */\n\t\tthrow mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Invalid ${context}: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { context },\n\t\t\tcause: error\n\t\t});\n\t}\n}\n/**\n* Strip `undefined`-valued properties before they reach arktype's optional-key\n* assertions.\n*\n* Op IRs (e.g. `CreateCollectionCommand`) assign every optional field on\n* every instance — fields the caller did not provide land as\n* `undefined`-valued properties. arktype treats `{ foo?: 'boolean' }` as\n* \"key may be absent, but if present must be boolean\", so the bare instance\n* fails validation when it crosses the deserialize boundary in-process\n* (no JSON round-trip happens between planner → runner). This helper\n* recovers the JSON-round-tripped shape (undefined keys absent) without\n* forcing every caller to round-trip.\n*\n* Returns the original value reference whenever no change is needed.\n* That preserves prototype-bound payload values such as BSON wrappers\n* (`ObjectId`, `Decimal128`, `Binary`, …) which embed no `undefined`\n* own-enumerable properties and therefore never trigger a rebuild.\n* Top-level op IRs (class instances with `undefined` optional fields)\n* still get flattened to plain records as required by arktype.\n*/\nfunction stripUndefinedDeep(value) {\n\tif (Array.isArray(value)) {\n\t\tlet changed = false;\n\t\tconst next = value.map((item) => {\n\t\t\tconst stripped = stripUndefinedDeep(item);\n\t\t\tif (stripped !== item) changed = true;\n\t\t\treturn stripped;\n\t\t});\n\t\treturn changed ? next : value;\n\t}\n\tif (value === null || typeof value !== \"object\") return blindCast(value);\n\tconst entries = Object.entries(value);\n\tconst out = {};\n\tlet changed = false;\n\tfor (const [key, val] of entries) {\n\t\tif (val === void 0) {\n\t\t\tchanged = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst stripped = stripUndefinedDeep(val);\n\t\tif (stripped !== val) changed = true;\n\t\tout[key] = stripped;\n\t}\n\treturn changed ? out : blindCast(value);\n}\nfunction deserializeFilterExpr(json) {\n\tconst kind = recordKind(json, \"filter expression\");\n\tswitch (kind) {\n\t\tcase \"field\": {\n\t\t\tconst data = validate(FieldFilterJson, json, \"field filter\");\n\t\t\treturn MongoFieldFilter.of(data.field, data.op, blindCast(data.value));\n\t\t}\n\t\tcase \"and\": {\n\t\t\tconst data = validate(AndFilterJson, json, \"and filter\");\n\t\t\treturn MongoAndExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"or\": {\n\t\t\tconst data = validate(OrFilterJson, json, \"or filter\");\n\t\t\treturn MongoOrExpr.of(data.exprs.map(deserializeFilterExpr));\n\t\t}\n\t\tcase \"not\": return new MongoNotExpr(deserializeFilterExpr(validate(NotFilterJson, json, \"not filter\").expr));\n\t\tcase \"exists\": {\n\t\t\tconst data = validate(ExistsFilterJson, json, \"exists filter\");\n\t\t\treturn new MongoExistsExpr(data.field, data.exists);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown filter expression kind: ${kind}`, { meta: {\n\t\t\tcontext: \"filter expression\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializePipelineStage(json) {\n\tconst kind = recordKind(json, \"pipeline stage\");\n\tswitch (kind) {\n\t\tcase \"match\": return new MongoMatchStage(deserializeFilterExpr(validate(MatchStageJson, json, \"match stage\").filter));\n\t\tcase \"limit\": return new MongoLimitStage(validate(LimitStageJson, json, \"limit stage\").limit);\n\t\tcase \"sort\": return new MongoSortStage(validate(SortStageJson, json, \"sort stage\").sort);\n\t\tcase \"project\": return new MongoProjectStage(validate(ProjectStageJson, json, \"project stage\").projection);\n\t\tcase \"addFields\": return new MongoAddFieldsStage(blindCast(validate(AddFieldsStageJson, json, \"addFields stage\").fields));\n\t\tcase \"lookup\": {\n\t\t\tconst data = validate(LookupStageJson, json, \"lookup stage\");\n\t\t\tconst opts = {\n\t\t\t\tfrom: data.from,\n\t\t\t\tas: data.as\n\t\t\t};\n\t\t\tif (data.localField !== void 0) opts.localField = data.localField;\n\t\t\tif (data.foreignField !== void 0) opts.foreignField = data.foreignField;\n\t\t\tif (data.pipeline !== void 0) opts.pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\tif (data.let_ !== void 0) opts.let_ = blindCast(data.let_);\n\t\t\treturn new MongoLookupStage(opts);\n\t\t}\n\t\tcase \"merge\": {\n\t\t\tconst whenMatched = recordValue(json, \"whenMatched\", \"merge stage\");\n\t\t\tconst opts = { into: blindCast(recordValue(json, \"into\", \"merge stage\")) };\n\t\t\tconst on = recordValue(json, \"on\", \"merge stage\");\n\t\t\tif (on !== void 0) opts.on = blindCast(on);\n\t\t\tif (whenMatched !== void 0) opts.whenMatched = typeof whenMatched === \"string\" ? whenMatched : blindCast(blindCast(whenMatched).map(deserializePipelineStage));\n\t\t\tconst whenNotMatched = recordValue(json, \"whenNotMatched\", \"merge stage\");\n\t\t\tif (whenNotMatched !== void 0) opts.whenNotMatched = blindCast(whenNotMatched);\n\t\t\treturn new MongoMergeStage(opts);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown pipeline stage kind: ${kind}`, { meta: {\n\t\t\tcontext: \"pipeline stage\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeDmlCommand(json) {\n\tconst kind = recordKind(json, \"DML command\");\n\tswitch (kind) {\n\t\tcase \"rawInsertOne\": {\n\t\t\tconst data = validate(RawInsertOneJson, json, \"rawInsertOne command\");\n\t\t\treturn new RawInsertOneCommand(data.collection, data.document);\n\t\t}\n\t\tcase \"rawInsertMany\": {\n\t\t\tconst data = validate(RawInsertManyJson, json, \"rawInsertMany command\");\n\t\t\treturn new RawInsertManyCommand(data.collection, data.documents);\n\t\t}\n\t\tcase \"rawUpdateOne\": {\n\t\t\tconst data = validate(RawUpdateOneJson, json, \"rawUpdateOne command\");\n\t\t\treturn new RawUpdateOneCommand(data.collection, data.filter, data.update);\n\t\t}\n\t\tcase \"rawUpdateMany\": {\n\t\t\tconst data = validate(RawUpdateManyJson, json, \"rawUpdateMany command\");\n\t\t\treturn new RawUpdateManyCommand(data.collection, data.filter, data.update, ifDefined(\"bypassDocumentValidation\", data.bypassDocumentValidation));\n\t\t}\n\t\tcase \"rawDeleteOne\": {\n\t\t\tconst data = validate(RawDeleteOneJson, json, \"rawDeleteOne command\");\n\t\t\treturn new RawDeleteOneCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawDeleteMany\": {\n\t\t\tconst data = validate(RawDeleteManyJson, json, \"rawDeleteMany command\");\n\t\t\treturn new RawDeleteManyCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"rawAggregate\": {\n\t\t\tconst data = validate(RawAggregateJson, json, \"rawAggregate command\");\n\t\t\treturn new RawAggregateCommand(data.collection, data.pipeline);\n\t\t}\n\t\tcase \"rawFindOneAndUpdate\": {\n\t\t\tconst data = validate(RawFindOneAndUpdateJson, json, \"rawFindOneAndUpdate command\");\n\t\t\treturn new RawFindOneAndUpdateCommand(data.collection, data.filter, data.update, data.upsert);\n\t\t}\n\t\tcase \"rawFindOneAndDelete\": {\n\t\t\tconst data = validate(RawFindOneAndDeleteJson, json, \"rawFindOneAndDelete command\");\n\t\t\treturn new RawFindOneAndDeleteCommand(data.collection, data.filter);\n\t\t}\n\t\tcase \"aggregate\": {\n\t\t\tconst data = validate(TypedAggregateJson, json, \"aggregate command\");\n\t\t\tconst pipeline = data.pipeline.map(deserializePipelineStage);\n\t\t\treturn new AggregateCommand(data.collection, pipeline);\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DML command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DML command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeMongoQueryPlan(json) {\n\tconst data = validate(QueryPlanJson, json, \"Mongo query plan\");\n\tconst command = deserializeDmlCommand(data.command);\n\tconst m = data.meta;\n\tconst meta = {\n\t\ttarget: m.target,\n\t\tstorageHash: m.storageHash,\n\t\tlane: m.lane,\n\t\t...ifDefined(\"targetFamily\", m.targetFamily),\n\t\t...ifDefined(\"profileHash\", m.profileHash),\n\t\t...ifDefined(\"annotations\", m.annotations)\n\t};\n\treturn {\n\t\tcollection: data.collection,\n\t\tcommand,\n\t\tmeta\n\t};\n}\nfunction deserializeDdlCommand(json) {\n\tconst kind = recordKind(json, \"DDL command\");\n\tswitch (kind) {\n\t\tcase \"createIndex\": {\n\t\t\tconst data = validate(CreateIndexJson, json, \"createIndex command\");\n\t\t\treturn new CreateIndexCommand(data.collection, data.keys, {\n\t\t\t\t...ifDefined(\"unique\", data.unique),\n\t\t\t\t...ifDefined(\"sparse\", data.sparse),\n\t\t\t\t...ifDefined(\"expireAfterSeconds\", data.expireAfterSeconds),\n\t\t\t\t...ifDefined(\"partialFilterExpression\", data.partialFilterExpression),\n\t\t\t\t...ifDefined(\"name\", data.name),\n\t\t\t\t...ifDefined(\"wildcardProjection\", data.wildcardProjection),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"weights\", data.weights),\n\t\t\t\t...ifDefined(\"default_language\", data.default_language),\n\t\t\t\t...ifDefined(\"language_override\", data.language_override)\n\t\t\t});\n\t\t}\n\t\tcase \"dropIndex\": {\n\t\t\tconst data = validate(DropIndexJson, json, \"dropIndex command\");\n\t\t\treturn new DropIndexCommand(data.collection, data.name);\n\t\t}\n\t\tcase \"createCollection\": {\n\t\t\tconst data = validate(CreateCollectionJson, json, \"createCollection command\");\n\t\t\treturn new CreateCollectionCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"capped\", data.capped),\n\t\t\t\t...ifDefined(\"size\", data.size),\n\t\t\t\t...ifDefined(\"max\", data.max),\n\t\t\t\t...ifDefined(\"timeseries\", data.timeseries),\n\t\t\t\t...ifDefined(\"collation\", data.collation),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages),\n\t\t\t\t...ifDefined(\"clusteredIndex\", data.clusteredIndex)\n\t\t\t});\n\t\t}\n\t\tcase \"dropCollection\": return new DropCollectionCommand(validate(DropCollectionJson, json, \"dropCollection command\").collection);\n\t\tcase \"renameCollection\": {\n\t\t\tconst data = validate(RenameCollectionJson, json, \"renameCollection command\");\n\t\t\treturn new RenameCollectionCommand(data.collection, data.to);\n\t\t}\n\t\tcase \"collMod\": {\n\t\t\tconst data = validate(CollModJson, json, \"collMod command\");\n\t\t\treturn new CollModCommand(data.collection, {\n\t\t\t\t...ifDefined(\"validator\", data.validator),\n\t\t\t\t...ifDefined(\"validationLevel\", data.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", data.validationAction),\n\t\t\t\t...ifDefined(\"changeStreamPreAndPostImages\", data.changeStreamPreAndPostImages)\n\t\t\t});\n\t\t}\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown DDL command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"DDL command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeInspectionCommand(json) {\n\tconst kind = recordKind(json, \"inspection command\");\n\tswitch (kind) {\n\t\tcase \"listIndexes\": return new ListIndexesCommand(validate(ListIndexesJson, json, \"listIndexes command\").collection);\n\t\tcase \"listCollections\":\n\t\t\tvalidate(ListCollectionsJson, json, \"listCollections command\");\n\t\t\treturn new ListCollectionsCommand();\n\t\tdefault: throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `Unknown inspection command kind: ${kind}`, { meta: {\n\t\t\tcontext: \"inspection command\",\n\t\t\tkind\n\t\t} });\n\t}\n}\nfunction deserializeCheck(json) {\n\tconst data = validate(CheckJson, json, \"migration check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeInspectionCommand(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect,\n\t\t...ifDefined(\"object\", data.object)\n\t};\n}\nfunction deserializeStep(json) {\n\tconst data = validate(StepJson, json, \"migration step\");\n\treturn {\n\t\tdescription: data.description,\n\t\tcommand: deserializeDdlCommand(data.command)\n\t};\n}\nfunction isDmlOperationJson(json) {\n\treturn Array.isArray(recordValue(json, \"run\", \"migration operation\"));\n}\nfunction deserializeDdlOp(json) {\n\tconst data = validate(DdlOperationJson, json, \"migration operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tprecheck: data.precheck.map(deserializeCheck),\n\t\texecute: data.execute.map(deserializeStep),\n\t\tpostcheck: data.postcheck.map(deserializeCheck)\n\t};\n}\nfunction deserializeDmlCheck(json) {\n\tconst data = validate(DmlCheckJson, json, \"DML operation check\");\n\treturn {\n\t\tdescription: data.description,\n\t\tsource: deserializeMongoQueryPlan(data.source),\n\t\tfilter: deserializeFilterExpr(data.filter),\n\t\texpect: data.expect\n\t};\n}\nfunction deserializeDmlOp(json) {\n\tconst data = validate(DmlOperationJson, json, \"DML operation\");\n\treturn {\n\t\tid: data.id,\n\t\tlabel: data.label,\n\t\toperationClass: data.operationClass,\n\t\tname: data.name,\n\t\tprecheck: data.precheck.map(deserializeDmlCheck),\n\t\trun: data.run.map(deserializeMongoQueryPlan),\n\t\tpostcheck: data.postcheck.map(deserializeDmlCheck)\n\t};\n}\nfunction deserializeMongoOp(json) {\n\tif (isDmlOperationJson(json)) return deserializeDmlOp(json);\n\treturn deserializeDdlOp(json);\n}\nfunction deserializeMongoOps(json) {\n\treturn json.map(deserializeMongoOp);\n}\nfunction serializeMongoOps(ops) {\n\treturn JSON.stringify(ops, null, 2);\n}\n//#endregion\n//#region src/core/migrations/mongo-runner.ts\nconst READ_ONLY_CHECK_COMMAND_KINDS = /* @__PURE__ */ new Set([\"aggregate\", \"rawAggregate\"]);\nconst CHANGED_DOCUMENT_COUNTS = [\n\t\"insertedCount\",\n\t\"modifiedCount\",\n\t\"upsertedCount\",\n\t\"deletedCount\"\n];\n/** Whether a write command's result row says it changed no document: every count it carries is zero. */\nfunction reportsNoChangedDocuments(row) {\n\tif (typeof row !== \"object\" || row === null) return false;\n\tconst counts = CHANGED_DOCUMENT_COUNTS.map((field) => Reflect.get(row, field)).filter((count) => count !== void 0);\n\treturn counts.length > 0 && counts.every((count) => count === 0);\n}\nfunction failedCheckOf(operationId, phase, check) {\n\treturn {\n\t\toperationId,\n\t\tphase,\n\t\tdescription: check.description,\n\t\t...ifDefined(\"expectation\", check.object === void 0 ? void 0 : check.expect === \"exists\" ? expectPresent(check.object) : expectAbsent(check.object))\n\t};\n}\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(migrationRunnerFailure(code, summary, options));\n}\n/**\n* The failure when a field rename's before-check finds documents that already hold the new name,\n* which `$rename` would overwrite: what to look for and fix, and that the plan resumes.\n*/\nfunction renameOverwriteRefusal(op) {\n\tconst rewrite = fieldRewriteOf(op);\n\tif (rewrite === void 0) return void 0;\n\tconst renames = Reflect.get(rewrite.command.update, \"$rename\");\n\tconst to = typeof renames === \"object\" && renames !== null ? Reflect.get(renames, rewrite.field) : void 0;\n\tif (typeof to !== \"string\") return void 0;\n\tconst [check] = op.precheck;\n\tconst source = check?.source.command;\n\tconst match = source instanceof RawAggregateCommand ? Reflect.get(source.pipeline[0] ?? {}, \"$match\") : void 0;\n\tconst find = `db.getCollection(${JSON.stringify(rewrite.collection)}).find(${JSON.stringify(match ?? {})})`;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: some documents in collection ${rewrite.collection} already hold ${to} as well as ${rewrite.field}`, {\n\t\twhy: `Renaming ${rewrite.field} to ${to} would overwrite their ${to}. Find them with ${find} in mongosh, and move or remove one of the two values in each. Nothing was renamed. Once the documents are fixed, run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tname: op.name\n\t\t}\n\t});\n}\n/**\n* The failure when a collection rename's before-check finds that the new collection already exists.\n*/\nfunction renameTargetExistsRefusal(op, failed) {\n\tconst rename = op.execute.find((step) => step.command instanceof RenameCollectionCommand)?.command;\n\tif (!(rename instanceof RenameCollectionCommand) || failed.expect !== \"notExists\") return;\n\tconst { collection: from, to } = rename;\n\treturn runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} stopped: collection ${to} already exists, so collection ${from} cannot be renamed to it`, {\n\t\twhy: `Nothing was renamed. If ${to} holds nothing you need, drop it, then run the command again; operations that already ran are skipped. If an earlier operation of the same migration created ${to}, as a createIndex on ${to} does, make renameCollection(${JSON.stringify(from)}, ${JSON.stringify(to)}) the first operation of its migration.ts, run node on that migration.ts, and then drop ${to} and run the command again.`,\n\t\tmeta: { operationId: op.id }\n\t});\n}\nconst MONGO_UNAUTHORIZED = 13;\n/**\n* The failure for a rewrite that skips validation when the database user lacks the\n* `bypassDocumentValidation` action, as a `readWrite` user on a hosted cluster does.\n*/\nfunction bypassValidationRefusal(op, plan, error) {\n\tif (!(plan.command instanceof RawUpdateManyCommand) || !plan.command.bypassDocumentValidation) return;\n\tif (typeof error !== \"object\" || error === null) return void 0;\n\tif (Reflect.get(error, \"code\") !== MONGO_UNAUTHORIZED) return void 0;\n\tconst codeName = Reflect.get(error, \"codeName\");\n\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${op.id} failed: the database user may not skip document validation`, {\n\t\twhy: `Renaming or removing a field rewrites documents with bypassDocumentValidation, because the old validator requires the old field. MongoDB refused it with error ${MONGO_UNAUTHORIZED} (${String(codeName)}). Grant the user the bypassDocumentValidation action on the database, for example with the dbAdmin or restore role, then run the command again; operations that already ran are skipped.`,\n\t\tmeta: {\n\t\t\toperationId: op.id,\n\t\t\tmongoCode: MONGO_UNAUTHORIZED,\n\t\t\tcodeName\n\t\t}\n\t});\n}\nvar MongoMigrationRunner = class {\n\tdeps;\n\tconstructor(deps) {\n\t\tthis.deps = deps;\n\t}\n\tasync execute(options) {\n\t\tlet changedDatabase = false;\n\t\tconst result = await this.apply(options, () => {\n\t\t\tchangedDatabase = true;\n\t\t});\n\t\treturn result.ok ? ok({\n\t\t\t...result.value,\n\t\t\tchangedDatabase\n\t\t}) : notOk(withDatabaseUnchanged(result.failure, options.databaseChangedBefore !== true && !changedDatabase));\n\t}\n\t/** Applies the plan, calling `wrote` after each command that changes the database. */\n\tasync apply(options, wrote) {\n\t\tconst { inspectionExecutor, adapter, driver, executeDdl, markerOps } = this.deps;\n\t\tconst operations = deserializeMongoOps(blindCast(options.plan.operations));\n\t\tconst space = options.plan.spaceId ?? APP_SPACE_ID;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, operations);\n\t\tif (policyCheck) return policyCheck;\n\t\tconst existingMarker = await markerOps.readMarker(space);\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (markerCheck) return markerCheck;\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tconst filterEvaluator = new FilterEvaluator();\n\t\tlet operationsExecuted = 0;\n\t\tfor (const operation of operations) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (isMongoDmlOperation(operation)) {\n\t\t\t\t\tconst result = await this.executeDmlOperation(operation, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote);\n\t\t\t\t\tif (result.failure) return result.failure;\n\t\t\t\t\tif (result.executed) operationsExecuted += 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.allChecksSatisfied(operation.postcheck, inspectionExecutor, filterEvaluator)) continue;\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.precheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"precheck\", failing);\n\t\t\t\t\t\treturn renameTargetExistsRefusal(operation, failing) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${operation.id} failed during precheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPrecheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: { failedCheck }\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const step of operation.execute) {\n\t\t\t\t\tawait executeDdl(step.command);\n\t\t\t\t\twrote();\n\t\t\t\t}\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst failing = await this.firstFailingCheck(operation.postcheck, inspectionExecutor, filterEvaluator);\n\t\t\t\t\tif (failing !== void 0) {\n\t\t\t\t\t\tconst failedCheck = failedCheckOf(operation.id, \"postcheck\", failing);\n\t\t\t\t\t\treturn runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during postcheck: ${failing.description}`, {\n\t\t\t\t\t\t\twhy: failedPostcheckWhy(failedCheck),\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\t\t\t\tfailedCheck\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\tconst destination = options.plan.destination;\n\t\tconst profileHash = options.destinationContract.profileHash ?? destination.storageHash;\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariantSet = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariantSet.has(id));\n\t\tconst markerAlreadyAtDestination = existingMarker !== null && existingMarker.storageHash === destination.storageHash && existingMarker.profileHash === profileHash;\n\t\tif (!(operationsExecuted === 0 && markerAlreadyAtDestination && incomingIsSubsetOfExisting)) {\n\t\t\tconst liveSchema = await this.deps.introspectSchema();\n\t\t\tconst rawVerifyResult = verifyMongoSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: liveSchema,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\t...options.context ? { context: options.context } : {}\n\t\t\t});\n\t\t\tconst verifyResult = options.scopeVerifyResult ? options.scopeVerifyResult(rawVerifyResult) : rawVerifyResult;\n\t\t\tif (!verifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", verifyResult.summary, {\n\t\t\t\twhy: schemaCheckWhy(verifyResult.schema.issues),\n\t\t\t\tmeta: { schemaIssues: verifyResult.schema.issues }\n\t\t\t});\n\t\t\tif (existingMarker) {\n\t\t\t\tif (!await markerOps.updateMarker(space, existingMarker.storageHash, {\n\t\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\t\tprofileHash,\n\t\t\t\t\tinvariants: incomingInvariants\n\t\t\t\t})) {\n\t\t\t\t\tconst found = await markerOps.readMarker(space);\n\t\t\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\t\t\tdestinationStorageHash: destination.storageHash\n\t\t\t\t\t} });\n\t\t\t\t}\n\t\t\t} else await markerOps.initMarker(space, {\n\t\t\t\tstorageHash: destination.storageHash,\n\t\t\t\tprofileHash,\n\t\t\t\tinvariants: incomingInvariants\n\t\t\t});\n\t\t\twrote();\n\t\t\tawait this.recordLedgerEntries(markerOps, space, options);\n\t\t}\n\t\treturn ok({\n\t\t\toperationsPlanned: operations.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync recordLedgerEntries(markerOps, space, options) {\n\t\tconst plan = options.plan;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = plan.operations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait markerOps.writeLedgerEntry(space, {\n\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\tfrom: edge.from,\n\t\t\t\tto: edge.to,\n\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\toperations: edgeOps\n\t\t\t});\n\t\t}\n\t}\n\tasync executeDmlOperation(op, adapter, driver, filterEvaluator, runIdempotency, runPrechecks, runPostchecks, wrote) {\n\t\tif (runPostchecks && runIdempotency && op.postcheck.length > 0) {\n\t\t\tif (await this.evaluateDmlChecks(op.postcheck, adapter, driver, filterEvaluator)) return { executed: false };\n\t\t}\n\t\tif (runPrechecks && op.precheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.precheck, adapter, driver, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: renameOverwriteRefusal(op) ?? runnerFailure(\"MIGRATION.PRECHECK_FAILED\", `Operation ${op.id} failed during precheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\tfor (const plan of op.run) {\n\t\t\tconst wireCommand = await adapter.lower(plan, {});\n\t\t\ttry {\n\t\t\t\tlet reportedNoChange = false;\n\t\t\t\tlet reportedChange = false;\n\t\t\t\tfor await (const row of driver.execute(wireCommand)) if (reportsNoChangedDocuments(row)) reportedNoChange = true;\n\t\t\t\telse reportedChange = true;\n\t\t\t\tif (reportedChange || !reportedNoChange) wrote();\n\t\t\t} catch (error) {\n\t\t\t\tconst refusal = bypassValidationRefusal(op, plan, error);\n\t\t\t\tif (refusal === void 0) throw error;\n\t\t\t\treturn {\n\t\t\t\t\texecuted: false,\n\t\t\t\t\tfailure: refusal\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (runPostchecks && op.postcheck.length > 0) {\n\t\t\tif (!await this.evaluateDmlChecks(op.postcheck, adapter, driver, filterEvaluator)) return {\n\t\t\t\texecuted: false,\n\t\t\t\tfailure: runnerFailure(\"MIGRATION.POSTCHECK_FAILED\", `Operation ${op.id} failed during postcheck`, { meta: {\n\t\t\t\t\toperationId: op.id,\n\t\t\t\t\tname: op.name\n\t\t\t\t} })\n\t\t\t};\n\t\t}\n\t\treturn { executed: true };\n\t}\n\tasync evaluateDmlChecks(checks, adapter, driver, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst commandKind = check.source.command.kind;\n\t\t\tif (!READ_ONLY_CHECK_COMMAND_KINDS.has(commandKind)) throw mongoTargetError(\"MIGRATION.DATA_TRANSFORM_CHECK_NOT_READ_ONLY\", `Data-transform check rejected: command kind \"${commandKind}\" is not read-only`, {\n\t\t\t\twhy: \"Data-transform checks must use aggregate or rawAggregate commands so the pre/postcheck path cannot mutate the database.\",\n\t\t\t\tfix: \"Author the check.source as an aggregate pipeline (or rawAggregate) rather than a DML write command.\",\n\t\t\t\tmeta: {\n\t\t\t\t\tcheckDescription: check.description,\n\t\t\t\t\tcommandKind,\n\t\t\t\t\tcollection: check.source.collection\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst wireCommand = await adapter.lower(check.source, {});\n\t\t\tlet matchFound = false;\n\t\t\tfor await (const row of driver.execute(wireCommand)) if (filterEvaluator.evaluate(check.filter, row)) {\n\t\t\t\tmatchFound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tasync evaluateChecks(checks, inspectionExecutor, filterEvaluator) {\n\t\treturn await this.firstFailingCheck(checks, inspectionExecutor, filterEvaluator) === void 0;\n\t}\n\tasync firstFailingCheck(checks, inspectionExecutor, filterEvaluator) {\n\t\tfor (const check of checks) {\n\t\t\tconst matchFound = (await check.source.accept(inspectionExecutor)).some((doc) => filterEvaluator.evaluate(check.filter, doc));\n\t\t\tif (!(check.expect === \"exists\" ? matchFound : !matchFound)) return check;\n\t\t}\n\t}\n\tasync allChecksSatisfied(checks, inspectionExecutor, filterEvaluator) {\n\t\tif (checks.length === 0) return false;\n\t\treturn this.evaluateChecks(checks, inspectionExecutor, filterEvaluator);\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${[...allowedClasses].join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass\n\t\t\t}\n\t\t});\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return;\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t}\n};\n//#endregion\n//#region src/core/migrations/mongo-target-schema-verifier.ts\n/**\n* Mongo target `SchemaVerifier` concretion. Extends the family base's\n* namespace-walk scaffolding and contributes the per-namespace diff via\n* `verifyNamespace`; the diff body reuses the existing target-side\n* helpers (`contractToMongoSchemaIR`, `canonicalizeSchemasForVerification`,\n* `diffMongoSchemas`) so production verification behaviour is unchanged.\n*\n* Today's invariant: every Mongo contract carries exactly one\n* namespace (the unbound singleton, materialised as\n* `MongoTargetUnboundDatabase`), so the family-base namespace walk\n* dispatches exactly once and the per-namespace body runs the existing\n* whole-schema diff. Future per-collection namespace assignment will\n* have this hook project the diff to the namespace's owned collections.\n*\n* `verifyTargetExtensions` returns the empty list — Mongo has no\n* target-only kinds today.\n*\n* Strict diff mode is `false` for SPI-routed calls; production\n* verification today still goes through `verifyMongoSchema` which\n* receives strict from the CLI.\n*/\nvar MongoTargetSchemaVerifier = class extends MongoSchemaVerifierBase {\n\tverifyNamespace(options) {\n\t\tconst expectedIR = contractToMongoSchemaIR(options.contract);\n\t\tconst { live, expected } = canonicalizeSchemasForVerification(options.schema, expectedIR);\n\t\tconst collectionControlPolicy = (name) => this.collectionControlPolicyForName(options.contract, name);\n\t\tconst { failures, warnings } = diffMongoSchemas(live, expected, false, collectionControlPolicy);\n\t\treturn [...failures, ...warnings];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/migrations/scope-verify-result.ts\n/**\n* The bare entity names the given contracts declare, unioned. The Mongo runner\n* asks this of every OTHER contract space in a multi-space apply, so each\n* space's post-apply verify can drop the extras those siblings claim.\n*/\nfunction entityNamesDeclaredBy(contracts) {\n\tconst owned = /* @__PURE__ */ new Set();\n\tfor (const contract of contracts) for (const { entityName } of elementCoordinates(contract.storage)) owned.add(entityName);\n\treturn owned;\n}\n/**\n* True when an issue reports a whole collection present in the database but\n* declared by no contract (an extra) — its path is exactly the collection\n* name, never a deeper index/validator/options auxiliary.\n*/\nfunction extraCollectionName(issue) {\n\tif (issueOutcome(issue) !== \"not-expected\" || issue.path.length !== 1) return void 0;\n\treturn issue.path[0];\n}\n/**\n* Scope a per-space post-apply verify result to the contract space's own\n* elements: drop the `extra` findings for collections another contract space\n* claims. The runner verifies the destination contract against the full live\n* database, which holds sibling spaces' collections — without the scoping a\n* multi-space apply could never pass strict verify. Extras claimed by NO space\n* survive, so genuine drift still fails the runner's verdict.\n*\n* The result is issue-based, so the verdict recomputes directly from the\n* surviving list: `ok` holds exactly when it is empty.\n*/\nfunction scopeVerifyResultToSpace(result, ownedByOtherSpaces) {\n\tif (ownedByOtherSpaces.size === 0) return result;\n\tconst issues = result.schema.issues.filter((issue) => {\n\t\tconst name = extraCollectionName(issue);\n\t\treturn name === void 0 || !ownedByOtherSpaces.has(name);\n\t});\n\tif (issues.length === result.schema.issues.length) return result;\n\tconst ok = issues.length === 0;\n\tconst { code: staleCode, ...envelope } = result;\n\treturn {\n\t\t...envelope,\n\t\tok,\n\t\t...ok ? {} : { code: result.code ?? VERIFY_CODE_SCHEMA_FAILURE },\n\t\tsummary: ok ? \"Database schema satisfies contract\" : result.summary,\n\t\tschema: {\n\t\t\t...result.schema,\n\t\t\tissues\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/control-target.ts\n/**\n* `migration.ts` default-exports a `Migration` subclass whose `operations`\n* getter returns the ordered list of operations and whose `describe()`\n* returns the manifest identity metadata. `MongoMigrationPlanner.plan()`\n* returns a `MigrationPlanWithAuthoringSurface` that knows how to render\n* itself back to such a file; `MongoMigrationPlanner.emptyMigration()`\n* returns the same shape for `migration new`. Users run the scaffolded\n* `migration.ts` directly (via `node migration.ts`) to self-emit\n* `ops.json` and attest the `migrationHash`.\n*/\nconst mongoTargetDescriptor = {\n\t...mongoTargetDescriptorMeta,\n\tcontractSerializer: new MongoTargetContractSerializer(),\n\tschemaVerifier: new MongoTargetSchemaVerifier(),\n\tmigrations: {\n\t\tcreatePlanner(_adapter) {\n\t\t\treturn new MongoMigrationPlanner();\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\tlet cachedDeps;\n\t\t\tconst runMongo = async (driver, runnerOptions) => {\n\t\t\t\tcachedDeps ??= family.createRunnerDependencies({ driver });\n\t\t\t\treturn new MongoMigrationRunner(cachedDeps).execute({\n\t\t\t\t\t...runnerOptions,\n\t\t\t\t\tdestinationContract: blindCast(runnerOptions.destinationContract)\n\t\t\t\t});\n\t\t\t};\n\t\t\treturn { async execute({ driver, perSpaceOptions }) {\n\t\t\t\tconst contracts = perSpaceOptions.map((opts) => blindCast(opts.destinationContract));\n\t\t\t\tconst perSpaceResults = [];\n\t\t\t\tlet changedDatabase = false;\n\t\t\t\tfor (let i = 0; i < perSpaceOptions.length; i++) {\n\t\t\t\t\tconst spaceOptions = perSpaceOptions[i];\n\t\t\t\t\tif (!spaceOptions) continue;\n\t\t\t\t\tconst ownedByOtherSpaces = entityNamesDeclaredBy(contracts.filter((_, j) => j !== i));\n\t\t\t\t\tconst scopeVerifyResult = (result) => scopeVerifyResultToSpace(result, ownedByOtherSpaces);\n\t\t\t\t\tconst { space, ...runnerOptions } = spaceOptions;\n\t\t\t\t\tconst result = await runMongo(driver, {\n\t\t\t\t\t\t...runnerOptions,\n\t\t\t\t\t\tscopeVerifyResult,\n\t\t\t\t\t\tdatabaseChangedBefore: changedDatabase\n\t\t\t\t\t});\n\t\t\t\t\tif (!result.ok) return notOk(withFailingSpace(result.failure, space));\n\t\t\t\t\tconst { changedDatabase: spaceChanged, ...value } = result.value;\n\t\t\t\t\tchangedDatabase ||= spaceChanged;\n\t\t\t\t\tperSpaceResults.push({\n\t\t\t\t\t\tspace,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn ok({ perSpaceResults });\n\t\t\t} };\n\t\t},\n\t\tcontractToSchema(contract) {\n\t\t\treturn contractToMongoSchemaIR(blindCast(contract));\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\"\n\t\t};\n\t}\n};\n//#endregion\nexport { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };\n\n//#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