Repository navigation
Conversation
…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 bamx23" — 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. "bamx23" is the same string the shelf headings say; "bx23-ldn" 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
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 bamx23" 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 bamx23
S1 E4 · Episode title · Shared by bamx23
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 bx23-ldn" 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 · LDN Films bamx23 ▾`, 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
…is public 139 sites across 12 files carried a real third party's plex.tv handle, machine name, library name, port and LAN address: test fixtures, doc comments, the shared-servers note, and the harness README. They came in through the foundation commits and then spread, because each unit copied the shape of the fixture next to it. None of it is ours to publish. github.com/GLinnik21/plx-native is PUBLIC — a fact this codebase had recorded as "private" for about a month — and the person who shared their server is not a party to this project. Replaced throughout with stand-ins, several chosen at the SAME character length because ui/home.rs asserts text widths against them: handle bamx23 -> friend machine bx23-ldn -> nas-home library LDN Films -> Film Club port (real) -> 31234 LAN address 172.20.x -> 10.9.9.x (still RFC1918, as the real one is) machine id (real 40h) -> aaaabbbb... run docs/shared-servers.md already carried a paragraph promising exactly this redaction while violating it, so that paragraph now states the convention as a table, and says plainly that it was not followed. Stating a rule is not applying it. 479 tests green; the length-matched stand-ins keep every width assertion. Not fixed here, and both need a decision rather than an edit: the same values are in the history of origin/shared-servers-base (commits 4b8a103, 9c7d676), and one orphaned pre-force-push commit remains reachable by SHA on GitHub. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…no pill Builds on #31's projection rather than replacing it: the strip stays "your own libraries, plus a type only a friend has", and this makes that second half work. `is_show: bool` has two values, so "does an owned library have this KIND" — the test that decides whether a borrowed library gets its own pill — answers YES for a friend's MUSIC library on the strength of your films. It would fold onto your Movies pill, and everything in it would be unreachable from the strip. The other half of the same gap was one layer up: `project_sections` dropped `artist` and `photo` at discovery, so those types could never reach the projection to be missing from it. A type dropped at the door cannot be the growth case. So `SecKind` (Movie/Show/Music/Photo) replaces the boolean, discovery keeps every type this product has a level for, and the projection compares by type. A music library browses like any other section — the listing, its server-driven sorts and the A-Z rail are all type-agnostic, and this account's own /hubs already put a Recently Added Music shelf on Home, so the content was at the top level before it had a tab. What is still missing is the level BELOW the grid: an artist opens the movie detail page, which has nothing to play. That belongs to whoever builds the music level; the strip's job is to say the type exists. Two more things the multi-source table made true and one bug of my own: - The label + width cache moves off the section table's generation onto the STRIP's (`browse::tabs_gen`), bumped only when the projected pill list actually changes. The table's generation now moves once per source as libraries land, and most of those fold onto pills already drawn — so the row was re-measuring every pill, several times a boot, on Home's hot path, for a strip that had not moved. - `Nav::Library` carries a TAB and `pill = section + 1` is not true any more. Three comments still said "the first section" where they meant "the first tab" (the navosc scene, `select_pill`, the FPS manifest) and `nav.rs`'s TAB doc said the pill was a section index plus one. Wording only — #31 wired the arithmetic correctly; a doc that lies about an index space is how the next edit gets it wrong. - `tabs()` compared the old and new projection with `addr_of!(TABS).read()`, which copies the Vec BITWISE and then drops the copy — freeing the buffer the static still points at. A double free that aborts the process, found by the new invariance test rather than by review. It borrows now. The deliverable is host-provable, which matters because there is no host runtime: `the_strip_is_the_same_row_at_one_friend_and_at_three` grows the roster to eleven libraries across four sources and asserts the pill list never moves — the width follows, since every pill's width is a pure function of its label. Fixture names use the canonical stand-ins (`friend`, `nas-home`, `Film Club`), which are also character-length-preserving for the width assertions in home.rs.
…sure Two bugs of mine, both found by review with probe tests rather than by reading. **A profile switch kept the previous account's pills.** Moving the label/width cache onto the strip's own generation made `reset()` stop invalidating it: `reset` CLEARED the projection's memo, so the next derivation compared `[]` against `[]`, saw no change, and never bumped. `draw_tab_row` iterates the cache rather than the live table, so after a re-login the strip went on drawing — and hit-testing — libraries the new user cannot open, until some later landing happened to change the row. The memo is now invalidated rather than emptied, so the comparison that decides everything is made against what was actually on screen. That is also the shape of the rule: a memo nobody clears early cannot lie about what changed. **The row grew by PEOPLE for an un-owned type.** `owned || !owned_kinds.contains` admits one pill per borrowed LIBRARY of a missing type, so two friends who both share Music are two identically-titled Music pills with nothing to tell them apart — the exact property the projection exists to prevent, and the one the invariance test claimed to hold, which it could not see because its fixtures were all types we own. A missing type earns one pill now; the rest of that type are reachable through the toolbar's Source chip, exactly as a borrowed library of a type you DO own already is. Newly reachable because this branch admits `artist`/`photo` at all. Both are now regression tests, and the invariance test grew the half that would have caught the second: three friends sharing music are one Music pill. Also from the same review, smaller: - The unwatched filter is a movie/show question and only those two types answer it, so the query no longer sends `unwatched=1` to a music or photo listing — and the Filter menu no longer offers the switch there, because a control that visibly changes nothing is a worse answer than one that is not offered. The menu's row indices go through `filter_rows` rather than literals, since the switch's absence shifts Genre up. - `Nav::Library`'s own doc still said "section" where the arithmetic already meant "tab", and `docs/pms-api.md` still told the next reader to filter sections down to movie/show — the filter this branch removed on purpose.
…' into shared-servers-integration # Conflicts: # docs/shared-servers.md # rust-modules/src/app.rs # rust-modules/src/browse.rs # rust-modules/src/plex/mod.rs # rust-modules/src/plex/servers.rs
…' into shared-servers-integration
Units 7 and 8 branched before the scrub landed, so merging them reintroduced the handle, machine name and library name into dev.rs (the DevServer.handle doc), plex/models.rs and ui/library.rs's Source-panel fixtures. This is the shape to expect for every remaining merge: a scrub is a property of a TREE, and any branch cut before it carries the old values forward. Re-scan after each one — `grep -rlE` over rust-modules/src, docs and tests with the six values, which is what caught these. Stand-ins per the table at the top of docs/shared-servers.md. 497 tests green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…and its retry stops blocking
Two findings from the review of the merge, both inside this unit.
THE SESSION READ. `dead_strs` resolved the labels and compared afterwards, so
`source_labels`' fallback — `plex::session::peek`, a file read plus a JSON parse —
ran on every drawn frame the failure read-out was up. And it ran on ALL of them:
the fallback fires exactly when the browsed source has no name of its own, which
a source that never answered can never have. The cache was keyed on the value the
read produced, so it could not avoid the read.
Keyed on the RAW `(name, handle)` pair now — two `&'static str` comparisons off
this module's own table — with the check ahead of any resolution, so `peek` runs
once per change instead of once per frame. A profile switch still invalidates it:
`browse::reset` empties the sources, so the key goes to ("", "").
THE BLOCKING RETRY. `retry_cur_source` called `ensure_sections` for a source whose
table had never landed, on the reasoning that it is the same call route entry
makes. Route entry makes it for a server nobody has dialled yet; this button is
only reachable for one that has just been PROVEN not to answer, so every press
parked the SDL loop for a full connect(2) timeout.
That trade was real on the branch this came from, where nothing else could
discover a source. The merge removed it: `maybe_discover` picks up exactly the
pair this sets — `retry_cd == 0 && !sections_done` — on the next `pump`, off the
main thread. So the button now clears both back-offs and returns, the screen no
longer re-enters itself, and the read-out clears on the frame `readout()` stops
saying Failed. Its job at both layers is the same one it always claimed: skip the
wait.
Host 510 green three times, `make` and `make RELEASE=1` link.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…tch tabs Owner-reported on the device build: picking a library in the Sources panel could land on one of another type, which moves the selected SECTION — and the tab is derived from the section's kind, so a control in the toolbar silently navigated the row above it. Scoping the row model is the fix rather than a guard on the press. A guard leaves rows on screen that refuse to do anything, and the panel would have to explain why; with the type as the scope there is nothing to explain, and a source with no library of this type drops out entirely (source_sections already omits a group whose rows are gone, so no empty header appears). Both LEVELS are scoped, not just Browse: the panel is one row set shown two ways, and a Browse level listing four libraries while On Home listed six reads as two different lists. Pinning a TV library is done from the TV Shows tab. `pinned`/`last_pinned` stay whole-roster facts, so "Home needs one library" still counts every pin rather than the visible ones. Mutation-checked: dropping the filter fails the new test and nothing else. 498 green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
… shared-servers-integration
…lay goes to the item's own server Three owner-reported device failures, three causes, all on paths the dev triggers bypassed — which is why a headless capture showed the feature working and a signed-in television did not. 1. NOTHING EVER DESCRIBED A SERVER on a real boot. `install_roster` registered each source and never called `describe_server`, so `ServerFacts` stayed unset, every source read as owned with an empty handle, and each surface then correctly drew nothing: no "Shared by" on a detail page, no handle on a shelf heading or the Source chip, no owner on a failure read-out, and a friend's library pinned to Home by the ownership default. It presented as five separate features not working. The only `describe_server` call in the app was in `app.rs`'s DEV-TRIGGER path. 2. THE STRAIGHT-TO-HOME BOOT NEVER INSTALLED THE ROSTER at all — a stored session with a single Plex Home user, or any automated run. One registered server, no shares, nothing to browse or attribute. `install_stored_roster`'s own doc had named this call site as missing; it is now made rather than described. 3. PLAYS RESOLVED AGAINST THE BROWSED SERVER, not the item's. `request_play_movie` passed `surface_sid()` while the row has carried its own `sid` since item identity became a (server, key) pair, and both `detail.rs` entries did the same. Starting a borrowed film sent that film's server-local `rk` and `Part.key` to OUR server — reported as "playback from the other server just fails with no error, or starves", which is one cause with two faces: our server either refuses the key or answers with a part the pipeline was not told to expect. `route::item_sid` is the rule in one place — the item's server when it has one, the browsed surface when it does not — so the single-server app and the host tests (whose rows are UNSET by construction) are unchanged, and the dev `play` trigger states its surface-relative intent through the same function rather than looking like a fourth site that forgot. 511 tests green; ARM links. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…yer, at last
`alt_sources::install` had no callers. The panel, its ordering, its gate and its
navigation were all built; the seam that feeds them was documented as future
work, so the control could never appear. Owner-reported: "Detail view does not
show Also available on other servers (like obsession)."
Measured against both of this household's servers before designing anything
(2026-08-14):
GET /library/all?guid=plex://movie/6856893830a4aaafd5c4291d
-> ours: size=1 "Obsession" ratingKey 2029 in "Movies"
-> share: size=1 <another title entirely> ratingKey 5274 in "Film Club"
which settles the identity question the module doc raised: the two copies share
a guid, have different ratingKeys, and do not even share a title. Matching by key
would confidently offer a different film; matching by title would miss this one.
The owner confirms Plex's own client matches these two, so this reproduces it.
- `Metadata.guid` + `librarySectionTitle` on the DTO. The latter matters because
`/library/all` is the one query the app makes without naming a library, so the
answer has to say which one replied — and the panel names libraries, not
machines.
- `Client::find_by_guid`. `None` (no answer) and `Some(empty)` (does not have
it) are deliberately NOT collapsed: a share that is merely unreachable would
otherwise read as one that lacks the film — a row silently missing rather than
a source visibly not answering.
- `Detail.guid`, and the resolve kicked from `pump_detail`, which is the one
place the item's server and its guid are both known on the main thread. One
round trip per OTHER registered source, on a worker, in the detail fetch's own
mailbox shape — the SDL loop must not pay a connect timeout per dead share.
- A one-server install spawns no worker, sends no query and draws no control.
Also fixes the second half of the missing attribution: `Detail.source` read the
`plxnative-shared` DEV TRIGGER and nothing else, so on a signed-in television
every item's owner was empty whatever server it came from. It asks the registry
now; the trigger still overrides, since it is the only way to make a
single-server library look borrowed for a capture.
513 tests green ×3; ARM links.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
… log it Two device-found gaps in the resolve landed an hour earlier, both of the same kind — a chain that is correct where it is wired and simply not wired everywhere. 1. The list must include the item's OWN copy. It was built from the other sources alone, but the panel's gate counts distinct SOURCES and its first row is normally "This account" with the tick — so a list of the others could never reach two and the control stayed absent on a device that demonstrably had two copies of the guid. Querying our own server rather than synthesising that row from the open `Detail` also supplies the one field the page does not have: which LIBRARY the copy is in. 2. `load_detail_now` installs CURRENT itself instead of going through the mailbox, so a resolve hung only off `pump_detail` never ran for anything opened that way — `plxnative-detail`, `open_rk_season`, and home's play-a-show arm. Both were found by the button being absent on screen and neither by a test, which is the honest reason the log line comes with them: `altsrc: asked N source(s) for <guid> -> M copy(ies)` is what makes this chain answerable from a device log instead of by redeploying with a guess. A guid is a public metadata id — not an address, a token or a machine name — so it is safe in the log. Device-verified end to end against the real share: the panel lists "Movies · This account" (ticked) and the friend's library with their handle; OK NAVIGATES to their copy, which is a different page in another language with its own key; that page's facts line reads "Shared by <handle>"; and Play on it direct-plays 4K HEVC from their server. 513 tests green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Owner-reported on the device: opening a shared library replaced the whole Home page with that friend's content, and once left the tab strip showing only their library. Both are one cause — `set_cur` re-pointed `plex::current_server()` at that section's server and then wiped Home's catalog, the person store and the PlayQueue identity. The strip collapsed because `ensure_sections` discovers the CURRENT server, which had just become theirs. Confirmed against the official client, which the owner supplied: Home there is MERGED (its Continue Watching interleaves both servers' items) and a shared server is its own separate destination in the sidebar — selecting it gives a source-scoped view with its own tabs and never replaces Home. The re-point was a deliberate stopgap that named its own retirement: `PmsMovie` carried no `ServerId`, so OK on a borrowed card would have opened one of OUR films with the same ratingKey, and re-pointing made the ids line up. Threading `ServerId` through the stored rows retired it. Every consumer addresses the server by DATA now — the page fetch dials `client_for(section_sid(..))`, rows are stamped at parse, and `open_library_card` opens `to_detail(mm.sid, &mm.rk)`. "Current" means the SESSION's server: whose Home you are on, whose PlayQueue identity is in play. Browsing is not that, and the two only looked like one thing while there was a single server. This is half the fix. Home being a MERGE rather than one server's is the other half and lives in the multi-source Home unit. 513 tests green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
The owner ran the twelve-unit integration on the television and reported Home
as "a mess — if I click the friend's server in the library, the whole Home page
is replaced by their content. But it should merge." The coordinator fixed the
half that re-pointed `plex::current_server()` from a browse. This is the other
half: Home is assembled from EVERY source that feeds it, not from whichever
server happens to be current.
The owner's screenshots of the official client settle the shape, and it is the
one this unit already built: Continue Watching is ONE row whose items interleave
by `lastViewedAt`, so the friend's films sit BETWEEN the owner's rather than
after them; every other shelf keeps its own heading annotation; and a shared
server being additionally its own destination in the sidebar never replaces
Home, which stays merged.
Three architectures met in `pms.rs` and all three had to survive:
* Unit 3 stamps every row with the server it was parsed from and compares
items as `(sid, rk)`. Kept whole — and it is what lets the merged catalog
hold two different films both numbered 1 without either aliasing the other.
`project` now takes the `sid` the spawning frame captured, exactly as
`build_hubs` did.
* Unit 12's `HeroSlot` + `own_items_first` carry the hero pool's ordering.
Kept whole, with one correction the merge forces: a slot's handle is taken
from the ROW's source, not from its shelf's. The merged deck's own `source`
is empty by design, so a slot reading its shelf would attribute every
borrowed film in Continue Watching to nobody — and `own_items_first` would
conclude one of ours had already opened the door.
* This unit's per-source fetch, single-flight latch, retry ladder and verdict.
A dead share contributes nothing and backs off alone; the total-failure
read-out is reserved for the case where every source failed.
The roster is no longer this unit's own list. The registry IS the granted roster
and now carries the handle (`ServerFacts`), so `Source`/`set_sources` are gone
and with them the app.rs registration this unit had added — integration's
`install_pms` already registers and describes every injected server, and doing
it twice would have been two models of the same fact. `feeds_home` is the seam
the pin store fills, reading `browse::pinned_libraries`, and its one subtlety is
written as a test: an EMPTY pinned set means "no section has been discovered
yet", never "nothing is pinned", because `/library/sections` lands after
`pms_fetch_hubs` and `is_last_pinned` forbids emptying the set. Read the other
way, Home would have no sources at all on the frame it boots.
526 host tests green three times over, ARM links.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Multi-source Home lands with it, and this is the one product call it left open. The pin defaulted to `handle.is_empty()` — your own libraries on, a friend's off — which is the design's FIRST-RUN state and the right default only once the first-run screen exists to ask (deliverable F, not merged). Without that screen a share is granted, discovered, browsable, and silently absent from Home with no control anywhere to turn it on. That is the owner's reported symptom: Home not merging. The reference settles it. In the official client (owner's own capture) a shared library's films sit in the main Home's Continue Watching interleaved with the account's own, nothing pinned by hand — sharing IS the opt-in, and the per-source controls remove content afterwards rather than adding it. Home there is also a DESTINATION beside the share, never replaced by it, which is the other half and landed in the previous commit. The pin stays a real, persisted, per-library decision; it is defaulted on, not removed. `pin::resolve` already prefers a recorded answer to the ownership default, so when the first-run screen lands it asks before this is ever read and neither the screen nor `feeds_home` changes. Unit 5's merge also corrected a bug the merge itself created: a hero slot took its handle from its SHELF, but the merged Continue Watching deck has no single source, so every borrowed film in it would have been attributed to nobody — and `own_items_first` would have concluded one of ours had opened the door. Per-item now. 526 tests green ×3; ARM links. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Design-system change (owner: "I made section titles capitalized"), components/panels/TableView.prompt.md: "Section headers are SET IN CAPS at --size-caption, REGULAR weight in --text-tertiary, one size in both size classes — the caps are what make it read as a label rather than a row, so it never ties with the rows it heads." Ours drew CAPTION when `compact` and HEADLINE otherwise, mixed case. The size class was the bug the contract names: the Sources panel is a two-line picker, so it is NOT compact, so its headers drew at HEADLINE — putting the machine names on screen larger than the libraries they name, which is exactly a header tying with its own rows. `to_uppercase`, not `to_ascii_uppercase`: a header is a machine or library name and can be any script — the share this was developed against is Cyrillic. Uppercased at DRAW time, so the row model keeps the original string: the casing is presentation, and `source_sections`' host tests still assert the real names. `HDR_H` stays 58px in both classes, so no size change can reflow a panel. NOT done, and it needs a text-renderer change rather than a token: the contract also asks for `--track-caps` tracking, and `text::draw_text` has no letter-spacing parameter at all. Caps at CAPTION without tracking still reads as a label; adding tracking means a new advance path and a glyph-cache key that includes it. 526 tests green. Appearance is only observable on the television, which the owner currently has — not visually verified. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…nt one
Found by a 13-agent comparison against the decompiled official webOS client.
This is a data-damage bug, not a cosmetic gap.
`ui/detail.rs` posted /:/scrobble and /:/unscrobble through `plex::client()` —
the CURRENT server — carrying the open item's ratingKey. It became live the
moment browsing a shared library stopped re-pointing `current` (the previous
commit, which was itself a fix): open a borrowed film from a merged Home shelf
and press Watched, and its ratingKey goes to OUR server. Both servers number
from 1, so that is not a harmless miss — the friend's film stays unwatched and
an unrelated film of ours is marked instead, and nothing surfaces it because
`refresh_view_state` then re-reads the page that did not change.
The official client resolves `findServer(item.metadataSourceUri)` and posts to
that server. `Detail` has carried its own `sid` since item identity became a
(server, key) pair; this now uses it. `client_for` also returns None where
`client()` panics, and a watch-state write is exactly the operation to skip and
log rather than send to the wrong machine.
Also: `excludeContinueWatching` is NOT a no-op. The call and its comment had
asserted that since they were written ("D-4: drop the no-op"). Measured against
this server, twice, independently of the agent that reported it:
/hubs?count=12 returns 10 hubs; &excludeContinueWatching=1 returns 8, dropping
home.continue and home.ondeck — precisely the two the dedicated
/hubs/continueWatching endpoint fetches properly. We were parsing and discarding
them once per source per fetch.
526 tests green x3; ARM links.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…lows its item Five device-found defects from one session with the owner at the television. 1. A SHARE APPEARED ON HOME ONLY AFTER VISITING THE LIBRARY. `feeds_home` read "this server has no pinned library" as "the user turned it off". But section discovery for a source other than the current one runs on a worker off `browse::pump`, which only runs while the LIBRARY screen is up — so a booted app knows the roster and none of its shares' libraries. A server whose libraries have not been enumerated is UNDECIDED, not unpinned; you cannot have decided against a library nobody has discovered. 2. …and nothing re-merged when that changed. `pump` re-merged only on a build landing, so a late section discovery (or a pin toggled by hand, which bumped no generation at all) never reached Home. Both move `SECTIONS_GEN` now, and the merge re-runs on it — it is pure over builds each source already answered with. 3. ART RESOLVED AGAINST THE CURRENT SERVER, not the item's. A thumb path embeds a server-local ratingKey, so a friend's library drew grey skeletons for most tiles and OUR films for the keys that collide — both servers number from 1, so collisions are the normal case. Only invisible while browsing a share also re-pointed `current`; removing that (correctly) exposed it. Threaded through every art path: `Art::Poster` via the row's `sid`, `Art::Thumb`/`Art::Person` which carried no server at all, both heroes, the clearLogo (`HeroLogo` gained a `sid`; the logo API already took one and both call sites passed `current_server()`), Related, cast headshots, episode stills, chapters, Up Next and the info panel. 4. TWO THINGS WORE FOCUS AT ONCE in the Sources panel: the level pills took the accent capsule while the table went on painting its selected row, which a table always did. `TableView::list_focused` is the "nothing selected" mode it lacked — the row is remembered, simply not drawn as focused while the pills have it. (First attempt made the pills unfocusable instead, which the owner corrected: they want the rows deselected, not the tabs unreachable.) 5. Per-source landing now logs on SUCCESS, not only on failure. "hubs: source 1 fetching" with nothing after it said only that a worker had started, which is what made 1 and 2 hard to see. Device-verified: source 0 → 4 shelves, source 1 → 1 shelf and 2 in CW, commit goes 40 items/5 shelves → 54/6. Home's Continue Watching interleaves both servers exactly as the official client's does, borrowed artwork included. 526 tests green. NB one SIGABRT at process exit on a single `make check` run, not reproduced in four since — flagged, not fixed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
All owner-found at the television, in one sitting. **Unpinning a library did nothing.** `/hubs` is a whole-SERVER request that answers with rows from every library on it, so the finest gate we had was "does this server feed Home at all" — turning off one library of a two-library server changed nothing on screen. Every row carries `librarySectionID`; that is the join. `item_pinned` gates the merged deck AND every other shelf, before the row budget is spent, so an emptied shelf contributes no heading rather than an empty one. Unknown passes both ways (no id sent; library not yet enumerated), because hiding what cannot be classified empties Home on the frame it boots. Measured while sizing it: `/hubs?contentDirectoryID=N` does NOT scope (still returns every library's hubs) — `/hubs/promoted?contentDirectoryID=…& pinnedContentDirectoryID=…` is the endpoint that does, returning per-library `movie.recentlyadded.<id>`. Switching to it is the better fix and is now a sized, evidenced follow-up rather than a guess. **"Also available" replaced the whole tab strip.** It still did the `set_current` + `activate_server` re-point I had removed from browsing, so one press wiped the section table and re-discovered only the newly-current server: `altsources: source switched to slot 1` then `nsections=1`, and the top row became Home | <the friend's one library>. Opening the other copy is a NAVIGATION — `to_detail` carries the pair and every surface resolves its own server from the item. The trail survives too, since its nodes carry a ServerId. **Black row text.** Suppressing the selection pill when focus moves to the level tabs left the row's ink flipped to near-black, which is only legible ON that pill. Ink and pill now read from one flag. **No tick in "Also available".** The tick was matched against `plex::current_server()`, which stopped being the page's server the moment browsing stopped re-pointing. It asks the page. **No quality badge.** The badge was computed but always None: `/library/all?guid=` returns no `Media[]` at all. Measured — `&type=1` is what makes it return `4k 3840x2160`. The type comes off the guid (`plex://movie/…`); an unrecognised kind sends none rather than guessing, since a wrong type answers size 0 and would read as "that server does not have it". **The level tabs did not animate** — the one tab row in the app that didn't. They were standalone `segment` pills painting their own fills; they use the shared `TabStrip` now, stepped in the update pass, so both capsules travel. **Tab-to-list seam.** 16 + the list's own 20 = 36px, which is not a rung. The band subtracts `TableView::TOP_PAD` so the seam is exactly `space::MD`, and stays right if either constant moves. 528 tests green; ARM links. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Reuse / simplification / efficiency / altitude, run over the whole 50-commit range. Applied the findings the four agents converged on; the deeper structural ones are listed at the end, not done. **Hot path — the poster key memo allocated on every HIT.** `HashMap::entry` takes its key by value, so a flat `(u16, String, w, h, png)` key ran `path.to_owned()` whether or not the entry existed, on top of the `cstr` that had already built that string. `poster_key` runs once per visible tile per frame plus the hero art and logo, so at ~25-40 tiles x 60fps that was ~1,500-2,400 needless heap allocations a second on the A53 — putting back a sixth of the waste the memo was written to remove. Nesting the map (dims -> path -> entry) keeps the hit path allocation-free and pays for the owned key only on a miss. **`roster_key` allocated two Vecs per frame** to detect a change a u32 compare five lines away already saw: the pinned set is a projection of the section table, and `toggle_pin`/`append_sections`/`reset` all bump `SECTIONS_GEN`. Now two atomic loads, no allocation, on a path `pump` runs every loop iteration — including on a settled Home, which is the screen `ui::idle` was tuned down to ~1% of a core on. **The hero's source measure ran with no source to draw.** Rust evaluates the argument before the call can decide there is nothing to show, so a single-server install — documented as paying nothing for this feature — paid a `CString` + an uncached `TTF_SizeUTF8` over the whole meta line per hero frame, twice per frame through a slide. **Three roster projections became one.** `servers_with_known_sections` and `pinned_servers` were the same index->slot fold as `library_pins_by_server` with a different `browse` call feeding each, and each pulled its own `pub(crate)` out of `browse` — so a change to how a source index maps to a registry slot had to land in three places. Both are columns of the one table; `browse`'s `discovered_sources` and `pinned_libraries` went with them. **`alt_sources` asked "which copy am I on" two ways, and they disagreed.** `live_rows` read the loaded Detail; `on_ok` passed `plex::current_server()`. So the row that wore the tick and the row a press treated as "already here" could be different rows — and after browsing stopped re-pointing `current`, the second was a different MACHINE, not a synonym. One `here_sid()` via `detail::mounted_sid`, which is the app-wide answer. Both hand-rolled `(sid, rk)` comparisons in that file now go through `plex::same_item`, whose own doc claimed every stored-item lookup already did. **`shared_by` was written twice with two different empty-handle behaviours** and interpolated a third time inline. One guarded formatter in `ui::fmt`, returning `Option` — absence is what the design specifies for an owned item, and both call sites were hand-rolling that guard. **Dead code the branch's reversals left behind:** `route::forget_server_identity` (retired by scoping MACHINE_ID behind MACHINE_SID), `browse::section_src`, `browse::retry`, `pms::request_retry_source`, the unused `_sid` parameter on `request_alt_sources`, and the bare `resolve_tex_wh`/`warm_tex` — zero callers each, and the last two were the shorter names autocomplete offers for the case where getting it wrong is a blank billboard. I deleted `browse::loading_initial` too and put it back: rustc's dead-code warning does not count test callers, and three tests assert exactly the state/`total < 0` distinction it exists to make. Marked, so the next reader does not repeat that. **Skipped, deliberately.** The altitude review's central finding is that `(ServerId, key)` is a calling convention rather than a type — 35 signatures take the two as adjacent positional params, so a transposition compiles and returns a confidently wrong row. An `ItemRef` newtype is the fix and it is mechanical, but it is a few hundred lines across a dozen files: a refactor, not a cleanup. Same for making the ambient accessors demand `task::MainThread` (the `!Send` token this repo already ships) so a worker reading the current server is a compile error rather than eight paragraphs of doc. Also skipped: fanning out the serial guid resolve and roster probe (behaviour), wiring `Client::set_link` (adds behaviour to a currently-dead path), and deleting `ServerFacts::owned` — it has no readers, but the right move is to USE it, since two of its three writers currently fabricate it from the empty-handle test its own doc forbids. 528 tests green x3; ARM links. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…vision The television is a mutex. One set, one app instance, and two `tests/run.py` jobs kill each other's app — so every UI change waits for every other one, and an agent with no TV can verify nothing. `make sim` builds the same app core with `--features hostsim`, linked against desktop SDL2 and desktop GL 4.1 core. It draws the real interface against a real PMS, boots to a screen with the same `plxnative-*` triggers, is driven by the same remote-FIFO tokens, and screenshots itself. Several run side by side, each pointed at its own instance root; unset `PLXNATIVE_RUNTIME_DIR` and everything resolves to `/tmp` exactly as before. The `ui-sim` skill is the loop. The whole TV seam is 29 symbols — 13 `sf_*`, 7 `acb_*`, 5 `vp_*`, wayland, glib, the LG cursor call — and `player/ffi.rs` already had the right shape for it, so the host arm is a `#[path]` swap of one private `sys` module. Nothing in `engine`/`pump`/`threads` branches. The stand-in reports the seam's own "no video path" failure rather than faking success, so Play lands on the app's real failure read-out: a state a television can genuinely be in (issue #22). Three bugs this found in code that ships to the device: - `text.rs` uploaded glyph surfaces assuming `w * 4` stride while SDL is free to pad rows. `surface_ink_v` two lines above had always read `pitch`; only the upload assumed they were equal. Repack rather than `GL_UNPACK_ROW_LENGTH`, which does not exist in GLES2 and would have fixed the host while silently doing nothing on the TV. - The runtime namespace was three `/tmp` literals (`dev`, `remote`, `log`), so N instances shared one trigger set, one FIFO and one log. - `env` overrides were gated on `devtriggers`, on in every dev TV build. Since `src/main.c` opens the event and crash logs by absolute literal before any Rust runs, a TV launched with `PLXNATIVE_RUNTIME_DIR` set would have written the two halves of one log to two places. `ENV_STEERABLE` makes that impossible at compile time. Guardrails, because the failure mode is an agent reporting a Mac number as a device result: every simulator heartbeat carries `sim=1`, the event log's first line says what wrote it, and `tests/run.py` now refuses to grade a log carrying the tag. `--fps`, text rasterization, video and the video plane stay device-only. Also fixed while here: `encode_key`/`decode_key` had no coupling and had already shipped disagreeing (every FIFO token silently swallowed) — now one pure encoder plus a round-trip test that passes in both layouts; each simulator gets its own session file instead of sharing `pkg/auth.json`, which held live tokens in the payload directory of a public repo; and `gl_is_es()` is one source of truth so the shader preamble and the core-profile VAO cannot disagree. Verified: `make check` 390 green, TV cross-build unchanged, sim rendered and driven end to end (boot -> keys -> detail page -> screenshot). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
The pitch was `min(34, band / n)`, so how far apart the letters sat was a function of how many a section happens to have. Nine Latin letters drew at 34px; a mixed Cyrillic+Latin library's thirty collapsed to 27.5 against a CAPTION cap height of ~17 — under half a letter of air, which reads as a column of type rather than an index you can aim at. The pitch is a constant 34 now and the rail scrolls past what fits (24 slots), driven by rail focus while the rail has it and by the grid's current letter otherwise, so scrolling the grid carries the rail with it. One letter of clearance is kept at each end and the ends with more beyond them fade over one letter, so it reads as scrollable rather than cut. A section that fits is byte-identical to before: no scroll, same origin, same spacing. Two latent bugs fell out of the same read: - MAX_LETTERS was 34. `#` + Latin is 27 and Cyrillic adds 32 more, so a mixed library can want 59. At 35 the rail would have stopped mid-alphabet with every title past it unreachable by jump, and nothing on screen saying so. Now 64. - The hit rects were a fixed 38px against a 27.5px pitch, so they overlapped and `rail_at`'s first match won — the top of every letter clicked the one above it. The target is the slot now, and a scrolled-away letter keeps an empty rect so a click can only land on a letter you can actually see. `rail_geom` and `rail_scroll_target` are pure, so the window invariant is host- tested at every letter from three starting scrolls. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
The design system's TableView cell is four places in screen-x order — leading mark, label over its sub-line, trailing read-out, right-aligned badge. Ours drew the badge inline from the label's DRAWN right edge, so the chip landed at a different x on every row: a column of 1080p/4K, or the subtitle picker's FORCED/SDH, read as ragged text instead of a column you compare down. On a two-line row it was also centred on the title's cap band rather than the row box. Right-aligned and row-centred now, which forces a second fix that was harmless only while the chips sat on the title's line: the sub-line has to elide to the same right edge as the label, not to the bare row width. Two more places where the row diverged from the contract: - The badge ring is `theme::OVERLAY_BORDER`. That token's own doc has said "outlined-badge / meta-badge border" for as long as it has had zero consumers, while every chip off a focus pill outlined at full TEXT_PRIMARY. - The header accessory drops to MICRO; at CAPTION it tied with the header it qualifies. "Also available" then fills all four places — ✓ | Movies / This account | 1 hr 57 min | 1080p. The runtime was a dotted second half of the sub-line, which left the read-out empty and buried the one fact that lines up down the panel. Also removes a stray `mut` on a test closure left behind by the last simplify pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
… in parallel
Everything a Search unit needs to exist against, and nothing a unit should own.
The screen is reachable, wears the shared strip, and draws nothing yet.
The route. `Route::Search` is a PEER of Home and the Library, not a stacking
page: it is reached from the strip and BACK from it returns to Home, so it needs
no trail node — what it opens stacks, it does not. Two of its match sites are
exhaustive and would have failed the build; thirteen are `_` catch-alls that
would not, and three of those are why this landed as one commit rather than
per-unit: the draw dispatch ends `} else { home_draw() }`, so a missing arm
silently draws Home; the BACK arm ends `running = false`, so a missing arm quits
the app; and the heartbeat's route name ends `_ => "home"`, so every harness
scene grading `route=search` would have read Home and passed.
The pill goes LAST, and that is the whole reason it cost nothing. Prepending it
would have shifted every `pill - 1 -> section` conversion to `+2` at eight
sites; appending leaves `Home = 0, sections = 1..=n` exactly as written, and the
only new rule is `is_search_pill` — one test, in one place. It is the one pill
that is a mark instead of a word, inked through the same `TabPill::mixed_ink`
the labels use so it travels under the focus capsule with them instead of being
a separate colour story. Two host tests that encoded the pill count moved with
it; they were right, the row is genuinely one longer.
`Hub.directory`, because the DTO would have silently rendered three of the five
shelves as nothing. `/hubs/search` was probed live over six queries rather than
modelled from `plex-openapi.json`, whose own worked example disagrees with this
server: movies, shows and episodes arrive as `Metadata[]`, but **actors,
directors and collections arrive as `Directory[]`** — so Cast & Crew and
Collections both need it. Those entries are the SAME record the detail page's
cast row already parses, so `plex::Tag` grew the three fields only search sets
rather than gaining a near-identical twin; a search hit can now be handed
straight to the person page, and `Tag::is_person` matches one against a credit.
Two more measured facts are written down where they decide something: a
one-character query returns every hub empty (so `MIN_QUERY` is 2, and the first
keystroke of a search costs no round trip), and hub ORDER moves per query (so
the shelf order is fixed and ranking is honoured only inside a shelf —
reordering rows per keystroke would move the row under the user's focus while
they are still typing).
`/tmp/plxnative-search[=<query>]` seeds the field at boot. It is not a
convenience: `sim-shot` and the TV harness both run with no keyboard, so without
it every headless look at this screen is the empty state.
Verified: `make check` 535 green, sim boots and the pill draws (screenshot).
FFmpeg/ARM build unaffected — nothing here touches the seam.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…pture `Client::search` existed and was dead. Finishing it turned up two facts that the parameter names actively hide, both probed against PMS 1.43.3 on 2026-08-14. **`sectionId` ranks, it does not filter.** `sectionId=1` moves the `movie` hub ahead of `show`; `sectionId=2` puts `show` and `episode` first — and in every case every row from every OTHER section still comes back, same items, same counts. So it is a scope HINT and cannot be used to search one library. The spec says so too, in a sentence easy to read past: "can result in re-ordering of search result hubs". **Both numbers are optional, and a literal 0 is an error the app cannot see.** `sectionId=0` is a section no server has (400) and `limit=0` is a 500, while OMITTING either is a healthy 200 (`limit` then defaults to 3 rows per hub). Every PMS error body on this endpoint is `text/html`, so `get_json` parses nothing and returns `None` — the same `None` a dead socket gives. Built the obvious way with `.int`, a search would therefore never work AND would blame the network for it. Hence `opt_int` on both, and a test that says why so neither goes back. The path builder is split out as `search_path` because the transport is what makes the method itself untestable, and the values that need watching are decided here. `Hub`/`Tag` needed no new fields — the shared base already carried `directory`, `key`, `librarySectionID`, `reason` — so the audit is spent as TESTS against a captured live response instead. **The fixture is an inlined trimmed literal, not a `.json` file.** There is no fixture-file precedent under `rust-modules/` (every DTO test in `models.rs` inlines its body), and a whole 40 KB capture would put one household's library — titles, people, section names — into a public repo for no test value. It is verbatim otherwise: all 17 hubs in the server's order, 9 of 19 rows kept, every kept field and value byte-identical to the capture (checked mechanically). No token, host or machine identifier is in it. Five tests pin what a future reader cannot reconstruct: * the payload split — `Metadata[]` for movie/show/episode, **`Directory[]` for actor/collection**. This is the failure that is silent and total: nothing errors, no field is missing, `Hub.size` still says 3, and three of the five design shelves draw nothing. * a person hit carries a portable `tagKey` and an absolute thumb; a collection carries neither, nor a `ratingKey` — `key` is its only handle, so a screen that keys tags by `tagKey` silently drops every collection. * **the same person arrives once per library section**, same `id` and `tagKey`, with a PER-SECTION count. Drawn raw he appears twice; keep the first row and you report 5 credits for someone who has 8. * every number string-encoded, since `score` arrives as `"0.52000"` and proves this endpoint does it. * a matched-nothing query is an ANSWER, not a failure — 17 hubs, all empty. `docs/pms-api.md` gains §3b, which it never had; the file's own banner used to send readers to the spec for this endpoint, which is where the wrong example is. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
…roved nothing
Code review of the previous commit, applied.
**The count was wrong in six places, including the base commit's.** Three hub
types arrive as `Directory[]` — `actor`, `director`, `collection` — and I wrote
that as "three of the five shelves". But `search::Kind::hubs` folds `actor` and
`director` into ONE Cast & Crew shelf, so it is **two** shelves that silently draw
nothing: Cast & Crew and Collections. A hub-type count had been swapped for a
shelf count, and `docs/pms-api.md` contradicted itself inside one paragraph —
naming the two shelves in one sentence and calling them three in the next.
**One assertion could not fail.** `assert!(!c.is_person("0", ""))` was documented
as guarding the `self.id != 0` branch in `Tag::is_person`, but the collection row
it ran against has `id: 6068`, so it returned false on the value compare no matter
what — delete the guard and the test stayed green. It now runs against
`Tag::default()`, which is the only row that can exercise it, and the collection
row instead asserts what it can: its server-local id DOES match, and no guid ever
will. That is the sharper statement anyway.
**A test name claimed more than the wire does.** "…carries no identity but its key"
is refuted by the same fixture: a collection has `id` and `filter` too. What it
lacks is anything portable — no `tagKey`, no `thumb`, no `ratingKey` — so it is
`no_portable_identity` now, in the name, the doc and §3b.
Three smaller corrections. `size` is asserted against rows I trimmed by hand, so
its message no longer claims to be evidence for the wire fact (that one is
measured by varying `limit`, and lives in §3b). `director` is in the split table
on the strength of the `sta` query but is `size: 0` in this capture, which the
test now says out loud instead of quietly covering two of the three types. And
`more` is the wire's attribute, not a `Hub` field — it is deliberately unmodelled
because it stays `false` on a truncated hub, and calling it `Hub.more` implied a
field that does not exist.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
There was a problem hiding this comment.
Pull request overview
This PR substantially expands the app’s search and multi-server foundations: it updates Plex /hubs/search request construction and documents the endpoint’s real response shape, while also introducing a host desktop UI simulator (hostsim) plus a broad set of “which server is this item on?” scoping fixes across UI, playback reporting, and art resolution.
Changes:
- Implement and host-test
/hubs/searchURL building (with zero-value suppression), and add probed documentation for the endpoint’s actual response shape and semantics. - Add a desktop simulator build (
plxnative-sim) with per-instance runtime roots, screenshot capture, and host-only linking/build plumbing. - Thread
ServerIdthrough multiple UI/playback paths to correctly resolve art/actions/timeline against the originating server in multi-source scenarios.
Reviewed changes
Copilot reviewed 72 out of 76 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/run.py | Adds handle to injected shared-server payload; rejects simulator logs for device-calibrated FPS gates. |
| tests/README.md | Updates shared-server examples and notes (but currently has documentation mismatches flagged in comments). |
| tests/manifest.json | Clarifies navosc scene comment to reference tab projection vs section index. |
| rust-modules/src/ui/up_next.rs | Routes still art resolution through the current item’s server id. |
| rust-modules/src/ui/search/results.rs | Adds stubbed typed result-shelves module and tile sizing by kind. |
| rust-modules/src/ui/search/recents.rs | Adds stubbed recents/clear state module with documented design intent. |
| rust-modules/src/ui/search/mod.rs | Adds Search screen state-machine scaffold (zones, view snapshot, draw order). |
| rust-modules/src/ui/search/field.rs | Adds stubbed query field module with documented design rules. |
| rust-modules/src/ui/search/empty.rs | Adds stubbed empty-state module with copy/design constraints. |
| rust-modules/src/ui/profiles.rs | Ensures profile art lookup is scoped to a server id. |
| rust-modules/src/ui/person.rs | Plumbs ServerId into person-page open/reopen and person art rendering. |
| rust-modules/src/ui/nav.rs | Documents that tab pill index is no longer section+1 due to tab projection. |
| rust-modules/src/ui/mod.rs | Registers new UI modules (alt_sources, search). |
| rust-modules/src/ui/item_menu.rs | Captures server id on menu open so actions apply to the correct server. |
| rust-modules/src/ui/info_panel.rs | Switches thumb resolution to server-scoped texture resolution; refines outlined badge border usage. |
| rust-modules/src/ui/icons.rs | Adds Icon::Search and wires new search SVG asset. |
| rust-modules/src/ui/hero_logo.rs | Makes hero-logo fetch server-aware via ServerId. |
| rust-modules/src/ui/fmt.rs | Adds shared_by(handle) formatter for consistent shared-source attribution. |
| rust-modules/src/ui/consts.rs | Adds WCODE_BACK constant and uses it in is_back. |
| rust-modules/src/ui/chapters_panel.rs | Routes chapter thumb resolution through item server id. |
| rust-modules/src/ui/anim.rs | Writes anim probe log into runtime dir instead of hardcoded /tmp. |
| rust-modules/src/textinput.rs | Adds host-safe stub and documentation for TV on-screen keyboard integration. |
| rust-modules/src/text.rs | Fixes text upload to honor SDL surface pitch (with GLES2-safe repack path). |
| rust-modules/src/system.rs | Makes wayland/glib symbols hostsim-safe; avoids unsound WM-info reads on host. |
| rust-modules/src/shot.rs | Adds simulator screenshot capture (glReadPixels → PNG via image). |
| rust-modules/src/search.rs | Adds stubbed Search data-layer types/state with documented endpoint behavior expectations. |
| rust-modules/src/remote.rs | Moves remote FIFO path under per-instance runtime dir; uses exact bytes for CString. |
| rust-modules/src/plex/transcoder.rs | Adds relay-aware link policy controlling direct-play/remux eligibility + tests. |
| rust-modules/src/plex/timeline.rs | Scopes PlayQueue row identity by server id; updates queue selection logic/tests. |
| rust-modules/src/plex/probe.rs | Adds resolvability ranking (numeric host before hostname) and related tests. |
| rust-modules/src/plex/params.rs | Documents why relay ceilings are handled via flavor policy, not bitrate fields. |
| rust-modules/src/plex/mod.rs | Re-exports server registry helpers and link-policy; exposes test-only registry helpers. |
| rust-modules/src/plex/library.rs | Adds friendly_name() and find_by_guid() (with guid-kind mapping) + tests. |
| rust-modules/src/plex/hubs.rs | Updates home hubs query; revives Client::search with section/limit rules and host-testable path builder. |
| rust-modules/src/plex/client.rs | Adds per-client link tier storage; adds fetch_built for token-bearing prebuilt paths. |
| rust-modules/src/plex/CLAUDE.md | Expands plex-layer design notes for multi-server registry and link-tier policy. |
| rust-modules/src/plex/account.rs | Updates shared-server fixture naming/handle examples in tests/docs. |
| rust-modules/src/player/threads.rs | Captures ServerId into timeline reporter worker to avoid cross-server scrobble. |
| rust-modules/src/player/ffi.rs | Adds hostsim swap to ffi_host.rs for the media seam. |
| rust-modules/src/player/ffi_host.rs | Implements hostsim “no video path” seam that fails honestly rather than no-op. |
| rust-modules/src/player/engine.rs | Captures (sid, rk) at reporter spawn site and passes into timeline thread. |
| rust-modules/src/person.rs | Adds sid to Person state and ensures worker fetches use client_for(sid). |
| rust-modules/src/paths.rs | Introduces steerable runtime dir for hostsim; adds runtime dir helpers and tests; adds PLXNATIVE_APP_DIR override for simulator assets. |
| rust-modules/src/lib.rs | Routes event log through runtime dir; exports sim helpers and plex_run for hostsim. |
| rust-modules/src/gfx.rs | Adds GLSL preamble adaptation for desktop GL core profile and binds a core-profile VAO when needed. |
| rust-modules/src/dev.rs | Resolves triggers under runtime dir; adds handle to DevServer and updates parsing/tests. |
| rust-modules/src/bin/sim.rs | Adds plxnative-sim entrypoint (hostsim-only) with runtime setup and logging banner. |
| rust-modules/Cargo.toml | Adds hostsim feature, plxnative-sim bin, and rlib crate-type for simulator linking. |
| rust-modules/build.rs | Adds hostsim-only link configuration and host build of src/svg.c for icon rasterization. |
| Makefile | Clarifies dlopen rationale; adds make sim, sim-run, sim-shot, sim-token, etc. |
| docs/pms-api.md | Adds live-verified /hubs/search section (§3b) and corrects guidance on spec vs reality. |
| CLAUDE.md | Updates project-wide guidance to include simulator tier and plex-layer doc pointer. |
| assets/icons/search.svg | Adds search icon SVG asset. |
| .gitignore | Ignores simulator target dir and pkg/auth.json to avoid credential leakage from host runs. |
| .claude/skills/ui-sim/SKILL.md | Adds ui-sim workflow skill documentation for simulator usage and limits. |
| .claude/skills/tv-session/SKILL.md | Updates tv-session skill preface to route suitable work to the simulator first. |
Suppressed comments (1)
tests/README.md:110
- This example log content is out of date:
DevServer::describe()now printshandle=..., and the truncatedmid=...should match the examplemachine_idshown above (currently it still showsa348a464..).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - With `shared_server` configured, the runner resolves it **before touching the TV** and writes | ||
| `/tmp/plxnative-servers` for those cases only — a JSON array of | ||
| `{name, machine_id, host, port, token}` — beside `plxnative-token`. Value never on stdout; the | ||
| printed line is `plxnative-servers: <bx23-ldn @ 10.0.0.9:32400, token redacted>`. | ||
| printed line is `plxnative-servers: <nas-home @ 10.0.0.9:32400, token redacted>`. |
|
Superseded by #47, which is the integration branch this unit was built for and which now carries the whole feature. Closed rather than merged because #47 already contains this work — verified before closing, not assumed: every commit on this branch is either an ancestor of #47 or reached it through the The review record lives here; the code ships there. |
The
/hubs/searchquery and its DTOs — the data layer under the Search screen.Touches
plex/anddocs/only; nothing inui/,search.rsorapp.rs.What changed
Client::searchexisted and was dead. It now takes asection_id, both its numbersare optional, and the path it builds is host-testable.
Hub/Tagneeded no new fields — the shared base commit already carriedHub.directory,Tag.key,Tag.library_section_id,Tag.reason/reason_title,each with a lenient adapter. The audit is therefore spent as tests against a
captured live response rather than as new struct fields.
Two findings the parameter names actively hide
Both probed against this household's PMS 1.43.3 on 2026-08-14.
1.
sectionIdranks; it does not filter.sectionId=1moves themoviehubahead of
show,sectionId=2putsshowandepisodefirst — and in every caseevery row from every other section still comes back, same items, same counts. It
is a scope hint and cannot scope a search to one library.
plex-openapi.jsonsaysso too, in a sentence that is easy to read past: "can result in re-ordering of
search result hubs."
2. A literal
0on either number is an error the app cannot see. This one is abug fix, not just documentation:
limitomittedlimit=0sectionIdomittedsectionId=0Every PMS error body on this endpoint is
text/html, soget_jsonparses nothingand returns
None— the sameNonea dead socket gives. Written the obvious waywith
.int, a search would never work and would blame the network for it. Soboth numbers go on via
opt_int, with a test that says why, so neither goes back.(The brief asked only for
sectionIdviaopt_int;limitturned out to need thesame treatment, which is only visible if you actually send
limit=0.)Tests — 7 new, against a live capture
The substance of the unit. Five in
models.rspin what a future reader cannotreconstruct:
Metadata[]for movie/show/episode,Directory[]foractor/collection. This is the failure that is silent and total: nothing errors,
no field is missing,
Hub.sizestill reports 3, and three of the five designshelves draw zero cards with a green parse.
tagKeyand an absolutemetadata-static.plex.tvthumb; a collection carries neither, nor a
ratingKey—keyis its onlyhandle, so a screen keyed on
tagKeysilently drops every collection.idandtagKey, witha per-section count. Drawn raw he appears twice; keep the first row and you
report 5 credits for someone who has 8. (Dedupe on
tagKey/id, sum the counts.)scorearrives as"0.52000", which is the liveproof this endpoint does it.
Two in
hubs.rscover the built path: percent-encoding of a user-typed query, andthe zero rule above.
Fixture decision: inlined trimmed literal, not a
.jsonfileChecked for precedent first — there is none:
find rust-modules -name '*.json'returns nothing, and every DTO test in
models.rsinlines its body. Two reasons tomatch that:
to the body they assert on.
names — into a public repo for no test value. Trimming is what makes it
publishable.
It is verbatim otherwise: all 17 hubs in the server's own order, 9 of 19 rows
kept, every kept field and value byte-identical to the capture, checked
mechanically rather than by eye (dropped fields, dropped rows, and the
sizecorrection that follows a dropped row were the only sanctioned edits).
Token check
git grep -F,git diff | grep -F).src/config.local.hconfirmed gitignored (.gitignore:25).X-Plex-Tokenstring is the literal placeholderX-Plex-Token=...in the docs, matching the rest of that file.
machineIdentifier.Docs
docs/pms-api.mdgains §3b, which it never had. The file's own banner used tosend readers to the spec for this endpoint — which is exactly where the wrong
example is — so the banner now says which half of the spec to trust.
Code review
/code-review highran against this diff. Everything it found here is fixed inthe second commit — including one genuine factual error I had propagated to six
places: three hub types arrive as
Directory[], butsearch::Kind::hubsfoldsactor+directorinto one Cast & Crew shelf, so it is two shelves thatsilently vanish, not three. It also caught an assertion that could not fail
(
is_person("0", "")was run against a row whose id is 6068, so it passedregardless; it now runs against
Tag::default(), the only row that exercises thatguard).
Two findings deliberately not acted on, both pre-existing and outside this
unit's files-of-record — flagging rather than silently fixing:
Metadata.rating_keyis a bareStringwith node_str.MediaContainer.hub,Hub.metadata,Hub.directoryare strictVecwith only#[serde(default)]; a presentnull(as opposed to an absent key) would failthe whole container.
de_vecexists for exactly this.Both touch DTO fields every other unit depends on, the reviewer rated them low and
did not verify PMS ever sends
nullthere. Follow-up, not a last-minute edit.Gates
Run in this worktree on 2026-08-14, at this branch's final content:
make check— 542 host tests pass, 0 failed; the three named clippy lintsclean. (One transient failure mid-session, two clean runs after — a concurrent
harness run, per
CLAUDE.md's warning about two jobs at once.)make— the ARM cross-build links;pkg/plxnativeproduced (8.5 MB).No device or simulator run — this unit draws nothing.
tools/fwcompat.pynot run:nothing here touches linkage or FFI.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV