Skip to content

The television's webOS-shaped types become neutral ones - #1485

Merged
GLinnik21 merged 5 commits into
mainfrom
platform/w3d-neutral-types
Nov 20, 2026
Merged

GLinnik21 merged 5 commits into
mainfrom
platform/w3d-neutral-types

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Step W3d of the platform plan (discussion #1460). The television seam's types no longer name webOS: the secure envelope's backend becomes an opaque tag, sandbox becomes native_video, and identity publishes a neutral Platform. webOS fills them with the values it used before. No behaviour change on webOS or the simulator. The X-Plex headers, the devjail: log line, the telemetry fields and the session file's wire form are unchanged.

What changes

  • tv::secure::Backend:
    • It becomes pub struct Backend(Cow<'static, str>), serialized transparently, with the constants KEYMANAGER3 and PALM_KEYMANAGER.
    • keymanager::open returns None for any other tag, without an LS2 call, and remove ignores it. The session layer reports Locked, the file is not written or deleted, and a sign-out retires it as before: the same outcome as the old serde failure. One log line changes. Such a file used to fail to parse and log session: unsupported or damaged secure envelope is locked. It now parses, open refuses it, and it logs session: secure file is present but its device key is unavailable. webOS only ever writes the two known tags, so a webOS install can meet another tag only in a file that a different build wrote.
    • The legacy-migration decoder persistence::decode_legacy_at_depth still accepts only keymanager3. The Backend doc names it as the one shared reader.
  • tv::sandbox becomes tv::native_video (git mv):
    • Verdict is Available | Blocked(&'static str) | NotApplicable. webOS maps Ok to Available, Missing to Blocked("missing"), and NotApplicable to itself.
    • blocks_native_video() becomes blocked().
    • context() still returns ok, missing or n/a, so devjail:, the telemetry rtkmem field and PRIVACY.md read as before.
    • Services.identity.repair_sandbox becomes repair_native_video: Option<fn() -> Result<(), Failure>>. None answers Failure::Unsupported, as before. port.rs gives Some(webos::jail_repair::execute).
  • tv::device:
    • Info becomes { release, build, major, webos: WebosDetail { codename, api, name } }.
    • New Platform { name, version }, with platform() and publish_platform(). It uses the same publish-once pattern as the rest of tv::device.
    • webOS publishes Platform { "webOS", release or "4.5" }, the values the headers always carried.
    • plex::identity::platform() reads it, defaulting to PLATFORM until a platform publishes. Client loses its platform field.
  • tv::device::Files { read, exists } (with Files::NONE): devcaps' file reads go through it. read_caps(&Files) is split out of probe(); probe() and caps() keep their path and signature. webOS supplies webos::DEVICE_FILES through Services.identity.device_files. The log lines are unchanged.
  • Readers of the moved fields and the renamed module follow, in media, appkit, screens, telemetry, app/{diagnostics,playback}.rs and lab/snapshot.rs.
  • Docs: docs/module-layers.md's L15 / L15c / L15d rows and its interface table follow. L15c is marked done, since Keep no credential on platforms that cannot store one: a memory-only store mode #1477, URI drivers report their own display evidence; LG's binding moves into the LG driver #1478 and run_application returns its exit; only the executable entry ends the process #1479 are on main. One comment changes in ci/module-layers.ini.

FFI: no extern, dynlib! or link directive changes. The keymanager LS2 URIs are the same. libc::access on the rtkmem device is the same call, moved into a closure passed to the pure jail_verdict. The ARM-only Sentry block changes three field paths. I reviewed these hunks by hand in place of fw-compat-reviewer, and the armv7 artifact assertions are green on this head.

Nothing changes in the certificate-pinned sources (ci/readonly_generated.py), the C ABI, extern/dynlib! declarations or the ledgers. The only file move is inside plx_os (rust-modules/os/src/tv/), so no crate or rust-modules/src/ layout changes and there is no build-bench table.

Tests

New:

  • The wire form is pinned before the change. For both tags, the_sealed_envelope_keeps_its_wire_form_for_every_backend_tag compares against a literal written from the old code, and passes byte for byte after it. An envelope member the type no longer has (0.6.3–0.6.5's identity) is still ignored on read.
  • An unknown tag:
    • it is kept verbatim and equals no known tag;
    • no installed platform opens it;
    • keymanager refuses it without an RPC;
    • plex's an_envelope_with_a_backend_tag_no_platform_knows_is_locked_and_left_as_it_was locks it and leaves the file, with a control test.
  • The webOS jail verdict, as a pure function.
  • devcaps: no files gives the assumed profile unmeasured, an unparseable table gives the same, and a served table with gstcool.conf gives measured caps with DTS dropped.
  • Unchanged: the X-Plex headers test (metadata_receives_versions_for_this_client) passes as it was.

Bounded runs on the committed head, through tools/check-lock.py:

  • make test-crate C=plx_os: test result: ok. 460 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
  • C=plx_plex T=identity: ok. 27 passed; T=backend_tag: ok. 2 passed; T=metadata_receives_versions: ok. 1 passed
  • C=plx_media T=repair: ok. 3 passed; C=plx_appkit T=player_hud: ok. 211 passed
  • C=plx_screens T=jail_fixture: ok. 1 passed; T=player::ass_subtitles: ok. 21 passed
  • C=plx_telemetry T=sentry: ok. 22 passed; T=schema: ok. 17 passed
  • make test-hostsim C=plx_media T=jail_refusal: ok. 1 passed; T=app::diagnostics: ok. 49 passed; T=app::playback: ok. 13 passed
  • lab/snapshot.rs is gated on lab-diagnostics. It type-checks under cargo check --lib --tests --features lab-diagnostics with 0 warnings, but it was not run.
  • make test-crate C=plx_screens T=player dies with SIGSEGV in player::automatic_marker_tests::actual_visible_player_paint_reports_typed_watch_without_mutating_it, a paint test with no GL context on this Mac. An older log shows the same crate crash on a tree without this change. With that test skipped, the crate's binary gives 2285 passed, 0 failed.
  • ci/check-deps.sh, ci/check-module-layers.py, ci/check-ledger-ratchet.py and ci/test_readonly_generated.py: green.

Not run here: make check, check-nodef and the ARM cross-build. This PR's own CI gates them, including the ARM-only Sentry block in telemetry/native.rs, where three field paths change.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits November 20, 2026 11:53
The sealed session envelope is what the session layer stores on disk, and its backend tag
is the one spelling a TV's saved login cannot survive a change of. Nothing pinned it: the
persistence fixtures carry the keymanager3 tag inside the session wrapper and only read it
back, and palm_keymanager appeared in no fixture at all.

The test serializes a Sealed for each tag the type can name today and compares the JSON with
a literal written from today's code, then reads the literal back and compares the value. A
second test pins that a member an earlier build wrote (the 0.6.3 to 0.6.5 files carry an
identity member the type has no field for) is still ignored on read.

Co-Authored-By: Claude <noreply@anthropic.com>
Backend was a closed enum naming the two webOS key managers, in the one type the stored
session envelope shares with every platform. It becomes an opaque string tag, serde
transparent, so the wire form is the bare string it always was and a platform can name its
own store in its own code (Backend::new). The two spellings a TV has already written stay as
constants, KEYMANAGER3 and PALM_KEYMANAGER; the pinned envelope literals from the previous
commit pass unchanged.

A tag no installed platform knows now parses instead of failing the whole envelope, so the
refusal moves to open: keymanager's open answers None for it (the session layer reports the
file locked, as it did for the parse failure) and its remove asks no service and leaves the
backend cache alone, so a foreign tag is never handed to keymanager3 on the strength of the
shared key name. Tests pin both in keymanager and one through the session file, with a
control that the platform's own tag still opens.

Co-Authored-By: Claude <noreply@anthropic.com>
tv::sandbox becomes tv::native_video. Its verdict is Available, Blocked(reason) or
NotApplicable, where webOS's old Ok, Missing and NotApplicable map one to one and the reason
word stays "missing", so the devjail: log line, the rtkmem telemetry context and PRIVACY.md
read exactly as before. The repair is an optional hook, Services.identity.repair_native_video,
and a platform that states none answers Unsupported, the answer the all-None services gave.
The readers in media, appkit, screens, telemetry and the application follow the rename.

The platform publishes the name and version the Plex headers report. tv::device keeps a
once-set Platform, webOS's probe states the release it read (or the "4.5" literal when the set
named none) and plex::identity::platform() and platform_version() answer it, falling back to
"webOS" and the old release-or-"4.5" when nothing is published. The X-Plex headers are the
same bytes on every path; the client no longer carries a copy of the platform name.

device::Info keeps release, build and major; codename, API version and name move to a
WebosDetail behind Info::webos, and the readers (the probe log line, devcaps, the Sentry and
PostHog contexts, the diagnostics panel, the lab snapshot) print the same text.

devcaps reads its files through the platform. The parsed model stays and keeps its paths and
its log lines; the reads go through tv::device::Files, which Services.identity states and which
webOS fills from the file system. devcaps::probe() and caps() keep their paths and signatures.

Not on the host and so read by hand: the ARM-only Sentry block in telemetry/native.rs now reads
the same three strings from info.webos.

Co-Authored-By: Claude <noreply@anthropic.com>
The L15c row still said W3a to W3c were planned; #1477, #1478 and #1479 landed them, and the
row beside it now says W3d has. The Backend doc said no shared code branches on a tag, but the
legacy-migration decoder in plex::session::persistence compares the one spelling earlier builds
wrote.

Co-Authored-By: Claude <noreply@anthropic.com>
Target shape 1 still listed repair_sandbox in the identity group. After W3d the group carries
repair_native_video, an optional hook, and device_files, the reader devcaps parses through, as
tv.rs's IdentityHooks does.

Co-Authored-By: Claude <noreply@anthropic.com>
@GLinnik21
GLinnik21 merged commit d166f5f into main Nov 20, 2026
17 checks passed
@GLinnik21
GLinnik21 deleted the platform/w3d-neutral-types branch November 20, 2026 10:16
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