{"version":3,"file":"model-parser-DxRB8rya.cjs","sources":["../../../node_modules/lodash-es/_trimmedEndIndex.js","../../../node_modules/lodash-es/_baseTrim.js","../../../node_modules/lodash-es/toNumber.js","../../../node_modules/lodash-es/toFinite.js","../../../node_modules/lodash-es/toInteger.js","../../../node_modules/lodash-es/_baseCreate.js","../../../node_modules/lodash-es/_copyArray.js","../../../node_modules/lodash-es/_arrayEach.js","../../../node_modules/lodash-es/_baseAssignValue.js","../../../node_modules/lodash-es/_assignValue.js","../../../node_modules/lodash-es/_copyObject.js","../../../node_modules/lodash-es/_isIterateeCall.js","../../../node_modules/lodash-es/_createAssigner.js","../../../node_modules/lodash-es/_nativeKeysIn.js","../../../node_modules/lodash-es/_baseKeysIn.js","../../../node_modules/lodash-es/keysIn.js","../../../node_modules/lodash-es/_getPrototype.js","../../../node_modules/lodash-es/isPlainObject.js","../../../node_modules/lodash-es/_baseClamp.js","../../../node_modules/lodash-es/_cloneBuffer.js","../../../node_modules/lodash-es/_initCloneArray.js","../../../node_modules/lodash-es/_cloneArrayBuffer.js","../../../node_modules/lodash-es/_cloneDataView.js","../../../node_modules/lodash-es/_cloneRegExp.js","../../../node_modules/lodash-es/_cloneSymbol.js","../../../node_modules/lodash-es/_cloneTypedArray.js","../../../node_modules/lodash-es/_initCloneByTag.js","../../../node_modules/lodash-es/_initCloneObject.js","../../../node_modules/lodash-es/_baseIsMap.js","../../../node_modules/lodash-es/isMap.js","../../../node_modules/lodash-es/_baseIsSet.js","../../../node_modules/lodash-es/isSet.js","../../../node_modules/lodash-es/_baseClone.js","../../../node_modules/lodash-es/cloneDeep.js","../../../node_modules/lodash-es/_arrayAggregator.js","../../../node_modules/lodash-es/_baseAggregator.js","../../../node_modules/lodash-es/_createAggregator.js","../../../node_modules/lodash-es/_assignMergeValue.js","../../../node_modules/lodash-es/_safeGet.js","../../../node_modules/lodash-es/toPlainObject.js","../../../node_modules/lodash-es/_baseMergeDeep.js","../../../node_modules/lodash-es/_baseMerge.js","../../../node_modules/lodash-es/endsWith.js","../../../node_modules/lodash-es/groupBy.js","../../../node_modules/lodash-es/isString.js","../../../node_modules/lodash-es/_baseValues.js","../../../node_modules/lodash-es/values.js","../../../node_modules/lodash-es/includes.js","../../../node_modules/lodash-es/isBoolean.js","../../../node_modules/lodash-es/merge.js","../src/libs/model-parser/model/model.helper.ts","../src/libs/model-parser/key-property.helper.ts","../src/libs/quality/flatten-string.ts","../src/libs/model-parser/model/model.ts","../src/libs/quality/quality.controller.ts","../src/libs/model-parser/change-tracker.ts","../src/libs/model-parser/partial-update-metrics.ts","../src/libs/model-parser/reference-type-guards.ts","../src/libs/model-parser/model-parser.ts"],"sourcesContent":["/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n  var index = string.length;\n\n  while (index-- && reWhitespace.test(string.charAt(index))) {}\n  return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n  return string\n    ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n    : string;\n}\n\nexport default baseTrim;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = baseTrim(value);\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import toNumber from './toNumber.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n  value = toNumber(value);\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = (value < 0 ? -1 : 1);\n    return sign * MAX_INTEGER;\n  }\n  return value === value ? value : 0;\n}\n\nexport default toFinite;\n","import toFinite from './toFinite.js';\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n  var result = toFinite(value),\n      remainder = result % 1;\n\n  return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nexport default toInteger;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n  function object() {}\n  return function(proto) {\n    if (!isObject(proto)) {\n      return {};\n    }\n    if (objectCreate) {\n      return objectCreate(proto);\n    }\n    object.prototype = proto;\n    var result = new object;\n    object.prototype = undefined;\n    return result;\n  };\n}());\n\nexport default baseCreate;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\nexport default copyArray;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\nexport default arrayEach;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n  if (key == '__proto__' && defineProperty) {\n    defineProperty(object, key, {\n      'configurable': true,\n      'enumerable': true,\n      'value': value,\n      'writable': true\n    });\n  } else {\n    object[key] = value;\n  }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n  var isNew = !object;\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n\n    var newValue = customizer\n      ? customizer(object[key], source[key], key, object, source)\n      : undefined;\n\n    if (newValue === undefined) {\n      newValue = source[key];\n    }\n    if (isNew) {\n      baseAssignValue(object, key, newValue);\n    } else {\n      assignValue(object, key, newValue);\n    }\n  }\n  return object;\n}\n\nexport default copyObject;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n *  else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n  if (!isObject(object)) {\n    return false;\n  }\n  var type = typeof index;\n  if (type == 'number'\n        ? (isArrayLike(object) && isIndex(index, object.length))\n        : (type == 'string' && index in object)\n      ) {\n    return eq(object[index], value);\n  }\n  return false;\n}\n\nexport default isIterateeCall;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n  return baseRest(function(object, sources) {\n    var index = -1,\n        length = sources.length,\n        customizer = length > 1 ? sources[length - 1] : undefined,\n        guard = length > 2 ? sources[2] : undefined;\n\n    customizer = (assigner.length > 3 && typeof customizer == 'function')\n      ? (length--, customizer)\n      : undefined;\n\n    if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n      customizer = length < 3 ? undefined : customizer;\n      length = 1;\n    }\n    object = Object(object);\n    while (++index < length) {\n      var source = sources[index];\n      if (source) {\n        assigner(object, source, index, customizer);\n      }\n    }\n    return object;\n  });\n}\n\nexport default createAssigner;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n  var result = [];\n  if (object != null) {\n    for (var key in Object(object)) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n  if (!isObject(object)) {\n    return nativeKeysIn(object);\n  }\n  var isProto = isPrototype(object),\n      result = [];\n\n  for (var key in object) {\n    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n    return false;\n  }\n  var proto = getPrototype(value);\n  if (proto === null) {\n    return true;\n  }\n  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n  return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n    funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\nfunction baseClamp(number, lower, upper) {\n  if (number === number) {\n    if (upper !== undefined) {\n      number = number <= upper ? number : upper;\n    }\n    if (lower !== undefined) {\n      number = number >= lower ? number : lower;\n    }\n  }\n  return number;\n}\n\nexport default baseClamp;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of  `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n  if (isDeep) {\n    return buffer.slice();\n  }\n  var length = buffer.length,\n      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n  buffer.copy(result);\n  return result;\n}\n\nexport default cloneBuffer;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n  var length = array.length,\n      result = new array.constructor(length);\n\n  // Add properties assigned by `RegExp#exec`.\n  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n    result.index = array.index;\n    result.input = array.input;\n  }\n  return result;\n}\n\nexport default initCloneArray;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n  new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n  return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n  result.lastIndex = regexp.lastIndex;\n  return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n  var Ctor = object.constructor;\n  switch (tag) {\n    case arrayBufferTag:\n      return cloneArrayBuffer(object);\n\n    case boolTag:\n    case dateTag:\n      return new Ctor(+object);\n\n    case dataViewTag:\n      return cloneDataView(object, isDeep);\n\n    case float32Tag: case float64Tag:\n    case int8Tag: case int16Tag: case int32Tag:\n    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n      return cloneTypedArray(object, isDeep);\n\n    case mapTag:\n      return new Ctor;\n\n    case numberTag:\n    case stringTag:\n      return new Ctor(object);\n\n    case regexpTag:\n      return cloneRegExp(object);\n\n    case setTag:\n      return new Ctor;\n\n    case symbolTag:\n      return cloneSymbol(object);\n  }\n}\n\nexport default initCloneByTag;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n  return (typeof object.constructor == 'function' && !isPrototype(object))\n    ? baseCreate(getPrototype(object))\n    : {};\n}\n\nexport default initCloneObject;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n  return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n  return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Deep clone\n *  2 - Flatten inherited properties\n *  4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n  var result,\n      isDeep = bitmask & CLONE_DEEP_FLAG,\n      isFlat = bitmask & CLONE_FLAT_FLAG,\n      isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n  if (customizer) {\n    result = object ? customizer(value, key, object, stack) : customizer(value);\n  }\n  if (result !== undefined) {\n    return result;\n  }\n  if (!isObject(value)) {\n    return value;\n  }\n  var isArr = isArray(value);\n  if (isArr) {\n    result = initCloneArray(value);\n    if (!isDeep) {\n      return copyArray(value, result);\n    }\n  } else {\n    var tag = getTag(value),\n        isFunc = tag == funcTag || tag == genTag;\n\n    if (isBuffer(value)) {\n      return cloneBuffer(value, isDeep);\n    }\n    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n      result = (isFlat || isFunc) ? {} : initCloneObject(value);\n      if (!isDeep) {\n        return isFlat\n          ? copySymbolsIn(value, baseAssignIn(result, value))\n          : copySymbols(value, baseAssign(result, value));\n      }\n    } else {\n      if (!cloneableTags[tag]) {\n        return object ? value : {};\n      }\n      result = initCloneByTag(value, tag, isDeep);\n    }\n  }\n  // Check for circular references and return its corresponding clone.\n  stack || (stack = new Stack);\n  var stacked = stack.get(value);\n  if (stacked) {\n    return stacked;\n  }\n  stack.set(value, result);\n\n  if (isSet(value)) {\n    value.forEach(function(subValue) {\n      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n    });\n  } else if (isMap(value)) {\n    value.forEach(function(subValue, key) {\n      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n    });\n  }\n\n  var keysFunc = isFull\n    ? (isFlat ? getAllKeysIn : getAllKeys)\n    : (isFlat ? keysIn : keys);\n\n  var props = isArr ? undefined : keysFunc(value);\n  arrayEach(props || value, function(subValue, key) {\n    if (props) {\n      key = subValue;\n      subValue = value[key];\n    }\n    // Recursively populate clone (susceptible to call stack limits).\n    assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n  });\n  return result;\n}\n\nexport default baseClone;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n  return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    var value = array[index];\n    setter(accumulator, value, iteratee(value), array);\n  }\n  return accumulator;\n}\n\nexport default arrayAggregator;\n","import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n  baseEach(collection, function(value, key, collection) {\n    setter(accumulator, value, iteratee(value), collection);\n  });\n  return accumulator;\n}\n\nexport default baseAggregator;\n","import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n  return function(collection, iteratee) {\n    var func = isArray(collection) ? arrayAggregator : baseAggregator,\n        accumulator = initializer ? initializer() : {};\n\n    return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n  };\n}\n\nexport default createAggregator;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n  if ((value !== undefined && !eq(object[key], value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nexport default assignMergeValue;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n  if (key === 'constructor' && typeof object[key] === 'function') {\n    return;\n  }\n\n  if (key == '__proto__') {\n    return;\n  }\n\n  return object[key];\n}\n\nexport default safeGet;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n  return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n *  counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n  var objValue = safeGet(object, key),\n      srcValue = safeGet(source, key),\n      stacked = stack.get(srcValue);\n\n  if (stacked) {\n    assignMergeValue(object, key, stacked);\n    return;\n  }\n  var newValue = customizer\n    ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n    : undefined;\n\n  var isCommon = newValue === undefined;\n\n  if (isCommon) {\n    var isArr = isArray(srcValue),\n        isBuff = !isArr && isBuffer(srcValue),\n        isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n    newValue = srcValue;\n    if (isArr || isBuff || isTyped) {\n      if (isArray(objValue)) {\n        newValue = objValue;\n      }\n      else if (isArrayLikeObject(objValue)) {\n        newValue = copyArray(objValue);\n      }\n      else if (isBuff) {\n        isCommon = false;\n        newValue = cloneBuffer(srcValue, true);\n      }\n      else if (isTyped) {\n        isCommon = false;\n        newValue = cloneTypedArray(srcValue, true);\n      }\n      else {\n        newValue = [];\n      }\n    }\n    else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n      newValue = objValue;\n      if (isArguments(objValue)) {\n        newValue = toPlainObject(objValue);\n      }\n      else if (!isObject(objValue) || isFunction(objValue)) {\n        newValue = initCloneObject(srcValue);\n      }\n    }\n    else {\n      isCommon = false;\n    }\n  }\n  if (isCommon) {\n    // Recursively merge objects and arrays (susceptible to call stack limits).\n    stack.set(srcValue, newValue);\n    mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n    stack['delete'](srcValue);\n  }\n  assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n *  counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n  if (object === source) {\n    return;\n  }\n  baseFor(source, function(srcValue, key) {\n    stack || (stack = new Stack);\n    if (isObject(srcValue)) {\n      baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n    }\n    else {\n      var newValue = customizer\n        ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n        : undefined;\n\n      if (newValue === undefined) {\n        newValue = srcValue;\n      }\n      assignMergeValue(object, key, newValue);\n    }\n  }, keysIn);\n}\n\nexport default baseMerge;\n","import baseClamp from './_baseClamp.js';\nimport baseToString from './_baseToString.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n *  else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\nfunction endsWith(string, target, position) {\n  string = toString(string);\n  target = baseToString(target);\n\n  var length = string.length;\n  position = position === undefined\n    ? length\n    : baseClamp(toInteger(position), 0, length);\n\n  var end = position;\n  position -= target.length;\n  return position >= 0 && string.slice(position, end) == target;\n}\n\nexport default endsWith;\n","import baseAssignValue from './_baseAssignValue.js';\nimport createAggregator from './_createAggregator.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n  if (hasOwnProperty.call(result, key)) {\n    result[key].push(value);\n  } else {\n    baseAssignValue(result, key, [value]);\n  }\n});\n\nexport default groupBy;\n","import baseGetTag from './_baseGetTag.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n  return typeof value == 'string' ||\n    (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nexport default isString;\n","import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n  return arrayMap(props, function(key) {\n    return object[key];\n  });\n}\n\nexport default baseValues;\n","import baseValues from './_baseValues.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n  return object == null ? [] : baseValues(object, keys(object));\n}\n\nexport default values;\n","import baseIndexOf from './_baseIndexOf.js';\nimport isArrayLike from './isArrayLike.js';\nimport isString from './isString.js';\nimport toInteger from './toInteger.js';\nimport values from './values.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n  collection = isArrayLike(collection) ? collection : values(collection);\n  fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n  var length = collection.length;\n  if (fromIndex < 0) {\n    fromIndex = nativeMax(length + fromIndex, 0);\n  }\n  return isString(collection)\n    ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n    : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nexport default includes;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]';\n\n/**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\nfunction isBoolean(value) {\n  return value === true || value === false ||\n    (isObjectLike(value) && baseGetTag(value) == boolTag);\n}\n\nexport default isBoolean;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n *   'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n *   'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n  baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import {\n  Reference,\n  Property,\n  PropertyType,\n  ReferenceType,\n  DerivedReference,\n  ResolvedReference,\n  GroupedRefeference,\n  ModelDefinition,\n  QualityAnalyzer,\n  parseTemplate,\n} from '@dcupl/common';\nimport { DcuplModel } from './model';\n\nconst getModelError = (title: string, attribute: string, description: string): QualityAnalyzer.InternalModelError => {\n  return {\n    title: title,\n    type: 'model',\n    errorGroup: 'ModelDefinitionError',\n    errorType: 'InvalidModelDefinition',\n    attribute: attribute,\n    description: description,\n  };\n};\n\n/**\n * Validates a property\n */\nexport const isValidProperty = (property: Property): QualityAnalyzer.InternalModelError | undefined => {\n  const validDatatypes: PropertyType[] = [\n    'any',\n    'Array<date>',\n    'Array<float>',\n    'Array<int>',\n    'Array<string>',\n    'boolean',\n    'date',\n    'float',\n    'int',\n    'json',\n    'string',\n  ];\n\n  if (!property.key) {\n    return getModelError('Invalid Property', property.key, 'Property key is missing');\n  }\n\n  if (!property.type || validDatatypes.indexOf(property.type) === -1) {\n    return getModelError('Invalid Property', property.key, 'Property type is invalid');\n  }\n\n  if ('derive' in property) {\n    if (!property.derive?.localReference) {\n      return getModelError('Invalid Property', property.key, 'Derived Property localReference is missing');\n    }\n\n    if (!property.derive.remoteProperty) {\n      return getModelError('Invalid Property', property.key, 'Derived Property remoteProperty is missing');\n    }\n  }\n\n  if ('expression' in property) {\n    if (typeof property.expression !== 'string') {\n      return getModelError('Invalid Property', property.key, 'Expression is invalid');\n    }\n  }\n\n  return;\n};\n\n/**\n * Validates a reference\n */\nexport const isValidReference = (reference: Reference): QualityAnalyzer.InternalModelError | undefined => {\n  const validReferenceTypes: ReferenceType[] = ['multiValued', 'singleValued'];\n\n  if (!reference.key) {\n    return getModelError('Invalid Reference', reference.key, 'Reference key is missing');\n  }\n\n  if (!reference.type || validReferenceTypes.indexOf(reference.type) === -1) {\n    return getModelError('Invalid Reference', reference.key, 'Reference type is invalid');\n  }\n\n  if (!reference.model) {\n    return getModelError('Invalid Reference', reference.key, 'Reference model is missing');\n  }\n\n  if ('derive' in reference) {\n    if (!reference.derive.localReference) {\n      return getModelError('Invalid Reference', reference.key, 'Derived Reference localReference is missing');\n    }\n\n    if (!reference.derive.remoteReference) {\n      return getModelError('Invalid Reference', reference.key, 'Derived Reference remoteReference is missing');\n    }\n  }\n\n  if ('resolve' in reference) {\n    if (!reference.resolve.reference) {\n      return getModelError('Invalid Reference', reference.key, 'Resolved Reference reference is missing');\n    }\n\n    if (!reference.resolve.model) {\n      return getModelError('Invalid Reference', reference.key, 'Resolved Reference model is missing');\n    }\n  }\n\n  if ('groupBy' in reference) {\n    if (!reference.groupBy.reference) {\n      return getModelError('Invalid Reference', reference.key, 'Grouped Reference reference is missing');\n    }\n  }\n  return;\n};\n\nexport const validateBasicModelStructure = (model: ModelDefinition): boolean => {\n  if (typeof model.key !== 'string' || model.key.length === 0) {\n    throw new Error('Invalid Model: key must be a non-empty string');\n  }\n\n  if (typeof model.keyProperty !== 'undefined') {\n    const kp = model.keyProperty;\n    const isValidString = typeof kp === 'string' && kp.length > 0;\n    const isValidArray = Array.isArray(kp) && kp.length > 0 && kp.every((p) => typeof p === 'string' && p.length > 0);\n    if (!isValidString && !isValidArray) {\n      throw new Error(\n        'Invalid Model: keyProperty must be a non-empty string or a non-empty array of non-empty strings',\n      );\n    }\n  }\n\n  if (typeof model.keyPropertySeparator !== 'undefined') {\n    if (typeof model.keyPropertySeparator !== 'string' || model.keyPropertySeparator.length === 0) {\n      throw new Error('Invalid Model: keyPropertySeparator must be a non-empty string');\n    }\n  }\n\n  if (typeof model.autoGenerateKey !== 'undefined' && typeof model.autoGenerateKey !== 'boolean') {\n    throw new Error('Invalid Model: autoGenerateKey must be a boolean');\n  }\n\n  if (typeof model.autoGenerateProperties !== 'undefined') {\n    const v = model.autoGenerateProperties;\n    if (typeof v !== 'boolean') {\n      if (typeof v !== 'object' || v === null || Array.isArray(v)) {\n        throw new Error('Invalid Model: autoGenerateProperties must be a boolean or an options object');\n      }\n      if (typeof v.deep !== 'undefined' && typeof v.deep !== 'boolean') {\n        throw new Error('Invalid Model: autoGenerateProperties.deep must be a boolean');\n      }\n      if (typeof v.sampleSize !== 'undefined') {\n        if (typeof v.sampleSize !== 'number' || !Number.isFinite(v.sampleSize) || v.sampleSize < 1) {\n          throw new Error('Invalid Model: autoGenerateProperties.sampleSize must be a positive number');\n        }\n      }\n    }\n  }\n\n  if (model.properties && !Array.isArray(model.properties)) {\n    throw new Error('Invalid Model: properties must be an array');\n  }\n\n  if (model.references && !Array.isArray(model.references)) {\n    throw new Error('Invalid Model: references must be an array');\n  }\n\n  return true;\n};\n\nexport const validateModels = (\n  model: DcuplModel<any>,\n  allModels: Map<string, DcuplModel<any>>,\n): QualityAnalyzer.InternalModelError[] => {\n  const errors: QualityAnalyzer.InternalModelError[] = [];\n\n  model.references.forEach((ref) => {\n    if (!allModels.has(ref.model)) {\n      errors.push({\n        title: 'Missing Model',\n        type: 'model',\n        errorGroup: 'ModelDefinitionError',\n        errorType: 'MissingModel',\n        attribute: ref.key,\n        model: model.key,\n        description: `Referenced model ${ref.model} does not exist`,\n      });\n    }\n\n    if ('derive' in ref) {\n      errors.push(...validateDerivedReference(ref, model, allModels));\n    }\n\n    if ('resolve' in ref) {\n      errors.push(...validateResolvedReference(ref, model, allModels));\n    }\n\n    if ('groupBy' in ref) {\n      errors.push(...validateGroupedReference(ref, model));\n    }\n  });\n\n  model.properties.forEach((prop) => {\n    if ('derive' in prop) {\n      errors.push(...validateDerivedProperty(prop, model, allModels));\n    }\n\n    if ('expression' in prop) {\n      errors.push(...validateExpressionProperty(prop, model));\n    }\n  });\n\n  return errors;\n};\n\nconst validateDerivedReference = (\n  ref: DerivedReference,\n  model: DcuplModel,\n  allModels: Map<string, DcuplModel>,\n): QualityAnalyzer.InternalModelError[] => {\n  const errors: QualityAnalyzer.InternalModelError[] = [];\n  const localRef = model.references.get(ref.derive.localReference);\n\n  if (!localRef) {\n    errors.push({\n      title: 'Missing Reference',\n      type: 'model',\n      errorGroup: 'ModelDefinitionError',\n      errorType: 'MissingReference',\n      attribute: ref.key,\n      model: model.key,\n      description: `Local Referenced ${ref.derive.localReference} does not exist in model ${model.key}`,\n    });\n    return errors;\n  }\n\n  const remoteModel = allModels.get(localRef.model);\n\n  if (remoteModel) {\n    const remoteReferenece = remoteModel.references.get(ref.derive.remoteReference);\n\n    if (!remoteReferenece) {\n      errors.push({\n        title: 'Missing Reference',\n        type: 'model',\n        errorGroup: 'ModelDefinitionError',\n        errorType: 'MissingReference',\n        attribute: ref.key,\n        model: model.key,\n        description: `Remote Reference ${ref.derive.remoteReference} does not exist in model ${remoteModel.key}`,\n      });\n    }\n  }\n\n  return errors;\n};\n\nconst validateResolvedReference = (\n  ref: ResolvedReference,\n  model: DcuplModel,\n  allModels: Map<string, DcuplModel>,\n): QualityAnalyzer.InternalModelError[] => {\n  const errors: QualityAnalyzer.InternalModelError[] = [];\n\n  const remoteModel = allModels.get(ref.resolve.model);\n\n  if (!remoteModel) {\n    errors.push({\n      title: 'Missing Model',\n      type: 'model',\n      errorGroup: 'ModelDefinitionError',\n      errorType: 'MissingModel',\n      attribute: ref.key,\n      model: model.key,\n      description: `Referenced model ${ref.model} does not exist`,\n    });\n    return errors;\n  }\n\n  const remoteReferenece = remoteModel.references.get(ref.resolve.reference);\n\n  if (!remoteReferenece) {\n    errors.push({\n      title: 'Missing Reference',\n      type: 'model',\n      errorGroup: 'ModelDefinitionError',\n      errorType: 'MissingReference',\n      attribute: ref.key,\n      model: model.key,\n      description: `Resolved Reference ${ref.resolve.reference} does not exist in model ${remoteModel.key}`,\n    });\n  }\n\n  return errors;\n};\n\nconst validateGroupedReference = (ref: GroupedRefeference, model: DcuplModel): QualityAnalyzer.InternalModelError[] => {\n  const errors: QualityAnalyzer.InternalModelError[] = [];\n\n  const remoteReferenece = model.references.get(ref.groupBy.reference);\n\n  if (!remoteReferenece) {\n    errors.push({\n      title: 'Missing Reference',\n      type: 'model',\n      errorGroup: 'ModelDefinitionError',\n      errorType: 'MissingReference',\n      attribute: ref.key,\n      model: model.key,\n      description: `Resolved Reference ${ref.groupBy.reference} does not exist in model ${model.key}`,\n    });\n  }\n\n  return errors;\n};\n\nconst validateDerivedProperty = (\n  prop: Property,\n  model: DcuplModel,\n  allModels: Map<string, DcuplModel>,\n): QualityAnalyzer.InternalModelError[] => {\n  const errors: QualityAnalyzer.InternalModelError[] = [];\n  const localRef = model.references.get(prop.derive!.localReference);\n\n  if (!localRef) {\n    errors.push({\n      title: 'Missing Reference',\n      type: 'model',\n      errorGroup: 'ModelDefinitionError',\n      errorType: 'MissingReference',\n      attribute: prop.key,\n      model: model.key,\n      description: `Local Referenced ${prop.derive!.localReference} does not exist in model ${model.key}`,\n    });\n    return errors;\n  }\n\n  const remoteModel = allModels.get(localRef.model);\n\n  if (remoteModel) {\n    if (prop.derive!.remoteProperty === 'key') {\n      return errors;\n    }\n\n    const remoteProperty = remoteModel.properties.get(prop.derive!.remoteProperty);\n\n    if (!remoteProperty) {\n      errors.push({\n        title: 'Missing Property',\n        type: 'model',\n        errorGroup: 'ModelDefinitionError',\n        errorType: 'MissingProperty',\n        attribute: prop.key,\n        model: model.key,\n        description: `Remote Property ${prop.derive!.remoteProperty} does not exist in model ${remoteModel.key}`,\n      });\n    }\n  }\n\n  return errors;\n};\n\nconst validateExpressionProperty = (prop: Property, model: DcuplModel): QualityAnalyzer.InternalModelError[] => {\n  const errors: QualityAnalyzer.InternalModelError[] = [];\n\n  const template = parseTemplate(prop.expression!);\n  template.variables.forEach((templateVar) => {\n    if (templateVar.name === 'key' || templateVar.name.endsWith('.key')) {\n      return;\n    }\n    if (!model.properties.get(templateVar.name) && !model.references.get(templateVar.name)) {\n      errors.push({\n        title: 'Unknown Expression Variable',\n        type: 'model',\n        errorGroup: 'ModelDefinitionError',\n        errorType: 'UnknownExpressionVariable',\n        attribute: prop.key,\n        model: model.key,\n        description: `Expression Variable ${templateVar.name} not found in expression ${prop.key} in ${model.key}`,\n      });\n    }\n  });\n\n  return errors;\n};\n","import { RawItem } from '@dcupl/common';\n\n/**\n * Default separator joining composite `keyProperty` parts when no override is\n * supplied at the model, container, or resource level.\n */\nexport const DEFAULT_KEY_PROPERTY_SEPARATOR = '::';\n\n/**\n * Normalize a `keyProperty` spec to an array of property names.\n *\n * Returns `[]` for `undefined`. Single-string and single-element-array forms\n * both collapse to a one-element array — callers that want to short-circuit\n * the join can check `parts.length === 1`.\n */\nexport function getKeyParts(keyProperty: string | readonly string[] | undefined): readonly string[] {\n  if (typeof keyProperty === 'string') return [keyProperty];\n  if (Array.isArray(keyProperty)) return keyProperty;\n  return [];\n}\n\n/**\n * Extract the composite key string from `item` using `keyProperty`.\n *\n * - String form: returns `String(item[keyProperty])`.\n * - Single-element array: equivalent to the string form (no separator applied).\n * - Multi-element array: joins `String(item[p])` for each part with `separator`.\n *\n * Each part is stringified via `String(value)`, so `null` → `'null'`,\n * `undefined` → `'undefined'`, `''` stays `''` — preserving data distinctions.\n * Row ingest uses `extractRowKey`, which treats a row without any key value as\n * missing instead of keying it `'undefined'`.\n */\nexport function extractKey(\n  item: RawItem,\n  keyProperty: string | readonly string[],\n  separator: string = DEFAULT_KEY_PROPERTY_SEPARATOR,\n): string {\n  if (typeof keyProperty === 'string') {\n    return String(item[keyProperty]);\n  }\n  if (keyProperty.length === 1) {\n    return String(item[keyProperty[0] as string]);\n  }\n  return keyProperty.map((p) => String(item[p])).join(separator);\n}\n\n/**\n * Extract a row's key from its `keyProperty` value(s) for ingest.\n *\n * Same as `extractKey`, but returns `undefined` when the row has no key: the\n * single key property is `undefined` or `null`, or every part of a composite\n * key is. The model drops such a row and records `MissingKey`, as for a row\n * without the default `key` (#377). A composite key with only some parts\n * missing keeps them as `'undefined'`/`'null'` parts.\n */\nexport function extractRowKey(\n  item: RawItem,\n  keyProperty: string | readonly string[],\n  separator: string = DEFAULT_KEY_PROPERTY_SEPARATOR,\n): string | undefined {\n  const isMissing = (part: string): boolean => item[part] === undefined || item[part] === null;\n  if (getKeyParts(keyProperty).every(isMissing)) {\n    return undefined;\n  }\n  return extractKey(item, keyProperty, separator);\n}\n\n/**\n * Whether a row carries a key. A row whose `key` is `undefined` or `null`\n * cannot be identified: the model drops it and records `MissingKey`.\n */\nexport function hasRowKey(row: RawItem): boolean {\n  return row.key !== undefined && row.key !== null;\n}\n\n/**\n * Render a `keyProperty` spec as a single string suitable for the `attribute`\n * field of error reports.\n *\n * - String → returned as-is.\n * - Array → joined with `separator` (e.g. `'ID::Language'`).\n * - `undefined` → `undefined`.\n *\n * Keeps the error contract a string for backward compatibility while making\n * the offending composite obvious to callers reading the error.\n */\nexport function joinKeyProperty(\n  keyProperty: string | readonly string[] | undefined,\n  separator: string = DEFAULT_KEY_PROPERTY_SEPARATOR,\n): string | undefined {\n  if (keyProperty === undefined) return undefined;\n  if (typeof keyProperty === 'string') return keyProperty;\n  return keyProperty.join(separator);\n}\n","/**\n * Returns `text` as a flat string. A string built by concatenation (template literals,\n * `replace`) is a tree of concatenated-string nodes in V8 until something reads its\n * characters; kept as an error description, every node stays in the heap (#444).\n *\n * The JSON round trip builds a fresh, flat string in every engine. Reading one character\n * (`text.charCodeAt(0)`) flattens a V8 string in place too, but the optimizer drops a call\n * whose result is unused, so that only works some of the time.\n */\nexport function flattenString(text: string): string {\n  return JSON.parse(JSON.stringify(text)) as string;\n}\n","import {\n  DataContainer,\n  Reference,\n  ReferenceDataTypes,\n  AggregatedReference,\n  DerivedReference,\n  GroupedRefeference,\n  ResolvedReference,\n  InverseIndexValuesMap,\n  ListItem,\n  ModelDefinition,\n  Property,\n  PropertyAggregate,\n  PropertyDateInputFormat,\n  ValueMappingConfig,\n  PropertyFloat,\n  PropertyDate,\n  PropertyJson,\n  PropertyInt,\n  ModelMetadata,\n  PropertyBoolean,\n  IndicesController,\n  resolveCacheMaxSize,\n  ChangeDetector,\n  getPropertiesForData,\n  parseBooleanString,\n  AutoGeneratePropertiesOption,\n  generateKey,\n  QualityAnalyzer,\n  PropertyString,\n  ModelQualityConfig,\n  isValidDate,\n  parseDate,\n  AttributeQualityConfig,\n  ModelAttribute,\n  isInt,\n  isFloat,\n  ValidatorErrorType,\n  evaluateTemplate,\n  QueryReference,\n  DcuplQueryBuilder,\n  PropertyStringArray,\n  PropertyIntArray,\n  PropertyDateArray,\n  PropertyFloatArray,\n  logger,\n  yieldToEventLoop,\n} from '@dcupl/common';\n\nimport { ModelParser } from '../';\nimport { isValidReference, isValidProperty } from './model.helper';\nimport { DEFAULT_KEY_PROPERTY_SEPARATOR, extractKey, getKeyParts, joinKeyProperty } from '../key-property.helper';\nimport { isBoolean, isObjectLike, isString, merge } from 'lodash-es';\nimport { flattenString } from '../../quality/flatten-string';\n\nexport const EntryMetadataValues = {\n  REF_VALUE: '_dcupl_ref_',\n};\n\ntype REF_VALUE = 'hit' | 'miss' | 'auto_hit';\n\ntype ResolvedReferenceObject<T extends ListItem = ListItem> = {\n  reference: ResolvedReference;\n  model: DcuplModel;\n  remoteData: T[];\n  inverseKeys?: InverseIndexValuesMap;\n};\n\nconst defaultAttributeQualityConfig: AttributeQualityConfig = {\n  required: true,\n  forceStrictDataType: false,\n  nullable: false,\n  validatorHandling: 'loose',\n};\n\nconst defaultQualityConfig: ModelQualityConfig = {\n  enabled: true,\n  attributes: defaultAttributeQualityConfig,\n};\n\nexport type ValidatorReturnValue = {\n  isValid: boolean;\n  type: ValidatorErrorType;\n};\n\n// Helper function to cast to writable entry (avoids TS2862 error with generic types)\nfunction asWritable<T extends ListItem>(entry: T): Record<string, unknown> {\n  return entry as unknown as Record<string, unknown>;\n}\n\nexport class DcuplModel<ListType extends ListItem = ListItem> {\n  public properties: Map<string, Property> = new Map();\n  public references: Map<string, Reference> = new Map();\n  public attributeQualityConfigs: Map<string, AttributeQualityConfig> = new Map();\n  public key!: string;\n  private log = logger.child({ prefix: 'Model' });\n  public initialDefinition!: ModelDefinition;\n\n  private data: Map<string, ListType> = new Map();\n  public supportsAutoCreation = false;\n  public autoGenerateKey = false;\n  public autoGenerateProperties = false;\n  public autoGeneratePropertiesOption: AutoGeneratePropertiesOption = false;\n  public keyProperty: string | readonly string[] = 'key';\n  public keyPropertySeparator?: string;\n  public valueMappings: ValueMappingConfig[] = [];\n  public meta?: ModelMetadata | undefined;\n  public qualityConfig: ModelQualityConfig = defaultQualityConfig;\n\n  public indicesController = new IndicesController();\n  public cdRef!: ChangeDetector;\n\n  // #120 Performance optimization: Reverse index for grouped references\n  // Maps reference key -> value -> Set of item keys that have that value\n  // Enables O(1) lookup instead of O(n·v²) nested loops\n  private groupedRefReverseIndex: Map<string, Map<string, Set<string>>> = new Map();\n\n  // #411: the keys of every row the running step-1 pass stores. A reference\n  // within this model resolves against them, not only against the rows stored\n  // so far: a later row, the row itself or a cycle exists as well.\n  private pendingItemKeys: Set<string> | undefined;\n\n  constructor(private modelParser: ModelParser) {\n    this.cdRef = modelParser.cdRef;\n    // performance.cache.maxSize bounds the indices this model builds for queries and sections (#361)\n    this.indicesController.maxContextIndexSize = resolveCacheMaxSize(modelParser.initOptions?.performance?.cache);\n  }\n\n  public init(modelDefinition: ModelDefinition): void {\n    this.key = modelDefinition.key;\n    this.initialDefinition = modelDefinition;\n    if (modelDefinition.quality) {\n      this.qualityConfig = merge({}, defaultQualityConfig, modelDefinition.quality);\n    }\n  }\n\n  /**\n   * Drops what the previous definition set (attributes and their quality configs, the model's\n   * quality config), so `init` + `applyPropertiesAndReferences` build the model from a replaced\n   * definition as for a new model, while lists keep this instance (#408).\n   */\n  public resetDefinition(): void {\n    this.properties.clear();\n    this.references.clear();\n    this.attributeQualityConfigs.clear();\n    this.qualityConfig = defaultQualityConfig;\n  }\n\n  public applyPropertiesAndReferences(modelDefinition: ModelDefinition): void {\n    // Track keys declared within THIS definition so a duplicate is reported\n    // rather than silently overwriting. (Checking this.properties directly would\n    // false-positive on model re-registration, where the map is not reset.)\n    const seenPropertyKeys = new Set<string>();\n    modelDefinition.properties?.map((prop) => {\n      const error = isValidProperty(prop);\n      if (!error) {\n        if (seenPropertyKeys.has(prop.key)) {\n          this.setDefinitionError({\n            title: 'Duplicate Property Key',\n            type: 'model',\n            errorGroup: 'ModelDefinitionError',\n            errorType: 'DuplicatePropertyKey',\n            description: `Model \"${this.key}\" declares property \"${prop.key}\" more than once; the first definition is kept and the duplicate is ignored.`,\n            attribute: prop.key,\n            model: this.key,\n          });\n          return;\n        }\n        seenPropertyKeys.add(prop.key);\n        this.setAttributeQualityConfig(prop);\n        this.properties.set(prop.key, prop);\n      } else {\n        error.model = this.key;\n        this.setDefinitionError(error);\n      }\n    });\n    modelDefinition.references?.map((reference) => {\n      const error = isValidReference(reference);\n      if (!error) {\n        reference.validity = reference.validity || 'loose';\n        this.setAttributeQualityConfig(reference);\n        this.references.set(reference.key, reference);\n      } else {\n        error.model = this.key;\n        this.setDefinitionError(error);\n      }\n    });\n\n    // set model defaults\n    this.supportsAutoCreation = !!modelDefinition.supportsAutoCreation;\n    this.keyProperty = modelDefinition.keyProperty || 'key';\n    this.keyPropertySeparator = modelDefinition.keyPropertySeparator;\n    this.autoGenerateKey = !!modelDefinition.autoGenerateKey;\n    this.autoGenerateProperties = !!modelDefinition.autoGenerateProperties;\n    this.autoGeneratePropertiesOption = modelDefinition.autoGenerateProperties ?? false;\n    this.valueMappings = modelDefinition.valueMappings || [];\n    this.meta = modelDefinition.meta;\n  }\n\n  private setAttributeQualityConfig(attribute: ModelAttribute): void {\n    const typeQualityConfig = this.qualityConfig.attributes;\n\n    const qualityConfig: AttributeQualityConfig = merge(\n      {},\n      defaultAttributeQualityConfig,\n      typeQualityConfig,\n      attribute.quality,\n    );\n\n    this.attributeQualityConfigs.set(attribute.key, qualityConfig);\n  }\n\n  public getModelDefinition(): ModelDefinition {\n    if (this.autoGenerateProperties) {\n      const modelDef: ModelDefinition = {\n        key: this.key,\n        keyProperty: this.keyProperty,\n        keyPropertySeparator: this.keyPropertySeparator,\n        references: Array.from(this.references.values()),\n        properties: Array.from(this.properties.values()),\n        autoGenerateKey: this.autoGenerateKey,\n        supportsAutoCreation: this.supportsAutoCreation,\n        valueMappings: this.valueMappings,\n        meta: this.meta,\n        autoGenerateProperties: this.autoGeneratePropertiesOption,\n        quality: this.qualityConfig,\n      };\n      return modelDef;\n    } else {\n      return this.initialDefinition;\n    }\n  }\n\n  public generatePropertiesFromContainer(container: DataContainer): void {\n    const opt = this.autoGeneratePropertiesOption;\n    let properties: Property[];\n    if (typeof opt === 'object' && opt !== null) {\n      properties = getPropertiesForData(container.data, opt);\n    } else {\n      // `true`: the first row names the properties. Only when it names one the model does not\n      // have yet does the default scan run, which checks number columns against every row (#503);\n      // an update that adds no attribute costs the first row, as before.\n      const firstRow = getPropertiesForData(container.data, false);\n      if (firstRow.every((property) => property.key === 'key' || this.properties.has(property.key))) {\n        return;\n      }\n      properties = getPropertiesForData(container.data);\n    }\n    properties.map((property) => {\n      if (!this.properties.has(property.key)) {\n        // The internal 'key' field is always the item's identity string — skip it\n        // regardless of what keyProperty is named, since handleAlternativeKey always\n        // copies the keyProperty value into item.key as a string before inference runs.\n        if (property.key === 'key') {\n          return;\n        }\n\n        // The keyProperty is the item's identity — keys are strings, so never let\n        // string-aware inference coerce it to a numeric/date/boolean type.\n        // Fall back to the model's own keyProperty when the container doesn't carry it\n        // (e.g. after mergeContainers strips it).\n        const effectiveKeyProperty = container.keyProperty ?? this.keyProperty;\n        const keyParts = getKeyParts(effectiveKeyProperty);\n        if (keyParts.some((p) => p && p !== 'key' && p === property.key)) {\n          property.type = 'string';\n        }\n\n        property.filter = true;\n\n        this.properties.set(property.key, property);\n      }\n    });\n  }\n\n  private getReferenceKeys(referenceValue: string[] | ListType[]): string[] {\n    return referenceValue.map((value) => {\n      if (typeof value === 'string') {\n        return String(value.trim());\n      } else if (typeof value === 'number') {\n        return String(value);\n      } else if (value === null) {\n        return 'null';\n      } else if (typeof value === 'object' && !!value && value.key) {\n        return value.key;\n      }\n      return undefined;\n    }) as string[];\n  }\n\n  /** A definition error init re-detects on every run (#417); same gate as `setError`. */\n  private setDefinitionError(error: QualityAnalyzer.InternalModelError): void {\n    if (this.modelParser.qualityController.enabled && this.qualityConfig.enabled === true) {\n      error.model = this.key;\n      this.modelParser.qualityController.setDefinitionError(error);\n    }\n  }\n\n  // Descriptions of the errors whose text does not depend on the row, one flat string per text,\n  // shared by every record of the group: built per row, each record held its own\n  // concatenated-string tree (#444). The key holds every input of the text.\n  private sharedErrorDescriptions: Map<string, string> = new Map();\n\n  private sharedErrorDescription(cacheKey: string, build: () => string): string {\n    let description = this.sharedErrorDescriptions.get(cacheKey);\n    if (description === undefined) {\n      description = flattenString(build());\n      this.sharedErrorDescriptions.set(cacheKey, description);\n    }\n    return description;\n  }\n\n  /**\n   * Sets a validation error for this model.\n   * Requires both global quality controller AND model-specific quality to be enabled.\n   */\n  private setError(error: QualityAnalyzer.InternalModelError): void {\n    if (this.modelParser.qualityController.enabled) {\n      if (this.qualityConfig.enabled === true) {\n        error.model = this.key;\n        this.modelParser.qualityController.setError(error);\n      }\n    }\n  }\n\n  /**\n   * Emit one `UnknownColumn` error per (model, attribute) for columns in the\n   * source that are NOT declared on the model. The data for those columns is\n   * silently dropped during ingest — this surfaces that data loss without\n   * failing the load. See dcupl#183.\n   */\n  private emitUnknownColumnErrors(\n    container: DataContainer<ListType>,\n    sourceColumns: string[],\n    properties: Property[],\n    references: Reference[],\n    origin: string,\n  ): void {\n    const declared = new Set<string>();\n    for (const p of properties) declared.add(p.key);\n    for (const r of references) declared.add(r.key);\n    // The key attribute is always declared, whether or not it appears in\n    // `properties` (composite keys are joined separately).\n    const effectiveKeyProperty = container.keyProperty ?? this.keyProperty;\n    if (typeof effectiveKeyProperty === 'string') {\n      declared.add(effectiveKeyProperty);\n    } else if (Array.isArray(effectiveKeyProperty)) {\n      for (const part of effectiveKeyProperty) declared.add(part);\n    }\n    // 'key' is the default name and is always a valid column even when the\n    // model uses a custom keyProperty.\n    declared.add('key');\n\n    for (const column of sourceColumns) {\n      if (declared.has(column)) continue;\n      this.setError({\n        title: 'Unknown Column',\n        type: 'model',\n        errorGroup: 'DataContainerError',\n        errorType: 'UnknownColumn',\n        description: `Column \"${column}\" in the source for model \"${container.model}\" is not declared on the model; its values are dropped during ingest`,\n        attribute: column,\n        model: container.model,\n        meta: {\n          column,\n          origin,\n        },\n      });\n    }\n  }\n\n  /**\n   * Coerces and validates one basic property of a raw row and stores it on\n   * `dataEntry`. Returns whether a value was stored — `false` when the raw\n   * value is missing or the coercion or a strict validator rejects it.\n   */\n  private processBasicProperty(\n    property: Property,\n    rawDataEntry: ListType,\n    dataEntry: ListType,\n    origin: string = 'inline',\n  ): boolean {\n    const rawValue = rawDataEntry[property.key];\n    const qualityConfig = this.attributeQualityConfigs.get(property.key);\n    let value;\n    if (typeof rawValue === 'undefined') {\n      // todo - check if property can be undefined\n      if (qualityConfig?.required) {\n        const declaredType = (property as { type?: string }).type;\n        this.setError({\n          title: 'Undefined Value',\n          type: 'model',\n          errorGroup: 'PropertyDataError',\n          errorType: 'UndefinedValue',\n          description: this.sharedErrorDescription(\n            ['UndefinedValue', 'property', property.key, declaredType ?? '', this.key].join('\\u0000'),\n            () =>\n              `The required ${declaredType ?? ''} property \"${property.key}\" in the \"${this.key}\" model is undefined (no value)`.replace(\n                /\\s+/g,\n                ' ',\n              ),\n          ),\n          itemKey: rawDataEntry.key,\n          attribute: property.key,\n          model: this.key,\n          meta: {\n            rawValue: rawValue,\n            declaredType: declaredType,\n            origin: origin,\n          },\n        });\n      }\n      return false;\n    } else {\n      if (rawValue === null) {\n        if (!qualityConfig?.nullable) {\n          this.setError({\n            title: 'Null Value',\n            description: this.sharedErrorDescription(\n              ['NullValue', 'property', property.key, this.key].join('\\u0000'),\n              () => `The value of the property \"${property.key}\" in the \"${this.key}\" model should not be null`,\n            ),\n            type: 'model',\n            errorGroup: 'PropertyDataError',\n            errorType: 'NullValue',\n            itemKey: rawDataEntry.key,\n            attribute: property.key,\n            model: this.key,\n          });\n        }\n        value = rawValue;\n      } else if (property.type === 'string') {\n        value = this.processStringProperty(property, rawValue, rawDataEntry);\n        if (typeof value === 'undefined') {\n          return false;\n        }\n      } else if (property.type === 'int') {\n        value = this.processIntProperty(property, rawValue, rawDataEntry);\n        if (typeof value === 'undefined') {\n          return false;\n        }\n      } else if (property.type === 'float') {\n        value = this.processFloatProperty(property, rawValue, rawDataEntry);\n        if (typeof value === 'undefined') {\n          return false;\n        }\n      } else if (property.type === 'date') {\n        value = this.processDateProperty(property, rawValue, rawDataEntry);\n        if (typeof value === 'undefined') {\n          return false;\n        }\n      } else if (property.type === 'json') {\n        value = this.processJSONProperty(property, rawValue, rawDataEntry);\n        if (typeof value === 'undefined') {\n          return false;\n        }\n      } else if (property.type === 'boolean') {\n        value = this.processBooleanProperty(property, rawValue, rawDataEntry);\n        if (typeof value === 'undefined') {\n          return false;\n        }\n      } else if (property.type === 'any') {\n        value = rawValue;\n      } else if (property.type === 'Array<string>') {\n        const arrayValue = this.getValueAsArray(rawValue, property?.separator);\n        if (Array.isArray(arrayValue)) {\n          value = [];\n          arrayValue.forEach((val) => {\n            const stringValue = this.processStringProperty(property, val, rawDataEntry);\n            if (typeof stringValue !== 'undefined') {\n              value.push(stringValue);\n            }\n          });\n        }\n      } else if (property.type === 'Array<int>') {\n        const arrayValue = this.getValueAsArray(rawValue, property?.separator);\n        if (Array.isArray(arrayValue)) {\n          value = [];\n          arrayValue.forEach((val) => {\n            const intValue = this.processIntProperty(property, val, rawDataEntry);\n            if (typeof intValue !== 'undefined') {\n              value.push(intValue);\n            }\n          });\n        }\n      } else if (property.type === 'Array<float>') {\n        const arrayValue = this.getValueAsArray(rawValue, property?.separator);\n        if (Array.isArray(arrayValue)) {\n          value = [];\n          arrayValue.forEach((val) => {\n            const floatValue = this.processFloatProperty(property, val, rawDataEntry);\n            if (typeof floatValue !== 'undefined') {\n              value.push(floatValue);\n            }\n          });\n        }\n      } else if (property.type === 'Array<date>') {\n        const arrayValue = this.getValueAsArray(rawValue, property?.separator);\n        if (Array.isArray(arrayValue)) {\n          value = [];\n          arrayValue.forEach((val) => {\n            const dateValue = this.processDateProperty(property, val, rawDataEntry);\n            if (typeof dateValue !== 'undefined') {\n              value.push(dateValue);\n            }\n          });\n        }\n      }\n\n      asWritable(dataEntry)[property.key] = value;\n    }\n    if (property.index) {\n      this.indicesController.fillInverseIndex(property.key, dataEntry.key, [value]);\n      this.indicesController.fillDataMap(property.key, [value]);\n    }\n    return true;\n  }\n\n  private handleValidators(value: any, property: Property, rawDataEntry: ListItem): boolean {\n    // Skip validation if quality controller is disabled globally or for this model\n    if (!this.modelParser.qualityController.enabled || this.qualityConfig.enabled !== true) {\n      return true;\n    }\n\n    let isValid = true;\n    try {\n      if (property.quality?.validators) {\n        const validationErrors = this.modelParser.qualityController.validateAttribute(\n          value,\n          property.quality.validators!,\n          property.key,\n        );\n        for (const validationError of validationErrors) {\n          isValid = false;\n          validationError.attribute = property.key;\n          validationError.itemKey = rawDataEntry.key;\n          validationError.model = this.key;\n          this.setError(validationError);\n        }\n      }\n    } catch (err) {\n      this.log.error('Validator definition error', err as Error);\n    }\n    return isValid;\n  }\n\n  private getWrongDataTypeError(\n    property: Property,\n    rawValue: any,\n    rawDataEntry: ListItem,\n  ): QualityAnalyzer.InternalModelError {\n    const error: QualityAnalyzer.InternalModelError = {\n      title: 'Wrong Data Type',\n      type: 'model',\n      errorGroup: 'PropertyDataError',\n      errorType: 'WrongDataType',\n      itemKey: rawDataEntry.key,\n      attribute: property.key,\n      model: this.key,\n      description: `Expect ${property.type} but got ${typeof rawValue} with value ${rawValue}`,\n      meta: {\n        expected: property.type,\n        rawValue: rawValue,\n        typeof: typeof rawValue,\n      },\n    };\n    return error;\n  }\n\n  /**\n   * Detects a lossy numeric coercion: the raw value was successfully coerced to a\n   * number, but information was silently dropped — either trailing/embedded\n   * non-numeric content (e.g. \"1.2 lbs\" → 1.2) or fractional truncation for int\n   * properties (e.g. \"1.2\" → 1). Representation-only differences that preserve the\n   * value (leading zeros, trailing zeros, surrounding whitespace, \"4.0\" → 4) are\n   * not considered lossy.\n   */\n  private isLossyNumericCoercion(rawValue: any, coercedValue: number, isInt: boolean): boolean {\n    const numericFull = typeof rawValue === 'string' ? Number(rawValue.trim()) : Number(rawValue);\n    if (isNaN(numericFull)) {\n      // The full string is not a clean number — junk was dropped during coercion.\n      return true;\n    }\n    // For int properties, a fractional source value loses its decimal part.\n    return isInt ? numericFull !== coercedValue : false;\n  }\n\n  private getLossyCoercionError(\n    property: Property,\n    rawValue: any,\n    coercedValue: number,\n    rawDataEntry: ListItem,\n  ): QualityAnalyzer.InternalModelError {\n    return {\n      title: 'Lossy Data Coercion',\n      type: 'model',\n      errorGroup: 'PropertyDataError',\n      errorType: 'WrongDataType',\n      itemKey: rawDataEntry.key,\n      attribute: property.key,\n      model: this.key,\n      description: `Lossy coercion to ${property.type}: raw value \"${rawValue}\" was coerced to ${coercedValue}`,\n      meta: {\n        expected: property.type,\n        rawValue: rawValue,\n        coercedValue: coercedValue,\n        typeof: typeof rawValue,\n        lossy: true,\n      },\n    };\n  }\n\n  private getValueAsArray(value: string | string[] | any, separator = ','): any[] | undefined {\n    if (!value) {\n      return undefined;\n    }\n    if (Array.isArray(value)) {\n      return value;\n    }\n    if (value && typeof value === 'string') {\n      return value.split(separator).map((val) => val.trim());\n    }\n    return [];\n  }\n\n  private processStringProperty(\n    property: PropertyString | PropertyStringArray,\n    rawValue: any,\n    rawDataEntry: ListItem,\n  ): string | undefined {\n    const qualityConfig = this.attributeQualityConfigs.get(property.key);\n\n    let relevantValue = rawValue;\n    if (qualityConfig?.forceStrictDataType) {\n      if (!isString(rawValue)) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n    } else {\n      relevantValue = String(rawValue);\n      if (!isString(relevantValue) && relevantValue != rawValue) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n    }\n\n    if (!this.handleValidators(relevantValue, property, rawDataEntry)) {\n      if (qualityConfig?.validatorHandling !== 'loose') {\n        return;\n      }\n    }\n\n    return relevantValue;\n  }\n\n  private processIntProperty(\n    property: PropertyInt | PropertyIntArray,\n    rawValue: any,\n    rawDataEntry: ListItem,\n  ): number | undefined {\n    const qualityConfig = this.attributeQualityConfigs.get(property.key);\n    if (qualityConfig?.forceStrictDataType) {\n      if (!isInt(rawValue)) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n      return rawValue;\n    }\n\n    const value = parseInt(rawValue, 10);\n    if (isNaN(value)) {\n      this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      return;\n    }\n\n    if (this.isLossyNumericCoercion(rawValue, value, true)) {\n      this.setError(this.getLossyCoercionError(property, rawValue, value, rawDataEntry));\n    }\n\n    if (!this.handleValidators(value, property, rawDataEntry)) {\n      if (qualityConfig?.validatorHandling !== 'loose') {\n        return;\n      }\n    }\n\n    return value;\n  }\n\n  private processFloatProperty(\n    property: PropertyFloat | PropertyFloatArray,\n    rawValue: any,\n    rawDataEntry: ListItem,\n  ): number | undefined {\n    const qualityConfig = this.attributeQualityConfigs.get(property.key);\n    if (qualityConfig?.forceStrictDataType) {\n      if (!isFloat(rawValue)) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n      return rawValue;\n    }\n\n    let value: number;\n    const fractionDigits = property.fractionDigits;\n\n    if (typeof fractionDigits === 'undefined') {\n      value = parseFloat(rawValue);\n    } else {\n      value = parseFloat(parseFloat(rawValue).toFixed(fractionDigits));\n    }\n    if (isNaN(value)) {\n      this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      return;\n    }\n\n    if (this.isLossyNumericCoercion(rawValue, value, false)) {\n      this.setError(this.getLossyCoercionError(property, rawValue, value, rawDataEntry));\n    }\n\n    if (!this.handleValidators(value, property, rawDataEntry)) {\n      if (qualityConfig?.validatorHandling !== 'loose') {\n        return;\n      }\n    }\n\n    return value;\n  }\n\n  private processJSONProperty(property: PropertyJson, rawValue: any, rawDataEntry: ListItem): any | undefined {\n    const qualityConfig = this.attributeQualityConfigs.get(property.key);\n    if (qualityConfig?.forceStrictDataType) {\n      if (!isObjectLike(rawValue)) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n      return rawValue;\n    }\n\n    if (isObjectLike(rawValue)) {\n      return rawValue;\n    }\n    if (!isObjectLike(rawValue) && typeof rawValue === 'string') {\n      try {\n        return JSON.parse(rawValue);\n      } catch (_err) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n    }\n\n    return;\n  }\n\n  /**\n   * A boolean is kept as is. A string follows {@link parseBooleanString}: 'true'/'false'/'1'/'0'\n   * (case-insensitive) become booleans, any other string is a WrongDataType and the value stays\n   * undefined (#364). Numbers are strict too: 1 and 0 become true and false, any other number is a\n   * WrongDataType. Any other value, such as an object or an array, is a WrongDataType as well (#402).\n   * With `forceStrictDataType` only real booleans pass.\n   */\n  private processBooleanProperty(\n    property: PropertyBoolean,\n    rawValue: any,\n    rawDataEntry: ListItem,\n  ): boolean | undefined {\n    const qualityConfig = this.attributeQualityConfigs.get(property.key);\n    if (qualityConfig?.forceStrictDataType) {\n      if (!isBoolean(rawValue)) {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n        return;\n      }\n      return rawValue;\n    }\n\n    if (typeof rawValue === 'string') {\n      const value = parseBooleanString(rawValue);\n      if (typeof value === 'undefined') {\n        this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      }\n      return value;\n    }\n\n    if (typeof rawValue === 'number') {\n      if (rawValue === 1 || rawValue === 0) {\n        return rawValue === 1;\n      }\n      this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      return;\n    }\n\n    if (typeof rawValue === 'boolean') {\n      return rawValue;\n    }\n\n    // An object or an array is not a boolean either (#402)\n    this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n    return;\n  }\n\n  private processDateProperty(\n    property: PropertyDate | PropertyDateArray,\n    rawValue: any,\n    rawDataEntry: ListItem,\n  ): Date | undefined {\n    // forceStrictDataType is not supported / makes no sense for date\n\n    if (rawValue === '') {\n      this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      return;\n    }\n\n    const inputFormat: PropertyDateInputFormat | undefined = property.inputFormat;\n\n    let date: Date;\n\n    try {\n      if (inputFormat && typeof inputFormat === 'string') {\n        let relevantValue = rawValue;\n        if (typeof relevantValue !== 'string') {\n          relevantValue = String(relevantValue);\n        }\n        date = parseDate(relevantValue, inputFormat, new Date());\n      } else {\n        date = new Date(rawValue);\n      }\n    } catch (err) {\n      this.log.error('Property extraction error', err as Error, { property: property.key, model: this.key });\n\n      this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      return;\n    }\n\n    if (!isValidDate(date)) {\n      this.setError(this.getWrongDataTypeError(property, rawValue, rawDataEntry));\n      return;\n    }\n\n    if (property.UTC) {\n      date = new Date(\n        Date.UTC(\n          date.getFullYear(),\n          date.getMonth(),\n          date.getDate(),\n          date.getHours(),\n          date.getMinutes(),\n          date.getSeconds(),\n          date.getMilliseconds(),\n        ),\n      );\n    }\n\n    return date;\n  }\n\n  /** The NullValue error of a non-nullable reference with an explicit null, as for a property (#215). */\n  private getNullReferenceError(\n    reference: Reference,\n    rawDataEntry: ListItem,\n    model: string,\n  ): QualityAnalyzer.InternalModelError {\n    return {\n      title: 'Null Value',\n      type: 'model',\n      errorGroup: 'ReferenceDataError',\n      errorType: 'NullValue',\n      description: this.sharedErrorDescription(\n        ['NullValue', 'reference', reference.key, this.key].join('\\u0000'),\n        () => `The value of the reference \"${reference.key}\" in the \"${this.key}\" model should not be null`,\n      ),\n      itemKey: rawDataEntry.key,\n      attribute: reference.key,\n      model,\n    };\n  }\n\n  private processSingleValuedReference(\n    reference: Reference,\n    referenceValue: string | ListType,\n    dataEntry: ListType,\n  ): void {\n    const remoteModel = this.modelParser.models.get(reference.model)!;\n\n    if (!remoteModel) {\n      return;\n    }\n\n    let referenceKey = '';\n    if (typeof referenceValue === 'string') {\n      referenceKey = referenceValue;\n    } else if (typeof referenceValue === 'object' && referenceValue && referenceValue.key) {\n      referenceKey = referenceValue.key;\n    }\n\n    const remoteDataEntry = this.hasRemoteEntry(remoteModel, String(referenceKey));\n\n    // fill undefined indexMap for for single and multi valued\n    if (!remoteDataEntry) {\n      if (remoteModel.supportsAutoCreation) {\n        const remoteValue = this.handleAutoCreationAndReturnKey(remoteModel, referenceValue) as ListItem;\n        this.indicesController.fillInverseIndex(reference.key, dataEntry.key, [referenceValue]);\n        asWritable(dataEntry)[reference.key] = remoteValue;\n        this.setRefValue(remoteValue, 'auto_hit');\n        return;\n      } else {\n        this.indicesController.fillInverseIndex(reference.key, dataEntry.key, [referenceKey]);\n        this.setError({\n          title: 'Remote Reference Key Not Found',\n          type: 'model',\n          errorGroup: 'ReferenceDataError',\n          errorType: 'RemoteReferenceKeyNotFound',\n          itemKey: dataEntry.key,\n          attribute: reference.key,\n          description: `The reference \"${reference.key}\" in the \"${this.key}\" model can not find the value \"${referenceValue}\" in the remote model \"${reference.model}\"`,\n          meta: {\n            remoteModel: reference.model,\n            remoteKey: referenceValue,\n          },\n        });\n\n        if (reference.validity === 'strict') {\n          // No value, as on a fresh entry: a partial update must not keep the\n          // previous one once its item is removed (#368)\n          if (reference.key in dataEntry) {\n            delete asWritable(dataEntry)[reference.key];\n          }\n          return;\n        }\n      }\n    }\n\n    this.indicesController.fillInverseIndex(reference.key, dataEntry.key, [referenceKey]);\n\n    const item: ListItem = { key: String(referenceKey) };\n\n    asWritable(dataEntry)[reference.key] = item;\n\n    if (!remoteDataEntry && !remoteModel.supportsAutoCreation && reference.validity !== 'strict') {\n      this.setRefValue(item, 'miss');\n    } else {\n      this.setRefValue(item, 'hit');\n    }\n  }\n\n  private processMultiValuedReference(\n    reference: Reference,\n    referenceValue: string[] | ListType[],\n    dataEntry: ListType,\n  ): void {\n    const remoteModel = this.modelParser.models.get(reference.model)!;\n\n    if (!remoteModel) {\n      return;\n    }\n\n    const referenceKeys = this.getReferenceKeys(referenceValue);\n\n    const validReferenceKeys: ListItem[] = [];\n\n    referenceKeys.forEach((referenceKey, index) => {\n      const remoteDataEntry = this.hasRemoteEntry(remoteModel, String(referenceKey));\n\n      if (!remoteDataEntry) {\n        if (remoteModel.supportsAutoCreation) {\n          const remoteKey = this.handleAutoCreationAndReturnKey(\n            remoteModel,\n            referenceValue[index] as ListType | string,\n          ) as ListItem;\n\n          this.setRefValue(remoteKey, 'auto_hit');\n\n          validReferenceKeys.push(remoteKey);\n\n          return;\n        } else {\n          this.setError({\n            title: 'Remote Reference Key Not Found',\n            type: 'model',\n            errorGroup: 'ReferenceDataError',\n            errorType: 'RemoteReferenceKeyNotFound',\n            itemKey: dataEntry.key,\n            attribute: reference.key,\n            description: `The reference \"${reference.key}\" in the \"${this.key}\" model can not find the value \"${referenceKey}\" in the remote model \"${reference.model}\"`,\n            meta: {\n              remoteModel: reference.model,\n              remoteKey: referenceKey,\n            },\n          });\n          if (reference.validity === 'strict') {\n            return;\n          }\n        }\n      }\n      const item: ListItem = { key: referenceKey };\n\n      if (!remoteDataEntry && !remoteModel.supportsAutoCreation && reference.validity !== 'strict') {\n        this.setRefValue(item, 'miss');\n      } else {\n        this.setRefValue(item, 'hit');\n      }\n      validReferenceKeys.push(item);\n    });\n\n    this.indicesController.fillInverseIndex(\n      reference.key,\n      dataEntry.key,\n      validReferenceKeys.map((val) => val.key),\n    );\n    asWritable(dataEntry)[reference.key] = validReferenceKeys;\n  }\n\n  public getViewKeys(): string[] {\n    return this.modelParser['_getViewKeys']({ modelKey: this.key });\n  }\n\n  /**\n   * Records one `NonUniqueKey` per row that a later row with the same key\n   * replaced in the container's `set` payload. ModelParser dedupes the rows\n   * before processing (the last row wins as a whole) and keeps the replaced\n   * keys beside the container, so every full apply reports them again (#369).\n   */\n  private emitNonUniqueKeyErrors(container: DataContainer<ListType>): void {\n    const replacedRowKeys = this.modelParser.getReplacedRowKeys(container as DataContainer);\n    if (replacedRowKeys.length === 0) {\n      return;\n    }\n    const effectiveKeyProperty = container.keyProperty ?? this.keyProperty;\n    const effectiveSeparator =\n      container.keyPropertySeparator ?? this.keyPropertySeparator ?? DEFAULT_KEY_PROPERTY_SEPARATOR;\n    const keyAttribute = joinKeyProperty(effectiveKeyProperty, effectiveSeparator);\n    for (const duplicateKey of replacedRowKeys) {\n      // Per-row emit — matches the existing aggregation infrastructure in\n      // QualityController (errorCounts cap via maxErrorsPerGroup, group\n      // totals via getErrorCounts). meta carries a minimal audit trail on\n      // each record: droppedRows names the replaced row's key. See dcupl#188.\n      this.setError({\n        title: 'Non Unique Key',\n        type: 'model',\n        errorGroup: 'DataContainerError',\n        errorType: 'NonUniqueKey',\n        description: `Row with key \"${duplicateKey}\" in model \"${container.model}\" is replaced by a later row with the same key (key attribute \"${keyAttribute}\"); the last row wins`,\n        itemKey: duplicateKey,\n        attribute: keyAttribute,\n        model: container.model,\n        meta: {\n          duplicateCount: 1,\n          droppedRows: [duplicateKey],\n        },\n      });\n    }\n  }\n\n  /** Whether `remoteModel` holds the item `key`, or is about to within this model's step-1 pass (#411). */\n  private hasRemoteEntry(remoteModel: DcuplModel, key: string): boolean {\n    return !!remoteModel.getEntry(key) || (remoteModel === this && !!this.pendingItemKeys?.has(key));\n  }\n\n  /**\n   * The keys of the given rows when this model has a basic reference to\n   * itself, for `pendingItemKeys` (#411); `undefined` otherwise.\n   */\n  public getPendingItemKeys(rows: ListType[]): Set<string> | undefined {\n    if (!this.getBasicReferences().some((reference) => reference.model === this.key)) {\n      return undefined;\n    }\n    const keys = new Set<string>();\n    for (const row of rows) {\n      if (row.key !== undefined && row.key !== null) keys.add(String(row.key));\n    }\n    return keys;\n  }\n\n  public addBasicPropertiesAndReferences(container: DataContainer<ListType>): void {\n    const properties = this.getBasicProperties();\n    const references = this.getBasicReferences();\n    this.pendingItemKeys = this.getPendingItemKeys(container.data);\n    const sourceMetadata = this.modelParser.qualityController.dcupl?.getContainerSourceMetadata(\n      container as DataContainer,\n    );\n    const origin = sourceMetadata?.origin ?? 'inline';\n\n    // Detect unknown columns: any column the loader saw in the source that the\n    // model doesn't declare (as a property, reference, or key attribute) is\n    // silently dropped on ingest. Surface it as `UnknownColumn` so users see\n    // the data loss. Only runs when source metadata is registered — inline\n    // `model.data` has no equivalent \"column list\" concept. See dcupl#183.\n    if (sourceMetadata && sourceMetadata.sourceColumns.length > 0) {\n      this.emitUnknownColumnErrors(container, sourceMetadata.sourceColumns, properties, references, origin);\n    }\n\n    this.emitNonUniqueKeyErrors(container);\n\n    for (let rawDataEntry of container.data) {\n      // A row with no key cannot be identified. Previously String(undefined)\n      // stored it under the literal key 'undefined' (and multiple such rows\n      // collided). Surface it as MissingKey and drop the row instead.\n      if (rawDataEntry.key === undefined || rawDataEntry.key === null) {\n        const effectiveKeyProperty = container.keyProperty ?? this.keyProperty;\n        const effectiveSeparator =\n          container.keyPropertySeparator ?? this.keyPropertySeparator ?? DEFAULT_KEY_PROPERTY_SEPARATOR;\n        const keyAttribute = joinKeyProperty(effectiveKeyProperty, effectiveSeparator);\n        this.setError({\n          title: 'Missing Key',\n          type: 'model',\n          errorGroup: 'DataContainerError',\n          errorType: 'MissingKey',\n          description: this.sharedErrorDescription(\n            ['MissingKey', container.model, keyAttribute].join('\\u0000'),\n            () =>\n              `A row in model \"${container.model}\" has no value for the key attribute \"${keyAttribute}\"; the row is dropped.`,\n          ),\n          attribute: keyAttribute,\n          model: container.model,\n        });\n        continue;\n      }\n\n      // Rows with the same key in a `set` payload were deduped before\n      // processing (ModelParser.mergeContainers, #369); an existing entry is\n      // only met by containers that merge into it, e.g. auto-created rows.\n      let dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n\n      if (!dataEntry) {\n        dataEntry = {\n          key: String(rawDataEntry.key),\n        } as ListType;\n      }\n\n      // handle Properties\n      for (const property of properties) {\n        if (property.origin) {\n          asWritable(rawDataEntry)[property.key] = rawDataEntry[property.origin];\n        }\n\n        const valueMapping = this.valueMappings.find((map) => map.attributes.includes(property.key));\n        if (this.isValidValueMapping(valueMapping)) {\n          rawDataEntry = this.mapRawValueUsingValueMapping(rawDataEntry, property.key, valueMapping!);\n        }\n\n        this.processBasicProperty(property, rawDataEntry, dataEntry, origin);\n      }\n\n      // handle References\n      for (const reference of references) {\n        const qualityConfig = this.attributeQualityConfigs.get(reference.key);\n\n        if (reference.origin) {\n          asWritable(rawDataEntry)[reference.key] = rawDataEntry[reference.origin];\n        }\n\n        const valueMapping = this.valueMappings.find((map) => map.attributes.includes(reference.key));\n        if (this.isValidValueMapping(valueMapping)) {\n          rawDataEntry = this.mapRawValueUsingValueMapping(rawDataEntry, reference.key, valueMapping!);\n        }\n\n        let referenceValue: ReferenceDataTypes<ListType> = rawDataEntry[reference.key];\n\n        if (typeof referenceValue === 'number') {\n          referenceValue = String(referenceValue);\n        }\n\n        if (!referenceValue) {\n          // An explicit null is kept and indexed under null, as for a property; an absent or\n          // empty value stays undefined (#215)\n          const emptyValue: any = referenceValue === null ? null : undefined;\n          this.indicesController.fillInverseIndex(reference.key, dataEntry.key, [emptyValue]);\n          if (emptyValue === null) {\n            asWritable(dataEntry)[reference.key] = null;\n            // A null reference is a NullValue unless nullable, as for a property\n            if (!qualityConfig?.nullable) {\n              this.setError(this.getNullReferenceError(reference, rawDataEntry, container.model));\n            }\n          } else if (qualityConfig?.required) {\n            this.setError({\n              title: 'Undefined Value',\n              type: 'model',\n              errorGroup: 'ReferenceDataError',\n              errorType: 'UndefinedValue',\n              description: this.sharedErrorDescription(\n                ['UndefinedValue', 'reference', reference.key, reference.type, this.key].join('\\u0000'),\n                () =>\n                  `The required ${reference.type} reference \"${reference.key}\" in the \"${this.key}\" model is undefined`,\n              ),\n              itemKey: rawDataEntry.key,\n              attribute: reference.key,\n              model: container.model,\n              meta: {\n                rawValue: referenceValue,\n                declaredType: reference.type,\n                origin: origin,\n              },\n            });\n          }\n          continue;\n        }\n\n        if (reference.type === 'singleValued') {\n          if (\n            (typeof referenceValue === 'object' || typeof referenceValue === 'string') &&\n            !Array.isArray(referenceValue)\n          ) {\n            this.processSingleValuedReference(reference, referenceValue, dataEntry);\n          } else {\n            this.setError({\n              title: 'Wrong Data Type',\n              type: 'model',\n              errorGroup: 'ReferenceDataError',\n              errorType: 'WrongDataType',\n              description: `Expect ${reference.type} but got ${typeof referenceValue} with value ${referenceValue}`,\n              itemKey: rawDataEntry.key,\n              attribute: reference.key,\n              meta: {\n                value: referenceValue,\n              },\n            });\n          }\n        } else if (reference.type === 'multiValued') {\n          const arrayValue = this.getValueAsArray(referenceValue, reference?.separator);\n          if (Array.isArray(arrayValue)) {\n            this.processMultiValuedReference(reference, arrayValue, dataEntry);\n          } else {\n            this.setError({\n              title: 'Wrong Data Type',\n              type: 'model',\n              errorGroup: 'ReferenceDataError',\n              errorType: 'WrongDataType',\n              description: `Expect ${reference.type} but got ${typeof referenceValue} with value ${referenceValue}`,\n              itemKey: rawDataEntry.key,\n              attribute: reference.key,\n              meta: {\n                value: referenceValue,\n              },\n            });\n          }\n        }\n      }\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n    this.pendingItemKeys = undefined;\n  }\n\n  public addQueryReferences(container: DataContainer<ListType>): void {\n    const queryReferences = this.getQueryReferences();\n\n    for (let qR of queryReferences) {\n      // #121 Performance optimization: Pre-stringify query once per reference instead of per item\n      // Reduces O(q·n) JSON.stringify calls to O(q) where q = query refs, n = items\n      const strigifiedQuery = JSON.stringify(qR.query);\n\n      for (let rawDataEntry of container.data) {\n        let dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n\n        const resolvedQuery = evaluateTemplate(strigifiedQuery, { ...rawDataEntry });\n\n        const parsedQuery = JSON.parse(resolvedQuery);\n\n        const qb: DcuplQueryBuilder = new DcuplQueryBuilder();\n        qb.init({ modelKey: qR.model });\n\n        qb.applyQuery(parsedQuery, { mode: 'set' });\n\n        // Only apply default projection if the query doesn't specify one\n        // This allows sort, pagination, and custom projection from query reference definitions\n        if (!parsedQuery.projection) {\n          qb.applyOptions({ projection: { $: false } });\n        }\n\n        const finalQuery = qb.getQuery();\n\n        if (finalQuery.queries.length > 0) {\n          const result = this.modelParser.dcuplInstance.query.execute(finalQuery);\n\n          if (qR.type === 'singleValued') {\n            if (result[0]) {\n              asWritable(dataEntry)[qR.key] = { key: result[0].key, _dcupl_ref_: 'hit' };\n            }\n          } else if (qR.type === 'multiValued') {\n            result.forEach((entry) => {\n              entry._dcupl_ref_ = 'hit';\n            });\n            asWritable(dataEntry)[qR.key] = result;\n          }\n        } else {\n          if (qR.type === 'singleValued') {\n            asWritable(dataEntry)[qR.key] = null;\n          } else if (qR.type === 'multiValued') {\n            asWritable(dataEntry)[qR.key] = [];\n          }\n        }\n\n        const stringKey = String(dataEntry.key);\n        (dataEntry as any).key = stringKey;\n        this.data.set(stringKey, dataEntry);\n      }\n    }\n  }\n\n  private isValidValueMapping(valueMapping: ValueMappingConfig | undefined): boolean {\n    if (!valueMapping || !Array.isArray(valueMapping.attributes) || !Array.isArray(valueMapping.values)) {\n      return false;\n    }\n\n    const invalidFromValues = valueMapping.values.find((value) => !Array.isArray(value.from));\n    // Check for structural presence of `to`, not truthiness — a falsy target\n    // (false, 0, '') is a valid mapping and must not disqualify the value.\n    const invalidToValues = valueMapping.values.find((value) => value.to === undefined);\n\n    if (invalidFromValues || invalidToValues) {\n      return false;\n    }\n\n    return true;\n  }\n\n  private mapRawValueUsingValueMapping(\n    rawEntry: ListType,\n    attribute: string,\n    valueMappingConfig: ValueMappingConfig,\n  ): ListType {\n    for (const mappingValue of valueMappingConfig.values) {\n      if (mappingValue.from.includes('$dcupl_falsy')) {\n        if (typeof rawEntry[attribute] === 'undefined' || rawEntry[attribute] === null || rawEntry[attribute] === '') {\n          asWritable(rawEntry)[attribute] = mappingValue.to;\n          continue;\n        }\n        continue;\n      }\n\n      if (mappingValue.from.includes(rawEntry[attribute])) {\n        asWritable(rawEntry)[attribute] = mappingValue.to;\n        continue;\n      }\n    }\n\n    return rawEntry;\n  }\n\n  private handleAutoCreationAndReturnKey(\n    remoteModel: DcuplModel,\n    referenceValue: ReferenceDataTypes,\n  ): ListItem | ListItem[] {\n    if (Array.isArray(referenceValue)) {\n      return [];\n    }\n\n    if (referenceValue === null) {\n      return { key: 'null' };\n    }\n\n    if (typeof referenceValue === 'object') {\n      const keyProperty = remoteModel.keyProperty;\n      const separator = remoteModel.keyPropertySeparator ?? DEFAULT_KEY_PROPERTY_SEPARATOR;\n      let key: string;\n      if (remoteModel.autoGenerateKey) {\n        key = generateKey();\n      } else if (typeof keyProperty === 'string' || (Array.isArray(keyProperty) && keyProperty.length > 0)) {\n        key = extractKey(referenceValue, keyProperty, separator);\n      } else {\n        key = String(referenceValue['key']);\n      }\n      remoteModel.data.set(key, { key: key });\n      referenceValue.key = key;\n      const container: DataContainer = { model: remoteModel.key, data: [referenceValue] };\n      void yieldToEventLoop().then(() => remoteModel.addContainer(container));\n      return { key: key };\n    }\n\n    if (typeof referenceValue === 'string') {\n      remoteModel.data.set(referenceValue, { key: referenceValue });\n      const container: DataContainer = { model: remoteModel.key, data: [{ key: referenceValue }] };\n      void yieldToEventLoop().then(() => remoteModel.addContainer(container));\n    }\n    return { key: String(referenceValue) };\n  }\n\n  private addContainer(container: DataContainer<ListType>): void {\n    this.cdRef.analyticsController.mark({ name: 'model:autogenerate_data:start', context: container.model });\n    this.modelParser.handleAlternativeKey([container]);\n\n    if (!Array.isArray(container.data)) {\n      this.setError({\n        title: 'Invalid Data',\n        type: 'model',\n        errorGroup: 'DataContainerError',\n        errorType: 'WrongDataType',\n        description: `Expect the data to be an Array but got ${typeof container.data}`,\n        model: container.model,\n      });\n      return;\n    }\n\n    if (this.autoGenerateProperties) {\n      this.generatePropertiesFromContainer(container);\n    }\n\n    this.addBasicPropertiesAndReferences(container);\n\n    this.addQueryReferences(container);\n\n    this.addResolvedReferences(container);\n\n    this.addDerivedReferencesGroupedReferencesDerivedPropertiesAndExpressionProperties(container);\n\n    if (this.hasDerivedPropertiesBasedOnResolvedReferences() || this?.hasDerivedReferencesBasedOnResolvedReferences()) {\n      this.reRunDerivedPropertiesBasedOnResolves(container);\n    }\n\n    this.cdRef.analyticsController.mark({ name: 'model:autogenerate_data:end', context: container.model });\n    this.cdRef.analyticsController.measure({\n      name: 'model:autogenerate_data',\n      start: 'model:autogenerate_data:start',\n      end: 'model:autogenerate_data:end',\n      sum: true,\n      context: container.model,\n      detail: {\n        model: container.model,\n        origin: this.key,\n      },\n    });\n  }\n\n  public addResolvedReferences(container: DataContainer<ListType>): void {\n    const references = this.getResolvedReferences();\n\n    const resolvedReferencesHelper: ResolvedReferenceObject[] = references\n      .map((reference) => {\n        const remoteModel = this.modelParser.models.get(reference.resolve.model);\n        if (!remoteModel) {\n          return;\n        }\n        const remoteData = remoteModel.getDataAsArray();\n\n        const inverseKeys = remoteModel.indicesController.getIndex(reference.resolve.reference);\n\n        const obj: ResolvedReferenceObject = {\n          reference,\n          model: remoteModel,\n          remoteData,\n          inverseKeys,\n        };\n        return obj;\n      })\n      .filter((entry) => !!entry) as ResolvedReferenceObject[];\n\n    for (const rawDataEntry of container.data) {\n      const localDataEntryKey = String(rawDataEntry.key);\n      const dataEntry = this.data.get(localDataEntryKey) as ListType;\n\n      for (const object of resolvedReferencesHelper) {\n        const localReferenceKey = object.reference.key;\n\n        let value: ListItem | ListItem[] | null;\n        if (object.inverseKeys) {\n          if (object.reference.type === 'multiValued') {\n            const v = object.inverseKeys.get(dataEntry.key) || new Set<string>();\n            value = Array.from(v).map((key) => {\n              return { key: key };\n            });\n          } else {\n            const vSet = object.inverseKeys.get(dataEntry.key);\n            const v = vSet ? Array.from(vSet)[0] || null : null;\n            if (v) {\n              value = { key: v };\n            } else {\n              value = null;\n            }\n          }\n          asWritable(dataEntry)[localReferenceKey] = value;\n          this.indicesController.fillInverseIndex(localReferenceKey, localDataEntryKey, dataEntry[localReferenceKey]);\n        }\n      }\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n  }\n\n  /**\n   * Rebuilds resolved references for ALL items in this model\n   * Used in partial updates when source references change\n   * @param specificReferences - Optional set of specific reference keys to rebuild\n   */\n  public rebuildResolvedReferencesForAllItems(specificReferences?: Set<string>): void {\n    let references = this.getResolvedReferences();\n    if (references.length === 0) return;\n\n    // Filter to only rebuild specific references if provided\n    if (specificReferences) {\n      references = references.filter((ref) => specificReferences.has(ref.key));\n      if (references.length === 0) return;\n    }\n\n    const resolvedReferencesHelper: ResolvedReferenceObject[] = references\n      .map((reference) => {\n        const remoteModel = this.modelParser.models.get(reference.resolve.model);\n        if (!remoteModel) {\n          return;\n        }\n        const inverseKeys = remoteModel.indicesController.getIndex(reference.resolve.reference);\n\n        const obj: ResolvedReferenceObject = {\n          reference,\n          model: remoteModel,\n          remoteData: [],\n          inverseKeys,\n        };\n        return obj;\n      })\n      .filter((entry) => !!entry) as ResolvedReferenceObject[];\n\n    // Process ALL items in this model, not just those in a container\n    for (const dataEntry of this.data.values()) {\n      for (const object of resolvedReferencesHelper) {\n        const localReferenceKey = object.reference.key;\n\n        let value: ListItem | ListItem[] | null;\n        if (object.inverseKeys) {\n          if (object.reference.type === 'multiValued') {\n            const v = object.inverseKeys.get(dataEntry.key) || new Set<string>();\n            value = Array.from(v).map((key: string) => {\n              return { key: key };\n            });\n          } else {\n            const v = object.inverseKeys.get(dataEntry.key);\n            const firstKey = v ? Array.from(v)[0] : null;\n            if (firstKey) {\n              value = { key: firstKey };\n            } else {\n              value = null;\n            }\n          }\n          asWritable(dataEntry)[localReferenceKey] = value;\n          this.indicesController.fillInverseIndex(localReferenceKey, dataEntry.key, dataEntry[localReferenceKey]);\n        }\n      }\n    }\n  }\n\n  public addDerivedReferencesGroupedReferencesDerivedPropertiesAndExpressionProperties(\n    container: DataContainer<ListType>,\n  ): void {\n    const derivedProperties = this.getDerivedPropertiesForBasicAndDerivedReferences();\n    const expressionProperties = this.getExpressionProperties();\n    const derivedReferences = this.getDerivedReferences();\n    const groupedReferences = this.getGroupedReferences();\n\n    for (const rawDataEntry of container.data) {\n      const dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n\n      /**\n       * 1) Derived References\n       */\n      if (derivedReferences.length > 0) {\n        derivedReferences.forEach((reference) => {\n          this.handleDerivedReferences(reference, dataEntry);\n        });\n      }\n\n      /**\n       * 2) Grouped References\n       */\n      if (groupedReferences.length > 0) {\n        groupedReferences.forEach((reference) => {\n          this.handleGroupedReferences(reference, dataEntry);\n        });\n      }\n\n      /**\n       * 3) Derived Properties\n       */\n      if (derivedProperties.length > 0) {\n        derivedProperties.forEach((prop) => {\n          this.handleDerivedProperties(prop, dataEntry);\n        });\n      }\n\n      /**\n       * 4) Expression Properties\n       */\n      if (expressionProperties.length > 0) {\n        expressionProperties.forEach((prop) => {\n          const context = this.createExpressionContext(dataEntry);\n          const value = evaluateTemplate(prop.expression!, context);\n          asWritable(dataEntry)[prop.key] = value;\n        });\n      }\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n  }\n\n  private handleDerivedProperties(prop: Property, dataEntry: ListItem): void {\n    const reference = this.references.get(prop.derive!.localReference);\n    if (reference) {\n      const remoteModel = this.modelParser.models.get(reference!.model);\n      if (remoteModel) {\n        if (reference.type === 'singleValued') {\n          this.handleSingleValuedDerivedProperties(remoteModel, dataEntry, reference, prop);\n        } else if (reference.type === 'multiValued') {\n          this.handleMultiValuedDerivedProperties(remoteModel, dataEntry, reference, prop);\n        }\n      }\n    }\n  }\n\n  public reRunDerivedPropertiesBasedOnResolves(container: DataContainer<ListType>): void {\n    const derivedProperties = this.getDerivedProperties();\n    const derivedReferences = this.getDerivedReferences();\n\n    for (const rawDataEntry of container.data) {\n      const dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n\n      derivedReferences.forEach((reference) => {\n        this.handleDerivedReferences(reference, dataEntry);\n      });\n\n      derivedProperties.forEach((prop) => {\n        const reference = this.references.get(prop.derive!.localReference);\n        if (reference) {\n          const remoteModel = this.modelParser.models.get(reference!.model);\n          if (remoteModel) {\n            if (reference.type === 'singleValued') {\n              this.handleSingleValuedDerivedProperties(remoteModel, dataEntry, reference, prop);\n            } else if (reference.type === 'multiValued') {\n              this.handleMultiValuedDerivedProperties(remoteModel, dataEntry, reference, prop);\n            }\n          }\n        }\n      });\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n  }\n\n  private handleSingleValuedDerivedProperties(\n    remoteModel: DcuplModel,\n    dataEntry: ListItem,\n    reference: Reference,\n    property: Property,\n  ): void {\n    const localReferenceValue = dataEntry[reference.key] as ListItem;\n    if (!localReferenceValue) {\n      // Clear derived property if reference is null/undefined\n      delete dataEntry[property.key];\n      return;\n    }\n\n    const remoteEntry = remoteModel?.getData().get(localReferenceValue.key);\n    if (remoteEntry) {\n      const remoteValue = remoteEntry[property.derive!.remoteProperty];\n\n      if (typeof remoteValue !== 'undefined') {\n        dataEntry[property.key] = remoteValue;\n      } else if (property.key in dataEntry) {\n        // No value, as on a fresh entry: a partial update must not keep the previous one (#400)\n        delete dataEntry[property.key];\n      }\n      if (property.index) {\n        this.indicesController.fillInverseIndex(property.key, dataEntry.key, [remoteValue]);\n      }\n    } else {\n      // Clear derived property if referenced entry no longer exists\n      delete dataEntry[property.key];\n    }\n  }\n\n  private handleMultiValuedDerivedProperties(\n    remoteModel: DcuplModel,\n    dataEntry: ListItem,\n    reference: Reference,\n    prop: Property,\n  ): void {\n    const entryValue: ListItem | ListItem[] = dataEntry[reference.key];\n    let entries: ListItem[];\n\n    if (!entryValue) {\n      entries = [];\n    } else if (Array.isArray(entryValue)) {\n      entries = [...entryValue];\n    } else if (entryValue && typeof entryValue.key === 'string') {\n      entries = [{ key: entryValue.key }];\n    } else {\n      entries = [];\n    }\n\n    const separator = prop.derive?.separator || ', ';\n\n    const remoteValues = entries\n      .map((item) => {\n        const remoteEntry = remoteModel?.getData().get(item.key);\n        if (remoteEntry) {\n          return remoteEntry[prop.derive!.remoteProperty];\n        }\n      })\n      .filter(Boolean);\n\n    let value: any;\n\n    if (prop.type.includes('Array<')) {\n      value = remoteValues;\n    } else if (prop.type === 'string' || prop.type === 'int' || prop.type === 'float' || prop.type === 'date') {\n      value = remoteValues.join(separator);\n    } else if (prop.type === 'json') {\n      value = remoteValues;\n    } else {\n      value = remoteValues;\n    }\n\n    dataEntry[prop.key] = value;\n  }\n\n  private handleDerivedReferences(reference: DerivedReference, dataEntry: ListType): void {\n    const localReferenceToDeriveFrom = this.references.get(reference.derive.localReference);\n\n    if (!localReferenceToDeriveFrom) return;\n\n    const remoteModelToDeriveFrom = this.modelParser.models.get(localReferenceToDeriveFrom.model);\n\n    if (!remoteModelToDeriveFrom) return;\n\n    const localKeyToDeriveFrom: ListItem | ListItem[] = dataEntry[localReferenceToDeriveFrom.key];\n\n    // A partial update rewrites a stored value: drop its index entries first (#400)\n    const previousValue: ListItem | ListItem[] | undefined = dataEntry[reference.key];\n    if (previousValue) {\n      this.indicesController.removeFromInverseIndex(\n        reference.key,\n        dataEntry.key,\n        (Array.isArray(previousValue) ? previousValue : [previousValue]).map((item) => item?.key),\n      );\n    }\n\n    if (!localKeyToDeriveFrom) {\n      // No value, as on a fresh entry (#400)\n      if (reference.key in dataEntry) {\n        delete asWritable(dataEntry)[reference.key];\n        this.groupedRefReverseIndex.delete(reference.key);\n      }\n      return;\n    }\n\n    let value: string[] = [];\n\n    if (Array.isArray(localKeyToDeriveFrom)) {\n      const resultSet = new Set<string>();\n\n      localKeyToDeriveFrom.forEach((item) => {\n        const dataEntryToDeriveFrom = remoteModelToDeriveFrom?.data.get(item.key);\n\n        if (dataEntryToDeriveFrom) {\n          const valueToDerive: ListItem | ListItem[] = dataEntryToDeriveFrom[reference.derive.remoteReference];\n\n          if (valueToDerive) {\n            if (Array.isArray(valueToDerive)) {\n              valueToDerive.forEach((entry) => {\n                resultSet.add(entry.key);\n              });\n            } else {\n              resultSet.add(valueToDerive.key);\n            }\n          }\n        }\n      });\n\n      // Convert Set to array ONCE after all items are processed\n      value = Array.from(resultSet.values());\n    } else {\n      const dataEntryToDeriveFrom = remoteModelToDeriveFrom?.data.get(localKeyToDeriveFrom.key);\n\n      if (dataEntryToDeriveFrom) {\n        const remoteValue: ListItem | ListItem[] = dataEntryToDeriveFrom[reference.derive.remoteReference];\n        if (!remoteValue) {\n          value = [];\n        } else if (Array.isArray(remoteValue)) {\n          value = remoteValue.map((val) => val.key);\n        } else if ('key' in remoteValue) {\n          value = [remoteValue.key];\n        }\n      }\n    }\n\n    let valueToAssign: ListItem[] | ListItem;\n    if (reference.type === 'singleValued') {\n      valueToAssign = { key: value[0] as string };\n    } else {\n      valueToAssign = value.map((v) => {\n        return { key: v };\n      });\n    }\n\n    this.indicesController.fillInverseIndex(reference.key, dataEntry.key, value);\n\n    // #244: keep grouped references correct when they group on a derived\n    // reference — its values are being rewritten here.\n    this.groupedRefReverseIndex.delete(reference.key);\n\n    asWritable(dataEntry)[reference.key] = valueToAssign;\n  }\n\n  private asStringArray(input: ListItem[] | ListItem): string[] {\n    if (!input) {\n      return [];\n    }\n    if (Array.isArray(input)) {\n      return input.map((i) => i.key);\n    } else {\n      return [input.key];\n    }\n  }\n\n  // #120 Performance optimization: Build reverse index for a reference\n  private buildReverseIndexForReference(referenceKey: string): void {\n    const reverseIndex = new Map<string, Set<string>>();\n\n    this.data.forEach((entry) => {\n      const values = this.asStringArray(entry[referenceKey]);\n      for (const value of values) {\n        if (!reverseIndex.has(value)) {\n          reverseIndex.set(value, new Set());\n        }\n        reverseIndex.get(value)!.add(entry.key);\n      }\n    });\n\n    this.groupedRefReverseIndex.set(referenceKey, reverseIndex);\n  }\n\n  // #120 Performance optimization: Ensure reverse index exists for reference\n  private ensureReverseIndex(referenceKey: string): Map<string, Set<string>> {\n    if (!this.groupedRefReverseIndex.has(referenceKey)) {\n      this.buildReverseIndexForReference(referenceKey);\n    }\n    return this.groupedRefReverseIndex.get(referenceKey)!;\n  }\n\n  private handleGroupedReferences(reference: GroupedRefeference, dataEntry: ListType): void {\n    const valueToAssign: ListItem[] = [];\n\n    const referenceToGroupOn = this.references.get(reference.groupBy.reference);\n\n    if (referenceToGroupOn) {\n      const valueToGroupOn = this.asStringArray(dataEntry[referenceToGroupOn.key]);\n\n      if (!valueToGroupOn.length) {\n        // No value, as on a fresh entry: a partial update must not keep the previous one (#400)\n        if (reference.key in dataEntry) {\n          delete asWritable(dataEntry)[reference.key];\n        }\n        return;\n      }\n\n      // #120 Performance optimization: Use reverse index for O(v) lookup instead of O(n·v²)\n      const reverseIndex = this.ensureReverseIndex(referenceToGroupOn.key);\n\n      // Collect all items that share any value with this item\n      const matchingItemKeys = new Set<string>();\n      for (const value of valueToGroupOn) {\n        const itemsWithValue = reverseIndex.get(value);\n        if (itemsWithValue) {\n          itemsWithValue.forEach((key) => matchingItemKeys.add(key));\n        }\n      }\n\n      // Build result array\n      for (const itemKey of matchingItemKeys) {\n        if (reference.groupBy.includeSelfInGroup) {\n          valueToAssign.push({ key: itemKey });\n        } else {\n          if (dataEntry.key !== itemKey) {\n            valueToAssign.push({ key: itemKey });\n          }\n        }\n      }\n    }\n\n    asWritable(dataEntry)[reference.key] = valueToAssign;\n  }\n\n  public resetData(): void {\n    this.data.clear();\n    // #120: Clear reverse index when data is reset\n    this.groupedRefReverseIndex.clear();\n  }\n\n  public resetIndexMap(): void {\n    this.indicesController.reset();\n  }\n\n  /**\n   * Drops model-level indices derived from the given attributes after a\n   * partial update (#243): lazily built plain indices (facets/pivot\n   * fallback), context-hashed indices (aggregate/sections/suggest) and\n   * deep-query indices are built from data a partial update silently\n   * invalidates — the next read rebuilds them from current data. A\n   * reference's plain index stays: it is maintained eagerly during\n   * processing, and the generic lazy rebuild cannot reproduce its shape.\n   *\n   * Which attribute an index belongs to comes from the indices controller's\n   * record, not from the index name: cutting `the_customer.country_<context>`\n   * at `_` reads `the`, and `price` matched `price_net` (#358).\n   */\n  public resetIndicesForChangedAttributes(attributeKeys: Set<string>): void {\n    this.indicesController.resetIndicesWhere((indexKey) => {\n      if (this.references.has(indexKey)) {\n        return false;\n      }\n      return this.indicesController.indexDependsOn(indexKey, attributeKeys);\n    });\n  }\n\n  public deleteDataEntries(data: DataContainer): void {\n    for (const rawDataEntry of data.data) {\n      const itemKey = String(rawDataEntry.key);\n      // Remove from data map\n      this.data.delete(itemKey);\n      // Remove from all inverse indices\n      this.indicesController.removeItemFromAllIndices(itemKey);\n\n      // #120: Remove from grouped reference reverse index\n      this.groupedRefReverseIndex.forEach((reverseIndex) => {\n        reverseIndex.forEach((itemSet) => {\n          itemSet.delete(itemKey);\n        });\n      });\n    }\n  }\n\n  public getItemCount(): number {\n    return this.data.size;\n  }\n\n  public getAttributes(): (Reference | Property)[] {\n    return [...this.references.values(), ...this.properties.values()];\n  }\n\n  public getAttribute(key: string): Reference | Property | undefined {\n    if (key === 'key') {\n      const keyProperty: Property = {\n        key: 'key',\n        type: 'string',\n      };\n      return keyProperty;\n    }\n    return this.references.get(key) || this.properties.get(key);\n  }\n\n  public getReferencesRelevantForDependencyGraph(): Reference[] {\n    return Array.from(this.references.values()).filter(\n      (reference) => !('derive' in reference) && !('resolve' in reference),\n    ) as Reference[];\n  }\n\n  public getBasicReferences(): Reference[] {\n    return Array.from(this.references.values()).filter(\n      (reference) =>\n        !('derive' in reference) && !('resolve' in reference) && !('query' in reference) && !('groupBy' in reference),\n    ) as Reference[];\n  }\n\n  public getQueryReferences(): QueryReference[] {\n    return Array.from(this.references.values()).filter((reference) => 'query' in reference) as QueryReference[];\n  }\n\n  public getResolvedReferences(): ResolvedReference[] {\n    return Array.from(this.references.values()).filter((reference) => 'resolve' in reference) as ResolvedReference[];\n  }\n\n  public getGroupedReferences(): GroupedRefeference[] {\n    return Array.from(this.references.values()).filter((reference) => 'groupBy' in reference) as GroupedRefeference[];\n  }\n\n  public getDerivedReferences(): DerivedReference[] {\n    return Array.from(this.references.values()).filter((reference) => 'derive' in reference) as DerivedReference[];\n  }\n\n  public getAggregatedReferences(): AggregatedReference[] {\n    return Array.from(this.references.values()).filter(\n      (reference) => 'aggregate' in reference,\n    ) as AggregatedReference[];\n  }\n\n  public getBasicProperties(): Property[] {\n    return Array.from(this.properties.values()).filter(\n      (property) => !('derive' in property) && !('expression' in property),\n    );\n  }\n\n  public getDerivedProperties(): Property[] {\n    return Array.from(this.properties.values()).filter((property) => 'derive' in property);\n  }\n\n  public getDerivedPropertiesForBasicAndDerivedReferences(): Property[] {\n    const basicReferences = this.getBasicReferences();\n    const derivedReferences = this.getDerivedReferences();\n    const queryReferences = this.getQueryReferences();\n    const derivedProperties = this.getDerivedProperties();\n\n    const references = [...basicReferences, ...derivedReferences, ...queryReferences];\n\n    const derivedPropertiesBasedOnBasicReferences = derivedProperties.filter((property) =>\n      references.find((reference) => reference.key === property.derive?.localReference),\n    );\n\n    return derivedPropertiesBasedOnBasicReferences;\n  }\n\n  public getDerivedPropertiesForResolvedReferences(): Property[] {\n    const resolvedReferences = this.getResolvedReferences();\n    const derivedProperties = this.getDerivedProperties();\n\n    const derivedPropertiesBasedOnResolvedReferences = derivedProperties.filter((property) =>\n      resolvedReferences.find((reference) => reference.key === property.derive?.localReference),\n    );\n\n    return derivedPropertiesBasedOnResolvedReferences;\n  }\n\n  public getDerivedReferencesForResolvedReferences(): DerivedReference[] {\n    const resolvedReferences = this.getResolvedReferences();\n    const derivedReferences = this.getDerivedReferences();\n\n    const derivedPropertiesBasedOnResolvedReferences = derivedReferences.filter((ref) =>\n      resolvedReferences.find((reference) => reference.key === ref.derive.localReference),\n    );\n\n    return derivedPropertiesBasedOnResolvedReferences;\n  }\n\n  public getExpressionProperties(): Property[] {\n    return Array.from(this.properties.values()).filter((property) => 'expression' in property);\n  }\n  public getAggregatedProperties(): PropertyAggregate[] {\n    return Array.from(this.properties.values()).filter((property) => 'aggregate' in property) as PropertyAggregate[];\n  }\n\n  public hasBasicReferences(): boolean {\n    return this.getBasicReferences().length > 0;\n  }\n\n  public hasQueryReferences(): boolean {\n    return this.getQueryReferences().length > 0;\n  }\n\n  public hasResolvedReferences(): boolean {\n    return this.getResolvedReferences().length > 0;\n  }\n\n  public hasGroupedReferences(): boolean {\n    return this.getGroupedReferences().length > 0;\n  }\n\n  public hasDerivedReferences(): boolean {\n    return this.getDerivedReferences().length > 0;\n  }\n\n  public hasBasicProperties(): boolean {\n    return this.getBasicProperties().length > 0;\n  }\n\n  public hasDerivedProperties(): boolean {\n    return this.getDerivedProperties().length > 0;\n  }\n  public hasDerivedPropertiesForBasicReferences(): boolean {\n    return this.getDerivedPropertiesForBasicAndDerivedReferences().length > 0;\n  }\n\n  public hasDerivedPropertiesBasedOnResolvedReferences(): boolean {\n    return this.getDerivedPropertiesForResolvedReferences().length > 0;\n  }\n  public hasDerivedReferencesBasedOnResolvedReferences(): boolean {\n    return this.getDerivedReferencesForResolvedReferences().length > 0;\n  }\n\n  public hasExpressionProperties(): boolean {\n    return this.getExpressionProperties().length > 0;\n  }\n\n  public hasAggregatedProperties(): boolean {\n    return this.getAggregatedProperties().length > 0;\n  }\n\n  public getData(options?: { itemKeys: string[] }): Map<string, ListType> {\n    if (options?.itemKeys) {\n      const filteredData = new Map();\n      options.itemKeys.forEach((key) => {\n        const entry = this.data.get(key);\n        if (entry) {\n          filteredData.set(entry.key, entry);\n        }\n      });\n      return filteredData;\n    }\n    return this.data;\n  }\n\n  public getDataAsArray(): ListType[] {\n    return Array.from(this.data.values());\n  }\n\n  public getEntry(key: string): ListType | undefined {\n    return this.data.get(key);\n  }\n\n  private setRefValue(item: ListItem, value: REF_VALUE): void {\n    if (this.modelParser.initOptions.referenceMetadata?.enabled) {\n      Object.defineProperty(item, EntryMetadataValues.REF_VALUE, {\n        value: value,\n        enumerable: true,\n        writable: false,\n        configurable: false,\n      });\n    }\n  }\n\n  // ========== PARTIAL UPDATE METHODS ==========\n  // These methods support selective attribute processing for partial updates\n\n  /**\n   * Processes only specific basic properties and references (Step 1)\n   * @param container - Data container to process\n   * @param attributesToProcess - Set of attribute keys to process\n   */\n  public addBasicPropertiesAndReferencesPartial(\n    container: DataContainer<ListType>,\n    attributesToProcess: Set<string>,\n    pendingItemKeys: Set<string> | undefined = this.getPendingItemKeys(container.data),\n  ): void {\n    const properties = this.getBasicProperties().filter((p) => attributesToProcess.has(p.key));\n    const references = this.getBasicReferences().filter((r) => attributesToProcess.has(r.key));\n    this.pendingItemKeys = pendingItemKeys;\n    const origin =\n      this.modelParser.qualityController.dcupl?.getContainerSourceMetadata(container as DataContainer)?.origin ??\n      'inline';\n\n    for (let rawDataEntry of container.data) {\n      // A row with no key cannot be identified. Previously String(undefined)\n      // stored it under the literal key 'undefined' (and multiple such rows\n      // collided). Surface it as MissingKey and drop the row instead.\n      if (rawDataEntry.key === undefined || rawDataEntry.key === null) {\n        const effectiveKeyProperty = container.keyProperty ?? this.keyProperty;\n        const effectiveSeparator =\n          container.keyPropertySeparator ?? this.keyPropertySeparator ?? DEFAULT_KEY_PROPERTY_SEPARATOR;\n        const keyAttribute = joinKeyProperty(effectiveKeyProperty, effectiveSeparator);\n        this.setError({\n          title: 'Missing Key',\n          type: 'model',\n          errorGroup: 'DataContainerError',\n          errorType: 'MissingKey',\n          description: this.sharedErrorDescription(\n            ['MissingKey', container.model, keyAttribute].join('\\u0000'),\n            () =>\n              `A row in model \"${container.model}\" has no value for the key attribute \"${keyAttribute}\"; the row is dropped.`,\n          ),\n          attribute: keyAttribute,\n          model: container.model,\n        });\n        continue;\n      }\n\n      let dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n\n      if (!dataEntry) {\n        dataEntry = {\n          key: String(rawDataEntry.key),\n        } as ListType;\n      }\n\n      // Handle Properties\n      for (const property of properties) {\n        if (property.origin) {\n          asWritable(rawDataEntry)[property.key] = rawDataEntry[property.origin];\n        }\n\n        const valueMapping = this.valueMappings.find((map) => map.attributes.includes(property.key));\n        if (this.isValidValueMapping(valueMapping)) {\n          rawDataEntry = this.mapRawValueUsingValueMapping(rawDataEntry, property.key, valueMapping!);\n        }\n\n        // As on the full path's fresh entry, a raw value that is missing or\n        // that the coercion or a strict validator rejects leaves no value\n        // instead of keeping the previous one (#368).\n        if (!this.processBasicProperty(property, rawDataEntry, dataEntry, origin) && property.key in dataEntry) {\n          delete asWritable(dataEntry)[property.key];\n        }\n      }\n\n      // Handle References\n      for (const reference of references) {\n        const qualityConfig = this.attributeQualityConfigs.get(reference.key);\n\n        if (reference.origin) {\n          asWritable(rawDataEntry)[reference.key] = rawDataEntry[reference.origin];\n        }\n\n        const valueMapping = this.valueMappings.find((map) => map.attributes.includes(reference.key));\n        if (this.isValidValueMapping(valueMapping)) {\n          rawDataEntry = this.mapRawValueUsingValueMapping(rawDataEntry, reference.key, valueMapping!);\n        }\n\n        let referenceValue: ReferenceDataTypes<ListType> = rawDataEntry[reference.key];\n\n        if (typeof referenceValue === 'number') {\n          referenceValue = String(referenceValue);\n        }\n\n        // Get old value BEFORE processing to update inverse index correctly\n        const oldReferenceValue = dataEntry[reference.key];\n\n        // #244: this reference's value may change — a grouped-reference\n        // reverse index built from it is stale now. Drop it so the next\n        // grouped-reference pass rebuilds from current data (it is otherwise\n        // only cleared on a full resetData()).\n        this.groupedRefReverseIndex.delete(reference.key);\n\n        if (!referenceValue) {\n          // Remove the old mapping, also an old null or undefined one\n          this.indicesController.removeFromInverseIndex(reference.key, dataEntry.key, [oldReferenceValue]);\n\n          // An explicit null is kept and indexed under null, as on the full path (#215)\n          const emptyValue: any = referenceValue === null ? null : undefined;\n          this.indicesController.fillInverseIndex(reference.key, dataEntry.key, [emptyValue]);\n\n          if (emptyValue === null) {\n            asWritable(dataEntry)[reference.key] = null;\n            // A null reference is a NullValue unless nullable, as for a property\n            if (!qualityConfig?.nullable) {\n              this.setError(this.getNullReferenceError(reference, rawDataEntry, container.model));\n            }\n          } else {\n            // Clear the reference value in the data entry\n            delete dataEntry[reference.key];\n          }\n\n          if (emptyValue !== null && qualityConfig?.required) {\n            this.setError({\n              title: 'Undefined Value',\n              type: 'model',\n              errorGroup: 'ReferenceDataError',\n              errorType: 'UndefinedValue',\n              description: this.sharedErrorDescription(\n                ['UndefinedValue', 'reference', reference.key, reference.type, this.key].join('\\u0000'),\n                () =>\n                  `The required ${reference.type} reference \"${reference.key}\" in the \"${this.key}\" model is undefined`,\n              ),\n              itemKey: rawDataEntry.key,\n              attribute: reference.key,\n              model: container.model,\n              meta: {\n                rawValue: referenceValue,\n                declaredType: reference.type,\n                origin: origin,\n              },\n            });\n          }\n          continue;\n        }\n\n        if (reference.type === 'singleValued') {\n          if (\n            (typeof referenceValue === 'object' || typeof referenceValue === 'string') &&\n            !Array.isArray(referenceValue)\n          ) {\n            // Remove the old value (also an old null or undefined) from the inverse index before\n            // adding the new one\n            if (oldReferenceValue?.key !== referenceValue) {\n              this.indicesController.removeFromInverseIndex(reference.key, dataEntry.key, [oldReferenceValue]);\n            }\n            this.processSingleValuedReference(reference, referenceValue, dataEntry);\n          } else {\n            this.setError({\n              title: 'Wrong Data Type',\n              type: 'model',\n              errorGroup: 'ReferenceDataError',\n              errorType: 'WrongDataType',\n              description: `Expect ${reference.type} but got ${typeof referenceValue} with value ${referenceValue}`,\n              itemKey: rawDataEntry.key,\n              attribute: reference.key,\n              meta: {\n                value: referenceValue,\n              },\n            });\n          }\n        } else if (reference.type === 'multiValued') {\n          const arrayValue = this.getValueAsArray(referenceValue, reference?.separator);\n          if (Array.isArray(arrayValue)) {\n            // Remove the old values (also an old null or undefined) from the inverse index before\n            // adding the new ones\n            this.indicesController.removeFromInverseIndex(reference.key, dataEntry.key, [oldReferenceValue]);\n            this.processMultiValuedReference(reference, arrayValue, dataEntry);\n          } else {\n            this.setError({\n              title: 'Wrong Data Type',\n              type: 'model',\n              errorGroup: 'ReferenceDataError',\n              errorType: 'WrongDataType',\n              description: `Expect ${reference.type} but got ${typeof referenceValue} with value ${referenceValue}`,\n              itemKey: rawDataEntry.key,\n              attribute: reference.key,\n              meta: {\n                value: referenceValue,\n              },\n            });\n          }\n        }\n      }\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n    this.pendingItemKeys = undefined;\n  }\n\n  /**\n   * Processes only specific query and resolved references (Step 2)\n   * @param container - Data container to process\n   * @param attributesToProcess - Set of attribute keys to process\n   */\n  public addQueryAndResolvedReferencesPartial(\n    container: DataContainer<ListType>,\n    attributesToProcess: Set<string>,\n  ): void {\n    // Process query references\n    if (this.hasQueryReferences()) {\n      const queryReferences = this.getQueryReferences().filter((r) => attributesToProcess.has(r.key));\n\n      for (let qR of queryReferences) {\n        // #121 Performance optimization: Pre-stringify query once per reference instead of per item\n        const strigifiedQuery = JSON.stringify(qR.query);\n\n        for (let rawDataEntry of container.data) {\n          let dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n          if (!dataEntry) continue;\n\n          const resolvedQuery = evaluateTemplate(strigifiedQuery, { ...rawDataEntry });\n          const parsedQuery = JSON.parse(resolvedQuery);\n\n          const qb: DcuplQueryBuilder = new DcuplQueryBuilder();\n          qb.init({ modelKey: qR.model });\n          qb.applyQuery(parsedQuery, { mode: 'set' });\n\n          // Only apply default projection if the query doesn't specify one\n          // This allows sort, pagination, and custom projection from query reference definitions\n          if (!parsedQuery.projection) {\n            qb.applyOptions({ projection: { $: false } });\n          }\n\n          const finalQuery = qb.getQuery();\n\n          if (finalQuery.queries.length > 0) {\n            const result = this.modelParser.dcuplInstance.query.execute(finalQuery);\n\n            if (qR.type === 'singleValued') {\n              if (result[0]) {\n                asWritable(dataEntry)[qR.key] = { key: result[0].key, _dcupl_ref_: 'hit' };\n              }\n            } else if (qR.type === 'multiValued') {\n              result.forEach((entry) => {\n                entry._dcupl_ref_ = 'hit';\n              });\n              asWritable(dataEntry)[qR.key] = result;\n            }\n          } else {\n            if (qR.type === 'singleValued') {\n              asWritable(dataEntry)[qR.key] = null;\n            } else if (qR.type === 'multiValued') {\n              asWritable(dataEntry)[qR.key] = [];\n            }\n          }\n\n          const stringKey = String(dataEntry.key);\n          (dataEntry as any).key = stringKey;\n          this.data.set(stringKey, dataEntry);\n        }\n      }\n    }\n\n    // Process resolved references\n    if (this.hasResolvedReferences()) {\n      const resolvedReferences = this.getResolvedReferences().filter((r) => attributesToProcess.has(r.key));\n\n      if (resolvedReferences.length > 0) {\n        // For resolved references in partial updates, we need to rebuild for ALL items\n        // because changes in the remote model affect all items in this model\n        // For example, if products.categoryRef changes, categories.products needs to be rebuilt for ALL categories\n        this.rebuildResolvedReferencesForAllItems();\n      }\n    }\n  }\n\n  /**\n   * Creates an expanded context object for expression evaluation\n   * Resolves references so expressions can access nested properties like productRef.baseCost\n   */\n  private createExpressionContext(dataEntry: ListType): Record<string, any> {\n    const context: Record<string, any> = { ...dataEntry };\n\n    // Expand all references\n    this.references.forEach((reference, refKey) => {\n      const refValue = dataEntry[refKey];\n      if (!refValue) return;\n\n      const remoteModel = this.modelParser.models.get(reference.model);\n      if (!remoteModel) return;\n\n      if (reference.type === 'singleValued' && typeof refValue === 'object' && 'key' in refValue) {\n        // Expand single-valued reference\n        const remoteEntry = remoteModel.getData().get((refValue as ListItem).key);\n        if (remoteEntry) {\n          // Recursively expand nested references\n          context[refKey] = this.createNestedContext(remoteEntry, remoteModel);\n        }\n      } else if (reference.type === 'multiValued' && Array.isArray(refValue)) {\n        // Expand multi-valued references\n        context[refKey] = refValue\n          .map((item: ListItem) => {\n            const remoteEntry = remoteModel.getData().get(item.key);\n            return remoteEntry ? this.createNestedContext(remoteEntry, remoteModel) : null;\n          })\n          .filter(Boolean);\n      }\n    });\n\n    return context;\n  }\n\n  /**\n   * Helper to recursively expand nested references (up to one level deep to avoid infinite recursion)\n   */\n  private createNestedContext(entry: ListItem, model: DcuplModel): Record<string, any> {\n    const context: Record<string, any> = { ...entry };\n\n    model.references.forEach((reference, refKey) => {\n      const refValue = entry[refKey];\n      if (!refValue) return;\n\n      const remoteModel = this.modelParser.models.get(reference.model);\n      if (!remoteModel) return;\n\n      if (reference.type === 'singleValued' && typeof refValue === 'object' && 'key' in refValue) {\n        const remoteEntry = remoteModel.getData().get((refValue as ListItem).key);\n        if (remoteEntry) {\n          // Shallow copy to avoid deep recursion\n          context[refKey] = { ...remoteEntry };\n        }\n      }\n    });\n\n    return context;\n  }\n\n  /**\n   * Processes only specific derived/grouped references and derived/expression properties (Step 3)\n   * @param container - Data container to process\n   * @param attributesToProcess - Set of attribute keys to process\n   */\n  public addDerivedAndExpressionAttributesPartial(\n    container: DataContainer<ListType>,\n    attributesToProcess: Set<string>,\n  ): void {\n    const derivedProperties = this.getDerivedPropertiesForBasicAndDerivedReferences().filter((p) =>\n      attributesToProcess.has(p.key),\n    );\n    const derivedReferences = this.getDerivedReferences().filter((r) => attributesToProcess.has(r.key));\n    const groupedReferences = this.getGroupedReferences().filter((r) => attributesToProcess.has(r.key));\n    const expressionProperties = this.getExpressionProperties().filter((p) => attributesToProcess.has(p.key));\n\n    for (const rawDataEntry of container.data) {\n      const dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n      if (!dataEntry) continue;\n\n      // Process derived references\n      derivedReferences.forEach((reference) => {\n        this.handleDerivedReferences(reference, dataEntry);\n      });\n\n      // Process grouped references\n      groupedReferences.forEach((reference) => {\n        this.handleGroupedReferences(reference, dataEntry);\n      });\n\n      // Process derived properties\n      derivedProperties.forEach((prop) => {\n        this.handleDerivedProperties(prop, dataEntry);\n      });\n\n      // Process expression properties\n      expressionProperties.forEach((prop) => {\n        const context = this.createExpressionContext(dataEntry);\n        const value = evaluateTemplate(prop.expression!, context);\n        asWritable(dataEntry)[prop.key] = value;\n      });\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n  }\n\n  /**\n   * Re-runs only specific derived properties based on resolved references (Step 4)\n   * @param container - Data container to process\n   * @param attributesToProcess - Set of attribute keys to process\n   */\n  public reRunDerivedPropertiesBasedOnResolvesPartial(\n    container: DataContainer<ListType>,\n    attributesToProcess: Set<string>,\n  ): void {\n    const derivedProperties = this.getDerivedProperties().filter((p) => attributesToProcess.has(p.key));\n    const derivedReferences = this.getDerivedReferences().filter((r) => attributesToProcess.has(r.key));\n\n    for (const rawDataEntry of container.data) {\n      const dataEntry = this.data.get(String(rawDataEntry.key)) as ListType;\n      if (!dataEntry) continue;\n\n      // Re-run derived references\n      derivedReferences.forEach((reference) => {\n        this.handleDerivedReferences(reference, dataEntry);\n      });\n\n      // Re-run derived properties\n      derivedProperties.forEach((prop) => {\n        this.handleDerivedProperties(prop, dataEntry);\n      });\n\n      const stringKey = String(dataEntry.key);\n      (dataEntry as any).key = stringKey;\n      this.data.set(stringKey, dataEntry);\n    }\n  }\n}\n","import {\n  AnalyticsEntryResource,\n  AnalyticsEntryResourceValue,\n  AttributeValidatorConfig,\n  // CustomValidatorConfig,\n  DataContainer,\n  ListItem,\n  QualityAnalyzer,\n  ScriptController,\n  ValidatorConfig,\n  generateKey,\n  logger,\n} from '@dcupl/common';\nimport { DcuplModel, ModelParser } from '../model-parser';\nimport { DcuplApi } from '../dcupl/dcupl-api';\nimport { endsWith, groupBy, includes } from 'lodash-es';\n\n/** Key prefix of the models that publish the error records (#444: built on first read). */\nexport const ERROR_TRACKING_MODEL_PREFIX = '$DcuplErrorTracking';\n\n/** The models whose rows initData() stages and the first read builds. */\nconst ERROR_TRACKING_ROW_MODELS: readonly string[] = ['$DcuplErrorTrackingErrors', '$DcuplErrorTrackingSummary'];\n\ntype ErrorCountGroup = {\n  model?: string;\n  attribute?: string;\n  errorGroup: string;\n  errorType: string;\n  type: QualityAnalyzer.DcuplErrorType;\n  count: number;\n};\n\n/**\n * Error types the data pipeline derives from an attribute's values: the\n * per-row checks of step 1 (incl. lossy coercion and validators), the\n * `unique` validator and the per-attribute aggregates of cleanUpErrors().\n * A partial update re-derives exactly these (#368).\n */\nconst ATTRIBUTE_ERROR_TYPES: ReadonlySet<string> = new Set([\n  'UndefinedValue',\n  'NullValue',\n  'WrongDataType',\n  'InvalidValidator',\n  'RemoteReferenceKeyNotFound',\n  'UndefinedAttribute',\n]);\n\n/** Error groups the data pipeline re-detects (see resetDataErrors). */\nconst DATA_ERROR_GROUPS: readonly string[] = ['ReferenceDataError', 'PropertyDataError', 'DataContainerError'];\n\nconst UNIQUE_ERROR_TITLE = 'Validator Error - Unique';\n\n/**\n * QualityController manages data quality validation and error tracking.\n *\n * TWO-TIER VALIDATION SYSTEM:\n * For validation to occur, BOTH conditions must be true:\n * 1. Global flag: qualityController.enabled (set via errorTracking.enabled OR quality.enabled in init options)\n * 2. Per-model flag: model.qualityConfig.enabled (defined in each model's quality configuration)\n *\n * This allows fine-grained control: disable validation globally for performance,\n * or enable/disable validation for specific models.\n */\nexport class QualityController {\n  public enabled = false;\n  public maxErrorsPerGroup = 1000;\n  private errors: Map<string, QualityAnalyzer.DcuplError> = new Map();\n  private errorCounts: Map<string, ErrorCountGroup> = new Map();\n  // Whether the error records changed since initData() last published them to\n  // the $DcuplErrorTracking* models (#368).\n  private errorsChangedSinceInitData = true;\n  // The containers initData() queued for $DcuplErrorTrackingErrors / -Summary and nothing has\n  // processed yet: the error set of the last init()/update(), built on first read (#444).\n  private pendingErrorTrackingContainers: DataContainer[] | undefined;\n  // The model-definition errors init re-detects from the registered definitions (#417): the keys\n  // of the stored records, and per error group how many were counted without a stored record\n  // (beyond maxErrorsPerGroup).\n  private definitionErrorKeys: Set<string> = new Set();\n  private unstoredDefinitionErrors: Map<string, number> = new Map();\n  private log = logger.child({ prefix: 'QualityController' });\n\n  public values: QualityAnalyzer.AnalyticsValues = {\n    loading: 0,\n    processing: 0,\n    startup: 0,\n    counts: {\n      resources: 0, // todo\n      modelFiles: 0,\n      dataFiles: 0,\n      models: 0,\n      rows: 0,\n      attributes: 0,\n      dataEntries: 0,\n    },\n    unusedAttributes: [],\n    errors: {\n      size: 0,\n      UndefinedValue: 0,\n      UndefinedAttribute: 0,\n      WrongDataType: 0,\n      MissingModel: 0,\n      InvalidModelDescription: 0,\n      RemoteReferenceKeyNotFound: 0,\n    },\n    sizes: {\n      totalEncoded: 0,\n      totalDecoded: 0,\n      unusedDecoded: 0,\n      models: [],\n    },\n  };\n\n  public modelParser: ModelParser | undefined;\n  public dcupl!: DcuplApi;\n\n  constructor(public scriptsController: ScriptController) {}\n\n  private getErrorGroupKey(error: QualityAnalyzer.DcuplError): string {\n    const attribute = 'attribute' in error ? error.attribute : undefined;\n    return `${error.model ?? ''}::${attribute ?? ''}::${error.errorType}`;\n  }\n\n  /**\n   * Exact occurrence count for an error group, independent of the per-group\n   * storage cap (#177). Lets consolidation reflect the true number of affected\n   * rows even when stored error objects are capped at maxErrorsPerGroup.\n   */\n  private getGroupCount(model: string | undefined, attribute: string | undefined, errorType: string): number {\n    const key = `${model ?? ''}::${attribute ?? ''}::${errorType}`;\n    return this.errorCounts.get(key)?.count ?? 0;\n  }\n\n  public setError(error: QualityAnalyzer.DcuplError): void {\n    this.errorsChangedSinceInitData = true;\n    const groupKey = this.getErrorGroupKey(error);\n    let group = this.errorCounts.get(groupKey);\n    if (!group) {\n      group = {\n        model: error.model,\n        attribute: 'attribute' in error ? error.attribute : undefined,\n        errorGroup: error.errorGroup,\n        errorType: error.errorType,\n        type: error.type,\n        count: 0,\n      };\n      this.errorCounts.set(groupKey, group);\n    }\n    group.count += 1;\n\n    if (group.count > this.maxErrorsPerGroup) {\n      return;\n    }\n\n    if (!error.key) {\n      error.key = generateKey();\n    }\n    this.errors.set(error.key, error);\n  }\n\n  /**\n   * Records a model-definition error that init re-detects from the registered definitions on every\n   * run (attribute checks when a model is built, `validateModels`), so `resetDefinitionErrors` can\n   * drop exactly these before the next run (#417). Registration errors (an invalid definition passed\n   * to `models.set`, loader errors) go through `setError` and stay.\n   */\n  public setDefinitionError(error: QualityAnalyzer.DcuplError): void {\n    this.setError(error);\n    if (error.key !== undefined && this.errors.get(error.key) === error) {\n      this.definitionErrorKeys.add(error.key);\n    } else {\n      const groupKey = this.getErrorGroupKey(error);\n      this.unstoredDefinitionErrors.set(groupKey, (this.unstoredDefinitionErrors.get(groupKey) ?? 0) + 1);\n    }\n  }\n\n  /**\n   * Drops the `InvalidModelDefinition` errors recorded when a definition for `modelKey` was\n   * rejected at registration (an invalid `models.set`, a loader file): a valid `models.set`\n   * replaces the whole definition for the key, so they no longer describe it (#417).\n   */\n  public removeRejectedDefinitionErrors(modelKey: string): void {\n    const isRejection = (error: QualityAnalyzer.DcuplError): boolean =>\n      error.type === 'model' &&\n      error.errorType === 'InvalidModelDefinition' &&\n      error.model === modelKey &&\n      !('attribute' in error && error.attribute);\n    for (const error of this.getErrors()) {\n      if (isRejection(error)) {\n        this.removeError(error.key!);\n      }\n    }\n    // records beyond maxErrorsPerGroup are counted without being stored\n    this.errorCounts.delete(`${modelKey}::::InvalidModelDefinition`);\n  }\n\n  /**\n   * Drops the errors recorded with `setDefinitionError` (#417). init calls it before it builds the\n   * models and runs `validateModels`, which record them again from the current definitions: without\n   * it, a changed definition kept the old definition's errors and every re-init counted the same\n   * errors once more.\n   */\n  public resetDefinitionErrors(): void {\n    if (this.definitionErrorKeys.size === 0 && this.unstoredDefinitionErrors.size === 0) {\n      return;\n    }\n    this.errorsChangedSinceInitData = true;\n    for (const key of this.definitionErrorKeys) {\n      this.removeError(key);\n    }\n    for (const [groupKey, count] of this.unstoredDefinitionErrors) {\n      const group = this.errorCounts.get(groupKey);\n      if (group) {\n        group.count -= count;\n        if (group.count <= 0) {\n          this.errorCounts.delete(groupKey);\n        }\n      }\n    }\n    this.definitionErrorKeys.clear();\n    this.unstoredDefinitionErrors.clear();\n  }\n\n  public getErrorCounts(): Array<{\n    model?: string;\n    attribute?: string;\n    errorType: string;\n    count: number;\n  }> {\n    return Array.from(this.errorCounts.values()).map(({ model, attribute, errorType, count }) => ({\n      model,\n      attribute,\n      errorType,\n      count,\n    }));\n  }\n\n  /**\n   * One entry per (model, attribute, errorType) group with the exact\n   * occurrence count and how many error objects were actually retained under\n   * the `maxErrorsPerGroup` cap (#204). Sized by group count, not error count,\n   * so it stays small no matter how many errors a dataset produces.\n   */\n  public getErrorSummary(): QualityAnalyzer.ErrorGroupSummary[] {\n    const storedPerGroup = new Map<string, number>();\n    for (const error of this.errors.values()) {\n      const groupKey = this.getErrorGroupKey(error);\n      storedPerGroup.set(groupKey, (storedPerGroup.get(groupKey) ?? 0) + 1);\n    }\n\n    const summary: QualityAnalyzer.ErrorGroupSummary[] = [];\n    for (const [groupKey, group] of this.errorCounts) {\n      const storedCount = storedPerGroup.get(groupKey) ?? 0;\n      summary.push({\n        key: groupKey,\n        model: group.model,\n        attribute: group.attribute,\n        errorGroup: group.errorGroup,\n        errorType: group.errorType,\n        type: group.type,\n        totalCount: group.count,\n        storedCount,\n        truncated: group.count > storedCount,\n      });\n    }\n    return summary;\n  }\n\n  /**\n   * Stamps `groupTotal` / `truncated` onto every retained error object so the\n   * `$DcuplErrorTrackingErrors` rows themselves reveal when their group was\n   * capped (#204). Mutates in place: bounded by the number of stored errors,\n   * no per-error allocation.\n   */\n  private stampGroupTotals(summary: QualityAnalyzer.ErrorGroupSummary[]): void {\n    const byGroup = new Map(summary.map((s) => [s.key, s]));\n    for (const error of this.errors.values()) {\n      const group = byGroup.get(this.getErrorGroupKey(error));\n      error.groupTotal = group?.totalCount ?? 1;\n      error.truncated = group?.truncated ?? false;\n    }\n  }\n\n  public removeError(key: string): void {\n    this.errorsChangedSinceInitData = true;\n    const error = this.errors.get(key);\n    if (error) {\n      const groupKey = this.getErrorGroupKey(error);\n      const group = this.errorCounts.get(groupKey);\n      if (group) {\n        group.count -= 1;\n        if (group.count <= 0) {\n          this.errorCounts.delete(groupKey);\n        }\n      }\n    }\n    this.errors.delete(key);\n  }\n\n  public getError(key: string): QualityAnalyzer.DcuplError | undefined {\n    return this.errors.get(key);\n  }\n\n  public getErrors(): QualityAnalyzer.DcuplError[] {\n    return Array.from(this.errors.values());\n  }\n\n  public resetErrors(): void {\n    this.errorsChangedSinceInitData = true;\n    this.errors.clear();\n    this.errorCounts.clear();\n    this.definitionErrorKeys.clear();\n    this.unstoredDefinitionErrors.clear();\n  }\n\n  public resetModelErrors(): void {\n    this.errorsChangedSinceInitData = true;\n    this.getErrors().forEach((e) => {\n      if (e.type === 'model') {\n        this.removeError(e.key!);\n      }\n    });\n    for (const [groupKey, group] of this.errorCounts) {\n      if (group.type === 'model') {\n        this.errorCounts.delete(groupKey);\n      }\n    }\n    // definition errors are model errors\n    this.definitionErrorKeys.clear();\n    this.unstoredDefinitionErrors.clear();\n  }\n\n  /** Drops every model error recorded for `modelKey`: `models.remove` unregisters the model (#420). */\n  public removeErrorsOfModel(modelKey: string): void {\n    for (const error of this.getErrors()) {\n      if (error.type === 'model' && error.model === modelKey) {\n        this.removeError(error.key!);\n      }\n    }\n    // records beyond maxErrorsPerGroup are counted without being stored\n    for (const [groupKey, group] of this.errorCounts) {\n      if (group.type === 'model' && group.model === modelKey) {\n        this.errorCounts.delete(groupKey);\n      }\n    }\n  }\n\n  public resetValidationErrors(): void {\n    this.errorsChangedSinceInitData = true;\n    this.getErrors().forEach((e) => {\n      // Only reset validation errors (InvalidValidator), not model definition errors\n      if (e.type === 'model' && e.errorType === 'InvalidValidator') {\n        this.removeError(e.key!);\n      }\n    });\n    // Counts must be cleared alongside the stored errors, otherwise\n    // getErrorCounts() keeps accumulating across update() cycles (see issue #177).\n    for (const [groupKey, group] of this.errorCounts) {\n      if (group.type === 'model' && group.errorType === 'InvalidValidator') {\n        this.errorCounts.delete(groupKey);\n      }\n    }\n  }\n\n  /**\n   * Resets every error that the data processing pipeline re-detects during a\n   * full (re-)initialization: reference, property and data-container errors.\n   *\n   * Without this, errors such as RemoteReferenceKeyNotFound accumulate on each\n   * update() cycle because resetValidationErrors() only clears InvalidValidator\n   * errors (see issue #174, Bug 2).\n   *\n   * Model-definition errors ('ModelDefinitionError') and loader errors\n   * (type 'loader') are preserved because init() does not re-generate them.\n   */\n  public resetDataErrors(): void {\n    this.errorsChangedSinceInitData = true;\n    const reprocessedGroups: QualityAnalyzer.ModelErrorGroup[] = [\n      'ReferenceDataError',\n      'PropertyDataError',\n      'DataContainerError',\n    ];\n    this.getErrors().forEach((e) => {\n      if (e.type === 'model' && reprocessedGroups.includes(e.errorGroup)) {\n        this.removeError(e.key!);\n      }\n    });\n    // Counts must be cleared alongside the stored errors, otherwise\n    // getErrorCounts() keeps accumulating across update() cycles (see issue #177).\n    for (const [groupKey, group] of this.errorCounts) {\n      if (group.type === 'model' && reprocessedGroups.includes(group.errorGroup as QualityAnalyzer.ModelErrorGroup)) {\n        this.errorCounts.delete(groupKey);\n      }\n    }\n  }\n\n  /**\n   * Consolidates the per-row errors of `model` into per-attribute aggregates\n   * once its rows are processed. `attributes` limits it to those attributes —\n   * a partial update consolidates only the attributes it reprocessed (#368).\n   */\n  public cleanUpErrors(model: DcuplModel, dataContainer: DataContainer, attributes?: ReadonlySet<string>): void {\n    const isRelevant = (attribute: string): boolean => !attributes || attributes.has(attribute);\n    const sourceMetadata = this.dcupl?.getContainerSourceMetadata(dataContainer);\n    const modelKey = dataContainer.model;\n\n    if (sourceMetadata) {\n      const coercionSamples = sourceMetadata.coercionFailureSamples ?? {};\n\n      // ---- CSV / loader path: loader-confirmed coercion failures are authoritative.\n      // Trigger on count > 0 (not storedLength === rowCount) so the #177 cap can no\n      // longer suppress consolidation on large datasets. ----\n      for (const attribute of Object.keys(coercionSamples)) {\n        const sample = coercionSamples[attribute];\n        if (!sample || sample.count <= 0 || !isRelevant(attribute)) {\n          continue;\n        }\n        // A coercion-failed cell is nulled by the loader and surfaces as a per-row\n        // UndefinedValue (or as a per-row WrongDataType under forceStrictDataType).\n        // The single aggregate below subsumes both.\n        for (const error of this.getModelErrors(modelKey)) {\n          if (\n            error.attribute === attribute &&\n            error.itemKey != null &&\n            (error.errorType === 'UndefinedValue' || error.errorType === 'WrongDataType')\n          ) {\n            this.removeError(error.key!);\n          }\n        }\n        const declaredType =\n          (model.properties.get(attribute) as { type?: string } | undefined)?.type ?? sample.expected;\n        this.setError(this.buildColumnCoercionError(modelKey, attribute, sample.rawValue, declaredType, sample.count));\n      }\n\n      // ---- Absent column: declared on the model but not present in the source.\n      // Uses the exact count so it survives the cap the same way. ----\n      for (const [attribute] of model.properties) {\n        if (coercionSamples[attribute] || sourceMetadata.sourceColumns.includes(attribute) || !isRelevant(attribute)) {\n          continue;\n        }\n        const undefinedCount = this.getGroupCount(modelKey, attribute, 'UndefinedValue');\n        if (undefinedCount > 0 && undefinedCount === dataContainer.data.length) {\n          for (const error of this.getModelErrors(modelKey)) {\n            if (error.attribute === attribute && error.itemKey != null && error.errorType === 'UndefinedValue') {\n              this.removeError(error.key!);\n            }\n          }\n          this.setError(this.buildAbsentColumnError(modelKey, attribute));\n        }\n      }\n    } else {\n      // ---- Inline / programmatic path (no loader source metadata). ----\n      // (a) uses getGroupCount (exact, cap-safe) for its comparison.\n      // (b) cannot use getGroupCount because lossy errors share the WrongDataType\n      //     count key; it uses group.length instead, which is bounded by\n      //     maxErrorsPerGroup (see the note on (b)).\n\n      // (a) Every row missing an attribute → collapse per-row UndefinedValue\n      // into a single UndefinedAttribute.\n      const undefinedAttributes = new Set(\n        this.getModelErrors(modelKey)\n          .filter((error) => error.errorType === 'UndefinedValue' && error.attribute != null)\n          .map((error) => error.attribute as string),\n      );\n      for (const attribute of undefinedAttributes) {\n        if (!isRelevant(attribute)) {\n          continue;\n        }\n        const undefinedCount = this.getGroupCount(modelKey, attribute, 'UndefinedValue');\n        if (undefinedCount > 0 && undefinedCount === dataContainer.data.length) {\n          for (const error of this.getModelErrors(modelKey)) {\n            if (error.attribute === attribute && error.itemKey != null && error.errorType === 'UndefinedValue') {\n              this.removeError(error.key!);\n            }\n          }\n          this.setError(this.buildAbsentColumnError(modelKey, attribute));\n        }\n      }\n\n      // (b) Per-row WrongDataType *property* coercion failures → collapse into a\n      // single aggregate per attribute. Excludes lossy coercion ('Lossy Data\n      // Coercion', which shares the WrongDataType errorType) and reference\n      // errors. rowCount uses the filtered group size (group.length) rather than\n      // getGroupCount, because lossy errors share the (model, attribute,\n      // WrongDataType) count key and would otherwise inflate the total.\n      // NOTE: group.length is bounded by maxErrorsPerGroup (#177), so for this\n      // inline path rowCount under-reports when there are more than\n      // maxErrorsPerGroup non-lossy failures. The CSV path (the primary\n      // production path) is exact via the loader count; this is an accepted\n      // limitation for inline data.\n      const propertyCoercionErrors = this.getModelErrors(modelKey).filter(\n        (error) =>\n          error.errorType === 'WrongDataType' &&\n          error.errorGroup === 'PropertyDataError' &&\n          error.title === 'Wrong Data Type' &&\n          error.itemKey != null,\n      );\n      const groupedByAttribute = groupBy(propertyCoercionErrors, 'attribute');\n      for (const attribute in groupedByAttribute) {\n        const group = groupedByAttribute[attribute];\n        if (!group?.length || !isRelevant(attribute)) {\n          continue;\n        }\n        const firstMeta = group[0]!.meta as { rawValue?: unknown; expected?: string } | undefined;\n        const declaredType =\n          (model.properties.get(attribute) as { type?: string } | undefined)?.type ?? firstMeta?.expected ?? 'unknown';\n        for (const error of group) {\n          this.removeError(error.key!);\n        }\n        this.setError(\n          this.buildColumnCoercionError(\n            modelKey,\n            attribute,\n            String(firstMeta?.rawValue ?? ''),\n            declaredType,\n            group.length,\n          ),\n        );\n      }\n    }\n  }\n\n  private buildColumnCoercionError(\n    model: string,\n    attribute: string,\n    rawValue: string,\n    declaredType: string,\n    rowCount: number,\n  ): QualityAnalyzer.InternalModelError {\n    return {\n      title: 'Wrong Data Type',\n      type: 'model',\n      errorGroup: 'DataContainerError',\n      errorType: 'WrongDataType',\n      model,\n      attribute,\n      description: `${rowCount} value(s) in column \"${attribute}\" of model \"${model}\" failed to coerce to the declared type \"${declaredType}\" (e.g. \"${rawValue}\")`,\n      meta: {\n        rawValue,\n        declaredType,\n        rowCount,\n      },\n    };\n  }\n\n  private buildAbsentColumnError(model: string, attribute: string): QualityAnalyzer.InternalModelError {\n    return {\n      title: 'Missing Data',\n      type: 'model',\n      errorGroup: 'DataContainerError',\n      errorType: 'UndefinedAttribute',\n      model,\n      attribute,\n      description: `The Attribute \"${attribute}\" is not present in the dataset for model \"${model}\"`,\n    };\n  }\n\n  public getModelErrors(modelKey: string): QualityAnalyzer.InternalModelError[] {\n    return this.getErrors().filter(\n      (e) => e.type === 'model' && e.model === modelKey,\n    ) as QualityAnalyzer.InternalModelError[];\n  }\n\n  /**\n   * Clean up errors for specific items and attributes only\n   * @param model - The model to clean errors for\n   * @param itemKeys - Set of item keys to clean errors for\n   * @param attributesOrErrorType - Optional set of attribute keys to clean errors for, or errorType for backwards compatibility\n   * @param errorType - Optional error type to filter by\n   */\n  public cleanUpErrorsForItems(\n    model: DcuplModel,\n    itemKeys: Set<string>,\n    attributesOrErrorType?: Set<string> | QualityAnalyzer.ModelErrorType,\n    errorType?: QualityAnalyzer.ModelErrorType,\n  ): void {\n    // Handle backwards compatibility: if 3rd param is a string (errorType), treat it as such\n    let attributes: Set<string> | undefined;\n    let actualErrorType: QualityAnalyzer.ModelErrorType | undefined;\n\n    if (typeof attributesOrErrorType === 'string') {\n      // Backwards compat: 3rd param is errorType\n      actualErrorType = attributesOrErrorType;\n    } else if (attributesOrErrorType instanceof Set) {\n      // New behavior: 3rd param is attributes Set\n      attributes = attributesOrErrorType;\n      actualErrorType = errorType;\n    }\n\n    const modelErrors = this.getModelErrors(model.key);\n    const relevantErrors = actualErrorType\n      ? modelErrors.filter((error) => error.errorType === actualErrorType)\n      : modelErrors;\n\n    for (const error of relevantErrors) {\n      if (error.itemKey && itemKeys.has(error.itemKey)) {\n        // If attributes filter is provided, only remove errors for those attributes\n        if (attributes && error.attribute && !attributes.has(error.attribute)) {\n          continue;\n        }\n        this.removeError(error.key!);\n      }\n    }\n  }\n\n  /**\n   * Get errors for specific items\n   * @param modelKey - The model key\n   * @param itemKeys - Set of item keys to get errors for\n   * @returns Array of errors for the specified items\n   */\n  public getErrorsForItems(modelKey: string, itemKeys: Set<string>): QualityAnalyzer.InternalModelError[] {\n    const modelErrors = this.getModelErrors(modelKey);\n    return modelErrors.filter((error) => error.itemKey && itemKeys.has(error.itemKey));\n  }\n\n  /**\n   * Validate specific items and attributes only (partial validation)\n   * @param model - The model to validate\n   * @param itemKeys - Set of item keys to validate\n   * @param attributes - Set of attribute keys to validate\n   * @returns Array of validation errors found\n   */\n  public validateItemsPartial(\n    model: DcuplModel,\n    itemKeys: Set<string>,\n    attributes: Set<string>,\n  ): QualityAnalyzer.InternalModelError[] {\n    if (!model) {\n      return [];\n    }\n\n    const errors: QualityAnalyzer.InternalModelError[] = [];\n    const dataMap = model.getData();\n    const modelAttributes = model.getAttributes();\n\n    // Validate each specified attribute for each specified item\n    for (const attribute of modelAttributes) {\n      if (!attributes.has(attribute.key)) {\n        continue;\n      }\n\n      const validators = attribute.quality?.validators;\n      if (!validators) {\n        continue;\n      }\n\n      // Directly access only the items we need from the Map\n      for (const itemKey of itemKeys) {\n        const item = dataMap.get(itemKey);\n        if (!item) {\n          continue;\n        }\n\n        const value = item[attribute.key];\n\n        // Validate the attribute value\n        const attributeErrors = this.validateAttribute(value, validators, attribute.key);\n\n        // Add model and itemKey context to errors\n        for (const error of attributeErrors) {\n          error.model = model.key;\n          error.itemKey = item.key;\n          errors.push(error);\n        }\n      }\n    }\n\n    return errors;\n  }\n\n  /**\n   * Prepares the error records of `model` for a partial update, so that the\n   * update leaves the same records and summary() counts as init() on the same\n   * data (#368). Removes the errors the update re-derives:\n   * - every data error of a deleted item;\n   * - the attribute errors of the changed items for the changed attributes —\n   *   step 1 of the partial path reprocesses exactly these rows (`itemKeys`)\n   *   and `attributes`;\n   * - the `unique` errors when rows changed: the check compares all rows and\n   *   finishPartialUpdate() re-runs it.\n   *\n   * Returns the attributes whose errors must be derived from every row\n   * instead; all their attribute errors are removed and the partial path\n   * reprocesses them for all rows:\n   * - an attribute with a per-attribute aggregate (UndefinedAttribute,\n   *   WrongDataType): the aggregate stands for rows the update does not\n   *   reprocess;\n   * - an attribute with an error group capped by `maxErrorsPerGroup`: its\n   *   unstored errors cannot be removed one by one;\n   * - a `unique` attribute with strict handling when rows changed: init()\n   *   dropped the duplicate values, only reprocessing restores them for the\n   *   re-check.\n   */\n  public prepareErrorsForPartialUpdate(\n    model: DcuplModel,\n    attributes: ReadonlySet<string>,\n    itemKeys: ReadonlySet<string>,\n    deletedItemKeys: ReadonlySet<string>,\n  ): Set<string> {\n    const allRowsAttributes = new Set<string>();\n    if (!this.enabled || model.qualityConfig.enabled !== true) {\n      return allRowsAttributes;\n    }\n\n    const rowsChanged = itemKeys.size > 0 || deletedItemKeys.size > 0;\n    const uniqueAttributes = rowsChanged ? this.getUniqueAttributes(model) : new Set<string>();\n    const modelErrors = this.getModelErrors(model.key);\n\n    const storedPerGroup = new Map<string, number>();\n    for (const error of modelErrors) {\n      const groupKey = this.getErrorGroupKey(error);\n      storedPerGroup.set(groupKey, (storedPerGroup.get(groupKey) ?? 0) + 1);\n      if (\n        error.attribute != null &&\n        error.itemKey == null &&\n        error.errorGroup === 'DataContainerError' &&\n        ATTRIBUTE_ERROR_TYPES.has(error.errorType) &&\n        (attributes.has(error.attribute) || uniqueAttributes.has(error.attribute))\n      ) {\n        allRowsAttributes.add(error.attribute);\n      }\n    }\n    for (const [groupKey, group] of this.errorCounts) {\n      if (\n        group.model === model.key &&\n        group.attribute != null &&\n        ATTRIBUTE_ERROR_TYPES.has(group.errorType) &&\n        (attributes.has(group.attribute) || uniqueAttributes.has(group.attribute)) &&\n        group.count > (storedPerGroup.get(groupKey) ?? 0)\n      ) {\n        allRowsAttributes.add(group.attribute);\n      }\n    }\n    for (const attribute of uniqueAttributes) {\n      if (this.isStrictValidatorHandling(model, attribute)) {\n        allRowsAttributes.add(attribute);\n      }\n    }\n\n    for (const error of modelErrors) {\n      const attribute = error.attribute;\n      const itemKey = error.itemKey == null ? undefined : String(error.itemKey);\n      if (itemKey !== undefined && deletedItemKeys.has(itemKey) && DATA_ERROR_GROUPS.includes(error.errorGroup)) {\n        this.removeError(error.key!);\n      } else if (attribute == null || !ATTRIBUTE_ERROR_TYPES.has(error.errorType)) {\n        continue;\n      } else if (allRowsAttributes.has(attribute)) {\n        this.removeError(error.key!);\n      } else if (\n        itemKey !== undefined &&\n        itemKeys.has(itemKey) &&\n        attributes.has(attribute) &&\n        error.errorGroup !== 'DataContainerError'\n      ) {\n        this.removeError(error.key!);\n      } else if (uniqueAttributes.has(attribute) && error.title === UNIQUE_ERROR_TITLE) {\n        this.removeError(error.key!);\n      }\n    }\n    // A capped group keeps counting errors it did not store: drop the count too.\n    for (const [groupKey, group] of this.errorCounts) {\n      if (\n        group.model === model.key &&\n        group.attribute != null &&\n        allRowsAttributes.has(group.attribute) &&\n        ATTRIBUTE_ERROR_TYPES.has(group.errorType)\n      ) {\n        this.errorCounts.delete(groupKey);\n        this.errorsChangedSinceInitData = true;\n      }\n    }\n\n    return allRowsAttributes;\n  }\n\n  /**\n   * Completes the error records of `model` after a partial update (#368), the\n   * way init() does: consolidates the reprocessed `attributes` into\n   * per-attribute aggregates (cleanUpErrors) and, when rows changed, re-runs\n   * the `unique` validators (whose errors prepareErrorsForPartialUpdate()\n   * removed). `dataContainer` is the model's complete merged container.\n   */\n  public finishPartialUpdate(\n    model: DcuplModel,\n    dataContainer: DataContainer,\n    attributes: ReadonlySet<string>,\n    rowsChanged: boolean,\n  ): void {\n    if (!this.enabled || model.qualityConfig.enabled !== true) {\n      return;\n    }\n    this.cleanUpErrors(model, dataContainer, attributes);\n    if (rowsChanged) {\n      for (const error of this.validateAttributesAfterInitialization(model)) {\n        this.setError(error);\n      }\n    }\n  }\n\n  private getUniqueAttributes(model: DcuplModel): Set<string> {\n    const uniqueAttributes = new Set<string>();\n    for (const attribute of model.getAttributes()) {\n      if (attribute.quality?.validators?.unique) {\n        uniqueAttributes.add(attribute.key);\n      }\n    }\n    return uniqueAttributes;\n  }\n\n  /** Strict unless the attribute's quality config says `'loose'` (as validateUnique decides). */\n  private isStrictValidatorHandling(model: DcuplModel, attribute: string): boolean {\n    return model['attributeQualityConfigs']?.get(attribute)?.validatorHandling !== 'loose';\n  }\n\n  /**\n   * Whether the error records changed since initData() last published them to the\n   * $DcuplErrorTracking* models; a partial update skips the rebuild otherwise (#368).\n   */\n  public hasErrorChangesSinceInitData(): boolean {\n    return this.errorsChangedSinceInitData;\n  }\n\n  public async initData(): Promise<void> {\n    if (!this.modelParser) {\n      return;\n    }\n    // An earlier snapshot nobody read: process it before it is replaced, as the eager build did,\n    // so $DcuplErrorTrackingModel (auto-created from both models' `model` reference; initData() never\n    // resets it) keeps the model keys every apply published (#444). Only the partial path gets here\n    // with a snapshot: a full init() drops it first (discardPendingErrorTrackingSnapshot).\n    const superseded = this.pendingErrorTrackingContainers;\n    if (superseded) {\n      this.pendingErrorTrackingContainers = undefined;\n      await this.modelParser['handleDataContainer'](superseded);\n    }\n    this.errorsChangedSinceInitData = false;\n\n    // Drop error containers pushed by previous initData() calls. Otherwise they\n    // pile up in unprocessedData and the next init() reprocesses a stale error\n    // snapshot, leaving $DcuplErrorTrackingErrors one update() cycle behind\n    // getErrors() (see issue #174, Bug 1).\n    this.modelParser['unprocessedData'] = this.modelParser['unprocessedData'].filter(\n      (d) => !ERROR_TRACKING_ROW_MODELS.includes(d.model),\n    );\n\n    // Rebuild the error models from scratch so their data maps and indices\n    // reflect the current error set rather than whatever an earlier pipeline\n    // step left.\n    this.resetErrorTrackingRowModels();\n\n    // The summary carries the exact per-group totals the capped record set\n    // cannot express (#204); the same totals are stamped onto the records.\n    const summary = this.getErrorSummary();\n    this.stampGroupTotals(summary);\n\n    this.modelParser.addData({\n      data: this.getErrors(),\n      model: '$DcuplErrorTrackingErrors',\n      type: 'set',\n    });\n    this.modelParser.addData({\n      data: summary,\n      model: '$DcuplErrorTrackingSummary',\n      type: 'set',\n    });\n\n    const containers = this.modelParser['unprocessedData'].filter((d) => ERROR_TRACKING_ROW_MODELS.includes(d.model));\n\n    if (containers.length === 0) {\n      return;\n    }\n    if (this.hasErrorTrackingLists()) {\n      // the apply refreshes these lists next: build now, as before #444\n      await this.modelParser['handleDataContainer'](containers);\n    } else {\n      // built on first read (materializeErrorTrackingModels); until then their rows and indices\n      // take no memory (#444)\n      this.pendingErrorTrackingContainers = containers;\n    }\n  }\n\n  /**\n   * Builds $DcuplErrorTrackingErrors / -Summary from the error set the last init()/update()\n   * published, if no read built them since (#444). Every read of a $DcuplErrorTracking* model\n   * calls it first (ModelParser.prepareModelForRead), so a read returns what the build at\n   * init()/update() returned, and a read between two updates never sees an older set (#174).\n   * The rows go in through the parser's data processing, which leaves the change tracker and the\n   * error records alone.\n   *\n   * A read while an apply is suspended mid-processing is not guarded: reads were never queued\n   * behind applies, and what such a read sees of the error models is the state the apply has\n   * reached.\n   */\n  public materializeErrorTrackingModels(): void {\n    const containers = this.pendingErrorTrackingContainers;\n    if (!containers || !this.modelParser) {\n      return;\n    }\n    this.pendingErrorTrackingContainers = undefined;\n    try {\n      this.modelParser.processDataContainersSync(containers);\n    } catch (err) {\n      // not built: empty what the failed run half filled, so the next read builds from scratch\n      // instead of on top of it (or serving half-built models)\n      this.resetErrorTrackingRowModels();\n      this.pendingErrorTrackingContainers ??= containers;\n      throw err;\n    }\n  }\n\n  /**\n   * Drops the snapshot initData() queued and nothing has read, without building it. A full init()\n   * calls it right after prepareModels() reset the error-tracking models: the containers of the\n   * last apply are still queued, so the init pipeline processes them again, as before #444, and\n   * initData() stages the new set at its end. Replaying the unread snapshot as well would serve\n   * rows of an apply that is gone: after a full apply that fails (getErrors() is empty then), or\n   * for models that left the queue before init().\n   */\n  public discardPendingErrorTrackingSnapshot(): void {\n    this.pendingErrorTrackingContainers = undefined;\n  }\n\n  /** Empties the rows and the indices of $DcuplErrorTrackingErrors and -Summary. */\n  private resetErrorTrackingRowModels(): void {\n    for (const modelKey of ERROR_TRACKING_ROW_MODELS) {\n      const model = this.modelParser?.models.get(modelKey);\n      model?.resetData();\n      model?.resetIndexMap();\n    }\n  }\n\n  /**\n   * Whether a list over a $DcuplErrorTracking* model exists, the hidden `__global_list__…` lists\n   * of `query.execute` / `fn.*` included. The apply refreshes such a list right after\n   * initData(), so initData() builds the models for it at once (#444).\n   */\n  private hasErrorTrackingLists(): boolean {\n    return this.dcupl?.lists.getAll().some((list) => list.modelKey?.startsWith(ERROR_TRACKING_MODEL_PREFIX)) ?? false;\n  }\n\n  public initErrorTrackingModels(): void {\n    this.modelParser?.addModel({\n      key: '$DcuplErrorTrackingErrors',\n      autoGenerateKey: true,\n      supportsAutoCreation: true,\n      references: [\n        {\n          key: 'model',\n          type: 'singleValued',\n          model: '$DcuplErrorTrackingModel',\n          filter: {\n            calculateFacets: true,\n          },\n        },\n        {\n          key: 'errorGroup',\n          type: 'singleValued',\n          model: '$DcuplErrorTrackingGroup',\n          filter: {\n            calculateFacets: true,\n          },\n        },\n        {\n          key: 'errorType',\n          type: 'singleValued',\n          model: '$DcuplErrorTrackingType',\n          filter: {\n            calculateFacets: true,\n          },\n        },\n      ],\n      properties: [\n        {\n          key: 'title',\n          type: 'string',\n          filter: true,\n        },\n        {\n          key: 'itemKey',\n          type: 'string',\n          filter: true,\n        },\n        {\n          key: 'attribute',\n          type: 'string',\n          filter: true,\n        },\n        {\n          key: 'description',\n          type: 'string',\n        },\n        {\n          key: 'meta',\n          type: 'json',\n        },\n        {\n          key: 'groupTotal',\n          type: 'int',\n        },\n        {\n          key: 'truncated',\n          type: 'boolean',\n          filter: true,\n        },\n      ],\n      quality: {\n        enabled: false,\n      },\n    });\n\n    // One row per (model, attribute, errorType) group with the exact total,\n    // independent of the maxErrorsPerGroup record cap (#204).\n    this.modelParser?.addModel({\n      key: '$DcuplErrorTrackingSummary',\n      supportsAutoCreation: true,\n      references: [\n        {\n          key: 'model',\n          type: 'singleValued',\n          model: '$DcuplErrorTrackingModel',\n          filter: {\n            calculateFacets: true,\n          },\n        },\n        {\n          key: 'errorGroup',\n          type: 'singleValued',\n          model: '$DcuplErrorTrackingGroup',\n          filter: {\n            calculateFacets: true,\n          },\n        },\n        {\n          key: 'errorType',\n          type: 'singleValued',\n          model: '$DcuplErrorTrackingType',\n          filter: {\n            calculateFacets: true,\n          },\n        },\n      ],\n      properties: [\n        {\n          key: 'attribute',\n          type: 'string',\n          filter: true,\n        },\n        {\n          key: 'type',\n          type: 'string',\n          filter: true,\n        },\n        {\n          key: 'totalCount',\n          type: 'int',\n          filter: true,\n        },\n        {\n          key: 'storedCount',\n          type: 'int',\n        },\n        {\n          key: 'truncated',\n          type: 'boolean',\n          filter: true,\n        },\n      ],\n      quality: {\n        enabled: false,\n      },\n    });\n\n    this.modelParser?.addModel({\n      key: '$DcuplErrorTrackingType',\n      data: [\n        { key: 'UndefinedAttribute' },\n        { key: 'InvalidValidator' },\n        { key: 'UndefinedValue' },\n        { key: 'NullValue' },\n        { key: 'WrongDataType' },\n        { key: 'MissingModel' },\n        { key: 'NonUniqueKey' },\n        { key: 'RemoteReferenceKeyNotFound' },\n        { key: 'InvalidModelDescription' },\n        { key: 'InvalidResource' },\n        { key: 'InvalidModelDefinition' },\n        { key: 'EndpointScriptMissing' },\n        { key: 'EndpointDuplicate' },\n      ],\n      quality: {\n        enabled: false,\n      },\n    });\n\n    this.modelParser?.addModel({\n      key: '$DcuplErrorTrackingGroup',\n      data: [\n        { key: 'ReferenceDataError' },\n        { key: 'PropertyDataError' },\n        { key: 'DataContainerError' },\n        { key: 'ModelDescriptionError' },\n        { key: 'LoaderError' },\n        { key: 'ResourceError' },\n        { key: 'ModelDefinitionError' },\n      ],\n      quality: {\n        enabled: false,\n      },\n    });\n\n    this.modelParser?.addModel({\n      key: '$DcuplErrorTrackingModel',\n      supportsAutoCreation: true,\n      quality: {\n        enabled: false,\n      },\n    });\n  }\n\n  public initAnalyticsValues(): void {\n    this.calculateTiming();\n    this.calculateSizes();\n    this.calculateErrorTrackingFacet();\n    this.calculateCounts();\n    this.calculateUnusedAttributes();\n  }\n\n  private calculateUnusedAttributes(): void {\n    this.values.unusedAttributes = [];\n\n    const models = this.dcupl.models.keys();\n    for (const modelKey of models) {\n      const unusedAttributesForModel = this.getUnusedAttributesFromModel(this.dcupl, modelKey);\n      for (const attr of unusedAttributesForModel) {\n        this.values.unusedAttributes?.push({\n          model: modelKey,\n          attribute: attr,\n        });\n      }\n    }\n  }\n\n  private calculateCounts(): void {\n    this.values.counts = {};\n\n    // const progress = this.progress.getValue();\n    // this.values.counts.resources = progress?.total;\n\n    this.values.counts.modelFiles = this.dcupl['modelParser'].unprocessedModelDescriptions.size;\n    this.values.counts.dataFiles = this.dcupl['modelParser']['unprocessedData'].length;\n    this.values.counts.models = this.dcupl.models.keys().length;\n\n    let rows = 0;\n    let attributes = 0;\n    let values = 0;\n\n    this.dcupl.models.keys().forEach((modelKey) => {\n      const model = this.dcupl['modelParser'].models.get(modelKey);\n\n      if (!model) {\n        return;\n      }\n\n      const properties = model?.getBasicProperties() || [];\n      const references = model?.getBasicReferences() || [];\n\n      const modelAttributes = properties.length + references.length;\n      attributes += modelAttributes;\n\n      const data = model['data'];\n      const modelRows = data?.size || 0;\n      rows += modelRows;\n      values += modelAttributes * modelRows;\n    });\n\n    this.values.counts.rows = rows;\n    this.values.counts.attributes = attributes;\n    this.values.counts.dataEntries = values;\n  }\n\n  private calculateTiming(): void {\n    const loadingValue = this.dcupl['analyticsController'].getByName('loader_processed');\n\n    if (loadingValue && loadingValue[0]) {\n      this.values.loading = loadingValue[0].value;\n    }\n    const processValue = this.dcupl['analyticsController'].getByName('dcupl_initialized');\n\n    if (processValue && processValue[0]) {\n      this.values.processing = processValue[0].value;\n    }\n\n    this.values.startup = this.values.loading + this.values.processing;\n  }\n\n  private calculateSizes(): void {\n    const sizes = this.calculateSizesForModels();\n    this.values.sizes = {};\n    this.values.sizes.totalEncoded = sizes.reduce((acc, item) => acc + item.encodedBodySize!, 0);\n    this.values.sizes.totalDecoded = sizes.reduce((acc, item) => acc + item.decodedBodySize!, 0);\n    this.values.sizes.unusedDecoded = this.calculateUnusedData();\n\n    this.values.sizes.models = sizes.map((item) => {\n      return {\n        model: item.model,\n        decodedBodySize: item.decodedBodySize,\n        encodedBodySize: item.encodedBodySize,\n      };\n    }) as AnalyticsEntryResourceValue[];\n\n    this.values.sizes.models?.sort((a, b) => (b.encodedBodySize || 0) - (a.encodedBodySize || 0));\n  }\n\n  private calculateErrorTrackingFacet(): void {\n    try {\n      if (!this.enabled) {\n        return;\n      }\n      // Exact per-group totals, not facet sizes over the capped\n      // $DcuplErrorTrackingErrors records (#204).\n      const totalByType = new Map<string, number>();\n      let size = 0;\n      for (const group of this.errorCounts.values()) {\n        totalByType.set(group.errorType, (totalByType.get(group.errorType) ?? 0) + group.count);\n        size += group.count;\n      }\n      this.values.errors = {\n        size,\n        UndefinedValue: totalByType.get('UndefinedValue') ?? 0,\n        UndefinedAttribute: totalByType.get('UndefinedAttribute') ?? 0,\n        WrongDataType: totalByType.get('WrongDataType') ?? 0,\n        MissingModel: totalByType.get('MissingModel') ?? 0,\n        InvalidModelDescription: totalByType.get('InvalidModelDescription') ?? 0,\n        RemoteReferenceKeyNotFound: totalByType.get('RemoteReferenceKeyNotFound') ?? 0,\n      };\n    } catch (err) {\n      this.log.error('Error calculating error tracking facet', err as Error);\n    }\n  }\n\n  private calculateSizesForModels(): Partial<AnalyticsEntryResourceValue>[] {\n    const allProcessingData = this.dcupl['analyticsController'].getByType('resource') as AnalyticsEntryResource[];\n\n    const onlyDataResources = allProcessingData.filter((item) => item.value?.type === 'data');\n\n    const groupedByModel = groupBy(onlyDataResources, (item) => item.value?.model);\n\n    const summedUpByModel = Object.keys(groupedByModel).map((key) => {\n      const encodedBodySize = groupedByModel[key]?.reduce((acc, item) => {\n        const size = item.value.encodedBodySize;\n        return acc + size;\n      }, 0);\n\n      const decodedBodySize = groupedByModel[key]?.reduce((acc, item) => {\n        const size = item.value.decodedBodySize;\n        return acc + size;\n      }, 0);\n\n      return {\n        model: key,\n        decodedBodySize: decodedBodySize,\n        encodedBodySize: encodedBodySize,\n      };\n    });\n    return summedUpByModel;\n  }\n\n  public calculateUnusedData(): number {\n    const models = this.dcupl.models.keys();\n\n    // let totalLength = 0;\n    let unusedDataLength = 0;\n\n    models.forEach((modelKey) => {\n      const relevantData =\n        this.dcupl['modelParser']['unprocessedData'].find((container: DataContainer) => container.model === modelKey)\n          ?.data || [];\n\n      const unusedAttributesForModel = this.getUnusedAttributesFromModel(this.dcupl, modelKey);\n\n      // totalLength += JSON.stringify(relevantData).length;\n\n      if (!unusedAttributesForModel.length) {\n        return;\n      }\n      const unusedData = this.getDataWithAttributes(relevantData, unusedAttributesForModel);\n      unusedDataLength += JSON.stringify(unusedData).length;\n    });\n\n    return unusedDataLength;\n  }\n\n  private getDataWithAttributes(data: any, attribute: string[]): any[] {\n    return data.map((item: any) => {\n      const newItem: any = {};\n\n      attribute.forEach((attr) => {\n        newItem[attr] = item[attr];\n      });\n\n      return newItem;\n    });\n  }\n\n  private getUnusedAttributesFromModel(dcupl: DcuplApi, modelKey: string): string[] {\n    const model = dcupl['modelParser'].models.get(modelKey);\n    const properties = model?.getBasicProperties() || [];\n    const references = model?.getBasicReferences() || [];\n    const keyProperty = model?.keyProperty;\n\n    const attributes = [...properties, ...references].map((a) => a.key);\n    if (typeof keyProperty === 'string') {\n      attributes.push(keyProperty);\n    } else if (Array.isArray(keyProperty)) {\n      attributes.push(...keyProperty);\n    } else {\n      attributes.push('key');\n    }\n    attributes.push('key');\n\n    const relevantData =\n      dcupl['modelParser']['unprocessedData'].find((container: DataContainer) => container.model === modelKey)?.data ||\n      [];\n\n    return this.getUnusedAttributes(relevantData, attributes);\n  }\n\n  private getUnusedAttributes(data: any[], attributes: string[]): string[] {\n    const unusedAttributes = new Set<string>();\n\n    data.forEach((item) => {\n      Object.keys(item).forEach((key) => {\n        if (!attributes.includes(key)) {\n          unusedAttributes.add(key);\n        }\n      });\n    });\n\n    return Array.from(unusedAttributes.values());\n  }\n\n  public validateAttribute(\n    value: any,\n    validators: AttributeValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError[] {\n    const validationErrors: QualityAnalyzer.InternalModelError[] = [];\n\n    // if (validators.custom) {\n    //   const error = this.validateCustom(value, validators.custom, attribute);\n    //   if (error) {\n    //     validationErrors.push(error);\n    //   }\n    // }\n\n    if (validators.email) {\n      const error = this.validateEmail(value, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.endsWith) {\n      const error = this.validateEndsWith(value, validators.endsWith, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.enum) {\n      const error = this.validateEnum(value, validators.enum, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.includes) {\n      const error = this.validateIncludes(value, validators.includes, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.max) {\n      const error = this.validateMax(value, validators.max, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.maxLength) {\n      const error = this.validateMaxLength(value, validators.maxLength, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.min) {\n      const error = this.validateMin(value, validators.min, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.minLength) {\n      const error = this.validateMinLength(value, validators.minLength, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.pattern) {\n      const error = this.validatePattern(value, validators.pattern, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    if (validators.startsWith) {\n      const error = this.validateStartsWith(value, validators.startsWith, attribute);\n      if (error) {\n        validationErrors.push(error);\n      }\n    }\n\n    return validationErrors;\n  }\n\n  public validateAttributesAfterInitialization(model: DcuplModel): QualityAnalyzer.InternalModelError[] {\n    if (!model) {\n      return [];\n    }\n    const attributes = model.getAttributes();\n    const data = model.getDataAsArray();\n    const errors: QualityAnalyzer.InternalModelError[] = [];\n    for (const attribute of attributes) {\n      const validators = attribute.quality?.validators;\n      if (validators) {\n        if (validators.unique) {\n          const uniqueErrors = this.validateUnique(data, attribute.key, model);\n          errors.push(...uniqueErrors);\n        }\n      }\n    }\n    return errors;\n  }\n\n  private validateUnique(data: ListItem[], attribute: string, model: DcuplModel): QualityAnalyzer.InternalModelError[] {\n    const uniqueErrors: QualityAnalyzer.InternalModelError[] = [];\n    const uniqueValues = new Set();\n\n    // Check if validator handling is strict for this attribute\n    const isStrict = this.isStrictValidatorHandling(model, attribute);\n\n    for (const item of data) {\n      const value = item[attribute];\n      if (uniqueValues.has(value)) {\n        const error: QualityAnalyzer.InternalModelError = {\n          title: UNIQUE_ERROR_TITLE,\n          type: 'model',\n          errorGroup: 'PropertyDataError',\n          model: model.key,\n          errorType: 'InvalidValidator',\n          attribute: attribute,\n          itemKey: item.key,\n          description: `The value \"${value}\" is not unique`,\n        };\n        uniqueErrors.push(error);\n\n        // Remove duplicate value in strict mode\n        if (isStrict) {\n          delete item[attribute];\n        }\n      } else {\n        uniqueValues.add(value);\n      }\n    }\n    return uniqueErrors;\n  }\n\n  // private validateCustom(\n  //   value: string,\n  //   config: CustomValidatorConfig,\n  //   attribute: string,\n  // ): QualityAnalyzer.InternalModelError | undefined {\n  //   const customScript = this.scriptsController.getScript(config.key);\n  //   if (!customScript) {\n  //     console.log('Custom Validator script not found');\n  //   }\n  //   const result = this.scriptsController.executeScript(config.key, 'validator', { value, config, attribute });\n  //   if (result !== true) {\n  //     return {\n  //       title: 'Validator Error - Custom Script',\n  //       type: 'model',\n  //       errorGroup: 'PropertyDataError',\n  //       errorType: 'InvalidValidator',\n  //       attribute: attribute,\n  //       description: `The value \"${value}\" does not pass the custom validation`,\n  //       meta: result,\n  //     };\n  //   }\n\n  //   return;\n  // }\n\n  private validateEmail(value: string, attribute: string): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    const emailRegex = /^[\\w.-]+@[a-zA-Z\\d.-]+\\.[a-zA-Z]{2,6}$/;\n    if (!emailRegex.test(value)) {\n      return {\n        title: 'Validator Error - Invalid Email',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" is not a valid email address`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateMin(\n    value: any,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value < config.value) {\n      return {\n        title: 'Validator Error - Min Value',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" is smaller than the minimum value of \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateMax(\n    value: any,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value > config.value) {\n      return {\n        title: 'Validator Error - Max Value',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" is larger than the maximum value of \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateStartsWith(\n    value: string,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    if (!value.startsWith(config.value)) {\n      return {\n        title: 'Validator Error - StartsWith',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" does not start with \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateEndsWith(\n    value: string,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    if (!endsWith(value, config.value)) {\n      return {\n        title: 'Validator Error - EndsWith',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" does not end with \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n  private validateIncludes(\n    value: string,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    if (!includes(value, config.value)) {\n      return {\n        title: 'Validator Error - Includes',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" does not include \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateMinLength(\n    value: string,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    if (value.length < config.value) {\n      return {\n        title: 'Validator Error - Min Length',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" is shorter than the minimum length of \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateMaxLength(\n    value: string,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    if (value.length > config.value) {\n      return {\n        title: 'Validator Error - Max Length',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" is longer than the maximum length of \"${config.value}\"`,\n      };\n    }\n    return undefined;\n  }\n\n  private validateEnum(\n    value: any,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (!config.value.includes(value)) {\n      return {\n        title: 'Validator Error - Enum',\n        type: 'model',\n        errorGroup: 'PropertyDataError',\n        errorType: 'InvalidValidator',\n        attribute: attribute,\n        description: `The value \"${value}\" is not in the enum values`,\n      };\n    }\n    return undefined;\n  }\n\n  private validatePattern(\n    value: string,\n    config: ValidatorConfig,\n    attribute: string,\n  ): QualityAnalyzer.InternalModelError | undefined {\n    if (value == null) {\n      return undefined;\n    }\n    try {\n      const pattern = new RegExp(config.value);\n      if (!pattern.test(value)) {\n        return {\n          title: 'Validator Error - Pattern',\n          type: 'model',\n          errorGroup: 'PropertyDataError',\n          errorType: 'InvalidValidator',\n          attribute: attribute,\n          description: `The value \"${value}\" does not match the pattern \"${config.value}\"`,\n        };\n      }\n    } catch (err) {\n      this.log.error('Invalid pattern validation', err as Error);\n    }\n    return undefined;\n  }\n}\n","import { DataContainer, RawItem } from '@dcupl/common';\n\n/**\n * Change tracking state machine states\n * - clean: No changes tracked\n * - tracking: Actively tracking incremental changes\n * - full-reset: A full reset occurred, all subsequent changes are part of the reset\n */\ntype ChangeTrackerState = 'clean' | 'tracking' | 'full-reset';\n\n/**\n * ChangeTracker detects and records which attributes and items have changed during data updates.\n *\n * This enables partial updates by tracking:\n * - Which model attributes have changed\n * - Which specific items were added/modified/deleted\n * - Whether a full model reset occurred (type='set')\n *\n * State Machine:\n * - clean → tracking (first update/upsert/remove)\n * - clean → full-reset (first set)\n * - tracking → full-reset (set occurs)\n * - full-reset → full-reset (stays in full-reset until clear())\n * - any → clean (clear() called)\n */\nexport class ChangeTracker {\n  private changedAttributes: Map<string, Set<string>>; // modelKey → Set<attributeKeys>\n  private changedItems: Map<string, Set<string>>; // modelKey → Set<itemKeys>\n  private deletedItems: Map<string, Set<string>>; // modelKey → Set<itemKeys>\n  // modelKey → row arrays of the recorded update/upsert (changed) and remove\n  // (deleted) containers, kept for refreshItemKeys()\n  private changedRows: Map<string, RawItem[][]>;\n  private deletedRows: Map<string, RawItem[][]>;\n  private modelFullReset: Set<string>; // Models that had type='set' (full reset)\n  private state: ChangeTrackerState = 'clean';\n\n  constructor() {\n    this.changedAttributes = new Map();\n    this.changedItems = new Map();\n    this.deletedItems = new Map();\n    this.changedRows = new Map();\n    this.deletedRows = new Map();\n    this.modelFullReset = new Set();\n  }\n\n  /**\n   * Records changes from a data container using state machine logic\n   * @param container - The data container with changes\n   */\n  public recordDataChange(container: DataContainer<RawItem>): void {\n    const modelKey = container.model;\n\n    // An empty incremental container changes nothing. An empty `set` is a\n    // full reset of the model (data.reset / data.set([])) and must be\n    // tracked like any other `set` (#257).\n    if (container.type !== 'set' && (!container.data || container.data.length === 0)) {\n      return;\n    }\n\n    // State machine transitions\n    if (container.type === 'set') {\n      // Transition to full-reset state if this is the first change\n      if (this.state === 'clean') {\n        this.state = 'full-reset';\n      } else if (this.state === 'tracking') {\n        // Transition from tracking to full-reset\n        // Clear tracked changes for this specific model as they're now irrelevant\n        this.state = 'full-reset';\n        this.changedAttributes.delete(modelKey);\n        this.changedItems.delete(modelKey);\n        this.deletedItems.delete(modelKey);\n        this.changedRows.delete(modelKey);\n        this.deletedRows.delete(modelKey);\n      }\n      // If already in full-reset, just add this model to the full reset set\n\n      // Mark model for full reset\n      this.modelFullReset.add(modelKey);\n    } else {\n      // For incremental changes (update, upsert, remove)\n\n      // If this specific model already had a type='set', don't track incremental changes for it\n      if (this.modelFullReset.has(modelKey)) {\n        return;\n      }\n\n      // Transition from clean to tracking (if needed)\n      if (this.state === 'clean') {\n        this.state = 'tracking';\n      } else if (this.state === 'full-reset') {\n        // If we're in full-reset state but this is a different model, we can track it\n        this.state = 'tracking';\n      }\n\n      // Track changes normally\n      if (container.type === 'remove') {\n        // Track deleted items\n        this.recordDeletedItems(modelKey, container.data);\n        // Note: Reference attributes are recorded as changed in model-parser.partialUpdate()\n      } else {\n        // update or upsert - track changed attributes and items\n        this.recordChangedData(modelKey, container.data);\n      }\n    }\n  }\n\n  /**\n   * Records a specific attribute change\n   * @param modelKey - The model key\n   * @param attributeKey - The attribute key that changed\n   */\n  public recordAttributeChange(modelKey: string, attributeKey: string): void {\n    if (!this.changedAttributes.has(modelKey)) {\n      this.changedAttributes.set(modelKey, new Set());\n    }\n    this.changedAttributes.get(modelKey)!.add(attributeKey);\n  }\n\n  /**\n   * Records changed data items and determines which attributes changed\n   * @param modelKey - The model key\n   * @param data - The changed data items\n   */\n  private recordChangedData(modelKey: string, data: RawItem[]): void {\n    // Get or create sets\n    if (!this.changedAttributes.has(modelKey)) {\n      this.changedAttributes.set(modelKey, new Set());\n    }\n    if (!this.changedItems.has(modelKey)) {\n      this.changedItems.set(modelKey, new Set());\n    }\n\n    const attributeSet = this.changedAttributes.get(modelKey)!;\n    const itemSet = this.changedItems.get(modelKey)!;\n    this.addRows(this.changedRows, modelKey, data);\n\n    for (const item of data) {\n      // Track item key\n      if (item.key) {\n        itemSet.add(String(item.key));\n      }\n\n      // Track all attributes present in this item\n      for (const attributeKey in item) {\n        if (attributeKey === 'key') continue; // Skip the key property itself\n        attributeSet.add(attributeKey);\n      }\n    }\n  }\n\n  /**\n   * Records deleted items\n   * @param modelKey - The model key\n   * @param data - The deleted data items\n   */\n  private recordDeletedItems(modelKey: string, data: RawItem[]): void {\n    if (!this.deletedItems.has(modelKey)) {\n      this.deletedItems.set(modelKey, new Set());\n    }\n\n    const deletedSet = this.deletedItems.get(modelKey)!;\n    this.addRows(this.deletedRows, modelKey, data);\n\n    for (const item of data) {\n      if (item.key) {\n        deletedSet.add(String(item.key));\n      }\n    }\n  }\n\n  private addRows(rowsByModel: Map<string, RawItem[][]>, modelKey: string, data: RawItem[]): void {\n    const rows = rowsByModel.get(modelKey);\n    if (rows) {\n      rows.push(data);\n    } else {\n      rowsByModel.set(modelKey, [data]);\n    }\n  }\n\n  /**\n   * Re-reads the changed and deleted item keys from the recorded rows. A row\n   * keyed by a custom `keyProperty` or by `autoGenerateKey` gets its `key`\n   * only when the parser applies the keys (`handleAlternativeKey`), after the\n   * row was recorded: without this its item was missing from\n   * getChangedItems() / getDeletedItems() (#368). Call it once the keys are\n   * applied.\n   */\n  public refreshItemKeys(): void {\n    const keysOf = (rowsByModel: Map<string, RawItem[][]>, itemsByModel: Map<string, Set<string>>): void => {\n      for (const [modelKey, containers] of rowsByModel) {\n        const itemKeys = new Set<string>();\n        for (const rows of containers) {\n          for (const row of rows) {\n            if (row.key) {\n              itemKeys.add(String(row.key));\n            }\n          }\n        }\n        itemsByModel.set(modelKey, itemKeys);\n      }\n    };\n    keysOf(this.changedRows, this.changedItems);\n    keysOf(this.deletedRows, this.deletedItems);\n  }\n\n  /**\n   * Gets all changed attributes grouped by model\n   * @returns Map of modelKey → Set of changed attributeKeys\n   */\n  public getChangedAttributes(): Map<string, Set<string>> {\n    return this.changedAttributes;\n  }\n\n  /**\n   * Gets changed attributes for a specific model\n   * @param modelKey - The model key\n   * @returns Set of changed attribute keys, or undefined if model has no changes\n   */\n  public getChangedAttributesForModel(modelKey: string): Set<string> | undefined {\n    return this.changedAttributes.get(modelKey);\n  }\n\n  /**\n   * Gets changed items for a specific model\n   * @param modelKey - The model key\n   * @returns Set of changed item keys, or empty set if no changes\n   */\n  public getChangedItems(modelKey: string): Set<string> {\n    return this.changedItems.get(modelKey) || new Set();\n  }\n\n  /**\n   * Gets deleted items for a specific model\n   * @param modelKey - The model key\n   * @returns Set of deleted item keys, or empty set if no deletions\n   */\n  public getDeletedItems(modelKey: string): Set<string> {\n    return this.deletedItems.get(modelKey) || new Set();\n  }\n\n  /**\n   * Gets all models that have changes (not full resets)\n   * @returns Array of model keys with changes\n   */\n  public getModelsWithChanges(): string[] {\n    const models = new Set<string>();\n\n    for (const modelKey of this.changedAttributes.keys()) {\n      models.add(modelKey);\n    }\n    for (const modelKey of this.changedItems.keys()) {\n      models.add(modelKey);\n    }\n    for (const modelKey of this.deletedItems.keys()) {\n      models.add(modelKey);\n    }\n\n    return Array.from(models);\n  }\n\n  /**\n   * Every model the pending update effectively touches: attribute changes,\n   * item changes, deletions AND full resets (#245). `getModelsWithChanges()`\n   * deliberately excludes full resets and a deletion records its attribute\n   * changes only later, inside the parser — so callers that need \"which\n   * models did this update change\" must not reconstruct the union from the\n   * per-kind accessors. Returns a fresh Set that survives `clear()`.\n   */\n  public getEffectivelyChangedModels(): Set<string> {\n    return new Set<string>([...this.getModelsWithChanges(), ...this.modelFullReset]);\n  }\n\n  /**\n   * Gets all models that had a full reset (type='set')\n   * @returns Set of model keys that need full reset\n   */\n  public getModelsWithFullReset(): Set<string> {\n    return this.modelFullReset;\n  }\n\n  /**\n   * Checks if a model had a full reset\n   * @param modelKey - The model key\n   * @returns true if model had type='set', false otherwise\n   */\n  public hasFullReset(modelKey: string): boolean {\n    return this.modelFullReset.has(modelKey);\n  }\n\n  /**\n   * Checks if there are any changes tracked\n   * @returns true if any changes are tracked, false otherwise\n   */\n  public hasChanges(): boolean {\n    return (\n      this.changedAttributes.size > 0 ||\n      this.changedItems.size > 0 ||\n      this.deletedItems.size > 0 ||\n      this.modelFullReset.size > 0\n    );\n  }\n\n  /**\n   * Gets the total number of changed items across all models\n   * @returns Total count of changed items\n   */\n  public getTotalChangedItemCount(): number {\n    let count = 0;\n    for (const items of this.changedItems.values()) {\n      count += items.size;\n    }\n    for (const items of this.deletedItems.values()) {\n      count += items.size;\n    }\n    return count;\n  }\n\n  /**\n   * Gets the ratio of models with changes to total models\n   * @param totalModelCount - Total number of models in the system\n   * @returns Ratio between 0 and 1\n   */\n  public getAffectedModelRatio(totalModelCount: number): number {\n    if (totalModelCount === 0) return 0;\n    const affectedCount = this.getModelsWithChanges().length + this.modelFullReset.size;\n    return affectedCount / totalModelCount;\n  }\n\n  /**\n   * Gets the ratio of changed items to total items for a model\n   * @param modelKey - The model key\n   * @param totalItemCount - Total number of items in the model\n   * @returns Ratio between 0 and 1\n   */\n  public getAffectedItemRatio(modelKey: string, totalItemCount: number): number {\n    if (totalItemCount === 0) return 0;\n    const changedCount = this.getChangedItems(modelKey).size;\n    return changedCount / totalItemCount;\n  }\n\n  /**\n   * Clears all tracked changes and resets state to clean\n   */\n  public clear(): void {\n    this.changedAttributes.clear();\n    this.changedItems.clear();\n    this.deletedItems.clear();\n    this.changedRows.clear();\n    this.deletedRows.clear();\n    this.modelFullReset.clear();\n    this.state = 'clean';\n  }\n\n  /**\n   * Checks if the tracker is in full-reset state\n   * @returns true if in full-reset state, false otherwise\n   */\n  public requiresFullReset(): boolean {\n    return this.state === 'full-reset';\n  }\n\n  /**\n   * Gets the current state of the change tracker\n   * @returns The current state\n   */\n  public getState(): ChangeTrackerState {\n    return this.state;\n  }\n\n  /**\n   * Gets statistics about tracked changes\n   * @returns Statistics object\n   */\n  public getStats(): {\n    modelsWithChanges: number;\n    modelsWithFullReset: number;\n    totalChangedItems: number;\n    totalDeletedItems: number;\n    totalChangedAttributes: number;\n  } {\n    let totalChangedItems = 0;\n    let totalDeletedItems = 0;\n    let totalChangedAttributes = 0;\n\n    for (const items of this.changedItems.values()) {\n      totalChangedItems += items.size;\n    }\n\n    for (const items of this.deletedItems.values()) {\n      totalDeletedItems += items.size;\n    }\n\n    for (const attrs of this.changedAttributes.values()) {\n      totalChangedAttributes += attrs.size;\n    }\n\n    return {\n      modelsWithChanges: this.getModelsWithChanges().length,\n      modelsWithFullReset: this.modelFullReset.size,\n      totalChangedItems,\n      totalDeletedItems,\n      totalChangedAttributes,\n    };\n  }\n}\n","/**\n * Tracks performance metrics for partial updates vs full updates\n */\nexport class PartialUpdateMetrics {\n  private metrics: UpdateMetric[] = [];\n  private enabled: boolean = false;\n\n  constructor() {}\n\n  public enable(): void {\n    this.enabled = true;\n  }\n\n  public disable(): void {\n    this.enabled = false;\n  }\n\n  public isEnabled(): boolean {\n    return this.enabled;\n  }\n\n  /**\n   * Records a completed update\n   */\n  public recordUpdate(metric: UpdateMetric): void {\n    if (!this.enabled) return;\n\n    this.metrics.push({\n      ...metric,\n      timestamp: Date.now(),\n    });\n\n    // Keep only last 100 updates to avoid memory bloat\n    if (this.metrics.length > 100) {\n      this.metrics.shift();\n    }\n  }\n\n  /**\n   * Gets all recorded metrics\n   */\n  public getMetrics(): UpdateMetric[] {\n    return [...this.metrics];\n  }\n\n  /**\n   * Gets summary statistics\n   */\n  public getSummary(): MetricsSummary {\n    if (this.metrics.length === 0) {\n      return {\n        totalUpdates: 0,\n        partialUpdates: 0,\n        fullUpdates: 0,\n        avgPartialUpdateTime: 0,\n        avgFullUpdateTime: 0,\n        avgAttributesProcessed: 0,\n        avgModelsAffected: 0,\n        totalTimeSaved: 0,\n      };\n    }\n\n    const partialUpdates = this.metrics.filter((m) => m.type === 'partial');\n    const fullUpdates = this.metrics.filter((m) => m.type === 'full');\n\n    const avgPartialTime =\n      partialUpdates.length > 0 ? partialUpdates.reduce((sum, m) => sum + m.durationMs, 0) / partialUpdates.length : 0;\n\n    const avgFullTime =\n      fullUpdates.length > 0 ? fullUpdates.reduce((sum, m) => sum + m.durationMs, 0) / fullUpdates.length : 0;\n\n    const avgAttributesProcessed =\n      partialUpdates.length > 0\n        ? partialUpdates.reduce((sum, m) => sum + (m.attributesProcessed || 0), 0) / partialUpdates.length\n        : 0;\n\n    const avgModelsAffected =\n      partialUpdates.length > 0\n        ? partialUpdates.reduce((sum, m) => sum + (m.modelsAffected || 0), 0) / partialUpdates.length\n        : 0;\n\n    // Estimate time saved by comparing partial updates to average full update time\n    const totalTimeSaved =\n      avgFullTime > 0 ? partialUpdates.reduce((sum, m) => sum + (avgFullTime - m.durationMs), 0) : 0;\n\n    return {\n      totalUpdates: this.metrics.length,\n      partialUpdates: partialUpdates.length,\n      fullUpdates: fullUpdates.length,\n      avgPartialUpdateTime: avgPartialTime,\n      avgFullUpdateTime: avgFullTime,\n      avgAttributesProcessed,\n      avgModelsAffected,\n      totalTimeSaved,\n    };\n  }\n\n  /**\n   * Gets the last N updates\n   */\n  public getLastUpdates(count: number = 10): UpdateMetric[] {\n    return this.metrics.slice(-count);\n  }\n\n  /**\n   * Clears all metrics\n   */\n  public clear(): void {\n    this.metrics = [];\n  }\n\n  /**\n   * Gets metrics for a specific time range\n   */\n  public getMetricsInRange(startTime: number, endTime: number): UpdateMetric[] {\n    return this.metrics.filter((m) => m.timestamp >= startTime && m.timestamp <= endTime);\n  }\n}\n\nexport interface UpdateMetric {\n  /** Type of update performed */\n  type: 'partial' | 'full';\n\n  /** Duration in milliseconds */\n  durationMs: number;\n\n  /** Timestamp when update completed */\n  timestamp: number;\n\n  /** Number of models affected (partial updates only) */\n  modelsAffected?: number;\n\n  /** Number of attributes processed (partial updates only) */\n  attributesProcessed?: number;\n\n  /** Number of items changed (partial updates only) */\n  itemsChanged?: number;\n\n  /** Whether update decision was optimal */\n  decisionReason?: string;\n}\n\nexport interface MetricsSummary {\n  totalUpdates: number;\n  partialUpdates: number;\n  fullUpdates: number;\n  avgPartialUpdateTime: number;\n  avgFullUpdateTime: number;\n  avgAttributesProcessed: number;\n  avgModelsAffected: number;\n  totalTimeSaved: number;\n}\n","import { Reference, QueryReference, ResolvedReference, DerivedReference, GroupedRefeference } from '@dcupl/common';\n\n/**\n * Type guard to check if a reference is a QueryReference\n */\nexport function isQueryReference(ref: Reference): ref is QueryReference {\n  return 'query' in ref;\n}\n\n/**\n * Type guard to check if a reference is a ResolvedReference\n */\nexport function isResolvedReference(ref: Reference): ref is ResolvedReference {\n  return 'resolve' in ref;\n}\n\n/**\n * Type guard to check if a reference is a DerivedReference\n */\nexport function isDerivedReference(ref: Reference): ref is DerivedReference {\n  return 'derive' in ref;\n}\n\n/**\n * Type guard to check if a reference is a GroupedRefeference\n */\nexport function isGroupedReference(ref: Reference): ref is GroupedRefeference {\n  return 'groupBy' in ref;\n}\n","import {\n  DataContainer,\n  DcuplInitOptions,\n  ViewDefinition,\n  generateKey,\n  ListItem,\n  ModelDefinition,\n  RawItem,\n  ChangeDetector,\n  trigger,\n  QualityAnalyzer,\n  DependencyGraph,\n  AttributeDependencyGraph,\n  AttributeNode,\n  parseTemplate,\n  logger,\n  yieldToEventLoop,\n  Property,\n  Reference,\n  DcuplSealedError,\n} from '@dcupl/common';\n\nimport { DcuplModel } from './model/model';\nimport { orderBy, groupBy, cloneDeep } from 'lodash-es';\n\nimport { validateBasicModelStructure, validateModels } from './model/model.helper';\nimport { ERROR_TRACKING_MODEL_PREFIX, QualityController } from '../quality/quality.controller';\nimport { ChangeTracker } from './change-tracker';\nimport { PartialUpdateMetrics } from './partial-update-metrics';\nimport { isQueryReference, isResolvedReference, isDerivedReference, isGroupedReference } from './reference-type-guards';\nimport { DEFAULT_KEY_PROPERTY_SEPARATOR, extractRowKey, hasRowKey } from './key-property.helper';\n\nimport { DcuplApi, ContainerSourceMetadata } from '../dcupl/dcupl-api';\n\ntype ModelParserCalculationTimingEntry = {\n  modelName: string;\n  step: string;\n  value: number;\n};\n\n/** The rows and attributes step 1 of a partial update reprocesses for one model (#368). */\ntype PartialRowScope = {\n  /** Rows of existing items the update changed. */\n  changedRows: RawItem[];\n  /** Rows the update inserts. */\n  insertedRows: RawItem[];\n  /** Attributes the update re-derives errors for. */\n  attributes: Set<string>;\n  /** Attributes reprocessed for every row (see QualityController.prepareErrorsForPartialUpdate). */\n  allRowsAttributes: Set<string>;\n  /** Whether the update changed, inserted or deleted rows of the model. */\n  rowsChanged: boolean;\n};\n\nexport class ModelParser {\n  public unprocessedModelDescriptions: Map<string, ModelDefinition> = new Map();\n  protected unprocessedData: DataContainer<RawItem>[] = [];\n\n  // Tracks containers whose composite `keyProperty` has already been applied.\n  // Without this guard, a container re-entering handleAlternativeKey (e.g.\n  // partialUpdate calls it once for deletion lookup and a second time via\n  // getMergedContainers) re-reads the already-joined `item.key` and produces\n  // doubled values like \"100::Foo::Foo\". See #182.\n  private keyedContainers: WeakSet<DataContainer<RawItem>> = new WeakSet();\n\n  // Keys of the rows a later row with the same key replaced in a `set`\n  // payload, one entry per replaced row, kept per container the merge built.\n  // The rows are deduped before processing, so the model reads these to\n  // record its NonUniqueKey errors; a re-init merges the deduped container\n  // again and carries them over, so the errors stay the same (#369).\n  private replacedRowKeys: WeakMap<DataContainer<RawItem>, string[]> = new WeakMap();\n\n  // Models whose definition `models.set`/`models.update` changed since the last init (#408). The\n  // next init rebuilds their attributes in the existing model instance (lists keep it), and the\n  // next update() takes the full path, as the partial path never re-applies a definition.\n  private definitionChanges: Set<string> = new Set();\n\n  // Models the next init or full update drops with their data (#415), see dropModel.\n  private modelDrops: Set<string> = new Set();\n  // The instances of dropped models, emptied: lists created before hold them, so a model registered\n  // again under the key reuses its instance and those lists follow it, as after any update (#413).\n  private droppedModels: Map<string, DcuplModel> = new Map();\n\n  public dependencyGraph!: DependencyGraph;\n  public attributeDependencyGraph!: AttributeDependencyGraph;\n  public changeTracker: ChangeTracker = new ChangeTracker();\n  public partialUpdateMetrics: PartialUpdateMetrics = new PartialUpdateMetrics();\n\n  public views: Map<string, ViewDefinition> = new Map();\n  public models: Map<string, DcuplModel> = new Map();\n  public initOptions!: DcuplInitOptions;\n\n  private calculationTimings: ModelParserCalculationTimingEntry[] = [];\n  private log = logger.child({ prefix: 'ModelParser' });\n\n  // Set by seal() only: the staged log is gone, every write is rejected (#332).\n  private _sealed = false;\n\n  /** True after seal(): the staged log is gone, every write is rejected (#332). Read-only; seal() sets it (#454). */\n  public get sealed(): boolean {\n    return this._sealed;\n  }\n\n  constructor(\n    public cdRef: ChangeDetector,\n    public qualityController: QualityController,\n    public dcuplInstance: DcuplApi,\n  ) {\n    this.qualityController.modelParser = this;\n  }\n\n  /**\n   * Drops the staged raw rows and the change tracker. The built models, indices and quality\n   * errors stay. After this, addData/addModel/reprocessData/init/update throw DcuplSealedError.\n   * The preconditions are checked by DcuplApi.seal(): init() completed, no apply in flight, no pending\n   * loader resource, no unapplied staged changes (rows or model definitions).\n   */\n  public seal(): void {\n    this._sealed = true;\n    this.unprocessedData = [];\n    this.calculationTimings = [];\n    this.changeTracker.clear();\n  }\n\n  private assertNotSealed(what: string): void {\n    if (this.sealed) throw new DcuplSealedError(what);\n  }\n\n  public async init(): Promise<void> {\n    this.assertNotSealed('init');\n    // Clear change tracker at start of init\n    this.changeTracker.clear();\n    if (this.qualityController.enabled) {\n      // Reset every error the data pipeline re-detects below (reference,\n      // property, data-container errors) and the model-definition errors that\n      // building the models and validateModels re-detect (#417). Registration\n      // and loader errors are preserved as they are not re-generated by a full init.\n      this.qualityController.resetDataErrors();\n      this.qualityController.resetDefinitionErrors();\n\n      if (!this.models.get('$DcuplErrorTrackingErrors')) {\n        this.qualityController.initErrorTrackingModels();\n      }\n    }\n\n    this.prepareModels();\n\n    if (this.qualityController.enabled) {\n      // prepareModels() reset the error-tracking models, and the init pipeline below processes the\n      // error containers still queued from the last apply, as it did before they were built on first\n      // read. An unread snapshot replayed on top would serve rows of an apply that is gone (#444).\n      this.qualityController.discardPendingErrorTrackingSnapshot();\n      this.validateModels();\n    }\n\n    this.initDependencyGraph();\n    this.buildAttributeDependencyGraph();\n\n    // Validate attribute dependency graph completeness\n    this.validateAttributeDependencyGraph();\n\n    const consumedData = this.unprocessedData.filter((container) => !container.placeholderUid);\n    const relevantData = this.getMergedContainers(this.unprocessedData);\n\n    await this.connectDataWithModels(relevantData);\n\n    this.consolidateUnprocessedData(relevantData, consumedData);\n\n    if (this.qualityController.enabled) {\n      await this.qualityController.initData();\n    }\n\n    // Clear change tracker at end of init since this was a full initialization\n    // Any changes tracked during init are not \"changes\" for partial update purposes\n    this.changeTracker.clear();\n    this.retrackUnprocessedData(relevantData);\n  }\n\n  private prepareModels(): void {\n    this.applyModelDrops();\n    this.unprocessedModelDescriptions.forEach((modelDescription) => {\n      const dropped = this.droppedModels.get(modelDescription.key);\n      if (dropped) {\n        // registered again after a drop: rebuilt in the instance the lists created before hold\n        this.droppedModels.delete(modelDescription.key);\n        dropped.resetDefinition();\n        dropped.init(modelDescription);\n        dropped.initialDefinition = modelDescription;\n        dropped.applyPropertiesAndReferences(modelDescription);\n        this.models.set(dropped.key, dropped);\n      } else if (!this.models.has(modelDescription.key)) {\n        const model = new DcuplModel(this);\n        model.init(modelDescription);\n        model.applyPropertiesAndReferences(modelDescription);\n        this.models.set(model.key, model);\n      } else {\n        const model = this.models.get(modelDescription.key)!;\n        if (this.definitionChanges.has(modelDescription.key)) {\n          // A definition set or merged after init: built from it like a new model, in the\n          // instance the lists hold (#408)\n          model.resetDefinition();\n          model.init(modelDescription);\n        }\n        // `models.update` after init merged into the description: `models.get` reports the merged one\n        model.initialDefinition = modelDescription;\n        model.resetData();\n        model.resetIndexMap();\n        model.applyPropertiesAndReferences(modelDescription);\n      }\n    });\n    this.definitionChanges.clear();\n  }\n\n  /**\n   * Stages dropping `modelKey` (#415): the next `init()` or `update()`, which takes the full path,\n   * removes its definition, its data and the model, as in an instance that never had it: the global\n   * API (`query.*`, `fn.*`) throws for the key, and lists created on it serve no rows. Registering\n   * the key again with `addModel` before that cancels the drop; registering it after rebuilds the\n   * model in the same instance, so those lists follow it. The app loader uses it when a model left\n   * the loader config.\n   */\n  public dropModel(modelKey: string): void {\n    this.modelDrops.add(modelKey);\n    this.markDefinitionChanged(modelKey);\n  }\n\n  /** Whether the next init or full update drops `modelKey` (see dropModel). */\n  public hasModelDrop(modelKey: string): boolean {\n    return this.modelDrops.has(modelKey);\n  }\n\n  private applyModelDrops(): void {\n    for (const modelKey of this.modelDrops) {\n      this.unprocessedModelDescriptions.delete(modelKey);\n      this.unprocessedData = this.unprocessedData.filter((container) => container.model !== modelKey);\n      const model = this.models.get(modelKey);\n      if (model) {\n        // lists hold the instance: they serve no rows, and follow the model if it comes back\n        model.resetData();\n        model.resetIndexMap();\n        this.models.delete(modelKey);\n        this.droppedModels.set(modelKey, model);\n      }\n      // the internal list behind query.* and fn.* would keep answering for the key\n      this.dcuplInstance?.lists?.destroy({ listKey: `__global_list__${modelKey}` });\n    }\n    this.modelDrops.clear();\n  }\n\n  /**\n   * Unregisters a model (#420): its stored definition, its instance and its queued data containers,\n   * so the next init does not bring it back. Counts as a definition change, so the next `update()`\n   * rebuilds everything and references to the model resolve as to a missing model.\n   */\n  public removeModel(modelKey: string): void {\n    const registered = this.unprocessedModelDescriptions.has(modelKey) || this.models.has(modelKey);\n    this.unprocessedModelDescriptions.delete(modelKey);\n    this.models.delete(modelKey);\n    this.unprocessedData = this.unprocessedData.filter((container) => container.model !== modelKey);\n    if (registered) {\n      this.markDefinitionChanged(modelKey);\n    }\n  }\n\n  /** Unregisters a view; takes effect at once (#420). */\n  public removeView(viewKey: string): void {\n    this.views.delete(viewKey);\n  }\n\n  /**\n   * Records that `models.set`/`models.update` changed the definition of `modelKey` (#408): the next\n   * `update()` rebuilds everything, like `init()`.\n   */\n  public markDefinitionChanged(modelKey: string): void {\n    this.definitionChanges.add(modelKey);\n  }\n\n  /** The models whose definition changed since the last init (#408). */\n  public getDefinitionChanges(): string[] {\n    return Array.from(this.definitionChanges);\n  }\n\n  private validateModels(): void {\n    this.models.forEach((model) => {\n      if (model.qualityConfig.enabled === true) {\n        const errors = validateModels(model, this.models);\n        // only called with quality enabled (init); re-detected on every init (#417)\n        errors.forEach((error) => this.qualityController.setDefinitionError(error));\n      }\n    });\n  }\n\n  /**\n   * initDependencyGraph\n   * The dependencies are only affected by references. Derived properties/references do not count since they\n   * are only possible if references are already present to derive from. Same goes for resolved references.\n   */\n  private initDependencyGraph(): void {\n    this.dependencyGraph = new DependencyGraph();\n\n    this.models.forEach((model) => {\n      this.dependencyGraph.addNode(model.key);\n    });\n\n    this.models.forEach((model) => {\n      model.getReferencesRelevantForDependencyGraph().forEach((reference) => {\n        if (model.key === reference.model) {\n          return;\n        }\n        this.dependencyGraph.addNode(reference.model);\n        this.dependencyGraph.addDependency(model.key, reference.model);\n      });\n    });\n\n    // Validate that there are no circular dependencies\n    const validation = this.dependencyGraph.validateNoCycles();\n    if (validation.hasCycle) {\n      const cyclePath = validation.path!.join(' → ');\n      this.log.error(\n        `Circular dependency detected in model references: ${cyclePath}\\n` +\n          `This will cause unpredictable update ordering. Please restructure your models to remove the circular dependency.`,\n      );\n      throw new Error(\n        `Circular dependency detected: ${cyclePath}\\n` +\n          `Models cannot have circular references as this leads to unpredictable behavior during updates.`,\n      );\n    }\n  }\n\n  /**\n   * buildAttributeDependencyGraph\n   * Analyzes all models and their attributes to build attribute-level dependencies.\n   * This enables partial updates by tracking which attributes depend on others.\n   */\n  private buildAttributeDependencyGraph(): void {\n    this.attributeDependencyGraph = new AttributeDependencyGraph();\n\n    // Register every attribute with its own processing step first (#400). A\n    // node keeps the step it was first added with, and the dependency helpers\n    // below add the attributes they depend on as basic (step 1) ones: a derived\n    // property on a resolved reference, or one that reads a derived property of\n    // a model defined later, registered its source as step 1, so the partial\n    // path never recomputed it.\n    this.models.forEach((model) => {\n      model.properties.forEach((property, propertyKey) => {\n        this.attributeDependencyGraph.addAttribute({\n          modelKey: model.key,\n          attributeKey: propertyKey,\n          type: 'property',\n          processingStep: this.getAttributeProcessingStep(model, property),\n        });\n      });\n      model.references.forEach((reference, referenceKey) => {\n        this.attributeDependencyGraph.addAttribute({\n          modelKey: model.key,\n          attributeKey: referenceKey,\n          type: 'reference',\n          processingStep: this.getAttributeProcessingStep(model, reference),\n        });\n      });\n    });\n\n    this.models.forEach((model) => {\n      const modelKey = model.key;\n\n      // Process all properties\n      model.properties.forEach((property, propertyKey) => {\n        if (property.expression) {\n          // Expression properties (Step 3) - depend on all properties/references in template\n          this.processExpressionProperty(modelKey, propertyKey, property.expression);\n        } else if (property.derive) {\n          // Derived properties (Step 3) - depend on reference + remote property\n          this.processDerivedProperty(modelKey, propertyKey, property.derive);\n        } else {\n          // Basic properties (Step 1) - no dependencies\n          const node: AttributeNode = {\n            modelKey,\n            attributeKey: propertyKey,\n            type: 'property',\n            processingStep: 1,\n          };\n          this.attributeDependencyGraph.addAttribute(node);\n        }\n      });\n\n      // Process all references\n      model.references.forEach((reference, referenceKey) => {\n        if (isQueryReference(reference)) {\n          // Query references (Step 2) - depend on properties used in query templates\n          this.processQueryReference(modelKey, referenceKey, reference.query);\n        } else if (isResolvedReference(reference)) {\n          // Resolved references (Step 2) - depend on inverse reference from remote model\n          this.processResolvedReference(modelKey, referenceKey, reference.resolve);\n        } else if (isDerivedReference(reference)) {\n          // Derived references (Step 3) - depend on source reference\n          this.processDerivedReference(modelKey, referenceKey, reference.derive);\n        } else if (isGroupedReference(reference)) {\n          // Grouped references (Step 3) - depend on source reference\n          this.processGroupedReference(modelKey, referenceKey, reference.groupBy);\n        } else {\n          // Basic references (Step 1) - no dependencies\n          const node: AttributeNode = {\n            modelKey,\n            attributeKey: referenceKey,\n            type: 'reference',\n            processingStep: 1,\n          };\n          this.attributeDependencyGraph.addAttribute(node);\n        }\n      });\n    });\n  }\n\n  /**\n   * The processing step of an attribute, as the full path computes it: 1 basic\n   * properties and references, 2 query and resolved references, 3 derived and\n   * grouped references and derived and expression properties, 4 derived\n   * properties and references on a resolved reference (#400).\n   */\n  private getAttributeProcessingStep(model: DcuplModel, attribute: Property | Reference): 1 | 2 | 3 | 4 {\n    if ('query' in attribute || 'resolve' in attribute) {\n      return 2;\n    }\n    if ('derive' in attribute && attribute.derive) {\n      const localReference = model.references.get(attribute.derive.localReference);\n      return localReference && isResolvedReference(localReference) ? 4 : 3;\n    }\n    if (('expression' in attribute && attribute.expression) || 'groupBy' in attribute) {\n      return 3;\n    }\n    return 1;\n  }\n\n  /**\n   * Validates that all expected attributes are present in the attribute dependency graph.\n   * Logs warnings for any missing attributes that might indicate parsing failures.\n   */\n  private validateAttributeDependencyGraph(): void {\n    const expectedAttributes = new Map<string, string[]>();\n\n    // Build expected attributes from models\n    this.models.forEach((model) => {\n      const attributes: string[] = [];\n\n      // Collect all properties\n      model.properties.forEach((_, propertyKey) => {\n        attributes.push(propertyKey);\n      });\n\n      // Collect all references\n      model.references.forEach((_, referenceKey) => {\n        attributes.push(referenceKey);\n      });\n\n      if (attributes.length > 0) {\n        expectedAttributes.set(model.key, attributes);\n      }\n    });\n\n    // Validate completeness\n    const validation = this.attributeDependencyGraph.validateCompleteness(expectedAttributes);\n\n    if (!validation.isComplete) {\n      const missingCount = validation.missing.length;\n      const missingList = validation.missing\n        .map(({ modelKey, attributeKey }) => `${modelKey}.${attributeKey}`)\n        .slice(0, 10) // Show first 10\n        .join(', ');\n\n      const message = `Attribute dependency graph incomplete. ${missingCount} attribute(s) missing: ${missingList}${\n        missingCount > 10 ? ` ... and ${missingCount - 10} more` : ''\n      }`;\n\n      this.log.warn(\n        `${message}\\n` +\n          `These attributes will default to Step 1 processing which may be incorrect. ` +\n          `This usually indicates a problem during expression or reference parsing.`,\n      );\n    }\n  }\n\n  /**\n   * Process expression property dependencies\n   * Expression properties depend on all attributes referenced in the template\n   */\n  private processExpressionProperty(modelKey: string, propertyKey: string, expression: string): void {\n    const expressionNode: AttributeNode = {\n      modelKey,\n      attributeKey: propertyKey,\n      type: 'property',\n      processingStep: 3,\n    };\n    this.attributeDependencyGraph.addAttribute(expressionNode);\n\n    // Parse template to find dependencies\n    const { variables } = parseTemplate(expression);\n    variables.forEach((variable) => {\n      // e.g. \"productRef.categoryRef.markup\", \"tags.0.name\" or \"tags[0].name\"\n      const segments = this.getExpressionPathSegments(variable.name);\n      let currentModel = this.models.get(modelKey);\n\n      // Walk the path and depend on every attribute it reads (#385): the local property or\n      // reference, each intermediate reference and the final remote property. An index into a\n      // multi-valued reference (\"0\") is skipped; the walk ends at a property (nested object\n      // paths like \"meta.color\" read the property \"meta\") or at a segment it cannot resolve.\n      for (const segment of segments) {\n        if (!currentModel) return;\n\n        if (currentModel.properties.has(segment)) {\n          this.attributeDependencyGraph.addAttributeDependency(expressionNode, {\n            modelKey: currentModel.key,\n            attributeKey: segment,\n            type: 'property',\n            processingStep: 1,\n          });\n          return;\n        }\n\n        const reference = currentModel.references.get(segment);\n        if (reference) {\n          this.attributeDependencyGraph.addAttributeDependency(expressionNode, {\n            modelKey: currentModel.key,\n            attributeKey: segment,\n            type: 'reference',\n            processingStep: 1,\n          });\n          currentModel = this.models.get(reference.model);\n          continue;\n        }\n\n        if (!/^\\d+$/.test(segment)) return;\n      }\n    });\n  }\n\n  /**\n   * Splits an expression variable path into its segments; bracket indices become segments of\n   * their own: \"tags[0].name\" -> [\"tags\", \"0\", \"name\"].\n   */\n  private getExpressionPathSegments(path: string): string[] {\n    return path\n      .replace(/\\[\\s*['\"]?([^\\]'\"]*?)['\"]?\\s*\\]/g, '.$1')\n      .split('.')\n      .map((segment) => segment.trim())\n      .filter((segment) => segment.length > 0);\n  }\n\n  /**\n   * Process derived property dependencies\n   * Derived properties depend on a local reference and the remote property\n   */\n  private processDerivedProperty(\n    modelKey: string,\n    propertyKey: string,\n    derive: { localReference: string; remoteProperty: string },\n  ): void {\n    const derivedNode: AttributeNode = {\n      modelKey,\n      attributeKey: propertyKey,\n      type: 'property',\n      processingStep: 3,\n    };\n    this.attributeDependencyGraph.addAttribute(derivedNode);\n\n    // Depends on local reference\n    const localRefNode: AttributeNode = {\n      modelKey,\n      attributeKey: derive.localReference,\n      type: 'reference',\n      processingStep: 1, // Assume basic reference for now\n    };\n    this.attributeDependencyGraph.addAttributeDependency(derivedNode, localRefNode);\n\n    // Also depends on the remote property\n    const model = this.models.get(modelKey);\n    if (model) {\n      const reference = model.references.get(derive.localReference);\n      if (reference) {\n        const remotePropertyNode: AttributeNode = {\n          modelKey: reference.model,\n          attributeKey: derive.remoteProperty,\n          type: 'property',\n          processingStep: 1,\n        };\n        this.attributeDependencyGraph.addAttributeDependency(derivedNode, remotePropertyNode);\n      }\n    }\n  }\n\n  /**\n   * Process query reference dependencies\n   * Query references depend on properties used in the query template\n   */\n  private processQueryReference(modelKey: string, referenceKey: string, query: any): void {\n    const queryRefNode: AttributeNode = {\n      modelKey,\n      attributeKey: referenceKey,\n      type: 'reference',\n      processingStep: 2,\n    };\n    this.attributeDependencyGraph.addAttribute(queryRefNode);\n\n    // Parse query as JSON string to find template variables\n    try {\n      const queryString = JSON.stringify(query);\n      const { variables } = parseTemplate(queryString);\n\n      variables.forEach((variable) => {\n        const varName = variable.name;\n        const model = this.models.get(modelKey);\n        if (!model) return;\n\n        // Check if it's a property or reference in this model\n        if (model.properties.has(varName)) {\n          const depNode: AttributeNode = {\n            modelKey,\n            attributeKey: varName,\n            type: 'property',\n            processingStep: 1,\n          };\n          this.attributeDependencyGraph.addAttributeDependency(queryRefNode, depNode);\n        } else if (model.references.has(varName)) {\n          const depNode: AttributeNode = {\n            modelKey,\n            attributeKey: varName,\n            type: 'reference',\n            processingStep: 1,\n          };\n          this.attributeDependencyGraph.addAttributeDependency(queryRefNode, depNode);\n        }\n      });\n    } catch (_err) {\n      // If query parsing fails, skip dependencies\n    }\n  }\n\n  /**\n   * Process resolved reference dependencies\n   * Resolved references depend on the inverse reference from the remote model\n   */\n  private processResolvedReference(\n    modelKey: string,\n    referenceKey: string,\n    resolve: { reference: string; model: string },\n  ): void {\n    const resolvedNode: AttributeNode = {\n      modelKey,\n      attributeKey: referenceKey,\n      type: 'reference',\n      processingStep: 2,\n    };\n    this.attributeDependencyGraph.addAttribute(resolvedNode);\n\n    // Depends on the remote reference\n    const remoteRefNode: AttributeNode = {\n      modelKey: resolve.model,\n      attributeKey: resolve.reference,\n      type: 'reference',\n      processingStep: 1, // Assume basic reference\n    };\n    this.attributeDependencyGraph.addAttributeDependency(resolvedNode, remoteRefNode);\n  }\n\n  /**\n   * Process derived reference dependencies\n   * Derived references depend on a local reference\n   */\n  private processDerivedReference(\n    modelKey: string,\n    referenceKey: string,\n    derive: { localReference: string; remoteReference: string },\n  ): void {\n    const derivedRefNode: AttributeNode = {\n      modelKey,\n      attributeKey: referenceKey,\n      type: 'reference',\n      processingStep: 3,\n    };\n    this.attributeDependencyGraph.addAttribute(derivedRefNode);\n\n    // Depends on local reference\n    const localRefNode: AttributeNode = {\n      modelKey,\n      attributeKey: derive.localReference,\n      type: 'reference',\n      processingStep: 1,\n    };\n    this.attributeDependencyGraph.addAttributeDependency(derivedRefNode, localRefNode);\n\n    // Also depends on the remote reference\n    const model = this.models.get(modelKey);\n    if (model) {\n      const reference = model.references.get(derive.localReference);\n      if (reference) {\n        const remoteRefNode: AttributeNode = {\n          modelKey: reference.model,\n          attributeKey: derive.remoteReference,\n          type: 'reference',\n          processingStep: 1,\n        };\n        this.attributeDependencyGraph.addAttributeDependency(derivedRefNode, remoteRefNode);\n      }\n    }\n  }\n\n  /**\n   * Process grouped reference dependencies\n   * Grouped references depend on a source reference\n   */\n  private processGroupedReference(modelKey: string, referenceKey: string, groupBy: { reference: string }): void {\n    const groupedRefNode: AttributeNode = {\n      modelKey,\n      attributeKey: referenceKey,\n      type: 'reference',\n      processingStep: 3,\n    };\n    this.attributeDependencyGraph.addAttribute(groupedRefNode);\n\n    // Depends on the source reference\n    const sourceRefNode: AttributeNode = {\n      modelKey,\n      attributeKey: groupBy.reference,\n      type: 'reference',\n      processingStep: 1,\n    };\n    this.attributeDependencyGraph.addAttributeDependency(groupedRefNode, sourceRefNode);\n  }\n\n  /**\n   * Applies the pending changes, on the partial path when it is possible and worth it, otherwise\n   * as a full rebuild (`init()`).\n   *\n   * @returns The path taken: `'partial'` or `'full'` (dcupl.update() reports it as\n   * `isPartialUpdate` on `dcupl_partial_update`, #383)\n   */\n  public async update(): Promise<'partial' | 'full'> {\n    this.assertNotSealed('update');\n    const startTime = performance.now();\n\n    // Check if we can do a partial update\n    const shouldUsePartial = this.shouldUsePartialUpdate();\n\n    if (shouldUsePartial.decision) {\n      // Capture metrics before update\n      const modelsAffected = this.changeTracker.getModelsWithChanges().length;\n      const attributesChanged = Array.from(this.changeTracker.getChangedAttributes().values()).reduce(\n        (sum, attrs) => sum + attrs.size,\n        0,\n      );\n      const itemsChanged = this.changeTracker.getTotalChangedItemCount();\n\n      await this.partialUpdate();\n\n      const duration = performance.now() - startTime;\n\n      // Record metrics\n      this.partialUpdateMetrics.recordUpdate({\n        type: 'partial',\n        durationMs: duration,\n        modelsAffected,\n        attributesProcessed: attributesChanged,\n        itemsChanged,\n        decisionReason: shouldUsePartial.reason,\n        timestamp: Date.now(),\n      });\n      return 'partial';\n    } else {\n      // Fall back to full update\n      await this.init();\n\n      const duration = performance.now() - startTime;\n\n      // Record metrics\n      this.partialUpdateMetrics.recordUpdate({\n        type: 'full',\n        durationMs: duration,\n        decisionReason: shouldUsePartial.reason,\n        timestamp: Date.now(),\n      });\n      return 'full';\n    }\n  }\n\n  /**\n   * Determines if a partial update is possible and beneficial\n   * @returns object with decision and reason\n   */\n  private shouldUsePartialUpdate(): { decision: boolean; reason: string } {\n    // Get configurable thresholds\n    const config = this.dcuplInstance.initOptions.performance?.partialUpdates;\n    const modelRatioThreshold = config?.modelRatioThreshold ?? 0.5;\n    const itemRatioThreshold = config?.itemRatioThreshold ?? 0.5;\n    const enableLogging = config?.enableDetailedLogging ?? false;\n\n    // A definition changed after init: only a full rebuild applies it (#408)\n    if (this.definitionChanges.size > 0) {\n      if (enableLogging) {\n        this.log.debug('Partial update decision: FULL', { reason: 'definition_changed' });\n      }\n      return { decision: false, reason: 'definition_changed' };\n    }\n\n    // If no changes tracked, skip update entirely\n    if (!this.changeTracker.hasChanges()) {\n      if (enableLogging) {\n        this.log.debug('Partial update decision: SKIP', { reason: 'no_changes_detected' });\n      }\n      return { decision: false, reason: 'no_changes_detected' };\n    }\n\n    // If any model has full reset (type='set'), do full update\n    if (this.changeTracker.getModelsWithFullReset().size > 0) {\n      if (enableLogging) {\n        this.log.debug('Partial update decision: FULL', { reason: 'full_reset_detected' });\n      }\n      return { decision: false, reason: 'full_reset_detected' };\n    }\n\n    // Query references are computed on the full path only (#367)\n    const affectedQueryReference = this.findQueryReferenceAffectedByChanges();\n    if (affectedQueryReference) {\n      if (enableLogging) {\n        this.log.debug('Partial update decision: FULL', {\n          reason: 'query_reference_affected',\n          queryReference: affectedQueryReference,\n        });\n      }\n      return { decision: false, reason: `query_reference_affected:${affectedQueryReference}` };\n    }\n\n    // Calculate if partial update is worth it\n    // Only count non-internal models (exclude $ prefixed models like error tracking)\n    const totalModelCount = Array.from(this.models.keys()).filter((key) => !key.startsWith('$')).length;\n    const affectedModelRatio = this.changeTracker.getAffectedModelRatio(totalModelCount);\n\n    // Check item-level changes for affected models\n    let totalItems = 0;\n    let totalChangedItems = 0;\n\n    for (const modelKey of this.changeTracker.getModelsWithChanges()) {\n      const model = this.models.get(modelKey);\n      if (model) {\n        const modelItemCount = model.getData().size;\n        totalItems += modelItemCount;\n        totalChangedItems += this.changeTracker.getChangedItems(modelKey).size;\n        totalChangedItems += this.changeTracker.getDeletedItems(modelKey).size;\n      }\n    }\n\n    const itemRatio = totalItems > 0 ? totalChangedItems / totalItems : 0;\n\n    // Decision logic: Use partial update unless BOTH model AND item ratios are high\n    // This prevents false negatives like \"1 model, 10000 items, change 1 item\"\n    const bothRatiosHigh = affectedModelRatio > modelRatioThreshold && itemRatio > itemRatioThreshold;\n\n    if (bothRatiosHigh) {\n      if (enableLogging) {\n        this.log.debug('Partial update decision: FULL', {\n          reason: 'both_ratios_high',\n          modelRatio: affectedModelRatio.toFixed(2),\n          itemRatio: itemRatio.toFixed(2),\n        });\n      }\n      return {\n        decision: false,\n        reason: `both_ratios_high:models=${affectedModelRatio.toFixed(2)},items=${itemRatio.toFixed(2)}`,\n      };\n    }\n\n    // Use partial update\n    if (enableLogging) {\n      this.log.debug('Partial update decision: PARTIAL', {\n        modelRatio: affectedModelRatio.toFixed(2),\n        itemRatio: itemRatio.toFixed(2),\n        modelThreshold: modelRatioThreshold,\n        itemThreshold: itemRatioThreshold,\n      });\n    }\n    return {\n      decision: true,\n      reason: `optimal:models=${affectedModelRatio.toFixed(2)},items=${itemRatio.toFixed(2)}`,\n    };\n  }\n\n  /**\n   * Query references are computed on the full path only: the partial path has\n   * no step that re-runs their queries (#367). Returns the first query\n   * reference (`Model.reference`) whose result the pending changes can alter,\n   * so that update() takes the full path instead:\n   * - its owner model changed — the owner's rows fill the query templates;\n   * - its target model, or a model the target reaches through its references,\n   *   changed — deep query paths and derived/resolved attributes read those.\n   * Recomputing just the affected query references on the partial path is a\n   * performance follow-up.\n   */\n  private findQueryReferenceAffectedByChanges(): string | undefined {\n    const changedModels = new Set(this.changeTracker.getModelsWithChanges());\n    const reachableByTarget = new Map<string, Set<string>>();\n\n    for (const model of this.models.values()) {\n      for (const queryReference of model.getQueryReferences()) {\n        if (changedModels.has(model.key)) {\n          return `${model.key}.${queryReference.key}`;\n        }\n\n        let reachable = reachableByTarget.get(queryReference.model);\n        if (!reachable) {\n          reachable = this.getModelsReachableFrom(queryReference.model);\n          reachableByTarget.set(queryReference.model, reachable);\n        }\n        for (const modelKey of reachable) {\n          if (changedModels.has(modelKey)) {\n            return `${model.key}.${queryReference.key}`;\n          }\n        }\n      }\n    }\n\n    return undefined;\n  }\n\n  /**\n   * The model itself plus every model it reaches through its references of\n   * any kind, transitively.\n   */\n  private getModelsReachableFrom(modelKey: string): Set<string> {\n    const reachable = new Set<string>([modelKey]);\n    const queue = [modelKey];\n    while (queue.length > 0) {\n      const model = this.models.get(queue.pop()!);\n      if (!model) continue;\n      for (const reference of model.references.values()) {\n        if (!reachable.has(reference.model)) {\n          reachable.add(reference.model);\n          queue.push(reference.model);\n        }\n      }\n    }\n    return reachable;\n  }\n\n  /**\n   * Performs a partial update by only reprocessing changed attributes and their dependents\n   */\n  private async partialUpdate(): Promise<void> {\n    // Don't reset all model errors in partial update - only the errors of the changed and deleted\n    // items are re-derived (#368, see getPartialRowScopes)\n\n    // Handle deletions first, before merging\n    const allContainers = this.handleAlternativeKey(this.unprocessedData).filter(\n      (container) => !container.placeholderUid,\n    );\n    // Rows keyed by a custom keyProperty or autoGenerateKey only have their key now\n    this.changeTracker.refreshItemKeys();\n\n    for (const container of allContainers) {\n      if (container.type === 'remove') {\n        const model = this.models.get(container.model);\n        if (model) {\n          model.deleteDataEntries(container);\n\n          // Record all properties as changed to trigger derived property updates in other models\n          // E.g., deleting modelB.propB should clear modelA.derivedProp (derived from modelB.propB)\n          for (const property of model.properties.values()) {\n            this.changeTracker.recordAttributeChange(container.model, property.key);\n          }\n\n          // Record all references as changed to trigger resolved reference updates in other models\n          // E.g., deleting a product should update category.products (resolved ref)\n          for (const reference of model.references.values()) {\n            this.changeTracker.recordAttributeChange(container.model, reference.key);\n          }\n        }\n      }\n    }\n\n    // Now merge and process non-remove containers\n    const consumedData = this.unprocessedData.filter((container) => !container.placeholderUid);\n    const relevantData = this.getMergedContainers(this.unprocessedData);\n    await this.connectDataWithModelsPartial(relevantData);\n\n    this.consolidateUnprocessedData(relevantData, consumedData);\n\n    if (this.qualityController.enabled && this.qualityController.hasErrorChangesSinceInitData()) {\n      // Rebuild $DcuplErrorTrackingErrors / $DcuplErrorTrackingSummary from the\n      // updated error records, as init() does (#368). initData() replaces their\n      // queued containers and builds the new ones itself, at once or on first read\n      // (#444): drop those from the change tracker (retrackUnprocessedData\n      // re-records anything else).\n      await this.qualityController.initData();\n      this.changeTracker.clear();\n    }\n\n    this.retrackUnprocessedData(relevantData);\n  }\n\n  public async reprocessData(): Promise<void> {\n    this.assertNotSealed('reprocessData');\n    if (this.qualityController.enabled) {\n      this.qualityController.resetModelErrors();\n    }\n    const relevantData = this.getMergedContainers(this.unprocessedData);\n    await this.connectDataWithModels(relevantData);\n  }\n\n  protected getSortedCalculationTimings(): ModelParserCalculationTimingEntry[] {\n    return orderBy(this.calculationTimings, 'value');\n  }\n\n  /**\n   * Registers a model definition, merged into an earlier one with the same key (`models.update`;\n   * `models.set` drops the earlier one first). The parser keeps its own copy, so later changes to\n   * `model` do not reach this instance, and init does not write into it (#314). Inline `data` is not\n   * part of the stored definition: it is queued through `addData`, like `dcupl.data.set`, so\n   * `models.get` does not return it.\n   */\n  @trigger({\n    scope: 'global',\n    type: 'model_add',\n    connectMessage: true,\n  })\n  public addModel(model: ModelDefinition): void {\n    this.assertNotSealed('models');\n    if (model?.quality?.enabled !== false) {\n      try {\n        validateBasicModelStructure(model);\n      } catch (err: any) {\n        if (this.qualityController.enabled) {\n          this.qualityController.setError({\n            title: 'Invalid Model Definition',\n            type: 'model',\n            errorGroup: 'ModelDefinitionError',\n            errorType: 'InvalidModelDefinition',\n            model: model.key,\n            description: err.message,\n          });\n        }\n        return;\n      }\n    }\n\n    const { data, ...rest } = model;\n    const definition: ModelDefinition = cloneDeep(rest);\n    this.modelDrops.delete(definition.key);\n\n    if (this.unprocessedModelDescriptions.has(definition.key)) {\n      const existingModel = this.unprocessedModelDescriptions.get(definition.key)!;\n      const newModel = this.mergeModels(existingModel, definition);\n      this.unprocessedModelDescriptions.set(definition.key, newModel);\n    } else {\n      this.unprocessedModelDescriptions.set(definition.key, definition);\n    }\n\n    if (data) {\n      this.addData({\n        model: definition.key,\n        data,\n        autoGenerateProperties: definition.autoGenerateProperties,\n        autoGenerateKey: definition.autoGenerateKey,\n        keyProperty: definition.keyProperty,\n      });\n    }\n  }\n\n  private mergeModels(modelA: ModelDefinition, modelB: ModelDefinition): ModelDefinition {\n    // Scalar/object fields (keyProperty, keyPropertySeparator, autoGenerateKey,\n    // autoGenerateProperties, meta, quality, ...) follow a last-write-wins\n    // contract: modelB overrides modelA for any field it carries. The\n    // `properties` and `references` arrays are the exception — they are\n    // concatenated so that successive definitions accumulate rather than clobber.\n    const newModel = Object.assign({}, modelA, modelB);\n\n    if (Array.isArray(modelA.properties) || Array.isArray(modelB.properties)) {\n      newModel.properties = [\n        ...(Array.isArray(modelA.properties) ? modelA.properties : []),\n        ...(Array.isArray(modelB.properties) ? modelB.properties : []),\n      ];\n    }\n    if (Array.isArray(modelA.references) || Array.isArray(modelB.references)) {\n      newModel.references = [\n        ...(Array.isArray(modelA.references) ? modelA.references : []),\n        ...(Array.isArray(modelB.references) ? modelB.references : []),\n      ];\n    }\n\n    return newModel;\n  }\n\n  @trigger({\n    scope: 'global',\n    type: 'data_change',\n    connectMessage: true,\n  })\n  public addData(container: DataContainer<RawItem>): void {\n    this.assertNotSealed('data');\n    if (!container || !container.model || !container.data) {\n      throw new Error('Invalid Data Container');\n    }\n\n    if (!Array.isArray(container.data)) {\n      throw new Error('Invalid Data - Data must be an Array');\n    }\n\n    if (!container.type) {\n      container.type = 'set';\n    }\n\n    if (container.autoGenerateProperties) {\n      this.addModel({\n        key: container.model,\n        autoGenerateProperties: container.autoGenerateProperties,\n        autoGenerateKey: container.autoGenerateKey,\n        keyProperty: container.keyProperty || 'key',\n      });\n    }\n\n    // Track data changes for partial updates\n    this.changeTracker.recordDataChange(container);\n\n    this.unprocessedData.push(container);\n  }\n\n  /** Registers a view definition. The parser keeps its own copy (#314). */\n  @trigger({\n    scope: 'global',\n    type: 'view_add',\n    connectMessage: true,\n  })\n  public addView(view: ViewDefinition): void {\n    this.views.set(view.key, cloneDeep(view));\n  }\n\n  /**\n   * Sets a validation error for a model.\n   * Requires both global quality controller AND model-specific quality to be enabled.\n   * This implements the two-tier validation system.\n   */\n  private setError(error: QualityAnalyzer.InternalModelError, model: DcuplModel): void {\n    if (this.qualityController.enabled) {\n      if (model.qualityConfig.enabled === true) {\n        this.qualityController.setError(error);\n      }\n    }\n  }\n\n  /**\n   * Folds each model's queued containers into the one `set` container that is\n   * processed. A lone `set` container whose rows have unique keys is processed\n   * as is. Every other group goes through mergeContainers(), which applies the\n   * containers in order and dedupes the rows by key: a lone `update`/`remove`\n   * on a model without data changes nothing (#365), and duplicate keys in a\n   * `set` payload keep only the last row (#369).\n   */\n  private getMergedContainers(containers: DataContainer<RawItem>[]): DataContainer<RawItem>[] {\n    const newContainers = this.handleAlternativeKey(containers);\n    const relevantContainer = newContainers.filter((container) => !container.placeholderUid);\n    const mergedContainers: DataContainer<RawItem>[] = [];\n\n    const groupedContainers = groupBy(relevantContainer, 'model');\n\n    for (const key in groupedContainers) {\n      const containerGroup = groupedContainers[key]!;\n      if (containerGroup.length === 1 && this.isProcessableAsIs(containerGroup[0]!)) {\n        mergedContainers.push(containerGroup[0]!);\n        continue;\n      }\n\n      const container = this.mergeContainers(containerGroup);\n      const mergedMetadata = this.mergeContainerSourceMetadata(containerGroup);\n      if (mergedMetadata) {\n        this.dcuplInstance.setContainerSourceMetadata(container, mergedMetadata);\n      }\n      mergedContainers.push(container);\n    }\n\n    return mergedContainers;\n  }\n\n  /**\n   * Keys of the rows that a later row with the same key replaced in the `set`\n   * payload behind `container`, one entry per replaced row (#369). Empty for\n   * containers without duplicate keys.\n   */\n  public getReplacedRowKeys(container: DataContainer<RawItem>): readonly string[] {\n    return this.replacedRowKeys.get(container) ?? [];\n  }\n\n  /**\n   * A lone container needs no merge when it is a `set` whose rows have unique\n   * keys. A lone `update`/`upsert`/`remove` is merged onto an empty dataset,\n   * so an update or remove on a model without data changes nothing (#365).\n   */\n  private isProcessableAsIs(container: DataContainer<RawItem>): boolean {\n    if (container.type !== undefined && container.type !== 'set') {\n      return false;\n    }\n    const rowKeys = new Set<string>();\n    for (const row of container.data) {\n      if (!hasRowKey(row)) {\n        continue;\n      }\n      const rowKey = String(row.key);\n      if (rowKeys.has(rowKey)) {\n        return false;\n      }\n      rowKeys.add(rowKey);\n    }\n    return true;\n  }\n\n  /**\n   * Collapse the accumulated container history into the already-merged per-model\n   * result so `unprocessedData` stays bounded (≈ one container per model) instead\n   * of growing with every data mutation — the merged result is identical to\n   * re-merging the full history, so this is behavior-preserving and only affects\n   * how much is re-merged on the next cycle. Runs after processing completes.\n   *\n   * - Only the containers the apply merged (`consumedContainers`) are collapsed.\n   *   Every other container stays queued after the merged result, keeping its\n   *   relative order: pending (unresolved) placeholders, and placeholders\n   *   resolved or containers staged while the apply ran — it yields to the\n   *   event loop, and dropping those lost their data. A placeholder that was\n   *   already pending therefore folds after containers this apply merged, even\n   *   ones staged after it (as before).\n   * - Merged containers are registered as already-keyed so a subsequent\n   *   handleAlternativeKey pass does not re-apply a composite keyProperty (#182).\n   */\n  private consolidateUnprocessedData(\n    mergedContainers: DataContainer<RawItem>[],\n    consumedContainers: DataContainer<RawItem>[],\n  ): void {\n    const consumed = new Set(consumedContainers);\n    const pendingContainers = this.unprocessedData.filter((container) => !consumed.has(container));\n    // A merged container replaces the containers it was merged from, so it is kept only while they\n    // are still queued: `models.remove` during the apply took them out, and its rows must not come\n    // back with a later `models.set` (#420).\n    const stillQueued = new Set(this.unprocessedData);\n    const queuedModels = new Set(\n      consumedContainers.filter((container) => stillQueued.has(container)).map((container) => container.model),\n    );\n    const keptContainers = mergedContainers.filter((container) => queuedModels.has(container.model));\n    for (const container of keptContainers) {\n      this.keyedContainers.add(container);\n    }\n    this.unprocessedData = [...keptContainers, ...pendingContainers];\n  }\n\n  /**\n   * Re-records the containers still queued on top of the merged result after\n   * an apply cleared the change tracker. They were staged (or their\n   * placeholder resolved) while the apply ran and are not processed yet: the\n   * next apply must still see them, or its partial path skips their data.\n   * Left out: pending placeholders, which carry no data yet (as before), and\n   * internal `$` models, whose containers the apply stages and builds itself\n   * (quality initData stages the error-tracking models, built at once or on\n   * first read).\n   */\n  private retrackUnprocessedData(mergedContainers: DataContainer<RawItem>[]): void {\n    const merged = new Set(mergedContainers);\n    for (const container of this.unprocessedData) {\n      if (merged.has(container) || container.placeholderUid || container.model.startsWith('$')) {\n        continue;\n      }\n      this.changeTracker.recordDataChange(container);\n    }\n  }\n\n  /**\n   * Applies a model's containers in order and returns one `set` container\n   * with one row per key. Keys are compared as strings, the same identity the\n   * model stores, and rows without a key are passed through for the model to\n   * drop as `MissingKey`.\n   *\n   * - `set`: replaces the rows. Rows with the same key are deduped: the last\n   *   row wins as a whole and keeps the first row's position; the keys of the\n   *   replaced rows are kept for the model's NonUniqueKey errors (#369).\n   * - `upsert`: merges a row into the stored row with the same key (see\n   *   mergeRow) or inserts it.\n   * - `update`: merges a row into the stored row with the same key and ignores\n   *   unknown keys, also when the model has no rows yet (#365).\n   * - `remove`: deletes the rows with the given keys; unknown keys are ignored.\n   *\n   * The result carries the key settings of the `set` container that supplied\n   * the rows (without one: of the last container that has them), so the\n   * model's errors name the same key attribute.\n   */\n  private mergeContainers(containers: DataContainer<RawItem>[]): DataContainer<RawItem> {\n    let dataset = new Map<string, RawItem>();\n    let keylessRows: RawItem[] = [];\n    let replacedRowKeys: string[] = [];\n    let setContainer: DataContainer<RawItem> | undefined;\n\n    for (const newContainer of containers) {\n      switch (newContainer.type) {\n        case 'upsert':\n          for (const entry of newContainer.data) {\n            if (!hasRowKey(entry)) {\n              keylessRows.push(entry);\n              continue;\n            }\n            const rowKey = String(entry.key);\n            const storedRow = dataset.get(rowKey);\n            dataset.set(rowKey, storedRow ? this.mergeRow(storedRow, entry) : entry);\n          }\n          break;\n        case 'update':\n          for (const entry of newContainer.data) {\n            const rowKey = hasRowKey(entry) ? String(entry.key) : undefined;\n            const storedRow = rowKey === undefined ? undefined : dataset.get(rowKey);\n            if (rowKey !== undefined && storedRow) {\n              dataset.set(rowKey, this.mergeRow(storedRow, entry));\n            }\n          }\n          break;\n        case 'remove':\n          for (const entry of newContainer.data) {\n            if (hasRowKey(entry)) {\n              dataset.delete(String(entry.key));\n            }\n          }\n          break;\n        case 'set':\n        default:\n          dataset = new Map();\n          keylessRows = [];\n          // A container this merge built earlier is already deduped; its\n          // replaced rows are carried over so a re-init reports them again,\n          // also when a later update/remove touched the key (they describe\n          // this set payload).\n          replacedRowKeys = [...this.getReplacedRowKeys(newContainer)];\n          setContainer = newContainer;\n          for (const entry of newContainer.data) {\n            if (!hasRowKey(entry)) {\n              keylessRows.push(entry);\n              continue;\n            }\n            const rowKey = String(entry.key);\n            if (dataset.has(rowKey)) {\n              replacedRowKeys.push(rowKey);\n            }\n            dataset.set(rowKey, entry);\n          }\n          break;\n      }\n    }\n\n    const container: DataContainer<RawItem> = {\n      model: containers[0]!.model!,\n      data: [...dataset.values(), ...keylessRows],\n      type: 'set',\n    };\n    const keySource =\n      setContainer ?? [...containers].reverse().find((candidate) => candidate.keyProperty !== undefined);\n    if (keySource?.keyProperty !== undefined) {\n      container.keyProperty = keySource.keyProperty;\n    }\n    if (keySource?.keyPropertySeparator !== undefined) {\n      container.keyPropertySeparator = keySource.keyPropertySeparator;\n    }\n    // The rows already carry their extracted keys.\n    this.keyedContainers.add(container);\n    if (replacedRowKeys.length > 0) {\n      this.replacedRowKeys.set(container, replacedRowKeys);\n    }\n\n    return container;\n  }\n\n  /**\n   * Folds an update/upsert payload row into the stored row. Every attribute\n   * the payload carries replaces the stored value wholesale: arrays\n   * (Array<…> properties, multi-valued references) and objects (json/any\n   * properties) are never merged element-wise or recursively — change\n   * tracking and the partial path work per attribute, too. Attributes absent\n   * from the payload, or `undefined` in it, keep their stored value (send\n   * `null` to clear one). Returns a new row and mutates neither input: rows\n   * can be caller-owned, and json values are stored by reference.\n   */\n  private mergeRow(storedRow: RawItem, payloadRow: RawItem): RawItem {\n    const mergedRow: RawItem = { ...storedRow };\n    for (const attributeKey of Object.keys(payloadRow)) {\n      const value = payloadRow[attributeKey];\n      // An own `__proto__` key (JSON.parse yields one) would re-parent the row\n      // instead of setting an attribute; lodash `merge` skipped it, too.\n      if (value !== undefined && attributeKey !== '__proto__') {\n        mergedRow[attributeKey] = value;\n      }\n    }\n    return mergedRow;\n  }\n\n  /**\n   * Mirrors mergeContainers() for the loader source-metadata side channel: when\n   * several resources feed one model, their per-resource coercion metadata must\n   * be combined onto the merged container, otherwise the CSV aggregation path in\n   * QualityController loses its side channel (dcupl#197). 'set'/default resets the\n   * effective metadata (the dataset is replaced); 'upsert'/'update' accumulate\n   * columns and failure counts; 'remove' leaves the effective metadata unchanged\n   * (an approximation — removed rows' failures may be over-counted).\n   */\n  private mergeContainerSourceMetadata(containers: DataContainer<RawItem>[]): ContainerSourceMetadata | undefined {\n    let effective:\n      | {\n          columns: Set<string>;\n          samples: Record<string, { rawValue: string; expected: string; count: number }>;\n          origin?: string;\n        }\n      | undefined;\n\n    for (const container of containers) {\n      const meta = this.dcuplInstance.getContainerSourceMetadata(container);\n      const type = container.type ?? 'set';\n\n      if (type === 'set') {\n        // Dataset is replaced → effective metadata is exactly this container's.\n        effective = meta\n          ? {\n              columns: new Set(meta.sourceColumns),\n              samples: this.cloneCoercionSamples(meta.coercionFailureSamples),\n              origin: meta.origin,\n            }\n          : undefined;\n      } else if (type === 'upsert' || type === 'update') {\n        if (meta) {\n          if (!effective) {\n            effective = { columns: new Set(), samples: {}, origin: meta.origin };\n          }\n          // origin is kept from the dataset-owning ('set') resource; upsert/update\n          // resources contribute columns and counts but do not change origin.\n          meta.sourceColumns.forEach((col) => effective!.columns.add(col));\n          for (const col of Object.keys(meta.coercionFailureSamples)) {\n            const sample = meta.coercionFailureSamples[col]!;\n            const existing = effective.samples[col];\n            if (existing) {\n              existing.count += sample.count;\n            } else {\n              effective.samples[col] = { ...sample };\n            }\n          }\n        }\n      }\n      // type === 'remove': leave effective unchanged.\n    }\n\n    if (!effective) {\n      return undefined;\n    }\n    return {\n      sourceColumns: Array.from(effective.columns),\n      coercionFailureSamples: effective.samples,\n      origin: effective.origin,\n    };\n  }\n\n  private cloneCoercionSamples(\n    samples: Record<string, { rawValue: string; expected: string; count: number }>,\n  ): Record<string, { rawValue: string; expected: string; count: number }> {\n    const clone: Record<string, { rawValue: string; expected: string; count: number }> = {};\n    for (const col of Object.keys(samples)) {\n      clone[col] = { ...samples[col]! };\n    }\n    return clone;\n  }\n\n  private async connectDataWithModels(containers: DataContainer<RawItem>[]): Promise<void> {\n    try {\n      this.dependencyGraph.order();\n    } catch (error) {\n      this.log.warn(\n        'Your models have circular dependencies which might lead to errors. Please consider changing your models',\n      );\n      this.log.error('Dependency graph error', error as Error);\n    }\n\n    const orderedModelKeys = this.dependencyGraph.order({ allowCycles: true });\n\n    containers.sort((a, b) => {\n      return orderedModelKeys.indexOf(a.model) - orderedModelKeys.indexOf(b.model);\n    });\n\n    await this.handleDataContainer(containers);\n  }\n\n  /**\n   * Performs partial data processing by only reprocessing changed attributes and their dependents\n   * @param containers - Data containers to process\n   */\n  private async connectDataWithModelsPartial(containers: DataContainer<RawItem>[]): Promise<void> {\n    // Step 0: Sort containers by dependency order (same as full update path)\n    // This ensures models are processed in the correct order (e.g., Customer before Order)\n    const orderedModelKeys = this.dependencyGraph.order({ allowCycles: true });\n    containers.sort((a, b) => {\n      return orderedModelKeys.indexOf(a.model) - orderedModelKeys.indexOf(b.model);\n    });\n\n    // Auto-generate properties BEFORE the change plan is built (#373): an\n    // attribute that first appears in this update has no property yet, and the\n    // plan below only keeps attributes the model declares — generating it\n    // afterwards left its values undefined. The new property is unknown to the\n    // attribute dependency graph and takes the step-1 fallback below. Every\n    // row is new to it, untouched rows that carry it included: step 1 fills it\n    // for all rows, as init() does.\n    const generatedAttributes = new Map<string, Set<string>>();\n    for (const dataContainer of containers) {\n      const model = this.models.get(dataContainer.model);\n      if (model?.autoGenerateProperties) {\n        const known = new Set(model.properties.keys());\n        model.generatePropertiesFromContainer(dataContainer);\n        const generated = new Set([...model.properties.keys()].filter((key) => !known.has(key)));\n        if (generated.size > 0) {\n          generatedAttributes.set(model.key, generated);\n        }\n      }\n    }\n\n    // Split the changed rows into rows of existing items and inserted rows. An\n    // inserted row changes every attribute of its model, as a removed one does\n    // (partialUpdate): without that, a row that carries only its key gave the\n    // plan no attribute and was never inserted (#398), and its derived values\n    // stayed uncomputed.\n    let changedRowsByModel = this.splitChangedRows(containers);\n\n    // Rows that reference an item this update inserts or removes resolve that\n    // reference again (#368): a hit becomes a miss with its\n    // RemoteReferenceKeyNotFound error and vice versa, as on init().\n    const referencingItemKeys = this.getItemsReferencingChangedItems(containers, changedRowsByModel);\n    if (referencingItemKeys.size > 0) {\n      changedRowsByModel = this.splitChangedRows(containers, referencingItemKeys);\n    }\n\n    for (const [modelKey, { insertedRows }] of changedRowsByModel) {\n      const model = this.models.get(modelKey);\n      if (!model || insertedRows.length === 0) continue;\n      for (const attributeKey of [...model.properties.keys(), ...model.references.keys()]) {\n        this.changeTracker.recordAttributeChange(modelKey, attributeKey);\n      }\n    }\n\n    // Step 1: Determine which attributes changed\n    const changedAttributes: AttributeNode[] = [];\n\n    for (const [modelKey, attributeKeys] of this.changeTracker.getChangedAttributes()) {\n      for (const attributeKey of attributeKeys) {\n        // Find the attribute node in the dependency graph\n        const attributeNodes = this.attributeDependencyGraph.getAttributesForModel(modelKey);\n        const matchingNode = attributeNodes.find((node) => node.attributeKey === attributeKey);\n\n        if (matchingNode) {\n          changedAttributes.push(matchingNode);\n        } else {\n          // If not in dependency graph, it's a basic attribute with no dependencies\n          // We still need to mark it as changed but it won't cascade\n          const model = this.models.get(modelKey);\n          if (model) {\n            const property = model.properties.get(attributeKey);\n            const reference = model.references.get(attributeKey);\n\n            if (property || reference) {\n              changedAttributes.push({\n                modelKey,\n                attributeKey,\n                type: property ? 'property' : 'reference',\n                processingStep: 1, // Basic attributes are step 1\n              });\n            }\n          }\n        }\n      }\n    }\n\n    // Step 2: Find all impacted attributes (including cascading dependencies)\n    const impactedAttributes = this.attributeDependencyGraph.getImpactedAttributes(changedAttributes);\n\n    // Step 3: Get processing order (grouped by model and step)\n    const processingPlan = this.attributeDependencyGraph.getProcessingOrder(impactedAttributes);\n\n    // Step 4 (#368): limit step 1 to the changed rows and prepare their error records\n    const rowScopes = this.getPartialRowScopes(processingPlan, containers, changedRowsByModel, generatedAttributes);\n\n    // Step 5: Process attributes in order by step using PARTIAL methods\n    // We need to process all models for each step before moving to the next step\n    for (const step of [1, 2, 3, 4] as const) {\n      await this.processAttributesForStep(step, processingPlan, containers, rowScopes);\n    }\n\n    // Step 5b (#243): drop model-level indices derived from the impacted\n    // attributes — eager fills only cover index:true properties and\n    // references, so lazily built plain indices (facets/pivot), the\n    // context-hashed indices (aggregate/sections/suggest) and deep indices\n    // would keep serving pre-update values. The next read rebuilds them.\n    for (const [modelKey, stepMap] of processingPlan.entries()) {\n      const model = this.models.get(modelKey);\n      if (!model) continue;\n      const impactedAttributeKeys = new Set<string>();\n      for (const attrs of stepMap.values()) {\n        for (const attributeKey of attrs) {\n          impactedAttributeKeys.add(attributeKey);\n        }\n      }\n      for (const attributeKey of rowScopes.get(modelKey)?.allRowsAttributes ?? []) {\n        impactedAttributeKeys.add(attributeKey);\n      }\n      model.resetIndicesForChangedAttributes(impactedAttributeKeys);\n    }\n\n    // Step 6 (#368): complete the error records the way init() does — consolidate\n    // the reprocessed attributes and re-run the unique check\n    for (const container of containers) {\n      const model = this.models.get(container.model);\n      const scope = rowScopes.get(container.model);\n      if (model && scope) {\n        this.qualityController.finishPartialUpdate(\n          model,\n          container,\n          new Set([...scope.attributes, ...scope.allRowsAttributes]),\n          scope.rowsChanged,\n        );\n      }\n    }\n\n    // Clear change tracker after successful partial update\n    this.changeTracker.clear();\n  }\n\n  /**\n   * The merged rows of the items the pending changes touch, per model: rows of\n   * existing items and rows the update inserts (no stored item yet). Rows\n   * without a key are left out — init() reported them already (MissingKey).\n   */\n  private splitChangedRows(\n    containers: DataContainer<RawItem>[],\n    extraItemKeys?: Map<string, Set<string>>,\n  ): Map<string, { changedRows: RawItem[]; insertedRows: RawItem[] }> {\n    const rowsByModel = new Map<string, { changedRows: RawItem[]; insertedRows: RawItem[] }>();\n    for (const container of containers) {\n      const model = this.models.get(container.model);\n      const changedItemKeys = this.changeTracker.getChangedItems(container.model);\n      const extraKeys = extraItemKeys?.get(container.model);\n      if (!model || (changedItemKeys.size === 0 && !extraKeys)) continue;\n\n      const changedRows: RawItem[] = [];\n      const insertedRows: RawItem[] = [];\n      for (const row of container.data) {\n        if (row.key === undefined || row.key === null) continue;\n        const itemKey = String(row.key);\n        if (!changedItemKeys.has(itemKey) && !extraKeys?.has(itemKey)) continue;\n        (model.getEntry(itemKey) ? changedRows : insertedRows).push(row);\n      }\n      rowsByModel.set(container.model, { changedRows, insertedRows });\n    }\n    return rowsByModel;\n  }\n\n  /**\n   * The items, per model, whose basic reference points at an item that this\n   * update inserts or removes (#368). Records those references as changed, so\n   * they and their dependents are processed again. Matches the raw reference\n   * value (any separator part, array element or object key) and the stored\n   * one, so strict references that dropped a missing key are found too.\n   * References within one model count too: they resolve against every row of\n   * the model, whatever its position (#411).\n   */\n  private getItemsReferencingChangedItems(\n    containers: DataContainer<RawItem>[],\n    changedRowsByModel: Map<string, { changedRows: RawItem[]; insertedRows: RawItem[] }>,\n  ): Map<string, Set<string>> {\n    const changedKeysByModel = new Map<string, Set<string>>();\n    const addKey = (keysByModel: Map<string, Set<string>>, modelKey: string, itemKey: string): void => {\n      const keys = keysByModel.get(modelKey) ?? new Set<string>();\n      keys.add(itemKey);\n      keysByModel.set(modelKey, keys);\n    };\n    for (const [modelKey, { insertedRows }] of changedRowsByModel) {\n      for (const row of insertedRows) addKey(changedKeysByModel, modelKey, String(row.key));\n    }\n    for (const modelKey of this.changeTracker.getModelsWithChanges()) {\n      for (const itemKey of this.changeTracker.getDeletedItems(modelKey)) {\n        addKey(changedKeysByModel, modelKey, itemKey);\n      }\n    }\n\n    const referencingItemKeys = new Map<string, Set<string>>();\n    if (changedKeysByModel.size === 0) return referencingItemKeys;\n\n    for (const container of containers) {\n      const model = this.models.get(container.model);\n      if (!model) continue;\n      const references = model.getBasicReferences().filter((reference) => changedKeysByModel.has(reference.model));\n      if (references.length === 0) continue;\n\n      const itemKeys = new Set<string>();\n      for (const row of container.data) {\n        if (row.key === undefined || row.key === null) continue;\n        const stored = model.getEntry(String(row.key));\n        if (!stored) continue;\n        for (const reference of references) {\n          const changedKeys = changedKeysByModel.get(reference.model)!;\n          const values = [\n            row[reference.key],\n            reference.origin ? row[reference.origin] : undefined,\n            stored[reference.key],\n          ];\n          if (values.some((value) => this.referencesAnyKey(value, changedKeys, reference.separator))) {\n            itemKeys.add(String(row.key));\n            this.changeTracker.recordAttributeChange(model.key, reference.key);\n          }\n        }\n      }\n      if (itemKeys.size > 0) {\n        referencingItemKeys.set(model.key, itemKeys);\n      }\n    }\n    return referencingItemKeys;\n  }\n\n  /** Whether a raw or stored reference value names one of `keys` (a superset match). */\n  private referencesAnyKey(value: unknown, keys: Set<string>, separator = ','): boolean {\n    if (value === undefined || value === null) return false;\n    if (Array.isArray(value)) {\n      return value.some((entry) => this.referencesAnyKey(entry, keys, separator));\n    }\n    if (typeof value === 'object') {\n      const key = (value as { key?: unknown }).key;\n      return key !== undefined && key !== null && keys.has(String(key));\n    }\n    const text = String(value);\n    return keys.has(text) || keys.has(text.trim()) || text.split(separator).some((part) => keys.has(part.trim()));\n  }\n\n  /**\n   * Scopes step 1 of a partial update to the rows that changed (#368): the\n   * other rows' raw values did not change, so reprocessing them only recorded\n   * their errors again. Rows the update inserts are processed for every basic\n   * attribute, as init() does. With error tracking on, it removes the error\n   * records the update re-derives (QualityController.prepareErrorsForPartialUpdate);\n   * the attributes whose errors need every row are reprocessed for all rows.\n   */\n  private getPartialRowScopes(\n    processingPlan: Map<string, Map<number, Set<string>>>,\n    containers: DataContainer<RawItem>[],\n    changedRowsByModel: Map<string, { changedRows: RawItem[]; insertedRows: RawItem[] }>,\n    generatedAttributes: Map<string, Set<string>>,\n  ): Map<string, PartialRowScope> {\n    const scopes = new Map<string, PartialRowScope>();\n\n    for (const container of containers) {\n      const model = this.models.get(container.model);\n      const planAttributes = processingPlan.get(container.model)?.get(1) ?? new Set<string>();\n      const { changedRows, insertedRows } = changedRowsByModel.get(container.model) ?? {\n        changedRows: [],\n        insertedRows: [],\n      };\n      const generated = generatedAttributes.get(container.model) ?? new Set<string>();\n      // A model without attributes still has to insert its new rows (#398)\n      if (!model || (planAttributes.size === 0 && insertedRows.length === 0 && generated.size === 0)) continue;\n\n      const attributes = new Set(planAttributes);\n      if (insertedRows.length > 0) {\n        for (const attributeKey of [...model.properties.keys(), ...model.references.keys()]) {\n          attributes.add(attributeKey);\n        }\n      }\n\n      const rowKeys = new Set([...changedRows, ...insertedRows].map((row) => String(row.key)));\n      const deletedItemKeys = this.changeTracker.getDeletedItems(model.key);\n      const allRowsAttributes = this.qualityController.enabled\n        ? this.qualityController.prepareErrorsForPartialUpdate(model, attributes, rowKeys, deletedItemKeys)\n        : new Set<string>();\n      // A property generated in this update is new to every row (#373)\n      for (const attributeKey of generated) {\n        allRowsAttributes.add(attributeKey);\n      }\n\n      scopes.set(model.key, {\n        changedRows,\n        insertedRows,\n        attributes,\n        allRowsAttributes,\n        rowsChanged: rowKeys.size > 0 || deletedItemKeys.size > 0,\n      });\n    }\n\n    return scopes;\n  }\n\n  /**\n   * Step 1 of the partial path for one model (#368): the changed attributes of\n   * the changed rows, every basic attribute of the inserted rows, and the\n   * attributes of `scope.allRowsAttributes` for every row.\n   */\n  private addBasicAttributesPartial(\n    model: DcuplModel,\n    container: DataContainer<RawItem>,\n    attributes: Set<string>,\n    scope: PartialRowScope | undefined,\n  ): void {\n    // A reference within the model resolves against every row the model will\n    // hold, not only the rows processed so far (#411). Removals are applied and\n    // every existing row is stored already, so only inserted rows are pending.\n    const pendingItemKeys = model.getPendingItemKeys(scope ? scope.insertedRows : container.data);\n\n    if (!scope) {\n      model.addBasicPropertiesAndReferencesPartial(container, attributes, pendingItemKeys);\n      return;\n    }\n\n    const withoutAllRows = (keys: Set<string>): Set<string> =>\n      new Set([...keys].filter((key) => !scope.allRowsAttributes.has(key)));\n\n    const changedRowAttributes = withoutAllRows(attributes);\n    if (scope.changedRows.length > 0 && changedRowAttributes.size > 0) {\n      model.addBasicPropertiesAndReferencesPartial(\n        this.getContainerWithRows(container, scope.changedRows),\n        changedRowAttributes,\n        pendingItemKeys,\n      );\n    }\n    if (scope.insertedRows.length > 0) {\n      model.addBasicPropertiesAndReferencesPartial(\n        this.getContainerWithRows(container, scope.insertedRows),\n        withoutAllRows(scope.attributes),\n        pendingItemKeys,\n      );\n    }\n    if (scope.allRowsAttributes.size > 0) {\n      const keyedRows = container.data.filter((row) => row.key !== undefined && row.key !== null);\n      model.addBasicPropertiesAndReferencesPartial(\n        this.getContainerWithRows(container, keyedRows),\n        scope.allRowsAttributes,\n        pendingItemKeys,\n      );\n    }\n  }\n\n  /** `container` limited to `rows`, keeping its source metadata (the error `origin`). */\n  private getContainerWithRows(container: DataContainer<RawItem>, rows: RawItem[]): DataContainer<RawItem> {\n    const view: DataContainer<RawItem> = { ...container, data: rows };\n    const sourceMetadata = this.dcuplInstance.getContainerSourceMetadata(container);\n    if (sourceMetadata) {\n      this.dcuplInstance.setContainerSourceMetadata(view, sourceMetadata);\n    }\n    return view;\n  }\n\n  /**\n   * Computes the processing order for resolved references in step 2\n   * Resolved references that depend on basic references should be processed before\n   * resolved references that depend on other resolved references\n   * @param processingPlan - The full processing plan\n   * @returns Array of model keys in the correct processing order\n   */\n  private getResolvedReferenceProcessingOrder(processingPlan: Map<string, Map<number, Set<string>>>): string[] {\n    // Build a dependency graph for resolved references\n    const dependencies = new Map<string, Set<string>>(); // modelKey → Set of models it depends on\n    const allModelsWithStep2 = new Set<string>();\n\n    // Collect all models that have step 2 attributes\n    for (const [modelKey, stepMap] of processingPlan.entries()) {\n      const step2Attrs = stepMap.get(2);\n      if (step2Attrs && step2Attrs.size > 0) {\n        allModelsWithStep2.add(modelKey);\n        dependencies.set(modelKey, new Set());\n      }\n    }\n\n    // If no models have step 2 attributes, return the original order\n    if (allModelsWithStep2.size === 0) {\n      return this.dependencyGraph.order();\n    }\n\n    // For each model with step 2, find which other models' resolved references it depends on\n    for (const modelKey of allModelsWithStep2) {\n      const model = this.models.get(modelKey);\n      if (!model) continue;\n\n      const step2Attrs = processingPlan.get(modelKey)?.get(2);\n      if (!step2Attrs) continue;\n\n      // Check each resolved reference\n      for (const attrKey of step2Attrs) {\n        const reference = model.references.get(attrKey);\n        if (reference && isResolvedReference(reference)) {\n          // This is a resolved reference - it depends on the remote model's basic reference\n          const remoteModelKey = reference.resolve.model;\n          const remoteRefKey = reference.resolve.reference;\n\n          // Check if the remote reference is ALSO a resolved reference being rebuilt\n          const remoteModel = this.models.get(remoteModelKey);\n          if (remoteModel) {\n            const remoteRef = remoteModel.references.get(remoteRefKey);\n            // If the remote reference is a resolved reference, we have a dependency\n            if (remoteRef && isResolvedReference(remoteRef)) {\n              // modelKey depends on remoteModelKey\n              dependencies.get(modelKey)!.add(remoteModelKey);\n            }\n          }\n        }\n      }\n    }\n\n    // Topological sort\n    const sorted: string[] = [];\n    const visiting = new Set<string>();\n    const visited = new Set<string>();\n\n    const visit = (modelKey: string): void => {\n      if (visited.has(modelKey)) return;\n      if (visiting.has(modelKey)) {\n        // Circular dependency - just continue\n        return;\n      }\n\n      visiting.add(modelKey);\n      const deps = dependencies.get(modelKey);\n      if (deps) {\n        for (const dep of deps) {\n          visit(dep);\n        }\n      }\n      visiting.delete(modelKey);\n      visited.add(modelKey);\n      sorted.push(modelKey);\n    };\n\n    for (const modelKey of allModelsWithStep2) {\n      visit(modelKey);\n    }\n\n    // Only return the models that have step 2 attributes, in dependency order\n    // All other models will be skipped during step 2 processing anyway\n    return sorted;\n  }\n\n  /**\n   * Processes specific attributes for a given step across all affected models\n   * @param step - Processing step (1-4)\n   * @param processingPlan - Map of modelKey → Map of step → Set of attributeKeys\n   * @param containers - Data containers being processed\n   */\n  private async processAttributesForStep(\n    step: 1 | 2 | 3 | 4,\n    processingPlan: Map<string, Map<number, Set<string>>>,\n    containers: DataContainer<RawItem>[],\n    rowScopes: Map<string, PartialRowScope>,\n  ): Promise<void> {\n    // Get dependency-ordered model list\n    let orderedModelKeys = this.dependencyGraph.order({ allowCycles: true });\n\n    // For step 2 (resolved references), we need special ordering\n    // because resolved references can depend on OTHER resolved references\n    if (step === 2) {\n      orderedModelKeys = this.getResolvedReferenceProcessingOrder(processingPlan);\n    }\n\n    // Process models in dependency order\n    for (const modelKey of orderedModelKeys) {\n      // Step 1 also runs for a model without attributes to plan when it inserts\n      // rows (#398) or generated a property in this update (#373)\n      const scope = step === 1 ? rowScopes.get(modelKey) : undefined;\n      const hasRowWork = !!scope && (scope.insertedRows.length > 0 || scope.allRowsAttributes.size > 0);\n      const attributesForStep = processingPlan.get(modelKey)?.get(step) ?? new Set<string>();\n      if (attributesForStep.size === 0 && !hasRowWork) continue;\n\n      const model = this.models.get(modelKey);\n      if (!model) continue;\n\n      const context = generateKey();\n      const stepName = `dcupl:partial_process_data:step_${step}`;\n\n      this.cdRef.analyticsController.mark({\n        name: `${stepName}:start`,\n        context,\n      });\n\n      // For step 2 (resolved references), we may need to process even if there's no container\n      // because changes in other models affect resolved references\n      if (step === 2) {\n        // Rebuild only the specific resolved references in the processing plan\n        // This ensures we don't rebuild references using stale data from other unprocessed resolved references\n        model.rebuildResolvedReferencesForAllItems(attributesForStep);\n      } else {\n        // For other steps, we need a container\n        const container = containers.find((c) => c.model === modelKey);\n        if (!container) continue;\n\n        // Process attributes based on the step\n        switch (step) {\n          case 1:\n            // Basic properties and references, for the changed rows only (#368)\n            this.addBasicAttributesPartial(model, container, attributesForStep, rowScopes.get(modelKey));\n            break;\n          case 3:\n            // Derived/grouped references and derived/expression properties\n            model.addDerivedAndExpressionAttributesPartial(container, attributesForStep);\n            break;\n          case 4:\n            // Reprocess derived properties based on resolved references\n            model.reRunDerivedPropertiesBasedOnResolvesPartial(container, attributesForStep);\n            break;\n        }\n      }\n\n      this.cdRef.analyticsController.mark({\n        name: `${stepName}:end`,\n        context,\n      });\n\n      this.cdRef.analyticsController.measure({\n        name: stepName,\n        start: `${stepName}:start`,\n        end: `${stepName}:end`,\n        context,\n        detail: {\n          model: modelKey,\n          attributeCount: attributesForStep.size,\n        },\n      });\n    }\n  }\n\n  public handleAlternativeKey(containers: DataContainer<RawItem>[]): DataContainer<ListItem>[] {\n    containers.forEach((container) => {\n      if (this.keyedContainers.has(container)) {\n        return;\n      }\n\n      const model = this.models.get(container.model);\n\n      const keyProperty = container.keyProperty ?? model?.keyProperty;\n      const separator = container.keyPropertySeparator ?? model?.keyPropertySeparator ?? DEFAULT_KEY_PROPERTY_SEPARATOR;\n      const autoGenerateKey = container.autoGenerateKey || model?.autoGenerateKey;\n\n      const hasNamedKey =\n        typeof keyProperty === 'string'\n          ? keyProperty !== '' && keyProperty !== 'key'\n          : Array.isArray(keyProperty) && keyProperty.length > 0;\n\n      if (hasNamedKey) {\n        // A row without a key value gets `key: undefined`: the model drops it\n        // as MissingKey instead of keying it 'undefined' (#377).\n        container.data.forEach((item) => {\n          item.key = extractRowKey(item, keyProperty as string | readonly string[], separator);\n        });\n      } else if (autoGenerateKey) {\n        container.data.forEach((item) => {\n          if (!item.key) {\n            item.key = generateKey();\n          }\n        });\n      }\n\n      this.keyedContainers.add(container);\n    });\n    return containers;\n  }\n\n  @trigger({\n    scope: 'global',\n    type: 'dcupl_handle_datacontainer',\n  })\n  private async handleDataContainer(containers: DataContainer[]): Promise<void> {\n    const steps = this.processDataContainers(containers);\n    while (!steps.next().done) {\n      await yieldToEventLoop();\n    }\n  }\n\n  /**\n   * The processing of handleDataContainer without yielding to the event loop, for callers that\n   * cannot wait: the error-tracking models are built on first read, inside a synchronous read (#444).\n   * It emits the same `dcupl_handle_datacontainer` message, when the containers are processed.\n   */\n  @trigger({\n    scope: 'global',\n    type: 'dcupl_handle_datacontainer',\n  })\n  public processDataContainersSync(containers: DataContainer[]): void {\n    const steps = this.processDataContainers(containers);\n    while (!steps.next().done) {\n      // run every step to the end\n    }\n  }\n\n  /**\n   * Steps 1-4 of the data processing. Yields where the async caller gives the event loop a turn\n   * (performance.containerBatchSize decides where, as before).\n   */\n  private *processDataContainers(containers: DataContainer[]): Generator<void, void, undefined> {\n    // Auto-generate properties first\n    for (const dataContainer of containers) {\n      const model = this.models.get(dataContainer.model);\n      if (model?.autoGenerateProperties) {\n        model.generatePropertiesFromContainer(dataContainer);\n      }\n    }\n\n    // Get batch size from config\n    // If undefined: yield after every container (default async behavior)\n    // If 0: never yield (fully synchronous)\n    // If > 0: yield every N containers (batched processing)\n    const batchSize = this.initOptions.performance?.containerBatchSize;\n    const syncMode = batchSize !== undefined; // true if explicitly set, false for default async\n\n    // Step 1: Basic properties and references\n    for (let i = 0; i < containers.length; i++) {\n      const dataContainer = containers[i]!;\n      const model = this.models.get(dataContainer.model);\n      const context = generateKey();\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_1:start`,\n        context,\n      });\n\n      if (model) {\n        model.addBasicPropertiesAndReferences(dataContainer);\n\n        if (this.qualityController.enabled) {\n          if (model.qualityConfig.enabled === true) {\n            this.qualityController.cleanUpErrors(model, dataContainer);\n          }\n        }\n      }\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_1:end`,\n        context,\n      });\n      this.cdRef.analyticsController.measure({\n        name: `dcupl:process_data:step_1`,\n        start: `dcupl:process_data:step_1:start`,\n        end: `dcupl:process_data:step_1:end`,\n        context,\n        detail: {\n          model: dataContainer.model,\n        },\n      });\n\n      // Yield logic:\n      // - Default (batchSize === undefined): yield after every container\n      // - Sync mode (batchSize === 0): never yield\n      // - Batched (batchSize > 0): yield every N containers\n      if (!syncMode) {\n        // Default: yield after every container\n        yield;\n      } else if (batchSize! > 0 && i > 0 && i % batchSize! === 0) {\n        // Batched: yield every N containers\n        yield;\n      }\n    }\n\n    // Step 2: Query and resolved references\n    for (let i = 0; i < containers.length; i++) {\n      const dataContainer = containers[i]!;\n      const model = this.models.get(dataContainer.model);\n      const context = generateKey();\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_2:start`,\n        context,\n      });\n\n      if (model && model.hasQueryReferences()) {\n        model.addQueryReferences(dataContainer);\n      }\n\n      if (model && model.hasResolvedReferences()) {\n        model.addResolvedReferences(dataContainer);\n      }\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_2:end`,\n        context,\n      });\n      this.cdRef.analyticsController.measure({\n        name: `dcupl:process_data:step_2`,\n        start: `dcupl:process_data:step_2:start`,\n        end: `dcupl:process_data:step_2:end`,\n        context,\n        detail: {\n          model: dataContainer.model,\n        },\n      });\n\n      // Yield logic (same as step 1)\n      if (!syncMode) {\n        yield;\n      } else if (batchSize! > 0 && i > 0 && i % batchSize! === 0) {\n        yield;\n      }\n    }\n\n    // Step 3: Derived references, grouped references, and expression properties\n    for (let i = 0; i < containers.length; i++) {\n      const dataContainer = containers[i]!;\n      const model = this.models.get(dataContainer.model);\n      const context = generateKey();\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_3:start`,\n        context,\n      });\n\n      if (\n        model &&\n        (model.hasDerivedPropertiesForBasicReferences() ||\n          model?.hasDerivedReferences() ||\n          model?.hasGroupedReferences() ||\n          model?.hasExpressionProperties())\n      ) {\n        model.addDerivedReferencesGroupedReferencesDerivedPropertiesAndExpressionProperties(dataContainer);\n      }\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_3:end`,\n        context,\n      });\n      this.cdRef.analyticsController.measure({\n        name: `dcupl:process_data:step_3`,\n        start: `dcupl:process_data:step_3:start`,\n        end: `dcupl:process_data:step_3:end`,\n        context,\n        detail: {\n          model: dataContainer.model,\n        },\n      });\n\n      // Yield logic (same as step 1)\n      if (!syncMode) {\n        yield;\n      } else if (batchSize! > 0 && i > 0 && i % batchSize! === 0) {\n        yield;\n      }\n    }\n\n    /**\n     * Step 4: Re-run derived properties based on resolved references\n     * In theory... if there is a derivedProperty based on a resolved reference we have to reprocess all Properties of this model.\n     */\n    for (let i = 0; i < containers.length; i++) {\n      const dataContainer = containers[i]!;\n      const model = this.models.get(dataContainer.model);\n\n      if (!model) {\n        this.log.error('Model not found during data processing', undefined, { model: dataContainer.model, step: 4 });\n        continue;\n      }\n\n      const context = generateKey();\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_4:start`,\n        context,\n      });\n\n      if (\n        model.hasDerivedPropertiesBasedOnResolvedReferences() ||\n        model.hasDerivedReferencesBasedOnResolvedReferences()\n      ) {\n        model.reRunDerivedPropertiesBasedOnResolves(dataContainer);\n      }\n\n      this.cdRef.analyticsController.mark({\n        name: `dcupl:process_data:step_4:end`,\n        context,\n      });\n      this.cdRef.analyticsController.measure({\n        name: `dcupl:process_data:step_4`,\n        start: `dcupl:process_data:step_4:start`,\n        end: `dcupl:process_data:step_4:end`,\n        context,\n        detail: {\n          model: dataContainer.model,\n        },\n      });\n\n      // Quality validation\n      if (this.qualityController.enabled && model.qualityConfig.enabled === true) {\n        const errors = this.qualityController.validateAttributesAfterInitialization(model);\n        errors.forEach((error) => {\n          this.setError(error, model);\n        });\n      }\n\n      // Yield logic (same as step 1)\n      if (!syncMode) {\n        yield;\n      } else if (batchSize! > 0 && i > 0 && i % batchSize! === 0) {\n        yield;\n      }\n    }\n  }\n\n  /**\n   * Called before a read of `modelKey`'s rows from outside the parser: the error-tracking models\n   * are built on first read (#444).\n   */\n  public prepareModelForRead(modelKey: string | undefined): void {\n    // no modelKey (the app runner passes `config.data` to `fn.*` unvalidated): the read fails the\n    // way it did before, \"Model with key undefined not found\"\n    if (modelKey?.startsWith(ERROR_TRACKING_MODEL_PREFIX)) {\n      this.qualityController.materializeErrorTrackingModels();\n    }\n  }\n\n  public _getModelKeys(): string[] {\n    return Array.from(this.models.values())\n      .map((model) => model.key)\n      .filter((key) => key && !key.startsWith('$Dcupl'));\n  }\n\n  public _getViewKeys(options?: { modelKey: string }): string[] {\n    const modelKey = options?.modelKey;\n\n    return Array.from(this.views.values())\n      .filter((view) => {\n        if (modelKey) {\n          return view.model === modelKey;\n        }\n        return true;\n      })\n      .map((view) => view.key);\n  }\n\n  /**\n   * Gets the total number of items across all models\n   * @returns Total count of items\n   */\n  public getTotalItemCount(): number {\n    let total = 0;\n    for (const model of this.models.values()) {\n      total += model.getItemCount();\n    }\n    return total;\n  }\n}\n"],"names":["reWhitespace","trimmedEndIndex","string","index","reTrimStart","baseTrim","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","isSymbol","isObject","other","isBinary","INFINITY","MAX_INTEGER","toFinite","sign","toInteger","result","remainder","objectCreate","baseCreate","object","proto","copyArray","source","array","length","arrayEach","iteratee","baseAssignValue","key","defineProperty","objectProto","hasOwnProperty","assignValue","objValue","eq","copyObject","props","customizer","isNew","newValue","isIterateeCall","type","isArrayLike","isIndex","createAssigner","assigner","baseRest","sources","guard","nativeKeysIn","baseKeysIn","isProto","isPrototype","keysIn","arrayLikeKeys","getPrototype","overArg","objectTag","funcProto","funcToString","objectCtorString","isPlainObject","isObjectLike","baseGetTag","Ctor","baseClamp","number","lower","upper","freeExports","freeModule","moduleExports","Buffer","root","allocUnsafe","cloneBuffer","buffer","isDeep","initCloneArray","cloneArrayBuffer","arrayBuffer","Uint8Array","cloneDataView","dataView","reFlags","cloneRegExp","regexp","symbolProto","Symbol","symbolValueOf","cloneSymbol","symbol","cloneTypedArray","typedArray","boolTag","dateTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","initCloneByTag","tag","initCloneObject","baseIsMap","getTag","nodeIsMap","nodeUtil","isMap","baseUnary","baseIsSet","nodeIsSet","isSet","CLONE_DEEP_FLAG","argsTag","arrayTag","errorTag","funcTag","genTag","weakMapTag","cloneableTags","baseClone","bitmask","stack","isArr","isArray","isFunc","isBuffer","Stack","stacked","subValue","keysFunc","getAllKeys","CLONE_SYMBOLS_FLAG","cloneDeep","arrayAggregator","setter","accumulator","baseAggregator","collection","baseEach","createAggregator","initializer","func","baseIteratee","assignMergeValue","safeGet","toPlainObject","baseMergeDeep","srcIndex","mergeFunc","srcValue","isCommon","isBuff","isTyped","isTypedArray","isArrayLikeObject","isArguments","isFunction","baseMerge","baseFor","endsWith","target","position","toString","baseToString","end","groupBy","isString","baseValues","arrayMap","values","keys","nativeMax","includes","fromIndex","baseIndexOf","isBoolean","merge","getModelError","title","attribute","description","isValidProperty","property","validDatatypes","isValidReference","reference","validReferenceTypes","validateBasicModelStructure","model","kp","isValidString","isValidArray","p","v","validateModels","allModels","errors","ref","validateDerivedReference","validateResolvedReference","validateGroupedReference","prop","validateDerivedProperty","validateExpressionProperty","localRef","remoteModel","parseTemplate","templateVar","DEFAULT_KEY_PROPERTY_SEPARATOR","getKeyParts","keyProperty","extractKey","item","separator","extractRowKey","isMissing","part","hasRowKey","row","joinKeyProperty","flattenString","text","EntryMetadataValues","defaultAttributeQualityConfig","defaultQualityConfig","DcuplModel","modelParser","resolveCacheMaxSize","logger","IndicesController","modelDefinition","seenPropertyKeys","error","typeQualityConfig","qualityConfig","container","opt","properties","getPropertiesForData","effectiveKeyProperty","referenceValue","cacheKey","build","sourceColumns","references","origin","declared","r","column","rawDataEntry","dataEntry","rawValue","declaredType","arrayValue","val","stringValue","intValue","floatValue","dateValue","isValid","validationErrors","validationError","err","coercedValue","isInt","numericFull","relevantValue","isFloat","fractionDigits","parseBooleanString","inputFormat","date","parseDate","isValidDate","referenceKey","remoteDataEntry","remoteValue","referenceKeys","validReferenceKeys","remoteKey","replacedRowKeys","effectiveSeparator","keyAttribute","duplicateKey","rows","sourceMetadata","valueMapping","map","emptyValue","stringKey","queryReferences","qR","strigifiedQuery","resolvedQuery","evaluateTemplate","parsedQuery","qb","DcuplQueryBuilder","finalQuery","entry","invalidFromValues","invalidToValues","rawEntry","valueMappingConfig","mappingValue","generateKey","yieldToEventLoop","resolvedReferencesHelper","remoteData","inverseKeys","localDataEntryKey","localReferenceKey","vSet","specificReferences","firstKey","derivedProperties","expressionProperties","derivedReferences","groupedReferences","context","localReferenceValue","remoteEntry","entryValue","entries","remoteValues","localReferenceToDeriveFrom","remoteModelToDeriveFrom","localKeyToDeriveFrom","previousValue","resultSet","dataEntryToDeriveFrom","valueToDerive","valueToAssign","input","i","reverseIndex","referenceToGroupOn","valueToGroupOn","matchingItemKeys","itemsWithValue","itemKey","attributeKeys","indexKey","data","itemSet","basicReferences","resolvedReferences","options","filteredData","attributesToProcess","pendingItemKeys","oldReferenceValue","refKey","refValue","ERROR_TRACKING_MODEL_PREFIX","ERROR_TRACKING_ROW_MODELS","ATTRIBUTE_ERROR_TYPES","DATA_ERROR_GROUPS","UNIQUE_ERROR_TITLE","QualityController","scriptsController","errorType","groupKey","group","modelKey","isRejection","count","storedPerGroup","summary","storedCount","byGroup","s","reprocessedGroups","e","dataContainer","attributes","isRelevant","coercionSamples","sample","undefinedCount","undefinedAttributes","propertyCoercionErrors","groupedByAttribute","firstMeta","rowCount","itemKeys","attributesOrErrorType","actualErrorType","modelErrors","relevantErrors","dataMap","modelAttributes","validators","attributeErrors","deletedItemKeys","allRowsAttributes","uniqueAttributes","rowsChanged","superseded","d","containers","list","models","unusedAttributesForModel","attr","modelRows","loadingValue","processValue","sizes","acc","a","b","totalByType","size","onlyDataResources","groupedByModel","encodedBodySize","decodedBodySize","unusedDataLength","relevantData","unusedData","newItem","dcupl","unusedAttributes","uniqueErrors","uniqueValues","isStrict","config","ChangeTracker","attributeKey","attributeSet","deletedSet","rowsByModel","keysOf","itemsByModel","items","totalModelCount","totalItemCount","totalChangedItems","totalDeletedItems","totalChangedAttributes","attrs","PartialUpdateMetrics","metric","partialUpdates","m","fullUpdates","avgPartialTime","sum","avgFullTime","avgAttributesProcessed","avgModelsAffected","totalTimeSaved","startTime","endTime","isQueryReference","isResolvedReference","isDerivedReference","isGroupedReference","ModelParser","cdRef","qualityController","dcuplInstance","what","DcuplSealedError","consumedData","modelDescription","dropped","registered","viewKey","DependencyGraph","validation","cyclePath","AttributeDependencyGraph","propertyKey","node","localReference","expectedAttributes","_","missingCount","missingList","message","expression","expressionNode","variables","variable","segments","currentModel","segment","path","derive","derivedNode","localRefNode","remotePropertyNode","query","queryRefNode","queryString","varName","depNode","resolve","resolvedNode","remoteRefNode","derivedRefNode","groupedRefNode","sourceRefNode","shouldUsePartial","modelsAffected","attributesChanged","itemsChanged","duration","modelRatioThreshold","itemRatioThreshold","enableLogging","affectedQueryReference","affectedModelRatio","totalItems","modelItemCount","itemRatio","changedModels","reachableByTarget","queryReference","reachable","queue","allContainers","orderBy","rest","definition","existingModel","newModel","modelA","modelB","view","relevantContainer","mergedContainers","groupedContainers","containerGroup","mergedMetadata","rowKeys","rowKey","consumedContainers","consumed","pendingContainers","stillQueued","queuedModels","keptContainers","merged","dataset","keylessRows","setContainer","newContainer","storedRow","keySource","candidate","payloadRow","mergedRow","effective","meta","col","existing","samples","clone","orderedModelKeys","generatedAttributes","known","generated","changedRowsByModel","referencingItemKeys","insertedRows","changedAttributes","matchingNode","impactedAttributes","processingPlan","rowScopes","step","stepMap","impactedAttributeKeys","scope","extraItemKeys","changedItemKeys","extraKeys","changedRows","changedKeysByModel","addKey","keysByModel","stored","changedKeys","scopes","planAttributes","withoutAllRows","changedRowAttributes","keyedRows","dependencies","allModelsWithStep2","step2Attrs","attrKey","remoteModelKey","remoteRefKey","remoteRef","sorted","visiting","visited","visit","deps","dep","hasRowWork","attributesForStep","stepName","c","autoGenerateKey","steps","batchSize","syncMode","total","__decorateClass","trigger"],"mappings":"uDACA,IAAIA,GAAe,KAUnB,SAASC,GAAgBC,EAAQ,CAG/B,QAFIC,EAAQD,EAAO,OAEZC,KAAWH,GAAa,KAAKE,EAAO,OAAOC,CAAK,CAAC,GAAG,CAC3D,OAAOA,CACT,CCbA,IAAIC,GAAc,OASlB,SAASC,GAASH,EAAQ,CACxB,OAAOA,GACHA,EAAO,MAAM,EAAGD,GAAgBC,CAAM,EAAI,CAAC,EAAE,Q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