v0.253.0 — errors carry the key of the sentence they are (R-557 slice 2 release B)
gates / gates (push) Successful in 24s

179 Hungarian sentences were built deep inside a package with fmt.Errorf and printed by
whoever caught them: too late to translate where they are shown, too early where they are
made. Every one now carries its key across that gap. ZERO Hungarian error literals remain.

util.MsgError does three things at once, each earned:
  - Error() is the Hungarian, byte for byte, so every un-converted printer is unchanged;
  - errors.Is answers for the kind AND for a wrapped cause (KindErrorf dropped the cause);
  - an error ARGUMENT renders recursively, so "formázás sikertelen: %w" translates whole.
A foreign error — restic, docker, ssh, the stdlib — prints verbatim. It is not ours.

76 display sites go through errText, and TestNoErrErrorInPageOutput convicts any that do
not. memoryVerdict returns an error rather than a sentence, so the deploy's 409 and the
household's language come from one value; UpdateRefusal gained a Cause to carry it.

Plurals, one rule, stated once: a key with .one/.other takes its COUNT first. Not a
per-call-site flag — the producer somebody forgot would read "3 app is not running". The
guard caught a real key collision (alert.deadapp.one) the day the rule landed.

TWO DEFECTS FOUND IN MY OWN TOOLING, recorded rather than quietly fixed. The bulk converter
silently dropped multi-line concatenations, damaging 7 producers — and the parity gate could
not see it, because every surviving fragment WAS a real base literal while the CALL had lost
text; two behaviour tests caught it. And the counting script was case-sensitive, so it said
"0 left" while five remained.

MinAgent: 0.131.0 (unchanged). No hub release needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-09-18 11:44:30 +02:00
parent 5270bad76e
commit 7c05b59708
70 changed files with 1853 additions and 377 deletions
+11 -10
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"gitea.dooplex.hu/admin/felhom-controller/internal/util"
"os"
"path/filepath"
"time"
@@ -312,7 +313,7 @@ func (m *Manager) UpdateBusy(stackName string) (bool, string) {
// ErrUpdateBackupNoUnit is returned when a "back up first" run completed but the app still has no
// openable Tier-2 unit — typically Tier 2 is switched off for the app or has no second target.
var ErrUpdateBackupNoUnit = errors.New("a frissítés előtti mentés lefutott, de nem jött létre visszaállítható másolat")
var ErrUpdateBackupNoUnit = util.MsgError("err.backup.a_frissites_elotti_mentes_lefutott_de")
// RunAppBackupNow runs THIS app's backup legs now, in the nightly order, and then its Tier-2 copy:
// database dump(s) → volume dump (if the app has named volumes) → recovery-unit capture → Tier-2
@@ -327,7 +328,7 @@ func (m *Manager) RunAppBackupNow(ctx context.Context, stackName string) error {
return fmt.Errorf("stack provider not configured")
}
if m.migrationActive() {
return fmt.Errorf("adatáthelyezés folyamatban — a mentés most nem indítható")
return util.MsgError("err.backup.adatathelyezes_folyamatban_a_mentes_most_nem")
}
if err := m.acquireRunning(); err != nil {
return err
@@ -341,13 +342,13 @@ func (m *Manager) RunAppBackupNow(ctx context.Context, stackName string) error {
drivePath := m.GetAppDrivePath(stackName)
if drivePath == "" || !filepath.IsAbs(drivePath) {
return fmt.Errorf("az alkalmazás meghajtója nem határozható meg")
return util.MsgError("err.backup.az_alkalmazas_meghajtoja_nem_hatarozhato_meg")
}
if m.settings != nil && (m.settings.IsDisconnected(drivePath) || m.settings.IsDecommissioned(drivePath)) {
return fmt.Errorf("az alkalmazás meghajtója nem elérhető (%s)", drivePath)
return util.MsgError("err.backup.az_alkalmazas_meghajtoja_nem_elerheto", drivePath)
}
if !m.admitApp(stackName) {
return fmt.Errorf("nincs elég szabad hely a mentéshez a(z) %s meghajtón", drivePath)
return util.MsgError("err.backup.nincs_eleg_szabad_hely_a_menteshez", drivePath)
}
nsRoot = m.namespaceRoot(drivePath)
@@ -359,7 +360,7 @@ func (m *Manager) RunAppBackupNow(ctx context.Context, stackName string) error {
}
dbs, err := discover(ctx)
if err != nil {
return fmt.Errorf("adatbázis-felderítés sikertelen: %w", err)
return util.MsgError("err.backup.adatbazis_felderites_sikertelen", err)
}
dumped := 0
for _, db := range dbs {
@@ -368,7 +369,7 @@ func (m *Manager) RunAppBackupNow(ctx context.Context, stackName string) error {
}
res := DumpOne(ctx, db, AppDBDumpPath(nsRoot, stackName), m.logger, m.isDebug())
if res.Error != nil {
return fmt.Errorf("adatbázis-mentés sikertelen (%s): %w", db.ContainerName, res.Error)
return util.MsgError("err.backup.adatbazis_mentes_sikertelen", db.ContainerName, res.Error)
}
dumped++
m.logger.Printf("[INFO] [backup] update pre-backup for %s: database dump OK (%s, %s)", stackName, db.ContainerName, humanizeBytes(res.Size))
@@ -380,13 +381,13 @@ func (m *Manager) RunAppBackupNow(ctx context.Context, stackName string) error {
dump = m.DumpAppVolumesSafe
}
if err := dump(stackName); err != nil {
return fmt.Errorf("kötetmentés sikertelen: %w", err)
return util.MsgError("err.backup.kotetmentes_sikertelen", err)
}
m.logger.Printf("[INFO] [backup] update pre-backup for %s: volume dump OK", stackName)
}
if err := m.CaptureRecoveryUnit(stackName); err != nil {
return fmt.Errorf("a mentési egység rögzítése sikertelen: %w", err)
return util.MsgError("err.backup.a_mentesi_egyseg_rogzitese_sikertelen", err)
}
m.logger.Printf("[INFO] [backup] update pre-backup for %s: recovery unit captured (%d database dump(s))", stackName, dumped)
return nil
@@ -437,7 +438,7 @@ func (m *Manager) updatePreBackupTail(stackName, nsRoot string, now time.Time) {
func (m *Manager) WriteUpdateSafetyDump(ctx context.Context, stackName string) ([]string, error) {
nsRoot := m.AppNamespaceRoot(stackName)
if nsRoot == "" {
return nil, fmt.Errorf("az alkalmazás mentési helye nem határozható meg")
return nil, util.MsgError("err.backup.az_alkalmazas_mentesi_helye_nem_hatarozhato")
}
set, err := m.writeSafetyDump(ctx, stackName, nsRoot)
if err != nil {