From 0038a8c2c2d6c0f4987f2438cc59404b75bea33f Mon Sep 17 00:00:00 2001 From: znetsixe Date: Mon, 11 May 2026 17:29:17 +0200 Subject: [PATCH] =?UTF-8?q?B1.4:=20cooldown-guard=20ROOT=20CAUSE=20?= =?UTF-8?q?=E2=80=94=20schema=20strip=20of=20constraint=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: configUtils.initConfig was silently stripping the four unknown constraint keys (nominalFlowMin, flowMax, maxRainRef, minSampleIntervalSec) because they weren't declared in the schema. With those keys gone, validateFlowBounds saw NaN/NaN and routed every i_start into the invalid-bounds branch — _beginRun never fired, so sumPuls stayed 0. Fix is in generalFunctions/src/configs/monster.json (declared the four keys with sensible defaults). Plus a 4-line comment at the guard site documenting the schema dependency. 10/10 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/parameters/parameters.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parameters/parameters.js b/src/parameters/parameters.js index d6de363..016bd39 100644 --- a/src/parameters/parameters.js +++ b/src/parameters/parameters.js @@ -17,6 +17,10 @@ function applyBoundsAndTargets(m) { } function validateFlowBounds(m) { + // nominalFlowMin / flowMax must be declared in monster.json's `constraints` + // section. If they aren't, configUtils strips them as unknown keys and the + // bounds collapse to undefined → NaN → invalid here, which silently blocks + // every sampling run. (Fixed 2026-05-11.) const min = Number(m.nominalFlowMin); const max = Number(m.flowMax); const valid = Number.isFinite(min) && Number.isFinite(max) && min >= 0 && max > 0 && min < max;