Repository navigation
HUD plugins: reachability, the More folds and the package invariants, and classic as a package - #1142
Merged
Merged
Conversation
… and classic as a package `hud_format::check(&Package)` walks the HUD's state graph (the open sections x the Discs / Up Next / Skip slot, under every valuation of the content conditions the package names) and reports R1 (More is placed in the root state), R3 (a section opener has a band), R4 (what Up Next replaces and where it is drawn exists) as findings and R2 as data: the key-less commands no reachable state places under every valuation in which they are enabled, which the app will fold into More. `validate.rs` adds I3 identity, I9's no-palette rule for the built-in and I11's Skip-ladder warning; the invariants the parser already enforces (I8, I13, I9's sizes, I11's `default`, R4's buttons and countdown) are not repeated and have rows asserting the parser's own codes. New codes: HUD-E0801 more-in-root, E0802 opener-has-section, E0803 up-next-whole, E0901 identity-unique, E0902 builtin-no-palette, W0903 face-ladder-complete. `fixtures/classic.plxhud.json` is the whole built-in HUD as a package (the plan's layout block plus the chapters and info section bands and the tabs band's keyed gap); `builtin_classic_passes_package_invariants` parses it clean and finds nothing to fold. Its id, `builtin:classic`, is not reverse-DNS, so the id pattern accepts that one reserved literal besides reverse-DNS names (`schema::BUILTIN_CLASSIC_ID`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…More; the plan says what PR5b shipped Review of #1142. The fold decision asked only whether a `toggle_section` command was enabled, so a package with no section band (the published `minimal` example) would have got Chapters and Info rows in More that enter a state where nothing is drawn. A section row now folds only for a section the package lays out; the minimal test pinned the wrong answer and now expects the others, with a case for one laid-out section. `docs/hud-plugins.md` now agrees with the code: classic's file already has its section bands, the playbar carries the four keys the table requires, I3 is unique per kind, the chapters gap of 43 is a placeholder until PR8 computes it from the strip box, and PR10 must refuse the id `builtin:classic` from outside sources. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
marked this pull request as ready for review
October 29, 2026 21:43
GLinnik21
added a commit
that referenced
this pull request
Oct 29, 2026
Merged PR5b (#1142): reachability, the package invariants, classic as a package. The schema's reverse-DNS regex now accepts the one other id the parser accepts, `builtin:classic`, so the schema accepts classic.plxhud.json; the agreement test walks classic with the valid corpus and the regex pin covers the built-in id and its near misses. The published examples are held to PR5b's `check` (zero findings) instead of a second reachability walker of this PR's own. The parser now reads `schema::GAP_TOP_PX` and `schema::BUILTIN_FACE_PREFIX` instead of keeping its own copies of the same two constants (behaviour unchanged). The plan and the emitter's module doc list every keyword the schema uses (`$ref`/`$defs`, `description`, `default`, `title`), and the site tests' doc names the CI path-filter gap. The schema golden is re-blessed (the id's doc string changed on main). 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 and why
PR5 part 2 of the HUD-plugin plan (
docs/hud-plugins.md): the package-level checks that need no geometry, over a parsedPackage, and classic as a package.hud_format::check(&Package) -> Checked { findings, folds, states }:hud_format/reach.rs, pure). States are (open sections, slot) under every valuation of the content conditions the package names (chapters.present,title.is_episode; a condition it does not name holds;transport.pausedcounts as holding either way).modalopens one section at a time,inlineany subset of the laid-out sections. Edges are the app-owned ones: OK on a placed, enabledtoggle_section, BACK, and the slot changing involuntarily. Per D7 the slot is only Discs while a section is open.open_more(opening More's root) is placed in the root state under every valuation.MIN_CONTROL_SIZEis a geometric bound and belongs to the compiler (PR5c): presence only is checked here and no value is invented.open_tracksis one command whosetabis an opening address;toggle_statsand the Options switch never fold.toggle_section {section: s}control needs a band whosewhenholdspanel.s.replacesis non-empty and names segments of the package,bandnames a band.hud_format/validate.rs): I3 identity (band, segment and control ids are unique per kind), I9's no-palette rule forbuiltin:classic, I11's Skip-ladder warning.Decisions
REST_FOCUS_RULES:E0106/E0103), I13 (layout.anchoris a one-name enum:E0201), I9's sizes (E0201,HUD_TITLEonly ontitle.main:E0106), I11'sdefault(E0303), R4's two buttons and countdown (required keys oflayout.up_next:E0103). Each has a row inreach_tests::parse_rowsasserting the parser's own code and pointer.builtin:classicis not reverse-DNS, so the brief's "parses with zero findings" needed the id pattern to accept it.Pattern::ReverseDnsnow accepts exactly that one literal (schema::BUILTIN_CLASSIC_ID), tests include near-misses (builtin:Classic,builtin:other,builtin:,xbuiltin:classic, a trailing space). That the id parses does not make a file the built-in: whether a package IS the built-in must come from where it was loaded (compiled in), and the storage/sideload PR must refuse that id on any path that takes files from outside (noted indocs/hud-plugins.mdnext to the id rule). I9 only restricts the id (no palette), it grants nothing. For PR6's schema emitter: theidpattern accepts this literal besides reverse-DNS names.open_morethat opens More's root (nopage, orpage: root): a control opening only Quality or Speed is not More's home of Stats and the folds.by_intervalmap that lacks a rung of the viewer's Skip ladder (SkipInterval::LADDER, read fromplx_media::route); noby_intervalat all is one face for every interval and is clean.Codes added
HUD-E0801more-in-rootHUD-E0802opener-has-sectionHUD-E0803up-next-wholeHUD-E0901identity-uniqueHUD-E0902builtin-no-paletteHUD-W0903face-ladder-completeE06 stays reserved for the compiler's text-fit codes.
fixtures/classic.plxhud.jsonThe whole built-in HUD as a package: the plan's
layoutblock (every number from "Classic, element by element"), plus thechaptersandinfosection bands the table describes, with the tabs band'sgap_beforekeyed onpanel.chapters/panel.info.idbuiltin:classic, no palette, no faces. It is a test fixture here; PR7 embeds it and PR6's--hud-exportprints it.Where the table leaves a value implicit:
playbar: the plan's block writes{ "w": "fill" }but the table requiresfill,track,thickness,clock_size. Taken fromdraw_playbar/SB_H:fill: TEXT_PRIMARY,track: RAIL_TRACK,thickness: 8,clock_size: CAPTION. Everything else is the parser default.version1.0.0,nameClassic,authorPlxNative,licenseGPL-3.0-or-later(the crate licence); no$schema.w: fill,art {bind: item.thumb, crop: cover}; the name textmax_lines: 1(classic elides it) with its ink keyed onitem.focused(TEXT_SECONDARY, focusedTEXT_PRIMARY, fromchapters_panel.rs); the timeCAPTIONinTEXT_SECONDARY. Nowon the card's texts, no overlay.gap_beforeunderpanel.chapters: 43,949 - 684 - (162 + 26 + 34), taking the timestamp as a zero-height origin aslabel_ysdoes today. UNVERIFIED against the compiler: PR8 computes it from the strip's box. Underpanel.infoit is the table's 45.info.titleTITLEboldTEXT_PRIMARY,max_lines: 1; synopsisLABELTEXT_SECONDARY(leading 29,max_lines: 2from the table); factssize: CAPTION(fromdraw_chip_row); rectradius: 28,h: 236,gap: 34,pad: 28,bleed: 16from the table; the actions' two controls arewidget: button,size: 70(the table'sitem_h) with the parser's defaultrest/focus.Tests
hud_format/reach_tests.rs(module path containshud_format):builtin_classic_passes_package_invariants: parses with zero findings,checkreports none, nothing folds.from_beginningandgo_to_detail(its unplacedopen_tracks {tab: audio}does not fold); the minimal package passes.when: title.is_episode, More absent, More only opens a page, More's band shown only in a section), R3, R4 (three cases), I3 (control, band, segment), I9, I11; parser rows for I8, I13, I9 sizes, I11default, R4's buttons and countdown.chapters.presentfold too, placed for episodes only do not;open_tracksone command; a section without an opener folds its row;toggle_play,seek,toggle_stats,open_morenever fold.Pure: no IO, no globals, no
cfg(test)fork in production code, no new dependency, no Cargo change, no ledger line, noMAX_*constant.Gates
Local, as required (
PATH="$HOME/.cargo/bin:$PATH" make test-crate C=plx_appkit T=hud_format, on the committed tree,git status --shortempty after):python3 ci/check-module-layers.py: green. This PR's CI is the full gate (make check,make check-nodef, the ARM build were not run locally).No issue tracks the HUD-plugin work; none was opened for this PR.
Review
Review verdict was FIX FIRST; head after the round is
530a257d0.Layout::enablednow requires a laid-out section for atoggle_sectionfold. The minimal test, which pinned the wrong answer, now expects onlyprevious,next,open_tracks,from_beginning,go_to_detail; a new test (a_section_row_folds_only_for_a_section_the_package_lays_out) lays out Chapters only and expects only that row. Both failed before the fix (test result: FAILED. 14 passed; 2 failed).gap_beforeof 43 leaves out the timestamp line. A one-line text's box is its rung's line height, which is a runtime font measure that I cannot compute here, so no certain value exists; the plan's Chapters-strip row now says the number is a placeholder until PR8 recomputes it from the compiled strip box.docs/hud-plugins.mdnow says classic's file already has the section bands and keyed gap, that the playbar carriesfill/track/thickness/clock_size(the plan's block and table row said otherwise), and that I3 is unique per kind.builtin:classicfrom every source that is not compiled in.Gates (after the review round)
PATH="$HOME/.cargo/bin:$PATH" make test-crate C=plx_appkit T=hud_format, on the committed tree,git status --shortempty before and after:origin/mainhad not moved (no merge needed). This PR's CI is still the full gate.🤖 Generated with Claude Code