Skip to content

browse: a source's reachability becomes a STATE (the contract two lanes will share) - #50

Merged
GLinnik21 merged 2 commits into
mainfrom
c0/source-dto-contract
Aug 23, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
c0/source-dto-contract

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

BrowseSource.reachable: bool could say "answered" or "did not". It could not say the three things the prober already tells apart (plex::probe::Outcome): nobody has dialled yet, the server answered and refused our token, and the server did not answer. Those want different words, and the middle one wants a different remedy — a 401 is a sharing-grant problem that re-fetching /api/v2/resources fixes, and reporting it as "not reachable" sends the user to look at a router for something that was never a network fault.

So reachable: bool becomes state: SourceState { NotProbed, Reachable, Unauthorized, Unreachable }, beside a tier: Option<probe::Location> for which connection actually won — the fact route's relay policy consumes and has never once been given, because Client::set_link still has no production caller.

Nothing changes on screen

The old question survives as reachable(), the old write as set_reachable(), and the seed keeps its exact meaning. A source nobody has dialled is NotProbed, which reads as reachable — because the field this replaced was seeded true for precisely that reason. Make it false and every group opens dimmed for the frames between registration and the first probe, which is a visible flicker on every boot. Two new tests pin the mapping rather than asserting it in prose, and one pins the half that looks wrong: an answered-but-refused server does not dim.

Unauthorized is unconstructed in production on purpose and carries cfg_attr(not(test), expect(dead_code, …)) rather than an allow. When the prober that can produce it lands, the expectation becomes unfulfilled and the build fails until the attribute is deleted. That is the handover note, enforced rather than written down.

Why it lands alone, ahead of the work that uses it

The renderer of these states and the code that populates them are separate changes. Neither can reference a type living in the other's unmerged branch, and they cannot both own the definition — so the type goes first, by itself, doing nothing.

Verification

  • make check — 976/976, lint clean.
  • cargo +nightly check --lib --no-default-features — clean (the release feature set make check cannot see).
  • Desktop simulator booted against a real PMS: Home renders identically, hero, shelves and all.
  • Everything outside browse.rs is mechanical — .reachable → .reachable() at four call sites.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

GLinnik21 and others added 2 commits August 23, 2026 12:15
… two lanes will share

`BrowseSource.reachable: bool` could say "answered" or "did not", and the Sources
list said exactly those two things. It could not say the three the prober already
tells apart (`plex::probe::Outcome`): nobody has dialled yet, the server answered
and refused our token, and the server did not answer. Those want different words
and, for the middle one, a different remedy — a 401 is a sharing-grant problem
that re-fetching /api/v2/resources fixes, and reporting it as "not reachable"
sends the user to look at a router for something that was never a network fault.

So `reachable: bool` becomes `state: SourceState`, beside a `tier` for which
connection actually won (local / remote / relay — the fact `route`'s relay policy
consumes and has never once been given, because `Client::set_link` still has no
production caller).

**Nothing changes on screen.** The old question survives as `reachable()`, the old
write as `set_reachable()`, and the seed keeps its exact meaning: a source nobody
has dialled is `NotProbed`, which reads as reachable, because the field this
replaced was seeded `true` for precisely that reason — otherwise every group opens
dimmed for the frames between registration and the first probe. Two new tests pin
that mapping rather than asserting it in prose, and one of them pins the half that
looks wrong: an answered-but-refused server does NOT dim.

`Unauthorized` is unconstructed in production on purpose and carries
`cfg_attr(not(test), expect(dead_code, ...))` rather than an `allow` — when the
prober that can produce it lands, the expectation becomes unfulfilled and the
build fails until the attribute is deleted. That is the handover note, enforced.

Landed alone, ahead of the work that uses it, because the renderer and the
populator are separate changes: neither can reference a type living in the other's
unmerged branch, and they cannot both own the definition.

976/976 host tests, lint clean, and clean under --no-default-features.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
…ed since 2026-08-22

`./tests/run.py --list` prints which cases a set of flags selects. It opens no
socket, arms no trigger and touches no television — `test_harness.py`'s own
docstring says so, and that is precisely why `DefaultTier` spawns the real CLI to
ask what a bare command runs rather than importing a rule that lives in `main()`.

But `load_manifest` ran first, and it requires a TV address for the synthetic tier
and a whole overlay for the server tier. On a machine with neither — a fresh clone,
a fleet worktree, and **the CI runner** — `--list` exited 1 with empty stdout, so
both `DefaultTier` listing tests failed on every push. Red on `main` since
87a0c94; both jobs, every run.

The fix is to let a LISTING skip the two requirements and nothing else:

  * `for_listing=True` makes the absent overlay and the absent TV non-fatal, and
    `main()` passes `args.list`.
  * `cfg["tv"]` and the placeholder scan become `.get` — under `--list` there may
    genuinely be no address, and nothing downstream of a listing dials one.

A malformed overlay stays fatal even for a listing: that is a typo to fix, not an
absence to work around, and quietly listing the wrong thing is the failure mode
this function is shaped to avoid. Verified in a clean checkout with no `.tv-host`
and no `manifest.local.json`: both listings now print and exit 0, while a real
`./tests/run.py` and `./tests/run.py --server` still refuse with their existing
messages — the safety property, unchanged.

Fixed here rather than later because this base is about to be branched by a fleet
of parallel lanes. Inherited, it would have put an identical red check on every
one of their PRs, where a real failure is indistinguishable from the background.

30/30 harness tests in a CI-like checkout; 976/976 with an overlay present.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
@GLinnik21
GLinnik21 merged commit cf6cef7 into main Aug 23, 2026
2 checks passed
@GLinnik21
GLinnik21 deleted the c0/source-dto-contract branch August 23, 2026 09:26
GLinnik21 added a commit that referenced this pull request Aug 23, 2026
…, and a proxy that can be slow

Three checklist items were unanswerable for three different reasons, and none of
them was a defect in the app.

**#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo
could only answer it as "pieces are covered": every pipeline fixture was 1080p
except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264
existed in neither pack — which is a fact about the maintainer's library (every
4K item there is HEVC or AV1) rather than about the player. Six new generated
clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160
x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the
raster and nothing else. Each of the eight cells now grades `expect.video_size`,
an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480
from 720x576 and a matrix answered with "at least 1900 wide" is the answer the
item is asking us to stop giving.

Four decisions in the matrix look arbitrary and are argued where they live
(`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture
would grade PAR handling, an axis with no assertion behind it anywhere here);
CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not
its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a
quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which
makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture,
already device-verified; and E-AC-3 down the HEVC column, which is also the
better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce
"AC3".

**#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos`
plays a deliberately short 20 s clip to its end and asserts `EOS reached ...
-> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered
because every stop tears the engine down — the harness's own close included — and
searched forward from the EOS rather than compared against the first teardown in
the log, because `teardown` writes the same line for a `for_reload` stop, which
would fail the case for its whole cap with the evidence reading "the player froze
on the last frame". This is the only case in either tier that is SUPPOSED to run
out, so it gets its own fixture that nothing else may name (everything else is
sized so it cannot hit EOF mid-window, trap 9's second half), and
`_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is
longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing
as a frozen player.

The SECOND half — starting the same content again — is NOT closed, and it is an
app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s
one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS
`finish_playback` -> `exit_player` leaves the player, and with no Plex session
there is no detail page, no Play control and no key path back in. The manifest
case carries a `_replay_note` naming the small app-side change that would close
it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever
`route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay
half untested.

**#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could
make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps
-> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link
was anecdote. One token bucket for the whole proxy, because `rate:` names a link
and a link is shared; decimal kilobits, because that is the unit the item states
its legs in; empty at the start, because a full bucket hands the first
quarter-second a free burst and that is most of a short transfer; live under an
open connection, so one scripted run covers all four legs instead of four
launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000,
17500 -> 17518.

Two pre-existing bugs surfaced in the code it touches, both fixed:

* **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the
  scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which
  discards it — so `stall@/:/timeline` really froze every open connection
  including the media stream, i.e. the exact opposite of what the scope exists
  for. Both docs claimed the working behaviour. `relay` now takes the
  connection's own first bytes.
* **The read poll's socket timeout was also the other direction's WRITE
  timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)`
  set the timeout on the other thread's `dst`; `sendall` on a timed-out socket
  raises having written an unspecified number of bytes, the `except OSError`
  swallowed it, and the stream truncated silently — reachable in exactly the
  situation the proxy exists to measure. The poll moved to `select` and both
  sockets are put back to blocking before relaying.

`--selftest` proves the shaper against a loopback transfer with no television in
the room, in its own temp control file so it cannot release the mode under a live
experiment.

**What this costs and what it does not prove.** The pipeline pack goes from ~0.4
to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution
is a property of the media, so a matrix cell cannot be a second case on an
existing file. Everything here is generated, so what none of it reaches is a PMS
DECISION on any of these shapes — `library_gaps` says so per entry. While
correcting those entries: `8-bit-hevc` was ALREADY covered by
`pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not
caught up; only `4k-h264` is newly closed.

Host-verified only — this lane has no television. `make check` is green (976 Rust
+ 47 harness tests, the harness suite now including the netcond shaper against
real loopback sockets), every fixture verifies under `make_fixtures.py`'s own
ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail
for each new clip. The device run is the integrator's; the recipe is in the PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
GLinnik21 added a commit that referenced this pull request Aug 23, 2026
…, and a proxy that can be slow (#59)

* tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow

Three checklist items were unanswerable for three different reasons, and none of
them was a defect in the app.

**#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo
could only answer it as "pieces are covered": every pipeline fixture was 1080p
except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264
existed in neither pack — which is a fact about the maintainer's library (every
4K item there is HEVC or AV1) rather than about the player. Six new generated
clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160
x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the
raster and nothing else. Each of the eight cells now grades `expect.video_size`,
an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480
from 720x576 and a matrix answered with "at least 1900 wide" is the answer the
item is asking us to stop giving.

Four decisions in the matrix look arbitrary and are argued where they live
(`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture
would grade PAR handling, an axis with no assertion behind it anywhere here);
CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not
its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a
quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which
makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture,
already device-verified; and E-AC-3 down the HEVC column, which is also the
better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce
"AC3".

**#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos`
plays a deliberately short 20 s clip to its end and asserts `EOS reached ...
-> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered
because every stop tears the engine down — the harness's own close included — and
searched forward from the EOS rather than compared against the first teardown in
the log, because `teardown` writes the same line for a `for_reload` stop, which
would fail the case for its whole cap with the evidence reading "the player froze
on the last frame". This is the only case in either tier that is SUPPOSED to run
out, so it gets its own fixture that nothing else may name (everything else is
sized so it cannot hit EOF mid-window, trap 9's second half), and
`_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is
longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing
as a frozen player.

The SECOND half — starting the same content again — is NOT closed, and it is an
app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s
one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS
`finish_playback` -> `exit_player` leaves the player, and with no Plex session
there is no detail page, no Play control and no key path back in. The manifest
case carries a `_replay_note` naming the small app-side change that would close
it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever
`route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay
half untested.

**#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could
make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps
-> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link
was anecdote. One token bucket for the whole proxy, because `rate:` names a link
and a link is shared; decimal kilobits, because that is the unit the item states
its legs in; empty at the start, because a full bucket hands the first
quarter-second a free burst and that is most of a short transfer; live under an
open connection, so one scripted run covers all four legs instead of four
launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000,
17500 -> 17518.

Two pre-existing bugs surfaced in the code it touches, both fixed:

* **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the
  scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which
  discards it — so `stall@/:/timeline` really froze every open connection
  including the media stream, i.e. the exact opposite of what the scope exists
  for. Both docs claimed the working behaviour. `relay` now takes the
  connection's own first bytes.
* **The read poll's socket timeout was also the other direction's WRITE
  timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)`
  set the timeout on the other thread's `dst`; `sendall` on a timed-out socket
  raises having written an unspecified number of bytes, the `except OSError`
  swallowed it, and the stream truncated silently — reachable in exactly the
  situation the proxy exists to measure. The poll moved to `select` and both
  sockets are put back to blocking before relaying.

`--selftest` proves the shaper against a loopback transfer with no television in
the room, in its own temp control file so it cannot release the mode under a live
experiment.

**What this costs and what it does not prove.** The pipeline pack goes from ~0.4
to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution
is a property of the media, so a matrix cell cannot be a second case on an
existing file. Everything here is generated, so what none of it reaches is a PMS
DECISION on any of these shapes — `library_gaps` says so per entry. While
correcting those entries: `8-bit-hevc` was ALREADY covered by
`pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not
caught up; only `4k-h264` is newly closed.

Host-verified only — this lane has no television. `make check` is green (976 Rust
+ 47 harness tests, the harness suite now including the netcond shaper against
real loopback sockets), every fixture verifies under `make_fixtures.py`'s own
ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail
for each new clip. The device run is the integrator's; the recipe is in the PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: the which-tier skill still said the synthetic tier was twelve cases

It is 19 as of this branch, and the number in that sentence was going to rot
again — the same way the host test count in CLAUDE.md rotted three times — so it
now points at `./tests/run.py --list` instead of restating a census.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: five sentences this branch made false, one of them mine twice over

`doc-claim-auditor` over the branch. All five are contradictions, not omissions.

**The one that matters, because it is the skill whose whole subject is this
error.** `which-tier` opens by warning against "reading a bare `./tests/run.py`
as the suite it used to be" — and its pasteable `sh` block still said **12
synthetic cases**. Worse, 8ede10e fixed the identical number in that file's
PROSE two paragraphs above and left the two copies in the code block, i.e. the
half a reader copies. The file contradicted itself inside one commit. Both counts
are gone; the block now points at `--list`, which it already named two lines down,
and says why a second copy of the number does not survive here.

**`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.**
Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while
`manifest.json`, rewritten in the same commit, says 4K H.264 is closed by
`pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4`
landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes
off to author media that already exists. Both cut, with what a generated clip
still cannot close said plainly: a PMS DECISION on such an item.

Same sentence, pre-existing and one word: it named **`plxnative-url`** as the
trigger these are fed through. `tests/README.md` says the opposite and is right —
`plxnative-playurl` is the one carrying the DECLARATION, and several remaining
gaps (HLG, HDR10+) are *about* what the payload declares.

**Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing
is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because
ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for
it. The new shape's comment cited "trap 9's second half" as the rule it breaks;
trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still
said the only length constraint left was "do not hit EOF". Both now carry both
bounds, and say that adding a second short clip means picking a side.

**`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures
carrying two cases each, and it was four of twelve on `main` too — a count that
was wrong before the denominator moved. Replaced with the property (a seek case
beside its play case; an audio-lane pair), which is true at any number.

**`docs/lg-self-checklist.md` was dated the day before its own newest content** —
"Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the
line now says to bump it in the same edit as any row, since it is the only sentence
in that file nothing else restates.

Rejected and recorded so the next run does not re-derive them: the Makefile's
"~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit
"measure before budgeting", subprocess count unchanged); `README.md:176`'s "two
gitignored files", false since 072a60e and not this branch's; and four notes
recording the 6974 ms reporter-join measurement taken while netcond's scope was
broken — they assert the park and the mechanism, not that the media stream kept
flowing, so none is contradicted. Two more (`async-model-decision.md:399`,
`ui/library.rs:171`) described scoping as working per-request and were FALSE until
this branch fixed `relay`; they are true again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* player: a finished stream can be started again, and #46 gets both halves

The replay half of LG App Self Checklist #46 was the one thing my last PR could
not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic
tier's only entry into the player is `plxnative-playurl`, read behind a one-shot
`auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback`
→ `exit_player` leaves the player, and with no Plex session there is no detail
page, no Play control and no key path back in.

Everything else was already in place, which is why the change is small:
`teardown` clears the URL and the `ended` flag on a real stop, and
`engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is
empty. So a replay is a second trip through the entry the boot already used.

**A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards
the `autoplay`+`playidx` arm, which does a `request_play_movie` +
`load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog
item on every player exit and loop a REAL playback forever.
`/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file
appearing mid-run can turn it into a loop), gated on `playurl` being armed, and
declines when `finish_playback` handed off to Up Next instead — an auto-advance
chain returns to the player, and that is exactly what the route check tells
apart. An absent file is 0, so every existing boot is byte-identical.
`dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`,
so a release build has no replay arm at all; both feature sets type-check.

`replay_budget` is split out and host-tested for `note_global_press`'s reason one
step removed: the call site is inside the SDL event loop where no host test can
reach, and this half touches no SDL. It matters more than it looks, because every
value it can return is plausible and a misparse is invisible on the panel — 0
reads as "the replay arm is missing from this binary" and 2 reads as a loop.

**The two hazards in the lanes that landed in this file since I last read it are
both safe by construction, and I checked rather than assumed.** b6's
unconsumed-press invariant lives in `note_global_press`, and this change is
nowhere near key dispatch — it adds no press path and no global side effect. b7's
recorder cannot write a bogus record for a synthetic playback either:
`coldstart_place` answers `Route::Player` from `metadata::playing()`, which is
installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed
session has no playing item and records nothing — before this change or after it.
A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh
never fires between the two viewings.

**The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and
starts it again. `expect.replays` is one statement, not two: the harness writes it
into the trigger AND `a_replayed` counts it, so the number the app is told cannot
drift from the number that is graded. Three signals, each worthless alone — the
`replay:` line exactly N times (counted, because more often than asked is a loop
and a loop satisfies everything else); at least N+1 `load:` lines, since
`start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a
second line is what says the declaration was really re-read; and a media position
that FALLS and then climbs, which is the only thing separating a restart from a
session that carried on. `server_opens_min: 2` is the wire-side half no log line
can give: the second viewing has to fetch the clip again.

`_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a
`--secs`-regenerated pack skips this case instead of failing it as a missing
feature. `pipe_finish_eos` stays separate and grades the finish alone: "never
ends" and "ends and cannot be restarted" are different failures, and one case
would report either as the other.

**Two prose corrections this branch's netcond findings force, both about the same
sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes
the progress reporter while video keeps streaming, which is what makes a clean
experiment possible" — as a working feature. It was FALSE for as long as it
existed, because `relay` took a scope-less `Mode.split`; it became true on
2026-08-23. Said so at the sentence rather than three sentences later.

And the **6974 ms** measurement cited beside it was taken under that broken
instrument, so the proxy was stalling every connection and not only the
reporter's. **The number and the conclusion both survive, and the mechanism is
worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline
6974ms` — `task::join` emits one NAMED line per join, so the attribution came
from the instrument and not from inferring a total — and `timeline` is the only
join that COULD have parked whatever else was stalled, because `engine::teardown`
step 1 deliberately wakes the other two before joining them (`http_shutdown` on
the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no
such wake. Before and after were taken the same way, so the 14x is
apples-to-apples. What CANNOT be claimed from that session is that video kept
streaming while the reporter was frozen — a property of the tool today, not of
that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of
which carried the number.

Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51
harness tests — and `--no-default-features` type-checks. No television: the device
run is the integrator's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay count is a third exception to the early-exit rule, and says so

`stream_case`'s soundness note names exactly two ABSENCE checks that early exit
cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed`
is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines,
because more than N is a loop), and an equality can pass at N and fail at N+1.

What it cannot see, stated rather than left to be discovered: an app replaying
forever fires its next `replay:` line only after another full viewing — ~20 s on
the short clip — while the case satisfies everything else at ~28 s, so an early
exit two seconds later stops before the evidence arrives.

Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on
every suite run to guard three lines whose bound is ALREADY gradeable by `make
check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s
parsing has host tests. `--no-early` is how to go looking for a loop deliberately,
and the trade is worth re-taking only if that app-side bound moves.

Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed
as untested", which stopped being true one commit ago. It now points at the case.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay assertion passed on a replay that never played, and three notes it made false

`/code-review` on the replay work, five findings, all mine, all fixed.

**The one that mattered: `a_replayed` was a false PASS in the ordering the field
will actually produce.** It measured the post-drop climb from the GLOBAL floor —
and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to
reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so
viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts
the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced
against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and
PASSED with the second viewing having produced one sample and zero seconds of
playback — defeating near-miss (e) in its own docstring, "restarted and then
stalled at the join".

Worse than a corner: the harness exits the moment every assertion passes, so that
is the state it would NORMALLY have graded. My own near-miss test passed only
because its series starts at 2 rather than 0 — exactly the accident a regression
test is for, and there is now one carrying the counterexample verbatim.

The climb is anchored at the index of the deepest DROP, which the loop computing
`drop` already had in hand.

Four more, each a sentence this branch itself made false:

* `a_finished`'s docstring still said the replay half "is unreachable from this
  tier today and it is an app gap, not a test gap … exactly one playback per boot
  and no key path back into the player" — contradicted by the `a_replayed` fifty
  lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all
  added in the same change. It now points at them and says why the two cases stay
  apart.
* `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment
  and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to
  reach EOF and the only one allowed to name that fixture. Two cases do both now.
  The rule was never "one case" anyway — it is "a case graded through a teardown
  has to have declared `reaches_eos`", which is what the unit test was deliberately
  loosened to, so the prose was the last thing still asserting the old form.
* `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23".
  The manifest holds 20. **That count rotted inside the branch that wrote it, one
  commit after that same branch corrected the previous stale copy of it.** Both are
  now the pointer to `--list` rather than a fourth number waiting to go stale.
* `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per
  `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like
  every other temp use in that file. Verified: no new directories after a run.

`make check` green — 1069 Rust, 52 harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…es will share) (#50)

* browse: a source's reachability becomes a STATE, and it is a contract two lanes will share

`BrowseSource.reachable: bool` could say "answered" or "did not", and the Sources
list said exactly those two things. It could not say the three the prober already
tells apart (`plex::probe::Outcome`): nobody has dialled yet, the server answered
and refused our token, and the server did not answer. Those want different words
and, for the middle one, a different remedy — a 401 is a sharing-grant problem
that re-fetching /api/v2/resources fixes, and reporting it as "not reachable"
sends the user to look at a router for something that was never a network fault.

So `reachable: bool` becomes `state: SourceState`, beside a `tier` for which
connection actually won (local / remote / relay — the fact `route`'s relay policy
consumes and has never once been given, because `Client::set_link` still has no
production caller).

**Nothing changes on screen.** The old question survives as `reachable()`, the old
write as `set_reachable()`, and the seed keeps its exact meaning: a source nobody
has dialled is `NotProbed`, which reads as reachable, because the field this
replaced was seeded `true` for precisely that reason — otherwise every group opens
dimmed for the frames between registration and the first probe. Two new tests pin
that mapping rather than asserting it in prose, and one of them pins the half that
looks wrong: an answered-but-refused server does NOT dim.

`Unauthorized` is unconstructed in production on purpose and carries
`cfg_attr(not(test), expect(dead_code, ...))` rather than an `allow` — when the
prober that can produce it lands, the expectation becomes unfulfilled and the
build fails until the attribute is deleted. That is the handover note, enforced.

Landed alone, ahead of the work that uses it, because the renderer and the
populator are separate changes: neither can reference a type living in the other's
unmerged branch, and they cannot both own the definition.

976/976 host tests, lint clean, and clean under --no-default-features.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: `--list` is documented as offline, and was not — CI has been red since 2026-08-22

`./tests/run.py --list` prints which cases a set of flags selects. It opens no
socket, arms no trigger and touches no television — `test_harness.py`'s own
docstring says so, and that is precisely why `DefaultTier` spawns the real CLI to
ask what a bare command runs rather than importing a rule that lives in `main()`.

But `load_manifest` ran first, and it requires a TV address for the synthetic tier
and a whole overlay for the server tier. On a machine with neither — a fresh clone,
a fleet worktree, and **the CI runner** — `--list` exited 1 with empty stdout, so
both `DefaultTier` listing tests failed on every push. Red on `main` since
f1824c5; both jobs, every run.

The fix is to let a LISTING skip the two requirements and nothing else:

  * `for_listing=True` makes the absent overlay and the absent TV non-fatal, and
    `main()` passes `args.list`.
  * `cfg["tv"]` and the placeholder scan become `.get` — under `--list` there may
    genuinely be no address, and nothing downstream of a listing dials one.

A malformed overlay stays fatal even for a listing: that is a typo to fix, not an
absence to work around, and quietly listing the wrong thing is the failure mode
this function is shaped to avoid. Verified in a clean checkout with no `.tv-host`
and no `manifest.local.json`: both listings now print and exit 0, while a real
`./tests/run.py` and `./tests/run.py --server` still refuse with their existing
messages — the safety property, unchanged.

Fixed here rather than later because this base is about to be branched by a fleet
of parallel lanes. Inherited, it would have put an identical red check on every
one of their PRs, where a real failure is indistinguishable from the background.

30/30 harness tests in a CI-like checkout; 976/976 with an overlay present.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…, and a proxy that can be slow (#59)

* tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow

Three checklist items were unanswerable for three different reasons, and none of
them was a defect in the app.

**#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo
could only answer it as "pieces are covered": every pipeline fixture was 1080p
except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264
existed in neither pack — which is a fact about the maintainer's library (every
4K item there is HEVC or AV1) rather than about the player. Six new generated
clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160
x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the
raster and nothing else. Each of the eight cells now grades `expect.video_size`,
an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480
from 720x576 and a matrix answered with "at least 1900 wide" is the answer the
item is asking us to stop giving.

Four decisions in the matrix look arbitrary and are argued where they live
(`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture
would grade PAR handling, an axis with no assertion behind it anywhere here);
CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not
its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a
quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which
makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture,
already device-verified; and E-AC-3 down the HEVC column, which is also the
better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce
"AC3".

**#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos`
plays a deliberately short 20 s clip to its end and asserts `EOS reached ...
-> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered
because every stop tears the engine down — the harness's own close included — and
searched forward from the EOS rather than compared against the first teardown in
the log, because `teardown` writes the same line for a `for_reload` stop, which
would fail the case for its whole cap with the evidence reading "the player froze
on the last frame". This is the only case in either tier that is SUPPOSED to run
out, so it gets its own fixture that nothing else may name (everything else is
sized so it cannot hit EOF mid-window, trap 9's second half), and
`_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is
longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing
as a frozen player.

The SECOND half — starting the same content again — is NOT closed, and it is an
app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s
one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS
`finish_playback` -> `exit_player` leaves the player, and with no Plex session
there is no detail page, no Play control and no key path back in. The manifest
case carries a `_replay_note` naming the small app-side change that would close
it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever
`route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay
half untested.

**#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could
make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps
-> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link
was anecdote. One token bucket for the whole proxy, because `rate:` names a link
and a link is shared; decimal kilobits, because that is the unit the item states
its legs in; empty at the start, because a full bucket hands the first
quarter-second a free burst and that is most of a short transfer; live under an
open connection, so one scripted run covers all four legs instead of four
launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000,
17500 -> 17518.

Two pre-existing bugs surfaced in the code it touches, both fixed:

* **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the
  scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which
  discards it — so `stall@/:/timeline` really froze every open connection
  including the media stream, i.e. the exact opposite of what the scope exists
  for. Both docs claimed the working behaviour. `relay` now takes the
  connection's own first bytes.
* **The read poll's socket timeout was also the other direction's WRITE
  timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)`
  set the timeout on the other thread's `dst`; `sendall` on a timed-out socket
  raises having written an unspecified number of bytes, the `except OSError`
  swallowed it, and the stream truncated silently — reachable in exactly the
  situation the proxy exists to measure. The poll moved to `select` and both
  sockets are put back to blocking before relaying.

`--selftest` proves the shaper against a loopback transfer with no television in
the room, in its own temp control file so it cannot release the mode under a live
experiment.

**What this costs and what it does not prove.** The pipeline pack goes from ~0.4
to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution
is a property of the media, so a matrix cell cannot be a second case on an
existing file. Everything here is generated, so what none of it reaches is a PMS
DECISION on any of these shapes — `library_gaps` says so per entry. While
correcting those entries: `8-bit-hevc` was ALREADY covered by
`pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not
caught up; only `4k-h264` is newly closed.

Host-verified only — this lane has no television. `make check` is green (976 Rust
+ 47 harness tests, the harness suite now including the netcond shaper against
real loopback sockets), every fixture verifies under `make_fixtures.py`'s own
ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail
for each new clip. The device run is the integrator's; the recipe is in the PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: the which-tier skill still said the synthetic tier was twelve cases

It is 19 as of this branch, and the number in that sentence was going to rot
again — the same way the host test count in CLAUDE.md rotted three times — so it
now points at `./tests/run.py --list` instead of restating a census.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: five sentences this branch made false, one of them mine twice over

`doc-claim-auditor` over the branch. All five are contradictions, not omissions.

**The one that matters, because it is the skill whose whole subject is this
error.** `which-tier` opens by warning against "reading a bare `./tests/run.py`
as the suite it used to be" — and its pasteable `sh` block still said **12
synthetic cases**. Worse, 8ede10e fixed the identical number in that file's
PROSE two paragraphs above and left the two copies in the code block, i.e. the
half a reader copies. The file contradicted itself inside one commit. Both counts
are gone; the block now points at `--list`, which it already named two lines down,
and says why a second copy of the number does not survive here.

**`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.**
Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while
`manifest.json`, rewritten in the same commit, says 4K H.264 is closed by
`pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4`
landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes
off to author media that already exists. Both cut, with what a generated clip
still cannot close said plainly: a PMS DECISION on such an item.

Same sentence, pre-existing and one word: it named **`plxnative-url`** as the
trigger these are fed through. `tests/README.md` says the opposite and is right —
`plxnative-playurl` is the one carrying the DECLARATION, and several remaining
gaps (HLG, HDR10+) are *about* what the payload declares.

**Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing
is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because
ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for
it. The new shape's comment cited "trap 9's second half" as the rule it breaks;
trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still
said the only length constraint left was "do not hit EOF". Both now carry both
bounds, and say that adding a second short clip means picking a side.

**`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures
carrying two cases each, and it was four of twelve on `main` too — a count that
was wrong before the denominator moved. Replaced with the property (a seek case
beside its play case; an audio-lane pair), which is true at any number.

**`docs/lg-self-checklist.md` was dated the day before its own newest content** —
"Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the
line now says to bump it in the same edit as any row, since it is the only sentence
in that file nothing else restates.

Rejected and recorded so the next run does not re-derive them: the Makefile's
"~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit
"measure before budgeting", subprocess count unchanged); `README.md:176`'s "two
gitignored files", false since b6b9bdb and not this branch's; and four notes
recording the 6974 ms reporter-join measurement taken while netcond's scope was
broken — they assert the park and the mechanism, not that the media stream kept
flowing, so none is contradicted. Two more (`async-model-decision.md:399`,
`ui/library.rs:171`) described scoping as working per-request and were FALSE until
this branch fixed `relay`; they are true again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* player: a finished stream can be started again, and #46 gets both halves

The replay half of LG App Self Checklist #46 was the one thing my last PR could
not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic
tier's only entry into the player is `plxnative-playurl`, read behind a one-shot
`auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback`
→ `exit_player` leaves the player, and with no Plex session there is no detail
page, no Play control and no key path back in.

Everything else was already in place, which is why the change is small:
`teardown` clears the URL and the `ended` flag on a real stop, and
`engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is
empty. So a replay is a second trip through the entry the boot already used.

**A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards
the `autoplay`+`playidx` arm, which does a `request_play_movie` +
`load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog
item on every player exit and loop a REAL playback forever.
`/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file
appearing mid-run can turn it into a loop), gated on `playurl` being armed, and
declines when `finish_playback` handed off to Up Next instead — an auto-advance
chain returns to the player, and that is exactly what the route check tells
apart. An absent file is 0, so every existing boot is byte-identical.
`dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`,
so a release build has no replay arm at all; both feature sets type-check.

`replay_budget` is split out and host-tested for `note_global_press`'s reason one
step removed: the call site is inside the SDL event loop where no host test can
reach, and this half touches no SDL. It matters more than it looks, because every
value it can return is plausible and a misparse is invisible on the panel — 0
reads as "the replay arm is missing from this binary" and 2 reads as a loop.

**The two hazards in the lanes that landed in this file since I last read it are
both safe by construction, and I checked rather than assumed.** b6's
unconsumed-press invariant lives in `note_global_press`, and this change is
nowhere near key dispatch — it adds no press path and no global side effect. b7's
recorder cannot write a bogus record for a synthetic playback either:
`coldstart_place` answers `Route::Player` from `metadata::playing()`, which is
installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed
session has no playing item and records nothing — before this change or after it.
A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh
never fires between the two viewings.

**The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and
starts it again. `expect.replays` is one statement, not two: the harness writes it
into the trigger AND `a_replayed` counts it, so the number the app is told cannot
drift from the number that is graded. Three signals, each worthless alone — the
`replay:` line exactly N times (counted, because more often than asked is a loop
and a loop satisfies everything else); at least N+1 `load:` lines, since
`start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a
second line is what says the declaration was really re-read; and a media position
that FALLS and then climbs, which is the only thing separating a restart from a
session that carried on. `server_opens_min: 2` is the wire-side half no log line
can give: the second viewing has to fetch the clip again.

`_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a
`--secs`-regenerated pack skips this case instead of failing it as a missing
feature. `pipe_finish_eos` stays separate and grades the finish alone: "never
ends" and "ends and cannot be restarted" are different failures, and one case
would report either as the other.

**Two prose corrections this branch's netcond findings force, both about the same
sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes
the progress reporter while video keeps streaming, which is what makes a clean
experiment possible" — as a working feature. It was FALSE for as long as it
existed, because `relay` took a scope-less `Mode.split`; it became true on
2026-08-23. Said so at the sentence rather than three sentences later.

And the **6974 ms** measurement cited beside it was taken under that broken
instrument, so the proxy was stalling every connection and not only the
reporter's. **The number and the conclusion both survive, and the mechanism is
worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline
6974ms` — `task::join` emits one NAMED line per join, so the attribution came
from the instrument and not from inferring a total — and `timeline` is the only
join that COULD have parked whatever else was stalled, because `engine::teardown`
step 1 deliberately wakes the other two before joining them (`http_shutdown` on
the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no
such wake. Before and after were taken the same way, so the 14x is
apples-to-apples. What CANNOT be claimed from that session is that video kept
streaming while the reporter was frozen — a property of the tool today, not of
that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of
which carried the number.

Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51
harness tests — and `--no-default-features` type-checks. No television: the device
run is the integrator's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay count is a third exception to the early-exit rule, and says so

`stream_case`'s soundness note names exactly two ABSENCE checks that early exit
cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed`
is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines,
because more than N is a loop), and an equality can pass at N and fail at N+1.

What it cannot see, stated rather than left to be discovered: an app replaying
forever fires its next `replay:` line only after another full viewing — ~20 s on
the short clip — while the case satisfies everything else at ~28 s, so an early
exit two seconds later stops before the evidence arrives.

Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on
every suite run to guard three lines whose bound is ALREADY gradeable by `make
check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s
parsing has host tests. `--no-early` is how to go looking for a loop deliberately,
and the trade is worth re-taking only if that app-side bound moves.

Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed
as untested", which stopped being true one commit ago. It now points at the case.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay assertion passed on a replay that never played, and three notes it made false

`/code-review` on the replay work, five findings, all mine, all fixed.

**The one that mattered: `a_replayed` was a false PASS in the ordering the field
will actually produce.** It measured the post-drop climb from the GLOBAL floor —
and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to
reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so
viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts
the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced
against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and
PASSED with the second viewing having produced one sample and zero seconds of
playback — defeating near-miss (e) in its own docstring, "restarted and then
stalled at the join".

Worse than a corner: the harness exits the moment every assertion passes, so that
is the state it would NORMALLY have graded. My own near-miss test passed only
because its series starts at 2 rather than 0 — exactly the accident a regression
test is for, and there is now one carrying the counterexample verbatim.

The climb is anchored at the index of the deepest DROP, which the loop computing
`drop` already had in hand.

Four more, each a sentence this branch itself made false:

* `a_finished`'s docstring still said the replay half "is unreachable from this
  tier today and it is an app gap, not a test gap … exactly one playback per boot
  and no key path back into the player" — contradicted by the `a_replayed` fifty
  lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all
  added in the same change. It now points at them and says why the two cases stay
  apart.
* `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment
  and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to
  reach EOF and the only one allowed to name that fixture. Two cases do both now.
  The rule was never "one case" anyway — it is "a case graded through a teardown
  has to have declared `reaches_eos`", which is what the unit test was deliberately
  loosened to, so the prose was the last thing still asserting the old form.
* `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23".
  The manifest holds 20. **That count rotted inside the branch that wrote it, one
  commit after that same branch corrected the previous stale copy of it.** Both are
  now the pointer to `--list` rather than a fourth number waiting to go stale.
* `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per
  `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like
  every other temp use in that file. Verified: no new directories after a run.

`make check` green — 1069 Rust, 52 harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 27, 2026
…es will share) (#50)

* browse: a source's reachability becomes a STATE, and it is a contract two lanes will share

`BrowseSource.reachable: bool` could say "answered" or "did not", and the Sources
list said exactly those two things. It could not say the three the prober already
tells apart (`plex::probe::Outcome`): nobody has dialled yet, the server answered
and refused our token, and the server did not answer. Those want different words
and, for the middle one, a different remedy — a 401 is a sharing-grant problem
that re-fetching /api/v2/resources fixes, and reporting it as "not reachable"
sends the user to look at a router for something that was never a network fault.

So `reachable: bool` becomes `state: SourceState`, beside a `tier` for which
connection actually won (local / remote / relay — the fact `route`'s relay policy
consumes and has never once been given, because `Client::set_link` still has no
production caller).

**Nothing changes on screen.** The old question survives as `reachable()`, the old
write as `set_reachable()`, and the seed keeps its exact meaning: a source nobody
has dialled is `NotProbed`, which reads as reachable, because the field this
replaced was seeded `true` for precisely that reason — otherwise every group opens
dimmed for the frames between registration and the first probe. Two new tests pin
that mapping rather than asserting it in prose, and one of them pins the half that
looks wrong: an answered-but-refused server does NOT dim.

`Unauthorized` is unconstructed in production on purpose and carries
`cfg_attr(not(test), expect(dead_code, ...))` rather than an `allow` — when the
prober that can produce it lands, the expectation becomes unfulfilled and the
build fails until the attribute is deleted. That is the handover note, enforced.

Landed alone, ahead of the work that uses it, because the renderer and the
populator are separate changes: neither can reference a type living in the other's
unmerged branch, and they cannot both own the definition.

976/976 host tests, lint clean, and clean under --no-default-features.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: `--list` is documented as offline, and was not — CI has been red since 2026-08-22

`./tests/run.py --list` prints which cases a set of flags selects. It opens no
socket, arms no trigger and touches no television — `test_harness.py`'s own
docstring says so, and that is precisely why `DefaultTier` spawns the real CLI to
ask what a bare command runs rather than importing a rule that lives in `main()`.

But `load_manifest` ran first, and it requires a TV address for the synthetic tier
and a whole overlay for the server tier. On a machine with neither — a fresh clone,
a fleet worktree, and **the CI runner** — `--list` exited 1 with empty stdout, so
both `DefaultTier` listing tests failed on every push. Red on `main` since
a30054a; both jobs, every run.

The fix is to let a LISTING skip the two requirements and nothing else:

  * `for_listing=True` makes the absent overlay and the absent TV non-fatal, and
    `main()` passes `args.list`.
  * `cfg["tv"]` and the placeholder scan become `.get` — under `--list` there may
    genuinely be no address, and nothing downstream of a listing dials one.

A malformed overlay stays fatal even for a listing: that is a typo to fix, not an
absence to work around, and quietly listing the wrong thing is the failure mode
this function is shaped to avoid. Verified in a clean checkout with no `.tv-host`
and no `manifest.local.json`: both listings now print and exit 0, while a real
`./tests/run.py` and `./tests/run.py --server` still refuse with their existing
messages — the safety property, unchanged.

Fixed here rather than later because this base is about to be branched by a fleet
of parallel lanes. Inherited, it would have put an identical red check on every
one of their PRs, where a real failure is indistinguishable from the background.

30/30 harness tests in a CI-like checkout; 976/976 with an overlay present.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 27, 2026
…, and a proxy that can be slow (#59)

* tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow

Three checklist items were unanswerable for three different reasons, and none of
them was a defect in the app.

**#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo
could only answer it as "pieces are covered": every pipeline fixture was 1080p
except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264
existed in neither pack — which is a fact about the maintainer's library (every
4K item there is HEVC or AV1) rather than about the player. Six new generated
clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160
x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the
raster and nothing else. Each of the eight cells now grades `expect.video_size`,
an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480
from 720x576 and a matrix answered with "at least 1900 wide" is the answer the
item is asking us to stop giving.

Four decisions in the matrix look arbitrary and are argued where they live
(`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture
would grade PAR handling, an axis with no assertion behind it anywhere here);
CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not
its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a
quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which
makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture,
already device-verified; and E-AC-3 down the HEVC column, which is also the
better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce
"AC3".

**#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos`
plays a deliberately short 20 s clip to its end and asserts `EOS reached ...
-> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered
because every stop tears the engine down — the harness's own close included — and
searched forward from the EOS rather than compared against the first teardown in
the log, because `teardown` writes the same line for a `for_reload` stop, which
would fail the case for its whole cap with the evidence reading "the player froze
on the last frame". This is the only case in either tier that is SUPPOSED to run
out, so it gets its own fixture that nothing else may name (everything else is
sized so it cannot hit EOF mid-window, trap 9's second half), and
`_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is
longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing
as a frozen player.

The SECOND half — starting the same content again — is NOT closed, and it is an
app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s
one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS
`finish_playback` -> `exit_player` leaves the player, and with no Plex session
there is no detail page, no Play control and no key path back in. The manifest
case carries a `_replay_note` naming the small app-side change that would close
it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever
`route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay
half untested.

**#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could
make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps
-> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link
was anecdote. One token bucket for the whole proxy, because `rate:` names a link
and a link is shared; decimal kilobits, because that is the unit the item states
its legs in; empty at the start, because a full bucket hands the first
quarter-second a free burst and that is most of a short transfer; live under an
open connection, so one scripted run covers all four legs instead of four
launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000,
17500 -> 17518.

Two pre-existing bugs surfaced in the code it touches, both fixed:

* **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the
  scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which
  discards it — so `stall@/:/timeline` really froze every open connection
  including the media stream, i.e. the exact opposite of what the scope exists
  for. Both docs claimed the working behaviour. `relay` now takes the
  connection's own first bytes.
* **The read poll's socket timeout was also the other direction's WRITE
  timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)`
  set the timeout on the other thread's `dst`; `sendall` on a timed-out socket
  raises having written an unspecified number of bytes, the `except OSError`
  swallowed it, and the stream truncated silently — reachable in exactly the
  situation the proxy exists to measure. The poll moved to `select` and both
  sockets are put back to blocking before relaying.

`--selftest` proves the shaper against a loopback transfer with no television in
the room, in its own temp control file so it cannot release the mode under a live
experiment.

**What this costs and what it does not prove.** The pipeline pack goes from ~0.4
to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution
is a property of the media, so a matrix cell cannot be a second case on an
existing file. Everything here is generated, so what none of it reaches is a PMS
DECISION on any of these shapes — `library_gaps` says so per entry. While
correcting those entries: `8-bit-hevc` was ALREADY covered by
`pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not
caught up; only `4k-h264` is newly closed.

Host-verified only — this lane has no television. `make check` is green (976 Rust
+ 47 harness tests, the harness suite now including the netcond shaper against
real loopback sockets), every fixture verifies under `make_fixtures.py`'s own
ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail
for each new clip. The device run is the integrator's; the recipe is in the PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: the which-tier skill still said the synthetic tier was twelve cases

It is 19 as of this branch, and the number in that sentence was going to rot
again — the same way the host test count in CLAUDE.md rotted three times — so it
now points at `./tests/run.py --list` instead of restating a census.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: five sentences this branch made false, one of them mine twice over

`doc-claim-auditor` over the branch. All five are contradictions, not omissions.

**The one that matters, because it is the skill whose whole subject is this
error.** `which-tier` opens by warning against "reading a bare `./tests/run.py`
as the suite it used to be" — and its pasteable `sh` block still said **12
synthetic cases**. Worse, 8ede10e fixed the identical number in that file's
PROSE two paragraphs above and left the two copies in the code block, i.e. the
half a reader copies. The file contradicted itself inside one commit. Both counts
are gone; the block now points at `--list`, which it already named two lines down,
and says why a second copy of the number does not survive here.

**`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.**
Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while
`manifest.json`, rewritten in the same commit, says 4K H.264 is closed by
`pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4`
landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes
off to author media that already exists. Both cut, with what a generated clip
still cannot close said plainly: a PMS DECISION on such an item.

Same sentence, pre-existing and one word: it named **`plxnative-url`** as the
trigger these are fed through. `tests/README.md` says the opposite and is right —
`plxnative-playurl` is the one carrying the DECLARATION, and several remaining
gaps (HLG, HDR10+) are *about* what the payload declares.

**Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing
is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because
ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for
it. The new shape's comment cited "trap 9's second half" as the rule it breaks;
trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still
said the only length constraint left was "do not hit EOF". Both now carry both
bounds, and say that adding a second short clip means picking a side.

**`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures
carrying two cases each, and it was four of twelve on `main` too — a count that
was wrong before the denominator moved. Replaced with the property (a seek case
beside its play case; an audio-lane pair), which is true at any number.

**`docs/lg-self-checklist.md` was dated the day before its own newest content** —
"Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the
line now says to bump it in the same edit as any row, since it is the only sentence
in that file nothing else restates.

Rejected and recorded so the next run does not re-derive them: the Makefile's
"~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit
"measure before budgeting", subprocess count unchanged); `README.md:176`'s "two
gitignored files", false since 4f69d32 and not this branch's; and four notes
recording the 6974 ms reporter-join measurement taken while netcond's scope was
broken — they assert the park and the mechanism, not that the media stream kept
flowing, so none is contradicted. Two more (`async-model-decision.md:399`,
`ui/library.rs:171`) described scoping as working per-request and were FALSE until
this branch fixed `relay`; they are true again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* player: a finished stream can be started again, and #46 gets both halves

The replay half of LG App Self Checklist #46 was the one thing my last PR could
not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic
tier's only entry into the player is `plxnative-playurl`, read behind a one-shot
`auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback`
→ `exit_player` leaves the player, and with no Plex session there is no detail
page, no Play control and no key path back in.

Everything else was already in place, which is why the change is small:
`teardown` clears the URL and the `ended` flag on a real stop, and
`engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is
empty. So a replay is a second trip through the entry the boot already used.

**A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards
the `autoplay`+`playidx` arm, which does a `request_play_movie` +
`load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog
item on every player exit and loop a REAL playback forever.
`/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file
appearing mid-run can turn it into a loop), gated on `playurl` being armed, and
declines when `finish_playback` handed off to Up Next instead — an auto-advance
chain returns to the player, and that is exactly what the route check tells
apart. An absent file is 0, so every existing boot is byte-identical.
`dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`,
so a release build has no replay arm at all; both feature sets type-check.

`replay_budget` is split out and host-tested for `note_global_press`'s reason one
step removed: the call site is inside the SDL event loop where no host test can
reach, and this half touches no SDL. It matters more than it looks, because every
value it can return is plausible and a misparse is invisible on the panel — 0
reads as "the replay arm is missing from this binary" and 2 reads as a loop.

**The two hazards in the lanes that landed in this file since I last read it are
both safe by construction, and I checked rather than assumed.** b6's
unconsumed-press invariant lives in `note_global_press`, and this change is
nowhere near key dispatch — it adds no press path and no global side effect. b7's
recorder cannot write a bogus record for a synthetic playback either:
`coldstart_place` answers `Route::Player` from `metadata::playing()`, which is
installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed
session has no playing item and records nothing — before this change or after it.
A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh
never fires between the two viewings.

**The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and
starts it again. `expect.replays` is one statement, not two: the harness writes it
into the trigger AND `a_replayed` counts it, so the number the app is told cannot
drift from the number that is graded. Three signals, each worthless alone — the
`replay:` line exactly N times (counted, because more often than asked is a loop
and a loop satisfies everything else); at least N+1 `load:` lines, since
`start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a
second line is what says the declaration was really re-read; and a media position
that FALLS and then climbs, which is the only thing separating a restart from a
session that carried on. `server_opens_min: 2` is the wire-side half no log line
can give: the second viewing has to fetch the clip again.

`_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a
`--secs`-regenerated pack skips this case instead of failing it as a missing
feature. `pipe_finish_eos` stays separate and grades the finish alone: "never
ends" and "ends and cannot be restarted" are different failures, and one case
would report either as the other.

**Two prose corrections this branch's netcond findings force, both about the same
sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes
the progress reporter while video keeps streaming, which is what makes a clean
experiment possible" — as a working feature. It was FALSE for as long as it
existed, because `relay` took a scope-less `Mode.split`; it became true on
2026-08-23. Said so at the sentence rather than three sentences later.

And the **6974 ms** measurement cited beside it was taken under that broken
instrument, so the proxy was stalling every connection and not only the
reporter's. **The number and the conclusion both survive, and the mechanism is
worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline
6974ms` — `task::join` emits one NAMED line per join, so the attribution came
from the instrument and not from inferring a total — and `timeline` is the only
join that COULD have parked whatever else was stalled, because `engine::teardown`
step 1 deliberately wakes the other two before joining them (`http_shutdown` on
the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no
such wake. Before and after were taken the same way, so the 14x is
apples-to-apples. What CANNOT be claimed from that session is that video kept
streaming while the reporter was frozen — a property of the tool today, not of
that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of
which carried the number.

Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51
harness tests — and `--no-default-features` type-checks. No television: the device
run is the integrator's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay count is a third exception to the early-exit rule, and says so

`stream_case`'s soundness note names exactly two ABSENCE checks that early exit
cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed`
is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines,
because more than N is a loop), and an equality can pass at N and fail at N+1.

What it cannot see, stated rather than left to be discovered: an app replaying
forever fires its next `replay:` line only after another full viewing — ~20 s on
the short clip — while the case satisfies everything else at ~28 s, so an early
exit two seconds later stops before the evidence arrives.

Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on
every suite run to guard three lines whose bound is ALREADY gradeable by `make
check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s
parsing has host tests. `--no-early` is how to go looking for a loop deliberately,
and the trade is worth re-taking only if that app-side bound moves.

Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed
as untested", which stopped being true one commit ago. It now points at the case.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay assertion passed on a replay that never played, and three notes it made false

`/code-review` on the replay work, five findings, all mine, all fixed.

**The one that mattered: `a_replayed` was a false PASS in the ordering the field
will actually produce.** It measured the post-drop climb from the GLOBAL floor —
and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to
reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so
viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts
the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced
against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and
PASSED with the second viewing having produced one sample and zero seconds of
playback — defeating near-miss (e) in its own docstring, "restarted and then
stalled at the join".

Worse than a corner: the harness exits the moment every assertion passes, so that
is the state it would NORMALLY have graded. My own near-miss test passed only
because its series starts at 2 rather than 0 — exactly the accident a regression
test is for, and there is now one carrying the counterexample verbatim.

The climb is anchored at the index of the deepest DROP, which the loop computing
`drop` already had in hand.

Four more, each a sentence this branch itself made false:

* `a_finished`'s docstring still said the replay half "is unreachable from this
  tier today and it is an app gap, not a test gap … exactly one playback per boot
  and no key path back into the player" — contradicted by the `a_replayed` fifty
  lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all
  added in the same change. It now points at them and says why the two cases stay
  apart.
* `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment
  and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to
  reach EOF and the only one allowed to name that fixture. Two cases do both now.
  The rule was never "one case" anyway — it is "a case graded through a teardown
  has to have declared `reaches_eos`", which is what the unit test was deliberately
  loosened to, so the prose was the last thing still asserting the old form.
* `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23".
  The manifest holds 20. **That count rotted inside the branch that wrote it, one
  commit after that same branch corrected the previous stale copy of it.** Both are
  now the pointer to `--list` rather than a fourth number waiting to go stale.
* `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per
  `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like
  every other temp use in that file. Verified: no new directories after a run.

`make check` green — 1069 Rust, 52 harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 28, 2026
…es will share) (#50)

* browse: a source's reachability becomes a STATE, and it is a contract two lanes will share

`BrowseSource.reachable: bool` could say "answered" or "did not", and the Sources
list said exactly those two things. It could not say the three the prober already
tells apart (`plex::probe::Outcome`): nobody has dialled yet, the server answered
and refused our token, and the server did not answer. Those want different words
and, for the middle one, a different remedy — a 401 is a sharing-grant problem
that re-fetching /api/v2/resources fixes, and reporting it as "not reachable"
sends the user to look at a router for something that was never a network fault.

So `reachable: bool` becomes `state: SourceState`, beside a `tier` for which
connection actually won (local / remote / relay — the fact `route`'s relay policy
consumes and has never once been given, because `Client::set_link` still has no
production caller).

**Nothing changes on screen.** The old question survives as `reachable()`, the old
write as `set_reachable()`, and the seed keeps its exact meaning: a source nobody
has dialled is `NotProbed`, which reads as reachable, because the field this
replaced was seeded `true` for precisely that reason — otherwise every group opens
dimmed for the frames between registration and the first probe. Two new tests pin
that mapping rather than asserting it in prose, and one of them pins the half that
looks wrong: an answered-but-refused server does NOT dim.

`Unauthorized` is unconstructed in production on purpose and carries
`cfg_attr(not(test), expect(dead_code, ...))` rather than an `allow` — when the
prober that can produce it lands, the expectation becomes unfulfilled and the
build fails until the attribute is deleted. That is the handover note, enforced.

Landed alone, ahead of the work that uses it, because the renderer and the
populator are separate changes: neither can reference a type living in the other's
unmerged branch, and they cannot both own the definition.

976/976 host tests, lint clean, and clean under --no-default-features.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: `--list` is documented as offline, and was not — CI has been red since 2026-08-22

`./tests/run.py --list` prints which cases a set of flags selects. It opens no
socket, arms no trigger and touches no television — `test_harness.py`'s own
docstring says so, and that is precisely why `DefaultTier` spawns the real CLI to
ask what a bare command runs rather than importing a rule that lives in `main()`.

But `load_manifest` ran first, and it requires a TV address for the synthetic tier
and a whole overlay for the server tier. On a machine with neither — a fresh clone,
a fleet worktree, and **the CI runner** — `--list` exited 1 with empty stdout, so
both `DefaultTier` listing tests failed on every push. Red on `main` since
aea72ce; both jobs, every run.

The fix is to let a LISTING skip the two requirements and nothing else:

  * `for_listing=True` makes the absent overlay and the absent TV non-fatal, and
    `main()` passes `args.list`.
  * `cfg["tv"]` and the placeholder scan become `.get` — under `--list` there may
    genuinely be no address, and nothing downstream of a listing dials one.

A malformed overlay stays fatal even for a listing: that is a typo to fix, not an
absence to work around, and quietly listing the wrong thing is the failure mode
this function is shaped to avoid. Verified in a clean checkout with no `.tv-host`
and no `manifest.local.json`: both listings now print and exit 0, while a real
`./tests/run.py` and `./tests/run.py --server` still refuse with their existing
messages — the safety property, unchanged.

Fixed here rather than later because this base is about to be branched by a fleet
of parallel lanes. Inherited, it would have put an identical red check on every
one of their PRs, where a real failure is indistinguishable from the background.

30/30 harness tests in a CI-like checkout; 976/976 with an overlay present.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 28, 2026
…, and a proxy that can be slow (#59)

* tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow

Three checklist items were unanswerable for three different reasons, and none of
them was a defect in the app.

**#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo
could only answer it as "pieces are covered": every pipeline fixture was 1080p
except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264
existed in neither pack — which is a fact about the maintainer's library (every
4K item there is HEVC or AV1) rather than about the player. Six new generated
clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160
x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the
raster and nothing else. Each of the eight cells now grades `expect.video_size`,
an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480
from 720x576 and a matrix answered with "at least 1900 wide" is the answer the
item is asking us to stop giving.

Four decisions in the matrix look arbitrary and are argued where they live
(`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture
would grade PAR handling, an axis with no assertion behind it anywhere here);
CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not
its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a
quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which
makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture,
already device-verified; and E-AC-3 down the HEVC column, which is also the
better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce
"AC3".

**#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos`
plays a deliberately short 20 s clip to its end and asserts `EOS reached ...
-> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered
because every stop tears the engine down — the harness's own close included — and
searched forward from the EOS rather than compared against the first teardown in
the log, because `teardown` writes the same line for a `for_reload` stop, which
would fail the case for its whole cap with the evidence reading "the player froze
on the last frame". This is the only case in either tier that is SUPPOSED to run
out, so it gets its own fixture that nothing else may name (everything else is
sized so it cannot hit EOF mid-window, trap 9's second half), and
`_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is
longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing
as a frozen player.

The SECOND half — starting the same content again — is NOT closed, and it is an
app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s
one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS
`finish_playback` -> `exit_player` leaves the player, and with no Plex session
there is no detail page, no Play control and no key path back in. The manifest
case carries a `_replay_note` naming the small app-side change that would close
it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever
`route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay
half untested.

**#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could
make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps
-> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link
was anecdote. One token bucket for the whole proxy, because `rate:` names a link
and a link is shared; decimal kilobits, because that is the unit the item states
its legs in; empty at the start, because a full bucket hands the first
quarter-second a free burst and that is most of a short transfer; live under an
open connection, so one scripted run covers all four legs instead of four
launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000,
17500 -> 17518.

Two pre-existing bugs surfaced in the code it touches, both fixed:

* **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the
  scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which
  discards it — so `stall@/:/timeline` really froze every open connection
  including the media stream, i.e. the exact opposite of what the scope exists
  for. Both docs claimed the working behaviour. `relay` now takes the
  connection's own first bytes.
* **The read poll's socket timeout was also the other direction's WRITE
  timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)`
  set the timeout on the other thread's `dst`; `sendall` on a timed-out socket
  raises having written an unspecified number of bytes, the `except OSError`
  swallowed it, and the stream truncated silently — reachable in exactly the
  situation the proxy exists to measure. The poll moved to `select` and both
  sockets are put back to blocking before relaying.

`--selftest` proves the shaper against a loopback transfer with no television in
the room, in its own temp control file so it cannot release the mode under a live
experiment.

**What this costs and what it does not prove.** The pipeline pack goes from ~0.4
to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution
is a property of the media, so a matrix cell cannot be a second case on an
existing file. Everything here is generated, so what none of it reaches is a PMS
DECISION on any of these shapes — `library_gaps` says so per entry. While
correcting those entries: `8-bit-hevc` was ALREADY covered by
`pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not
caught up; only `4k-h264` is newly closed.

Host-verified only — this lane has no television. `make check` is green (976 Rust
+ 47 harness tests, the harness suite now including the netcond shaper against
real loopback sockets), every fixture verifies under `make_fixtures.py`'s own
ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail
for each new clip. The device run is the integrator's; the recipe is in the PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: the which-tier skill still said the synthetic tier was twelve cases

It is 19 as of this branch, and the number in that sentence was going to rot
again — the same way the host test count in CLAUDE.md rotted three times — so it
now points at `./tests/run.py --list` instead of restating a census.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* docs: five sentences this branch made false, one of them mine twice over

`doc-claim-auditor` over the branch. All five are contradictions, not omissions.

**The one that matters, because it is the skill whose whole subject is this
error.** `which-tier` opens by warning against "reading a bare `./tests/run.py`
as the suite it used to be" — and its pasteable `sh` block still said **12
synthetic cases**. Worse, 8ede10e fixed the identical number in that file's
PROSE two paragraphs above and left the two copies in the code block, i.e. the
half a reader copies. The file contradicted itself inside one commit. Both counts
are gone; the block now points at `--list`, which it already named two lines down,
and says why a second copy of the number does not survive here.

**`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.**
Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while
`manifest.json`, rewritten in the same commit, says 4K H.264 is closed by
`pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4`
landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes
off to author media that already exists. Both cut, with what a generated clip
still cannot close said plainly: a PMS DECISION on such an item.

Same sentence, pre-existing and one word: it named **`plxnative-url`** as the
trigger these are fed through. `tests/README.md` says the opposite and is right —
`plxnative-playurl` is the one carrying the DECLARATION, and several remaining
gaps (HLG, HDR10+) are *about* what the payload declares.

**Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing
is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because
ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for
it. The new shape's comment cited "trap 9's second half" as the rule it breaks;
trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still
said the only length constraint left was "do not hit EOF". Both now carry both
bounds, and say that adding a second short clip means picking a side.

**`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures
carrying two cases each, and it was four of twelve on `main` too — a count that
was wrong before the denominator moved. Replaced with the property (a seek case
beside its play case; an audio-lane pair), which is true at any number.

**`docs/lg-self-checklist.md` was dated the day before its own newest content** —
"Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the
line now says to bump it in the same edit as any row, since it is the only sentence
in that file nothing else restates.

Rejected and recorded so the next run does not re-derive them: the Makefile's
"~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit
"measure before budgeting", subprocess count unchanged); `README.md:176`'s "two
gitignored files", false since 8a5ac95 and not this branch's; and four notes
recording the 6974 ms reporter-join measurement taken while netcond's scope was
broken — they assert the park and the mechanism, not that the media stream kept
flowing, so none is contradicted. Two more (`async-model-decision.md:399`,
`ui/library.rs:171`) described scoping as working per-request and were FALSE until
this branch fixed `relay`; they are true again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* player: a finished stream can be started again, and #46 gets both halves

The replay half of LG App Self Checklist #46 was the one thing my last PR could
not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic
tier's only entry into the player is `plxnative-playurl`, read behind a one-shot
`auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback`
→ `exit_player` leaves the player, and with no Plex session there is no detail
page, no Play control and no key path back in.

Everything else was already in place, which is why the change is small:
`teardown` clears the URL and the `ended` flag on a real stop, and
`engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is
empty. So a replay is a second trip through the entry the boot already used.

**A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards
the `autoplay`+`playidx` arm, which does a `request_play_movie` +
`load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog
item on every player exit and loop a REAL playback forever.
`/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file
appearing mid-run can turn it into a loop), gated on `playurl` being armed, and
declines when `finish_playback` handed off to Up Next instead — an auto-advance
chain returns to the player, and that is exactly what the route check tells
apart. An absent file is 0, so every existing boot is byte-identical.
`dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`,
so a release build has no replay arm at all; both feature sets type-check.

`replay_budget` is split out and host-tested for `note_global_press`'s reason one
step removed: the call site is inside the SDL event loop where no host test can
reach, and this half touches no SDL. It matters more than it looks, because every
value it can return is plausible and a misparse is invisible on the panel — 0
reads as "the replay arm is missing from this binary" and 2 reads as a loop.

**The two hazards in the lanes that landed in this file since I last read it are
both safe by construction, and I checked rather than assumed.** b6's
unconsumed-press invariant lives in `note_global_press`, and this change is
nowhere near key dispatch — it adds no press path and no global side effect. b7's
recorder cannot write a bogus record for a synthetic playback either:
`coldstart_place` answers `Route::Player` from `metadata::playing()`, which is
installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed
session has no playing item and records nothing — before this change or after it.
A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh
never fires between the two viewings.

**The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and
starts it again. `expect.replays` is one statement, not two: the harness writes it
into the trigger AND `a_replayed` counts it, so the number the app is told cannot
drift from the number that is graded. Three signals, each worthless alone — the
`replay:` line exactly N times (counted, because more often than asked is a loop
and a loop satisfies everything else); at least N+1 `load:` lines, since
`start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a
second line is what says the declaration was really re-read; and a media position
that FALLS and then climbs, which is the only thing separating a restart from a
session that carried on. `server_opens_min: 2` is the wire-side half no log line
can give: the second viewing has to fetch the clip again.

`_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a
`--secs`-regenerated pack skips this case instead of failing it as a missing
feature. `pipe_finish_eos` stays separate and grades the finish alone: "never
ends" and "ends and cannot be restarted" are different failures, and one case
would report either as the other.

**Two prose corrections this branch's netcond findings force, both about the same
sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes
the progress reporter while video keeps streaming, which is what makes a clean
experiment possible" — as a working feature. It was FALSE for as long as it
existed, because `relay` took a scope-less `Mode.split`; it became true on
2026-08-23. Said so at the sentence rather than three sentences later.

And the **6974 ms** measurement cited beside it was taken under that broken
instrument, so the proxy was stalling every connection and not only the
reporter's. **The number and the conclusion both survive, and the mechanism is
worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline
6974ms` — `task::join` emits one NAMED line per join, so the attribution came
from the instrument and not from inferring a total — and `timeline` is the only
join that COULD have parked whatever else was stalled, because `engine::teardown`
step 1 deliberately wakes the other two before joining them (`http_shutdown` on
the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no
such wake. Before and after were taken the same way, so the 14x is
apples-to-apples. What CANNOT be claimed from that session is that video kept
streaming while the reporter was frozen — a property of the tool today, not of
that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of
which carried the number.

Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51
harness tests — and `--no-default-features` type-checks. No television: the device
run is the integrator's.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay count is a third exception to the early-exit rule, and says so

`stream_case`'s soundness note names exactly two ABSENCE checks that early exit
cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed`
is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines,
because more than N is a loop), and an equality can pass at N and fail at N+1.

What it cannot see, stated rather than left to be discovered: an app replaying
forever fires its next `replay:` line only after another full viewing — ~20 s on
the short clip — while the case satisfies everything else at ~28 s, so an early
exit two seconds later stops before the evidence arrives.

Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on
every suite run to guard three lines whose bound is ALREADY gradeable by `make
check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s
parsing has host tests. `--no-early` is how to go looking for a loop deliberately,
and the trade is worth re-taking only if that app-side bound moves.

Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed
as untested", which stopped being true one commit ago. It now points at the case.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* tests: the replay assertion passed on a replay that never played, and three notes it made false

`/code-review` on the replay work, five findings, all mine, all fixed.

**The one that mattered: `a_replayed` was a false PASS in the ordering the field
will actually produce.** It measured the post-drop climb from the GLOBAL floor —
and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to
reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so
viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts
the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced
against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and
PASSED with the second viewing having produced one sample and zero seconds of
playback — defeating near-miss (e) in its own docstring, "restarted and then
stalled at the join".

Worse than a corner: the harness exits the moment every assertion passes, so that
is the state it would NORMALLY have graded. My own near-miss test passed only
because its series starts at 2 rather than 0 — exactly the accident a regression
test is for, and there is now one carrying the counterexample verbatim.

The climb is anchored at the index of the deepest DROP, which the loop computing
`drop` already had in hand.

Four more, each a sentence this branch itself made false:

* `a_finished`'s docstring still said the replay half "is unreachable from this
  tier today and it is an app gap, not a test gap … exactly one playback per boot
  and no key path back into the player" — contradicted by the `a_replayed` fifty
  lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all
  added in the same change. It now points at them and says why the two cases stay
  apart.
* `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment
  and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to
  reach EOF and the only one allowed to name that fixture. Two cases do both now.
  The rule was never "one case" anyway — it is "a case graded through a teardown
  has to have declared `reaches_eos`", which is what the unit test was deliberately
  loosened to, so the prose was the last thing still asserting the old form.
* `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23".
  The manifest holds 20. **That count rotted inside the branch that wrote it, one
  commit after that same branch corrected the previous stale copy of it.** Both are
  now the pointer to `--list` rather than a fourth number waiting to go stale.
* `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per
  `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like
  every other temp use in that file. Verified: no new directories after a run.

`make check` green — 1069 Rust, 52 harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant