Repository navigation
shared servers + Search: a friend's library beside your own, and a way to find anything in either - #47
Merged
Conversation
…to dial
A friend's shared server is not a second address, it is a second AUTHORITY:
its own machineIdentifier, its own per-(user, server) accessToken, its own
ratingKey space and its own watch state. Measured against a real share this
week: our own server's token gets a 401 from it, and its section key 1 is a
different library from our section key 1.
THE REGISTRY. `plex::install` was a OnceLock whose host and port froze at the
first call, so a later install naming a DIFFERENT server silently kept the
first one's address and applied the new token to it — a mis-target that could
not be seen from any call site. `servers.rs` replaces it with a table keyed on
machineIdentifier. `client()` and `client_opt()` keep their exact signatures
and now mean "the current server", so all ~30 call sites outside plex/ read
unchanged; `client_for(id)` is the multi-server addition.
It is an atomic-pointer table rather than a lock because `client()` is a hot
path — `posters::poster_key` calls it three times per key, for every visible
tile, every frame. Each slot's Client is leaked, which is what makes handing
out `&'static Client` sound without an Arc; a re-point publishes a NEW leaked
Client over the pointer, so a worker mid-request with the old reference gets
one request sent to where that server used to be, never a dangling pointer.
TOKEN_GEN moved into Client, and its values come from a process-global
sequence so no two Clients ever share one. That is not tidiness: the poster
memo compares a single generation number, so identical per-server generations
would have served server B its cards from A's memoised, token-bearing paths
the moment `client()` switched.
THE POLICY. `probe.rs` is pure — no socket, no thread, no clock — so the rules
that decide reachability are gradeable on the dev Mac, which is the only tier
that can grade them at all. Three rules, each measured rather than assumed:
* A `local` connection on a NON-owned server is dropped unless
publicAddressMatches. `Connection.local` means "this address is RFC1918",
not "you are on that LAN" — the share advertises the OWNER's 172.20.x.x,
which times out after 8 s from here, and the worse outcome is that it
SUCCEEDS against a different machine of ours at that address.
* No plain-http candidate when the owner set httpsRequired. It is their
setting; a plain request to such a server is a refusal, not a connection.
* local -> remote -> relay, the order every Plex client with one uses.
The owned-server fixture deliberately carries publicAddressMatches:false, the
value the live capture returns. With `true` there, deleting `&& !res.owned`
from the drop rule passes the whole suite while discarding our OWN LAN address
in the field, and offline play with it.
THE ROSTER. account.rs keeps what plex.tv already sent and we threw away:
sourceTitle (the owner's handle — what "shared" looks like on the wire),
ownerId, publicAddressMatches, httpsRequired, IPv6. No field is strict any
more: serde's `default` covers an ABSENT field and not a present `null`, and
one strict String meeting one null fails the WHOLE resources array, so a
single odd row would take every other server with it and end sign-in at "no
server found". sourceTitle is a real Option (absent and empty differ); the
rest go through de_str/de_vec/de_bool/de_i64.
Host 393 -> 411 + lint, `make` (ARM) green. Nothing calls register/client_for
yet, so no behaviour changes: the live selector still picks one server.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…the heading ink Deliverable C of the Shared Sources design: with two servers, a borrowed shelf reads "Recently Added in Film Club · friend" — the source stated once, on the heading, never on a tile. Continue Watching merges across servers and so carries no annotation at all: a shelf drawn from three servers cannot be named by one of them. The heading becomes a two-run flow. The title keeps HEADLINE/bold; the source, when there is one, follows a middot at one rung down, regular, tertiary. Both runs ride one painter, so the annotation cannot detach from the title under the shelf's lift or the snap fade. WITH AN EMPTY SOURCE THE ANNOTATION IS ABSENT, NOT EMPTY — no gap, no dot, no second run, no draw call. That is the design's "with one source, none of this is drawn" implemented as absence rather than as a branch that draws nothing visible, and it is what makes the annotation free for the 90% of installs with one server. `HubRow.source` is "" at both construction sites today, so nothing new is reachable in the product until the multi-server layer populates it. Two things ride along, both worth their own sentence: TITLE_DY is now a constant. The hub title's 34px cap-top offset was a bare literal in home.rs described in PROSE twice in consts.rs — and it is the one symbol the design's own layout script cites that the repo could not. The heading ink moves from TEXT_PRIMARY to TEXT_HEADING. This is a VISIBLE change on a single-server install today: every shelf heading on Home is ~4% darker. It is a harmonization, not a side effect — TEXT_HEADING is the shared section-heading ink detail.rs and person.rs already use, and Home was the one screen still inking its headings as body text. Called out here because the first draft of this work claimed byte-identity over it. text::baseline_y is the one place the two-run baseline arithmetic lives now (rating_group had it inline). It returns its reference y bit-for-bit for the same-token case, and takes that case as an identity rather than paying two glyph-cache scans per heading per shelf per frame to compute a zero. Host 411 -> 414 + lint, `make` (ARM) green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Found while mapping the shared-server work, but it is a bug on the user's own
server today, for any failed fetch: a failed first page armed the retry
cooldown and nothing else. `total` stayed at -1, `loading_initial()` was
`total < 0`, and so the Library grid spun for the rest of the session with no
way out and nothing on screen admitting it.
The irony is worth recording, and the module doc now does: `pms.rs`'s hub
fetch says in its own doc that it was "modelled on browse.rs's page store,
deliberately, because it already learned both lessons this needed" — it took
the two lessons (a failed fetch must never overwrite a populated store; a
fast-failing network is held off by a countdown) and then added the state the
ORIGINAL never had.
So `SecFetch { Loading, Ready, Failed }`, per section, gated on the same
generation test the success branch uses — a landing from a query the user has
already replaced describes a listing nobody is looking at. `loading_initial()`
now reads the state instead of `total < 0`: the two agreed on every path that
ends in an answer and disagreed on the one that doesn't. `failed_initial()` is
Failed AND nothing to show, so a mid-scroll page failure on a populated grid
does not blank a working screen.
An EMPTY answer is Ready, never Failed — an empty library is an answer, which
is the rule StatusKind::Empty already states. And once a query has failed the
state stays Failed through the retry, so the user reads one steady "couldn't
load this library" rather than a spinner blinking back every two seconds.
library.rs gets one arm between the spinner and "Nothing here matches", and
nothing more: the real read-out — the machine's name, the reason, a single
Try again — is deliberately left for deliverable D, where StatusOverlay grows
a reason line. A second-order benefit with no code change: the grid's cross-
fade now commits on a failure instead of hanging at the fade floor.
Two PRE-EXISTING tests in this module took no lock at all while calling
reset(), which wipes STATES, bumps GEN and clears every mailbox. They were
always racy; nothing else touched browse's globals concurrently, so it never
showed. The new tests exposed it as a 2-in-3 failure that passed both single-
threaded and in isolation. Both now take the crate lock.
Host 414 -> 418 + lint, `make` (ARM) green. A failed SECTIONS list still spins
forever, one layer up, where ensure_sections swallows failures into
unwrap_or_default — same symptom, same screen, and it belongs with D.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Every screen the Shared Sources design specifies needs TWO servers to exist. `/tmp/plxnative-token` carries exactly one, so none of those states could ever be graded headlessly — each one would have been verified by hand, one capture at a time, forever. A second trigger, `/tmp/plxnative-servers`, carrying a JSON array of ADDITIONAL servers. Purely additive: the primary is still the token file plus the compiled host, byte for byte, so a one-server manifest behaves exactly as it did. Overloading the token file was rejected — a second server needs a host, a port and a machineIdentifier, not just a token, and reshaping that file risks the one path everything already depends on. It carries a host AND the token to trust it with, so it is automation of the strongest kind and is deliberately NOT on the DIAG exemption list: like the token file it must suppress the who's-watching picker, or a headless run lands on the picker and grades the wrong screen. There is a test asserting exactly that. `DevServer` has no Debug impl, so a secret cannot reach a log by accident, and the whole surface is behind the devtriggers feature — in a RELEASE build `servers()` is `Ok(vec![])` at COMPILE time and the trigger string is absent from the binary. run.py resolves the second token from GET /api/v2/resources with the owner token it already reads from the gitignored config, so no new secret is stored anywhere; the existing teardown already glob-clears the file on exit, pass or fail or Ctrl-C. Its connection ranking deliberately does NOT copy the app's own sign-in rule. That rule prefers `local`, and for a SHARED server `local` is the OWNER's LAN: this account's share advertises a 172.20.x.x that is unroutable from the TV, so ranking it first would hand the harness an address it can never reach and turn a credentials test into a mystery timeout. Public wins for a non-owned server, dotted quads beat hostnames (the media transport has no DNS), relay last, and the pick is printed. One limitation, documented rather than hidden: there is no managed-user token for someone else's server, so a case that PLAYS from a share plays as YOU there. `test_user` isolation stops at the account boundary. Host 418 + lint, `make` and `make RELEASE=1` both green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…t had gone stale
docs/shared-servers.md is the design of record for browsing a friend's server:
how Plex structures it (the account is an index, each server a separate
authority with its own token), what THIS account's share actually advertises
(measured from the dev Mac and from the TV), where the app assumes one server,
and the staged plan. Its UI section defers to Shared Sources.dc.html, which
supersedes the shape this note originally proposed — the Sources list is a
library-toolbar chip, not a row in the account popover, and the tab strip
carries nothing new at all.
The CLAUDE.md corrections, each verified against code and each having already
misled a reader:
* stream.rs DOES decode chunked, and has for a long time. Claiming otherwise
made it read as less capable than it is and sent work to net.rs it would
have handled. Its only real disqualifiers are DNS and TLS.
* ff.rs is a BUNDLED, PINNED FFmpeg shipped beside the binary and opened by
absolute path with its majors asserted — not "the TV's own libavformat"
dlopen'd by SONAME candidate list. This one is not cosmetic: it is built
--disable-network with file as the only protocol, which turns "does the
TV's FFmpeg have https?" from an open question into a decided one, and
that decides how a remote server's media has to be fetched.
* The dual-FFmpeg-header ABI gate is gone; there is one header tree now, and
a reader chasing vendor/ffmpeg-* finds nanosvg and concludes the build is
broken.
* FFmpeg is therefore no longer one of the moving-SONAME families. That list
is curl and ACB — and ACB never went through dynlib.rs at all; starfish.c
does its own dlopen.
* The test count was stale for the third time. Rather than write a fourth
number destined to rot, the warning now says to treat every count in that
section as already wrong, including the one in the sentence saying so, and
the re-derive command it gives finally passes +nightly — which the very
next paragraph warns is the toolchain that counts.
Also: the "four #[link] directives" claim in the same section, which describes
directives that no longer exist, and distribution.md repeating the chunked
error inside its multi-server analysis.
Still wrong and left for a code change: Makefile:119-123 justifies not linking
FFmpeg by SONAME drift, twenty lines above the rules that build and stage the
pinned copy.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…dy carries the facts Deliverable E of the Shared Sources design. On a friend's item the detail hero's date/runtime line reads "13 Jun 2024 · 1 hr 57 min · Shared by friend" — one more run on a line that is already there, rather than a chip, a band or a line of its own. WHERE, AND WHY NOWHERE ELSE. An item's source is stated where the item is, and the badges row above cannot be it: those chips say what the item IS — 4K, CC — and where a copy came from is not a media property. Its own line would be a fifth line in the one column already fighting for height, for a fact you read once; a kicker above the title is where an episode's show name goes. So it joins the FACTS line, last, after the facts about the item, because it is a fact about where the item came from. It takes that line's own rung and ink (CAPTION, tertiary, regular) after the same .45 middot every separator there uses: it is dim because the line is dim, and the line is the lowest rung in the ladder — under it is the couch legibility floor. ON YOUR OWN SERVER THERE IS NO RUN AT ALL, not an empty one and not a dangling dot. `Detail::source` is the owner's HANDLE and is empty for our own machine, and empty means the flow emits nothing — no separator, no run, no draw call — so the 90% of installs with one server pay nothing for the feature. The host suite's first assertion is exactly that: the borrowed row's event list is the own-server row's with the credit appended, prefix-identical. The person, never the machine. "friend" is the same string the shelf headings say; "nas-home" stays in the Sources list and the failure read-out, because "whose copy is this" is answered by a person and "what could not be reached" by a machine. THE ROW BECAME A FLOW, which is the part worth reading. It was a `dotted_run` + `dotted_run_w` pair — a paint expression and a width expression that had to be kept agreeing — plus a yield ladder written in terms of the second. `home::heading_flow`'s doc names that exact pair as the pattern to stop repeating, so this row now has ONE expression: `facts_flow` hands each run to a closure that paints in the product and measures in the tests, and `facts_fit` takes a measure rather than owning one, so the row that is graded is the row that is drawn. `dotted_run_w` is gone; `dotted_run` stays, still the identity line's join, which is a join and not a tail-with-a-fragment-in- the-middle. The ladder is unchanged for an item with no source, and the tests prove it across every budget rather than at a corner: the extent goes entirely, then a date that cannot fit alone is elided. The credit slots in AHEAD of both — the trailing credit yields first, as the design calls it, because the item's own facts outrank the attribution; and monotonically, so a row that had to drop its extent can never win the credit back. One behaviour changed for items with no source, and it is a fix: the fragment's leading separator is now decided by whether anything was actually emitted before it, not by whether the item HAD a date or an extent. An item whose extent was dropped by the ladder while its date was empty used to open its facts line with an orphan dot. `Detail::source` is "" at its one construction site, so nothing new is reachable in the product until the multi-server layer can say which server a fetch was made against (docs/shared-servers.md step 2 threads `ServerId` through this struct; the roster field behind it is `Resource::source_title`, already parsed). It is captured at FETCH time rather than read at paint time because the page outlives the fetch and the current server can move under it. Host 418 -> 422 + lint, `make` (ARM) green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
A ratingKey names an item on ONE server. So does a Part.id, a Stream.id, a
playQueueID, and the resume point. Every PMS call on the playback path used to
find its server implicitly — `plex::client_opt()`, evaluated at the instant of
the call, which means "whichever server the user happens to be browsing right
now". With one server that is always the right answer. With a friend's share
merged into Home it is right only by luck, and the resolve worker alone asked
the question four independent times, so a switch landing mid-resolve could split
one playback across two servers.
The server is now captured ONCE, on the main thread, at `request_play` — the
same instant and under the same discipline as every other `ResolveEnv` field —
and carried by value from there: ResolveEnv → Plan → CUR_SID, installed beside
CUR_RK by `apply_plan`, which is the sole writer of the route statics. The
resolve's client bind, the PlayQueue, /decision, the stream-selection PUT, the
transcode seek, the retranscode and the final scrobble all take
`client_for(sid)`. None of them asks what is current any more.
`plex::client_opt()` deserves naming as the hazard it is. It is not a static a
worker could be caught reading — it is a function call, so `Send` cannot see it,
and a worker that resolves its own server compiles clean and passes every test
we have. That is why `build_stream`'s doc now says so in as many words.
The one that had to land in THIS commit rather than a follow-up is the
`/:/timeline` reporter. It runs on a worker every ten seconds for the whole of a
playback and had no capture at all — it re-read the current server on each tick.
Split from `CUR_SID`, the app would resolve correctly, play correctly, and
quietly write the resume point of a borrowed film onto your own server every ten
seconds for as long as it played. Nothing would show it: the POST is
fire-and-forget, the host suite has no runtime, and the device harness grades
progress from the app's own heartbeat rather than from the server the report
reached. So `report_timeline` takes the id as an argument and `engine.rs`
captures it at the spawn site, beside the `rk` it already captured.
Two smaller things fall out of the same rule.
The `/identity` machine id cache is now keyed to the server that taught it. It
feeds `uri=server://{machineIdentifier}/…` on the PlayQueue POST, so one cached
globally is server A's fingerprint sent to B, naming a machine B has never heard
of — on a POST that is best-effort and therefore fails silently. The registry's
own per-server id outranks the cache entirely, so a server registered with one
skips that round trip.
And the Up Next still-warm moves out of `apply_plan` into `pump_play`, its only
caller. That function's contract is to be the sole writer of the route statics;
a texture prefetch is not one of them. Keeping them apart is also what lets the
host suite reach the install at all — `warm_tex` drags in the poster cache and,
through it, a GL call the dev Mac cannot link.
`metadata::cached_playing` / `fetch_playing_item` take the id for the same
reason. The fetch uses it now; the cache HIT still tests the rk alone, because
`Detail` does not yet carry the server it was loaded from — that gap is written
up at the call site as the one hole left in the capture, with what it will cost
and the one-line shape of the fix.
Three host tests, plus one fixture repair. `Plan`/`ResolveEnv` round-tripping
the sid is graded on the resolve that FAILS, which is the exit `build_stream`
takes before any network. The machine-id cache is graded from both sides. And
the timeline routing is graded against two real loopback servers: the item plays
from B, the user switches to A, the POST must land on B — with a closing report
to A as the control, so "A heard nothing" is a fact about routing and not about
a listener that never worked. That test needed `plex`'s registry test seams
widened to `pub(crate)`: the public `register` resolves the device id through
`session::load`, which mints and PERSISTS a uuid, and a host test must not write
one; `reset_for_test` is what hands the table back empty afterwards.
The fixture repair is `ui::detail`'s test `mount`, which reset the filmstrip's
sub-row and the season capsules as retained state but not `saved_col`, the
per-section column memory `move_focus` seeds from when it enters a strip. So a
test that walked one strip decided where the next test's first DOWN landed.
Order-dependent and therefore invisible until the set of tests changes, which is
exactly what a route case holding `testlock` across real socket I/O did.
Device: ./tests/run.py 21/21. Host: make check green, 12 consecutive runs at
--test-threads=16.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Found by review, not by a test, and it could not have been found by one: the slot pointers were published Release and read Acquire, but CURRENT — the id that says WHICH slot to read — was Relaxed on both sides. That states no ordering between the two, and the invariant every reader depends on is exactly an ordering: "if you can see this id, the slot it names is published". ARMv7 is weakly ordered, so the reordering is real hardware behaviour rather than a theoretical one. The reachable case: `install` runs on the auth worker and stores a slot pointer and then CURRENT; `posters::poster_key` calls `client()` three times per key, for every visible art tile, every frame, on the poster workers. A reader that sees the new CURRENT before the slot store lands gets a null slot, and `client()`'s contract on null is to PANIC. x86 would never show this, which is why the fix is spelled out at the accessors rather than left for a host test to catch — `make check` runs on the dev Mac and is structurally incapable of failing on it. Host 418 x3 + lint, `make` (ARM) green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Plex's relay is the last connection a server offers and the only one with a ceiling: a tunnel to a Plex relay host, conventionally :8443, capped at 2 Mbps with the server transcoding down to fit. probe.rs already ranks it last. What was missing is what playback should DO when it wins, and the answer is a branch rather than a parameter, because there is no parameter to reach for: TranscodeSpec has no bitrate field, maxVideoBitrate is a literal on the re-encode branch alone, and on direct play — this client's default and its whole point — a cap means nothing, since no encoder is running to obey it. So plex::link_policy denies TWO things over a relay, and the second is the one a "force a transcode" instinct leaves behind. Direct play is obvious: the share measured this week is 31 Mbit/s, and 31 down a 2 arrives as a stall two minutes in with the AU queue draining and nothing on any surface saying why. But a container REMUX is no better — it copies the codecs and deliberately sends no cap, because a cap is exactly what would force the re-encode it is avoiding. Same bytes, same rate, one layer down. Denying both leaves the re-encode, which is the only flavor whose whole point is that the server picks the rate; the server is on the other end of the tunnel and is the only party that knows its real ceiling. The tier itself is now a property of the SERVER, not of a request: Client::set_link/link(), lock-free, LINK_UNKNOWN until something says otherwise. route::build_stream reads it off the client it already holds — no new global for the resolve worker to consult — and one derived `remux` local keeps the payload guess, the stored flavor a seek rebuilds from, and the /decision query from disagreeing. Nothing calls set_link yet, so link() is None everywhere and UNRESTRICTED is what every play gets: byte-identical behaviour, which is also why "unknown" is deliberately permissive rather than defensive. Assuming relay would downgrade every direct play on earth to a server-side encode to prevent a stall on a connection this codebase has never made. NO RELAY CONNECTION HAS EVER BEEN OBSERVED HERE. includeRelay=1 has been on the query since the first login and every relay connection was then discarded unconditionally. The 2 Mbps and the :8443 are Plex's documentation, not our measurement, and this account's share advertises no relay at all — so it is not merely untested, it is untestable from here. The policy doc says so, at the policy. A REGRESSION THIS WORK CAUSED, found by review. Adding includeIPv6=1 to the roster query means plex.tv now offers v6 connections, and the live sign-in chooser takes the FIRST `local` match and PERSISTS it. stream.rs parses a dotted quad by hand (AF_INET, no DNS), so a v6 literal is not slower, it is undialable: a server listing its LAN v6 first would have signed in "successfully" to an empty Home and written that address to the session file, so every later boot started there too. The chooser is extracted as auth::choose_local_connection — the rule was not gradeable at all before — guarded on both the flag and a colon in the address, since a null flag must not be believed, and it has the two tests that would have caught it. DOCS. plex/CLAUDE.md gains the registry section it never had: why the table is atomic pointers (client() is called three times per key, per visible tile, per frame), why each Client is leaked (a re-point costs a worker one request to where that server used to be, never a dangling pointer), why token generations are globally unique (the poster memo compares ONE number, so equal generations would serve server B its cards from A's memoised token-bearing paths), and the three states the whole feature rests on: granted, pinned, reachable. The Makefile said FFmpeg is unlinked because "SONAMEs move between releases, 55->57->58->59->60" a hundred lines above the rules that build and stage a bundled, PINNED copy. Both halves are in the same file and they contradict each other. The real reason is different in kind: those .so files land beside the binary, on no library search path and with no rpath, so a DT_NEEDED entry would resolve at exec() against the system path and either find nothing (dead before main) or find the TELEVISION's FFmpeg, which is the wrong one. Left alone, the old wording is how "just use the TV's libavformat for https" keeps coming back — when what we ship is --disable-network and cannot open a URL. docs/shared-servers.md is brought level: §3 separates what was fixed from what is still live (the 8-second trap is still exactly as live as it was), §5 marks each step's status, §6 defers to the design canvas and names the two things its own earlier draft got wrong, §7 retires the harness question and records that relay is unverifiable from this account, §8 shows all four corrections landed, and §9 covers all seven units. Host 418 -> 424 + lint (x3), `make` (ARM) green. No device run: the docs half cannot be observed on a television and the relay half cannot be reached. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…only observable on the TV `/tmp/plxnative-shared=<handle>` stamps that handle onto every item the session loads, which is what a fully-borrowed library looks like from the detail page. It exists because there is no host runtime: nothing in the suite draws a pixel, so the only place the hero's "Shared by friend" run can be JUDGED — its weight against the runs either side of it, whether it reads as the same voice as the date, what a long handle does to the line — is a real panel. And until the multi-server layer lands, `Detail::source` is "" on every path, so there is no item on this server that can put that run on screen at all. Without the trigger the feature is unreviewable by anyone, including the owner. It goes through `dev::read` like every other trigger, so `RELEASE=1` compiles it out with the rest of the `/tmp` surface, and it is deliberately NOT in `DIAG`: it changes what the app draws, so it should suppress the who's-watching picker exactly as `plxnative-detail` does. Host 422, `make` (ARM) green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Measured against the real share this evening, from the dev Mac:
GET /photo/:/transcode?width=250&height=375&minSize=1&url=/library/metadata/1/thumb/1778526065
-> our server: Frozen's poster 25658 B sha a211b9ac5a
-> the shared one: Призраки в Венеции's 11707 B sha 59928cd5b1
One request path, two different films. That is not a corner case: rating keys
are server-local integers from 1 on every Plex server, and the thumb path's
trailing timestamp is a cache-buster the other server ignores, so the paths
COLLIDE by construction rather than by coincidence.
THE POSTER STORE. The key was the request path and nothing else, so those two
posters were one slot: whichever landed first was drawn for both, and the tile
that missed showed a film from a library it had never asked about. The fetch
made it worse in the other direction — every worker read `plex::client()`, the
CURRENT server, whatever item the slot belonged to, so with a merged Home half
the requests went to the wrong host carrying the wrong grant.
So a ServerId rides every entry point, sits in the slot as the other half of
its identity, and is what the worker dials. It is a FIELD, not a key prefix:
keys already run ~135 bytes into a fixed 256-byte array, and `slot_matches`
compares the u16 first, which is the half that can reject without touching the
array — this runs for every slot of every probe of every visible tile.
Capture-at-the-spawn-site is honoured by the store itself: `lookup` writes the
slot's server on the main thread when it claims it, and the worker resolves
`client_for(that id)`. It never asks what the current server is, which is the
question that has no correct answer on a worker.
THE KEY MEMO had neither host nor token in its key and one token generation for
the whole map. Both halves are now per entry: the server is part of the key, so
server B's card can never be built from A's memoised token-bearing path (a
request to B carrying A's grant is a 401), and each entry remembers the
generation it was built at, because with a table of servers there is no single
"the token" to compare against any more.
LAYERING. The store fetched through `crate::stream` directly, behind the back of
the layer whose module doc says it is the only code that touches the socket. It
now goes through `Client::fetch_built` — deliberately NOT `get_bytes`, which
would append a second `X-Plex-Token`: the poster path IS the store key and
already ends in one.
SERVER FACTS. `serverinfo` kept one version, one subscription and one in-flight
latch for the whole app, justified in its own doc by "host/port fix at the first
install (a later install is only a token swap)". The registry retired that
premise. All three are now per server, indexed by the registry's own slot number
(and by its ceiling, so a second constant cannot drift out of agreement with it).
The LATCH mattered as much as the values: a global one silently skips the second
server's fetch while the first is in flight, and the answer it never fetched is
then read as fact. An id that names nothing reads Unknown — never a neighbouring
server's answer, and never a panic.
`register` now does the refresh, not `install`: install only ever reached the
current server, so a shared server registered beside it would have stayed
permanently Unknown — and `player::error_shape` blames a missing Plex Pass on a
known-free server, which is exactly the sentence you do not want aimed at the
wrong owner. The log line names the slot, because the machineIdentifier that
really identifies a server is a household fingerprint.
The three UI resolvers keep their signatures and gain `_on(ServerId, …)` twins;
the bare form is exactly `_on(current_server(), …)`, so a one-server install is
byte-identical and the item-server plumbing has a door to walk through. One
behaviour change falls out for free: a poster resolve before `plex::install`
used to panic through `client()` and now degrades to no artwork.
Host suite 421 (three new: the slot identity rule, the memo's two scopes, and
one server's Plex Pass never being read as another's), `make` ARM green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Deliverable E of the Shared Sources design. When a second pinned source also holds the item on screen, the actions row grows an "Also available" pill with a trailing chevron, and it opens the app's usual Popover + TableView listing the copies: the library on each source, whose it is and how long it runs, and the resolution class as a badge. The reason it is a CONTROL and not a section of the page is that an item on several servers is a rare fact — a permanent band would spend a whole row on nothing on every other page in the library. So it is drawn only when a second source actually holds the film, and `is_available` counts distinct SOURCES rather than copies: two copies in two libraries of one server is not "also available elsewhere", and the row naming the second one would lead back to the machine you are already on. OK NAVIGATES. It opens that server's own page for the film rather than swapping the copy under you, which is also what settles the per-server progress problem: watch state does not travel between servers, so a design that switched the copy in place would have had to explain a resume position that jumped. Navigating makes it self-evident — you are on a different page, and it says where you are in that copy. Ordering is the copy that PLAYS first, then what a viewer would prefer: higher quality, and at equal quality yours before a friend's, because yours cannot go offline mid-film. The design's own example is the case that separates the first two clauses — a 1080p copy you are standing on outranks a friend's 4K one — and it is what the host tests pin, along with the gate and the rule that exactly one row is ever ticked (marked on the first copy matching the page's own (server, ratingKey), so a duplicated input cannot say "you are here" twice). Copies are keyed by the item's GUID and never by its ratingKey: every item-shaped integer in Plex is server-local and starts at 1, so both servers in this household have a ratingKey 4. `install()` is the seam the multi-server data layer feeds; it is empty until that lands, which is what makes the whole feature cost a one-server library nothing — no query, no control, no layout. Three things this needed elsewhere, each smaller than it sounds: `Button` gains a TRAILING accessory slot, because the leading `icon` is part of the label's own statement (the Play triangle IS "play") while a chevron is a disclosure mark about what the control does. `pill_w` grows a `pill_w_full` twin rather than a second sizing path, since sizing the pill without the chevron and then drawing one pushes the label off-centre. The hero row's focus now follows its CONTROL through an index change by name (`HeroCtl`/`hero_set`), not by a `+= 1` around one insertion point. That was sound while the restart disc was the only conditional control; with a second one, two controls can appear in the same frame and which of them moved the focus depends on where it was sitting. The geometry walk is one accumulation for the same reason — the alt pill is a variable-width control in the MIDDLE of a row that was otherwise a pill followed by fixed-width discs. And the source switch itself is performed by app.rs, not by the screen. Re-pointing `plex::client()` invalidates every store keyed to the server that was current when it was filled — the hub catalog, the browse grid, an open person page — and none of them carries a server in its keys, so a screen doing the switch itself would leave server A's ratingKeys being fetched from server B with only the page in front of you correct. `install_pms`'s wipe is now `activate_server`, shared by the profile switch and this one, and the BACK trail is truncated to its root because `Node::Detail` carries a ratingKey and no server (step 2 of docs/shared-servers.md). Host 418 -> 430 + lint, `make` and `make RELEASE=1` both green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
`/tmp/plxnative-shared=<handle>` already means "pretend this item came from <handle>" — it is how the hero's own "Shared by …" run is judged on a panel, because with `Detail::source` empty at every construction site there is no item in the product that can put a borrowed-item surface on screen. A second copy of that film on <handle>'s source is the other half of the same pretence, so this reuses that trigger rather than adding a second one for one deliverable. What it stands in for, precisely, because a stand-in that lies is worse than none. YOUR copy is real: the page's own ratingKey, on the current server, with the loaded item's runtime and resolution class and the library the browse store says you are in — which is what makes the tick meaningful. THEIR copy is that same film on a second registry SLOT, and the slot is real: a genuinely different server when one is registered, otherwise the current server registered again under a synthetic machine id. From everything this feature does — counting sources, resolving a client, switching, refetching — that is a second source, and because it is the same machine the ratingKey it carries is honestly the same film. So OK performs the real switch and opens a real page, which is the one behaviour of this panel that cannot be judged from a still. The single invention is that their copy is one resolution class better than yours, and it earns its place: the ordering rule is otherwise unobservable. The design's own example is a 1080p copy you are standing on sorting ABOVE a friend's 4K one — the case that separates "the copy that plays" from "the best copy" — and with two equal badges a capture cannot show the rule was applied at all. `one_class_better` promotes nothing past the top of the ladder and leaves an unrecognised class exactly as the server spelled it. It is built by a `pump` on the detail page's frame, not by the store's `reset`, because a mount deliberately clears `metadata::current()` for the whole 2-5 round-trip fetch: at reset time there is no runtime, no class and no title to copy. Two string compares in the ordinary case, and `dev_stand_in` is `None` at COMPILE time under `cfg(test)` so the host suite can never depend on what this Mac happens to have under /tmp. Host 430 + lint, `make` (ARM) green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
`pump` returned early only on SUCCESS, so the ordinary case — the trigger not armed, which is every real boot — re-opened `/tmp/plxnative-shared` on every frame of every detail page. It now marks the attempt whatever the outcome, and takes the "has the item landed" gate BEFORE marking, so waiting out the mount's 2-5 round trips does not spend the one chance the page gets. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
The trigger swap replaced the parser but left its doc — a JSON schema for a `/tmp/plxnative-altsources` file that no longer exists, which would have sent the next reader to write one. What survives from it is the sentence that has to: the trigger literal, spelled in a comment so the catalog grep in the root CLAUDE.md still finds this surface. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Deliverable C of the Shared Sources design ruled the conditional in its own
list: "if the hero ever becomes independent of a shelf, it needs E's dim run
and the preference comes back." In this app the hero IS independent. It is a
rotating billboard built per fetch from Continue Watching plus every recent
hub, deduped and capped at 8, turning over on its own 8-second timer — so it
is nobody's focused tile, the shelf heading beneath it is attributing
something else entirely, and with a merged pool the front door could open on a
stranger's film with nothing on the screen saying so.
So the run comes back, on the hero's own meta line, as its last run:
Movie · 2024 · 18 · Shared by friend
S1 E4 · Episode title · Shared by friend
IT KEEPS THAT LINE'S RUNG AND TAKES ONE STEP OF INK. BODY, not the detail
page's CAPTION — a rung is a role, and the hero line is BODY because it is
read from across the room while E's is CAPTION because it sits under a page of
copy. What travels between the two screens is the ink step, secondary →
tertiary, after a middot at the separator token's own .45. The host tests
assert the rung explicitly, because "match E literally" is the plausible wrong
answer and it is invisible in a diff.
THE LINE NOW HAS A WIDTH BUDGET, WHICH IT NEVER HAD. This is copy over a
photograph, legible only inside the hero's corner wedge — which is gone by
four fifths of the frame and leaves the last fifth, the side the composition
is usually about, completely alone. HERO_META_R ends the line at three fifths,
a whole fifth of the panel short of that edge, and every run in the flow is
handed a budget running to it. So an over-long handle ELIDES where a wrapped
block would have spilled: there is no wrap in this flow to reach, only a bound
to truncate against, and the line can never become two. The facts ahead of the
run keep the hero column exactly as they always have — the handle is the last
thing on the line and a fact about where the item came from, so it is the
right thing to lose first.
OWN-ITEMS-FIRST IS AN ORDERING, NOT A FILTER. `own_items_first` promotes the
first owned page to the front and moves nothing else, so [B,B,O,O,B] becomes
[O,B,B,O,B]: the door opens on your own library and a friend's film arrives
one flip in, attributed. Filtering instead would leave a borrowed-only account
with no billboard at all and would overrule a pin the user made — which is why
a pool with nothing of ours in it is left exactly as it is. It needs no switch
of its own either: the pool is built from included sources only, so a borrowed
hero is always the consequence of a pin.
The pool's entries stop being bare catalog indices and become HeroSlot — index
plus the handle of the shelf's server. It is carried rather than looked up
because this is the one place in the app that lifts items OUT of their shelf
order, so an entry that knew only its index would have to scan its way back to
a hub to answer "whose is this", for a fact the build already had in hand.
With one source none of this exists: `HubRow::source` is "" everywhere, so the
flow returns before its first run — no pad, no dot, no draw call — and
own_items_first returns on its first line. Absence, not an empty annotation.
Two things the flow forced, both real:
* hero_content's off-screen cull was measured on the text column, and the
run is the one thing that draws outside it. Left alone, a flip would take
the whole column away while ~400px of that line was still on the panel,
and the tail of the meta line would blink out ahead of the item it
belongs to.
* meta_drawn_w clamps to the column. `TextView::truncates` answers "were
WORDS left unplaced", and a single token too wide for the column leaves
none — it is ellipsized by a separate safety pass — so the measured string
can be wider than anything drawn. Unclamped the run would start in mid-air
past the ellipsis, and an absurd one could hand the flow a negative
budget, which text::elide reads as "no bound at all".
SOURCE_PAD is now one constant for both places this screen states a source.
The heading and the hero line are one annotation in two positions, not two
spacings.
/tmp/plxnative-shared — the detail page's own trigger, reused rather than
twinned — stands in for a source where the real answer is empty. The visible
half of this work is unreachable in the product until the multi-server layer
lands, and the two things the design states about this run (that it sits
inside the wedge, and that it ends well short of the last fifth) are things
only a panel can settle. One file arms both surfaces, which is the only way to
see the hero's run and the detail page's agree. Both hero accessors go through
it, or the run would pop into existence halfway through a flip.
Host 427 (+9: 4 for the ordering, 5 for the line) + lint, `make` (ARM) green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…ed-servers-integration
…' into shared-servers-integration # Conflicts: # rust-modules/src/route.rs
…' into shared-servers-integration
…' into shared-servers-integration
…' into shared-servers-integration
…that looks local Sign-in kept exactly one server and threw the rest of the account away. Both of its passes filtered on `c.local && !c.relay`, and against a real share that is worse than useless: `Connection.local` means "this address is RFC1918", not "you are on that LAN", so for a friend's server it selected the OWNER's 172.20.x.x — eight seconds of timeout from here, and the worse outcome is that it SUCCEEDS, against whatever else happens to sit at that address on our own LAN. So discovery now works the way every Plex client with a connection story works. Each resource that provides a server — ours and every share alike — is turned into ranked candidates by `plex::probe` (which is what drops that address), and they are dialled in order until one answers. `/identity` is the probe, chosen because it is unauthenticated: it answers 200 to anybody, which makes it useless as a token test and perfect as a reachability one. The token is deliberately not sent, because a probe can land on a machine that is not the one we asked for, and that machine must never be handed a live credential. Which is the same reason the answer is VERIFIED: a candidate that answered is not yet a server, so its machineIdentifier must equal the resource's clientIdentifier before the connection is accepted. Anything else is discarded and the next address tried. A 401 is its own state and not "unreachable" — every other address of that server answers a token problem identically, and reporting "can't reach nas-home" for one sends the user to look at their friend's router. Note what that does NOT cover, spelled out where the probe path is defined: an accessToken revoked since the resources fetch still probes as reachable, and surfaces on the first authenticated request instead. Everything that answers is registered with the server registry under its real machine id and its OWN per-(user, server) token, and persisted as a roster in the session beside the primary ServerRef, which is written exactly as before — a single-server account produces the session file it always did, plus a one-entry roster. Our own server stays current: a share is browsable, never the default. Three things fall out of the rewrite that are worth naming. The failure copy was one line, "No local Plex server found on this network.", for every outcome. That sentence was the policy talking — a server reached over the internet was a failure by construction, so the message named the LAN. It is now three, and none of them sends the user to the wrong place. A profile switch re-keys the WHOLE roster from the /resources response it already fetches, because accessToken is per (user, server): a share left on the previous profile's token answers 401 to everything. It is computed before the switch is known to have worked and applied only on success — persisting a roster re-keyed for a profile we did not switch to would delete the user's shares from disk. And `choose_local_connection`'s IPv6 guard is now structural rather than a filter that can be forgotten. Nothing but a dialable candidate — plain HTTP to four decimal octets, which is all `stream.rs` can build a sockaddr from — is ever dialled, and only a candidate that ANSWERED becomes a stored source. An address can therefore only be persisted after it has been connected to, which is the property the v6 fix was protecting: `includeIPv6=1` made plex.tv offer v6 connections, and writing one to disk broke every later boot, not just that one. `probe.rs` gains the fourth ranking axis that makes the same point about names: a numeric address outranks a HOSTNAME inside its tier. The transport has no resolver at all, and this account's share lists an internal name that does not resolve ahead of the public address that answers in 115 ms. Ranked, not dropped — a name is the only thing TLS can ever validate. The session file's structs are hardened while they are open: every one of them takes `#[serde(default)]` on the container, and the three list fields decode element by element. `#[serde(default)]` covers a field that is ABSENT, not one that is present and the wrong shape, and for this file the cost of the difference is not an empty roster — it is a Session that will not parse, which is a silent sign-out and a QR code to scan on every boot. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…ing from 1 is the normal case
A Plex ratingKey — and a librarySectionID, a personId, a Part.key, a Stream.id — is a
server-local integer dense from 1. With one server that is a distinction without a
difference, and the app has always leaned on it: five places identify an item by a bare
rk. With a share registered it is not a distinction the app can skip, and it is not an
edge case either. It is the measured default: docs/shared-servers.md §2 records the
friend's server answering with section key 1, exactly like our own Movies, its
ratingKeys starting at 1 alongside ours.
So a key alone now names an item on neither machine, and each of the five sites turns
into a confident answer about the wrong one:
* `pms::index_of_rk` scanned `m.rk == rk` over one flat catalog and returned whichever
row came first. Its callers are the item menu's Play from Start — long-press a
friend's episode on a merged Continue Watching shelf and OUR film with that number
plays, with the friend's title still in the HUD — and `detail::mount_rk`, which
mounts the wrong backdrop, blur envelope and selection.
* `metadata::cached_playing` is the worst of them, because it is silent and it feeds
playback. It is the fast path that SKIPS the PMS fetch, so a false hit substitutes
the loaded page's whole `PlayingItem`: its audio and subtitle `Stream.id`s (which are
then PUT to the other server), its frame size (so the direct-play gate reasons about
the wrong resolution), its fps, its chapters, its markers.
* `metadata::pump_season`'s `d.rk != r.rk` ownership test. Hop from A's show page to
B's with the same rk while a `/children` is in flight and A's episodes install onto
B's page. Nothing else can see it — the hop bumps no generation that separates them.
* `plex::queue_index_of`'s rating-key FALLBACK. The primary key, `playQueueItemID`, is
minted by the queue and needs no scoping; the fallback compares a key the caller
supplied, which can come from anywhere.
* `trail::Node::Detail{rk}` and `Node::Person{key}`. The trail stores identity
precisely because indices go stale, and then stored an identity that had gone
ambiguous: browse the share, open an item, go deeper, press BACK, land on a page the
user has never seen.
The rule lives in one place, `plex::same_item((sid, key), (sid, key))`, so the five sites
cannot drift and one host test grades the rule itself. UNSET matches only UNSET — that is
the pre-registry state (and every row a host test builds by literal), not a wildcard, so
the single-server app is unchanged and a "server unknown" row never answers for a named
machine. Every miss degrades safely where it lands: a catalog miss opens the page
off-catalog, a playing-item miss costs one round trip, a season miss leaves the page it
found alone.
`PmsMovie`, `Detail`, `PlayingItem`, `QueueRow` and `person::Person` gain the server they
came from, stamped where they are parsed — and the server is PASSED IN, never looked up.
`parse_item` runs on the hub, page and person workers, `fetch_full` on the detail worker,
and the house rule (browse.rs's spawn site states it outright) is that a worker reads no
statics. It is also the only correct answer: the current server can move while a fetch is
in flight, and the rows in hand belong to the machine that was asked. So the fetches now
take a `ServerId` and dial `client_for(sid)` rather than `client()`, which is what makes a
row's stamp provable rather than incidental.
`Node::Person` prefers the plex.tv `tagKey` whenever both sides have one, because that id
is GLOBAL — one guid is one person however each machine numbers them — and falls back to
the server-scoped local pair only when a credit row carried none. Comparing a present guid
against a missing one would make every guid-less row the same person as every other.
`Trail::reset`'s doc calls a truncation the profile-switch guard, and a server switch has
the same shape. It does not get the same remedy: a source change does not revoke access to
what is behind you, and the trail's other rule is that a cycle is a HISTORY. A per-node
sid keeps that history walkable and still lands every pop on the page it names.
Two dropped-write paths in the item menu now say so. `client_for(sid)` can return None
where `client()` used to panic, and the repaint below ran either way — so a scrobble or a
deck removal that never reached a server is a log line rather than the one PMS write with
no trace at all.
Not in this change, deliberately: `route.rs` still resolves the STREAM against the current
server (`ResolveEnv::snapshot`). That is the sibling unit's seam, and its comment says so
rather than implying the play path is finished.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
… its Source chip Deliverable A of the Shared Sources design. The Library's section table described one server — a bare `key` with no server on it, a flat `SECTIONS`, and an `ensure_sections` that fetched from whatever `client()` happened to be. Measured against the real share on 2026-08-11, both servers have a section `1` and they are different libraries, so a bare key names two things. The table is now addressed by (SOURCE, section), and every fetch is issued through `client_for(sid)` CAPTURED AT THE SPAWN SITE — the rule this file already stated for its page worker and did not keep. IT GROWS BY APPEND AND NEVER BY REBUILD, and that is the soundness argument, not a detail. A page landing is blamed on a section INDEX, so a table that reshuffled under an in-flight fetch would splice one library's items into another's store. `ensure_sections`'s early-return was the only thing preventing that; appending replaces it and holds for every source, not only for the second call. Two generations now, each with one job: SECTIONS_GEN (shape — moves on an append, what the label caches key on) and EPOCH (identity — moves on `reset` alone, what index-blamed landings gate on), because one source's append must not discard another source's answer. ONLY THE CURRENT SERVER IS DISCOVERED ON THE MAIN THREAD. `ensure_sections` runs at boot and on every Library entry, so fanning out there would park the SDL loop for one connect(2) per unreachable share — seconds of frozen boot because a friend switched their server off. Every other source is discovered by a worker off `pump`: sections, then the server's own friendlyName (`GET /`, so a roster that never reached plex.tv can still head its group with a machine name), then a size=0 count probe per library. Ten-second per-source backoff. A dead share arrives as `reachable: false` and costs the main thread nothing. THE SOURCE CHIP, first in the toolbar: `Library · Film Club friend ▾`, the handle a MICRO run at 62% of the label's own ink and ABSENT ENTIRELY on your own libraries — absence, not an empty run. With one source the chip is not drawn at all and the list does not exist. Its panel is 640 wide because the rows are two-line, with two levels swapped by pills at the panel top: Browse, a picker with one tick and no words, and On Home, switches whose word is the only mark. The levels never mirror each other's marks — a mark says where you are, a word says what is set. A server is a group whose header is the MACHINE and whose accessory is the PERSON; the last pinned library dims its VALUE and states the rule on its sub-line while its label keeps live ink; an unreachable server's group dims whole at one alpha and still reads On, because nothing was unpinned. The toolbar is a TYPED chip list now, and that is a fix rather than a tidy-up: `on_ok` matched on the chip's INDEX with a `_` catch-all, so inserting Source at 0 would have made it open the Sort menu while Sort and Filter both opened Filter — silently, since every index still resolved to something. `open_chip_menu` is the one chip → action map, exhaustive so a new chip is a compile error, and the pointer path calls it directly instead of deferring to `on_ok` (which reads the FOCUSED chip, so the two agreed by side effect rather than by construction). The test asserts chip → menu by IDENTITY and the row's contents by order, and pins position nowhere. THE TAB STRIP DELIBERATELY DOES NOT CHANGE (deliverable B, "answered by subtraction"). `browse::tab_*` projects the table to one pill per TYPE — your own sections, plus any type only a friend has — so the strip is the same width at one friend or at ten, and a borrowed library's selection capsule rests on its type's pill. With one source it is the identity map, so a single-server install draws exactly the strip it always did. `/tmp/plxnative-library=N` therefore names a PILL now; the comment says so. PICKING A LIBRARY ON ANOTHER SERVER MOVES THE APP'S CURRENT SERVER, which is `docs/shared-servers.md` §5's named cheap variant and is here because without it this panel is a trap. `PmsMovie` carries no ServerId, so a borrowed card's poster is fetched from `client()` and its ratingKey resolved through `client()` — and ratingKeys are server-local, so OK on a friend's card would quietly open, and play, a different title of yours with the same number. Moving `current` makes them agree. The cost is stated rather than hidden: Home's catalog belongs to the server it came from, so it is dropped and re-armed asynchronously, and `route`'s cached machineIdentifier is forgotten so the next PlayQueue names the right machine. Threading ServerId through the stored structs retires the seam. Two things `TableView` was missing for the panel, both now in the shared component rather than drawn in the screen: `Section::accessory` was declared and NEVER PAINTED, and `Section::dim` is one alpha over header, accessory, rows and the selection pill — not `Row::dim` per row, because the state is a fact about the GROUP and a dimmed row's own "On" must stay legible as itself. Four latching bugs the review caught, all the same shape as the single-flight one this module already had: an empty count landing no longer latches the probe off; `reachable` is now written by every page fetch, in both directions, so a server that goes offline after discovery can still dim; "Check for new shares" re-asks EVERY source rather than only the ones already known to be down, and a library created since is appended; and the Source chip reads the QUEUED section's owner, so the handle does not pop in 70 ms after the name it belongs to. Host 419 -> 431 (`make check` green three times), `make` and `make RELEASE=1` both link. NOT VERIFIED ON DEVICE — the television was unavailable for the whole of this work; the PR carries the recipe. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…it down
Home was one `?` chain over one server: `home_hubs()?` then `continue_watching()?`,
and a single failure anywhere in it committed nothing at all. That is defensible with
one server — there is nothing else to show — and it becomes a lie with two. Extended
naively over N sources, a friend's machine being asleep aborted the whole build, so on
a cold boot the user got the whole-screen "Can't reach your Plex server" read-out about
their own library, which was answering perfectly well the entire time.
So a verdict now belongs to a SOURCE, not to Home. Each one has its own single-flight
latch, its own place on the retry ladder, and its own last good projection; the merge
runs over whatever has answered so far. Every piece of that used to be process-global,
and each of the three was its own failure with a second server: one latch meant a share
that takes eight seconds to time out held the owned server's retry behind it; one
backoff meant the 30 s rung a dead share had climbed to was the rung everybody then
waited on; one `?` chain meant it blanked their shelves as well. `hub_state` folds the
per-source verdicts for the read-out, and the fold reserves the total-failure caption
for a total failure — any source answering makes Home answered.
What the merge draws, per the design canvas (deliverable C):
* Continue Watching is ONE shelf across every source, ordered by `lastViewedAt`, so a
borrowed item legitimately holds first position. It therefore carries no annotation
at all — a shelf drawn from three servers cannot be named by one of them.
* Every other shelf keeps its source: the owner's handle for a borrowed server, empty
for our own. Ours come first, then each share whole, because adjacency is the
grouping device and interleaving would destroy it.
* A source that has never answered contributes NOTHING — no heading, no empty shelf,
no spinner row. A spinner would also hold the panel presenting for something that
is not coming, which is the 39.6% → 1.67% idle saving spent on an apology. One that
HAS answered and has since failed keeps what it last had: a transient failure must
not reflow the shelves under the focus ring, and what removes a source for good is
it leaving the ROSTER, which is a fact about the grant rather than about one fetch.
Two caps had to move here from `ui::home`, because a cap the data layer has never heard
of is a cap that truncates a whole source away. Shelves and rows are now divided by
water-filling (`allot`): the smallest demand is served first and what it does not use
is re-divided, so a modest source costs nobody anything and two greedy ones split the
rest evenly. Handing the budget out first-come — which is what a single running total
does, and what this module did while there was only ever one server — means the first
source spends it: `/hubs` promotes several rows per library, so one four-library server
already overruns the sixteen shelves the grid can address. The per-shelf cap is the
other half: three sources' decks merge to 36 cards, and past 24 the focus ring and the
OK dispatch clamp differently, so the ring sits on one card while the press opens
another.
Boot stays synchronous for the owned server alone. A share that has gone away costs a
full connect timeout, and serialising those on the SDL thread would freeze the app for
as long as the friend's router stays quiet.
The open seam is named at the line that will close it: `PmsMovie` still carries no
`ServerId`, so a merged row's server is forgotten the moment it leaves `merge`, and
posters, the detail page and the scrobble paths all resolve a server-local ratingKey
against whichever server is current. That is steps 2 and 3 of `docs/shared-servers.md`,
and until they land a second source can only ever arrive through `/tmp/plxnative-servers`
— dev-only, and compiled out of a release build.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
`candidates()` sorted on (location, scheme, ipv6) and stopped. Two candidates tying on those three fell through to plex.tv's listing order — so whether the app reached a server depended on the order a remote service happened to return its connections in, which is reproducible for one account and not another. `stream.rs` takes a numeric address and speaks cleartext: it has no resolver at all. A hostname is therefore not merely slower here, it is undialable, exactly as an https origin is — and the existing `shared_server()` fixture already carried the bug. Its custom hostname is listed BEFORE the public IPv4, so the top-ranked candidate was an address the media transport cannot open, while the one connection measured as reachable from the TV sat second. The old test asserted that address was *present*, which it was. Ranked, not filtered: the curl control plane does resolve names, so a hostname-only server stays reachable once TLS lands — it just must never outrank an address the byte path can open. Found by unit 12's code review, in code from the shared-servers foundation. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…' into shared-servers-integration # Conflicts: # rust-modules/src/auth.rs # rust-modules/src/plex/probe.rs
…' into shared-servers-integration # Conflicts: # rust-modules/src/route.rs
Deliverable D of the Shared Sources design. The base branch stopped the grid spinning on a failed page; what it left was the read-out itself, and the layer above it. THE COMPONENT. `StatusOverlay` grows a reason line and an action, so it can say three things instead of one: the verdict (what happened), the reason (why, and what is NOT broken), the action (the one thing to press). Its caption is a borrowed `&CStr` rather than a `&'static` one, because a section read-out interpolates a machine name and no `c"…"` literal can carry that; every existing caller passes a `&'static` and is unchanged. The action pill is the COMPONENT's now. Home hand-built its Retry — a `Button::pill_w` and a y measured off the panel centre — under a caption that came from the shared read-out, so one block was laid out by two pieces of code and agreed only by inspection. The Library's read-out would have been a third copy. `action_frame` is the one geometry the draw and the screen's hit test both read, and Home's pill moves 7px up onto the shared `space::LG` rung as a result. Everything hangs off ONE anchor — the caption band, exactly where it was — so a read-out carrying neither optional block is laid out as before. THE READ-OUT. The verdict names the MACHINE, the reason names the PERSON and rules out the worry that everything is down, and there is one action. Focus starts on it, because a server that did not answer often answers a second later. It is anchored in the CONTENT REGION rather than at the read-out's canonical full-screen position: the chrome above it is still live, and that is the whole difference between a section failing and the app failing. Nothing else is drawn beside it — no Sort, no Filter, no count, no A–Z rail (all four act on a grid with no items), no alert glyph (that mark is the player's) and no BACK hint (BACK is universal, and the chip and tabs above are the visible way out). `toolbar_n` and `rail_drawn` are the ONE predicate each behind a control's draw, its pointer hit test and the focus walk, so neither can be invisible-and-clickable nor drawn-and-unreachable — and when the Source chip lands, UP from the read-out reaches it with no change here. Two identifying strings, and the list is CLOSED: the machine's own name and the owner's handle. No address, no path, no URL, no machineIdentifier. That is `ui::stats`' redaction rule and it applies for its reason — a read-out is what a user PHOTOGRAPHS for a bug report, and on a borrowed source the machine is not even theirs to publish. The session name is the only source for it; the address that sits right there in the client is deliberately NOT a fallback, and "this server" is the answer when there is no name. The owner is `None` at its one seam today and the reason line is therefore ABSENT, not empty — the same shape `HubRow::source` took for the shelf heading. Nothing maps a section to the source it came from yet; when that lands, one line of `dead_strs` learns about it. AND THE LAYER ABOVE. `ensure_sections` swallowed every failure into `unwrap_or_default`, so a server that could not be reached at all was indistinguishable from a table nobody had asked for yet: no section, no state, `fetch_state()` answering `Loading` out of its `unwrap_or`, and the grid spinning for the rest of the session — the same bug the base branch fixed one layer down. `SECTIONS_FETCH` is that state and `fetch_table` is the one place "the server answered" and "the request failed" are told apart. `readout_of` is where the whole decision lives now, as one pure function over both fetch states and the store — four answers that were four `else if`s in the middle of `draw`, none of which a host could reach. Catching only the FAILED table was not enough: a server that answers with nothing we browse (a music-only account) is Ready with no sections and falls into the same two `unwrap_or` defaults, which is the eternal spinner one case over. That one is Empty, because it answered. Its read-out was then drawn at alpha 0 — the grid's `Xfade` asks "did a section answer" to decide it has content, and with no section that is false forever — so `ready` now asks `readout()`, which is the question with the right shape. `browse::failed_initial` is gone: it was exactly one arm of `readout_of`, and one rule in two places is what this file keeps being wrong about. `/tmp/plxnative-libfail` forces one read-out state (`dead` / `own` / `table` / `empty`). This screen's failure is the one state in the app that cannot be reached on purpose — it needs a server that refuses — and the honest way there is three moving parts, each of which fails looking exactly like "the app is fine". It forces the PROJECTION only; `browse` keeps whatever state it really has, and it is compiled out of a `RELEASE=1` build with every other trigger (verified: the string is absent from the release binary). Deliberately not the player's `failtest`, which already owns that name and a different vocabulary. Host 418 -> 430, `make check` green three times; `make` and `make RELEASE=1` both link. NOT VERIFIED ON DEVICE — the television was held for the whole of this work and the coordinator has taken the fleet's device pass; the PR body carries the recipe. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…' into shared-servers-integration # Conflicts: # rust-modules/src/metadata.rs # rust-modules/src/plex/mod.rs # rust-modules/src/pms.rs # rust-modules/src/route.rs
…named the friend's server
The app already holds itself to a redaction contract for someone else's server —
`dev.rs`'s `DevServer::describe`, pinned by
`describe_redacts_everything_identifying_about_someone_elses_server`: a SHARED
server names nothing that identifies it or its owner, only a stable
non-reversible `ref=` tag so two lines about one server can be correlated inside
a single log. That contract exists because four PR bodies leaked exactly these
fields on 2026-08-14 and had to be redacted after the fact, which a public
repository does not really allow.
`tests/run.py` was not held to it, and it prints to stdout — which is every bit
as pasteable as the file the contract was written for. Three lines said the
whole of it: `setup_shared`'s header ("second server: <name> @ <host>:<port>
(machine_id=…)"), and the per-case and per-scene trigger lines ("plxnative-
servers: <<name> @ <host>:<port>, token redacted>"), which carefully redacted the
token while printing the address and the machine name beside it. A harness run is
the most likely thing in this repo to be pasted into an issue.
So the harness now says it the way the app does. `server_ref` is `describe`'s FNV
arithmetic reproduced in Python and `describe_server` is its branch — `handle`
non-empty means somebody else's, and produces the SAME text the event log does,
so a transcript line and a device line about one server read as one server. Your
own machine is unchanged: it is already in the boot line and in
`config.local.h`.
Two places needed a decision rather than a translation.
`--list` runs offline, so there is no `sourceTitle` to branch on and ownership is
unknown; `describe_spec` guesses the stricter rule, and prints the same `ref=`
the real run will when the block names a `machine_id`, so the two correlate.
The "servers this account can reach" listing on a failed resolve KEEPS the names
and machine ids, deliberately: they are the answer to the question that exit
asks, which is "put one of these in your gitignored overlay", and it fires before
anything runs. It now says out loud that a "shared with you" row is somebody
else's machine and is not for pasting.
Nothing links the Python tag to the Rust one at build time, so `dev.rs` gains a
test pinning the whole line to a literal — `SHARED ref=71c955 port_set=true` for
a fixed machine id — and `run.py`'s docstring names that test. If one side's
arithmetic moves, the other's has to move with it.
Verified: `tests/run.py --list` parses and prints the redacted header;
`cargo +nightly test --lib` green.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
`maybe_discover` runs once a frame. When `task::spawn_small` refused the worker,
the arm released the single flight and did nothing else — so the very next frame
picked the same source, spawned again, was refused again. `task::spawn` logs
every refusal ("task: spawn 'sources' REFUSED — this work is dropped"), which
makes that ~60 lines a second into `/tmp/plxnative-events.log`: the one file
on-device triage is read from, drowned exactly when the machine is under enough
thread pressure to be worth reading about.
The fix is the backoff the file already runs for a failed landing —
`SRC_RETRY_CD`, ~10 s — not a quieter log. Retrying at 60 Hz cannot succeed
either: nothing about a refused `pthread_create` changes within a frame, and the
comment claiming "callers re-kick every frame, so this retries by itself" was
describing a hot loop as if it were a recovery.
The refusal arm is now `discovery_spawn_refused`, which does both halves and says
why neither is enough alone. What it deliberately does NOT do is mark the source
unreachable: nothing was asked of that server, so the Sources list must not dim
its group and the Library must not say it failed. Only the next attempt moves,
and `retry_cur_source` — the read-out's *Try again* — clears it exactly as it
clears a real failure.
The page-fetch site (`maybe_spawn`) has the same shape and is deliberately left
alone: it is already gated by `RETRY_CD` at the top of `pump`, so it cannot spin
the same way.
The test drives `discovery_spawn_refused` directly, because there is no way to
make the OS refuse a thread on demand, and then runs a real second of frames
through `maybe_discover` to show the backoff holds the picker off — a call that
is only safe there BECAUSE the backoff is armed, which is the property under
test.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
…cast wrapped
Every port in this app arrives as an `i64`, because plex.tv and PMS both
string-encode numbers and every numeric field goes through the lenient `de_i64`
— so what lands in a `Candidate`, a `SourceRef` or a `DevServer` is whatever the
JSON said, not whatever a port can be. The transport takes an `i32`, and the
narrowing was a bare `as` cast at five sites.
`4_294_999_696 as i32` is **32400**. That is the shape of the failure worth
naming: not a nonsense port that fails to connect, but the most ordinary port
there is, at an address the answer really did name — and on a server that is
genuinely at 32400 the probe then matches its `machineIdentifier` and the
connection is accepted. A broken or hostile `/api/v2/resources` could have moved
which port the app dials and left nothing in the log to see it by.
One helper, `probe::dial_port`, is now the only way an advertised port becomes a
socket argument: `Some(i32)` inside `1..=65535`, `None` otherwise. Out of range
drops the CANDIDATE and not the server, which is the same rule this file already
applies to an address the transport cannot speak — another of its addresses may
still be dialable.
Five gates use it, and they are five because the value arrives from three
different places and each has its own consequence:
* `probe::is_usable` — the plex.tv boundary; `port <= 0` was already refused
here and the range simply completes the test.
* `auth::dial_target` — the last thing before a socket. `dialable` is now
defined in terms of it, so the predicate that admits a candidate and the
number handed to `dial` cannot disagree.
* `session::SourceRef::usable` — what `install_roster` filters on before
`register(…, s.port as i32, …)`. The session file is JSON on disk: a hand
edit or a truncated write is exactly this input.
* `session::can_go_local` — the ONE gate in front of the resume path's
`plex::install`. An undialable primary now lands the app on sign-in, which is
the honest report for a session it cannot dial. It also covers `port` simply
being absent from an older file (`serde(default)` = 0), which could never
have connected either.
* `dev::DevServer::usable` — the `plxnative-servers` trigger, a hand-written
blob under `/tmp`, registered with the same cast in `app.rs`.
Tests: the arithmetic and its boundaries in `probe.rs` (including that the good
address beside the wrapping one survives), a skipped candidate proving the next
address still gets its turn in `auth.rs`, and both session gates in `session.rs`
— roster entry versus primary, which fail differently and where one does not
imply the other.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
…-in contradicted itself `/tmp/plxnative-shared=<handle>` is deliberately ONE file arming three surfaces — the detail page's "Shared by …" run (`metadata::fetch_detail`), the home hero's (`ui::home`), and the Search results' owner annotation (`ui::search::results`) — because watching them agree is the whole reason the stand-in exists. They did not agree about what the file MEANS. `metadata.rs` read it as an override: armed, it wins. The two UI sites read it as a fallback: it stood in only where the real answer was empty. On a single-server install those are the same behaviour, which is why this survived — but with a real share installed, arming the trigger changed the detail page and left the hero and the results shelf saying something else. Two surfaces, one file, disagreeing, on the one comparison the file is for. Unified to trigger-wins, which is the precedence every `/tmp/plxnative-*` read in this app has: `crate::dev`'s module doc opens by listing `plxnative-token` beating the signed-in session and `plxnative-servers` handing the app a whole server. A trigger exists to FORCE a state; a trigger that yields to the real answer cannot force anything. That makes an armed-but-EMPTY file meaningful in the same way at all three: it forces the ABSENCE of a handle, rather than being a no-op. So both UI sites now carry `Option<&str>` from the `OnceLock` instead of collapsing "absent" and "empty" into `""` — the distinction `dev::read` already draws and its doc already insists on. Each site says **"WINS WHEN ARMED"** in those words, which is the grep that finds the family. `ui/alt_sources.rs` reads the same trigger and is explicitly marked as NOT one of them: it has no real answer to outrank, so armed-and-empty means no panel content there, and someone unifying by grep should not "fix" it. No host test: the precedence is only observable with the trigger armed, and a host test that read `/tmp/plxnative-shared` would assert on whatever this dev Mac happens to have lying there — the hazard `alt_sources.rs` already guards with a `#[cfg(test)]` stub. It is checkable on the simulator or the television by arming the file and looking at all three screens, which is what the file is for. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
… note argues with the caret Two stale claims, both of the kind that reads as authoritative. `ui/CLAUDE.md`'s component table opens by promising that **every** `.rs` file under `ui/` has a row, "so a missing entry means the table is stale, not that the module is unimportant" — and then had no row for any of the five files under `ui/search/`. That is the largest screen added since the promise was written, and an undocumented module is the one the next person re-implements. Five rows now, in the table's voice: the state machine and the ▼ handoff it exists for, the field and its two pure functions, the shelves and their one vertical geometry, the recents block that imports `table.rs`' numbers rather than restating them, and the two empty states that are statements rather than failures. `nav.rs`' row said `page_alpha()` is pushed by "`home_draw`, `library::draw`, `detail::draw`, `person::draw`, and those four are the whole list". Search's `draw` has pushed it since the screen landed, so the closed list was wrong by one — and it pushes `chrome_alpha()` too, which the same row described as the bar shared by "Home and the Library". Both corrected, with a line about the shape of the staleness: that list grows by one every time a screen becomes routable. `tests/manifest.json`'s `_caret_note` was worse than stale — it argued a position the code had abandoned, quoting `ui/search/field.rs` saying the caret is "solid by design" because "a blinking caret would hold the GL loop awake forever". `field.rs` has since retracted that in its own doc, `BLINK_MS` is 530 and `step_blink` reports to `ui::idle` on the phase FLIP alone (two presents a second while the panel is up, nothing while it is not), and `the_caret_blinks_and_reports_only_on_the_flip` grades both halves on the host. A reader reaching that note for "does the caret blink" got the answer backwards. The note's other half was right and is kept, with the reason spelled out: this scene does not grade the caret and no fps scene can. The caret is drawn only while `editing`, `plxnative-search` seeds the field but leaves `EDITING` false (`search::enter` calls `leave()` first), raising the television's panel takes a real OK press, and `run_fps_scene` has no key-injection path at all — only the playback cases do. So NO scene was added: it would need a harness change and would then measure a screen with a system keyboard over its bottom third, which is a different measurement. The blink's gate is the host test. Docs and one JSON note only; no behaviour. `cargo +nightly test --lib` green, `tests/run.py --list` parses. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
# Conflicts: # rust-modules/src/auth.rs # rust-modules/src/plex/session.rs
GLinnik21
force-pushed
the
shared-servers-integration
branch
2 times, most recently
from
August 15, 2026 15:12
01644ad to
a4de7a5
Compare
GLinnik21
added a commit
that referenced
this pull request
Aug 22, 2026
The checklist is a submission DOCUMENT, not a private rubric, and its own preamble is the reason this file exists: every item must be Pass or N/A, and marking one Pass when it should be N/A — or vice versa — is a stated rejection ground. So "we never tested it" is not a markable state, which makes the UNTESTED column matter as much as the failing one. Eleven items sit there today. Four fail outright, and three of those are one root cause: `stream.rs::http_open` builds a `sockaddr_in` from four decimal octets, so no TLS, no DNS, IPv4 only — which takes out #20, #43 and #47 together the moment a QA bench is not on the same LAN as a plaintext PMS. Plus no ABR (#43 CASE1) and factory reset (#53), which is undefined for a sideloaded app. §4 records the four items that moved on 2026-08-22 and why they are worth reading together: every one was found by LOOKING AT THE PANEL, and not one was visible in a green test run. Subtitles rendering `.notdef` tofu because neither Inter nor the television has U+2669-U+266C; transport keys bound to CEA-2014-A web keyCodes instead of the native scancodes the app actually receives; a splash 63% black against LG's "should not be black"; and `requiredMemory` asking for less headroom than declaring nothing would have. §5 records the two items that are DECISIONS rather than defects — no on-screen transport button row, and English-only — because a future reader of the checklist will otherwise try to "fix" the first one, and item 45's own remark ("refer to UX scenario for movement details") is what makes the UX scenario document, not code, the place that answer belongs. §7 names the defect class rather than the bug: the music note was the visible tip of "any codepoint outside Inter tofus", which is CJK, Hebrew, Arabic and Thai titles and subtitles, hits the same two items, and nothing in the host suite can see. Co-Authored-By: Claude Opus 5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 23, 2026
**This commit contradicts a recorded OWNER RULING and is separated from the one before it for that reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and states the consequence: "There is no add-a-server-by-address on the television, and there will not be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it. Dropping this commit leaves the one before it building and green, which is the point of the split. The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface anywhere that could be typed an address. That is a question about a REVIEWER being unable to evaluate the app at all, which is not the question the ruling answered — it may or may not move it. **No new `Route` and no screen.** It is two rows in the tail of the popover that already exists, beside "Check for new shares", which is the other answer to "my server is missing" — putting them side by side is the point. Closed it is one row; open it is the field plus its action row, and the COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`, carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and never will — did not have to learn about a state it cannot reach. The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there, because the television's keyboard has no caret and delegates its delete and Clear-all to the app as ordinary key syms. **The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`, merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes the request today, so the field ages out after 20s saying nothing answered — literally true of a request nobody picked up, and the right read-out once somebody does and the address is wrong. **A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which was defensible only while the panel had nothing to offer a user with one server. It was the single state in the app where somebody whose only server cannot be dialled had nowhere to type one — the exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING library: one source, nothing wrong, still no chip. Five findings from `/code-review high`, all fixed and each with a test: - **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the simulator survives "привет" with the app still running. - **The keyboard wedge Search is explicitly defended against.** An app-switch left `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again. `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping what was typed, because an app switch is the OS moving the screen, not the user abandoning it. - **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has libraries yet drew neither way out, in precisely the state both rows exist for. It is its own headerless section now, with no separator drawn over nothing. - **The mailboxes had no request identity**, so a late answer for an attempt the user had already replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped. - **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:` unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead. 1088 host tests (1075 on the commit before it). Prose corrected where this makes it false: `ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7. `docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the replacement wording is in the PR body rather than in this diff. 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 24, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the other; both are the words a surface uses about a fact it already had. **The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory is the last run on that line and elides from the right, so leading with the state means a 34-character plex.tv handle is what gives way rather than the fact that a server is not answering. `Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about our own instrumentation, and stating it would put a warning on a working server. Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to fit, which reads as a broken server unless something says why; Remote explains a slower first frame and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not reachable · Relay · friend" reads as three problems where there is one. The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which `Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather than inheriting one, and it still defers to `reachable()` for the three states that method gets right. `browse.rs` needed no edit. **And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an account without Plex Home never gets a profile written at all — so that title is empty for a signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself with their name and offered "Sign out". On a fresh single-user test account that is the first thing a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and named `ui/widgets.rs` as the fix site. Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`, not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks for. 1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s `Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * sources: an address you can type, and a seam for whoever dials it **This commit contradicts a recorded OWNER RULING and is separated from the one before it for that reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and states the consequence: "There is no add-a-server-by-address on the television, and there will not be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it. Dropping this commit leaves the one before it building and green, which is the point of the split. The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface anywhere that could be typed an address. That is a question about a REVIEWER being unable to evaluate the app at all, which is not the question the ruling answered — it may or may not move it. **No new `Route` and no screen.** It is two rows in the tail of the popover that already exists, beside "Check for new shares", which is the other answer to "my server is missing" — putting them side by side is the point. Closed it is one row; open it is the field plus its action row, and the COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`, carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and never will — did not have to learn about a state it cannot reach. The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there, because the television's keyboard has no caret and delegates its delete and Clear-all to the app as ordinary key syms. **The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`, merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes the request today, so the field ages out after 20s saying nothing answered — literally true of a request nobody picked up, and the right read-out once somebody does and the address is wrong. **A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which was defensible only while the panel had nothing to offer a user with one server. It was the single state in the app where somebody whose only server cannot be dialled had nowhere to type one — the exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING library: one source, nothing wrong, still no chip. Five findings from `/code-review high`, all fixed and each with a test: - **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the simulator survives "привет" with the app still running. - **The keyboard wedge Search is explicitly defended against.** An app-switch left `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again. `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping what was typed, because an app switch is the OS moving the screen, not the user abandoning it. - **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has libraries yet drew neither way out, in precisely the state both rows exist for. It is its own headerless section now, with no separator drawn over nothing. - **The mailboxes had no request identity**, so a late answer for an attempt the user had already replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped. - **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:` unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead. 1088 host tests (1075 on the commit before it). Prose corrected where this makes it false: `ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7. `docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the replacement wording is in the PR body rather than in this diff. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * Revert "sources: an address you can type, and a seam for whoever dials it" This reverts commit b61ce64. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
…ection (#47) Transcode seeks flushed + refed a fresh start.mkv?offset WITHOUT sending a new GStreamer segment, leaving a stale segment -> visual artifacts on the jump (the same class of bug the in-place seek cured for direct-play; a transcode can't use the in-place path because the stream content changes at the new offset). Route transcode seeks through the existing engine::reload_transcode() instead — a fresh Load rebuilds the segment by construction (the known-good fresh-play path). Removed the now-dead flush+refeed transcode arm + subs_reopen helper. That reload exposed a latent trap: reset_session() (run by every teardown) wiped desired_sub_idx + subs_want_sid, so a reload-based seek would silently kill subtitles. Made the subtitle selection PERSIST across seeks/reloads — mirroring desired_audio_idx, which already does — resetting only on a new item (player::reset_subtitle). Bonus: subs now also survive an app background/foreground cycle. Verified: toy_story4_seek_transcode reloads at the target and climbs past it, no error; full suite green. Visual artifact-gone check pending on-device. 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
toy_story4_seek_transcode now reloads (reload_transcode) instead of flush+refeed (seek(transcode)); update op_seek_transcode to recognize the new log line. 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
…y to find anything in either (#47) shared servers + Search: a friend's library beside your own, and a way to find anything in either
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
The checklist is a submission DOCUMENT, not a private rubric, and its own preamble is the reason this file exists: every item must be Pass or N/A, and marking one Pass when it should be N/A — or vice versa — is a stated rejection ground. So "we never tested it" is not a markable state, which makes the UNTESTED column matter as much as the failing one. Eleven items sit there today. Four fail outright, and three of those are one root cause: `stream.rs::http_open` builds a `sockaddr_in` from four decimal octets, so no TLS, no DNS, IPv4 only — which takes out #20, #43 and #47 together the moment a QA bench is not on the same LAN as a plaintext PMS. Plus no ABR (#43 CASE1) and factory reset (#53), which is undefined for a sideloaded app. §4 records the four items that moved on 2026-08-22 and why they are worth reading together: every one was found by LOOKING AT THE PANEL, and not one was visible in a green test run. Subtitles rendering `.notdef` tofu because neither Inter nor the television has U+2669-U+266C; transport keys bound to CEA-2014-A web keyCodes instead of the native scancodes the app actually receives; a splash 63% black against LG's "should not be black"; and `requiredMemory` asking for less headroom than declaring nothing would have. §5 records the two items that are DECISIONS rather than defects — no on-screen transport button row, and English-only — because a future reader of the checklist will otherwise try to "fix" the first one, and item 45's own remark ("refer to UX scenario for movement details") is what makes the UX scenario document, not code, the place that answer belongs. §7 names the defect class rather than the bug: the music note was the visible tip of "any codepoint outside Inter tofus", which is CJK, Hebrew, Arabic and Thai titles and subtitles, hits the same two items, and nothing in the host suite can see. Co-Authored-By: Claude Opus 5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the other; both are the words a surface uses about a fact it already had. **The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory is the last run on that line and elides from the right, so leading with the state means a 34-character plex.tv handle is what gives way rather than the fact that a server is not answering. `Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about our own instrumentation, and stating it would put a warning on a working server. Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to fit, which reads as a broken server unless something says why; Remote explains a slower first frame and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not reachable · Relay · friend" reads as three problems where there is one. The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which `Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather than inheriting one, and it still defers to `reachable()` for the three states that method gets right. `browse.rs` needed no edit. **And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an account without Plex Home never gets a profile written at all — so that title is empty for a signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself with their name and offered "Sign out". On a fresh single-user test account that is the first thing a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and named `ui/widgets.rs` as the fix site. Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`, not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks for. 1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s `Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * sources: an address you can type, and a seam for whoever dials it **This commit contradicts a recorded OWNER RULING and is separated from the one before it for that reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and states the consequence: "There is no add-a-server-by-address on the television, and there will not be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it. Dropping this commit leaves the one before it building and green, which is the point of the split. The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface anywhere that could be typed an address. That is a question about a REVIEWER being unable to evaluate the app at all, which is not the question the ruling answered — it may or may not move it. **No new `Route` and no screen.** It is two rows in the tail of the popover that already exists, beside "Check for new shares", which is the other answer to "my server is missing" — putting them side by side is the point. Closed it is one row; open it is the field plus its action row, and the COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`, carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and never will — did not have to learn about a state it cannot reach. The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there, because the television's keyboard has no caret and delegates its delete and Clear-all to the app as ordinary key syms. **The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`, merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes the request today, so the field ages out after 20s saying nothing answered — literally true of a request nobody picked up, and the right read-out once somebody does and the address is wrong. **A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which was defensible only while the panel had nothing to offer a user with one server. It was the single state in the app where somebody whose only server cannot be dialled had nowhere to type one — the exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING library: one source, nothing wrong, still no chip. Five findings from `/code-review high`, all fixed and each with a test: - **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the simulator survives "привет" with the app still running. - **The keyboard wedge Search is explicitly defended against.** An app-switch left `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again. `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping what was typed, because an app switch is the OS moving the screen, not the user abandoning it. - **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has libraries yet drew neither way out, in precisely the state both rows exist for. It is its own headerless section now, with no separator drawn over nothing. - **The mailboxes had no request identity**, so a late answer for an attempt the user had already replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped. - **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:` unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead. 1088 host tests (1075 on the commit before it). Prose corrected where this makes it false: `ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7. `docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the replacement wording is in the PR body rather than in this diff. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * Revert "sources: an address you can type, and a seam for whoever dials it" This reverts commit b61ce64. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 27, 2026
…y to find anything in either (#47) shared servers + Search: a friend's library beside your own, and a way to find anything in either
GLinnik21
added a commit
that referenced
this pull request
Aug 27, 2026
The checklist is a submission DOCUMENT, not a private rubric, and its own preamble is the reason this file exists: every item must be Pass or N/A, and marking one Pass when it should be N/A — or vice versa — is a stated rejection ground. So "we never tested it" is not a markable state, which makes the UNTESTED column matter as much as the failing one. Eleven items sit there today. Four fail outright, and three of those are one root cause: `stream.rs::http_open` builds a `sockaddr_in` from four decimal octets, so no TLS, no DNS, IPv4 only — which takes out #20, #43 and #47 together the moment a QA bench is not on the same LAN as a plaintext PMS. Plus no ABR (#43 CASE1) and factory reset (#53), which is undefined for a sideloaded app. §4 records the four items that moved on 2026-08-22 and why they are worth reading together: every one was found by LOOKING AT THE PANEL, and not one was visible in a green test run. Subtitles rendering `.notdef` tofu because neither Inter nor the television has U+2669-U+266C; transport keys bound to CEA-2014-A web keyCodes instead of the native scancodes the app actually receives; a splash 63% black against LG's "should not be black"; and `requiredMemory` asking for less headroom than declaring nothing would have. §5 records the two items that are DECISIONS rather than defects — no on-screen transport button row, and English-only — because a future reader of the checklist will otherwise try to "fix" the first one, and item 45's own remark ("refer to UX scenario for movement details") is what makes the UX scenario document, not code, the place that answer belongs. §7 names the defect class rather than the bug: the music note was the visible tip of "any codepoint outside Inter tofus", which is CJK, Hebrew, Arabic and Thai titles and subtitles, hits the same two items, and nothing in the host suite can see. Co-Authored-By: Claude Opus 5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 27, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the other; both are the words a surface uses about a fact it already had. **The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory is the last run on that line and elides from the right, so leading with the state means a 34-character plex.tv handle is what gives way rather than the fact that a server is not answering. `Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about our own instrumentation, and stating it would put a warning on a working server. Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to fit, which reads as a broken server unless something says why; Remote explains a slower first frame and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not reachable · Relay · friend" reads as three problems where there is one. The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which `Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather than inheriting one, and it still defers to `reachable()` for the three states that method gets right. `browse.rs` needed no edit. **And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an account without Plex Home never gets a profile written at all — so that title is empty for a signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself with their name and offered "Sign out". On a fresh single-user test account that is the first thing a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and named `ui/widgets.rs` as the fix site. Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`, not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks for. 1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s `Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * sources: an address you can type, and a seam for whoever dials it **This commit contradicts a recorded OWNER RULING and is separated from the one before it for that reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and states the consequence: "There is no add-a-server-by-address on the television, and there will not be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it. Dropping this commit leaves the one before it building and green, which is the point of the split. The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface anywhere that could be typed an address. That is a question about a REVIEWER being unable to evaluate the app at all, which is not the question the ruling answered — it may or may not move it. **No new `Route` and no screen.** It is two rows in the tail of the popover that already exists, beside "Check for new shares", which is the other answer to "my server is missing" — putting them side by side is the point. Closed it is one row; open it is the field plus its action row, and the COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`, carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and never will — did not have to learn about a state it cannot reach. The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there, because the television's keyboard has no caret and delegates its delete and Clear-all to the app as ordinary key syms. **The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`, merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes the request today, so the field ages out after 20s saying nothing answered — literally true of a request nobody picked up, and the right read-out once somebody does and the address is wrong. **A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which was defensible only while the panel had nothing to offer a user with one server. It was the single state in the app where somebody whose only server cannot be dialled had nowhere to type one — the exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING library: one source, nothing wrong, still no chip. Five findings from `/code-review high`, all fixed and each with a test: - **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the simulator survives "привет" with the app still running. - **The keyboard wedge Search is explicitly defended against.** An app-switch left `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again. `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping what was typed, because an app switch is the OS moving the screen, not the user abandoning it. - **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has libraries yet drew neither way out, in precisely the state both rows exist for. It is its own headerless section now, with no separator drawn over nothing. - **The mailboxes had no request identity**, so a late answer for an attempt the user had already replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped. - **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:` unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead. 1088 host tests (1075 on the commit before it). Prose corrected where this makes it false: `ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7. `docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the replacement wording is in the PR body rather than in this diff. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * Revert "sources: an address you can type, and a seam for whoever dials it" This reverts commit d9513e523518ca362f9b92a797c9b762bebabbcc. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 28, 2026
…y to find anything in either (#47) shared servers + Search: a friend's library beside your own, and a way to find anything in either
GLinnik21
added a commit
that referenced
this pull request
Aug 28, 2026
The checklist is a submission DOCUMENT, not a private rubric, and its own preamble is the reason this file exists: every item must be Pass or N/A, and marking one Pass when it should be N/A — or vice versa — is a stated rejection ground. So "we never tested it" is not a markable state, which makes the UNTESTED column matter as much as the failing one. Eleven items sit there today. Four fail outright, and three of those are one root cause: `stream.rs::http_open` builds a `sockaddr_in` from four decimal octets, so no TLS, no DNS, IPv4 only — which takes out #20, #43 and #47 together the moment a QA bench is not on the same LAN as a plaintext PMS. Plus no ABR (#43 CASE1) and factory reset (#53), which is undefined for a sideloaded app. §4 records the four items that moved on 2026-08-22 and why they are worth reading together: every one was found by LOOKING AT THE PANEL, and not one was visible in a green test run. Subtitles rendering `.notdef` tofu because neither Inter nor the television has U+2669-U+266C; transport keys bound to CEA-2014-A web keyCodes instead of the native scancodes the app actually receives; a splash 63% black against LG's "should not be black"; and `requiredMemory` asking for less headroom than declaring nothing would have. §5 records the two items that are DECISIONS rather than defects — no on-screen transport button row, and English-only — because a future reader of the checklist will otherwise try to "fix" the first one, and item 45's own remark ("refer to UX scenario for movement details") is what makes the UX scenario document, not code, the place that answer belongs. §7 names the defect class rather than the bug: the music note was the visible tip of "any codepoint outside Inter tofus", which is CJK, Hebrew, Arabic and Thai titles and subtitles, hits the same two items, and nothing in the host suite can see. Co-Authored-By: Claude Opus 5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 28, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the other; both are the words a surface uses about a fact it already had. **The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory is the last run on that line and elides from the right, so leading with the state means a 34-character plex.tv handle is what gives way rather than the fact that a server is not answering. `Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about our own instrumentation, and stating it would put a warning on a working server. Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to fit, which reads as a broken server unless something says why; Remote explains a slower first frame and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not reachable · Relay · friend" reads as three problems where there is one. The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which `Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather than inheriting one, and it still defers to `reachable()` for the three states that method gets right. `browse.rs` needed no edit. **And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an account without Plex Home never gets a profile written at all — so that title is empty for a signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself with their name and offered "Sign out". On a fresh single-user test account that is the first thing a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and named `ui/widgets.rs` as the fix site. Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`, not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks for. 1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s `Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * sources: an address you can type, and a seam for whoever dials it **This commit contradicts a recorded OWNER RULING and is separated from the one before it for that reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and states the consequence: "There is no add-a-server-by-address on the television, and there will not be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it. Dropping this commit leaves the one before it building and green, which is the point of the split. The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface anywhere that could be typed an address. That is a question about a REVIEWER being unable to evaluate the app at all, which is not the question the ruling answered — it may or may not move it. **No new `Route` and no screen.** It is two rows in the tail of the popover that already exists, beside "Check for new shares", which is the other answer to "my server is missing" — putting them side by side is the point. Closed it is one row; open it is the field plus its action row, and the COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`, carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and never will — did not have to learn about a state it cannot reach. The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there, because the television's keyboard has no caret and delegates its delete and Clear-all to the app as ordinary key syms. **The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`, merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes the request today, so the field ages out after 20s saying nothing answered — literally true of a request nobody picked up, and the right read-out once somebody does and the address is wrong. **A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which was defensible only while the panel had nothing to offer a user with one server. It was the single state in the app where somebody whose only server cannot be dialled had nowhere to type one — the exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING library: one source, nothing wrong, still no chip. Five findings from `/code-review high`, all fixed and each with a test: - **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the simulator survives "привет" with the app still running. - **The keyboard wedge Search is explicitly defended against.** An app-switch left `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again. `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping what was typed, because an app switch is the OS moving the screen, not the user abandoning it. - **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has libraries yet drew neither way out, in precisely the state both rows exist for. It is its own headerless section now, with no separator drawn over nothing. - **The mailboxes had no request identity**, so a late answer for an attempt the user had already replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped. - **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:` unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead. 1088 host tests (1075 on the commit before it). Prose corrected where this makes it false: `ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7. `docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the replacement wording is in the PR body rather than in this diff. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * Revert "sources: an address you can type, and a seam for whoever dials it" This reverts commit d9513e523518ca362f9b92a797c9b762bebabbcc. --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shared servers and the Search screen, integrated: a friend's library sits beside your own, and there is finally a way to find anything in either.
This is the integration branch for the work the 21 open unit PRs cover, plus the Search screen built on top of it and a round of device fixes that only a television could have found. 124 commits, 71 files.
What it adds
More than one server. A friend's shared server is not a second address, it is a second authority — its own
machineIdentifier, its own per-user token, its ownratingKeyspace and its own watch state.plex/servers.rsis a registry rather than a singleton; an item's identity is a(server, key)pair; Home merges every pinned source and one dead share cannot take it down; the Library gets a Source chip and a Sources panel; the detail page gets Also available when two servers hold the same film.Search. The last pill in the shared strip,
/hubs/searchacross every registered source, merged client-side into typed shelves (Movies / TV Shows / Episodes / Cast & Crew / Collections) in a fixed order. Text entry is the television's own keyboard — plainSDL_StartTextInput, which turns out to work on this firmware and to hand the app a whole edit protocol nobody had documented.The device findings, because they are the interesting part
Everything below was found on hardware and could not have been found on the host.
SDL_TEXTINPUTand forwards every edit intent as an ordinary key:</>are caret moves, its delete is backspace, its Clear all isSDLK_CLEAR(wcode 156). Three of its four buttons visibly did nothing until this.SDL_TEXTEDITING, no backspaces, just the whole word.sum+summergavesumsummer. Keyed on commit length, since every key press is exactly one character and only the prediction bar sends more.SDL_IsScreenKeyboardShowndoes not answer the question its name asks on this firmware — it reports false with the panel up and being typed on. A dismissal detector built on it shipped a dead keyboard for an hour. Replaced by a signal that cannot lie: an arriving text event is proof the panel is up.glBlendFuncwas squaring the alpha channel. The wayland surface is deliberately non-opaque so the video plane shows through, so alpha is output, not scratch — and every partial-alpha draw in the app was punching a hole in it and letting black through. Invisible in a screenshot, a hard bar on the panel. It took a photograph to see. Fixed withglBlendFuncSeparate; every fade in the app has been a shade darker than authored since the renderer was written.Verification
make check— 660 host tests, plus the three named clippy lintsmake— ARM cross-build links./tests/run.py— 21/21 on device, including both subtitle renderers, which draw through the blend path that changed./tests/run.py --fps— 13/13, no scene regressedNotes for review
shared-servers-baseare all correctly based and have clean diffs; this branch contains that base plus everything since. Merging here supersedes them — close them or land them first, whichever you prefer for the review record.🤖 Generated with Claude Code
https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Review round (2026-08-15)
Reviewed at max effort, then fixed. Twelve finder angles produced ~55 candidates; 37 survived dedup into clustered adversarial verification (24 confirmed, 5 plausible, 2 refuted). The 15 most severe were fixed across seven parallel clusters, and
origin/mainwas merged in.The five that mattered most
refresh_roster_onlinefetched/api/v2/resourceswith the adminaccount_tokenon every boot and picker-open, then swapped those admin per-server tokens in under whichever managed profile was active — wrong-identity scrobbling, and for a restricted profile a re-grant of sharesretokenhad correctly dropped. It now refuses unless the active profile is the account owner's, because re-keying is not available: the per-user tokens only exist in a/resourcesfetched with that user's own token.revoke_all()now raises a floor under the walk and empties each retired client's token, so a reference a worker already holds cannot dial with the old credential.ratingKeyalone. Servers each number from 1, so a resolve for one server's item landed on another's page and OK opened the wrong film.AltResultnow carries itsServerId, the waySeasonResultalready did.viewstate.rs).savenow writes a sibling tmp and renames;update()is the one door for changing part of the file.Also fixed: both Plex Pass read-outs judged the browsed server rather than the item's; the Search pill threw away the search you were reading; an app-switch left a caret blinking over a keyboard the compositor had torn down; scrolled-away posters still took clicks; the Sources panel rebuilt every frame it was open; the toolbar drew no focus while OK still activated a chip; ports wrapped on an
as i32; and the harness printed a third party's server name, address and machine id to stdout, which the app's own redaction contract forbids.One fix the suite itself needed.
make checkwas aborting roughly one run in five under load — nightly's UB checks firing on a dangling&str.pms::reset()never adopted the section-table generation, so a later pump re-committed and freed the strings a live borrow still pointed into; three more modules leaked state past their lock. Four defects, no data race (ThreadSanitizer was clean 75 runs straight, which was the clue). 0 failures in 100 stressed runs after.Verification of the merged result
make check— 703 host tests (662 before this round), plus the named clippy lintsmake— ARM cross-build links;tools/fwcompat.pyunchanged at OK on 4.4.2 → 11.2.0make sim— the desktop simulator builds./tests/run.py— 21/21 on device./tests/run.py --fps— 13/13, no scene regressedThe branch history was rewritten once before merge: nine commit messages named a third party's plex.tv handle, library and hostname (the file contents had already been redacted), and 347 MB of build cache had been swept into a merge by accident. Both are gone; every tree is otherwise byte-identical.
Fixes #147.