Repository navigation
Telemetry's consent store follows the platform's storage authority, not the build's CPU - #1490
Merged
Merged
Conversation
…orage
The session, the install's preferences and the consent record live in the LS2/DB8 storage helper
on a webOS television and in files everywhere else. The persistence layers chose between the two
with `all(target_os = "linux", target_arch = "arm", not(feature = "hostsim"), not(any(test,
feature = "test-support")))`, which is "32-bit ARM Linux", not "a television": a Tizen ARM build
would select the helper with none behind it.
`tv::Services` gains a fifth group, `storage: StorageHooks { authority }`, in the new
`os/src/tv/authority.rs`. `Authority::Helper` is webOS (`port.rs`); `Authority::Files` is the
desktop platform, `Services::HOST_TEST` and any platform with no helper (`StorageHooks::NONE`).
`tv::authority::authority()` reads the installed table, and an uninstalled process reads `Files`
like every other group's host-test answer. There is deliberately no test override: the layers that
read it take the authority as a parameter, so a test passes whichever one it grades.
Nothing reads the value yet; the plex and telemetry lanes re-key their fences to it next. Tests pin
the host-test answer in the destructuring test of `tv.rs`, the webOS and desktop tables, and the
order `run_application` installs the services before it enters the application: an uninstalled
television would read `Files` and write a plaintext session file.
Co-Authored-By: Claude <noreply@anthropic.com>
…ot the build's CPU Where consent lives was picked by `all(target_os = "linux", target_arch = "arm", not(hostsim), not(any(test, test-support)))`: a 32-bit ARM Linux binary was assumed to be a webOS television with the LS2/DB8 storage helper. The platform now states it (`plx_os::tv::authority::authority()`), and `load`, `record_at` and `forget_at` read it once per operation and hand it to `load_with`, `record_with` and `forget_with`: `Helper` runs the helper arm, `Files` the files arm. Both arms' bodies are unchanged; only the selection moved. The helper arm's items (the DB8 commit, the legacy import, the canonical-consent helpers) and the canonical-consent codec in `consent.rs` compile on every target, so the 29 gated lines in persistence.rs, consent.rs and mod.rs are gone. `cleanup_after_account_clear` is unconditional: under `Helper` it sweeps the legacy candidates the helper arm of `forget_at` deferred, under `Files` it answers true because `forget_at` already removed them inline. A Tizen build takes `Files`, with no third authority value. Its install in `app::boot::install_plex_seams` loses its cfg in this same change, which needs plex's installer and its static ungated too (two cfg lines and one sentence in plex/session.rs, the two stale lines deleted from ci/allow/forks/plex.txt). Tests pass the authority as a parameter through the `*_with` forms, so no process-global override is added: one test per operation grades both stores (the files arm never reaches the helper's transport; the helper arm leaves the state root's consent file alone), and one grades the account-clear sweep. `telemetry/native.rs` (Sentry Native, 9 arm and 9 linux sites) is left for the Tizen retail work. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… a television, and the order pin is exact Review of the foundation found three things the first commit got wrong or left weak. On webOS the helper is the canonical store, but the app's own files are not absent there: the session layer writes a marked fallback (`save_legacy_fallback_locked`) whenever a commit to the helper is not durable, serves it as transient state while the helper cannot answer (`read_legacy_filtered_locked`), and the legacy files an older build left are migration inputs. `tv::authority`'s module doc and the `Helper` variant said no file is ever written and a helper outage is never papered over; they now say what the code does. The platform-ports bullet follows. The order pin in `port.rs` asserted only that the install precedes `exit::entry`. It now asserts that `platform.install_services();` is `run_application`'s first non-comment statement, counts the call and `tv::install(` across every source file of the application crate (not just `app/mod.rs`), and fails when a statement is inserted above the install, when a second call is added, and when `tv::install` is called a second time. Each of those three mutations was run and fails for its own assertion. `authority.rs` and the `port.rs` test docs spoke as if a reader of the value already existed. They now state what the value says and what it is for. Co-Authored-By: Claude <noreply@anthropic.com>
GLinnik21
added a commit
that referenced
this pull request
Nov 20, 2026
…#1490) #1490 ungated ACCOUNT_CLEAR_CLEANUP and install_account_clear_cleanup in session.rs with the same text this branch carries, so that file merges without a hunk. The forks ledger for plex keeps this branch's 12 lines: both PRs delete the same two lines, and this one deletes the rest of its 21, so `# count: 12` is the real line count after both. Co-Authored-By: Claude <noreply@anthropic.com>
GLinnik21
added a commit
that referenced
this pull request
Nov 20, 2026
…tead of the build's CPU (#1491) Part of step W8a of the platform plan (discussion #1460). `plex`'s session persistence now follows the storage authority the platform states (#1488). Before, it was fenced by `all(target_os = "linux", target_arch = "arm", not(feature = "hostsim"), not(any(test, feature = "test-support")))`, which means "32-bit ARM Linux", not "a webOS television". webOS behaves as before. Every other platform keeps the files arm it already took. On x86_64, the Tizen emulator build's CPU, that fence was already false. ## What changes - **The fenced lines** (21 at #1488's base; 19 left after #1490 ungated the account-clear hook's two) in `plex/session.rs`, `session/persistence.rs` and `session/install_preferences.rs` become a run-time choice on `plx_os::tv::authority::authority()`. - The `persistence.rs` dispatchers take `(authority, &mut dyn Transport)`. The public functions pass `authority()` and the native transport. - `Helper` runs the storage-helper arm and `Files` runs the files arm. - Only the selection changes. The session layer's marked fallback during a helper outage and the legacy migration reads are untouched. - Both arms now compile on every build. - **The account-clear hook.** `clear_for_erase` calls the telemetry account-clear hook only when the authority is `Helper`. An unset hook still reads as retired, so this PR and #1490 (telemetry, which installs the hook on every platform) were safe in either order. #1490 has landed. - **`ci/allow/forks/plex.txt`** falls from 31 lines to 12, by deletion only. It was 33 before #1490, which deleted two of the same lines first. - **#1488's last review minor is folded in.** `os/src/tv/authority.rs` and `docs/platform-ports.md` now: - name the third file the app keeps on webOS beside the helper, the install preferences `clear_for_erase` saves when a helper sign-out clear is not durable; - say that `secure::mode()`'s `MemoryOnly` decides the session record before the authority does. - **Docs.** `plex/src/plex/CLAUDE.md` says what reads the authority, and two prose claims that named the ARM fence as plex's store fence follow. So does a doc comment in `base/src/paths.rs` that called the helper-owned DB8 record "the canonical ARM adapter". The guide and the `persistence.rs` module doc name the two helpers that still name `NativeTransport` without a `_via` seam: `reset_cleared_language`, which `clear_for_erase` calls on a television only, and `helper_commit`, which has no caller. - **Left for W8c.** `plex/Cargo.toml` still declares the `hostsim` feature, though nothing in `plex` reads it now. `Cargo.toml` is certificate-pinned. ## Counts in `rust-modules/plex` | | before #1490 | main, before this PR | after | |---|---|---|---| | `target_arch = "arm"` | 21 | 19 | 0 | | `target_os = "linux"` | 21 | 19 | 0 | | `feature = "hostsim"` | 21 | 19 | 0 | | `ci/allow/forks/plex.txt` lines | 33 | 31 | 12 | ## Tests - Fake-transport tests in `migration_tests.rs` drive the `Helper` arm on every host, with the authority passed as a parameter. There is no process-global override. - Positive `Helper` tests cover load and clear. - Write, migrate, commit and bootstrap are covered through an unavailable transport. The helper fake cannot accept a positive commit outside a device. - `plx_plex` lib tests went from 823 to 828. Results on the committed tree at a637194, after merging main at 3923286: - `make test-crate C=plx_plex`: `test result: ok. 828 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out` - `make test-crate C=plx_os T=tv`: `test result: ok. 79 passed; 0 failed; 0 ignored; 0 measured; 383 filtered out` - `make test-crate C=plxnative-modules T=port::tests`: `test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1501 filtered out` - `make test-crate C=plxnative-modules T=app::adapters::session`: `test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 1468 filtered out` - `make test-crate C=plx_session T=auth`: `test result: ok. 353 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out` - `make test-hostsim T=app::adapters::session`: `test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 1718 filtered out` - `make test-hostsim T=the_desktop_table_keeps_the_account_in_files`: `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1752 filtered out` - `make check-nodef`: exit 0 - ARM `cargo check --target armv7-unknown-linux-gnueabi` for `plx_plex` and for the app crate with `play-uri,play-feed`: both exit 0 - `ci/check-deps.sh`, `ci/check-module-layers.py`, `ci/check-ledger-ratchet.py` and `ci/check-statics.sh` are green. - `ci/test_readonly_generated.py` (22 tests) and `ci/test_readonly_dependencies.py` (64 tests) are OK. - No `Cargo.toml`, lock, `.cargo` or certificate-pinned source changes. ## Prose left for one follow-up The review found two stale sentences in prose this PR edits. Both are left for one docs PR, after a doc-claim audit of the whole W8a series (#1488, #1490, this PR): - `docs/platform-ports.md` says telemetry's sites "follow in its own PR". They landed in #1490. - `plex/CLAUDE.md` and the `persistence.rs` module doc list `cleanup_temporaries` among the `*_via(authority, helper, ..)` dispatchers. It calls `cleanup_temporaries_for(authority)`, which takes no transport. ## Not covered - **The television.** The ARM evidence is a `cargo check`, so there is no link and no size figure. Both arms now compile into the ARM binary, so a small size change is possible and unmeasured. - The device check: on a `--guest --mock` boot, `session: authority read reason=miss` still appears, the identity line is unchanged, and no `session.json` appears under the state root. - **Device-only paths.** `clear_for_erase`'s `Helper` branch has no transport seam, so it, and the telemetry sweep after a durable clear, run only on a device. - **Read order.** A read before `run_application` installs the services would see `Files`. #1488's pin holds `install_services()` first in `run_application`. Nothing earlier that we found reads `plex::session`: `port::plex_main`'s storage activator and clear probe, or `main.c`'s crash and launch-argument entries. That was checked by reading the code, not by a test.
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.
Part of step W8a of the platform plan (discussion #1460). Telemetry's consent store now follows the storage authority the platform states (#1488), instead of
all(target_os = "linux", target_arch = "arm", not(feature = "hostsim"), not(test)). That predicate means "32-bit ARM Linux", not "a webOS television". webOS behaves as before. Every other platform keeps the files arm it already took.What changes
persistence.rs23,consent.rs5,mod.rs1) become a run-timematchonplx_os::tv::authority::authority().load,record_atandforget_atread the authority once per operation, then hand it toload_with(authority, transport, …),record_with(…)andforget_with(authority, legacy, root).Helperruns the helper arm;Filesruns the files arm.*_helperitem (load_helper,record_helper, the legacy import, the legacy sweep) and every files-arm body is byte-for-byte as before, apart from its deleted cfg line. No fallback, migration read or sweep is dropped.split_canonical/join_canonical) now compile on every build.cleanup_after_account_clearis unconditional. It calls a privateaccount_clear_sweep(authority, legacy).Helpersweeps the legacy candidates throughcleanup_after_combined_clear.Filesanswerstruewithout reading a path.app/boot.rsinstall_plex_seamsinstallsinstall_account_clear_cleanupon every platform. Its cfg line is removed and its doc bullet follows; the hunk is 5 lines.plex/session.rsloses the matching cfg onACCOUNT_CLEAR_CLEANUPandinstall_account_clear_cleanup.ci/allow/forks/plex.txt, whose count falls from 33 to 31.clear_for_erasekeeps its fence, so until the stackedplexPR re-keys it, a non-webOS build installs the hook and never calls it.Files, with no thirdAuthorityvalue. HowStoreMode::MemoryOnlyapplies to consent is decided in W9.Counts in
rust-modules/telemetrytarget_arch = "arm"target_os = "linux"native.rs(the Sentry Native crash capture:mod sdk, 17 externs,src/sentry_context.c) are the recorded follow-up for Tizen ARM retail builds. They do not affect the x86_64 emulator, where both predicates already pick the non-webOS arm.target_os = "linux"lines incrashreport.rsare true Linux facts and stay.Tests
New tests pass the authority as a parameter. There is no process-global override:
upgrade_tests::the_platform_authority_picks_the_store_for_{load,record,forget};tests::the_account_clear_sweep_retires_legacy_files_only_where_the_helper_defers_it.Results on the committed, restacked tree (
git status --shortwas empty before and after):make test-crate C=plx_telemetry:test result: ok. 381 passed; 0 failed; 1 ignored; 0 measured; 0 filtered outmake check-nodef: exit 0make test-hostsim T=lifecycle_regression_tests::parking:test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 1750 filtered outhostsimwith theboot.rschange.lifecycle_regression_testsmodule was not graded. One test in it,player_owner_events_record_and_replay_through_the_actual_app_host, kills the test binary (SIGSEGV) on the lane's Mac at 8f55751 and 641ba14 too.ci/check-deps.sh,ci/check-module-layers.py,ci/check-ledger-ratchet.pyandci/check-statics.share green.ci/test_readonly_generated.py(22 tests) andci/test_readonly_dependencies.py(64 tests) are OK.Cargo.toml, lock,.cargoor certificate-pinned source changes.Not covered
authority(). The platform states where the account's records live: tv::Services.storage #1488's pin keepsinstall_services()ahead of every reader.plexW8a PR edits the same lines inplex/session.rsandci/allow/forks/plex.txt, with identical hunks. Whichever lands second mergesmain, and may need to resolve the# count:line.🤖 Generated with Claude Code