Repository navigation
Preserve Ping Scores records and archived paths - #309
Conversation
Review — CS-MacBook PR#309 — head 8262c61Dom: APPROVE with nits Independent read-only review of the merged tree ( Findings
No correctness, privacy, scope, or read-only defects found. Answers to the brief
Tests run (all green, merged tree vs origin/master 22589f0)
Mutants (mine)
Not verified
Overall: a tightly-scoped, exceptionally well-tested change. Read-only, privacy, downgrade, bounds, and scope invariants all hold under code review, the suites, three of my own mutants, and live runs. The two nits are cosmetic and non-blocking. |
Summary
Keep historical Ping Scores distance records intact when the original GPS evidence disappears, and save map geometry for the current All-Time and This Week record cards so their View path can survive packet retention and a server restart.
Previously, a deep history sweep could replace a saved distance with a smaller value or no distance when the original endpoints no longer had GPS. Separately, View path depended entirely on retained raw packet observations, even though the record itself lived in the history sidecar.
Changes
GET /api/ping-scores/{hash}/path?record=<slot>. Prefer the saved snapshot; require metric-coherent evidence before using a live fallback. Reapply current identity visibility rules to a copy of an archive and fail closed if current-name lookup fails.Performance and bounds
The archive cache is bounded to ten slots. Each serialized snapshot is limited to 256 KiB, 128 branches and 4,096 points; oversized snapshots are not truncated into misleading paths. Existing cycle path results are reused, with at most one additional bulk lookup for the distinct missing record hashes, not one query per record.
A representative 20-branch capture benchmark on macOS arm64 / Apple M5 measured approximately 0.266 ms/op, 118,934 B/op and 915 allocations/op. This is a local measurement, not a worst-case latency guarantee or a speedup claim.
Verification
Fresh local verification on macOS arm64, Go 1.26.3:
cmd/serverandcmd/ingestorGo suites: pass.-race: pass;go vet ./...in the server module: pass.sh test-all.sh: 222 test files passed, zero failed.The browser matrix is a local disposable probe, not a newly registered GitHub Actions E2E suite. Existing registered frontend tests were extended. GitHub Actions/Linux results are separate and are not claimed by these local runs.
Scope and limitations