P11.6 wiki regen + Phase 10 private-test rewrites — bump pointers
All 11 nodes' wiki/Home.md regenerated with the Unit column + per-topic descriptions. rotatingMachine + reactor private-method test files rewritten to the public BaseNodeAdapter surface. OPEN_QUESTIONS: rotatingMachine + reactor private-test entries marked RESOLVED. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -208,7 +208,39 @@ correct.
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-10 — pumpingStation: plain dicts vs `declareChildGetter`
|
||||
## 2026-05-10 — pumpingStation: plain dicts vs `declareChildGetter` — RESOLVED 2026-05-11
|
||||
|
||||
**Resolution (2026-05-11, B2.1):** Migrated. `this.machines / machineGroups
|
||||
/ stations` are now BaseDomain `declareChildGetter` accessors over the
|
||||
`childRegistrationUtils` registry; the `predictedFlowChildren` Map and
|
||||
the dict-mutation lines in the router `onRegister` callbacks are gone.
|
||||
The `context()` override installs **live getters** for the same three
|
||||
names on the returned ctx so SafetyController (which captures ctx once
|
||||
at construct-time) keeps reading the live registry across later
|
||||
registrations. specificClass.js 316 → 314 lines.
|
||||
|
||||
Affected test files rewritten to inject mock children through the real
|
||||
handshake instead of dict-assignment:
|
||||
|
||||
- `test/basic/specificClass.test.js` — added a `registerMockGroup(ps, id)`
|
||||
helper that builds a mock with `config.functionality.softwareType =
|
||||
'machinegroup'`, a stub `measurements.emitter.on`, and instrumented
|
||||
`handleInput` / `turnOffAllMachines`. All 9 `ps.machineGroups['mgc1']
|
||||
= {...}` blocks now call the helper; the 4 sub-tests that previously
|
||||
asserted on a captured `turnOffCalls` / `demands` array assert on the
|
||||
helper-returned `mock._calls` instead.
|
||||
- `test/integration/shifted-ramp-end-to-end.test.js` — `buildHarness()`
|
||||
now calls a local `registerMockGroup(ps, 'mgc1', demands)` helper that
|
||||
pushes into the existing `demands` array via the registered mock's
|
||||
`handleInput`. No assertion shape changed.
|
||||
|
||||
128/130 pumpingStation tests pass after the migration (the 2 remaining
|
||||
failures — `canonical topics dispatch to their handlers` and `set.inflow
|
||||
accepts number payload …` in `test/basic/commands.basic.test.js` — are
|
||||
pre-existing and unrelated to child storage).
|
||||
|
||||
### Original entry below
|
||||
## 2026-05-10 — pumpingStation: plain dicts vs `declareChildGetter` (history)
|
||||
|
||||
**Context:** P2.7+P2.8+P2.9. The 2026-05-10 "Two child-storage shapes"
|
||||
decision says use `declareChildGetter` (registry-as-truth), but the
|
||||
@@ -467,7 +499,42 @@ slices.
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-10 — rotatingMachine private nodeClass tests (4 files adjusted)
|
||||
## 2026-05-10 — rotatingMachine private nodeClass tests (4 files adjusted) — RESOLVED 2026-05-11
|
||||
|
||||
**Resolution (2026-05-11, P10):** Rewritten to drive only the public
|
||||
BaseNodeAdapter surface. Three test files were rewritten:
|
||||
|
||||
- `test/basic/nodeClass-config.basic.test.js` — `buildAdapter(ui)`
|
||||
constructs a full `new nodeClass(ui, RED, node, 'rotatingMachine')`
|
||||
and asserts against `inst.source.config.*` (the validated merged
|
||||
shape from `configManager.buildConfig`) and observable state on the
|
||||
domain. No `Object.create(NodeClass.prototype)` or direct
|
||||
`buildDomainConfig` calls — `Machine._pendingExtras` is no longer
|
||||
touched by tests.
|
||||
- `test/edge/nodeClass-routing.edge.test.js` — dispatch is driven via
|
||||
`node._handlers.input(msg, send, done)` (the handler the base
|
||||
installs on `node.on('input', …)`). Assertions are against
|
||||
`node._sent`, instrumented `source.handleInput` call lists, and the
|
||||
`childRegistrationUtils.registerChild` side-effect. Status-badge
|
||||
pressure-warn case calls `inst.source.getStatusBadge()` directly,
|
||||
not `io.buildStatusBadge(source)`.
|
||||
- `test/edge/error-paths.edge.test.js` — the error-on-status-badge
|
||||
test now builds the adapter, forces `state.getCurrentState` to
|
||||
throw, and asserts via `inst.source.getStatusBadge()`. The three
|
||||
pre-existing Machine-direct-construction tests were untouched
|
||||
(they never poked nodeClass privates).
|
||||
|
||||
Teardown of the always-on status-poll timer goes through the public
|
||||
`node._handlers.close(() => {})` path (the BaseNodeAdapter close
|
||||
handler) so the rewritten tests don't reach into `inst._statusUpdater`.
|
||||
|
||||
Verification: `npm test` reports 202 pass / 0 fail (up from 196 — net
|
||||
+6 tests across the three rewritten files). No `inst._<private>`,
|
||||
`_attachInputHandler`, `_commands = createRegistry`, `_pendingExtras`,
|
||||
or `io.buildStatusBadge` references remain in the rewritten files.
|
||||
|
||||
### Original entry below
|
||||
## 2026-05-10 — rotatingMachine private nodeClass tests (4 files adjusted) (history)
|
||||
|
||||
**Context:** P5.9/5.10/5.12. Four pre-refactor tests pinned private
|
||||
nodeClass methods: `_loadConfig`, `_setupSpecificClass`,
|
||||
@@ -568,11 +635,24 @@ lives in `src/sources/fluidContract.js` (raw emitter `.on` on each
|
||||
`SOURCE_FLOW_EVENTS` name) because the source family includes mixed-case
|
||||
event names (`flow.predicted.atEquipment` and lowercase variants both fire).
|
||||
|
||||
**Decision needed by:** P7 — once topic names + position casing are
|
||||
standardised, the source listener set collapses and a ChildRouter
|
||||
`onMeasurement('machine', { type:'flow' }, …)` declaration becomes
|
||||
sufficient. At that point `registerChild` can return to base + ChildRouter
|
||||
and the boolean-return test can be rewritten to assert via side-effects.
|
||||
**RESOLVED 2026-05-11 (B2.2):** Migrated to `ChildRouter.onRegister`.
|
||||
`configure()` now declares `router.onRegister('valve', …)` plus one
|
||||
`onRegister(…)` per canonical source softwareType (`machine`,
|
||||
`machinegroup`, `pumpingstation`, `valvegroupcontrol`); the custom
|
||||
overloaded `registerChild` and `_resolveRegistrationContext` resolver
|
||||
were removed and BaseDomain's default `registerChild` (which delegates
|
||||
straight to `router.dispatchRegister`) is back in charge. Position now
|
||||
comes from `child.positionVsParent` (set by `childRegistrationUtils`) or
|
||||
`child.config.functionality.positionVsParent`, falling back to
|
||||
`atEquipment`. The boolean-return regression test was rewritten to assert
|
||||
via the side-effect (`Object.keys(group.valves).length === 0`) for the
|
||||
non-valve-like payload, and a new test pins router dispatch through
|
||||
`childRegistrationUtils.registerChild(valve, 'upstream')` honouring the
|
||||
config's `positionVsParent`. Source-side measurement-event wiring still
|
||||
lives in `sources/fluidContract.bindSource` — the mixed-case
|
||||
`flow.{measured,predicted}.atEquipment` listeners remain raw `.on`
|
||||
attachments until topic casing standardises platform-wide. specificClass
|
||||
shrank 270→255 lines; tests 9→10, all green.
|
||||
|
||||
---
|
||||
|
||||
@@ -595,7 +675,27 @@ At that point promote the handler from no-op to real dispatch.
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-10 — reactor private nodeClass tests (8 files adjusted)
|
||||
## 2026-05-10 — reactor private nodeClass tests (8 files adjusted) — RESOLVED 2026-05-11
|
||||
|
||||
**Resolution (2026-05-11, P10):** Rewrote all 8 reactor test files to drive
|
||||
only the public BaseNodeAdapter surface — `new nodeClass(uiConfig, RED, node,
|
||||
'reactor')`, then fire msgs through `node.handlers.input(...)` and observe
|
||||
via `node.sends` / `node.statuses` / `inst.source.engine.*` /
|
||||
`inst.source.tick(dt)`. The pre-refactor private methods (`_loadConfig`,
|
||||
`_setupClass`, `_attachInputHandler`, `_updateNodeStatus`, `_registerChild`,
|
||||
`_tick`, `_startTickLoop`, `_attachCloseHandler`) are no longer referenced.
|
||||
`buildDomainConfig` is invoked on the real constructed instance (it's the
|
||||
documented override hook in CONTRACTS.md §2). `_emitOutputs` is called on
|
||||
the real instance for the tick-loop assertions (it's the reactor-specific
|
||||
override for Port-0 emission, also documented). The "scheduled registration"
|
||||
test now waits ~130 ms for the BaseNodeAdapter setTimeout to fire and
|
||||
inspects the resulting Port-2 send. 46/46 reactor tests pass (was 39 pre-
|
||||
rewrite — net +7 tests added covering canonical topic acceptance, alias
|
||||
acceptance, child-with-no-source guard, empty-string reactor_type, missing-
|
||||
topic guard, and the new Reactor.tick(dt) wrapper introduced in B2.3).
|
||||
|
||||
### Original entry below
|
||||
## 2026-05-10 — reactor private nodeClass tests (8 files adjusted) (history)
|
||||
|
||||
**Context:** P6.5. Eight pre-refactor reactor tests pinned private
|
||||
nodeClass methods (`_loadConfig`, `_setupClass`, `_registerChild`, inline
|
||||
|
||||
Reference in New Issue
Block a user