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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user