Repository navigation
Platform plan: webOS, the desktop simulators and Samsung Tizen as platforms of one app - #1480
Merged
Merged
Conversation
`plx_platform` becomes `plx_os`, `rust-modules/platform/` becomes `rust-modules/os/`, the layer
`[platform]` becomes `[os]`, the fence keyword `[port X]` becomes `[platform X]` and `SRC_PLATFORM`
becomes `SRC_OS`. No behaviour change. The inner `tv` module stays.
The rewrite is `tools/rename-os-layer.py` (stdlib, run with -I), shipped for the open PRs and the
release lines that still carry the old names:
- forward (idempotent) and `--reverse`, which rewrites only the sites the forward pass writes;
- `--reverse-patch FILE`, the backport route: a post-rename `git diff` is rewritten hunk line by hunk
line (the enumerated sites are per file) so `git apply` accepts it on a line with the old names;
- `--check`: every old-name site in the three spellings (the package, the path incl. the bare
`platform/..` and `../platform` forms, the layer token) plus every enumerated literal site, and
every quoted "platform" in both quote styles is classified (a JSON key, a Sentry field,
sys.platform) or fails; a quoted platform in a list of layer names is never a keeper (the
report.rs and release-config-check.py lists, N1);
- `--equivalence BASE`: HEAD against script(BASE) and BASE against reverse(HEAD), allowing only
(a) the two certificates and their pin lines, (b) Cargo.lock as a sorted-line multiset,
(c) a .rs hunk with the same token multiset, (d) the tool, its test and its two lines in ci/check-python-steps.txt.
`ci/test_rename_os_layer.py` (16 cases, synthetic trees and a throwaway git repo) is wired into
`ci/check-python-steps.txt`. rustfmt was not run: there is no fmt gate and no line needed a reflow.
Cargo.lock: the script renames the package, then cargo (a plain `make test-crate`, offline) re-sorts
it: `plx_os` sorts before `plx_owp`, so that one package block moved above it. The lines are the
same multiset as origin/main's with plx_platform spelled plx_os, so no version moved (`--equivalence`
checks exactly that), and `cargo metadata --offline --locked` accepts the committed lock.
Certificate re-pins (both reviewed; every changed hash is a consequence of the rename):
ci/proofs/platform-generated-enums.json (keeps its name), pinned by ci/readonly_generated.py
CERTIFICATE_SHA256 1b3b34fa...6503 -> ac7a32d9...60c3
I18N_SOURCES[1] (the reviewed variant of os/src/i18n/mod.rs; its only change is the comment path
platform/build_support/catalog.rs) 2c978e3a...4d52 -> 7119e673...b463
changed: package, module, the key platform/ -> os/ for 5 sources and the manifest key; hashes of
os/Cargo.toml, os/src/lib.rs, os/src/i18n/mod.rs, build_support/install_identities.rs, the lock
and the manifests of the root, appkit, data, media, play-feed, play-uri, plex, screens, session,
storage, telemetry, ui and os. Unchanged: os/build.rs, os/build_support/catalog.rs, machine/*.
ci/proofs/serde-json-immutable.json (serde_json 1.0.154, archive checksum verified), pinned by
ci/readonly_dependencies.py
CERTIFICATE_SHA256 915ab64b...6540 -> dc193808...2fc4f
changed: lock_sha256, the same 13 manifest hashes and the manifest key platform -> os, and the
lib_sha256 of the owners os, data, media, net, play-feed, plex, session, storage and telemetry
(their lib files name the layer in a doc comment or a #[path]).
Verified here: `--check` 0 sites left; `--equivalence origin/main` ok; ci/test_rename_os_layer.py,
ci/test_readonly_{generated,dependencies}.py, test_module_graph, test_build_bench,
test_no_host_staticlib, test_storage_package_isolated, test_check_machine_shape, test_ci_split,
test_cargo_seed, check-module-layers (0 migration entries), check-list-caps, check-localization,
check-deps.sh (all green); cargo check --workspace --locked; make test-crate C=plx_os (442 passed).
Not run here: make check, check-nodef, the ARM cross-build, build-bench, a TV boot.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…reams docs/platform-ports.md is the approved plan for running the application on more than webOS (the desktop simulator and PlxNative.app as a platform of their own, Samsung Tizen as the first new one): the verified facts, the target shape, workstreams W0 to W13 and the owner decisions 1 to 8. Its fact sections quote the tree before the bottom-layer rename and say so; everything else uses the final names. It also records the emulator evidence E10 to E12 (tester build panel, image library check) and Decision 8, the emulator MVP. docs/module-layers.md: the decision to wait for a second TV OS is revised, the desktop platform counting as the second implementation; the order is amended to extraction (W7) after item 2 (W4), then item 3 (W8) and item 1 (W11); and steps L15c to L15h, introduced here, map the workstreams to the migration table. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…/../platform"; --reverse-patch names its weak rewrites Two findings from the review of PR #1474, both in the tool and its test. --check: the old patterns needed `base platform` / `machine platform` or a quoted "platform", so `for c in net platform gfx`, `--only machine,platform` and `base -> platform -> ui` passed unseen, and the bare-path rule's lookbehind rejected a `/` before `../` (`"/../platform/src"`). BARE_OLD/NEW and UP_OLD/NEW now start after a `/` that directly precedes a `../`, and a new class, "3 layer token in a separator list", flags `platform` beside a layer name with a space, comma, `>` or `-` between them. Two hits on the head tree are not the layer and are named in SEP_KEEP (path + line regex + label): the Plex client-identification field list in docs/plex-api-design.md and the prose "machine, platform API" in session/src/auth/owner.rs. The class finds three real stale spellings the forward pass does not rewrite (docs/module-layers.md:112, docs/watchlist-plan.md:112, rust-modules/base/src/eventlog/scrub.rs:1079), so `--check` on this head reports 3 sites, not 0. They are not classified away; fixing them touches files outside this commit and is left to the PR's owner. --reverse-patch: a weak pattern (backticked `os`, a quoted "os" in a layer list, `base os`, `+ os machine base`, `os::member`, `os/` in a directory list) rewrote an `os` that may be the operating system back to `platform`, in every file outside NATURAL_OS, without a word. rewrite() takes weak=False to skip them; reverse_patch compares both ways per hunk line and prints every line the weak patterns changed to stderr as `file:line: old -> new` (new-side line, old-side for a `-` line), plus a count. Hunk line counts now decide what is a hunk line, so a removed `--- x` line is no longer read as a file header. Tests: one case for the check class (and `/../`), two for the report (weak lines named, strong-only patch silent); the shared runner swallows stderr. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…(graph row, two layer lists)
`--check`'s separator-list class found three places that still named the layer
`platform` and that no general rule reads: the layer graph's own row in
docs/module-layers.md (`os` keeps the `machine base` column where it was), the layer
list in docs/watchlist-plan.md ("base, machine, os. NOT net") and the comment above
the log-scan roots in rust-modules/base/src/eventlog/scrub.rs ("the machine, net, os,
gfx, ... layers"). Each is a per-file LITERALS entry in tools/rename-os-layer.py, so
the forward pass writes it, `--reverse` undoes it and `--check` flags the old text;
the three files are the script's output, not hand edits, and `--equivalence` holds.
One line changes in each file. None of the three is pinned by a certificate or a
`ci/readonly_*` digest.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…; --check sees a table cell and `platform layer/crate`
The re-review found two table cells that still said `platform` (docs/module-layers.md:121 and the layer
cell of docs/watchlist-plan.md:119). Rather than patch those two, every standalone `platform` or
`Platform` left in the tree (675 lines in 244 files, minus dated records, the tool and its test, the
platform-webos/-desktop/-tizen names, `plx_platform_*`, `[platform X]` and `app::Platform`) was read and
classified. 91 lines name the layer and are rewritten, each by a per-file LITERALS entry of
tools/rename-os-layer.py run by the script (the forward pass writes them, `--reverse` restores them
exactly, `--check` flags the old text). 584 lines are not the layer and stay: the Plex `X-Plex-Platform`
fields, the Sentry/manifest `"platform"` field, Python's `platform` module and `sys.platform`, TrueType
name-record platform ids, the webOS "platform release" in the release notes, the OpenAPI JSON key, the
dated records, and prose about the host or TV platform ("the platform bus", "a platform difference").
Eight more lines hold the layer's own constants (PLATFORM_LEAF, PLATFORM_LEAF_FILE, PLATFORM_PACKAGE,
PLATFORM_CRATE, the "PLATFORM layer crate" docstring): OS_*.
`--check` gains two classes: a table cell that is the layer's name (`| platform |`) and `platform layer`
/ `platform crate` (also possessive). Against the previous head's text they flag exactly the two cells
the review found and the `platform crate` / `platform layer` prose; on this tree they report 0 sites
with no keeper needed. The tool's docstring no longer says layer prose is left alone.
The reverse leg of `--equivalence` caught a defect in the new entries: a reverse run (and a forward dry
run) reads files that still sit under rust-modules/platform/, but LITERALS is keyed by head paths, so the
five entries under rust-modules/os/ never matched and `--reverse` left "the os layer" behind.
rewrite() and `--check` now look a file up by head_name(rel). The fixture gains
rust-modules/platform/build.rs; against the previous tool the suite failed 4 cases (the reverse round
trip and the three equivalence cases that run the reverse leg).
ci/test_rename_os_layer.py: the `/` before `platform/` assertions use real fixtures
(`rust-modules/platform/src` keeps its own class, `x/platform/src` is not flagged), the prose line has no
layer neighbour and `data platform` is asserted as a separator hit, and one case covers the cell and
noun classes (20 cases). The fixture's natural-`os` file no longer says "the platform layer".
Certificates (reviewed; every changed hash is a consequence of five edited files):
ci/proofs/serde-json-immutable.json, pinned by ci/readonly_dependencies.py
CERTIFICATE_SHA256 dc193808...2fc4f -> 47228bf8...2fec9
changed: the manifest hashes of rust-modules/Cargo.toml, os/Cargo.toml and storage/Cargo.toml (a
comment or the crate description names the layer); nothing else.
ci/proofs/platform-generated-enums.json (keeps its name), pinned by ci/readonly_generated.py
CERTIFICATE_SHA256 ac7a32d9...460c3 -> 55e6b3ac...7a718
I18N_SOURCES[1] (the reviewed variant of os/src/i18n/mod.rs; two doc comments) 7119e673...b463 ->
867bb410...37e1
changed: the same three manifest hashes, os/Cargo.toml, os/build.rs (a doc comment), the i18n variant.
Verified here: ci/test_rename_os_layer.py (20), ci/test_readonly_{generated,dependencies}.py (22, 64),
test_build_bench (46), test_build_not_always_dirty (10), test_storage_package_isolated (7),
release-config-check-test (75/75), check-module-layers, check-list-caps, check-localization;
`make test-crate C=plx_plex T=t_account` (prefs_tests.rs renames a local; 2 passed).
Not run here: make check, check-nodef, the ARM cross-build, a TV boot.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A doc-claim audit of the platform plan found six false claims; each was checked against the tree before it was changed. docs/module-layers.md: `system` is a module of the top crate, not of the bottom layer; the top crate stays on top only until L15f, when the webOS and desktop platform crates take over the staticlib; and only W9 adds a platform crate, while W10, W12 and W13 add code to the Tizen and desktop crates. The two `plx_platform` prose sites the rename check reported now name the platform crates. docs/platform-ports.md: the hostsim fence rule counts cfg lines of both polarities (77 television gates that lose a term, 11 test seams, 14 host arms) instead of "40 stay, 62 move"; `plane.rs` is the one `os` file in `MACHINES`; the rename tool has `--reverse-patch` for a backport's diff, exempts the whole plan page, and allows a fourth equivalence class. W9's emulator MVP is the interface on the dev-token path against the mock PMS, advertised as the emulator's host alias; the sign-in against the mock plex.tv is a follow-up check and the `plex_tv()` loopback rule is not widened (E12). Decision 8, the W9 heading, its Goal and its acceptance say the same. E13 records the H7 (real renderer) and H8 (libcurl) probes on the emulator, and H7 and H8 join the hello-world question list. Co-Authored-By: Claude <noreply@anthropic.com>
The first W4 rule moved all 14 positive lines that name no test term. Read one by one, only 4 of them are host arms: six are frame-probe no-op stubs that every TV build without devtriggers compiles, a RELEASE build included, three are dead-code attributes on TV items, and one is a statement inside a TV function. The simulator table's own test (`port.rs`, all(test, hostsim, play-feed)) names a type that exists only under hostsim and moves with the table. The rule, the Test line and the platform-crate list now say 77 television gates, 10 seams, 6 stubs, 4 lines that stay and 5 host arms that move, which add up to the 102. Also: L15c no longer lists Wave R as planned (it landed as #1474), and the plan records that; the H7 and H8 bullets pin the README to e8da14c; "363 arms" reads "363 `hostsim` cfg lines"; F44 cites the `MACHINES` and `FORK_SCOPE` lines of `ci/check-deps.sh` at e9924f0 once and the same way; the W9 retail run takes the same dev-token shape as the emulator MVP, with the plex.tv sign-in a follow-up, because the loopback-only override cannot be reached from a retail set; and the L15c-to-L15h text states which workstreams are steps of the table instead of a "no layer rule" reason the table itself contradicts. Co-Authored-By: Claude <noreply@anthropic.com>
…es exactly L15b item 2 still said `ffi_host` and the `hostsim` arms of `webos`, `system` and `keymanager` become a second Port table. The L15d row and W4 say otherwise: only `system`'s and `port`'s simulator arms move. The `webos` and `keymanager` items gated `any(hostsim, test, test-support)` are what the simulator runs today (launch_home, system_locale, sound_output, bind_window, the keymanager client, deliver, call_hbc), so the three places now say the same thing: they stay compiled for tests and `test-support` with only the `hostsim` term gone, and W4 no longer calls them just test seams. "363 hostsim cfg lines" counted three doc comments (`base/src/paths.rs:1347`, `src/app/session_picker_regression_tests.rs:326`, `src/app/surface_navigation_tests.rs:4`). Every site now says 363 `feature = "hostsim"` lines, 360 of them cfg lines, and F10 gives the grep that finds the three comments. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Step W0 of the platform plan (discussion #1460). The approved plan for running PlxNative on webOS, the desktop simulators and Samsung Tizen, from one repo, moves into
docs/platform-ports.md.docs/module-layers.mdis updated to the order the plan lands in. Documentation only.What the plan says
plx_platform_webos,plx_platform_desktop,plx_platform_tizen. Exactly one is compiled per build, selected by aPLATFORMmake axis. There is no runtime capability registry.tv::Portbecomestv::Services. Every hook is required, except the legacy webOS media group.run_applicationreturning its exit instead of ending the process (run_application returns its exit; only the executable entry ends the process #1479)..tpkhost that loads our Rust.so, because retail sets refuse native packages. Rust creates its own Ecore_Wl2 window and EGL context on its own thread.tests/mock_pms.py;plex_tv()accepts only loopback and that rule is not widened..soloads under a Public certificate).Emulator evidence folded in (E1–E13, emulator only)
dynlibloading reaches the mock (H8).vs_ambient.vert's one multi-declarator is split (H7). That split is its own PR.module-layers.md
systemandportare modules of the top crate, not ofplx_os.plx_platform_tizen. W10, W12 and W13 add code to the Tizen and desktop crates and change no layer rule.The doc-claim audit's six findings against the first draft are fixed.
python3 -I tools/rename-os-layer.py --checkreports 0 old-name sites.ci/check-module-layers.pyis green.🤖 Generated with Claude Code