Iter 34 — adds an optional `staleness_ms` field to the iter-23
NodeSyncSnapshot that exposes (Instant::now() - latest_sync_at).
Dashboards / Prometheus exporters / UI badges can now decay sync
freshness without re-deriving it from latest_sync_at on the host.
Wire compatibility: new field is `#[serde(skip_serializing_if =
"Option::is_none")]` so pre-iter-34 clients that strict-parse via
serde + deny_unknown_fields are unaffected (default serde_json
strategy is to ignore unknown fields anyway).
Sensing-server changes:
+ NodeSyncSnapshot.staleness_ms: Option<u64>
+ sync_snapshot() populates it via latest_sync_at.elapsed().as_millis()
+ iter-24 serialization tests now check 8 contract fields, not 7
+ new test `snapshot_staleness_ms_tracks_apply_time` pins
latest_sync_at to a past Instant and asserts the snapshot reports
~750 ms staleness with ±500 ms tolerance for scheduler delay
User-guide updates:
+ REST/WebSocket field table grows a `staleness_ms` row with the
UI-rendering thresholds (fade at 5 s, drop at 9 s to match the
firmware's VALID_WINDOW_MS-derived gate).
Tests passing:
sync_snapshot_helper_tests: 7/7
node_sync_snapshot_serialization_tests: 3/3 (8-field assertion green)
Co-Authored-By: claude-flow <ruv@ruv.net>
|
||
|---|---|---|
| .. | ||
| .claude-flow | ||
| crates | ||
| data | ||
| docs | ||
| examples | ||
| patches/ruvector-crv | ||
| Cargo.lock | ||
| Cargo.toml | ||
| rust-toolchain.toml | ||