mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
aff28bc93676e6db775da355750794f96523f1ca
Adds the first calibration pass: five scenario families (C1-C5) that drive the accepted route and record expected-versus-observed evidence as machine-readable artifacts. ## Scenarios | ID | Family | What it proves | |---|---|---| | `CAL-C1-healthy-repeat` | C1 | Repeated probes on a caught-up replica do not trigger spurious recovery | | `CAL-C2-short-gap-catchup` | C2 | Short retained gap chooses catch-up; closes to healthy; data integrity preserved | | `CAL-C3-long-gap-rebuild` | C3 | Long gap beyond retained window chooses rebuild; closes to healthy; data integrity preserved | | `CAL-C4-terminal-close-only` | C4 | Healthy publication appears in the trace ONLY after `event: SessionClosedCompleted` (ordered check, not presence-only) | | `CAL-C5-order-stable` | C5 | Five same-replica delivery perturbations produce identical Decision, FinalMode, recoverySignature, and CloseEventCount | ## What changed - `core/calibration/` — new package - `result.go`, `harness.go`, `scenarios.go`, `report.go`, `scenarios_test.go` - `cmd/sparrow/calibrate.go` — wires `--calibrate` and `--calibrate --json` - `docs/calibration/scenario-map.md` and `divergence-log.md` — evidence templates seeded with the first-pass results - `README.md` and `docs/bootstrap-validation.md` — `--calibrate` advertised ## Evidence dimensions C5 compares across runs 1. `Decision` (derived from command path) 2. `FinalMode` 3. `recoverySignature` = (NCatchUp count, NRebuild count) 4. `CloseEventCount` (count of `SessionClosedCompleted` events in trace) 5. `DataIntegrityOK` Each has a distinct sentinel in the JSON artifact when it drifts. ## Tests - 14 calibration tests (5 per-scenario + 8 compare + 1 meta-test for the recovery-signature check) - Stable under `-count=10` stress - Full repo green
Languages
Go
84.5%
Rust
7.9%
Shell
2.7%
templ
1.6%
Java
1%
Other
2%