Establish CONTRACTS.md at the EVOLV root as the canonical map of where every contract, rule, and standard lives. Surface it from CLAUDE.md so every fresh agent or colleague lands there first. Reshape .claude/refactor/ to reflect that the platform refactor is done: live standards stay at the top level; the plan artifacts (CONTINUE_HERE.md, TASKS.md) move into Archive/ with WARNING banners. Drop content that drifted out of date or duplicated the new standards stack: - docs/DEVELOPER_GUIDE.md (pre-refactor walkthrough; superseded by wiki/Architecture, wiki/Getting-Started, .claude/rules/node-architecture, .claude/refactor/MODULE_SPLIT + per-node CONTRACT.md + src/commands/). - .agents/decisions/ (15 DECISION files): load-bearing decisions belong in commit messages and PR descriptions; live open items in OPEN_QUESTIONS.md. - .agents/improvements/TOP10_*.md: moved to Archive/. Bump generalFunctions to 49c77f2 — adds CONTRACT.md inside the library: different shape from per-node CONTRACT.md files (library API, not msg.topic), with stability tags and pointers to .claude/refactor/CONTRACTS.md §N. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.6 KiB
4.6 KiB
Top 10 Production Priorities (Availability-First)
Context:
- Scope reviewed: all nodes under
nodes/*plus sharednodes/generalFunctions/*. - Target posture: keep runtime alive; emit
null/degraded outputs instead of crashing.
Priority List
- Remove import-time executable code from machine group runtime module.
- Why:
makeMachines()runs at module load and can execute demo logic in production runtime. - Evidence:
nodes/machineGroupControl/src/specificClass.js:1294,nodes/machineGroupControl/src/specificClass.js:1399. - Availability target: no side effects on
require; test/demo code must be isolated from runtime path.
- Guard
registerChildin node wrappers to prevent null dereference crashes.
- Why: multiple wrappers dereference
childObj.sourcewithout checking child existence. - Evidence:
nodes/reactor/src/nodeClass.js:54,nodes/settler/src/nodeClass.js:39,nodes/valve/src/nodeClass.js:256,nodes/valveGroupControl/src/nodeClass.js:178,nodes/machineGroupControl/src/nodeClass.js:215. - Availability target: if child missing, log warning and continue.
- Harden shared child registration utility contract checks.
- Why: shared helper destructures
child.config.*without validation. - Evidence:
nodes/generalFunctions/src/helper/childRegistrationUtils.js:9,nodes/generalFunctions/src/helper/childRegistrationUtils.js:10. - Availability target: reject invalid child payload with warning, no throw.
- Add global input-handler error boundary pattern across nodes.
- Why: many handlers do work without
try/catch; one thrown error can bubble and destabilize node behavior. - Evidence:
nodes/measurement/src/nodeClass.js:156,nodes/valve/src/nodeClass.js:250,nodes/valveGroupControl/src/nodeClass.js:169,nodes/settler/src/nodeClass.js:32. - Availability target: wrap topic routing; map failures to warning + safe
done(err)/done()handling.
- Normalize
donecallback handling for Node-RED compatibility.
- Why: several nodes call
done()unguarded; older/inconsistent runtime callbacks can fail. - Evidence:
nodes/measurement/src/nodeClass.js:167,nodes/valve/src/nodeClass.js:280,nodes/valveGroupControl/src/nodeClass.js:201,nodes/machineGroupControl/src/nodeClass.js:257. - Availability target:
if (typeof done === 'function') done();everywhere.
- Fix reactor runtime routing and setup defects.
- Why:
Temperaturetopic routes to missing setter path and default reactor warning references wrong variable. - Evidence:
nodes/reactor/src/nodeClass.js:46,nodes/reactor/src/nodeClass.js:140. - Availability target: unknown/unsupported control topics fail soft with warning; setup path cannot throw from bad references.
- Fix valve mode-selection bug using undefined config source.
- Why:
setModereferencesdefaultConfiginstead of instance config; can throw or silently break mode changes. - Evidence:
nodes/valve/src/specificClass.js:142. - Availability target: invalid mode inputs are rejected safely, valid mode changes deterministic.
- Replace hard-throw chain semantics in measurement container with safe-return options.
- Why: chain API currently throws for sequence misuse; upstream callers can crash control loops.
- Evidence:
nodes/generalFunctions/src/measurements/MeasurementContainer.js:99,nodes/generalFunctions/src/measurements/MeasurementContainer.js:109. - Availability target: invalid chain usage logs and returns no-op/null path in production mode.
- Remove noisy console/debug/test logging from runtime paths.
- Why: heavy
console.log/errorin control and shared code adds noise and can hide real failures. - Evidence:
nodes/reactor/src/nodeClass.js:58,nodes/measurement/src/nodeClass.js:90,nodes/pumpingStation/src/nodeClass.js:87,nodes/valve/src/specificClass.js:207. - Availability target: use structured logger with levels; disable debug by default.
- Standardize output contract for unchanged state to explicit
nulloutput.
- Why:
formatMsgreturnsundefinedwhen no change; behavior differs by node send implementation. - Evidence:
nodes/generalFunctions/src/helper/outputUtils.js:37,nodes/generalFunctions/src/helper/outputUtils.js:62. - Availability target: unchanged outputs always return
nullto keep port contract deterministic.
Implementation Status
- Implemented on 2026-02-19 in current session.
- Verification: node test suites passed for modified runtime nodes (
measurement,reactor,valve,valveGroupControl,machineGroupControl,settler,pumpingStation,dashboardAPI,monster,rotatingMachine). - Remaining follow-up items are tracked in
.agents/improvements/IMPROVEMENTS_BACKLOG.md.