feat(commands): unify command envelope across all nodes — msg.origin + unit shorthand

Platform-wide command-message contract:
- Document the envelope in .claude/refactor/CONTRACTS.md §4: unit shorthand +
  derived measure, always-convert (incl. numeric strings), msg.origin
  provenance (parent|GUI|fysical, default parent) + gated mode arbitration.
- wiki-gen: normalise descriptors through createRegistry().list() so the Unit
  column resolves both the unit: shorthand and legacy units:{} shapes.
- Bump submodule pointers: generalFunctions (registry), rotatingMachine, valve,
  valveGroupControl, machineGroupControl (msg.origin), diffuser, pumpingStation,
  monster (unit shorthand + handler dedup), dashboardAPI (wiki sync).
- Log decision in OPEN_QUESTIONS.md (2026-05-29).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
znetsixe
2026-05-29 18:41:56 +02:00
parent b76202190d
commit efbc0d7273
12 changed files with 95 additions and 34 deletions

View File

@@ -17,7 +17,16 @@ function loadRegistry(nodeDir) {
if (!Array.isArray(descriptors)) {
throw new Error('commands/index.js must export an array of descriptors');
}
return descriptors;
// Normalise through the registry so both the legacy `units: {measure, default}`
// and the `unit: 'm3/h'` shorthand resolve to the same `{measure, default}`
// shape (measure derived from the unit). Falls back to the raw descriptors if
// the registry can't be loaded so the tool never hard-fails on an edge case.
try {
const { createRegistry } = require('../../../nodes/generalFunctions');
return createRegistry(descriptors).list();
} catch (_) {
return descriptors;
}
}
function renderTopicTable(descriptors) {