Repository navigation
feat(flow): links, tabs and menu items as steps; the commit point is the step the demo saw writing - #2499
feat(flow): links, tabs and menu items as steps; the commit point is the step the demo saw writing#2499abrichr wants to merge 3 commits into
Conversation
…the step the demo saw writing Adds openadapt_flow.gui, a neutral view of a screen (controls by role, name, state and containers) with adapters for a browser page (links included), an accessibility tree and a form_tx snapshot. gui.steps learns each clicked step's role from what the backend counted in the demonstration (commit, navigate, in place, unknown), never from its words, and judges a live step against it. judge_step is a registered verdict site.
… an in-place step that moves the screen From Gemini's review of #2499. A navigation must be shown not to write, so without a write count no step is judged and none is clicked. An in-place step that moved the screen did something the demo did not.
Independent adversarial review: REQUEST CHANGESFrom: Gemini Gemini run on c6d6cb1 (model Blockers
Non-blockingNone. |
Independent adversarial review: APPROVEFrom: Gemini Gemini run on f72b015 (model BlockersNone. Non-blockingNone. |
What this adds
The Set 4 v2 held-out run (#2464) stopped one clean case because its next control was a link, and the packs could only name buttons. This change makes links, tabs and menu items steps in the core engine, and works out which step commits from what the demonstration showed it doing.
openadapt_flow.gui, a neutral view of a screen. Controls carry a role, a name, a value or checked state, and the containers they sit in. Adapters build that view from:gui.dom), where links are now included;gui.adapters.screen_from_tree), for desktop apps and the spreadsheet test surface;form_txsnapshot (screen_from_form_snapshot), so the form layer can call this without a rewrite.gui.steps.learn_steps. Each demonstrated click on a button, link, tab or menu item gets a role from what the backend counted. It is a commit when writes were counted, a navigation when the screen changed with no write, in place when neither happened, and unknown when the backend could not count writes. Its words are never read, and the engine adds no new "save" word list.gui.steps.take_stepandjudge_step. A learned step is resolved on the live screen and clicked, then judged against the demonstration.judge_stepis a@verdict_sitewith a fail-open spec (tests/failopen/sites/gui_steps.py).A commit drawn as a plain GET link shows no write unless the pack declares its request path (
PageActuator(write_get_paths=...)). Without that declaration the link is learned as a navigation, so the program has one commit point fewer and the caller's no-commit rule still stops the run. That is deliberate: a request nobody counted is not evidence that anything was saved.Tests
tests/gui/test_gui_steps.pyhas 14 tests. Each app is recorded once through the backend a run uses, then replayed with other values. The negative cases change the app after the demonstration.The fail-open harness runs every generic mutation against
judge_step. A hand-made fail-open copy, one that accepts>=the demonstrated writes and coerces counts, fails M5, M10, M15 and P0. The fold ratchet is unchanged.Everything is synthetic, headless Chromium on the Mac, run single-process. No app is named in engine code, and no fixture copies a held-out portal.
Base and what is not here
claude/fail-open-general), for the verdict kernel and the harness. GitHub retargets this tomainwhen feat(flow): one verdict kernel, a fail-open harness and a fold ratchet #2476 merges.form_tx's reconciler does not call this yet. The form stack (fix(form-tx): read back every field, report the rest as not_checked, and measure on held-out quote portals #2429 to fix(form-tx): re-check after a sign-in, watch unbound controls, name every stop #2461) is unmerged, and it conflicts with feat(flow): one verdict kernel, a fail-open harness and a fold ratchet #2476 in four files. Wiringform_txin is a thin follow-up: adapt the snapshot, then take the step.