Files
archie/internal/app
sam a4e7bccaba docs(archied): correct the watch loop's claims and pin the boundaries
Three claims the reconnect loop records were false, and one boundary was
unpinned either way.

The claim that a store which "stalls until its read times out" is charged and
climbs the ladder described a timeout this code does not impose: nextUpdate
waits on the stream and the loop's context, and never on a clock, so a peer
that accepts the stream and then never answers it ends nothing here and is
charged by nothing here -- a probe held the read open for 2s with no retry
logged at all, and the attempt that finally ended was read as healthy. What
ends that stream is the transport's client keepalive on
internal/infrastructure/staterpc/dial.go (Time 10s, Timeout 5s), which the
watch rides because bootstrap takes its control-plane client off the
*staterpc.Client that dial returned. The comment now states that, names the
file, and states this loop's own boundary: it charges only attempts that END.

"The rule reaches every shape" was false for the shape it was argued from. The
window is derived from the delay the attempt would be charged (four times the
minimum at the minimum rung), so a stall at or past it -- 1s and 1.1s were
measured -- is read as a store that answered on every attempt and pins the
ladder at 250ms, against [250ms 500ms 1s 2s] at a 500ms stall. The comment now
says the reach stops at the window, and why that is deliberate rather than a
gap to close: the stalled attempt lasts the window, so those reopens are under
one a second against the four a second the rule exists to charge.
TestKeepWatchTreatsAStallPastTheWindowAsAStoreThatAnswered pins it, at a
five-minimum stall against the four-minimum window (widening the window past
the stall fails it).

The rule's sentence said "outlived a window", which the operator (>=) does not
mean, and a verification pass confirmed >= -> > survived the whole package. The
comparison stays inclusive and the sentence now says so: an attempt still open
when the window closes is a store that answered. The load-bearing inequality is
the other one -- the window is a strictly wider multiple of the charge, so a
store that fails as slowly as the charge is still charged -- and
TestAttemptHealthyAtTheWindowBoundary pins both edges at every rung: equal to
the window is healthy, a nanosecond inside it is charged.

TestKeepWatchChargesAnAttemptThatEndedWithNothing's window case now stands open
past the window rather than for exactly it: its sleep starts before the loop's
attempt does, so an attempt measured against it could be judged a hair early,
and the exact edge is pinned without a clock by the new unit test.

TestBothWatchStreamsRunThroughTheReconnectLoop asserted only that the name
keepWatch appeared, so a launch site handing the loop a wait of its own was
invisible -- the persona site's wait has no behavioural test at all. It now
reads the wait argument of each keepWatch call (changing it fails the test, and
nothing else in the package does).

No upper bound was added for the wait itself: the injection seam replaces the
wait in every test that drives the loop, so a bound on waitFor's own duration
would have to be a wall-clock one, and the correct code overshot a 25ms timer
to 65ms on a saturated 16-CPU box (169/200 samples over 1.5x, 8/200 over 2x),
which is exactly the flake a bound tight enough to catch the 2x mutation buys.
The wait doc states what the injected wait can and cannot show.
2026-09-22 01:58:03 +10:00
..