no union reader consults the peers freshness marker, and the marker cannot yet say how stale the peers are
Id: TD-PPagop-26082515 · Status: resolved · Filed: 2026-08-25 · Resolved: 2026-09-19 · Ref: https://github.com/Pullwright/agent-ops/pull/1692
Severity: Medium
Noticed while reviewing PR #795 (agent-ops#693), which introduced the marker.
state-sync.sh fetch now writes <peers_dir>/.last-fetch.json
(fleet_mark_peers/fleet_peers_marker, lib/fleet.sh; implementation
spec 2.5), so a real fetch failure — dead credentials, a network outage, a
corrupt mirror — leaves the peers directory visibly marked stale instead of
looking exactly as fresh as one a successful fetch just materialised. That
closes the silent half of #693: the failure is now logged and returns
non-zero, and the frozen state is now labelled.
Nothing reads the label. The four union readers implementation spec 2.5
names — the blocked and void extractions (requirements 34/34c), the no-op
fingerprint (3b), the usage-limit cooldown (2.1) — and the fleet dashboard
all still consume fleet_logs’ merged stream with no idea whether the peer
copies underneath it are current or frozen from three days ago. #693’s own
scope was deliberately the marker existing so that they can tell, not each
reader’s response to it, so this is expected deferral rather than a miss —
but until it is done the marker is write-only, and the consequence #693
opens with (readers silently consuming frozen peer state) is unchanged for
every one of them.
Two things want settling as part of that wiring, because they are decisions about the marker rather than about any one reader:
- The marker records the time of the last fetch attempt, not of the last
successful fetch. A failure writes
{"ok": false, "ts": <now>}, which overwrites the only record of when the peer trees below it were last actually current. So a reader can tell frozen from fresh, but not a five-minute outage from a three-day one — and “how stale” is exactly what a reader has to know to decide whether to degrade (drop peers from the union, widen a cooldown, badge the dashboard) or carry on. #693’s own wording asked for “a marker file recording the last successful fetch time”; what shipped satisfies its acceptance criterion by a different route, and the gap only bites once something reads it. Deriving the answer from the peer directories’ own mtimes is the re-derivationlib/fleet.sh’s comment says the marker exists to spare a reader. - The marker is rewritten on every attempt, including every failed one, and
it lives inside the peers directory that
publish-dashboard.sh’slocal_state_fingerprinthashes (dashboard spec, requirement 3b). During a prolonged outage that moves a fingerprinted path on the fetch cadence, so an otherwise-idle node rebuilds the dashboard once per fetch attempt rather than skipping — mild, and on the safe side of the fingerprint’s own stated failure direction (“a needless rebuild, never a stale page”), but it is the churn #793 had just removed. Recording the last successful fetch time would settle this one too: the marker would stop moving once the outage set in.
Suggested fix: decide the marker’s schema first (at minimum a last-successful timestamp that a failure preserves rather than overwrites), then give each of the readers in spec 2.5 an explicit answer to a stale peers directory — which may legitimately be “carry on regardless” for some of them, as long as the choice is written down rather than left as today’s silence.
References to update when resolved: lib/fleet.sh
(fleet_peers_marker/fleet_mark_peers header comment),
docs/IMPLEMENTATION-PIPELINE-SPEC.md requirement 2.5.
Related: #602 (the publish-side counterpart — a node that cannot publish is not fresh either), #604 (repairing a corrupt mirror), #691 (the same 401-as-outage conflation on the claim path).
Migrated to https://github.com/Poetic-Poems/agent-ops/issues/990.