From 4b0080cc60c2f74c213c59e0489e8a811a33d7a7 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Fri, 29 May 2026 18:41:30 +0200 Subject: [PATCH] feat(commands): unit shorthand + declare units on physical setters; wiki sync - data.flow: units:{measure,default} -> unit:'m3/h'. - set.water-height -> unit:'m'; set.header-pressure -> unit:'mbar' (matches the domain setters' expected units; no-unit input passes through unchanged). - Regenerate wiki topic-contract (Unit column). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/commands/index.js | 4 +++- wiki/Reference-Contracts.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/index.js b/src/commands/index.js index f11d74a..73b1f59 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -12,7 +12,7 @@ module.exports = [ topic: 'data.flow', aliases: ['air_flow'], payloadSchema: { type: 'number' }, - units: { measure: 'volumeFlowRate', default: 'm3/h' }, + unit: 'm3/h', description: 'Push the measured air flow into the diffuser model.', handler: handlers.setFlow, }, @@ -27,6 +27,7 @@ module.exports = [ topic: 'set.water-height', aliases: ['height_water'], payloadSchema: { type: 'number' }, + unit: 'm', description: 'Update the water column height above the diffusers (m).', handler: handlers.setWaterHeight, }, @@ -34,6 +35,7 @@ module.exports = [ topic: 'set.header-pressure', aliases: ['header_pressure'], payloadSchema: { type: 'number' }, + unit: 'mbar', description: 'Update the header (supply) pressure feeding the diffusers (mbar).', handler: handlers.setHeaderPressure, }, diff --git a/wiki/Reference-Contracts.md b/wiki/Reference-Contracts.md index 5bb66a0..b1315d1 100644 --- a/wiki/Reference-Contracts.md +++ b/wiki/Reference-Contracts.md @@ -19,8 +19,8 @@ The registry lives in `src/commands/index.js`. Each descriptor maps a canonical |---|---|---|---|---| | `data.flow` | `air_flow` | `number` | `volumeFlowRate` (default `m3/h`) | Push the measured air flow into the diffuser model. | | `set.density` | `density` | `number` | — | Update the air density used in OTR / SOTR calculations. | -| `set.water-height` | `height_water` | `number` | — | Update the water column height above the diffusers (m). | -| `set.header-pressure` | `header_pressure` | `number` | — | Update the header (supply) pressure feeding the diffusers (mbar). | +| `set.water-height` | `height_water` | `number` | `length` (default `m`) | Update the water column height above the diffusers (m). | +| `set.header-pressure` | `header_pressure` | `number` | `pressure` (default `mbar`) | Update the header (supply) pressure feeding the diffusers (mbar). | | `set.elements` | `elements` | `number` | — | Update the count of active diffuser elements. | | `set.alfa-factor` | `alfaFactor` | `number` | — | Update the alfa factor used in oxygen-transfer correction. |