v0.306.0: R-570 — the off-site note decides on its kind only; the pre-0.251.0 text fallback is deleted
gates / gates (push) Successful in 1m14s

Fleet condition read on each box's settings.json 2026-10-10 (offbox.last_success ~02:16Z on 0.304.0).
Red-proof: the new no-kind row of TestR553_StaleNoteDecisionSurvivesWordingChange failed against the fallback.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-10-10 15:08:42 +02:00
parent c255195e37
commit 9e5b88146e
9 changed files with 41 additions and 69 deletions
+3 -3
View File
@@ -1186,9 +1186,9 @@ func (m *Manager) runOffboxBackup(ctx context.Context, withProgress bool) error
// must not be told "nothing is selected".
// R-240: the sentence no longer opens with „Sikeres" — a run that covered nothing was
// congratulating the household on it. The verdict stays `ok` (an unconfigured selection is
// not a failure). Still a Hungarian LITERAL and still carrying the lowercase marker
// „nincs mentésre jelölt alkalmazás" (R-570: boxes with the older persisted text are
// recognised by those words). Pinned by TestR240_ZeroSelectionRunDoesNotSaySuccess.
// not a failure). Still a Hungarian LITERAL; since R-570 closed (2026-10-10) no reader depends
// on its words — the page decides on warnKind — so localisation may translate it.
// Pinned by TestR240_ZeroSelectionRunDoesNotSaySuccess.
if len(apps) == 0 && !runResult.sharesBackedUp {
warns = append(warns, "Ez a futás semmit nem mentett: nincs mentésre jelölt alkalmazás")
warnKind = OffboxWarnNoAppsSelected // R-553: the page reads this, not the sentence
@@ -156,37 +156,6 @@ func backupNoteHU(t *testing.T, key string) string {
return newNoteManager(t).note(key)
}
// TestR570SentenceStaysHungarian — the ONE saved note release C may not translate.
//
// A box upgraded to 0.251.0 carries the OLD persisted warning with no kind until its next off-site
// run rewrites it, so `offboxWarningDisplay` still falls back to a substring test on those words when
// the kind is empty (R-553's documented exception). Translating the PRODUCER while that fallback is
// load-bearing would strand exactly the boxes the fallback exists for: their stale note would stop
// being recognised and would keep telling a household that nothing is covered.
//
// **Delete this test when R-570 closes** — it is named for the row on purpose.
//
// RED-PROOF (REPORT): turn the producer into m.note("…") → this test fails naming the line.
func TestR570SentenceStaysHungarian(t *testing.T) {
const sentence = "Ez a futás semmit nem mentett: nincs mentésre jelölt alkalmazás"
src, err := os.ReadFile("offbox.go")
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(src), `"`+sentence+`"`) {
t.Errorf("the R-570 producer no longer writes %q as a literal — a box that has not run off-site "+
"since 0.251.0 carries that exact text with no kind, and offboxWarningDisplay finds it by "+
"those words. Translating it strands them. Close R-570 first.", sentence)
}
// And the sentence must not have quietly acquired a bundle key either: a key would render
// Hungarian today and something else the day someone adds a translation.
for _, k := range []string{"note.offsite.no_apps_selected", "note.offsite.zero_toggle"} {
if strings.Contains(string(src), k) {
t.Errorf("the R-570 producer now names a bundle key (%s) — same problem, one step further away", k)
}
}
}
// TestNoteHelpersAreNotCalledUnderTheSettingsLock — release C (R-557), and it is a REGRESSION test,
// not a precaution.
//
@@ -10,7 +10,7 @@ import (
// SUCCESSFUL right beside NOTHING SELECTED, the same shape as R-203/R-234 (a warning beside a success
// is read as a success). The consequence asserted through the real run: the verdict stays `ok` (an
// empty selection is not a failure), the note says plainly that the run saved nothing, it does NOT
// say „Sikeres", and it still carries the lowercase marker the R-570 legacy fallback reads.
// say „Sikeres", and it records its KIND (the page decides on the kind; R-570 removed the text fallback).
func TestR240_ZeroSelectionRunDoesNotSaySuccess(t *testing.T) {
m, sett := newOffboxManager(t)
m.SetOffboxRunner(func(_ context.Context, _ []string, args ...string) ([]byte, error) {
@@ -32,9 +32,6 @@ func TestR240_ZeroSelectionRunDoesNotSaySuccess(t *testing.T) {
if !strings.Contains(st.LastWarning, "semmit nem mentett") {
t.Errorf("R-240: the note does not say the run saved nothing: %q", st.LastWarning)
}
if !strings.Contains(st.LastWarning, "nincs mentésre jelölt alkalmazás") {
t.Errorf("the R-570 marker is gone from the note: %q", st.LastWarning)
}
if st.LastWarningKind != OffboxWarnNoAppsSelected {
t.Errorf("the kind is not recorded: %q", st.LastWarningKind)
}