Repository navigation
HUD authoring: tools/hud-dev, and a dev-source HUD re-fetched on Play - #1241
Merged
Merged
Conversation
tools/hud-dev bundles a HUD source (a folder or a .plxhud) with the native packer, lints it with plxnative-sim --hud-lint on every change, and serves the last clean bundle over http on the Mac's RFC 1918 address, printing the address the TV's "Install from address" takes. A source with findings is printed and not served. Every clean change is served under a strictly higher patch version (the store's comparator is numeric MAJOR.MINOR.PATCH only), seeded from the clock so a restart still lands above what the set holds. The store now records the address of a package installed from a development source (installed.json "from", dev addresses only, dropped on read otherwise), and Entry::dev_source hands it back. On the Player HUD page, Play on the row of such a package sends the same HudCmd::Fetch "Install from address" does, so the existing offer dialog and its confirmation follow. No new string, worker, global or fork. Docs: the PR15 line, the installed.json layout, a "Developing a HUD on the TV" recipe in site/hud/AUTHORING.md, the tools list, the Play row of remote-keys. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…talling the published version A dev build's patch outranks a later release that only raises the patch, so the TV refuses the published one as not newer. The ordering is unchanged; the tool's printed instructions, its docstring, site/hud/AUTHORING.md and the PR15 paragraph now name the page's existing Remove row. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… longer patches time.sleep A test that replaced time.sleep with an interrupt also replaced the sleep inside the subprocess wait of a build, so on a slow runner the interrupt landed inside the lint call before the first bundle was served (CI: host python/shell/C gates, test_it_prints_the_address_and_the_recipe_builds_and_stops_on_interrupt). The loop now waits in pause(), and the two command tests end it there. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…st log, prose that overclaimed tools/hud-dev lists the default route's address first (a VPN that routes 10/8 no longer prints its tunnel address as the TV address), prints a finding with a null file as the package, writes control characters of a request line out instead of sending them to the terminal, and names the lab receiver's real default port in its comment. The Player HUD page drops the open-prompt guard of the Play re-fetch: the prompt takes the key in step() first, the test now keeps the dev row focused and pins that nothing is fetched. Prose: the firewall is described as allowing /usr/bin/python3 by default and dropping other pythons until the prompt is clicked (as the netcond paragraph says); the offer is quoted as the TV draws it; the older-build caveat names the right remedy (an older build cannot list or remove the dev HUD) and says anyone installing from a private-LAN http address can reach it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The dev loop was run on the television with a dev-source install seeded by hand: Play on its row fetched the next tools/hud-dev build, the offer named a development source, Install replaced the package with the address kept, and Remove took it out. Typing an address into "Install from address" was not verified, because the remote harness cannot type into that field. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
PR15 of the HUD-plugin series (
docs/hud-plugins.md, "PR15. Authoring tools"): an author can edit a HUD on a Mac and see each build on the TV.tools/hud-dev(Python standard library; runs on macOS's/usr/bin/python33.9). It takes a HUD source folder or a.plxhud, packs it withtools/hud_package.py(the simulator's--hud-pack; no second packer), lints it withplxnative-sim --hud-lintwhenever a file's mtime changes, and serves the last CLEAN bundle on0.0.0.0:<port>(default 8731). A source with findings is printed (file, pointer, hint) and not served; the previous clean bundle stays up. It printshttp://<RFC 1918 address>:<port>/<name>.plxhudand a one-line TV recipe, refuses to start on a machine with no RFC 1918 address, and logs one line per request (client, path, version served).Address::dev_source) now records that address (installed.jsonfrom;Entry::dev_source).HudCmd::Fetch(address)that "Install from address" sends. The existing offer dialog follows and OK installs; the confirmation is kept.installed.jsondescription indocs/hud-plugins.md; a "Developing a HUD on the TV" recipe insite/hud/AUTHORING.md(with "remove the dev install before installing the registry one"); thetools/hud-deventry indocs/agent-reference.md; the Play row indocs/remote-keys.md.tests/test_hud_dev.pyis registered inci/check-python-steps.txt. NoMakefile,Cargo.tomlor make target changed, no new string, no new worker, global orcfg(test)fork, and noci/allow/**line moved.Decisions
Version counter.
hudpacks::Semveris numericMAJOR.MINOR.PATCHonly (no pre-release, and the manifestversionpattern is the same), so1.2.0-dev.7cannot be ordered and the comparator cannot express a dev counter without changing app code. The tool therefore raises the PATCH of the copy it serves: author's patch plusmax(now - 1767225600, 1)(seconds since 2026-01-01), and never below the previous served patch + 1. A clock seed rather than a counter that starts at 1, so a restart of the tool still lands above what the set already holds. Never below the author's own version; the author's files are never edited. No second ordering rule was added. Consequence, accepted and not worked around: the dev patch outranks a later published release that only raises the patch (a dev build installed as1.0.26000000makes the published1.0.4NotNewer, so the TV refuses it). The ordering is unchanged; insteadsite/hud/AUTHORING.mdandtools/hud-dev's own printed instructions say to remove the dev install before installing the published version, by the page's existing Remove row (the row named after the HUD, detail "Remove"). The app does have a way to remove an installed HUD.The key: Play (the remote's play key,
wcode450, legacy 19/402;consts::Key::Play). The settings surface owns input, so a Play press reachesSettingsScreen::stepand is forwarded to the top page; the global ladder'skey_playnever sees it there. The page has no secondary action for a Choice row besides the Right-at-edge arm (form_right_target), the colour keys are deliberately unbound (docs/remote-keys.md), and the HUD rows' own Right/OK meanings must stay. Play reads as "play this build", and it is a no-op everywhere else on the page: on a non-dev row, on Classic, on a Remove or address row, while a fetch or package operation is busy, or while a prompt is open.tools/hud-devprints the key.Address recording. No address was recorded before:
Recordheld sha, source, time and the two formats. So the store now persists a dev-onlyfrom. It is written only when the install's source isSource::Addressand the address is a dev source; on read it is parsed again withaddress::parseand dropped if it is not a dev address or sits on a record of another source (fail closed, the package stays listed and the index writable). An index withoutfromis the bytes it always was.Caveat recorded, not worked around:
IndexRecordisdeny_unknown_fields, so an older build reads aninstalled.jsonholding a devfromas read-only. Anyone who installed from a private-LANhttp://address can reach that (an author runningtools/hud-dev, most often). The older build lists no dev HUD and cannot remove it, so the dev install is removed on a newer build before going back (stated in the recipe).Design choice: the page reuses
HudCmd::Fetch, so the Bridge, the runner and the event set are unchanged; the existing refusals (NotNewer,AlreadyInstalled) already surface throughsettings_hud_already(), so no new string.Verified here
Red first for the store (a dev install records its address and no other install does; the address is read back from disk and the next fetch goes to it; an install from elsewhere forgets it; an address the store would not have written is dropped) and the page (Play on a focused dev row emits the effect; non-dev, Classic, busy and open-prompt rows send nothing).
tools/hud-devwas mutation-checked: removing the version bump, serving despite findings, widening the address check to loopback, and dropping the clock seed each fail the suite. Along the way the tests found thatHTTPServer.server_binddoes a reverse DNS lookup of0.0.0.0(35 s on this Mac under another interpreter), now skipped and pinned by a test.make test-crate C=plx_data(nothing underrust-modules/datachanged after this run):make test-crate C=plx_screens:tests/test_hud_dev.py,/usr/bin/python33.9.6 and Homebrew 3.13 (stub simulator, loopback port 0, real HTTP GET):Ran 39 tests in 8.584s/OKandRan 39 tests in 8.737s/OK.Static gates, all green:
check-list-caps: 339 sites, every one classed: work 102, preview 14, format 70, not-a-list 153, reach(open) 0;Localization inventory: product text boundaries passed;check-module-layers: green;check-deps: all gates green;ci/test_shipped_faces.py(2 tests OK);ci/test_ci_workflows.py(80 tests OK);ci/test_ci_split.py(16 tests OK);make lintexit 0;CARGO_INCREMENTAL=0 cargo check --libforplx_dataandplx_screensfinished clean.Review round
pr-reviewer(five MINOR findings) anddoc-claim-auditor(five contradictions) ran once overorigin/main...HEAD; every realistic finding was fixed in e851b1c: the default route's address is listed first (a VPN that routes 10/8 had its tunnel address printed as the TV address), a finding with a null file prints as the package, control characters in a request line are written out before logging, the redundant prompt guard of the Play arm was removed and its test now keeps the dev row focused, the firewall wording followsdocs/agent-reference.md's own netcond paragraph, the offer is quoted as the TV draws it, the older-build caveat names the right remedy, and the lab port in a comment is the real one. A CI run on the first push failedhost python/shell/C gatesbecause a test replacedtime.sleepfor the whole process and the interrupt landed inside the lint subprocess of a slow runner; the loop now waits in its ownpause()and the test patches that.Verified on the TV
On the set at
e851b1c4b(a debug build, the defaulttvdevprofile, booted--guest --mockwith the mock's identity read before any key), withtools/hud-devserving a scratch copy of theminimalfixture from the Mac over the home network:packs/and aninstalled.jsonrecord withsource: addressand the dev address infrom). The Player HUD page listed it with its Remove row, so the store readfromback.tools/hud-devre-linted it and served the next, higher version. Play on the dev row fetched that build (the tool logged the TV's GET), and the offer dialog showed it as a development source, Unreviewed, with Cancel focused by default.installed.jsonwith the new sha and keptfrom, and only the new pack remained inpacks/.Not verified on the TV
Typing an address into "Install from address". The remote harness's text token reaches only the Search field, and the system keyboard cannot be driven from outside, so that step needs a person at the remote.
No issue tracks the HUD-plugin work; none was opened for this PR.
🤖 Generated with Claude Code