diff --git a/.agents/agents/fw-compat-reviewer.md b/.agents/agents/fw-compat-reviewer.md index 513990be98..b23e7f86a7 100644 --- a/.agents/agents/fw-compat-reviewer.md +++ b/.agents/agents/fw-compat-reviewer.md @@ -6,7 +6,7 @@ description: > Use before pushing anything that edits `rust-modules/base/src/dynlib.rs`, `rust-modules/media-codecs/src/ffi.rs`, `rust-modules/media-codecs/src/venc.rs`, `rust-modules/net/src/net.rs`, `rust-modules/net/src/curlio.rs`, - `src/starfish.c`, `src/video_plane.c`, `src/starfish.h`, `rust-modules/platform/src/webos/ls2/uri.rs`, + `src/starfish.c`, `src/video_plane.c`, `src/starfish.h`, `rust-modules/os/src/webos/ls2/uri.rs`, `rust-modules/play-uri/src`, `ci/expected-dt-needed.txt`, `ci/expected-dt-needed-uri.txt`, the Makefile's `LIBS_REAL`, `PLAYBACK_BACKENDS` or `PLAYBACK_HAS_FEED`, or that adds any @@ -57,7 +57,7 @@ In scope if the diff touches any of: | `rust-modules/net/src/curlio.rs` | the byte-range `curl_multi_*` `dynlib!` table, exposed as `net::range_io` | | `src/starfish.c` | 15 mangled C++ externs against real libraries (built only when `PLAYBACK_HAS_FEED`) | | `src/video_plane.c`, `src/starfish.h` | the video-plane binding: its own `dlopen` of ACB, the `dlsym` probe for the SDL exported window, and `vp_mode()` choosing between them; the header declares the `acb_*` / `sf_*` seam the Rust externs mirror | -| `rust-modules/platform/src/webos/ls2/uri.rs` and the `LSCall` declaration in `webos.rs` | the `com.webos.media` LS2 worker; `LSCall` is a hard import of `libluna-service2` in every build with the platform feature `uri-transport`, which the application's `play-uri` feature (in the shipping set) turns on | +| `rust-modules/os/src/webos/ls2/uri.rs` and the `LSCall` declaration in `webos.rs` | the `com.webos.media` LS2 worker; `LSCall` is a hard import of `libluna-service2` in every build with the os crate's feature `uri-transport`, which the application's `play-uri` feature (in the shipping set) turns on | | `rust-modules/play-uri/src` | the URI backend declares no `extern "C"` of its own: it reaches ACB through `DisplaySink` (the platform's `acb_*` externs) and the bus through `tv::uri::UriMedia`; a declaration appearing here is a new undefined symbol and a layer violation | | any new `extern "C"` block, `#[link]`, or `__asm__("")` declaration | each one adds an undefined symbol, or a whole `DT_NEEDED` entry | | `Makefile`'s `LIBS_REAL` and the link rule that uses it | a new `-l` is a new hard `DT_NEEDED` | @@ -163,9 +163,9 @@ grade an ELF at all. git -C diff --stat HEAD # or the range under review git -C diff HEAD -- rust-modules/base/src/dynlib.rs rust-modules/media-codecs/src/ffi.rs rust-modules/media-codecs/src/venc.rs \ rust-modules/net/src/net.rs rust-modules/net/src/curlio.rs src/starfish.c src/video_plane.c src/starfish.h \ - rust-modules/platform/src/webos.rs rust-modules/platform/src/webos/ls2/uri.rs Makefile \ + rust-modules/os/src/webos.rs rust-modules/os/src/webos/ls2/uri.rs Makefile \ ci/expected-dt-needed.txt ci/expected-dt-needed-uri.txt -grep -rn '#\[link\|extern "C"\|__asm__("' rust-modules/src rust-modules/media/src rust-modules/play-feed/src rust-modules/play-uri/src rust-modules/platform/src rust-modules/media-codecs/src rust-modules/net/src src # against the diff, not the tree +grep -rn '#\[link\|extern "C"\|__asm__("' rust-modules/src rust-modules/media/src rust-modules/play-feed/src rust-modules/play-uri/src rust-modules/os/src rust-modules/media-codecs/src rust-modules/net/src src # against the diff, not the tree ``` ### 1. Decide, out loud, whether you are grading an ELF or grading source diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md new file mode 100644 index 0000000000..8e57f72960 --- /dev/null +++ b/.agents/skills/review-pr/SKILL.md @@ -0,0 +1,146 @@ +--- +name: review-pr +description: > + Review someone's pull request locally and post the review from the owner's own GitHub account, + after the owner has read the draft: "review #N", "review this PR", "check PR N", "what do you + think of #N", "post a review on N", "final review", and any external contributor's PR. Reads the + whole conversation and CI first, analyses with the repo's `pr-reviewer` agent (plus the tests and + `fw-compat-reviewer` when the diff needs them), drafts in a low-noise maintainer style (`lgtm` + or a short numbered list, findings inline), and posts one formal GitHub review only on the + owner's click. Use it instead of the `@claude` GitHub bot when the PR is from a fork and matters, + when tests have to run, or when the review should be the owner's. For a review of your OWN branch + before opening a PR, run `pr-reviewer` directly; this skill is for reviewing a PR that exists. +--- + +# review-pr: a local review, posted as the owner + +The workflow and the writing rules follow umputun's review skill +([umputun/cc-thingz](https://github.com/umputun/cc-thingz), `plugins/review`), chosen by the owner +because it knows about bot noise. The analysis is this repo's own: `pr-reviewer` reviews against +AGENTS.md's working rules (read from the base), `docs/review-checklist.md` and the module guides, +and `tools/review-eval.py` grades it against past PRs whose bugs are known. Do not replace it with a +generic reviewer prompt; a change to it is measured with `review-eval.py` first. + +The `@claude` bot (`.github/workflows/claude.yml`) is the quick first pass on every thread. This +skill is the deep one: it can run tests and the repo's reviewers, and its review counts as the owner's. + +## 1. Context, before reading any code + +```bash +gh pr view N --json number,title,body,author,state,isDraft,baseRefName,headRefName,headRefOid,\ +headRepositoryOwner,isCrossRepository,additions,deletions,changedFiles,files,mergeable,mergeStateStatus +gh api repos/{owner}/{repo}/issues/N/comments --jq '.[] | "[\(.user.login)] \(.body)"' +gh api repos/{owner}/{repo}/pulls/N/comments --jq '.[] | "[\(.user.login) on \(.path):\(.line // .original_line)] \(.body)"' +gh api repos/{owner}/{repo}/pulls/N/reviews --jq '.[] | "[\(.user.login) - \(.state)] \(.body)"' +gh pr checks N +``` + +Summarize for yourself: what is already resolved, what is still open, what the OWNER already said +(never repeat it), and what bots found (Copilot, the `@claude` bot, Codex). A bot finding goes into +the draft only after you have checked it in the code. A CONFLICTING or BEHIND PR explains odd +"deletions" in the diff; say so early. + +Then ask the owner once (AskUserQuestion): **Full** (worktree, `pr-reviewer`, tests when allowed) +or **Quick** (diff only). Quick skips to step 4 with what `gh pr diff N` shows. + +## 2. Worktree (never switch any checkout's branch) + +```bash +git fetch origin "pull/N/head:refs/remotes/pr/N" && git fetch origin main +git worktree add --detach ".claude/worktrees/review-N" "refs/remotes/pr/N" +``` + +`gh pr checkout` moves a checkout's branch: do not use it. The worktree goes away in step 6. + +## 3. Analysis + +**`pr-reviewer`** (Agent tool, `subagent_type: pr-reviewer`), on `origin/main...refs/remotes/pr/N`, +run from the worktree. Hand it the context from step 1 (resolved points, the owner's earlier +comments, open questions) so it does not re-raise them. Its findings carry `file:line`, a severity +and a fix; keep the full head SHA its report names. + +**`fw-compat-reviewer`** too when `pr-reviewer` recommends it (FFI, linkage, `dynlib!`, Starfish, +ACB, curl, FFmpeg). + +**Tests: who wrote the code decides.** + +- The author has write access (`gh api repos/{owner}/{repo}/collaborators/AUTHOR/permission`): + pick the tier with the `which-tier` skill and run it in the worktree (`make test-crate C=...`, + `make test-hostsim ...`). Never `make check` in the foreground; it can queue for a long time. +- An outside contributor (a fork, no write access): running their tests runs THEIR code on this + Mac, next to the owner's tokens, `~/.config/plxnative/` and the TV. Read CI's results instead + (`gh pr checks N`; a fork's CI holds no secrets). Run anything locally only after you have read + every changed build input (`build.rs`, `Makefile`, `Cargo.toml`, `ci/`, `tests/`, `tools/`, any + script the tests call) and the owner has said yes for this PR. + +**Also judge**, as umputun's skill does: over-engineering (name the simpler thing), code that does +not match the patterns around it (AGENTS.md rule 1: a shared mechanism exists), and scope creep. +Sort every file as core, supporting, related cleanup or unrelated; unrelated and risky is a finding, +an unrelated lint fix is not. + +Show the owner the condensed findings, then ask each open design question one at a time before +drafting. Their answer goes into the draft as their decision. + +## 4. The draft + +Findings that sit on a line become **inline comments**, one or two sentences each, with a +`suggestion` block when the fix is small and certain. The **body** is: + +- `lgtm` when nothing is wrong, or +- a short numbered list of what is not tied to a line (failing CI, a question, scope creep), each + with `file:line`, then at most one closing line (`otherwise looks good`). + +Writing rules (umputun's `writing-style`): casual, lowercase is fine, direct; state an opinion +instead of hedging, say "not sure" when you are not. Never restate what the PR does: the author +knows. No headings, no praise, no "great work", no sign-off, no "let me know". None of: +comprehensive, robust, leverage, utilize, facilitate, seamless, "it's worth noting", "in order to", +"additionally", "furthermore". Code in a suggestion handles its errors. Severity words (BLOCKER, +MAJOR) stay out of the comment; a real bug reads as one plainly ("this accepts `wss://v1/ws`"). + +Show the whole draft (body and each inline comment with its `path:line`) as one text block, then +ask (AskUserQuestion): **Comment** / **Request changes** / **Approve** / **Edit** / **Cancel**. +Nothing is posted without that answer, every time: a review on someone's PR is the owner speaking. + +## 5. Post one review + +One formal review, the inline comments attached, pinned to the commit that was reviewed. Write it +to a file and send it; never put the text on the command line. + +```bash +cat > "$TMPDIR/review-N.json" <<'JSON' +{ + "commit_id": "", + "event": "COMMENT", + "body": "", + "comments": [ + {"path": "rust-modules/owp/src/relays.rs", "line": 32, "side": "RIGHT", "body": ""} + ] +} +JSON +gh api -X POST "repos/{owner}/{repo}/pulls/N/reviews" --input "$TMPDIR/review-N.json" +``` + +`event` is `COMMENT`, `REQUEST_CHANGES` or `APPROVE` as the owner chose. A `line` must be in the +diff on that side, or GitHub refuses the whole review (422); move such a comment into the body. +The head moved since the review (`gh pr view N --json headRefOid`): say so and re-review, do not +post findings about code that is no longer there. The repo is public: never quote a value from a +gitignored private file (AGENTS.md); outbound-guard scans the file too. + +Record what `pr-reviewer` found on that SHA, so the landing gate reads it: + +```bash +tools/pr-land.py reviewed N --sha --blockers B --majors M --minors K +``` + +An **Approve** is not a merge. Landing goes through the `land-pr` skill (`tools/pr-land.py`, +squash only) and needs the owner's authorization to merge, which an approval is not. + +## 6. Clean up + +```bash +git worktree remove ".claude/worktrees/review-N" && git update-ref -d "refs/remotes/pr/N" +``` + +Do it after the review is posted or cancelled, not before: follow-up questions need the worktree. +A worktree with build output in it (a test run) goes with `git worktree remove --force` only after +`git -C .claude/worktrees/review-N status --short` shows nothing but ignored files. diff --git a/.agents/skills/which-tier/SKILL.md b/.agents/skills/which-tier/SKILL.md index e1794a4c53..9596d40b60 100644 --- a/.agents/skills/which-tier/SKILL.md +++ b/.agents/skills/which-tier/SKILL.md @@ -86,7 +86,7 @@ but a photograph could show it (`gfx.rs`, at the `glBlendFuncSeparate` call). ### Tier 1 — `make check` -`cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens`, preceded by `make lint` (three **named** clippy lints — +`cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp`, preceded by `make lint` (three **named** clippy lints — `ifs_same_cond`, `same_functions_in_if_condition`, `if_same_then_else` — the shadowed-branch gate), and followed by **three** host checks that are easy to forget are in here: `python3 ci/flavor.py --selftest` (the flavour transform, whose central assertion is that the STABLE transform is the @@ -114,7 +114,7 @@ lock.) Do not write a new number here: measure it if you need one — this file Count it yourself if you need the number: ```sh -cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -- --list | grep -c ': test' +cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp -- --list | grep -c ': test' ``` **Run it on the pinned toolchain.** `make check` uses `cargo +$(RUST_TOOLCHAIN)`, the `channel` of diff --git a/.claude/hooks/release-config-check-test.py b/.claude/hooks/release-config-check-test.py index dab6e05dad..134742b1a2 100755 --- a/.claude/hooks/release-config-check-test.py +++ b/.claude/hooks/release-config-check-test.py @@ -66,7 +66,7 @@ def edit(path, tool="Edit", key="file_path", **extra): (FIRE, "Write", edit("/repo/rust-modules/src/dev.rs", tool="Write"), ROOT), (FIRE, "a layer crate's source", edit("/repo/rust-modules/base/src/paths.rs"), ROOT), (FIRE, "the machine layer crate's source", edit("/repo/rust-modules/machine/src/idle.rs"), ROOT), - (FIRE, "the platform layer crate's source", edit("/repo/rust-modules/platform/src/webos.rs"), ROOT), + (FIRE, "the os layer crate's source", edit("/repo/rust-modules/os/src/webos.rs"), ROOT), (FIRE, "the gfx layer crate's source", edit("/repo/rust-modules/gfx/src/gfx.rs"), ROOT), (FIRE, "the net layer crate's source", edit("/repo/rust-modules/net/src/net.rs"), ROOT), (FIRE, "the ui layer crate's source", edit("/repo/rust-modules/ui/src/widgets.rs"), ROOT), diff --git a/.claude/hooks/release-config-check.py b/.claude/hooks/release-config-check.py index 84f33b3d98..434e61775f 100755 --- a/.claude/hooks/release-config-check.py +++ b/.claude/hooks/release-config-check.py @@ -273,7 +273,7 @@ def rust_src_target(payload, root, cwd=None): src = os.path.realpath(os.path.join(root, "rust-modules", "src")) # The layer crates split out of `src` (docs/module-layers.md) are compiled by the same # `cargo check --lib` as a dependency, so an edit there is a release-configuration risk too. - layer_srcs = [os.path.realpath(os.path.join(root, "rust-modules", layer, "src")) for layer in ("base", "machine", "net", "platform", "gfx", "ui", "plex", "telemetry", "data", "session", "media", "appkit", "screens")] + layer_srcs = [os.path.realpath(os.path.join(root, "rust-modules", layer, "src")) for layer in ("base", "machine", "net", "os", "gfx", "ui", "plex", "telemetry", "data", "session", "media", "appkit", "screens")] if not any(path.startswith(s + os.sep) for s in [src] + layer_srcs): return None # `--lib` compiles no bin target, and `sim.rs` needs `hostsim`, which the release set never has. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 245d7abf92..b3971cade8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,7 +259,7 @@ jobs: # (`cargo metadata` resolves; it compiles nothing), plus an informational line count. # The binary-size budget runs in cross-build, where the binary exists. Limits and how to # raise one deliberately: ci/build-budgets.json, docs/agent-reference.md. - run: python3 ci/check-build-budgets.py --graph --src rust-modules/src --src rust-modules/base/src --src rust-modules/machine/src --src rust-modules/net/src --src rust-modules/platform/src --src rust-modules/gfx/src --src rust-modules/ui/src --src rust-modules/plex/src --src rust-modules/telemetry/src --src rust-modules/data/src --src rust-modules/session/src --src rust-modules/media/src --src rust-modules/playback-contract/src --src rust-modules/media-codecs/src --src rust-modules/play-feed/src --src rust-modules/play-uri/src --src rust-modules/appkit/src --src rust-modules/screens/src + run: python3 ci/check-build-budgets.py --graph --src rust-modules/src --src rust-modules/base/src --src rust-modules/machine/src --src rust-modules/net/src --src rust-modules/os/src --src rust-modules/gfx/src --src rust-modules/ui/src --src rust-modules/plex/src --src rust-modules/telemetry/src --src rust-modules/data/src --src rust-modules/session/src --src rust-modules/media/src --src rust-modules/playback-contract/src --src rust-modules/media-codecs/src --src rust-modules/play-feed/src --src rust-modules/play-uri/src --src rust-modules/appkit/src --src rust-modules/screens/src --src rust-modules/owp/src - name: Third-party notices vs the ARM runtime graph # `make check` runs only the OFFLINE half of this (ci/gen-third-party-notices.py --check), which @@ -309,7 +309,7 @@ jobs: # for plxnative-modules both ways), so the `cargo test --lib` below finds everything built # and this step is where the compile happens, not an extra one. The upload below carries it. shell: bash - run: cd rust-modules && cargo "+$RUST_TOOLCHAIN" test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --no-run --timings + run: cd rust-modules && cargo "+$RUST_TOOLCHAIN" test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --no-run --timings - name: make check-cargo-unit-default # Teed to a file so the size step below can read the `test result:` lines this run already diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index a6ab8f7ff8..6da669fea7 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -3,8 +3,12 @@ name: Claude # Answers `@claude` in an issue, a pull request comment, an inline review comment or a review body, # with the Claude Code GitHub Action (https://code.claude.com/docs/en/github-actions). Its main job is # reviewing pull requests, including ones from outside contributors' forks. It runs Claude Fable (the -# `fable` alias: the newest Fable the action's Claude Code knows). `--append-system-prompt` sets the -# tone: findings as inline review comments, and a short, casual summary comment. +# `fable` alias: the newest Fable the action's Claude Code knows). `--append-system-prompt` sets how it +# reviews, after umputun's review skill (github.com/umputun/cc-thingz, plugins/review): read the whole +# conversation first and never repeat a settled point, diff against main, read CI instead of running +# tests, findings inline, and a summary that is `lgtm` or a short numbered list, with none of the usual +# bot noise. Read-only git (`git fetch origin`, `git diff`, `git log`, `git show`) is allowed in both +# jobs for that diff: Fable runs without auto mode, so anything not allowed is refused. # # TWO JOBS. `route` decides whether the thread is a pull request from a fork, from GitHub's own record # of the head repository, and nothing else; then exactly one of these runs: @@ -133,10 +137,11 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} claude_args: >- --model fable - --append-system-prompt "Write like a teammate on GitHub: short, casual, plain words. Put each finding on the line it is about as an inline review comment, one or two sentences, with a suggestion block when the fix is small. Keep the summary comment to a few lines: a one-line verdict, then at most a few bullets for what is not tied to a line. No headings, no restating the PR, no list of files you read, no praise. If nothing needs changing, say so in one line." + --append-system-prompt "Review like a terse maintainer. First read the whole conversation, the earlier inline comments and any bot reviews: never raise a point that was already resolved or that a maintainer already made, and keep a bot finding only if you checked it yourself. To see the whole change, run git fetch origin main (git fetch origin --deepen=200 if there is no merge base), then git diff origin/main...HEAD. Read the CI results of the pull request instead of running tests. Look for real bugs, missing error handling, code that does not match the patterns around it, over-engineering (say what simpler thing would do), and changes unrelated to the purpose of the pull request. Put each finding inline on its line, one or two sentences, with a suggestion block when the fix is small. Summary comment: lgtm when nothing is wrong, otherwise a short numbered list of what is not tied to a line, with file:line. Casual tone, lowercase is fine. Never restate what the pull request does. No headings, no praise, no list of files you read, no sign-off, no filler, and none of these words: comprehensive, robust, leverage, utilize, facilitate, seamless, it is worth noting." --settings '{"disableAllHooks":true}' --disallowedTools "Bash(git tag:*)" "Bash(git push --tags:*)" --allowedTools "mcp__github_inline_comment__create_inline_comment" + "Bash(git fetch origin:*)" "Bash(git diff:*)" "Bash(git log:*)" "Bash(git show:*)" fork: needs: route @@ -177,8 +182,9 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} claude_args: >- --model fable - --append-system-prompt "Write like a teammate on GitHub: short, casual, plain words. Put each finding on the line it is about as an inline review comment, one or two sentences, with a suggestion block when the fix is small. Keep the summary comment to a few lines: a one-line verdict, then at most a few bullets for what is not tied to a line. No headings, no restating the PR, no list of files you read, no praise. If nothing needs changing, say so in one line." + --append-system-prompt "Review like a terse maintainer. First read the whole conversation, the earlier inline comments and any bot reviews: never raise a point that was already resolved or that a maintainer already made, and keep a bot finding only if you checked it yourself. To see the whole change, run git fetch origin main (git fetch origin --deepen=200 if there is no merge base), then git diff origin/main...HEAD. Read the CI results of the pull request instead of running tests. Look for real bugs, missing error handling, code that does not match the patterns around it, over-engineering (say what simpler thing would do), and changes unrelated to the purpose of the pull request. Put each finding inline on its line, one or two sentences, with a suggestion block when the fix is small. Summary comment: lgtm when nothing is wrong, otherwise a short numbered list of what is not tied to a line, with file:line. Casual tone, lowercase is fine. Never restate what the pull request does. No headings, no praise, no list of files you read, no sign-off, no filler, and none of these words: comprehensive, robust, leverage, utilize, facilitate, seamless, it is worth noting." --settings '{"disableAllHooks":true,"disableSkillShellExecution":true}' --disallowedTools "Skill" "Agent" "Task" "Bash(curl:*)" "Bash(wget:*)" "Bash(gh:*)" "Bash(git push:*)" "Bash(git tag:*)" "Bash(tools/:*)" "Bash(./tools/:*)" "Read(//proc/**)" --allowedTools "mcp__github_inline_comment__create_inline_comment" + "Bash(git fetch origin:*)" "Bash(git diff:*)" "Bash(git log:*)" "Bash(git show:*)" diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 7bd59fdbdc..c79233d7a5 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -1,7 +1,8 @@ name: Fuzz the HUD parsers # The `cargo fuzz` package in `fuzz/` (docs/hud-plugins.md, "Fuzzing"): one libFuzzer target over each parser -# a HUD package or the registry reaches, and one over the WebSocket codec (`plx_net::ws`). It is not part of +# a HUD package or the registry reaches, one over the WebSocket codec (`plx_net::ws`) and one over the Open +# Watch Party reader (`plx_owp::json`). It is not part of # the rust-modules workspace, so nothing in `ci.yml` # compiles it; this workflow is what keeps it from rotting, and the only place it is fuzzed for longer than # a smoke test. @@ -50,6 +51,8 @@ on: - 'rust-modules/net/src/ws/**' - 'rust-modules/base/src/sha1.rs' - 'rust-modules/base/src/b64.rs' + - 'rust-modules/owp/src/**' + - 'rust-modules/owp/fixtures/**' - 'rust-modules/build_support/host_link.rs' - 'rust-modules/Cargo.lock' - 'site/hud/schema/**' @@ -59,11 +62,11 @@ on: workflow_dispatch: inputs: secs: - description: 'Seconds per target (9 targets run one after another; the step stops at 100 minutes)' + description: 'Seconds per target (10 targets run one after another; the step stops at 100 minutes)' type: string default: '300' target: - description: 'One target (admit, bundle_read, archive_read, svg_check, address_parse, catalog_parse, catalog_verify, catalog_cache, ws_frame); empty runs all' + description: 'One target (admit, bundle_read, archive_read, svg_check, address_parse, catalog_parse, catalog_verify, catalog_cache, ws_frame, owp_json); empty runs all' type: string default: '' diff --git a/.github/workflows/jellyfin.yml b/.github/workflows/jellyfin.yml index e7fbfae42f..523a769b7b 100644 --- a/.github/workflows/jellyfin.yml +++ b/.github/workflows/jellyfin.yml @@ -12,7 +12,7 @@ on: - 'rust-modules/jellyfin/**' - 'rust-modules/plex/**' - 'rust-modules/base/**' - - 'rust-modules/platform/**' + - 'rust-modules/os/**' - 'rust-modules/net/**' - 'rust-modules/Cargo.toml' - 'rust-modules/Cargo.lock' @@ -24,7 +24,7 @@ on: - 'rust-modules/jellyfin/**' - 'rust-modules/plex/**' - 'rust-modules/base/**' - - 'rust-modules/platform/**' + - 'rust-modules/os/**' - 'rust-modules/net/**' - 'rust-modules/Cargo.toml' - 'rust-modules/Cargo.lock' @@ -65,7 +65,7 @@ jobs: *) echo "::warning::TMDB did not answer the key check ($status)" ;; esac - # plx_jellyfin depends on plx_plex, plx_base, plx_platform and plx_net only, none of which + # plx_jellyfin depends on plx_plex, plx_base, plx_os and plx_net only, none of which # links SDL, so the desktop libraries are not installed. - uses: ./.github/actions/host-rust with: diff --git a/AGENTS.md b/AGENTS.md index a1964f2876..6d049e5be1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -133,7 +133,7 @@ the macOS simulator are valuable, but they cannot prove every device behavior. `ci/module-layers.ini` declares the crates `rust-modules/src` is being split into, and `ci/check-module-layers.py` (in `make check`) fails on a reference that names a layer its own layer may not use, on a module placed in no layer, and on a reference from outside - `[port webos]` to `webos`, `keymanager`, `system` or `port`. Fix the reference + `[platform webos]` to `webos`, `keymanager`, `system` or `port`. Fix the reference (`docs/module-layers.md` says where code belongs and how to cut an upward name) instead of adding a (file, member) pair to `ci/allow/layers.txt`, which is empty and only shrinks. - **Logic never performs IO.** A machine (a screen, a `data/` store, the session owner, the player's diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3d4da5b3f..93c041320e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,9 +6,10 @@ about Jellyfin (the player, the interface, the TV integration) belongs in PlxNat there, and FinNative picks it up when it next merges PlxNative. New contributions to FinNative are offered under GPL-3.0-or-later, the licence of PlxNative and of -FinNative's changes to it, without copyright assignment. Retain existing third-party notices and -identify external code, its source revision, license and modifications. Do not submit code whose -redistribution rights you cannot establish. +FinNative's changes to it, without copyright assignment; to `rust-modules/owp/` (`plx_owp`), under +Apache-2.0, as `LICENSING.md` says. Retain existing third-party notices and identify external code, +its source revision, license and modifications. Do not submit code whose redistribution rights you +cannot establish. Please include a `Signed-off-by: Your Name ` trailer certifying the [Developer Certificate of Origin 1.1](https://developercertificate.org/). This records your right diff --git a/LICENSING.md b/LICENSING.md index c97ee0f7b1..f738a765f3 100644 --- a/LICENSING.md +++ b/LICENSING.md @@ -10,6 +10,8 @@ from other Jellyfin clients is listed in `THIRD-PARTY-NOTICES.md`, section 2.8. Copyright (c) 2026 Gleb Linnik and contributors. PlxNative's own code is licensed under the GNU General Public License, version 3 or (at your option) any later version: **GPL-3.0-or-later**. The complete license is in `LICENSE`. +The `plx_owp` crate (`rust-modules/owp/`) is the exception: it is licensed under **Apache-2.0**, like +Open Watch Party, so it can be used on its own. That license is in `licenses/Apache-2.0.txt`. There is no warranty, to the extent permitted by applicable law. You may use, modify and redistribute this software, including selling copies, under those terms. diff --git a/Makefile b/Makefile index 3b53467491..0ccf832027 100644 --- a/Makefile +++ b/Makefile @@ -530,7 +530,7 @@ ARM_PROFILE_FLAG = $(if $(filter release,$(ARM_PROFILE)),--release,--profile $(A # HOST_THREADS -- OPT-IN: rustc's PARALLEL FRONT END for the local host test builds (`-Zthreads=N`). # -# The crate stack is a chain (base -> platform -> ui/plex -> data/session -> media -> appkit -> +# The crate stack is a chain (base -> os -> ui/plex -> data/session -> media -> appkit -> # screens -> app), so cargo has little to run side by side, and the front end (parse, type-check, # borrow-check) is single-threaded per crate by default. Measured 2026-10-05 on nightly, Apple M4 # (10 cores), `make build-bench` edit-rebuild rows, medians of 5, non-incremental: plx_base leaf @@ -1016,7 +1016,7 @@ $(FFABI_STAMP): ci/ffabi-assert.c $(FFMPEG_INC)/libavformat/avformat.h Makefile # rule would leave every later `make` linking a library built by the OLD one. Cargo's own # `rerun-if-changed` cannot save that — it is only consulted when make decides to invoke cargo at # all, and this target is an ordinary timestamp comparison. -RUST_INPUTS := $(shell find rust-modules/src rust-modules/base rust-modules/machine rust-modules/net rust-modules/platform rust-modules/gfx rust-modules/ui rust-modules/plex rust-modules/jellyfin rust-modules/telemetry rust-modules/data rust-modules/session rust-modules/media rust-modules/playback-contract rust-modules/play-uri rust-modules/play-feed rust-modules/media-codecs rust-modules/appkit rust-modules/screens rust-modules/build_support locales locales-finnative assets -type f 2>/dev/null) +RUST_INPUTS := $(shell find rust-modules/src rust-modules/base rust-modules/machine rust-modules/net rust-modules/os rust-modules/gfx rust-modules/ui rust-modules/plex rust-modules/jellyfin rust-modules/telemetry rust-modules/data rust-modules/session rust-modules/media rust-modules/playback-contract rust-modules/play-uri rust-modules/play-feed rust-modules/media-codecs rust-modules/appkit rust-modules/screens rust-modules/build_support locales locales-finnative assets -type f 2>/dev/null) $(RUST_LIB): LICENSE $(RUST_INPUTS) rust-modules/Cargo.toml rust-modules/Cargo.lock rust-modules/build.rs ci/install-identities.json rust-modules/.cargo/config.toml Makefile ci/check-staticlib-artifact.py $(FFABI_STAMP) @# BEFORE the mkdir: the seed is only ever cloned into a target dir that does not exist yet. $(CARGO_SEED) restore $(RUST_TDIR) rust-modules/$(RUST_TDIR) @@ -1051,11 +1051,11 @@ $(RUST_LIB): LICENSE $(RUST_INPUTS) rust-modules/Cargo.toml rust-modules/Cargo.l STORAGE_TDIR = $(RUST_TDIR)-storage # The helper is its own cargo package (rust-modules/storage) that does NOT depend on the app crate, # so the `cargo rustc -p plxnative-storage` below compiles only it, not the application library. What -# it does read of the platform layer crate is the handful of files it shares by `#[path]` -# (platform/src/storage_service/ and platform/src/storage/state.rs) and the install-identity +# it does read of the os layer crate is the handful of files it shares by `#[path]` +# (os/src/storage_service/ and os/src/storage/state.rs) and the install-identity # generator in build_support/; that is all it names here, so an edit to the UI no longer relinks it. `ci/test_storage_package_isolated.py` holds the # "no app library" line. -STORAGE_INPUTS := $(shell find rust-modules/storage rust-modules/build_support rust-modules/platform/src/storage_service -type f 2>/dev/null) rust-modules/platform/src/storage/state.rs rust-modules/.cargo/config.toml +STORAGE_INPUTS := $(shell find rust-modules/storage rust-modules/build_support rust-modules/os/src/storage_service -type f 2>/dev/null) rust-modules/os/src/storage/state.rs rust-modules/.cargo/config.toml STORAGE_BIN = rust-modules/$(STORAGE_TDIR)/$(RUST_TARGET)/$(ARM_PROFILE)/plxnative-storage pkg/plxnative-storage: LICENSE $(STORAGE_INPUTS) rust-modules/Cargo.toml rust-modules/Cargo.lock ci/install-identities.json Makefile ci/arm-cc.py ci/check-link-evidence.py cd rust-modules && PATH="$$HOME/.cargo/bin:$$PATH" $(RUST_ENV) \ @@ -1558,8 +1558,9 @@ DISK_TREE = $(if $(CARGO_TARGET_DIR),$(if $(filter /%,$(CARGO_TARGET_DIR)),$(CAR DISK_NEED = test-fast test-crate: DISK_TREE = $(CURDIR)/rust-modules/$(TEST_FAST_TDIR) test-hostsim: DISK_TREE = $(CURDIR)/rust-modules/$(TEST_HOSTSIM_TDIR) -# The fuzz tree (ASan + coverage, release with debuginfo, nine binaries): 3.1 GiB measured after a cold build -# of the first eight; the ninth, `ws_frame`, adds 83 MiB (measured on Linux x86_64). +# The fuzz tree (ASan + coverage, release with debuginfo, ten binaries): 3.1 GiB measured after a cold build +# of the first eight; the ninth, `ws_frame`, adds 83 MiB, and the tenth, `owp_json`, 49 MiB with `plx_owp` +# (measured on Linux x86_64). fuzz-hud: DISK_TREE = $(CURDIR)/rust-modules/$(FUZZ_TDIR) fuzz-hud: DISK_NEED = 3.3 check-replay sim-macos: DISK_TREE = $(abspath $(SIM_TDIR)$(if $(LAB),-lab,)) @@ -1682,7 +1683,7 @@ check-cargo-lint: lint @# gate has nothing to reuse a cache for. No `pkg/lab.json` is involved — that file is `make @# LAB=1`'s requirement (a live session secret), not the compiler's. @set -e; cd rust-modules && CARGO_INCREMENTAL=0 PATH="$$HOME/.cargo/bin:$$PATH" \ - cargo +$(RUST_TOOLCHAIN) check --lib --tests -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --features lab-diagnostics + cargo +$(RUST_TOOLCHAIN) check --lib --tests -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --features lab-diagnostics @# And the demo-video dump build's pixel oracle, `placeholder-sentinel`: in no default set and @# built only by `make site-video-sim`, which no gate runs and which compiles no `plx_ui` tests, so @# this line is what keeps it compiling (its code AND its tests, `--tests`). `plx_ui` is the only @@ -1701,19 +1702,19 @@ check-cargo-lint: lint # `-p` lists in the recipes below (those stay literal because ci/test_ci_split.py greps for them); # ci/test_test_crate.py pins the two equal. UNIT_RUN = python3 ../tools/cargo-test-parallel.py -UNIT_SUITE = plxnative-modules plx_base plx_machine plx_platform plx_gfx plx_net plx_ui plx_plex plx_telemetry plx_data plx_session plx_media plx_playback_contract plx_play_uri plx_play_feed plx_media_codecs plx_appkit plx_screens +UNIT_SUITE = plxnative-modules plx_base plx_machine plx_os plx_gfx plx_net plx_ui plx_plex plx_telemetry plx_data plx_session plx_media plx_playback_contract plx_play_uri plx_play_feed plx_media_codecs plx_appkit plx_screens plx_owp # The `hostsim` pass runs only the crates that DECLARE a `hostsim` feature (HOSTSIM_SUITE, a subset of -# UNIT_SUITE in the same order; ci/test_test_crate.py pins both the subset and the recipe). The seven that -# do not (plx_net, plx_ui, plx_appkit, plx_screens, plx_media_codecs, plx_play_uri, plx_playback_contract) -# have no `feature = "hostsim"` in their source and the same test names in both passes (14 crates did in +# UNIT_SUITE in the same order; ci/test_test_crate.py pins both the subset and the recipe). The eight that +# do not (plx_net, plx_ui, plx_appkit, plx_screens, plx_media_codecs, plx_play_uri, plx_playback_contract, +# plx_owp) have no `feature = "hostsim"` in their source and the same test names in both passes (14 crates did in # CI run 43528579834; the three that differ are `plxnative-modules`, `plx_media` and `plx_play_feed`, # all kept). Their own test set is therefore identical in the two passes. The old second run did link -# their test binaries against hostsim-built `plx_base`, `plx_gfx`, `plx_platform`, `plx_media` and +# their test binaries against hostsim-built `plx_base`, `plx_gfx`, `plx_os`, `plx_media` and # `plx_play_feed` (steerable `ENV_STEERABLE` paths, larger glyph-cache sizes, `ffi_host` present), but # none of their tests observes those dependency-side differences; the guard does not check that, it # checks that the crate declares no `hostsim` feature and has no `feature = "hostsim"` in its src, and # fails when one gains either, which is the moment it must join the list. -HOSTSIM_SUITE = plxnative-modules plx_base plx_machine plx_platform plx_gfx plx_plex plx_telemetry plx_data plx_session plx_media plx_play_feed +HOSTSIM_SUITE = plxnative-modules plx_base plx_machine plx_os plx_gfx plx_plex plx_telemetry plx_data plx_session plx_media plx_play_feed # The default-feature unit suite and everything that drives cargo through ci/ self-tests. check-cargo-unit-default: @@ -1742,7 +1743,7 @@ check-cargo-unit-default: cd rust-modules && PATH="$$HOME/.cargo/bin:$$PATH" PLXNATIVE_RUNTIME_DIR="$$d" \ $(TELEMETRY_ENV) \ $(HOST_ENV) \ - $(UNIT_RUN) -- cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens + $(UNIT_RUN) -- cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp RUST_TOOLCHAIN=$(RUST_TOOLCHAIN) python3 ci/test_storage_service_package.py cd rust-modules && PATH="$$HOME/.cargo/bin:$$PATH" cargo +$(RUST_TOOLCHAIN) test -p plxnative-storage --bin plxnative-storage @# The helper is its own package, so building it compiles no copy of the app library; this reads @@ -1776,7 +1777,7 @@ check-cargo-unit-hostsim: cd rust-modules && PATH="$$HOME/.cargo/bin:$$PATH" PLXNATIVE_RUNTIME_DIR="$$d" \ $(TELEMETRY_ENV) \ $(HOST_ENV) \ - $(UNIT_RUN) -- cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_play_feed --features hostsim + $(UNIT_RUN) -- cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_play_feed --features hostsim # OPT-IN incremental inner loop: the default-feature unit suite (the same `cargo test --lib` as # `check-cargo-unit-default`, same throwaway runtime root and telemetry env) with @@ -1800,7 +1801,7 @@ test-fast: PATH="$$HOME/.cargo/bin:$$PATH" PLXNATIVE_RUNTIME_DIR="$$d" \ $(TELEMETRY_ENV) \ $(HOST_ENV) \ - $(UNIT_RUN) $(if $(T),--filter '$(T)') -- cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens + $(UNIT_RUN) $(if $(T),--filter '$(T)') -- cargo +$(RUST_TOOLCHAIN) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp # `make test-crate C=plx_ui [T=filter] [DEPS=1]` -- build and run ONLY the named crate's lib tests, in # the same incremental `$(TEST_FAST_TDIR)` tree and with the same flags as `test-fast`, so the two diff --git a/README.md b/README.md index 441ff3613a..2a640b2cbf 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,9 @@ The default `FLAVOR=debug` package installs as `io.github.tiper.finnative.debug` ## Licence -GPL-3.0-or-later, the same as PlxNative. [`LICENSE`](LICENSE) is the unmodified GPLv3 text and -[`LICENSING.md`](LICENSING.md) states the "or later" choice. +GPL-3.0-or-later, the same as PlxNative; `rust-modules/owp/` is Apache-2.0. [`LICENSE`](LICENSE) is +the unmodified GPLv3 text and [`LICENSING.md`](LICENSING.md) states the "or later" choice and the +Apache-2.0 crate. Jellyfin is a project of the Jellyfin team; Plex is a trademark of Plex, Inc.; LG and webOS are trademarks of LG Electronics. FinNative is not affiliated with or endorsed by any of them. diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md index b10d4b4d6f..1f2a4df18e 100644 --- a/THIRD-PARTY-NOTICES.md +++ b/THIRD-PARTY-NOTICES.md @@ -657,11 +657,20 @@ the GPL-3.0-or-later election. Also retain `licenses/GCC-exception-3.1.txt` and ## 6. Deliberately not listed -Two third-party components exist in the PlxNative source repository but are **not** part of this +Three third-party components exist in the PlxNative source repository but are **not** part of this package, and therefore carry no obligation discharged here: **libjpeg-turbo** -(`libturbojpeg.so.0`, copied to developer televisions by the development deploy step only) and +(`libturbojpeg.so.0`, copied to developer televisions by the development deploy step only), **jsmpeg** (a host-side development tool; `tools/stream-screen.py` downloads it at the upstream commit -`ci/dependencies.json` pins, so no copy of it is in the repository; its licence is `licenses/jsmpeg.txt`). Neither is present in the installed application. +`ci/dependencies.json` pins, so no copy of it is in the repository; its licence is `licenses/jsmpeg.txt`), and +the **Open Watch Party** conformance data described below. None of the three is present in the installed application. + +The Open Watch Party data in `rust-modules/owp/fixtures/` holds test vectors, +descriptor and `setMedia` examples and the public relay list, copied unchanged from +[edde746/openwatchparty](https://github.com/edde746/openwatchparty) at revision `d8c3c2abc753` +(Apache-2.0, its text in `rust-modules/owp/fixtures/LICENSE`, the file list and hashes in that +directory's `README.md`). The `plx_owp` tests read them; the application does not link `plx_owp`, so +none of it is installed. The relay list `relays.json` is compiled into `plx_owp` and moves to §2 when +the application links it. ## Source-only attribution diff --git a/TRADEMARKS.md b/TRADEMARKS.md index d15f098de1..f0ea886490 100644 --- a/TRADEMARKS.md +++ b/TRADEMARKS.md @@ -1,6 +1,7 @@ # Trademarks, brand assets, and non-affiliation -The [GPL-3.0-or-later grant](LICENSE) covers this project's own source code. This file covers the things a +The [GPL-3.0-or-later grant](LICENSE) covers this project's own source code, except the `plx_owp` crate, +which is Apache-2.0 ([`LICENSING.md`](LICENSING.md)). This file covers the things a licence grant does not: the marks that identify the project, and whose software this interoperates with. diff --git a/ci/allow/language-lists.txt b/ci/allow/language-lists.txt index 4350b93bd2..76b43e5512 100644 --- a/ci/allow/language-lists.txt +++ b/ci/allow/language-lists.txt @@ -1,6 +1,6 @@ # count: 5 # The files allowed to hold a hand-written list of several UI languages, one `pathreason` line each (ci/check-language-lists.py). -# Every other "each language" loop reads `plx_platform::i18n::SHIPPED`. An entry here is a PINNED, reviewed table: it iterates its own rows, a new language may add a row and is never forced to, and it must not fall back with `_ =>`. The gate compares this list to the tree as an exact set. +# Every other "each language" loop reads `plx_os::i18n::SHIPPED`. An entry here is a PINNED, reviewed table: it iterates its own rows, a new language may add a row and is never forced to, and it must not fall back with `_ =>`. The gate compares this list to the tree as an exact set. rust-modules/appkit/src/track_menu.rs ICU decimal plus unit per language and region (a reviewed spot check) rust-modules/data/src/browse/mod.rs reviewed per-language browse wording rust-modules/data/src/metadata_credits_tests.rs reviewed per-language credit wording diff --git a/ci/build-budgets.json b/ci/build-budgets.json index aecdf6c91b..d72fb5a550 100644 --- a/ci/build-budgets.json +++ b/ci/build-budgets.json @@ -48,7 +48,7 @@ "headroom": "+3" }, "source_lines": { - "what": "Lines of Rust under rust-modules/src, rust-modules/base/src, rust-modules/machine/src, rust-modules/net/src, rust-modules/platform/src, rust-modules/gfx/src, rust-modules/ui/src, rust-modules/plex/src, rust-modules/telemetry/src, rust-modules/data/src, rust-modules/session/src, rust-modules/media/src, rust-modules/playback-contract/src, rust-modules/media-codecs/src, rust-modules/play-feed/src, rust-modules/play-uri/src, rust-modules/appkit/src and rust-modules/screens/src (every .rs file). Informational: exceeding it warns and never fails, because a growing feature is not a build-health defect by itself.", + "what": "Lines of Rust under rust-modules/src, rust-modules/base/src, rust-modules/machine/src, rust-modules/net/src, rust-modules/os/src, rust-modules/gfx/src, rust-modules/ui/src, rust-modules/plex/src, rust-modules/telemetry/src, rust-modules/data/src, rust-modules/session/src, rust-modules/media/src, rust-modules/playback-contract/src, rust-modules/media-codecs/src, rust-modules/play-feed/src, rust-modules/play-uri/src, rust-modules/appkit/src, rust-modules/screens/src and rust-modules/owp/src (every .rs file). Informational: exceeding it warns and never fails, because a growing feature is not a build-health defect by itself.", "unit": "lines", "mode": "warn", "limit": 485000, diff --git a/ci/check-build-budgets.py b/ci/check-build-budgets.py index c69eb95491..6ea4444a9e 100755 --- a/ci/check-build-budgets.py +++ b/ci/check-build-budgets.py @@ -15,7 +15,7 @@ * binary_bytes the stripped binary `make ipk` stages (measured in the cross-build job) * packages_* third-party packages the app crate compiles for the ARM target * duplicate_versions_* crate names in more than one version on the normal-edge graph -* source_lines lines of Rust in rust-modules/src and every split-out layer crate (rust-modules/base/src, rust-modules/machine/src, rust-modules/net/src, rust-modules/platform/src, rust-modules/gfx/src, rust-modules/ui/src, rust-modules/plex/src, rust-modules/telemetry/src, rust-modules/data/src, rust-modules/session/src, rust-modules/media/src, rust-modules/playback-contract/src, rust-modules/media-codecs/src, rust-modules/play-feed/src, rust-modules/play-uri/src, rust-modules/appkit/src, rust-modules/screens/src); mode "warn", never fails +* source_lines lines of Rust in rust-modules/src and every split-out layer crate (rust-modules/base/src, rust-modules/machine/src, rust-modules/net/src, rust-modules/os/src, rust-modules/gfx/src, rust-modules/ui/src, rust-modules/plex/src, rust-modules/telemetry/src, rust-modules/data/src, rust-modules/session/src, rust-modules/media/src, rust-modules/playback-contract/src, rust-modules/media-codecs/src, rust-modules/play-feed/src, rust-modules/play-uri/src, rust-modules/appkit/src, rust-modules/screens/src, rust-modules/owp/src); mode "warn", never fails Exit status: 0 all within budget (warn-mode overruns print ::warning::), 1 a fail-mode budget is exceeded, 2 the budgets file or an input is unusable. @@ -243,7 +243,7 @@ def main(argv=None) -> int: ap.add_argument("--graph", action="store_true") ap.add_argument("--tree-default") ap.add_argument("--tree-no-default") - ap.add_argument("--src", action="append", help="a source directory to count; repeat for each crate (rust-modules/src, rust-modules/base/src, rust-modules/machine/src, rust-modules/net/src, rust-modules/platform/src, rust-modules/gfx/src, rust-modules/ui/src, rust-modules/plex/src, rust-modules/telemetry/src, rust-modules/data/src, rust-modules/session/src, rust-modules/media/src, rust-modules/playback-contract/src, rust-modules/media-codecs/src, rust-modules/play-feed/src, rust-modules/play-uri/src, rust-modules/appkit/src, rust-modules/screens/src)") + ap.add_argument("--src", action="append", help="a source directory to count; repeat for each crate (rust-modules/src, rust-modules/base/src, rust-modules/machine/src, rust-modules/net/src, rust-modules/os/src, rust-modules/gfx/src, rust-modules/ui/src, rust-modules/plex/src, rust-modules/telemetry/src, rust-modules/data/src, rust-modules/session/src, rust-modules/media/src, rust-modules/playback-contract/src, rust-modules/media-codecs/src, rust-modules/play-feed/src, rust-modules/play-uri/src, rust-modules/appkit/src, rust-modules/screens/src, rust-modules/owp/src)") args = ap.parse_args(argv) try: budgets = load_budgets(Path(args.budgets)) diff --git a/ci/check-deps.sh b/ci/check-deps.sh index f40ff7436b..8e448ca617 100755 --- a/ci/check-deps.sh +++ b/ci/check-deps.sh @@ -128,15 +128,15 @@ SRC=rust-modules/src # rules below that read the WHOLE tree read these too: moving a file into one must not move it out # of a gate. A rule scoped to a directory of $SRC (ui/, screens/, app/ ...) cannot reach a layer # below them and stays as it is, UNLESS the files it policed there were moved out: `machine` came -# from ui/, so the rules that read `ui/` read $SRC_MACHINE too, and `ui` is $SRC_UI now (docs/module-layers.md, Split 6). `platform` is the layer that held +# from ui/, so the rules that read `ui/` read $SRC_MACHINE too, and `ui` is $SRC_UI now (docs/module-layers.md, Split 6). `os` is the layer that held # `tv/` and `storage/`, and the rules that name a moved module by path (`crate::tv::window::`, -# `crate::storage::`) now spell it `plx_platform::`. `gfx` held `text.rs`, the one file the textmeasure +# `crate::storage::`) now spell it `plx_os::`. `gfx` held `text.rs`, the one file the textmeasure # rule exempts, and the rule's pattern now accepts `plx_gfx::text::`. `net` held the loopback fixtures # the `threads` gate skips as test code; they are `cfg(any(test, feature = "test-support"))` now, # which it accepts. SRC_BASE=rust-modules/base/src SRC_MACHINE=rust-modules/machine/src -SRC_PLATFORM=rust-modules/platform/src +SRC_OS=rust-modules/os/src SRC_GFX=rust-modules/gfx/src SRC_NET=rust-modules/net/src SRC_UI=rust-modules/ui/src @@ -151,6 +151,7 @@ SRC_PLAY_FEED=rust-modules/play-feed/src SRC_MEDIA_CODECS=rust-modules/media-codecs/src SRC_APPKIT=rust-modules/appkit/src SRC_SCREENS=rust-modules/screens/src +SRC_OWP=rust-modules/owp/src fails=0 fail() { echo "::error::check-deps: $*"; fails=$((fails+1)); } ok() { echo " ok — $*"; } @@ -336,7 +337,7 @@ $1|$2 wholly_test_files() { python3 ci/rust_test_modules.py "$SRC" python3 ci/rust_test_modules.py "$SRC_MACHINE" - python3 ci/rust_test_modules.py "$SRC_PLATFORM" + python3 ci/rust_test_modules.py "$SRC_OS" python3 ci/rust_test_modules.py "$SRC_GFX" python3 ci/rust_test_modules.py "$SRC_NET" python3 ci/rust_test_modules.py "$SRC_UI" @@ -351,6 +352,7 @@ wholly_test_files() { python3 ci/rust_test_modules.py "$SRC_MEDIA_CODECS" python3 ci/rust_test_modules.py "$SRC_APPKIT" python3 ci/rust_test_modules.py "$SRC_SCREENS" + python3 ci/rust_test_modules.py "$SRC_OWP" } # is_wholly_test : the `wholly_test` list as a builtin lookup. Three gates below asked this @@ -718,7 +720,7 @@ fi # metadata-owner # Wholly-test files (see `wholly_test_files`) are skipped like inline `#[cfg(test)]` blocks: a # test's reference colour maths is not logical state. if want libm; then -libm_lines=$(grep_code '\.(exp|ln|log|powf|powi|cbrt|sin|cos|tan|atan2|hypot|mul_add|sin_cos)\(' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" \ +libm_lines=$(grep_code '\.(exp|ln|log|powf|powi|cbrt|sin|cos|tan|atan2|hypot|mul_add|sin_cos)\(' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" \ | grep -vE '\.log\((&|")' | grep -v "^$SRC_MACHINE/motion.rs:") libm_bad=0 while IFS= read -r line; do @@ -730,14 +732,14 @@ done <<< "$libm_lines" if [ "$libm_bad" -eq 0 ]; then ok "libm"; else fail "libm: $libm_bad line(s) outside ci/allow/libm.txt"; fi fi # libm -want ticks && gate ticks 'SDL_GetTicks\(' "$SRC" "$SRC_BASE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" +want ticks && gate ticks 'SDL_GetTicks\(' "$SRC" "$SRC_BASE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" # Every data/session module is logic unless its exact reviewed IO/instrument file is in ports.ini. if want wall; then if python3 ci/check-ports.py; then ok "wall"; else fail "wall: outside exact ci/ports.ini files"; fi fi # wall if want fpflags; then -if grep -rnE 'fp-contract|fast-math|\+fma' rust-modules/Cargo.toml rust-modules/build.rs rust-modules/net/Cargo.toml rust-modules/plex/Cargo.toml rust-modules/telemetry/Cargo.toml rust-modules/data/Cargo.toml rust-modules/session/Cargo.toml rust-modules/media/Cargo.toml rust-modules/appkit/Cargo.toml rust-modules/screens/Cargo.toml rust-modules/platform/Cargo.toml rust-modules/platform/build.rs rust-modules/gfx/Cargo.toml rust-modules/gfx/build.rs rust-modules/ui/Cargo.toml rust-modules/ui/build.rs rust-modules/appkit/build.rs rust-modules/screens/build.rs rust-modules/storage/Cargo.toml rust-modules/storage/build.rs rust-modules/.cargo Makefile 2>/dev/null | grep -v '^[[:space:]]*#'; then +if grep -rnE 'fp-contract|fast-math|\+fma' rust-modules/Cargo.toml rust-modules/build.rs rust-modules/net/Cargo.toml rust-modules/plex/Cargo.toml rust-modules/telemetry/Cargo.toml rust-modules/data/Cargo.toml rust-modules/session/Cargo.toml rust-modules/media/Cargo.toml rust-modules/appkit/Cargo.toml rust-modules/screens/Cargo.toml rust-modules/os/Cargo.toml rust-modules/os/build.rs rust-modules/gfx/Cargo.toml rust-modules/gfx/build.rs rust-modules/ui/Cargo.toml rust-modules/ui/build.rs rust-modules/appkit/build.rs rust-modules/screens/build.rs rust-modules/storage/Cargo.toml rust-modules/storage/build.rs rust-modules/.cargo Makefile 2>/dev/null | grep -v '^[[:space:]]*#'; then fail "fpflags: a floating-point contraction flag is set (spec §4.2 assumes none)" else ok "fpflags"; fi fi # fpflags @@ -748,7 +750,7 @@ if [ "$n" -eq 1 ] && [ "$d" -eq 1 ]; then ok "present: one worker door"; else fa fi # present if want effect; then -if [ -n "$(grep_code '\bEffect::' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS")" ]; then fail "effect: \`Effect::\` is spelled (use Fx:: / AppFx::)"; else ok "effect"; fi +if [ -n "$(grep_code '\bEffect::' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP")" ]; then fail "effect: \`Effect::\` is spelled (use Fx:: / AppFx::)"; else ok "effect"; fi fi # effect # mutators: production lines of ui/, screens/ and app/ (everything before the file's first @@ -860,7 +862,7 @@ want nav && gate nav '(crate::ui|plx_ui)::nav::' "$SRC" "$SRC_UI" "$SRC_APPKIT" # Completed ownership migration: legacy publications and the old gate cannot return. if want ui-owner-legacy; then -ui_owner_hits=$(grep_code '(plx_ui|crate::ui)::press::|(plx_machine|crate)::idle::' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS") +ui_owner_hits=$(grep_code '(plx_ui|crate::ui)::press::|(plx_machine|crate)::idle::' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP") if [ -z "$ui_owner_hits" ]; then ok "ui-owner-legacy"; else printf '%s\n' "$ui_owner_hits" fail "ui-owner-legacy: retired global readers must not return" @@ -879,7 +881,7 @@ fi # ui-owner-files # Motion collectors may not own generic damage or a second process-global notification adapter. if want owned-damage; then -owned_damage_hits=$(grep_code 'motion::report::(invalidate|take_damage|select_damage|take_page_damage|OwnScope)' "$SRC" "$SRC_UI" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_DATA" "$SRC_PLEX" "$SRC_MEDIA" "$SRC_PLATFORM") +owned_damage_hits=$(grep_code 'motion::report::(invalidate|take_damage|select_damage|take_page_damage|OwnScope)' "$SRC" "$SRC_UI" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_DATA" "$SRC_PLEX" "$SRC_MEDIA" "$SRC_OS") report_adapter=$(grep_code '\bAtomic[A-Za-z0-9_]*\b|pub fn (invalidate|take_damage|select_damage|take_page_damage|present_dirty|wake)\b' "$SRC_MACHINE/motion/report.rs") if [ -z "$owned_damage_hits$report_adapter" ]; then ok "owned-damage"; else printf '%s\n%s\n' "$owned_damage_hits" "$report_adapter" @@ -955,12 +957,12 @@ fi # screen-runtime-io # `crate::{gfx,text,paths,task}`). A ui-owned sweep that needs the app's removal rule takes it as an # injected `fn` (`ui::rec::erase_owned_artifacts`). Zero, no allowlist. The wider table is not a # grep yet: ui/ still names other application modules, mostly from tests and dev instruments. -want uistorage && gate uistorage '(crate|super|plx_platform)::storage::' "$SRC_UI" "$SRC_MACHINE" +want uistorage && gate uistorage '(crate|super|plx_os)::storage::' "$SRC_UI" "$SRC_MACHINE" # legacypage: the word itself, anywhere under src — a doc that still describes the type is as much # a hit as a declaration, which is the point (nothing compiles the prose either). if want legacypage; then -legacy_hits=$(grep -rn --include='*.rs' 'LegacyPage' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" 2>/dev/null || true) +legacy_hits=$(grep -rn --include='*.rs' 'LegacyPage' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" 2>/dev/null || true) if [ -z "$legacy_hits" ]; then ok "legacypage"; else echo "$legacy_hits" | sed 's/^/ /' fail "legacypage: $(echo "$legacy_hits" | wc -l | tr -d ' ') mention(s) — the type is retired (§15.2)" @@ -1054,7 +1056,7 @@ fi # textmeasure # the documented intent (spec §4.2: the ONLY file licensed to touch a raw per-frame delta), not a # live carve-out. if want dt; then -dt_hits=$(grep_code 'idle::dt\(\)|(\+=|-=)\s*dt\b' "$SRC" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" | grep -v "^$SRC_MACHINE/motion.rs:") +dt_hits=$(grep_code 'idle::dt\(\)|(\+=|-=)\s*dt\b' "$SRC" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" | grep -v "^$SRC_MACHINE/motion.rs:") if [ -z "$dt_hits" ]; then ok "dt"; else echo "$dt_hits" | sed 's/^/ /' fail "dt: $(echo "$dt_hits" | wc -l | tr -d ' ') line(s) — see rule comment above" @@ -1083,7 +1085,7 @@ want hittest && gate_zero hittest 'pointer_focus\(|\b(failure_quality|icon|scrub # frame: the three privileged OS-primitive calls, ZERO-TOLERANCE outside `app/run.rs` (D4) — no # allowlist file, because there is exactly one legitimate home once D1 lands: `app/run.rs` is the # frame loop, and `app/bridge.rs`'s `Rig` impl delegates to `run::rig_opaque_route`/ -# `rig_clear_opaque_region` (a one-line pass-through) rather than naming `plx_platform::tv::window::` itself, +# `rig_clear_opaque_region` (a one-line pass-through) rather than naming `plx_os::tv::window::` itself, # which is what keeps this gate's text out of bridge.rs without splitting the `impl Rig # for Bridge` block (a trait's impl for a type is one syntactic unit; it carries two dozen other # methods beside these three). A self-test that spells two of the three call shapes as STRING @@ -1094,7 +1096,7 @@ want hittest && gate_zero hittest 'pointer_focus\(|\b(failure_quality|icon|scrub # double-quote-depth tracking `tmppath` below uses), rather than exempting files by name: an # actual call typed outside a string still fails this gate. `// `-prefixed comment lines (`app/run.rs` keeps one, describing where a call # used to live) are stripped the same way `grep_code` above does for every other rule. -frame_pat='(crate|plx_platform)::tv::window::(pump_bus|opaque_route|clear_opaque_region)\(' +frame_pat='(crate|plx_os)::tv::window::(pump_bus|opaque_route|clear_opaque_region)\(' if want frame; then frame_bad=0 while IFS= read -r f; do @@ -1111,7 +1113,7 @@ while IFS= read -r f; do # REMOVES matches, so a file with no raw hit cannot fail this gate — and running its `awk` plus a # `grep` over all 420 files, to reach the two that mention the shape, was the single most expensive # rule in this script (4.8 s of its 17 s). -done < <(grep -rlE --include='*.rs' "$frame_pat" "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" 2>/dev/null | sort) +done < <(grep -rlE --include='*.rs' "$frame_pat" "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" 2>/dev/null | sort) if [ "$frame_bad" -eq 0 ]; then ok "frame" else fail "frame: $frame_bad line(s) of a privileged OS-primitive call outside app/run.rs"; fi fi # frame @@ -1133,10 +1135,10 @@ while IFS= read -r line; do case "$p" in "$SRC_PLAY_FEED"/*|"$SRC_PLAY_URI"/*) case "$line" in *tv::sink::installed*|*tv::sink::display_installed*) ;; *) continue ;; esac ;; esac - case "$p" in "$SRC_MEDIA"/player/*|"$SRC_PLATFORM"/tv/*|"$SRC_PLATFORM"/tv.rs|"$SRC_PLATFORM"/webos/*|"$SRC"/port.rs|"$SRC"/app/adapters/backends.rs) continue ;; esac + case "$p" in "$SRC_MEDIA"/player/*|"$SRC_OS"/tv/*|"$SRC_OS"/tv.rs|"$SRC_OS"/webos/*|"$SRC"/port.rs|"$SRC"/app/adapters/backends.rs) continue ;; esac if is_wholly_test "$p"; then continue; fi echo " $line"; sink_bad=$((sink_bad+1)) -done < <(grep_code 'tv::sink::(installed|display_installed)|\b(VideoSink|DisplaySink)\b' "$SRC" "$SRC_PLATFORM" "$SRC_UI" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS") +done < <(grep_code 'tv::sink::(installed|display_installed)|\b(VideoSink|DisplaySink)\b' "$SRC" "$SRC_OS" "$SRC_UI" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP") if [ "$sink_bad" -eq 0 ]; then ok "sink" else fail "sink: $sink_bad line(s) naming the video sink outside playback execution, port.rs, tv.rs and tv/"; fi fi # sink @@ -1229,7 +1231,7 @@ while IFS= read -r f; do { print NR":"$0; prev=$0 }' "$f" | grep -E "$pat" | grep -vE '^[0-9]+:\s*//' || true) # ...over the files that spell `spawn(` at all — a superset of both matched spellings, and the `awk` # below only drops `#[cfg(test)] mod` blocks, so the count is unchanged. -done < <(grep -rlE --include='*.rs' '\bspawn\(' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" 2>/dev/null | grep -v "^$SRC_BASE/task.rs\$" | sort) +done < <(grep -rlE --include='*.rs' '\bspawn\(' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" 2>/dev/null | grep -v "^$SRC_BASE/task.rs\$" | sort) threads_declared=$(sed -n 's/^# count: *//p' ci/allow/threads.txt | head -1) if [ "$threads_bad" -eq "${threads_declared:-0}" ]; then ok "threads" else fail "threads: $threads_bad line(s) outside ci/allow/threads.txt (declared count is exactly ${threads_declared:-0}, not a ceiling)"; fi @@ -1374,7 +1376,7 @@ EOF_STALE # `ci/ledger.awk` (the ledger machinery above). if want blocking; then blocking_sites=$( - grep -rlE --include='*.rs' 'allow_blocking' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" 2>/dev/null \ + grep -rlE --include='*.rs' 'allow_blocking' "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" 2>/dev/null \ | grep -v "^$SRC_BASE/task/blocking.rs\$" | sort \ | LG_MODE=call LG_SITE='(^|[^A-Za-z0-9_])allow_blocking\(' LG_DEF='fn[[:space:]]+allow_blocking\(' \ LG_REF='(^|[^A-Za-z0-9_])allow_blocking([^A-Za-z0-9_(]|$)' LG_REEXPORT_FILE="$SRC_BASE/task.rs" \ @@ -1399,13 +1401,13 @@ fi # blocking # lines of the machine it made pure. MACHINES is the scope of workers and globals; FORK_SCOPE is the # scope of forks: the whole of every crate that holds a machine (a fork anywhere in them is a test that # does not run the product's code), which is each crate MACHINES names a directory or file of, plus all -# of the Plex client and the player. The one exception is `platform/src/tv/plane.rs` (the ACB plane's -# pure `Plane`, in the file of its runner `PlaneOwner`): platform holds forks of its own (i18n, +# of the Plex client and the player. The one exception is `os/src/tv/plane.rs` (the ACB plane's +# pure `Plane`, in the file of its runner `PlaneOwner`): os holds forks of its own (i18n, # keymanager, storage, toast, webos, ...) that no ledger lists, so that one file is scanned for workers # and globals and the crate is not in FORK_SCOPE: -MACHINES=("$SRC_DATA" "$SRC_SESSION" rust-modules/plex/src/plex/session.rs "$SRC_MEDIA/player/lifecycle.rs" - "$SRC_MEDIA/player/attempt_metrics.rs" "$SRC_MEDIA/player/attempt_view.rs" "$SRC_MEDIA/player/readout.rs" "$SRC_MEDIA/player/backend_startup.rs" "$SRC_MEDIA/player/backend_metrics.rs" "$SRC_MEDIA/player/recovery.rs" "$SRC_MEDIA/player/release.rs" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI/uriprobe.rs" "$SRC_PLAY_URI/uri_protocol.rs" "$SRC_PLAY_URI/uri_lifecycle.rs" "$SRC_PLAY_URI/register_ladder.rs" "$SRC_PLAY_URI/acb_bind.rs" "$SRC_PLAY_URI/picture_gate.rs" "$SRC_PLATFORM/tv/plane.rs" "$SRC_MEDIA/route/backend_policy.rs" "$SRC_MEDIA/route/plan.rs" "$SRC_MEDIA/route/plan_memory.rs" "$SRC_SCREENS" "$SRC_UI" "$SRC_APPKIT" "$SRC_MACHINE") -FORK_SCOPE=("$SRC_DATA" "$SRC_PLEX" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_SESSION" "$SRC_SCREENS" "$SRC_UI" "$SRC_APPKIT" "$SRC_MACHINE") +MACHINES=("$SRC_DATA" "$SRC_SESSION" "$SRC_OWP" rust-modules/plex/src/plex/session.rs "$SRC_MEDIA/player/lifecycle.rs" + "$SRC_MEDIA/player/attempt_metrics.rs" "$SRC_MEDIA/player/attempt_view.rs" "$SRC_MEDIA/player/readout.rs" "$SRC_MEDIA/player/backend_startup.rs" "$SRC_MEDIA/player/backend_metrics.rs" "$SRC_MEDIA/player/recovery.rs" "$SRC_MEDIA/player/release.rs" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI/uriprobe.rs" "$SRC_PLAY_URI/uri_protocol.rs" "$SRC_PLAY_URI/uri_lifecycle.rs" "$SRC_PLAY_URI/register_ladder.rs" "$SRC_PLAY_URI/acb_bind.rs" "$SRC_PLAY_URI/picture_gate.rs" "$SRC_OS/tv/plane.rs" "$SRC_MEDIA/route/backend_policy.rs" "$SRC_MEDIA/route/plan.rs" "$SRC_MEDIA/route/plan_memory.rs" "$SRC_SCREENS" "$SRC_UI" "$SRC_APPKIT" "$SRC_MACHINE") +FORK_SCOPE=("$SRC_DATA" "$SRC_PLEX" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_SESSION" "$SRC_SCREENS" "$SRC_OWP" "$SRC_UI" "$SRC_APPKIT" "$SRC_MACHINE") # scope_re ...: an ERE over repo-relative file paths that matches those paths (a `.rs` file # exactly, anything else as a directory prefix) @@ -1436,7 +1438,7 @@ forks_plain_re='^[[:space:]]*#\[cfg\((test|any\(test, feature = "test-support"\) # PRELUDE 3 of 3: computed only when workers, globals or forks is selected. if any_wanted workers globals forks; then ledger_hits=$( - find "$SRC_DATA" "$SRC_SESSION" "$SRC_PLEX" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_SCREENS" "$SRC_UI" "$SRC_APPKIT" "$SRC_MACHINE" "$SRC_PLATFORM/tv/plane.rs" \ + find "$SRC_DATA" "$SRC_SESSION" "$SRC_PLEX" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_SCREENS" "$SRC_OWP" "$SRC_UI" "$SRC_APPKIT" "$SRC_MACHINE" "$SRC_OS/tv/plane.rs" \ -name '*.rs' -type f 2>/dev/null \ | W_PAT="$workers_pat" G_PAT="$globals_pat" F_PAT="$forks_pat" F_PLAIN="$forks_plain_re" \ M_RE="$machines_re" K_RE="$fork_scope_re" \ @@ -1626,7 +1628,7 @@ fi # fxlanes # neither one is a `/tmp/plxnative-` literal in the first place and there is no second file to # name here (re-verify this if a log sink is ever given a hardcoded `/tmp/` path). if want tmppath; then -tmp_hits=$(python3 - "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" <<'PY' +tmp_hits=$(python3 - "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" <<'PY' import os, sys src = sys.argv[1] @@ -1727,7 +1729,7 @@ fi # tmppath # classification above) and `#[cfg(test)]` items, found from tokens so a literal inside a string is # never mistaken for a comment. Zero, no allowlist. Scans every crate root, not only plex's. if want paging; then -paging_hits=$(WHOLLY_TEST="$wholly_test" python3 - "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_PLATFORM" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" <<'PY' +paging_hits=$(WHOLLY_TEST="$wholly_test" python3 - "$SRC" "$SRC_BASE" "$SRC_MACHINE" "$SRC_OS" "$SRC_GFX" "$SRC_NET" "$SRC_UI" "$SRC_PLEX" "$SRC_TELEMETRY" "$SRC_DATA" "$SRC_SESSION" "$SRC_MEDIA" "$SRC_PLAYBACK_CONTRACT" "$SRC_PLAY_URI" "$SRC_PLAY_FEED" "$SRC_MEDIA_CODECS" "$SRC_APPKIT" "$SRC_SCREENS" "$SRC_OWP" <<'PY' import os, sys sys.path.insert(0, "ci") from rust_test_modules import close, lex diff --git a/ci/check-language-lists.py b/ci/check-language-lists.py index a1fc80adc6..3365b2e2a8 100755 --- a/ci/check-language-lists.py +++ b/ci/check-language-lists.py @@ -93,7 +93,7 @@ def problems(root): for rel in sorted(set(found) - set(entries)): where = ', '.join(f'line {n}' for n, _ in found[rel]) out.append(f'{rel}: a hand-written list names several languages ({where}). Loop over ' - f'`plx_platform::i18n::SHIPPED` instead; only a pinned, reviewed translation table belongs in {ALLOW_REL}') + f'`plx_os::i18n::SHIPPED` instead; only a pinned, reviewed translation table belongs in {ALLOW_REL}') for rel in sorted(set(entries) - set(found)): out.append(f'{ALLOW_REL}: stale entry {rel} (the file no longer lists languages): delete the line') for rel in sorted({e for e in entries if entries.count(e) > 1}): diff --git a/ci/check-localization.py b/ci/check-localization.py index a4ba4ff61d..3a50caf0c9 100644 --- a/ci/check-localization.py +++ b/ci/check-localization.py @@ -315,10 +315,10 @@ def literals(start: int, end: int, seen: frozenset[int] = frozenset()) -> list[T # The layer crates split out of rust-modules/src whose files this gate reads (docs/module-layers.md). -# `platform` holds three of the listed product files below (webos.rs, tv/device.rs, devcaps/dv.rs); +# `os` holds three of the listed product files below (webos.rs, tv/device.rs, devcaps/dv.rs); # `gfx` holds `overdraw.rs`, which this gate read as `ui/overdraw.rs` before the split, and `ui` # is the whole of what this gate read as `rust-modules/src/ui`. -LAYER_SRCS = ('rust-modules/platform/src', 'rust-modules/gfx/src', 'rust-modules/ui/src') +LAYER_SRCS = ('rust-modules/os/src', 'rust-modules/gfx/src', 'rust-modules/ui/src') # The constants table reads EVERY layer crate, not only the three above: a prose `const` is followed # across files, and `rust-modules/src` held all of them before the split. Without `plex` (which # also took `PlaybackQuality::label`, the quality row's text, out of the listed `route/decision.rs`) @@ -341,7 +341,7 @@ def missing_roots(root: Path) -> list[str]: def source_paths(root: Path): src = root / 'rust-modules/src' - platform = root / LAYER_SRCS[0] + os_src = root / LAYER_SRCS[0] for base, folders in ((root / LAYER_SRCS[2], ('',)), (root / 'rust-modules/appkit/src', ('',)), (root / 'rust-modules/screens/src', ('',))): for folder in folders: for path in sorted((base / folder).rglob('*.rs')): @@ -352,7 +352,7 @@ def source_paths(root: Path): for rel in ('player/ass.rs', 'player/mod.rs', 'player/shared.rs', 'player/sidecar.rs', 'route/decision.rs', 'route/decision_memory.rs', 'route/plan.rs', 'route/plan_memory.rs'): yield root / 'rust-modules/media/src' / rel for rel in ('webos.rs', 'tv/device.rs', 'devcaps/dv.rs'): - yield platform / rel + yield os_src / rel # `metadata.rs` and `person.rs` were listed under `rust-modules/src` until the data split. for rel in ('metadata.rs', 'person.rs'): yield root / 'rust-modules/data/src' / rel diff --git a/ci/check-module-layers.py b/ci/check-module-layers.py index 522878119e..b2b4c40521 100755 --- a/ci/check-module-layers.py +++ b/ci/check-module-layers.py @@ -11,7 +11,7 @@ * a reference — production or `cfg(test)` — names a layer its own layer does not `use`, and ci/allow/layers.txt has no entry for that (file, member) pair; * a reference from outside a PORT names one of its members, with no entry either. A - `[port ]` section is not a layer: its members stay placed in their layers, and the + `[platform ]` section is not a layer: its members stay placed in their layers, and the port fences one platform's code off from the rest (docs/module-layers.md, step L15). Its entries do not hold up any layer's extraction; * an allowlist entry no longer matches any such reference (the list only shrinks), or the @@ -65,21 +65,21 @@ def __init__(self, path): parser.optionxform = str with open(path, encoding='utf-8') as f: parser.read_file(f) - self.order = [s for s in parser.sections() if not s.startswith('port ')] + self.order = [s for s in parser.sections() if not s.startswith('platform ')] self.uses, self.members, self.errors = {}, {}, [] # A PORT is a set of members, still placed in their layers, that nothing outside the port # may name: the boundary of one platform's code (docs/module-layers.md, step L15). self.ports, self.port_members = {}, {} for section in parser.sections(): - if not section.startswith('port '): continue - port = section[len('port '):].strip() + if not section.startswith('platform '): continue + port = section[len('platform '):].strip() unknown = set(parser[section]) - {'members'} if unknown: self.errors.append(f'[{section}] has unknown key(s) {sorted(unknown)}') self.ports[port] = [] for member in parser[section].get('members', '').split(): key = tuple(member.split('::')) if key in self.port_members: - self.errors.append(f'{member} is listed in [port {self.port_members[key]}] and [{section}]') + self.errors.append(f'{member} is listed in [platform {self.port_members[key]}] and [{section}]') self.ports[port].append(key) self.port_members[key] = port for layer in self.order: @@ -161,7 +161,7 @@ def config_errors(crate, layers): errors.append(f'{member_name(member)} is listed in [{layers.members[member]}] but is not a module of the crate') for member, port in layers.port_members.items(): if member not in crate.modules: - errors.append(f'{member_name(member)} is listed in [port {port}] but is not a module of the crate') + errors.append(f'{member_name(member)} is listed in [platform {port}] but is not a module of the crate') for module in sorted(crate.modules): if layers.member_of(module) is None: errors.append(f'module {member_name(module)} belongs to no layer: add it (or its top-level module) to ci/module-layers.ini') @@ -419,7 +419,7 @@ def unit(module): if key not in allow and key not in found: file, member = key port = layers.port_of(refs[0].target)[1] - errors.append(f'{file} names {member} from outside [port {port}], which only the port itself may ' + errors.append(f'{file} names {member} from outside [platform {port}], which only the port itself may ' f'name: {describe(refs)}') for key in sorted(set(allow) - named): errors.append(f'stale allowlist entry {key[0]}\t{key[1]} — it no longer names that layer or port; ' @@ -437,7 +437,7 @@ def unit(module): return 1 where = args.allow.relative_to(REPO) if args.allow.is_relative_to(REPO) else args.allow ports = ''.join(f', {sum(1 for key in ported if key[1] in {member_name(m) for m in members})} of them ' - f'into [port {port}]' for port, members in layers.ports.items()) + f'into [platform {port}]' for port, members in layers.ports.items()) print(f'check-module-layers: green — {len(layers.order)} layers, {len(crate.modules)} modules, ' f'{cargo_edges} Cargo layer declarations, ' f'{len(allow)} migration entries left in {where}{ports}; ' diff --git a/ci/check-python-steps.txt b/ci/check-python-steps.txt index 283f0c609d..614f18207b 100644 --- a/ci/check-python-steps.txt +++ b/ci/check-python-steps.txt @@ -173,11 +173,13 @@ python3 tools/test_tv_net_remote.py python3 ci/check-package.py --selftest # The module-layer gate (docs/module-layers.md): every reference one module makes to another # must point DOWN the target crate graph in ci/module-layers.ini, and only the webOS port may -# name the webOS modules (`[port webos]`), unless it is one of the counted migration entries in +# name the webOS modules (`[platform webos]`), unless it is one of the counted migration entries in # ci/allow/layers.txt, which only shrinks. This is what keeps the module graph from growing new # cycles while the crate split is under way, and webOS from spreading. ~3 s, no cargo. python3 ci/test_module_graph.py python3 ci/check-module-layers.py +# tools/rename-os-layer.py, Wave R's rename tool: forward, --reverse, --check and --equivalence on synthetic trees and a throwaway git repo. ~1 s, no cargo. +python3 ci/test_rename_os_layer.py # The statics gate (spec §0 done-criterion 1): a static mut under ui/, screens/, appkit/ and the # gated data modules must be named in ci/allow/statics.txt or sit in a legacy module still awaiting # its phase in ci/allow/statics-migration.txt (a counted list that only shrinks). A static mut that diff --git a/ci/list-caps.ini b/ci/list-caps.ini index 7bf26222de..40bc6d2648 100644 --- a/ci/list-caps.ini +++ b/ci/list-caps.ini @@ -770,89 +770,89 @@ reason = The min caps one poll() wait of the close linger at POLL_CAP so the can class = not-a-list reason = The min caps one poll() wait at POLL_CAP so the cancel flag is read again; a wait time, not a list. -# ---- platform ------------------------------------------------------------ +# ---- os ------------------------------------------------------------ -[platform/src/devcaps.rs::OPUS_AUTO_MAX_CHANNELS] +[os/src/devcaps.rs::OPUS_AUTO_MAX_CHANNELS] class = not-a-list reason = An audio channel ceiling for direct-playing Opus in Auto (stereo; wider tracks go to the server), not a collection of content. -[platform/src/devcaps.rs::PCM_MAX_CHANNELS] +[os/src/devcaps.rs::PCM_MAX_CHANNELS] class = format reason = LG's PCM input names only mono and stereo in `pcmInfo.channelMode`; a limit of the pipeline's format, and wider FLAC, ALAC or LPCM is converted by the server. -[platform/src/imgcache.rs::MAX_BYTES] +[os/src/imgcache.rs::MAX_BYTES] class = work reason = MAX_BYTES: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/imgcache.rs::MAX_ENTRIES] +[os/src/imgcache.rs::MAX_ENTRIES] class = work reason = MAX_ENTRIES: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/imgcache.rs::MAX_FILE] +[os/src/imgcache.rs::MAX_FILE] class = work reason = MAX_FILE: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/imgcache.rs::MIN_CAP] +[os/src/imgcache.rs::MIN_CAP] class = work reason = MIN_CAP: the least spare disk the poster cache needs before it turns on; below it the cache is off and posters are fetched, not reachable content lost. -[platform/src/imgcache.rs::probe_dir] +[os/src/imgcache.rs::probe_dir] class = work reason = probe_dir: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/imgcache.rs::read_file] +[os/src/imgcache.rs::read_file] class = work reason = read_file: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/client.rs::DESCRIPTOR_MAX] +[os/src/storage/client.rs::DESCRIPTOR_MAX] class = work reason = DESCRIPTOR_MAX: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/diagnostics.rs::LIMIT] +[os/src/storage/diagnostics.rs::LIMIT] class = work reason = LIMIT: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/diagnostics.rs::boot] +[os/src/storage/diagnostics.rs::boot] class = work reason = boot: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/diagnostics.rs::cap] +[os/src/storage/diagnostics.rs::cap] class = work reason = cap: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/mod.rs::MAX_BYTES] +[os/src/storage/mod.rs::MAX_BYTES] class = work reason = MAX_BYTES: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/state.rs::MAX_ENCODED_BYTES] +[os/src/storage/state.rs::MAX_ENCODED_BYTES] class = work reason = MAX_ENCODED_BYTES: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage/state.rs::MAX_LOGICAL_BYTES] +[os/src/storage/state.rs::MAX_LOGICAL_BYTES] class = work reason = MAX_LOGICAL_BYTES: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage_service/activation.rs::MAX_BYTES] +[os/src/storage_service/activation.rs::MAX_BYTES] class = work reason = MAX_BYTES: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage_service/runtime.rs::record_failure_in] +[os/src/storage_service/runtime.rs::record_failure_in] class = work reason = record_failure_in: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/storage_service/wire.rs::MAX_FRAME] +[os/src/storage_service/wire.rs::MAX_FRAME] class = work reason = MAX_FRAME: cache, persisted-payload or service-wire size bound; eviction or refusal costs a re-fetch, not reachable content. -[platform/src/tv/launch.rs::MAX_PENDING] +[os/src/tv/launch.rs::MAX_PENDING] class = work reason = MAX_PENDING: bounds launch payloads queued between two frames (oldest dropped); not a list the user browses. -[platform/src/webos.rs::soc_from_machine_name] +[os/src/webos.rs::soc_from_machine_name] class = not-a-list reason = soc_from_machine_name: keeps the first eight characters of the machine-name token as the SoC class for the hardware context; a string-size bound, not a list. -[platform/src/tv/plane.rs::MAX_EARLY_COMPLETIONS] +[os/src/tv/plane.rs::MAX_EARLY_COMPLETIONS] class = work reason = Bounds the memory of completion callbacks that arrived before their unload was recorded (a one-frame race); no user-visible list is truncated, and an older completion simply no longer matches a task that was never awaited. @@ -1525,11 +1525,11 @@ reason = How many shelves one page-key press jumps; a paging stride, not a limit class = work reason = Bounds recovery flights per play request (a facet rung, then the both-facets rung); the read-out follows, nothing is unreachable. -[platform/src/playback_trace.rs::TRACE_BYTE_LIMIT] +[os/src/playback_trace.rs::TRACE_BYTE_LIMIT] class = work reason = Bounds the opt-in firmware diagnostic recording and export bytes, not library items or other viewer content. -[platform/src/playback_trace.rs::LINE_BYTE_LIMIT] +[os/src/playback_trace.rs::LINE_BYTE_LIMIT] class = work reason = Bounds one native diagnostic message before formatting and scrubbing; no user-visible content list is truncated. @@ -1560,3 +1560,59 @@ reason = Bounds allocation of one complete signed catalog response (header line, [data/src/hudpacks/catalog.rs::CACHE_BYTE_LIMIT] class = work reason = Bounds a complete catalog cache read including JSON escaping of the bounded UTF-8 response; invalid or oversized caches never become partial catalogs. + +[owp/src/clock.rs::CLOCK_WINDOW] +class = format +reason = The Open Watch Party clock keeps its 8 newest round-trip samples (SDK.md §5); a protocol constant over pings, not a list anyone browses. + +[owp/src/code.rs::format] +class = not-a-list +reason = Splits a valid six-symbol room code into two groups of three for display (SDK.md §4.1); every symbol is kept. + +[owp/src/json.rs::MAX_SAFE_INT] +class = format +reason = The largest integer an Open Watch Party message may carry, ±(2^53 − 1) (SPEC.md §2); a numeric bound, not a list. + +[owp/src/media.rs::MAX_DURATION_MS] +class = format +reason = The protocol's longest media duration, 7 days (SPEC.md §10, §13.1); a numeric bound on one field. + +[owp/src/media.rs::MAX_EXT_BYTES] +class = format +reason = The protocol limit on a descriptor's app-private `ext`, 1024 bytes (SPEC.md §10, §13.1), checked before sending. + +[owp/src/media.rs::MAX_MEDIA_BYTES] +class = format +reason = The protocol limit on a media descriptor, 4096 bytes (SPEC.md §10, §13.1), checked before sending. + +[owp/src/message.rs::MAX_MESSAGE_BYTES] +class = format +reason = The relay's largest inbound message, 8192 bytes (SPEC.md §3.1, §13.1), checked before sending; MAX_RELAY_MESSAGE_BYTES caps what the relay sends. + +[owp/src/message.rs::MAX_RELAY_MESSAGE_BYTES] +class = not-a-list +reason = The longest relay message decode reads, 65536 bytes, checked before the scan; clients must accept at least 32768 (SPEC.md §3.1), and a longer one is TooLarge. + +[owp/src/relays.rs::MAX_RELAY_ID_LENGTH] +class = format +reason = The relay list's longest relay id, 32 characters (SPEC.md §5.2); a text length. + +[owp/src/relays.rs::MAX_RELAY_NAME_LENGTH] +class = format +reason = The relay list's longest relay name, 64 code points (SPEC.md §5.2); a text length. + +[owp/src/room.rs::MAX_OFFSET_MS] +class = format +reason = The protocol's widest participant offset, ±7 days (SPEC.md §7.5, §13.1); a numeric bound on one field. + +[owp/src/room.rs::MAX_PEER_ID_LENGTH] +class = format +reason = The peer ID pattern's longest id, 16 characters (SPEC.md §11.1); a text length. + +[owp/src/text.rs::MAX_CLIENT_LENGTH] +class = format +reason = The protocol's longest `client`, 64 code points (SPEC.md §6.3, §13.1); a text length. + +[owp/src/text.rs::MAX_NAME_LENGTH] +class = format +reason = The protocol's longest display `name`, 32 code points (SPEC.md §6.3, §13.1); a text length. diff --git a/ci/machines.ini b/ci/machines.ini index 99e071b7c1..76ad5eff23 100644 --- a/ci/machines.ini +++ b/ci/machines.ini @@ -154,3 +154,15 @@ state_reads = immutable [module session/src/auth/owner.rs] wildcard_enum_match_arm = deny + +[owp/src/clock.rs::ClockSync] +event = ClockEvent +effect = PongOutcome +step = inherent (`ClockSync::step`); one clock per relay connection (SDK.md section 5); not yet owned by a session, the caller hands it local monotonic times in the events +writer_policy = strict +state_field = window +transition = transition +constructor = new + +[module owp/src/clock.rs] +wildcard_enum_match_arm = deny diff --git a/ci/module-layers.ini b/ci/module-layers.ini index 1156e95693..c1810b3153 100644 --- a/ci/module-layers.ini +++ b/ci/module-layers.ini @@ -50,15 +50,15 @@ members = uses = base members = machine present landgate landing job motion idle_regression_tests present_contract_tests -[platform] -# EXTRACTED: this layer is the workspace crate `plx_platform` (rust-modules/platform/), the third +[os] +# EXTRACTED: this layer is the workspace crate `plx_os` (rust-modules/os/), the third # split of docs/module-layers.md; ci/module_graph.py reads it as part of the same module tree (a -# path `plx_platform::storage::open` names module `storage`). `webos` and `keymanager` are also in -# [port webos] below, and the port fence still reads references to them by that name. +# path `plx_os::storage::open` names module `storage`). `webos` and `keymanager` are also in +# [platform webos] below, and the port fence still reads references to them by that name. # What this television is and keeps: webOS identity, the storage helper client, the key stores, # the codec table, the artwork cache, the localization catalog, and the Cloud Lab session file # (`labcfg`: `lab.json` plus the trigger-key / menu-row answers `ui/` and `screens/` ask of it). -# `webos` and `keymanager` are also in [port webos]. `tv` holds the interfaces the webOS port fills +# `webos` and `keymanager` are also in [platform webos]. `tv` holds the interfaces the webOS port fills # at boot (step L15): device identity, the sandbox verdict, the key store, home, toast, the window # and the video sink trait. uses = base machine @@ -69,19 +69,19 @@ members = webos storage keymanager devcaps imgcache i18n labcfg tv playback_trac # docs/module-layers.md; ci/module_graph.py reads it as part of the same module tree (a path # `plx_gfx::text::elide` names module `text`). `overdraw` was `ui::overdraw`. # GL, EGL, text rasterization, images, vector icons and the GPU instruments. The crate names -# nothing of `platform` today, so it does not depend on `plx_platform`; the ceiling stays. -uses = base machine platform +# nothing of `os` today, so it does not depend on `plx_os`; the ceiling stays. +uses = base machine os members = gfx egl text rtl img svg gpu_timer hwcnt overdraw dump [net] # EXTRACTED: this layer is the workspace crate `plx_net` (rust-modules/net/), the fifth split of # docs/module-layers.md; ci/module_graph.py reads it as part of the same module tree (a path # `plx_net::net::keypin::is_latched` names module `net`). The crate depends on `plx_base` only; -# `platform` stays in `uses` because the layer may name it, not because anything does today. +# `os` stays in `uses` because the layer may name it, not because anything does today. # The transports: libcurl HTTPS (`net` for control calls, `range_io` for interruptible media byte ranges) # and the plaintext socket stream. And `ws`: the RFC 6455 codec and the WebSocket transport that runs it # over `net::connect_only`, libcurl's CONNECT_ONLY socket. -uses = base platform +uses = base os members = net stream range_io ws [plex] @@ -89,7 +89,7 @@ members = net stream range_io ws # docs/module-layers.md; ci/module_graph.py reads it as part of the same module tree (a path # `plx_plex::plex::session::load` names module `plex::session`, `plx_plex::http` names `http`). # The typed Plex API (PMS + plex.tv), the session store, and the one request door. -uses = base machine platform net +uses = base machine os net members = plex http [jellyfin] @@ -97,7 +97,7 @@ members = plex http # its translation into the common item model, which is the Plex layer's (`plx_plex::plex::Metadata` # and friends), hence `plex` in `uses`. It answers the Plex layer's `Client` calls through the # `alt-backend` hook. -uses = base machine platform net plex +uses = base machine os net plex members = jellyfin [telemetry] @@ -107,7 +107,7 @@ members = jellyfin # `plx_telemetry::diag::schema` names `diag::schema`). `diag::{heartbeat, spans, zlib}` are not here: # they are `plx_base::diag::*`, a different module of the same name. # Consent, the opt-in crash/usage channels, and the typed usage-event schema they carry. -uses = base machine platform net plex +uses = base machine os net plex members = telemetry diag [ui] @@ -117,7 +117,7 @@ members = telemetry diag # ci/module_graph.py reads `plx_ui::theme::X` and the `crate::theme` written inside the crate as # module `ui::theme`. That is why the member below is still `ui`. # The UI LIBRARY (ui/src/CLAUDE.md's layer rule): widgets, containers, the frame — no application type. -uses = base machine platform gfx +uses = base machine os gfx members = ui [data] @@ -125,10 +125,10 @@ members = ui # docs/module-layers.md; ci/module_graph.py reads it as part of the same module tree (a path # `plx_data::stores::hubs::HubsStore` names module `stores::hubs`, `plx_data::pms::seed_for_test` # names `pms`). The members below are still the top-level modules of that crate, and the manifest -# depends on `plx_base`, `plx_machine`, `plx_platform`, `plx_plex` and `plx_telemetry` (`net` is a +# depends on `plx_base`, `plx_machine`, `plx_os`, `plx_plex` and `plx_telemetry` (`net` is a # dev-dependency only: one fixture test calls it). # The content stores and their data modules. -uses = base machine platform net plex telemetry playback_contract +uses = base machine os net plex telemetry playback_contract members = instruments stores browse metadata person collection search sortfacts subsearch viewstate viewledger pms watchlist catalog hudpacks watchlist_guid_tests captured_store_fixture # Value-only cfg(test) harness, like watchlist_guid_tests; no production dependency edge. @@ -139,7 +139,7 @@ members = instruments stores browse metadata person collection search sortfacts # of docs/module-layers.md; ci/module_graph.py reads it as part of the same module tree (a path # `plx_session::auth::owner::SessionMachine` names module `auth::owner`). The crate keeps `auth` as # its one top-level module, so every `crate::auth::` inside it stayed valid. -uses = base machine platform net plex jellyfin telemetry +uses = base machine os net plex jellyfin telemetry members = auth # Playback interfaces and optional independent implementations. Each mounted crate owns a @@ -153,11 +153,15 @@ uses = base playback_contract members = media_codecs [play_uri] -uses = base platform playback_contract +uses = base os playback_contract members = play_uri +[owp] +uses = +members = owp + [play_feed] -uses = base platform net playback_contract media_codecs +uses = base os net playback_contract media_codecs members = play_feed [media] @@ -167,7 +171,7 @@ members = play_feed # modules that were the last import cycle (`abr curlio ff hls player route`) were all in this crate; the # demuxer, `aq` and `hls` have since moved to `play_feed`, and this crate is neutral orchestration over the # backend seam: transport for media, adaptive bitrate, the engine, route selection. -uses = base machine platform gfx net plex telemetry data playback_contract play_feed media_codecs +uses = base machine os gfx net plex telemetry data playback_contract play_feed media_codecs members = ff abr adaptive curlio player route speed_audio subtitle_job http_test_support [appkit] @@ -177,7 +181,7 @@ members = ff abr adaptive curlio player route speed_audio subtitle_job http_test # `appkit::player_hud`), like `plx_ui`. # Application widgets shared by several screens: compositions of ui components over application types. # The sibling rule keeps shared widgets out of screens/. -uses = base machine platform gfx net plex telemetry ui data session media +uses = base machine os gfx net plex telemetry ui data session media members = appkit [screens] @@ -187,16 +191,16 @@ members = appkit # `screens::home`), like `plx_ui` and `plx_appkit`. # The application's screens (screens/CLAUDE.md): never a sibling screen, never the app. # Its tests (the player pins) drive the Feed's transport flags: a dev-dependency edge, no production name. -uses = base machine platform gfx net plex jellyfin telemetry ui data session media appkit play_feed +uses = base machine os gfx net plex jellyfin telemetry ui data session media appkit play_feed members = screens [app] # The loop, its adapters and every dev/diagnostic surface; lib.rs's own items are the facade. -uses = base machine platform gfx net plex jellyfin telemetry ui data session media appkit screens playback_contract play_uri play_feed media_codecs +uses = base machine os gfx net plex jellyfin telemetry ui data session media appkit screens playback_contract play_uri play_feed media_codecs members = crate app dev lab capture remote focusprobe hud_cli hud_tools shot coldstart textinput system release_line port -[port webos] +[platform webos] # Not a layer: the modules that exist only because the target is webOS. Identity, capability and # repair (`webos`), the LS2 key stores (`keymanager`), the SDL/Wayland window glue (`system`), the # Starfish/ACB playback seam (`webos::video_sink`, which implements `tv::sink::VideoSink`) and `port`, @@ -204,7 +208,7 @@ members = # for the crate split, and nothing outside the port may name them. # The native port does not carry the simulator's stand-ins: `play-feed/src/ffi_host.rs` is the # simulator's own `VideoSink` (it lives with the Feed backend, in `[play_feed]`), outside this fence. Everything else reaches the television through -# the interfaces in [platform]'s `tv` that the port fills at boot (docs/module-layers.md, step +# the interfaces in [os]'s `tv` that the port fills at boot (docs/module-layers.md, step # L15). Nothing outside names the port, so it can become its own crate on top, and another TV OS # another port beside it. members = webos keymanager system port diff --git a/ci/proofs/platform-generated-enums.json b/ci/proofs/platform-generated-enums.json index e0a84610fb..1ebea13dac 100644 --- a/ci/proofs/platform-generated-enums.json +++ b/ci/proofs/platform-generated-enums.json @@ -1,79 +1,62 @@ { - "schema": "plx.readonly.generated-unit-enums.v1", - "package": "plx_platform", - "module": "platform/src/i18n/mod.rs", - "include": "include!(concat!(env!(\"OUT_DIR\"), \"/languages.rs\"));", - "sources": { - "platform/Cargo.toml": "4181b79fa53a7ff6e8b0157f4d1ffe258737896603d267b4802551dee0812472", - "platform/src/lib.rs": "de49b2ad8b017496e851dd647f22aed565fa4753e80b67d43f3368c8d436e60b", - "platform/src/i18n/mod.rs": [ - "40a13d07a43c772b10587e510a69502684abfa1f582ce355b22fd935a8c46f45", - "2c978e3aa3a9215a2e96ebaec9dd5ae3cf3ee85cf1afb43a36b5f42f17ff4d52", - "9ca00f085c87dec8dcb1a356483f1c10a8452b28e3db877ab51d31528b95b503" - ], - "platform/build.rs": "565db6b510ee3a9794c614eaab5ab151703b43311087d1d52adcc845ae6d8f9c", - "platform/build_support/catalog.rs": "ed55b6029a9af5aa5cdf8a7cb70e8fd4fe657c30068ca815f5bef46428e232f9", - "build_support/install_identities.rs": "8039b85c09d27c1f9a80aded1245dd4a0c7b7ac3b633e28cb9b7a0f6d62ed621", - "machine/src/lib.rs": [ - "105afdbb05fb762e6752cef260b6d928b1d828993350aaa71651f96cee0c3188", - "c35d39ae620b5607e7035222ab1023799adaf091d6a4f737a847dd70b26c1b36" - ], - "machine/src/machine.rs": [ - "571415d64a9885248f852b402153feedd4660acbe03606e4796c59659726049f", - "03a6e18f576dcbaff66c3d7405923b155302bfb2996bb373dac115ece055a5bf", - "d08b44dbff241962286eb7e1f85897073ba9f2f712a2ba935837f901635369a8", - "9b1ffb66c7ba2eb9fdffcb4bcbf0a29cda87a003cce69b16c73567c8bc0a65b0", - "b2794fd0febbbd98febfb45e12fedadcbb58900b02674af7f665bd15adea458d", - "ff378a339f0b4934a4934ab25aa4965a51a27f38d053fe19c1abb382b690ee45", - "1fafb56dcc9f423d7c00fd989a3f11bd21022d64d62d8f71f70e3eb97f6b4975", - "8f46da48c81057c28aa19524d80a585e5aa136bcdd841a1a5359a9f576bbf7b5" - ] - }, - "text_hashing": "sha256-utf8-bytes-crlf-to-lf-local-root-version-v1", - "manifests": { - "Cargo.toml": "1ff48f737c5de2ed1f2d84d30d1f68b81064eeb832d41ae2d17c100868f7be6f", - "appkit/Cargo.toml": "1e3a33f392110f269537b12f12879c6bc15309aca304b189d6b0346edf8a1186", - "base/Cargo.toml": "ebe0b95553bd44f33f422f7d8e22b75ddeb53c7ee81bbe738f675690694568f7", - "data/Cargo.toml": "90a763a8a9e22bda7e95f8ede4dc10ec6e92a62b90bd0fd2e622c617d75ec6c7", - "gfx/Cargo.toml": "c8889dd95a481938966c41635f85702695ce9c59956381768e6c56d215d8fc0e", - "jellyfin/Cargo.toml": "052d42e12408e9f16a637d2db35c45c76212c9a4e339a0592879f81316d3c865", - "machine/Cargo.toml": "0bc99e95272916b8d00e1a8dad81440bc4998de12ccd9a00e7853f438c813d03", - "media/Cargo.toml": "2b3bb41264db9b9f30869015dfe0dd6656147c432728c9ea9301988c710a4202", - "media-codecs/Cargo.toml": "503c8681289314b5c8a63195aad6796cbad93fcb3eedd8d7cba9e8ed0233783f", - "net/Cargo.toml": "bfdb3a08200642eeeafc9762733718c407529f26dce8a7b90665bc77ac928171", - "platform/Cargo.toml": "4181b79fa53a7ff6e8b0157f4d1ffe258737896603d267b4802551dee0812472", - "play-feed/Cargo.toml": "b85320257da74a1affd81238b8fb6caa7f28960181d5ea0e07704ceef4800515", - "play-uri/Cargo.toml": "107832fa33c96b7d2a4150c294aea9cd40954c3aabf66f809fc771bb52f5c280", - "playback-contract/Cargo.toml": "bde335ea645552d4f7481b007b80204ecb5bb592caaca22af58a8361cd050dcf", - "plex/Cargo.toml": "d6196bf9876508d331fe8e0a0855b04ebdbc75609654b2e800367e76eafd264d", - "screens/Cargo.toml": "40684caf71c5f4efdbf2408fdbe82c449eb9971ad407e17c57b4fbf8088bb947", - "session/Cargo.toml": "3465138599308ff134e2ed643bfdf375bfa54933d693b36e041b0e9514b1d91d", - "storage/Cargo.toml": "8865be804f87c69c5ab6fdf3f3f5388b8bfc254195329623c7b1f5cf614e3e81", - "telemetry/Cargo.toml": "19ccd3f933efcda0052c8f0fdd9c9275c566f6d445e77a1049d0c3bd16e71b36", - "ui/Cargo.toml": "0957d2057cadbd522ae2ee2446727c9c4022c75fba9cfb2347fd341a10fdacf4" - }, + "assumptions": [ + "Offline source-backed unit-enum proof; certificate changes require source review.", + "", + "No Cargo, cached output, generator execution, Copy axiom or type-name exemption.", + "The certificate pins the entire production pipeline and include namespace, not the", + "language list. Its reviewed template emits unit variants in every configuration.", + "Only enum values are certified: LocaleContext/OnceLock and methods are not.", + "Assumes ordinary Cargo/Rust/std/serde execution, no external build/config/compiler", + "overrides, output tampering or unsafe-code/compiler unsoundness attestation." + ], "configs": { - ".cargo/config": null, - ".cargo/config.toml": "82f061c716740e16cfee63a74d87159e0e0dc253e1092b87c54190c603515b14", "../.cargo/config": null, - "../.cargo/config.toml": null + "../.cargo/config.toml": null, + ".cargo/config": null, + ".cargo/config.toml": "82f061c716740e16cfee63a74d87159e0e0dc253e1092b87c54190c603515b14" }, - "lock": "e4a22856112e6ecb4025e720246bd044d872a915b1dc63bb4f5edf6bb10357fe", "grammar": { - "Preference": { - "prefix": [ - "System" - ], - "catalogue_unit_variants": true - }, "Language": { "catalogue_unit_variants": true, "suffix": [ "Pseudo" ] + }, + "Preference": { + "catalogue_unit_variants": true, + "prefix": [ + "System" + ] } }, + "include": "include!(concat!(env!(\"OUT_DIR\"), \"/languages.rs\"));", + "lock": "9034a341236d78f3c943b2d86672dee5a9d802513cdbeac1b193952be4090bc8", "machine_newtype": "reviewed local newtype macro emits pub struct Name(pub u32); doc attributes only", + "manifests": { + "Cargo.toml": "e5e1f95985fc8f0827757692c393dc5f7a8b93298cc2c04db02576e95057f82a", + "appkit/Cargo.toml": "5cc1214cba7746fe0f2d4cfa5047b599e0d5124abe7bdaebe210381021b88c4a", + "base/Cargo.toml": "ebe0b95553bd44f33f422f7d8e22b75ddeb53c7ee81bbe738f675690694568f7", + "data/Cargo.toml": "74f79e6240f0965069ec34916ae276b3f7e5f4b944cf16a0846570a6b115afa0", + "gfx/Cargo.toml": "c8889dd95a481938966c41635f85702695ce9c59956381768e6c56d215d8fc0e", + "jellyfin/Cargo.toml": "1e2bee52f1b0307e55d29b8bf5e7444f248a86421e1ff55fb490500de0e50765", + "machine/Cargo.toml": "0bc99e95272916b8d00e1a8dad81440bc4998de12ccd9a00e7853f438c813d03", + "media-codecs/Cargo.toml": "503c8681289314b5c8a63195aad6796cbad93fcb3eedd8d7cba9e8ed0233783f", + "media/Cargo.toml": "f6678328f609a0552573d4be6762c888f4e88aaa0e8b6d2cc9eb1abaa9335a97", + "net/Cargo.toml": "bfdb3a08200642eeeafc9762733718c407529f26dce8a7b90665bc77ac928171", + "os/Cargo.toml": "3dbc4c654863f682a01f0750d0e2d1d6b42d56740d040b353d0a4ea00dcd1d9a", + "owp/Cargo.toml": "2c1354bce16b34f0d006fc04cd4c8eb22ef91f00063b53a1113e32f475ecae33", + "play-feed/Cargo.toml": "5bd2b67820914b578fcb371b80ed9274eae4b57078391c38161a67fc22df760d", + "play-uri/Cargo.toml": "48528dd164a910a32f5396ab8f5bc4c6c13f6fd5f1136ee080f8424fe663280b", + "playback-contract/Cargo.toml": "bde335ea645552d4f7481b007b80204ecb5bb592caaca22af58a8361cd050dcf", + "plex/Cargo.toml": "69e38307e21cce2e4f0a7efd288b64110b9af1dd7bbd0daceeca689ddbacd656", + "screens/Cargo.toml": "772bc873f1779152f52807f1f5d6ea2dfa5a46cab42523b86821f50aa0627d2b", + "session/Cargo.toml": "1a3b4b923b1fba49a1b9243d75c05d6f84521f7d035545adf754d948d69df3ba", + "storage/Cargo.toml": "4b8576b04a5877e95d084a49a16b30224c275ae29b4a192c40725ac819500150", + "telemetry/Cargo.toml": "9e514e64ae4a35619294621f22534b5e5b109d9dd3b729b94ed20112f47197bf", + "ui/Cargo.toml": "7375c6a73cb2558c7c0f62da7b0bd4beb2a5b78f5460ee35e93b1045c0e80eec" + }, + "module": "os/src/i18n/mod.rs", + "package": "plx_os", "review": [ "build.rs -> catalog::build(locales, OUT_DIR), no cfg-dependent producer", "parse_registry derives variant solely from validated ASCII tag", @@ -86,14 +69,32 @@ "UI FIFO on PR1385: AppCommandId(u64), AppCommandOutcome and generic AppCommand appended after unchanged doc-only newtype producer and its ten u32 invocations; none certified as generated declarations", "Owned runtime: HoldHintRead/Event, ModalRead, PageImageRead, Cx/Fx projections, AppEffect partition and PresentationAuthority/Receipt added outside the unchanged doc-only newtype macro and ten u32 invocations; Arc-bearing receipts and effect contracts are not certified; canonical include namespace unchanged" ], - "assumptions": [ - "Offline source-backed unit-enum proof; certificate changes require source review.", - "", - "No Cargo, cached output, generator execution, Copy axiom or type-name exemption.", - "The certificate pins the entire production pipeline and include namespace, not the", - "language list. Its reviewed template emits unit variants in every configuration.", - "Only enum values are certified: LocaleContext/OnceLock and methods are not.", - "Assumes ordinary Cargo/Rust/std/serde execution, no external build/config/compiler", - "overrides, output tampering or unsafe-code/compiler unsoundness attestation." - ] + "schema": "plx.readonly.generated-unit-enums.v1", + "sources": { + "build_support/install_identities.rs": "ee38a9be37796abe5a9a98e9ff3562012e4ac7cfb01c32e24755a1518fcaa982", + "machine/src/lib.rs": [ + "105afdbb05fb762e6752cef260b6d928b1d828993350aaa71651f96cee0c3188", + "c35d39ae620b5607e7035222ab1023799adaf091d6a4f737a847dd70b26c1b36" + ], + "machine/src/machine.rs": [ + "571415d64a9885248f852b402153feedd4660acbe03606e4796c59659726049f", + "03a6e18f576dcbaff66c3d7405923b155302bfb2996bb373dac115ece055a5bf", + "d08b44dbff241962286eb7e1f85897073ba9f2f712a2ba935837f901635369a8", + "9b1ffb66c7ba2eb9fdffcb4bcbf0a29cda87a003cce69b16c73567c8bc0a65b0", + "b2794fd0febbbd98febfb45e12fedadcbb58900b02674af7f665bd15adea458d", + "ff378a339f0b4934a4934ab25aa4965a51a27f38d053fe19c1abb382b690ee45", + "1fafb56dcc9f423d7c00fd989a3f11bd21022d64d62d8f71f70e3eb97f6b4975", + "8f46da48c81057c28aa19524d80a585e5aa136bcdd841a1a5359a9f576bbf7b5" + ], + "os/Cargo.toml": "3dbc4c654863f682a01f0750d0e2d1d6b42d56740d040b353d0a4ea00dcd1d9a", + "os/build.rs": "7e1e3e5ed60ea3433200bb943123aaeb2c892b81bc671ec0d1501ac6e3043af3", + "os/build_support/catalog.rs": "ed55b6029a9af5aa5cdf8a7cb70e8fd4fe657c30068ca815f5bef46428e232f9", + "os/src/i18n/mod.rs": [ + "40a13d07a43c772b10587e510a69502684abfa1f582ce355b22fd935a8c46f45", + "867bb41013e0016d186e699698c762685325aa02f01ebe92d39797c0a41a37e1", + "cdbda874c25a7188bc843f5bb644ebc664c3c71dd268a515a94607e99bb4dd6d" + ], + "os/src/lib.rs": "5efef31144cad117fc5cba931d1bb0a4210909e6d6b5374a123b03f521465714" + }, + "text_hashing": "sha256-utf8-bytes-crlf-to-lf-local-root-version-v1" } diff --git a/ci/proofs/serde-json-immutable.json b/ci/proofs/serde-json-immutable.json index a469cd17cd..ccaf1287d6 100644 --- a/ci/proofs/serde-json-immutable.json +++ b/ci/proofs/serde-json-immutable.json @@ -371,28 +371,29 @@ ".cargo/config": null, ".cargo/config.toml": "82f061c716740e16cfee63a74d87159e0e0dc253e1092b87c54190c603515b14" }, - "lock_sha256": "e4a22856112e6ecb4025e720246bd044d872a915b1dc63bb4f5edf6bb10357fe", + "lock_sha256": "9034a341236d78f3c943b2d86672dee5a9d802513cdbeac1b193952be4090bc8", "manifests": { - "Cargo.toml": "1ff48f737c5de2ed1f2d84d30d1f68b81064eeb832d41ae2d17c100868f7be6f", - "appkit/Cargo.toml": "1e3a33f392110f269537b12f12879c6bc15309aca304b189d6b0346edf8a1186", + "Cargo.toml": "e5e1f95985fc8f0827757692c393dc5f7a8b93298cc2c04db02576e95057f82a", + "appkit/Cargo.toml": "5cc1214cba7746fe0f2d4cfa5047b599e0d5124abe7bdaebe210381021b88c4a", "base/Cargo.toml": "ebe0b95553bd44f33f422f7d8e22b75ddeb53c7ee81bbe738f675690694568f7", - "data/Cargo.toml": "90a763a8a9e22bda7e95f8ede4dc10ec6e92a62b90bd0fd2e622c617d75ec6c7", + "data/Cargo.toml": "74f79e6240f0965069ec34916ae276b3f7e5f4b944cf16a0846570a6b115afa0", "gfx/Cargo.toml": "c8889dd95a481938966c41635f85702695ce9c59956381768e6c56d215d8fc0e", - "jellyfin/Cargo.toml": "052d42e12408e9f16a637d2db35c45c76212c9a4e339a0592879f81316d3c865", + "jellyfin/Cargo.toml": "1e2bee52f1b0307e55d29b8bf5e7444f248a86421e1ff55fb490500de0e50765", "machine/Cargo.toml": "0bc99e95272916b8d00e1a8dad81440bc4998de12ccd9a00e7853f438c813d03", "media-codecs/Cargo.toml": "503c8681289314b5c8a63195aad6796cbad93fcb3eedd8d7cba9e8ed0233783f", - "media/Cargo.toml": "2b3bb41264db9b9f30869015dfe0dd6656147c432728c9ea9301988c710a4202", + "media/Cargo.toml": "f6678328f609a0552573d4be6762c888f4e88aaa0e8b6d2cc9eb1abaa9335a97", "net/Cargo.toml": "bfdb3a08200642eeeafc9762733718c407529f26dce8a7b90665bc77ac928171", - "platform/Cargo.toml": "4181b79fa53a7ff6e8b0157f4d1ffe258737896603d267b4802551dee0812472", - "play-feed/Cargo.toml": "b85320257da74a1affd81238b8fb6caa7f28960181d5ea0e07704ceef4800515", - "play-uri/Cargo.toml": "107832fa33c96b7d2a4150c294aea9cd40954c3aabf66f809fc771bb52f5c280", + "os/Cargo.toml": "3dbc4c654863f682a01f0750d0e2d1d6b42d56740d040b353d0a4ea00dcd1d9a", + "owp/Cargo.toml": "2c1354bce16b34f0d006fc04cd4c8eb22ef91f00063b53a1113e32f475ecae33", + "play-feed/Cargo.toml": "5bd2b67820914b578fcb371b80ed9274eae4b57078391c38161a67fc22df760d", + "play-uri/Cargo.toml": "48528dd164a910a32f5396ab8f5bc4c6c13f6fd5f1136ee080f8424fe663280b", "playback-contract/Cargo.toml": "bde335ea645552d4f7481b007b80204ecb5bb592caaca22af58a8361cd050dcf", - "plex/Cargo.toml": "d6196bf9876508d331fe8e0a0855b04ebdbc75609654b2e800367e76eafd264d", - "screens/Cargo.toml": "40684caf71c5f4efdbf2408fdbe82c449eb9971ad407e17c57b4fbf8088bb947", - "session/Cargo.toml": "3465138599308ff134e2ed643bfdf375bfa54933d693b36e041b0e9514b1d91d", - "storage/Cargo.toml": "8865be804f87c69c5ab6fdf3f3f5388b8bfc254195329623c7b1f5cf614e3e81", - "telemetry/Cargo.toml": "19ccd3f933efcda0052c8f0fdd9c9275c566f6d445e77a1049d0c3bd16e71b36", - "ui/Cargo.toml": "0957d2057cadbd522ae2ee2446727c9c4022c75fba9cfb2347fd341a10fdacf4" + "plex/Cargo.toml": "69e38307e21cce2e4f0a7efd288b64110b9af1dd7bbd0daceeca689ddbacd656", + "screens/Cargo.toml": "772bc873f1779152f52807f1f5d6ea2dfa5a46cab42523b86821f50aa0627d2b", + "session/Cargo.toml": "1a3b4b923b1fba49a1b9243d75c05d6f84521f7d035545adf754d948d69df3ba", + "storage/Cargo.toml": "4b8576b04a5877e95d084a49a16b30224c275ae29b4a192c40725ac819500150", + "telemetry/Cargo.toml": "9e514e64ae4a35619294621f22534b5e5b109d9dd3b729b94ed20112f47197bf", + "ui/Cargo.toml": "7375c6a73cb2558c7c0f62da7b0bd4beb2a5b78f5460ee35e93b1045c0e80eec" }, "owners": { "Cargo.toml": { @@ -408,7 +409,7 @@ ], "edition": "2021", "lib": "src/lib.rs", - "lib_sha256": "c3e5773952ed1dc138ed7806383bda16d88d3c3d470729aa011d7b645738852d" + "lib_sha256": "41bf877e3d547d517be99dedc2f57e1932ffed6cd6df26d80b46dc1c474f49c7" }, "data/Cargo.toml": { "dependency": [ @@ -423,7 +424,7 @@ ], "edition": "2021", "lib": "data/src/lib.rs", - "lib_sha256": "13b19b51177935c316df61913c418233f371b2faf6e7d993cbdbe539e2d4360f" + "lib_sha256": "51257fa0bd132f20469253f07bec172fcbba053fcbc15ae2a22e17507dc3bdb1" }, "jellyfin/Cargo.toml": { "dependency": [ @@ -438,7 +439,7 @@ ], "edition": "2021", "lib": "jellyfin/src/lib.rs", - "lib_sha256": "afc284744d8d4f8169be2316248dd6c42a99cd938d2a5452c9722f2b9f7133aa" + "lib_sha256": "7232a36c1a2eced71e960596a16e55ff053874307fae10c95ccc85273777c3ca" }, "media/Cargo.toml": { "dependency": [ @@ -453,7 +454,7 @@ ], "edition": "2021", "lib": "media/src/lib.rs", - "lib_sha256": "37046486175719577d4ea0fda178dfc577b63c49ba70f472b5fccdd56ce3f3c7" + "lib_sha256": "c15e9804d375fec628df21df57ccaa4abfc78f54f45da19a39ff9c27453f9f16" }, "net/Cargo.toml": { "dependency": [ @@ -477,9 +478,9 @@ ], "edition": "2021", "lib": "net/src/lib.rs", - "lib_sha256": "d9f24001852917fb61bb790e2b3276b7d7bd589a0646fb7bf10e01bbd8324755" + "lib_sha256": "fb01ff87004a7309b82525c393b8d32c927c862c16dd1b8b09aada89850a8c74" }, - "platform/Cargo.toml": { + "os/Cargo.toml": { "dependency": [ { "default-features": false, @@ -494,8 +495,23 @@ } ], "edition": "2021", - "lib": "platform/src/lib.rs", - "lib_sha256": "de49b2ad8b017496e851dd647f22aed565fa4753e80b67d43f3368c8d436e60b" + "lib": "os/src/lib.rs", + "lib_sha256": "5efef31144cad117fc5cba931d1bb0a4210909e6d6b5374a123b03f521465714" + }, + "owp/Cargo.toml": { + "dependency": [ + { + "default-features": false, + "features": [ + "alloc", + "std" + ], + "version": "1" + } + ], + "edition": "2021", + "lib": "owp/src/lib.rs", + "lib_sha256": "78e104e61b5cf3052f18139f5e922576fd7b17890c4b1e7ee0ec71f29d557e72" }, "play-feed/Cargo.toml": { "dependency": [ @@ -510,7 +526,7 @@ ], "edition": "2021", "lib": "play-feed/src/lib.rs", - "lib_sha256": "59373e64dfec596f770f7c81a99c703fc46f0112090c4e9eadc0a615ec5d33c8" + "lib_sha256": "10edd07aa6ede29cd393ac9afe91b04208b69a88b18c15bdafe3f7f0ae460017" }, "play-uri/Cargo.toml": { "dependency": [ @@ -540,7 +556,7 @@ ], "edition": "2021", "lib": "plex/src/lib.rs", - "lib_sha256": "b90aa3a18b5a6479734ff0fc7143308657bb0d24eceb0b128375037c3b3a6f68" + "lib_sha256": "21f51ff3c31160f900f141229bdeaee0af937d7e12aef9baa7b9a946fb6c4e19" }, "screens/Cargo.toml": { "dependency": [ @@ -570,7 +586,7 @@ ], "edition": "2021", "lib": "session/src/lib.rs", - "lib_sha256": "aabf46f0171754643b3e7f246a4270b388a0f205b9263705eadb1e033d03066d" + "lib_sha256": "4640a9718f8cae45cd37818706ac29fd7a27eafbe89abbb69998dea2b9219ac1" }, "storage/Cargo.toml": { "dependency": [ @@ -588,7 +604,7 @@ ], "edition": "2021", "lib": "storage/src/main.rs", - "lib_sha256": "94278ac8964b3825227f444691995278474e97b0802c4fec6dbddba6fe9a29e7" + "lib_sha256": "8726244b78f7d513d9a062b742d56c8e16611dbb6247fb753e9f8d008e257a53" }, "telemetry/Cargo.toml": { "dependency": [ @@ -603,7 +619,7 @@ ], "edition": "2021", "lib": "telemetry/src/lib.rs", - "lib_sha256": "7fd06b717cbe02de1a755dcf0bb3c6098335768854898fba343ccc79484098a7" + "lib_sha256": "f00b8697c55fb037169a502ee32c6941facd4e20cf444d59592704975aaae1f8" }, "ui/Cargo.toml": { "dependency": [ @@ -618,7 +634,7 @@ ], "edition": "2021", "lib": "ui/src/lib.rs", - "lib_sha256": "47ae4e7f8a879f4adc3c765fa8ee2be4c647fec1529661090b921075c0060eb2" + "lib_sha256": "c44fd787244020857e9606bce02c2edf855bcb78445a671be6200d24ef14df2d" } }, "text_hashing": "sha256-utf8-bytes-crlf-to-lf-local-root-version-v1" diff --git a/ci/readonly_dependencies.py b/ci/readonly_dependencies.py index f15ef375c9..85d8157add 100644 --- a/ci/readonly_dependencies.py +++ b/ci/readonly_dependencies.py @@ -9,6 +9,7 @@ Cargo honoring the checked-in locked graph/config, and no out-of-tree compiler or Cargo overrides. This cannot attest an arbitrary build environment or unsafe code. """ +from functools import lru_cache from pathlib import Path import argparse import hashlib @@ -17,7 +18,7 @@ import tarfile CERTIFICATE_PATH = Path(__file__).with_name('proofs') / 'serde-json-immutable.json' -CERTIFICATE_SHA256 = 'aec7889e58a56fbe34172a700f1588b30d42243af5b5635252e4f41da4b39e98' +CERTIFICATE_SHA256 = '31e7cd660df4298f91a031feb183a37ce77628eb226388de5167efb34f08069d' SCHEMA = 'plx.readonly.locked-json.v1' REGISTRY = 'registry+https://github.com/rust-lang/crates.io-index' SUPPORTED = ['alloc', 'arbitrary_precision', 'default', 'float_roundtrip', 'raw_value', 'std', 'unbounded_depth'] @@ -51,8 +52,17 @@ def _json(data): return json.dumps(data, sort_keys=True, separators=(',', ':'), ensure_ascii=True).encode('ascii') +_RAW_STRING = re.compile(r'(?:b|c)?r(#+)?"') +_LITERAL = re.compile(r'(?:b|c)?"(?:\\.|[^"\\])*"|(?:b)?\'(?:\\.|[^\'\\])\'') +_TOKEN = re.compile(r'r#[A-Za-z_]\w*|[A-Za-z_]\w*|::|[^\s]') + + def _tokens(text): - """Lex comments/literals before examining Rust identifiers; never expand macros.""" + """Lex comments/literals before examining Rust identifiers; never expand macros. + + Each pattern matches AT the cursor (`pattern.match(text, i)`): slicing `text[i:]` per token + copied the rest of the file every time and made a 700 KB source cost seconds. + """ result, i = [], 0 while i < len(text): if text[i].isspace(): @@ -67,17 +77,17 @@ def _tokens(text): elif text.startswith('*/', i): depth -= 1; i += 2 else: i += 1 else: - raw = re.match(r'(?:b|c)?r(#+)?"', text[i:]) + raw = _RAW_STRING.match(text, i) if raw: end = '"' + (raw[1] or '') - stop = text.find(end, i + raw.end()) + stop = text.find(end, raw.end()) if stop < 0: raise ValueError('unclosed raw string') result.append('""'); i = stop + len(end); continue - literal = re.match(r'(?:b|c)?"(?:\\.|[^"\\])*"|(?:b)?\'(?:\\.|[^\'\\])\'', text[i:]) + literal = _LITERAL.match(text, i) if literal: - result.append(literal[0]); i += literal.end(); continue - token = re.match(r'r#[A-Za-z_]\w*|[A-Za-z_]\w*|::|[^\s]', text[i:]) - result.append(token[0].removeprefix('r#')); i += token.end() + result.append(literal[0]); i = literal.end(); continue + token = _TOKEN.match(text, i) + result.append(token[0].removeprefix('r#')); i = token.end() return result @@ -194,7 +204,7 @@ def _workspace_hashes(root, paths): """Pin all bytes except the root app's coherent, non-resolving release number. The app build.rs reports this number; it does not select the locked JSON - source or the platform enum producer. Member/dependency versions, features, + source or the os enum producer. Member/dependency versions, features, source identities, comments and all other metadata remain byte-pinned. """ manifest = (root / 'Cargo.toml').read_bytes().replace(b'\r\n', b'\n').decode('utf-8') @@ -401,6 +411,13 @@ def _root_modules_only(text): return True +@lru_cache(maxsize=128) +def _crate_tokens(text): + """_tokens of one crate source TEXT, shared by every namespace check of the same file; the list is + only read (a changed file is new text, so a stale entry cannot answer for it).""" + return _tokens(text) + + def _namespace_safe(crate, source, context): if context is not None: if not isinstance(context, dict) or set(context) - {'imports', 'definitions'}: return False @@ -408,7 +425,7 @@ def _namespace_safe(crate, source, context): if any(entry[0] == 'serde_json' for entry in context.get('imports', ())): return False for path in sorted((crate / 'src').rglob('*.rs')): if path.is_symlink() or not path.resolve().is_relative_to(crate.resolve()): return False - tokens = _tokens(path.read_text(encoding='utf-8')) + tokens = _crate_tokens(path.read_text(encoding='utf-8')) for i, token in enumerate(tokens): if token == 'serde_json' and i and tokens[i - 1] in ('mod', 'type', 'struct', 'enum', 'union', 'trait', 'as', 'crate'): return False diff --git a/ci/readonly_generated.py b/ci/readonly_generated.py index edd20bae93..d016a28ceb 100644 --- a/ci/readonly_generated.py +++ b/ci/readonly_generated.py @@ -13,9 +13,9 @@ from readonly_dependencies import _local_sha, _sha, _json, _manifest_paths, _configs, _workspace_hashes, WORKSPACE_HASHING CERTIFICATE_PATH = Path(__file__).with_name('proofs') / 'platform-generated-enums.json' -CERTIFICATE_SHA256 = '46b10d07a5a062a283d775d01fb502a0a37ed2b2d41316d2e95193c6d1d62253' -SOURCES = ['platform/Cargo.toml', 'platform/src/lib.rs', 'platform/src/i18n/mod.rs', - 'platform/build.rs', 'platform/build_support/catalog.rs', 'build_support/install_identities.rs', +CERTIFICATE_SHA256 = '07654a700668377b83cd5ca784703bbcbb379be649e1fb8b0a908066e1c54bab' +SOURCES = ['os/Cargo.toml', 'os/src/lib.rs', 'os/src/i18n/mod.rs', + 'os/build.rs', 'os/build_support/catalog.rs', 'build_support/install_identities.rs', 'machine/src/lib.rs', 'machine/src/machine.rs'] GRAMMAR = {'Preference': {'prefix': ['System'], 'catalogue_unit_variants': True}, 'Language': {'catalogue_unit_variants': True, 'suffix': ['Pseudo']}} @@ -34,9 +34,9 @@ I18N_SOURCES = ['40a13d07a43c772b10587e510a69502684abfa1f582ce355b22fd935a8c46f45', - '2c978e3aa3a9215a2e96ebaec9dd5ae3cf3ee85cf1afb43a36b5f42f17ff4d52', + '867bb41013e0016d186e699698c762685325aa02f01ebe92d39797c0a41a37e1', # FinNative: only CONTRIBUTE_URL names the fork. - '9ca00f085c87dec8dcb1a356483f1c10a8452b28e3db877ab51d31528b95b503'] + 'cdbda874c25a7188bc843f5bb644ebc664c3c71dd268a515a94607e99bb4dd6d'] def source_hashes(root): sources = {p: _local_sha((root / p).read_bytes()) for p in SOURCES} @@ -51,16 +51,16 @@ def source_hashes(root): if sources['machine/src/lib.rs'] not in MACHINE_LIB_SOURCES: raise ValueError('unreviewed machine namespace') sources['machine/src/lib.rs'] = MACHINE_LIB_SOURCES # Existing consumer variants differ in clock formatting, not include/enum identity. - if sources['platform/src/i18n/mod.rs'] not in I18N_SOURCES: raise ValueError('unreviewed include namespace') - sources['platform/src/i18n/mod.rs'] = I18N_SOURCES + if sources['os/src/i18n/mod.rs'] not in I18N_SOURCES: raise ValueError('unreviewed include namespace') + sources['os/src/i18n/mod.rs'] = I18N_SOURCES return sources def produce_certificate(root): """Review all executable sources on regeneration; catalogue additions need no pin.""" root = Path(root).resolve() hashes = _workspace_hashes(root, _manifest_paths(root)) - return {'schema': 'plx.readonly.generated-unit-enums.v1', 'package': 'plx_platform', - 'module': 'platform/src/i18n/mod.rs', + return {'schema': 'plx.readonly.generated-unit-enums.v1', 'package': 'plx_os', + 'module': 'os/src/i18n/mod.rs', 'include': 'include!(concat!(env!("OUT_DIR"), "/languages.rs"));', 'sources': source_hashes(root), 'text_hashing': WORKSPACE_HASHING, 'manifests': hashes['manifests'], @@ -128,7 +128,7 @@ def provenance(rust_modules_root, source_file): root = Path(rust_modules_root).resolve() path = Path(source_file) if not path.is_absolute(): path = root / path - if path.resolve() not in (root / 'platform/src/i18n/mod.rs', root / 'machine/src/machine.rs') or path.is_symlink(): return None + if path.resolve() not in (root / 'os/src/i18n/mod.rs', root / 'machine/src/machine.rs') or path.is_symlink(): return None cert = json.loads(CERTIFICATE_PATH.read_text(encoding='utf-8')) if _sha(_json(cert)) != CERTIFICATE_SHA256 or cert != produce_certificate(root): return None for relative in SOURCES: @@ -149,7 +149,7 @@ def provenance(rust_modules_root, source_file): def canonical_child(root, parent, name, child): """An include's OUT_DIR belongs to its crate, not a foreign #[path] importer.""" root = Path(root).resolve() - bindings = {root / 'platform/src/i18n/mod.rs': (root / 'platform/src/lib.rs', 'i18n'), + bindings = {root / 'os/src/i18n/mod.rs': (root / 'os/src/lib.rs', 'i18n'), root / 'machine/src/machine.rs': (root / 'machine/src/lib.rs', 'machine')} expected = bindings.get(Path(child).resolve()) return expected is None or expected == (Path(parent).resolve(), name) diff --git a/ci/test_build_bench.py b/ci/test_build_bench.py index 9f81557d68..054a3f6355 100644 --- a/ci/test_build_bench.py +++ b/ci/test_build_bench.py @@ -58,7 +58,7 @@ def read(p): return open(p).read() except OSError: return "" -EDITED = ("base/src/cbuf.rs", "machine/src/landgate.rs", "platform/src/devcaps.rs", "gfx/src/overdraw.rs", "net/src/stream_redirect.rs", "ui/src/dwell.rs", "plex/src/plex/retry.rs", "telemetry/src/telemetry/window.rs", "data/src/stores/tape.rs", "session/src/auth/scripted.rs", "media/src/abr/units.rs", "appkit/src/skip_pill.rs", "screens/src/clock_readout.rs", "src/coldstart.rs", "ui/src/lib.rs") +EDITED = ("base/src/cbuf.rs", "machine/src/landgate.rs", "os/src/devcaps.rs", "gfx/src/overdraw.rs", "net/src/stream_redirect.rs", "ui/src/dwell.rs", "plex/src/plex/retry.rs", "telemetry/src/telemetry/window.rs", "data/src/stores/tape.rs", "session/src/auth/scripted.rs", "media/src/abr/units.rs", "appkit/src/skip_pill.rs", "screens/src/clock_readout.rs", "src/coldstart.rs", "ui/src/lib.rs") if os.environ.get("FAKE_FAIL_ON_EDIT") and "build-bench edit" in "".join(read(p) for p in EDITED): sys.stderr.write("error: fake cargo failed on the edited tree\n") sys.exit(101) @@ -93,7 +93,7 @@ def art(pkg_path, name, version): print(json.dumps({"reason": "compiler-artifact", "package_id": "registry+x#serde@1.0.0", "fresh": True})) art('/base', 'plx_base', '0.0.0') art('/machine', 'plx_machine', '0.0.0') - art('/platform', 'plx_platform', '0.0.0') + art('/os', 'plx_os', '0.0.0') art('/gfx', 'plx_gfx', '0.0.0') art('/net', 'plx_net', '0.0.0') art('/ui', 'plx_ui', '0.0.0') @@ -108,6 +108,7 @@ def art(pkg_path, name, version): art('/media-codecs', 'plx_media_codecs', '0.0.0') art('/appkit', 'plx_appkit', '0.0.0') art('/screens', 'plx_screens', '0.0.0') + art('/owp', 'plx_owp', '0.0.0') art('', 'plxnative-modules', '0.7.0') elif args[0] == "rustc": tgt = args[args.index("--target") + 1] @@ -129,7 +130,7 @@ def art(pkg_path, name, version): ''' LEAF = "rust-modules/base/src/cbuf.rs" MACHINE_LEAF = "rust-modules/machine/src/landgate.rs" -PLATFORM_LEAF = "rust-modules/platform/src/devcaps.rs" +OS_LEAF = "rust-modules/os/src/devcaps.rs" GFX_LEAF = "rust-modules/gfx/src/overdraw.rs" NET_LEAF = "rust-modules/net/src/stream_redirect.rs" UI_LEAF = "rust-modules/ui/src/dwell.rs" @@ -142,7 +143,7 @@ def art(pkg_path, name, version): SCREENS_LEAF = "rust-modules/screens/src/clock_readout.rs" APP_LEAF = "rust-modules/src/coldstart.rs" HUB = "rust-modules/ui/src/lib.rs" -SRC_FILES = {LEAF: "pub fn leaf() {}\n", MACHINE_LEAF: "pub fn machine() {}\n", PLATFORM_LEAF: "pub fn platform() {}\n", GFX_LEAF: "pub fn gfx() {}\n", NET_LEAF: "pub fn net() {}\n", UI_LEAF: "pub fn ui() {}\n", PLEX_LEAF: "pub fn plex() {}\n", TELEMETRY_LEAF: "pub fn telemetry() {}\n", DATA_LEAF: "pub fn data() {}\n", SESSION_LEAF: "pub fn session() {}\n", MEDIA_LEAF: "pub fn media() {}\n", APPKIT_LEAF: "pub fn appkit() {}\n", SCREENS_LEAF: "pub fn screens() {}\n", APP_LEAF: "pub fn app() {}\n", HUB: "pub fn hub() {}", +SRC_FILES = {LEAF: "pub fn leaf() {}\n", MACHINE_LEAF: "pub fn machine() {}\n", OS_LEAF: "pub fn os() {}\n", GFX_LEAF: "pub fn gfx() {}\n", NET_LEAF: "pub fn net() {}\n", UI_LEAF: "pub fn ui() {}\n", PLEX_LEAF: "pub fn plex() {}\n", TELEMETRY_LEAF: "pub fn telemetry() {}\n", DATA_LEAF: "pub fn data() {}\n", SESSION_LEAF: "pub fn session() {}\n", MEDIA_LEAF: "pub fn media() {}\n", APPKIT_LEAF: "pub fn appkit() {}\n", SCREENS_LEAF: "pub fn screens() {}\n", APP_LEAF: "pub fn app() {}\n", HUB: "pub fn hub() {}", "rust-modules/src/lib.rs": "mod coldstart;\n"} @@ -205,11 +206,11 @@ def test_table_json_and_restoration(self): (sb.repo / "rust-modules" / "target").mkdir(parents=True) (sb.repo / "rust-modules" / "target" / "blob").write_bytes(b"x" * 4096) out = sb.repo.parent / "out.json" - proc = sb.run("--runs", "2", "--only", "noop,leaf,machine,platform,gfx,net,ui,plex,telemetry,data,session,media,appkit,screens,hub,tests,sizes", "--json", str(out)) + proc = sb.run("--runs", "2", "--only", "noop,leaf,machine,os,gfx,net,ui,plex,telemetry,data,session,media,appkit,screens,hub,tests,sizes", "--json", str(out)) self.assertEqual(proc.returncode, 0, proc.stderr) md = proc.stdout self.assertIn("| Scenario | Runs | Median | Min | Max | Notes |", md) - for title in (bb.TITLES["noop"], bb.TITLES["leaf"], bb.TITLES["machine"], bb.TITLES["platform"], bb.TITLES["gfx"], bb.TITLES["net"], bb.TITLES["ui"], bb.TITLES["plex"], bb.TITLES["telemetry"], bb.TITLES["data"], bb.TITLES["session"], bb.TITLES["media"], bb.TITLES["appkit"], bb.TITLES["screens"], bb.TITLES["hub"], + for title in (bb.TITLES["noop"], bb.TITLES["leaf"], bb.TITLES["machine"], bb.TITLES["os"], bb.TITLES["gfx"], bb.TITLES["net"], bb.TITLES["ui"], bb.TITLES["plex"], bb.TITLES["telemetry"], bb.TITLES["data"], bb.TITLES["session"], bb.TITLES["media"], bb.TITLES["appkit"], bb.TITLES["screens"], bb.TITLES["hub"], bb.TITLES["tests"]): self.assertRegex(md, re.escape(f"| {title} | 2 | ") + r"[\d.]+ s \| [\d.]+ s \| [\d.]+ s \|") self.assertIn("app crate rebuilt: no", md) # the no-op row @@ -226,7 +227,7 @@ def test_table_json_and_restoration(self): self.assertGreaterEqual(doc["host"]["cores"], 1) self.assertEqual(doc["runs"], 2) self.assertTrue(doc["restored_clean"]) - self.assertEqual([s["id"] for s in doc["scenarios"]], ["noop", "leaf", "machine", "platform", "gfx", "net", "ui", "plex", "telemetry", "data", "session", "media", "appkit", "screens", "hub", "tests", "sizes"]) + self.assertEqual([s["id"] for s in doc["scenarios"]], ["noop", "leaf", "machine", "os", "gfx", "net", "ui", "plex", "telemetry", "data", "session", "media", "appkit", "screens", "hub", "tests", "sizes"]) for sc in doc["scenarios"]: if sc["id"] == "sizes": continue @@ -241,8 +242,8 @@ def test_table_json_and_restoration(self): self.assertTrue(all(s["app_rebuilt"] for s in by_id["leaf"]["samples"])) self.assertTrue(all(s["machine_rebuilt"] and s["app_rebuilt"] for s in by_id["machine"]["samples"])) self.assertIn("plx_machine rebuilt: yes", md) - self.assertTrue(all(s["platform_rebuilt"] and s["app_rebuilt"] for s in by_id["platform"]["samples"])) - self.assertIn("plx_platform rebuilt: yes", md) + self.assertTrue(all(s["platform_rebuilt"] and s["app_rebuilt"] for s in by_id["os"]["samples"])) + self.assertIn("plx_os rebuilt: yes", md) self.assertTrue(all(s["gfx_rebuilt"] and s["app_rebuilt"] for s in by_id["gfx"]["samples"])) self.assertIn("plx_gfx rebuilt: yes", md) self.assertTrue(all(s["net_rebuilt"] and s["app_rebuilt"] for s in by_id["net"]["samples"])) diff --git a/ci/test_build_not_always_dirty.py b/ci/test_build_not_always_dirty.py index cf40c440f8..81012b0934 100644 --- a/ci/test_build_not_always_dirty.py +++ b/ci/test_build_not_always_dirty.py @@ -12,7 +12,7 @@ objects with a `reason` are looked at; `cargo test` also prints harness text on stdout): * `SecondBuildIsFreshTests` builds the real crate twice from `rust-modules/` and demands that the - second run recompiled nothing of the crate: every `plxnative_modules` (and `plx_platform`, the + second run recompiled nothing of the crate: every `plxnative_modules` (and `plx_os`, the layer crate whose own build script generates the catalog, and `plx_gfx`, whose build script compiles the nanosvg object for its own test binary) compiler-artifact is `fresh`, and the crate's build script did not write its output again (cargo replays a @@ -41,7 +41,7 @@ `build.rs` and `src/release_line.rs` against a stub library, in a throwaway repository (the appearance is detected through the worktree's `HEAD`, which is what checking out the line moves), so the real tree is never touched and nothing app-sized is recompiled. It has no dependencies of - its own (the catalog and install-identity generators belong to the platform crate's build script + its own (the catalog and install-identity generators belong to the os crate's build script now) and runs `--offline`. It also pins that a missing `.git/logs/HEAD` (reflog off or deleted) does not make the build always-dirty, the same hazard through `emit_build_sha`. @@ -62,14 +62,14 @@ PACKAGE = "plxnative-modules" # the package's name, as it appears in a package_id # The layer crate that owns a build script of its own (catalog + install identities): it must not be # always-dirty either, or every crate above it would rebuild with it. -PLATFORM_CRATE = "plx_platform" +OS_CRATE = "plx_os" GFX_CRATE = "plx_gfx" NIGHTLY = pinned() # the repo's one toolchain (historic name) -# The invocation `make check`'s lab line runs (Makefile, "cargo check --lib --tests -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --features +# The invocation `make check`'s lab line runs (Makefile, "cargo check --lib --tests -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --features # lab-diagnostics"); identical arguments and CARGO_INCREMENTAL make the first run here a reuse. -LIB_ARGS = ["check", "--lib", "--tests", "-p", "plxnative-modules", "-p", "plx_base", "-p", "plx_machine", "-p", "plx_platform", "-p", "plx_gfx", "-p", "plx_net", "-p", "plx_ui", "-p", "plx_plex", "-p", "plx_telemetry", "-p", "plx_data", "-p", "plx_session", "-p", "plx_media", "-p", "plx_playback_contract", "-p", "plx_play_uri", "-p", "plx_play_feed", "-p", "plx_media_codecs", "-p", "plx_appkit", "-p", "plx_screens", "--features", "lab-diagnostics"] +LIB_ARGS = ["check", "--lib", "--tests", "-p", "plxnative-modules", "-p", "plx_base", "-p", "plx_machine", "-p", "plx_os", "-p", "plx_gfx", "-p", "plx_net", "-p", "plx_ui", "-p", "plx_plex", "-p", "plx_telemetry", "-p", "plx_data", "-p", "plx_session", "-p", "plx_media", "-p", "plx_playback_contract", "-p", "plx_play_uri", "-p", "plx_play_feed", "-p", "plx_media_codecs", "-p", "plx_appkit", "-p", "plx_screens", "-p", "plx_owp", "--features", "lab-diagnostics"] def cargo_env(): @@ -109,12 +109,12 @@ def package_of(record): def rebuilt(records): - """Describe what a build recompiled of the app crate (or of the platform crate, whose build + """Describe what a build recompiled of the app crate (or of the os crate, whose build script generates the catalog), or [] when it recompiled none of it.""" return [f"{(rec.get('target') or {}).get('name')} ({'/'.join((rec.get('target') or {}).get('kind') or [])}) was recompiled" for rec in records if rec.get("reason") == "compiler-artifact" - and (rec.get("target") or {}).get("name") in (CRATE, PLATFORM_CRATE, GFX_CRATE) and not rec.get("fresh")] + and (rec.get("target") or {}).get("name") in (CRATE, OS_CRATE, GFX_CRATE) and not rec.get("fresh")] def freeze_stamps(records): diff --git a/ci/test_check_language_lists.py b/ci/test_check_language_lists.py index fb704678eb..9ffb9b11fb 100644 --- a/ci/test_check_language_lists.py +++ b/ci/test_check_language_lists.py @@ -31,7 +31,7 @@ def test_a_multiline_list_is_found(self): self.assertEqual(len(tree(source)), 1) def test_tuples_and_qualified_paths_count(self): - self.assertEqual(len(tree('const X: [(plx_platform::i18n::Language::En, &str); 0] = [(Language::En, "a"), (Language::It, "b")];')), 1) + self.assertEqual(len(tree('const X: [(plx_os::i18n::Language::En, &str); 0] = [(Language::En, "a"), (Language::It, "b")];')), 1) def test_one_language_a_registry_slice_and_prose_are_fine(self): self.assertEqual(tree('let a = [Preference::En]; let b = SHIPPED; // [Preference::En, Preference::Es]\n'), []) diff --git a/ci/test_check_machine_shape.py b/ci/test_check_machine_shape.py index 7fff72e6aa..f1940ce7f7 100644 --- a/ci/test_check_machine_shape.py +++ b/ci/test_check_machine_shape.py @@ -150,7 +150,7 @@ def test_every_actual_entry_mutation_matrix(self): destination.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(source, destination) # Source-backed generated layouts require the actual producers and dynamic input. - for relative in ('platform/build.rs', 'platform/build_support/catalog.rs', 'build_support/install_identities.rs', '../locales/languages.json'): + for relative in ('os/build.rs', 'os/build_support/catalog.rs', 'build_support/install_identities.rs', '../locales/languages.json'): destination = modules / relative destination.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(ROOT / 'rust-modules' / relative, destination) diff --git a/ci/test_check_placeholders.py b/ci/test_check_placeholders.py index ae82e8e1c2..6fda228075 100644 --- a/ci/test_check_placeholders.py +++ b/ci/test_check_placeholders.py @@ -52,7 +52,7 @@ def test_every_watched_name_is_watched(self): 'theme::CARD_ABSENT', 'theme::white(SKEL_BAR_A)', 'COOL_850', 'widgets::Spinner::new(1.0, 2.0, 3.0)', 'Spinner::leading(x, y)', 'let s = Spinner { r: 1.0, ..d };', - 'plx_platform::i18n::msg::browse_home_loading_c()', 'msg::settings_audio_loading()', + 'plx_os::i18n::msg::browse_home_loading_c()', 'msg::settings_audio_loading()', 'pub fn skeleton_bar(p: Painter) {', 'fn skeleton_sheet(p: Painter) {'): with self.subTest(line=line): self.assertEqual(only({'ui/src/a.rs': f'fn f() {{ {line} }}\n'}), 'UNACCOUNTED') diff --git a/ci/test_ci_split.py b/ci/test_ci_split.py index f6e04d180c..4e20b035b1 100644 --- a/ci/test_ci_split.py +++ b/ci/test_ci_split.py @@ -55,16 +55,16 @@ def rule(target): # Each cargo gate, as a regex over a target's whole (comment-free) recipe, and the one target that # owns it. `lint` is a prerequisite rather than a recipe line, handled separately. GATES = { - "check-cargo-lint": [r"cargo \+\$\(RUST_TOOLCHAIN\) check --lib --tests -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --features lab-diagnostics"], + "check-cargo-lint": [r"cargo \+\$\(RUST_TOOLCHAIN\) check --lib --tests -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --features lab-diagnostics"], "check-cargo-unit-default": [ - r"cargo \+\$\(RUST_TOOLCHAIN\) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens\n", + r"cargo \+\$\(RUST_TOOLCHAIN\) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp\n", r"ci/test_storage_service_package\.py", r"test -p plxnative-storage --bin plxnative-storage", r"ci/test_storage_package_isolated\.py", r"ci/test_no_host_staticlib\.py", r"ci/test_build_not_always_dirty\.py", ], - "check-cargo-unit-hostsim": [r"cargo \+\$\(RUST_TOOLCHAIN\) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_play_feed --features hostsim"], + "check-cargo-unit-hostsim": [r"cargo \+\$\(RUST_TOOLCHAIN\) test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_play_feed --features hostsim"], } diff --git a/ci/test_module_graph.py b/ci/test_module_graph.py index 7163eb5241..4d7b508316 100644 --- a/ci/test_module_graph.py +++ b/ci/test_module_graph.py @@ -332,13 +332,13 @@ def test_cfg_test_items_named_across_layers_are_reported_not_failed(self): code, out, _ = self.run_gate(self.CLEAN, LAYERS, '# count: 0\n', '--report') self.assertIn('low ready', out) - PORT = LAYERS + '[port p]\nmembers = b c\n' + PORT = LAYERS + '[platform p]\nmembers = b c\n' def test_a_reference_into_a_port_from_outside_it_fails_even_down_the_graph(self): code, out, _ = self.run_gate(self.CLEAN, self.PORT, '# count: 0\n') self.assertEqual(code, 1) - self.assertIn('a.rs names c from outside [port p], which only the port itself may name: a.rs:1 c::g', out) - self.assertIn('a.rs names b from outside [port p]', out) + self.assertIn('a.rs names c from outside [platform p], which only the port itself may name: a.rs:1 c::g', out) + self.assertIn('a.rs names b from outside [platform p]', out) self.assertNotIn('names a', out, 'the port may name what its layer may') def test_port_entries_are_allowlisted_pruned_and_do_not_hold_up_the_split(self): @@ -346,7 +346,7 @@ def test_port_entries_are_allowlisted_pruned_and_do_not_hold_up_the_split(self): code, out, _ = self.run_gate(self.CLEAN, self.PORT, '# count: 2\n' + entries) self.assertEqual(code, 0, out) self.assertIn('2 migration entries left in', out) - self.assertIn('2 of them into [port p]', out) + self.assertIn('2 of them into [platform p]', out) code, _, remaining = self.run_gate(self.CLEAN, self.PORT, '# count: 2\n' + entries, '--prune') self.assertEqual((code, remaining), (0, gate.ALLOW_HEADER.format(count=2) + entries)) code, out, _ = self.run_gate(self.CLEAN, self.PORT, '# count: 2\n' + entries, '--report') @@ -359,9 +359,9 @@ def test_port_entries_are_allowlisted_pruned_and_do_not_hold_up_the_split(self): def test_port_config_errors_fail(self): for layers, message in [ - (LAYERS + '[port p]\nmembers = ghost\n', 'ghost is listed in [port p] but is not a module'), - (LAYERS + '[port p]\nmembers = c\n[port q]\nmembers = c\n', 'c is listed in [port p] and [port q]'), - (LAYERS + '[port p]\nmembers = c\nuses = low\n', "[port p] has unknown key(s) ['uses']"), + (LAYERS + '[platform p]\nmembers = ghost\n', 'ghost is listed in [platform p] but is not a module'), + (LAYERS + '[platform p]\nmembers = c\n[platform q]\nmembers = c\n', 'c is listed in [platform p] and [platform q]'), + (LAYERS + '[platform p]\nmembers = c\nuses = low\n', "[platform p] has unknown key(s) ['uses']"), ]: with self.subTest(message=message): code, out, _ = self.run_gate(self.CLEAN, layers, '# count: 0\n') diff --git a/ci/test_no_host_staticlib.py b/ci/test_no_host_staticlib.py index d521edcc4f..216d0d9587 100644 --- a/ci/test_no_host_staticlib.py +++ b/ci/test_no_host_staticlib.py @@ -37,12 +37,12 @@ CRATE = "plxnative_modules" # The layer crates split out of the app crate (docs/module-layers.md), each a dependency of it and # each held to the same rule: an rlib, never an archive. One archive is linked, and it is the app's. -LAYER_CRATES = ("plx_base", "plx_machine", "plx_net", "plx_platform", "plx_gfx", "plx_ui", "plx_plex", "plx_jellyfin", "plx_telemetry", "plx_data", "plx_session", "plx_media", "plx_playback_contract", "plx_play_uri", "plx_play_feed", "plx_media_codecs", "plx_appkit", "plx_screens") +LAYER_CRATES = ("plx_base", "plx_machine", "plx_net", "plx_os", "plx_gfx", "plx_ui", "plx_plex", "plx_jellyfin", "plx_telemetry", "plx_data", "plx_session", "plx_media", "plx_playback_contract", "plx_play_uri", "plx_play_feed", "plx_media_codecs", "plx_appkit", "plx_screens") TOOLCHAIN = pinned() # the repo's one toolchain # What the workspace needs for cargo to resolve (not compile) the app package: the manifest and # lockfile, the `.cargo/config.toml` that cargo finds from the working directory, and the sources # the manifest names. A mutated copy replaces `Cargo.toml` only. -WORKSPACE_FILES = (".cargo", "Cargo.lock", "build.rs", "build_support", "src", "storage", "base", "machine", "net", "platform", "gfx", "ui", "plex", "jellyfin", "telemetry", "data", "session", "media", "playback-contract", "play-uri", "play-feed", "media-codecs", "appkit", "screens") +WORKSPACE_FILES = (".cargo", "Cargo.lock", "build.rs", "build_support", "src", "storage", "base", "machine", "net", "os", "gfx", "ui", "plex", "jellyfin", "telemetry", "data", "session", "media", "playback-contract", "play-uri", "play-feed", "media-codecs", "appkit", "screens", "owp") def offences(unit_graph=None, metadata=None): diff --git a/ci/test_readonly_generated.py b/ci/test_readonly_generated.py index 943f235222..fe3ff4b430 100644 --- a/ci/test_readonly_generated.py +++ b/ci/test_readonly_generated.py @@ -28,7 +28,7 @@ def setUp(self): out = self.root / relative out.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(ROOT / 'rust-modules' / relative, out) - self.module = self.root / 'platform/src/i18n/mod.rs' + self.module = self.root / 'os/src/i18n/mod.rs' self.catalogue = self.root.parent / 'locales/languages.json' def evidence(self): @@ -99,7 +99,7 @@ def test_certificate_payload_and_manifest_tampering_fail_closed(self): forged.write_text(json.dumps(changed), encoding='utf-8') with patch.object(generated, 'CERTIFICATE_PATH', forged): self.assertIsNone(self.evidence()) - for relative in ('machine/Cargo.toml', 'platform/Cargo.toml', 'Cargo.lock'): + for relative in ('machine/Cargo.toml', 'os/Cargo.toml', 'Cargo.lock'): with self.subTest(path=relative): path = self.root / relative original = path.read_bytes() @@ -118,27 +118,27 @@ def test_additional_language_remains_data_only(self): self.assertIsNotNone(self.evidence()) # Rust Debug-escaped string, never a source slot. def test_wrong_module_and_same_name_are_not_certified(self): - wrong = self.root / 'platform/src/wrong.rs' + wrong = self.root / 'os/src/wrong.rs' wrong.write_text('pub enum Preference { Payload(std::cell::Cell) }', encoding='utf-8') self.assertIsNone(generated.provenance(self.root, wrong)) self.assertFalse(Proof(self.root, gate).inert(wrong, ['Preference'])) consumer = self.root / 'session/src/shadow.rs' consumer.parent.mkdir(parents=True, exist_ok=True) - consumer.write_text('#[path="../../platform/src/i18n/mod.rs"] mod language;', encoding='utf-8') + consumer.write_text('#[path="../../os/src/i18n/mod.rs"] mod language;', encoding='utf-8') self.assertFalse(Proof(self.root, gate).inert(consumer, ['language', ':', ':', 'Preference'])) def test_all_producer_namespace_and_feature_mutations_fail_closed(self): mutations = [ - ('platform/src/i18n/mod.rs', '/languages.rs', '/other.rs'), - ('platform/src/i18n/mod.rs', 'include!', '#[cfg(feature="rogue")] include!'), - ('platform/src/i18n/mod.rs', 'include!', 'pub enum Preference { Payload(std::cell::Cell) } include!'), - ('platform/src/lib.rs', 'pub mod i18n;', '#[path="other.rs"] pub mod i18n;'), - ('platform/build.rs', 'catalog::build', 'other::build'), - ('platform/build_support/catalog.rs', 'System,\\n', 'System(std::cell::Cell),\\n'), - ('platform/build_support/catalog.rs', 's.variant', 'callback()'), - ('platform/build_support/catalog.rs', 'write("languages.rs"', 'write("rogue.rs"'), + ('os/src/i18n/mod.rs', '/languages.rs', '/other.rs'), + ('os/src/i18n/mod.rs', 'include!', '#[cfg(feature="rogue")] include!'), + ('os/src/i18n/mod.rs', 'include!', 'pub enum Preference { Payload(std::cell::Cell) } include!'), + ('os/src/lib.rs', 'pub mod i18n;', '#[path="other.rs"] pub mod i18n;'), + ('os/build.rs', 'catalog::build', 'other::build'), + ('os/build_support/catalog.rs', 'System,\\n', 'System(std::cell::Cell),\\n'), + ('os/build_support/catalog.rs', 's.variant', 'callback()'), + ('os/build_support/catalog.rs', 'write("languages.rs"', 'write("rogue.rs"'), ('build_support/install_identities.rs', 'pub fn emit', '#[cfg(feature="rogue")] pub fn emit'), - ('platform/Cargo.toml', '[package]', '[features]\nrogue = []\n[package]'), + ('os/Cargo.toml', '[package]', '[features]\nrogue = []\n[package]'), ] for relative, old, new in mutations: with self.subTest(path=relative, mutation=new): @@ -166,7 +166,7 @@ def test_catalogue_injection_schema_and_identifiers_fail_closed(self): self.assertIsNone(self.evidence()) def test_conditional_field_attribute_is_opaque(self): - self.module = self.root / 'platform/src/rogue.rs' + self.module = self.root / 'os/src/rogue.rs' self.module.write_text('enum Holder { Value(#[cfg_attr(feature="rogue", payload)] u32) }', encoding='utf-8') self.assertFalse(Proof(self.root, gate).inert(self.module, ['Holder'])) @@ -176,8 +176,8 @@ def test_grouped_self_import_binds_module_not_self(self): def test_consumer_namespace_shadow_is_not_canonical(self): path = self.root / 'session/src/shadow.rs' path.parent.mkdir(parents=True, exist_ok=True) - path.write_text('mod plx_platform { pub mod i18n { pub enum Preference { Payload(std::cell::Cell) } } }', encoding='utf-8') - self.assertFalse(Proof(self.root, gate).inert(path, ['plx_platform', ':', ':', 'i18n', ':', ':', 'Preference'])) + path.write_text('mod plx_os { pub mod i18n { pub enum Preference { Payload(std::cell::Cell) } } }', encoding='utf-8') + self.assertFalse(Proof(self.root, gate).inert(path, ['plx_os', ':', ':', 'i18n', ':', ':', 'Preference'])) self.assertEqual(imports(['plx_plex', ':', ':', 'probe', ':', ':', '{', 'self', '}']), [('probe', ('plx_plex', 'probe'))]) def change_root_release(self, version, manifest=True, lock=True): diff --git a/ci/test_rename_os_layer.py b/ci/test_rename_os_layer.py new file mode 100644 index 0000000000..9d4b6a2830 --- /dev/null +++ b/ci/test_rename_os_layer.py @@ -0,0 +1,461 @@ +#!/usr/bin/env python3 +"""tools/rename-os-layer.py on synthetic trees: every spelling of `plx_platform` is rewritten and +reversed byte for byte, a second run changes nothing, `--check` flags every old-name site and fails +on a quoted "platform" it cannot classify (a layer list is never a keeper), and `--equivalence` +accepts exactly the enumerated hand edits and nothing else. Each case writes a tiny tree (or a tiny +git repository) to a private temp dir; it reads nothing of the checkout but the script.""" +import contextlib +import importlib.util +import io +import json +import os +import subprocess +import tempfile +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +_spec = importlib.util.spec_from_file_location('rename_os_layer', ROOT / 'tools' / 'rename-os-layer.py') +tool = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(tool) + +LOCK_OLD = '''version = 4 + +[[package]] +name = "plx_net" +version = "0.0.0" +dependencies = [ + "plx_platform", +] + +[[package]] +name = "plx_owp" +version = "0.0.0" + +[[package]] +name = "plx_platform" +version = "0.0.0" +''' +# What cargo writes after the rename: the same lines, the packages re-sorted by name (`plx_os` sorts before `plx_owp`). +LOCK_NEW_SORTED = '''version = 4 + +[[package]] +name = "plx_net" +version = "0.0.0" +dependencies = [ + "plx_os", +] + +[[package]] +name = "plx_os" +version = "0.0.0" + +[[package]] +name = "plx_owp" +version = "0.0.0" +''' + +# path -> text. Each file carries the sites of one class; `NATURAL` files carry `os` meaning the OS. +FILES = { + 'rust-modules/Cargo.toml': '# layers: base/, machine/, net/, platform/, gfx/\n[workspace]\nmembers = [\n "base",\n "platform",\n]\n' + 'plx_platform = { path = "platform" }\nplx_platform = { path = "platform", features = ["test-support"] }\n' + '# see ci/module-layers.ini `[platform]`\n', + 'rust-modules/platform/Cargo.toml': '[package]\nname = "plx_platform"\n[lib]\nname = "plx_platform"\n', + 'rust-modules/platform/src/lib.rs': '//! plx_platform: the `platform` layer.\nuse plx_platform::tv::sink;\n', + 'rust-modules/net/Cargo.toml': 'plx_platform = { path = "../platform" }\n', + 'rust-modules/net/src/lib.rs': '//! it uses `base`, `machine`, `platform` and `net`.\n// see `platform::storage::diagnostics` and keymanager::platform::Client\n', + 'rust-modules/storage/src/main.rs': '#[path = "../../platform/src/storage_service/wire.rs"]\nmod wire;\n', + 'rust-modules/base/src/scrub.rs': 'let roots = [manifest.join("../net/src"), manifest.join("../platform/src")];\n', + 'rust-modules/Cargo.lock': LOCK_OLD, + 'ci/module-layers.ini': '[machine]\nuses = base\n\n[platform]\n# crate `plx_platform` (rust-modules/platform/); also in [port webos]\nuses = base machine\n\n' + '[net]\nuses = base platform\n\n[port webos]\nmembers = webos\n', + 'ci/check-module-layers.py': "order = [s for s in sections if not s.startswith('port ')]\nport = section[len('port '):]\nmsg = f'is listed in [port {port}]'\n", + 'ci/check-deps.sh': 'SRC_PLATFORM=rust-modules/platform/src\nplatform holds forks of its own\n', + 'ci/list-caps.ini': '[platform/src/devcaps.rs::PCM_MAX_CHANNELS]\nreason = x\n', + 'rust-modules/platform/build.rs': '//! Code generation for the platform layer: the catalog.\n', # a LITERALS entry keyed by the head path + 'ci/test_no_host_staticlib.py': 'WORKSPACE_FILES = (".cargo", "base", "machine", "net", "platform", "gfx", "ui")\n', + 'Makefile': 'RUST_INPUTS := $(shell find rust-modules/net rust-modules/platform rust-modules/gfx -type f)\n# chain (base -> platform -> ui/plex)\n' + 'test: ; cargo test -p plx_base -p plx_platform -p plx_gfx\n', + 'tools/cargo-seed.py': 'part("manifest-platform", mb(os.path.join(root, "rust-modules", "platform", "Cargo.toml")))\n', + 'tools/build-bench.py': 'PLATFORM_LEAF_FILE = "rust-modules/platform/src/devcaps.rs"\nALL = ("noop", "leaf", "machine", "platform", "gfx", "net")\n' + ' platform ...after appending one to a leaf file\nTITLES = {\n "platform": "Edit leaf (plx_platform devcaps.rs)",\n}\n', + 'ci/test_build_bench.py': "art('/platform', 'plx_platform', '0.0.0')\nonly = \"noop,leaf,machine,platform,gfx\"\nok(by_id[\"platform\"][\"samples\"])\n" + 'host = doc["host"]["machine"] and doc["host"]["os"]\n', + '.claude/hooks/release-config-check.py': 'for layer in ("base", "machine", "net", "platform", "gfx", "ui"):\n pass\n', + 'docs/module-layers.md': 'The split: `machine/`, `platform/`, `gfx/`. `[net] uses = base platform` and `[port webos]`.\n' + 'The `platform` layer is `plx_platform`; the `[platform]` section.\nnet gfx + platform machine base\n', + # Kept: a quoted `platform` that is not the layer, and the plain word. + 'rust-modules/telemetry/src/telemetry/native.rs': 'json!({"platform": "native"});\nconst K: &[&str] = &[\n "platform",\n];\n', + 'tests/test_replay_fixtures.py': "mock.patch.object(replay.sys, 'platform', 'linux')\n", + 'docs/plex-openapi.json': '{"platform": "MacOSX"}\n', + # `os` already means the operating system. + 'rust-modules/telemetry/src/telemetry/sentry.rs': '/// The `os` context a native crash carries, `"os"` and `"net"`, `"gfx"` none.\nlet k = ["os", "webos", "hardware"];\n', + 'tools/disk-budget.py': '# uses only `os` and `sys`\nuse std::os::raw::c_int;\n', + 'docs/disk-budget.md': 'needs only `os` and `sys` and the host platform\n', + # Exempt: dated records and the plan keep the old name. + 'docs/release-audits/v0.9.0.md': 'rust-modules/platform/src/x.rs plx_platform\n', + 'docs/measurements/acb-2026-11-04.md': 'rust-modules/platform/src/tv/plane.rs\n', + 'docs/some-note-2026-11-16.md': 'plx_platform and `platform`\n', + 'docs/platform-ports.md': 'F36: plx_platform, rust-modules/platform/\n', + # Certificates are regenerated by their producers, never rewritten. + 'ci/proofs/platform-generated-enums.json': json.dumps({'package': 'plx_platform', 'module': 'platform/src/i18n/mod.rs'}, indent=2) + '\n', + 'ci/proofs/serde-json-immutable.json': json.dumps({'owners': {'platform/Cargo.toml': 'abc'}}, indent=2) + '\n', + 'ci/readonly_generated.py': "CERTIFICATE_SHA256 = '" + '1' * 64 + "'\nSOURCES = ['platform/Cargo.toml']\n", + 'ci/readonly_dependencies.py': "CERTIFICATE_SHA256 = '" + '2' * 64 + "'\n", + # Names the new waves bring: neither rewritten nor flagged. + 'docs/ports.md': 'crate plx_platform_webos in rust-modules/platform-webos/ and rust-modules/platform-desktop\n', + 'ci/check-python-steps.txt': 'python3 ci/test_module_graph.py\n', +} +NATURAL = ('rust-modules/telemetry/src/telemetry/sentry.rs', 'tools/disk-budget.py', 'docs/disk-budget.md') +EXEMPT = ('docs/release-audits/v0.9.0.md', 'docs/measurements/acb-2026-11-04.md', 'docs/some-note-2026-11-16.md', + 'docs/platform-ports.md', 'ci/proofs/platform-generated-enums.json', 'ci/proofs/serde-json-immutable.json') + + +def write_tree(root, files): + for rel, text in files.items(): + path = Path(root) / rel + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(text, encoding='utf-8') + + +def read_tree(root): + root = Path(root) + return {str(p.relative_to(root)): p.read_text(encoding='utf-8') for p in sorted(root.rglob('*')) if p.is_file() and '.git' not in p.parts} + + +def run(*args): + """(exit code, stdout) of the tool's main().""" + out = io.StringIO() + with contextlib.redirect_stdout(out), contextlib.redirect_stderr(io.StringIO()): + try: code = tool.main(list(args)) + except SystemExit as exit_: code = exit_.code + return code, out.getvalue() + + +def run_err(*args): + """(exit code, stdout, stderr) of the tool's main().""" + out, err = io.StringIO(), io.StringIO() + with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err): + try: code = tool.main(list(args)) + except SystemExit as exit_: code = exit_.code + return code, out.getvalue(), err.getvalue() + + +def git(root, *args): + env = dict(os.environ, GIT_AUTHOR_NAME='t', GIT_AUTHOR_EMAIL='t@example.invalid', GIT_COMMITTER_NAME='t', GIT_COMMITTER_EMAIL='t@example.invalid', + GIT_CONFIG_GLOBAL=os.devnull, GIT_CONFIG_SYSTEM=os.devnull) + return subprocess.run(['git', '-C', str(root), *args], capture_output=True, text=True, check=True, env=env).stdout + + +class RenameTests(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory(prefix='rename-os-test-') + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) / 'tree' + write_tree(self.root, FILES) + + def test_forward_rewrites_every_spelling(self): + code, out = run('--root', str(self.root)) + self.assertEqual(code, 0, out) + now = read_tree(self.root) + self.assertNotIn('rust-modules/platform/Cargo.toml', now) + self.assertEqual(now['rust-modules/os/build.rs'], '//! Code generation for the os layer: the catalog.\n') + self.assertEqual(now['rust-modules/os/Cargo.toml'], '[package]\nname = "plx_os"\n[lib]\nname = "plx_os"\n') + self.assertEqual(now['rust-modules/os/src/lib.rs'], '//! plx_os: the `os` layer.\nuse plx_os::tv::sink;\n') + self.assertEqual(now['rust-modules/Cargo.toml'], '# layers: base/, machine/, net/, os/, gfx/\n[workspace]\nmembers = [\n "base",\n "os",\n]\n' + 'plx_os = { path = "os" }\nplx_os = { path = "os", features = ["test-support"] }\n# see ci/module-layers.ini `[os]`\n') + self.assertEqual(now['rust-modules/net/Cargo.toml'], 'plx_os = { path = "../os" }\n') + self.assertEqual(now['rust-modules/net/src/lib.rs'], + '//! it uses `base`, `machine`, `os` and `net`.\n// see `os::storage::diagnostics` and keymanager::platform::Client\n') + self.assertEqual(now['rust-modules/storage/src/main.rs'], '#[path = "../../os/src/storage_service/wire.rs"]\nmod wire;\n') + self.assertIn('manifest.join("../os/src")', now['rust-modules/base/src/scrub.rs']) + self.assertEqual(now['rust-modules/Cargo.lock'].count('plx_os'), 2) + self.assertNotIn('plx_platform', now['rust-modules/Cargo.lock']) + self.assertEqual(now['ci/module-layers.ini'], '[machine]\nuses = base\n\n[os]\n# crate `plx_os` (rust-modules/os/); also in [platform webos]\nuses = base machine\n\n' + '[net]\nuses = base os\n\n[platform webos]\nmembers = webos\n') + self.assertEqual(now['ci/check-module-layers.py'], + "order = [s for s in sections if not s.startswith('platform ')]\nport = section[len('platform '):]\nmsg = f'is listed in [platform {port}]'\n") + self.assertEqual(now['ci/check-deps.sh'], 'SRC_OS=rust-modules/os/src\nos holds forks of its own\n') + self.assertEqual(now['ci/list-caps.ini'], '[os/src/devcaps.rs::PCM_MAX_CHANNELS]\nreason = x\n') + self.assertIn('"machine", "net", "os", "gfx"', now['ci/test_no_host_staticlib.py']) + self.assertEqual(now['Makefile'].splitlines()[0], 'RUST_INPUTS := $(shell find rust-modules/net rust-modules/os rust-modules/gfx -type f)') + self.assertIn('base -> os -> ui/plex', now['Makefile']) + self.assertIn('-p plx_os -p plx_gfx', now['Makefile']) + self.assertEqual(now['tools/cargo-seed.py'], 'part("manifest-os", mb(os.path.join(root, "rust-modules", "os", "Cargo.toml")))\n') + self.assertEqual(now['tools/build-bench.py'], 'OS_LEAF_FILE = "rust-modules/os/src/devcaps.rs"\nALL = ("noop", "leaf", "machine", "os", "gfx", "net")\n' + ' os ...after appending one to a leaf file\nTITLES = {\n "os": "Edit leaf (plx_os devcaps.rs)",\n}\n') + self.assertEqual(now['ci/test_build_bench.py'], "art('/os', 'plx_os', '0.0.0')\nonly = \"noop,leaf,machine,os,gfx\"\nok(by_id[\"os\"][\"samples\"])\n" + 'host = doc["host"]["machine"] and doc["host"]["os"]\n') + self.assertIn('("base", "machine", "net", "os", "gfx", "ui")', now['.claude/hooks/release-config-check.py']) + self.assertEqual(now['docs/module-layers.md'], 'The split: `machine/`, `os/`, `gfx/`. `[net] uses = base os` and `[platform webos]`.\n' + 'The `os` layer is `plx_os`; the `[os]` section.\nnet gfx + os machine base\n') + for rel in EXEMPT + ('docs/ports.md', 'rust-modules/telemetry/src/telemetry/native.rs', 'tests/test_replay_fixtures.py', 'docs/plex-openapi.json') + NATURAL: + self.assertEqual(now[rel], FILES[rel], rel) + + def test_second_run_changes_nothing(self): + run('--root', str(self.root)) + first = read_tree(self.root) + code, out = run('--root', str(self.root)) + self.assertEqual(code, 0) + self.assertIn('0 of', out) + self.assertEqual(read_tree(self.root), first) + + def test_reverse_restores_every_byte(self): + run('--root', str(self.root)) + code, _ = run('--root', str(self.root), '--reverse') + self.assertEqual(code, 0) + self.assertEqual(read_tree(self.root), FILES) + + def test_reverse_leaves_the_operating_system_alone(self): + write_tree(self.root, {'rust-modules/net/src/x.rs': 'use std::os::raw; let doc = host["os"]; libc::os::foo();\n'}) + run('--root', str(self.root), '--reverse') + self.assertEqual((self.root / 'rust-modules/net/src/x.rs').read_text(), 'use std::os::raw; let doc = host["os"]; libc::os::foo();\n') + for rel in NATURAL: + self.assertEqual((self.root / rel).read_text(), FILES[rel]) + + def test_check_flags_the_old_tree_and_passes_the_new(self): + code, out = run('--root', str(self.root), '--check') + self.assertEqual(code, 1) + for label in ('1 package plx_platform', '2 path rust-modules/platform', '2 bare path platform/..', '2 manifest path ../platform', + '2 directory `platform/`', '3 layer token [platform]', '3 layer token `platform`', '3 layer token in a list', '3 layer token in the layer table', + '3 layer token platform::member', '3 fence keyword [port X]', '3 SRC_PLATFORM', '3 layer token in a uses line', + 'enumerated site', 'directory still named rust-modules/platform'): + self.assertIn('[' + label + ']', out, label) + self.assertIn('ci/test_no_host_staticlib.py:1: [UNCLASSIFIED quoted "platform"]', out) + self.assertNotIn('native.rs', out.split('kept')[0]) # a keeper is not a problem + run('--root', str(self.root)) + code, out = run('--root', str(self.root), '--check') + # Only the certificates (regenerated by hand) still name the old spelling. + self.assertEqual(code, 1) + self.assertEqual({line.split(':')[0] for line in out.splitlines() if ': [' in line}, + {'ci/proofs/platform-generated-enums.json', 'ci/proofs/serde-json-immutable.json'}) + write_tree(self.root, {'ci/proofs/platform-generated-enums.json': '{"package": "plx_os"}\n', 'ci/proofs/serde-json-immutable.json': '{}\n'}) + code, out = run('--root', str(self.root), '--check') + self.assertEqual(code, 0, out) + self.assertIn('check: 0 old-name sites left', out) + self.assertIn('kept (Sentry event `platform` field)', out) + self.assertIn('kept (sys.platform mock)', out) + + def test_an_unclassified_quoted_platform_fails_and_a_layer_list_is_never_a_keeper(self): + run('--root', str(self.root)) + write_tree(self.root, {'ci/proofs/platform-generated-enums.json': '{}\n', 'ci/proofs/serde-json-immutable.json': '{}\n', + 'tools/new-gate.py': 'LAYERS = "platform", "gfx"\nx = {"platform": 1}\n', + 'rust-modules/telemetry/src/telemetry/list.rs': 'let l = ["base", "machine", "platform", "gfx"];\n'}) + code, out = run('--root', str(self.root), '--check') + self.assertEqual(code, 1) + self.assertIn('tools/new-gate.py:1: [UNCLASSIFIED quoted "platform"]', out) + self.assertIn('tools/new-gate.py:2: [UNCLASSIFIED quoted "platform"]', out) + self.assertIn('rust-modules/telemetry/src/telemetry/list.rs:1: [UNCLASSIFIED quoted "platform"]', out) + + def test_check_flags_a_layer_token_in_a_separator_list_and_a_slash_before_dotdot(self): + run('--root', str(self.root)) + write_tree(self.root, {'ci/proofs/platform-generated-enums.json': '{}\n', 'ci/proofs/serde-json-immutable.json': '{}\n', + 'ci/new-gate.sh': 'for c in net platform gfx; do :; done\n', + 'ci/new-args.sh': 'run --only machine,platform now\n', + 'ci/new-chain.md': 'the chain is base -> platform -> ui\n', + 'ci/new-order.md': 'platform, plex and data are below\n', + 'ci/new-path.py': 'root = os.path.join(x, "/../platform/src")\n', + 'ci/new-path-ok.py': 'root = os.path.join(x, "../os/src", "/../os/src")\n', + 'ci/new-dir.py': 'root = Path("rust-modules/platform/src")\n', + 'ci/new-other-dir.py': 'root = Path("x/platform/src")\n', + 'docs/new-prose.md': 'the platform is a cross-platform thing; ports and the ARM platform stay\n', + 'docs/new-data.md': 'the data platform stays\n'}) + code, out = run('--root', str(self.root), '--check') + self.assertEqual(code, 1) + for path in ('ci/new-gate.sh:1', 'ci/new-args.sh:1', 'ci/new-chain.md:1', 'ci/new-order.md:1'): + self.assertIn(path + ': [3 layer token in a separator list]', out) + self.assertIn('ci/new-path.py:1: [2 bare path platform/..]', out) + self.assertNotIn('ci/new-path-ok.py', out) + # `rust-modules/platform/` keeps its own class; a `/` before `platform/` that is not a `../` prefix + # (`x/platform/src`, some other tree's directory) is not a bare path and is not flagged at all. + self.assertIn('ci/new-dir.py:1: [2 path rust-modules/platform]', out) + self.assertNotIn('ci/new-dir.py:1: [2 bare', out) + self.assertNotIn('ci/new-other-dir.py', out) + # Prose with no layer neighbour is not a site; `data platform` is a neighbour and is a separator hit. + self.assertNotIn('docs/new-prose.md', out) + self.assertIn('docs/new-data.md:1: [3 layer token in a separator list]', out) + + def test_check_flags_a_layer_table_cell_and_platform_layer_or_crate(self): + run('--root', str(self.root)) + write_tree(self.root, {'ci/proofs/platform-generated-enums.json': '{}\n', 'ci/proofs/serde-json-immutable.json': '{}\n', + 'docs/new-table.md': '| layer | members |\n|---|---|\n| platform | `webos storage` |\n| `os::i18n` | platform | strings |\n', + 'docs/new-noun.md': "the platform layer crate's source\nthe platform crate's own build script\n", + 'docs/new-host.md': '| Platform | LG webOS |\nthe webOS platform release, a platform port\n'}) + code, out = run('--root', str(self.root), '--check') + self.assertEqual(code, 1) + for site in ('docs/new-table.md:3', 'docs/new-table.md:4'): + self.assertIn(site + ': [3 layer token in a table cell]', out) + for site in ('docs/new-noun.md:1', 'docs/new-noun.md:2'): + self.assertIn(site + ': [3 layer token before layer/crate]', out) + self.assertNotIn('docs/new-host.md', out) # the host platform, a column heading and a port are not the layer + + def test_both_quote_styles_are_classified(self): + run('--root', str(self.root)) + write_tree(self.root, {'ci/proofs/platform-generated-enums.json': '{}\n', 'ci/proofs/serde-json-immutable.json': '{}\n', + 'tools/other.py': "x = 'platform'\n"}) + code, out = run('--root', str(self.root), '--check') + self.assertEqual(code, 1) + self.assertIn("tools/other.py:1: [UNCLASSIFIED quoted \"platform\"] x = 'platform'", out) + + def test_dry_run_changes_nothing(self): + code, out = run('--root', str(self.root), '--dry-run') + self.assertEqual(code, 0) + self.assertIn('would change', out) + self.assertEqual(read_tree(self.root), FILES) + + +class ReversePatchTests(unittest.TestCase): + PATCH = ( + 'diff --git a/rust-modules/net/src/x.rs b/rust-modules/net/src/x.rs\n' + '--- a/rust-modules/net/src/x.rs\n' + '+++ b/rust-modules/net/src/x.rs\n' + '@@ -10,3 +10,4 @@ fn f()\n' + ' let ctx = 1;\n' + '-// old: the `os` clock\n' + '+// new: the `os` clock and plx_os::tv\n' + '+let layers = ["base", "net", "os", "gfx"];\n' + ' let tail = 2;\n') + + def test_every_weak_rewrite_is_printed_with_its_line_and_the_strong_ones_are_not(self): + patch = Path(tempfile.mkdtemp(prefix='rename-os-patch-')) / 'fix.patch' + self.addCleanup(lambda: patch.parent.exists() and __import__('shutil').rmtree(patch.parent)) + patch.write_text(self.PATCH) + code, out, err = run_err('--reverse-patch', str(patch)) + self.assertEqual(code, 0) + # The rewrite itself is unchanged: the backport still applies. + self.assertIn('+// new: the `platform` clock and plx_platform::tv\n', out) + self.assertIn('+let layers = ["base", "net", "platform", "gfx"];\n', out) + lines = err.splitlines() + self.assertIn('rust-modules/net/src/x.rs:11: // old: the `os` clock -> // old: the `platform` clock', lines) + self.assertIn('rust-modules/net/src/x.rs:11: // new: the `os` clock and plx_os::tv -> // new: the `platform` clock and plx_platform::tv', lines) + self.assertIn('rust-modules/net/src/x.rs:12: let layers = ["base", "net", "os", "gfx"]; -> let layers = ["base", "net", "platform", "gfx"];', lines) + self.assertEqual(len([l for l in lines if ': ' in l and ' -> ' in l]), 3, err) + self.assertNotIn('let ctx', err) # an unchanged context line is silent + + def test_a_patch_with_only_strong_rewrites_prints_nothing(self): + patch = Path(tempfile.mkdtemp(prefix='rename-os-patch-')) / 'fix.patch' + self.addCleanup(lambda: patch.parent.exists() and __import__('shutil').rmtree(patch.parent)) + patch.write_text('diff --git a/rust-modules/os/src/lib.rs b/rust-modules/os/src/lib.rs\n--- a/rust-modules/os/src/lib.rs\n+++ b/rust-modules/os/src/lib.rs\n' + '@@ -1,1 +1,2 @@\n use plx_os::tv;\n+use plx_os::devcaps; // rust-modules/os/src\n') + code, out, err = run_err('--reverse-patch', str(patch)) + self.assertEqual((code, err), (0, '')) + self.assertIn('+use plx_platform::devcaps; // rust-modules/platform/src\n', out) + + +class EquivalenceTests(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory(prefix='rename-os-equivalence-test-') + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) / 'repo' + self.root.mkdir() + git(self.root, 'init', '-q', '-b', 'main') + write_tree(self.root, FILES) + git(self.root, 'add', '-A') + git(self.root, 'commit', '-q', '-m', 'base') + git(self.root, 'tag', 'base') + run('--root', str(self.root)) + # The hand edits the plan allows: the two certificates and their pin lines, the lock re-sorted. + write_tree(self.root, { + 'ci/proofs/platform-generated-enums.json': '{"package": "plx_os"}\n', + 'ci/proofs/serde-json-immutable.json': '{"owners": {"os/Cargo.toml": "def"}}\n', + 'rust-modules/Cargo.lock': LOCK_NEW_SORTED, + }) + for rel, old, new in (('ci/readonly_generated.py', '1' * 64, '3' * 64), ('ci/readonly_dependencies.py', '2' * 64, '4' * 64)): + path = self.root / rel + path.write_text(path.read_text().replace(old, new)) + + def commit(self): + git(self.root, 'add', '-A') + git(self.root, 'commit', '-q', '-m', 'head') + + def test_the_enumerated_edits_are_accepted_and_printed(self): + self.commit() + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 0, out) + self.assertIn('equivalence: ok', out) + self.assertIn('(a certificate) 2 file(s)', out) + self.assertIn('(a pin) 2 file(s)', out) + self.assertIn('(b lock) 1 file(s)', out) + + def test_a_hand_edit_outside_the_classes_fails(self): + self.commit() + path = self.root / 'ci/check-deps.sh' + path.write_text(path.read_text() + 'echo extra\n') + git(self.root, 'commit', '-q', '-am', 'edit') + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 1) + self.assertIn('FAIL [forward(BASE) vs HEAD] ci/check-deps.sh', out) + self.assertIn('FAIL [BASE vs reverse(HEAD)] ci/check-deps.sh', out) + + def test_a_missed_rewrite_fails(self): + path = self.root / 'rust-modules/net/src/lib.rs' + path.write_text(path.read_text().replace('`os`', '`platform`')) + self.commit() + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 1) + self.assertIn('rust-modules/net/src/lib.rs', out) + + def test_a_version_bump_in_the_lock_fails(self): + (self.root / 'rust-modules/Cargo.lock').write_text(LOCK_NEW_SORTED.replace('version = "0.0.0"', 'version = "0.0.1"', 1)) + self.commit() + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 1) + self.assertIn('Cargo.lock differs beyond a re-sort', out) + + def test_a_pin_file_edit_beyond_digests_fails(self): + path = self.root / 'ci/readonly_generated.py' + path.write_text(path.read_text() + "EXTRA = 1\n") + self.commit() + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 1) + self.assertIn('a pin file differs in more than digests', out) + + def test_a_reflow_with_the_same_tokens_is_allowed_and_listed(self): + path = self.root / 'rust-modules/os/src/lib.rs' + path.write_text('//! plx_os: the `os` layer.\nuse plx_os::{\n tv::sink,\n};\n') + self.commit() + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 1, out) # `use plx_os::tv::sink;` -> braces: the `{` `}` tokens are new + path.write_text('//! plx_os: the `os` layer.\nuse plx_os::tv::sink;\n\n') + git(self.root, 'commit', '-q', '-am', 'blank line') + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 0, out) + self.assertIn('(c reflow) 1 file(s)', out) + + def test_the_tool_and_its_test_are_the_fourth_class(self): + write_tree(self.root, {'tools/rename-os-layer.py': '# the tool\n', 'ci/test_rename_os_layer.py': '# its test\n', + 'ci/check-python-steps.txt': 'python3 ci/test_module_graph.py\n# tools/rename-os-layer.py, the rename tool\npython3 ci/test_rename_os_layer.py\n'}) + self.commit() + code, out = run('--root', str(self.root), '--equivalence', 'base') + self.assertEqual(code, 0, out) + self.assertIn('(d tool) 3 file(s)', out) + + + def test_a_post_rename_patch_is_rewritten_to_apply_on_the_old_line(self): + self.commit() + lib, deps, seed = (self.root / 'rust-modules/os/src/lib.rs', self.root / 'ci/check-deps.sh', self.root / 'tools/cargo-seed.py') + lib.write_text(lib.read_text() + '// the `os` layer names plx_os::tv and rust-modules/os/src\n') + deps.write_text(deps.read_text().replace('os holds forks', 'os holds forks (and more)')) + seed.write_text(seed.read_text().replace('part("manifest-os"', 'part("manifest-os", extra=1) or part("manifest-os"')) + git(self.root, 'commit', '-q', '-am', 'a fix written after the rename') + patch = Path(self.temp.name) / 'fix.patch' + patch.write_text(git(self.root, 'diff', 'HEAD~1', 'HEAD')) + reversed_patch = Path(self.temp.name) / 'fix-old.patch' + code, _ = run('--reverse-patch', str(patch), '--output', str(reversed_patch)) + self.assertEqual(code, 0) + text = reversed_patch.read_text() + self.assertIn('diff --git a/rust-modules/platform/src/lib.rs b/rust-modules/platform/src/lib.rs', text) + self.assertIn('the `platform` layer names plx_platform::tv and rust-modules/platform/src', text) + self.assertIn('part("manifest-platform", extra=1)', text) + self.assertNotIn('plx_os', text) + git(self.root, 'checkout', '-q', 'base') # the release line: old names + with self.assertRaises(subprocess.CalledProcessError): git(self.root, 'apply', '--check', str(patch)) + git(self.root, 'apply', '--check', str(reversed_patch)) + git(self.root, 'apply', str(reversed_patch)) + self.assertIn('plx_platform::tv', (self.root / 'rust-modules/platform/src/lib.rs').read_text()) + self.assertEqual(run('--root', str(self.root), '--check')[0], 1) # the old names are back + self.assertNotIn('rust-modules/os', git(self.root, 'diff')) + + +if __name__ == '__main__': + unittest.main() diff --git a/ci/test_storage_package_isolated.py b/ci/test_storage_package_isolated.py index c0613657d2..f4e76da22c 100644 --- a/ci/test_storage_package_isolated.py +++ b/ci/test_storage_package_isolated.py @@ -2,8 +2,8 @@ """Fail if building the storage helper compiles the app library. `plxnative-storage` is the small LS2 service binary that holds the private store; it shares a few -source files with the platform layer crate (`platform/src/storage_service/*.rs`, -`platform/src/storage/state.rs`) but never links the +source files with the os layer crate (`os/src/storage_service/*.rs`, +`os/src/storage/state.rs`) but never links the app crate. While it was a `[[bin]]` of the `plxnative-modules` package, cargo nevertheless built the whole ~423k-line library for it first (a bin of a package depends on that package's lib), so `make check` paid two extra host library builds and the `pkg/plxnative-storage` rule paid a third, diff --git a/ci/test_test_crate.py b/ci/test_test_crate.py index f083c4ba58..023b9400f7 100644 --- a/ci/test_test_crate.py +++ b/ci/test_test_crate.py @@ -210,7 +210,7 @@ def test_the_hostsim_pass_is_exactly_the_crates_that_declare_hostsim(self): every binary is the default pass). A crate left out has an identical test set in both passes: no `hostsim` feature in its manifest and no `feature = "hostsim"` in its source. What the guard does not check is the dependency side: the old pass linked those crates' test binaries - against hostsim-built `plx_base`, `plx_gfx`, `plx_platform`, `plx_media` and `plx_play_feed` + against hostsim-built `plx_base`, `plx_gfx`, `plx_os`, `plx_media` and `plx_play_feed` (`ENV_STEERABLE` paths, glyph-cache sizes, `ffi_host` present), and none of their tests observes those differences. A crate that gains the feature or a cfg fails here until it is added to HOSTSIM_SUITE (and the recipe's `-p` list).""" diff --git a/ci/test_test_fast.py b/ci/test_test_fast.py index a9722e5955..6f89e3e378 100644 --- a/ci/test_test_fast.py +++ b/ci/test_test_fast.py @@ -162,7 +162,7 @@ def test_incremental_in_its_own_target_dir_and_forwards_the_filter(self): self.assertEqual(call["target_dir"], TDIR) self.assertTrue(call["cwd"].endswith("rust-modules"), call["cwd"]) self.assertEqual(call["runtime_dir_set"], "yes") - self.assertRegex(call["args"], r"^\+\S+ test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --no-run --message-format=json-render-diagnostics$") + self.assertRegex(call["args"], r"^\+\S+ test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --no-run --message-format=json-render-diagnostics$") # The filter goes to each test binary (the runner builds first, then runs), not to cargo. self.assertEqual(len(fake.bin_calls()), call["args"].split().count("-p")) self.assertTrue(all(line.endswith("args=route::") for line in fake.bin_calls()), fake.bin_calls()) @@ -171,7 +171,7 @@ def test_no_filter_runs_the_whole_default_feature_suite(self): with FakeCargoHome() as fake: self.assertEqual(fake.run("test-fast").returncode, 0) (call,) = fake.calls() - self.assertRegex(call["args"], r"^\+\S+ test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --no-run --message-format=json-render-diagnostics$") + self.assertRegex(call["args"], r"^\+\S+ test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --no-run --message-format=json-render-diagnostics$") self.assertNotIn("--features", call["args"]) self.assertEqual(len(fake.bin_calls()), call["args"].split().count("-p")) self.assertTrue(all(line.endswith("args=") for line in fake.bin_calls()), fake.bin_calls()) diff --git a/ci/test_transition_arguments.py b/ci/test_transition_arguments.py index 59c3a83ec2..f0710b543a 100644 --- a/ci/test_transition_arguments.py +++ b/ci/test_transition_arguments.py @@ -96,11 +96,11 @@ def read(path, *args, **kwargs): return source if path.resolve() == target else old(path, *args, **kwargs) with patch.object(Path, 'read_text', read): problems, report = gate.check(ROOT / 'rust-modules', ROOT / 'ci/machines.ini') - self.assertEqual(sum(line.startswith('machine ') for line in report), 10) + self.assertEqual(sum(line.startswith('machine ') for line in report), 11) self.assertTrue(any('unbound transition argument' in p for p in problems), problems) def test_every_cohort_machine_rejects_unbound_arguments(self): - self.assertEqual(len(ENTRIES), 10) + self.assertEqual(len(ENTRIES), 11) for section in ENTRIES: for extra in ('next: RawState', 'renamed: RawAlias', 'ctx: Context', 'extra: u64', 'next: &RawState', 'next: &mut RawState', 'cb: fn(RawState)', @@ -200,7 +200,7 @@ def test_actual_session_tick_and_entire_cohort(self): source = (ROOT / 'rust-modules/session/src/auth/owner.rs').read_text(encoding='utf-8') self.assertIn('tick_ms: u32', source) problems, report = gate.check(ROOT / 'rust-modules', ROOT / 'ci/machines.ini') - self.assertEqual(sum(line.startswith('machine ') for line in report), 10) + self.assertEqual(sum(line.startswith('machine ') for line in report), 11) self.assertEqual(problems, []) diff --git a/ci/test_ui_boundaries.py b/ci/test_ui_boundaries.py index d0473fd4ab..09715e2e2f 100644 --- a/ci/test_ui_boundaries.py +++ b/ci/test_ui_boundaries.py @@ -185,11 +185,11 @@ def test_shared_scrub_helper_uses_the_same_persistent_guard(self): def test_adjacent_root_install_and_profile_aliases_fail(self): for source in ( - 'impl RootPage { fn rebuild() { plx_platform::i18n::saved_preference(); } }', + 'impl RootPage { fn rebuild() { plx_os::i18n::saved_preference(); } }', 'impl RootPage { fn rebuild() { plx_media::route::under_posters(); } }', 'use plx_media::route as playback; impl RootPage { fn rebuild() { playback::under_posters(); } }', 'use plx_media::route::{under_posters as read}; impl RootPage { fn rebuild() { read(); } }', - 'use plx_platform::i18n::saved_preference as pick; impl LanguagePage { fn new() { pick(); } }', + 'use plx_os::i18n::saved_preference as pick; impl LanguagePage { fn new() { pick(); } }', 'impl LanguagePage { fn pending() { i18n::current().preference(); } }', ): with self.subTest(source=source): diff --git a/docs/agent-reference.md b/docs/agent-reference.md index 4d50337eed..634862836d 100644 --- a/docs/agent-reference.md +++ b/docs/agent-reference.md @@ -221,10 +221,10 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y what the user can reach, which is the only class that is tracked rather than accepted; `--sites` lists every hit with its class. CI runs the three cargo targets plus those two as five parallel jobs (`host-lint`, `host-unit-default`, `host-unit-hostsim`, `host-python`, `host-python-harness`) behind an aggregator named - `host checks (NOT a device gate)`; `ci/test_ci_split.py` pins that no gate falls between them. The cargo half runs `cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens` + `host checks (NOT a device gate)`; `ci/test_ci_split.py` pins that no gate falls between them. The cargo half runs `cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp` **on the default feature set, and again with `--features hostsim` for the crates that declare it (`HOSTSIM_SUITE`: all of `UNIT_SUITE` except `plx_net`, `plx_ui`, `plx_appkit`, `plx_screens`, - `plx_media_codecs`, `plx_play_uri` and `plx_playback_contract`, which have no `hostsim` cfg and run the + `plx_media_codecs`, `plx_play_uri`, `plx_playback_contract` and `plx_owp`, which have no `hostsim` cfg and run the same test names in both passes; `ci/test_test_crate.py` fails if one gains the feature or a cfg)**, which is not a duplicate run. The host feed seam (`play-feed/src/ffi_host.rs`) exists ONLY in the hostsim configuration, so every test that drives an access unit through `sf_feed` is compiled out of the @@ -267,7 +267,7 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y SDL event loop where no host test can see it. Needs the **clippy component of the pinned toolchain** (`make setup-rust` installs it with `--profile minimal --component clippy`). - `make test-fast [T=filter]` — **opt-in** incremental inner loop: the same default-feature - `cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens` as `check-cargo-unit-default` (throwaway runtime root, telemetry env), but + `cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp` as `check-cargo-unit-default` (throwaway runtime root, telemetry env), but with `CARGO_INCREMENTAL=1` in its own `rust-modules/target-fast` (gitignored). `T=route::` is the test-name filter, handed to every one of the per-crate test binaries; each prints its own libtest `test result:` line (the counts are per crate, never one total), followed by the wrapper's summary line. Use it for a long series of @@ -338,8 +338,10 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y `bundle_read`, `archive_read` (the 1.0 ZIP container), `svg_check` (the SVG gate in front of nanosvg), `address_parse`, `catalog_parse` (the registry index), `catalog_verify` (the signed index: no input is accepted under the shipped keys; the fuzzer's bytes are also signed with the data layer's TEST ONLY keys to reach what - follows the signature check), `catalog_cache` (its cache record, verified again) and `ws_frame` (the - WebSocket codec, `plx_net::ws`: the server's upgrade answer and frames, split at any byte). Each target + follows the signature check), `catalog_cache` (its cache record, verified again), `ws_frame` (the + WebSocket codec, `plx_net::ws`: the server's upgrade answer and frames, split at any byte) and `owp_json` + (the Open Watch Party reader, `plx_owp::json`: the scan keeps the length, and the visitor marks the same strings + and numbers as the scan). Each target asserts only what its code promises (no panic, the documented bounds, round trips) and a crash fails the run, with the input in `fuzz/artifacts//`. The package is a top-level `fuzz/` with its own `[workspace]`, so no shipped `Cargo.toml` names it and no shipped build changes; it depends on the layer @@ -349,7 +351,7 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y (the shared crates are exactly the shipped versions), builds with the nightly named by `FUZZ_TOOLCHAIN` (default `nightly`; CI names a dated one; `cargo install cargo-fuzz --locked` once) in `rust-modules/target-fuzz` (3.1 GiB after a cold build of the first eight targets, plus 83 MiB for - `ws_frame`; `make disk` lists it), generates the seeds from + `ws_frame` and 49 MiB for `owp_json`; `make disk` lists it), generates the seeds from the fixtures, the examples and the icons the repository already has plus a dictionary from the published schemas, and runs the targets one after another. A corpus is thousands of tiny files read and written all run long: on a slow or shared disk (the external one a lane may sit on) set `FUZZ_WORK=` to move seeds, @@ -381,12 +383,12 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y - **CI build health** — four tools keep the build from growing unnoticed, and none of them is a device gate. - *Timings artifact.* `host-unit-default` compiles the test binary in its own step with - `cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --no-run --timings`, then `make check-cargo-unit-default` runs against what that + `cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --no-run --timings`, then `make check-cargo-unit-default` runs against what that built (`--timings` is not part of cargo's fingerprint: checked 2026-10-02 by building with and without it and getting `Fresh` for `plxnative-modules` both ways, so the step moves the compile rather than adding one). Download `cargo-timings-host-unit-default` from the run page ("Artifacts", kept 14 days) and open `cargo-timing.html`: it names the crates on the critical - path. Locally: `cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --no-run --timings` writes + path. Locally: `cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --no-run --timings` writes `target/cargo-timings/cargo-timing.html`. - *Trends.* `tools/ci-durations.py [--runs 30] [--recent 5] [--json]` reads the last 30 successful `main` runs of CI and Simulator CI through `gh api` and prints, per job, the median and p90 and @@ -462,10 +464,10 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y before/after table instead of an ad-hoc scratch-script number. It prints a Markdown table (median / min / max over `--runs`, default 3, the scenarios interleaved round by round) and, with `--json`, a machine-readable document (git sha, `rustc -V` of the pinned toolchain, host, per-run load and swap). Rows: - a **no-op** host test build (`cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens --no-run`; it reports from cargo's JSON `fresh` + a **no-op** host test build (`cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp --no-run`; it reports from cargo's JSON `fresh` flag whether the app crate was rebuilt and flags a recompile as UNEXPECTED, the `ci/test_build_not_always_dirty.py` hazard); an **edit-rebuild** after appending a comment to a - leaf file of each crate (`plx_base`'s `cbuf.rs`, `plx_machine`'s `landgate.rs`, `plx_platform`'s `devcaps.rs`, `plx_gfx`'s `overdraw.rs`, `plx_net`'s `stream_redirect.rs`, `plx_ui`'s `dwell.rs`, `plx_plex`'s `retry.rs`, `plx_telemetry`'s `window.rs`, `plx_data`'s `tape.rs`, `plx_session`'s `scripted.rs`, `plx_media`'s `units.rs`, `plx_appkit`'s `skip_pill.rs`, `plx_screens`'s `clock_readout.rs`, the application's `coldstart.rs`) and to a hub (`plx_ui`'s `lib.rs`), non-incremental (`CARGO_INCREMENTAL=0`, the + leaf file of each crate (`plx_base`'s `cbuf.rs`, `plx_machine`'s `landgate.rs`, `plx_os`'s `devcaps.rs`, `plx_gfx`'s `overdraw.rs`, `plx_net`'s `stream_redirect.rs`, `plx_ui`'s `dwell.rs`, `plx_plex`'s `retry.rs`, `plx_telemetry`'s `window.rs`, `plx_data`'s `tape.rs`, `plx_session`'s `scripted.rs`, `plx_media`'s `units.rs`, `plx_appkit`'s `skip_pill.rs`, `plx_screens`'s `clock_readout.rs`, the application's `coldstart.rs`) and to a hub (`plx_ui`'s `lib.rs`), non-incremental (`CARGO_INCREMENTAL=0`, the default `target`) and incremental (`CARGO_INCREMENTAL=1`, `target-fast`; skipped with a note when that tree is absent unless `--cold`); the **unit suite** run on a warm tree, through the same `tools/cargo-test-parallel.py` wrapper the Makefile's recipes use (`UNIT_RUN` in `print-bench-config`), with its `test @@ -942,7 +944,7 @@ the pinned Sentry Native cross-build), and `sshpass` (Homebrew; deploy/run use y else's checkout. It type-checks the bare `--no-default-features` set, which drops `play-uri` and `play-feed` too (a build with no playback backend), so it does not replace `make check-nodef`, which passes the Makefile's `RUST_BACKEND_FEATURES`. It type-checks after every edit to a `rust-modules/src/**.rs` or one of the thirteen layer crates it lists (it does not watch `playback-contract`, `media-codecs`, - `play-feed` or `play-uri`; `make check-nodef` is the only gate that compiles them in the shipping set); it costs well under a second warm, because cargo keys + `play-feed` or `play-uri`, for which `make check-nodef` is the only gate that compiles them in the shipping set, nor `owp`, which the application does not link yet); it costs well under a second warm, because cargo keys fingerprints by feature set and the two configurations coexist in one `target/`. The hazard it guards is hand-written `#[cfg(feature = "devtriggers")]` PAIRS, where a spliced-in function swallows a neighbour's attribute — `devtrig::latched_flag!` exists to avoid most of them. @@ -1951,7 +1953,7 @@ behaviour; real GL copies, glyphs and presentation still need a device capture w There **is** a host unit suite, and it is not the real gate — both halves matter, and conflating them is how this section used to be wrong in three files at once. -**Tier 1 — `make check` (host).** `cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens` (a bare `cargo test --lib` runs the application crate only and skips every layer crate: `plx_base`, `plx_machine`, `plx_platform`, `plx_gfx`, `plx_net`, `plx_ui`, `plx_plex`, `plx_telemetry`, `plx_data`, `plx_session`, `plx_media`, `plx_appkit`, `plx_screens`) runs the whole +**Tier 1 — `make check` (host).** `cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp` (a bare `cargo test --lib` runs the application crate only and skips every layer crate: `plx_base`, `plx_machine`, `plx_os`, `plx_gfx`, `plx_net`, `plx_ui`, `plx_plex`, `plx_telemetry`, `plx_data`, `plx_session`, `plx_media`, `plx_appkit`, `plx_screens`) runs the whole host suite on the dev Mac, no TV involved — and `make check` runs the crates that declare `hostsim` (`HOSTSIM_SUITE`, a subset of that list) a SECOND time under `--features hostsim`, because the host feed seam only exists there and the tests that need it are compiled out of the first pass (the build @@ -1961,7 +1963,7 @@ documented 59 before that, which was five times stale before anyone noticed — of this paragraph was stale within one *commit*, because two agents were adding tests to the same batch that documented it. Three numbers have now rotted here, so do not add a fourth: the only count worth having is the one you take yourself, with -`cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -- --list | grep -c ': test'`. **The per-module counts +`cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp -- --list | grep -c ': test'`. **The per-module counts below have the same disease and are worse**, because a stale one reads as precise rather than round — several were written when the module was a third its present size, and two bullets have now outlived the file they named: `ui/home.rs` (retired to `screens/home/`) and `route.rs` (split in diff --git a/docs/hud-plugins.md b/docs/hud-plugins.md index 5426e14488..194adb9779 100644 --- a/docs/hud-plugins.md +++ b/docs/hud-plugins.md @@ -186,7 +186,7 @@ Captions (`player_hud.rs:155-164`). Readers of the band: `player_hud.rs:15`, `:155-163`, `:304-322`, `:477`; `text_style.rs:68`, `:192-195`; `screens/src/player/ass_subtitles.rs:271` (test `:398`); `media/src/player/ass/tests/synth.rs:443-447`; `plex/src/plex/session.rs:1076` (doc). Media cannot name - appkit (`ci/module-layers.ini` `[media] uses = base machine platform gfx net plex telemetry data`). + appkit (`ci/module-layers.ini` `[media] uses = base machine os gfx net plex telemetry data`). Captions drew first and the HUD over them (`screens/src/player/mod.rs:1513-1525`, `:1539-1541`), so an open Info card (top 668) or strip (684) covered a caption lifted to 780 until PR17, which lifts the caption clear of it and draws it above the section (section "Captions"). @@ -195,7 +195,7 @@ Captions What must be inside is what the viewer has to read or press" (`:88-93`). Layers, Sans-IO, settings, replay -- F30. `ci/module-layers.ini`: `[ui] uses = base machine platform gfx`; `[data]` members by name; +- F30. `ci/module-layers.ini`: `[ui] uses = base machine os gfx`; `[data]` members by name; `[appkit] members = appkit`; a new top-level module "fails the gate until it is placed here"; `[data] uses` has no `ui` (`:120`). `ui/src/CLAUDE.md:279`: the ui library is "never an application type". - F31. `docs/sans-io.md:12-17`: a machine "starts no worker, makes no network, storage or LS2 call, and diff --git a/docs/lab-diagnostics.md b/docs/lab-diagnostics.md index 3228f7a1c2..d74a00ee2f 100644 --- a/docs/lab-diagnostics.md +++ b/docs/lab-diagnostics.md @@ -170,7 +170,7 @@ by forgetting a flag. | file | what it owns | | --- | --- | | `lab/mod.rs` | the feature boundary, boot/config gating and the main-thread control mailbox seam | -| `labcfg/config.rs` | (a `platform` module, so `ui/` and `screens/` can ask `labcfg::is_trigger_key` and `labcfg::menu_row_enabled`) reads `lab.json` **from the app directory** (`paths::in_app_dir("lab.json")`) once at boot: `{endpoint, session, secret, pin, control, trigger_wcodes[]}`. Absent or malformed → the feature is inert and says so in one log line. Missing `control` is false, so an older package remains upload-only. | +| `labcfg/config.rs` | (a `os` module, so `ui/` and `screens/` can ask `labcfg::is_trigger_key` and `labcfg::menu_row_enabled`) reads `lab.json` **from the app directory** (`paths::in_app_dir("lab.json")`) once at boot: `{endpoint, session, secret, pin, control, trigger_wcodes[]}`. Absent or malformed → the feature is inert and says so in one log line. Missing `control` is false, so an older package remains upload-only. | | `lab/control.rs` | one persistent pinned HTTPS long-poll worker, ordered command parsing, the main-thread mailbox, dispatch acknowledgement and bounded reconnect backoff | | `base/src/eventlog/ring.rs` | the bounded buffer: `VecDeque<(u32 t_ms, String)>`, capped by **both** 4000 records and 768 KB of text, evicting oldest, counting evictions. One `Mutex`. | | `lab/snapshot.rs` | envelope construction from `Diag` + `webos` + `devcaps` + `paths` + uptime. Pure and host-testable. | @@ -441,7 +441,7 @@ not pretending the old filesystem contract exists. * `make check` is green in both configurations. **Take the counts yourself** — this repository has rotted four written test counts already and the fifth is not going to be this one: - `cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_platform -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -- --list | grep -c ': test'`, with and without + `cd rust-modules && cargo test --lib -p plxnative-modules -p plx_base -p plx_machine -p plx_os -p plx_gfx -p plx_net -p plx_ui -p plx_plex -p plx_telemetry -p plx_data -p plx_session -p plx_media -p plx_playback_contract -p plx_play_uri -p plx_play_feed -p plx_media_codecs -p plx_appkit -p plx_screens -p plx_owp -- --list | grep -c ': test'`, with and without `--features lab-diagnostics`. What the feature's own tests cover: the ring's two caps and its `dropped` delta, the `lab.json` parse and each refusal it names, the five scrub rewrites and the outright refusal (including the bare address and the household name the device test found), the diff --git a/docs/launch-links.md b/docs/launch-links.md index 8e221a0eea..e4b3473d5e 100644 --- a/docs/launch-links.md +++ b/docs/launch-links.md @@ -2,7 +2,7 @@ Another app on the television (a launcher's Continue Watching row, say) can open a Plex title in PlxNative by passing it in the launch parameters. The code is `rust-modules/src/app/deeplink.rs`; -the argument plumbing is `rust-modules/platform/src/tv/launch.rs`. +the argument plumbing is `rust-modules/os/src/tv/launch.rs`. ## The contract diff --git a/docs/localization.md b/docs/localization.md index 2edf9bd840..a7fc18236d 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -58,7 +58,7 @@ context and wrapping; do not include tokens, private server addresses or persona ## Check and submit -Run `make check` (or, while iterating, `make test-crate C=plx_platform T=catalog`) to validate catalogs and run the host checks. Let it finish before starting +Run `make check` (or, while iterating, `make test-crate C=plx_os T=catalog`) to validate catalogs and run the host checks. Let it finish before starting another build in the same checkout: its structure-gate tests temporarily modify source files. Every build rejects duplicate, missing or unknown keys, invalid placeholders, incomplete plural forms, or a translation of an English-only message. The generated accessors also make unknown message keys and wrong argument types compilation errors. Source @@ -100,7 +100,7 @@ a sentence. Note any wording they changed and why. A UI language is `locales//` plus its entry in `locales/languages.json`. Month-and-day captions also need the language's abbreviated and full format-month names in -`LocaleContext::month_day` (`rust-modules/platform/src/i18n/mod.rs`), with tests for both widths. +`LocaleContext::month_day` (`rust-modules/os/src/i18n/mod.rs`), with tests for both widths. Use the grammatical form that follows a day number (for Polish, `12 marca`, not `12 marzec`; for Russian, `12 марта`, not `12 март`). 1. Add the catalog directory, named by the bare language tag (`it`, not `it-IT`), translating all @@ -116,7 +116,7 @@ Use the grammatical form that follows a day number (for Polish, `12 marca`, not ICU's own data, and another checks that ICU has the language's number and plural data. 3. Add launcher metadata, `pkg/resources//appinfo.json`, and verify every character in both bundled font faces (the build tests do). -4. Run `make test-crate C=plx_platform T=catalog`. A directory with no registry entry, an entry with +4. Run `make test-crate C=plx_os T=catalog`. A directory with no registry entry, an entry with no directory, a missing or extra key, a missing or never-selected plural form and a wrapped translation are build errors that name the file and key, all listed at once. diff --git a/docs/module-layers.md b/docs/module-layers.md index 7acababeac..f3d15e3572 100644 --- a/docs/module-layers.md +++ b/docs/module-layers.md @@ -8,22 +8,22 @@ L14, which a split hides from them, and the gate does not check impl coherence. off behind a port, so that another TV OS can be a second port. L15 is **gate-complete**: its 44 entries are gone, and the gate fails on any reference from outside the port to a member of it. It is not done in the sense of its own goal. L15b, the OS-neutral port, is open (below). Neither holds -up the split. **Thirteen of the fourteen layers, `base`, `machine`, `platform`, `gfx`, `net`, `ui`, +up the split. **Thirteen of the fourteen layers, `base`, `machine`, `os`, `gfx`, `net`, `ui`, `plex`, `telemetry`, `data`, `session`, `media`, `appkit` and `screens`, are their own crates, -`plx_base`, `plx_machine`, `plx_platform`, `plx_gfx`, `plx_net`, `plx_ui`, `plx_plex`, `plx_telemetry`, +`plx_base`, `plx_machine`, `plx_os`, `plx_gfx`, `plx_net`, `plx_ui`, `plx_plex`, `plx_telemetry`, `plx_data`, `plx_session`, `plx_media`, `plx_appkit` and `plx_screens`** (`rust-modules/base/`, -`machine/`, `platform/`, `gfx/`, `net/`, `ui/`, `plex/`, `telemetry/`, `data/`, `session/`, `media/`, +`machine/`, `os/`, `gfx/`, `net/`, `ui/`, `plex/`, `telemetry/`, `data/`, `session/`, `media/`, `appkit/` and `screens/`; "Split 1: base" to "Split 13 (screens)" below, and "Splits 9 and 10 together" for how those two were combined). **The split is finished.** What is left in `rust-modules/src/` is the last layer, `app`, and it stays the top crate `plxnative-modules`: the loop, its adapters, every dev and diagnostic surface, and the application's side of the port -(`port`, `system`, and the other `[port webos]` members that are not in a layer crate). They are +(`port`, `system`, and the other `[platform webos]` members that are not in a layer crate). They are the one `staticlib` the Makefile links and the one place that may name every other layer, so there -is nothing below it to split off. **Decision: the `[port webos]` members stay where they are** -(`webos`, `keymanager` and `system` are modules of `plx_platform` (the Starfish sink is +is nothing below it to split off. **Decision: the `[platform webos]` members stay where they are** +(`webos`, `keymanager` and `system` are modules of `plx_os` (the Starfish sink is `webos::video_sink`), and `port` of the top crate) **until a second TV OS exists.** A port crate now would have one customer and a boundary drawn from guesses about the second; the fence in `ci/check-module-layers.py` -(a reference from outside `[port webos]` to a member of it fails) already holds the line a crate +(a reference from outside `[platform webos]` to a member of it fails) already holds the line a crate would, and L15b is where the port's OS-neutral shape is worked out. The gate is `ci/check-module-layers.py` and its config is `ci/module-layers.ini`. @@ -64,8 +64,8 @@ formed one strongly connected component** from production references alone. Only outside it. `ci/check-module-layers.py --cycles` prints the current components, with the config's members (`ui::machine`, `diag::zlib`, …) as separate nodes. After L14 every production component sat inside one layer: media's `abr curlio ff hls player route`, data's eight modules, app's `app -dev textinput`, platform's `i18n storage webos`, gfx's `gfx gpu_timer overdraw`, plex's `http -plex`, telemetry's `diag telemetry` and machine's `ui::machine ui::present`. L15 took the platform +dev textinput`, os's `i18n storage webos`, gfx's `gfx gpu_timer overdraw`, plex's `http +plex`, telemetry's `diag telemetry` and machine's `ui::machine ui::present`. L15 took the os one apart (`webos` is behind the port, and `tv` names neither `i18n` nor `storage`: the release line is `i18n::webos_release_line`, and the port installs the storage helper's activator through `storage::client::install_activator`), so seven components remain, the others unchanged. A cycle @@ -94,21 +94,22 @@ in `screens` above it; `media` also draws through `gfx`. ``` app everything below -screens appkit ui media session data telemetry plex net gfx + platform machine base -appkit ui media session data telemetry plex net gfx + platform machine base -media data telemetry plex net gfx playback_contract media_codecs + platform machine base -session telemetry plex net + platform machine base -data telemetry plex net playback_contract + platform machine base -ui gfx + platform machine base -telemetry plex net + platform machine base -plex net + platform machine base -net + platform base -gfx + platform machine base -play_feed net playback_contract media_codecs + platform base -play_uri playback_contract + platform base +screens appkit ui media session data telemetry plex net gfx + os machine base +appkit ui media session data telemetry plex net gfx + os machine base +media data telemetry plex net gfx playback_contract media_codecs + os machine base +session telemetry plex net + os machine base +data telemetry plex net playback_contract + os machine base +ui gfx + os machine base +telemetry plex net + os machine base +plex net + os machine base +net + os base +gfx + os machine base +play_feed net playback_contract media_codecs + os base +play_uri playback_contract + os base media_codecs playback_contract + base playback_contract + base -platform machine base +owp +os machine base machine base base ``` @@ -117,7 +118,7 @@ base |---|---|---:|---:| | base | `eventlog paths task cbuf sha256 sha1 b64 spki dynlib checkpoint storage_worker fontcov surface tile hold detail_parts devtrig diag::{zlib,spans,heartbeat} testlock testnet testscratch testrace` | 9k | everything | | machine | `ui::{machine,present,idle,landgate,landing,motion}` | 4k | 97% | -| platform | `webos storage keymanager devcaps imgcache i18n labcfg tv` | 11k | 96% | +| os | `webos storage keymanager devcaps imgcache i18n labcfg tv` | 11k | 96% | | gfx | `gfx egl text rtl img svg gpu_timer hwcnt overdraw dump` | 15k | 68% | | net | `net stream ws` | 6k | 74% | | plex | `plex http` | 26k | 72% | @@ -157,7 +158,7 @@ drives `Venc`); it names neither `media` nor Plex. `ci/check-deps.sh` reads the whole crate for the same IO and clock gates as every other layer. `play_feed` is a seventeenth layer, declared the same way. Its crate is `plx_play_feed` -(`rust-modules/play-feed/`) and it names `base`, `platform`, `net`, `playback_contract` and `media_codecs`: the +(`rust-modules/play-feed/`) and it names `base`, `os`, `net`, `playback_contract` and `media_codecs`: the buffer-feed backend (the guarded transport, the physical FFmpeg demuxer and HLS parser, the native payload construction and executor, which implement the Feed port traits) and the simulator's `VideoSink` stand-in (`ffi_host`, behind that crate's `hostsim` feature). It was `plx_media::player`'s own until the player stopped @@ -169,18 +170,28 @@ Feed through a dev-dependency edge; `ci/check-deps.sh` reads the whole crate for every other layer. `play_uri` is an eighteenth layer, declared the same way. Its crate is `plx_play_uri` -(`rust-modules/play-uri/`) and it names `base`, `platform` and `playback_contract`: the URI backend (the +(`rust-modules/play-uri/`) and it names `base`, `os` and `playback_contract`: the URI backend (the `com.webos.media` protocol and request lifecycle, the ACB bind machine and its envelope map, the picture gate, and the product driver `UriBackend`, which implements the contract's `UriDriver`) and the developer probe's machine and driver (`uriprobe`, `uriprobe_drive`, `devtriggers` builds only). `plx_media` does not name it: the route planner and the player adapter see only the contract's traits and the `UriProbe` port, and the application composes the driver (`app/adapters/backends.rs`, behind the application crate's `play-uri` feature, which the release build passes -explicitly) and the probe (`dev/uriprobe.rs`). The driver is compiled into every build that has the feature. +explicitly) and the probe (`dev/uriprobe.rs`). The driver tells the route which display it can show a source on as +the contract's `DisplayEvidence` (`UriDriver::display`), so the route never names the driver's window, plane or +binding. The driver is compiled into every build that has the feature. Production offers it a source only for a viewer who turned on Settings > Video & playback > Playback engine > -Experimental: `media::route::uri_preflight::ProductQualifier` answers `Unknown` for everyone else, for an original +Experimental: the application's `ProductQualifier` (`app/adapters/backends.rs`) answers `Unknown` for everyone else, for an original Standard would not direct-play (the plan's own `StandardDirectPlay` verdicts for the video, Dolby Vision, audio and container, not the server's decision, which the offer precedes), and for a converted PMS output. `ci/check-deps.sh` reads the whole crate for the same IO and clock gates as every other layer. +`owp` is a nineteenth layer, declared the same way. Its crate is `plx_owp` (`rust-modules/owp/`); it +names no other layer and no `plx_*` crate, so it can be used on its own: the Open Watch Party client protocol, sans-IO. It holds the JSON reader that keeps +unpaired surrogate escapes visible to the checks, the message codec, the checks on names, room codes, the +relay list, descriptors and room snapshots, the clock sync and the room timeline, each run against the +vendored conformance vectors in `rust-modules/owp/fixtures/`. The WebSocket under it is `plx_net::ws`; the +application does not name the crate yet. `ci/check-deps.sh` reads the whole crate for the same IO and clock +gates as every other layer, and as machine code. + The Watchlist adds two data modules and no new edge. `watchlist` (rows, match table, `TileState`, intent ledger, comparator; with `stores::watchlist`) and `catalog` (the Discover-only item page; with `stores::catalog`) name only layers below data, chiefly `plx_plex`: `plex::watchlist`, `Client::find_by_guids`, `plex::session` @@ -200,7 +211,7 @@ Four choices that were not obvious: types (`metadata::Stream`, `Dovi`, the metadata store) 84 times in production code and 191 times in tests. The data layer names `media` 11 times. With this order the baseline is 231 entries and 783 production references; the reverse order gives 254 and 856. -- **machine sits below platform.** The runtime names nothing above `base`. `webos` already wakes +- **machine sits below os.** The runtime names nothing above `base`. `webos` already wakes the frame through `ui::idle::invalidate`, and `auth`, `stores` and `plex` are written against `ui::machine`. - **appkit sits between media and screens.** It was added by L10, which planned to move the player @@ -213,10 +224,10 @@ Four choices that were not obvious: flags (`plx_play_feed::shared::FEED_TX`), which `plx_media` stopped re-exporting when it stopped depending on a backend (W3h): a dev-dependency edge, so `[screens] uses` lists `play_feed` and no production code of `screens` may name it. -- **The webOS port is a fence, not a layer.** `[port webos]` lists `webos` (which holds - `webos::video_sink`), `keymanager`, `system` and `port`, which stay in `platform` and `app` above, and +- **The webOS port is a fence, not a layer.** `[platform webos]` lists `webos` (which holds + `webos::video_sink`), `keymanager`, `system` and `port`, which stay in `os` and `app` above, and nothing outside the port may name them. A layer on top would say the same thing, but then the - modules in `platform`, `plex` and `telemetry` that named webOS before L15 would have held up + modules in `os`, `plex` and `telemetry` that named webOS before L15 would have held up those layers' extraction until it was finished, video sink and all. As a fence it held the line without blocking the split. The gate no longer sees a reference into the port from outside, so it can become a crate on top. L15b is the open step that makes it a port another OS could fill. @@ -237,7 +248,7 @@ tables say so, but `check-deps.sh`'s `layer` gate scans only `screens/`. - a reference, production **or** `cfg(test)`, names a layer its own layer does not `use`, and `ci/allow/layers.txt` has no entry for that (file, member) pair; - a reference from outside a port names one of the port's members, with no entry either, and the - list is empty. A port (`[port webos]`, step L15) is not a layer, and a port reference never held + list is empty. A port (`[platform webos]`, step L15) is not a layer, and a port reference never held up the split; - an allowlist entry has gone stale. `--prune` drops fixed entries, and `tests/test_harness.py` pins the count; @@ -301,11 +312,11 @@ proves the references are gone and nothing more; L15b is open. |---|---:|---| | **L1** log core to base — **done** | 72 / 325 | `log`, `redact_tokens`, `events_log`, `open_log_append`, `write_log_line` and their tests moved from `lib.rs` to `eventlog.rs` in `base`. `log` calls `eventlog::ring::record` directly (`lab::record` was a one-line wrapper of it and is gone), and all 473 references in 95 files name `crate::eventlog::log`. The log's own guards moved under it too (`diag::scrub` and `diag::ring`, which named nothing but `redact_tokens`, are `eventlog::{scrub, ring}`), and `paths::app_dir` no longer logs: the boot preamble writes the same `appdir:` line from `paths::app_dir_line()`. So `eventlog` names nothing but `paths`, `paths` names nothing, and both sit outside every cycle. | | **L2** dev trigger primitives to base — **done** | 28 / 68 | The primitives (`read`, `flag`, `latched_flag!`, `read_sample`, `controlled_trigger`, `listed`, `guard_log_only`, `no_wan`, `holdload_delay_ms`) are the base module `devtrig`, which every caller names; the typed triggers moved beside their one consumer (`abr_pin` to `abr::ladder`, `PlayUrl`/`PlayDovi` to `player::playurl`, now `plx_playback_contract::playurl` with the parse in `plx_play_feed::playurl`), and the scenario reads lower layers made moved down rather than becoming hooks (`auth::scripted`, `telemetry::consent::state_override`, `screens::login`'s `harness_driven`, `player::failure_fixture`). | -| **L3** lab config to platform — **done** | 5 / 7 | `lab::{config, is_trigger_key, menu_row_enabled}` are the platform module `labcfg`, and `ui/lab_toast.rs` went to `lab/toast.rs`, since only `lab` draws it. | +| **L3** lab config to os — **done** | 5 / 7 | `lab::{config, is_trigger_key, menu_row_enabled}` are the os module `labcfg`, and `ui/lab_toast.rs` went to `lab/toast.rs`, since only `lab` draws it. | | **L4** machine runtime leaves ui — **done** | 4 / 6 | The six upward names are cut: `page_frozen` lives in `ui::idle` (`gfx` re-exports it), `ScreenArg`/`ScreenEvent` and `fit_line_by`/`elide_by` moved into `ui::machine` (`ui::screen` and `text` re-export them), the loop calls `card_motion_metrics::presented` itself, and idle's plane-bit test moved to `app::run`. | | **L5** gfx stops naming ui — **done** | 2 / 61 | `Rect`, `Crop` and `Zoom` are `gfx/geom.rs`, the colour and size tokens `gfx` and `text` draw with are `gfx/tokens.rs`, and the backdrop walk and the profilers moved whole to `gfx/backdrop.rs` and `gfx/profile.rs`; `ui` re-exports all of them at the old paths. | | **L6** transport takes Plex values — **done** | 5 / 13 | `Origin`, `Scheme`, `url_host`, `ResolvePin` and `dial_port` are `net/origin.rs` (`plex::origin` re-exports them and keeps `CredentialPolicy`), the user agent is installed once at boot through `net::set_user_agent`, and `stream::redirect::Request` takes the credential-transport check as a function pointer. | -| **L7** platform owns its types — **done** | 2 / 5 | `DP_AUDIO_CODECS` lives in `devcaps` (`plex` re-exports it), and the Dolby Vision half of `webos/caps.rs`'s frame-safety test moved to `metadata`'s tests. | +| **L7** os owns its types — **done** | 2 / 5 | `DP_AUDIO_CODECS` lives in `devcaps` (`plex` re-exports it), and the Dolby Vision half of `webos/caps.rs`'s frame-safety test moved to `metadata`'s tests. | | **L8** plex stops naming upward — **done** | 7 / 10 | `urlenc_str` is `plex::client`'s, `backoff_secs` and `EndpointRefresh(Set)` are `plex::retry` (`pms` and `stores` re-export them), `LinkClass`/`classify` are `plex::probe`'s, `route::auto_quality_ready` and `telemetry::cleanup_after_account_clear` are hooks `app::boot::install_plex_seams` installs, and `plex::session`'s whole-app tests moved to `app/plex_session_app_tests.rs`. | | **L9** telemetry owns its wire schema — **done** | 5 / 69 | The `*Class`/`Trace*` vocabulary and a new `FailureClass` are `telemetry::classes` (`player::report` re-exports them and converts through `FailureKind::class()`), clearing the error trace is a hook (`player::report::install_trace_eraser`, run at boot by `app::enter_application`, not by the first attempt: a failed preview traces without one), an incident hands over a telemetry-owned `ReadoutGlyph` that `screens::login` maps to an icon, and the consent adapter's live half is `telemetry::transition`. | | **L10** player and Plex-aware widgets out of ui — **done** | 38 / 511 | Part a moved `ui/{player_hud,track_menu,more_menu,info_panel,up_next,chapters_panel,timing_capsule,source_list}.rs` and `screens/player/skip_pill.rs` to the new `appkit` layer rather than `screens/` (the third choice above); part b gave `widgets`, `card_row`, `hero_logo`, `collection_tile` and `fmt` plain values (`ui::tile::TileFacts`, a raw `u16` server id, `fmt::RatingScale`), with `screens::registry::tile_facts::of` the one `PmsMovie` converter. | @@ -313,27 +324,27 @@ proves the references are gone and nothing more; L15b is open. | **L12** media owns its lifecycle seams — **done** | 7 / 28 | The foreground-resume machine is `player::lifecycle`, its drivers `player::foreground` and the transport-pause contract `player::transport` (`app::lifecycle` re-exports them), the stats switch is `player::DIAG_READOUT_ON`, `Venc::open` takes the capture socket writer as an argument, and `route` takes the HUD context line as a parameter, with the up-next still prefetch a hook the app installs. | | **L13** tests move up to the layer that owns their parts — **done** | 41 / 96 | Part a moved the auth, plex, i18n, task and fontcov tests that named upper layers to `app/` (`session_*_tests.rs`), `screens/login_text_fit_tests.rs`, `plex`, `auth::owner` and `storage::client`, and moved `fontcov`'s `Measure` impl beside the trait, with `ui::machine`'s new `BareArg`/`BareMeasure` fixtures for the rest; part b moved the data, media and ui ones to `app/` (`dispatch_return_tests.rs`, `overscan_audit_tests.rs`) and `screens/` (`plaintext_question`, `library/labels_tests.rs`, `search/tests.rs`, `player`), and rewrote two against their own layer. | | **L14** session-layer presentation to screens — **done** | 2 / 4 | `auth::signed_in_reason` is a private fn of `screens::login`, its only caller, with its two tests; `auth` already handed over the plain account name. | -| **L15** the webOS port — **gate-complete** | 44 / 205 | Everything outside `[port webos]` reaches the television through the `tv` interfaces in `platform` that the port fills at boot: `tv::{device, sandbox, secure, home, toast, window}`, `devcaps::dv`, and `tv::sink::VideoSink`, a Starfish-shaped verb trait that `plx_platform::webos::video_sink::StarfishSink` and `plx_play_feed::ffi_host::HostSink` implement. `plex_run` is `port::plex_run`. The allowlist is empty. Not "done": the sink is not OS-neutral and the simulator is not its own port (L15b). | +| **L15** the webOS port — **gate-complete** | 44 / 205 | Everything outside `[platform webos]` reaches the television through the `tv` interfaces in `os` that the port fills at boot: `tv::{device, sandbox, secure, home, toast, window}`, `devcaps::dv`, and `tv::sink::VideoSink`, a Starfish-shaped verb trait that `plx_os::webos::video_sink::StarfishSink` and `plx_play_feed::ffi_host::HostSink` implement. `plex_run` is `port::plex_run`. The allowlist is empty. Not "done": the sink is not OS-neutral and the simulator is not its own port (L15b). | | **L15b** the OS-neutral port — **open** | — | An OS-neutral video sink with the ACB bind sequence behind it, the simulator as its own port, and the webOS facts the gate cannot see. See below. | ### L15: the webOS port L1 to L14 gave the crate a direction, but webOS was still spread through it. The modules that exist only because the target is webOS (`webos`, `keymanager`, `system` and `player::ffi`) were named -from 29 production files in 8 layers, from `platform` up to `app`, so supporting another -television OS would have meant edits in all of them. `[port webos]` fences them off: the gate fails +from 29 production files in 8 layers, from `os` up to `app`, so supporting another +television OS would have meant edits in all of them. `[platform webos]` fences them off: the gate fails on a new reference from outside, and the ones that were there when the port was declared were L15's 44 entries, 205 references of which 95 were in production code. The port's members stay in their layers, so none of this held up the split. -L15 moved every one of those references behind an interface in `platform`'s new `tv` module that +L15 moved every one of those references behind an interface in `os`'s new `tv` module that the port fills at boot. `tv::Port` is a table of function pointers, installed once as the first statement of `port::plex_run`, before anything that reads it. With no port installed (host unit tests, where nothing calls `plex_run`) `tv::ABSENT` answers what the host arms answered before; a shipping build that reaches it logs `tv: port not installed - using the no-port defaults` once. Only `tv`'s own modules read the table. Two things leave it: the sink, through `tv::sink::installed()` (rule `sink` of `ci/check-deps.sh` fences naming `VideoSink` or `installed` to `media`'s -`player/`, `play-uri/`, `platform`'s `tv/`, `tv.rs` and `webos/`, `port.rs` and +`player/`, `play-uri/`, `os`'s `tv/`, `tv.rs` and `webos/`, `port.rs` and `app/adapters/backends.rs`; `play-feed/` may name the trait but never resolves `installed`), and the URI media pipe through `tv::uri::installed()`, resolved once by the composition (`app/adapters/backends.rs::install_uri_product`, every build with the `play-uri` feature) and, in a `devtriggers` build, again by the media wrapper `player::uriprobe_drive` for the developer probe. The independent @@ -348,7 +359,7 @@ published values rather than hooks: the webOS code writes them into `tv::device` | device identity | `tv::device::{info, device, Info, Hardware}`, published by `webos::probe` | `telemetry`, `diag::schema`, `plex::identity`, `plex::session`'s tests, `screens::login`, `lab::snapshot`, `app`, `player` | | playback capability | `devcaps::dv::{capability, probe, DvCapability}`, published by `webos::caps`; `tv::start_capability_probe` starts the probe | `metadata`, `route`, `player::engine`, `app` | | native-video availability and repair | `tv::sandbox::{blocks_native_video, context, repair, Verdict, State, Failure, FORCE_BLOCKED}`; the verdict is published by `webos::probe` and the repair is a port hook | `player`, `route`, `appkit::player_hud`, `screens::player`, `app::playback` | -| video sink | `tv::sink::VideoSink`, implemented by `plx_platform::webos::video_sink::StarfishSink` and `HostSink` (`plx_play_feed::ffi_host`), installed in `Port.sink` and read through `tv::sink::installed` | `player::{adapter, test_physical}`, `plx_play_feed::{native_executor, native_load, physical, seek}` (which receive it injected), `app::adapters::backends` (which resolves `installed` and `display_installed`) | +| video sink | `tv::sink::VideoSink`, implemented by `plx_os::webos::video_sink::StarfishSink` and `HostSink` (`plx_play_feed::ffi_host`), installed in `Port.sink` and read through `tv::sink::installed` | `player::{adapter, test_physical}`, `plx_play_feed::{native_executor, native_load, physical, seek}` (which receive it injected), `app::adapters::backends` (which resolves `installed` and `display_installed`) | | secure store | `tv::secure::{seal, open, remove, Sealed, Backend}` | `plex::session` | | storage backend | `storage::client::install_activator`, which the port calls with `webos::activate_storage_helper` | `port::plex_run` | | locale | `tv::system_locale` and `tv::LocaleReply`; `i18n` still owns the parse and the log lines | `i18n` | @@ -357,7 +368,7 @@ published values rather than hooks: the webOS code writes them into `tv::device` | home key | `tv::home::{go_home, poll, take_root_press, release_root_press}` | `app::input`, `app::run`, `app::adapters::session`, `app::lifecycle`'s tests | | system toast | `tv::toast::{toast, send, Identity, Outcome, Sent}` | `app::clock_notice`, `dev::scenarios::toast_probe` | -`tv` may name only `base`, `machine` and `platform`. `port.rs` holds `plex_run` and the `PORT` table +`tv` may name only `base`, `machine` and `os`. `port.rs` holds `plex_run` and the `PORT` table that points each hook at the `webos`, `keymanager` and `system` function behind it. The C shim and the simulator both enter through `port::plex_run`; `app::run_application` is the two-line body it hands over to. `lib.rs` declares the port but re-exports nothing from it, because a re-export would @@ -368,7 +379,7 @@ Starfish seam, 29 of them, with the C return values and the `&MainThread` token `load`, `window_mode` and `window_id` (since 2026-10-15 `unload` takes an `UnloadTicket` instead, so a real stop's Unload can run on a worker; the trait's own doc is the current list). It is **Starfish-shaped**: a load payload, `feed`, and the ACB bind verbs that the Feed pump walks. Another TV OS cannot implement it as it stands. -`plx_platform::webos::video_sink` keeps its `extern "C"` block unchanged and implements the trait as +`plx_os::webos::video_sink` keeps its `extern "C"` block unchanged and implements the trait as `StarfishSink`; the player adapter and the Feed backend's pump, executor and Load worker call it through the sink the composition hands them (`PlayerAdapter::display_sink`; `app/adapters/backends.rs`). `ffi_host` is no longer swapped in under `webos::video_sink`. It is the simulator's own `VideoSink` @@ -442,15 +453,15 @@ is already a separate crate there, and enters through `port::plex_run`. `--report` ends with an "extractable as a crate" list. A layer is ready when neither it nor anything it uses has entries left, **and** no other layer's tests name a `cfg(test)` item of it or of a layer below it. Since L14 the first half holds for every layer and the second for none: `--report` -listed 134 such items after L14 (8 in `base`, 11 `machine`, 13 `platform`, 8 `gfx`, 10 `net`, 21 +listed 134 such items after L14 (8 in `base`, 11 `machine`, 13 `os`, 8 `gfx`, 10 `net`, 21 `plex`, 8 `telemetry`, 12 `ui`, 25 `data`, 4 `session`, 6 `media`, 4 `appkit`, 4 `screens`). L15 replaced `webos::FORCE_JAIL_BLOCKED`, `webos::home_requests` and `keymanager::RPC_FOR_TEST` with `cfg(test)` seams of `tv` (`sandbox::FORCE_BLOCKED`, `home::home_requests`, `secure::{STORE_FOR_TEST, TestStore}`) that other layers' tests still name, so `--report` listed -136 (15 in `platform`, the rest as above) before Split 3 took the 15 with it; run it for the current +136 (15 in `os`, the rest as above) before Split 3 took the 15 with it; run it for the current count. The gate cannot see either remaining hazard on its own, because it checks names, not `cfg(test)`-ness -of the item named or impl coherence. Extract bottom-up: `base`, then `machine`, `platform`, and so +of the item named or impl coherence. Extract bottom-up: `base`, then `machine`, `os`, and so on. Each extraction: - creates `rust-modules//` as a workspace member (the storage helper in `storage/` is the @@ -623,34 +634,34 @@ couple of seconds that crate cost per edit to everything above it. The gain is i application edit is 5.7 s faster), not in the noisy medians; the crates that carry the line count (`gfx`, `plex`, `ui`, `screens`) were still inside the application crate at that point. -### Split 3: platform +### Split 3: os -`platform` was extracted third: `rust-modules/platform/` is the workspace member `plx_platform` (an +`os` was extracted third: `rust-modules/os/` is the workspace member `plx_os` (an `rlib`, `uses = base machine`), holding `webos storage keymanager devcaps imgcache i18n labcfg tv` and the `storage_service/` files that `storage` and the storage helper both include by `#[path]` -(they are not a module of their own). `webos` and `keymanager` are still `[port webos]` members, and -the port fence reads `plx_platform::webos::` exactly as it read `crate::webos::`: a probe naming +(they are not a module of their own). `webos` and `keymanager` are still `[platform webos]` members, and +the port fence reads `plx_os::webos::` exactly as it read `crate::webos::`: a probe naming either from `coldstart.rs` still fails the gate for both. The 1828 `crate::::` references in -150 application files were rewritten by a script to `plx_platform::::`; `pub(crate)` became +150 application files were rewritten by a script to `plx_os::::`; `pub(crate)` became `pub` across the moved files and in what the two generators emit (`Flavor`, the `i18n::msg` accessors). Features: `devtriggers`, `hostsim` and `lab-diagnostics` are forwarded, `test-support` is new and enables the two lower layers'. The 218 tests of the layer run in their own binary: the suite is 5603 tests before and after (157 + 66 + 218 + 5162). What it taught beyond the recipe: - **The generated code is the layer's, and so is the build script that generates it.** - `platform/build.rs` runs the catalog generator (`platform/build_support/catalog.rs`, reading + `os/build.rs` runs the catalog generator (`os/build_support/catalog.rs`, reading `locales/` and the language registry `locales/languages.json`) and the install-identity generator (`rust-modules/build_support/install_identities.rs`, which stays where it is because the storage helper's build script calls it too). It reads no `PLX_*` variable and emits no `rustc-link-*`, so it is never dirty on a second run: - `ci/test_build_not_always_dirty.py` now fails on `plx_platform` as well as on the application + `ci/test_build_not_always_dirty.py` now fails on `plx_os` as well as on the application crate. The application's `build.rs` kept the version, the build SHA, the host link configuration and the nanosvg object, lost its `serde`/`serde_json` build-dependencies, and the application manifest lost the `icu_*` crates, which only `i18n` used. - **A `cargo:rustc-env` reaches one crate.** `storage::diagnostics` read `env!("PLX_VERSION")`, - which the application's build script publishes; the platform crate cannot see it, and + which the application's build script publishes; the os crate cannot see it, and re-deriving the version rule in a second build script would have been a third copy of it (it is already in `build.rs` and `ci/version_rule.py`). The application hands it in instead: - `storage::diagnostics::start(env!("PLX_VERSION"))`. The platform layer does not know what + `storage::diagnostics::start(env!("PLX_VERSION"))`. The os layer does not know what version the application is. - **A test that reads another layer's source moves up.** `storage::diagnostics`'s boot-order test `include_str!`ed `app/mod.rs`; it now sits beside its sibling in `app/boot.rs`'s @@ -675,7 +686,7 @@ suite is 5603 tests before and after (157 + 66 + 218 + 5162). What it taught bey binary of 218 it failed every run. `imgcache`'s `TestDir` takes the lock now. A layer that is split off may expose a race that the big suite averaged away: run the new crate's tests a few times alone before trusting them. -- **No orphan-rule hazard, and nothing was dead because of a trait.** `platform` defines traits +- **No orphan-rule hazard, and nothing was dead because of a trait.** `os` defines traits (`tv::sink::VideoSink`) and the application implements them for its own types, which is legal; the compiler is the checker, as in Split 2. `tv::sandbox::Failure::Timeout` had a `cfg_attr(..., expect(dead_code))` that became an unfulfilled expectation once the enum was `pub`; @@ -688,38 +699,38 @@ suite is 5603 tests before and after (157 + 66 + 218 + 5162). What it taught bey prebuilt std since the move to stable; it was `.cargo/config.toml`'s `build-std` on nightly; no NDK, no link step) does, and passes with and without default features; use it for any split that moves FFI when no NDK is at hand. - **Gates scoped by the path of a moved file stopped seeing it, and some by its spelling.** - `ci/check-deps.sh` reads `SRC_PLATFORM` where it read `SRC_MACHINE`; the `frame` and `uistorage` + `ci/check-deps.sh` reads `SRC_OS` where it read `SRC_MACHINE`; the `frame` and `uistorage` rules name a moved module as `crate::tv::window::` and `crate::storage::`, which would have kept - passing while matching nothing, so they accept `plx_platform::` too; the `sink` gate exempts - `$SRC_PLATFORM/tv*`; the `fpflags` rule and the harness's private tree copy include the new + passing while matching nothing, so they accept `plx_os::` too; the `sink` gate exempts + `$SRC_OS/tv*`; the `fpflags` rule and the harness's private tree copy include the new `Cargo.toml` and `build.rs`. `ci/check-localization.py` named `webos.rs`, `tv/device.rs` and `devcaps/dv.rs` under `rust-modules/src` and skips a missing path without a word: it reads - `platform/src` for them and for the constants table now. Grep the gate scripts for + `os/src` for them and for the constants table now. Grep the gate scripts for `crate::` as well as for directory names. - **Tooling that knows the tree's shape**: the `-p` lists (`-p plxnative-modules -p plx_base -p - plx_machine -p plx_platform`) in the Makefile, the workflow, `tools/build-bench.py` and the tests - that pin them; `--src rust-modules/platform/src` for the line budget; `RUST_INPUTS` and - `STORAGE_INPUTS` (the helper's `#[path]` files are under `platform/`); `tools/cargo-seed.py` keys - on the new manifest; the eventlog scrub test's root list gained `../platform/src`; + plx_machine -p plx_os`) in the Makefile, the workflow, `tools/build-bench.py` and the tests + that pin them; `--src rust-modules/os/src` for the line budget; `RUST_INPUTS` and + `STORAGE_INPUTS` (the helper's `#[path]` files are under `os/`); `tools/cargo-seed.py` keys + on the new manifest; the eventlog scrub test's root list gained `../os/src`; `ci/test_no_host_staticlib.py` holds the crate to `rlib`; the release-configuration hook treats an - edit in `platform/src` as a shipping-feature risk; and `make build-bench` has a `platform` - scenario ("Edit leaf (plx_platform devcaps.rs)"). + edit in `os/src` as a shipping-feature risk; and `make build-bench` has a `os` + scenario ("Edit leaf (plx_os devcaps.rs)"). Measured effect (`make build-bench`, same machine, 3 interleaved runs; the host was quiet for both sets, and the figures are non-incremental). Before, on `b131c181`: an edit in `plx_base` 31.3 s (min 31.2), in `plx_machine` 31.4 s (min 31.3), of the application crate 32.0 s (min 31.0), the hub edit 32.3 s (min 31.4), the unit suite 60.5 s. After: an edit in `plx_base` 30.6 s (min 30.5), in -`plx_machine` 30.9 s (min 30.5), in `plx_platform` 31.2 s (min 30.1, it rebuilds the platform crate +`plx_machine` 30.9 s (min 30.5), in `plx_os` 31.2 s (min 30.1, it rebuilds the os crate and the application behind it), of the application crate 30.8 s (min 28.4, the three layer crates fresh), the hub edit 30.8 s (min 28.2), and the unit suite 61.1 s with the same 5603 tests. The gain -is the 1 to 3 s that `platform` (11k of 450k lines) cost every application edit, and no more: the +is the 1 to 3 s that `os` (11k of 450k lines) cost every application edit, and no more: the application crate is still about 30 s of every row. The leverage is in `gfx`, `net` and `plex` and above, which carry the line count. ### Split 4 (gfx) `gfx` was extracted fourth: `rust-modules/gfx/` is the workspace member `plx_gfx` (an `rlib`, -`uses = base machine platform`; the manifest depends on `plx_base` and `plx_machine` only), holding `gfx` (with `backdrop`, `geom`, `profile`, `tokens`), `egl`, `text`, +`uses = base machine os`; the manifest depends on `plx_base` and `plx_machine` only), holding `gfx` (with `backdrop`, `geom`, `profile`, `tokens`), `egl`, `text`, `img`, `svg`, `gpu_timer`, `hwcnt` and `overdraw` (which was `ui::overdraw`), and the `shaders/` directory the renderer embeds. The module paths are `plx_gfx::::` (a path `plx_gfx::gfx::draw_rect` names module `gfx`), so `ci/module-layers.ini` lists `overdraw` where it @@ -778,13 +789,13 @@ layer run in their own binary. What it taught beyond the recipe: it was the one thing `gfx.rs`'s header said the renderer named of `ui`, so it moves down with the renderer. The rules scoped to `$SRC/ui` stopped reading the file; it holds no clock, store or session call, and the whole-tree rules read `$SRC_GFX`. -- **The crate does not depend on `plx_platform`.** The layer's `uses` ceiling includes `platform` +- **The crate does not depend on `plx_os`.** The layer's `uses` ceiling includes `os` and nothing in the moved files names it, so the manifest depends on `plx_base` and `plx_machine` - only. An edit in `plx_platform` therefore does not rebuild `plx_gfx`, which a declared-but-unused + only. An edit in `plx_os` therefore does not rebuild `plx_gfx`, which a declared-but-unused dependency would have caused. - **No orphan-rule hazard and no dead code appeared.** No `impl` in the application has both its trait and its type in `plx_gfx`; the compiler is the checker. -- **Tooling that knows the tree's shape**: the `-p` lists (`... -p plx_platform -p plx_gfx -p plx_net`, with Split 5) in the +- **Tooling that knows the tree's shape**: the `-p` lists (`... -p plx_os -p plx_gfx -p plx_net`, with Split 5) in the Makefile, the workflow, `tools/build-bench.py` and the tests that pin them; `--src rust-modules/gfx/src` for the line budget; `RUST_INPUTS`; `tools/cargo-seed.py` keys on the new manifest; the eventlog scrub test's root list gained `../gfx/src` (a log call in `gfx` would @@ -804,7 +815,7 @@ layer run in their own binary. What it taught beyond the recipe: `net` (`net.rs`, `net/origin.rs`, the HTTP/2 reset fixture script `net/h2_reset_fixture.py`) and `stream` (`stream.rs`, `stream_redirect.rs` and the six `stream_*_tests.rs` files plus `stream_test_support.rs`, all declared by `#[path]` from `stream.rs`). It depends on `plx_base` and -nothing else: `[net] uses = base platform` still allows `platform`, but no line of the layer names +nothing else: `[net] uses = base os` still allows `os`, but no line of the layer names it, so the crate does not depend on it. It has no build script and links nothing (libcurl is `dlopen`ed through `plx_base::dynlib!`; the final link line stays the application crate's and the Makefile's `LIBS_REAL`; `ci/expected-dt-needed.txt` did not change). The references were rewritten @@ -861,13 +872,13 @@ the recipe and Splits 1 to 3: - **Scrub, budgets and the private tree copy.** The eventlog scrub test's root list gained `../net/src` (these are the files that handle URLs and tokens, so the privacy scan matters most here), `tests/test_harness.py`'s `TREE_INPUTS` gained the crate's source and manifest, and - `ci/check-deps.sh` reads `SRC_NET` wherever it reads `SRC_PLATFORM` except the video-sink rule. + `ci/check-deps.sh` reads `SRC_NET` wherever it reads `SRC_OS` except the video-sink rule. The module-cycle baseline moved from 43 modules outside the cycle to 26 with Splits 4 and 5 together, and the cycle itself is the same 8 modules (no moved module was on it; the smaller `gfx`/`text`/`ui` component the baseline also listed is gone with `gfx`); `ci/check-module-cycle.py --update-baseline` records it. - **Tooling that knows the tree's shape**: the `-p` lists (`-p plxnative-modules -p plx_base -p - plx_machine -p plx_platform -p plx_gfx -p plx_net`) in the Makefile, the workflow, `tools/build-bench.py` and + plx_machine -p plx_os -p plx_gfx -p plx_net`) in the Makefile, the workflow, `tools/build-bench.py` and the tests that pin them; `--src rust-modules/net/src` for the line budget; `RUST_INPUTS`; `tools/cargo-seed.py` keys on the new manifest; `ci/test_no_host_staticlib.py` holds the crate to `rlib`; the release-configuration hook treats an edit in `net/src` as a shipping-feature risk; the @@ -902,16 +913,16 @@ The two splits were made in parallel from the same commit and landed as one chan staticlib. The non-`pub` form expands to the same tokens as before (the `@emit` arm's body differs from the old single arm only in `$vis` for `pub(crate)`), the variadic arm of `dynlib_wrapper!` is unchanged, and an existing table cannot select the `pub` arm. -- **`uses` is a ceiling.** `ci/module-layers.ini` keeps `gfx uses base machine platform` and `net - uses base platform`; neither crate names `platform`, so neither manifest depends on - `plx_platform`, and an edit there rebuilds neither (the bench rows below show it). +- **`uses` is a ceiling.** `ci/module-layers.ini` keeps `gfx uses base machine os` and `net + uses base os`; neither crate names `os`, so neither manifest depends on + `plx_os`, and an edit there rebuilds neither (the bench rows below show it). Measured effect (`make build-bench`, same machine, 3 interleaved runs, no load warning in either set; non-incremental). Before, on `464ceb33` (the commit before `main`'s current tip, which differs from it by a Home change only): an edit in `plx_base` 30.7 s (min 30.4), in `plx_machine` -30.4 s (min 30.1), in `plx_platform` 30.3 s (min 30.1), of the application crate 28.4 s (min 28.1), +30.4 s (min 30.1), in `plx_os` 30.3 s (min 30.1), of the application crate 28.4 s (min 28.1), the hub edit 29.2 s (min 28.1), the unit suite 62.3 s (min 61.7) with 5603 tests. After: an edit in -`plx_base` 29.3 s (min 29.3), in `plx_machine` 29.2 s (min 29.2), in `plx_platform` 28.9 s (min +`plx_base` 29.3 s (min 29.3), in `plx_machine` 29.2 s (min 29.2), in `plx_os` 28.9 s (min 28.6), in `plx_gfx` 27.7 s (min 27.6), in `plx_net` 27.3 s (min 27.1), of the application crate 26.7 s (min 26.6), the hub edit 26.8 s (min 26.6), and the unit suite 67.7 s (min 67.5) with 5606 tests (the base moved: 3 new Home tests). Every edit is 1.4 to 2.4 s faster, which is what 25k of @@ -922,7 +933,7 @@ the two new ones link SDL/GL (`plx_gfx`) and build the TLS fixtures (`plx_net`). ### Split 6 (ui) `ui` was extracted sixth: `rust-modules/ui/` is the workspace member `plx_ui` (an `rlib`, -`uses = base machine platform gfx`; the manifest depends on all four), holding everything that was +`uses = base machine os gfx`; the manifest depends on all four), holding everything that was `rust-modules/src/ui/`: 59k lines, about sixty modules, the widgets, containers, frame, focus engine, recorder and the fixtures they are tested against. Nothing under `ui/` belongs to a layer above it (`appkit` and `screens` are top-level modules), so nothing stayed behind and the application has no @@ -993,7 +1004,7 @@ What it taught beyond the recipe and Splits 1 to 5: spelling is `plx_ui::nav::` now) and `mutators` masks a screen's own `crate::ui::x::y(` call before matching. Both accept either spelling. Proven by planting a violation in a copy of the file and reading the gate go red, then restoring it byte for byte: `wall` (an `Instant::now()` in - `ui/src/dwell.rs`), `uistorage` (`plx_platform::storage::` in `fmt.rs`), `nav` + `ui/src/dwell.rs`), `uistorage` (`plx_os::storage::` in `fmt.rs`), `nav` (`plx_ui::nav::` in `screens/about_panel.rs`), `textmeasure` (`plx_gfx::text::text_width(` in `fmt.rs`), `sessionwrite` and `ticks`. `ci/check-statics.sh` named `$SRC/ui` for its gated paths and fails loudly on a missing one (it did not need the fix to be noticed, which is the better way @@ -1019,13 +1030,13 @@ What it taught beyond the recipe and Splits 1 to 5: ### Split 7 (plex) `plex` was extracted seventh (Split 6 is `ui`, above; the two were made in parallel): `rust-modules/plex/` is the -workspace member `plx_plex` (an `rlib`, `uses = base machine platform net`), holding `plex` (the +workspace member `plx_plex` (an `rlib`, `uses = base machine os net`), holding `plex` (the typed Plex API, the session store, `grant`, `probe`, `identity`, with its `CLAUDE.md`) and `http` (the one request door). The members kept their names, so a path is `plx_plex::plex::session::load` and `plx_plex::http::...`, and every `crate::plex::` *inside* the moved files stayed valid; only the 3 897 references in 213 application files changed, by `split-plex-rewrite.py` (`crate::plex` and `crate::http` to `plx_plex::plex` and `plx_plex::http`, `pub(crate)` to `pub`). The crate -depends on `plx_base`, `plx_machine`, `plx_platform` and `plx_net`, owns no build script and links +depends on `plx_base`, `plx_machine`, `plx_os` and `plx_net`, owns no build script and links nothing. Features: `devtriggers` and `hostsim` are forwarded, `test-support` is new and enables the four lower layers'. Its 458 tests run in their own binary. What it taught beyond the recipe: @@ -1109,7 +1120,7 @@ that moved twice meanwhile (four changes, three of them to Home). Combining them rewrote the `crate::ui`/`crate::plex` paths `main` had added to `screens/home/mod.rs` since, and where `main` conflicted with the rewritten file its version was taken and rewritten again. - **The gates still fire in the combination**, proven by temporary violating edits: `plx_ui` - naming `plx_plex`, `plx_plex` naming `plx_ui`, and `plx_platform::webos`/`::keymanager` named + naming `plx_plex`, `plx_plex` naming `plx_ui`, and `plx_os::webos`/`::keymanager` named from `ui/src`, `plex/src` and `coldstart.rs` each fail `ci/check-module-layers.py` (the mounted crate is reported as `[ui]`); `nav`, `textmeasure` (in `ui/src` and in the application), `wall`, `uistorage`, `ticks`, `threads`, `tmppath` and `effect` fail `ci/check-deps.sh` from the new @@ -1120,7 +1131,7 @@ that moved twice meanwhile (four changes, three of them to Home). Combining them - **One gate had gone quiet, and it was neither lane's own.** `ci/check-localization.py` reads a fixed list of product files, and `route/decision.rs` was on it for the quality row's text. The plex split moved that text (`PlaybackQuality::label`) into `plex/session.rs`, which the gate did - not read, and its constants table read `platform`, `gfx` and `ui` only. It reads + not read, and its constants table read `os`, `gfx` and `ui` only. It reads `plex/src/plex/session.rs` and every layer crate's constants now. When an inherent method moves down a layer, look for the gates that listed its old file. - **The security-relevant seams were checked in the artifact, not in the manifest.** In a host @@ -1145,11 +1156,11 @@ that moved twice meanwhile (four changes, three of them to Home). Combining them Measured effect (`make build-bench`, same machine, 3 interleaved runs each, non-incremental; other lanes were building, both sets carry load warnings, so read the minima). Before, on `cab5834f`: an -edit in `plx_base` 35.3 s (min 35.1), in `plx_machine` 34.6 s (min 34.6), in `plx_platform` 34.6 s +edit in `plx_base` 35.3 s (min 35.1), in `plx_machine` 34.6 s (min 34.6), in `plx_os` 34.6 s (min 34.0), in `plx_gfx` 33.0 s (min 32.8), in `plx_net` 33.0 s (min 32.0), of the application crate 32.4 s (min 31.5), the hub edit (`ui/mod.rs`) 32.3 s (min 31.8), the unit suite 76.0 s (min 75.2) with 5613 tests. After (measured before `main`'s second move, which adds Home tests): an edit in `plx_base` 30.9 s (min 27.8), in `plx_machine` 27.9 s -(min 27.2), in `plx_platform` 28.1 s (min 26.7), in `plx_gfx` 25.3 s (min 24.2), in `plx_net` +(min 27.2), in `plx_os` 28.1 s (min 26.7), in `plx_gfx` 25.3 s (min 24.2), in `plx_net` 26.3 s (min 24.2), in `plx_ui` 24.4 s (min 23.7), in `plx_plex` 24.7 s (min 24.1), of the application crate 21.8 s (min 21.6), the hub edit (`plx_ui`'s `lib.rs`) 23.8 s (min 23.6), and the unit suite 72.0 s (min 71.7) with 5614 tests (the one added is the hand-in order test). An @@ -1163,8 +1174,8 @@ or starting them. ### Split 8 (telemetry) `telemetry` was extracted eighth, alone (no parallel lane): `rust-modules/telemetry/` is the -workspace member `plx_telemetry` (an `rlib`, `uses = base machine platform net plex`; the manifest -depends on `plx_base`, `plx_platform`, `plx_net` and `plx_plex`, because no line of the crate names +workspace member `plx_telemetry` (an `rlib`, `uses = base machine os net plex`; the manifest +depends on `plx_base`, `plx_os`, `plx_net` and `plx_plex`, because no line of the crate names `machine`), holding `telemetry` (consent, the Sentry and PostHog wire formats, the spool and the worker) and `diag` (the typed usage-event schema; `diag::{heartbeat, spans, zlib}` are not here, they are `plx_base::diag::*`). The members kept their names, so a path is @@ -1289,13 +1300,13 @@ taught is mostly about what would have gone quiet: Measured effect (`make build-bench`, same machine, 3 interleaved runs each, non-incremental, medians with the minimum after the slash). The "before" set, on `a23ddee1`, ran while this lane was also running cargo and other lanes were building (the log warns of a load of 16 to 18 on 10 cores in -three runs), so its medians for the first rows (`plx_base` 57.5 s, `plx_platform` 40.7 s) are +three runs), so its medians for the first rows (`plx_base` 57.5 s, `plx_os` 40.7 s) are noise and the minima are the guide; the "after" set, on the same base plus this change, ran with no load warning. Before: an edit in `plx_base` 57.5 s / 29.4 s, in `plx_machine` 30.9 / 29.3, in -`plx_platform` 40.7 / 28.8, in `plx_gfx` 29.0 / 26.6, in `plx_net` 26.6 / 25.7, in `plx_ui` 25.6 / +`plx_os` 40.7 / 28.8, in `plx_gfx` 29.0 / 26.6, in `plx_net` 26.6 / 25.7, in `plx_ui` 25.6 / 25.0, in `plx_plex` 26.2 / 26.1, of the application crate 23.7 / 23.0, the hub edit 25.7 / 25.6, the unit suite 81.0 / 80.8 with 5620 tests. After: `plx_base` 26.9 / 25.6, `plx_machine` 26.3 / 25.1, -`plx_platform` 25.9 / 24.7, `plx_gfx` 22.9 / 22.4, `plx_net` 23.7 / 22.9, `plx_ui` 22.4 / 21.6, +`plx_os` 25.9 / 24.7, `plx_gfx` 22.9 / 22.4, `plx_net` 23.7 / 22.9, `plx_ui` 22.4 / 21.6, `plx_plex` 22.8 / 22.5, `plx_telemetry` 20.7 / 20.5 (new row: it rebuilds the telemetry crate and the application behind it), the application crate 19.8 / 19.7, the hub edit 21.6 / 21.5, the unit suite 72.7 / 70.9 with the same 5620 tests (157 + 66 + 218 + 94 + 128 + 752 + 458 + 235 + 3512). The @@ -1307,8 +1318,8 @@ binary and is no slower. ### Split 9 (data) `data` was extracted ninth, in parallel with the `session` lane: `rust-modules/data/` is the -workspace member `plx_data` (an `rlib`, `uses = base machine platform net plex telemetry`; the -manifest depends on `plx_base`, `plx_machine`, `plx_platform`, `plx_plex` and `plx_telemetry`, and +workspace member `plx_data` (an `rlib`, `uses = base machine os net plex telemetry`; the +manifest depends on `plx_base`, `plx_machine`, `plx_os`, `plx_plex` and `plx_telemetry`, and on `plx_net` as a dev-dependency only, because one fixture test calls it), holding `stores` (one command vocabulary and one machine per data store), `pms` (the Home catalog), `browse`, `metadata`, `person`, `collection`, `search` and `viewstate`. The members kept their names, so a path is @@ -1403,7 +1414,7 @@ ready. What it taught beyond the recipe: ### Split 10 (session) `session` was extracted tenth, in parallel with `data` (Split 9, its own lane): `rust-modules/session/` -is the workspace member `plx_session` (an `rlib`, `uses = base machine platform net plex +is the workspace member `plx_session` (an `rlib`, `uses = base machine os net plex telemetry`; the manifest names exactly those six, because no line of the crate names anything else), holding `auth` and nothing else: the sign-in controller (PIN and QR, discovery of the account's servers, who's-watching and the profile PIN, the install of the chosen profile's @@ -1570,7 +1581,7 @@ they were combined) and landed as one change. Combining them: `devtriggers` only. - **The gates still fire in the combination**, proven by temporary violating edits, reverted byte for byte: `plx_data` naming `plx_session`, `plx_session` naming `appkit`, and - `plx_platform::webos`/`::keymanager` named from either crate fail `ci/check-module-layers.py`; + `plx_os::webos`/`::keymanager` named from either crate fail `ci/check-module-layers.py`; `plx_data::viewstate::reset(` in `coldstart.rs` fails `viewstate-owner` and `plx_data::person::pump(` in a screen fails `person-owner` (the application's spelling of the owner rules); `ticks` fires in both crates, `tmppath` in `session/src`, `threads` in `data/src`; @@ -1590,11 +1601,11 @@ they were combined) and landed as one change. Combining them: Measured effect (`make build-bench`, same machine, 3 interleaved runs each, non-incremental, no load warning in either set; median / minimum). Before, on `11584830`: an edit in `plx_base` 28.9 s / -28.7 s, in `plx_machine` 28.6 / 28.1, in `plx_platform` 27.8 / 27.5, in `plx_gfx` 24.9 / 24.5, in +28.7 s, in `plx_machine` 28.6 / 28.1, in `plx_os` 27.8 / 27.5, in `plx_gfx` 24.9 / 24.5, in `plx_net` 25.6 / 25.1, in `plx_ui` 24.2 / 23.6, in `plx_plex` 25.2 / 24.7, in `plx_telemetry` 23.1 / 22.8, of the application crate 22.2 / 22.0, the hub edit 24.1 / 24.1, the unit suite 80.7 / 80.4 with 5630 tests in nine binaries. After: `plx_base` 23.5 / 23.3, `plx_machine` 22.8 / 22.7, -`plx_platform` 22.4 / 22.4, `plx_gfx` 17.0 / 17.0, `plx_net` 20.4 / 20.3, `plx_ui` 16.4 / 16.3, +`plx_os` 22.4 / 22.4, `plx_gfx` 17.0 / 17.0, `plx_net` 20.4 / 20.3, `plx_ui` 16.4 / 16.3, `plx_plex` 20.0 / 20.0, `plx_telemetry` 18.0 / 17.9, `plx_data` 16.9 / 16.8 and `plx_session` 16.1 / 16.0 (new rows: each rebuilds its crate and the application behind it), the application crate 14.7 / 14.5, the hub edit 16.5 / 16.4, and the unit suite 73.6 / 73.3 with the same 5630 tests in eleven @@ -1613,7 +1624,7 @@ re-exports `plx_media_codecs`' FFmpeg bindings and holds the integration fixture the feed's application entry points are `plx_play_feed`'s (`plx_play_feed::demux`). `media` was extracted eleventh: `rust-modules/media/` is the workspace member `plx_media` (an `rlib`, -`uses = base machine platform gfx net plex telemetry data`; the manifest names those eight, with +`uses = base machine os gfx net plex telemetry data`; the manifest names those eight, with `plx_gfx` optional behind `hostsim` because only the simulator's `player::sim_video` drew; that file has since moved to the application, `app::adapters::hostsim`, and the manifest no longer names `plx_gfx`), holding `ff` (then the bundled-FFmpeg demuxer), `aq`, `abr`, `hls`, `curlio`, `player` (the buffer-feed engine, @@ -1641,7 +1652,7 @@ modules on the cycle (`app dev textinput`), 10 outside". What it taught: `acb_on_event` among them) and the same 279 undefined non-Rust symbols, by `llvm-nm`; `ci/expected-dt-needed.txt` and `LIBS_REAL` did not change. A `#[no_mangle]` item of an upstream rlib is kept in the staticlib under `lto = "fat"`: that is the claim the diff checks, and it holds. -- **The port fence is unchanged.** `player::ffi` is in `[port webos]`, and the fence reads a +- **The port fence is unchanged.** `player::ffi` is in `[platform webos]`, and the fence reads a reference by module name, so `plx_media::player::ffi::StarfishSink` in `port.rs` is the one allowed use. A `use plx_media::player::ffi::..` added to `appkit` and a `use crate::player::ffi::..` added to `route/plan.rs` both fail `ci/check-module-layers.py`. @@ -1734,7 +1745,7 @@ modules on the cycle (`app dev textinput`), 10 outside". What it taught: ### Split 12 (appkit) `appkit` was extracted twelfth: `rust-modules/appkit/` is the workspace member `plx_appkit` (an `rlib`, -`uses = base machine platform gfx net plex telemetry ui data session media`; the manifest names the nine +`uses = base machine os gfx net plex telemetry ui data session media`; the manifest names the nine it calls, `net` and `session` being reached only through `media`), holding the player HUD, the track, more, info and chapters panels, `up_next`, `timing_capsule`, `skip_pill` and the Sources row model: 11 files, 12,813 lines. Like `ui` it is one module, so the manifest says @@ -1812,7 +1823,7 @@ doc links that named `screens`, `app`, `lab` and `focusprobe` unbracketed. What ### Split 13 (screens) `screens` was extracted thirteenth and last: `rust-modules/screens/` is the workspace member -`plx_screens` (an `rlib`, `uses = base machine platform gfx net plex telemetry ui data session media +`plx_screens` (an `rlib`, `uses = base machine os gfx net plex telemetry ui data session media appkit`; the manifest names all twelve), holding every screen the dispatcher mounts (Home, the library, detail, search, person, the player screen, the Settings family with consent, onboarding, legal, profiles and preferences, the account, item and alternate-sources menus) and the `registry` @@ -1954,7 +1965,7 @@ units), which is faster and larger, and keeps `release` for CI, `RELEASE=1`, `SY - `cfg` predicates other than `test` count as possibly on, so the graph is the union of every feature configuration. - Files included from `OUT_DIR` are not read: the generated `i18n::msg` catalog and - `storage::state`'s install identities (both generated by `plx_platform`'s build script since + `storage::state`'s install identities (both generated by `plx_os`'s build script since Split 3). Today they name nothing outside their own parent module. - A `macro_rules!` that is neither `#[macro_export]` nor inside a `#[macro_use]` module is visible only to its own module and to children declared after it. The analyzer does not follow diff --git a/docs/playback-diagnostics.md b/docs/playback-diagnostics.md index e8b9ddb73e..93c1c08fa8 100644 --- a/docs/playback-diagnostics.md +++ b/docs/playback-diagnostics.md @@ -20,7 +20,7 @@ If saving fails, the row shows **Failed** and the app event log records the fail ## Implementation and firmware evidence -The Settings form emits typed `AppFx::PlaybackTrace` commands. The app runner executes them and delivers one `AppMsg::PlaybackTrace` status to the originating surface. The screen opens no file, starts no worker and reads no native/global recorder state. The platform adapter owns native logging and its file; the Bridge owns the off-frame save receipt and delivers its result to the requesting surface. Saving is generation-fenced against a later deletion or new recording, and the IO transaction is serialized with privacy deletion; the cap/deadline writer takes elapsed time as an input and is tested without firmware. +The Settings form emits typed `AppFx::PlaybackTrace` commands. The app runner executes them and delivers one `AppMsg::PlaybackTrace` status to the originating surface. The screen opens no file, starts no worker and reads no native/global recorder state. The os layer's adapter owns native logging and its file; the Bridge owns the off-frame save receipt and delivers its result to the requesting surface. Saving is generation-fenced against a later deletion or new recording, and the IO transaction is serialized with privacy deletion; the cap/deadline writer takes elapsed time as an input and is tested without firmware. The adapter optionally resolves `libgstreamer-1.0.so.0` on the first explicit recording request. Missing APIs report Unavailable and do not block playback or startup. No GStreamer structure field is accessed. `GstLogFunction` and the public log/threshold API signatures come from the NDK `gst/gstinfo.h`; the six symbols used by the binding are checked against the DAS firmware generations 3, 4, 5, 6, 9, 10 and 11. Symbol presence is ABI evidence, not a claim that every generation emits every category. diff --git a/docs/poster-scheduler-design.md b/docs/poster-scheduler-design.md index 4c278508be..851e9b3bc7 100644 --- a/docs/poster-scheduler-design.md +++ b/docs/poster-scheduler-design.md @@ -296,7 +296,7 @@ Before each behavior piece, audit prose made false by the change: `P_READY` term A scheduler cannot make two workers decode faster, shorten a slow server response, remove texture-upload stalls, or make 64 logical identities fit under the texture byte budget. `Delivered` does not repair the source/cache residency contract: `TexCache::evict_for` can drop residency independently of the adapter slot. That boundary is why resident-eviction work comes first. The scheduler also does not add transport cancellation, cure playback's blocking control paths, or establish a process-wide network budget. -“Then a disk cache” must mean a broader poster-art cache: [imgcache.rs](../rust-modules/platform/src/imgcache.rs) already caches avatars. Its module prose currently says posters “never will be” cached, which conflicts with the requested later roadmap. Record that contradiction rather than claiming no disk tier exists; changing that policy and its prose belongs to the later cache project. +“Then a disk cache” must mean a broader poster-art cache: [imgcache.rs](../rust-modules/os/src/imgcache.rs) already caches avatars. Its module prose currently says posters “never will be” cached, which conflicts with the requested later roadmap. Record that contradiction rather than claiming no disk tier exists; changing that policy and its prose belongs to the later cache project. **Is this worth doing on its own merits? Yes, as a bounded correctness and maintainability change; not as a throughput optimization.** Explicit FIFO within priority, typed impossible-state prevention, and accounting for hidden refresh occupancy are independently useful. The visible-first point fix already provides the main incident remedy, so a generic background-work rewrite would not earn its cost. If the implementation expands into cross-screen state ownership or a renderer rewrite, stop at the typed poster protocol and retain the patch. Performance claims wait for the measurements above. diff --git a/docs/sans-io-guide.md b/docs/sans-io-guide.md index 1475ea106f..207836ae0d 100644 --- a/docs/sans-io-guide.md +++ b/docs/sans-io-guide.md @@ -66,12 +66,12 @@ seal, not a broad `Copy` bound. See "Machine shape" in `docs/sans-io.md`. `media/src/route/{backend_policy,plan,plan_memory}.rs`; - `rust-modules/playback-contract/src` and the extracted pure `play-uri/src/{uriprobe,uri_protocol,uri_lifecycle,register_ladder,acb_bind,picture_gate}.rs` modules; -- `rust-modules/platform/src/tv/plane.rs`, the ACB plane's pure `Plane` (its runner `PlaneOwner` is in +- `rust-modules/os/src/tv/plane.rs`, the ACB plane's pure `Plane` (its runner `PlaneOwner` is in the same file, so the scan covers it too). `forks` reads every machine crate whole (`FORK_SCOPE`): all of `data/`, `plex/`, `media/`, `session/`, `screens/`, `ui/`, `appkit/`, `machine/`, `playback-contract/`, `play-uri/`, -`play-feed/` and `media-codecs/`. `platform/` is not in it: it holds forks that are not ledgered, so +`play-feed/` and `media-codecs/`. `os/` is not in it: it holds forks that are not ledgered, so `plane.rs` is scanned for workers and globals only. The scan is by file; an entry is a site to classify, not proof that its enclosing function is a diff --git a/docs/sans-io.md b/docs/sans-io.md index 8b4b9aa21d..fa04bfb669 100644 --- a/docs/sans-io.md +++ b/docs/sans-io.md @@ -170,7 +170,7 @@ dropped. `session/src`, `screens/src`, `ui/src`, `appkit/src` and `machine/src`, plus `plex/src/plex/session.rs` (the session owner's state), the player's `lifecycle.rs`, `recovery.rs` (the failed-open ladder machine), `release.rs` (the native object's release machine) and the route planners `route/plan.rs` and `route/plan_memory.rs`. The IO layers (the rest of `plex/`, `media/`, -`net/`, `platform/`) are where those calls belong, so they are not scanned. `forks` reads the whole +`net/`, `os/`) are where those calls belong, so they are not scanned. `forks` reads the whole of every crate that holds a machine (`FORK_SCOPE` in `ci/check-deps.sh` names them: `data/`, `plex/`, `media/`, `play-feed/`, `session/`, `screens/`, `ui/`, `appkit/` and `machine/` among them), because a fork anywhere in them is a test that does not run the product's code. It read only the first four until the scope was widened to the rest; the @@ -293,7 +293,7 @@ opaque payloads. Foreign types remain opaque without reproducible source-backed a familiar dependency name is not a certificate. `ci/readonly_generated.py` and `ci/proofs/platform-generated-enums.json` separately certify -the actual platform language include: pinned package/module/include, complete production +the actual os language include: pinned package/module/include, complete production build scripts, generator/templates, manifests/configuration and locked graph. The reviewed pipeline emits only unit enum variants in every configuration; strict catalogue/schema and ASCII variant validation permit new languages without a count/list pin. The same evidence diff --git a/docs/shared-servers.md b/docs/shared-servers.md index e6b6a61622..f0df3279b8 100644 --- a/docs/shared-servers.md +++ b/docs/shared-servers.md @@ -243,7 +243,7 @@ picker says so: "No internet connection. Pick this profile once while online, an offline." One online sign-in and one online pick per profile are the whole precondition. `rust-modules/plex/src/plex/CLAUDE.md` has the mechanism. **Offline artwork.** Every reusable image transcode—posters, backdrops, logos, episode stills, -profile avatars and cast headshots—uses the shared disk tier in `rust-modules/platform/src/imgcache.rs`. +profile avatars and cast headshots—uses the shared disk tier in `rust-modules/os/src/imgcache.rs`. A hit is decoded locally before any network request. Entries are keyed by stable server identity, source and transformation, with the outer request’s `X-Plex-Token` excluded; the volatile avatar roster stamp is ignored. On a stale disk hit (after a day), cached art remains visible while a bounded background lane diff --git a/docs/uri-first-migration.md b/docs/uri-first-migration.md index 6f0e49ce40..b497084807 100644 --- a/docs/uri-first-migration.md +++ b/docs/uri-first-migration.md @@ -82,7 +82,7 @@ Never hold queue/route locks while waiting for IO or a main-thread answer. One common owner admits an attempt and holds the display lease until physical release is proven. Backend workers and pending native resources stay private. Timeouts do not prove release. Keep quarantine and the shutdown rule that avoids SDL teardown while firmware workers remain alive. -The ACB plane is released through the plane owner (`platform/src/tv/plane.rs`): `UNLOADED`, then a +The ACB plane is released through the plane owner (`os/src/tv/plane.rs`): `UNLOADED`, then a fence on that call's completion callback (`docs/measurements/acb-release-fence-2026-11-04.md`), so a released plane is reusable in the same process. Only a failed fence (a refused unload, a completion that is not "complete", no completion within `RELEASE_FENCE_MS`) quarantines it until process exit. diff --git a/docs/uri-mode.md b/docs/uri-mode.md index f1ac5374c5..344f8f9bb5 100644 --- a/docs/uri-mode.md +++ b/docs/uri-mode.md @@ -24,7 +24,7 @@ displayed its URI fixture on the 4.5 dev set, as recorded below. |---|---|---| | webOS 4.10.0 / 4.4.2 | unpacked images + this project's 4.5 set | No `AVProxy` or `SDL_webOS*ExportedWindow`; the window option is ignored. Earlier probe loads decoded without a visible picture, and earlier ACB attempts returned `ERROR_06`. The controlled 2026-11-02 ACB pair later displayed moving SDR720p24 H.264/AAC URI video on the 4.5 dev set, both with and without `connectDass`; this does not establish other 4.x sets or formats. | | webOS 5.4.2 | LG 65UN80006LA (issue #1064) | `windowId` in `load` → picture, moving, with sound. `late` (`setWindowId` after `loadCompleted`) and `none` → `error code=104 "fail to create AVProxy"`. Both a `plex.direct` HTTPS direct play and an HLS transcode played. Where the picture sat and its aspect were not reported (the tester's report names picture and sound only), and the registration ladder ended on the named client (`shape=named`). | -| webOS 5.6.2 (build 5.6.2-21) | LG OLED CX (issue #1064: [the first run](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6758688148), [the single-audio product run and drive probe](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6844822550)) | **Admitted: major 5 is in `EXPORTED_STRATA`.** (a) The 5.5.0 and 5.6.2 images read `option.windowId` at load (decompile, below). (b) The PRODUCT run, on the CI build of run 43017142892 (main at `e8442d5e`, which carries #1314) installed over the existing debug app, Playback engine Experimental, quality Original, `plxnative-uriexported` armed at the jail's persistent path: a 1080p HEVC (1920x1040) MKV with ONE AAC 2.0 track and no subtitle streams, direct play. Every boot: `uri: product binding=Unbound mode=2 handle=false ptype=10 initialized=false major=5 evidence=none`, then `uri: product binding=Exported { canvas: (1920, 1080) } mode=2 evidence=override`. Play: `ls2uri: register shape=named ok after 6ms`, `uri: exported window placed src=1920x1040 rv=1`, `uri: audio index=0 is already selected (audioInfo); no selectTrack sent`, `uri: service playing`. The picture moved, full width with thin bars for 1.85:1, not stretched. Back: `ls2uri: released`. (c) The drive probe on the same build printed `load=ok playing=yes ... currentTime_advanced=yes videoInfo=seen audioInfo=seen window=exported ... shape=named end=script audio_at_load=0 clock_period_ms=200 pause=froze pause_delta=- resume=sent seek=hit seek_delta=-3898 text=sent audio=sent subs=ok eos=no pause_basis=paused_event_and_resume pause_samples=0 ... paused_event=yes seekdone=yes resume_from=2568`. `pause=froze` is printed by the current grader (#1314), so no amendment is used for it. The tester gives no paused position for the probe (no `drive pause pos=` line), so `resume_from=2568` is not compared here against rule (c)'s paused position minus 1000 ms; `pause_basis=paused_event_and_resume` is the grader's own check of the resume against the position it recorded. The audio token is `audio=sent` with `audio_at_load=0`, the rule's `audio_at_load=` alternative. Product controls: pause logged `ev=paused` and two service screenshots 2 s apart were identical (mean pixel difference 0.007 of 255); Play resumed at 39383 ms, where it paused (`timeline paused t=39s`); seek: `uri: control Seek(ContentTime(65606)) landed on the service's seekDone (its reply acknowledged first: yes)`, first `currentTime` after it 62692; a listener in the room confirmed sound in a second play: throughout, silent during a 5 s pause, back on resume and after a seek. Extra datapoint: a 4K HEVC Dolby Vision profile 8.6 MKV (3840x1604, one AC3 5.1 track) showed the TV's Dolby Vision badge, letterboxed for 2.39:1, with the same pause, seek and sound. The multi-audio film now starts in Standard and logs `uri: original declined (several audio tracks on the exported window)`; `exported_uri_leaves_multi_audio_originals_on_standard` (`rust-modules/media/src/route/uri_preflight.rs`) pins that route. History: the first run (a debug build of `main` at 5011614a, before #1314) printed `pause=unconfirmed` from its drive probe (no `currentTime` while paused, so no samples to grade), and its product run of that four-track file (AAC 5.1, AAC 5.1, Vorbis 5.1, Vorbis 5.1) failed the audio-track switch: the service lists the tracks as AAC, Vorbis, AAC, Vorbis, so `uri: selectTrack sent kind=audio index=1 stream=364534` selected Vorbis, the bus answered `{"error":{"errorCode":200,"errorText":"Audio Codec Not Supported"}}` and the play fell back to Standard. That is rule (c)'s amendment (2) case: such a file now starts in Standard, and the admission covers only the route as it now stands (audio switching on the URI path is avoided, not admitted). Not checked: subtitles on the URI path, HLS. | +| webOS 5.6.2 (build 5.6.2-21) | LG OLED CX (issue #1064: [the first run](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6758688148), [the single-audio product run and drive probe](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6844822550)) | **Admitted: major 5 is in `EXPORTED_STRATA`.** (a) The 5.5.0 and 5.6.2 images read `option.windowId` at load (decompile, below). (b) The PRODUCT run, on the CI build of run 43017142892 (main at `e8442d5e`, which carries #1314) installed over the existing debug app, Playback engine Experimental, quality Original, `plxnative-uriexported` armed at the jail's persistent path: a 1080p HEVC (1920x1040) MKV with ONE AAC 2.0 track and no subtitle streams, direct play. Every boot: `uri: product binding=Unbound mode=2 handle=false ptype=10 initialized=false major=5 evidence=none`, then `uri: product binding=Exported { canvas: (1920, 1080) } mode=2 evidence=override`. Play: `ls2uri: register shape=named ok after 6ms`, `uri: exported window placed src=1920x1040 rv=1`, `uri: audio index=0 is already selected (audioInfo); no selectTrack sent`, `uri: service playing`. The picture moved, full width with thin bars for 1.85:1, not stretched. Back: `ls2uri: released`. (c) The drive probe on the same build printed `load=ok playing=yes ... currentTime_advanced=yes videoInfo=seen audioInfo=seen window=exported ... shape=named end=script audio_at_load=0 clock_period_ms=200 pause=froze pause_delta=- resume=sent seek=hit seek_delta=-3898 text=sent audio=sent subs=ok eos=no pause_basis=paused_event_and_resume pause_samples=0 ... paused_event=yes seekdone=yes resume_from=2568`. `pause=froze` is printed by the current grader (#1314), so no amendment is used for it. The tester gives no paused position for the probe (no `drive pause pos=` line), so `resume_from=2568` is not compared here against rule (c)'s paused position minus 1000 ms; `pause_basis=paused_event_and_resume` is the grader's own check of the resume against the position it recorded. The audio token is `audio=sent` with `audio_at_load=0`, the rule's `audio_at_load=` alternative. Product controls: pause logged `ev=paused` and two service screenshots 2 s apart were identical (mean pixel difference 0.007 of 255); Play resumed at 39383 ms, where it paused (`timeline paused t=39s`); seek: `uri: control Seek(ContentTime(65606)) landed on the service's seekDone (its reply acknowledged first: yes)`, first `currentTime` after it 62692; a listener in the room confirmed sound in a second play: throughout, silent during a 5 s pause, back on resume and after a seek. Extra datapoint: a 4K HEVC Dolby Vision profile 8.6 MKV (3840x1604, one AC3 5.1 track) showed the TV's Dolby Vision badge, letterboxed for 2.39:1, with the same pause, seek and sound. The multi-audio film now starts in Standard and logs `uri: original declined (several audio tracks on the exported window)`; `exported_uri_leaves_multi_audio_originals_on_standard` (`rust-modules/src/app/adapters/backends.rs`) pins that route. History: the first run (a debug build of `main` at 5011614a, before #1314) printed `pause=unconfirmed` from its drive probe (no `currentTime` while paused, so no samples to grade), and its product run of that four-track file (AAC 5.1, AAC 5.1, Vorbis 5.1, Vorbis 5.1) failed the audio-track switch: the service lists the tracks as AAC, Vorbis, AAC, Vorbis, so `uri: selectTrack sent kind=audio index=1 stream=364534` selected Vorbis, the bus answered `{"error":{"errorCode":200,"errorText":"Audio Codec Not Supported"}}` and the play fell back to Standard. That is rule (c)'s amendment (2) case: such a file now starts in Standard, and the admission covers only the route as it now stands (audio switching on the URI path is avoided, not admitted). Not checked: subtitles on the URI path, HLS. | | webOS 6.5.3 (firmware major 6) | unpacked image `HE_DTV_W21O_AFABATAA` (webOS TV 6.5.3, release 6.5.3-47); no tester run | **Admitted, bracketed, no tester run: major 6 is in `EXPORTED_STRATA`.** (a) The 6.5.3 image reads `option.windowId` at load: `libplayerAPIs.so.1.0.0` (sha256 prefix `0b0f6654`), `StarfishMediaAPIs::parseLoadMessage`. The string `option.windowId` (file offset 0x874bc) is referenced at 0x41556 and is read as an optional string from the load JSON; when the key is present the function stores it at `MediaApiPrivate+0x90` and passes it to a virtual call (vtable slot +0x74 of the object at `MediaApiPrivate+0x5c`; the 11.2 read names the corresponding call (slot +0x78 of `+0x60`) the AVProxy builder, and the slot was not separately identified on this image). The same image's string table has `fail to create AVProxy` (0x88b44), the error 104 text. Addresses are file VAs (`objdump -d`; Ghidra's are +0x10000). Bracketed: majors 5 and 10 are each admitted on a tester's product run (the rows above and below), and they are the nearest major admitted on tester evidence on each side of 6. No tester run exists on a 6.x set, so there is no (b) and no (c): nothing says a picture, sound, pause, seek or an audio switch works there, and no other 6.x release has been read. The boot line reads `major=6 evidence=table` like any admitted major's; it does not say a tester ran it. | | webOS 7.6.0 (firmware major 7) | unpacked image `HE_DTV_W22P_AFADATAA` (webOS TV 7.6.0, release 7.6.0-1901); no tester run | **Admitted, bracketed, no tester run: major 7 is in `EXPORTED_STRATA`.** (a) The 7.6.0 image reads `option.windowId` at load: `libplayerAPIs.so.1.0.0` (sha256 prefix `0969903e`), `StarfishMediaAPIs::parseLoadMessage`. The string `option.windowId` (file offset 0x971d8) is referenced at 0x467c6 and is read as an optional string; when the key is present the function stores it at `MediaApiPrivate+0x90` and passes it to a virtual call (vtable slot +0x74 of the object at `MediaApiPrivate+0x5c`, not separately identified on this image). The same image's string table has `fail to create AVProxy` (0x98b9c). Addresses are file VAs. Bracketed: majors 5 and 10 are each admitted on a tester's product run, and they are the nearest major admitted on tester evidence on each side of 7. No tester run exists on a 7.x set, so there is no (b) and no (c), and no other 7.x release has been read. The boot line reads `major=7 evidence=table`. | | webOS 9.2.4 / 10.3.1 (33.31.68) | unpacked images; LG C2 on webOS 25 (10.x, 33.31.68; issue #1064: [the set](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6507267775), [the drive probe](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6749905096), [the first product run](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6806253745), [the Dolby Vision product run](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6834626267), [a DTS file](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6834728153), [the wider-than-16:9 product run](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6884620557)) | **Admitted: major 10 is in `EXPORTED_STRATA`, on tester evidence. Major 9 is admitted too, bracketed, no tester run.** Major 9, (a): the 9.2.4 image (`HE_DTV_W24G_AFABATAA`, webOS TV 9.2.4, release 9.2.4-48) reads `option.windowId` at load: `libplayerAPIs.so.1.0.0` (sha256 prefix `cc08e2b8`), `StarfishMediaAPIs::parseLoadMessage`. The string `option.windowId` (file offset 0x9a7c0) is referenced at 0x4385c and is read as an optional string; when the key is present the function stores it at `MediaApiPrivate+0x94` and passes it to a virtual call (vtable slot +0x78 of the object at `MediaApiPrivate+0x60`, not separately identified on this image). The same image's string table has `fail to create AVProxy` (0x99884). Addresses are file VAs. Bracketed: majors 5 and 10 are the nearest major admitted on tester evidence on each side of 9. No run exists on a 9.x set, so there is no (b) and no (c) for major 9, and no other 9.x release has been read. For major 10: (a) The 10.3 image (33.31.68) reads `option.windowId` at load (decompile, below). (b) The PRODUCT run of 2026-11-14 ([the tester's comment](https://github.com/plxnative/plx-native/issues/1064#issuecomment-6884620557)), on a debug build the tester does not name. It answers the maintainer's request of 2026-11-13 for the CI build of run 43421880266 (main at `2d565dc9f`, #1331's merge) with the override armed, Playback engine Experimental, quality Original and an original wider than 16:9 with one audio track and no subtitles. It opens "Everything was successful again: aspect ratio correct, picture is full width with black bars, audio is playing, pause, resume, seek working." and pastes the event log's `grep -E 'uri(probe)?: |ls2uri: '`: boot `uri: product binding=Exported { canvas: (1920, 1080) } mode=2 evidence=override` (the paste has no `uri: product binding=Unbound ... major=10 evidence=none` line before it, which the earlier Dolby Vision paste had, so no line of this paste names the firmware major: the run is attributed to this row by the tester's own answer in the thread, on their set); `uri: original declined (a trailer preview)`; `ls2uri: register shape=named ok after 2ms`; `uri: exported window placed src=1920x1080 rv=1`, then `uri: exported window placed src=3840x1608 rv=1` (3840x1608 is 2.39:1); `uri: audio index=0 is already selected (audioInfo); no selectTrack sent`; `uri: service playing`; `uri: control Seek(ContentTime(54901)) landed on the service's seekDone (its reply acknowledged first: yes)` and `uri: control Seek(ContentTime(130201)) landed on the service's seekDone (its reply acknowledged first: yes)`; `ls2uri: released`. This run meets rule (b): the override boot line; a picture placed from a 2.39:1 source, "full width with black bars" in the tester's words; sound ("audio is playing", with the audio and `service playing` lines logged); and controls, the two seeks logged landing on `seekDone`. Pause and resume rest on the tester's words alone: the paste has no pause line, and the backend logs none for the service's `paused` event. Two earlier product runs on the same set support it and are not relied on for the rule. On 2026-11-11 the first, answering the maintainer's request for the debug build of main at `68527cb2` (which carries #1314), pasted no lines and reported "I can confirm that everything worked: picture size/aspect, spinner clears, remaining time counts down, pause/ resume and seek also working." On 2026-11-12 the second, a 16:9 Dolby Vision MKV with one audio track and no subtitles, was "also successful" ("Audio plays, pause, resume and seek works"); its paste has the override line, `uri: exported window placed src=3840x2160 rv=1` and seeks at 31724 and 87765, after the boot line from before this entry, `uri: product binding=Unbound mode=2 handle=false ptype=10 initialized=false major=10 evidence=none`. (c) The drive probe, on an older build (the earlier grader), printed `load=ok playing=yes ... currentTime_advanced=yes ... window=exported ... shape=named end=script pause=unconfirmed ... resume=sent seek=hit seek_delta=-742 ... audio=ok ... pause_basis=reported_positions pause_samples=0 ... paused_event=yes`. Its lines: `drive pause pos=2410`, `ev=paused` at t=4701, no `currentTime` until after `drive resume pos=2410`, then `ev=currentTime value=2729`; `drive seek target=24937`, `ev=seekDone`, the first `currentTime` after it 24195; `drive selectTrack type=audio index=1`, `ev=trackSelected type=audio index=1` (its file had at least two audio tracks; the product runs' had one); `currentTime` in milliseconds about 1 s apart; the tester's answers: pause froze the picture and resume carried on from there ("Yes"), the seek "worked", "Subtitles worked, audio switch also worked" (the subtitles are the firmware's, not our overlay). The tester also reported on that probe run that the video "shows ‘connecting…’ and the buffering icon all the time" and the remaining time "only shows -0:00"; the first product run (2026-11-11) reports the spinner clearing and the remaining time counting down. **Amendment (1) is used.** The run printed `pause=unconfirmed`: with `pause_samples=0` the grader had no position to compare, because the service sends none while paused. The current grader's verdict on the run's recorded numbers stands in for the printed `pause=froze`: `uri_drive_webos_25_c2_run_replays_to_pause_froze_from_the_paused_event_and_resume` (`rust-modules/play-uri/src/uriprobe.rs`) replays them (a pause at 2410, a `paused` event inside the dwell, no samples, 2729 as the first position after the resume) and the current grader answers `pause=froze` on `pause_basis=paused_event_and_resume`; the same test shows that a resume more than 1000 ms from the paused position (3411, 1409) confirms nothing. That verdict is the test's, not a printed one. This older summary prints no `resume_from=` token, so rule (c)'s resume comparison is read from the log: first position after the resume 2729, 319 ms past the paused 2410, inside the bound. Amendment (2) is not used: no control failed. Extra datapoint, not part of the rule: a file with a DTS audio track also played as a direct play on this C2 (the tester says the set uses `dts_restore_plus`), and Diagnostics read `Audio dca -> unknown`: the row's third stage is what we declared to Starfish, and it reads `unknown` for a play on the URI backend (`feed_attempt` in `rust-modules/src/app/diagnostics.rs` on main today; the report names no build), which is expected on a URI play. Not checked: subtitles on the URI path through the product, HLS, audio-track switching through the product (a multi-audio original goes to Standard), end of stream, other 10.x minors, and a build with this table entry on a 10.x set. The 2026-11-14 run adds none of these: one audio track, no subtitles, no `evidence=table` line in its paste, and no end-of-stream line (the backend logs none for it, so a paste could not show one). | diff --git a/docs/watchlist-plan.md b/docs/watchlist-plan.md index 8a31c9e6e8..ca3838102e 100644 --- a/docs/watchlist-plan.md +++ b/docs/watchlist-plan.md @@ -95,7 +95,7 @@ Every file:line is on origin/main adf73d81a. - **Replay.** `StoreId` is append-only (data/stores/mod.rs:469-486). `ARG_SHAPE` (registry.rs:1650) feeds `SCREEN_SHAPES_PIN` (:2232); a fixture recorded against another pin cannot load (:2121-2125). 3 committed fixtures. -- **i18n.** `SHIPPED = [En, Es, Be, Fr]` (platform/i18n/mod.rs:22-23). Dates only as +- **i18n.** `SHIPPED = [En, Es, Be, Fr]` (os/i18n/mod.rs:22-23). Dates only as `YMD::short()`. No collation/case-mapping/normalization crate in Cargo.lock. - **Text tracking.** gfx/src/text.rs has no letter-spacing. - **Icons.** Commit 40b4cd14 (branch claude/zen-tesla-pqhbu8): `bookmark`, `bookmark-fill`, @@ -109,14 +109,14 @@ Every file:line is on origin/main adf73d81a. |---|---|---| | `plex::watchlist` (plex/src/plex/watchlist.rs) | plex | `impl AccountClient`: paged list, released list, `user_state(hex)`, `catalog_item(hex)`, add/remove PUT. Drift-tolerant DTOs; injectable `request` closure. Base URL `account::discover()` (moved from this file; `discover.rs`'s person routes share it): DISCOVER, or `/tmp/plxnative-discover` (else the `plxnative-plextv` loopback) behind the `loopback_http` guard as `plex_tv()`. Logs status + endpoint shape only. | | `Client::find_by_guids` (plex/library.rs) | plex | One `/library/all?type=T&guid=a,b,c` per server per kind (1 movie, 2 show), ≤40 guids/request; other guid kinds not matched. | -| `watchlist` (data/src/watchlist.rs) | data — ADD to `[data] members` + docs/module-layers.md line. Names `plx_plex` (incl. `plex::servers` facts_gen/roster_gen/probe_result, `plex::session`), base, machine, platform. NOT net, NOT media. | Rows, released set, match table, `TileState`, intent ledger, client-side sort/filter, comparator. | +| `watchlist` (data/src/watchlist.rs) | data — ADD to `[data] members` + docs/module-layers.md line. Names `plx_plex` (incl. `plex::servers` facts_gen/roster_gen/probe_result, `plex::session`), base, machine, os. NOT net, NOT media. | Rows, released set, match table, `TileState`, intent ledger, client-side sort/filter, comparator. | | `stores::watchlist` | data | `WatchlistStore`: main-thread state + `Arc` mailbox (viewstate ownership pattern). `StoreId::Watchlist` APPENDED. | | `catalog` (data/src/catalog.rs) + `stores::catalog` | data — ADD to members | Discover-only item page fetch/state. `StoreId::Catalog` appended. | | `screens::watchlist` | screens | The page. | | `screens::catalog` | screens | Lightweight page for a Discover-only item (§1.7). | | `appkit::hero_layout` | appkit | Hero geometry/meta-line helpers moved out of detail/hero.rs so Detail and catalog share them without breaking the sibling rule. | | `ui::icons`, `ui::cards::{landing,grid}`, `ui::popover`, gfx `fs_glass.frag`, gfx text | ui/gfx | DS PRs | -| `platform::i18n` | platform | Month-name dates, strings | +| `os::i18n` | os | Month-name dates, strings | | app (chrome.rs, bridge.rs, content.rs, effects.rs, input) | app | Strip vocabulary, routing, `AppArg::Watchlist`, tab pulse | Nothing names webOS. Screens never name a sibling screen or app. @@ -495,7 +495,7 @@ Empty states: full-screen read-out (verdict y=372, no glyph, sentence case): emp "filter left nothing". DS rule change: verdict in PRIMARY text colour, body secondary, everywhere. App text never elides (ui/src/CLAUDE.md). Focus caption: TileLabel title + secondary line; unplayable → state sentence ("Coming 12 -Mar"). ICU4X dates numeric only today (`platform/src/i18n/mod.rs:151-163`); need month-name +Mar"). ICU4X dates numeric only today (`os/src/i18n/mod.rs:151-163`); need month-name format for En/Es/Be (`SHIPPED`, `mod.rs:22`). **Tile states.** Unplayable tiles visible+focusable; OK → Detail, hold → menu. State marks @@ -509,7 +509,7 @@ duotone, frosted tiles. not on list, filled when on. No label under a hero disc, at rest or focused (design-review S25's focused caption, "Add to Watchlist" / "On Watchlist", was removed by the owner on 2026-10-20). Without Play (coming soon / on no server / server offline): labelled pill in primary slot "Add to Watchlist" (outline) / "On Watchlist" (filled) + status line with icon; coming-soon also has a 36 px "Coming 12 March" -line and a Trailer button. NO toast anywhere (not `platform/src/tv/toast.rs`); button state is +line and a Trailer button. NO toast anywhere (not `os/src/tv/toast.rs`); button state is the only feedback. **Hold menus.** Episode menu rows today: Go to Episode, Go to Show, —, Mark as Watched, Play diff --git a/docs/webos5-port.md b/docs/webos5-port.md index cde0e4b07e..a13e311b4b 100644 --- a/docs/webos5-port.md +++ b/docs/webos5-port.md @@ -432,7 +432,7 @@ a question of presence alone, so a green matrix proves none of them. | --- | --- | --- | --- | --- | --- | | 1 | **Video-plane binding** | ACB on webOS 2.2.3 to 4.10.0, the SDL exported window on 5.3.1+ (the header comment of `src/video_plane.c`) | `dlopen("libAcbAPI.so.1")` and seven required `AcbAPI_*` entry points (`vp_mode` in `src/video_plane.c`); `SDL_webOSCreateExportedWindow` and `SDL_webOSSetExportedWindow` by `dlsym(RTLD_DEFAULT)` (`vp_mode`) | `vp_mode` resolves once and logs `vplane: ACB (webOS 4.x)`, `vplane: SDL exported window (webOS 5+)` or `vplane: NONE` (`vp_mode`); every required pointer must resolve | A library that opens with a missing entry point logs it and falls through to the SDL probe (`vp_mode`); neither resolving gives `VP_NONE`, logged as "video cannot be shown" (the end of `vp_mode`) and no plane is bound | | 2 | **Callback context overload and the `callbackFunctionHook` interposer** | Device-proven on webOS 4.10.2; the inventories only show the symbols exist (the comment above `SMP_LoadWithContextFn` in `src/starfish.c`) | `_ZN17StarfishMediaAPIs4LoadEPKcPFvixS1_PvES2_`, `_ZN17StarfishMediaAPIs20callbackFunctionHookEixPKc` (`SMP_LOAD_WITH_CONTEXT_SYMBOL` and `SMP_CALLBACK_HOOK_SYMBOL` in `src/starfish.c`) | Both resolve with `dlsym` and must be owned by a library whose path contains `libplayerAPIs.so`; the result is logged as `native callback gate: hook=...` or `BLOCKED` (`sf_resolve_callback_hook_once` in `src/starfish.c`) | None. `BLOCKED` latches `g_lifecycle_blocked` and `sf_load` returns 0 (the refusal at the top of `sf_load` in `src/starfish.c`), so every Load is refused: playback does not start on that release | -| 3 | **Two `Feed` ABIs** | `B5cxx11` name from 4.4.2 on, the pre-C++11 copy-on-write string on 3.9.2 and earlier (the comment above `SMP_FeedFn` in `src/starfish.c`) | `_ZN17StarfishMediaAPIs4FeedB5cxx11EPKc`, else `_ZN17StarfishMediaAPIs4FeedEPKc` with `_ZNSsD1Ev` to release the reply (`sf_resolve_feed_once` in `src/starfish.c`) | The first name that resolves wins and is logged as `feed abi: cxx11\|cow\|NONE fn=... dtor=...` (`sf_resolve_feed_once`); a COW library whose `_ZNSsD1Ev` is missing leaks every reply and the log shows `dtor=(nil)` | Neither name resolving makes `sf_feed` return `e` for every unit (`sf_feed`): nothing is ever accepted. Which ABI resolved is read by Rust through `feed_abi_is_cow` (`StarfishSink::feed_abi_is_cow` in `rust-modules/platform/src/webos/video_sink.rs`, over `sf_feed_abi_is_cow` in `src/starfish.c`) and feeds row 4 | +| 3 | **Two `Feed` ABIs** | `B5cxx11` name from 4.4.2 on, the pre-C++11 copy-on-write string on 3.9.2 and earlier (the comment above `SMP_FeedFn` in `src/starfish.c`) | `_ZN17StarfishMediaAPIs4FeedB5cxx11EPKc`, else `_ZN17StarfishMediaAPIs4FeedEPKc` with `_ZNSsD1Ev` to release the reply (`sf_resolve_feed_once` in `src/starfish.c`) | The first name that resolves wins and is logged as `feed abi: cxx11\|cow\|NONE fn=... dtor=...` (`sf_resolve_feed_once`); a COW library whose `_ZNSsD1Ev` is missing leaks every reply and the log shows `dtor=(nil)` | Neither name resolving makes `sf_feed` return `e` for every unit (`sf_feed`): nothing is ever accepted. Which ABI resolved is read by Rust through `feed_abi_is_cow` (`StarfishSink::feed_abi_is_cow` in `rust-modules/os/src/webos/video_sink.rs`, over `sf_feed_abi_is_cow` in `src/starfish.c`) and feeds row 4 | | 4 | **Decompiled struct offsets** | Read off the webOS 4.5 `libplayerAPIs` and `libpf`; nothing confirms them on another build (`docs/webos5-port.md` §4 item 3) | `StarfishMediaAPIs` object `+0x4c` to the player, player `+0x04` to the pipeline (`sf_pipeline` in `src/starfish.c`); `MEDIA_CUSTOM_CONTENT_INFO` size `0x138`, `ptsToDecode` at `+0x28` (`CI_SIZE` and `CI_PTS_OFF` in `src/starfish.c`, used by `sf_set_content_info`) | `inplace_layout_known(major, feed_abi_is_cow)`: true when the Feed ABI is not COW and the major is 0 or at least 4 (`rust-modules/play-feed/src/seek.rs`, used by `select_seek_mode_for_load` at every Load). `sf_pipeline` only checks the two pointers for NULL. None for the offsets themselves: a wrong layout that still yields non-NULL pointers is not detected | A layout-unknown library never selects `Segment` (row 5); a NULL pipeline pointer makes `sf_send_segment` return 0, which downgrades the session to `Reload` (`feed_stream` in `rust-modules/play-feed/src/native_executor.rs`) | | 5 | **Segment seek: `setTimeToDecode`, `loadSpi_getInfo` + `setContentInfo`, `sendSegmentEvent`** | webOS 4.x on the ACB plane: selected when the layout is known and the window is not `VP_EXPORTED` (`select_seek_mode` in `rust-modules/play-feed/src/seek.rs`) | `_ZN17StarfishMediaAPIs15setTimeToDecodeEPKc`, `mediapipeline::CustomPipeline::{loadSpi_getInfo, setContentInfo, sendSegmentEvent}`, all strong `__asm__` references (the `SMP_setTimeToDecode` and `CP_*` externs in `src/starfish.c`) | `setTimeToDecode` returning 0 is expected on 4.5 and routes to the content-info call (`set_time_to_decode` then `set_content_info` in `feed_stream`). `sendSegmentEvent` returns void, so its effect is not checked; `sf_send_segment` reports only whether a pipeline pointer existed (`sf_send_segment` in `src/starfish.c`). A seek that never anchors is caught by the reopen watchdog (`SEEK_STUCK_MS` in `rust-modules/media/src/player/pump.rs`). After Play, the Segment seek stays pending until the clock has ticked and the reported position is on the accepted video timeline, and, on a session that has received any displayed-frame callback, a zero count included (`Shared::sink_counter_seen`), until a fresh positive count has arrived since Play (`stuck_seek_due` in `rust-modules/play-feed/src/feed_pump.rs`). A session with no such callback lands on the clock and the runway alone: a set that cannot send the counter would otherwise reload every in-place seek (#1436) | `sendSegment=0` sets the session's mode to `Reload` (`feed_stream` in `rust-modules/play-feed/src/native_executor.rs`); a stuck seek retries the reopen up to twice, then calls `reload_at` (`retry_stuck_seek` in `rust-modules/play-feed/src/feed_pump.rs` and the `StuckSeekAction::Reload` arm beside `SEEK_STUCK_MS` in `pump.rs`). A primed Segment seek that still cannot present after `SEGMENT_PRESENTATION_MS` (4 s) falls back directly to a fresh Load at the seek target, and the one `seek: Segment presentation deadline` event-log line names which of the clock, the runway and the fresh count was missing. `/tmp/plxnative-seekmode` overrides the choice on a debug build (`dev_seek_mode` in `seek.rs`) | | 6 | **Public `StarfishMediaAPIs::Seek`** | Always on `VP_EXPORTED` (webOS 5+, decompiled on 4.5, never run on 5+ per §4); on the ACB plane only for a known release 3, device-tested on 3.9.3 (`old_abi_seek_tested` in `seek.rs`, §4 "On webOS 3") | `_ZN17StarfishMediaAPIs4SeekEPKc` (`SMP_Seek` and `sf_seek_ms` in `src/starfish.c`) | A return of 0 is read as a refusal (`feed_stream`); the stuck watchdog above also covers it. None for a `Seek` that is accepted and then anchors wrong (the `select_seek_mode` doc in `seek.rs`) | A refused `Seek` sets the session to `Reload` and latches `native_seek_refused` so the rest of that playback reloads per seek; a fresh play clears it (`FeedCommand::BeginPlayback` in `rust-modules/play-feed/src/control.rs`, `feed_stream`) | diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 6ce57a3605..75bb12169e 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -1,6 +1,6 @@ # The `cargo fuzz` package over every parser a HUD package or the registry reaches (PR16 of the -# player-HUD plugin series; docs/hud-plugins.md, "Trust and safety"), and over the WebSocket codec -# (`plx_net::ws`). It ships nothing and changes no +# player-HUD plugin series; docs/hud-plugins.md, "Trust and safety"), over the WebSocket codec +# (`plx_net::ws`) and over the Open Watch Party reader (`plx_owp::json`). It ships nothing and changes no # shipped build. # # WHERE IT LIVES. A top-level `fuzz/`, with a `[workspace]` of its own: it is not a member of the @@ -10,7 +10,7 @@ # tree (`ci/check-module-layers.py`, `ci/check-deps.sh`, `ci/check-list-caps.py`) and its binaries # would need an `exclude`; here they cannot see it. # -# WHAT IT FUZZES. The parsers of `plx_appkit` (`hud_format`), `plx_data` (`hudpacks`) and `plx_net` (`ws`), +# WHAT IT FUZZES. The parsers of `plx_appkit` (`hud_format`), `plx_data` (`hudpacks`), `plx_net` (`ws`) and `plx_owp` (`json`), # built in the host-simulator configuration: `hostsim`, the only one a host executable can link (the television build # declares the LS2, glib and ACB symbols only the TV's own libraries define). The parsers have no `cfg` # on that feature (`rust-modules/Cargo.toml`, "What it changes, and nothing else"), and nothing here @@ -25,7 +25,7 @@ name = "plxnative-fuzz" version = "0.0.0" edition = "2021" license = "GPL-3.0-or-later" -description = "Fuzz targets over the HUD package, bundle, SVG, address and registry-index parsers and the WebSocket codec. Not shipped." +description = "Fuzz targets over the HUD package, bundle, SVG, address and registry-index parsers, the WebSocket codec and the Open Watch Party reader. Not shipped." repository = "https://github.com/GLinnik21/plx-native" publish = false build = "build.rs" @@ -41,6 +41,7 @@ plx_base = { path = "../rust-modules/base" } plx_appkit = { path = "../rust-modules/appkit" } plx_data = { path = "../rust-modules/data" } plx_net = { path = "../rust-modules/net" } +plx_owp = { path = "../rust-modules/owp" } # The registry-index targets sign with TEST ONLY keys (`src/signing.rs`) to reach what follows the signature # check. The same version and features as `plx_data`, so the lock gains nothing. ed25519-compact = { version = "=2.6.1", default-features = false, features = ["opt_size"] } @@ -114,3 +115,10 @@ path = "fuzz_targets/ws_frame.rs" test = false doc = false bench = false + +[[bin]] +name = "owp_json" +path = "fuzz_targets/owp_json.rs" +test = false +doc = false +bench = false diff --git a/fuzz/fuzz_targets/owp_json.rs b/fuzz/fuzz_targets/owp_json.rs new file mode 100644 index 0000000000..862850d68a --- /dev/null +++ b/fuzz/fuzz_targets/owp_json.rs @@ -0,0 +1,63 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; +use plx_owp::json::{read, scanned, Json, DISAGREEMENT}; +use plx_owp::message::decode; +use plxnative_fuzz as _; + +#[derive(Default)] +struct Seen { + strings: usize, + marked: Vec, + numbers: usize, + overflowing: Vec, +} + +impl Seen { + fn string(&mut self, unpaired: bool) { + if unpaired { + self.marked.push(self.strings); + } + self.strings += 1; + } + + fn number(&mut self, infinite: bool) { + if infinite { + self.overflowing.push(self.numbers); + } + self.numbers += 1; + } + + fn walk(&mut self, value: &Json) { + match value { + Json::Str(text) => self.string(text.unpaired), + Json::Int(_) => self.number(false), + Json::Float(number) => self.number(number.is_infinite()), + Json::Array(items) => items.iter().for_each(|item| self.walk(item)), + Json::Object(members) => members.iter().for_each(|(key, value)| { + self.string(key.unpaired); + self.walk(value); + }), + Json::Null | Json::Bool(_) => {} + } + } +} + +fuzz_target!(|data: &[u8]| { + let Ok(input) = std::str::from_utf8(data) else { return }; + let scan = scanned(input).expect("the scan broke the UTF-8 of its input"); + assert_eq!(scan.length, input.len(), "the scan changed the length"); + let _ = decode(input); + let read = read(input); + if let Err(error) = &read { + assert_ne!(error.to_string(), DISAGREEMENT, "the scan and the visitor disagree on {input:?}"); + } + if serde_json::from_str::(input).is_ok() { + assert!(read.is_ok(), "serde_json reads {input:?} and the reader does not"); + assert!(scan.marked.is_empty(), "marks on {input:?}, which serde_json reads"); + } + let Ok(read) = read else { return }; + let mut seen = Seen::default(); + seen.walk(&read.value); + assert_eq!(seen.marked, scan.marked, "the visitor marked other strings than the scan"); + assert_eq!(seen.overflowing, scan.overflowing, "the visitor made other numbers infinite than the scan"); +}); diff --git a/rust-modules/Cargo.lock b/rust-modules/Cargo.lock index 4e257a633a..1c8228527c 100644 --- a/rust-modules/Cargo.lock +++ b/rust-modules/Cargo.lock @@ -766,7 +766,7 @@ dependencies = [ "plx_gfx", "plx_machine", "plx_media", - "plx_platform", + "plx_os", "plx_plex", "plx_telemetry", "plx_ui", @@ -790,7 +790,7 @@ dependencies = [ "plx_data", "plx_machine", "plx_net", - "plx_platform", + "plx_os", "plx_playback_contract", "plx_plex", "plx_telemetry", @@ -815,7 +815,7 @@ dependencies = [ "plx_base", "plx_machine", "plx_net", - "plx_platform", + "plx_os", "plx_plex", "qrcodegen", "serde", @@ -843,7 +843,7 @@ dependencies = [ "plx_media", "plx_media_codecs", "plx_net", - "plx_platform", + "plx_os", "plx_play_feed", "plx_playback_contract", "plx_plex", @@ -875,7 +875,7 @@ dependencies = [ ] [[package]] -name = "plx_platform" +name = "plx_os" version = "0.0.0" dependencies = [ "icu_calendar", @@ -891,6 +891,14 @@ dependencies = [ "serde_json", ] +[[package]] +name = "plx_owp" +version = "0.0.0" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "plx_play_feed" version = "0.0.0" @@ -900,7 +908,7 @@ dependencies = [ "plx_base", "plx_media_codecs", "plx_net", - "plx_platform", + "plx_os", "plx_playback_contract", "serde", "serde_json", @@ -911,7 +919,7 @@ name = "plx_play_uri" version = "0.0.0" dependencies = [ "plx_base", - "plx_platform", + "plx_os", "plx_play_uri", "plx_playback_contract", "serde", @@ -934,7 +942,7 @@ dependencies = [ "plx_base", "plx_machine", "plx_net", - "plx_platform", + "plx_os", "serde", "serde_json", ] @@ -952,7 +960,7 @@ dependencies = [ "plx_machine", "plx_media", "plx_net", - "plx_platform", + "plx_os", "plx_play_feed", "plx_plex", "plx_screens", @@ -971,7 +979,7 @@ dependencies = [ "plx_jellyfin", "plx_machine", "plx_net", - "plx_platform", + "plx_os", "plx_plex", "plx_session", "plx_telemetry", @@ -986,7 +994,7 @@ dependencies = [ "libc", "plx_base", "plx_net", - "plx_platform", + "plx_os", "plx_plex", "serde", "serde_json", @@ -1000,7 +1008,7 @@ dependencies = [ "plx_base", "plx_gfx", "plx_machine", - "plx_platform", + "plx_os", "qrcodegen", "serde", "serde_json", @@ -1021,7 +1029,7 @@ dependencies = [ "plx_media", "plx_media_codecs", "plx_net", - "plx_platform", + "plx_os", "plx_play_feed", "plx_play_uri", "plx_playback_contract", diff --git a/rust-modules/Cargo.toml b/rust-modules/Cargo.toml index ce04edfc3c..a550f631da 100644 --- a/rust-modules/Cargo.toml +++ b/rust-modules/Cargo.toml @@ -1,5 +1,5 @@ # A cargo workspace with this package as its ROOT; the other members are the storage helper and the -# layer crates split out of the application (everything under `rust-modules/*/` with a `[package.metadata.plx] mount`: base/, machine/, net/, platform/, gfx/, ui/, plex/, telemetry/, data/, session/, media/, play-feed/, appkit/, screens/ and the contract and codec crates; +# layer crates split out of the application (everything under `rust-modules/*/` with a `[package.metadata.plx] mount`: base/, machine/, net/, os/, gfx/, ui/, plex/, telemetry/, data/, session/, media/, play-feed/, appkit/, screens/, owp/ and the contract and codec crates; # docs/module-layers.md). # The root keeps the literal `version` below (release tooling reads it), `make`/CI run their usual # commands from this directory against this package (a bare `cargo test`/`check`/`build` here still @@ -11,7 +11,7 @@ members = [ "playback-contract", "machine", "net", - "platform", + "os", "gfx", "ui", "plex", @@ -26,6 +26,7 @@ members = [ "media-codecs", "appkit", "screens", + "owp", "storage", ] resolver = "2" @@ -79,8 +80,8 @@ required-features = ["hostsim"] default = ["play-uri", "play-feed", "devtools", "devtriggers", "threadcheck"] # Explicit production URI transport/driver inclusion. The buffer-feed route remains the default; # this feature does not qualify, select or promote a URI playback attempt. -play-uri = ["dep:plx_play_uri", "plx_platform/uri-transport"] -play-feed = ["dep:plx_play_feed", "plx_platform/feed-sink"] +play-uri = ["dep:plx_play_uri", "plx_os/uri-transport"] +play-feed = ["dep:plx_play_feed", "plx_os/feed-sink"] # Developer-facing chrome that must not reach a public build. Currently: the on-screen # seven-segment counter. Everything gated here must be DRAW-ONLY or otherwise inert — the device # is the only test this project has, so a release build must not differ from the tested one in @@ -99,7 +100,7 @@ devtriggers = [ "plx_base/devtriggers", "plx_machine/devtriggers", "plx_net/devtriggers", - "plx_platform/devtriggers", + "plx_os/devtriggers", "plx_gfx/devtriggers", "plx_ui/devtriggers", "plx_plex/devtriggers", @@ -128,7 +129,7 @@ threadcheck = ["plx_base/threadcheck", "plx_ui/threadcheck"] # it adds: a bounded in-memory copy of the lines `crate::log` already writes, one key arm, one row # in two menus, one overlay, pinned diagnostic POSTs and an opt-in pinned HTTPS long-poll worker. # Everything else compiles identically. -lab-diagnostics = ["plx_base/lab-diagnostics", "plx_net/lab-diagnostics", "plx_platform/lab-diagnostics", "plx_media/lab-diagnostics"] +lab-diagnostics = ["plx_base/lab-diagnostics", "plx_net/lab-diagnostics", "plx_os/lab-diagnostics", "plx_media/lab-diagnostics"] # **The demo-video dump build's pixel oracle** (`rust-modules/ui/src/placeholder.rs`): every # placeholder the UI draws is painted flat in one exact colour (#FF00FE) at alpha 1, so the dump's @@ -177,7 +178,7 @@ placeholder-sentinel = ["plx_ui/placeholder-sentinel"] # (LG's SDL fork shifts SDL_KeyboardEvent; stock SDL2 does not), and the wayland/glib calls that # have no host equivalent. Everything else — all of `ui/`, the whole Plex data layer, the demux # orchestration — is compiled identically for both. -hostsim = ["dep:xxhash-rust", "plx_base/hostsim", "plx_machine/hostsim", "plx_platform/hostsim", "plx_gfx/hostsim", "plx_plex/hostsim", "plx_telemetry/hostsim", "plx_data/hostsim", "plx_session/hostsim", "plx_media/hostsim", "plx_play_feed?/hostsim"] +hostsim = ["dep:xxhash-rust", "plx_base/hostsim", "plx_machine/hostsim", "plx_os/hostsim", "plx_gfx/hostsim", "plx_plex/hostsim", "plx_telemetry/hostsim", "plx_data/hostsim", "plx_session/hostsim", "plx_media/hostsim", "plx_play_feed?/hostsim"] # Warnings are ERRORS, for both workspace packages, in every cargo invocation — build, check, test, clippy, the # ARM cross-build and the simulator alike. The tree reached zero warnings in all four @@ -226,10 +227,10 @@ plx_base = { path = "base" } # The machine layer (ci/module-layers.ini `[machine]`): machines and effects, the present gate, the # idle wake, the landing schedule, motion. Features it has a `cfg` on are forwarded above. plx_machine = { path = "machine" } -# The platform layer (ci/module-layers.ini `[platform]`): webOS identity, the storage helper client, +# The os layer (ci/module-layers.ini `[os]`): webOS identity, the storage helper client, # the key stores, the codec table, the artwork cache, the localization catalog, the Cloud Lab session # file. It owns the build script that generates the catalog and the install identities. -plx_platform = { path = "platform" } +plx_os = { path = "os" } # The gfx layer (ci/module-layers.ini `[gfx]`): the GLES2 renderer, the EGL probe, text, images, the # vector-icon rasterizer FFI and the GPU instruments. It declares the GL/SDL_ttf/nanosvg symbols and # links nothing on the television; the Makefile links them. @@ -259,7 +260,7 @@ plx_session = { path = "session" } # The media layer (ci/module-layers.ini `[media]`): neutral orchestration over the backend seam: the HTTPS # media plane, adaptive bitrate, the player engine and route selection. The demuxer, HLS and the buffer-feed # engine are `plx_play_feed`'s, and the two C callbacks `src/starfish.c` calls are `plx_play_feed::sf_event`'s and -# `plx_platform`'s (`webos::video_sink`); it links nothing on the television. +# `plx_os`'s (`webos::video_sink`); it links nothing on the television. plx_media = { path = "media", default-features = false } plx_playback_contract = { path = "playback-contract" } plx_play_uri = { path = "play-uri", optional = true } @@ -348,9 +349,9 @@ debug = "line-tables-only" plx_base = { path = "base", features = ["test-support"] } # Likewise the machine layer's fixtures (`landgate::fixture_gate`, `idle::reset_for_test`, ...). plx_machine = { path = "machine", features = ["test-support"] } -# Likewise the platform layer's seams (`i18n`'s thread locale, `storage`'s fault injection and +# Likewise the os layer's seams (`i18n`'s thread locale, `storage`'s fault injection and # in-process helper backend, `tv`'s sandbox/home/secure-store seams). -plx_platform = { path = "platform", features = ["test-support"] } +plx_os = { path = "os", features = ["test-support"] } # Likewise the gfx layer's seams (`text`'s prewarm and capture hooks, `gfx::backdrop::commit`, ...). plx_gfx = { path = "gfx", features = ["test-support"] } # Likewise the net layer's loopback PMS fixtures, `keypin`/`resolve` seams and canned responses. diff --git a/rust-modules/appkit/Cargo.toml b/rust-modules/appkit/Cargo.toml index b9d9614d31..e9733bfd18 100644 --- a/rust-modules/appkit/Cargo.toml +++ b/rust-modules/appkit/Cargo.toml @@ -28,17 +28,17 @@ default = [] # Forwarded from the application crate, which is the only one that sets it. Nothing in this crate # has a `cfg` on it; it is declared so that `cargo test -p plx_appkit` (which dev-depends on this # crate with it) builds the layers below with the dev trigger surface, as the Makefile's suite does. -devtriggers = ["plx_base/devtriggers", "plx_machine/devtriggers", "plx_platform/devtriggers", "plx_gfx/devtriggers", "plx_ui/devtriggers", "plx_plex/devtriggers", "plx_telemetry/devtriggers", "plx_data/devtriggers", "plx_media/devtriggers"] +devtriggers = ["plx_base/devtriggers", "plx_machine/devtriggers", "plx_os/devtriggers", "plx_gfx/devtriggers", "plx_ui/devtriggers", "plx_plex/devtriggers", "plx_telemetry/devtriggers", "plx_data/devtriggers", "plx_media/devtriggers"] # The `cfg(test)` seams other crates' tests use (`player_hud::SkipIntervalGuard`, the `overscan_rects` # audits, the row/page read-backs of the menus, ...). Enabled from the dependents' `[dev-dependencies]`; # never in a shipped build. It enables the lower layers' own `test-support` because the seams call # into them. -test-support = ["plx_base/test-support", "plx_machine/test-support", "plx_platform/test-support", "plx_gfx/test-support", "plx_ui/test-support", "plx_plex/test-support", "plx_telemetry/test-support", "plx_data/test-support", "plx_media/test-support"] +test-support = ["plx_base/test-support", "plx_machine/test-support", "plx_os/test-support", "plx_gfx/test-support", "plx_ui/test-support", "plx_plex/test-support", "plx_telemetry/test-support", "plx_data/test-support", "plx_media/test-support"] [dependencies] plx_base = { path = "../base" } plx_machine = { path = "../machine" } -plx_platform = { path = "../platform" } +plx_os = { path = "../os" } plx_gfx = { path = "../gfx" } plx_ui = { path = "../ui" } plx_plex = { path = "../plex" } @@ -54,7 +54,7 @@ zip = { version = "=9.2.2", default-features = false } plx_appkit = { path = ".", features = ["devtriggers"] } plx_base = { path = "../base", features = ["test-support"] } plx_machine = { path = "../machine", features = ["test-support"] } -plx_platform = { path = "../platform", features = ["test-support"] } +plx_os = { path = "../os", features = ["test-support"] } plx_gfx = { path = "../gfx", features = ["test-support"] } plx_ui = { path = "../ui", features = ["test-support"] } plx_plex = { path = "../plex", features = ["test-support"] } diff --git a/rust-modules/appkit/src/hero_layout.rs b/rust-modules/appkit/src/hero_layout.rs index 3058b13cb4..9cf45e9b07 100644 --- a/rust-modules/appkit/src/hero_layout.rs +++ b/rust-modules/appkit/src/hero_layout.rs @@ -72,9 +72,9 @@ pub fn pill_w(measure: &dyn Measure, label: &CStr, sz: i32, icon: bool, trailing /// Shared by the Detail hero and card menu, and by Home when it has no resume duration to show. pub fn play_label(resumes: bool) -> &'static CStr { if resumes { - plx_platform::i18n::msg::browse_detail_resume_c() + plx_os::i18n::msg::browse_detail_resume_c() } else { - plx_platform::i18n::msg::browse_detail_play_c() + plx_os::i18n::msg::browse_detail_play_c() } } @@ -86,9 +86,9 @@ pub fn play_width(measure: &dyn Measure, label: &CStr) -> f32 { /// [`play_label`] as text, for the rows that take a `&str`. pub fn play_text(resumes: bool) -> &'static str { if resumes { - plx_platform::i18n::msg::browse_detail_resume() + plx_os::i18n::msg::browse_detail_resume() } else { - plx_platform::i18n::msg::browse_detail_play() + plx_os::i18n::msg::browse_detail_play() } } @@ -200,7 +200,7 @@ pub fn time_facts(year: i64, aired: &str, episode: bool, dur_ms: i64, resume_ms: let length = (dur_ms >= 60_000).then(|| { if resumes { let left = dur_ms.saturating_sub(resume_ms); - if left < 3_600_000 { plx_platform::i18n::msg::browse_detail_minutes_left((left / 60_000).max(1)) } + if left < 3_600_000 { plx_os::i18n::msg::browse_detail_minutes_left((left / 60_000).max(1)) } else { plx_ui::fmt::time_left(left) } } else { plx_ui::fmt::duration(dur_ms) } }); @@ -215,9 +215,9 @@ pub fn meta_facts(d: &Detail, episode: Option<&Episode>) -> (String, Option 0 { - plx_platform::i18n::msg::browse_detail_extent(&plx_platform::i18n::msg::browse_detail_episodes(episodes), &seasons) + plx_os::i18n::msg::browse_detail_extent(&plx_os::i18n::msg::browse_detail_episodes(episodes), &seasons) } else { seasons }; (facts.0, Some(extent)) } diff --git a/rust-modules/appkit/src/hero_layout_tests.rs b/rust-modules/appkit/src/hero_layout_tests.rs index 902f9bf3d5..bcb672aad0 100644 --- a/rust-modules/appkit/src/hero_layout_tests.rs +++ b/rust-modules/appkit/src/hero_layout_tests.rs @@ -144,14 +144,14 @@ fn proposal_play_capsule_keeps_its_minimum_and_grows_for_translations() { #[test] fn pdf_proposal_movie_facts_use_year_and_remaining_time() { let d = Detail { year: 2024, aired: "2024-03-09".into(), dur_ms: 112 * 60_000, resume_ms: 74 * 60_000, ..Default::default() }; - assert_eq!(meta_facts(&d, None), ("2024".into(), Some(plx_platform::i18n::msg::browse_detail_minutes_left(38)))); + assert_eq!(meta_facts(&d, None), ("2024".into(), Some(plx_os::i18n::msg::browse_detail_minutes_left(38)))); let fresh = Detail { resume_ms: 0, ..d }; assert_eq!(meta_facts(&fresh, None), ("2024".into(), Some(plx_ui::fmt::duration(112 * 60_000)))); } #[test] fn pdf_proposal_episode_facts_use_a_named_month_and_validate_resume() { - let _locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); assert_eq!(time_facts(2024, "2024-03-02", true, 48 * 60_000, 10 * 60_000), ("Mar 2, 2024".into(), Some("38 min left".into()))); assert_eq!(time_facts(2024, "2024-02-30", true, 48 * 60_000, 49 * 60_000), diff --git a/rust-modules/appkit/src/hud_format/compile.rs b/rust-modules/appkit/src/hud_format/compile.rs index 1ec54e8943..77854de5a8 100644 --- a/rust-modules/appkit/src/hud_format/compile.rs +++ b/rust-modules/appkit/src/hud_format/compile.rs @@ -57,7 +57,7 @@ use std::ffi::CString; use plx_machine::machine::Measure; use plx_media::player::text_style::HudBand; -use plx_platform::i18n::{msg, LocaleContext}; +use plx_os::i18n::{msg, LocaleContext}; use plx_ui::consts::{SAFE, SCR_H, SCR_W}; use plx_ui::hstack::{Align, HStack, Item}; use plx_ui::vstack::{Anchor, VStack}; @@ -118,7 +118,7 @@ pub struct AppLabels { impl AppLabels { /// **The app's own strings in the language `cx` names**: the one constructor of [`AppLabels`], over the /// generated `msg::*_in(cx)` accessors. The language is an ARGUMENT, so nothing here reads the - /// process-wide current locale: the app layer passes `plx_platform::i18n::current()` when it compiles + /// process-wide current locale: the app layer passes `plx_os::i18n::current()` when it compiles /// (outside the draw, `player_hud::loaded`), the lint passes each shipped language's context. pub fn in_language(cx: &LocaleContext) -> AppLabels { AppLabels { @@ -2634,7 +2634,7 @@ mod content_axis_tests { r#"{ "id": "title", "when": "title.is_episode", "cells": ["#); let package = crate::hud_format::fixtures::parse(text.as_bytes()).package.unwrap(); let mut compiled = compile(&package, &plx_ui::fixture::FixtureMeasure, - CompileCtx { labels: AppLabels::in_language(plx_platform::i18n::english()) }); + CompileCtx { labels: AppLabels::in_language(plx_os::i18n::english()) }); assert!(crate::player_hud::loaded::answers_every_frame(&compiled)); compiled.states.retain(|state| !(state.key.open == 0 && state.key.slot == Slot::Discs && state.key.episode && state.key.real_episode == Some(false))); assert!(!crate::player_hud::loaded::answers_every_frame(&compiled)); diff --git a/rust-modules/appkit/src/hud_format/compile_tests.rs b/rust-modules/appkit/src/hud_format/compile_tests.rs index 33e0a528bb..3b8b741db3 100644 --- a/rust-modules/appkit/src/hud_format/compile_tests.rs +++ b/rust-modules/appkit/src/hud_format/compile_tests.rs @@ -14,7 +14,7 @@ use plx_base::fontcov::advances::ShippedMeasure; use plx_data::metadata::{Marker, MarkerKind}; use plx_machine::machine::Measure; use plx_media::player::text_style::HudBand; -use plx_platform::i18n::{language_on_this_thread_for_test, msg, Preference, SHIPPED}; +use plx_os::i18n::{language_on_this_thread_for_test, msg, Preference, SHIPPED}; use plx_ui::consts::{MARGIN_X, SCR_H, SCR_W}; use plx_ui::fixture::FixtureMeasure; use plx_ui::{theme, Rect}; @@ -47,7 +47,7 @@ fn labels() -> AppLabels { tab_info: msg::widgets_player_info().to_owned(), tab_chapters: msg::widgets_player_chapters().to_owned(), next_episode: msg::widgets_next_episode().to_owned(), - next_seconds: AppLabels::in_language(plx_platform::i18n::current()).next_seconds, + next_seconds: AppLabels::in_language(plx_os::i18n::current()).next_seconds, watch_credits: msg::widgets_next_credits().to_owned(), skip_intro: msg::widgets_skip_intro().to_owned(), watch_intro: msg::widgets_watch_intro().to_owned(), @@ -55,7 +55,7 @@ fn labels() -> AppLabels { from_beginning: msg::widgets_info_from_beginning().to_owned(), go_to_show: msg::widgets_info_go_show().to_owned(), go_to_movie: msg::widgets_info_go_movie().to_owned(), - commands: AppLabels::in_language(plx_platform::i18n::current()).commands, + commands: AppLabels::in_language(plx_os::i18n::current()).commands, } } diff --git a/rust-modules/appkit/src/hud_format/lint.rs b/rust-modules/appkit/src/hud_format/lint.rs index 4eb40564f8..93ed11333f 100644 --- a/rust-modules/appkit/src/hud_format/lint.rs +++ b/rust-modules/appkit/src/hud_format/lint.rs @@ -62,7 +62,7 @@ pub use super::lint_text::{metrics as text_metrics, Metric as TextMetric}; use plx_machine::machine::Measure; -use plx_platform::i18n::{LocaleContext, Preference}; +use plx_os::i18n::{LocaleContext, Preference}; use plx_ui::Rect; use super::compile::{ diff --git a/rust-modules/appkit/src/hud_format/lint_tests.rs b/rust-modules/appkit/src/hud_format/lint_tests.rs index 1649815fbe..9a6e5ac671 100644 --- a/rust-modules/appkit/src/hud_format/lint_tests.rs +++ b/rust-modules/appkit/src/hud_format/lint_tests.rs @@ -13,7 +13,7 @@ use std::collections::{BTreeSet, HashMap}; use plx_base::fontcov::advances::ShippedMeasure; -use plx_platform::i18n::{language_on_this_thread_for_test, msg, LocaleContext, Preference}; +use plx_os::i18n::{language_on_this_thread_for_test, msg, LocaleContext, Preference}; use plx_ui::fixture::FixtureMeasure; use plx_ui::Rect; diff --git a/rust-modules/appkit/src/hud_format/lint_text.rs b/rust-modules/appkit/src/hud_format/lint_text.rs index 5c3e22d7af..c1d1b8cfb8 100644 --- a/rust-modules/appkit/src/hud_format/lint_text.rs +++ b/rust-modules/appkit/src/hud_format/lint_text.rs @@ -76,7 +76,7 @@ use std::collections::BTreeMap; use std::ops::RangeInclusive; use plx_machine::machine::Measure; -use plx_platform::i18n::{msg, LocaleContext, Preference}; +use plx_os::i18n::{msg, LocaleContext, Preference}; use plx_ui::consts::SAFE; use plx_ui::fmt::KICKER_SEPARATOR; use plx_ui::Rect; diff --git a/rust-modules/appkit/src/info_panel.rs b/rust-modules/appkit/src/info_panel.rs index 192d40db70..edca0f94dc 100644 --- a/rust-modules/appkit/src/info_panel.rs +++ b/rust-modules/appkit/src/info_panel.rs @@ -41,11 +41,11 @@ fn is_episode(meta: metadata::MetadataView<'_>) -> bool { /// only where the actual label TEXT is wanted. pub(crate) fn actions(meta: metadata::MetadataView<'_>) -> [&'static str; 2] { [ - plx_platform::i18n::msg::widgets_info_from_beginning(), + plx_os::i18n::msg::widgets_info_from_beginning(), if is_episode(meta) { - plx_platform::i18n::msg::widgets_info_go_show() + plx_os::i18n::msg::widgets_info_go_show() } else { - plx_platform::i18n::msg::widgets_info_go_movie() + plx_os::i18n::msg::widgets_info_go_movie() }, ] } @@ -69,9 +69,9 @@ pub(crate) fn card_geometry() -> (Rect, f32) { pub(crate) fn button_rect(i: usize, measure: &dyn plx_machine::machine::Measure) -> Rect { let (card, pad) = card_geometry(); let labels = [ - plx_platform::i18n::msg::widgets_info_from_beginning_c(), - plx_platform::i18n::msg::widgets_info_go_show_c(), - plx_platform::i18n::msg::widgets_info_go_movie_c(), + plx_os::i18n::msg::widgets_info_from_beginning_c(), + plx_os::i18n::msg::widgets_info_go_show_c(), + plx_os::i18n::msg::widgets_info_go_movie_c(), ]; let bw = labels.iter().map(|label| { plx_ui::widgets::Button::pill_w_measured(label, theme::size::BODY, true, None, measure) @@ -214,9 +214,9 @@ pub(crate) fn info_chips( chips.push(Chip::badge(tag, measure)); } } - "cc" if !c.subs.is_empty() => chips.push(Chip::badge(plx_platform::i18n::msg::widgets_badge_cc().to_string(), measure)), - "sdh" if c.subs.iter().any(|s| s.sdh) => chips.push(Chip::badge(plx_platform::i18n::msg::widgets_badge_sdh().to_string(), measure)), - "ad" if c.audio.iter().any(|s| s.ad) => chips.push(Chip::badge(plx_platform::i18n::msg::widgets_badge_ad().to_string(), measure)), + "cc" if !c.subs.is_empty() => chips.push(Chip::badge(plx_os::i18n::msg::widgets_badge_cc().to_string(), measure)), + "sdh" if c.subs.iter().any(|s| s.sdh) => chips.push(Chip::badge(plx_os::i18n::msg::widgets_badge_sdh().to_string(), measure)), + "ad" if c.audio.iter().any(|s| s.ad) => chips.push(Chip::badge(plx_os::i18n::msg::widgets_badge_ad().to_string(), measure)), _ => {} } } @@ -295,17 +295,17 @@ pub fn playback_now( return None; } if !transcoding { - return Some(plx_platform::i18n::msg::widgets_playback_direct_play().to_string()); + return Some(plx_os::i18n::msg::widgets_playback_direct_play().to_string()); } if remux { - return Some(plx_platform::i18n::msg::widgets_playback_direct_stream().to_string()); + return Some(plx_os::i18n::msg::widgets_playback_direct_stream().to_string()); } let name = video_codec_name(vcodec); // a re-encode whose output codec we somehow do not know still converted — say that much Some(if name.is_empty() { - plx_platform::i18n::msg::widgets_playback_converting().to_string() + plx_os::i18n::msg::widgets_playback_converting().to_string() } else { - plx_platform::i18n::msg::widgets_playback_converting_codec(&name) + plx_os::i18n::msg::widgets_playback_converting_codec(&name) }) } diff --git a/rust-modules/appkit/src/more_menu.rs b/rust-modules/appkit/src/more_menu.rs index 659cff5742..034c059157 100644 --- a/rust-modules/appkit/src/more_menu.rs +++ b/rust-modules/appkit/src/more_menu.rs @@ -136,7 +136,7 @@ pub fn folded_rows( meta: plx_data::metadata::MetadataView<'_>, ) -> Vec { use crate::player_hud::command::{Section, TrackTab}; - use plx_platform::i18n::msg; + use plx_os::i18n::msg; folds .iter() .filter_map(|fold| { @@ -171,8 +171,8 @@ impl MorePage { /// The title band's text. fn title(self) -> String { match self { - Self::Quality => plx_platform::i18n::msg::widgets_menu_quality().to_string(), - Self::Speed => plx_platform::i18n::msg::widgets_menu_speed().to_string(), + Self::Quality => plx_os::i18n::msg::widgets_menu_quality().to_string(), + Self::Speed => plx_os::i18n::msg::widgets_menu_speed().to_string(), } } @@ -409,7 +409,7 @@ fn root_form( speeds: &[i32], folded: &[FoldedRow], ) -> MoreForm { - let mut options = FormSection::new(plx_platform::i18n::msg::widgets_menu_options()); + let mut options = FormSection::new(plx_os::i18n::msg::widgets_menu_options()); for a in rows.iter().copied().filter(|a| !matches!(a, Action::SetQuality(_))) { options = options.item(MoreRow::Act(a), RowKind::Button, a, row_for(ps, a)); } @@ -418,7 +418,7 @@ fn root_form( MoreRow::OpenQuality, RowKind::Nav(MorePage::Quality), Action::None, - Row::new(plx_platform::i18n::msg::widgets_menu_quality()).value(quality_readout(ps, current)), + Row::new(plx_os::i18n::msg::widgets_menu_quality()).value(quality_readout(ps, current)), ) // Offered under Force Direct Play too: a speed changes how fast the picture plays, not what // the server sends. Not offered where this playback cannot play any speed but 1x @@ -428,7 +428,7 @@ fn root_form( MoreRow::OpenSpeed, RowKind::Nav(MorePage::Speed), Action::None, - Row::new(plx_platform::i18n::msg::widgets_menu_speed()).value(speed_label(speed)), + Row::new(plx_os::i18n::msg::widgets_menu_speed()).value(speed_label(speed)), ); let mut form = Form::new().section(quality); // The commands the package places nowhere: after Quality and Speed, before Options, in the compiler's order. @@ -456,7 +456,7 @@ fn speed_form(ps: &plx_media::route::PlaybackSession, speed: i32, speeds: &[i32] /// A speed's name: `Normal` at 1x, else the multiplier (`plx_media::player::rate_name`). fn speed_label(permille: i32) -> String { if permille == plx_media::player::RATE_NORMAL { - return plx_platform::i18n::msg::widgets_speed_normal().to_string(); + return plx_os::i18n::msg::widgets_speed_normal().to_string(); } plx_media::player::rate_name(permille) } @@ -471,7 +471,7 @@ fn quality_readout(ps: &plx_media::route::PlaybackSession, current: plx_media::r let joined = |second: String| format!("{} \u{b7} {second}", current.short_label()); match (current, plx_media::route::playing_quality(ps)) { (Quality::Original | Quality::Auto, PlayingQuality::Converted) => { - joined(plx_platform::i18n::msg::widgets_menu_quality_converted().to_owned()) + joined(plx_os::i18n::msg::widgets_menu_quality_converted().to_owned()) } (Quality::Auto, PlayingQuality::Original) => joined(Quality::Original.label()), (Quality::Auto, PlayingQuality::Rung(lines)) => joined(format!("{lines}p")), @@ -501,7 +501,7 @@ fn quality_form( |sec, a| { let mut row = row_for(ps, a); if a == Action::SetQuality(current) && quality_conversion_note(ps, current) { - row = row.detail(plx_platform::i18n::msg::widgets_menu_quality_converted_note()); + row = row.detail(plx_os::i18n::msg::widgets_menu_quality_converted_note()); } sec.choice(MoreRow::Act(a), a, row, |id| { *id == MoreRow::Act(Action::SetQuality(current)) @@ -994,7 +994,7 @@ fn rows_for(forced: bool) -> Vec { .collect() }; v.push(Action::ToggleStats); - if plx_platform::labcfg::menu_row_enabled() { + if plx_os::labcfg::menu_row_enabled() { v.push(Action::SendDiagnostics); } v @@ -1002,12 +1002,12 @@ fn rows_for(forced: bool) -> Vec { fn label(a: Action) -> std::borrow::Cow<'static, str> { match a { - Action::ToggleStats => plx_platform::i18n::msg::widgets_menu_stats().into(), + Action::ToggleStats => plx_os::i18n::msg::widgets_menu_stats().into(), // the rung names itself — rate and frame in one string, because the row already carries // the picker's leading mark (see this module's doc) Action::SetQuality(q) => q.label().into(), Action::SetSpeed(r) => speed_label(r).into(), - Action::SendDiagnostics => plx_platform::i18n::msg::widgets_menu_diagnostics().into(), + Action::SendDiagnostics => plx_os::i18n::msg::widgets_menu_diagnostics().into(), Action::None => "".into(), // a folded row is labelled by its `FoldedRow`, which knows the content Action::Hud(_) => "".into(), @@ -1982,7 +1982,7 @@ mod focus_tests { #[test] fn every_row_fits_the_panel_in_every_language() { plx_media::speed_audio::force_speed_decoder_for_test(true); // a host test loads no FFmpeg - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let ps = plx_media::route::PlaybackSession::default(); let mut out = Vec::new(); let rows = rows_for(false); @@ -2038,7 +2038,7 @@ mod focus_tests { let meta = plx_data::stores::metadata::MetadataStore::default(); let mut folded = folded_rows(&every, &full, meta.view()); assert_eq!(folded.len(), every.len(), "{}: every command offers a row", language.tag()); - for go in [plx_platform::i18n::msg::widgets_info_go_show(), plx_platform::i18n::msg::widgets_info_go_movie()] { + for go in [plx_os::i18n::msg::widgets_info_go_show(), plx_os::i18n::msg::widgets_info_go_movie()] { folded[6].label = go; for q in plx_media::route::QUALITY_LADDER { let mut root = MoreMenuState::new(&ps); @@ -2080,8 +2080,8 @@ mod focus_tests { fn the_quality_row_reads_choice_then_what_is_playing() { use plx_media::route::{EnhTestFixture, Quality}; let _g = plx_base::testlock::serial(); - let note = plx_platform::i18n::msg::widgets_menu_quality_converted_note(); - let converted = plx_platform::i18n::msg::widgets_menu_quality_converted(); + let note = plx_os::i18n::msg::widgets_menu_quality_converted_note(); + let converted = plx_os::i18n::msg::widgets_menu_quality_converted(); let original = Quality::Original.label(); let auto = Quality::Auto.label(); let fixture = |remux, quality| EnhTestFixture { remux, quality, ..Default::default() }; @@ -2134,7 +2134,7 @@ mod focus_tests { /// The converted read-out and note fit the panel in every shipped language. #[test] fn the_converted_marks_fit_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let _g = plx_base::testlock::serial(); let (ps, _) = plx_media::route::enhancement_test_session(plx_media::route::EnhTestFixture { remux: Some(false), @@ -2290,7 +2290,7 @@ mod folded_tests { const REFERENCE: &str = include_str!("hud_format/fixtures/reference/hud.json"); fn compiled(text: &str) -> Arc { - load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &plx_ui::fixture::FixtureMeasure).expect("the fixture loads").compiled + load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &plx_ui::fixture::FixtureMeasure).expect("the fixture loads").compiled } /// A frame's model for an episode with both neighbours (or a movie with none), chapters and a detail page. diff --git a/rust-modules/appkit/src/player_hud/classic.rs b/rust-modules/appkit/src/player_hud/classic.rs index e3f9c16fd6..e67c7c54df 100644 --- a/rust-modules/appkit/src/player_hud/classic.rs +++ b/rust-modules/appkit/src/player_hud/classic.rs @@ -196,7 +196,7 @@ pub(super) const FOOTER_TOP: f32 = SCR_H - plx_ui::consts::MARGIN_Y - theme::spa impl FailureReadout { fn overlay(&self, labels: &[&'static std::ffi::CStr], focus: Option) -> StatusOverlay<'_> { - StatusOverlay::new(Rect::FULL, plx_platform::i18n::msg::widgets_status_failed_c(), StatusKind::Failed) + StatusOverlay::new(Rect::FULL, plx_os::i18n::msg::widgets_status_failed_c(), StatusKind::Failed) .page(self.glyph) .reason(&self.reason) .row(labels) @@ -243,8 +243,8 @@ pub fn ctrl_row_hit_rect() -> Rect { /// tab the row does not carry. pub(super) fn tab_labels(has_chapters: bool) -> [Option<&'static str>; HUD_TABS] { [ - Some(plx_platform::i18n::msg::widgets_player_info()), - has_chapters.then(plx_platform::i18n::msg::widgets_player_chapters), + Some(plx_os::i18n::msg::widgets_player_info()), + has_chapters.then(plx_os::i18n::msg::widgets_player_chapters), ] } @@ -668,7 +668,7 @@ pub fn draw_playbar_look(p: Painter, bar: Playbar, look: PlaybarLook, measure: & let available = (sx + sw - el_r - 20.0).min(sw); let run = end_time_run(look.clock_size).measured(measure); let end = look.end_time_lane.zip(bar.end_time).and_then(|(lane, time)| { - let time = plx_platform::i18n::current().time_of_day(time)?; + let time = plx_os::i18n::current().time_of_day(time)?; let parts = [remaining.as_str(), time.as_str()]; let actual = run.width(measure, &parts); // Keep the fit decision stable while duration digits tick, including proportional faces. diff --git a/rust-modules/appkit/src/player_hud/loaded.rs b/rust-modules/appkit/src/player_hud/loaded.rs index 5b7af2e2ee..4ce004ae11 100644 --- a/rust-modules/appkit/src/player_hud/loaded.rs +++ b/rust-modules/appkit/src/player_hud/loaded.rs @@ -8,7 +8,7 @@ //! pushes the [`Arc`] into the player page the way it pushes the frame's //! [`HudModel`](super::model::HudModel). //! Nothing here reads a registry on its own account: the language arrives as a [`LocaleContext`] (the -//! OWNER passes `plx_platform::i18n::current()`), the strings are built from it ([`AppLabels::in_language`]) and the +//! OWNER passes `plx_os::i18n::current()`), the strings are built from it ([`AppLabels::in_language`]) and the //! measurer is passed in. The draw ([`super::render`]) //! walks the result and computes nothing. //! @@ -19,7 +19,7 @@ use std::sync::Arc; use plx_machine::machine::Measure; -use plx_platform::i18n::{Language, LocaleContext}; +use plx_os::i18n::{Language, LocaleContext}; use crate::hud_format::compile::{compile, AppLabels, CompileCtx, CompileKey, Compiled}; use crate::hud_format::bundle::{self, VerifiedPackage}; @@ -88,7 +88,7 @@ pub fn load_classic(app_version: &str, cx: &LocaleContext, measure: &dyn Measure /// The ONE helper a test builder takes its `PlayerScreen::new` argument from. #[cfg(any(test, feature = "test-support"))] pub fn classic_for_test() -> Arc { - load_classic("0.0.0-test", plx_platform::i18n::english(), &plx_ui::fixture::FixtureMeasure).compiled + load_classic("0.0.0-test", plx_os::i18n::english(), &plx_ui::fixture::FixtureMeasure).compiled } /// **The reference package for a test that builds a player page**: the fixture the format's own tests draw @@ -97,7 +97,7 @@ pub fn classic_for_test() -> Arc { #[cfg(any(test, feature = "test-support"))] pub fn reference_for_test() -> Arc { let bytes = crate::hud_format::fixtures::bytes("reference"); - load(&bytes, "0.0.0-test", plx_platform::i18n::english(), &plx_ui::fixture::FixtureMeasure) + load(&bytes, "0.0.0-test", plx_os::i18n::english(), &plx_ui::fixture::FixtureMeasure) .expect("the reference fixture loads") .compiled } @@ -113,7 +113,7 @@ pub fn reference_with_info_actions_for_test() -> Arc { let actions = r#"{ "align": "end", "valign": "center", "actions": { "axis": "column", "gap": 12, "item_h": 52, "min_w": 200, "items": [ { "id": "from_beginning", "command": "from_beginning", "widget": "button", "size": 52 }, { "id": "go_to_detail", "command": "go_to_detail", "widget": "button", "size": 52 } ] } }"#; - load(&crate::hud_format::fixtures::with_hud("reference", &text.replace(spacer, actions)), "0.0.0-test", plx_platform::i18n::english(), &plx_ui::fixture::FixtureMeasure) + load(&crate::hud_format::fixtures::with_hud("reference", &text.replace(spacer, actions)), "0.0.0-test", plx_os::i18n::english(), &plx_ui::fixture::FixtureMeasure) .expect("the reference fixture with Info actions loads") .compiled } @@ -127,7 +127,7 @@ pub fn reference_with_forward_as_for_test(command: &str) -> Arc { let forward = r#"{ "id": "fwd", "command": "seek", "by": 30,"#; assert_eq!(text.matches(forward).count(), 1, "the reference fixture has one forward seek"); let replaced = text.replace(forward, &format!(r#"{{ "id": "fwd", "command": "{command}","#)); - load(&crate::hud_format::fixtures::with_hud("reference", &replaced), "0.0.0-test", plx_platform::i18n::english(), &plx_ui::fixture::FixtureMeasure) + load(&crate::hud_format::fixtures::with_hud("reference", &replaced), "0.0.0-test", plx_os::i18n::english(), &plx_ui::fixture::FixtureMeasure) .expect("the reference fixture with a replaced forward control loads") .compiled } @@ -146,7 +146,7 @@ pub fn reference_without_openers_for_test(policy: &str) -> Arc { ); assert_eq!(text.matches(openers).count(), 1, "the reference's two section discs, as written"); let text = text.replace(openers, "").replace("\"sections\": \"inline\"", &format!("\"sections\": \"{policy}\"")); - load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &plx_ui::fixture::FixtureMeasure) + load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &plx_ui::fixture::FixtureMeasure) .expect("the reference without its openers loads") .compiled } @@ -233,7 +233,7 @@ pub enum DevHud { mod tests { use super::*; use plx_base::fontcov::advances::ShippedMeasure; - use plx_platform::i18n::SHIPPED; + use plx_os::i18n::SHIPPED; /// The embedded classic is a package the format accepts and the compiler lays out without a single /// finding (a number or gap keyed on a card term), in EVERY shipped language: a label's width is a @@ -283,7 +283,7 @@ mod tests { #[test] fn classic_and_every_fixture_answer_every_frame() { - let en = plx_platform::i18n::english(); + let en = plx_os::i18n::english(); assert!(answers_every_frame(&load_classic("1.0", en, &ShippedMeasure).compiled)); let reference = include_str!("../hud_format/fixtures/reference/hud.json"); assert!(answers_every_frame(&load(&crate::hud_format::fixtures::with_hud("reference", reference), "1.0", en, &ShippedMeasure).unwrap().compiled)); @@ -295,11 +295,11 @@ mod tests { /// or another language are not, so the owner recompiles exactly when something changed. #[test] fn the_key_names_the_bytes_the_release_and_the_language() { - let en = plx_platform::i18n::english(); + let en = plx_os::i18n::english(); let a = load_classic("1.0", en, &ShippedMeasure).key; assert_eq!(a, load_classic("1.0", en, &ShippedMeasure).key); assert_ne!(a, load_classic("1.1", en, &ShippedMeasure).key, "the release is part of the key"); - let other = SHIPPED.into_iter().find(|p| p.language() != Some(plx_platform::i18n::Language::En)).expect("a shipped language other than English"); + let other = SHIPPED.into_iter().find(|p| p.language() != Some(plx_os::i18n::Language::En)).expect("a shipped language other than English"); let de = LocaleContext::resolve(other, None, None, None, None); assert_ne!(a, load_classic("1.0", &de, &ShippedMeasure).key, "the language is part of the key"); assert_eq!(a.sha256, plx_base::sha256::sha256(crate::hud_format::CLASSIC_PACKAGE)); @@ -308,7 +308,7 @@ mod tests { /// A package that does not parse is refused, never half-loaded: the screen keeps the layout it has. #[test] fn a_package_that_does_not_parse_is_refused() { - let err = load(b"{ not json", "1.0", plx_platform::i18n::english(), &ShippedMeasure); + let err = load(b"{ not json", "1.0", plx_os::i18n::english(), &ShippedMeasure); assert!(matches!(err, Err(LoadError::Invalid(n)) if n > 0)); } /// The dev trigger's value is the package's path: its first line, trimmed. An empty file arms nothing. @@ -324,7 +324,7 @@ mod tests { /// (for that language), and leaves the owner on classic. #[test] fn a_dev_package_that_does_not_load_reports_once_and_is_not_recompiled() { - let en = plx_platform::i18n::english(); + let en = plx_os::i18n::english(); let mut bad = DevPackage::new("/x/bad.json".to_owned(), Ok(b"{ not json".to_vec())); assert!(bad.hud().is_none()); assert!(matches!(bad.refresh("1.0", en, &ShippedMeasure), DevStep::Report(m) if m.contains("/x/bad.json"))); @@ -332,7 +332,7 @@ mod tests { assert_eq!(bad.refresh("1.0", en, &ShippedMeasure), DevStep::Quiet); assert!(bad.hud().is_none(), "classic draws"); // another language is another key: it is tried (and fails) once more - let other = SHIPPED.into_iter().find(|p| p.language() != Some(plx_platform::i18n::Language::En)).unwrap(); + let other = SHIPPED.into_iter().find(|p| p.language() != Some(plx_os::i18n::Language::En)).unwrap(); let de = LocaleContext::resolve(other, None, None, None, None); assert!(matches!(bad.refresh("1.0", &de, &ShippedMeasure), DevStep::Report(_))); assert_eq!(bad.refresh("1.0", &de, &ShippedMeasure), DevStep::Quiet); @@ -341,7 +341,7 @@ mod tests { /// A file that cannot be read is reported once and never read again. #[test] fn a_dev_package_that_cannot_be_read_reports_once() { - let en = plx_platform::i18n::english(); + let en = plx_os::i18n::english(); let mut gone = DevPackage::new("/x/gone.json".to_owned(), Err("No such file".to_owned())); assert!(matches!(gone.refresh("1.0", en, &ShippedMeasure), DevStep::Report(m) if m.contains("No such file"))); assert_eq!(gone.refresh("1.0", en, &ShippedMeasure), DevStep::Quiet); @@ -352,13 +352,13 @@ mod tests { /// language changes. #[test] fn a_dev_package_compiles_once_per_language() { - let en = plx_platform::i18n::english(); + let en = plx_os::i18n::english(); let mut dev = DevPackage::new("/x/classic.json".to_owned(), Ok(crate::hud_format::CLASSIC_PACKAGE.to_vec())); assert_eq!(dev.refresh("1.0", en, &ShippedMeasure), DevStep::Compiled); let first = Arc::clone(&dev.hud().expect("loaded").compiled); assert_eq!(dev.refresh("1.0", en, &ShippedMeasure), DevStep::Ready); assert!(Arc::ptr_eq(&first, &dev.hud().unwrap().compiled), "not recompiled per frame"); - let other = SHIPPED.into_iter().find(|p| p.language() != Some(plx_platform::i18n::Language::En)).unwrap(); + let other = SHIPPED.into_iter().find(|p| p.language() != Some(plx_os::i18n::Language::En)).unwrap(); let de = LocaleContext::resolve(other, None, None, None, None); assert_eq!(dev.refresh("1.0", &de, &ShippedMeasure), DevStep::Compiled); assert!(!Arc::ptr_eq(&first, &dev.hud().unwrap().compiled), "a language change recompiles"); diff --git a/rust-modules/appkit/src/player_hud/mod.rs b/rust-modules/appkit/src/player_hud/mod.rs index 8387f531a8..262d1a2341 100644 --- a/rust-modules/appkit/src/player_hud/mod.rs +++ b/rust-modules/appkit/src/player_hud/mod.rs @@ -5,7 +5,7 @@ //! //! This was one 3600-line file; it is now a directory so that a layout can be swapped without //! touching the rules, and so that the draw path reads no player global (the localized labels it draws go through -//! `plx_platform::i18n`, [`classic::tab_labels`] among them): +//! `plx_os::i18n`, [`classic::tab_labels`] among them): //! //! | module | what it is | //! |---|---| @@ -473,7 +473,7 @@ impl SubtitleBitmaps { /// the frozen golden). #[cfg(any(test, feature = "test-support"))] pub fn audit_geometry() -> geometry::HudGeometry { - let hud = loaded::load_classic("audit", plx_platform::i18n::english(), &plx_base::fontcov::advances::ShippedMeasure); + let hud = loaded::load_classic("audit", plx_os::i18n::english(), &plx_base::fontcov::advances::ShippedMeasure); geometry::geometry(&hud.compiled, 0, ControlSlot::Discs(Controls::NONE), false, false) } diff --git a/rust-modules/appkit/src/player_hud/motion.rs b/rust-modules/appkit/src/player_hud/motion.rs index 1af7d87fda..43912d41e8 100644 --- a/rust-modules/appkit/src/player_hud/motion.rs +++ b/rust-modules/appkit/src/player_hud/motion.rs @@ -82,7 +82,7 @@ impl ClockWarm { (fmt_time(next_remaining * SEC_NS, true), 0, cap), ]; let ends = end_time - .and_then(|time| plx_platform::i18n::current().time_of_day(time)) + .and_then(|time| plx_os::i18n::current().time_of_day(time)) .into_iter() .flat_map(|time| [(time, 0, cap), (String::from("\u{b7}"), 0, cap)]); // the elapsed clock also draws at the size it grows to during a scrub with no card diff --git a/rust-modules/appkit/src/player_hud/render.rs b/rust-modules/appkit/src/player_hud/render.rs index e0606579b2..ec1fafb33f 100644 --- a/rust-modules/appkit/src/player_hud/render.rs +++ b/rust-modules/appkit/src/player_hud/render.rs @@ -980,7 +980,7 @@ mod tests { use crate::player_hud::state::Controls; use crate::skip_pill::prompt_for; use plx_data::metadata::{Marker, MarkerKind}; - use plx_platform::i18n::{language_on_this_thread_for_test, Preference, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, Preference, SHIPPED}; use plx_ui::draw_census::{capture, capture_icons, capture_inks, capture_runs, Run}; use plx_ui::fixture::FixtureMeasure; use plx_ui::icons::Icon; @@ -1164,7 +1164,7 @@ mod tests { let mut compared = 0; for language in frozen_languages.iter().copied() { let _language = language_on_this_thread_for_test(language); - let cx = plx_platform::i18n::current(); + let cx = plx_os::i18n::current(); let hud = crate::player_hud::loaded::load_classic("0.0.0-test", cx, &FM); for (index, c) in cases().into_iter().enumerate() { let (new, drew) = drawn(&hud.compiled, c); @@ -1183,7 +1183,7 @@ mod tests { #[test] fn catalan_classic_renders_every_case() { let _language = language_on_this_thread_for_test(Preference::Ca); - let cx = plx_platform::i18n::current(); + let cx = plx_os::i18n::current(); let hud = crate::player_hud::loaded::load_classic("0.0.0-test", cx, &FM); for c in cases() { let (drawn_census, drew) = drawn(&hud.compiled, c); @@ -1195,7 +1195,7 @@ mod tests { /// A failure owns the frame: nothing of the transport draws, and the title's marquee resets. #[test] fn a_failure_read_out_owns_the_frame_in_the_renderer_too() { - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); let ps = plx_media::route::PlaybackSession::IDLE; let store = plx_data::stores::metadata::MetadataStore::default(); let model = HudModel::default(); @@ -1299,10 +1299,10 @@ mod tests { fn scene(items: Vec, sel: u32, appear: f32, closing: bool) -> Side { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let mut store = plx_data::stores::metadata::MetadataStore::default(); plx_data::metadata::set_playing_chapters_for_test(store.state_mut(), items); - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); let state = hud.compiled.lookup(OPEN_CHAPTERS, Slot::Discs, true, true, false).expect("classic has a chapters state"); let geo = state.ops.iter().find_map(Geometry::of).expect("the chapters state has a strip"); let ps = plx_media::route::PlaybackSession::IDLE; @@ -1515,10 +1515,10 @@ mod tests { fn scene(detail: Detail, appear: f32, closing: bool) -> Census { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let mut store = plx_data::stores::metadata::MetadataStore::default(); plx_data::metadata::set_current_for_test(store.state_mut(), Some(detail)); - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); assert!(hud.compiled.lookup(OPEN_INFO, Slot::Discs, true, true, false).is_some(), "classic has an info state"); let ps = plx_media::route::PlaybackSession::IDLE; let model = HudModel::default(); @@ -1666,8 +1666,8 @@ mod tests { #[test] fn the_synopsis_column_ends_where_the_cards_text_column_ends() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); let state = hud.compiled.lookup(OPEN_INFO, Slot::Discs, true, true, false).expect("classic has an info state"); let text = |bind: &str| { state @@ -1755,7 +1755,7 @@ mod tests { /// what is compared; the full block fills the rect exactly. #[test] fn a_group_stays_inside_its_worst_case_rect() { - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); let state = hud.compiled.lookup(OPEN_INFO, Slot::Discs, true, true, false).expect("an info state"); assert_eq!(state.groups.len(), 1, "classic's info text block is one group"); let rect = state.groups[0].rect; @@ -1783,7 +1783,7 @@ mod tests { #[test] fn a_package_vstack_with_the_title_pair_stays_static() { let text = include_str!("../hud_format/fixtures/reference/hud.json"); - let compiled = crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &FM) + let compiled = crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &FM) .expect("the reference loads") .compiled; let state = compiled.lookup(OPEN_INFO, Slot::Discs, true, true, false).expect("the reference has an info state"); @@ -1792,7 +1792,7 @@ mod tests { #[test] fn an_open_chapters_state_has_no_info_arms_and_the_gate_only_hides_the_compact_state() { - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); assert!(hud.compiled.lookup(OPEN_CHAPTERS, Slot::Discs, true, true, false).is_some()); } } @@ -1807,10 +1807,10 @@ mod tests { fn info_frame_census(transport: bool, tab: i32, focus: GroupId, btn: i32, row: &mut HudMotion) -> Census { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let mut store = plx_data::stores::metadata::MetadataStore::default(); plx_data::metadata::set_current_for_test(store.state_mut(), Some(plx_data::metadata::Detail { title: "T".into(), ..Default::default() })); - let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM); + let hud = crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM); let state = hud.compiled.lookup(OPEN_INFO, Slot::Discs, true, true, false).expect("an info state"); let ps = plx_media::route::PlaybackSession::IDLE; let model = HudModel::default(); @@ -1838,7 +1838,7 @@ mod tests { #[test] fn a_toggle_section_control_reads_selected_while_its_section_is_open() { let text = include_str!("../hud_format/fixtures/reference/hud.json"); - let compiled = crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &FM) + let compiled = crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &FM) .expect("the reference loads") .compiled; let open = |bits: u8| { @@ -1892,7 +1892,7 @@ mod tests { fn reference() -> std::sync::Arc { let text = include_str!("../hud_format/fixtures/reference/hud.json"); - crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &FM) + crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &FM) .expect("the reference loads") .compiled } diff --git a/rust-modules/appkit/src/player_hud/render/tests/conformance.rs b/rust-modules/appkit/src/player_hud/render/tests/conformance.rs index 9f24842f2f..4d04b57d5e 100644 --- a/rust-modules/appkit/src/player_hud/render/tests/conformance.rs +++ b/rust-modules/appkit/src/player_hud/render/tests/conformance.rs @@ -8,7 +8,7 @@ const REFERENCE: &str = include_str!("../../../hud_format/fixtures/reference/hud fn load(text: &str) -> Arc { let parsed = crate::hud_format::fixtures::parse(text.as_bytes()); assert!(parsed.findings.is_empty(), "{:?}", parsed.findings); - crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &FM).unwrap().compiled + crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &FM).unwrap().compiled } fn frame(compiled: &Compiled) -> Census { @@ -19,7 +19,7 @@ fn frame(compiled: &Compiled) -> Census { #[test] fn declared_title_ink_weight_and_alpha_reach_the_painter() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let text = REFERENCE.replace(r#""size": "TITLE", "ink": "TEXT_PRIMARY", "bold": true"#, r#""size": "TITLE", "ink": "gold", "bold": false, "alpha": 0.5"#); assert_ne!(text, REFERENCE); @@ -58,14 +58,14 @@ fn a_vertical_rule_keeps_its_compiled_extent() { #[test] fn a_more_pill_or_button_draws_its_measured_app_label() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); for widget in ["pill", "button"] { let text = REFERENCE.replace(r#"{ "id": "more", "command": "open_more", "widget": "disc""#, &format!(r#"{{ "id": "more", "command": "open_more", "widget": "{widget}""#)); assert_ne!(text, REFERENCE); let compiled = load(&text); let drew = frame(&compiled); - let label = plx_platform::i18n::msg::widgets_menu_options(); + let label = plx_os::i18n::msg::widgets_menu_options(); assert!(drew.1.iter().any(|r| r.text == label), "{widget}: accepted More control must be visible as {label:?}"); let state = compiled.lookup(0, crate::hud_format::Slot::Discs, true, false, false).unwrap(); let control = state.control("more").unwrap(); @@ -124,7 +124,7 @@ fn labelled_control_width_counts_only_the_glyphs_it_draws() { let text = if glyph { text } else { text.replace(r#", "face": "gear""#, "") }; let compiled = load(&text); let state = compiled.lookup(0, crate::hud_format::Slot::Discs, true, false, false).unwrap(); - let label = CString::new(plx_platform::i18n::msg::widgets_menu_options()).unwrap(); + let label = CString::new(plx_os::i18n::msg::widgets_menu_options()).unwrap(); let expected = if widget == "pill" && !glyph { TabPill::width_measured(label.to_str().unwrap(), theme::size::BODY, &FM) } else { plx_ui::widgets::Button::pill_w_measured(&label, theme::size::BODY, glyph, None, &FM) }; assert_eq!(state.control("more").unwrap().rect.w, expected, "{widget}, glyph {glyph}: no phantom leading/trailing icon"); @@ -152,7 +152,7 @@ fn info_frame(compiled: &Compiled, focus: GroupId, btn: i32) -> Census { #[test] fn a_row_button_does_not_shift_the_info_actions_focus_or_pop() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let text = REFERENCE.replace(r#"{ "id": "more", "command": "open_more", "widget": "disc""#, r#"{ "id": "more", "command": "open_more", "widget": "button""#); let text = text.replace(r#""z": 1"#, r#""z": 0"#); @@ -161,7 +161,7 @@ fn a_row_button_does_not_shift_the_info_actions_focus_or_pop() { "items": [{ "id": "from_beginning", "command": "from_beginning", "widget": "button", "size": 70 }, { "id": "detail", "command": "go_to_detail", "widget": "button", "size": 70 }] } }"#); let drew = info_frame(&load(&text), GROUP_SECTION, 0); - let label = plx_platform::i18n::msg::widgets_info_from_beginning(); + let label = plx_os::i18n::msg::widgets_info_from_beginning(); let action = drew.1.iter().find(|r| r.text == label).expect("Info's first action draws"); let expected = plx_ui::widgets::ControlStyle::Accent.colors(true, ControlGround::Keyed).1; assert_eq!(action.ink, expected, "section index0 is still the focused action, regardless of row buttons"); @@ -171,10 +171,10 @@ fn a_row_button_does_not_shift_the_info_actions_focus_or_pop() { fn actions_measure_the_same_parameterised_label_they_paint() { let _serial = plx_base::testlock::serial(); for (command, expected) in [ - (r#""seek", "by": -10"#, plx_platform::i18n::msg::player_hud_skip_back()), - (r#""open_tracks", "tab": "audio""#, plx_platform::i18n::msg::widgets_tracks_audio()), - (r#""open_more", "page": "quality""#, plx_platform::i18n::msg::widgets_menu_quality()), - (r#""open_more""#, plx_platform::i18n::msg::widgets_menu_options()), + (r#""seek", "by": -10"#, plx_os::i18n::msg::player_hud_skip_back()), + (r#""open_tracks", "tab": "audio""#, plx_os::i18n::msg::widgets_tracks_audio()), + (r#""open_more", "page": "quality""#, plx_os::i18n::msg::widgets_menu_quality()), + (r#""open_more""#, plx_os::i18n::msg::widgets_menu_options()), ] { let text = REFERENCE.replace(r#"{ "align": "end", "spacer": { "w": 150 } }"#, &format!(r#"{{ "align": "end", "actions": {{ "axis": "column", "gap": 0, "item_h": 70, "min_w": 0, @@ -261,9 +261,9 @@ fn numeric_up_next_reserves_every_countdown_label_in_every_language() { let _serial = plx_base::testlock::serial(); let minimal = include_str!("../../../hud_format/fixtures/minimal/hud.json"); let text = minimal.replace(r#""countdown": "fill_sweep""#, r#""countdown": "numeric""#); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _lang = language_on_this_thread_for_test(language); - let locale = plx_platform::i18n::current(); + let locale = plx_os::i18n::current(); let hud = crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", locale, &FM).unwrap(); let state = hud.compiled.lookup(0, crate::hud_format::Slot::UpNext, false, false, false).unwrap(); let next = state.standin.up_next.unwrap().next; @@ -336,7 +336,7 @@ fn chapter_frame_content(compiled: &Compiled, focused: bool, name: &str, episode #[test] fn chapter_template_text_faces_reach_focused_and_unfocused_cards() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let text = REFERENCE.replace(r#""bind": "item.title", "size": "CAPTION", "bold": false"#, r#""bind": "item.title", "size": "BODY", "bold": false"#); let compiled = load(&text); @@ -352,7 +352,7 @@ fn chapter_template_text_faces_reach_focused_and_unfocused_cards() { #[test] fn chapter_template_omission_alignment_and_paint_are_declared() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let text = REFERENCE.replace(r#""bind": "item.title", "size": "CAPTION", "bold": false"#, r#""bind": "item.title", "size": "CAPTION", "bold": false, "alpha": 0.5"#) .replace(r#""if": { "item.focused": "TEXT_PRIMARY" }"#, r#""if": { "item.focused": "gold" }"#); diff --git a/rust-modules/appkit/src/player_hud/render/tests/transitions.rs b/rust-modules/appkit/src/player_hud/render/tests/transitions.rs index d64794446c..3d15024d1c 100644 --- a/rust-modules/appkit/src/player_hud/render/tests/transitions.rs +++ b/rust-modules/appkit/src/player_hud/render/tests/transitions.rs @@ -21,7 +21,7 @@ const RISING: &str = include_str!("../../../hud_format/fixtures/rising-tabs/hud. const REFERENCE: &str = include_str!("../../../hud_format/fixtures/reference/hud.json"); fn load(text: &str) -> Arc { - crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &FM) + crate::player_hud::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &FM) .expect("the package loads") .compiled } @@ -31,7 +31,7 @@ fn rising() -> Arc { } fn classic() -> Arc { - crate::player_hud::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &FM).compiled + crate::player_hud::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &FM).compiled } /// `text` with `from` written as `to`, which must occur once. @@ -141,7 +141,7 @@ fn motion(section: Section, appear: f32, page: f32) -> HudMotion { #[test] fn at_the_end_points_the_census_is_the_settled_states() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let store = store(); for (name, compiled) in [("rising-tabs", rising()), ("classic", classic())] { let compact = state(&compiled, 0); @@ -162,7 +162,7 @@ fn at_the_end_points_the_census_is_the_settled_states() { #[test] fn halfway_the_tabs_stand_half_way_and_the_title_block_is_half_seen() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); let (compact, info) = (state(&compiled, 0), state(&compiled, OPEN_INFO)); let (c, m) = (band(compact, "tabs"), band(info, "tabs")); @@ -200,7 +200,7 @@ fn halfway_the_tabs_stand_half_way_and_the_title_block_is_half_seen() { #[test] fn the_held_frame_is_the_compact_hud_whole_and_the_up_frame_has_none_of_it() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); let compact = state(&compiled, 0); let at_compact = draw_in(&compiled, &mut HudMotion::new(), &store, 0, NONE, true); @@ -221,7 +221,7 @@ fn the_held_frame_is_the_compact_hud_whole_and_the_up_frame_has_none_of_it() { #[test] fn a_press_turning_the_motion_round_has_no_jump() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); let (compact, info) = (state(&compiled, 0), state(&compiled, OPEN_INFO)); let (c, m) = (band(compact, "tabs").y, band(info, "tabs").y); @@ -303,7 +303,7 @@ fn a_press_turning_the_motion_round_has_no_jump() { #[test] fn a_switch_moves_the_tabs_between_the_two_sections_places_with_the_title_block_gone() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); let (chapters, info) = (state(&compiled, OPEN_CHAPTERS), state(&compiled, OPEN_INFO)); let (yc, yi) = (band(chapters, "tabs").y, band(info, "tabs").y); @@ -332,7 +332,7 @@ fn a_switch_moves_the_tabs_between_the_two_sections_places_with_the_title_block_ #[test] fn classic_in_motion_fades_its_title_bar_and_row_and_moves_nothing_else() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (classic(), store()); let (compact, info) = (state(&compiled, 0), state(&compiled, OPEN_INFO)); assert_eq!(band(compact, "tabs"), band(info, "tabs"), "classic's tabs stand at one place"); @@ -359,7 +359,7 @@ fn classic_in_motion_fades_its_title_bar_and_row_and_moves_nothing_else() { #[test] fn an_inline_package_fades_its_compact_only_band_and_keeps_the_lift() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let compiled = load(&edit(REFERENCE, r#"{ "id": "bar", "gap_before": "SM","#, r#"{ "id": "bar", "when": "!sections", "gap_before": "SM","#)); let store = store(); let (compact, info) = (state(&compiled, 0), state(&compiled, OPEN_INFO)); @@ -400,7 +400,7 @@ fn an_inline_package_fades_its_compact_only_band_and_keeps_the_lift() { #[test] fn an_inline_partial_band_fades_when_a_second_section_opens_and_closes() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let store = store(); for when in [r#""!panel.info""#, r#"["sections", "!panel.info"]"#] { let compiled = load(&edit(REFERENCE, r#"{ "id": "bar", "gap_before": "SM","#, @@ -434,7 +434,7 @@ fn an_inline_partial_band_fades_when_a_second_section_opens_and_closes() { #[test] fn the_scrim_follows_its_top_edge_only_and_a_fixed_one_stands_still() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); let (chapters, info) = (state(&compiled, OPEN_CHAPTERS), state(&compiled, OPEN_INFO)); let (yc, yi) = (chapters.scrim.unwrap().y, info.scrim.unwrap().y); @@ -467,7 +467,7 @@ fn runs_of(c: &Census, size: i32) -> Vec<(f32, f32)> { #[test] fn a_band_in_only_the_open_states_fades_on_the_page_and_one_in_only_some_on_that_sections_appear() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let line = |id: &str, when: &str, size: &str| { let text = |bind: &str, size: &str| format!(r#"{{ "text": {{ "bind": "{bind}", "size": "{size}", "ink": "TEXT_SECONDARY", "bold": false, "max_lines": 1, "w": "fill" }} }}"#); format!( @@ -526,7 +526,7 @@ fn a_band_in_only_the_open_states_fades_on_the_page_and_one_in_only_some_on_that #[test] fn a_stand_in_cuts_to_the_discs_on_the_opening_frame_and_returns_at_once_on_the_closing_one() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); let offer = ControlSlot::UpNext(marker(MarkerKind::Credits, true)); @@ -556,7 +556,7 @@ fn a_stand_in_cuts_to_the_discs_on_the_opening_frame_and_returns_at_once_on_the_ #[test] fn the_titles_marquee_is_released_once_the_fade_is_over_and_not_at_its_first_frame() { let _serial = plx_base::testlock::serial(); - let _en = language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (compiled, store) = (rising(), store()); // a title that has been running for a while let prime = |row: &HudMotion| { diff --git a/rust-modules/appkit/src/player_hud/state.rs b/rust-modules/appkit/src/player_hud/state.rs index 1622d4a24c..9acb821e25 100644 --- a/rust-modules/appkit/src/player_hud/state.rs +++ b/rust-modules/appkit/src/player_hud/state.rs @@ -560,7 +560,7 @@ pub fn failure_action_word(a: plx_media::player::FailureAction) -> &'static str /// A control's label. Sentence case, as every `StatusOverlay` row is (the sign-in read-out's *Try /// again*): these are capsule buttons, not the ALL-CAPS clickable TEXT marks. pub fn failure_action_label(a: plx_media::player::FailureAction) -> &'static std::ffi::CStr { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; use plx_media::player::FailureAction as A; match a { A::PlayAutomatically => msg::widgets_failure_play_auto_c(), @@ -587,21 +587,21 @@ fn failure_glyph(kind: plx_media::player::FailureKind) -> plx_ui::icons::Icon { impl FailureReadout { /// Pure projection of the app's complete failure snapshot, including the repair status. pub fn captured(mut e: plx_media::player::ErrorShape, actions: Vec, - support: String, repair_status: plx_platform::tv::sandbox::State) -> Self { + support: String, repair_status: plx_os::tv::sandbox::State) -> Self { if e.kind == plx_media::player::FailureKind::JailMissingRtkmem { - use plx_platform::tv::sandbox::State; + use plx_os::tv::sandbox::State; match repair_status { State::Idle => {} State::Running => { - e.readout = plx_platform::i18n::msg::widgets_repair_running(); - e.detail = plx_platform::i18n::msg::widgets_repair_wait().into(); + e.readout = plx_os::i18n::msg::widgets_repair_running(); + e.detail = plx_os::i18n::msg::widgets_repair_wait().into(); } State::Repaired => { - e.readout = plx_platform::i18n::msg::widgets_repair_completed(); - e.detail = plx_platform::i18n::msg::widgets_repair_reopen().into(); + e.readout = plx_os::i18n::msg::widgets_repair_completed(); + e.detail = plx_os::i18n::msg::widgets_repair_reopen().into(); } State::Failed(reason) => { - e.readout = plx_platform::i18n::msg::widgets_repair_failed(); + e.readout = plx_os::i18n::msg::widgets_repair_failed(); e.detail = repair_failure_message(reason).into(); } } @@ -627,7 +627,7 @@ impl FailureReadout { let policy = e.kind == FailureKind::PlaybackPolicy && !e.detail.is_empty(); let reason: &str = if policy { &e.detail } else { e.readout }; let note: Option = if e.no_pass { - Some(plx_platform::i18n::msg::widgets_failure_no_pass(PLEX_PASS)) + Some(plx_os::i18n::msg::widgets_failure_no_pass(PLEX_PASS)) } else if policy || e.detail.is_empty() { None } else { @@ -726,16 +726,16 @@ pub fn failure_row_drawn(busy: Busy) -> bool { } /// Product copy is resolved here; the worker's technical error identity stays unchanged. -fn repair_failure_message(reason: plx_platform::tv::sandbox::Failure) -> &'static str { - use plx_platform::tv::sandbox::Failure; +fn repair_failure_message(reason: plx_os::tv::sandbox::Failure) -> &'static str { + use plx_os::tv::sandbox::Failure; match reason { - Failure::StartFailed => plx_platform::i18n::msg::widgets_repair_start_failed(), - Failure::HbcUnavailable => plx_platform::i18n::msg::widgets_repair_hbc_unavailable(), - Failure::NotRoot => plx_platform::i18n::msg::widgets_repair_not_root(), - Failure::CommandFailed => plx_platform::i18n::msg::widgets_repair_command_failed(), - Failure::Timeout => plx_platform::i18n::msg::widgets_repair_timeout(), - Failure::Unreadable => plx_platform::i18n::msg::widgets_repair_unreadable(), - Failure::Unsupported => plx_platform::i18n::msg::widgets_repair_unsupported(), + Failure::StartFailed => plx_os::i18n::msg::widgets_repair_start_failed(), + Failure::HbcUnavailable => plx_os::i18n::msg::widgets_repair_hbc_unavailable(), + Failure::NotRoot => plx_os::i18n::msg::widgets_repair_not_root(), + Failure::CommandFailed => plx_os::i18n::msg::widgets_repair_command_failed(), + Failure::Timeout => plx_os::i18n::msg::widgets_repair_timeout(), + Failure::Unreadable => plx_os::i18n::msg::widgets_repair_unreadable(), + Failure::Unsupported => plx_os::i18n::msg::widgets_repair_unsupported(), } } diff --git a/rust-modules/appkit/src/player_hud/strip.rs b/rust-modules/appkit/src/player_hud/strip.rs index 533d361cc9..1f15ec74f8 100644 --- a/rust-modules/appkit/src/player_hud/strip.rs +++ b/rust-modules/appkit/src/player_hud/strip.rs @@ -302,7 +302,7 @@ impl<'a, E> Cards<'a, E> { fn name(&self, i: usize) -> String { let ch = &self.chapters[i]; if ch.title.trim().is_empty() { - plx_platform::i18n::msg::widgets_chapters_number(ch.index) + plx_os::i18n::msg::widgets_chapters_number(ch.index) } else { ch.title.clone() } diff --git a/rust-modules/appkit/src/player_hud/tests.rs b/rust-modules/appkit/src/player_hud/tests.rs index a5edc65cb6..bc474a624e 100644 --- a/rust-modules/appkit/src/player_hud/tests.rs +++ b/rust-modules/appkit/src/player_hud/tests.rs @@ -88,9 +88,9 @@ fn long_hud_titles_fit_before_every_control_slot() { let measure = &ShippedMeasure; let long = CString::new("An extraordinarily long episode — Über den Wolken — ".repeat(20)).unwrap(); let clock = plx_ui::marquee::Clock::new(); - for language in plx_platform::i18n::SHIPPED { - let _language = plx_platform::i18n::language_on_this_thread_for_test(language); - let compiled = super::loaded::load_classic("test", plx_platform::i18n::current(), measure).compiled; + for language in plx_os::i18n::SHIPPED { + let _language = plx_os::i18n::language_on_this_thread_for_test(language); + let compiled = super::loaded::load_classic("test", plx_os::i18n::current(), measure).compiled; let slots = [ ControlSlot::Discs(Controls::NONE), ControlSlot::Discs(Controls { previous: true, next: true }), @@ -234,7 +234,7 @@ const FM: plx_ui::fixture::FixtureMeasure = plx_ui::fixture::FixtureMeasure; /// the presenting side's (`app::run::prepare_window`), ahead of the clear. #[test] fn the_transport_clocks_are_rasterised_before_the_draw_and_one_second_ahead() { - let _locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); let _g = plx_base::testlock::serial(); plx_gfx::text::reset_prewarm_for_test(); let sz = theme::size::CAPTION; @@ -293,7 +293,7 @@ fn the_transport_clocks_are_rasterised_before_the_draw_and_one_second_ahead() { while plx_gfx::text::prewarm_pending() { plx_ui::panel_motion::PanelMotion::drain_queued_text_for_test(); } - let time = plx_platform::i18n::current().time_of_day([22, 35]).unwrap(); + let time = plx_os::i18n::current().time_of_day([22, 35]).unwrap(); for text in [b"-0:36".as_slice(), b"-0:35".as_slice(), "\u{b7}".as_bytes(), time.as_bytes()] { assert!( plx_gfx::text::prewarm_resident_for_test(text, sz, 0), @@ -967,7 +967,7 @@ fn the_diagnostics_footer_sits_below_the_row_inside_the_safe_bottom_band() { fn every_failure_row_fits_the_screen_in_every_language() { use plx_base::fontcov::advances::ShippedMeasure; use plx_ui::fit::HEADROOM; - use plx_platform::i18n::{language_on_this_thread_for_test}; + use plx_os::i18n::{language_on_this_thread_for_test}; use plx_media::player::FailureAction as A; let rows: [&[A]; 3] = [ &[A::PlayAutomatically, A::TryAgain, A::Back], @@ -975,7 +975,7 @@ fn every_failure_row_fits_the_screen_in_every_language() { &[A::Repair, A::Back], ]; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _guard = language_on_this_thread_for_test(language); for row in rows { let labels: Vec<&'static std::ffi::CStr> = row.iter().map(|a| failure_action_label(*a)).collect(); @@ -1000,9 +1000,9 @@ fn the_jail_help_note_fits_the_note_slot_in_every_language() { use plx_base::fontcov::advances::ShippedMeasure; use plx_ui::fit::HEADROOM; use plx_ui::text_view::TextView; - use plx_platform::i18n::{language_on_this_thread_for_test, msg}; + use plx_os::i18n::{language_on_this_thread_for_test, msg}; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _guard = language_on_this_thread_for_test(language); let help = msg::widgets_reason_jail_help(); let fits = !TextView::new(help, theme::size::CAPTION, theme::TEXT_TERTIARY) @@ -1022,9 +1022,9 @@ fn the_jail_help_note_fits_the_note_slot_in_every_language() { fn every_forced_verdict_fits_the_reason_slot_in_every_language() { use plx_base::fontcov::advances::ShippedMeasure; use plx_ui::fit::HEADROOM; - use plx_platform::i18n::{language_on_this_thread_for_test, msg}; + use plx_os::i18n::{language_on_this_thread_for_test, msg}; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _guard = language_on_this_thread_for_test(language); for s in [msg::widgets_verdict_forced_no_original(), msg::widgets_verdict_forced_container(), msg::widgets_verdict_forced_video(), msg::widgets_verdict_forced_audio(), @@ -1637,7 +1637,7 @@ fn classic_resolved_through_the_compile_is_classics_table() { use super::command::HudCommand; use super::model::HudModel; use plx_base::fontcov::advances::ShippedMeasure; - let hud = super::loaded::load_classic("test", plx_platform::i18n::english(), &ShippedMeasure); + let hud = super::loaded::load_classic("test", plx_os::i18n::english(), &ShippedMeasure); let compiled = &*hud.compiled; let model = HudModel::default(); for episode in [false, true] { @@ -1690,14 +1690,14 @@ mod playbar_options { #[test] fn the_remaining_clock_can_include_a_local_end_time() { - let _locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); let mut b = bar(Knob::Tick, TransportMark::None); let plain = runs(b, PlaybarLook::default()); assert!(plain.iter().any(|r| r.text == "-10:00")); b.end_time = Some([22, 35]); let look = with_end_time_width(PlaybarLook::default(), 320.0); let with_end = runs(b, look); - let time = plx_platform::i18n::current().time_of_day([22, 35]).unwrap(); + let time = plx_os::i18n::current().time_of_day([22, 35]).unwrap(); let combined = with_end.iter().filter(|r| r.align == 0).collect::>(); assert_eq!(combined.iter().map(|r| r.text.as_str()).collect::>(), ["-10:00", "\u{b7}", time.as_str()]); assert_eq!(combined[1].ink, theme::TEXT_SEPARATOR); @@ -1782,12 +1782,12 @@ mod playbar_options { // --- PR8 stage 2a: what the screen reads to open, travel and close a section --- fn compiled_classic() -> std::sync::Arc { - super::loaded::load_classic("0.0.0-test", plx_platform::i18n::english(), &plx_base::fontcov::advances::ShippedMeasure).compiled + super::loaded::load_classic("0.0.0-test", plx_os::i18n::english(), &plx_base::fontcov::advances::ShippedMeasure).compiled } fn compiled_reference() -> std::sync::Arc { let text = include_str!("../hud_format/fixtures/reference/hud.json"); - super::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &plx_base::fontcov::advances::ShippedMeasure) + super::loaded::load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &plx_base::fontcov::advances::ShippedMeasure) .expect("the reference loads") .compiled } diff --git a/rust-modules/appkit/src/player_hud/travel.rs b/rust-modules/appkit/src/player_hud/travel.rs index 6346d0c543..8d00f343f0 100644 --- a/rust-modules/appkit/src/player_hud/travel.rs +++ b/rust-modules/appkit/src/player_hud/travel.rs @@ -194,7 +194,7 @@ mod tests { use plx_ui::fixture::FixtureMeasure; fn fixture(text: &str) -> std::sync::Arc { - load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_platform::i18n::english(), &FixtureMeasure).expect("the fixture loads").compiled + load(&crate::hud_format::fixtures::with_hud_resources("reference", &text), "0.0.0-test", plx_os::i18n::english(), &FixtureMeasure).expect("the fixture loads").compiled } fn reference() -> std::sync::Arc { diff --git a/rust-modules/appkit/src/scrub_preview.rs b/rust-modules/appkit/src/scrub_preview.rs index 1e29526bcf..ffccbd0007 100644 --- a/rust-modules/appkit/src/scrub_preview.rs +++ b/rust-modules/appkit/src/scrub_preview.rs @@ -6,7 +6,7 @@ //! `/library/parts/{part}/indexes/sd/{ms}` — about 10 KB of 320×180 JPEG each, the nearest frame //! to `ms`. The whole BIF is tens of MB against a 32-bit heap, so it is never fetched: each still //! is ordinary keyed art through the poster source and the render cache (`plx_ui::tex`), exactly -//! like a chapter card's thumbnail. `plx_platform::imgcache` keeps them off the disk tier. +//! like a chapter card's thumbnail. `plx_os::imgcache` keeps them off the disk tier. //! //! **Absence is the ordinary case.** Many libraries have preview thumbnails off, and then every //! still is a 404. The first request of a playback that settles as a miss before any still has diff --git a/rust-modules/appkit/src/skip_pill.rs b/rust-modules/appkit/src/skip_pill.rs index 2f7dbc033c..d5c85942d9 100644 --- a/rust-modules/appkit/src/skip_pill.rs +++ b/rust-modules/appkit/src/skip_pill.rs @@ -52,16 +52,16 @@ impl Prompt { /// end): Skip intro / Skip credits, for the manual pill and the Automatic prompt alike. pub fn label(&self) -> &'static str { match self.kind { - MarkerKind::Intro => plx_platform::i18n::msg::widgets_skip_intro(), - MarkerKind::Credits => plx_platform::i18n::msg::widgets_skip_credits(), + MarkerKind::Intro => plx_os::i18n::msg::widgets_skip_intro(), + MarkerKind::Credits => plx_os::i18n::msg::widgets_skip_credits(), } } /// The Automatic prompt's unfilled button, which cancels the countdown: Watch intro / Watch credits. /// Item 0 of the row, to the left of the filled action ([`crate::up_next::BTN_CREDITS`]). pub fn watch_label(&self) -> &'static str { match self.kind { - MarkerKind::Intro => plx_platform::i18n::msg::widgets_watch_intro(), - MarkerKind::Credits => plx_platform::i18n::msg::widgets_next_credits(), + MarkerKind::Intro => plx_os::i18n::msg::widgets_watch_intro(), + MarkerKind::Credits => plx_os::i18n::msg::widgets_next_credits(), } } } @@ -128,7 +128,7 @@ mod tests { #[test] fn the_automatic_prompt_draws_watch_beside_the_filled_skip_and_the_manual_one_the_pill_alone() { let _serial = plx_base::testlock::serial(); - let _en = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); let row = crate::player_hud::motion::HudMotion::new(); let (watch, skip) = (Rect::new(900.0, 800.0, 200.0, 64.0), Rect::new(1116.0, 800.0, 232.0, 64.0)); for (kind, filled, cancel) in [(MarkerKind::Intro, "Skip Intro", "Watch Intro"), (MarkerKind::Credits, "Skip Credits", "Watch Credits")] { diff --git a/rust-modules/appkit/src/source_list.rs b/rust-modules/appkit/src/source_list.rs index 7504ca9742..1a75ebc2aa 100644 --- a/rust-modules/appkit/src/source_list.rs +++ b/rust-modules/appkit/src/source_list.rs @@ -90,9 +90,9 @@ fn state_word(s: SourceState) -> Option<&'static str> { /// a router for something no router was ever part of. The remedy is in this same panel, one row /// down: *Check for shared libraries* is the `/api/v2/resources` refetch that reissues the per-(user, /// server) `accessToken`, which is why this run does not have to carry an instruction as well. -fn unauthorized() -> &'static str { plx_platform::i18n::msg::widgets_source_unauthorized() } +fn unauthorized() -> &'static str { plx_os::i18n::msg::widgets_source_unauthorized() } /// Did not answer at all — refused, timed out, or unresolvable. -fn unreachable() -> &'static str { plx_platform::i18n::msg::widgets_source_unreachable() } +fn unreachable() -> &'static str { plx_os::i18n::msg::widgets_source_unreachable() } /// Answered, verified as the right machine, but only over a transport this build may not put a /// credential on without the person's consent (issue #95, PLX-NATIVE-10). A different kind of fault from [`unreachable`] again — the server IS /// there, it is the connection to it that has to change (HTTPS), not the server itself. @@ -100,7 +100,7 @@ fn unreachable() -> &'static str { plx_platform::i18n::msg::widgets_source_unrea /// Deliberately NOT the consent flow's "without encryption" wording: this row names a state no /// question can change (the server was ineligible, or not yet offered); an eligible server is /// asked through `screens::plaintext_question`, and a granted one reads as connected. -fn insecure_only() -> &'static str { plx_platform::i18n::msg::widgets_source_insecure() } +fn insecure_only() -> &'static str { plx_os::i18n::msg::widgets_source_insecure() } /// The word a WORKING group's connection tier is said in — `None` when there is nothing worth /// saying. @@ -118,8 +118,8 @@ fn insecure_only() -> &'static str { plx_platform::i18n::msg::widgets_source_ins fn tier_word(t: Location) -> Option<&'static str> { match t { Location::Local => None, - Location::Remote => Some(plx_platform::i18n::msg::widgets_source_remote()), - Location::Relay => Some(plx_platform::i18n::msg::widgets_source_relay()), + Location::Remote => Some(plx_os::i18n::msg::widgets_source_remote()), + Location::Relay => Some(plx_os::i18n::msg::widgets_source_relay()), } } @@ -239,7 +239,7 @@ pub fn form( let shared_pick = level == Level::Browse && !g.handle.is_empty(); let head = if shared_pick { let (words, _) = accessory_parts(g); - let sec = Section::new(plx_platform::i18n::msg::widgets_source_shared_with_you()); + let sec = Section::new(plx_os::i18n::msg::widgets_source_shared_with_you()); (if words.is_empty() { sec } else { sec.accessory(words) }).dim(!usable(g)) } else { header_accessory(Section::new(g.name.clone()).server_header(), g).dim(!usable(g)) @@ -263,7 +263,7 @@ pub fn form( // is the library that works. .value_dim(r.last_pinned) .detail(if r.last_pinned { - plx_platform::i18n::msg::widgets_source_needs_library().to_string() + plx_os::i18n::msg::widgets_source_needs_library().to_string() } else { r.count_line.clone() }); @@ -285,7 +285,7 @@ pub fn form( SrcTarget::Recheck, RowKind::Button, SrcTarget::Recheck, - Row::new(plx_platform::i18n::msg::widgets_source_new_shares()), + Row::new(plx_os::i18n::msg::widgets_source_new_shares()), )); } } @@ -309,7 +309,7 @@ pub fn compact_picker(groups: &[SrcGroup], rows: &[plx_data::browse::SrcRow], ta if tail == Tail::Recheck { if !rows.is_empty() { section = section.separator(); } section = section.item(SrcTarget::Recheck, RowKind::Button, SrcTarget::Recheck, - Row::new(plx_platform::i18n::msg::widgets_source_new_shares())); + Row::new(plx_os::i18n::msg::widgets_source_new_shares())); } Form::new().section(section) } @@ -461,7 +461,7 @@ mod tests { /// table width (`RouteLayout::screen().sectioned_table()`, `screens::onboard`). #[test] fn every_app_owned_run_fits_its_column_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; use plx_ui::route_screen::RouteLayout; use plx_ui::table::TableView; // the library panel is a menu table; the favourites editor is a route page's table @@ -524,7 +524,7 @@ mod tests { /// the app's state words, with and without a handle, must still fit it in every language. #[test] fn the_state_words_fit_beside_a_long_machine_name_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; use plx_ui::table::TableView; let name = "a-very-long-shared-server-machine-name-that-keeps-going"; let mut out = Vec::new(); diff --git a/rust-modules/appkit/src/timing_capsule.rs b/rust-modules/appkit/src/timing_capsule.rs index d2dd4197fb..a7c797fbb8 100644 --- a/rust-modules/appkit/src/timing_capsule.rs +++ b/rust-modules/appkit/src/timing_capsule.rs @@ -63,20 +63,20 @@ const CHEVRON_SZ: f32 = 30.0; /// seconds unit (`core.seconds`). `signed` prefixes `+`/`-` (the Subtitles panel's Timing /// read-out); unsigned is the bare magnitude this capsule's sentence says "later"/"earlier" about. /// ASCII hyphen-minus rather than U+2212, which the UI font is not guaranteed to carry. -pub fn offset_seconds_in(ms: i64, signed: bool, locale: &plx_platform::i18n::LocaleContext) -> String { +pub fn offset_seconds_in(ms: i64, signed: bool, locale: &plx_os::i18n::LocaleContext) -> String { let sign = match ms.signum() { 1 if signed => "+", -1 if signed => "-", _ => "", }; let tenths = (ms.unsigned_abs() / 100) as i64; - plx_platform::i18n::msg::core_seconds_in(locale, &format!("{sign}{}", locale.decimal(tenths, 1))) + plx_os::i18n::msg::core_seconds_in(locale, &format!("{sign}{}", locale.decimal(tenths, 1))) } /// The capsule's sentence for `offset_ms` in `locale` — catalog text, with the magnitude from /// [`offset_seconds_in`], as the Timing row's read-out uses. -fn text_in(offset_ms: i64, locale: &plx_platform::i18n::LocaleContext) -> String { - use plx_platform::i18n::msg; +fn text_in(offset_ms: i64, locale: &plx_os::i18n::LocaleContext) -> String { + use plx_os::i18n::msg; if offset_ms == 0 { return msg::widgets_tracks_capsule_original_in(locale).to_string(); } @@ -139,7 +139,7 @@ impl TimingCapsule { fn set_offset(&mut self, ms: i64) { self.offset_ms = ms; // catalog text never carries a NUL; an empty caption is the harmless fallback - self.caption = CString::new(text_in(ms, plx_platform::i18n::current())).unwrap_or_default(); + self.caption = CString::new(text_in(ms, plx_os::i18n::current())).unwrap_or_default(); } #[cfg(any(test, feature = "test-support"))] @@ -402,7 +402,7 @@ mod tests { /// The sentence is catalog text with the locale's decimal and seconds unit. #[test] fn the_text_is_localized() { - use plx_platform::i18n::{LocaleContext, Preference}; + use plx_os::i18n::{LocaleContext, Preference}; let es = LocaleContext::resolve(Preference::Es, None, Some("es-ES"), None, None); let be = LocaleContext::resolve(Preference::Be, None, Some("be-BY"), None, None); let fr = LocaleContext::resolve(Preference::Fr, None, Some("fr-FR"), None, None); @@ -419,10 +419,10 @@ mod tests { fn the_capsule_sentence_fits_its_block_in_every_language() { use plx_base::fontcov::advances::ShippedMeasure; use plx_ui::fit::HEADROOM; - use plx_platform::i18n::{LocaleContext}; + use plx_os::i18n::{LocaleContext}; use plx_machine::machine::Measure; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { // No format locale: the language's own region (the registry's), as a fresh launch resolves. let locale = LocaleContext::resolve(language, None, None, None, None); for ms in [-60_000, 60_000, 0] { diff --git a/rust-modules/appkit/src/track_menu.rs b/rust-modules/appkit/src/track_menu.rs index d019ded370..12134dddc7 100644 --- a/rust-modules/appkit/src/track_menu.rs +++ b/rust-modules/appkit/src/track_menu.rs @@ -230,7 +230,7 @@ impl StyleField { } fn label(self) -> &'static str { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match self { Self::Size => msg::widgets_tracks_style_size(), Self::Position => msg::widgets_tracks_style_position(), @@ -282,14 +282,14 @@ impl TrackPage { /// model, [`TrackMenuState::other`]). fn title(self, other: &[OtherLang]) -> String { match self { - Self::Style => plx_platform::i18n::msg::widgets_tracks_style().to_string(), + Self::Style => plx_os::i18n::msg::widgets_tracks_style().to_string(), Self::Picker(field) => field.label().to_string(), - Self::OtherLanguages => plx_platform::i18n::msg::widgets_tracks_other_languages().to_string(), + Self::OtherLanguages => plx_os::i18n::msg::widgets_tracks_other_languages().to_string(), Self::Language(stream) => { other.iter().find(|o| o.id.stream == stream).map(|o| o.name.clone()).unwrap_or_default() } - Self::Search => plx_platform::i18n::msg::widgets_tracks_search_open().to_string(), - Self::SearchLanguage => plx_platform::i18n::msg::widgets_tracks_search_language().to_string(), + Self::Search => plx_os::i18n::msg::widgets_tracks_search_open().to_string(), + Self::SearchLanguage => plx_os::i18n::msg::widgets_tracks_search_language().to_string(), } } @@ -480,7 +480,7 @@ impl SubRenderer { /// subtitle says which of its colours the pick reaches: `takes_colour` is the media fact /// (`plx_media::player::subtitle_takes_colour`), so its white text follows the pick or none of it does. fn note(self, takes_colour: bool) -> Option<&'static str> { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match self { Self::Text => None, Self::Image => Some(msg::widgets_tracks_style_image_note()), @@ -1558,7 +1558,7 @@ impl TrackMenuState { let current = tracks.iter().find(|t| active >= 0 && t.i == active as usize); let value = match current { Some(t) => in_lang_label(t), - None => plx_platform::i18n::msg::widgets_tracks_count(tracks.len() as i64), + None => plx_os::i18n::msg::widgets_tracks_count(tracks.len() as i64), }; let row = Row::new(lang.name.clone()).value(value).checked(current.is_some()); sec.item(TrackRow::OpenLang(lang.id), RowKind::Nav(TrackPage::Language(lang.id.stream)), (), row) @@ -1588,7 +1588,7 @@ impl TrackMenuState { /// failure is ever drawn as an alarm (`ui/src/CLAUDE.md`: failure read-outs are never red). fn search_form(&self) -> TrackForm { use plx_data::subsearch::{DownloadPhase, SearchFailure, SearchStatus}; - use plx_platform::i18n::msg; + use plx_os::i18n::msg; let Some(s) = self.search.as_ref() else { return Form::new() }; let busy = s.download.busy(); let lang = if s.lang.is_empty() { String::new() } else { plx_plex::plex::languages::label(&s.lang).to_string() }; @@ -1956,14 +1956,14 @@ impl TrackMenuState { fn enh_reason_text(reason: plx_media::route::DisabledReason) -> String { use plx_media::route::DisabledReason; match reason { - DisabledReason::NotAnalyzed => plx_platform::i18n::msg::widgets_tracks_enh_reason_not_analyzed(), - DisabledReason::DolbyVisionUnusable => plx_platform::i18n::msg::widgets_tracks_enh_reason_dv_unusable(), - DisabledReason::DolbyVisionSubtitle => plx_platform::i18n::msg::widgets_tracks_enh_reason_dv_subtitle(), - DisabledReason::NotOriginalQuality => plx_platform::i18n::msg::widgets_tracks_enh_reason_quality(), - DisabledReason::ForcedDirectPlay => plx_platform::i18n::msg::widgets_tracks_enh_reason_forced(), - DisabledReason::ServerConverting => plx_platform::i18n::msg::widgets_tracks_enh_reason_converting(), - DisabledReason::NotCopyable => plx_platform::i18n::msg::widgets_tracks_enh_reason_not_copyable(), - DisabledReason::ServerRefused => plx_platform::i18n::msg::widgets_tracks_enh_reason_refused(), + DisabledReason::NotAnalyzed => plx_os::i18n::msg::widgets_tracks_enh_reason_not_analyzed(), + DisabledReason::DolbyVisionUnusable => plx_os::i18n::msg::widgets_tracks_enh_reason_dv_unusable(), + DisabledReason::DolbyVisionSubtitle => plx_os::i18n::msg::widgets_tracks_enh_reason_dv_subtitle(), + DisabledReason::NotOriginalQuality => plx_os::i18n::msg::widgets_tracks_enh_reason_quality(), + DisabledReason::ForcedDirectPlay => plx_os::i18n::msg::widgets_tracks_enh_reason_forced(), + DisabledReason::ServerConverting => plx_os::i18n::msg::widgets_tracks_enh_reason_converting(), + DisabledReason::NotCopyable => plx_os::i18n::msg::widgets_tracks_enh_reason_not_copyable(), + DisabledReason::ServerRefused => plx_os::i18n::msg::widgets_tracks_enh_reason_refused(), } .to_string() } @@ -1976,9 +1976,9 @@ impl TrackMenuState { ) -> Option { use plx_media::route::{EnhancementRoute, SubtitleEffect}; match route { - EnhancementRoute::Burn => Some(plx_platform::i18n::msg::widgets_tracks_enh_note_burn().to_string()), + EnhancementRoute::Burn => Some(plx_os::i18n::msg::widgets_tracks_enh_note_burn().to_string()), EnhancementRoute::Remux if subtitle_effect == SubtitleEffect::Sidecar => { - Some(plx_platform::i18n::msg::widgets_tracks_enh_note_sidecar().to_string()) + Some(plx_os::i18n::msg::widgets_tracks_enh_note_sidecar().to_string()) } EnhancementRoute::Remux => None, } @@ -2003,7 +2003,7 @@ impl TrackMenuState { /// so the Audio root can be built while the menu shows Subtitles and has not stored one. fn audio_form_for(&self, ps: &plx_media::route::PlaybackSession, meta: metadata::MetadataView<'_>, enh: EnhState) -> TrackForm { let (enhance_shown, enhance_route, enhance_disabled, enhance_subtitle_effect) = enh; - let mut sec = FormSection::new(plx_platform::i18n::msg::widgets_tracks_audio()); + let mut sec = FormSection::new(plx_os::i18n::msg::widgets_tracks_audio()); let d = match tracks(meta) { Some(t) => t, None => return Form::new().section(sec), @@ -2011,12 +2011,12 @@ impl TrackMenuState { let names = plx_media::player::SHARED.track_names.lock().unwrap(); for (i, s) in d.audio.iter().enumerate() { let lang = if s.lang.is_empty() { - plx_platform::i18n::msg::widgets_tracks_unknown() + plx_os::i18n::msg::widgets_tracks_unknown() } else { s.lang.as_str() }; let label = if s.default { - plx_platform::i18n::msg::widgets_tracks_original(lang) + plx_os::i18n::msg::widgets_tracks_original(lang) } else { lang.to_string() }; @@ -2050,13 +2050,13 @@ impl TrackMenuState { TrackRow::Boost, RowKind::Toggle, (), - Row::new(plx_platform::i18n::msg::widgets_tracks_boost_dialog()).toggle(shown.boost_dialog), + Row::new(plx_os::i18n::msg::widgets_tracks_boost_dialog()).toggle(shown.boost_dialog), ) .item( TrackRow::Loudness, RowKind::Toggle, (), - Row::new(plx_platform::i18n::msg::widgets_tracks_normalize_loudness()).toggle(shown.normalize_loudness), + Row::new(plx_os::i18n::msg::widgets_tracks_normalize_loudness()).toggle(shown.normalize_loudness), ); if let Some(route) = enhance_route { if let Some(note) = Self::enh_note_text(route, enhance_subtitle_effect) { @@ -2073,13 +2073,13 @@ impl TrackMenuState { TrackRow::Boost, RowKind::Toggle, (), - Row::new(plx_platform::i18n::msg::widgets_tracks_boost_dialog()).toggle(false).dim(true), + Row::new(plx_os::i18n::msg::widgets_tracks_boost_dialog()).toggle(false).dim(true), ) .item( TrackRow::Loudness, RowKind::Toggle, (), - Row::new(plx_platform::i18n::msg::widgets_tracks_normalize_loudness()).toggle(false).dim(true), + Row::new(plx_os::i18n::msg::widgets_tracks_normalize_loudness()).toggle(false).dim(true), ) .note(Self::enh_reason_text(reason)); form = form.section(enh); @@ -2149,7 +2149,7 @@ impl TrackMenuState { TrackRow::OpenSearch, RowKind::Nav(TrackPage::Search), (), - Row::new(plx_platform::i18n::msg::widgets_tracks_search_open()), + Row::new(plx_os::i18n::msg::widgets_tracks_search_open()), )); } (form, model) @@ -2533,20 +2533,20 @@ fn visible_subs(ps: &plx_media::route::PlaybackSession, meta: metadata::Metadata /// Resolve the typed tone at the UI boundary; persisted values and technical logs stay stable. pub fn subtitle_tone_label(tone: SubtitleTone) -> &'static str { match tone { - SubtitleTone::White => plx_platform::i18n::msg::widgets_tracks_tone_white(), - SubtitleTone::Yellow => plx_platform::i18n::msg::widgets_tracks_tone_yellow(), - SubtitleTone::Silver => plx_platform::i18n::msg::widgets_tracks_tone_silver(), - SubtitleTone::LightGrey => plx_platform::i18n::msg::widgets_tracks_tone_light_grey(), - SubtitleTone::Grey => plx_platform::i18n::msg::widgets_tracks_tone_grey(), - SubtitleTone::DarkGrey => plx_platform::i18n::msg::widgets_tracks_tone_dark_grey(), - SubtitleTone::Charcoal => plx_platform::i18n::msg::widgets_tracks_tone_charcoal(), + SubtitleTone::White => plx_os::i18n::msg::widgets_tracks_tone_white(), + SubtitleTone::Yellow => plx_os::i18n::msg::widgets_tracks_tone_yellow(), + SubtitleTone::Silver => plx_os::i18n::msg::widgets_tracks_tone_silver(), + SubtitleTone::LightGrey => plx_os::i18n::msg::widgets_tracks_tone_light_grey(), + SubtitleTone::Grey => plx_os::i18n::msg::widgets_tracks_tone_grey(), + SubtitleTone::DarkGrey => plx_os::i18n::msg::widgets_tracks_tone_dark_grey(), + SubtitleTone::Charcoal => plx_os::i18n::msg::widgets_tracks_tone_charcoal(), } } /// The localized name of a caption size rung — the one place both the player's Style pages and /// Settings' Playback read it. pub fn subtitle_size_label(size: SubtitleSize) -> &'static str { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match size { SubtitleSize::Small => msg::settings_playback_subtitle_size_small(), SubtitleSize::Medium => msg::settings_playback_subtitle_size_medium(), @@ -2558,7 +2558,7 @@ pub fn subtitle_size_label(size: SubtitleSize) -> &'static str { /// The localized name of a caption position rung, shared like [`subtitle_size_label`]. pub fn subtitle_position_label(position: SubtitlePosition) -> &'static str { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match position { SubtitlePosition::Low => msg::settings_playback_subtitle_position_low(), SubtitlePosition::Middle => msg::settings_playback_subtitle_position_middle(), @@ -2569,7 +2569,7 @@ pub fn subtitle_position_label(position: SubtitlePosition) -> &'static str { /// An offset as localized signed seconds to the tenth (`appkit::timing_capsule::offset_seconds_in`, /// the one offset formatter). fn format_offset(ms: i64) -> String { - crate::timing_capsule::offset_seconds_in(ms, true, plx_platform::i18n::current()) + crate::timing_capsule::offset_seconds_in(ms, true, plx_os::i18n::current()) } // ---- section building ---- @@ -2588,7 +2588,7 @@ use plx_data::metadata::track_label::Kind; /// longest label is graded against the panel by `converted_audio_sub_lines_fit_the_panel_in_every_language`. fn audio_sub_line(ps: &plx_media::route::PlaybackSession, sub: String, s: &metadata::Stream) -> String { let converted = plx_media::route::audio_converted_by_server(ps, &s.codec, s.channels, s.sampling_rate); - let in_app = plx_platform::devcaps::app_decode_mixes_down(s.channels) + let in_app = plx_os::devcaps::app_decode_mixes_down(s.channels) && plx_media::route::audio_decoded_in_app(ps, &s.codec, s.channels, s.sampling_rate); audio_sub_line_for(sub, converted, in_app) } @@ -2598,9 +2598,9 @@ fn audio_sub_line_for(sub: String, converted: bool, decoded_in_app: bool) -> Str if sub.is_empty() { sub } else if converted { - plx_platform::i18n::msg::widgets_tracks_converted_by_server(&sub) + plx_os::i18n::msg::widgets_tracks_converted_by_server(&sub) } else if decoded_in_app { - plx_platform::i18n::msg::widgets_tracks_decoded_in_app_stereo(&sub) + plx_os::i18n::msg::widgets_tracks_decoded_in_app_stereo(&sub) } else { sub } @@ -2613,8 +2613,8 @@ fn audio_descriptor(s: &metadata::Stream) -> String { channel_short(&s.layout) } else if s.channels > 0 { match s.channels { - 1 => plx_platform::i18n::msg::widgets_tracks_mono().to_string(), - 2 => plx_platform::i18n::msg::widgets_tracks_stereo().to_string(), + 1 => plx_os::i18n::msg::widgets_tracks_mono().to_string(), + 2 => plx_os::i18n::msg::widgets_tracks_stereo().to_string(), n => format!("{}.{}", n - 1, if n >= 6 { 1 } else { 0 }), } } else { @@ -2632,8 +2632,8 @@ fn audio_descriptor(s: &metadata::Stream) -> String { fn channel_short(layout: &str) -> String { let base = layout.split('(').next().unwrap_or(layout).trim(); match base { - "mono" => plx_platform::i18n::msg::widgets_tracks_mono().to_string(), - "stereo" => plx_platform::i18n::msg::widgets_tracks_stereo().to_string(), + "mono" => plx_os::i18n::msg::widgets_tracks_mono().to_string(), + "stereo" => plx_os::i18n::msg::widgets_tracks_stereo().to_string(), other => other.to_string(), } } @@ -2652,7 +2652,7 @@ fn row_badge(b: &RowBadge) -> Badge { match b { RowBadge::Forced => Badge::Forced, RowBadge::Sdh => Badge::Sdh, - RowBadge::External => Badge::Text(plx_platform::i18n::msg::widgets_tracks_external_badge().to_string()), + RowBadge::External => Badge::Text(plx_os::i18n::msg::widgets_tracks_external_badge().to_string()), RowBadge::Codec(c) => Badge::Text((*c).to_string()), } } @@ -2666,7 +2666,7 @@ fn flat_row(t: &SubTrack, active_sub: c_int) -> Row { parts.push(t.detail.clone()); } if let Some(n) = t.ordinal { - parts.push(plx_platform::i18n::msg::widgets_tracks_track_ordinal(n as i64)); + parts.push(plx_os::i18n::msg::widgets_tracks_track_ordinal(n as i64)); } if !parts.is_empty() { row = row.detail(parts.join(" \u{b7} ")); @@ -2697,7 +2697,7 @@ fn in_lang_row(t: &SubTrack, active_sub: c_int) -> Row { /// A track's label inside its language: the source (+ "Track N" if needed), or the kind word for a /// nameless one. Also the value a language's drill-in reads out for its active variant. fn in_lang_label(t: &SubTrack) -> String { - let nth = t.ordinal.map(|n| plx_platform::i18n::msg::widgets_tracks_track_ordinal(n as i64)); + let nth = t.ordinal.map(|n| plx_os::i18n::msg::widgets_tracks_track_ordinal(n as i64)); if !t.detail.is_empty() { match &nth { Some(n) => format!("{} \u{b7} {}", t.detail, n), @@ -2748,7 +2748,7 @@ fn table_form( memory_note: bool, forced_only: Option<&str>, ) -> TrackForm { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; // the track the rows check: the drawn one, unless Forced only holds the checkmark let checked_sub = if forced_only.is_some() { -1 } else { active_sub }; let active_other = @@ -3019,7 +3019,7 @@ mod tests { /// server text and may elide; the fixture's sources are short so only app text is judged.) #[test] fn every_subtitles_row_fits_the_panel_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let mut subs = vec![ stream(1, 0, "Russian", "rus", "forced, DVD R5"), stream(2, 1, "Russian", "rus", "Netflix"), @@ -3053,7 +3053,7 @@ mod tests { /// accented vowels), the fixture's own server values, or letter-free. #[test] fn every_app_owned_subtitles_string_comes_from_the_catalog() { - let _pseudo = plx_platform::i18n::pseudo_on_this_thread_for_test(); + let _pseudo = plx_os::i18n::pseudo_on_this_thread_for_test(); // a title's own "Commentary" stays its source (the mock strips no commentary word), so it // is server text here like the rest let server = ["Russian", "Spanish", "Portuguese", "Netflix", "DVD R5", "Commentary"]; @@ -3653,7 +3653,7 @@ mod enhancement_menu_tests { let (menu, ps) = audio_tab(EnhTestFixture { carried_capable: Some(false), ..Default::default() }); assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::NotAnalyzed)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_not_analyzed()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_not_analyzed()); teardown(&ps); } @@ -3667,8 +3667,8 @@ mod enhancement_menu_tests { assert_eq!(menu.enhance_route, Some(plx_media::route::EnhancementRoute::Remux)); assert!(menu.enhance_shown.is_some()); let last = menu.form.table.sections[1].rows.last().unwrap(); - assert_ne!(last.label, plx_platform::i18n::msg::widgets_tracks_enh_note_burn()); - assert_ne!(last.label, plx_platform::i18n::msg::widgets_tracks_enh_note_sidecar()); + assert_ne!(last.label, plx_os::i18n::msg::widgets_tracks_enh_note_burn()); + assert_ne!(last.label, plx_os::i18n::msg::widgets_tracks_enh_note_sidecar()); assert_eq!(menu.form.table.sections[1].rows.len(), 2, "the two DSP toggles and no note row"); teardown(&ps); } @@ -3683,7 +3683,7 @@ mod enhancement_menu_tests { assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::DolbyVisionUnusable)); assert_eq!(menu.enhance_shown, None); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_dv_unusable()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_dv_unusable()); teardown(&ps); } @@ -3700,7 +3700,7 @@ mod enhancement_menu_tests { }); assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::DolbyVisionSubtitle)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_dv_subtitle()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_dv_subtitle()); teardown(&ps); } @@ -3716,7 +3716,7 @@ mod enhancement_menu_tests { assert_eq!(menu.enhance_route, Some(plx_media::route::EnhancementRoute::Burn)); assert!(menu.enhance_shown.is_some()); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_note_burn()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_note_burn()); teardown(&ps); } @@ -3732,7 +3732,7 @@ mod enhancement_menu_tests { assert_eq!(menu.enhance_route, Some(plx_media::route::EnhancementRoute::Remux)); assert!(menu.enhance_shown.is_some()); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_note_sidecar()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_note_sidecar()); teardown(&ps); } @@ -3748,7 +3748,7 @@ mod enhancement_menu_tests { }); assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::NotOriginalQuality)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_quality()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_quality()); teardown(&ps); } @@ -3791,8 +3791,8 @@ mod enhancement_menu_tests { let (menu, ps) = audio_tab(fixture); assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::NotCopyable)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_not_copyable()); - assert_ne!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_quality()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_not_copyable()); + assert_ne!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_quality()); teardown(&ps); } } @@ -3836,7 +3836,7 @@ mod enhancement_menu_tests { assert_eq!(menu.enhance_route, Some(plx_media::route::EnhancementRoute::Burn)); assert_eq!(menu.enhance_disabled, None); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_note_burn()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_note_burn()); teardown(&ps); } } @@ -3850,7 +3850,7 @@ mod enhancement_menu_tests { assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::ServerConverting)); assert!(plx_media::route::original_is_converted(&ps)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_converting()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_converting()); teardown(&ps); } @@ -3866,7 +3866,7 @@ mod enhancement_menu_tests { }); assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::ForcedDirectPlay)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_forced()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_forced()); teardown(&ps); } @@ -3876,7 +3876,7 @@ mod enhancement_menu_tests { let (menu, ps) = audio_tab(EnhTestFixture { refused: true, ..Default::default() }); assert_eq!(menu.enhance_disabled, Some(plx_media::route::DisabledReason::ServerRefused)); let note = menu.form.table.sections[1].rows.last().unwrap(); - assert_eq!(note.label, plx_platform::i18n::msg::widgets_tracks_enh_reason_refused()); + assert_eq!(note.label, plx_os::i18n::msg::widgets_tracks_enh_reason_refused()); teardown(&ps); } @@ -3899,8 +3899,8 @@ mod enhancement_menu_tests { let enh = &menu.form.table.sections[1]; assert_eq!(enh.header, ""); assert_eq!(enh.rows.len(), 2); - assert_eq!(enh.rows[0].label, plx_platform::i18n::msg::widgets_tracks_boost_dialog()); - assert_eq!(enh.rows[1].label, plx_platform::i18n::msg::widgets_tracks_normalize_loudness()); + assert_eq!(enh.rows[0].label, plx_os::i18n::msg::widgets_tracks_boost_dialog()); + assert_eq!(enh.rows[1].label, plx_os::i18n::msg::widgets_tracks_normalize_loudness()); teardown(&ps); } @@ -4451,12 +4451,12 @@ mod enhancement_menu_tests { /// prose the viewer who HAS them ever reads. #[test] fn enh_locale_values_never_mention_plex_pass() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; for language in SHIPPED { let _guard = language_on_this_thread_for_test(language); for value in [ - plx_platform::i18n::msg::widgets_tracks_boost_dialog(), - plx_platform::i18n::msg::widgets_tracks_normalize_loudness(), + plx_os::i18n::msg::widgets_tracks_boost_dialog(), + plx_os::i18n::msg::widgets_tracks_normalize_loudness(), ] { let lower = value.to_lowercase(); assert!(!lower.contains("plex pass"), "{language:?}: {value:?} names the gate"); @@ -4470,7 +4470,7 @@ mod enhancement_menu_tests { /// never heard the word "remux" and should not need to. #[test] fn enh_notes_and_reasons_never_use_jargon() { - use plx_platform::i18n::{language_on_this_thread_for_test}; + use plx_os::i18n::{language_on_this_thread_for_test}; const BANNED: &[&str] = &[ "remux", "transcode", @@ -4482,21 +4482,21 @@ mod enhancement_menu_tests { "base layer", "hdr10", ]; - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _guard = language_on_this_thread_for_test(language); for (name, value) in [ - ("enh_note_sidecar", plx_platform::i18n::msg::widgets_tracks_enh_note_sidecar()), - ("enh_note_burn", plx_platform::i18n::msg::widgets_tracks_enh_note_burn()), - ("enh_reason_not_analyzed", plx_platform::i18n::msg::widgets_tracks_enh_reason_not_analyzed()), - ("enh_reason_dv_unusable", plx_platform::i18n::msg::widgets_tracks_enh_reason_dv_unusable()), - ("enh_reason_dv_subtitle", plx_platform::i18n::msg::widgets_tracks_enh_reason_dv_subtitle()), - ("enh_reason_quality", plx_platform::i18n::msg::widgets_tracks_enh_reason_quality()), - ("enh_reason_converting", plx_platform::i18n::msg::widgets_tracks_enh_reason_converting()), - ("enh_reason_forced", plx_platform::i18n::msg::widgets_tracks_enh_reason_forced()), - ("enh_reason_not_copyable", plx_platform::i18n::msg::widgets_tracks_enh_reason_not_copyable()), - ("enh_reason_refused", plx_platform::i18n::msg::widgets_tracks_enh_reason_refused()), - ("sub_burn_audio", plx_platform::i18n::msg::widgets_tracks_sub_burn_audio()), - ("sub_burn_quality", plx_platform::i18n::msg::widgets_tracks_sub_burn_quality()), + ("enh_note_sidecar", plx_os::i18n::msg::widgets_tracks_enh_note_sidecar()), + ("enh_note_burn", plx_os::i18n::msg::widgets_tracks_enh_note_burn()), + ("enh_reason_not_analyzed", plx_os::i18n::msg::widgets_tracks_enh_reason_not_analyzed()), + ("enh_reason_dv_unusable", plx_os::i18n::msg::widgets_tracks_enh_reason_dv_unusable()), + ("enh_reason_dv_subtitle", plx_os::i18n::msg::widgets_tracks_enh_reason_dv_subtitle()), + ("enh_reason_quality", plx_os::i18n::msg::widgets_tracks_enh_reason_quality()), + ("enh_reason_converting", plx_os::i18n::msg::widgets_tracks_enh_reason_converting()), + ("enh_reason_forced", plx_os::i18n::msg::widgets_tracks_enh_reason_forced()), + ("enh_reason_not_copyable", plx_os::i18n::msg::widgets_tracks_enh_reason_not_copyable()), + ("enh_reason_refused", plx_os::i18n::msg::widgets_tracks_enh_reason_refused()), + ("sub_burn_audio", plx_os::i18n::msg::widgets_tracks_sub_burn_audio()), + ("sub_burn_quality", plx_os::i18n::msg::widgets_tracks_sub_burn_quality()), ] { let lower = value.to_lowercase(); for word in BANNED { @@ -4521,7 +4521,7 @@ mod enhancement_menu_tests { /// string back; do not assume either phrase's width from the source text alone. #[test] fn enh_rows_fit_menu_cap_es_be() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let mut out = Vec::new(); for language in SHIPPED { let _g = plx_base::testlock::serial(); @@ -4573,9 +4573,9 @@ mod enhancement_menu_tests { assert_eq!(audio_sub_line_for("DTS 7.1".into(), false, true), "DTS 7.1 \u{b7} played in stereo"); assert_eq!(audio_sub_line_for("DTS 7.1".into(), false, false), "DTS 7.1"); let dts = |channels| metadata::Stream { codec: "dca".into(), channels, sampling_rate: 48_000, ..Default::default() }; - let measured = std::sync::Arc::new(plx_platform::devcaps::Caps { - app_lossy: plx_platform::devcaps::AppLossy::Measured, - ..plx_platform::devcaps::Caps::assumed() + let measured = std::sync::Arc::new(plx_os::devcaps::Caps { + app_lossy: plx_os::devcaps::AppLossy::Measured, + ..plx_os::devcaps::Caps::assumed() }); let mut ps = plx_media::route::PlaybackSession::IDLE; plx_media::route::begin_attempt_for_test(&mut ps, measured.clone()); @@ -4593,7 +4593,7 @@ mod enhancement_menu_tests { assert_eq!(audio_sub_line(&ps, "DTS 5.1".into(), &dts(6)), "DTS 5.1", "Forced on a measured set: the refusal, no mark"); let truehd = metadata::Stream { codec: "truehd".into(), channels: 8, sampling_rate: 48_000, ..Default::default() }; assert_eq!(audio_sub_line(&ps, "Dolby TrueHD 7.1".into(), &truehd), "Dolby TrueHD 7.1", "unmeasured: not decoded here"); - let native = std::sync::Arc::new(plx_platform::devcaps::Caps { + let native = std::sync::Arc::new(plx_os::devcaps::Caps { audio: "aac,ac3,eac3,dts".into(), audio_channels: [("dts".into(), 6)].into(), ..(*measured).clone() @@ -4607,7 +4607,7 @@ mod enhancement_menu_tests { /// (`Dolby Digital Plus 7.1`, `Dolby TrueHD 7.1`). #[test] fn converted_audio_sub_lines_fit_the_panel_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let mut out = Vec::new(); for language in SHIPPED { let _g = plx_base::testlock::serial(); @@ -4623,9 +4623,9 @@ mod enhancement_menu_tests { // The same track menu once the recovery's last rung put DTS in force on a measured set: the DTS // 7.1 track is decoded in the app, and its "played in stereo" line is graded the same way. plx_media::route::begin_attempt_for_test(&mut ps, std::sync::Arc::new( - plx_platform::devcaps::Caps { - app_lossy: plx_platform::devcaps::AppLossy::Measured, - ..plx_platform::devcaps::Caps::assumed() + plx_os::devcaps::Caps { + app_lossy: plx_os::devcaps::AppLossy::Measured, + ..plx_os::devcaps::Caps::assumed() } .with_app_lossy_for("dts"), )); @@ -4678,7 +4678,7 @@ mod enhancement_menu_tests { let note_i = style_i + 1; assert_eq!(menu.form.id_at(note_i), None, "a note is an inert slot with no id"); - assert_eq!(rows[note_i].label, plx_platform::i18n::msg::widgets_tracks_sub_burn_audio()); + assert_eq!(rows[note_i].label, plx_os::i18n::msg::widgets_tracks_sub_burn_audio()); assert!(rows[note_i].sep, "a note row is non-selectable"); // The track rows themselves stay live: Off, and the embedded subtitle, neither dim. @@ -4720,7 +4720,7 @@ mod enhancement_menu_tests { for (route, reason) in [ ( EnhTestFixture { remux: Some(true), subtitle_effect: plx_media::route::SubtitleEffect::Embedded, ..Default::default() }, - plx_platform::i18n::msg::widgets_tracks_sub_burn_audio(), + plx_os::i18n::msg::widgets_tracks_sub_burn_audio(), ), ( EnhTestFixture { @@ -4729,7 +4729,7 @@ mod enhancement_menu_tests { subtitle_effect: plx_media::route::SubtitleEffect::Embedded, ..Default::default() }, - plx_platform::i18n::msg::widgets_tracks_sub_burn_quality(), + plx_os::i18n::msg::widgets_tracks_sub_burn_quality(), ), ] { let (mut menu, ps) = subtitles_tab(route); @@ -4917,9 +4917,9 @@ mod enhancement_menu_tests { /// `enh_rows_fit_menu_cap_es_be` over the Audio panel. #[test] fn subtitles_locked_note_fits_menu_cap_es_be() { - use plx_platform::i18n::{language_on_this_thread_for_test}; + use plx_os::i18n::{language_on_this_thread_for_test}; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(language); // the audio-conversion reason (a remux) and the quality reason, as well as the own burn @@ -4965,7 +4965,7 @@ mod enhancement_menu_tests { let (menu, ps) = subtitles_tab(EnhTestFixture { remux: Some(true), memory_note: true, ..Default::default() }); - assert_eq!(notes(&menu), vec![plx_platform::i18n::msg::widgets_tracks_sub_remembered_note()]); + assert_eq!(notes(&menu), vec![plx_os::i18n::msg::widgets_tracks_sub_remembered_note()]); let rows = flat_rows(&menu); let note_i = rows.iter().position(|r| r.is_note()).expect("the note row"); assert_eq!(menu.form.id_at(note_i), None, "a note is an inert slot with no id"); @@ -4990,7 +4990,7 @@ mod enhancement_menu_tests { let (with, _sid) = enhancement_test_session(EnhTestFixture { remux: Some(true), memory_note: true, ..Default::default() }); menu.update(0.016, &plx_ui::fixture::FixtureMeasure, &with, store.view()); - assert_eq!(notes(&menu), vec![plx_platform::i18n::msg::widgets_tracks_sub_remembered_note()]); + assert_eq!(notes(&menu), vec![plx_os::i18n::msg::widgets_tracks_sub_remembered_note()]); let (without, _sid) = enhancement_test_session(EnhTestFixture { remux: Some(true), ..Default::default() }); menu.update(0.016, &plx_ui::fixture::FixtureMeasure, &without, store.view()); @@ -5060,7 +5060,7 @@ mod enhancement_menu_tests { let (mut menu, mut ps) = subtitles_tab(EnhTestFixture { remux: Some(true), memory_note: true, ..Default::default() }); let store = super::tests::store_with(vec![super::tests::stream(999, 0, "English", "eng", "")]); - let note = vec![plx_platform::i18n::msg::widgets_tracks_sub_remembered_note()]; + let note = vec![plx_os::i18n::msg::widgets_tracks_sub_remembered_note()]; assert_eq!(notes(&menu), note, "setup: the note is up"); plx_media::route::commit_subtitle_pick(&mut ps, -1, 0, false, None); @@ -5079,14 +5079,14 @@ mod enhancement_menu_tests { /// shared menu cap and at the hugged width, with the real font measure. #[test] fn the_remembered_note_fits_the_subtitles_panel_in_every_shipped_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let mut out = Vec::new(); for language in SHIPPED { let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(language); let (menu, ps) = subtitles_tab(EnhTestFixture { remux: Some(true), memory_note: true, ..Default::default() }); - assert_eq!(notes(&menu), vec![plx_platform::i18n::msg::widgets_tracks_sub_remembered_note()], "{language:?}"); + assert_eq!(notes(&menu), vec![plx_os::i18n::msg::widgets_tracks_sub_remembered_note()], "{language:?}"); out.extend(menu.form.table.menu_cap_failure(&plx_base::fontcov::advances::ShippedMeasure, language.tag())); out.extend(menu.form.table.app_fit_failures(plx_ui::table::MENU_MAX_W, language.tag())); out.extend(menu.form.table.app_fit_failures_hugged(language.tag())); @@ -5099,10 +5099,10 @@ mod enhancement_menu_tests { /// viewer should not have to learn. #[test] fn the_remembered_note_never_uses_jargon() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; for language in SHIPPED { let _guard = language_on_this_thread_for_test(language); - let note = plx_platform::i18n::msg::widgets_tracks_sub_remembered_note().to_lowercase(); + let note = plx_os::i18n::msg::widgets_tracks_sub_remembered_note().to_lowercase(); for word in ["remux", "transcode", "burn", "re-encode", "reencode", "sidecar"] { assert!(!note.contains(word), "{language:?}: {note:?} uses the banned engineering term {word:?}"); } @@ -5116,7 +5116,7 @@ mod enhancement_menu_tests { use plx_machine::machine::Measure; use plx_base::fontcov::advances::ShippedMeasure; use plx_ui::fit::HEADROOM; - use plx_platform::i18n::{language_on_this_thread_for_test, Preference}; + use plx_os::i18n::{language_on_this_thread_for_test, Preference}; let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(Preference::Es); let (menu, ps) = subtitles_tab(EnhTestFixture { @@ -5125,7 +5125,7 @@ mod enhancement_menu_tests { applied_burn: true, ..Default::default() }); - let note = plx_platform::i18n::msg::widgets_tracks_sub_burn_audio(); + let note = plx_os::i18n::msg::widgets_tracks_sub_burn_audio(); let line = ShippedMeasure.width_str(¬e, plx_ui::theme::size::CAPTION, false); let before = menu.form.table.measured_height(); let pw = menu.form.table.menu_panel_width(&ShippedMeasure); @@ -5492,7 +5492,7 @@ mod forced_only_tests { open(SubMode::ForcedOnly, SubtitleEffect::None, vec![audio(10, "", "")], subs); assert_eq!( row_of(&menu, TrackRow::SubForcedOnly).value.as_deref(), - Some(plx_platform::i18n::msg::widgets_tracks_unknown()), + Some(plx_os::i18n::msg::widgets_tracks_unknown()), "control: no fallback, nothing to name" ); teardown(&ps); @@ -5562,7 +5562,7 @@ mod forced_only_tests { /// and hugged. #[test] fn the_forced_only_row_with_its_readout_fits_the_panel_in_every_shipped_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let mut out = Vec::new(); for language in SHIPPED { for name in ["Portuguese (Brazil)", "Norwegian Bokm\u{e5}l", "Serbo-Croatian", "Scottish Gaelic", "Tagalog"] { @@ -5572,7 +5572,7 @@ mod forced_only_tests { let (menu, ps, _store) = open(SubMode::ForcedOnly, SubtitleEffect::Embedded, vec![audio(10, name, "xxx")], subs); let row = row_of(&menu, TrackRow::SubForcedOnly); - assert_eq!(row.label, plx_platform::i18n::msg::widgets_tracks_forced_only(), "{language:?}"); + assert_eq!(row.label, plx_os::i18n::msg::widgets_tracks_forced_only(), "{language:?}"); assert!(row.value.as_deref().is_some_and(|v| !v.is_empty() && v.chars().count() <= 11), "{language:?} {name}"); out.extend(menu.form.table.menu_cap_failure(&plx_base::fontcov::advances::ShippedMeasure, language.tag())); out.extend(menu.form.table.app_fit_failures(plx_ui::table::MENU_MAX_W, language.tag())); @@ -5588,7 +5588,7 @@ mod forced_only_tests { /// which the Belarusian review (skarnik.by, verbum.by) covered once. #[test] fn the_forced_only_words_are_in_every_catalogue_and_match_the_settings_value() { - use plx_platform::i18n::{language_on_this_thread_for_test, msg, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, msg, SHIPPED}; for language in SHIPPED { let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(language); @@ -5899,7 +5899,7 @@ mod focus_tests { mod localized_offset_tests { #[test] fn subtitle_timing_uses_locale_decimal_and_unit_without_changing_offset_sign() { - use plx_platform::i18n::{LocaleContext, Preference}; + use plx_os::i18n::{LocaleContext, Preference}; for (preference, region, negative, positive) in [ (Preference::En, "en-US", "-0.1 s", "+1.3 s"), (Preference::Es, "es-ES", "-0,1 s", "+1,3 s"), @@ -6233,8 +6233,8 @@ mod style_page_tests { let _g = plx_base::testlock::serial(); for (codec, renderer, note) in [ ("srt", SubRenderer::Text, None), - ("pgs", SubRenderer::Image, Some(plx_platform::i18n::msg::widgets_tracks_style_image_note())), - ("ass", SubRenderer::Styled, Some(plx_platform::i18n::msg::widgets_tracks_style_styled_note())), + ("pgs", SubRenderer::Image, Some(plx_os::i18n::msg::widgets_tracks_style_image_note())), + ("ass", SubRenderer::Styled, Some(plx_os::i18n::msg::widgets_tracks_style_styled_note())), ] { let (mut menu, ps, store) = open_with(codec, SubtitleEffect::Sidecar); assert_eq!(menu.renderer, renderer, "{codec}"); @@ -6296,7 +6296,7 @@ mod style_page_tests { /// of the session. #[test] fn a_color_the_active_subtitle_cannot_take_is_dimmed_with_its_reason_and_the_stored_pick_stays() { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; let _g = plx_base::testlock::serial(); let cases: [(&str, Option, bool, Option<&str>); 4] = [ ("srt", None, true, None), @@ -6438,9 +6438,9 @@ mod style_page_tests { /// notes), and each picker page, judged by the same gates as the rest of the menu. #[test] fn every_style_page_fits_the_panel_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test}; + use plx_os::i18n::{language_on_this_thread_for_test}; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(language); for codec in ["srt", "pgs", "ass"] { @@ -6469,9 +6469,9 @@ mod style_page_tests { /// note wrapped to three lines in a sliver. #[test] fn the_style_note_fits_two_lines_at_the_player_menu_floor() { - use plx_platform::i18n::{language_on_this_thread_for_test, Preference}; + use plx_os::i18n::{language_on_this_thread_for_test, Preference}; let measure = plx_base::fontcov::advances::ShippedMeasure; - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(language); // the picture note, the styled note (white follows the pick) and the styled-with-no-white note, @@ -7025,9 +7025,9 @@ mod language_page_tests { /// judged by the same gates as the rest of the menu. #[test] fn the_language_pages_fit_the_panel_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test}; + use plx_os::i18n::{language_on_this_thread_for_test}; let mut out = Vec::new(); - for language in plx_platform::i18n::SHIPPED { + for language in plx_os::i18n::SHIPPED { let _g = plx_base::testlock::serial(); let _guard = language_on_this_thread_for_test(language); let (mut menu, ps, store) = open(subs_with_vobsub()); @@ -7564,7 +7564,7 @@ mod motion_tests { let row = menu.form.table.sections.iter().flat_map(|s| &s.rows).nth(i).unwrap(); row.value.clone().unwrap_or_default() }; - assert_eq!(value_of(&menu, row_a), plx_platform::i18n::msg::widgets_tracks_search_added()); + assert_eq!(value_of(&menu, row_a), plx_os::i18n::msg::widgets_tracks_search_added()); assert_eq!(value_of(&menu, row_b), "", "a hit the item lacks is not marked"); menu.focus_key(row_a.key().0); assert_eq!(menu.on_ok(store.view()), TrackOk::Inert); diff --git a/rust-modules/appkit/src/up_next.rs b/rust-modules/appkit/src/up_next.rs index 9e61e36b7a..f39c9ea699 100644 --- a/rust-modules/appkit/src/up_next.rs +++ b/rust-modules/appkit/src/up_next.rs @@ -296,7 +296,7 @@ fn caption(u: &UpNext) -> String { } else { u.ep_title.clone() }; - plx_platform::i18n::msg::widgets_next_caption(&episode) + plx_os::i18n::msg::widgets_next_caption(&episode) } /// Which of the offer's two pieces of decor a package draws (`up_next.still`, `up_next.caption`). The @@ -403,7 +403,7 @@ fn draw_buttons(l: &Layout, look: Look, row: &crate::player_hud::motion::HudMoti let e = Env::inert(); // The focus pop is the CONTROL ROW's, not this card's: these two stand in the transport's own // slot and share its cursor, so they share its springs (`HudMotion::scale`). - let credits = Button::new(plx_platform::i18n::msg::widgets_next_credits_c().as_ptr(), theme::size::BODY, l.credits) + let credits = Button::new(plx_os::i18n::msg::widgets_next_credits_c().as_ptr(), theme::size::BODY, l.credits) .focused(focused && btn == BTN_CREDITS) // Both buttons on this card stand on LIVE CREDITS — the video plane, under this card's own // scrim — so both take the unkeyed ground (`ControlGround`). It is what the app's @@ -418,8 +418,8 @@ fn draw_buttons(l: &Layout, look: Look, row: &crate::player_hud::motion::HudMoti // with its numeric countdown. The compiler reserves the widest numeric label before drawing, // so neither the button nor its neighbouring controls resize as the seconds change. let label = if let Some(left) = timer.remaining_ms.filter(|_| look.countdown == CountdownFace::Numeric) { - plx_platform::i18n::msg::player_up_next_seconds_left(i64::from(left.div_ceil(1000))) - } else { plx_platform::i18n::msg::widgets_next_episode().to_owned() }; + plx_os::i18n::msg::player_up_next_seconds_left(i64::from(left.div_ceil(1000))) + } else { plx_os::i18n::msg::widgets_next_episode().to_owned() }; let Ok(label) = CString::new(label) else { return false; }; @@ -460,7 +460,7 @@ mod tests { #[test] fn up_next_presentation_distinguishes_every_declared_countdown() { let _serial = plx_base::testlock::serial(); - let _en = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); let row = crate::player_hud::motion::HudMotion::new(); let up = Countdown { deadline: 11_000, ..Countdown::default() }; let l = Layout { still: Rect::default(), caption: Rect::default(), credits: Rect::new(100.0, 800.0, 200.0, 64.0), next: Rect::new(316.0, 800.0, 420.0, 64.0) }; @@ -479,7 +479,7 @@ mod tests { let numeric = paint(CountdownFace::Numeric); assert_ne!(ring.0, fill.0, "ring must not draw the fill-sweep path"); assert_ne!(bar.0, fill.0, "bar must not draw the fill-sweep path"); - let expected = plx_platform::i18n::msg::player_up_next_seconds_left(i64::from(up.remaining_ms(now).div_ceil(1000))); + let expected = plx_os::i18n::msg::player_up_next_seconds_left(i64::from(up.remaining_ms(now).div_ceil(1000))); assert!(numeric.1.iter().any(|r| r.text == expected), "numeric countdown must paint its measured localized remaining seconds"); } diff --git a/rust-modules/appkit/src/version_list.rs b/rust-modules/appkit/src/version_list.rs index f6efb3fea4..daf7842b00 100644 --- a/rust-modules/appkit/src/version_list.rs +++ b/rust-modules/appkit/src/version_list.rs @@ -11,7 +11,7 @@ use plx_ui::table::Row; /// The list's heading: "Play Version". pub fn title() -> &'static str { - plx_platform::i18n::msg::browse_menu_play_version_title() + plx_os::i18n::msg::browse_menu_play_version_title() } /// **The list as one section**, in the server's order: row `n` is `versions[n]`, identified by @@ -43,8 +43,8 @@ pub fn labels(versions: &[MediaVersion]) -> Vec<(String, String)> { let audio = |v: &MediaVersion| { let codec = plx_data::metadata::friendly_codec(&v.acodec); let channels = match v.channels { - 1 => plx_platform::i18n::msg::widgets_tracks_mono().to_string(), - 2 => plx_platform::i18n::msg::widgets_tracks_stereo().to_string(), + 1 => plx_os::i18n::msg::widgets_tracks_mono().to_string(), + 2 => plx_os::i18n::msg::widgets_tracks_stereo().to_string(), 6 => "5.1".to_string(), 8 => "7.1".to_string(), _ => String::new(), @@ -115,7 +115,7 @@ mod tests { /// (here the video codec and HDR, and the size), never a fact they share (audio, container). #[test] fn a_version_row_says_what_differs() { - let _g = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _g = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); let rows = labels(&sample()); assert_eq!(rows[0].0, "25.2 Mbps \u{b7} 4K"); assert_eq!(rows[1].0, "10.9 Mbps \u{b7} 1080p"); @@ -128,7 +128,7 @@ mod tests { /// The list fits a menu panel in every shipped language, measured with the device's advances. #[test] fn the_list_fits_in_every_language() { - use plx_platform::i18n::{language_on_this_thread_for_test, SHIPPED}; + use plx_os::i18n::{language_on_this_thread_for_test, SHIPPED}; let measure = plx_base::fontcov::advances::ShippedMeasure; let mut out = Vec::new(); for language in SHIPPED { diff --git a/rust-modules/base/src/eventlog/scrub.rs b/rust-modules/base/src/eventlog/scrub.rs index 3c6058da4c..e7e4ad631e 100644 --- a/rust-modules/base/src/eventlog/scrub.rs +++ b/rust-modules/base/src/eventlog/scrub.rs @@ -1076,9 +1076,9 @@ mod tests { // (`rust-modules/src`, where nearly every log call lives). Resolved from the manifest dir // so it is independent of the working directory the test runner happens to have. A layer // crate split out of `rust-modules/src` later must be added here, or its log calls stop - // being read (`../machine/src`, `../net/src`, `../platform/src`, `../gfx/src`, `../ui/src`, `../plex/src`, `../telemetry/src`, `../data/src` and `../session/src` are the machine, net, platform, gfx, ui, plex, telemetry, data and session layers'). + // being read (`../machine/src`, `../net/src`, `../os/src`, `../gfx/src`, `../ui/src`, `../plex/src`, `../telemetry/src`, `../data/src` and `../session/src` are the machine, net, os, gfx, ui, plex, telemetry, data and session layers'). let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); - let roots = [manifest.join("src"), manifest.join("../src"), manifest.join("../machine/src"), manifest.join("../net/src"), manifest.join("../platform/src"), manifest.join("../gfx/src"), manifest.join("../ui/src"), manifest.join("../plex/src"), manifest.join("../telemetry/src"), manifest.join("../data/src"), manifest.join("../session/src"), manifest.join("../media/src"), manifest.join("../appkit/src"), manifest.join("../screens/src")]; + let roots = [manifest.join("src"), manifest.join("../src"), manifest.join("../machine/src"), manifest.join("../net/src"), manifest.join("../os/src"), manifest.join("../gfx/src"), manifest.join("../ui/src"), manifest.join("../plex/src"), manifest.join("../telemetry/src"), manifest.join("../data/src"), manifest.join("../session/src"), manifest.join("../media/src"), manifest.join("../appkit/src"), manifest.join("../screens/src")]; let mut offences: Vec = Vec::new(); let mut files = 0usize; for src in &roots { diff --git a/rust-modules/build.rs b/rust-modules/build.rs index 8fed4ee3a3..683d653c88 100644 --- a/rust-modules/build.rs +++ b/rust-modules/build.rs @@ -1,7 +1,7 @@ //! The version string every build reports, and link configuration for everything cargo itself LINKS //! on the developer's own machine — the host UI simulator, and the host TEST BINARY. (The install -//! identities and the localization catalog are generated by the platform layer's own build script, -//! `platform/build.rs`.) +//! identities and the localization catalog are generated by the os layer's own build script, +//! `os/build.rs`.) //! //! Version generation runs for EVERY build. Host link configuration is a **no-op for the build //! that ships**: the television binary is linked by the Makefile, not by cargo (the ARM archive is a diff --git a/rust-modules/build_support/install_identities.rs b/rust-modules/build_support/install_identities.rs index 3205bac85f..f76da2eb25 100644 --- a/rust-modules/build_support/install_identities.rs +++ b/rust-modules/build_support/install_identities.rs @@ -1,6 +1,6 @@ //! Install-identity code generation, shared by the two build scripts that need it. //! -//! `platform/src/storage/state.rs` is compiled into BOTH the `plx_platform` library and the +//! `os/src/storage/state.rs` is compiled into BOTH the `plx_os` library and the //! `plxnative-storage` helper (the helper is its own workspace package and does not depend on the //! application crates), and it //! `include!`s the `Flavor` enum generated here from `ci/install-identities.json`. Each package's diff --git a/rust-modules/data/Cargo.toml b/rust-modules/data/Cargo.toml index 054f78e163..ec28e27d46 100644 --- a/rust-modules/data/Cargo.toml +++ b/rust-modules/data/Cargo.toml @@ -19,19 +19,19 @@ default = [] # Forwarded from the application crate, which is the only one that sets them. Each is named here # only because some code in this crate has a `cfg` on it (the dev-trigger stand-ins of `metadata` # and `person`, the simulator's detail source). -devtriggers = ["plx_base/devtriggers", "plx_machine/devtriggers", "plx_platform/devtriggers", "plx_plex/devtriggers", "plx_telemetry/devtriggers"] -hostsim = ["plx_base/hostsim", "plx_machine/hostsim", "plx_platform/hostsim", "plx_plex/hostsim", "plx_telemetry/hostsim"] +devtriggers = ["plx_base/devtriggers", "plx_machine/devtriggers", "plx_os/devtriggers", "plx_plex/devtriggers", "plx_telemetry/devtriggers"] +hostsim = ["plx_base/hostsim", "plx_machine/hostsim", "plx_os/hostsim", "plx_plex/hostsim", "plx_telemetry/hostsim"] # The `cfg(test)` seams other crates' tests use (`pms::seed_for_test`, `metadata::set_current_for_test`, # `browse::view::*::fixture`, the stores' `*_for_test` drivers, ...) plus the test-mode arms # `cfg(test)` alone cannot give a dependent. Enabled from the dependents' `[dev-dependencies]`; # never in a shipped build. -test-support = ["plx_base/test-support", "plx_machine/test-support", "plx_platform/test-support", "plx_plex/test-support", "plx_telemetry/test-support"] +test-support = ["plx_base/test-support", "plx_machine/test-support", "plx_os/test-support", "plx_plex/test-support", "plx_telemetry/test-support"] [dependencies] plx_playback_contract = { path = "../playback-contract" } plx_base = { path = "../base" } plx_machine = { path = "../machine" } -plx_platform = { path = "../platform" } +plx_os = { path = "../os" } plx_plex = { path = "../plex" } plx_telemetry = { path = "../telemetry" } # `rc`: Home cards are `Arc`, which the derived (de)serializers must be able to carry. @@ -49,7 +49,7 @@ ed25519-compact = { version = "=2.6.1", default-features = false, features = ["o [dev-dependencies] plx_base = { path = "../base", features = ["test-support"] } plx_machine = { path = "../machine", features = ["test-support"] } -plx_platform = { path = "../platform", features = ["test-support"] } +plx_os = { path = "../os", features = ["test-support"] } plx_net = { path = "../net", features = ["test-support"] } # THE RULE for a layer crate whose own tests need the development feature set (the same in every # crate that has it): the crate dev-depends on ITSELF with `devtriggers`, so `cargo test -p plx_data` diff --git a/rust-modules/data/src/browse/bands.rs b/rust-modules/data/src/browse/bands.rs index 15da361c66..a32e9dd674 100644 --- a/rust-modules/data/src/browse/bands.rs +++ b/rust-modules/data/src/browse/bands.rs @@ -88,7 +88,7 @@ pub enum Basis { } /// The viewer's time zone as the two reads of the OS a calendar family needs, handed to a bands job -/// by the application's runner as plain functions (`plx_platform::i18n::local_midnight` and +/// by the application's runner as plain functions (`plx_os::i18n::local_midnight` and /// `local_calendar_date`): the model and the job body read no zone and no clock themselves, and a test /// passes a fake. A civil date to its first moment (asked once per [`Basis::Local`] edge, daylight /// saving being per date), and an instant to the civil date it falls on; `None` from either where the diff --git a/rust-modules/data/src/browse/library_type_tests.rs b/rust-modules/data/src/browse/library_type_tests.rs index c6eddaf228..4ca8c4e1b1 100644 --- a/rust-modules/data/src/browse/library_type_tests.rs +++ b/rust-modules/data/src/browse/library_type_tests.rs @@ -25,7 +25,7 @@ mod tests { /// so a screen cannot count the same library in two words. #[test] fn a_count_wears_the_noun_of_what_the_listing_holds() { - let _g = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _g = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); for (ty, kind, n, want) in [ (LibraryType::Primary, SecKind::Movie, 185, "185 films"), (LibraryType::Primary, SecKind::Movie, 1, "1 film"), diff --git a/rust-modules/data/src/browse/listing_jobs.rs b/rust-modules/data/src/browse/listing_jobs.rs index 98f0f05ab3..280ee2a06f 100644 --- a/rust-modules/data/src/browse/listing_jobs.rs +++ b/rust-modules/data/src/browse/listing_jobs.rs @@ -196,7 +196,7 @@ impl BrowseDirectoryReq { /// The request's IO body and its completion: read the directory through `client` and post the /// answer to `port`. The answer is posted OUTSIDE the guard, so a read that panics lands like one that /// failed (`ok: false`), never as the empty list of a read that found nothing. `zone` is the viewer's -/// time zone, which only the application's runner can read (`plx_platform::i18n`): a bands read of a +/// time zone, which only the application's runner can read (`plx_os::i18n`): a bands read of a /// calendar family converts its edges with it, and nothing else uses it. pub fn finish_browse_directory_job(port: &BrowseDirectoryPort, addr: Addr, client: &'static Client, req: BrowseDirectoryReq, zone: Zone) { diff --git a/rust-modules/data/src/browse/mod.rs b/rust-modules/data/src/browse/mod.rs index 8443ce88d6..615550c6e6 100644 --- a/rust-modules/data/src/browse/mod.rs +++ b/rust-modules/data/src/browse/mod.rs @@ -375,7 +375,7 @@ impl LibraryType { } pub fn title(self, kind: SecKind) -> &'static str { - self.title_in(kind, plx_platform::i18n::current()) + self.title_in(kind, plx_os::i18n::current()) } /// `n` of what this listing holds, in the same words every other count of it wears: "185 @@ -383,7 +383,7 @@ impl LibraryType { /// source of the noun beside a number, shared by the Sources list's "185 films" line and the /// Library header's "37 of 120 films" read-out, so a count never changes its noun by screen. pub fn count_label(self, kind: SecKind, n: i64) -> String { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match (self, kind) { (Self::Primary, SecKind::Movie) => msg::browse_person_films(n), (Self::Primary, SecKind::Show) => msg::browse_person_shows(n), @@ -393,13 +393,13 @@ impl LibraryType { } } - fn title_in(self, kind: SecKind, locale: &plx_platform::i18n::LocaleContext) -> &'static str { + fn title_in(self, kind: SecKind, locale: &plx_os::i18n::LocaleContext) -> &'static str { match (self, kind) { - (Self::Primary, SecKind::Movie) => plx_platform::i18n::msg::browse_kind_movies_in(locale), - (Self::Primary, SecKind::Show) => plx_platform::i18n::msg::browse_kind_tv_shows_in(locale), - (Self::Seasons, _) => plx_platform::i18n::msg::browse_kind_seasons_in(locale), - (Self::Episodes, _) => plx_platform::i18n::msg::browse_kind_episodes_in(locale), - (Self::Collections, _) => plx_platform::i18n::msg::browse_kind_collections_in(locale), + (Self::Primary, SecKind::Movie) => plx_os::i18n::msg::browse_kind_movies_in(locale), + (Self::Primary, SecKind::Show) => plx_os::i18n::msg::browse_kind_tv_shows_in(locale), + (Self::Seasons, _) => plx_os::i18n::msg::browse_kind_seasons_in(locale), + (Self::Episodes, _) => plx_os::i18n::msg::browse_kind_episodes_in(locale), + (Self::Collections, _) => plx_os::i18n::msg::browse_kind_collections_in(locale), } } @@ -408,11 +408,11 @@ impl LibraryType { /// order differ by language. pub fn empty_readout(self, kind: SecKind, library: &str) -> String { match (self, kind) { - (Self::Primary, SecKind::Movie) => plx_platform::i18n::msg::browse_library_no_movies(library), - (Self::Primary, SecKind::Show) => plx_platform::i18n::msg::browse_library_no_shows(library), - (Self::Seasons, _) => plx_platform::i18n::msg::browse_library_no_seasons(library), - (Self::Episodes, _) => plx_platform::i18n::msg::browse_library_no_episodes(library), - (Self::Collections, _) => plx_platform::i18n::msg::browse_library_no_collections(library), + (Self::Primary, SecKind::Movie) => plx_os::i18n::msg::browse_library_no_movies(library), + (Self::Primary, SecKind::Show) => plx_os::i18n::msg::browse_library_no_shows(library), + (Self::Seasons, _) => plx_os::i18n::msg::browse_library_no_seasons(library), + (Self::Episodes, _) => plx_os::i18n::msg::browse_library_no_episodes(library), + (Self::Collections, _) => plx_os::i18n::msg::browse_library_no_collections(library), } } @@ -3741,8 +3741,8 @@ impl SecKind { /// The same thing as a standalone label ("Films"), for a row whose count has not landed yet. pub fn plural(self) -> &'static str { match self { - SecKind::Movie => plx_platform::i18n::msg::browse_kind_films(), - SecKind::Show => plx_platform::i18n::msg::browse_kind_tv_shows_sentence(), + SecKind::Movie => plx_os::i18n::msg::browse_kind_films(), + SecKind::Show => plx_os::i18n::msg::browse_kind_tv_shows_sentence(), } } } @@ -3780,7 +3780,7 @@ fn kind_offers_plays_sort(kind: SecKind) -> bool { /// feature exists for. fn with_plays_sort(mut sorts: Vec, kind: SecKind) -> Vec { if kind_offers_plays_sort(kind) && !sorts.iter().any(|sort| sort.key == PLAYS_SORT_KEY) { - sorts.push(plays_sort_entry(plx_platform::i18n::msg::browse_library_plays().into())); + sorts.push(plays_sort_entry(plx_os::i18n::msg::browse_library_plays().into())); } sorts } @@ -4583,7 +4583,7 @@ mod localized_type_tests { #[test] fn library_type_titles_translate_without_changing_the_pms_query_type() { - use plx_platform::i18n::{LocaleContext, Preference}; + use plx_os::i18n::{LocaleContext, Preference}; for (preference, expected) in [ (Preference::En, ["Movies", "Collections", "TV Shows", "Seasons", "Episodes", "Collections"]), (Preference::Es, ["Películas", "Colecciones", "Series", "Temporadas", "Episodios", "Colecciones"]), diff --git a/rust-modules/data/src/browse/section_hubs.rs b/rust-modules/data/src/browse/section_hubs.rs index f4d6df08bd..27ecf78d26 100644 --- a/rust-modules/data/src/browse/section_hubs.rs +++ b/rust-modules/data/src/browse/section_hubs.rs @@ -1873,7 +1873,7 @@ mod tests { /// against a plain `hub.title.clone()` before the override was wired in. #[test] fn a_be_ui_localizes_the_section_recently_added_hub_and_leaves_an_unknown_one_alone() { - let _thread_locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::Be); + let _thread_locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::Be); let json = r#"{"MediaContainer":{"Hub":[ {"hubIdentifier":"tv.recentlyadded.1","title":"Recently Added","type":"mixed", "Metadata":[{"ratingKey":"2001","type":"show","title":"Beta","thumb":"/t/2001"}]}, diff --git a/rust-modules/data/src/browse/view.rs b/rust-modules/data/src/browse/view.rs index f9ed5ad32a..7a61e212cc 100644 --- a/rust-modules/data/src/browse/view.rs +++ b/rust-modules/data/src/browse/view.rs @@ -213,7 +213,7 @@ impl ListingSnapshot { sorts: Arc::new(vec![SortEntry { desc_key: String::new(), key: "titleSort".into(), - title: plx_platform::i18n::msg::browse_library_title().into(), + title: plx_os::i18n::msg::browse_library_title().into(), default_desc: false, }]), genres: Arc::new(Vec::new()), @@ -1096,7 +1096,7 @@ mod tests { section.sorts = Arc::new(vec![SortEntry { desc_key: String::new(), key: "titleSort".into(), - title: plx_platform::i18n::msg::browse_library_title().into(), + title: plx_os::i18n::msg::browse_library_title().into(), default_desc: false, }]); section.genres = Arc::new(vec![GenreEntry { diff --git a/rust-modules/data/src/lib.rs b/rust-modules/data/src/lib.rs index 041d3c81a6..c4cbe87db4 100644 --- a/rust-modules/data/src/lib.rs +++ b/rust-modules/data/src/lib.rs @@ -4,7 +4,7 @@ //! machine per data store), `pms` (the Home catalog), `browse` (the per-section library catalog), //! `metadata` (the item detail), `person`, `collection`, `search` and `viewstate` (the view-state //! writes). It is the `data` layer of `ci/module-layers.ini`: it uses `base`, `machine`, -//! `platform`, `net`, `plex` and `telemetry` and nothing above them, so it names no screen, widget +//! `os`, `net`, `plex` and `telemetry` and nothing above them, so it names no screen, widget //! or application type. //! //! `test-support` exposes the seams the layers above drive their tests through diff --git a/rust-modules/data/src/metadata.rs b/rust-modules/data/src/metadata.rs index d8135f639d..b8c2cdaafb 100644 --- a/rust-modules/data/src/metadata.rs +++ b/rust-modules/data/src/metadata.rs @@ -363,11 +363,11 @@ impl CrewRole { } } - fn display(self, locale: &plx_platform::i18n::LocaleContext) -> &'static str { + fn display(self, locale: &plx_os::i18n::LocaleContext) -> &'static str { match self { - Self::Director => plx_platform::i18n::msg::browse_crew_director_in(locale), - Self::Writer => plx_platform::i18n::msg::browse_crew_writer_in(locale), - Self::DirectorWriter => plx_platform::i18n::msg::browse_crew_director_writer_in(locale), + Self::Director => plx_os::i18n::msg::browse_crew_director_in(locale), + Self::Writer => plx_os::i18n::msg::browse_crew_writer_in(locale), + Self::DirectorWriter => plx_os::i18n::msg::browse_crew_director_writer_in(locale), } } } @@ -575,7 +575,7 @@ impl Dovi { /// /// `signal` retains `nodv`'s diagnostic asymmetry: it withholds a Profile-5-style declaration, /// but does not suppress a compatible Profile 8 on a supported set. `capability` must be a - /// definite [`Supported`](plx_platform::devcaps::dv::DvCapability::Supported), and + /// definite [`Supported`](plx_os::devcaps::dv::DvCapability::Supported), and /// `video_carries_dv` ([`dv_video_codec`]) closes the old Profile 9 disagreement where the gate /// declared AVC and the payload's codec guard silently discarded the node. /// @@ -616,7 +616,7 @@ impl Dovi { pub fn presentation( &self, signal: bool, - capability: plx_platform::devcaps::dv::DvCapability, + capability: plx_os::devcaps::dv::DvCapability, video_carries_dv: bool, ) -> DvPresentation { if !self.present { @@ -631,7 +631,7 @@ impl Dovi { // Presence of our node enables libpf's DV path even on a television which cannot display // it. libplayerAPIs' own platform metadata does not protect that seam, so only this app's // affirmative configd result may make the declaration eligible. - let declare = capability == plx_platform::devcaps::dv::DvCapability::Supported + let declare = capability == plx_os::devcaps::dv::DvCapability::Supported && video_carries_dv && (signal || !self.base_layer_unusable()); if !declare || self.profile <= 0 { @@ -703,13 +703,13 @@ pub enum DvPresentation { /// installed decision exactly. #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct DvDecision { - pub capability: plx_platform::devcaps::dv::DvCapability, + pub capability: plx_os::devcaps::dv::DvCapability, pub presentation: DvPresentation, } impl DvDecision { pub const NONE: Self = Self { - capability: plx_platform::devcaps::dv::DvCapability::Unknown, + capability: plx_os::devcaps::dv::DvCapability::Unknown, presentation: DvPresentation::NotDv, }; } @@ -1010,7 +1010,7 @@ impl Extra { /// Human subtype for the extras shelf caption, in the UI language. Unknown subtypes read as /// the generic extra. The match is on PMS's own subtype names, which are never drawn. pub fn caption(&self) -> &'static str { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match self.subtype.as_str() { "trailer" => msg::browse_detail_trailer(), "behindTheScenes" => msg::browse_extra_behind_the_scenes(), @@ -1065,8 +1065,8 @@ impl ExtraContext { /// The HUD's word for this kind, in the UI language. pub fn label(self) -> &'static str { match self { - Self::Trailer => plx_platform::i18n::msg::browse_detail_trailer(), - Self::Extra => plx_platform::i18n::msg::browse_extra_extra(), + Self::Trailer => plx_os::i18n::msg::browse_detail_trailer(), + Self::Extra => plx_os::i18n::msg::browse_extra_extra(), } } } @@ -1898,10 +1898,10 @@ impl Detail { /// Only the crew array owns job identities. An actor whose server-provided character is /// named "Director" must retain that exact character name in every locale. pub fn credit_role(&self, i: usize) -> Option<&str> { - self.credit_role_in(i, plx_platform::i18n::current()) + self.credit_role_in(i, plx_os::i18n::current()) } - fn credit_role_in(&self, i: usize, locale: &plx_platform::i18n::LocaleContext) -> Option<&str> { + fn credit_role_in(&self, i: usize, locale: &plx_os::i18n::LocaleContext) -> Option<&str> { let credit = self.credit(i)?; if i < self.cast.len() { return Some(&credit.role); diff --git a/rust-modules/data/src/metadata/sub_layout.rs b/rust-modules/data/src/metadata/sub_layout.rs index 781a1470ed..8124fa2edb 100644 --- a/rust-modules/data/src/metadata/sub_layout.rs +++ b/rust-modules/data/src/metadata/sub_layout.rs @@ -215,7 +215,7 @@ fn group_of(s: &Stream, i: usize, lang: &str) -> (LangGroup, Option String { if s.lang.trim().is_empty() { - plx_platform::i18n::msg::widgets_tracks_unknown().to_string() + plx_os::i18n::msg::widgets_tracks_unknown().to_string() } else { s.lang.clone() } @@ -236,7 +236,7 @@ fn display_lang(s: &Stream) -> String { pub fn forced_only_readout(drawn: Option<&Stream>, audio: Option<&Stream>) -> String { match drawn.or(audio) { Some(s) => short_language(&display_lang(s)), - None => plx_platform::i18n::msg::widgets_tracks_unknown().to_string(), + None => plx_os::i18n::msg::widgets_tracks_unknown().to_string(), } } @@ -720,13 +720,13 @@ mod tests { let nameless = stream(11, 0, "", "", ""); assert_eq!(forced_only_readout(Some(&drawn), Some(&audio)), "Spanish", "the drawn track wins"); assert_eq!(forced_only_readout(None, Some(&audio)), "English", "nothing drawn: the audio's language"); - assert_eq!(forced_only_readout(None, Some(&nameless)), plx_platform::i18n::msg::widgets_tracks_unknown()); + assert_eq!(forced_only_readout(None, Some(&nameless)), plx_os::i18n::msg::widgets_tracks_unknown()); // a region qualifier is dropped and a long name is cut, so the label beside it stays whole let brazil = stream(3, 2, "Portuguese (Brazil)", "por", ""); assert_eq!(forced_only_readout(Some(&brazil), None), "Portuguese"); let bokmal = stream(4, 3, "Norwegian Bokm\u{e5}l", "nob", ""); assert_eq!(forced_only_readout(Some(&bokmal), None), "Norwegian\u{2026}"); assert_eq!(forced_only_readout(Some(&stream(5, 4, "Tagalog", "tgl", "")), None), "Tagalog", "a short name is untouched"); - assert_eq!(forced_only_readout(None, None), plx_platform::i18n::msg::widgets_tracks_unknown()); + assert_eq!(forced_only_readout(None, None), plx_os::i18n::msg::widgets_tracks_unknown()); } } diff --git a/rust-modules/data/src/metadata/track_label.rs b/rust-modules/data/src/metadata/track_label.rs index a95adb663c..13971eb7ad 100644 --- a/rust-modules/data/src/metadata/track_label.rs +++ b/rust-modules/data/src/metadata/track_label.rs @@ -45,10 +45,10 @@ impl Kind { /// track without a name of its own reads the same way. Catalog text: this is drawn. pub fn fallback_label(self) -> &'static str { match self { - Kind::Full => plx_platform::i18n::msg::widgets_tracks_kind_full(), - Kind::Sdh => plx_platform::i18n::msg::widgets_badge_sdh(), - Kind::Forced => plx_platform::i18n::msg::widgets_tracks_forced(), - Kind::Commentary => plx_platform::i18n::msg::widgets_tracks_kind_commentary(), + Kind::Full => plx_os::i18n::msg::widgets_tracks_kind_full(), + Kind::Sdh => plx_os::i18n::msg::widgets_badge_sdh(), + Kind::Forced => plx_os::i18n::msg::widgets_tracks_forced(), + Kind::Commentary => plx_os::i18n::msg::widgets_tracks_kind_commentary(), } } } @@ -350,7 +350,7 @@ pub fn track_name(pms: &str, container: &str, lang: &str) -> String { /// region this table does not know simply contributes no fallback, exactly as the mock's own /// `try`/`catch` around a `DisplayNames` miss does. const REGIONS: &[(&str, fn() -> &'static str)] = { - use plx_platform::i18n::msg as m; + use plx_os::i18n::msg as m; &[ ("GB", m::widgets_region_gb), ("US", m::widgets_region_us), diff --git a/rust-modules/data/src/metadata_credits_tests.rs b/rust-modules/data/src/metadata_credits_tests.rs index 8ec9f09b47..ebcff17949 100644 --- a/rust-modules/data/src/metadata_credits_tests.rs +++ b/rust-modules/data/src/metadata_credits_tests.rs @@ -119,7 +119,7 @@ fn the_credit_index_space_runs_every_actor_then_every_crew_member() { #[test] fn crew_display_translates_owned_roles_without_changing_identity_or_character_names() { - use plx_platform::i18n::{LocaleContext, Preference}; + use plx_os::i18n::{LocaleContext, Preference}; let person = |name: &str, role: &str| Cast { tag: name.into(), role: role.into(), thumb: String::new(), id: 1, tag_key: String::new(), }; diff --git a/rust-modules/data/src/metadata_dolby_vision_tests.rs b/rust-modules/data/src/metadata_dolby_vision_tests.rs index 3b6dac50a9..9ec7e18780 100644 --- a/rust-modules/data/src/metadata_dolby_vision_tests.rs +++ b/rust-modules/data/src/metadata_dolby_vision_tests.rs @@ -29,11 +29,11 @@ fn a_dolby_vision_record_is_not_erased_by_a_later_video_stream() { // …and, undeclared, must still refuse direct play — the record surviving is what both of // those turn on, so the cover-art stream must not be able to blank it assert_eq!( - dovi.presentation(false, plx_platform::devcaps::dv::DvCapability::Supported, true), + dovi.presentation(false, plx_os::devcaps::dv::DvCapability::Supported, true), crate::metadata::DvPresentation::Refuse("no cross-compatible base layer") ); assert_eq!( - dovi.presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true) + dovi.presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true) .declared() .map(|n| n.profile_id), Some(5) @@ -61,7 +61,7 @@ fn a_part_with_no_dolby_vision_reports_no_record() { fn dv_presentation_reads_are_frame_safe() { prewarm_dv_latches(); let frame = plx_base::task::FrameScope::enter(); - let _ = plx_platform::devcaps::dv::capability(); + let _ = plx_os::devcaps::dv::capability(); let dovi = Dovi { present: true, profile: 8, @@ -70,7 +70,7 @@ fn dv_presentation_reads_are_frame_safe() { ..Dovi::NONE }; assert_eq!( - dovi.presentation(true, plx_platform::devcaps::dv::DvCapability::Unknown, true), + dovi.presentation(true, plx_os::devcaps::dv::DvCapability::Unknown, true), DvPresentation::NotDv, ); drop(frame); diff --git a/rust-modules/data/src/person.rs b/rust-modules/data/src/person.rs index f7b8c1a48c..a09a7e3980 100644 --- a/rust-modules/data/src/person.rs +++ b/rust-modules/data/src/person.rs @@ -2328,7 +2328,7 @@ pub fn filmography(p: &Person) -> Vec { }; let mut kept: Vec = Vec::new(); let mut other = Department { - title: plx_platform::i18n::msg::browse_person_other().to_string(), + title: plx_os::i18n::msg::browse_person_other().to_string(), total: 0, rows: Vec::new(), }; diff --git a/rust-modules/data/src/pms.rs b/rust-modules/data/src/pms.rs index f57c1c8386..6b8e30a75f 100644 --- a/rust-modules/data/src/pms.rs +++ b/rust-modules/data/src/pms.rs @@ -173,6 +173,9 @@ pub struct PmsMovie { /// The first video stream is HDR (HDR10 / HLG / Dolby Vision). #[serde(default, skip_serializing_if = "is_false")] pub hdr: bool, + /// A video stream of the first media carries Dolby Vision (then `hdr` is set too). + #[serde(default, skip_serializing_if = "is_false")] + pub dolby_vision: bool, /// `audienceRating` (0..10), or `None` when the server sent none. #[serde(default, skip_serializing_if = "Option::is_none")] pub audience_rating: Option, @@ -590,6 +593,7 @@ fn fill_caption_facts(m: &mut PmsMovie, it: &plx_plex::plex::Metadata) { } m.video_resolution = facts.video_resolution; m.hdr = facts.hdr; + m.dolby_vision = facts.dolby_vision; m.audience_rating = facts.audience_rating; m.leaf_count = facts.leaf_count; m.viewed_leaf_count = facts.viewed_leaf_count; @@ -2350,7 +2354,7 @@ fn merge_with_scope(srcs: &[Src], scope: &BrowseScope) -> HubBuild { new_hubs.push(HubRow { // the hub id the rest of the module matches on (hero-pool eligibility, // `hub_is_continue`), rather than the dedicated hub's own "continueWatching" - title: plx_platform::i18n::msg::browse_home_continue_watching().to_string(), + title: plx_os::i18n::msg::browse_home_continue_watching().to_string(), hub_id: "home.continue".to_string(), key: String::new(), source: String::new(), @@ -4628,7 +4632,7 @@ mod caption_fact_tests { assert_eq!(m.genre.as_deref(), Some("Drama"), "the FIRST genre"); assert_eq!(m.secondary_genre.as_deref(), Some("Crime")); assert_eq!(m.video_resolution.as_deref(), Some("4k")); - assert!(m.hdr); + assert!(m.hdr && !m.dolby_vision, "HDR10 is HDR without Dolby Vision"); assert_eq!(m.audience_rating, Some(7.8)); assert_eq!(m.added_at, Some(1_700_000_000)); assert!(!m.smart && m.leaf_count.is_none() && m.child_count == 0); @@ -4657,7 +4661,7 @@ mod caption_fact_tests { fn dolby_vision_without_a_transfer_characteristic_is_hdr() { let m = row(r#"{"type":"movie","title":"M","Media":[{"Part":[{"Stream":[ {"streamType":1,"DOVIPresent":true}]}]}]}"#); - assert!(m.hdr); + assert!(m.hdr && m.dolby_vision); } #[test] diff --git a/rust-modules/data/src/pms/initial.rs b/rust-modules/data/src/pms/initial.rs index 8fb5028e38..a7d4e761db 100644 --- a/rust-modules/data/src/pms/initial.rs +++ b/rust-modules/data/src/pms/initial.rs @@ -200,7 +200,7 @@ fn movie(m: &PmsMovie, w: &mut impl Sink) { ep_index, unwatched, watched, aired, child_count, guid, show_guid, // CONTRACT FREEZE: the caption facts are not in the canonical encoding yet, so every // recorded hash stays what it was. P2 decides whether to hash them (which re-records). - subtype: _, smart: _, genre: _, secondary_genre: _, video_resolution: _, hdr: _, audience_rating: _, + subtype: _, smart: _, genre: _, secondary_genre: _, video_resolution: _, hdr: _, dolby_vision: _, audience_rating: _, leaf_count: _, viewed_leaf_count: _, added_at: _, // a listing's versions only feed the item menu's row, which the menu captures at open versions: _, edition: _, sort_info: _, diff --git a/rust-modules/data/src/pms/record.rs b/rust-modules/data/src/pms/record.rs index fad59ceda4..5147f8c726 100644 --- a/rust-modules/data/src/pms/record.rs +++ b/rust-modules/data/src/pms/record.rs @@ -116,7 +116,7 @@ mod tests { aired: "2026-09-08".into(), child_count: i64::MAX, guid: Some([1; 12]), show_guid: Some([2; 12]), subtype: Some("movie".into()), smart: true, genre: Some("Drama".into()), secondary_genre: Some("Crime".into()), - video_resolution: Some("4k".into()), hdr: true, audience_rating: Some(7.5), + video_resolution: Some("4k".into()), hdr: true, dolby_vision: true, audience_rating: Some(7.5), leaf_count: Some(10), viewed_leaf_count: Some(4), added_at: Some(i64::MAX), sort_info: Some(crate::pms::SortInfo { rating: Some(9.1), user_rating: Some(8.0), view_count: Some(7), bitrate_kbps: Some(8000), media_count: 2, ..Default::default() }), diff --git a/rust-modules/data/src/pms_multi_source_merge_tests.rs b/rust-modules/data/src/pms_multi_source_merge_tests.rs index e0cb565db3..ddbec23792 100644 --- a/rust-modules/data/src/pms_multi_source_merge_tests.rs +++ b/rust-modules/data/src/pms_multi_source_merge_tests.rs @@ -102,7 +102,7 @@ fn one_movie_and_one_tv_library_get_the_natural_per_type_recently_added_titles() /// recognize keeps drawing PMS's own text verbatim (checked below). #[test] fn a_recently_added_library_hub_renders_the_be_catalog_string_under_a_be_ui() { - let _thread_locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::Be); + let _thread_locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::Be); let body = r#"{"MediaContainer":{"Hub":[ {"type":"movie","hubIdentifier":"movie.recentlyadded.1", "title":"Recently Added in Movies","key":"/library/sections/1/all?sort=addedAt:desc", @@ -127,7 +127,7 @@ fn a_recently_added_library_hub_renders_the_be_catalog_string_under_a_be_ui() { /// the per-library `{library}`-interpolated form, under a `be` UI. #[test] fn a_lone_movie_library_renders_the_be_per_type_catalog_string_under_a_be_ui() { - let _thread_locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::Be); + let _thread_locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::Be); let body = r#"{"MediaContainer":{"Hub":[ {"type":"movie","hubIdentifier":"home.movies.recent", "title":"Recently Added Movies","key":"/hubs/home/recentlyAdded?type=1", @@ -151,7 +151,7 @@ fn a_lone_movie_library_renders_the_be_per_type_catalog_string_under_a_be_ui() { /// drawing PMS's own `title` verbatim, in any language, exactly as it did before this change. #[test] fn an_unrecognized_hub_identifier_keeps_the_pms_title_verbatim() { - let _thread_locale = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::Be); + let _thread_locale = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::Be); let body = r#"{"MediaContainer":{"Hub":[ {"type":"movie","hubIdentifier":"custom.collection.987", "title":"Прайдзiсветы i Незнаёмцы","key":"/library/collections/987/children", diff --git a/rust-modules/data/src/search.rs b/rust-modules/data/src/search.rs index a5f41e95af..3f5837a54e 100644 --- a/rust-modules/data/src/search.rs +++ b/rust-modules/data/src/search.rs @@ -152,11 +152,11 @@ impl Kind { /// The shelf heading. pub fn title(self) -> &'static str { match self { - Kind::Movie => plx_platform::i18n::msg::browse_kind_movies(), - Kind::Show => plx_platform::i18n::msg::browse_kind_tv_shows(), - Kind::Episode => plx_platform::i18n::msg::browse_kind_episodes(), - Kind::Person => plx_platform::i18n::msg::browse_detail_cast(), - Kind::Collection => plx_platform::i18n::msg::browse_kind_collections(), + Kind::Movie => plx_os::i18n::msg::browse_kind_movies(), + Kind::Show => plx_os::i18n::msg::browse_kind_tv_shows(), + Kind::Episode => plx_os::i18n::msg::browse_kind_episodes(), + Kind::Person => plx_os::i18n::msg::browse_detail_cast(), + Kind::Collection => plx_os::i18n::msg::browse_kind_collections(), } } /// The count read-out beside it — how many RESULTS are on this shelf, as one complete @@ -167,8 +167,8 @@ impl Kind { /// answered by two different formatters. pub fn count_label(self, n: usize) -> String { match self { - Kind::Person => plx_platform::i18n::msg::browse_search_people(n as i64), - _ => plx_platform::i18n::msg::browse_search_count(n as i64), + Kind::Person => plx_os::i18n::msg::browse_search_people(n as i64), + _ => plx_os::i18n::msg::browse_search_count(n as i64), } } /// Which hub identifiers feed this shelf. diff --git a/rust-modules/data/src/sortfacts.rs b/rust-modules/data/src/sortfacts.rs index 5763222ada..95dc4f3ae3 100644 --- a/rust-modules/data/src/sortfacts.rs +++ b/rust-modules/data/src/sortfacts.rs @@ -15,7 +15,7 @@ //! `rating`, `audienceRating`, `duration`, `addedAt`, `lastViewedAt`, `mediaHeight`, `random`) and the //! app's own `viewCount`: the server's titles are English Title Case whatever the language. -use plx_platform::i18n::msg; +use plx_os::i18n::msg; /// What an ordering runs along, which decides how its two ends are worded. #[derive(Clone, Copy, Debug, PartialEq, Eq)] @@ -130,7 +130,7 @@ impl SortFact { #[cfg(test)] mod tests { use super::*; - use plx_platform::i18n::{language_on_this_thread_for_test, Preference}; + use plx_os::i18n::{language_on_this_thread_for_test, Preference}; /// **A fact has one name and one pair of direction words, in sentence case.** The Library's /// "Critic Rating" and the Watchlist's "Rating" were the same fact in two words. @@ -168,7 +168,7 @@ mod tests { #[test] fn every_key_a_server_titles_in_english_takes_the_tables_word_in_every_language() { use crate::browse::SortEntry; - use plx_platform::i18n::SHIPPED; + use plx_os::i18n::SHIPPED; // (key, the server's title, the table's English word) let keys = [("lastViewedAt", "Date Viewed", "Date viewed"), ("random", "Randomly", "Random"), ("viewCount", "Plays", "Plays"), ("duration", "Duration", "Duration"), ("mediaHeight", "Resolution", "Resolution")]; diff --git a/rust-modules/gfx/src/gfx.rs b/rust-modules/gfx/src/gfx.rs index 4f85e72e1c..2d69342b4b 100644 --- a/rust-modules/gfx/src/gfx.rs +++ b/rust-modules/gfx/src/gfx.rs @@ -754,8 +754,8 @@ fn probed_clear(presented: impl FnOnce() -> bool, clear: impl FnOnce()) { /// The frame's first framebuffer-0 command is where this driver parks the wait for a free back /// buffer, and on every route but the player it is the page's [`frame_clear`]. The dev frame -/// probe (`/tmp/plxnative-framecb`) prices that wait, but its clock is `platform`'s and this -/// crate does not depend on `platform`, so the application hands the two edges down once at boot: +/// probe (`/tmp/plxnative-framecb`) prices that wait, but its clock is `os`'s and this +/// crate does not depend on `os`, so the application hands the two edges down once at boot: /// `waiting` runs just before the clear, `acquired` just after it returns. pub fn install_clear_probe(waiting: fn(), acquired: fn()) { CLEAR_PROBE.with(|p| p.hooks.set(Some((waiting, acquired)))); diff --git a/rust-modules/gfx/src/lib.rs b/rust-modules/gfx/src/lib.rs index e8146f9560..5fa9bec415 100644 --- a/rust-modules/gfx/src/lib.rs +++ b/rust-modules/gfx/src/lib.rs @@ -7,7 +7,7 @@ //! (`svg`, which calls into `src/svg.c`), and the GPU instruments: the async timer queries //! (`gpu_timer`), the Mali counter reader (`hwcnt`) and the per-draw-class overdraw ledger //! (`overdraw`, which lived in `ui` until the split). It is the `gfx` layer of -//! `ci/module-layers.ini`: it uses `base` and `machine` (and may use `platform`, which nothing +//! `ci/module-layers.ini`: it uses `base` and `machine` (and may use `os`, which nothing //! here names today). //! //! The crate declares the `extern "C"` blocks (GLES2, EGL, SDL2_ttf, nanosvg) and one `dynlib!` diff --git a/rust-modules/jellyfin/Cargo.toml b/rust-modules/jellyfin/Cargo.toml index 9912062449..fe80830341 100644 --- a/rust-modules/jellyfin/Cargo.toml +++ b/rust-modules/jellyfin/Cargo.toml @@ -23,7 +23,7 @@ plx_base = { path = "../base" } # `present::wake_from_worker`, so a favourite write's answer from the server is drawn at once. plx_machine = { path = "../machine" } # The app's translated strings (`i18n::msg`), for the shelf titles this layer names. -plx_platform = { path = "../platform" } +plx_os = { path = "../os" } # The libcurl transport (`plx_net::net::request`) the real `Transport` sends through. plx_net = { path = "../net" } serde = { version = "1", default-features = false, features = ["derive", "alloc"] } @@ -36,6 +36,6 @@ workspace = true [dev-dependencies] # Tests read the shelf titles in English without the boot-time locale (`i18n::current`). -plx_platform = { path = "../platform", features = ["test-support"] } +plx_os = { path = "../os", features = ["test-support"] } # The server registry as a test fixture (`register_for_test`), for the tests that call `Client`. plx_plex = { path = "../plex", features = ["alt-backend", "test-support"] } diff --git a/rust-modules/jellyfin/src/jellyfin/backend.rs b/rust-modules/jellyfin/src/jellyfin/backend.rs index 1fb982c5b1..ee34f3e5d1 100644 --- a/rust-modules/jellyfin/src/jellyfin/backend.rs +++ b/rust-modules/jellyfin/src/jellyfin/backend.rs @@ -17,7 +17,7 @@ use super::playback_info; use super::transcode; use super::translate::{self, hubs}; use plx_plex::plex::account::{AudioPreferences, MarkerAccess, PreferenceError}; -use plx_platform::i18n::msg; +use plx_os::i18n::msg; use plx_plex::plex::backend::Backend; use plx_plex::plex::grant::{self, MintRefusal, PlaintextAsk}; use plx_plex::plex::notify::{Notification, NotifyEnd}; @@ -443,7 +443,7 @@ fn prove_grant( /// The device as the server's profile describes it: the capability table the player's own /// direct-play gate reads, every video codec it lists (h264, hevc, vp9, av1) with their rows. -fn this_device(caps: &plx_platform::devcaps::Caps) -> playback_info::Device<'_> { +fn this_device(caps: &plx_os::devcaps::Caps) -> playback_info::Device<'_> { playback_info::Device { video: plx_plex::plex::direct_play_video_codecs(caps), max_w: caps.hevc_max.0, @@ -451,14 +451,14 @@ fn this_device(caps: &plx_platform::devcaps::Caps) -> playback_info::Device<'_> rows: vec![("vp9", caps.vp9_row.0, caps.vp9_row.1), ("av1", caps.av1_row.0, caps.av1_row.1)], vp9_bit_depth: caps.vp9_bit_depth, audio: &caps.audio, - converted_audio: if plx_platform::devcaps::tv_audio_conversion() { playback_info::CONVERTED_AUDIO } else { "" }, + converted_audio: if plx_os::devcaps::tv_audio_conversion() { playback_info::CONVERTED_AUDIO } else { "" }, audio_target: audio_encode_target(caps), } } /// The audio codec a server encodes to when a track cannot be copied: the head of the Plex /// profile's `audioCodec` chain (ac3 first, then the rest of what the TV decodes). -fn audio_encode_target(caps: &plx_platform::devcaps::Caps) -> &'static str { +fn audio_encode_target(caps: &plx_os::devcaps::Caps) -> &'static str { ["ac3", "eac3", "aac", "dts"].into_iter().find(|c| caps.audio_has(c)).unwrap_or("aac") } @@ -1000,7 +1000,7 @@ impl Backend for Shared { let chosen = m.media.get_mut(media_index)?; chosen.selected = true; let source = chosen.part.first().and_then(|p| transcode::media_source_of(&p.key)).map(str::to_string); - let profile = playback_info::device_profile(&this_device(&plx_platform::devcaps::caps())); + let profile = playback_info::device_profile(&this_device(&plx_os::devcaps::caps())); let verdict = if forced { None } else { diff --git a/rust-modules/jellyfin/src/jellyfin/client.rs b/rust-modules/jellyfin/src/jellyfin/client.rs index 02f3bacc6e..55b72831bd 100644 --- a/rust-modules/jellyfin/src/jellyfin/client.rs +++ b/rust-modules/jellyfin/src/jellyfin/client.rs @@ -25,7 +25,7 @@ use super::paths::{self, ImageKind, ItemsQuery, SortBy}; use super::time::ms_to_ticks; use super::tmdb; use super::translate::{self, Ctx}; -use plx_platform::i18n::msg; +use plx_os::i18n::msg; use plx_plex::plex::account::PreferenceError; use plx_plex::plex::discover::CreditGroup; use plx_plex::plex::{Hub, LibrarySection, MediaContainer, Metadata, OnDeckHub, Trickplay}; diff --git a/rust-modules/jellyfin/src/jellyfin/client/browse.rs b/rust-modules/jellyfin/src/jellyfin/client/browse.rs index 7564748fc7..c3dca4baaa 100644 --- a/rust-modules/jellyfin/src/jellyfin/client/browse.rs +++ b/rust-modules/jellyfin/src/jellyfin/client/browse.rs @@ -298,7 +298,7 @@ impl JfClient { } let person: BaseItemDto = serde_json::from_slice(&person.body).ok()?; let Some(tmdb_id) = person.provider_ids.get("Tmdb").filter(|id| !id.is_empty()) else { return Some(None) }; - let url = tmdb::combined_credits_url(tmdb_id, key, plx_platform::i18n::current().language().tag()); + let url = tmdb::combined_credits_url(tmdb_id, key, plx_os::i18n::current().language().tag()); let answer = self.transport.send(&url, Verb::Get, &["Accept: application/json".to_string()], None)?; match answer.status { 200 => serde_json::from_slice(&answer.body).ok().map(Some), diff --git a/rust-modules/jellyfin/src/jellyfin/client/tests.rs b/rust-modules/jellyfin/src/jellyfin/client/tests.rs index bb1213b5a2..390c6cf2ce 100644 --- a/rust-modules/jellyfin/src/jellyfin/client/tests.rs +++ b/rust-modules/jellyfin/src/jellyfin/client/tests.rs @@ -301,7 +301,7 @@ fn home_and_pages_ask_for_their_parts_at_once() { /// Shelf titles are the app's, in the viewer's language, not English from this layer. #[test] fn home_shelf_titles_follow_the_ui_language() { - let _pt = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::Pt); + let _pt = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::Pt); let (c, _) = signed_in(vec![ ("/UserViews", 200, VIEWS), ("/Items?userId=u1", 200, r#"{"Items":[{"Id":"m9","Name":"Loved","Type":"Movie","UserData":{"IsFavorite":true}}]}"#), @@ -1238,7 +1238,7 @@ fn capabilities_are_posted_as_this_device() { /// films, or a reason this client does not word, is left out. #[test] fn a_movie_library_s_suggestions_are_titled_by_their_reason() { - let _en = plx_platform::i18n::language_on_this_thread_for_test(plx_platform::i18n::Preference::En); + let _en = plx_os::i18n::language_on_this_thread_for_test(plx_os::i18n::Preference::En); let (c, fake) = signed_in(vec![ ("/UserViews", 200, VIEWS), ("/Movies/Recommendations", 200, r#"[ diff --git a/rust-modules/jellyfin/src/jellyfin/playback_info.rs b/rust-modules/jellyfin/src/jellyfin/playback_info.rs index 6a968c0ab5..40a28230f7 100644 --- a/rust-modules/jellyfin/src/jellyfin/playback_info.rs +++ b/rust-modules/jellyfin/src/jellyfin/playback_info.rs @@ -2,7 +2,7 @@ //! //! The player decides direct play from its device profile and asks the server for a verdict //! before playing (`Backend::mde_decision`). Asking Jellyfin with a profile built from the same -//! capability table (`plx_platform::devcaps`) lets the server apply what only it knows: the +//! capability table (`plx_os::devcaps`) lets the server apply what only it knows: the //! bitrate limits set on the Dashboard for this user, and which subtitles must be burned into the //! picture because the profile does not list them. Its answer is a verdict (direct play, or not) //! and, when not, the `TranscodingUrl` it would serve: the progressive Matroska stream this @@ -235,7 +235,7 @@ mod tests { assert_eq!(p["DirectPlayProfiles"][0]["AudioCodec"], format!("aac,ac3,eac3,{CONVERTED_AUDIO}")); assert_eq!(p["TranscodingProfiles"][0]["AudioCodec"], "aac,ac3,eac3"); for codec in CONVERTED_AUDIO.split(',') { - assert!(plx_platform::devcaps::tv_convertible(codec), "{codec} is one the app converts"); + assert!(plx_os::devcaps::tv_convertible(codec), "{codec} is one the app converts"); } } diff --git a/rust-modules/jellyfin/src/jellyfin/remote.rs b/rust-modules/jellyfin/src/jellyfin/remote.rs index 958318bc6e..c54b4cc4e3 100644 --- a/rust-modules/jellyfin/src/jellyfin/remote.rs +++ b/rust-modules/jellyfin/src/jellyfin/remote.rs @@ -5,7 +5,7 @@ //! ([`super::live`]). Each becomes what the app already acts on: //! //! * `Play` (`PlayNow`) starts the first item named where Resume would, as a launch link does -//! (`plx_platform::tv::launch`): the link waits for a signed-in Home and ends any playback first. +//! (`plx_os::tv::launch`): the link waits for a signed-in Home and ends any playback first. //! The other play commands (next, last, shuffle, instant mix) need a queue and are not taken. //! * `Playstate` (pause, unpause, play/pause, stop, rewind, fast-forward) and the navigation //! `GeneralCommand`s (the arrows, select, back, text) become presses of the remote's keys, in the @@ -82,7 +82,7 @@ fn play_link(id: &str) -> String { pub fn act(command: Command) { plx_base::eventlog::log(&format!("jellyfin: remote {command:?}")); match command { - Command::Play(id) => plx_platform::tv::launch::offer(&play_link(&id)), + Command::Play(id) => plx_os::tv::launch::offer(&play_link(&id)), Command::Key(token) => { let mut keys = KEYS.lock().unwrap_or_else(|p| p.into_inner()); if keys.len() == KEYS_MAX { @@ -95,7 +95,7 @@ pub fn act(command: Command) { } /// The keys pressed from another device since the last call, oldest first. FRAME THREAD; one -/// atomic swap when there are none. The queue is `plx_platform::tv::launch`'s, for keys. +/// atomic swap when there are none. The queue is `plx_os::tv::launch`'s, for keys. pub fn take_keys() -> Vec { if !WAITING.swap(false, Ordering::Acquire) { return Vec::new(); diff --git a/rust-modules/jellyfin/src/jellyfin/tmdb.rs b/rust-modules/jellyfin/src/jellyfin/tmdb.rs index eb77ac3af7..8f6e65f1ed 100644 --- a/rust-modules/jellyfin/src/jellyfin/tmdb.rs +++ b/rust-modules/jellyfin/src/jellyfin/tmdb.rs @@ -51,7 +51,7 @@ pub fn sized_poster(url: &str, w: i64) -> Option { /// larger than the disk cache keeps) and without a credential. pub fn fetch_image(url: &str) -> ArtFetch { use plx_net::net; - match net::request(url, &[], "GET", None, net::BULK, false, Some(plx_platform::imgcache::MAX_FILE), None) { + match net::request(url, &[], "GET", None, net::BULK, false, Some(plx_os::imgcache::MAX_FILE), None) { Some(r) if (200..300).contains(&r.status) => ArtFetch::Bytes(r.body), Some(r) => ArtFetch::Status(r.status.into()), None => ArtFetch::NoResponse, diff --git a/rust-modules/jellyfin/src/jellyfin/transcode.rs b/rust-modules/jellyfin/src/jellyfin/transcode.rs index 209ff122a8..744984d183 100644 --- a/rust-modules/jellyfin/src/jellyfin/transcode.rs +++ b/rust-modules/jellyfin/src/jellyfin/transcode.rs @@ -152,7 +152,7 @@ pub fn plan(mut m: Metadata, spec: &TranscodeSpec<'_>, dev: &Device<'_>) -> Opti _ => VIDEO_TARGET.to_string(), }; let audio_codecs = match &audio { - Some(a) if copy_audio && a.codec != dev.audio_target => format!("{},{}", plx_platform::devcaps::audio_codec_id(&a.codec), dev.audio_target), + Some(a) if copy_audio && a.codec != dev.audio_target => format!("{},{}", plx_os::devcaps::audio_codec_id(&a.codec), dev.audio_target), _ => dev.audio_target.to_string(), }; let audio_index = audio.as_ref().map(|a| a.index); @@ -250,9 +250,9 @@ mod tests { } fn spec(remux: bool, ceiling: Option) -> TranscodeSpec<'static> { - static ASSUMED: std::sync::OnceLock = std::sync::OnceLock::new(); + static ASSUMED: std::sync::OnceLock = std::sync::OnceLock::new(); TranscodeSpec { - caps: ASSUMED.get_or_init(plx_platform::devcaps::Caps::assumed), + caps: ASSUMED.get_or_init(plx_os::devcaps::Caps::assumed), rating_key: "abc", session: "s1", encoder_session: "s1", diff --git a/rust-modules/jellyfin/src/jellyfin/translate.rs b/rust-modules/jellyfin/src/jellyfin/translate.rs index 35fcbee8f2..0165ecf470 100644 --- a/rust-modules/jellyfin/src/jellyfin/translate.rs +++ b/rust-modules/jellyfin/src/jellyfin/translate.rs @@ -22,7 +22,7 @@ use crate::jellyfin::image_tags; use crate::jellyfin::languages; use crate::jellyfin::paths::{self, ImageKind}; use crate::jellyfin::time::{iso_date, iso_to_unix, ticks_to_ms}; -use plx_platform::i18n::msg; +use plx_os::i18n::msg; use plx_plex::plex::account::AudioPreferences; use plx_plex::plex::{ Chapter, HexColor, Hub, LibrarySection, Marker, Media, MediaContainer, MediaId, MediaPart, Metadata, SearchResult, Stream, diff --git a/rust-modules/jellyfin/src/lib.rs b/rust-modules/jellyfin/src/lib.rs index 9ad7cbda67..da47434055 100644 --- a/rust-modules/jellyfin/src/lib.rs +++ b/rust-modules/jellyfin/src/lib.rs @@ -1,6 +1,6 @@ //! plx_jellyfin: the Jellyfin layer of FinNative (see [`jellyfin`]). //! -//! It is the `jellyfin` layer of `ci/module-layers.ini`: it uses `base`, `machine`, `platform`, +//! It is the `jellyfin` layer of `ci/module-layers.ini`: it uses `base`, `machine`, `os`, //! `net` and `plex` (for the common item model) and nothing above them. pub mod jellyfin; diff --git a/rust-modules/media/Cargo.toml b/rust-modules/media/Cargo.toml index 6cc63197e1..efb513cfa6 100644 --- a/rust-modules/media/Cargo.toml +++ b/rust-modules/media/Cargo.toml @@ -15,7 +15,7 @@ name = "plx_media" # (dlopen at run time), the platform webOS port's Starfish/ACB externs are resolved by the final link (the # Makefile's), and the two `#[no_mangle]` callbacks the C seams call (`src/starfish.c` calls # `plx_play_feed::sf_event::sf_on_event`; `src/video_plane.c` calls the platform port's `acb_on_event`, -# `plx_platform::webos::video_sink`) ride the application's staticlib like `plx_telemetry`'s entry +# `plx_os::webos::video_sink`) ride the application's staticlib like `plx_telemetry`'s entry # points. It reads no `PLX_*` build variable. crate-type = ["rlib"] @@ -29,12 +29,12 @@ crate-type = ["rlib"] # behaviour here, not plumbing: the quality-override, track-name, playurl and forced-route triggers # read their files through `plx_base::devtrig`, which is compile-time `None` without it, and # 130-odd `cfg`s select the dev surface. -devtriggers = ["plx_play_feed/devtriggers", "plx_media_codecs/devtriggers", "plx_base/devtriggers", "plx_machine/devtriggers", "plx_net/devtriggers", "plx_platform/devtriggers", "plx_plex/devtriggers", "plx_telemetry/devtriggers", "plx_data/devtriggers"] +devtriggers = ["plx_play_feed/devtriggers", "plx_media_codecs/devtriggers", "plx_base/devtriggers", "plx_machine/devtriggers", "plx_net/devtriggers", "plx_os/devtriggers", "plx_plex/devtriggers", "plx_telemetry/devtriggers", "plx_data/devtriggers"] # `plx_play_feed::ffi_host` (the simulator's `VideoSink`, which lives in `plx_play_feed`) replaces the # platform webOS port's native sink (Starfish/ACB) under the media tests' Feed; a simulator build names # the application's `play-feed` too (ci/test_sim_backend.py). The simulator's decoded picture (its # frame sink, the one thing that draws) is the application's. -hostsim = ["plx_play_feed/hostsim", "plx_base/hostsim", "plx_machine/hostsim", "plx_platform/hostsim", "plx_plex/hostsim", "plx_telemetry/hostsim", "plx_data/hostsim"] +hostsim = ["plx_play_feed/hostsim", "plx_base/hostsim", "plx_machine/hostsim", "plx_os/hostsim", "plx_plex/hostsim", "plx_telemetry/hostsim", "plx_data/hostsim"] # Two `cfg_attr(not(feature = "lab-diagnostics"), allow(dead_code))` in `player`; the Cloud Lab bridge # that reads those items is the application crate's. lab-diagnostics = [] @@ -43,14 +43,14 @@ lab-diagnostics = [] # `cfg(test)` alone cannot give a dependent (the stand-in sink, the stepped feed clock, the asset # directory, the settled route start). Enabled from the dependents' `[dev-dependencies]`; never in a # shipped build. -test-support = ["plx_media_codecs/test-support", "plx_base/test-support", "plx_machine/test-support", "plx_platform/test-support", "plx_net/test-support", "plx_plex/test-support", "plx_telemetry/test-support", "plx_data/test-support"] +test-support = ["plx_media_codecs/test-support", "plx_base/test-support", "plx_machine/test-support", "plx_os/test-support", "plx_net/test-support", "plx_plex/test-support", "plx_telemetry/test-support", "plx_data/test-support"] [dependencies] plx_playback_contract = { path = "../playback-contract" } plx_media_codecs = { path = "../media-codecs" } plx_base = { path = "../base" } plx_machine = { path = "../machine" } -plx_platform = { path = "../platform" } +plx_os = { path = "../os" } plx_net = { path = "../net" } plx_plex = { path = "../plex" } plx_telemetry = { path = "../telemetry" } @@ -75,7 +75,7 @@ plx_playback_contract = { path = "../playback-contract", features = ["test-suppo plx_media = { path = ".", default-features = false, features = ["devtriggers"] } plx_base = { path = "../base", features = ["test-support"] } plx_machine = { path = "../machine", features = ["test-support"] } -plx_platform = { path = "../platform", features = ["test-support"] } +plx_os = { path = "../os", features = ["test-support"] } plx_net = { path = "../net", features = ["test-support"] } plx_plex = { path = "../plex", features = ["test-support"] } plx_telemetry = { path = "../telemetry", features = ["test-support"] } diff --git a/rust-modules/media/src/lib.rs b/rust-modules/media/src/lib.rs index c58f3d62c5..2b148c0bff 100644 --- a/rust-modules/media/src/lib.rs +++ b/rust-modules/media/src/lib.rs @@ -5,7 +5,7 @@ //! and route selection (`route`). The HLS parser and access-unit queues live in `plx_play_feed`. //! It is the `media` layer of `ci/module-layers.ini`: it //! uses `playback-contract`, `media-codecs`, `base`, `machine`, -//! `platform`, `gfx`, `net`, `plex`, `telemetry` and `data`, and nothing above them. The remaining +//! `os`, `gfx`, `net`, `plex`, `telemetry` and `data`, and nothing above them. The remaining //! media orchestration members (`abr`, `curlio`, `player` and //! `route`) and the `ff` facade share a crate. The bundled FFmpeg binding, encoder and pure //! audio DSP live in `plx_media_codecs` below this layer. diff --git a/rust-modules/media/src/player/CLAUDE.md b/rust-modules/media/src/player/CLAUDE.md index 20590dcce6..f7105070d9 100644 --- a/rust-modules/media/src/player/CLAUDE.md +++ b/rust-modules/media/src/player/CLAUDE.md @@ -27,7 +27,7 @@ set, not production source, control or release coverage. Boot now installs a pro and source qualification port. The port's production qualifier returns Unknown (but for a viewer's own Playback engine opt-in, `OriginalRequest::uri_opt_in`, below) and the evidence it reports has no certified capabilities, so ordinary routes still choose Feed. The driver itself is configured with what an opted-in -viewer certifies (`ProductEvidence::opted_in`), and only a qualification ever offers it a source. Host fixtures inject qualified source +viewer certifies (`ProductEvidence::opt_in_certifies`, which `ProductEvidence::opted_in` applies to the evidence's own pair), and only a qualification ever offers it a source. Host fixtures inject qualified source and firmware evidence to exercise source, control and release logic. The product driver also carries the ACB plane binding the probe proved (`Binding::Acb` in @@ -44,11 +44,16 @@ accepted pause/resume to the plane once the bind has completed. Release is `UNLO plane owner's fence on that call's completion callback, pumped from the backend's `poll` (`docs/measurements/acb-release-fence-2026-11-04.md`); a quarantine until process exit is only the outcome of a failed fence, not the normal one. `plx_play_uri::backend::product_binding` selects it at -composition (an ACB display; the URI engine's own handle, player type 0, is created ON DEMAND when the first source is OFFERED (`UriDriver::ready_to_start`, asked by `offer_qualified_uri`, runs `PlaneOwner::ensure_handle`; the driver's gate `Op::Check` makes it if nothing did), while the boot creates only Feed's player type 10 handle, each created once and never destroyed, and the plane owner binds one at a time across both; a create or initialize that fails DECLINES the offer, `uri: original declined (the ACB handle for the URI engine could not be created)`, and Feed plays the title; the failure is recorded, so a later offer declines without a new attempt, and the Start's own gate stays the backstop); media's `uri_preflight` only receives the result as -`ProductEvidence::unqualified_on(.., binding)`. `ProductEvidence::permits` and -`ResolvePort::could_qualify_pms` accept `Binding::Acb` as an offerable display path beside an exported -canvas, but only through `certified` capabilities: the production evidence certifies nothing and -`ProductQualifier` answers `Unknown`, which is what keeps the ACB binding from being offered a source. +composition (an ACB display; the URI engine's own handle, player type 0, is created ON DEMAND when the first source is OFFERED (`UriDriver::ready_to_start`, asked by `offer_qualified_uri`, runs `PlaneOwner::ensure_handle`; the driver's gate `Op::Check` makes it if nothing did), while the boot creates only Feed's player type 10 handle, each created once and never destroyed, and the plane owner binds one at a time across both; a create or initialize that fails DECLINES the offer, `uri: original declined (the ACB handle for the URI engine could not be created)` (the driver's own reason, `UriNotReady::Driver`), and Feed plays the title; the failure is recorded, so a later offer declines without a new attempt, and the Start's own gate stays the backstop); media's `uri_preflight` never sees the binding. +The driver reports the display path it can show a source on as `DisplayEvidence` (`UriDriver::display`: whether +the display is ready, whether it can place a preview rectangle, and an opaque tag the boot log prints; the +exported window, the ACB plane and the window mode that exports it are the LG driver's own detail, compared +only inside `plx_play_uri`), and the composition joins it to the product's callable and certified +capabilities as `ProductEvidence { display, callable, certified }`. `ProductEvidence::permits` and +`ResolvePort::could_qualify_pms` read only whether that display is ready, and offer a source only through +`certified` capabilities: the production evidence certifies nothing and the product's `ProductQualifier` +(`app/adapters/backends.rs`, which also holds LG's one display rule, a Part with several audio tracks stays +on Standard on the exported window) answers `Unknown`, which is what keeps the ACB binding from being offered a source. The one exception is a viewer who turned on Settings > Video & playback > Playback engine > Experimental (`UriEngine::On`, per profile, off by default): the route snapshots it into `ResolveEnv::uri_engine`, `OriginalRequest::uri_opt_in` carries it to the worker, `ProductQualifier` then answers the original @@ -193,8 +198,8 @@ and seeks by time via `av_seek_frame` (libavformat's own Cues index). the session reset the readout does not: the teardown records it as the terminal `AttemptFacts::load_abandoned`. -**The main-thread rule is compiler-enforced.** The seam is the `VideoSink` trait in `plx_platform::tv::sink` (`rust-modules/platform/src/tv/sink.rs`) -(Starfish-shaped: one method per verb, reached through `PlayerAdapter::display_sink`). `platform/src/webos/video_sink.rs`'s `extern "C"` +**The main-thread rule is compiler-enforced.** The seam is the `VideoSink` trait in `plx_os::tv::sink` (`rust-modules/os/src/tv/sink.rs`) +(Starfish-shaped: one method per verb, reached through `PlayerAdapter::display_sink`). `os/src/webos/video_sink.rs`'s `extern "C"` declarations are private to that module and only `StarfishSink` there implements the trait on the television; `HostSink` (`play-feed/src/ffi_host.rs`, `plx_play_feed::ffi_host`) is the simulator's. Every verb but `load` and `unload` takes a `task::MainThread` (the constant queries `feed_abi_is_cow`, `window_mode` and `window_id` diff --git a/rust-modules/media/src/player/adapter.rs b/rust-modules/media/src/player/adapter.rs index 09eaea2b86..6388c782a4 100644 --- a/rust-modules/media/src/player/adapter.rs +++ b/rust-modules/media/src/player/adapter.rs @@ -33,7 +33,7 @@ use super::backend; use plx_playback_contract::feed::{FeedTransportAction, OpenRequest}; use plx_playback_contract::feed::{PhysicalSet, UriOnlySet}; use plx_base::task::MainThread; -use plx_platform::tv::sink::{NoSink, VideoSink}; +use plx_os::tv::sink::{NoSink, VideoSink}; use std::collections::VecDeque; const MAX_METRIC_NOTICES: usize = 32; @@ -130,7 +130,7 @@ mod composed_backends_tests { /// reaches the seam through a sink that refuses every verb. #[test] fn the_adapters_sink_is_inert_until_installed_and_asked_afresh_at_every_use() { - use plx_platform::tv::sink::{NoSink, VideoSink, VP_NONE}; + use plx_os::tv::sink::{NoSink, VideoSink, VP_NONE}; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; static ASKED: AtomicUsize = AtomicUsize::new(0); fn counted() -> &'static dyn VideoSink { @@ -148,7 +148,7 @@ mod composed_backends_tests { /// A set the adapter refuses brings its sink with it: the adapter keeps the one it had. #[test] fn a_refused_physical_set_leaves_the_adapters_sink_alone() { - use plx_platform::tv::sink::{NoSink, VideoSink}; + use plx_os::tv::sink::{NoSink, VideoSink}; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; static ASKED: AtomicUsize = AtomicUsize::new(0); fn counted() -> &'static dyn VideoSink { @@ -221,13 +221,14 @@ mod qualified_uri_offer_tests { UriSource::new("https://example.invalid/original.mkv".to_owned(), vec![]), requirements(TrackChoice::Unspecified), initial, 60_000, deadline).expect("typed offer"); - handle.set_not_ready(Some(plx_playback_contract::uri::UriNotReady::AcbHandle)); + handle.set_not_ready(Some(plx_playback_contract::uri::UriNotReady::Driver( + "the driver could not set its display up"))); let (declined, log) = plx_base::eventlog::with_private_log(|| { let declined = adapter.offer_qualified_uri(&mut session, offer()); (declined, std::fs::read_to_string(plx_base::eventlog::events_log()).unwrap_or_default()) }); assert!(matches!(declined, Err(Failure::Unavailable))); - assert!(log.contains("uri: original declined (the ACB handle for the URI engine could not be created)\n"), + assert!(log.contains("uri: original declined (the driver could not set its display up)\n"), "{log}"); assert!(adapter.qualified_uri.is_none(), "a declined offer keeps no authorization"); assert!(matches!(session.backend_offer(), @@ -270,7 +271,7 @@ mod qualified_uri_offer_tests { requirements(TrackChoice::Unspecified), initial, 60_000, deadline).expect("typed offer"); // A driver that would decline if it were asked. - handle.set_not_ready(Some(plx_playback_contract::uri::UriNotReady::AcbHandle)); + handle.set_not_ready(Some(plx_playback_contract::uri::UriNotReady::DisplayUnavailable)); let mut fx = Vec::new(); adapter.release.step(&ReleaseEvent::UnloadHandedOff { epoch: 1, at: std::time::Instant::now() }, &mut fx); assert!(adapter.release_busy()); @@ -506,7 +507,7 @@ pub struct PlayerAdapter { abr_inbox: Option<(crate::route::RouteStartAttempt, crate::adaptive::AbrInbox)>, /// Backend-independent periodic reporting resource for the current physical attempt. timeline: Option, - repair: Option<(u64, std::sync::mpsc::Receiver>)>, + repair: Option<(u64, std::sync::mpsc::Receiver>)>, release: super::release::NativeRelease, /// Effects produced by an addressed URI release while the backend poll has no session /// borrow. The release machine owns the sole queued transaction; these are only its IO work. @@ -1758,11 +1759,11 @@ impl PlayerAdapter { let Some(token) = owner.begin(supported) else { return; }; let (tx, rx) = std::sync::mpsc::channel(); if plx_base::task::spawn_small("jail repair", move || { - let _ = tx.send(plx_platform::tv::sandbox::repair()); + let _ = tx.send(plx_os::tv::sandbox::repair()); }) { self.repair = Some((token, rx)); } else { - owner.complete(token, Err(plx_platform::tv::sandbox::Failure::StartFailed)); + owner.complete(token, Err(plx_os::tv::sandbox::Failure::StartFailed)); } } @@ -1772,7 +1773,7 @@ impl PlayerAdapter { let result = match rx.try_recv() { Ok(result) => result, Err(std::sync::mpsc::TryRecvError::Empty) => return false, - Err(std::sync::mpsc::TryRecvError::Disconnected) => Err(plx_platform::tv::sandbox::Failure::StartFailed), + Err(std::sync::mpsc::TryRecvError::Disconnected) => Err(plx_os::tv::sandbox::Failure::StartFailed), }; let changed = owner.complete(*token, result); self.repair = None; @@ -2253,7 +2254,7 @@ impl PlayerAdapter { #[cfg(test)] mod repair_receipt_tests { use super::*; - use plx_platform::tv::sandbox::{Failure, State}; + use plx_os::tv::sandbox::{Failure, State}; #[test] fn local_metric_history_evicts_old_effects_after_real_reducer_results() { use super::super::attempt_metrics::{Origin, RequestOutcome, Tick, Fx}; diff --git a/rust-modules/media/src/player/ass.rs b/rust-modules/media/src/player/ass.rs index f8385dd5a4..ec39cffe7a 100644 --- a/rust-modules/media/src/player/ass.rs +++ b/rust-modules/media/src/player/ass.rs @@ -139,7 +139,7 @@ pub enum Fault { impl Fault { pub fn message(self) -> &'static str { - use plx_platform::i18n::msg; + use plx_os::i18n::msg; match self { Fault::StartFailed => msg::widgets_ass_start_failed(), Fault::InvalidFile => msg::widgets_ass_invalid_file(), diff --git a/rust-modules/media/src/player/dv_start_pump_tests.rs b/rust-modules/media/src/player/dv_start_pump_tests.rs index cdc46f5f1e..10592933d3 100644 --- a/rust-modules/media/src/player/dv_start_pump_tests.rs +++ b/rust-modules/media/src/player/dv_start_pump_tests.rs @@ -16,7 +16,7 @@ use super::native_seek_pump_tests::{preroll_at_reload, reloads, Rig, TARGET_NS, V_STEP_NS}; use super::*; use plx_data::metadata::Dovi; -use plx_platform::devcaps::{apply_exclusions, dv::DvCapability, Caps, EXCLUSIONS}; +use plx_os::devcaps::{apply_exclusions, dv::DvCapability, Caps, EXCLUSIONS}; use plx_play_feed::dv_start::{Guard, Mode}; use plx_play_feed::native_audio::{self, Kind}; use plx_play_feed::native_stall::{Watch, NATIVE_AUDIO_STALL_MS, WATCH}; diff --git a/rust-modules/media/src/player/engine.rs b/rust-modules/media/src/player/engine.rs index 5100d6d4ae..65af3c37f7 100644 --- a/rust-modules/media/src/player/engine.rs +++ b/rust-modules/media/src/player/engine.rs @@ -35,7 +35,7 @@ use plx_play_feed::pcm_lead::{pcm_output_lead, PCM_LEAD_BY_OUTPUT, PCM_SINK_LEAD use plx_play_feed::{ fed_fps_rational, opus_head, pcm_rate_khz, ENVELOPE_FHD60, ENVELOPE_UHD60, PAYLOAD_AV, }; -pub(crate) use plx_platform::devcaps::LoadVideo; +pub(crate) use plx_os::devcaps::LoadVideo; #[cfg(test)] pub(crate) use plx_play_feed::load_video_refused; #[cfg(all(test, feature = "hostsim"))] @@ -49,7 +49,7 @@ use super::log; #[cfg(all(test, feature = "hostsim"))] use plx_base::task::MainThread; #[cfg(test)] -use plx_platform::devcaps::AudioStack; +use plx_os::devcaps::AudioStack; use plx_telemetry::telemetry::window::Stage as WindowStage; #[cfg(all(test, feature = "hostsim"))] use std::os::raw::{c_char, c_int}; @@ -174,7 +174,7 @@ fn window_step(stage: WindowStage) { /// route. pub(crate) fn speed_fps_ceiling( video: Option, - caps: &plx_platform::devcaps::Caps, + caps: &plx_os::devcaps::Caps, measured: bool, ) -> f64 { let row_fps = match video { @@ -503,7 +503,7 @@ mod native_lifecycle_host_seam_tests { let mt = unsafe { MainThread::assume() }; let epoch = loaded_epoch(&mt); crate::player::plane().reset_for_test(); - crate::player::plane().boot(plx_platform::tv::plane::PlaneFacts { handle: true, player_type: 10 }); + crate::player::plane().boot(plx_os::tv::plane::PlaneFacts { handle: true, player_type: 10 }); release_native_object(&mt, epoch); crate::player::plane().reset_for_test(); let recorded = plx_telemetry::telemetry::window::take_recorded_for_test(); @@ -678,9 +678,9 @@ mod payload_tests { ("aac", "AAC"), ("dts", "DTS"), ]; - let video: &[(&str, &str, plx_platform::devcaps::dv::DvCapability)] = &[ - ("h264", "H264", plx_platform::devcaps::dv::DvCapability::Unsupported), - ("hevc", "H265", plx_platform::devcaps::dv::DvCapability::Unsupported), + let video: &[(&str, &str, plx_os::devcaps::dv::DvCapability)] = &[ + ("h264", "H264", plx_os::devcaps::dv::DvCapability::Unsupported), + ("hevc", "H265", plx_os::devcaps::dv::DvCapability::Unsupported), ]; // The 1080p60 direct-play envelope — the shape a 5.1/7.1 Bluray direct play carries. let env = SinkEnvelope { w: 1920, h: 1080, fps: 60 }; @@ -738,7 +738,7 @@ mod payload_tests { 23.976, p8(), false, - plx_platform::devcaps::dv::DvCapability::Supported, + plx_os::devcaps::dv::DvCapability::Supported, )); let payload = build_av_payload( &ps, @@ -756,7 +756,7 @@ mod payload_tests { 23.976, p8(), false, - plx_platform::devcaps::dv::DvCapability::Unsupported, + plx_os::devcaps::dv::DvCapability::Unsupported, )); let payload = build_av_payload( &ps, @@ -779,7 +779,7 @@ mod payload_tests { 23.976, p8(), false, - plx_platform::devcaps::dv::DvCapability::Supported, + plx_os::devcaps::dv::DvCapability::Supported, )); let env = SinkEnvelope { w: 3840, h: 2160, fps: 60 }; assert!(build_av_payload(&ps, "H265", "AC3 PLUS", env).contains("DolbyHdrInfo")); @@ -808,7 +808,7 @@ mod payload_tests { 23.976, p10, false, - plx_platform::devcaps::dv::DvCapability::Supported, + plx_os::devcaps::dv::DvCapability::Supported, )); assert_eq!(crate::route::stream_dovi(&ps).profile, 10); let payload = build_av_payload( @@ -830,7 +830,7 @@ mod payload_tests { 23.976, p10, false, - plx_platform::devcaps::dv::DvCapability::Supported, + plx_os::devcaps::dv::DvCapability::Supported, )); assert!(crate::route::stream_dv_presentation(&ps).declared().is_none()); let payload = build_av_payload( @@ -852,11 +852,11 @@ mod payload_tests { 23.976, p8(), false, - plx_platform::devcaps::dv::DvCapability::Unknown, + plx_os::devcaps::dv::DvCapability::Unknown, )); let fresh = p8().presentation( true, - plx_platform::devcaps::dv::DvCapability::Supported, + plx_os::devcaps::dv::DvCapability::Supported, true, ); assert!(fresh.declared().is_some(), "a subsequent decision sees Supported"); @@ -989,7 +989,7 @@ mod payload_tests { // what `build_av_payload` hands it: the AV template with the codec already set to H265, // which is what a native HEVC direct play — the only kind that can be Dolby Vision — sends let base = PAYLOAD_AV.replace(r#""video":"H264""#, r#""video":"H265""#); - let out = with_dolby_hdr_info(&base, "H265", p5().presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true)); + let out = with_dolby_hdr_info(&base, "H265", p5().presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true)); assert!( out.contains(r#""provider":"plxnative","DolbyHdrInfo":{"trackType":"single","encryptionType":"clear","profileId":5}}"#), "{out}" @@ -1027,9 +1027,9 @@ mod payload_tests { ..Dovi::NONE }; for dv in [ - Dovi::NONE.presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true), - unconvertible_p7.presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true), - p5().presentation(false, plx_platform::devcaps::dv::DvCapability::Supported, true), + Dovi::NONE.presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true), + unconvertible_p7.presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true), + p5().presentation(false, plx_os::devcaps::dv::DvCapability::Supported, true), ] { assert_eq!(with_dolby_hdr_info(PAYLOAD_AV, "H265", dv), PAYLOAD_AV); } @@ -1049,7 +1049,7 @@ mod payload_tests { let out = with_dolby_hdr_info( PAYLOAD_AV, "H265", - p7.presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true), + p7.presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true), ); const NODE: &str = r#","DolbyHdrInfo":{"trackType":"single","encryptionType":"clear","profileId":8}"#; @@ -1109,7 +1109,7 @@ mod payload_tests { fn dolby_vision_and_atmos_are_siblings_inside_contents() { let base = PAYLOAD_AV.replace(r#""video":"H264""#, r#""video":"H265""#); let out = with_immersive( - &with_dolby_hdr_info(&base, "H265", p5().presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true)), + &with_dolby_hdr_info(&base, "H265", p5().presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true)), "AC3 PLUS", true, ); @@ -1134,7 +1134,7 @@ mod payload_tests { #[test] fn a_declaration_never_rides_a_non_hevc_payload() { assert_eq!( - with_dolby_hdr_info(PAYLOAD_AV, "H264", p5().presentation(true, plx_platform::devcaps::dv::DvCapability::Supported, true)), + with_dolby_hdr_info(PAYLOAD_AV, "H264", p5().presentation(true, plx_os::devcaps::dv::DvCapability::Supported, true)), PAYLOAD_AV ); } @@ -4210,7 +4210,7 @@ mod pcm_info_tests { #[test] fn the_sample_rate_is_declared_in_kilohertz() { let want = ["8", "12", "16", "22.05", "24", "32", "44.1", "48"]; - for (hz, khz) in plx_platform::devcaps::PCM_SAMPLE_RATES.into_iter().zip(want) { + for (hz, khz) in plx_os::devcaps::PCM_SAMPLE_RATES.into_iter().zip(want) { assert_eq!(pcm_rate_khz(hz), khz); let p = with_pcm_info(BASE, "PCM", Some(PcmFormat { sample_rate: hz, bits: 16, channels: 2, source_rate: hz })); let v: serde_json::Value = serde_json::from_str(&p).unwrap(); @@ -4243,7 +4243,7 @@ mod pcm_info_tests { assert!(off.contains(r#""audio":"DTS""#) && !off.contains("pcmInfo"), "{off}"); crate::route::begin_attempt_for_test( - &mut ps, std::sync::Arc::new(plx_platform::devcaps::Caps::assumed().with_app_lossy()), + &mut ps, std::sync::Arc::new(plx_os::devcaps::Caps::assumed().with_app_lossy()), ); let shape = crate::route::stream_pcm(&ps).and_then(Result::ok); assert_eq!(shape, Some(crate::route::PcmFormat::STEREO_48K)); @@ -4266,9 +4266,9 @@ mod pcm_info_tests { /// (`forced_resolve_refuses_a_surround_dts_track_instead_of_mixing_it_down`). #[test] fn a_forced_dts_with_no_row_is_declared_as_stereo_48k_pcm() { - let caps = std::sync::Arc::new(plx_platform::devcaps::Caps { - app_lossy: plx_platform::devcaps::AppLossy::Measured, - ..plx_platform::devcaps::Caps::assumed() + let caps = std::sync::Arc::new(plx_os::devcaps::Caps { + app_lossy: plx_os::devcaps::AppLossy::Measured, + ..plx_os::devcaps::Caps::assumed() }); let mut ps = crate::route::PlaybackSession::IDLE; crate::route::begin_attempt_for_test(&mut ps, caps); @@ -4302,7 +4302,7 @@ mod pcm_info_tests { assert_eq!(audio_declaration(codec, off.is_some()).map(|d| d.0).filter(|n| *n == "PCM"), None, "{codec}"); } crate::route::begin_attempt_for_test( - &mut ps, std::sync::Arc::new(plx_platform::devcaps::Caps::assumed().with_app_lossy()), + &mut ps, std::sync::Arc::new(plx_os::devcaps::Caps::assumed().with_app_lossy()), ); for codec in ["mp3", "vorbis"] { crate::route::set_stream_codecs(&mut ps, "h264", codec); @@ -4325,7 +4325,7 @@ mod pcm_info_tests { crate::route::set_stream_codecs(&mut ps, "h264", "truehd"); assert_eq!(crate::route::stream_pcm(&ps).and_then(Result::ok), None, "not in force"); crate::route::begin_attempt_for_test( - &mut ps, std::sync::Arc::new(plx_platform::devcaps::Caps::assumed().with_app_lossy()), + &mut ps, std::sync::Arc::new(plx_os::devcaps::Caps::assumed().with_app_lossy()), ); crate::route::set_stream_codecs(&mut ps, "h264", "truehd"); let shape = crate::route::stream_pcm(&ps).and_then(Result::ok); @@ -4349,7 +4349,7 @@ mod pcm_info_tests { fn an_app_decoded_lossy_track_loads_as_pcm_at_a_speed() { let mut ps = crate::route::PlaybackSession::IDLE; crate::route::begin_attempt_for_test( - &mut ps, std::sync::Arc::new(plx_platform::devcaps::Caps::assumed().with_app_lossy()), + &mut ps, std::sync::Arc::new(plx_os::devcaps::Caps::assumed().with_app_lossy()), ); for codec in ["mp3", "vorbis", "truehd"] { crate::route::set_stream_codecs(&mut ps, "h264", codec); @@ -4391,8 +4391,8 @@ mod pcm_info_tests { mod sink_envelope_tests { use super::*; - fn caps(h264: (u32, u32, u32), hevc: (u32, u32, u32)) -> plx_platform::devcaps::Caps { - let mut c = plx_platform::devcaps::Caps::assumed(); + fn caps(h264: (u32, u32, u32), hevc: (u32, u32, u32)) -> plx_os::devcaps::Caps { + let mut c = plx_os::devcaps::Caps::assumed(); c.h264_row = h264; c.hevc_row = hevc; c @@ -4442,11 +4442,11 @@ mod sink_envelope_tests { /// declare, or for a row with no rate, the flat [`SPEED_MAX_FPS`] ceiling stands. #[test] fn the_speed_offer_stops_at_the_measured_rows_frame_rate() { - let row30 = plx_platform::devcaps::Caps { + let row30 = plx_os::devcaps::Caps { h264_row: (3840, 2160, 30), - ..plx_platform::devcaps::Caps::assumed() + ..plx_os::devcaps::Caps::assumed() }; - let offered = |fps: f64, video: Option, caps: &plx_platform::devcaps::Caps, measured: bool| { + let offered = |fps: f64, video: Option, caps: &plx_os::devcaps::Caps, measured: bool| { crate::player::speeds_within(fps, speed_fps_ceiling(video, caps, measured)) }; assert_eq!( @@ -4470,15 +4470,15 @@ mod sink_envelope_tests { ( "a row with no rate", Some(LoadVideo::H264), - &plx_platform::devcaps::Caps { h264_row: (3840, 2160, 0), ..plx_platform::devcaps::Caps::assumed() }, + &plx_os::devcaps::Caps { h264_row: (3840, 2160, 0), ..plx_os::devcaps::Caps::assumed() }, true, ), ] { assert_eq!(speed_fps_ceiling(video, caps, measured), crate::player::SPEED_MAX_FPS, "{what}"); } - let row120 = plx_platform::devcaps::Caps { + let row120 = plx_os::devcaps::Caps { h264_row: (3840, 2160, 120), - ..plx_platform::devcaps::Caps::assumed() + ..plx_os::devcaps::Caps::assumed() }; assert_eq!( speed_fps_ceiling(Some(LoadVideo::H264), &row120, true), @@ -4556,7 +4556,7 @@ mod sink_envelope_tests { assert_eq!(sink_envelope(LoadVideo::H265, (0, 0), 0.0, &c, true), ENVELOPE_FHD60); // the same rows, not measured: never a clamp assert_eq!(sink_envelope(LoadVideo::H265, (3840, 2160), 0.0, &c, false), ENVELOPE_UHD60); - assert_eq!(sink_envelope(LoadVideo::H265, (0, 0), 0.0, &plx_platform::devcaps::Caps::assumed(), true), ENVELOPE_UHD60); + assert_eq!(sink_envelope(LoadVideo::H265, (0, 0), 0.0, &plx_os::devcaps::Caps::assumed(), true), ENVELOPE_UHD60); // a table stating a lower frame rate clamps it; a higher one never raises it let slow = caps((3840, 2160, 30), (3840, 2160, 120)); assert_eq!(sink_envelope(LoadVideo::H264, (3840, 2160), 0.0, &slow, true).fps, 30); @@ -4639,7 +4639,7 @@ mod sink_envelope_tests { 0.0, plx_data::metadata::Dovi::NONE, false, - plx_platform::devcaps::dv::DvCapability::Supported, + plx_os::devcaps::dv::DvCapability::Supported, )); crate::route::set_carried_audio_for_test( &mut ps, @@ -4797,21 +4797,21 @@ mod sink_envelope_tests { #[test] fn load_video_refused_only_for_av1_and_vp9_without_their_rows() { - let assumed = plx_platform::devcaps::Caps::assumed(); + let assumed = plx_os::devcaps::Caps::assumed(); assert!(load_video_refused(LoadVideo::Av1, &assumed)); assert!(load_video_refused(LoadVideo::Vp9, &assumed)); assert!(!load_video_refused(LoadVideo::H264, &assumed)); assert!(!load_video_refused(LoadVideo::H265, &assumed)); - let with_row = plx_platform::devcaps::Caps { + let with_row = plx_os::devcaps::Caps { av1: true, vp9: true, - ..plx_platform::devcaps::Caps::assumed() + ..plx_os::devcaps::Caps::assumed() }; for video in [LoadVideo::H264, LoadVideo::H265, LoadVideo::Av1, LoadVideo::Vp9] { assert!(!load_video_refused(video, &with_row), "{video:?}"); } // one row never admits the other codec - let av1_only = plx_platform::devcaps::Caps { av1: true, ..plx_platform::devcaps::Caps::assumed() }; + let av1_only = plx_os::devcaps::Caps { av1: true, ..plx_os::devcaps::Caps::assumed() }; assert!(load_video_refused(LoadVideo::Vp9, &av1_only)); } @@ -5636,7 +5636,7 @@ mod pcm_sink_lead_pure_tests { #[cfg(all(test, feature = "hostsim"))] mod pcm_stack_wiring_tests { use super::*; - use plx_platform::devcaps::{audio_stack_on_this_thread_for_test, AudioStack}; + use plx_os::devcaps::{audio_stack_on_this_thread_for_test, AudioStack}; struct Cleanup; impl Drop for Cleanup { diff --git a/rust-modules/media/src/player/feed_open.rs b/rust-modules/media/src/player/feed_open.rs index d3f52a20cb..eb918804a6 100644 --- a/rust-modules/media/src/player/feed_open.rs +++ b/rust-modules/media/src/player/feed_open.rs @@ -219,16 +219,16 @@ pub(super) fn dv_landing_plan(ps: &route::PlaybackSession) -> plx_playback_contr }; DvLandingPlan { mode, - idr_first: route::dv_first_picture(ps) == plx_platform::devcaps::DvFirstPicture::IdrOnly, + idr_first: route::dv_first_picture(ps) == plx_os::devcaps::DvFirstPicture::IdrOnly, } } /// Apply the current route's selected codec and Force policy to the native speed ceiling. pub(crate) fn speed_fps_ceiling_now(ps: &route::PlaybackSession) -> f64 { super::engine::speed_fps_ceiling( - plx_platform::devcaps::LoadVideo::of_stream(&route::stream_vcodec(ps)), - &plx_platform::devcaps::caps(), - plx_platform::devcaps::measured() && !route::forced_direct_play(ps), + plx_os::devcaps::LoadVideo::of_stream(&route::stream_vcodec(ps)), + &plx_os::devcaps::caps(), + plx_os::devcaps::measured() && !route::forced_direct_play(ps), ) } diff --git a/rust-modules/media/src/player/machine.rs b/rust-modules/media/src/player/machine.rs index 110af56bbc..dc9ed736a9 100644 --- a/rust-modules/media/src/player/machine.rs +++ b/rust-modules/media/src/player/machine.rs @@ -130,21 +130,21 @@ impl Default for Player { /// Logical repair authority; resource handles live in PlayerAdapter. No reset-on-playback API. pub struct RepairAttempt { - state: plx_platform::tv::sandbox::State, + state: plx_os::tv::sandbox::State, } impl RepairAttempt { - pub const fn new() -> Self { Self { state: plx_platform::tv::sandbox::State::Idle } } - pub fn state(&self) -> plx_platform::tv::sandbox::State { self.state } + pub const fn new() -> Self { Self { state: plx_os::tv::sandbox::State::Idle } } + pub fn state(&self) -> plx_os::tv::sandbox::State { self.state } pub fn begin(&mut self, supported: bool) -> Option { - use plx_platform::tv::sandbox::{State, Failure}; + use plx_os::tv::sandbox::{State, Failure}; if self.state != State::Idle { return None; } if !supported { self.state = State::Failed(Failure::Unsupported); return None; } self.state = State::Running; Some(1) } /// The single issued token can land only once. Wrong/duplicate completions cannot rewrite it. - pub fn complete(&mut self, token: u64, result: Result<(), plx_platform::tv::sandbox::Failure>) -> bool { - use plx_platform::tv::sandbox::State; + pub fn complete(&mut self, token: u64, result: Result<(), plx_os::tv::sandbox::Failure>) -> bool { + use plx_os::tv::sandbox::State; if token != 1 || self.state != State::Running { return false; } self.state = match result { Ok(()) => State::Repaired, Err(e) => State::Failed(e) }; true @@ -154,7 +154,7 @@ impl RepairAttempt { #[cfg(test)] mod repair_tests { use super::*; - use plx_platform::tv::sandbox::Failure; + use plx_os::tv::sandbox::Failure; // `repair_survives_screen_and_session_recreation_and_rejects_stale_completions` builds a // `PlayerScreen`, which `player` may not name: it lives in `screens::player`'s // `repair_confirmation_tests`, beside the screen it recreates. diff --git a/rust-modules/media/src/player/mod.rs b/rust-modules/media/src/player/mod.rs index eea3ef65b6..c38a22a32c 100644 --- a/rust-modules/media/src/player/mod.rs +++ b/rust-modules/media/src/player/mod.rs @@ -94,8 +94,8 @@ use plx_playback_contract::feed::{UserPauseOutcome, UserResumeOutcome}; /// The process's ACB plane owner: the one holder of the video-plane binding for every backend, /// booted once by the application's `acb_init` (`app/adapters/backends.rs`). It replaces the old `ACB_OK` / `PTYPE` statics. -pub(crate) fn plane() -> &'static plx_platform::tv::plane::PlaneOwner { - plx_platform::tv::plane::installed() +pub(crate) fn plane() -> &'static plx_os::tv::plane::PlaneOwner { + plx_os::tv::plane::installed() } /// `/tmp/plxnative-tracknames[=