Repository navigation
Hubs store emits its read as a store job; the step decides its client from ClientKeys - #1011
Merged
Merged
Conversation
…before Hubs moves onto the job lane A controlled Home Bridge (recording side) writes one admission per request the stores ask for, in the order they are asked, and a replay compares that list byte for byte. The new Bridge-level test delivers a Hubs refetch and the discovery work of the same frame and pins both recorded values as literals, hubs first and discovery second, against the signatures that do not change when Hubs emits a store job instead of starting its own worker. It passes on the base and stays unedited through the lane. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ry read Src keeps a ClientKey instead of a &'static Client and a token generation. Every Hubs entry (tick, land, run, controlled) and the Stores methods that step Hubs (viewstate_run, viewstate_pump, stops_landed, notify_map) take the ClientKeys the Bridge refills just before the call. The landing compare keys on resource.instance_gen(), so replay's recorded logical instance id cannot make a live landing look stale. The recorded HubsInitial and the request descriptor carry the same numbers as before. BrowseScope carries the keys so the scope-level cores need no new parameter; a test-only standalone scope reads the registry in test code. Four client_for lines leave the globals ledger (count 5 to 1); the last one goes with the worker in the job-lane commit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Stores::VIEWSTATE_FILLS and Stores::NOTIFY_FILLS name the outboxes a fanning call can fill, and Bridge::start_store_jobs_in starts them in that order. hubs_run, viewstate_run, viewstate_pump, notify_pump and the three live Store(Hubs) / HubsResult / StoreWork::Hubs arms drain Hubs in the same call as the step. stops_pump and reconcile_pump reach Hubs through ApplyView only, which launches nothing, so they drain none. The two controlled arms join in the job-lane commit, where they start through admission. Hubs has no outbox yet, so behaviour does not change; the WARN string and the leftover-job assertion name the new drains. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…he kick PmsAdapter gains an unrecorded refused list. kick_with records (generation, request id, server) there when its launcher says no and leaves the source in flight; settle_refused runs first in step_landings_with_scope, run_with_scope and controlled_work_with_scope and runs the old inline block verbatim (latch released; a quiet read spaces its next try; a page ask backs off without spending an attempt; anything else fails the attempt and asks for the endpoint again). An entry whose generation or request id no longer matches was superseded and is dropped. No refusal reaches a recorded mailbox, so no recorded byte moves. The refusal tests were rewritten first and failed against the previous tree (data 5 failed, app 4 failed); they pass with the settle. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… starts no worker HubsStore steps emit StoreJob::Hubs(Job<HubRequest>, HubsPort) on an outbox and the app's StoreRunner launches them. HubRequest carries the ClientKey its step decided on and owns the IO body (fetch) and the landing (complete); HubsPort holds the adapter Arc, raises the dump-mode claim at the launch (at the park in Held) and files a refusal on the unrecorded list the next step settles. StoreJob::admission() names three families as one exhaustive match (Tape, Home, Direct); the Hubs read is Home, admitted through the controlled run's own ledger by StoreRunner::start_admitted with the bytes HubRequest:: admission returns (the bytes hubs_descriptor returned). The controlled arms of the Bridge step Hubs and admit what it emitted inside the arm, so the hubs line still precedes the discovery line; the live arms, the landing and the fan-outs start through start. Held parks per kind: held() leaves Hubs live, held_all() parks it for the tests that choose when it settles. Both spawn_fetch forks, kick's client_for read and the HomeIo::hubs* helpers are gone, and the three data-pms ledger files are deleted. The test seams the inline spawn had (a refused spawn, a late worker) are the runner's, cfg(test) beside the boundary they stand for. The runner branches have tests of their own (live, spawn refused, client gone, held run, held gone, and the Home ledger recording and replaying a launch and a refusal); each fails when its branch is broken (gone-branch claim kept: 1 failed; Home never admitted: 6 failed; ledger refusal unanswered: 4 failed). home_admission_tests passes unedited. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
docs/sans-io.md gains the Hubs lane (the third admission family, the claim raised at the launch, the refusal outside the landing mailbox, replay identity) and names the Hubs drains; PINNED_LEDGER_TOTALS drops to workers 18, globals 90, forks 58 with the three data-pms files gone. Comments that the change made false are corrected: the landing gate's owed claim now names launch_hubs_job, the adapter and port docs say the port holds the Arc, a refused launch is settled by the next step, the check-deps hubs-owner note no longer names HomeIo::hubs_with_directory, and the rlib string measurement in docs/module-layers.md records that the Hubs refusal seam is the runner's. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e recorded instance Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Conflicts: ci/allow/globals/data-pms.txt (main only reworded its header; the Hubs lane deletes the file, so it stays deleted) and PINNED_LEDGER_TOTALS in tests/test_harness.py (main kept 19/95/60/11 and moved globals -3/+3; the real sums of ci/allow on the merged tree are workers 18, globals 90, forks 58, fxlanes 11). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… them (F1) BrowseScope::retained cloned the Vec<(ServerId, ClientKey)> on every Hubs step, so the idle per-frame Home tick allocated and freed once per frame for any user with a server. The scope now holds a Cow: Borrowed from the host's one buffer in retained(), Owned in the test-only standalone(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… endpoint refreshes (F2) A launch the runner refused is settled by the next Hubs step, and that step can be an ApplyView (a press, a stop patch, a read-back fact) or a quiet source refetch (the notification map). Their callers threw the EndpointRefreshSet away (`let _`), so a refusal settled there backed the source off and never asked for the server's endpoint to be re-resolved. publish_view returns the Hubs step's endpoints; ViewStateState::request/run, ViewStateStore::run, Stores::viewstate_run and Bridge::viewstate_run return a StoreOutcome (changed = the old bool); Stores::stops_landed/publish and Bridge::stops_pump return the set; Stores::reconcile_pump returns a StoreOutcome; Spent gains `endpoints`, which Bridge::notify_pump hands back. The dispatcher arm carries them (`Bridge::carry`), boot merges them, the item-action presses and the frame loop execute them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d (F3) `all(|sid| *sid == a)` was true for an empty list, so a boot that returned EndpointRefreshSet::default() passed. Boot yields exactly nothing in this rig (Reset rotates the Hubs and Browse adapters, and the refetch it sends is settled by the next Hubs step), so the assertion is is_empty() with that reason beside it and the list printed on failure. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a deleted fn (F6, F9) HubsPort::unclaim was a plain fetch_sub, so an unclaim after the landing take had already saturated the count to 0 wrapped it to u32::MAX. It now lowers with the same saturating update take_landings uses. ci/check-deps.sh's comment listed controlled_work_with_directory, which this lane deleted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The doc-claim audit found three prose claims the lane made false: the drain
rule ("each Bridge entry point drains only its own store", "in that one place")
that the *_FILLS fan-out lists broke, the stores-as-machines pms row and the
pms.rs module doc that still described controlled work as the capture path
(it is now a test driver; every step emits a StoreJob::Hubs), and run.rs's
"a refused launch settles at once" (it is settled by the next Hubs step).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… means The Hubs read is a StoreJob the runner starts, so the "fetching" log line says only that the step emitted the request, and the capture rule is `pms::kick_with`'s "capture at the step". Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 24, 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 #1010
The Hubs store no longer starts its own fetch worker from inside its step. Each step emits a typed
StoreJob::Hubs, and the app'sStoreRunnerstarts it, as it already does for Detail, Collection, Person, subtitle search, view reconcile and Catalog (#975, #987, #990, #996, #999). The step also stops asking the server registry which client a source talks to: it decides from theClientKeysthe Bridge refills in the same call. This is wave 3, lane A of the Sans-IO series (docs/sans-io.md, "The store job lane").What changed
Admission is a type (
data/src/stores/mod.rs,app/adapters/stores.rs):StoreJob::admission()is one exhaustive match overAdmission::{Tape, Home, Direct}. Detail, Collection and Person areTape, subtitle search, view reconcile and Catalog areDirect, and Hubs isHome. A new kind cannot skip the question.StoreRunner::start_admitted(job, Option<&mut HomeIo>)admits aHomejob through the controlled Home'sHomeIoand refuses it through its port if admission says no. Every other sender usesstart, which runs aHomekind asDirect.Bridge::admit_hubs_jobs), and they still record the Hubs line before the discovery line.HubRequest::admission()carries the oldhubs_descriptorbody unchanged, so the recorded bytes are the same.hubs_descriptorandHomeIo::hubs*are gone.The store (
data/src/pms.rs,stores/hubs.rs):kick_withbuilds the immutableHubRequestat the step and hands it tolaunch, which only collects it.spawn_fetchand its two test/production forks are deleted.BrowseScope.clients, a borrowedClientKeys. The five step-sideclient_forreads are gone. The landing compare keys on the bound client'sinstance_gen().owedis raised when the runner launches a job (HubsPort::claim), held while a job is parked, and lowered when a parked job's client is gone by the time it runs.Refusal (S2):
settle_refused): the source backs off and yields itsRequestEndpoint. That is one step later than before, when the kick settled it inline.publish_view, the viewstate and notify-map runs, theStorescalls and the Bridge pumps all carry theEndpointRefreshSetout, and boot, input and the run loop execute it.Drains (S3):
Storescall that fans out to Hubs names it in its fill list (VIEWSTATE_FILLS,NOTIFY_FILLS), and the Bridge drains those withstart_store_jobs_in.Held runner (test only):
held()parks every kind but Hubs, which still starts on a worker, because a rig that waits for a Home landing needs a real one.held_all()parks Hubs too, for the rigs that run the parked job themselves.Log line:
hubs: source N fetchingnow prints when the step emits the request, before the runner starts it.Ledgers
ci/allow/workers/data-pms.txtspawn_fetch::spawn_small)ci/allow/globals/data-pms.txtclient_forinkick_with,new,refresh_src_lifecycle,roster_with_scope,step_landings_with_scope)ci/allow/forks/data-pms.txtspawn_fetch)PINNED_LEDGER_TOTALS(workers/globals/forks/fxlanes)No ledger line was added or edited.
Tests
plx_data5 failed, app 4 failed) and pass with it.a_refusal_settled_by_a_view_edit_step_is_carried_out_of_the_press_and_the_stop_patch,a_refusal_the_quiet_refetch_step_settles_is_carried_out_of_the_pass) fail with the outcome dropped (test result: FAILED. 0 passed; 1 failed) and pass with it.app/adapters/stores.rs) were each checked by breaking the branch they pin: dropping the gone-branch unclaim fails 1, never admitting a Home job fails 6, leaving a ledger refusal unanswered fails 4.home_admission_tests.rs(added first, unedited since) pins what a controlled Home records for Hubs and discovery, in order. It passed onmainand passes here.plx_data1188 passed, 0 failed;plx_screens1698 passed, 0 failed;return_holdandlifecyclesubsets pass at ff2c00e.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. The fixture files are unchanged frommain.One review, verdict FIX FIRST, with three should-fix findings, all fixed here:
ClientKeysclone on every Home tick, now a borrow;Two notes are also fixed:
unclaimsaturates like the take, and check-deps no longer names a deleted function.A doc-claim audit found six sentences this change made false, and all six are fixed here:
pmsrow of docs/stores-as-machines.md and thepms.rsmodule doc, which still called controlled work the capture path;fetchinglog line;pms::kickrule that is nowkick_with's "capture at the step".Live path
Home was checked in the macOS simulator against
tests/mock_pms.py, with plex.tv and Discover pointed at the mock and a placeholder token. It was a mock-only run with no real account.StoreRunner::Live.hubs: source 0 fetching (off-thread)once, thenhubs: source 0 ok - 2 shelves, 12 in CWandhubs: landed - 44 items, 3 shelves.GET /hubs, one/hubs/continueWatchingand one/hubs/continueWatching/items: no re-ask, no refusal loop.The held and refused paths cannot be reached from a simulator boot, which always runs the Live runner. The runner's tests and the refusal tests cover them. This is host-simulator evidence only, with no TV claim. No drawing code or FFI changed.
Not in this PR
Four review notes are test coverage, not defects, and are left for a follow-up:
🤖 Generated with Claude Code