Skip to content

Telemetry's consent store follows the platform's storage authority, not the build's CPU - #1490

Merged
GLinnik21 merged 5 commits into
mainfrom
platform/w8a-telemetry
Nov 20, 2026
Merged

GLinnik21 merged 5 commits into
mainfrom
platform/w8a-telemetry

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

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

  • The 29 fenced lines (persistence.rs 23, consent.rs 5, mod.rs 1) become a run-time match on plx_os::tv::authority::authority().
    • load, record_at and forget_at read the authority once per operation, then hand it to load_with(authority, transport, …), record_with(…) and forget_with(authority, legacy, root). Helper runs the helper arm; Files runs the files arm.
    • Only the selection changes. Every *_helper item (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.
    • The helper-arm items and the consent codec (split_canonical/join_canonical) now compile on every build.
  • cleanup_after_account_clear is unconditional. It calls a private account_clear_sweep(authority, legacy).
    • Helper sweeps the legacy candidates through cleanup_after_combined_clear.
    • Files answers true without reading a path.
  • app/boot.rs install_plex_seams installs install_account_clear_cleanup on every platform. Its cfg line is removed and its doc bullet follows; the hunk is 5 lines.
    • plex/session.rs loses the matching cfg on ACCOUNT_CLEAR_CLEANUP and install_account_clear_cleanup.
    • The two lines go from ci/allow/forks/plex.txt, whose count falls from 33 to 31.
    • The call site in clear_for_erase keeps its fence, so until the stacked plex PR re-keys it, a non-webOS build installs the hook and never calls it.
  • Consent on Tizen takes Files, with no third Authority value. How StoreMode::MemoryOnly applies to consent is decided in W9.

Counts in rust-modules/telemetry

before after
target_arch = "arm" 38 9
target_os = "linux" 41 12
  • The 9/9 left in 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.
  • The 3 target_os = "linux" lines in crashreport.rs are 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 --short was empty before and after):

  • make test-crate C=plx_telemetry: test result: ok. 381 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out
  • make check-nodef: exit 0
  • make test-hostsim T=lifecycle_regression_tests::parking: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 1750 filtered out
    • This shows the app crate builds under hostsim with the boot.rs change.
    • The whole lifecycle_regression_tests module 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.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.

Not covered

  • No television run. The helper-arm bodies are unchanged; what changed on webOS is the dispatch, which now reads authority(). The platform states where the account's records live: tv::Services.storage #1488's pin keeps install_services() ahead of every reader.
  • The plex W8a PR edits the same lines in plex/session.rs and ci/allow/forks/plex.txt, with identical hunks. Whichever lands second merges main, and may need to resolve the # count: line.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits November 20, 2026 15:59
…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
GLinnik21 merged commit 3923286 into main Nov 20, 2026
14 checks passed
@GLinnik21
GLinnik21 deleted the platform/w8a-telemetry branch November 20, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant