Review fix 5: the box sends its end records only to a hub that says it reads them (version skew)
gates / gates (push) Successful in 32s

A new box with an older hub sent `ended` in the window request; that hub reads
4 KiB of it, decided the window on a wrong count, and the weekly clean-up
stalled.

- The box sends `ended` only when the hub's last window answer said
  accepts_ended (kept in settings, re-read from every answer, so a rolled-back
  hub stops getting them after one answer). Otherwise the request is the one
  every hub always got, and the ordinary clean-up runs.
- One request carries at most 5000 snapshot ids.

Tests seen red before the fix; 6 mutations seen red (felhom.eu
documentation/audits/build-release-4-2026-11-15/A/redproof-review-5.txt).

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 15:05:38 +01:00
1 parent c7e4ec9b5e
commit c5acb91a44
10 files changed
+179 -5

No files matched your search

+3 -1
View File
@@ -146,11 +146,13 @@ func (c HubWindowClient) Open(ctx context.Context, countBefore int, ended []back
Reason string `json:"reason"`
EndedAllowed []string `json:"ended_allowed"`
EndedRefused []backup.OffsiteEndedRefusal `json:"ended_refused"`
// AcceptsEnded: this hub reads `ended` (in every answer of a hub that does, granted or not).
AcceptsEnded bool `json:"accepts_ended"`
}
if err := json.Unmarshal(raw, &r); err != nil {
return backup.OffsiteWindow{}, fmt.Errorf("hub window-open: malformed response")
}
w := backup.OffsiteWindow{Granted: r.Granted, ID: r.WindowID, MaxRemove: r.MaxRemove, Reason: r.Reason}
w := backup.OffsiteWindow{Granted: r.Granted, ID: r.WindowID, MaxRemove: r.MaxRemove, Reason: r.Reason, AcceptsEnded: r.AcceptsEnded}
if r.Granted {
t, perr := time.Parse(time.RFC3339, r.NewestAllowed)
if perr != nil {