Repository navigation
Conversation
…sible A Tab onto an icon button, or an ArrowDown that highlights an option, gave its step no postcondition, and a strict policy refused it as vacuous. The recorder now keeps the focused element's identity around each key, and the compiler adds a focus_on postcondition when that element has a specific identity no other element shares at teach time: a data-testid, an id, or a role with a non-empty accessible name. At replay the focused element must have that identity and be the only one with it, and, for an option highlight, an option must be active (aria-activedescendant or aria-selected). Anything weaker asserts nothing, never passes, and still counts as vacuous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abrichr
marked this pull request as draft
October 25, 2026 14:51
This branch has not been deployed
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.
Bug 22 from the second-installation work (#1548).
Problem
Medplum's form has controls with nothing readable beside them, so #1548 teaches some of its fields by keyboard. Two of those keys change nothing the compiler can see:
The compiler gave those steps no postcondition, and
clinical-writerefused the program (prohibit_vacuous_postconditions,max_unverified_steps).Change
A structural postcondition,
focus_on, alongsideurl_changedandtitle_changed. It is mined only for key steps that have no visual postcondition.keyorhotkeyevent, it keeps the focused element's identity (focus_before,focus_after).PlaywrightBackend.focus_identity()reads:data-testidand theid, each with the count of elements sharing it in the element's document;aria-activedescendantnames an element, or the listbox it controls has anaria-selectedoption.focus_ononly when the key moved the focus or made an option active, and the element has a specific identity no other element shared at teach time. That is a testid, then an id, then a role with a non-empty name. A tag alone, a role without a name, or a shared identity gets no postcondition, and the step stays vacuous.focus_active_option, an option must also be active. An unreadable focus, nothing focused, a different element, a second element with the same identity, or a postcondition with no specific identity all fail.is_vacuouscounts afocus_onas asserting something only when it names a specific element (focus_identity_is_specific). A degenerate one is still refused byprohibit_vacuous_postconditions.lint_param_leakagechecks the focus name and value for demonstrated parameter values.focus_onout of revalidation, as it doeslocal_edit: it is relative to the moment the key was pressed.Tests
tests/test_focus_on_postcondition.py(18 tests):focus_on. A tag only, a role with no name, a shared role and name, a shared testid, or a key that moved nothing gets no postcondition. An option highlighted on the same control is markedfocus_active_option.focus_onmakes a key step non-vacuous. One without a specific identity stays vacuous.Local runs:
test_record_compile_replay_emit_roundtripandtest_installer_starts_with_an_empty_allow_list_and_default_reboot_policy) fail the same way on a branch without this change: a subprocess can't import the package in this environment.Not yet run against Medplum. That comes at the next fixture lease, on #1548.
🤖 Generated with Claude Code