- package.json test script now covers test/ recursively + nrmse/errorMetric.
- Removed 5 broken test files that used Mocha-style describe()/it() globals
with no test runner installed. All 5 have working kebab-case node:test
equivalents (e.g. childRegistration.test.js → child-registration-utils.test.js).
- 4 remaining pre-existing assertion failures in output-utils + validation-utils
logged in OPEN_QUESTIONS.md for Phase 10.5.
166/170 tests pass (4 known pre-existing failures).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tests 1, 4, 5 constructed an Adapter with the default
statusInterval=1000 and no mock for setInterval, leaking a real
status timer that held the event loop open past the assertions.
Single-file runs masked it; node --test test/basic/ blocked the
whole runner.
Fix: set static statusInterval = 0 + invoke node.handlers.close()
(or mock setInterval where the test asserts on registration timing).
113/113 basic tests pass in batch in ~400 ms.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- src/nodered/BaseNodeAdapter.js — base class for every nodeClass.js
Lifecycle: config build → domain instantiate → child.register on
Port 2 → tick (opt-in) or 'output-changed' subscription (default
event-driven) → status updater → input dispatch via commandRegistry →
close handler with clean teardown.
- index.js — additive exports of all Phase 1 modules:
UnitPolicy, ChildRouter, LatestWinsGate, HealthStatus, BaseDomain,
statusBadge, StatusUpdater, createRegistry, CommandRegistry,
BaseNodeAdapter, stats. Existing exports unchanged.
113 unit tests pass under node:test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- src/domain/BaseDomain.js — base class for every specificClass; wires emitter/config/logger/measurements/childRouter
- src/nodered/commandRegistry.js — declarative msg.topic dispatch with alias deprecation
- src/nodered/statusUpdater.js — 1Hz status badge poller with error-resilient loop
Additive. 43 new tests; all 99 basic tests still green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds platform infrastructure used by the upcoming refactor of
nodeClass / specificClass across all 12 nodes:
- src/domain/UnitPolicy.js — extracted from rotatingMachine/MGC
- src/domain/ChildRouter.js — declarative event routing on top of childRegistrationUtils
- src/domain/LatestWinsGate.js — extracted from MGC dispatch gate
- src/domain/HealthStatus.js — standardised {level, flags, message, source}
- src/nodered/statusBadge.js — compose / error / idle / byState / text helpers
- src/stats/index.js — mean / stdDev / median / mad / lerp
All additive — no existing exports change shape.
56 unit tests pass under node:test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Replace hardcoded position strings with POSITIONS.* constants
- Prefix unused variables with _ to resolve no-unused-vars warnings
- Fix no-prototype-builtins with Object.prototype.hasOwnProperty.call()
- Extract menuUtils.js (543 lines) into 6 focused modules under menu/
- menuUtils.js now 35 lines, delegates via prototype mixin pattern
- Add 158 unit tests for ConfigManager, MeasurementContainer, ValidationUtils
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>