hub v0.155.0: the floor can never deliver a withdrawn controller build (R-1085); RomM/Ghost evidence
gates / gates (push) Successful in 6m44s
gates / gates (push) Successful in 6m44s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
920c1aaf84
commit
b17e9e993c
28 files changed
+955
-6
No files matched your search
@@ -320,6 +320,9 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
GlobalFloor string // global default (hub_settings → config/env)
|
||||
EffectiveFloor string // override else global ("" = no floor)
|
||||
BelowFloor bool // current < effective floor (would auto-update)
|
||||
// EffectiveFloorWithdrawn (R-1085) — why the effective floor is a withdrawn build, "" when it is not. The
|
||||
// box is served no floor then (store.ResolveManagedFloor); the page says so instead of „will auto-update".
|
||||
EffectiveFloorWithdrawn string
|
||||
|
||||
NotifPrefs *store.NotificationPrefs
|
||||
RecentNotifications []store.NotificationLogEntry
|
||||
@@ -500,6 +503,10 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
GlobalFloor: globalFloor,
|
||||
EffectiveFloor: effectiveFloor,
|
||||
BelowFloor: belowFloor,
|
||||
EffectiveFloorWithdrawn: func() string {
|
||||
r, _ := store.SpoiledControllerTag(effectiveFloor)
|
||||
return r
|
||||
}(),
|
||||
|
||||
NotifPrefs: notifPrefs,
|
||||
RecentNotifications: recentNotifs,
|
||||
@@ -1216,12 +1223,28 @@ func (s *Server) countBoxesBelowFloor(proposedGlobal string) int {
|
||||
// (GET /configuration/global-floor/impact?v=X.Y.Z). Read-only JSON; blank v = 0.
|
||||
func (s *Server) handleGlobalFloorImpact(w http.ResponseWriter, r *http.Request) {
|
||||
v, ok := normalizeFloorInput(r.URL.Query().Get("v"))
|
||||
_, spoiled := store.SpoiledControllerTag(v)
|
||||
if spoiled {
|
||||
ok = false // R-1085: a withdrawn build is not a floor the dialog may offer to confirm
|
||||
}
|
||||
count := 0
|
||||
if ok && v != "" {
|
||||
count = s.countBoxesBelowFloor(v)
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"version": v, "valid": ok, "below": count})
|
||||
_ = json.NewEncoder(w).Encode(map[string]any{"version": v, "valid": ok, "spoiled": spoiled, "below": count})
|
||||
}
|
||||
|
||||
// refuseSpoiledFloor is the input half of R-1085, shared by the two floor forms (NOT normalizeFloorInput, which
|
||||
// also validates agent and golden versions, whose numbering is their own): a withdrawn controller build is never
|
||||
// saved as a floor. It logs the refusal and reports whether the caller must stop. The serve-time half is
|
||||
// store.ResolveManagedFloor.
|
||||
func (s *Server) refuseSpoiledFloor(v, where string) bool {
|
||||
reason, spoiled := store.SpoiledControllerTag(v)
|
||||
if spoiled {
|
||||
s.logger.Printf("[WARN] %s floor %q REFUSED: a withdrawn controller build (%s) — nothing saved (R-1085)", where, v, reason)
|
||||
}
|
||||
return spoiled
|
||||
}
|
||||
|
||||
// handleSetGlobalFloor sets (or clears) the global controller-version floor (Phase 2 managed
|
||||
@@ -1236,6 +1259,10 @@ func (s *Server) handleSetGlobalFloor(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, "/configuration?flash=floor_invalid", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
if s.refuseSpoiledFloor(v, "global") {
|
||||
http.Redirect(w, r, "/configuration?flash=floor_spoiled", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
ma, flash := s.floorDeclaredMinAgent(r, v)
|
||||
if flash != "" {
|
||||
http.Redirect(w, r, "/configuration?flash="+flash, http.StatusSeeOther)
|
||||
@@ -1598,6 +1625,10 @@ func (s *Server) handleSetCustomerFloor(w http.ResponseWriter, r *http.Request,
|
||||
http.Redirect(w, r, "/customers/"+customerID+"?flash=floor_invalid", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
if s.refuseSpoiledFloor(v, "customer "+customerID) {
|
||||
http.Redirect(w, r, "/customers/"+customerID+"?flash=floor_spoiled", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
ma, flash := s.floorDeclaredMinAgent(r, v)
|
||||
if flash != "" {
|
||||
http.Redirect(w, r, "/customers/"+customerID+"?flash="+flash, http.StatusSeeOther)
|
||||
|
||||
Reference in new issue
Block a user