Commit Graph

143 Commits

Author SHA1 Message Date
znetsixe
75d0413994 docs(CONTRACT): approve reactor's ASM-textbook unit divergence
reactor uses mg/L for concentrations, m³/d internally, °C, and 1/h
for KLa — diverging from EVOLV's canonical Pa/m³/s/W/K. This was a
real drift surfaced by the wiki audit; consensus is to keep it
because the ASM kinetics literature universally uses these units and
fighting that convention would obscure the math without improving
correctness. Now documented as an explicit, approved exception with
the conversion boundary spelled out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:35:36 +02:00
znetsixe
346a3ce2ab fix(reactor): X_A_init default 0.001 → 200; add timeStep-unit regression test
Two fixes for the reactor unit-confusion drift surfaced in the 2026-05-19
wiki uplift:

1. X_A_init default in reactor.html was 0.001 g COD/m³, which is
   effectively zero nitrifying biomass — the reactor cannot nitrify
   ammonia under that initial condition (per the project memory note,
   ~50 mg/L is the minimum). Aligned to the schema default of 200 in
   generalFunctions/src/configs/reactor.json. Same change in
   test/helpers/factories.js so the test factory mirrors the operational
   default; tests that need low-biomass scenarios already override.

2. New test/basic/timestep-units.basic.test.js locks in the
   `config.timeStep is interpreted as seconds` contract — verifies the
   engine's days-stored / seconds-input invariant and asserts the
   schema declares `unit: "s"`, `default: 1`. Companion to the schema
   fix in the generalFunctions submodule.

Full test suite: 49/49 pass (was 46/46 + 3 new).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:01:10 +02:00
znetsixe
6b8ae5cfc3 docs(wiki): regenerate topic-contract AUTOGEN block via wiki-gen
Replaces the agent-written placeholder inside Reference-Contracts.md with
the authoritative table generated from src/commands/index.js. Both the
BEGIN and END markers are normalized to the canonical form used by
`@evolv/wiki-gen`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 10:11:49 +02:00
znetsixe
cb49bb8b4d docs(wiki): full 5-page wiki matching the rotatingMachine reference format
Replaces the prior stub/partial wiki with a Home + Reference-{Architecture,
Contracts,Examples,Limitations} + _Sidebar structure. Topic-contract and
data-model sections wrapped in AUTOGEN markers for the future wiki-gen tool.
Source-vs-spec contradictions surfaced and flagged inline (not silently
fixed). Pending-review notes mark sections that need a full node review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 09:42:11 +02:00
znetsixe
0e34403c5d docs: add Folder & File Layout section per EVOLV convention
Each repo can now be read standalone for the file-naming convention. Full rule:
.claude/rules/node-architecture.md in the EVOLV superproject.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:30:29 +02:00
znetsixe
d735f9485c docs(wiki): rewrite Home.md to full 14-section visual-first template
- Banner updated to c84dd78 / 2026-05-11
- Section 2: add diffuser (data.otr path, not child-register), upstream
  reactor stateChange, settler downstream; switch to ~~~mermaid fences
- Section 4: accurate code-map — cstr/pfr extend baseEngine, not peer nodes
- Section 6: split measurement into temperature + oxygen(PFR) rows; clarify
  diffuser is NOT a registered child; switch to ~~~mermaid fences
- Section 7: expand sequence with n_iter formula, DO capping, GridProfile alt
- Section 9: correct timeStep unit note (schema h vs HTML label s), add all
  13 init fields, note X_A HTML default footgun, enum-casing note in cell
- Section 14: add row #6 (reactor_type enum lowercasing / toUpperCase guard)
  and row #7 (timeStep unit mismatch — label vs schema vs engine conversion)

AUTOGEN markers (topic-contract, data-model) untouched — regenerated clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 21:07:07 +02:00
znetsixe
c84dd781a3 P11.6 wiki regen + Phase 10 private-test rewrites where applicable
For all 11 nodes with auto-gen markers: wiki/Home.md sections 5 (topic
contract) and 9 (data model) regenerated via npm run wiki:all. New
Unit column shows '<measure> (default <unit>)' for declared topics,
'—' otherwise. Effect column now uses descriptor.description (P11.2
field) overriding the generic per-prefix fallback.

For rotatingMachine + reactor: Phase 10 test rewrites — 3 + 8 files
moved off private nodeClass internals (_attachInputHandler, _commands,
_pendingExtras, _registerChild, _tick, etc.) to the public
BaseNodeAdapter surface (node.handlers.input, node.source.*).
+6 / +7 net new tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 19:44:09 +02:00
znetsixe
1aa2d92083 P11.5 + B2.1/B2.2: per-command units + description (where applicable)
Adds  to scalar setters whose payloads are
plain numbers OR {value, unit}. Skipped where payload is compound or
mode-dependent (control-%, {F, C: [...]}, etc.) — documented inline.
Every command gains a description field for wikiGen consumption.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:41:15 +02:00
znetsixe
297c6713de fix: expose tick(dt) on Reactor wrapper
P6.5 refactor introduced the BaseDomain wrapper around CSTR/PFR engines
but didn't pass tick() through. BaseNodeAdapter's optional-chain
source.tick?.() got undefined and the kinetics engine never integrated
when driven through the new adapter (only via the explicit
_emitOutputs override that calls updateState).

Added tick(timeStep) that delegates to engine.tick + emits
'output-changed'. Tests that construct the wrapper (not the engine
directly) now work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:04:47 +02:00
znetsixe
d931bead0a P9.3: wiki/Home.md following 14-section visual-first template + wiki:* scripts
Auto-generated topic-contract + data-model sections via shared wikiGen
script. Hand-written Mermaid diagrams for position-in-platform, code
map, child registration, lifecycle, configuration, state chart (where
applicable).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:17:45 +02:00
znetsixe
7bf464b467 P6: convert reactor to platform infrastructure
Refactor of reactor to use BaseNodeAdapter + commandRegistry + statusBadge.
reactor follows the platform refactor plan in .claude/refactor/MODULE_SPLIT.md.
Tests stay green; CONTRACT.md generated; legacy aliases preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 22:23:43 +02:00
znetsixe
c5fc5c1b59 docs: add CLAUDE.md with S88 classification and superproject rule reference
References the flow-layout rule set in the EVOLV superproject
(.claude/rules/node-red-flow-layout.md) so Claude Code sessions working
in this repo know the S88 level, colour, and placement lane for this node.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 07:47:25 +02:00
znetsixe
556dc39049 Merge remote-tracking branch 'origin/main' into dev-Rene
# Conflicts:
#	additional_nodes/recirculation-pump.js
#	additional_nodes/settling-basin.js
#	reactor.html
#	src/nodeClass.js
#	src/reaction_modules/asm3_class Koch.js
#	src/reaction_modules/asm3_class.js
#	src/specificClass.js
2026-03-31 16:20:45 +02:00
root
2e3ba8a9bf Expand reactor demo telemetry and stability handling 2026-03-31 14:26:10 +02:00
Rene De Ren
1da55fc3f5 Expose output format selectors in editor 2026-03-12 16:39:25 +01:00
Rene De Ren
06251988af fix: replace console usage with logger, throw on unknown reactor type
Unknown reactor type is a configuration error that should fail loudly.
Converted console.log to logger.warn for unknown topics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 09:33:34 +01:00
Rene De Ren
7ff7c6ec1d test: add unit tests for specificClass
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:31:53 +01:00
Rene De Ren
a18c36b2e5 refactor: adopt POSITIONS constants and fix ESLint warnings
Replace hardcoded position strings with POSITIONS.* constants.
Prefix unused variables with _ to resolve no-unused-vars warnings.
Fix no-prototype-builtins where applicable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:35:28 +01:00
Rene De Ren
aacbc1e99d Migrate _loadConfig to use ConfigManager.buildConfig()
Replaces manual base config construction with shared buildConfig() method.
Node now only specifies domain-specific config sections.

Part of #1: Extract base config schema

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:59:35 +01:00
Rene De Ren
68576a8a36 Fix ESLint errors and bugs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:39:57 +01:00
znetsixe
2c69a5a0c1 updates 2026-03-11 11:13:51 +01:00
znetsixe
460b872053 updates 2026-02-23 12:51:10 +01:00
znetsixe
2b9ad5fd19 before functional changes by codex 2026-02-19 17:37:42 +01:00
znetsixe
7c8722b324 changed colours and icon based on s88 2025-10-14 13:52:55 +02:00
p.vanderwilt
442ddc60ed Fix syntax error 2025-10-01 11:50:35 +02:00
p.vanderwilt
04306d0996 Fix measurement type string for oxygen in _updateMeasurement method 2025-09-29 09:40:17 +02:00
p.vanderwilt
2bc244cae7 Refactor measurement update handling in Reactor_PFR class to include default case for measurement types 2025-09-26 16:36:09 +02:00
p.vanderwilt
254f9eec5a Fix measurement event listener to use correct measurement reference 2025-09-26 16:33:00 +02:00
p.vanderwilt
109fd182df Refactor measurement position handling in Reactor class 2025-09-26 14:51:18 +02:00
p.vanderwilt
bf5f265a76 Update measurement handling in Reactor class and rename oxygen measurement type 2025-09-26 10:17:00 +02:00
p.vanderwilt
905674ce58 Update dependencies and correct node name 2025-09-24 15:27:08 +02:00
p.vanderwilt
da1cff55ba Resolve merge conflicts from migration 2025-09-22 16:40:22 +02:00
p.vanderwilt
9147a3f7d0 Rename repo 2025-09-22 16:19:00 +02:00
ea35038aa1 Initial commit 2025-09-22 14:11:36 +00:00
p.vanderwilt
8f64fbe4e5 Add time step configuration and input handling in advanced reactor 2025-09-22 15:17:25 +02:00
p.vanderwilt
7a70f60655 Fix measurement event listener registration in Reactor class 2025-09-19 13:26:45 +02:00
p.vanderwilt
223c4555b8 Fix measurement reference in child registration logic 2025-09-16 15:54:31 +02:00
p.vanderwilt
972d33355e Formatting 2025-09-16 11:44:29 +02:00
p.vanderwilt
94ea4fe76b Fix subclass function 2025-09-15 17:39:54 +02:00
p.vanderwilt
f6b026928e Enhance measurement child registration and update measurement handling in Reactor class 2025-09-15 12:48:18 +02:00
p.vanderwilt
c2cd29db56 Update generalFunctions dependency and enhance reactor child registration logic 2025-09-05 15:26:00 +02:00
p.vanderwilt
0b49642668 Switch general functions to new implementation 2025-09-05 13:31:42 +02:00
p.vanderwilt
a4a5266040 Update package-lock 2025-09-03 12:21:15 +02:00
p.vanderwilt
1857031027 Minor fix Koch parameters 2025-08-18 16:56:59 +02:00
p.vanderwilt
a8928e50cc Add Koch parameters 2025-08-18 16:43:16 +02:00
p.vanderwilt
04a5b1a54f Fix COD balance 2025-08-14 11:14:14 +02:00
p.vanderwilt
7a6825a80e Add flows document 2025-08-04 11:45:00 +02:00
p.vanderwilt
fbbe5833b2 Temporary fix for undefined newTime value in updateState function 2025-08-04 10:59:11 +02:00
p.vanderwilt
2c9db0fcea Fixed position and log settings 2025-07-31 14:48:39 +02:00
p.vanderwilt
5ec9319b3f Add position field and proper logging configuration 2025-07-24 12:13:16 +02:00