UX-08 2c: short option names and descriptions, detail to DOCS

Every option name and description in en.yaml and nl.yaml is rewritten to
STYLE.md: a label of at most about 5 words with its unit, and one or two
plain sentences. Citations and derivations move to DOCS.md under "For
installers: where the numbers come from", beside a "Settings at a glance"
table of the tab's text.

test_translations.py part 3 (UX-01 citation check) is relaxed accordingly:
a derived key's description must say what to do ("leave it unchanged"),
and its DOCS entry must name the record. test_price.py pins the
fetch/trading wording by meaning, not capitals. No key, schema or default
changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-09-27 05:08:25 +02:00
co-authored by Claude Opus 5.5
parent e1d0970b23
commit c633d0a2d0
5 changed files with 512 additions and 362 deletions
+86 -73
View File
@@ -12,10 +12,11 @@ the sentence that says WHETHER TO TOUCH THE VALUE, because the tab presents a
constant derived from 1890 closed-loop test runs and the operator's own inverter
rating as the same kind of field.
⚠️ WHAT THIS FILE CANNOT SEE, SAID FIRST. It grades COVERAGE and PROVENANCE
CITATIONS - that every option has a name and a description in both languages,
that no translation names an option that does not exist, and that each derived
constant's English description cites the record it was derived from. It does NOT
⚠️ WHAT THIS FILE CANNOT SEE, SAID FIRST. It grades COVERAGE and PROVENANCE -
that every option has a name and a description in both languages, that no
translation names an option that does not exist, that each derived constant's
English description says to leave it, and that DOCS.md's "For installers"
entry for it names the record it came from (moved there by UX-08). It does NOT
grade whether a sentence is true, whether the Dutch is good Dutch, or whether
the result looks right on screen. The last of those is measured, not asserted,
by `tools/supervisor_shape_probe.py` section F, which loads these files with
@@ -107,83 +108,95 @@ check("...and no Dutch string was left as a copy of the English one, which is "
== TR["nl"]["configuration"][k]["description"]])
print("\n3. ⭐ the description says WHETHER TO TOUCH IT")
# ⚠️ THE HIGHEST-VALUE ITEM IN THE CARD, AND THE ONE A COVERAGE COUNT CANNOT
# REACH. Sixty-odd descriptions that all say "the threshold, in watts" would
# pass part 2 completely. What makes this surface safe is that a DERIVED
# constant names the campaign it came from and says the value is not a knob,
# while a number that really is the operator's says so too.
#
# ⚠️ AND THIS IS A TEXT CHECK, WHICH IS WEAK ON PURPOSE AND IS SAID TO BE. It
# cannot know whether a citation is TRUE; it can only know that the citation is
# there and names the right record, so that deleting the provenance - or
# renaming the card it points at - goes red instead of shipping. The table is
# written out rather than derived because there is nothing in config.yaml that
# distinguishes a derived constant from an operator's number; that distinction
# is the whole of what this card had to add.
# The value of this surface is the sentence that says whether a number is a
# knob. Since UX-08 phase 2c the tab keeps that sentence short ("Measured value,
# leave it unchanged.") and the record it came from lives in DOCS.md under
# "For installers: where the numbers come from", where UX-01's citations moved.
# So each derived key is pinned twice:
# its English description tells the reader what to do, and its DOCS entry names
# the record. A text check, weak on purpose: it cannot know a citation is TRUE,
# only that deleting it, or the instruction, goes red.
DOCS = (HERE / "DOCS.md").read_text(encoding="utf-8")
_inst = DOCS.split("\n### For installers: where the numbers come from\n", 1)
INSTALLERS = _inst[-1].split("\n#", 1)[0] if len(_inst) == 2 else ""
check("DOCS.md has the 'For installers: where the numbers come from' section",
bool(INSTALLERS.strip()))
def docs_entry(key):
"""The DOCS bullet that names `key` in backticks, lower-cased."""
hits = [b for b in INSTALLERS.split("\n- ") if f"`{key}`" in b]
return hits[0].lower() if hits else ""
LEAVE_M, LEAVE_D = "Measured value, leave it unchanged", \
"Derived value, leave it unchanged"
# key: (what the English description must say, what its DOCS entry must name)
DERIVED = {
"sign_disagree_w": ("SAFETY-02", "MEASURED"),
"sign_disagree_s": ("SAFETY-02", "MEASURED"),
"unit_sign_disagree_w": ("SAFETY-30", "1890"),
"unit_sign_disagree_s": ("SAFETY-30", "1890"),
"site_sign_disagree_w": ("SAFETY-30", "CARRIED"),
"site_sign_disagree_s": ("SAFETY-30", "1890"),
"meter_freeze_s": ("SAFETY-18", "MEASURED"),
"circulation_w": ("SAFETY-31", "924"),
"circulation_hold_s": ("SAFETY-31", "DERIVED"),
# SAFETY-42. Two needles rather than one: the campaign it was derived from,
# and the word that says what it does NOT do. An operator who reads
# "not-delivering report" and assumes the add-on has handled it is the
# failure this alarm's whole wording is written against.
"delivery_hold_s": ("SAFETY-42", "DERIVED FROM", "REPORTS ONLY"),
"peak_soc_floor": ("SAFETY-24", "DERIVED"),
"bms_soc_floor": ("0x0560", "MEASURED"),
"integrator_max_w": ("MEASURED", "Do not raise it"),
"gain": ("MEASURED ON", "do not raise it"),
# SAFETY-39. `slew_w` joins the table because it stopped being an
# operator's convenience and became a DERIVED value the moment it was
# tied to the rating: 0 resolves to about a ninth of `max_w`, from an
# ~18 s measured step response. It is the one entry here whose value is
# a RATIO, so the description has to say what it follows as well as
# where the ratio came from - a citation alone would leave an operator
# reading "0" on the tab with no idea it is not "off".
"slew_w": ("SAFETY-39", "DERIVED", "0 MEANS FOLLOW"),
# TARIFF-18. `price_taxes_eur_kwh` joins the table for `slew_w`'s reason:
# it stopped being a figure somebody picked and became one SUMMED FROM
# NAMED CARD ROWS. Three needles, because three different things about it
# can go wrong on the Configuration tab and only the first is provenance:
# where the number came from, that the operator's own DSO gives a
# different one, and that changing it moves no trade - which is the claim
# an operator is most likely to assume the opposite of when a number
# doubles.
"price_taxes_eur_kwh": ("TARIFF-18", "YOUR OWN DSO",
"MOVES NO TRADING DECISION"),
"sign_disagree_w": (LEAVE_M, ("SAFETY-02", "measured")),
"sign_disagree_s": (LEAVE_M, ("SAFETY-02", "measured")),
"unit_sign_disagree_w": (LEAVE_D, ("SAFETY-30", "1890")),
"unit_sign_disagree_s": (LEAVE_D, ("SAFETY-30", "1890")),
"site_sign_disagree_w": (LEAVE_M, ("SAFETY-30", "carried")),
"site_sign_disagree_s": (LEAVE_D, ("SAFETY-30", "1890")),
"meter_freeze_s": (LEAVE_M, ("SAFETY-18", "measured")),
"circulation_w": (LEAVE_M, ("SAFETY-31", "924")),
"circulation_hold_s": (LEAVE_D, ("SAFETY-31", "derived")),
# SAFETY-42: the alarm changes nothing, and both surfaces say so.
"delivery_hold_s": (LEAVE_D, ("SAFETY-42", "derived from",
"reports only")),
"peak_soc_floor": (LEAVE_D, ("SAFETY-24", "derived")),
"bms_soc_floor": ("Read it off your battery", ("0x0560", "measured")),
"integrator_max_w": ("Do not raise it above", ("measured",)),
"gain": ("do not raise it", ("measured on",)),
# SAFETY-39: 0 is not "off", it follows the rating.
"slew_w": ("0 follows", ("SAFETY-39", "derived", "0 means follow")),
# TARIFF-18: where the figure came from, that your DSO differs, and that
# changing it moves no trade.
"price_taxes_eur_kwh": ("Check it against your own grid operator",
("TARIFF-18", "your own dso",
"moves no trading decision")),
}
_uncited = []
for key, needles in sorted(DERIVED.items()):
desc = TR["en"]["configuration"][key]["description"]
for key, (says, needles) in sorted(DERIVED.items()):
if says not in TR["en"]["configuration"][key]["description"]:
_uncited.append(f"{key} description does not say {says!r}")
for needle in needles:
if needle not in desc:
_uncited.append(f"{key} does not cite {needle!r}")
print(f" {len(DERIVED)} derived constants must cite their campaign; "
f"{len(_uncited)} do not")
check(f"every derived constant's English description names WHERE THE NUMBER "
f"CAME FROM, so an operator reading the tab can tell it apart from their "
f"own inverter rating. Uncited: {_uncited}", not _uncited)
# The other direction, and it matters as much: a number that IS the operator's
# must not be dressed up as derived, or the labels stop meaning anything.
if needle.lower() not in docs_entry(key):
_uncited.append(f"{key}: DOCS does not name {needle!r}")
print(f" {len(DERIVED)} derived constants; {len(_uncited)} problem(s)")
check(f"every derived constant's description says what to do with it, and its "
f"DOCS entry names where the number came from. Problems: {_uncited}",
not _uncited)
_theirs = ["max_w", "peak_cap_w"]
check("...and the numbers that really are the OPERATOR'S say so instead of "
"carrying a citation - `max_w` and `peak_cap_w` are the two the card "
"names, and both read 'THIS IS YOUR NUMBER'",
all("THIS IS YOUR NUMBER" in TR["en"]["configuration"][k]["description"]
check("...and the numbers that really are the OPERATOR'S say so instead - "
"`max_w` and `peak_cap_w` start 'Your own number', here and in DOCS",
all(TR["en"]["configuration"][k]["description"].startswith(
"Your own number") and "your own number" in docs_entry(k)
for k in _theirs))
check("...and the one threshold that is NOT derived from a measurement admits "
"it rather than borrowing the others' authority - "
"`cycle_cost_threshold_eur` is an open product question (OPT-08)",
"NOT DERIVED FROM A MEASUREMENT"
"it - `cycle_cost_threshold_eur` is a product choice, and DOCS names the "
"open question (OPT-08)",
"product choice, not a measured one"
in TR["en"]["configuration"]["cycle_cost_threshold_eur"]["description"]
and "OPT-08"
in TR["en"]["configuration"]["cycle_cost_threshold_eur"]["description"])
and "opt-08" in docs_entry("cycle_cost_threshold_eur")
and "not derived from a measurement"
in docs_entry("cycle_cost_threshold_eur"))
# DOCS.md's "Settings at a glance" shows the tab's text. It must not drift.
_glance = DOCS.split("\n### Settings at a glance\n", 1)[-1].split("\n#", 1)[0]
_rows = {}
for line in _glance.splitlines():
cells = [c.strip() for c in line.strip().strip("|").split("|")]
if len(cells) == 4 and cells[2].startswith("`"):
_rows[cells[2].strip("`")] = (cells[1], cells[3])
_drift = []
for key in ORDER:
conf = TR["en"]["configuration"][key]
want = (conf["name"].split(" · ")[-1], conf["description"])
if _rows.get(key) != want:
_drift.append(key)
check(f"DOCS.md 'Settings at a glance' shows every option's English label and "
f"description exactly as the tab does. Drifted: {_drift}", not _drift)
print("\n4. task ordering, and the labels that carry it")
# ⚠️ ADD-ON OPTIONS ARE A FLAT LIST - no section headers, no per-option advanced