v0.252.0 — the sentences the program builds follow the language (R-557 slice 2 release A)
gates / gates (push) Successful in 23s
gates / gates (push) Successful in 23s
Slice 1 translated the dashboard's markup. The sentences the program BUILDS were still Hungarian literals in Go, so an English household clicked an English button and was answered in Hungarian. 226 of them move into the bundle here. A flash was the hard part: it travels inside the redirect URL and is rendered by a DIFFERENT request, so it now carries a bundle key plus its parameters. A link minted by an older controller carries prose and is shown verbatim — never a raw key, never dropped. Also converted: page data and view-model text, the internal/api JSON answers, the alert banners (Alert.MessageKey, rendered on the way out of GetAlerts), 237 country names at display, and the four page titles built around an app name (R-566 closed). Hungarian is byte-identical, and that is measured rather than read: scripts/i18n_go_parity.py freezes every Go literal at the base commit (7 467) and refuses a key whose Hungarian is not that text, byte for byte. Three decoys, each seen to convict. Its own first version filtered the capture through an ASCII-Hungarian word list and missed seven real literals — the R-565 class. The filter is gone. Nothing on the wire moved, and wire goldens now hold it there: the report's health warnings and every notify event message stay Hungarian, because the hub MAILS the controller's sentence when it has no entry of its own. Slice 3 (R-558) owns those. 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:
@@ -420,7 +420,7 @@ func (s *Server) handleStorageMigrate(w http.ResponseWriter, r *http.Request) {
|
||||
Target string `json:"target"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
if s.refuseNetworkLifecycle(w, strings.TrimSpace(req.Source)) || s.refuseNetworkLifecycle(w, strings.TrimSpace(req.Target)) {
|
||||
@@ -441,7 +441,7 @@ func (s *Server) handleStorageMigrateApp(w http.ResponseWriter, r *http.Request)
|
||||
Target string `json:"target"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
// R-108: the TARGET may not be network storage. Its whole-namespace sibling
|
||||
@@ -477,12 +477,12 @@ func (s *Server) handleStorageDecommission(w http.ResponseWriter, r *http.Reques
|
||||
MountName string `json:"mount_name"` // type-to-confirm for mode=anyway
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
req.Where = path.Clean(strings.TrimSpace(req.Where))
|
||||
if req.Where == "" || req.Where == "." || !strings.HasPrefix(req.Where, "/mnt/") {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen csatlakoztatási pont", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_mountpoint"), nil)
|
||||
return
|
||||
}
|
||||
if s.refuseNetworkLifecycle(w, req.Where) {
|
||||
@@ -492,7 +492,7 @@ func (s *Server) handleStorageDecommission(w http.ResponseWriter, r *http.Reques
|
||||
switch req.Mode {
|
||||
case "migrate":
|
||||
if strings.TrimSpace(req.Target) == "" {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "céltároló kötelező az áthelyezéshez", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.target_required"), nil)
|
||||
return
|
||||
}
|
||||
// R-108: the refuseNetworkLifecycle above guards `req.Where` — the SOURCE. The TARGET was
|
||||
@@ -515,7 +515,7 @@ func (s *Server) handleStorageDecommission(w http.ResponseWriter, r *http.Reques
|
||||
case "anyway":
|
||||
// Type-to-confirm: the typed name must match the mount basename exactly (mirrors wipe).
|
||||
if strings.TrimSpace(req.MountName) != path.Base(req.Where) {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "a beírt név nem egyezik a csatlakoztatási névvel", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.name_mismatch"), nil)
|
||||
return
|
||||
}
|
||||
// Stop the apps that live on this drive — but KEEP their HDD_PATH so the dashboard can name the
|
||||
@@ -545,7 +545,7 @@ func (s *Server) handleStorageDecommission(w http.ResponseWriter, r *http.Reques
|
||||
writeDiskJSON(w, http.StatusOK, true, "", map[string]any{"decommissioned": true, "where": req.Where, "stopped_apps": stopped})
|
||||
|
||||
default:
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "ismeretlen mód (migrate vagy anyway)", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.unknown_mode"), nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,7 +624,7 @@ type storageProvReq struct {
|
||||
func (s *Server) handleStorageInit(w http.ResponseWriter, r *http.Request) {
|
||||
var req storageProvReq
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
where, err := mountWhere(req.MountName)
|
||||
@@ -633,7 +633,7 @@ func (s *Server) handleStorageInit(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if req.Device == "" {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "eszköz kötelező", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.device_required"), nil)
|
||||
return
|
||||
}
|
||||
agent, err := s.agentClient()
|
||||
@@ -649,7 +649,7 @@ func (s *Server) handleStorageInit(w http.ResponseWriter, r *http.Request) {
|
||||
setDefault: req.SetDefault, confirmed: req.Confirmed, durableID: req.DurableID,
|
||||
})
|
||||
if !started {
|
||||
writeDiskJSON(w, http.StatusConflict, false, "már folyamatban van egy meghajtó-inicializálás", nil)
|
||||
writeDiskJSON(w, http.StatusConflict, false, s.msg(r, "disk.err.init_in_progress"), nil)
|
||||
return
|
||||
}
|
||||
writeDiskJSON(w, http.StatusOK, true, "", map[string]any{"started": true, "phase": storageInitPhaseFormatting})
|
||||
@@ -675,7 +675,7 @@ func (s *Server) handleStorageInitStatus(w http.ResponseWriter, r *http.Request)
|
||||
func (s *Server) handleStorageImpact(w http.ResponseWriter, r *http.Request) {
|
||||
where := path.Clean(strings.TrimSpace(r.URL.Query().Get("where")))
|
||||
if where == "" || where == "." || !strings.HasPrefix(where, "/mnt/") {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen csatlakoztatási pont", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_mountpoint"), nil)
|
||||
return
|
||||
}
|
||||
apps := s.appsUsingPath(where)
|
||||
@@ -734,16 +734,16 @@ func (s *Server) handleStorageWipe(w http.ResponseWriter, r *http.Request) {
|
||||
FSType string `json:"fstype"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
if req.Device == "" {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "eszköz kötelező", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.device_required"), nil)
|
||||
return
|
||||
}
|
||||
req.Where = path.Clean(strings.TrimSpace(req.Where))
|
||||
if req.Where == "" || req.Where == "." || !strings.HasPrefix(req.Where, "/mnt/") {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen csatlakoztatási pont", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_mountpoint"), nil)
|
||||
return
|
||||
}
|
||||
if s.refuseNetworkLifecycle(w, req.Where) {
|
||||
@@ -751,7 +751,7 @@ func (s *Server) handleStorageWipe(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
// Server-side type-to-confirm: the typed name must match the mount's basename exactly.
|
||||
if strings.TrimSpace(req.MountName) != path.Base(req.Where) {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "a beírt név nem egyezik a csatlakoztatási névvel", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.name_mismatch"), nil)
|
||||
return
|
||||
}
|
||||
fstype := req.FSType
|
||||
@@ -778,12 +778,12 @@ func (s *Server) handleStorageWipe(w http.ResponseWriter, r *http.Request) {
|
||||
// re-classifies the role — a protected device is refused here even though we send confirmed:true.
|
||||
probe, perr := agent.FormatDisk(r.Context(), req.Device, fstype, false, "")
|
||||
if errors.Is(perr, agentapi.ErrFormatRefused) {
|
||||
writeDiskJSON(w, http.StatusConflict, false, "a meghajtó védett (rendszer/biztonsági mentés) — törlés csak operátori aláírással", probe)
|
||||
writeDiskJSON(w, http.StatusConflict, false, s.msg(r, "disk.err.protected"), probe)
|
||||
return
|
||||
}
|
||||
if !errors.Is(perr, agentapi.ErrNeedsConfirmation) {
|
||||
if perr != nil {
|
||||
writeDiskJSON(w, http.StatusBadGateway, false, "törlés sikertelen: "+perr.Error(), nil)
|
||||
writeDiskJSON(w, http.StatusBadGateway, false, s.msg(r, "disk.err.wipe_failed", perr.Error()), nil)
|
||||
return
|
||||
}
|
||||
// Already blank (no confirmation needed) — the format the agent just ran is the wipe.
|
||||
@@ -792,7 +792,7 @@ func (s *Server) handleStorageWipe(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
fr, ferr := agent.FormatDisk(r.Context(), req.Device, fstype, true, probe.DurableID)
|
||||
if ferr != nil {
|
||||
writeDiskJSON(w, http.StatusBadGateway, false, "törlés sikertelen: "+ferr.Error(), nil)
|
||||
writeDiskJSON(w, http.StatusBadGateway, false, s.msg(r, "disk.err.wipe_failed", ferr.Error()), nil)
|
||||
return
|
||||
}
|
||||
writeDiskJSON(w, http.StatusOK, true, "", map[string]any{"device": req.Device, "wiped": fr.Formatted, "durable_id": fr.DurableID})
|
||||
@@ -838,12 +838,12 @@ func (s *Server) handleStorageRegister(w http.ResponseWriter, r *http.Request) {
|
||||
SetDefault bool `json:"set_default"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
req.Where = path.Clean(strings.TrimSpace(req.Where))
|
||||
if req.Where == "" || req.Where == "." || !strings.HasPrefix(req.Where, "/mnt/") {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen csatlakoztatási pont", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_mountpoint"), nil)
|
||||
return
|
||||
}
|
||||
// req.Where is the RAW /mnt/<name> host mount the agent reports; in the intermediary model the drive
|
||||
@@ -888,7 +888,7 @@ func (s *Server) handleStorageRegisterMounted(w http.ResponseWriter, r *http.Req
|
||||
SetDefault bool `json:"set_default"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
want := path.Clean(strings.TrimSpace(req.Path))
|
||||
@@ -903,7 +903,7 @@ func (s *Server) handleStorageRegisterMounted(w http.ResponseWriter, r *http.Req
|
||||
if match == nil {
|
||||
// Names a reason the customer can act on, and a route — never a bare refusal.
|
||||
writeDiskJSON(w, http.StatusBadRequest, false,
|
||||
"Ez a meghajtó most nem csatolható — lehet, hogy már regisztrálva van, vagy időközben lecsatolódott. Frissítsd az oldalt, és nézd meg a Tárhely → Meghajtók listát.", nil)
|
||||
s.msg(r, "disk.err.attach_unavailable"), nil)
|
||||
return
|
||||
}
|
||||
if err := s.registerStoragePath(match.Path, req.Label, req.SetDefault); err != nil {
|
||||
@@ -918,7 +918,7 @@ func (s *Server) handleStorageRegisterMounted(w http.ResponseWriter, r *http.Req
|
||||
func (s *Server) handleStorageAttach(w http.ResponseWriter, r *http.Request) {
|
||||
var req storageProvReq
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
where, err := mountWhere(req.MountName)
|
||||
@@ -927,7 +927,7 @@ func (s *Server) handleStorageAttach(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if req.Device == "" {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "eszköz kötelező", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.device_required"), nil)
|
||||
return
|
||||
}
|
||||
agent, err := s.agentClient()
|
||||
@@ -950,12 +950,12 @@ func (s *Server) handleStorageEject(w http.ResponseWriter, r *http.Request) {
|
||||
Where string `json:"where"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen kérés", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_request"), nil)
|
||||
return
|
||||
}
|
||||
req.Where = path.Clean(strings.TrimSpace(req.Where))
|
||||
if req.Where == "" || req.Where == "." || !strings.HasPrefix(req.Where, "/mnt/") {
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, "érvénytelen csatlakoztatási pont", nil)
|
||||
writeDiskJSON(w, http.StatusBadRequest, false, s.msg(r, "disk.err.bad_mountpoint"), nil)
|
||||
return
|
||||
}
|
||||
if s.refuseNetworkLifecycle(w, req.Where) {
|
||||
|
||||
Reference in New Issue
Block a user