Repository navigation
Watchlist W-1: the stores take the seated profile and its identity from the Bridge (#1107) - #1108
Merged
Merged
Conversation
Five tests that hand the stores a profile or an identity that disagrees with the scripted seam and fail on the base, which asks the seam. WatchlistInput is the pure value the Bridge will read and hand over; the helpers that pass it have the base's own calls as bodies. Co-Authored-By: OpenCode <[email protected]>
…om the Bridge (C1) WatchlistAuth::capture, is_current and the two IO seams' capture_auth and is_current leave data/. The Bridge reads the registry in app code: seated_profile (an Arc of the published profile) is handed to both stores' frame passes, and watchlist_input (the profile, plex_tv_credential and the client id, from one snapshot, built per call) to the steps that can capture: the Watchlist's Open and the catalog's open. WatchlistStore::run keeps its signature for every command but Open, which it refuses with a debug assertion and a log line; run_with_input is the stepping entry. The catalog pass captures nothing: a landing for a switched profile is dropped and the title owed a read, which Bridge::catalog_pump opens again in the same call (take_reopen). Three globals lines leave data-watchlist.txt; PINNED_LEDGER_TOTALS goes 7/60/58/11 -> 7/57/58/11. Co-Authored-By: OpenCode <[email protected]>
…itch tests (C2) Co-Authored-By: OpenCode <[email protected]>
Co-Authored-By: OpenCode <[email protected]>
Bardioc1977
added a commit
to Bardioc1977/plx-native
that referenced
this pull request
Oct 28, 2026
Merge main (plxnative#1103, plxnative#1106, plxnative#1108, Polish locale and the playback work) into the owner-stamp branch. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Heiko Kopp <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1107
The Watchlist and catalog stores no longer read the session registry to learn whose list they read. The Bridge reads it in app code (the ledger scan does not cover it) and hands the stores the value. This is the first of the Watchlist's two PRs in the Sans-IO series (design row W-1, S5). It adds no job kind and no runner arm: the worker jobs,
find,guid_of,copy_rankand the clock read are W-2's and are untouched.It copies the Browse pins (#1106) shape: one Bridge reader per entry point,
run(cmd)keeping its signature for callers that cannot reach the read (refusing the impossible command with a debug assertion and a log line), andrun_with_inputas the stepping entry.What changed
The input (
data/src/watchlist.rs):WatchlistInput { profile: Arc<CurrentProfile>, auth: Option<WatchlistAuth> }is a pure value.WatchlistInput::new(profile, credential, client_id)carries the rulescapture()had (no user, no credential or an empty client id means no auth).WatchlistAuth::is_current(&self, now: &CurrentProfile)is a pure comparison of generation, id and uuid (what the base compared).WatchlistAuth::captureis deleted.capture_auth/is_currentleaveWatchlistIoandCatalogIo, withLiveIo's andLiveCatalogIo's impls.The Bridge (
app/bridge.rs,app/watchlist.rs), two helpers because the two kinds of call need different amounts:Bridge::seated_profile()iscurrent_snapshot(), anArcclone. It goes to the two per-frame passes (WatchlistStore::pump_with_gate(gate, &profile),CatalogStore::pump(&profile)). They never capture, so they need no more, and anArcclone is what keeps them cheap every frame in every route.Bridge::watchlist_input()builds the profile andOption<WatchlistAuth>from ONE snapshot,plex_tv_credential(&user)andpeek().client_id. It is called only where a capture can happen, and never kept, so a capture reads the credential at the moment it is made, as before.plex_tv_credentialis apeek()read in disguise (legacy-owner fallback), so it is called here and nowhere indata/.watchlist_input():watchlist_feed(page mount),watchlist_open_if_idle,catalog_feed(mount), andBridge::catalog_open.Signatures:
WatchlistStore::run(cmd)Openthrough it is refused (debug assertion, log line)WatchlistStore::run_with_input(cmd, &WatchlistInput)WatchlistStore::pump_with_gate(gate, &CurrentProfile)Machine::stepCmdgoes throughrun;Pumpis refused (nothing sends it, and a pump handed no profile would read as a sign-out)watchlist_teefan-outapply_editonly)CatalogStore::open(hex, &WatchlistInput)CatalogStore::pump(&CurrentProfile)CatalogStore::take_reopen()The catalog re-open, which keeps the same-frame behaviour. Catalog
pumpused to callopenitself on a profile switch noticed while a landing was in hand. It now captures nothing: it drops the landing, clears the identity, records the title as owed a read and returnstrue, as before.Bridge::catalog_pumpcallstake_reopen()and then its owncatalog_open(hex), which reads the input then and starts the job, all in the same call.openandresetclear the owed title.Decisions (and why)
auth = Noneand the nextOpencaptures), so they take the profile only.capture_auth/is_current, so no registry read is left under a scanned function. Tests feed the input through one constructor family (WatchlistInput::for_test,signed_out_for_test,profile_for_test).pumpstops re-opening by itself rather than taking the full input every frame, for the same cost reason. The Bridge's drain is the only non-test caller ofCatalogStore::pump.is_currentcompares generation and user id/uuid only (a same-profile token refresh does not move the generation); the heldWatchlistAuth(including the write path's) is the one taken at the lastOpen; after a switch the Watchlist store sitsIdleuntil the nextOpen.Ledgers
ci/allow/globals/data-watchlist.txtcapture::current_snapshot,capture::session::peek,is_current::current_snapshotdeleted)PINNED_LEDGER_TOTALSThe three lines that stay are W-2's:
copy_rank::current_server,find::client_for,guid_of::client_for. The replay fixtures are unchanged (git diff --stat origin/main -- tests/fixtures/replayis empty).Tests
Red first (C0
5d69467b7, on the base; the helpers' bodies are the base's own calls, so each test hands a profile or identity that disagrees with the scripted seam):make test-crate C=plx_data T=handed:test result: FAILED. 6 passed; 4 failed; 0 ignored; 0 measured; 1275 filtered out; finished in 0.12s(a_profile_switch_is_noticed_from_the_handed_profile,open_captures_the_handed_authfor each store,a_switch_noticed_from_the_handed_profile_drops_the_landing)make test-crate C=plx_data T=an_input_with_no_auth:test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1284 filtered out; finished in 0.00sGreen on the committed tree (
git status --shortempty):make test-crate C=plx_data:test result: ok. 1290 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.99smake test-crate C=plxnative_modules:test result: ok. 1087 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 25.77smake test-hostsim T=return_hold:test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 1196 filtered out; finished in 0.16smake test-hostsim T=lifecycle:test result: ok. 88 passed; 0 failed; 0 ignored; 0 measured; 1114 filtered out; finished in 4.03spython3 tests/test_harness.py -v DepGates.test_ledger_totals_match_the_pinned_table DepGates.test_ledger_count_header_must_equal_its_entries_in_every_area_file:Ran 2 tests ... OKbash ci/check-deps.sh:check-deps: all gates green(globals (57 sites));python3 ci/check-module-layers.py: greenWhat pins what:
a_profile_switch_is_noticed_from_the_handed_profileanda_profile_switch_rotates_the_epoch_and_clears_everything(watchlist);a_switch_noticed_from_the_handed_profile_drops_the_landinganda_landing_for_a_switched_profile_asks_again_under_the_new_one(catalog); Bridge:a_profile_switch_is_noticed_in_the_frame_pass_and_the_new_profile_reads_once,the_bridge_catalog_entry_points_start_the_read_they_emitted_in_the_same_call;a_landing_tagged_with_the_old_generation_is_dropped_after_a_switch;NoAccount:a_sign_out_resets_the_pass_and_the_next_open_is_no_account,an_input_with_no_auth_is_no_account,a_switch_to_a_profile_with_no_credential_reads_nothing;a_reopen_owed_by_a_pass_is_taken_once_and_cleared_by_an_open,an_owed_reopen_with_no_credential_reads_unreachable; the guard:an_open_sent_through_the_inputless_entry_is_refused.The Bridge-level rigs seat a scratch session and a published profile (
Bridge::seat_watchlist_account_for_test), because the helper reads the real registry.Gates
Not run here (delegated to CI, per the lane rules):
make check,make check-nodef,make check-replay, the ARMmake. No FFI is touched. The doc-claim audit was done by hand overdocs/sans-io.md(the Catalog "still reads" bullet was replaced by "The Watchlist and catalog session input"),docs/watchlist.mdand the//!////of the touched files.Live path (macOS sim, 960x540, mock Discover stand-in; no TV, no real plex.tv)
A fresh
tests/mock_pms.pyin-process on its own port (--home-users 2 --authorize-after 2equivalent), plex.tv and Discover at the mock, a fresh scratch root. Identity lines read before any key: a synthetic PMS version (version=1.41.0.0000-synthetic),owned=1,discover: base=stand-in reads=open. A stored Home session of two profiles, booted withplxnative-pickuser=1:watchlist: list page 0 -> full readline, one/library/sections/watchlist/allread at the mock);AtoD); the mock saw exactly one list read per profile, none in between, and the page listed the stand-in's items again after the next Open. The store emptying in the very pass is pinned by the Bridge test above, not by a screenshot: the switch leaves the page for the picker;open; the catalog store's input is covered by the unit and Bridge tests.Every sim process was killed by the driver; the mock ran in the driver's process.
Not in this PR
W-2: the five worker kinds as jobs,
find/guid_of/copy_rankand the clock read in the step. Theserver_ids/server_probe_result/server_roster_gen/server_facts_genreads stay.🤖 Generated with OpenCode