Files
EVOLV/.agents/improvements/Archive/TOP10_PRODUCTION_PRIORITIES_2026-02-19.md
Rene De Ren 253ac93896 docs: standards cleanup — single front-door CONTRACTS.md + archive stale plan artifacts
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>
2026-05-18 15:48:46 +02:00

4.6 KiB

Top 10 Production Priorities (Availability-First)

Context:

  • Scope reviewed: all nodes under nodes/* plus shared nodes/generalFunctions/*.
  • Target posture: keep runtime alive; emit null/degraded outputs instead of crashing.

Priority List

  1. 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.
  1. Guard registerChild in node wrappers to prevent null dereference crashes.
  • Why: multiple wrappers dereference childObj.source without 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.
  1. 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.
  1. 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.
  1. Normalize done callback 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.
  1. Fix reactor runtime routing and setup defects.
  • Why: Temperature topic 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.
  1. Fix valve mode-selection bug using undefined config source.
  • Why: setMode references defaultConfig instead 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.
  1. 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.
  1. Remove noisy console/debug/test logging from runtime paths.
  • Why: heavy console.log/error in 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.
  1. Standardize output contract for unchanged state to explicit null output.
  • Why: formatMsg returns undefined when 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 null to 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.