Skip to content

The platform states where the account's records live: tv::Services.storage - #1488

Merged
GLinnik21 merged 2 commits into
mainfrom
platform/w8a-storage-authority
Nov 20, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
platform/w8a-storage-authority

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Part of step W8a of the platform plan (discussion #1460). The platform now states where the account's records live, instead of the build's CPU and OS deciding it.

The session record, the install's preferences and the consent record have two homes. On a webOS television the LS2/DB8 storage helper owns them; everywhere else they are files. plex and telemetry chose between the two with all(target_os = "linux", target_arch = "arm", not(feature = "hostsim"), not(any(test, feature = "test-support"))). That predicate means "32-bit ARM Linux", not "a television". A Tizen ARM build would select the helper with none behind it.

What changes

  • tv::Services gains a fifth group, storage: StorageHooks { authority }, in the new os/src/tv/authority.rs:
    • Authority::Helper is stated by webOS (port.rs). The helper is the canonical store there. The app still keeps three kinds of its own files on webOS, as before: the legacy migration inputs, the marked session fallback it writes during a helper outage, and the install preferences clear_for_erase saves when a helper sign-out clear is not durable. The module doc names only the first two; the stacked plex PR completes its list.
    • The authority does not decide the session record alone. secure::mode()'s MemoryOnly comes first, and under it nothing is written, whatever the authority says. Tizen starts in MemoryOnly (W9).
    • Authority::Files is StorageHooks::NONE, stated by the desktop platform and Services::HOST_TEST. It is also what an uninstalled process reads, like every other group's host-test answer.
    • tv::authority::authority() reads the installed table.
  • There is no test override. The layers that will read the value take it as a parameter, so a test passes whichever authority it grades.
  • storage::client::install_activator (the helper's wake-up, installed by port::plex_main) belongs in this group later. It moves with the os part of W8a after W7b, and the module doc says so.
  • docs/module-layers.md and docs/platform-ports.md name the new group.

Nothing reads the value yet. Two PRs stacked on this one re-key the fences to it: plex (21 lines) and telemetry (29 lines).

Tests

  • Services::HOST_TEST's destructuring test in tv.rs pins Files.
  • port.rs pins webOS's Helper, and platform_desktop.rs's hostsim test the_desktop_table_keeps_the_account_in_files pins the desktop table's Files.
  • A source-order pin in port.rs's tests checks that run_application installs the services before it enters the application. An uninstalled television would read Files and write a plaintext session file.
  • The lane's runs:
    • plx_os tv tests: 79 passed;
    • port tests: 2 passed;
    • the hostsim desktop table test: 1 passed;
    • make check-nodef: exit 0;
    • ci/test_readonly_generated.py and ci/test_readonly_dependencies.py: ok.

No Cargo.toml, lock or certificate-pinned source changes. No ledger line.

🤖 Generated with Claude Code

GLinnik21 and others added 2 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>
… 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 6f4f126 into main Nov 20, 2026
21 of 23 checks passed
@GLinnik21
GLinnik21 deleted the platform/w8a-storage-authority branch November 20, 2026 13:42
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