c00fed6db3
Every Hungarian sentence is byte-identical; each decision now reads a signal set where the message is
made. util.KindErrorf builds the same bytes fmt.Errorf did while carrying a sentinel for errors.Is.
- Deploy status (api/router.go): deployStatusFor() by kind — stacks.ErrAlreadyDeployed (409),
ErrRequiredField / ErrPathMissing / ErrNotEnoughMemory (400). The „kötelező" / „memória" /
"does not exist" / "already deployed" text chain is gone.
- Off-site failure class (backup/offbox.go): ErrOffsiteQuota replaces the „tárhelykeretet" match. The
restic/ssh signatures stay text matches on purpose — that output is not ours and is not translated.
- Alert placement (web/alerts.go): monitor.HealthReport carries WarningKinds parallel to Warnings;
the "not on a separate drive" warning is inline by KIND. The hub report is untouched (builder.go
copies Status/Issues/Warnings only) — pinned by a wire test.
- Stale off-site note (web/handlers.go): settings LastWarningKind + backup.OffboxWarnNoAppsSelected.
The text test survives ONLY for kind == "" (a box whose last run predates 0.251.0) and is removed
when R-570 closes; slice 2 must not translate that producer before then.
Tests (all red-proofed by restoring the pre-fix predicate — see the audit's redproofs.txt):
TestR553_Deploy_DecisionSurvivesWordingChange, TestR553_DeployHandlerUsesTheKind,
TestR553_DeployProducersCarryKindAndKeepTheirWords (through the real DeployStack),
TestR553_OffsiteQuota_{Decision,HeadLine}SurvivesWordingChange, TestR553_OffboxRunRecordsTheKind,
TestR553_StorageWarningsCarryKindsAndKeepTheirWords, TestR553_DiskWarningPlacementSurvivesWordingChange,
TestR553_HubReportWarningsAreUnchangedOnTheWire, TestR553_StaleNote*, TestR553_WarningKindIsPersistedAndCopied.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
22 lines
1.1 KiB
Go
22 lines
1.1 KiB
Go
package stacks
|
|
|
|
import "errors"
|
|
|
|
// R-553 — the deploy path's refusals carry a KIND, so the API can pick its status code without
|
|
// reading the customer's Hungarian sentence. The sentences themselves are unchanged (a test pins
|
|
// each one byte-for-byte); `internal/util.KindErrorf` builds the message exactly as fmt.Errorf did.
|
|
//
|
|
// Before this, internal/api/router.go matched „kötelező", „memória", "does not exist" and
|
|
// "already deployed" in the error text — so localisation slice 2 would have turned every validation
|
|
// refusal into a 500.
|
|
var (
|
|
// ErrAlreadyDeployed — the stack is already deployed (API: 409).
|
|
ErrAlreadyDeployed = errors.New("stack already deployed")
|
|
// ErrRequiredField — a required (or password) field was left empty (API: 400).
|
|
ErrRequiredField = errors.New("required field empty")
|
|
// ErrPathMissing — a path field names something that is not on the filesystem (API: 400).
|
|
ErrPathMissing = errors.New("path field does not exist")
|
|
// ErrNotEnoughMemory — the memory verdict refused the deploy (API: 400).
|
|
ErrNotEnoughMemory = errors.New("not enough memory")
|
|
)
|