pingqiu 4a38e5cbce G5-5C #1: probe loop skeleton + lifecycle tests
First production batch for the G5-5C primary-side degraded-peer probe
loop, per the architect-bound mini-plan v0.5 §1.A binding (Option B,
core/replication/ ownership) and §1.H audit-PASS verdict at
seaweedfs@9245446b5.

Files:
- core/replication/probe_loop.go (new): ProbeLoop struct with config
  + start/stop lifecycle (sync.Once on both); per-iteration tick that
  snapshots peers via PeerSourceFn, gates each via CooldownFn,
  dispatches via ProbeFn; CP4B-2 lessons applied (zero-interval
  rejected at construction; stop-before-start no deadlock; callback
  panic isolated via recover).
- core/replication/probe_loop_test.go (new): seven lifecycle tests
  covering Start/Stop happy path, stop-before-start, idempotent
  concurrent stop, zero-interval rejection, callback panic isolation,
  cooldownFn gating, empty peer set, and probeFn-error-doesn't-stop.

Design:
- ProbeLoop is runtime/wiring only. No engine FSM, no transport.
- Seams (PeerSourceFn / ProbeFn / CooldownFn) injected by host so
  the loop knows nothing about adapter, executor, or engine.
- Default config: Interval 5s, MaxConcurrent 1, CooldownBase 5s,
  CooldownCap 60s — architect-bound G5-5C v0.5 §1.A shape.
- Authority-bound (§1.E): peersFn snapshots ReplicationVolume.peers
  under lock; loop never enumerates network-discoverable addresses.
- All G5-5C INVs map cleanly to existing engine/replication state per
  the §1.H audit; this skeleton adds NO recovery substrate.

Tests verified:
- go test ./core/replication/ -run TestProbeLoop -count=1: PASS (7/7)
- go test ./core/replication/ -count=1: PASS (no regression on
  existing T4a-5/T4b/T4c suites)

Next batch (G5-5C #2): peer.go::ProbeIfDegraded() + cooldown
state-machine + in-flight guard tests.
2026-04-27 15:37:06 -07:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%