v0.259.0 — the claim page and the backup warnings answer in the reader's language (R-596, R-598)
gates / gates (push) Successful in 28s
gates / gates (push) Successful in 28s
The 2026-09-20 English drill ended one screen short: the claim page was English and its answers were Hungarian, so a household who mistyped the code from their e-mail could not tell a typo from a dead code. Fourteen call sites carrying nine messages now go through s.msg; the backup page's two protection warnings — which are promises about whether the customer's files are safe — follow the same route. Hungarian is byte-identical, proved structurally by the go-parity gate against the frozen base capture and red-proofed on a single added full stop. data["Title"] was DEAD (claim.html is standalone; .Title is layout.html's) and is deleted rather than translated — a translated dead field is a permanent false signal about where the page's title comes from. Six existing copy-contract tests were kept, not weakened: each now resolves its key through the real bundle, so it still convicts on a reworded Hungarian sentence. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -42,11 +42,11 @@ func renderBackupsPage(t *testing.T, primary string, disks []agentapi.DiskInfo,
|
||||
func TestBackupsPageRendersTheAbsentDriveCopy(t *testing.T) {
|
||||
html := renderBackupsPage(t, "felhom-backup", []agentapi.DiskInfo{theVanishedDrive}, "/mnt/felhom-drives/mentes2")
|
||||
|
||||
if !strings.Contains(html, backupTargetAbsentText) {
|
||||
if !strings.Contains(html, huText(t, backupTargetAbsentKey)) {
|
||||
t.Error("the absent-drive copy never reached the page — the customer is told nothing while " +
|
||||
"their backup drive is missing (R-112: the state had no consumer at all)")
|
||||
}
|
||||
if strings.Contains(html, backupTargetDegradedText) {
|
||||
if strings.Contains(html, huText(t, backupTargetDegradedKey)) {
|
||||
t.Error("the page shows the SYSTEM-DISK copy for an absent configured drive (R-114)")
|
||||
}
|
||||
// Assert the CONTROL's markup, not the bare id: the page script always contains
|
||||
@@ -68,10 +68,10 @@ func TestBackupsPageRendersTheOfferWhenNeverConfigured(t *testing.T) {
|
||||
Name: "hdd1", MountPath: "/mnt/hdd1", GuestPath: "/mnt/felhom-drives/hdd1", Role: "user-data",
|
||||
}}, "/mnt/felhom-drives/hdd1")
|
||||
|
||||
if !strings.Contains(html, backupTargetDegradedText) {
|
||||
if !strings.Contains(html, huText(t, backupTargetDegradedKey)) {
|
||||
t.Error("the degraded copy never reached the page")
|
||||
}
|
||||
if !strings.Contains(html, backupTargetOfferText) {
|
||||
if !strings.Contains(html, huText(t, backupTargetOfferKey)) {
|
||||
t.Error("the offer copy never reached the page")
|
||||
}
|
||||
if !strings.Contains(html, `id="backup-target-assign"`) {
|
||||
@@ -116,9 +116,9 @@ func TestBackupsPageRendersNothingWhenAgentUnreachable(t *testing.T) {
|
||||
func assertNoBackupTargetCopy(t *testing.T, html, why string) {
|
||||
t.Helper()
|
||||
for _, s := range []struct{ frag, name string }{
|
||||
{backupTargetDegradedText, "the system-disk copy"},
|
||||
{backupTargetAbsentText, "the absent-drive copy"},
|
||||
{backupTargetOfferText, "the offer copy"},
|
||||
{huText(t, backupTargetDegradedKey), "the system-disk copy"},
|
||||
{huText(t, backupTargetAbsentKey), "the absent-drive copy"},
|
||||
{huText(t, backupTargetOfferKey), "the offer copy"},
|
||||
} {
|
||||
if strings.Contains(html, s.frag) {
|
||||
t.Errorf("%s rendered: %s", s.name, why)
|
||||
@@ -135,11 +135,11 @@ func TestBackupTargetViewIsNilWhenNothingShouldRender(t *testing.T) {
|
||||
healthy := absentHarness(t, "felhom-backup", []agentapi.DiskInfo{{
|
||||
MountPath: "/mnt/mentes2", GuestPath: "/mnt/felhom-drives/mentes2", Role: "user-data", BackupTarget: true,
|
||||
}}, "")
|
||||
if v := healthy.backupTargetView(context.Background()); v != nil {
|
||||
if v := healthy.backupTargetView(context.Background(), "hu"); v != nil {
|
||||
t.Errorf("healthy returned a non-nil view %+v — nil is what makes the template render nothing", v)
|
||||
}
|
||||
unknown := testServer(t)
|
||||
if v := unknown.backupTargetView(context.Background()); v != nil {
|
||||
if v := unknown.backupTargetView(context.Background(), "hu"); v != nil {
|
||||
t.Errorf("unknown returned a non-nil view %+v", v)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user