v0.297.0: burn-down round 2 — 24 small rows (R-591 R-568 R-567 R-363 R-547 R-10 R-552 R-251 R-104 R-619 R-362 R-675 R-256 R-257 R-240 R-365 R-425 R-565 R-564 R-603 R-454 R-208 R-457-swept) + the banner countdown and deepCopyStack twins; MinAgent 0.131.0
gates / gates (push) Failing after 50s

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-05 20:12:56 +02:00
parent 114ff2761a
commit 1453cfc69b
68 changed files with 3953 additions and 116 deletions
@@ -0,0 +1,51 @@
package web
import (
"context"
"os"
"strings"
"testing"
)
// R-675: when a unit restore is refused for a file app, the sentence must name the route that brings
// the files back. Since decision 26 (v0.269.0) a second drive holding a WHOLE copy has its own action
// („Teljes visszaállítás a másolatból") — but the refusal still sent the household to the file-only
// „Fájlok visszaállítása". The consequence asserted: for each real state the household reads the right
// button name, in both languages; the whole copy wins over the file-only copy, and off-site still wins.
func TestR675_RefusalNamesTheWholeCopy(t *testing.T) {
s := noteServer(t)
cases := []struct {
name string
offsite, whole, files bool
huWant, enWant string
huNot string
}{
{"whole copy on the second drive", false, true, true, "Teljes visszaállítás a másolatból", "Full restore from the copy", "Fájlok visszaállítása"},
{"file copy only on the second drive", false, false, true, "Fájlok visszaállítása", "Restore files", "Teljes visszaállítás a másolatból"},
{"off-site copy", true, true, true, "Teljes visszaállítás (fájlok + adatbázis)", "Full restore (files + database)", "Fájlok visszaállítása"},
{"nothing", false, false, false, "nincs másolat", "There is no copy", "Fájlok visszaállítása"},
}
for _, c := range cases {
key := missingFileLegsRouteKey(c.offsite, c.whole, c.files)
hu := s.msgLang("hu", "restore.refuse.files.head") + s.msgLang("hu", key)
en := s.msgLang("en", "restore.refuse.files.head") + s.msgLang("en", key)
if !strings.Contains(hu, c.huWant) || strings.Contains(hu, c.huNot) {
t.Errorf("R-675 %s: the Hungarian refusal reads %q; want it to name %q and not %q", c.name, hu, c.huWant, c.huNot)
}
if !strings.Contains(en, c.enWant) {
t.Errorf("R-675 %s: the English refusal reads %q; want it to name %q", c.name, en, c.enWant)
}
}
// With no backup manager at all, the function answers the honest "no copy" sentence.
if got := s.missingFileLegsRefusal(context.Background(), "en", "nextcloud"); !strings.Contains(got, "There is no copy") {
t.Errorf("no backup manager: got %q", got)
}
// Wiring: the refusal consults the decision-26 whole-copy predicate.
src, err := os.ReadFile("handlers.go")
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(src), "s.backupMgr.WholeOnTier(stackName, backup.UpdateTierSecondDrive)") {
t.Errorf("R-675: missingFileLegsRefusal does not ask whether the second drive holds a whole copy")
}
}