Repository navigation
Browse pins: the pin logic takes the session the app reads, not the registry (B-F) - #1106
Merged
Merged
Conversation
Four tests that hand the pin logic a session that disagrees with the registry and fail on the base, which reads the registry; one characterisation pin (F1) that is green on both sides. The helper bodies are the base's own calls. Co-Authored-By: OpenCode <[email protected]>
resolve_pins, pin_record_for, record_pins and onboard::asks_for_sources no longer read the session registry. The Bridge observes the store's pending pin write, then reads the session, and hands it down (Bridge::browse_session); PinWrite::saved never polls again. Deletes the four globals ledger lines (globals 64 -> 60) and names the _from mutators in the guard. Co-Authored-By: OpenCode <[email protected]>
F2 (a latch belongs to its own write), F3 (a receipt is consumed only once observed), G1 (the gate judges the published profile) and the refusal of a pin command sent through the sessionless run entry. Co-Authored-By: OpenCode <[email protected]>
Doc-claim audit: sans-io.md gains "The pins' session input" and the browse row's remaining-on-ledger sentence is corrected; stores-as-machines and shared-servers name the _from functions; the touched files' docs name the session the Bridge hands and the observe/saved split. Co-Authored-By: OpenCode <[email protected]>
… name the roster path in sans-io.md Co-Authored-By: OpenCode <[email protected]>
Bardioc1977
added a commit
to Bardioc1977/plx-native
that referenced
this pull request
Oct 28, 2026
Conflicts: - rust-modules/data/src/browse/mod.rs: main's plxnative#1106 split the section append into `append_sections_with(.., session, user)` plus a test-only `append_sections_for_test`; this branch had made the same function the rediscovery door that also applies server renames. Kept both: main's signature and `append_sections_for_test`, with the branch's rename loop and doc inside. The one test seeder that still passed `None` now calls `append_sections_for_test`. - tests/mock_pms.py: /_mock/config allows main's `refuse_conversions` and this branch's `section_titles` rename patch. Follow-up: Polish (plxnative#1039) entries for the six Other Videos strings this branch added to every other locale (browse.kind.*, browse.library.videos, browse.library.no_videos, settings.libraries.detail_opt_in, widgets.source.opt_in_hint). Signed-off-by: Heiko Kopp <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[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 #1104
The Library's pin logic no longer reads the session registry from inside the Browse store.
resolve_pins(nowresolve_pins_from),pin_record_for,record_pins(nowrecord_pins_from) andonboard::asks_for_sourcestake the&Sessionthe app read and passed in. This is the fourth Browse PR of the Sans-IO series (docs/sans-io.md, "The store job lane"), design row B-F. It adds no job kind and no runner arm, and every replay fixture is byte-identical.What changed
The input is a borrowed
&plx_plex::plex::session::Session, read by the Bridge. Search's household scope (Bridge::household_ids) and the controlled run'spreferencesvalue are the precedents.append_sections_with(source, list, session, user),apply_discovery(.., session, user, adapter),record::apply_to(.., session, user),run_owned(.., session, jobs),land_discovery_owned_with_gate,discover_pump_owned_with_gate,pump_owned_with_gate,apply_pins_from(answers, session),record_pins_from(asked, touched, snapshot)andonboard::{asks, asks_for_sources}(.., session)take it.BrowseStore::run_with_session(cmd, keys, session)is the oldrunbody.run(cmd, keys)stays for the Stores fan-outs, which send onlyApplyView,HubsInvalidate*andListingsChanged. It refusesApplyPinsandDiscovery(adebug_assert, and a dropped command with a log line in a release build), so a step handed no session can never read the registry. TheMachinearms handSession::default()next toClientKeys::default().""andio.preferences.current_profile_key,queue_update_ticket's merge under IO,peek_settledand B-E's two peeks (discovery_needs_pump,sync_roster_owned) are untouched.Same-step freshness: observe, then read. The worker sends the receipt after it installs the written session, so a session read after seeing the receipt contains the write.
PinWrite::observepolls once and latches.PinWrite::savedonly reads the latch and never polls.Bridge::browse_sessioncallsobserve_pin_write()and thenpeek(). It is the only production poller. Its callers arebrowse_run,browse_discover_pump, theStoreWork::Browsearm andreconcile_pump's requery (therequery_owed()check is made first, so no immutable borrow overlaps theborrow_mut).record_pins_fromreplacespending_pins.The first-run gate. boot.rs (inside the lazy
ask_first_run) andfollow_auth_landingeach readpeek()where they ask. At login it is a fresh read, not the earliersaved, becauseinstall_pms_owned,reset_for_profileandrefresh_browse_directoryrun in between.Guards.
apply_pins_fromandrecord_pins_fromjoinMUTATORSand the browse row ofMUT_FNS_TABLEinci/check-deps.sh.Ledgers
ci/allow/globals/data-browse.txtpin_record_for,record_pins,resolve_pins,asks_for_sourcessession::peekgone)PINNED_LEDGER_TOTALS(workers/globals/forks/fxlanes)No ledger line was added or edited. No fixture under
tests/fixtures/replay/was touched. The shims (resolve_pins,apply_pins,record_pins,append_sections_for_test) are under#[cfg(test)]or#[cfg(any(test, feature = "test-support"))], so the rule does not scan them.Tests
Fails-first. 2876c27 was committed first and run red on the base, with the four fails-first tests failing and the F1 characterisation pin green:
test result: FAILED. 1 passed; 4 failed; 0 ignored; 0 measured; 1270 filtered out; finished in 0.11sThe naive variant of F1 (delete the re-peek in
pin_record_forbut keep the poll inside it) goes red, so F1 does pin the order. This run was not committed:test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 1270 filtered out; finished in 0.10sNew tests (
data/src/browse/browse_pins_input_tests.rs, every one seeds the registry to disagree with the handed session):runentry is refused.Gates
Verified on the committed tree (13c4302), targeted only (the full gates are CI's):
make test-crate C=plx_data T=pins_input:test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 1270 filtered out; finished in 0.18smake test-crate C=plx_data:test result: ok. 1279 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.93s(the C3 commit then changed only comments, docs and the names in them;T=browsere-run after it:test result: ok. 268 passed; 0 failed; 0 ignored; 0 measured; 1011 filtered out; finished in 1.85s)make test-crate C=plx_screens:test result: ok. 1721 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 24.79smake test-crate C=plxnative_modules:test result: ok. 1085 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 25.73smake test-hostsim T=return_hold:test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 1194 filtered out; finished in 0.14smake test-hostsim T=lifecycle:test result: ok. 88 passed; 0 failed; 0 ignored; 0 measured; 1112 filtered out; finished in 4.14spython3 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 in 13.447s/OKbash ci/check-deps.sh:check-deps: all gates green(globals (60 sites))Not run here, by the lane's rules:
make check,make check-nodef,make check-replayand the ARMmake. They are CI's.Live path
macOS simulator at 960x540, a fresh instance root, a fresh
tests/mock_pms.py --port 32499 --authorize-after 2with plex.tv and Discover pointed at it, no token. The identity lines first:pms: server 0 version=1.41.0.0000-synthetic,notify: roster servers=1 described=1 owned=1. No Plex account was touched.login: server installed — asking which sources feed Home(the gate, judged on the handed session). I turned the shows row Off, committed with Start watching, and got exactly oneonboard: Home selection recorded — 1 of 2 libraries on.plxnative-settings=homeandplxnative-loginremoved. Favorite libraries showed step 1's choice (films On, shows Off). I turned shows back On and pressed Done: one moreonboard: Home selection recorded — 2 of 2 libraries on. (BACK cancels the Settings editor and records nothing, as designed.)onboard:line was logged.The state file is sealed, so each step's evidence is the next shot of the screen, not the file's
home_pins. The boot-time gate (boot.rs) cannot be exercised live without a real plex.tv base, because a triggered boot is automated. It is covered bythe_first_run_gate_is_judged_on_the_handed_session,the_gate_judges_the_published_profileand the existingthe_first_run_question_is_asked_once_per_profile/every_profile_is_asked_even_on_a_single_server, and is not verified live. Another lane'smock_pmswas listening on 0.0.0.0:32499 throughout; it was left alone, and this run's own mock was the one answering (the default 48-film library, where the other was started with--movies 4). Every sim and mock process this run started was killed by pid.Decisions and deviations
mainat a2aa85d (B-D merged), not B-D's head, so the decision file's line numbers were re-found by grep. Behaviour is as decided.TestBrowse::first_run_asks, the*_for_testentries) pass&peek()afterobserve_pin_write(), neverSession::default().mod.rs's//!"The pins capture it at their spawn site" is about another mechanism and is left alone.Not in this PR
discovery_needs_pump,sync_roster_owned) stay on the ledger.Review
Verdict: MERGE, with two MINOR findings. Both were cheap and certain, so both are fixed.
TestBrowse::pumpobserved the write after its roster sync. Fixed: it now observes and reads the session beforesync_roster_owned, asBridge::browse_sessiondoes beforepump_with_gate. Red first:the_harness_pump_observes_the_write_before_the_roster_syncfailed before the fix (test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1279 filtered out; finished in 0.05s) and passes after (test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1279 filtered out; finished in 0.05s).docs/sans-io.mdsentence was false for the roster path. Fixed: the bullet now says the roster reconcile (sync_roster_owned->reconcile_pins_from->pin_record_for) getssync_roster_owned's own in-machinepeek(), which stays on the ledger until B-E.Nothing was left open or judged wrong.
Main merge
origin/mainhad not moved (still a2aa85d), so there was nothing to merge.git diff origin/main...HEAD --statshows only this lane's files (22 files).Gates after the review fixes
On the committed tree, clean before and after:
make test-crate C=plx_data:test result: ok. 1280 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.84smake test-crate C=plx_plex:test result: ok. 752 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.80smake test-crate C=plx_screens:test result: ok. 1721 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 24.57smake test-crate C=plxnative_modules:test result: ok. 1085 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 25.55smake test-hostsim T=return_hold:test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 1194 filtered out; finished in 0.14smake test-hostsim T=lifecycle:test result: ok. 88 passed; 0 failed; 0 ignored; 0 measured; 1112 filtered out; finished in 4.12sRan 2 tests in 14.128s/OKbash ci/check-deps.sh:check-deps: all gates green🤖 Generated with OpenCode