Skip to content

ui: a watched episode stops looking like one never started - #2

Merged
GLinnik21 merged 1 commit into
mainfrom
unit-2-episode-watched-state
Jul 30, 2026
Merged

GLinnik21 merged 1 commit into
mainfrom
unit-2-episode-watched-state

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Parity unit 2 — episode watched state (docs/parity-gaps.md §2 theme A, §5c).

metadata::Episode carried resume_ms and nothing else about playback history, so the episode filmstrip drew a season the viewer had finished exactly the way it drew one they had never opened. The information was already on the wire and already parsed — plex/models.rs:154 reads viewCount and fetch_episodes simply never copied it.

The data half

  • Episode.watched, from viewCount > 0 — the same rule fetch_detail already applies to a movie leaf.
  • Deliberately independent of resume_ms: PMS holds both on an episode that was finished and then started again, so collapsing them in the data layer would throw away a resume point the player needs. Which of the two a tile shows is a rule of the draw site.
  • The /children row mapping moved out to a pure convert_episode so that derivation is host-testable at all. A flag nothing can exercise is how the first one got dropped.

This is the foundation for per-episode Mark-as-Watched: Season.rk is already carried, scrobble/unscrobble already take any rating key, so the episode scope is the one field that was missing.

The mark

widgets::watched_badge — a reusable leaf in widgets.rs, not a draw_* in detail.rs, because the poster shelves and library grid will want it as soon as per-tile watched state reaches them. A dark disc with the amber check, wearing the exact CONTROL_IDLE_FILL + RESUME_FILL pair the detail page's own watched toggle already wears, reusing Icon::Check and DISC_ICON_RATIO. Constant size through the focus pop — a 1:1-texel mask whose size rode the scale spring would re-rasterise and re-upload every animating frame.

Mutual exclusion mirrors widgets::card's poster gate: resume bar wins, check otherwise.

One thing found on the way

The filmstrip's resume bar was drawn in the player scrubber's white RAIL_* tokens, while every poster in the product draws the same rail in amber RESUME_* — which those two tokens are explicitly documented for ("the full-bleed card-bottom rail"). Left alone, this tile would have been the only place in the app showing two progress colours side by side. The bar moves onto the pair it belongs to, so amber is now the one watched-state hue everywhere: corner angle, resume bar, check.

Known, and NOT fixed here

Leaving the player refetches the detail on the same frame route::scrobble_stop posts the final timeline from a worker, so a just-finished episode can be re-fetched before PMS has scrobbled and briefly draws a near-full resume bar instead of its new check. app.rs:2101 already defers the post-playback hub refresh 800 ms for exactly this reason; the detail refetch wants the same treatment. That fix belongs to the exit path in app.rs, not to these files, and app.rs is under heavy concurrent edit — filed rather than forced in.

Verification

  • make check — 59 passed (+1: metadata::episode_tests::view_count_on_the_wire_becomes_the_episode_watched_flag, covering absent / "1" / numeric 4 / explicit 0, and watched-plus-resuming surviving the mapping intact). Goes through serde, not a hand-built DTO, so the string-encoded-counter path is real.
  • make — ARM cross-build green.
  • Device — The Morning Show (rk=437), whose two seasons give all three states in one screen: season 1 (10/10 watched) draws ten checks; season 2 draws a check on E1 (viewCount=2), amber bars at 18% and 71% on E2/E3 (viewOffset only), and nothing on E4–E10. Captured and eyeballed at 1:1.
  • ./tests/run.py --fps — 5/5. No playback cases: nothing here touches the player.

🤖 Generated with Claude Code

https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc

`metadata::Episode` carried `resume_ms` and nothing else about playback
history, so the episode filmstrip drew a season the viewer had finished
exactly the way it drew one they had never opened. The information was
already on the wire and already parsed — `plex/models.rs` reads
`viewCount` and `fetch_episodes` simply never copied it — which is why
this survived: nothing was missing, one assignment was.

The data half is a `watched` flag off `viewCount > 0`, the same rule
`fetch_detail` already applies to a movie leaf. It is deliberately kept
INDEPENDENT of `resume_ms`: PMS holds both on an episode that was
finished and then started again, so collapsing them in the data layer
would throw away a resume point the player needs. Which of the two a
tile shows is a rule of the draw site instead — resume wins, mirroring
the poster's `unwatched && resume_ms == 0` gate in `widgets::card`.
The row mapping moved out to a pure `convert_episode` so that
derivation is host-testable at all; a flag nothing can exercise is how
the first one got dropped.

The mark itself is `widgets::watched_badge` rather than a `draw_*` in
detail.rs, because the poster shelves and the library grid will want it
the moment per-tile watched state reaches them: a dark disc with the
amber check, wearing the exact `CONTROL_IDLE_FILL` + `RESUME_FILL` pair
the detail page's own watched toggle already wears, pinned to the
still's top-right and held at a constant size through the focus pop (a
1:1-texel mask whose size rode the scale spring would re-rasterise and
re-upload every animating frame).

That exposed a real inconsistency underneath: the filmstrip's resume bar
was drawn in the player scrubber's white `RAIL_*` tokens, while every
poster in the product draws the same rail in amber `RESUME_*` — which
those two tokens are documented for. Left alone, this tile would have
been the only place showing two progress colours side by side, so the
bar moves onto the pair it belongs to. Amber is now the one watched-state
hue everywhere: corner angle, resume bar, check.

Known and NOT fixed here, because the fix belongs to the exit path and
not to this file: leaving the player refetches the detail on the same
frame that `route::scrobble_stop` posts the final timeline from a worker,
so a just-finished episode can be re-fetched before PMS has scrobbled and
briefly draws a near-full resume bar instead of its new check. `app.rs`
already defers the post-playback HUB refresh 800ms for exactly this
reason; the detail refetch wants the same treatment.

Verified on the TV against The Morning Show (rk=437), whose two seasons
give all three states in one screen: season 1 (10/10 watched) draws ten
checks; season 2 draws a check on E1, amber bars at 18% and 71% on E2/E3,
and nothing on E4-E10. FPS gates 5/5.

Tests: +1 host (59)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc
Copilot AI review requested due to automatic review settings July 29, 2026 17:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@GLinnik21
GLinnik21 merged commit f4cb279 into main Jul 30, 2026
@GLinnik21
GLinnik21 deleted the unit-2-episode-watched-state branch August 2, 2026 18:37
GLinnik21 added a commit that referenced this pull request Aug 3, 2026
…llback

Two fixes so audio-track switching stays native 4K HEVC instead of dropping to a
1080p server transcode:

1. Local /decision fallback now matches our capability profile. When the server
   decision request returns nothing (silent http failure), the code fell back to a
   stale "h264 && ac3" test that transcoded every HEVC+E-AC3 item (e.g. Morning
   Show episodes silently dropped to 1080p). Fallback is now h264|hevc + aac|ac3|eac3.

2. Native audio-track switch: feed the chosen audio stream from the SAME MKV instead
   of asking the server to transcode. The demuxer selects the Nth audio stream
   (SHARED.desired_audio_idx, which PERSISTS across seeks — reset only on a new item),
   and the switch reloads direct-play at the current position with that track's codec.
   The track menu picks native when the item direct-plays and the target codec is
   direct-playable (aac/ac3/eac3); else it falls back to the transcode switch
   (TrueHD/DTS, or an already-transcoding item). Verified on 1805: switching audio
   stays HEVC (codec_id=174), feeds a=#2, and plays straight through.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21 added a commit that referenced this pull request Aug 3, 2026
…scoding

An item whose video direct-plays (H264/HEVC) but whose DEFAULT audio doesn't
(e.g. Toy Story 3 — TrueHD default) was fully transcoded by the server, dropping
4K HEVC to 1080p H264. But such items often carry a second, direct-playable audio
track (Toy Story 3 has an AC3 track). Since we own the demuxer, we now DIRECT-PLAY
the raw file and feed that track: native 4K HEVC + AC3, no transcode at all — better
than the official app (which direct-streams the video but still transcodes the audio
to EAC3).

route::pick_dp_audio returns the default track if it's direct-playable, else the
first other direct-playable track (only fetching the track list — metadata::
audio_codecs — when the default isn't DP, so the common path adds no round-trip).
build_stream direct-plays when the video is DP AND some audio track is DP, setting
STREAM_ACODEC to that track's codec and player::set_audio_track(idx) so the demuxer
feeds it (desired_audio_idx persists across seeks). Falls back to the server
/decision → transcode only when NO audio track is direct-playable (TrueHD/DTS-only).
Verified: 1926 direct-plays codec_id=174 3840x2160 a=#2 (AC3), raw file.mkv, no
start.mkv transcode; seeks reload + prime cleanly.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21 added a commit that referenced this pull request Aug 3, 2026
…IN pad, async seasons

Home hero:
- LEFT pages the hero back (not just right); held LEFT keeps paging
- bottom-anchor the hero text block (HERO_TEXT_BOTTOM) so Play/dots/spacing
  hold steady across title flips
- hero synopsis bumped to MICRO=22, one rung under the meta line

Home grid:
- cards sit lower under their section titles (CARD_DY 12->26, ROW_PITCH->549)
- full title-lift for the first two slots so a 2nd-card pop no longer sinks
  the heading into the ring

Detail:
- episode meta re-paced (EPISODE->title air, air date to the bottom at MICRO)
- About card clips title/genres to the frame; MORE is quiet grey pinned right
  on the last synopsis line, which now fades to transparency into it (dedicated
  TPROGF text-fade GL program so plain glyphs pay no per-fragment cost)
- seasons/episodes/tabs keep their scroll + per-section focus memory; reset
  only on an actual season change
- season switching is async (SEASON_GEN/RESULT mailbox + pump_season); the old
  row dims + spins while the next loads -- no UI freeze on rapid switching

Profiles / PIN:
- PIN dots centered between label and keypad; backspace moved bottom-right
- wrong PIN flashes the dots red and keeps the pad up; only PIN-blaming failures
  flash (others close the pad so the real error shows)
- circular tiles (profile chip, avatars, cast) lose the square glow box
  (Painter::ring widens only circular quads)

Reviewed: 4 correctness bugs fixed (async-season mailbox wedge, play-during-fetch,
redundant refetch, PIN-vs-other failure); Opus cleanup applied (fade program split,
reset_view_state/supersede_season dedup).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kcauj6zm932EtcdTTtW998
GLinnik21 added a commit that referenced this pull request Aug 3, 2026
…caught

New harness op {"op":"seek","mode":"rapid"}: /tmp/plxnative-autoseek is now a
seek SCRIPT (optional gap=<ms>, default 300, then comma steps - absolute "120"
or tap-relative "+10"/"-10" against the last requested target), so a case can
emulate a user rapid-tapping LEFT/RIGHT while earlier seeks are still
resolving. op_seek_rapid asserts >=2 in-place seeks fired, no reload_at
escalation, the post-burst timeline reaches the final target AND keeps
climbing, and the audio lane resumes (the historical rapid-back-tap silence
bug). Two cases: substance_seek_rapid (H264, fwd burst + back jump) and
morning_show_seek_rapid (4K HEVC HDR10, rapid 10s-back taps). An empty
trigger file still means the classic single seek to 140s.

The cases immediately caught a real defect - deterministic, not flaky (2/2
runs): SEEK_STUCK_MS=500 was shorter than a real reopen+av_seek+keyframe
(~700ms on 4K HEVC), so during a burst the watchdog fired mid-open, and its
retry CLOSES the demux socket - killing the open it was waiting on and
restarting it. Retry #2 repeated the kill, then escalated to a full reload.
The retries/reload also re-armed the ORIGINAL stale target, ignoring the
newer coalesced taps, forcing yet another seek after the reload landed.

Fix (pump.rs): SEEK_STUCK_MS 500->1200 (comfortably above real anchor
latency; the watchdog only catches genuinely lost reopens) and the
retry/reload now adopt the NEWEST coalesced target from TX.seek_to_ns
(re-arming seek_target_ns so the rebase guard keys on it).

Verified: pre-fix 0/2 rapid cases pass (reload escalation both titles);
post-fix flake hunt 8 iterations x 2 cases = 16/16 PASS with ZERO watchdog
retries (every burst seek anchors naturally, coalescing works as designed);
full 18-case suite PASS as the pump-change regression.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kcauj6zm932EtcdTTtW998
GLinnik21 added a commit that referenced this pull request Aug 23, 2026
… real socket

CI was red on Linux with `thread '<unknown>' has overflowed its stack`,
at a different point in the output each run, while `make check` passed on
the dev Mac. The mechanism is not serde_json and not the session file.

`moving_a_server_to_https_re_points_its_slot` called the public
`register_origin`, where every other test in this module deliberately
goes through `register_with_client_id`. The public path fires
`serverinfo::refresh`, which spawns a `task::spawn_small` worker that
really opens a socket — and in a DEBUG build `stream::http_stream_boxed`
materialises its 64 KiB `HttpStream` as a STACK temporary before it ever
reaches the heap, despite the comment above it promising the opposite
("box it off the caller's stack"). lldb caught it on the guard page:

    frame #0  stream::http_stream_boxed
    frame #1  stream::http_get(host="10.0.0.1", port=32400, …)
    frame #2  Client::get_json
    frame #3  Client::server_root
    frame #4  serverinfo::fetch_once
    frame #5  serverinfo::refresh::{closure#0}   <- spawn_small, 256 KiB

Measured on this branch by varying `SMALL_STACK`: debug overflows at 48,
128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is
exactly why one host passed and the other did not. **`--release` passes at
48 KiB**, so the optimizer elides the temporary and the television — which
ships `cargo build --release` (Makefile:438) — is not affected. It is a
latent debug-only hazard in `stream.rs`, pre-existing and not this
branch's to fix; the base simply had no host test that reached
`http_get` from a `spawn_small` worker. Reported on the PR.

The fix is the test, which was wrong on its own terms: `register` also
mints and PERSISTS a client-id uuid, and that seam's doc has said since it
was written that a host test must not write one. It gains an origin-taking
sibling (the pair-shaped one cannot express a scheme, which is what this
test is about) and a second documented reason nobody had paid for yet.

Verified with the same differential that found it: at `SMALL_STACK = 48 *
1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both
`--test-threads=1` and parallel. `task.rs` is untouched.

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 never rebuilt from one (#53)

* transport: an Origin is what a server's address IS, and it is parsed from a URL

Everything below the transport carried a server's address as a bare
`(host, port)` pair. That pair cannot say `https`, and — the half that
matters — it cannot be *made* to say it afterwards, because the host a
`plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in
`Connection.uri`, while `Connection.address` stays the dotted quad behind
it. `probe.rs` has said so in prose since it was written ("https to the
bare IP fails validation by design"), and `auth::resolve_roster` then
threw `Candidate::url` away and wrote `address` into the session file. A
later lane adding a `scheme` field on top of that would have produced a
control plane that looks like it speaks TLS and fails hostname validation
on every real server.

So: `plex::Origin` — scheme + host + port, parsed from a URL by
`Origin::parse`, never assembled from an address. `Candidate::origin()`
is the one derivation; `Candidate::address` is documented down to what it
actually is, the diagnostic half.

Threaded through every site that passed a bare pair: `Client` (with
`host()`/`port()` kept as views, so the ~30 call sites below the layer
are untouched), `StreamUrl` and its two construction sites,
`register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`,
`app.rs`'s boot gate and `install_pms`, and the engine's URL splitter.
`dev::DevServer` gains an optional `scheme`, which is how an https origin
can be exercised headlessly through the `plxnative-servers` trigger by
anyone who has no such server to discover.

Two invariants are pinned by tests rather than left to prose.
`Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node —
and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL
serialization; `probe::host_of` returned the bracketed spelling and is
gone, replaced by one shared reading of a URL. And a session file written
by 0.4.1, carrying `address`/`port` and no origin, must still boot as
`http://{address}:{port}`: `Session::server` is not a soft-parsed roster
entry, so dropping it is a silent sign-out at every boot for every
existing user. Both have a test with a literal 0.4.1-shaped JSON string.

NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same
address: `dial_target` accepts only a plain-http IPv4 candidate, whose
URL `probe::candidates` synthesized as `http://{address}:{port}`, so the
parsed origin and the old pair are equal today — asserted, not assumed.
The registry's two log lines now print `origin.authority()`, which is
byte-identical for every http/IPv4 origin and correct for a v6 literal,
which `{host}:{port}` could not spell at all.

996 host tests pass. A simulator boot against a real PMS produces an
event log identical to the pre-change one on all 30 non-heartbeat lines;
the three `loop=`/`fps=` lines vary run to run on an unchanged binary.

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

* docs: name what the origin model made stale, rather than leaving it to rot

`plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the
registry in terms of `(host, port)`, which is the shape the change
replaced. `docs/plex-api-design.md` is a design note whose sketches were
the implementation of their day — it gets a banner naming the one thing
in it that would now mislead (rule 9, "Numeric host, no DNS", and the
two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains
the `plxnative-servers` trigger's new `scheme` field, which is the only
way to put a TLS origin through the registry without an account that
has one.

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

* session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()`

`SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside
a METHOD `origin()` (the parsed value). Rust puts those in different
namespaces so it compiles either way, which is exactly the problem: two
characters separate "the raw JSON string" from "the thing to dial", at
every use, forever. The field takes the `_url` suffix; `#[serde(rename)]`
keeps the FILE's key spelled `origin`, which is what a human editing a
session file on the television reads, and the round-trip test proves the
rename applies to both halves of serde.

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

* review: close the gap between the origin that was DIALLED and the one recorded

Eight findings from `/code-review high`; six fixed, two answered in prose.

**The one that mattered.** `resolve_roster` recorded `Candidate::origin()`
while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the
comment justifying that divergence was wrong about its own gate:
`dial_target` checks `is_ipv4_literal(&c.address)`, which admits a
plex.tv-advertised `uri` candidate and not only the synthesized twin. A
connection whose `uri` names a different port from `port` would be
verified at one and written into the session file as the other, and every
later request would go somewhere nothing ever answered from. So
`dial_target` now returns the ORIGIN, `probe_server` dials that origin's
host and port, and `Reach::At` carries it back beside the candidate — one
value, so what answered and what is recorded cannot be two addresses. The
candidate stays for the diagnostic fields. Its fixture had `url` and
`port` disagreeing, which is what let the old shape look consistent; it
builds both from one pair now, as `probe::candidates` does.

**The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field
exists so a lane with no TLS server of its own can put an https origin
through the registry — and both registry log lines and `DevServer::
describe` printed `host:port`, so such a run was byte-identical to an
http one. `Origin::log_form()` is the shared answer: the bare authority
for a plaintext origin (an archived log stays comparable, and the
byte-identical gate holds) and the whole URL as soon as the scheme is
worth saying.

**`player::engine` REFUSES a TLS stream target** instead of silently
downgrading it, which is what the code did while its comment claimed the
opposite. It is reachable today: a client registered at an https origin
copies that origin into `direct_play_url`/`transcode_start_url`, so
`route` would store an https URL and the engine would open a plaintext
socket to it.

Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot
be dialled, so `Origin::parse` refuses it rather than defaulting to 32400
— a truncated write of the session file is exactly the "port nobody wrote
down" case `dial_port` exists for. And `reconcile_primary` no longer logs
"primary now answers at …" when the only thing that changed was the
stored origin going from empty to populated, which is what the FIRST BOOT
after this lands does on every existing install — a false DHCP-churn
report in the file this project treats as its primary evidence surface.

Answered rather than changed: `Origin::port`'s doc claimed a narrowing one
constructor does not perform (`ServerRef::origin`'s legacy `port as i32`),
so the doc now says where the narrowing really lives; and
`Session::can_go_local` still asks "is there an address written down"
rather than "can THIS build's transport open it" — gating it would send a
user to a QR code for a transport gap that is not theirs, and the
half-landed state it exposes is named in the doc and refused out loud one
layer down, in the engine.

997 host tests pass. The simulator event log is still identical to the
pre-change one on all 30 non-heartbeat lines.

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

* tests: a registry test must not call the PUBLIC register — it opens a real socket

CI was red on Linux with `thread '<unknown>' has overflowed its stack`,
at a different point in the output each run, while `make check` passed on
the dev Mac. The mechanism is not serde_json and not the session file.

`moving_a_server_to_https_re_points_its_slot` called the public
`register_origin`, where every other test in this module deliberately
goes through `register_with_client_id`. The public path fires
`serverinfo::refresh`, which spawns a `task::spawn_small` worker that
really opens a socket — and in a DEBUG build `stream::http_stream_boxed`
materialises its 64 KiB `HttpStream` as a STACK temporary before it ever
reaches the heap, despite the comment above it promising the opposite
("box it off the caller's stack"). lldb caught it on the guard page:

    frame #0  stream::http_stream_boxed
    frame #1  stream::http_get(host="10.0.0.1", port=32400, …)
    frame #2  Client::get_json
    frame #3  Client::server_root
    frame #4  serverinfo::fetch_once
    frame #5  serverinfo::refresh::{closure#0}   <- spawn_small, 256 KiB

Measured on this branch by varying `SMALL_STACK`: debug overflows at 48,
128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is
exactly why one host passed and the other did not. **`--release` passes at
48 KiB**, so the optimizer elides the temporary and the television — which
ships `cargo build --release` (Makefile:438) — is not affected. It is a
latent debug-only hazard in `stream.rs`, pre-existing and not this
branch's to fix; the base simply had no host test that reached
`http_get` from a `spawn_small` worker. Reported on the PR.

The fix is the test, which was wrong on its own terms: `register` also
mints and PERSISTS a client-id uuid, and that seam's doc has said since it
was written that a host test must not write one. It gains an origin-taking
sibling (the pair-shaped one cannot express a scheme, which is what this
test is about) and a second documented reason nobody had paid for yet.

Verified with the same differential that found it: at `SMALL_STACK = 48 *
1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both
`--test-threads=1` and parallel. `task.rs` is untouched.

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 23, 2026
…had gone false (#55)

* docs: the UX scenario LG's checklist defers to, and four claims that had gone false

LG's App Self Checklist does not describe four of its own items — #2, #10, #42
and #45 defer to the UX scenario document, and #45 says so in as many words
("refer to UX scenario for movement details"). That makes the scenario the
artefact QA grades the transport against, so `docs/ux-scenario.md` is written as
a compliance document rather than a tour: every screen, how it is reached, every
control on it, what each remote key does on each screen, the BACK trail, and the
exit alert.

Two of its sections carry the weight.

**§6 — playback control.** There is no on-screen `<< || >>` transport row and
there will not be one; transport is remote-driven and the HUD shows STATE, a
mark beside the elapsed clock and nothing at all while playing steadily. That is
stated as settled rather than apologised for, with the grounds: on-screen
controls are Recommended rather than mandatory, the idiom already ships approved
on these sets, and the half that must really work — the FF/REW/play/pause/stop
keys — is bound and was settled 2026-08-22 against LG's own evdev table and 336
captured key lines. The section documents the transport as it IS: three focus
bands, the 4.5 s linger, the 10 s preview-then-commit seek with its 450 ms tap
accumulation, the six state marks and their precedence, and the control row's
three mutually exclusive occupants (discs / Skip pill / Up Next).

**§7 — sound.** There is no UI audio at all, and the item is therefore N/A on
its own precondition. Checked five ways rather than asserted: SDL is initialised
`SDL_INIT_VIDEO` alone, no SDL audio call exists, SDL_mixer is neither present
nor linked, there are no audio assets, and no webOS sound service is called.

Eleven figures, taken from the simulator at the authored 1920x1080 with the dev
counter compiled out. The player HUD is the existing device capture, because the
Starfish/ACB seam does not exist off-device — §9 lists the figures that still
need a television and why the who's-watching picker is deliberately not among
them (its roster is real people's names). One figure is edited and says so: the
Search scope line named a real server, and is replaced by the app's own string
for a server that reports no name.

And four corrections, each verified against the tree first:

- `docs/distribution.md` §2 no longer says native Store eligibility is
  unsettled. It rested on LG's `appinfo.json` reference ("Only `web` is allowed
  currently") — a `develop/*` WEB-RUNTIME page, which is not authority over a
  native SDL app. Seller Lounge parses this project's ipk as File Type: Native
  and asks for the native SDK version, chipset and resolution. What is open is
  the QA outcome, not the permission. The summary table's "No." row went with it.
- `docs/pms-api.md` — the `X-Plex-*` list was the minimum PMS needs to attribute
  a session, read for years as the identity set. Recorded the full set the
  official webOS client sends, including `X-Plex-Platform-Version` (Plex gates
  on FIRMWARE, which `X-Plex-Platform` cannot express) and `X-Plex-Features`,
  whose exact effect this repo has not measured and which is graded as such.
- `docs/shared-servers.md` — it called the `plex.direct` middle label "the
  certificate UUID, not the machineIdentifier" while `plex-openapi.json` calls
  the same label "The unique identifier of this particular PMS". Both are 32 hex
  characters, so no sample settles it. Recorded as a disagreement rather than
  resolved, with the rule that survives either answer: use the advertised `uri`
  verbatim, never construct the hostname.
- `docs/search.md` — deleted the status blockquote. Its own staleness test had
  fired: it claimed `ui/search/`'s `draw` bodies are `{}` (mod.rs is ~2200 lines
  with `draw()` at :832), that `search::pump` lands nothing, and that
  `Client::search` has zero callers (`search.rs:797` calls it).

`rust-modules/src/img.rs` is the only code touched, and only its comments: three
said `requiredMemory: 60` against `pkg/appinfo.json`'s 160.

make check: 976 passed.

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

* docs: two rendering/consistency fixes in the UX scenario

`<Name>` in the PIN-pad description was raw in prose, so a markdown renderer
swallows it as an HTML tag and the sentence reads "Enter 's PIN". Moved inside
backticks.

And the provenance note said "two figures are edited" in the same breath as
naming one. There is one: the Search scope line.

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

* docs: state Home's play-on-OK rule exactly, not approximately

The scenario said "OK on a Continue Watching card resumes, OK anywhere else
opens the detail page". Right about the deck, incomplete about the rest:
`home_activate` plays on `hub_is_continue(row) || mm.kind == 3`, so an EPISODE
card plays from any shelf. And a show/season card does not simply open its page
— it opens it, waits for the load to land on the expected item, and only then
fires Play, precisely so a failed fetch cannot play whatever page was open
before.

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

* docs: six claims the auditor refuted, five of them in the document written to be graded

`doc-claim-auditor` over the new UX scenario and the four corrections. Six
findings in files this unit owns; all six were confirmed against the code before
being fixed.

**The chevron is not a control.** The hero action-row table listed `›` under
"what OK does". `home.rs:44-50` says the opposite in as many words — `HERO_NBTN`
is 2, "the pager chevron beside them is an INDICATOR, not a third button: it is
drawn, it is never focused and it has no hit rect". The hero pages by RIGHT past
the info disc or LEFT off the pill (`home_hero_key`), plus an 8 s auto-flip.
This is the row a QA reader would have tried first and failed, in the one
document written for QA to read.

**"No control anywhere can take focus and do nothing" had two counterexamples.**
OK on Home's own tab pill standing on Home is a documented no-op (`app.rs:2126`),
and the person page's header band holds focus but only acts when there is a
biography long enough to expand (`person.rs:626`). Narrowed to what is true and
still answers #10, with both stops named.

**The synthesized tail can never raise a Skip pill.** The document said it
"stands in" where the server has no credits detection, and two lines later that
Skip Credits "remains for the last episode of a show". `synthesized_tail_marker`
returns None unless `has_next` (`metadata.rs:674`) and every Credits marker with
a successor resolves to Up Next (`player_hud.rs:401`), so the tail raises Up Next
100% of the time. Stated with its gate, plus the bench consequence: on a
Pass-less server Skip Credits is unreachable.

**The show/season sentence contradicted the one above it** — my own previous
commit's doing. The open-resolve-then-Play arm is INSIDE `want_play`
(`app.rs:2152`), so it is the deck rule, not the general one; elsewhere a show
card is a bare `nav_open`. Folded into the deck paragraph.

**`docs/pms-api.md` said "the five in bold" over six bolded rows**, and let the
table be read as what this app sends. Dropped the count and split the two facts:
`playback_identity` emits nine fields (`client.rs:152-162`) and none of the four
capability/locale ones exist anywhere in the tree. The table is the target; the
paragraph is the state.

**And two smaller ones**: `assets/` was said to hold 24 SVG icons against a
measured 28 — the number is decoration inside a five-way negative proof and is
the only thing in that bullet that can rot, so it is gone; and the detail page's
watched disc wears the face of the write it would perform (`detail.rs:1087`), so
it is a ✓ on an unwatched item and a − on a watched one, not a fixed ✓.

Two further findings are in files this unit does not own and are listed in the
PR: CLAUDE.md:985 and docs/lg-self-checklist.md:17, both dangling references
this branch created.

make check: 976 passed.

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 23, 2026
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


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
…llback

Two fixes so audio-track switching stays native 4K HEVC instead of dropping to a
1080p server transcode:

1. Local /decision fallback now matches our capability profile. When the server
   decision request returns nothing (silent http failure), the code fell back to a
   stale "h264 && ac3" test that transcoded every HEVC+E-AC3 item (e.g. Morning
   Show episodes silently dropped to 1080p). Fallback is now h264|hevc + aac|ac3|eac3.

2. Native audio-track switch: feed the chosen audio stream from the SAME MKV instead
   of asking the server to transcode. The demuxer selects the Nth audio stream
   (SHARED.desired_audio_idx, which PERSISTS across seeks — reset only on a new item),
   and the switch reloads direct-play at the current position with that track's codec.
   The track menu picks native when the item direct-plays and the target codec is
   direct-playable (aac/ac3/eac3); else it falls back to the transcode switch
   (TrueHD/DTS, or an already-transcoding item). Verified on 1805: switching audio
   stays HEVC (codec_id=174), feeds a=#2, and plays straight through.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…scoding

An item whose video direct-plays (H264/HEVC) but whose DEFAULT audio doesn't
(e.g. Toy Story 3 — TrueHD default) was fully transcoded by the server, dropping
4K HEVC to 1080p H264. But such items often carry a second, direct-playable audio
track (Toy Story 3 has an AC3 track). Since we own the demuxer, we now DIRECT-PLAY
the raw file and feed that track: native 4K HEVC + AC3, no transcode at all — better
than the official app (which direct-streams the video but still transcodes the audio
to EAC3).

route::pick_dp_audio returns the default track if it's direct-playable, else the
first other direct-playable track (only fetching the track list — metadata::
audio_codecs — when the default isn't DP, so the common path adds no round-trip).
build_stream direct-plays when the video is DP AND some audio track is DP, setting
STREAM_ACODEC to that track's codec and player::set_audio_track(idx) so the demuxer
feeds it (desired_audio_idx persists across seeks). Falls back to the server
/decision → transcode only when NO audio track is direct-playable (TrueHD/DTS-only).
Verified: 1926 direct-plays codec_id=174 3840x2160 a=#2 (AC3), raw file.mkv, no
start.mkv transcode; seeks reload + prime cleanly.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…IN pad, async seasons

Home hero:
- LEFT pages the hero back (not just right); held LEFT keeps paging
- bottom-anchor the hero text block (HERO_TEXT_BOTTOM) so Play/dots/spacing
  hold steady across title flips
- hero synopsis bumped to MICRO=22, one rung under the meta line

Home grid:
- cards sit lower under their section titles (CARD_DY 12->26, ROW_PITCH->549)
- full title-lift for the first two slots so a 2nd-card pop no longer sinks
  the heading into the ring

Detail:
- episode meta re-paced (EPISODE->title air, air date to the bottom at MICRO)
- About card clips title/genres to the frame; MORE is quiet grey pinned right
  on the last synopsis line, which now fades to transparency into it (dedicated
  TPROGF text-fade GL program so plain glyphs pay no per-fragment cost)
- seasons/episodes/tabs keep their scroll + per-section focus memory; reset
  only on an actual season change
- season switching is async (SEASON_GEN/RESULT mailbox + pump_season); the old
  row dims + spins while the next loads -- no UI freeze on rapid switching

Profiles / PIN:
- PIN dots centered between label and keypad; backspace moved bottom-right
- wrong PIN flashes the dots red and keeps the pad up; only PIN-blaming failures
  flash (others close the pad so the real error shows)
- circular tiles (profile chip, avatars, cast) lose the square glow box
  (Painter::ring widens only circular quads)

Reviewed: 4 correctness bugs fixed (async-season mailbox wedge, play-during-fetch,
redundant refetch, PIN-vs-other failure); Opus cleanup applied (fade program split,
reset_view_state/supersede_season dedup).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kcauj6zm932EtcdTTtW998
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…caught

New harness op {"op":"seek","mode":"rapid"}: /tmp/plxnative-autoseek is now a
seek SCRIPT (optional gap=<ms>, default 300, then comma steps - absolute "120"
or tap-relative "+10"/"-10" against the last requested target), so a case can
emulate a user rapid-tapping LEFT/RIGHT while earlier seeks are still
resolving. op_seek_rapid asserts >=2 in-place seeks fired, no reload_at
escalation, the post-burst timeline reaches the final target AND keeps
climbing, and the audio lane resumes (the historical rapid-back-tap silence
bug). Two cases: substance_seek_rapid (H264, fwd burst + back jump) and
morning_show_seek_rapid (4K HEVC HDR10, rapid 10s-back taps). An empty
trigger file still means the classic single seek to 140s.

The cases immediately caught a real defect - deterministic, not flaky (2/2
runs): SEEK_STUCK_MS=500 was shorter than a real reopen+av_seek+keyframe
(~700ms on 4K HEVC), so during a burst the watchdog fired mid-open, and its
retry CLOSES the demux socket - killing the open it was waiting on and
restarting it. Retry #2 repeated the kill, then escalated to a full reload.
The retries/reload also re-armed the ORIGINAL stale target, ignoring the
newer coalesced taps, forcing yet another seek after the reload landed.

Fix (pump.rs): SEEK_STUCK_MS 500->1200 (comfortably above real anchor
latency; the watchdog only catches genuinely lost reopens) and the
retry/reload now adopt the NEWEST coalesced target from TX.seek_to_ns
(re-arming seek_target_ns so the rebase guard keys on it).

Verified: pre-fix 0/2 rapid cases pass (reload escalation both titles);
post-fix flake hunt 8 iterations x 2 cases = 16/16 PASS with ZERO watchdog
retries (every burst seek anchors naturally, coalescing works as designed);
full 18-case suite PASS as the pump-change regression.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kcauj6zm932EtcdTTtW998
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
… and never rebuilt from one (#53)

* transport: an Origin is what a server's address IS, and it is parsed from a URL

Everything below the transport carried a server's address as a bare
`(host, port)` pair. That pair cannot say `https`, and — the half that
matters — it cannot be *made* to say it afterwards, because the host a
`plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in
`Connection.uri`, while `Connection.address` stays the dotted quad behind
it. `probe.rs` has said so in prose since it was written ("https to the
bare IP fails validation by design"), and `auth::resolve_roster` then
threw `Candidate::url` away and wrote `address` into the session file. A
later lane adding a `scheme` field on top of that would have produced a
control plane that looks like it speaks TLS and fails hostname validation
on every real server.

So: `plex::Origin` — scheme + host + port, parsed from a URL by
`Origin::parse`, never assembled from an address. `Candidate::origin()`
is the one derivation; `Candidate::address` is documented down to what it
actually is, the diagnostic half.

Threaded through every site that passed a bare pair: `Client` (with
`host()`/`port()` kept as views, so the ~30 call sites below the layer
are untouched), `StreamUrl` and its two construction sites,
`register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`,
`app.rs`'s boot gate and `install_pms`, and the engine's URL splitter.
`dev::DevServer` gains an optional `scheme`, which is how an https origin
can be exercised headlessly through the `plxnative-servers` trigger by
anyone who has no such server to discover.

Two invariants are pinned by tests rather than left to prose.
`Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node —
and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL
serialization; `probe::host_of` returned the bracketed spelling and is
gone, replaced by one shared reading of a URL. And a session file written
by 0.4.1, carrying `address`/`port` and no origin, must still boot as
`http://{address}:{port}`: `Session::server` is not a soft-parsed roster
entry, so dropping it is a silent sign-out at every boot for every
existing user. Both have a test with a literal 0.4.1-shaped JSON string.

NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same
address: `dial_target` accepts only a plain-http IPv4 candidate, whose
URL `probe::candidates` synthesized as `http://{address}:{port}`, so the
parsed origin and the old pair are equal today — asserted, not assumed.
The registry's two log lines now print `origin.authority()`, which is
byte-identical for every http/IPv4 origin and correct for a v6 literal,
which `{host}:{port}` could not spell at all.

996 host tests pass. A simulator boot against a real PMS produces an
event log identical to the pre-change one on all 30 non-heartbeat lines;
the three `loop=`/`fps=` lines vary run to run on an unchanged binary.

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

* docs: name what the origin model made stale, rather than leaving it to rot

`plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the
registry in terms of `(host, port)`, which is the shape the change
replaced. `docs/plex-api-design.md` is a design note whose sketches were
the implementation of their day — it gets a banner naming the one thing
in it that would now mislead (rule 9, "Numeric host, no DNS", and the
two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains
the `plxnative-servers` trigger's new `scheme` field, which is the only
way to put a TLS origin through the registry without an account that
has one.

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

* session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()`

`SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside
a METHOD `origin()` (the parsed value). Rust puts those in different
namespaces so it compiles either way, which is exactly the problem: two
characters separate "the raw JSON string" from "the thing to dial", at
every use, forever. The field takes the `_url` suffix; `#[serde(rename)]`
keeps the FILE's key spelled `origin`, which is what a human editing a
session file on the television reads, and the round-trip test proves the
rename applies to both halves of serde.

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

* review: close the gap between the origin that was DIALLED and the one recorded

Eight findings from `/code-review high`; six fixed, two answered in prose.

**The one that mattered.** `resolve_roster` recorded `Candidate::origin()`
while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the
comment justifying that divergence was wrong about its own gate:
`dial_target` checks `is_ipv4_literal(&c.address)`, which admits a
plex.tv-advertised `uri` candidate and not only the synthesized twin. A
connection whose `uri` names a different port from `port` would be
verified at one and written into the session file as the other, and every
later request would go somewhere nothing ever answered from. So
`dial_target` now returns the ORIGIN, `probe_server` dials that origin's
host and port, and `Reach::At` carries it back beside the candidate — one
value, so what answered and what is recorded cannot be two addresses. The
candidate stays for the diagnostic fields. Its fixture had `url` and
`port` disagreeing, which is what let the old shape look consistent; it
builds both from one pair now, as `probe::candidates` does.

**The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field
exists so a lane with no TLS server of its own can put an https origin
through the registry — and both registry log lines and `DevServer::
describe` printed `host:port`, so such a run was byte-identical to an
http one. `Origin::log_form()` is the shared answer: the bare authority
for a plaintext origin (an archived log stays comparable, and the
byte-identical gate holds) and the whole URL as soon as the scheme is
worth saying.

**`player::engine` REFUSES a TLS stream target** instead of silently
downgrading it, which is what the code did while its comment claimed the
opposite. It is reachable today: a client registered at an https origin
copies that origin into `direct_play_url`/`transcode_start_url`, so
`route` would store an https URL and the engine would open a plaintext
socket to it.

Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot
be dialled, so `Origin::parse` refuses it rather than defaulting to 32400
— a truncated write of the session file is exactly the "port nobody wrote
down" case `dial_port` exists for. And `reconcile_primary` no longer logs
"primary now answers at …" when the only thing that changed was the
stored origin going from empty to populated, which is what the FIRST BOOT
after this lands does on every existing install — a false DHCP-churn
report in the file this project treats as its primary evidence surface.

Answered rather than changed: `Origin::port`'s doc claimed a narrowing one
constructor does not perform (`ServerRef::origin`'s legacy `port as i32`),
so the doc now says where the narrowing really lives; and
`Session::can_go_local` still asks "is there an address written down"
rather than "can THIS build's transport open it" — gating it would send a
user to a QR code for a transport gap that is not theirs, and the
half-landed state it exposes is named in the doc and refused out loud one
layer down, in the engine.

997 host tests pass. The simulator event log is still identical to the
pre-change one on all 30 non-heartbeat lines.

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

* tests: a registry test must not call the PUBLIC register — it opens a real socket

CI was red on Linux with `thread '<unknown>' has overflowed its stack`,
at a different point in the output each run, while `make check` passed on
the dev Mac. The mechanism is not serde_json and not the session file.

`moving_a_server_to_https_re_points_its_slot` called the public
`register_origin`, where every other test in this module deliberately
goes through `register_with_client_id`. The public path fires
`serverinfo::refresh`, which spawns a `task::spawn_small` worker that
really opens a socket — and in a DEBUG build `stream::http_stream_boxed`
materialises its 64 KiB `HttpStream` as a STACK temporary before it ever
reaches the heap, despite the comment above it promising the opposite
("box it off the caller's stack"). lldb caught it on the guard page:

    frame #0  stream::http_stream_boxed
    frame #1  stream::http_get(host="10.0.0.1", port=32400, …)
    frame #2  Client::get_json
    frame #3  Client::server_root
    frame #4  serverinfo::fetch_once
    frame #5  serverinfo::refresh::{closure#0}   <- spawn_small, 256 KiB

Measured on this branch by varying `SMALL_STACK`: debug overflows at 48,
128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is
exactly why one host passed and the other did not. **`--release` passes at
48 KiB**, so the optimizer elides the temporary and the television — which
ships `cargo build --release` (Makefile:438) — is not affected. It is a
latent debug-only hazard in `stream.rs`, pre-existing and not this
branch's to fix; the base simply had no host test that reached
`http_get` from a `spawn_small` worker. Reported on the PR.

The fix is the test, which was wrong on its own terms: `register` also
mints and PERSISTS a client-id uuid, and that seam's doc has said since it
was written that a host test must not write one. It gains an origin-taking
sibling (the pair-shaped one cannot express a scheme, which is what this
test is about) and a second documented reason nobody had paid for yet.

Verified with the same differential that found it: at `SMALL_STACK = 48 *
1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both
`--test-threads=1` and parallel. `task.rs` is untouched.

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
…had gone false (#55)

* docs: the UX scenario LG's checklist defers to, and four claims that had gone false

LG's App Self Checklist does not describe four of its own items — #2, #10, #42
and #45 defer to the UX scenario document, and #45 says so in as many words
("refer to UX scenario for movement details"). That makes the scenario the
artefact QA grades the transport against, so `docs/ux-scenario.md` is written as
a compliance document rather than a tour: every screen, how it is reached, every
control on it, what each remote key does on each screen, the BACK trail, and the
exit alert.

Two of its sections carry the weight.

**§6 — playback control.** There is no on-screen `<< || >>` transport row and
there will not be one; transport is remote-driven and the HUD shows STATE, a
mark beside the elapsed clock and nothing at all while playing steadily. That is
stated as settled rather than apologised for, with the grounds: on-screen
controls are Recommended rather than mandatory, the idiom already ships approved
on these sets, and the half that must really work — the FF/REW/play/pause/stop
keys — is bound and was settled 2026-08-22 against LG's own evdev table and 336
captured key lines. The section documents the transport as it IS: three focus
bands, the 4.5 s linger, the 10 s preview-then-commit seek with its 450 ms tap
accumulation, the six state marks and their precedence, and the control row's
three mutually exclusive occupants (discs / Skip pill / Up Next).

**§7 — sound.** There is no UI audio at all, and the item is therefore N/A on
its own precondition. Checked five ways rather than asserted: SDL is initialised
`SDL_INIT_VIDEO` alone, no SDL audio call exists, SDL_mixer is neither present
nor linked, there are no audio assets, and no webOS sound service is called.

Eleven figures, taken from the simulator at the authored 1920x1080 with the dev
counter compiled out. The player HUD is the existing device capture, because the
Starfish/ACB seam does not exist off-device — §9 lists the figures that still
need a television and why the who's-watching picker is deliberately not among
them (its roster is real people's names). One figure is edited and says so: the
Search scope line named a real server, and is replaced by the app's own string
for a server that reports no name.

And four corrections, each verified against the tree first:

- `docs/distribution.md` §2 no longer says native Store eligibility is
  unsettled. It rested on LG's `appinfo.json` reference ("Only `web` is allowed
  currently") — a `develop/*` WEB-RUNTIME page, which is not authority over a
  native SDL app. Seller Lounge parses this project's ipk as File Type: Native
  and asks for the native SDK version, chipset and resolution. What is open is
  the QA outcome, not the permission. The summary table's "No." row went with it.
- `docs/pms-api.md` — the `X-Plex-*` list was the minimum PMS needs to attribute
  a session, read for years as the identity set. Recorded the full set the
  official webOS client sends, including `X-Plex-Platform-Version` (Plex gates
  on FIRMWARE, which `X-Plex-Platform` cannot express) and `X-Plex-Features`,
  whose exact effect this repo has not measured and which is graded as such.
- `docs/shared-servers.md` — it called the `plex.direct` middle label "the
  certificate UUID, not the machineIdentifier" while `plex-openapi.json` calls
  the same label "The unique identifier of this particular PMS". Both are 32 hex
  characters, so no sample settles it. Recorded as a disagreement rather than
  resolved, with the rule that survives either answer: use the advertised `uri`
  verbatim, never construct the hostname.
- `docs/search.md` — deleted the status blockquote. Its own staleness test had
  fired: it claimed `ui/search/`'s `draw` bodies are `{}` (mod.rs is ~2200 lines
  with `draw()` at :832), that `search::pump` lands nothing, and that
  `Client::search` has zero callers (`search.rs:797` calls it).

`rust-modules/src/img.rs` is the only code touched, and only its comments: three
said `requiredMemory: 60` against `pkg/appinfo.json`'s 160.

make check: 976 passed.

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

* docs: two rendering/consistency fixes in the UX scenario

`<Name>` in the PIN-pad description was raw in prose, so a markdown renderer
swallows it as an HTML tag and the sentence reads "Enter 's PIN". Moved inside
backticks.

And the provenance note said "two figures are edited" in the same breath as
naming one. There is one: the Search scope line.

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

* docs: state Home's play-on-OK rule exactly, not approximately

The scenario said "OK on a Continue Watching card resumes, OK anywhere else
opens the detail page". Right about the deck, incomplete about the rest:
`home_activate` plays on `hub_is_continue(row) || mm.kind == 3`, so an EPISODE
card plays from any shelf. And a show/season card does not simply open its page
— it opens it, waits for the load to land on the expected item, and only then
fires Play, precisely so a failed fetch cannot play whatever page was open
before.

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

* docs: six claims the auditor refuted, five of them in the document written to be graded

`doc-claim-auditor` over the new UX scenario and the four corrections. Six
findings in files this unit owns; all six were confirmed against the code before
being fixed.

**The chevron is not a control.** The hero action-row table listed `›` under
"what OK does". `home.rs:44-50` says the opposite in as many words — `HERO_NBTN`
is 2, "the pager chevron beside them is an INDICATOR, not a third button: it is
drawn, it is never focused and it has no hit rect". The hero pages by RIGHT past
the info disc or LEFT off the pill (`home_hero_key`), plus an 8 s auto-flip.
This is the row a QA reader would have tried first and failed, in the one
document written for QA to read.

**"No control anywhere can take focus and do nothing" had two counterexamples.**
OK on Home's own tab pill standing on Home is a documented no-op (`app.rs:2126`),
and the person page's header band holds focus but only acts when there is a
biography long enough to expand (`person.rs:626`). Narrowed to what is true and
still answers #10, with both stops named.

**The synthesized tail can never raise a Skip pill.** The document said it
"stands in" where the server has no credits detection, and two lines later that
Skip Credits "remains for the last episode of a show". `synthesized_tail_marker`
returns None unless `has_next` (`metadata.rs:674`) and every Credits marker with
a successor resolves to Up Next (`player_hud.rs:401`), so the tail raises Up Next
100% of the time. Stated with its gate, plus the bench consequence: on a
Pass-less server Skip Credits is unreachable.

**The show/season sentence contradicted the one above it** — my own previous
commit's doing. The open-resolve-then-Play arm is INSIDE `want_play`
(`app.rs:2152`), so it is the deck rule, not the general one; elsewhere a show
card is a bare `nav_open`. Folded into the deck paragraph.

**`docs/pms-api.md` said "the five in bold" over six bolded rows**, and let the
table be read as what this app sends. Dropped the count and split the two facts:
`playback_identity` emits nine fields (`client.rs:152-162`) and none of the four
capability/locale ones exist anywhere in the tree. The table is the target; the
paragraph is the state.

**And two smaller ones**: `assets/` was said to hold 24 SVG icons against a
measured 28 — the number is decoration inside a five-way negative proof and is
the only thing in that bullet that can rot, so it is gone; and the detail page's
watched disc wears the face of the write it would perform (`detail.rs:1087`), so
it is a ✓ on an unwatched item and a − on a watched one, not a fixed ✓.

Two further findings are in files this unit does not own and are listed in the
PR: CLAUDE.md:985 and docs/lg-self-checklist.md:17, both dangling references
this branch created.

make check: 976 passed.

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
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


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 never rebuilt from one (#53)

* transport: an Origin is what a server's address IS, and it is parsed from a URL

Everything below the transport carried a server's address as a bare
`(host, port)` pair. That pair cannot say `https`, and — the half that
matters — it cannot be *made* to say it afterwards, because the host a
`plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in
`Connection.uri`, while `Connection.address` stays the dotted quad behind
it. `probe.rs` has said so in prose since it was written ("https to the
bare IP fails validation by design"), and `auth::resolve_roster` then
threw `Candidate::url` away and wrote `address` into the session file. A
later lane adding a `scheme` field on top of that would have produced a
control plane that looks like it speaks TLS and fails hostname validation
on every real server.

So: `plex::Origin` — scheme + host + port, parsed from a URL by
`Origin::parse`, never assembled from an address. `Candidate::origin()`
is the one derivation; `Candidate::address` is documented down to what it
actually is, the diagnostic half.

Threaded through every site that passed a bare pair: `Client` (with
`host()`/`port()` kept as views, so the ~30 call sites below the layer
are untouched), `StreamUrl` and its two construction sites,
`register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`,
`app.rs`'s boot gate and `install_pms`, and the engine's URL splitter.
`dev::DevServer` gains an optional `scheme`, which is how an https origin
can be exercised headlessly through the `plxnative-servers` trigger by
anyone who has no such server to discover.

Two invariants are pinned by tests rather than left to prose.
`Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node —
and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL
serialization; `probe::host_of` returned the bracketed spelling and is
gone, replaced by one shared reading of a URL. And a session file written
by 0.4.1, carrying `address`/`port` and no origin, must still boot as
`http://{address}:{port}`: `Session::server` is not a soft-parsed roster
entry, so dropping it is a silent sign-out at every boot for every
existing user. Both have a test with a literal 0.4.1-shaped JSON string.

NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same
address: `dial_target` accepts only a plain-http IPv4 candidate, whose
URL `probe::candidates` synthesized as `http://{address}:{port}`, so the
parsed origin and the old pair are equal today — asserted, not assumed.
The registry's two log lines now print `origin.authority()`, which is
byte-identical for every http/IPv4 origin and correct for a v6 literal,
which `{host}:{port}` could not spell at all.

996 host tests pass. A simulator boot against a real PMS produces an
event log identical to the pre-change one on all 30 non-heartbeat lines;
the three `loop=`/`fps=` lines vary run to run on an unchanged binary.

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

* docs: name what the origin model made stale, rather than leaving it to rot

`plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the
registry in terms of `(host, port)`, which is the shape the change
replaced. `docs/plex-api-design.md` is a design note whose sketches were
the implementation of their day — it gets a banner naming the one thing
in it that would now mislead (rule 9, "Numeric host, no DNS", and the
two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains
the `plxnative-servers` trigger's new `scheme` field, which is the only
way to put a TLS origin through the registry without an account that
has one.

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

* session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()`

`SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside
a METHOD `origin()` (the parsed value). Rust puts those in different
namespaces so it compiles either way, which is exactly the problem: two
characters separate "the raw JSON string" from "the thing to dial", at
every use, forever. The field takes the `_url` suffix; `#[serde(rename)]`
keeps the FILE's key spelled `origin`, which is what a human editing a
session file on the television reads, and the round-trip test proves the
rename applies to both halves of serde.

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

* review: close the gap between the origin that was DIALLED and the one recorded

Eight findings from `/code-review high`; six fixed, two answered in prose.

**The one that mattered.** `resolve_roster` recorded `Candidate::origin()`
while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the
comment justifying that divergence was wrong about its own gate:
`dial_target` checks `is_ipv4_literal(&c.address)`, which admits a
plex.tv-advertised `uri` candidate and not only the synthesized twin. A
connection whose `uri` names a different port from `port` would be
verified at one and written into the session file as the other, and every
later request would go somewhere nothing ever answered from. So
`dial_target` now returns the ORIGIN, `probe_server` dials that origin's
host and port, and `Reach::At` carries it back beside the candidate — one
value, so what answered and what is recorded cannot be two addresses. The
candidate stays for the diagnostic fields. Its fixture had `url` and
`port` disagreeing, which is what let the old shape look consistent; it
builds both from one pair now, as `probe::candidates` does.

**The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field
exists so a lane with no TLS server of its own can put an https origin
through the registry — and both registry log lines and `DevServer::
describe` printed `host:port`, so such a run was byte-identical to an
http one. `Origin::log_form()` is the shared answer: the bare authority
for a plaintext origin (an archived log stays comparable, and the
byte-identical gate holds) and the whole URL as soon as the scheme is
worth saying.

**`player::engine` REFUSES a TLS stream target** instead of silently
downgrading it, which is what the code did while its comment claimed the
opposite. It is reachable today: a client registered at an https origin
copies that origin into `direct_play_url`/`transcode_start_url`, so
`route` would store an https URL and the engine would open a plaintext
socket to it.

Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot
be dialled, so `Origin::parse` refuses it rather than defaulting to 32400
— a truncated write of the session file is exactly the "port nobody wrote
down" case `dial_port` exists for. And `reconcile_primary` no longer logs
"primary now answers at …" when the only thing that changed was the
stored origin going from empty to populated, which is what the FIRST BOOT
after this lands does on every existing install — a false DHCP-churn
report in the file this project treats as its primary evidence surface.

Answered rather than changed: `Origin::port`'s doc claimed a narrowing one
constructor does not perform (`ServerRef::origin`'s legacy `port as i32`),
so the doc now says where the narrowing really lives; and
`Session::can_go_local` still asks "is there an address written down"
rather than "can THIS build's transport open it" — gating it would send a
user to a QR code for a transport gap that is not theirs, and the
half-landed state it exposes is named in the doc and refused out loud one
layer down, in the engine.

997 host tests pass. The simulator event log is still identical to the
pre-change one on all 30 non-heartbeat lines.

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

* tests: a registry test must not call the PUBLIC register — it opens a real socket

CI was red on Linux with `thread '<unknown>' has overflowed its stack`,
at a different point in the output each run, while `make check` passed on
the dev Mac. The mechanism is not serde_json and not the session file.

`moving_a_server_to_https_re_points_its_slot` called the public
`register_origin`, where every other test in this module deliberately
goes through `register_with_client_id`. The public path fires
`serverinfo::refresh`, which spawns a `task::spawn_small` worker that
really opens a socket — and in a DEBUG build `stream::http_stream_boxed`
materialises its 64 KiB `HttpStream` as a STACK temporary before it ever
reaches the heap, despite the comment above it promising the opposite
("box it off the caller's stack"). lldb caught it on the guard page:

    frame #0  stream::http_stream_boxed
    frame #1  stream::http_get(host="10.0.0.1", port=32400, …)
    frame #2  Client::get_json
    frame #3  Client::server_root
    frame #4  serverinfo::fetch_once
    frame #5  serverinfo::refresh::{closure#0}   <- spawn_small, 256 KiB

Measured on this branch by varying `SMALL_STACK`: debug overflows at 48,
128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is
exactly why one host passed and the other did not. **`--release` passes at
48 KiB**, so the optimizer elides the temporary and the television — which
ships `cargo build --release` (Makefile:438) — is not affected. It is a
latent debug-only hazard in `stream.rs`, pre-existing and not this
branch's to fix; the base simply had no host test that reached
`http_get` from a `spawn_small` worker. Reported on the PR.

The fix is the test, which was wrong on its own terms: `register` also
mints and PERSISTS a client-id uuid, and that seam's doc has said since it
was written that a host test must not write one. It gains an origin-taking
sibling (the pair-shaped one cannot express a scheme, which is what this
test is about) and a second documented reason nobody had paid for yet.

Verified with the same differential that found it: at `SMALL_STACK = 48 *
1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both
`--test-threads=1` and parallel. `task.rs` is untouched.

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
…had gone false (#55)

* docs: the UX scenario LG's checklist defers to, and four claims that had gone false

LG's App Self Checklist does not describe four of its own items — #2, #10, #42
and #45 defer to the UX scenario document, and #45 says so in as many words
("refer to UX scenario for movement details"). That makes the scenario the
artefact QA grades the transport against, so `docs/ux-scenario.md` is written as
a compliance document rather than a tour: every screen, how it is reached, every
control on it, what each remote key does on each screen, the BACK trail, and the
exit alert.

Two of its sections carry the weight.

**§6 — playback control.** There is no on-screen `<< || >>` transport row and
there will not be one; transport is remote-driven and the HUD shows STATE, a
mark beside the elapsed clock and nothing at all while playing steadily. That is
stated as settled rather than apologised for, with the grounds: on-screen
controls are Recommended rather than mandatory, the idiom already ships approved
on these sets, and the half that must really work — the FF/REW/play/pause/stop
keys — is bound and was settled 2026-08-22 against LG's own evdev table and 336
captured key lines. The section documents the transport as it IS: three focus
bands, the 4.5 s linger, the 10 s preview-then-commit seek with its 450 ms tap
accumulation, the six state marks and their precedence, and the control row's
three mutually exclusive occupants (discs / Skip pill / Up Next).

**§7 — sound.** There is no UI audio at all, and the item is therefore N/A on
its own precondition. Checked five ways rather than asserted: SDL is initialised
`SDL_INIT_VIDEO` alone, no SDL audio call exists, SDL_mixer is neither present
nor linked, there are no audio assets, and no webOS sound service is called.

Eleven figures, taken from the simulator at the authored 1920x1080 with the dev
counter compiled out. The player HUD is the existing device capture, because the
Starfish/ACB seam does not exist off-device — §9 lists the figures that still
need a television and why the who's-watching picker is deliberately not among
them (its roster is real people's names). One figure is edited and says so: the
Search scope line named a real server, and is replaced by the app's own string
for a server that reports no name.

And four corrections, each verified against the tree first:

- `docs/distribution.md` §2 no longer says native Store eligibility is
  unsettled. It rested on LG's `appinfo.json` reference ("Only `web` is allowed
  currently") — a `develop/*` WEB-RUNTIME page, which is not authority over a
  native SDL app. Seller Lounge parses this project's ipk as File Type: Native
  and asks for the native SDK version, chipset and resolution. What is open is
  the QA outcome, not the permission. The summary table's "No." row went with it.
- `docs/pms-api.md` — the `X-Plex-*` list was the minimum PMS needs to attribute
  a session, read for years as the identity set. Recorded the full set the
  official webOS client sends, including `X-Plex-Platform-Version` (Plex gates
  on FIRMWARE, which `X-Plex-Platform` cannot express) and `X-Plex-Features`,
  whose exact effect this repo has not measured and which is graded as such.
- `docs/shared-servers.md` — it called the `plex.direct` middle label "the
  certificate UUID, not the machineIdentifier" while `plex-openapi.json` calls
  the same label "The unique identifier of this particular PMS". Both are 32 hex
  characters, so no sample settles it. Recorded as a disagreement rather than
  resolved, with the rule that survives either answer: use the advertised `uri`
  verbatim, never construct the hostname.
- `docs/search.md` — deleted the status blockquote. Its own staleness test had
  fired: it claimed `ui/search/`'s `draw` bodies are `{}` (mod.rs is ~2200 lines
  with `draw()` at :832), that `search::pump` lands nothing, and that
  `Client::search` has zero callers (`search.rs:797` calls it).

`rust-modules/src/img.rs` is the only code touched, and only its comments: three
said `requiredMemory: 60` against `pkg/appinfo.json`'s 160.

make check: 976 passed.

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

* docs: two rendering/consistency fixes in the UX scenario

`<Name>` in the PIN-pad description was raw in prose, so a markdown renderer
swallows it as an HTML tag and the sentence reads "Enter 's PIN". Moved inside
backticks.

And the provenance note said "two figures are edited" in the same breath as
naming one. There is one: the Search scope line.

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

* docs: state Home's play-on-OK rule exactly, not approximately

The scenario said "OK on a Continue Watching card resumes, OK anywhere else
opens the detail page". Right about the deck, incomplete about the rest:
`home_activate` plays on `hub_is_continue(row) || mm.kind == 3`, so an EPISODE
card plays from any shelf. And a show/season card does not simply open its page
— it opens it, waits for the load to land on the expected item, and only then
fires Play, precisely so a failed fetch cannot play whatever page was open
before.

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

* docs: six claims the auditor refuted, five of them in the document written to be graded

`doc-claim-auditor` over the new UX scenario and the four corrections. Six
findings in files this unit owns; all six were confirmed against the code before
being fixed.

**The chevron is not a control.** The hero action-row table listed `›` under
"what OK does". `home.rs:44-50` says the opposite in as many words — `HERO_NBTN`
is 2, "the pager chevron beside them is an INDICATOR, not a third button: it is
drawn, it is never focused and it has no hit rect". The hero pages by RIGHT past
the info disc or LEFT off the pill (`home_hero_key`), plus an 8 s auto-flip.
This is the row a QA reader would have tried first and failed, in the one
document written for QA to read.

**"No control anywhere can take focus and do nothing" had two counterexamples.**
OK on Home's own tab pill standing on Home is a documented no-op (`app.rs:2126`),
and the person page's header band holds focus but only acts when there is a
biography long enough to expand (`person.rs:626`). Narrowed to what is true and
still answers #10, with both stops named.

**The synthesized tail can never raise a Skip pill.** The document said it
"stands in" where the server has no credits detection, and two lines later that
Skip Credits "remains for the last episode of a show". `synthesized_tail_marker`
returns None unless `has_next` (`metadata.rs:674`) and every Credits marker with
a successor resolves to Up Next (`player_hud.rs:401`), so the tail raises Up Next
100% of the time. Stated with its gate, plus the bench consequence: on a
Pass-less server Skip Credits is unreachable.

**The show/season sentence contradicted the one above it** — my own previous
commit's doing. The open-resolve-then-Play arm is INSIDE `want_play`
(`app.rs:2152`), so it is the deck rule, not the general one; elsewhere a show
card is a bare `nav_open`. Folded into the deck paragraph.

**`docs/pms-api.md` said "the five in bold" over six bolded rows**, and let the
table be read as what this app sends. Dropped the count and split the two facts:
`playback_identity` emits nine fields (`client.rs:152-162`) and none of the four
capability/locale ones exist anywhere in the tree. The table is the target; the
paragraph is the state.

**And two smaller ones**: `assets/` was said to hold 24 SVG icons against a
measured 28 — the number is decoration inside a five-way negative proof and is
the only thing in that bullet that can rot, so it is gone; and the detail page's
watched disc wears the face of the write it would perform (`detail.rs:1087`), so
it is a ✓ on an unwatched item and a − on a watched one, not a fixed ✓.

Two further findings are in files this unit does not own and are listed in the
PR: CLAUDE.md:985 and docs/lg-self-checklist.md:17, both dangling references
this branch created.

make check: 976 passed.

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
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


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 never rebuilt from one (#53)

* transport: an Origin is what a server's address IS, and it is parsed from a URL

Everything below the transport carried a server's address as a bare
`(host, port)` pair. That pair cannot say `https`, and — the half that
matters — it cannot be *made* to say it afterwards, because the host a
`plex.direct` certificate is issued for is the HOSTNAME plex.tv puts in
`Connection.uri`, while `Connection.address` stays the dotted quad behind
it. `probe.rs` has said so in prose since it was written ("https to the
bare IP fails validation by design"), and `auth::resolve_roster` then
threw `Candidate::url` away and wrote `address` into the session file. A
later lane adding a `scheme` field on top of that would have produced a
control plane that looks like it speaks TLS and fails hostname validation
on every real server.

So: `plex::Origin` — scheme + host + port, parsed from a URL by
`Origin::parse`, never assembled from an address. `Candidate::origin()`
is the one derivation; `Candidate::address` is documented down to what it
actually is, the diagnostic half.

Threaded through every site that passed a bare pair: `Client` (with
`host()`/`port()` kept as views, so the ~30 call sites below the layer
are untouched), `StreamUrl` and its two construction sites,
`register_origin`/`install`, `SourceRef`/`ServerRef`, `ReadyCreds`,
`app.rs`'s boot gate and `install_pms`, and the engine's URL splitter.
`dev::DevServer` gains an optional `scheme`, which is how an https origin
can be exercised headlessly through the `plxnative-servers` trigger by
anyone who has no such server to discover.

Two invariants are pinned by tests rather than left to prose.
`Origin::host()` is ALWAYS unbracketed — it is the `getaddrinfo` node —
and `Origin::authority()` ALWAYS brackets a v6 literal, because it is URL
serialization; `probe::host_of` returned the bracketed spelling and is
gone, replaced by one shared reading of a URL. And a session file written
by 0.4.1, carrying `address`/`port` and no origin, must still boot as
`http://{address}:{port}`: `Session::server` is not a soft-parsed roster
entry, so dropping it is a silent sign-out at every boot for every
existing user. Both have a test with a literal 0.4.1-shaped JSON string.

NO BEHAVIOUR CHANGE. Every origin is still `http://` and dials the same
address: `dial_target` accepts only a plain-http IPv4 candidate, whose
URL `probe::candidates` synthesized as `http://{address}:{port}`, so the
parsed origin and the old pair are equal today — asserted, not assumed.
The registry's two log lines now print `origin.authority()`, which is
byte-identical for every http/IPv4 origin and correct for a v6 literal,
which `{host}:{port}` could not spell at all.

996 host tests pass. A simulator boot against a real PMS produces an
event log identical to the pre-change one on all 30 non-heartbeat lines;
the three `loop=`/`fps=` lines vary run to run on an unchanged binary.

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

* docs: name what the origin model made stale, rather than leaving it to rot

`plex/CLAUDE.md` and `servers.rs`/`client.rs`'s module docs described the
registry in terms of `(host, port)`, which is the shape the change
replaced. `docs/plex-api-design.md` is a design note whose sketches were
the implementation of their day — it gets a banner naming the one thing
in it that would now mislead (rule 9, "Numeric host, no DNS", and the
two struct sketches), not a rewrite. `docs/shared-servers.md` §7 gains
the `plxnative-servers` trigger's new `scheme` field, which is the only
way to put a TLS origin through the registry without an account that
has one.

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

* session: the stored origin field is `origin_url`, so it cannot be mistaken for `origin()`

`SourceRef`/`ServerRef` had a FIELD `origin` (the serialized string) beside
a METHOD `origin()` (the parsed value). Rust puts those in different
namespaces so it compiles either way, which is exactly the problem: two
characters separate "the raw JSON string" from "the thing to dial", at
every use, forever. The field takes the `_url` suffix; `#[serde(rename)]`
keeps the FILE's key spelled `origin`, which is what a human editing a
session file on the television reads, and the round-trip test proves the
rename applies to both halves of serde.

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

* review: close the gap between the origin that was DIALLED and the one recorded

Eight findings from `/code-review high`; six fixed, two answered in prose.

**The one that mattered.** `resolve_roster` recorded `Candidate::origin()`
while `probe_server` dialled `(&c.address, dial_port(c.port))`, and the
comment justifying that divergence was wrong about its own gate:
`dial_target` checks `is_ipv4_literal(&c.address)`, which admits a
plex.tv-advertised `uri` candidate and not only the synthesized twin. A
connection whose `uri` names a different port from `port` would be
verified at one and written into the session file as the other, and every
later request would go somewhere nothing ever answered from. So
`dial_target` now returns the ORIGIN, `probe_server` dials that origin's
host and port, and `Reach::At` carries it back beside the candidate — one
value, so what answered and what is recorded cannot be two addresses. The
candidate stays for the diagnostic fields. Its fixture had `url` and
`port` disagreeing, which is what let the old shape look consistent; it
builds both from one pair now, as `probe::candidates` does.

**The silent-instrument trap, twice.** `dev::DevServer`'s `scheme` field
exists so a lane with no TLS server of its own can put an https origin
through the registry — and both registry log lines and `DevServer::
describe` printed `host:port`, so such a run was byte-identical to an
http one. `Origin::log_form()` is the shared answer: the bare authority
for a plaintext origin (an archived log stays comparable, and the
byte-identical gate holds) and the whole URL as soon as the scheme is
worth saying.

**`player::engine` REFUSES a TLS stream target** instead of silently
downgrading it, which is what the code did while its comment claimed the
opposite. It is reachable today: a client registered at an https origin
copies that origin into `direct_play_url`/`transcode_start_url`, so
`route` would store an https URL and the engine would open a plaintext
socket to it.

Also: an EMPTY port (`http://h:`) is a port that was WRITTEN and cannot
be dialled, so `Origin::parse` refuses it rather than defaulting to 32400
— a truncated write of the session file is exactly the "port nobody wrote
down" case `dial_port` exists for. And `reconcile_primary` no longer logs
"primary now answers at …" when the only thing that changed was the
stored origin going from empty to populated, which is what the FIRST BOOT
after this lands does on every existing install — a false DHCP-churn
report in the file this project treats as its primary evidence surface.

Answered rather than changed: `Origin::port`'s doc claimed a narrowing one
constructor does not perform (`ServerRef::origin`'s legacy `port as i32`),
so the doc now says where the narrowing really lives; and
`Session::can_go_local` still asks "is there an address written down"
rather than "can THIS build's transport open it" — gating it would send a
user to a QR code for a transport gap that is not theirs, and the
half-landed state it exposes is named in the doc and refused out loud one
layer down, in the engine.

997 host tests pass. The simulator event log is still identical to the
pre-change one on all 30 non-heartbeat lines.

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

* tests: a registry test must not call the PUBLIC register — it opens a real socket

CI was red on Linux with `thread '<unknown>' has overflowed its stack`,
at a different point in the output each run, while `make check` passed on
the dev Mac. The mechanism is not serde_json and not the session file.

`moving_a_server_to_https_re_points_its_slot` called the public
`register_origin`, where every other test in this module deliberately
goes through `register_with_client_id`. The public path fires
`serverinfo::refresh`, which spawns a `task::spawn_small` worker that
really opens a socket — and in a DEBUG build `stream::http_stream_boxed`
materialises its 64 KiB `HttpStream` as a STACK temporary before it ever
reaches the heap, despite the comment above it promising the opposite
("box it off the caller's stack"). lldb caught it on the guard page:

    frame #0  stream::http_stream_boxed
    frame #1  stream::http_get(host="10.0.0.1", port=32400, …)
    frame #2  Client::get_json
    frame #3  Client::server_root
    frame #4  serverinfo::fetch_once
    frame #5  serverinfo::refresh::{closure#0}   <- spawn_small, 256 KiB

Measured on this branch by varying `SMALL_STACK`: debug overflows at 48,
128 and 192 KiB on ARM64 and needs more than 256 KiB on x86-64, which is
exactly why one host passed and the other did not. **`--release` passes at
48 KiB**, so the optimizer elides the temporary and the television — which
ships `cargo build --release` (Makefile:438) — is not affected. It is a
latent debug-only hazard in `stream.rs`, pre-existing and not this
branch's to fix; the base simply had no host test that reached
`http_get` from a `spawn_small` worker. Reported on the PR.

The fix is the test, which was wrong on its own terms: `register` also
mints and PERSISTS a client-id uuid, and that seam's doc has said since it
was written that a host test must not write one. It gains an origin-taking
sibling (the pair-shaped one cannot express a scheme, which is what this
test is about) and a second documented reason nobody had paid for yet.

Verified with the same differential that found it: at `SMALL_STACK = 48 *
1024` the branch was 3/3 aborts and is now 3/3 clean, 997 tests, both
`--test-threads=1` and parallel. `task.rs` is untouched.

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
…had gone false (#55)

* docs: the UX scenario LG's checklist defers to, and four claims that had gone false

LG's App Self Checklist does not describe four of its own items — #2, #10, #42
and #45 defer to the UX scenario document, and #45 says so in as many words
("refer to UX scenario for movement details"). That makes the scenario the
artefact QA grades the transport against, so `docs/ux-scenario.md` is written as
a compliance document rather than a tour: every screen, how it is reached, every
control on it, what each remote key does on each screen, the BACK trail, and the
exit alert.

Two of its sections carry the weight.

**§6 — playback control.** There is no on-screen `<< || >>` transport row and
there will not be one; transport is remote-driven and the HUD shows STATE, a
mark beside the elapsed clock and nothing at all while playing steadily. That is
stated as settled rather than apologised for, with the grounds: on-screen
controls are Recommended rather than mandatory, the idiom already ships approved
on these sets, and the half that must really work — the FF/REW/play/pause/stop
keys — is bound and was settled 2026-08-22 against LG's own evdev table and 336
captured key lines. The section documents the transport as it IS: three focus
bands, the 4.5 s linger, the 10 s preview-then-commit seek with its 450 ms tap
accumulation, the six state marks and their precedence, and the control row's
three mutually exclusive occupants (discs / Skip pill / Up Next).

**§7 — sound.** There is no UI audio at all, and the item is therefore N/A on
its own precondition. Checked five ways rather than asserted: SDL is initialised
`SDL_INIT_VIDEO` alone, no SDL audio call exists, SDL_mixer is neither present
nor linked, there are no audio assets, and no webOS sound service is called.

Eleven figures, taken from the simulator at the authored 1920x1080 with the dev
counter compiled out. The player HUD is the existing device capture, because the
Starfish/ACB seam does not exist off-device — §9 lists the figures that still
need a television and why the who's-watching picker is deliberately not among
them (its roster is real people's names). One figure is edited and says so: the
Search scope line named a real server, and is replaced by the app's own string
for a server that reports no name.

And four corrections, each verified against the tree first:

- `docs/distribution.md` §2 no longer says native Store eligibility is
  unsettled. It rested on LG's `appinfo.json` reference ("Only `web` is allowed
  currently") — a `develop/*` WEB-RUNTIME page, which is not authority over a
  native SDL app. Seller Lounge parses this project's ipk as File Type: Native
  and asks for the native SDK version, chipset and resolution. What is open is
  the QA outcome, not the permission. The summary table's "No." row went with it.
- `docs/pms-api.md` — the `X-Plex-*` list was the minimum PMS needs to attribute
  a session, read for years as the identity set. Recorded the full set the
  official webOS client sends, including `X-Plex-Platform-Version` (Plex gates
  on FIRMWARE, which `X-Plex-Platform` cannot express) and `X-Plex-Features`,
  whose exact effect this repo has not measured and which is graded as such.
- `docs/shared-servers.md` — it called the `plex.direct` middle label "the
  certificate UUID, not the machineIdentifier" while `plex-openapi.json` calls
  the same label "The unique identifier of this particular PMS". Both are 32 hex
  characters, so no sample settles it. Recorded as a disagreement rather than
  resolved, with the rule that survives either answer: use the advertised `uri`
  verbatim, never construct the hostname.
- `docs/search.md` — deleted the status blockquote. Its own staleness test had
  fired: it claimed `ui/search/`'s `draw` bodies are `{}` (mod.rs is ~2200 lines
  with `draw()` at :832), that `search::pump` lands nothing, and that
  `Client::search` has zero callers (`search.rs:797` calls it).

`rust-modules/src/img.rs` is the only code touched, and only its comments: three
said `requiredMemory: 60` against `pkg/appinfo.json`'s 160.

make check: 976 passed.

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

* docs: two rendering/consistency fixes in the UX scenario

`<Name>` in the PIN-pad description was raw in prose, so a markdown renderer
swallows it as an HTML tag and the sentence reads "Enter 's PIN". Moved inside
backticks.

And the provenance note said "two figures are edited" in the same breath as
naming one. There is one: the Search scope line.

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

* docs: state Home's play-on-OK rule exactly, not approximately

The scenario said "OK on a Continue Watching card resumes, OK anywhere else
opens the detail page". Right about the deck, incomplete about the rest:
`home_activate` plays on `hub_is_continue(row) || mm.kind == 3`, so an EPISODE
card plays from any shelf. And a show/season card does not simply open its page
— it opens it, waits for the load to land on the expected item, and only then
fires Play, precisely so a failed fetch cannot play whatever page was open
before.

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

* docs: six claims the auditor refuted, five of them in the document written to be graded

`doc-claim-auditor` over the new UX scenario and the four corrections. Six
findings in files this unit owns; all six were confirmed against the code before
being fixed.

**The chevron is not a control.** The hero action-row table listed `›` under
"what OK does". `home.rs:44-50` says the opposite in as many words — `HERO_NBTN`
is 2, "the pager chevron beside them is an INDICATOR, not a third button: it is
drawn, it is never focused and it has no hit rect". The hero pages by RIGHT past
the info disc or LEFT off the pill (`home_hero_key`), plus an 8 s auto-flip.
This is the row a QA reader would have tried first and failed, in the one
document written for QA to read.

**"No control anywhere can take focus and do nothing" had two counterexamples.**
OK on Home's own tab pill standing on Home is a documented no-op (`app.rs:2126`),
and the person page's header band holds focus but only acts when there is a
biography long enough to expand (`person.rs:626`). Narrowed to what is true and
still answers #10, with both stops named.

**The synthesized tail can never raise a Skip pill.** The document said it
"stands in" where the server has no credits detection, and two lines later that
Skip Credits "remains for the last episode of a show". `synthesized_tail_marker`
returns None unless `has_next` (`metadata.rs:674`) and every Credits marker with
a successor resolves to Up Next (`player_hud.rs:401`), so the tail raises Up Next
100% of the time. Stated with its gate, plus the bench consequence: on a
Pass-less server Skip Credits is unreachable.

**The show/season sentence contradicted the one above it** — my own previous
commit's doing. The open-resolve-then-Play arm is INSIDE `want_play`
(`app.rs:2152`), so it is the deck rule, not the general one; elsewhere a show
card is a bare `nav_open`. Folded into the deck paragraph.

**`docs/pms-api.md` said "the five in bold" over six bolded rows**, and let the
table be read as what this app sends. Dropped the count and split the two facts:
`playback_identity` emits nine fields (`client.rs:152-162`) and none of the four
capability/locale ones exist anywhere in the tree. The table is the target; the
paragraph is the state.

**And two smaller ones**: `assets/` was said to hold 24 SVG icons against a
measured 28 — the number is decoration inside a five-way negative proof and is
the only thing in that bullet that can rot, so it is gone; and the detail page's
watched disc wears the face of the write it would perform (`detail.rs:1087`), so
it is a ✓ on an unwatched item and a − on a watched one, not a fixed ✓.

Two further findings are in files this unit does not own and are listed in the
PR: CLAUDE.md:985 and docs/lg-self-checklist.md:17, both dangling references
this branch created.

make check: 976 passed.

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
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


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.

2 participants