Repository navigation
Metadata season switch and episode pages emit store jobs; the runner resolves the client and the detail chain is one-client - #1023
Merged
Conversation
…s and the one-client show chain The detail chain's show test now expects the opening season's episodes on the server the chain was handed (the other server sees nothing), and a season switch and an episode-page window are expected to leave a request on the outbox instead of starting a worker. All three fail on the base. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… runner starts; fetches take the client load_season and want_episodes no longer start workers: each pushes a typed StoreJob (MetaSeason, MetaEpisodes, both Direct) on the Metadata outbox, and the app's StoreRunner starts it with the client it resolved for the show's server at the launch. fetch_episodes and fetch_episode_page take that client, so the detail chain (load_show_seasons passes the one it holds) is one-client end to end. A refused season job catches season_done up with fetch_max (a stale refusal never re-arms season_loading); a refused page job drops the inflight keys it held, so the next window asks again. A server with no client at the launch answers the failure without a GET. input.rs drains the bare store's season job in the call that emitted it; metadata_pump_season drains Metadata after its step (a guard: no landing pump emits a job today). Deletes the four ledger lines (workers 4 -> 2, globals 8 -> 6; pins 14/76/58/11). The held test runner runs the season switch live (menu_play_season_tests waits on a real landing) and parks page jobs, keyed by job kind. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…jobs and the detail chain is one-client sans-io.md gains the "Metadata reads" bullet (kinds, client resolution, refusal states, page batching, drains) and drops the "bar the opening season's episodes" caveats; stores-as-machines.md and the Metadata module docs name the jobs instead of an off-thread fetch. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…at answers; the superseded-season test presses as the dispatcher does F1: every M2 runner test dialled a dead port, where a worker handed the client the runner resolved and a worker handed none both landed the failure. The four tests that claim the client was handed over (the season and page jobs under Live, and their held-run arms) now register the slot against a loopback that answers /children and assert the landing: the season stays on the new tab with its episodes listed, the page is seated. Each of the four branches (the page Live arm, spawn_meta_season, and the two run_held arms) was mutated to hand over None and failed its own test. F3: a_superseded_season_landing_plays_nothing left its MetaSeason job on the outbox, and only the guard drain in metadata_pump_season started it. It now runs the press through Bridge::metadata_run, as the dispatcher's StoreCmd::Metadata arm does, so it no longer depends on the pump guard. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the shared id space is noted F2: the page job answered once with all its pages, so the restore page a window asks for first waited on every later GET of the job (restoring episode 130 of a long season asks for pages [2, 1, 3]; on a relayed server the hole stayed two round trips longer). The body now posts each page through MetaEpisodesPort::page as it is read, as the inline worker pushed it, and ends the job with the one done, which carries nothing (the S7 shape: many posts, one terminal). Fails before the change (a_page_job_lands_each_page_as_it_is_read saw [(2, []), (1, []), (3, [])]), passes after. The landing is still ungated (decision 7). F4: pages_addr documents that page, season and Detail jobs share one Addr id space. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The doc-claim audit of the M2 branch found seven sentences the change made false: the season landing is gated (only the page landing is an ungated take), the Direct inventory and the runner module doc omit the two new kinds, the module doc's description of held() omits the live season switch, the Held doc omits that a season or page job carries no key, Bridge::metadata_run's doc omitted the Bridge-holding bare-store caller (menu_play_tick), the MetadataState::jobs doc names only the Detail job, and a comment in route/decision.rs points at load_season's retired catch_unwind. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in the Browse B-A section-hubs job and the other changes main gained since fba7a81 (#1017, #1021, #950). Five files conflicted and every one keeps both sides: the Direct arm of StoreJob::admission() lists BrowseHubs, MetaSeason and MetaEpisodes; the runner and the Held docs name both the Browse and the Metadata kinds; bridge.rs's late-job messages name every drain of both stores; docs/sans-io.md numbers Metadata as the tenth store; PINNED_LEDGER_TOTALS is the real sum of the # count: headers (the textual merge produced a wrong-looking pair). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ge job takes one lock Behaviour-identical cleanups of the M2 job code. `finish_season_with` and `finish_episodes_with` each spelled the same "no client is no GET, a panic is a failure" read, now `read_through`, so the invariant is stated once. `want_episodes` took the page mailbox's lock twice, rebuilt each key a second time for the port and cloned the season once per page for the inflight list; it now takes the lock once and builds each key once. `MetaEpisodesPort::page` compared a freshly cloned key against every inflight entry; it compares the fields instead. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 24, 2026
Conflicts, all of the "keep every arm of both sides" kind: - data/src/stores/mod.rs: StoreJob gains ViewWrite beside MetaSeason and MetaEpisodes, and all three are Direct in admission(). - app/adapters/stores.rs: start, admit_home, retire_parked_details and run_held_where take the ViewWrite arm and the two Metadata arms; the module doc names both lanes. - docs/sans-io.md: Metadata M2 is the tenth store on the job lane and the view-state writes the eleventh; the fan-out drain list and the admission list name both. - tests/test_harness.py: PINNED_LEDGER_TOTALS recomputed from the # count: headers at the merged tree: workers 11, globals 68, forks 58, fxlanes 11 (the comment lines of both sides kept). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Oct 24, 2026
GLinnik21
added a commit
that referenced
this pull request
Oct 24, 2026
Metadata M2 (#1023) and ViewState (#1026) landed after the base. Both lanes and this one added their own test-only LiveKind, took PINNED_LEDGER_TOTALS down from the same base, and extended the same exhaustive StoreJob matches. - LiveKind = {Hubs, MetaSeason, BrowsePage}. held() runs all three live, so the season switch stays live for menu_play_season_tests and the page read for the library route rigs and session_dispatch_tests. park_page_reads() sets {Hubs, MetaSeason}: it parks only the page read. held_all() stays []. - Every StoreJob match in adapters/stores.rs (start, admit_home, retire_parked_details, run_held_where) lists both lanes' kinds. - PINNED_LEDGER_TOTALS = workers 9, globals 66, forks 58, fxlanes 11, recomputed from the `# count:` headers of the merged tree (main is 11/68; this lane takes 2 and 2), with every lane's comment kept. - docs/sans-io.md and the stores.rs //! paragraph carry every lane's prose. - Review notes N2 (the /// docs that named only the section-hubs read now also name the directory or page read) and N3 (one sentence: an Addr is not an identity across kinds). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1022
A show's season switch and its episode row's page windows no longer start the Metadata store's own workers, and their fetches no longer read the server registry. Each read leaves as a typed store job that the app's
StoreRunnerstarts:StoreJob::MetaSeason;StoreJob::MetaEpisodes.The runner resolves the show's client once at launch and hands it to the body. The detail chain's opening season now uses the chain's own client, so the chain (#1013) is one-client end to end. This is the second Metadata PR of the Sans-IO series (docs/sans-io.md, "The store job lane").
What changed
The jobs (
data/src/metadata.rs,data/src/stores/{metadata,mod}.rs):StoreJob::MetaSeason(Job<MetaSeasonReq>, MetaSeasonPort)is addressed by the season generation.StoreJob::MetaEpisodes(Job<MetaEpisodesReq>, MetaEpisodesPort)is addressed by the window's send sequence.Directand belong toStoreId::Metadata. A controlled run never emits them, becausebootstrap/effects.rshas noLoadSeason/WantEpisodesarm. No fixture records them, and the fixtures are unchanged.finish_season_job/finish_episodes_jobshare one guarded read,read_through. Thecatch_unwindguard stays in the body, and the landing stays outside it.MetaEpisodesPort::page, anddoneis the terminal. The restore page on a return to episode 130 of 300 still seats after one GET, not after every page of the job.The client:
fetch_episodes(client, season_rk)andfetch_episode_page(client, season_rk, page)take the&'static Clientthe runner resolved.load_show_seasonspasses the client it already holds. The "bar the opening season's episodes" caveats from Metadata detail chain runs its GETs through the client the runner resolved #1013 are gone, and the show test is flipped: a server re-pointed mid-chain now sees nothing.Refusal (S2). A refused job leaves what a failed start leaves on
main:season_doneup to the job's generation withfetch_max, never down. So a stale refusal after a newer landing cannot turnseason_loading()back on. The tab stays on the flipped season, and the old episodes stay listed.WantEpisodesasks for the same pages again.Drains (S3):
LoadSeason/WantEpisodeseffects →Bridge::metadata_runinput.rs,menu_play_tick)bridge.start_store_jobs()on the next lineBridge::metadata_pump_seasonstart_store_jobs_of(Metadata)after its step: a guard, since no pump emits these todayViewState's fan-outs send Metadata only
ApplyView, so no fill list changes.The runner (
app/adapters/stores.rs):start_meta_season/launch_meta_seasonandstart_meta_episodes/launch_meta_episodesare new.startandrun_held_where.retire_parked_detailskeeps both kinds, and the comment there says why.The test runner:
held()runsMetaSeasonlive, becausemenu_play_season_testspolls for a real season landing. It parksMetaEpisodes, since no rig waits on a page landing through a worker.held_all()parks both.LiveKind { Hubs, MetaSeason }), because Metadata's Detail kind must stay parked.Ledgers
ci/allow/workers/data-metadata.txtload_season,want_episodesspawn_smallgone)ci/allow/globals/data-metadata.txtfetch_episodes,fetch_episode_pageclient_forgone)PINNED_LEDGER_TOTALS(workers/globals/forks/fxlanes)No ledger line was added or edited.
Tests
Fails-first. 8ceb3d3 was committed first and run red on the base:
/children);New tests in
metadata_season_job_tests.rs:season_loading()and keeps the tab and the list;fetch_max→storefails it);a_page_job_lands_each_page_as_it_is_read. It read[(2, []), (1, []), (3, [])]before the per-page post and[(2, []), (1, [2]), (3, [2, 1])]after.Runner tests, per kind:
held()/held_all()behaviour;The client tests dial a loopback server that answers. Replacing the client with
Noneon each branch (season Live, page Live, bothrun_heldarms) turns that branch's own test red.Not forced by a test. The OS-refusal branch (
spawn_smallreturning false) is not forced by a runner test. A host has no failure knob for it, as the Search lane records. The refused outcomes are pinned at the port.Targeted suites at 14a8477, which merges
mainat 19048ea. The last commit is one doc comment.plx_data: 1228 passed, 0 failed.plx_media: 1744 passed, 0 failed.return_hold: 6 passed, 0 failed.lifecycle: 86 passed, 0 failed.ci/check-deps.share green.Gates
This PR's CI is the gate for
make check,check-nodef, the replay fixtures and the ARM build. They were not run locally.Review. One review, verdict FIX FIRST, with one should-fix finding and four notes, all handled:
metadata_run.Addr. This is now noted onpages_addr, since nothing routes byAddralone.Doc-claim audit. It found seven sentences made false, and all seven are fixed here:
docs/sans-io.mdand the runner's module doc;held(), and theStoreRunner::Helddoc;Bridge::metadata_rundoc and theMetadataState::jobsfield doc;request_play_inner(media/src/route/decision.rs) that namedload_season.Live path
Checked in the macOS simulator at 960x540 against
tests/mock_pms.py --seed 1 --shows 2 --seasons 3 --episodes 150, with plex.tv and Discover pointed at the mock and a placeholder token. It was a mock-only run, driven with the remote keys on show 2002.20021/children start=0 size=60once, through the detail chain's one client./library/metadata/<season>/children start=0 size=60exactly once. A left and right revisit read each season once more.start=60once andstart=120once, with no repeat.stores: WARNand no panic.This is host-simulator evidence only, with no TV claim. No drawing code or FFI changed.
Not in this PR
🤖 Generated with Claude Code