84a4430266c05d7a3cf1c8ece8739c6bd70814d6
buildConfig() was doing Object.assign(config, domainConfig) — a shallow
merge. When buildDomainConfig returned subsets like {general: {unit}} or
{asset: {curveUnits}}, the assign replaced config.general / config.asset
wholesale, wiping general.id (nodeId), general.name, asset.model, and
asset.supplier that buildConfig had just populated.
Downstream consequences:
- MGC.onRegister('machine') keys by config.general.id; two children with
the same null id collide and the second registration is rejected.
- rotatingMachine curve-lookup uses asset.model; with model "Unknown" the
pump curve fails to resolve.
Replace Object.assign with an in-place recursive _deepMerge: arrays and
primitives in src replace dst, plain objects merge key-by-key so siblings
on dst survive.
Two regression tests added — single-config field survival and the MGC
multi-child id-collision case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
convert
Makes unit conversions
#need to make an index to fetch the helper functions properly without destroying all the links.
Description
Languages
JavaScript
100%