From 9d5360cc0766447bb83bfe700cdfbe3e69173e17 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 20 Nov 2026 04:20:28 +0300 Subject: [PATCH 1/8] Rename the bottom layer crate plx_platform to plx_os (Wave R) `plx_platform` becomes `plx_os`, `rust-modules/platform/` becomes `rust-modules/os/`, the layer `[platform]` becomes `[os]`, the fence keyword `[port X]` becomes `[platform X]` and `SRC_PLATFORM` becomes `SRC_OS`. No behaviour change. The inner `tv` module stays. The rewrite is `tools/rename-os-layer.py` (stdlib, run with -I), shipped for the open PRs and the release lines that still carry the old names: - forward (idempotent) and `--reverse`, which rewrites only the sites the forward pass writes; - `--reverse-patch FILE`, the backport route: a post-rename `git diff` is rewritten hunk line by hunk line (the enumerated sites are per file) so `git apply` accepts it on a line with the old names; - `--check`: every old-name site in the three spellings (the package, the path incl. the bare `platform/..` and `../platform` forms, the layer token) plus every enumerated literal site, and every quoted "platform" in both quote styles is classified (a JSON key, a Sentry field, sys.platform) or fails; a quoted platform in a list of layer names is never a keeper (the report.rs and release-config-check.py lists, N1); - `--equivalence BASE`: HEAD against script(BASE) and BASE against reverse(HEAD), allowing only (a) the two certificates and their pin lines, (b) Cargo.lock as a sorted-line multiset, (c) a .rs hunk with the same token multiset, (d) the tool, its test and its two lines in ci/check-python-steps.txt. `ci/test_rename_os_layer.py` (16 cases, synthetic trees and a throwaway git repo) is wired into `ci/check-python-steps.txt`. rustfmt was not run: there is no fmt gate and no line needed a reflow. Cargo.lock: the script renames the package, then cargo (a plain `make test-crate`, offline) re-sorts it: `plx_os` sorts before `plx_owp`, so that one package block moved above it. The lines are the same multiset as origin/main's with plx_platform spelled plx_os, so no version moved (`--equivalence` checks exactly that), and `cargo metadata --offline --locked` accepts the committed lock. Certificate re-pins (both reviewed; every changed hash is a consequence of the rename): ci/proofs/platform-generated-enums.json (keeps its name), pinned by ci/readonly_generated.py CERTIFICATE_SHA256 1b3b34fa...6503 -> ac7a32d9...60c3 I18N_SOURCES[1] (the reviewed variant of os/src/i18n/mod.rs; its only change is the comment path platform/build_support/catalog.rs) 2c978e3a...4d52 -> 7119e673...b463 changed: package, module, the key platform/ -> os/ for 5 sources and the manifest key; hashes of os/Cargo.toml, os/src/lib.rs, os/src/i18n/mod.rs, build_support/install_identities.rs, the lock and the manifests of the root, appkit, data, media, play-feed, play-uri, plex, screens, session, storage, telemetry, ui and os. Unchanged: os/build.rs, os/build_support/catalog.rs, machine/*. ci/proofs/serde-json-immutable.json (serde_json 1.0.154, archive checksum verified), pinned by ci/readonly_dependencies.py CERTIFICATE_SHA256 915ab64b...6540 -> dc193808...2fc4f changed: lock_sha256, the same 13 manifest hashes and the manifest key platform -> os, and the lib_sha256 of the owners os, data, media, net, play-feed, plex, session, storage and telemetry (their lib files name the layer in a doc comment or a #[path]). Verified here: `--check` 0 sites left; `--equivalence origin/main` ok; ci/test_rename_os_layer.py, ci/test_readonly_{generated,dependencies}.py, test_module_graph, test_build_bench, test_no_host_staticlib, test_storage_package_isolated, test_check_machine_shape, test_ci_split, test_cargo_seed, check-module-layers (0 migration entries), check-list-caps, check-localization, check-deps.sh (all green); cargo check --workspace --locked; make test-crate C=plx_os (442 passed). Not run here: make check, check-nodef, the ARM cross-build, build-bench, a TV boot. Co-Authored-By: Claude Sonnet 5.5 --- .agents/agents/fw-compat-reviewer.md | 8 +- .agents/skills/which-tier/SKILL.md | 4 +- .claude/hooks/release-config-check-test.py | 2 +- .claude/hooks/release-config-check.py | 2 +- .github/workflows/ci.yml | 4 +- AGENTS.md | 2 +- Makefile | 22 +- ci/allow/language-lists.txt | 2 +- ci/build-budgets.json | 2 +- ci/check-build-budgets.py | 4 +- ci/check-deps.sh | 52 +- ci/check-language-lists.py | 2 +- ci/check-localization.py | 4 +- ci/check-module-layers.py | 16 +- ci/check-python-steps.txt | 4 +- ci/list-caps.ini | 46 +- ci/module-layers.ini | 46 +- ci/proofs/platform-generated-enums.json | 144 ++--- ci/proofs/serde-json-immutable.json | 64 +-- ci/readonly_dependencies.py | 2 +- ci/readonly_generated.py | 20 +- ci/test_build_bench.py | 16 +- ci/test_build_not_always_dirty.py | 8 +- ci/test_check_language_lists.py | 2 +- ci/test_check_machine_shape.py | 2 +- ci/test_check_placeholders.py | 2 +- ci/test_ci_split.py | 6 +- ci/test_module_graph.py | 14 +- ci/test_no_host_staticlib.py | 4 +- ci/test_readonly_generated.py | 32 +- ci/test_rename_os_layer.py | 370 +++++++++++++ ci/test_storage_package_isolated.py | 4 +- ci/test_test_crate.py | 2 +- ci/test_test_fast.py | 4 +- ci/test_ui_boundaries.py | 4 +- docs/agent-reference.md | 16 +- docs/hud-plugins.md | 4 +- docs/lab-diagnostics.md | 4 +- docs/launch-links.md | 2 +- docs/localization.md | 6 +- docs/module-layers.md | 182 +++---- docs/poster-scheduler-design.md | 2 +- docs/sans-io-guide.md | 4 +- docs/sans-io.md | 2 +- docs/shared-servers.md | 2 +- docs/uri-first-migration.md | 2 +- docs/watchlist-plan.md | 8 +- docs/webos5-port.md | 2 +- rust-modules/Cargo.lock | 40 +- rust-modules/Cargo.toml | 22 +- rust-modules/appkit/Cargo.toml | 8 +- rust-modules/appkit/src/hero_layout.rs | 14 +- rust-modules/appkit/src/hero_layout_tests.rs | 4 +- rust-modules/appkit/src/hud_format/compile.rs | 6 +- .../appkit/src/hud_format/compile_tests.rs | 6 +- rust-modules/appkit/src/hud_format/lint.rs | 2 +- .../appkit/src/hud_format/lint_tests.rs | 2 +- .../appkit/src/hud_format/lint_text.rs | 2 +- rust-modules/appkit/src/info_panel.rs | 26 +- rust-modules/appkit/src/more_menu.rs | 36 +- rust-modules/appkit/src/player_hud/classic.rs | 8 +- rust-modules/appkit/src/player_hud/loaded.rs | 34 +- rust-modules/appkit/src/player_hud/mod.rs | 4 +- rust-modules/appkit/src/player_hud/motion.rs | 2 +- rust-modules/appkit/src/player_hud/render.rs | 34 +- .../player_hud/render/tests/conformance.rs | 30 +- .../player_hud/render/tests/transitions.rs | 28 +- rust-modules/appkit/src/player_hud/state.rs | 36 +- rust-modules/appkit/src/player_hud/strip.rs | 2 +- rust-modules/appkit/src/player_hud/tests.rs | 32 +- rust-modules/appkit/src/player_hud/travel.rs | 2 +- rust-modules/appkit/src/scrub_preview.rs | 2 +- rust-modules/appkit/src/skip_pill.rs | 10 +- rust-modules/appkit/src/source_list.rs | 22 +- rust-modules/appkit/src/timing_capsule.rs | 16 +- rust-modules/appkit/src/track_menu.rs | 240 ++++----- rust-modules/appkit/src/up_next.rs | 12 +- rust-modules/appkit/src/version_list.rs | 10 +- rust-modules/base/src/eventlog/scrub.rs | 4 +- rust-modules/build.rs | 2 +- .../build_support/install_identities.rs | 2 +- rust-modules/data/Cargo.toml | 10 +- rust-modules/data/src/browse/bands.rs | 2 +- .../data/src/browse/library_type_tests.rs | 2 +- rust-modules/data/src/browse/listing_jobs.rs | 2 +- rust-modules/data/src/browse/mod.rs | 34 +- rust-modules/data/src/browse/section_hubs.rs | 2 +- rust-modules/data/src/browse/view.rs | 4 +- rust-modules/data/src/lib.rs | 2 +- rust-modules/data/src/metadata.rs | 28 +- rust-modules/data/src/metadata/sub_layout.rs | 8 +- rust-modules/data/src/metadata/track_label.rs | 10 +- .../data/src/metadata_credits_tests.rs | 2 +- .../data/src/metadata_dolby_vision_tests.rs | 8 +- rust-modules/data/src/person.rs | 2 +- rust-modules/data/src/pms.rs | 2 +- .../data/src/pms_multi_source_merge_tests.rs | 6 +- rust-modules/data/src/search.rs | 14 +- rust-modules/data/src/sortfacts.rs | 6 +- rust-modules/gfx/src/gfx.rs | 4 +- rust-modules/gfx/src/lib.rs | 2 +- rust-modules/media/Cargo.toml | 12 +- rust-modules/media/src/lib.rs | 2 +- rust-modules/media/src/player/CLAUDE.md | 4 +- rust-modules/media/src/player/adapter.rs | 16 +- rust-modules/media/src/player/ass.rs | 2 +- .../media/src/player/dv_start_pump_tests.rs | 2 +- rust-modules/media/src/player/engine.rs | 88 ++-- rust-modules/media/src/player/feed_open.rs | 8 +- rust-modules/media/src/player/machine.rs | 14 +- rust-modules/media/src/player/mod.rs | 156 +++--- rust-modules/media/src/player/pump.rs | 100 ++-- rust-modules/media/src/player/recovery.rs | 32 +- rust-modules/media/src/player/report.rs | 10 +- rust-modules/media/src/player/route_start.rs | 2 +- rust-modules/media/src/player/sidecar.rs | 8 +- .../media/src/player/test_physical.rs | 6 +- .../media/src/player/uriprobe_drive.rs | 10 +- rust-modules/media/src/route/decision.rs | 116 ++--- .../route/decision_audio_enhancement_tests.rs | 12 +- .../route/decision_direct_play_mode_tests.rs | 14 +- .../media/src/route/decision_flight_rig.rs | 4 +- .../media/src/route/decision_plan_tests.rs | 22 +- .../decision_prefs_characterisation_tests.rs | 2 +- .../route/decision_quality_recovery_tests.rs | 12 +- .../src/route/decision_resolve_route_tests.rs | 92 ++-- .../src/route/decision_timeline_tests.rs | 4 +- .../media/src/route/decision_version_tests.rs | 32 +- rust-modules/media/src/route/plan.rs | 56 +- .../src/route/plan_audio_enhancement_tests.rs | 10 +- .../media/src/route/plan_av1_tests.rs | 32 +- .../src/route/plan_codec_agreement_tests.rs | 4 +- .../src/route/plan_default_version_tests.rs | 4 +- .../src/route/plan_dolby_vision_tests.rs | 146 +++--- .../src/route/plan_track_memory_tests.rs | 4 +- .../src/route/plan_track_selection_tests.rs | 140 ++--- rust-modules/media/src/route/uri_preflight.rs | 14 +- rust-modules/net/src/lib.rs | 2 +- rust-modules/{platform => os}/Cargo.toml | 4 +- rust-modules/{platform => os}/build.rs | 0 .../{platform => os}/build_support/catalog.rs | 0 rust-modules/{platform => os}/src/devcaps.rs | 0 .../{platform => os}/src/devcaps/dv.rs | 0 rust-modules/{platform => os}/src/i18n/mod.rs | 2 +- .../{platform => os}/src/i18n/tests.rs | 0 rust-modules/{platform => os}/src/imgcache.rs | 0 .../{platform => os}/src/imgcache/tests.rs | 0 .../{platform => os}/src/keymanager.rs | 0 .../{platform => os}/src/labcfg/config.rs | 0 .../{platform => os}/src/labcfg/mod.rs | 2 +- rust-modules/{platform => os}/src/lib.rs | 6 +- .../{platform => os}/src/playback_trace.rs | 0 .../{platform => os}/src/storage/client.rs | 0 .../src/storage/diagnostics.rs | 0 .../{platform => os}/src/storage/mod.rs | 0 .../{platform => os}/src/storage/state.rs | 0 .../src/storage_service/activation.rs | 0 .../src/storage_service/auxv.rs | 0 .../src/storage_service/backend.rs | 0 .../src/storage_service/bus.rs | 0 .../src/storage_service/failure.rs | 0 .../src/storage_service/keymanager.rs | 0 .../src/storage_service/runtime.rs | 0 .../src/storage_service/service.rs | 0 .../src/storage_service/wire.rs | 0 rust-modules/{platform => os}/src/tv.rs | 0 .../{platform => os}/src/tv/device.rs | 0 rust-modules/{platform => os}/src/tv/home.rs | 0 .../{platform => os}/src/tv/launch.rs | 0 rust-modules/{platform => os}/src/tv/plane.rs | 0 .../{platform => os}/src/tv/sandbox.rs | 0 .../{platform => os}/src/tv/secure.rs | 0 rust-modules/{platform => os}/src/tv/sink.rs | 0 rust-modules/{platform => os}/src/tv/sound.rs | 0 rust-modules/{platform => os}/src/tv/toast.rs | 0 rust-modules/{platform => os}/src/tv/uri.rs | 0 .../{platform => os}/src/tv/window.rs | 0 rust-modules/{platform => os}/src/webos.rs | 0 .../{platform => os}/src/webos/caps.rs | 0 .../{platform => os}/src/webos/jail_repair.rs | 0 .../{platform => os}/src/webos/ls2/uri.rs | 0 .../{platform => os}/src/webos/toast.rs | 0 .../{platform => os}/src/webos/video_sink.rs | 0 rust-modules/play-feed/Cargo.toml | 4 +- rust-modules/play-feed/src/control.rs | 4 +- rust-modules/play-feed/src/dv_start.rs | 2 +- rust-modules/play-feed/src/feed_pump.rs | 8 +- rust-modules/play-feed/src/feed_resources.rs | 2 +- rust-modules/play-feed/src/ff.rs | 6 +- rust-modules/play-feed/src/ff_pcm.rs | 2 +- rust-modules/play-feed/src/ffi_host.rs | 14 +- rust-modules/play-feed/src/lib.rs | 18 +- rust-modules/play-feed/src/native_executor.rs | 30 +- rust-modules/play-feed/src/native_load.rs | 4 +- rust-modules/play-feed/src/pcm_lead.rs | 6 +- rust-modules/play-feed/src/physical.rs | 2 +- rust-modules/play-feed/src/seek.rs | 6 +- rust-modules/play-feed/src/sf_event.rs | 2 +- rust-modules/play-feed/src/sink_fence.rs | 4 +- rust-modules/play-uri/Cargo.toml | 8 +- rust-modules/play-uri/src/acb_bind.rs | 6 +- rust-modules/play-uri/src/acb_drive.rs | 14 +- rust-modules/play-uri/src/backend.rs | 98 ++-- rust-modules/play-uri/src/register_ladder.rs | 2 +- rust-modules/play-uri/src/session_io.rs | 4 +- rust-modules/play-uri/src/uri_lifecycle.rs | 8 +- rust-modules/play-uri/src/uri_protocol.rs | 4 +- rust-modules/play-uri/src/uriprobe.rs | 46 +- rust-modules/play-uri/src/uriprobe_drive.rs | 12 +- rust-modules/plex/Cargo.toml | 10 +- rust-modules/plex/src/lib.rs | 2 +- .../plex/src/plex/account/preferences.rs | 12 +- rust-modules/plex/src/plex/client.rs | 4 +- rust-modules/plex/src/plex/hub_title.rs | 2 +- rust-modules/plex/src/plex/identity.rs | 18 +- rust-modules/plex/src/plex/params.rs | 2 +- rust-modules/plex/src/plex/servers.rs | 2 +- rust-modules/plex/src/plex/session.rs | 136 ++--- .../src/plex/session/async_persistence.rs | 28 +- .../src/plex/session/install_preferences.rs | 6 +- .../plex/src/plex/session/migration_tests.rs | 46 +- .../plex/src/plex/session/persistence.rs | 72 +-- .../plex/src/plex/session/playback_options.rs | 6 +- rust-modules/plex/src/plex/session/prefs.rs | 2 +- .../prefs/track_memory_document_tests.rs | 16 +- .../session/prefs_characterisation_tests.rs | 28 +- .../plex/src/plex/session/prefs_tests.rs | 6 +- .../session/tier1_characterisation_tests.rs | 10 +- rust-modules/plex/src/plex/session/v0.rs | 8 +- .../plex/src/plex/session_cache_tests.rs | 8 +- .../plex/src/plex/session_compat_tests.rs | 14 +- .../src/plex/session_persistence_tests.rs | 50 +- rust-modules/plex/src/plex/transcoder.rs | 78 +-- rust-modules/screens/Cargo.toml | 8 +- rust-modules/screens/src/about_panel.rs | 4 +- rust-modules/screens/src/account_menu.rs | 32 +- rust-modules/screens/src/alt_sources.rs | 2 +- rust-modules/screens/src/alt_sources_tests.rs | 2 +- rust-modules/screens/src/catalog.rs | 20 +- rust-modules/screens/src/catalog_tests.rs | 2 +- rust-modules/screens/src/clock_readout.rs | 8 +- rust-modules/screens/src/collection.rs | 36 +- rust-modules/screens/src/consent.rs | 106 ++-- .../screens/src/consent_delete_alert_tests.rs | 4 +- .../screens/src/consent_focus_tests.rs | 4 +- .../screens/src/consent_scope_tests.rs | 24 +- .../screens/src/consent_text_fit_tests.rs | 10 +- rust-modules/screens/src/consent_v2_tests.rs | 2 +- rust-modules/screens/src/detail/about.rs | 50 +- rust-modules/screens/src/detail/cast.rs | 8 +- rust-modules/screens/src/detail/episodes.rs | 4 +- rust-modules/screens/src/detail/extras.rs | 2 +- rust-modules/screens/src/detail/hero.rs | 42 +- .../screens/src/detail/identity_tests.rs | 2 +- rust-modules/screens/src/detail/mod.rs | 10 +- rust-modules/screens/src/detail/related.rs | 2 +- rust-modules/screens/src/detail/tests.rs | 8 +- rust-modules/screens/src/detail/trailer.rs | 4 +- rust-modules/screens/src/filmography.rs | 10 +- rust-modules/screens/src/home/mod.rs | 12 +- rust-modules/screens/src/home/tests.rs | 4 +- rust-modules/screens/src/hud_settings.rs | 74 +-- .../screens/src/hud_settings_tests.rs | 90 ++-- rust-modules/screens/src/inputs.rs | 8 +- rust-modules/screens/src/item_menu.rs | 32 +- rust-modules/screens/src/item_menu/hold.rs | 6 +- .../screens/src/item_menu/hold_tests.rs | 2 +- .../screens/src/item_menu/watchlist.rs | 8 +- .../screens/src/item_menu/watchlist_tests.rs | 2 +- rust-modules/screens/src/legal.rs | 142 ++--- .../src/library/collections_listing_tests.rs | 4 +- .../screens/src/library/collections_page.rs | 2 +- .../src/library/collections_page_tests.rs | 2 +- rust-modules/screens/src/library/header.rs | 14 +- .../screens/src/library/header_tests.rs | 22 +- rust-modules/screens/src/library/menu.rs | 64 +-- rust-modules/screens/src/library/parts.rs | 8 +- .../screens/src/library/rail_bands.rs | 12 +- .../screens/src/library/recommended.rs | 6 +- .../screens/src/library/recommended_tests.rs | 8 +- .../src/library/sort_value_kinds_tests.rs | 2 +- rust-modules/screens/src/library/status.rs | 18 +- rust-modules/screens/src/library/tests.rs | 8 +- rust-modules/screens/src/login.rs | 142 ++--- .../screens/src/login_text_fit_tests.rs | 10 +- rust-modules/screens/src/onboard.rs | 26 +- rust-modules/screens/src/person.rs | 20 +- rust-modules/screens/src/person_bio.rs | 16 +- .../screens/src/plaintext_question.rs | 14 +- .../src/player/compiled_geometry_tests.rs | 8 +- .../screens/src/player/hud_pins_tests.rs | 8 +- rust-modules/screens/src/player/mod.rs | 14 +- .../screens/src/player/overlay_tests.rs | 4 +- rust-modules/screens/src/preferences.rs | 168 +++--- .../screens/src/preferences/picker.rs | 8 +- .../screens/src/preferences/picker_tests.rs | 10 +- rust-modules/screens/src/preferences_tests.rs | 42 +- .../screens/src/preferences_text_fit_tests.rs | 34 +- rust-modules/screens/src/profiles.rs | 18 +- .../screens/src/profiles_session_tests.rs | 2 +- rust-modules/screens/src/registry.rs | 8 +- rust-modules/screens/src/registry/captions.rs | 2 +- .../screens/src/registry/sort_info.rs | 20 +- rust-modules/screens/src/search/layout.rs | 2 +- rust-modules/screens/src/search/render.rs | 44 +- rust-modules/screens/src/settings.rs | 130 ++--- .../screens/src/settings_diagnostics.rs | 12 +- .../screens/src/settings_language_tests.rs | 14 +- .../src/settings_nav_structure_tests.rs | 6 +- .../screens/src/settings_push_tests.rs | 2 +- .../src/settings_root_navigation_tests.rs | 24 +- .../screens/src/settings_text_fit_tests.rs | 32 +- .../screens/src/settings_under_posters.rs | 40 +- .../src/settings_under_posters_tests.rs | 70 +-- rust-modules/screens/src/settings_v2_tests.rs | 6 +- .../screens/src/settings_warm_tests.rs | 4 +- rust-modules/screens/src/tracks_panel.rs | 80 +-- rust-modules/screens/src/watchlist/caption.rs | 2 +- .../screens/src/watchlist/caption_tests.rs | 2 +- rust-modules/screens/src/watchlist/header.rs | 8 +- rust-modules/screens/src/watchlist/options.rs | 2 +- .../screens/src/watchlist/options_tests.rs | 4 +- rust-modules/screens/src/watchlist/page.rs | 2 +- .../screens/src/watchlist/page_tests.rs | 2 +- rust-modules/screens/src/watchlist/readout.rs | 16 +- rust-modules/session/Cargo.toml | 10 +- rust-modules/session/src/auth.rs | 34 +- rust-modules/session/src/auth/owner.rs | 56 +- .../session/src/auth/owner/attempt.rs | 32 +- .../owner/attempt_characterization_tests.rs | 2 +- .../session/src/auth/owner/incident_tests.rs | 6 +- rust-modules/session/src/auth/ports.rs | 20 +- rust-modules/session/src/auth/scripted.rs | 2 +- rust-modules/session/src/auth_cause_tests.rs | 2 +- .../session/src/auth_discovery_tests.rs | 10 +- rust-modules/session/src/lib.rs | 2 +- rust-modules/src/app/adapters/backends.rs | 40 +- rust-modules/src/app/adapters/huds.rs | 8 +- rust-modules/src/app/adapters/poster.rs | 98 ++-- .../src/app/adapters/poster/baked_tests.rs | 12 +- .../src/app/adapters/poster/card/tests.rs | 4 +- rust-modules/src/app/adapters/poster/cover.rs | 2 +- .../src/app/adapters/poster/cover/tests.rs | 2 +- rust-modules/src/app/adapters/poster/fan.rs | 2 +- rust-modules/src/app/adapters/poster/miss.rs | 2 +- .../src/app/adapters/poster/refresh.rs | 10 +- .../src/app/adapters/poster/workers.rs | 26 +- rust-modules/src/app/adapters/session.rs | 38 +- rust-modules/src/app/adapters/stores.rs | 2 +- rust-modules/src/app/boot.rs | 28 +- rust-modules/src/app/bootstrap.rs | 4 +- rust-modules/src/app/bootstrap/effects.rs | 8 +- rust-modules/src/app/bootstrap/tests.rs | 2 +- rust-modules/src/app/bridge.rs | 50 +- rust-modules/src/app/chrome.rs | 6 +- rust-modules/src/app/clock.rs | 8 +- rust-modules/src/app/clock_notice.rs | 12 +- .../src/app/collection_crumb_route_tests.rs | 8 +- rust-modules/src/app/deeplink.rs | 4 +- rust-modules/src/app/deeplink_route_tests.rs | 22 +- rust-modules/src/app/diagnostics.rs | 490 +++++++++--------- rust-modules/src/app/events.rs | 2 +- rust-modules/src/app/input.rs | 24 +- rust-modules/src/app/lifecycle.rs | 24 +- rust-modules/src/app/mod.rs | 8 +- rust-modules/src/app/page_title.rs | 2 +- rust-modules/src/app/playback.rs | 22 +- rust-modules/src/app/plex_visual_inputs.rs | 4 +- rust-modules/src/app/run.rs | 80 +-- rust-modules/src/app/run_uri_boot_tests.rs | 38 +- rust-modules/src/app/runtime_owners.rs | 2 +- .../src/app/surface_navigation_tests.rs | 2 +- .../src/app/under_posters_band_route_tests.rs | 4 +- .../src/app/watchlist_disc_route_tests.rs | 4 +- rust-modules/src/dev.rs | 2 +- rust-modules/src/dev/scenarios.rs | 2 +- rust-modules/src/dev/scenarios/toast_probe.rs | 2 +- rust-modules/src/dev/uri_exported.rs | 4 +- rust-modules/src/dev/uri_product.rs | 2 +- rust-modules/src/dev/uriprobe.rs | 2 +- rust-modules/src/dev/uriprobe_tests.rs | 40 +- rust-modules/src/lab/control.rs | 2 +- rust-modules/src/lab/mod.rs | 6 +- rust-modules/src/lab/snapshot.rs | 12 +- rust-modules/src/lab/toast.rs | 6 +- rust-modules/src/lab/upload.rs | 2 +- rust-modules/src/lib.rs | 2 +- rust-modules/src/port.rs | 46 +- rust-modules/storage/Cargo.toml | 2 +- rust-modules/storage/build.rs | 2 +- rust-modules/storage/src/main.rs | 14 +- rust-modules/telemetry/Cargo.toml | 10 +- rust-modules/telemetry/src/diag/schema.rs | 8 +- rust-modules/telemetry/src/lib.rs | 2 +- .../telemetry/src/telemetry/consent.rs | 6 +- .../telemetry/src/telemetry/crashreport.rs | 6 +- .../telemetry/src/telemetry/incident.rs | 12 +- .../telemetry/src/telemetry/native.rs | 8 +- .../telemetry/src/telemetry/persistence.rs | 102 ++-- .../telemetry/src/telemetry/playback.rs | 12 +- .../telemetry/src/telemetry/sentry.rs | 8 +- rust-modules/ui/Cargo.toml | 8 +- rust-modules/ui/src/CLAUDE.md | 2 +- rust-modules/ui/src/caption_policy.rs | 16 +- rust-modules/ui/src/caption_policy_tests.rs | 12 +- rust-modules/ui/src/card_row.rs | 2 +- rust-modules/ui/src/consts.rs | 4 +- rust-modules/ui/src/decision_alert.rs | 8 +- rust-modules/ui/src/fmt.rs | 78 +-- rust-modules/ui/src/hold_hint.rs | 14 +- rust-modules/ui/src/route_screen.rs | 14 +- rust-modules/ui/src/runtime_warning.rs | 2 +- rust-modules/ui/src/scroll_chrome.rs | 4 +- rust-modules/ui/src/still_footer.rs | 12 +- rust-modules/ui/src/table.rs | 12 +- rust-modules/ui/src/text_view.rs | 8 +- rust-modules/ui/src/widgets.rs | 10 +- src/main.c | 4 +- tests/test_harness.py | 30 +- tools/build-bench.py | 36 +- tools/cargo-seed.py | 2 +- tools/plxnative-lab | 2 +- tools/rename-os-layer.py | 426 +++++++++++++++ 423 files changed, 4619 insertions(+), 3821 deletions(-) create mode 100644 ci/test_rename_os_layer.py rename rust-modules/{platform => os}/Cargo.toml (98%) rename rust-modules/{platform => os}/build.rs (100%) rename rust-modules/{platform => os}/build_support/catalog.rs (100%) rename rust-modules/{platform => os}/src/devcaps.rs (100%) rename rust-modules/{platform => os}/src/devcaps/dv.rs (100%) rename rust-modules/{platform => os}/src/i18n/mod.rs (99%) rename rust-modules/{platform => os}/src/i18n/tests.rs (100%) rename rust-modules/{platform => os}/src/imgcache.rs (100%) rename rust-modules/{platform => os}/src/imgcache/tests.rs (100%) rename rust-modules/{platform => os}/src/keymanager.rs (100%) rename rust-modules/{platform => os}/src/labcfg/config.rs (100%) rename rust-modules/{platform => os}/src/labcfg/mod.rs (98%) rename rust-modules/{platform => os}/src/lib.rs (89%) rename rust-modules/{platform => os}/src/playback_trace.rs (100%) rename rust-modules/{platform => os}/src/storage/client.rs (100%) rename rust-modules/{platform => os}/src/storage/diagnostics.rs (100%) rename rust-modules/{platform => os}/src/storage/mod.rs (100%) rename rust-modules/{platform => os}/src/storage/state.rs (100%) rename rust-modules/{platform => os}/src/storage_service/activation.rs (100%) rename rust-modules/{platform => os}/src/storage_service/auxv.rs (100%) rename rust-modules/{platform => os}/src/storage_service/backend.rs (100%) rename rust-modules/{platform => os}/src/storage_service/bus.rs (100%) rename rust-modules/{platform => os}/src/storage_service/failure.rs (100%) rename rust-modules/{platform => os}/src/storage_service/keymanager.rs (100%) rename rust-modules/{platform => os}/src/storage_service/runtime.rs (100%) rename rust-modules/{platform => os}/src/storage_service/service.rs (100%) rename rust-modules/{platform => os}/src/storage_service/wire.rs (100%) rename rust-modules/{platform => os}/src/tv.rs (100%) rename rust-modules/{platform => os}/src/tv/device.rs (100%) rename rust-modules/{platform => os}/src/tv/home.rs (100%) rename rust-modules/{platform => os}/src/tv/launch.rs (100%) rename rust-modules/{platform => os}/src/tv/plane.rs (100%) rename rust-modules/{platform => os}/src/tv/sandbox.rs (100%) rename rust-modules/{platform => os}/src/tv/secure.rs (100%) rename rust-modules/{platform => os}/src/tv/sink.rs (100%) rename rust-modules/{platform => os}/src/tv/sound.rs (100%) rename rust-modules/{platform => os}/src/tv/toast.rs (100%) rename rust-modules/{platform => os}/src/tv/uri.rs (100%) rename rust-modules/{platform => os}/src/tv/window.rs (100%) rename rust-modules/{platform => os}/src/webos.rs (100%) rename rust-modules/{platform => os}/src/webos/caps.rs (100%) rename rust-modules/{platform => os}/src/webos/jail_repair.rs (100%) rename rust-modules/{platform => os}/src/webos/ls2/uri.rs (100%) rename rust-modules/{platform => os}/src/webos/toast.rs (100%) rename rust-modules/{platform => os}/src/webos/video_sink.rs (100%) create mode 100644 tools/rename-os-layer.py diff --git a/.agents/agents/fw-compat-reviewer.md b/.agents/agents/fw-compat-reviewer.md index ec4fa84932..2518356477 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 platform 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` | @@ -161,9 +161,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/which-tier/SKILL.md b/.agents/skills/which-tier/SKILL.md index 901383dbb2..ade82bff39 100644 --- a/.agents/skills/which-tier/SKILL.md +++ b/.agents/skills/which-tier/SKILL.md @@ -80,7 +80,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 -p plx_owp`, 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 @@ -108,7 +108,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 -p plx_owp -- --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..560b61bb21 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 platform 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 ed2aa61fc5..4e7882e75f 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 --src rust-modules/owp/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 -p plx_owp --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/AGENTS.md b/AGENTS.md index 67b2aeba16..b0a6a48817 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,7 +64,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/Makefile b/Makefile index 16a3d6b7e5..8a4d751db0 100644 --- a/Makefile +++ b/Makefile @@ -529,7 +529,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 @@ -1013,7 +1013,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/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 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/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 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) @@ -1049,10 +1049,10 @@ 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 +# (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) \ @@ -1680,7 +1680,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 -p plx_owp --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 @@ -1699,19 +1699,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 plx_owp +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 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: @@ -1740,7 +1740,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 -p plx_owp + $(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 @@ -1774,7 +1774,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 @@ -1798,7 +1798,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 -p plx_owp + $(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/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 096c91fde5..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, 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.", + "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 e0b932678b..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, rust-modules/owp/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, rust-modules/owp/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 73f8aa5796..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 @@ -337,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" @@ -720,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" "$SRC_OWP" \ +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 @@ -732,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" "$SRC_OWP" +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 @@ -750,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" "$SRC_OWP")" ]; 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 @@ -862,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" "$SRC_OWP") +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" @@ -881,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" @@ -957,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" "$SRC_OWP" 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)" @@ -1056,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" "$SRC_OWP" | 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" @@ -1085,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 @@ -1096,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 @@ -1113,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" "$SRC_OWP" 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 @@ -1135,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" "$SRC_OWP") +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 @@ -1231,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" "$SRC_OWP" 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 @@ -1376,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" "$SRC_OWP" 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" \ @@ -1401,12 +1401,12 @@ 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" "$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_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") + "$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 @@ -1438,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_OWP" "$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" \ @@ -1628,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" "$SRC_OWP" <<'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] @@ -1729,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" "$SRC_OWP" <<'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..4b43f86e9d 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`) 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 a5de13dd64..438be11606 100644 --- a/ci/check-python-steps.txt +++ b/ci/check-python-steps.txt @@ -172,11 +172,13 @@ python3 tools/test_tv_capture_bench.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 66965b7ce0..b3d8f8ac4d 100644 --- a/ci/list-caps.ini +++ b/ci/list-caps.ini @@ -721,87 +721,87 @@ reason = The min caps one poll() wait at POLL_CAP so the cancel flag is read aga # ---- platform ------------------------------------------------------------ -[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. @@ -1466,11 +1466,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. diff --git a/ci/module-layers.ini b/ci/module-layers.ini index ce52e1ccfb..1718bb4bdc 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 [telemetry] @@ -99,7 +99,7 @@ members = plex http # `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] @@ -109,7 +109,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] @@ -117,10 +117,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. @@ -131,7 +131,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 telemetry +uses = base machine os net plex telemetry members = auth # Playback interfaces and optional independent implementations. Each mounted crate owns a @@ -145,7 +145,7 @@ uses = base playback_contract members = media_codecs [play_uri] -uses = base platform playback_contract +uses = base os playback_contract members = play_uri [owp] @@ -153,7 +153,7 @@ 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] @@ -163,7 +163,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] @@ -173,7 +173,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] @@ -183,16 +183,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 telemetry ui data session media appkit play_feed +uses = base machine os gfx net plex 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 telemetry ui data session media appkit screens playback_contract play_uri play_feed media_codecs +uses = base machine os gfx net plex 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`, @@ -200,7 +200,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 ac42fc6433..235a4d5782 100644 --- a/ci/proofs/platform-generated-enums.json +++ b/ci/proofs/platform-generated-enums.json @@ -1,78 +1,61 @@ { - "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": "0836abd640849f56afbe66af39632b28648609e6464fda0bd4c51087c1070acb", - "platform/src/i18n/mod.rs": [ - "40a13d07a43c772b10587e510a69502684abfa1f582ce355b22fd935a8c46f45", - "2c978e3aa3a9215a2e96ebaec9dd5ae3cf3ee85cf1afb43a36b5f42f17ff4d52" - ], - "platform/build.rs": "58a7a2f8d8851b995648f40fb0a179c3ae743fb0e4e92dd3e19b93f9b86940c8", - "platform/build_support/catalog.rs": "b02769b2de34bf6cf53a60d05bc9fc3080e6012778e30b400b13f772b43f7083", - "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": "bc1d99641ae550b5ea510bb5364c971fed278358019073e5cf8fb7759ab71218", - "appkit/Cargo.toml": "1e3a33f392110f269537b12f12879c6bc15309aca304b189d6b0346edf8a1186", - "base/Cargo.toml": "ebe0b95553bd44f33f422f7d8e22b75ddeb53c7ee81bbe738f675690694568f7", - "data/Cargo.toml": "90a763a8a9e22bda7e95f8ede4dc10ec6e92a62b90bd0fd2e622c617d75ec6c7", - "gfx/Cargo.toml": "c8889dd95a481938966c41635f85702695ce9c59956381768e6c56d215d8fc0e", - "machine/Cargo.toml": "0bc99e95272916b8d00e1a8dad81440bc4998de12ccd9a00e7853f438c813d03", - "media/Cargo.toml": "2b3bb41264db9b9f30869015dfe0dd6656147c432728c9ea9301988c710a4202", - "media-codecs/Cargo.toml": "503c8681289314b5c8a63195aad6796cbad93fcb3eedd8d7cba9e8ed0233783f", - "net/Cargo.toml": "bfdb3a08200642eeeafc9762733718c407529f26dce8a7b90665bc77ac928171", - "owp/Cargo.toml": "2c1354bce16b34f0d006fc04cd4c8eb22ef91f00063b53a1113e32f475ecae33", - "platform/Cargo.toml": "4181b79fa53a7ff6e8b0157f4d1ffe258737896603d267b4802551dee0812472", - "play-feed/Cargo.toml": "b85320257da74a1affd81238b8fb6caa7f28960181d5ea0e07704ceef4800515", - "play-uri/Cargo.toml": "107832fa33c96b7d2a4150c294aea9cd40954c3aabf66f809fc771bb52f5c280", - "playback-contract/Cargo.toml": "bde335ea645552d4f7481b007b80204ecb5bb592caaca22af58a8361cd050dcf", - "plex/Cargo.toml": "886ef07d7de8881d1a01666ea6aea70f228b5e0c8b8bbfc79b8693c59e1c8af7", - "screens/Cargo.toml": "ebe7f8c0d22492de6bd494cfa760dd99999bfd616b7952e753fe5a26dafc6a73", - "session/Cargo.toml": "331a64ed32fbc88988e4c1c33c7b9aa954deab219d1e74fbdec70a4c30690e61", - "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": "fae665206e8c713c34753e06eaca52d43e0eb9b7b5d10e2420e7ec33152dfe78", "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": "4c8ae319c8db665085f3fe744a30ae925f744feba2e64c3c38de51a94d762b16", "machine_newtype": "reviewed local newtype macro emits pub struct Name(pub u32); doc attributes only", + "manifests": { + "Cargo.toml": "834c58e54957a7c8eef3287a9a42f4cce96be0ec3ff6986b550bf4f1f397a027", + "appkit/Cargo.toml": "5cc1214cba7746fe0f2d4cfa5047b599e0d5124abe7bdaebe210381021b88c4a", + "base/Cargo.toml": "ebe0b95553bd44f33f422f7d8e22b75ddeb53c7ee81bbe738f675690694568f7", + "data/Cargo.toml": "74f79e6240f0965069ec34916ae276b3f7e5f4b944cf16a0846570a6b115afa0", + "gfx/Cargo.toml": "c8889dd95a481938966c41635f85702695ce9c59956381768e6c56d215d8fc0e", + "machine/Cargo.toml": "0bc99e95272916b8d00e1a8dad81440bc4998de12ccd9a00e7853f438c813d03", + "media-codecs/Cargo.toml": "503c8681289314b5c8a63195aad6796cbad93fcb3eedd8d7cba9e8ed0233783f", + "media/Cargo.toml": "f6678328f609a0552573d4be6762c888f4e88aaa0e8b6d2cc9eb1abaa9335a97", + "net/Cargo.toml": "bfdb3a08200642eeeafc9762733718c407529f26dce8a7b90665bc77ac928171", + "os/Cargo.toml": "ec44e037b8d1acf8ee26dda2fc8062b15f942811caa4ea9089338d29a8f5926c", + "owp/Cargo.toml": "2c1354bce16b34f0d006fc04cd4c8eb22ef91f00063b53a1113e32f475ecae33", + "play-feed/Cargo.toml": "5bd2b67820914b578fcb371b80ed9274eae4b57078391c38161a67fc22df760d", + "play-uri/Cargo.toml": "48528dd164a910a32f5396ab8f5bc4c6c13f6fd5f1136ee080f8424fe663280b", + "playback-contract/Cargo.toml": "bde335ea645552d4f7481b007b80204ecb5bb592caaca22af58a8361cd050dcf", + "plex/Cargo.toml": "5cdb185265b7f7217cff08e54ef683a827735c9b3ae7c50161850f7064667b66", + "screens/Cargo.toml": "cd42484a49fac394244ebc7b81f30f7e4f9a31cdf7bc1ace5c3fae21afd6d511", + "session/Cargo.toml": "ecb49fc9f44177be6de36715ad70845b8929799cdbeb5ce9d6939be741704db0", + "storage/Cargo.toml": "48be4ed0a20b5c690ea731423ecfbabef27fbcdd4cbe2eace5578fb1c7f72f82", + "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", @@ -85,14 +68,31 @@ "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": "ec44e037b8d1acf8ee26dda2fc8062b15f942811caa4ea9089338d29a8f5926c", + "os/build.rs": "58a7a2f8d8851b995648f40fb0a179c3ae743fb0e4e92dd3e19b93f9b86940c8", + "os/build_support/catalog.rs": "b02769b2de34bf6cf53a60d05bc9fc3080e6012778e30b400b13f772b43f7083", + "os/src/i18n/mod.rs": [ + "40a13d07a43c772b10587e510a69502684abfa1f582ce355b22fd935a8c46f45", + "7119e67300291b9dde7e3e65e16f673113bef30e6fb0cd237aa4aa67cabdb463" + ], + "os/src/lib.rs": "c0f79543c6b5a8099e84918a7de17451fe21a452412a68ad82c7e884863a27d9" + }, + "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 1892afbed6..f2bc807767 100644 --- a/ci/proofs/serde-json-immutable.json +++ b/ci/proofs/serde-json-immutable.json @@ -371,28 +371,28 @@ ".cargo/config": null, ".cargo/config.toml": "82f061c716740e16cfee63a74d87159e0e0dc253e1092b87c54190c603515b14" }, - "lock_sha256": "fae665206e8c713c34753e06eaca52d43e0eb9b7b5d10e2420e7ec33152dfe78", + "lock_sha256": "4c8ae319c8db665085f3fe744a30ae925f744feba2e64c3c38de51a94d762b16", "manifests": { - "Cargo.toml": "bc1d99641ae550b5ea510bb5364c971fed278358019073e5cf8fb7759ab71218", - "appkit/Cargo.toml": "1e3a33f392110f269537b12f12879c6bc15309aca304b189d6b0346edf8a1186", + "Cargo.toml": "834c58e54957a7c8eef3287a9a42f4cce96be0ec3ff6986b550bf4f1f397a027", + "appkit/Cargo.toml": "5cc1214cba7746fe0f2d4cfa5047b599e0d5124abe7bdaebe210381021b88c4a", "base/Cargo.toml": "ebe0b95553bd44f33f422f7d8e22b75ddeb53c7ee81bbe738f675690694568f7", - "data/Cargo.toml": "90a763a8a9e22bda7e95f8ede4dc10ec6e92a62b90bd0fd2e622c617d75ec6c7", + "data/Cargo.toml": "74f79e6240f0965069ec34916ae276b3f7e5f4b944cf16a0846570a6b115afa0", "gfx/Cargo.toml": "c8889dd95a481938966c41635f85702695ce9c59956381768e6c56d215d8fc0e", "machine/Cargo.toml": "0bc99e95272916b8d00e1a8dad81440bc4998de12ccd9a00e7853f438c813d03", "media-codecs/Cargo.toml": "503c8681289314b5c8a63195aad6796cbad93fcb3eedd8d7cba9e8ed0233783f", - "media/Cargo.toml": "2b3bb41264db9b9f30869015dfe0dd6656147c432728c9ea9301988c710a4202", + "media/Cargo.toml": "f6678328f609a0552573d4be6762c888f4e88aaa0e8b6d2cc9eb1abaa9335a97", "net/Cargo.toml": "bfdb3a08200642eeeafc9762733718c407529f26dce8a7b90665bc77ac928171", + "os/Cargo.toml": "ec44e037b8d1acf8ee26dda2fc8062b15f942811caa4ea9089338d29a8f5926c", "owp/Cargo.toml": "2c1354bce16b34f0d006fc04cd4c8eb22ef91f00063b53a1113e32f475ecae33", - "platform/Cargo.toml": "4181b79fa53a7ff6e8b0157f4d1ffe258737896603d267b4802551dee0812472", - "play-feed/Cargo.toml": "b85320257da74a1affd81238b8fb6caa7f28960181d5ea0e07704ceef4800515", - "play-uri/Cargo.toml": "107832fa33c96b7d2a4150c294aea9cd40954c3aabf66f809fc771bb52f5c280", + "play-feed/Cargo.toml": "5bd2b67820914b578fcb371b80ed9274eae4b57078391c38161a67fc22df760d", + "play-uri/Cargo.toml": "48528dd164a910a32f5396ab8f5bc4c6c13f6fd5f1136ee080f8424fe663280b", "playback-contract/Cargo.toml": "bde335ea645552d4f7481b007b80204ecb5bb592caaca22af58a8361cd050dcf", - "plex/Cargo.toml": "886ef07d7de8881d1a01666ea6aea70f228b5e0c8b8bbfc79b8693c59e1c8af7", - "screens/Cargo.toml": "ebe7f8c0d22492de6bd494cfa760dd99999bfd616b7952e753fe5a26dafc6a73", - "session/Cargo.toml": "331a64ed32fbc88988e4c1c33c7b9aa954deab219d1e74fbdec70a4c30690e61", - "storage/Cargo.toml": "8865be804f87c69c5ab6fdf3f3f5388b8bfc254195329623c7b1f5cf614e3e81", - "telemetry/Cargo.toml": "19ccd3f933efcda0052c8f0fdd9c9275c566f6d445e77a1049d0c3bd16e71b36", - "ui/Cargo.toml": "0957d2057cadbd522ae2ee2446727c9c4022c75fba9cfb2347fd341a10fdacf4" + "plex/Cargo.toml": "5cdb185265b7f7217cff08e54ef683a827735c9b3ae7c50161850f7064667b66", + "screens/Cargo.toml": "cd42484a49fac394244ebc7b81f30f7e4f9a31cdf7bc1ace5c3fae21afd6d511", + "session/Cargo.toml": "ecb49fc9f44177be6de36715ad70845b8929799cdbeb5ce9d6939be741704db0", + "storage/Cargo.toml": "48be4ed0a20b5c690ea731423ecfbabef27fbcdd4cbe2eace5578fb1c7f72f82", + "telemetry/Cargo.toml": "9e514e64ae4a35619294621f22534b5e5b109d9dd3b729b94ed20112f47197bf", + "ui/Cargo.toml": "7375c6a73cb2558c7c0f62da7b0bd4beb2a5b78f5460ee35e93b1045c0e80eec" }, "owners": { "Cargo.toml": { @@ -408,7 +408,7 @@ ], "edition": "2021", "lib": "src/lib.rs", - "lib_sha256": "c3e5773952ed1dc138ed7806383bda16d88d3c3d470729aa011d7b645738852d" + "lib_sha256": "41bf877e3d547d517be99dedc2f57e1932ffed6cd6df26d80b46dc1c474f49c7" }, "data/Cargo.toml": { "dependency": [ @@ -423,7 +423,7 @@ ], "edition": "2021", "lib": "data/src/lib.rs", - "lib_sha256": "13b19b51177935c316df61913c418233f371b2faf6e7d993cbdbe539e2d4360f" + "lib_sha256": "51257fa0bd132f20469253f07bec172fcbba053fcbc15ae2a22e17507dc3bdb1" }, "media/Cargo.toml": { "dependency": [ @@ -438,7 +438,7 @@ ], "edition": "2021", "lib": "media/src/lib.rs", - "lib_sha256": "37046486175719577d4ea0fda178dfc577b63c49ba70f472b5fccdd56ce3f3c7" + "lib_sha256": "c15e9804d375fec628df21df57ccaa4abfc78f54f45da19a39ff9c27453f9f16" }, "net/Cargo.toml": { "dependency": [ @@ -462,9 +462,9 @@ ], "edition": "2021", "lib": "net/src/lib.rs", - "lib_sha256": "d9f24001852917fb61bb790e2b3276b7d7bd589a0646fb7bf10e01bbd8324755" + "lib_sha256": "fb01ff87004a7309b82525c393b8d32c927c862c16dd1b8b09aada89850a8c74" }, - "owp/Cargo.toml": { + "os/Cargo.toml": { "dependency": [ { "default-features": false, @@ -473,13 +473,16 @@ "std" ], "version": "1" + }, + { + "version": "1" } ], "edition": "2021", - "lib": "owp/src/lib.rs", - "lib_sha256": "78e104e61b5cf3052f18139f5e922576fd7b17890c4b1e7ee0ec71f29d557e72" + "lib": "os/src/lib.rs", + "lib_sha256": "c0f79543c6b5a8099e84918a7de17451fe21a452412a68ad82c7e884863a27d9" }, - "platform/Cargo.toml": { + "owp/Cargo.toml": { "dependency": [ { "default-features": false, @@ -488,14 +491,11 @@ "std" ], "version": "1" - }, - { - "version": "1" } ], "edition": "2021", - "lib": "platform/src/lib.rs", - "lib_sha256": "0836abd640849f56afbe66af39632b28648609e6464fda0bd4c51087c1070acb" + "lib": "owp/src/lib.rs", + "lib_sha256": "78e104e61b5cf3052f18139f5e922576fd7b17890c4b1e7ee0ec71f29d557e72" }, "play-feed/Cargo.toml": { "dependency": [ @@ -510,7 +510,7 @@ ], "edition": "2021", "lib": "play-feed/src/lib.rs", - "lib_sha256": "7a9ee30908c1e60048fbeba9568b4c3b32c83480b266fe9f8840a695ce215f3f" + "lib_sha256": "d3e124eb236e1c9c7cee328f4c01988f32589d5427123603dab8ca9b174e60c0" }, "play-uri/Cargo.toml": { "dependency": [ @@ -540,7 +540,7 @@ ], "edition": "2021", "lib": "plex/src/lib.rs", - "lib_sha256": "b90aa3a18b5a6479734ff0fc7143308657bb0d24eceb0b128375037c3b3a6f68" + "lib_sha256": "21f51ff3c31160f900f141229bdeaee0af937d7e12aef9baa7b9a946fb6c4e19" }, "screens/Cargo.toml": { "dependency": [ @@ -570,7 +570,7 @@ ], "edition": "2021", "lib": "session/src/lib.rs", - "lib_sha256": "aabf46f0171754643b3e7f246a4270b388a0f205b9263705eadb1e033d03066d" + "lib_sha256": "4640a9718f8cae45cd37818706ac29fd7a27eafbe89abbb69998dea2b9219ac1" }, "storage/Cargo.toml": { "dependency": [ @@ -588,7 +588,7 @@ ], "edition": "2021", "lib": "storage/src/main.rs", - "lib_sha256": "94278ac8964b3825227f444691995278474e97b0802c4fec6dbddba6fe9a29e7" + "lib_sha256": "8726244b78f7d513d9a062b742d56c8e16611dbb6247fb753e9f8d008e257a53" }, "telemetry/Cargo.toml": { "dependency": [ @@ -603,7 +603,7 @@ ], "edition": "2021", "lib": "telemetry/src/lib.rs", - "lib_sha256": "7fd06b717cbe02de1a755dcf0bb3c6098335768854898fba343ccc79484098a7" + "lib_sha256": "f00b8697c55fb037169a502ee32c6941facd4e20cf444d59592704975aaae1f8" }, "ui/Cargo.toml": { "dependency": [ diff --git a/ci/readonly_dependencies.py b/ci/readonly_dependencies.py index 267d1a863e..2f4c3d399b 100644 --- a/ci/readonly_dependencies.py +++ b/ci/readonly_dependencies.py @@ -18,7 +18,7 @@ import tarfile CERTIFICATE_PATH = Path(__file__).with_name('proofs') / 'serde-json-immutable.json' -CERTIFICATE_SHA256 = '915ab64bde4c59b8218471f4560136450414d8dd5e9cd671233ab79130766540' +CERTIFICATE_SHA256 = 'dc193808428b7d45245754272ac468b3aadc866d6fbf5a84e91461ab83b2fc4f' 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'] diff --git a/ci/readonly_generated.py b/ci/readonly_generated.py index d10d5c7a0b..4319c2c946 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 = '1b3b34fa9b71d1850b8b9d569025e992440e29e2ce77d39f34d4e0b8d52c6503' -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 = 'ac7a32d98b59965d6551bb495e98b77d948f6646413c2084a4f147895f3460c3' +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,7 +34,7 @@ I18N_SOURCES = ['40a13d07a43c772b10587e510a69502684abfa1f582ce355b22fd935a8c46f45', - '2c978e3aa3a9215a2e96ebaec9dd5ae3cf3ee85cf1afb43a36b5f42f17ff4d52'] + '7119e67300291b9dde7e3e65e16f673113bef30e6fb0cd237aa4aa67cabdb463'] def source_hashes(root): sources = {p: _local_sha((root / p).read_bytes()) for p in SOURCES} @@ -49,16 +49,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'], @@ -126,7 +126,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: @@ -147,7 +147,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 153089b4b3..80b3b30df4 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') @@ -130,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" +PLATFORM_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" @@ -206,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 @@ -227,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 @@ -242,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 416a395f5f..0925767088 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 @@ -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" +PLATFORM_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 -p plx_owp --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", "-p", "plx_owp", "--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(): 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 27a4339606..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 -p plx_owp --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 -p plx_owp\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 14cbafb6b4..4a763bb0c4 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_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_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", "telemetry", "data", "session", "media", "playback-contract", "play-uri", "play-feed", "media-codecs", "appkit", "screens", "owp") +WORKSPACE_FILES = (".cargo", "Cargo.lock", "build.rs", "build_support", "src", "storage", "base", "machine", "net", "os", "gfx", "ui", "plex", "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..8691ea643e --- /dev/null +++ b/ci/test_rename_os_layer.py @@ -0,0 +1,370 @@ +#!/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', + '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 platform layer\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): + try: code = tool.main(list(args)) + except SystemExit as exit_: code = exit_.code + return code, out.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/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'], 'PLATFORM_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_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 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..07f78aa8fe 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 platform 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 55df29c71d..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 -p plx_owp --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 -p plx_owp --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_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 2b349f596b..15db8fcdde 100644 --- a/docs/agent-reference.md +++ b/docs/agent-reference.md @@ -221,7 +221,7 @@ 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 -p plx_owp` + `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`, `plx_playback_contract` and `plx_owp`, which have no `hostsim` cfg and run 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 -p plx_owp` 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 @@ -383,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 -p plx_owp --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 -p plx_owp --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 @@ -464,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 -p plx_owp --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 @@ -1950,7 +1950,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 -p plx_owp` (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 @@ -1960,7 +1960,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 -p plx_owp -- --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 0153875b59..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 -p plx_owp -- --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 59ba92ed67..d5c9e60f17 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 29b45aa876..a160b4c25d 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`. @@ -94,18 +94,18 @@ 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 owp @@ -158,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 @@ -170,7 +170,7 @@ 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 @@ -222,10 +222,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. @@ -246,7 +246,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; @@ -322,27 +322,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 @@ -357,7 +357,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` | @@ -366,7 +366,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 @@ -377,7 +377,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` @@ -451,15 +451,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 @@ -634,24 +634,24 @@ application edit is 5.7 s faster), not in the noisy medians; the crates that car ### Split 3: platform -`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. @@ -684,7 +684,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`; @@ -697,38 +697,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 platform 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 @@ -787,13 +787,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 @@ -813,7 +813,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 @@ -870,13 +870,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 @@ -911,16 +911,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 @@ -931,7 +931,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 @@ -1002,7 +1002,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 @@ -1028,13 +1028,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: @@ -1118,7 +1118,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 @@ -1129,7 +1129,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 @@ -1154,11 +1154,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 @@ -1172,8 +1172,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 @@ -1298,13 +1298,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 @@ -1316,8 +1316,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 @@ -1412,7 +1412,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 @@ -1579,7 +1579,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`; @@ -1599,11 +1599,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 @@ -1622,7 +1622,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, @@ -1650,7 +1650,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`. @@ -1743,7 +1743,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 @@ -1821,7 +1821,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` @@ -1963,7 +1963,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/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..f3ee5bd8d0 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 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/watchlist-plan.md b/docs/watchlist-plan.md index 8a31c9e6e8..55e4003832 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`, @@ -116,7 +116,7 @@ Every file:line is on origin/main adf73d81a. | `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` | platform | 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/rust-modules/Cargo.lock b/rust-modules/Cargo.lock index 636b27a366..c7e1c8f2a0 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", @@ -829,7 +829,7 @@ dependencies = [ "plx_media", "plx_media_codecs", "plx_net", - "plx_platform", + "plx_os", "plx_play_feed", "plx_playback_contract", "plx_plex", @@ -861,15 +861,7 @@ dependencies = [ ] [[package]] -name = "plx_owp" -version = "0.0.0" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "plx_platform" +name = "plx_os" version = "0.0.0" dependencies = [ "icu_calendar", @@ -885,6 +877,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" @@ -894,7 +894,7 @@ dependencies = [ "plx_base", "plx_media_codecs", "plx_net", - "plx_platform", + "plx_os", "plx_playback_contract", "serde", "serde_json", @@ -905,7 +905,7 @@ name = "plx_play_uri" version = "0.0.0" dependencies = [ "plx_base", - "plx_platform", + "plx_os", "plx_play_uri", "plx_playback_contract", "serde", @@ -928,7 +928,7 @@ dependencies = [ "plx_base", "plx_machine", "plx_net", - "plx_platform", + "plx_os", "serde", "serde_json", ] @@ -945,7 +945,7 @@ dependencies = [ "plx_machine", "plx_media", "plx_net", - "plx_platform", + "plx_os", "plx_play_feed", "plx_plex", "plx_screens", @@ -963,7 +963,7 @@ dependencies = [ "plx_base", "plx_machine", "plx_net", - "plx_platform", + "plx_os", "plx_plex", "plx_session", "plx_telemetry", @@ -978,7 +978,7 @@ dependencies = [ "libc", "plx_base", "plx_net", - "plx_platform", + "plx_os", "plx_plex", "serde", "serde_json", @@ -992,7 +992,7 @@ dependencies = [ "plx_base", "plx_gfx", "plx_machine", - "plx_platform", + "plx_os", "qrcodegen", "serde", "serde_json", @@ -1012,7 +1012,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 f80fd1bece..9af00f8615 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/, owp/ 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", @@ -79,8 +79,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 +99,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 +128,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 +177,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 +226,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 platform 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 +259,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 } @@ -349,7 +349,7 @@ plx_base = { path = "base", features = ["test-support"] } plx_machine = { path = "machine", features = ["test-support"] } # Likewise the platform 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 d466eb6e54..9ae03494f8 100644 --- a/rust-modules/appkit/src/hero_layout.rs +++ b/rust-modules/appkit/src/hero_layout.rs @@ -71,9 +71,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() } } @@ -85,9 +85,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() } } @@ -199,7 +199,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) } }); @@ -214,9 +214,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 eb178c5358..bcf065358c 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 | //! |---|---| @@ -470,7 +470,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..d9b22e4c8e 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, platform, 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..75c6c8227d 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`.) +//! `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 298465e059..6b8e30a75f 100644 --- a/rust-modules/data/src/pms.rs +++ b/rust-modules/data/src/pms.rs @@ -2354,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(), 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 e1d7e6f412..153d192e2c 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/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 e4cf61201d..46a87abec2 100644 --- a/rust-modules/media/src/player/CLAUDE.md +++ b/rust-modules/media/src/player/CLAUDE.md @@ -192,8 +192,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..b5b85a08f3 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 { @@ -506,7 +506,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 +1758,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 +1772,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 +2253,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 a8affd3339..dc136f9f48 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"); @@ -988,7 +988,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}" @@ -1026,9 +1026,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); } @@ -1048,7 +1048,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}"#; @@ -1108,7 +1108,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, ); @@ -1133,7 +1133,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 ); } @@ -4209,7 +4209,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(); @@ -4242,7 +4242,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)); @@ -4265,9 +4265,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); @@ -4301,7 +4301,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); @@ -4324,7 +4324,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); @@ -4348,7 +4348,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); @@ -4390,8 +4390,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 @@ -4441,11 +4441,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!( @@ -4469,15 +4469,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), @@ -4550,7 +4550,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); @@ -4633,7 +4633,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, @@ -4791,21 +4791,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)); } @@ -5630,7 +5630,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 34a815ca00..a04116c333 100644 --- a/rust-modules/media/src/player/feed_open.rs +++ b/rust-modules/media/src/player/feed_open.rs @@ -217,16 +217,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 f6ed025351..06dcdf7bc7 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[=