fix: H3 scale ratings were silently discarded and replaced with the default

Root cause of "every rating counts as liked": the 'rating' node
input is a COMBO widget the graph builder validates against
V2_RATING_LABELS (builder.py's _live_value) -- the same guard that
falls back to a node's default when a saved LoRA/model choice isn't
installed on this machine. The H3 scale sends bare digit strings,
which were never added to that list, so EVERY H3 rating since the
scale shipped was silently rejected as "not a valid choice" and
replaced with the node's declared default, "Missing action" (+0.05)
-- explaining the diagnostic log exactly: legacy_score=None (never
reached the digit-parsing path at all) and reward +0.050 (the
literal default, not a mapped value).

Confirmed with the log line the user captured: the fix earlier this
session to normalize_refiner_v2_rating's digit math was correct and
irrelevant -- the real rating value never reached that function.

Fix: add "1".."10" to V2_RATING_LABELS so they pass validation
unchanged, same list both rating widget declarations already read.
This commit is contained in:
digital-garbage
2026-09-03 18:56:28 +03:00
parent 90250e9f6a
commit 85add9ed84
2 changed files with 17 additions and 1 deletions
+7 -1
View File
@@ -3584,7 +3584,13 @@ _NO_LOVED_LABELS = {
}
V2_RATING_LABELS = _BASE_RATING_LABELS + [
l + "|loved" for l in _BASE_RATING_LABELS if l not in _NO_LOVED_LABELS
] + [MOVIE_EDITOR_CONTINUE_RATING, MOVIE_EDITOR_FRESH_PROMPT_RATING]
] + [MOVIE_EDITOR_CONTINUE_RATING, MOVIE_EDITOR_FRESH_PROMPT_RATING] + [str(n) for n in range(1, 11)]
# The "rating" node input is a COMBO the graph builder validates against this exact list
# (movie_editor/backend/builder.py's _live_value) -- a value that isn't in it gets silently
# swapped for the node's declared default ("Missing action") before Python ever sees it, the
# same protection that stops a saved-but-uninstalled LoRA from queuing a broken prompt. The
# H3 scale sends bare digit strings, so without them listed here every H3 rating was silently
# discarded and replaced with the same "Missing action" (+0.05) regardless of what was picked.
V2_RATING_PROFILES = {
"-Just forget it-": {"key": "forget", "reward": 0.0, "level": 0, "missing_axes": [], "skip_learning": True},
+10
View File
@@ -2285,3 +2285,13 @@ def test_the_digit_scale_reward_is_monotonic():
rewards = [normalize_refiner_v2_rating(str(n))["reward"] for n in range(1, 11)]
assert rewards == sorted(rewards)
assert abs(rewards[0] - -0.9) < 1e-9 and abs(rewards[-1] - 1.0) < 1e-9
def test_h3_scale_digits_are_valid_combo_choices():
"""The 'rating' node input is a COMBO the graph builder validates against this exact
list (movie_editor/backend/builder.py's _live_value) -- a value that isn't listed here
gets silently swapped for the node's declared default before Python ever sees it. Every
digit the H3 scale can send has to be a member, or every H3 rating silently becomes
whatever the default happens to be."""
for n in range(1, 11):
assert str(n) in V2_RATING_LABELS