Skip to content

UI tests: focus/press elements by id, and read the screen back (state:) - #1432

Merged
GLinnik21 merged 79 commits into
mainfrom
a11y/runtime
Nov 17, 2026
Merged

GLinnik21 merged 79 commits into
mainfrom
a11y/runtime

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

This is the run-time half of the accessibility-identifier system, built on the id projection that landed in #1431. A UI test or an agent can now focus or press an element by its id, and read back what is on screen, instead of walking to it with direction keys.

Tokens on the remote FIFO

  • focus:<id>, press:<id> and press:<id>@<subject> enter as one typed input, InputKind::ById, with Source::RemoteFifo.
    • The dispatcher resolves the id at the input's ordered delivery position, after the owner guard. A by-id input therefore lands exactly where a key press at the same moment would.
    • focus: moves focus with the new By::Script. A scripted move counts as deliberate wherever a key move does, so a card grows from rest and a provisional focus ends. It differs from a key move only at sites that react to pointer hover.
    • press: focuses the element, then delivers an ordinary OK Down and OK Up at the front of the queue, so it acts exactly like a remote press.
    • @<subject> refuses the press unless the element's subject (a card's ratingKey) matches.
    • A refusal logs one line: a11y: refused <act> <id> <reason> owner=<ns>. The reason is Unknown, NoOwner, Unloaded or SubjectMismatch. The line carries only the grammar-checked id and words.
  • state:<nonce> is built only with devtriggers.
    • It is a runner effect at the frame tail, not IO inside a machine.
    • It atomically writes one JSON projection of the owner's view to plxnative-a11y.json in the runtime dir. The projection holds the focused id, the groups, and each element's id, role, rect, visibility, loaded flag, label and subject.
    • The nonce is in the file, so a reader never takes an earlier answer for its own.
    • The token is not recorded and damages nothing. The file name is listed in DIAG and runtime_file::LOGS.
  • tools/a11y.py is the harness helper for these tokens.

Recording and replay

  • Recording.
    • A by-id input is recorded once, through the input tap.
    • RESOLUTION_SHAPE gains an Id row family, answered in replay by ReplayAuthority::resolve_id.
    • Id rows count toward hit_diffs; the resolution=focus|hit|id word on a divergence line tells the families apart.
  • Shape pin. The state fingerprint moves to 0x7f1d_280c_909c_8603, because STATE_SHAPE gains ById and Pan. The old pin, 0xea74_3865_5115_46c5, joins the refused list. CURRENT_FP moves in tools/plxnative-rec and in the outbound guard.
  • Recording privacy.
    • Labels and subjects never reach a log line or the heartbeat.
    • A press:<id>@<subject> records its subject text in the recording's input row, the way recordings already carry ratingKeys in metadata request paths. Such a recording is private like any other.
    • The fixture alphabet has no pattern for a subject, so a subject-guarded press cannot be committed as a fixture.
  • The fixture alphabet's id pattern is closed. The first segment must be one of the 48 namespaces the app produces, and at most MAX_ID_SEGS (6) segments may follow. A household hostname such as nas.local or first.last is refused at commit time. A test in the coverage table keeps the alphabet's namespaces and bound equal to the code's, in both directions.

Fixtures

  • v13-owned-input-content is re-recorded onto the new shape (922 frames).
  • New: 13-by-id-filmography (anchor: true, 1209 frames). Its recorded inputs:
    1. focus:nav.watchlist is refused on Filmography.
    2. focus:filmography.row.3 and press:filmography.row.0 resolve; the press opens Detail.
    3. Back to Home, where focus:nav.watchlist resolves.
  • The press is on a list row rather than a Home element, because a Home press records an application effect the controlled replay does not support yet.
  • Replay gate: 6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0.

Not in this PR

  • Off-window cards. A Library grid card, a Detail episode or a paged-window card that is not loaded refuses as Unknown. A follow-up adds a typed reveal event so the screen can move its window and the harness can retry.
  • One stale comment. A doc comment in machine/src/machine.rs (FirstInGroupAnimated) still names the old By::Dir | By::Pointer gate. ci/proofs pins that file by hash, so the rewording waits for the pin to be re-sealed.
  • Harness. The tv-session.sh verbs, the capture migrations and the docs come in the harness PR.

Gates

On the committed tree (Rust at 1ba7204; the later commits change only fixtures and prose):

  • plx_machine: test result: ok. 118 passed; 0 failed
  • plx_ui: test result: ok. 1710 passed; 0 failed
  • Skipped crash tests. The next three runs each skip a test that segfaults on this Mac, on main too, and passes in CI:
    • plx_screens: test result: ok. 2236 passed; 0 failed; … 1 filtered out
    • app crate: test result: ok. 1460 passed; 0 failed; … 1 filtered out
    • hostsim: test result: ok. 1685 passed; 0 failed; … 2 filtered out
  • make check-nodef: green.
  • ci/check-deps.sh: green, with no ledger line added.
  • ci/check-module-layers.py: green.
  • ci/check-localization.py: green.
  • make check-python-rest: 141 steps — all ok.
  • outbound-guard: 73/73 checks correct.
  • Replay, both modes:
    • v13-owned-input-content: verdict=SAME, 922 frames.
    • 13-by-id-filmography: verdict=SAME, 1209 frames.

No Makefile, Cargo manifest, build script or workflow changes, so there is no build-bench table.

🤖 Generated with Claude Code

GLinnik21 and others added 30 commits November 17, 2026 17:38
…erage table)

plx_ui::a11y holds the id grammar (`<ns>.<path>`, ns [a-z][a-z0-9_-]*, segments
[a-z][a-z0-9_]* or a decimal index), A11yPath (built from &'static str names and
indices, parsed from a test's text for comparison only), Role, A11y,
default_walk and the conformance suite (every element projects, ids unique per
view, a11y_find inverts a11y including off-screen elements, a11y_elems matches
GroupSpec.len).

Focusable gains the three defaulted hooks a11y, a11y_elems and a11y_find;
Screen gains a11y_ns (defaults to name()); composed_a11y* delegate through
layout() parts and both focusable_via_* macros forward the hooks (the view macro
hands back an owning projection, since its view is a temporary).

The screens crate gets the coverage table: an exhaustive match over every AppArg
arm (and ContentArg and SettingsPage), all Pending, so a new screen fails to
compile until it is tabled. No behaviour change: nothing produces or reads ids
at run time yet.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e Watchlist options menu

catalog.primary (the pill, subject = the record's hex), itemmenu.<row> named by ItemRow
(itemmenu.version.<n> on the Play Version page), watchlist_menu.<row> named by OptionsRow.
Each view runs a11y::conformance in its host tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t the player, collection and person pages

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ing deck and the linked headings

hero.play|info|watchlist, shelf.<row>.card.<col>, continue.card.<col>, shelf.<row>.heading and the
plaintext question's alert.cancel|connect; a card's subject is its ratingKey. By::Script is a
deliberate arrival like Dir at the strip-chosen and hero-rotation sites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every FormId of the Settings family (root, language, diagnostics, under
posters and its details picker, playback and audio fields, legal index,
privacy rows, account menu) answers a static a11y name per variant. A
variant that repeats in one form (a server's plaintext switch, a language
choice) answers None: its position names it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ty ids

tracks answers body; Also available and Play Version answer row.<n>, the
position among the focusable rows (what GroupSpec::len counts).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Login answers control, details and the alert's answers (alert.cancel,
alert.send) for the group it declares now. Profiles answers the roster
under roster.<the shared shelf's id> (labelled with the profile's name),
sign_out and back for the footer and the read-out, and the PIN pad as
pad.digit.<n> / pad.delete; the pad group's len now counts its eleven
keys, not its twelve cells, because the hole is no element. Onboard
forwards the three hooks through its view to the shared table screen, and
all three mountings keep the one namespace `onboard`.

Each screen's hand-written groups run a11y::conformance in host tests.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eir own id namespace; By::Script at the Detail and Library arrival sites

filmography.tab.<i> and filmography.row.<i> (a held copy's ratingKey is a row's subject), a11y_ns
overrides for Filmography and Recommended (their name() words are shared), and By::Script treated as a
deliberate Dir arrival in detail/mod.rs, library/mod.rs and library/recommended.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RouteSurface forwards to the top page and answers the top page's namespace;
RootPage, the Playback picker, the HUD page and the consent view answer
their alert's two answers alone while it is open (AlertAnswers, written once
in plaintext_question beside PlaintextAlert's own hooks); the HUD preview
answers back and scene.<i>; the account menu answers one row per action.
DocumentPage and PreviewPage answer namespaces of their own so no two
screen types of the family share one. A script's arrival on a HUD row is as
deliberate as a key's.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Surface-level conformance and namespace uniqueness over every page the
Settings surface mounts; the preview's back and scene.<i> controls; the
delete alert's alert.cancel / alert.delete answers alone; the account menu's
rows; AlertAnswers; every FormId's names valid and distinct; a script's
arrival ends the HUD page's provisional focus as a key does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The player names its elements from the HUD's own groups and slots: scrub,
control.<word|i>, tab.info|chapters, section.<i>, chapter.<i>,
failure.<action>, repair.cancel|confirm. The overlay forwards the active panel's
part. about and bio declare no group and conform vacuously.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The HUD census runs a11y::conformance for every occupant (discs, Skip, Up Next,
read-out, chapters). Collection, Person and Search run it over their card-harness
mounts: their ids are the stack's own, and these tests are what holds them to it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Dispatcher::a11y_snapshot is a pure projection of the input owner (page composed with the strip):
route word, owner kind, focused full id, every group (prefix, len, role) and every element with
rest_rect, visible, focused, loaded, label and subject (an unloaded element carries no text), no
cap. The projection is a free function over any Focusable, driven in host tests by a hand-written
view.

The app parses state:<nonce> in ingress_token before dispatch_remote_token (no damage, not
recorded), keeps the latest nonce in a one-slot frame-thread cell, and serves it at the frame tail
(run.rs::report, which both the presented and the skipped path reach). The JSON is built in the app
and written by one storage_worker job through the fixed temp name: stale temp removed, create_new
0600, rename over plxnative-a11y.json. Both names join DIAG (49 -> 51) and runtime_file::LOGS
(9 -> 11); the whole module is devtriggers.

tools/a11y.py (send, state, wait_for) waits until the file names the nonce it sent;
tests/test_a11y_tool.py grades that matching with a fake clock and a real FIFO.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
SectionSpec takes an optional static name (named / named_at), defaulting to
section.<i>. The card stack projects <section>.card.<j> for the cards of a
Shelf or Grid and <section>.<leaf|n> for the focusable elements of a Custom or
Overlay section (StackPage::plain_name names a leaf), with an indexed
a11y_find and a11y_elems; CardSource::subject (defaulted) carries the card's
ratingKey. PageWithStrip names the strip pills (nav.home|movies|shows|search|
profile|watchlist, nav.tab.<n>), qualifies the page's relative ids with the
page's a11y_ns and routes a11y_find by namespace. The More and Track menus
name their rows by identity, through shared popover_a11y helpers. By::Script is
a deliberate arrival at the card sites that treat By::Dir as one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rms and the page header

Shelf (card.<i>), Table (row.<i>), TabRow (tab.<i>), Grid (shelf.<r>.card.<c>) and Document
(document) project, enumerate and find their elements; indexed widgets answer a11y_find by the
index they parse. TablePart (plain and form-backed), BandPart (band.<i>), DocumentFocus,
DocumentPart and the composed TableScreen/DocumentScreen follow; a form-backed group's len now
counts its keyed rows only (a separator or note has no key, so no element).

FormId gains a11y() -> Option<&'static str> (default None = row.<index>), carried beside the
binding through Form::map and exposed by RowKeys::a11y_name. HeaderItem gains an optional a11y
name (the sort control is 'sort'); HeaderRow projects its stops under header.*. MasterDetail
delegates the three hooks to its parts; LinkedHeading::a11y gives the shared button projection.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ivery)

Workstream C of the accessibility-id plan (a11y-ids D3/D5/D6/D7). A UI test can now
focus or press an element by its id instead of walking keys to it.

- machine: InputKind::ById{id, press: Option<OkTap>, expect}, OkTap, By::Script
  (Canon tag 9).
- ui dispatcher: a by-id input is intercepted at its ORDERED delivery position
  (dispatch/by_id.rs), resolved against the input owner's view only (namespace,
  a11y_find, a11y, place, loaded and subject guards), then expands to a
  FocusMoved{by: Script} and, for a press, the OK Down/Up a remote OK is.
  A refusal moves no focus, emits no key and logs one id/word line. Every by-id
  input yields exactly one Id resolution through ReplayAuthority::resolve_id.
- recording: one tap per input (bootstrap::effects encoder and decoder, the
  fixture codec), a ProductResolutionV2 Id row, the family-based resolution
  identity, validate_resolution_recording pairs Id rows with by-id inputs over
  the recording, and By::Script is code 4 (refused in a Focus row).
- FIFO: devtriggers-gated focus:<id>, press:<id>, press:<id>@<subject> parsed in
  ingress_token after a drain_sdl; a malformed id is refused with one remote: line.
- shapes: STATE_SHAPE gains ById and the Pan it had left out; ProductResolutionV2
  is current and V1 is kept for the frozen historical vectors. The fixture pin and
  the APP_SHAPES pin move; ALPHABET.json gains the words and the id pattern.
- fixture: FixtureRow and FixtureModal project ids; tests cover focus, press,
  refusals, batch ordering, an element past the canvas edge and record/replay in
  both modes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ts like `drive`

`replay_mode` registers Home's two inflight requests after the first frame, so the
recording scenario must do the same for the by-id record/replay test to compare like
with like. Also corrects the scenario's doc comment to the order it actually runs.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ings

The route of an A11ySnapshot is the top PAGE's heartbeat word (Screen::name), also while a surface
owns input (ns names the owner), with a fixture test that opens the modal and tells the two apart.
The symlink test lists directory names in sorted order, and the no-log scan avoids the spelling
the libm lint reads as a float ln.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The writers matched By::Script, which only exists once the write side
(plx_machine::machine::By) lands. The ids layer keeps the pre-Script arms; the
runtime layer reverts this commit after merging the write side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	rust-modules/src/app/run.rs
This reverts commit 8e83a06: By::Script exists now that the write side is merged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1y tool test in CI

plxnative-a11y.json and its temp name are named by release code for erasure (paths::runtime_file::LOGS)
and sit in DIAG; tests/test_a11y_tool.py joins the python steps so ci/test_ci_split.py sees it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 and others added 2 commits November 17, 2026 22:21
…tion gate reads cards_harness.rs)

`detail_conforms` and `the_page_answers_its_ids_and_conforms` move from
detail/cards_harness.rs (a non-test file to ci/check-localization.py, so its fixture's
`Season {i}` / `Episode {i}` / `Extra {i}` / `Saga` titles read as product text) into
detail/tests.rs, where every other screen keeps its `*_conforms` fn. `detail::tests` becomes
`pub(crate)` (as hud_settings's does) so the registry's coverage table reaches it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Brings in Detail's conformance moving to its test module (the localization gate reads cards_harness.rs).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21 and others added 8 commits November 17, 2026 22:57
A press:<id>@<subject> token writes its @<subject> text into the recording's in row, so a
recording of a subject-guarded press carries a ratingKey and is private like any other recording
(ALPHABET has no pattern for it). Label and subject still never reach a LogLine or heartbeat.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ript

Seen::of reads By::Dir, By::Pointer and By::Script as deliberate; the card, shelf, grid and
machine docs named only Dir/Pointer, and two named the dead pop_from_rest.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…of a token

Resolution rows are Focus, Hit and Id; focus_diffs counts Focus, hit_diffs counts Hit and Id.
A remote token is an SDL-synthesised key, a direct token row, one typed ById input recorded by
the tap, or state: (not recorded).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comments and test docs only, plus one test rename (a_scripted_arrival_... ->
a_pointer_arrival_..., the loop it names drives By::{Dir, Pointer, Restore,
Reconcile}; there is no By::Script on this branch):

- player/overlay.rs: the overlay's namespace is the default Screen::a11y_ns,
  the active panel's OverlayKind::word() (menu, more, timing), not tracks.
- ui/geom.rs: the card menu does not answer row.<n> (it names rows
  itemmenu.<name>); table_a11y_find counts every element row for row.<n>;
  `indexed`'s doc no longer lists row.1 among the non-scanning ids.
- screens/registry.rs, alt_sources_tests.rs: nine <screen>_conforms functions
  have no caller outside the coverage table.
- settings_root_navigation_tests.rs, appkit/track_menu.rs: the conformance rule
  is "at most len, and some when len > 0", not "exactly len".
- home/ and library/cards_harness.rs: the last card-id segment is the card's
  global index (CardSource::global), not its column.
- ui/form.rs: playback.direct_play is a real row id; playback.audio_boost is not.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s its depth

The pattern `[a-z][a-z0-9_-]*(\.(name|0|index))+` fully matched ANY lowercase dotted string, so
the outbound guard (which lets a recording under tests/fixtures/replay/ be committed and pushed)
would have passed a household hostname such as `nas.local` or `first.last`. The first segment is
now the closed alternation of every namespace a screen answers plus `nav`, and the segment count
is `{1,6}`: plx_ui::a11y::MAX_ID_SEGS, which the conformance suite holds every id to (the deepest
id built is four segments, `detail.shelf.1.card.2`).

A test in plx_screens' registry reads ALPHABET.json and asserts the alternation lists exactly the
namespaces the a11y coverage table reports (plus nav) and that the bound equals MAX_ID_SEGS, so a
new screen fails the build until the alphabet is told. ALPHABET gains the one by-id refusal line
the by-id fixture records, as an exact literal. The guard's own tests load the real file and pin
nas.local / first.last refused and nav.watchlist / detail.shelf.1.card.2 accepted.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… anchor

The by-id `Id` resolution row moved the recorded state shape (state_fp 0xea74_3865_5115_46c5 ->
0x7f1d_280c_909c_8603), so recorder.rs refused the committed v13 anchor. It is re-recorded
(tests/focusfp.sh --rec --only 12, plxnative-rec import, anchor: true restored) and replays SAME in
Targets and Resolve, 922 frames; the guard's and the tool's CURRENT_FP follow, and no state_fp was
edited by hand.

13-by-id-filmography (focusfp flow 13) is the one fixture that drives the by-id tokens on Flow 12's
controlled domain: focus:nav.watchlist (refused, the Filmography page has no strip),
focus:filmography.row.3 and press:filmography.row.0 (no @subject), then the two BACK keys. An anchor,
SAME in both modes, 980 frames. The pins in test_harness.py and test_replay_fixtures.py follow.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… anchor

tests/README.md said four recording directories and SAME=6 REFUSED_EXPECTED=2; the tree has six
directories (twelve replays): SAME=4, REFUSED_EXPECTED=8. The v13 anchor doc records the second
2026-11-17 re-recording and the by-id fixture, and the fixtures README names it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Base automatically changed from a11y/ids to main November 17, 2026 20:28
GLinnik21 and others added 9 commits November 17, 2026 23:47
Every cap-shaped constant needs a section in ci/list-caps.ini. MAX_ID_SEGS is a limit of the
accessibility-id grammar (the replay alphabet's id pattern repeats it), not of a list: an index
segment names any position, so nothing is out of reach.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…hine.rs by hash)

The A4 doc-claim fix reworded this comment to stop naming the removed pop_from_rest, but
ci/proofs/platform-generated-enums.json (ci/readonly_generated.py MACHINE_SOURCES) pins
machine/src/machine.rs by whole-file hash: any byte change, a comment included, fails the
generated-enum proof and with it check-machine-shape, test_transition_arguments and
test_readonly_generated. Re-sealing that certificate is an owner decision, so the file returns to
the reviewed bytes (1fafb56d...); the prose fix is held until the owner re-seals the proof (the
reworded file hashes to 5a920e18...).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…hat abort

tests/README.md's bullets still described the old Home/Settings/12-current graded-in-full world
under the new SAME=4 REFUSED_EXPECTED=8 header: they now name the two current anchors (922 and 980
frames) and the four historical refusals. The by-id fixture prose names the presses actually
observed to abort (press:nav.profile, press:nav.movies, press:home.hero.info), and the guard test
also pins home.shelf.2.card.5 as an accepted id.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…esolves

The 13-by-id-filmography recording now holds both fates of the one token: the
refusal on Filmography (no strip, owner=filmography) and, after four BACKs
down to Home, the resolve on the Home strip (Id row, refusal 0), beside the
focus:/press: on Filmography rows. It replays SAME in Targets and Resolve,
1209 frames, three consecutive runs. A Home press is not recorded: it aborts
the controlled recording with an unsupported Home application effect.

The unwinding records the Person store's close, so ALPHABET gains the literal
"close" with its source (PersonCmd/CollectionCmd::Close encoding). The sleeps
are one second because the loader's decoded-recording budget refuses a longer
take at load. The census pin follows the new frame count.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1209 frames, the refusal on Filmography and the resolve on Home, the Person
close literal, why no press is recorded on Home, and the loader budget that
keeps the take short.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 marked this pull request as ready for review November 17, 2026 21:13
@GLinnik21
GLinnik21 merged commit 1e5ce4e into main Nov 17, 2026
18 checks passed
@GLinnik21
GLinnik21 deleted the a11y/runtime branch November 17, 2026 21:33
GLinnik21 added a commit that referenced this pull request Nov 17, 2026
GLinnik21 added a commit that referenced this pull request Nov 18, 2026
…r a hero press (#1442)

Device and simulator scripts now reach elements by accessibility id instead of walking to them with direction keys, check where focus landed before taking a shot, and cannot press a title without naming it. This is the harness half of the series, after the ids (#1431) and the `focus:`/`press:`/`state:` tokens (#1432).

- **`tools/tv-session.sh` gains `focus <id>`, `press <id> [--rk RK]` and `state [--out FILE]`**, all under the TV lock.
  - Ids and ratingKeys are checked locally before anything reaches ssh or the FIFO.
  - A press on an element that acts on a title needs `--rk`, and the app refuses the press if that title is not the element's.
  - `key` refuses by-id words, so the verbs are the only way to send one.
  - The FIFO write escapes `'` for the remote shell and refuses any whitespace inside a token, because the app splits on whitespace.
  - `state` sends a random nonce and polls `plxnative-a11y.json` until the nonce matches.
- **`tools/a11y.py` is the simulator helper.**
  - It provides `focus`, `press(subject=)` and `expect_focus`.
  - Its command line applies the same title guard, with `--subject`. The library `press()` is unguarded, for scripts that drive the mock.
- **Every element whose press acts on a title it names now carries that title's ratingKey as its `A11y` subject.** It is read the way the activation reads it, with no state and no IO.
  - This covers the Home hero, the item menu, the Detail hero (a started show names the episode the press acts on), the Play Version rows, the player HUD's queue and restart controls, the failure screen's retries, the More menu's quality rungs, and the track and subtitle rows that write to the server.
  - `SUBJECT_BEARING` is the one list. A test holds it equal to every file that builds a play, queue-step or write message.
- **Home's hero/grid door.** A by-id press queues its focus move and its OK in the same frame, so it used to act on the element focused before the move.
  - A scripted focus move now clears that remap.
  - While a key's move has left the picture behind the focus, any by-id press of the focused element is refused as `unloaded` until the picture catches up.
  - A key move followed by a quick OK keeps today's behaviour.
- **The carousel holds still under a hero press.** While a press is armed on a hero button, the countdown restarts and a Flip or edge key is refused, so the commit acts on the title the press was accepted against. This also fixes a person's OK just before a turn.
- **A by-id press resolves against the live focus, and every delivery reads the live press state.** A by-id press batched after a key sees the focus that key moved, and a screen's tick sees a press armed in the same frame.
- **The Watchlist captures drive by id only.** Focus is checked through `state` before each shot, and any `a11y: refused` line fails the capture. `tests/player_shots.sh` presses the HUD by id.
- **The docs carry two rules:** prefer ids, walking only where focus travel is the subject; and the subject rule, pointing to `SUBJECT_BEARING`. They are in the `tv-session` and `ui-sim` skills, `docs/agent-reference.md`, `tests/README.md` and `rust-modules/ui/src/CLAUDE.md`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Nov 18, 2026
Two doc comments still named `library::LibraryScreen`'s `pop_from_rest`, which no longer exists, as the read gated on `By::Dir | By::Pointer`. One is the doc on `FocusTarget::FirstInGroupAnimated` in `machine.rs`, the other the module doc of `ui/src/containers/tabs.rs`. Both now tell that bug's history in the past tense, under its old name. They add one sentence for today: the shared card grid reads a `By::Dir | By::Pointer | By::Script` move as deliberate (`ui/src/cards/mod.rs`'s `Seen::of`), with `By::Script` since #1432.

`machine.rs` is pinned by hash in `ci/proofs/platform-generated-enums.json`. Its new hash is appended to `MACHINE_SOURCES` and to the certificate's list, and `CERTIFICATE_SHA256` is recomputed. Every changed line in `machine.rs` is a `///` line, and no other certificate field moves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant