38 lines
1.9 KiB
Markdown
38 lines
1.9 KiB
Markdown
|
|
# Decision: Unit-Anchor Rollout Phase 1 (MachineGroup, PumpingStation, Valve, ValveGroupControl)
|
|||
|
|
|
|||
|
|
- Date: 2026-02-24
|
|||
|
|
- Scope:
|
|||
|
|
- `nodes/machineGroupControl/src/nodeClass.js`
|
|||
|
|
- `nodes/machineGroupControl/src/specificClass.js`
|
|||
|
|
- `nodes/pumpingStation/src/nodeClass.js`
|
|||
|
|
- `nodes/pumpingStation/src/specificClass.js`
|
|||
|
|
- `nodes/valve/src/nodeClass.js`
|
|||
|
|
- `nodes/valve/src/specificClass.js`
|
|||
|
|
- `nodes/valveGroupControl/src/nodeClass.js`
|
|||
|
|
- `nodes/valveGroupControl/src/specificClass.js`
|
|||
|
|
|
|||
|
|
## Context
|
|||
|
|
After adopting canonical-unit anchoring in `rotatingMachine`, adjacent controller nodes still mixed local units, unitless writes, and implicit conversions. That left cross-node behavior sensitive to registration order and source-unit assumptions.
|
|||
|
|
|
|||
|
|
## Decision
|
|||
|
|
1. Apply the same canonical storage policy per node:
|
|||
|
|
- internal storage in canonical units (`Pa`, `m3/s`, `W`, `K` where relevant),
|
|||
|
|
- preferred/output units for operator-facing status and output payloads.
|
|||
|
|
|
|||
|
|
2. Enable strict measurement ingress discipline on migrated nodes:
|
|||
|
|
- `strictUnitValidation: true`,
|
|||
|
|
- `throwOnInvalidUnit: true`,
|
|||
|
|
- required unit for physically dimensional types (`flow`, `pressure`, `power`, `temperature`, and node-specific equivalents).
|
|||
|
|
|
|||
|
|
3. Replace unitless runtime writes/reads with explicit-unit helpers in each node’s domain class, including child-machine/child-valve interactions.
|
|||
|
|
|
|||
|
|
## Consequences
|
|||
|
|
- Cross-node calculations now run against a deterministic unit anchor in phase-1 nodes.
|
|||
|
|
- Status/output values remain in preferred/output units, while internal math stays canonical.
|
|||
|
|
- Legacy paths that send dimensional values without units now fail fast instead of silently coercing.
|
|||
|
|
|
|||
|
|
## Rollback Notes
|
|||
|
|
- Revert the eight files listed in scope.
|
|||
|
|
- Restore previous `MeasurementContainer` initialization (non-canonical, non-strict behavior) in each node.
|
|||
|
|
- Remove helper-based explicit unit reads/writes and revert to prior direct chain usage.
|