Repository navigation
Browse: the Library's directory and listing-page reads leave as store jobs - #1028
Merged
Merged
Conversation
A grid step must leave its first page as a BrowsePage job and a filter-menu step its genre and letter reads as BrowseDirectory jobs, starting no worker of their own. Both are red on this base: the step still takes client_for and spawns the worker itself, so the store's job outbox stays empty. test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 1218 filtered out; finished in 0.01s Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The Library's genre and first-letter lists (kick_directory) and its grid pages (maybe_spawn_owned) stop starting their own workers and stop reading the server registry in the step. Each read leaves on Browse's outbox as StoreJob::BrowseDirectory or StoreJob::BrowsePage (both Admission::Direct), carrying the section's ClientKey captured from the borrowed ClientKeys; the app's StoreRunner resolves it at launch and refuses the job when the client is gone or the thread is refused. The claim is raised at the step, lowered by the refusal in the refusing call, and settled at the head of the store's next step, which asks again with the then-current key. BrowseAdapter's three AtomicBool claims and Mutex mailboxes become Fetch<..>. The landings keep commit_if_current / commit_reachability_if_current unchanged. Ledger: workers 14 -> 12, globals 75 -> 73 (kick_directory and maybe_spawn_owned lose their spawn_small and client_for lines). The Held test runner starts the page read on a worker (the library route and dispatch rigs wait for its landing) and parks directory reads; the drain rigs park both. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ed-run pin Tests for the page and directory job kinds: - a refused job is settled by the store's next step (claim down, record consumed) and the step after asks again with the registry's current key, for the page and both directory lists; - the runner's branches per kind: answered once by a worker, client gone (refused once, asked again), thread refused (refused once, asked again), held park and run, held with the client gone by the time it runs, and Admission::Direct leaves a Home ledger untouched; - the held runner starts the page read on a worker and parks the directory read; - a controlled Home run's Browse commands (Reset, a Discovery landing) start no page or directory read in record and replay mode, and the controlled encoder refuses every other way to ask for one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…he lane made stale docs/sans-io.md gains the listing lanes (the filter menus' directory read and the grid's page read: the keys, the three claims, the refusal settle, the panic guard) and the held runner's per-kind live set; docs/stores-as-machines.md names the adapter's four Fetches and the new step-to-job row. The StoreJob admission match states, per kind, why a controlled run never emits the read and where the pin lives (app/browse_listing_admission_tests.rs; the old comment named a file that does not exist). browse/mod.rs's top prose no longer says the page is filled by a spawn_small worker with a Mutex mailbox, or that the client is captured at the spawn site for every read. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…est per turn It built both requests before its loop, and the second one's registry replaced the first's, so the page job's client was gone when the runner resolved it and the job was refused instead of started. It passed under no filter that matched its name until the whole suite ran. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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]>
The doc-claim audit of the B-B+C lane found eight sentences the change made false. Each is reworded in the surrounding style, only the false clause: - the admission lists (docs/sans-io.md, the adapters/stores.rs //!) name the Library's directory and page reads among the Direct kinds; - LiveKind is "a kind and not a store" because Browse emits several kinds, named, not four; - docs/poster-scheduler-design.md: the `directory` and `page` workers are started by the app's runner (launch_browse_directory, launch_browse_page), only `sources` stays in browse/mod.rs; kick_directory reads its list's `*_done` flag, not a `done` argument; - docs/parity-gaps.md: kick_directory reads one of a closed set of value lists (listing_jobs::Directory), and a new axis adds a variant, a Fetch mailbox, a counter and a landing; - browse_dump_tests.rs names the claims that exist (`genres`, `letters`, `page`); - browse_test_support.rs: the loopback page source leaves its read as a job; - "the store's one claim" is the section hubs' one claim (BrowseAdapter::hubs.fetch) at its four sites, now that the store holds four. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… claim The B-B+C lane called `browse.adapter.page.clear()` before `browse.reset()`. Fetch::clear releases the claim, so the "page fetch stayed latched" assertion passed without reset ever running against it; the old line only emptied the mailbox. The mailbox is empty already (nothing was posted), so the line goes. With `self.page.clear()` removed from BrowseAdapter::clear the test now fails on the page assertion. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d page reads browse_directory_addr and browse_page_addr built the same Addr; they are one listing_addr with the doc that says an Addr is not an identity across kinds. Also the merged runner paragraph says "every held runner" parks episode-page jobs (Live parks nothing). Considered and left alone, because each changes a shared signature or a test assertion, or sits outside this diff: the per-kind launch/run_held arms (the same resolve-else-refuse shape every other kind has), the two struct literals of finish_directory_with (they differ in the result type), and section_hubs.rs's own address helper (B-A's file, not in this diff). This was a single inline pass without the agent fan-out. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Oct 28, 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 #1027
The Library screen's filter directories (genres, first letters) and its listing pages no longer start the Browse 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::BrowseDirectory;StoreJob::BrowsePage.The step captures the section's
ClientKeyfrom the borrowedClientKeys, as the section hubs' read does (#1021). The runner resolves the key at launch and hands the body the client. This PR is the second Browse PR of the Sans-IO series, covering design rows B-B and B-C (docs/sans-io.md, "The store job lane").What changed
The jobs (
data/src/browse/listing_jobs.rsis new;data/src/browse/mod.rs,data/src/stores/{browse,mod}.rs):StoreJob::BrowseDirectory(Job<BrowseDirectoryReq>, BrowseDirectoryPort)carries awhichthat names the genres or letters read. Each read keeps its own claim and mailbox, as before.StoreJob::BrowsePage(Job<BrowsePageReq>, BrowsePagePort)reads one listing page.Directand belong toStoreId::Browse. Each admission arm comment says why a controlled run never emits it and names the test that pins it.BrowseAdapterholds threeFetchclaims (page,genres,letters). They replace the three*_fetchingflags and the threeMutex<Option<..>>mailboxes.catch_unwindguard stays in the body, and the landing stays outside it. A panicking page lands as a failed page and armsretry_cd, as before. A panicking directory read lands as an empty list.The client:
commit_if_current/commit_reachability_if_current,apply_source_outcome, the generation check anditems.landexactly as they were. No second identity check was added.Fetch::take(), nottake_current. On a live adapter, only a request's own answer or refusal lowers its claim, since Reset and a roster retire swap in a fresh adapter. The answers carry no request id, so atake_currentkeyed on the query generation would leave the claim up with nothing in flight.Refusal (S2), the B-A shape:
*_donefalse as before;fetchingfalse, so the next pump asks again for the then-first missing page with the then-current key.!spawnedarm.admitted:false, and no controlled run reaches these reads.Drains (S3). Every path that reaches these reads already had a B-A drain. The table lists each one:
Bridge::browse_run(aim_librarycommit, addressed Genres/Letters)kick_genres/kick_lettersstart_store_jobs_of(Browse)StoreWork::Browsearmpump_with_gate→maybe_spawn_ownedstart_store_jobs_of(Browse)reconcile_pump's requerypump_with_gatestart_store_jobs_of(Browse)viewstate_pump,notify_pumpVIEWSTATE_FILLS/NOTIFY_FILLSbrowse_discover_pumpThe command path emits directory reads only, and the pump emits page reads only. B-A's drain rigs now assert the page read too.
The runner (
app/adapters/stores.rs):start_browse_directory/launch_browse_directoryandstart_browse_page/launch_browse_pageresolve the key or refuse through the port. They do the same when the system refuses the thread.run_held_wherearms resolve the key or refuse.The test runner. The rigs decided which reads run live:
held()runsBrowsePagelive. Fourlibrary_route_testsrows andsession_dispatch_tests::production_bridges_do_not_share_browse_state_or_landingsfail with the page read parked, because they wait for a page landing.BrowseDirectory. Every suite is green with it parked, and the few rigs that need it run it from the parked set.held_all()parks both.park_page_reads(), a new test-only mode, parks only the page read; the drain rigs use it.LiveKindis now{Hubs, MetaSeason, BrowsePage}.Gates:
ci/check-deps.sh'swall(clock) gate now also coverslisting_jobs.rs, as B-A did forsection_hubs.rs. This tightens the gate and adds no ledger line.Ledgers
ci/allow/workers/data-browse.txtkick_directory,maybe_spawn_ownedspawn_smallgone)ci/allow/globals/data-browse.txtclient_forgone)PINNED_LEDGER_TOTALS(workers/globals/forks/fxlanes)No ledger line was added or edited. The branch merges
mainat d51aff4, which includes Metadata M2 (#1023) and ViewState (#1026). The totals were recomputed from the# count:headers on the merged tree.Tests
Fails-first. 3948e5c was committed first and ran red on the base, with 2 failed: a grid step emits a
BrowsePagejob and starts no worker, and a filter-menu step emits aBrowseDirectoryjob.New tests:
listing_jobs_tests.rs):browse_listing_admission_tests.rs):reset_clears_the_single_flight_flags_with_the_mailboxesno longer clears the page claim by hand beforereset(). It now fails whenBrowseAdapter::clearstops releasing the page claim.Mutation checks. 30 mutations were run against the committed tree, and 29 were killed. That one added a genre kick to
run_owned'sDiscoveryarm, which a controlled run never reaches: the controlled arm routes Discovery toapply_discovery, which takes no keys and no outbox. The same mutation placed on the controlled arm itself is killed.Targeted suites at d9956c7:
plx_data: 1246 passed, 0 failed.return_hold6,lifecycle86).ci/check-deps.share green.plx_screens: 1706 passed, 0 failed, before the main merge. Nothing underscreensis in this diff.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. No Makefile, Cargo or workflow file changed, so no build-bench table is needed. There is no FFI or linkage change.Review. One review, verdict FIX FIRST: one should-fix finding and six notes.
main(M2'sLiveKindand pins). Fixed by the main merge described above.///docs named only the hubs read. They now name the directory or page read each path emits.Addr.listing_addrnow says anAddris not an identity across kinds. Nothing routes by it.Doc-claim audit. It found eight sentences made false, and all eight are fixed:
Directadmission lists indocs/sans-io.mdand the runner's module doc;kick_directorysentence indocs/poster-scheduler-design.md;docs/parity-gaps.md's two "Where:" lines;Live path
Checked in the macOS simulator at 960x540 against a fresh
tests/mock_pms.py --movies 200(four pages of 60), with plex.tv and Discover pointed at the mock and a placeholder token. The identity was read before any key:version=1.41.0.0000-synthetic,owned=1. The run used real remote keys through the instance FIFO./library/sections/1/allatstart=0,60and120once each./firstCharacter) was read once when the grid booted./genreonce, and the list drew the mock's genres. Nothing was asked again while the menu stayed open.stores: WARN, noBADTRIGGERand no panic.This is host-simulator evidence only, with no TV claim. No drawing code changed.
Not in this PR
🤖 Generated with Claude Code