v0.253.0 — errors carry the key of the sentence they are (R-557 slice 2 release B)
gates / gates (push) Successful in 24s
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:
@@ -20,22 +20,22 @@ import (
|
||||
var slice4T0 = time.Date(2026, 9, 13, 10, 0, 0, 0, time.UTC)
|
||||
|
||||
type fakeGuards struct {
|
||||
mu sync.Mutex
|
||||
calls []string
|
||||
held bool
|
||||
holdWhy string
|
||||
busy bool
|
||||
mu sync.Mutex
|
||||
calls []string
|
||||
held bool
|
||||
holdWhy string
|
||||
busy bool
|
||||
// points are the copies the backup side holds, in tier order (R-475); pointsAfterBackup replaces
|
||||
// them when BackupNow succeeds (nil = the backup changed nothing).
|
||||
points []UpdateRestorePoint
|
||||
pointsAfterBackup []UpdateRestorePoint
|
||||
cannotBackUp bool
|
||||
backupErr error
|
||||
dumpErr error
|
||||
holdErr error
|
||||
holdRP UpdateRestorePoint
|
||||
pinAtDump string
|
||||
stackDir string
|
||||
backupErr error
|
||||
dumpErr error
|
||||
holdErr error
|
||||
holdRP UpdateRestorePoint
|
||||
pinAtDump string
|
||||
stackDir string
|
||||
}
|
||||
|
||||
func (f *fakeGuards) note(c string) { f.mu.Lock(); f.calls = append(f.calls, c); f.mu.Unlock() }
|
||||
@@ -129,7 +129,7 @@ func newSlice4Manager(t *testing.T) (*Manager, string, *fakeGuards, *composeRec)
|
||||
m.updateGuards = g
|
||||
m.updateComposeFn = c.fn
|
||||
m.updateHealthFn = func(context.Context, string, time.Duration) (bool, string) { return true, "fake healthy" }
|
||||
m.updateMemoryFn = func(int, int, int, int) (string, string) { return "", "" }
|
||||
m.updateMemoryFn = func(int, int, int, int) (error, string) { return nil, "" }
|
||||
m.updateDiskFreeFn = func() (float64, bool) { return 50, true }
|
||||
m.updateNowFn = func() time.Time { return slice4T0 } // R-457: the SAME clock the age check reads
|
||||
m.execFn = func(string, ...string) (string, error) { return "", nil }
|
||||
@@ -338,8 +338,8 @@ func TestSlice4_D_CheapRefusals(t *testing.T) {
|
||||
if err := os.WriteFile(filepath.Join(catDir, ".felhom.yml"), []byte("resources:\n mem_request: 900M\n"), 0o644); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
m.updateMemoryFn = func(newReq, _, _, _ int) (string, string) {
|
||||
return fmt.Sprintf("Nincs elég memória (%d MB)", newReq), ""
|
||||
m.updateMemoryFn = func(newReq, _, _, _ int) (error, string) {
|
||||
return fmt.Errorf("Nincs elég memória (%d MB)", newReq), ""
|
||||
}
|
||||
}, "memory", "Nincs elég memória (900 MB)"},
|
||||
{"disk", func(m *Manager, _ *fakeGuards, _ string) {
|
||||
|
||||
Reference in New Issue
Block a user