From 1d33265aac94b24d64a26fb6b0b7f2ddc0f63cb2 Mon Sep 17 00:00:00 2001 From: glenn schrooyen Date: Sun, 27 Sep 2026 17:04:55 +0200 Subject: [PATCH] test_price: grade the Why row of the same render, not a second read of why_words Since UX-10 the waiting sentence counts its seconds when it is read, so the second read could cross a second boundary on a loaded runner ("1 second" in the row, "2 seconds" in the check). CI run 953 on this PR failed that way; test_price.py passes locally on the same tree. Co-Authored-By: Claude Opus 5.5 --- goodwe_controller/test_price.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/goodwe_controller/test_price.py b/goodwe_controller/test_price.py index 5fe1c81..7a53af1 100644 --- a/goodwe_controller/test_price.py +++ b/goodwe_controller/test_price.py @@ -4412,12 +4412,16 @@ check(f"AC, AND THE WHOLE OF DEFECT 4: 'trading is off' and 'trading is on " f"`off (arbitrage_enabled)` for both - naming an option that is `true` " f"in the options blob", _T11_OFF[0]["Arbitrage"] != _T11_ON_HELD[0]["Arbitrage"]) +# ⚠️ THE "Why" ROW OF THE SAME RENDER, NOT A SECOND READ OF `why_words`. Since +# UX-10 the waiting sentence counts its seconds when it is read, so reading the +# property again here, after the other renders above, could cross a second +# ("1 second" in the row, "2 seconds" now) - CI run 953 on PR #141 did. check(f"...and the armed-but-held row carries the CONTROL LOOP'S OWN REASON " - f"({_T11_ON_HELD[1].why_words!r}), so the operator is told which input is " + f"({_T11_ON_HELD[0]['Why']!r}), so the operator is told which input is " f"missing rather than being sent to look at a switch that is already on. " f"The reason comes from main.py, not from this file", - _T11_ON_HELD[1].why_words - and _T11_ON_HELD[1].why_words in _T11_ON_HELD[0]["Arbitrage"]) + _T11_ON_HELD[0]["Why"].startswith("A reading is missing") + and _T11_ON_HELD[0]["Why"] in _T11_ON_HELD[0]["Arbitrage"]) check(f"...and a cycle that DID reach the step renders the strategy's own " f"sentence - {_T11_ON_OK[1].arb.explain()[:50]!r} - rather than a " f"re-derivation of it, which is the guarantee OPT-04 put on this row and "