gunk-dev/the-valley
the-valley:bd-face163bugclosed

valley checks --build stops with 'telemetry lost records' seconds after it starts, with nothing built

State
done
Created
2026-11-15 by contributor
Changes
  • valley:the-valley/wuysourxxtxyyykwlmtzmrokxprzxppq

Body

Second trial of `valley checks --build` from an agent (client 273a801, a slot free): it stopped twice after 10 to 20 seconds with "not established · telemetry lost records" and no check built. The worker's stream drops records by design when two are emitted at the same moment, so a busy worker's stream has gaps, and the command treats a gap as the end of what it can establish.

Evidence refs are the authority for a pass; the follow is the wake. A gap in the wake should cause a reread of evidence and the wait should go on, with the printed worker records marked as possibly incomplete. Find where a gap ends the wait (`status/checkbuild.go`, the follow and `wake`), confirm the cause on a busy worker, and fix.

Comments

  1. contributor2026-11-15 15:48 UTC
    Independent review of d5c0832 (run 20261115-1524-b331e644, 20 min, $4.62; this branch's checks --build passed 16 checks on the real worker in 3m22s and 2m22s with gaps in the stream). NOT READY, no false-pass path: a pass end from another worker sharing the stream can end the wait; gap-triggered rereads are unbounded under staggered gaps; docs overstate recovery (a lost record of a failure leaves the wait running to its limit). Fix round launched.
    
    Keeping evidence as the sole authority for passing makes recovery from telemetry loss sound. Labelling surviving worker records as potentially incomplete correctly limits what users can infer from them.
    
    NOT READY. Static review of d5c0832 against 273a801; no tests run. Locations below are on the new side.
    
    status/checkbuild.go:708 — A pass end proves only that its own batches stopped. Two workers can use different --state directories while sharing --telemetry; their state locks do not serialize them. If worker A has emitted batch.start for this request’s tree, and worker B starts after filing, handles another project, and ends, B now terminates the wait while A is building. The command reports “not established” and deletes the request, potentially causing A to cancel it. The removed running check prevented this specific case. Ordinary restarts sharing the state directory remain protected by the inherited lock.
    
    status/checkbuild.go:654 — An empty channel is not a bound on rereads. If gap-bearing records arrive separately, with the channel empty after each delivery, every record triggers a complete evidence read regardless of readEvery. Sustained emitter contention can therefore cause repeated tree digests and origin reads throughout the wait, even for gaps from unrelated projects. Buffered bursts coalesce, but continuous or staggered gaps do not. The parent bounds elapsed time; it does not prevent this reread storm.
    
    docs/architecture.md:1485 — “A missed wake-up costs only minutes” overstates recovery. If a gap consumes the failed batch’s end and its pass.end, subsequent evidence reads remain incomplete and cannot establish that waiting should stop. Without another qualifying terminal record, the command waits until --wait, default two hours. The updated documentation does not state this distinction between recovering passing evidence and recovering a terminal failure.
    
    I found no new false-PASSED path: success still requires a complete evidence read. The same-binary “lost” pipe message only sets the diagnostic flag; malformed variants do not become passed or settled.
    
    The single most valuable change is to enforce one worker state directory per exported worker stream before treating any qualifying pass.end as sufficient to stop waiting.
  2. contributor2026-11-15 16:05 UTC
    Recheck of 2a06dad (run 20261115-1548-4862c12f, 14 min, $7.47 cumulative; branch's own checks --build passed 16 checks in 3m19s): all three findings closed, no wrong-pass path. Two small items sent back: a periodic read does not advance the gap throttle, so two reads per interval are possible against the documented bound; the two-worker early-end limit (same on main) is not stated in the docs. Noted for a later change: the worker keeps a failed request's ref and commit in its failures.json, which the client does not read; that is the durable sign a wait could use to end after a lost failure record.
  3. contributor2026-11-15 16:25 UTC
    Last round (run 20261115-1605-8381d03a, 20 min, $10.02 cumulative): any evidence read advances the gap throttle; the two-worker limit is stated. Branch's own checks --build passed 16 checks in 2m21s. Coordinator read the round's code and marked 1a4826b ready. Whole change: 5 files +312/-74; two independent passes.
  4. contributor2026-11-15 20:53 UTC
    Change valley:the-valley/wuysourxxtxyyykwlmtzmrokxprzxppq landed: v5 as 937924e2f63e9493016cf313fa508235c55f421a.
    
    Every change the knot links has landed and it has no active children, so klaus set it closed.