UX-08 2c: short refusals, error texts and option texts
Validator refusals name the setting by its label and key, say what is wrong and what to change, and keep the rejected value and limit. Option names and descriptions are short in en and nl; citations moved to DOCS "For installers" and the test_translations citation check now pins the instruction on the tab and the record in DOCS. No rule, key, schema, default or exit code changed. Allowlist 167 -> 43 (log lines only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyR88rXETvwhTgx6yHE39p
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e1d0970b23
commit
2c516a032c
@@ -2019,12 +2019,13 @@ check("...and so is a floor EXACTLY AT it, which is the interesting case: equal
|
||||
"it leaves none", len(equal) == 1)
|
||||
check("...while one point above is accepted, so this refuses the disarmed case "
|
||||
"only and not 'close to the limit'", above == [])
|
||||
check("...and the refusal NAMES BOTH NUMBERS and the shipped default, so the "
|
||||
"operator can act on it without reading the source",
|
||||
# UX-08 2c: the shipped default left the sentence (it is on the option's
|
||||
# description). The two numbers the operator acts on stay.
|
||||
check("...and the refusal NAMES BOTH NUMBERS, so the operator can act on it "
|
||||
"without reading the source",
|
||||
len(below) == 1
|
||||
and f"{BMS_FLOOR:.0f} %" in below[0]
|
||||
and f"{BMS_FLOOR - 5:.0f} %" in below[0]
|
||||
and f"{PEAK_OPTION_DEFAULTS['peak_soc_floor']:.0f} %" in below[0])
|
||||
and f"{BMS_FLOOR - 5:.0f} %" in below[0])
|
||||
check("...and a non-numeric floor is refused rather than defaulted, for the "
|
||||
"reason every read in this file is: a value that cannot be parsed is not "
|
||||
"an observation of anything",
|
||||
@@ -3894,13 +3895,12 @@ check("⚠️ AC 3. Rule 8 grades EVERY unit: a roster whose SECOND pack has a "
|
||||
"inverter-b. Under the flat key this config STARTED, and the guard would "
|
||||
"then have commanded a forced discharge that pack B's BMS - not the "
|
||||
"operator's floor - is the thing that stops",
|
||||
len(_r_second) == 1 and "(inverter-b)" in _msg(_r_second)
|
||||
and "(inverter-a)" not in _msg(_r_second))
|
||||
check("...and it names BOTH numbers and the shipped default, so the operator "
|
||||
"can act on it without reading the source",
|
||||
len(_r_second) == 1 and " for inverter-b" in _msg(_r_second)
|
||||
and " for inverter-a" not in _msg(_r_second))
|
||||
check("...and it names BOTH numbers, so the operator can act on it without "
|
||||
"reading the source",
|
||||
f"{B_PACK_FLOOR_DEEP_SIM:.0f} %" in _msg(_r_second)
|
||||
and f"{SOC_FLOOR:.0f} %" in _msg(_r_second)
|
||||
and f"{PEAK_OPTION_DEFAULTS['peak_soc_floor']:.0f} %" in _msg(_r_second))
|
||||
and f"{SOC_FLOOR:.0f} %" in _msg(_r_second))
|
||||
# The mirror. A grader hardwired to index 1 - or one that reports the LAST
|
||||
# offender - passes the check above and fails this one.
|
||||
_r_first = rule8(validate_startup_config(
|
||||
@@ -3908,8 +3908,8 @@ _r_first = rule8(validate_startup_config(
|
||||
check("...and with the SAME two numbers in the OTHER ORDER it names "
|
||||
"inverter-a instead. The pair of checks is what makes this an index "
|
||||
"check: one of them goes red for any hardwired position",
|
||||
len(_r_first) == 1 and "(inverter-a)" in _msg(_r_first)
|
||||
and "(inverter-b)" not in _msg(_r_first))
|
||||
len(_r_first) == 1 and " for inverter-a" in _msg(_r_first)
|
||||
and " for inverter-b" not in _msg(_r_first))
|
||||
# And both at once, because a loop that `break`s on the first offender reports
|
||||
# one refusal for a config with two.
|
||||
_r_both = rule8(validate_startup_config(
|
||||
@@ -3917,8 +3917,8 @@ _r_both = rule8(validate_startup_config(
|
||||
check("...and a roster where BOTH packs offend is refused TWICE, once per unit "
|
||||
"and each naming its own - so an operator with two wrong packs is not "
|
||||
"told about one of them and left to discover the other on the next boot",
|
||||
len(_r_both) == 2 and "(inverter-a)" in _msg(_r_both, 0)
|
||||
and "(inverter-b)" in _msg(_r_both, 1))
|
||||
len(_r_both) == 2 and " for inverter-a" in _msg(_r_both, 0)
|
||||
and " for inverter-b" in _msg(_r_both, 1))
|
||||
# A missing per-entry cut-out is refused BY NAME rather than defaulted.
|
||||
_r_missing = rule8(validate_startup_config(_roster32(A_PACK_FLOOR, None)))
|
||||
print(f" entry with no bms_soc_floor -> {_msg(_r_missing)[:120] or '(none)'}...")
|
||||
@@ -3927,7 +3927,7 @@ check("...and an entry that states NO `bms_soc_floor` is refused by name rather
|
||||
"cut-out this add-on invented for a battery it has not been told about, "
|
||||
"which is the same wrong number the flat key produced. See "
|
||||
"DECISIONS/SAFETY-32-per-pack-bms-floor.md",
|
||||
len(_r_missing) == 1 and "(inverter-b)" in _msg(_r_missing)
|
||||
len(_r_missing) == 1 and " for inverter-b" in _msg(_r_missing)
|
||||
and "must both be numbers" in _msg(_r_missing))
|
||||
|
||||
# --- 12f. nothing is inherited, with the flat key SET AND DIFFERENT ----------
|
||||
@@ -5601,7 +5601,7 @@ MUT.append(("an unstated per-entry cut-out defaulted to 0 %",
|
||||
|
||||
# 19. rule 8 grading only the first unit, i.e. the flat rule left in place.
|
||||
MUT.append(("rule 8 grading only the FIRST unit",
|
||||
_r_second != [] and "(inverter-b)" in _msg(_r_second),
|
||||
_r_second != [] and " for inverter-b" in _msg(_r_second),
|
||||
"part 12e: 'a roster whose SECOND pack has a cut-out above "
|
||||
"peak_soc_floor is refused'. ⚠️ The offender is the SECOND entry "
|
||||
"for exactly this row"))
|
||||
@@ -5609,7 +5609,7 @@ MUT.append(("rule 8 grading only the FIRST unit",
|
||||
# 20. rule 8 naming a hardwired unit - CFG-04's rule 5/6 bug, which is why
|
||||
# `unit_bms_floors_indexed()` carries the roster index.
|
||||
MUT.append(("rule 8's refusal naming a hardwired inverter",
|
||||
"(inverter-b)" in _msg(_r_second) and "(inverter-a)" in _msg(_r_first),
|
||||
" for inverter-b" in _msg(_r_second) and " for inverter-a" in _msg(_r_first),
|
||||
"part 12e: the two orders. Either hardwired index passes one of "
|
||||
"them and fails the other"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user