From 20e27bc6b6f3e0a062ede69e034a8a1d74fc18a4 Mon Sep 17 00:00:00 2001 From: abrichr Date: Tue, 1 Dec 2026 02:28:46 -0500 Subject: [PATCH 1/3] fix(transducer): every value typed into a saved form must be read back before VERIFIED wrap verified a save when the obligations compiled from the instruction were seen. A value the agent typed that no obligation names (a reference number, a field the instruction did not quote) could be dropped, cut or rewritten on save without stopping the run. With a pinned record identity, the done gate now holds, then releases unverified, while any value typed into the form a commit saved has not reappeared on a saved screen of the record (verbatim, or in the reopened form). This follows the post-save screen check model in #2849: every intended value is read back field by field. Limit: a wrong value that the app saves and shows back as typed is confirmed by this check. Catching it needs a check against the task (declared values), not a screen check. --- openadapt/transducer_v3_runtime.py | 69 +++++++++++++++++++++++++++++ tests/test_transducer_v3_runtime.py | 52 ++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/openadapt/transducer_v3_runtime.py b/openadapt/transducer_v3_runtime.py index 9b003a2493..6caef8528c 100644 --- a/openadapt/transducer_v3_runtime.py +++ b/openadapt/transducer_v3_runtime.py @@ -1176,6 +1176,59 @@ def observe_saved(self, state: EpisodeState, observation: Any, task: Any) -> Non w.confirmed = True self._reconcile_restored(state, ep, observation) + def _typed_values_gate( + self, + state: EpisodeState, + observation: Any, + task: Any, + history: Sequence[Any] | None, + budget: bool, + commit_idx: int, + action: Any, + ) -> Any | None: + """Hold, then release unverified, while a typed value is not read back.""" + unseen = self._unseen_writes(self.ep(state)) + if not unseen: + return None + hint = self._unseen_writes_hint(unseen) + held = self._hold( + state, observation, task, history, budget, + commit_idx + 20_000, "TYPED_VALUES_NOT_READ_BACK", hint, + ) # fmt: skip + if held is not None: + return held + self._release_unverified(state, commit_idx, hint) + return action + + def _unseen_writes(self, ep: V3EpisodeState) -> list[SavedWrite]: + """Values typed into a saved form that were never read back as saved. + + Only with a pinned record identity (field-bound read-back). Every value + the agent typed into the form a commit saved must reappear on a saved + screen of the record, whatever the field is called, before the run can + be verified. A value that was dropped, cut, or rewritten on save is + caught here even when no instruction obligation names it. + """ + if not [v for v in self.owner.pinned.values() if str(v).strip()]: + return [] + return [ + w for w in ep.writes if w.in_form and w.value.strip() and not w.confirmed + ] + + @staticmethod + def _unseen_writes_hint(unseen: Sequence[SavedWrite]) -> str: + lines = [ + "HOLD_DONE: these values were typed into a saved form but have not been " + "seen as saved on this record yet:" + ] + lines += [f"- {w.field_key.split('|', 1)[-1]}: {w.value}" for w in unseen[:12]] + lines.append( + "Open the saved record where they are stored and read them, without " + "changing or saving anything, then finish. If one did not save, enter it " + "again in that field and save once." + ) + return "\n".join(lines) + def _hold_hint( self, ep: V3EpisodeState, @@ -1379,6 +1432,17 @@ def pre_done( self._met_by_saved_writes(ob, ep.writes) for ob in diff.missing_obligations ): + gated = self._typed_values_gate( + state, + observation, + task, + history, + budget, + commit_idx, + action, + ) + if gated is not None: + return gated self._verified( state, commit_idx, 1, "persisted_state_reacquisition", "Every compiled field obligation is the pinned identity or a " @@ -1395,6 +1459,11 @@ def pre_done( return held self._release_unverified(state, commit_idx, diff.reason) return action + gated = self._typed_values_gate( + state, observation, task, history, budget, commit_idx, action + ) + if gated is not None: + return gated self._verified( state, commit_idx, 1, "persisted_state_reacquisition", "All compiled field obligations found in the saved read-back.", diff --git a/tests/test_transducer_v3_runtime.py b/tests/test_transducer_v3_runtime.py index a7888edabf..53ebf1c191 100644 --- a/tests/test_transducer_v3_runtime.py +++ b/tests/test_transducer_v3_runtime.py @@ -459,3 +459,55 @@ def test_hold_hint_names_confirmed_missing_and_where_it_looked(): assert "which shows this record" in hint assert "then finish" in hint and "Do not cancel or redo" in hint assert "Enter or correct exactly" not in hint + + +def test_typed_value_not_read_back_blocks_verified(): + # The task names only the comments; the agent also typed a reference number, + # and the app dropped it on save. Obligations alone would verify. + fill = { + "type": "fill_form", + "raw_action": { + "form_plan": { + "fields": [ + { + "selector": "[f.c]", + "name": "Comments", + "value": "CPT 29881; units 1", + }, + {"selector": "[f.s]", "name": "From", "value": "2026-12-16"}, + {"selector": "[f.n]", "name": "Number", "value": "PA14689226"}, + ] + } + }, + } + dom_blank = _fb_dom() + [ + {"selector": "[f.n]", "tag": "input", "text": "Number:", "value": ""} + ] + dom_filled = _fb_dom("CPT 29881; units 1", "2026-12-16") + [ + {"selector": "[f.n]", "tag": "input", "text": "Number:", "value": "PA14689226"} + ] + reopened = _fb_dom("CPT 29881; units 1", "2026-12-16", reopened=True) + [ + { + "selector": "[f.n]", + "tag": "input", + "text": "Number:", + "value": "", + "reopened": True, + } + ] + wrapped, _ = _wrap( + fill, _FB_SAVE, _FB_EDIT, *([{"type": "done"}] * 6), + pinned=_FB_PINNED, config=SupervisorConfig(enable_obligation_compiler=True), + ) # fmt: skip + wrapped.act(_fb_obs(dom_blank, _HEADER), _FB_TASK) + wrapped.act(_fb_obs(dom_filled, _HEADER), _FB_TASK) + wrapped.act(_fb_obs(_fb_dom(), _TRUNCATED), _FB_TASK) + for _ in range(5): + wrapped.act(_fb_obs(reopened, _HEADER), _FB_TASK) + if wrapped.last_receipt is not None: + break + receipt = wrapped.last_receipt + assert receipt is None or receipt.outcome != ReceiptOutcome.VERIFIED + state = wrapped.get_state("default-run", "default-task") + assert any("PA14689226" in iv.hint and "typed into a saved form" in iv.hint + for iv in state.intervention_log) # fmt: skip From 05304e052831ff261695f519813b8bf85cbdf34e Mon Sep 17 00:00:00 2001 From: abrichr Date: Tue, 1 Dec 2026 04:30:53 -0500 Subject: [PATCH 2/3] chore: drop unrelated test reformatting from the merge --- tests/test_cli_flight.py | 25 ++------------ tests/test_cli_pull.py | 4 +-- tests/test_cli_seal.py | 6 +--- tests/test_desktop_release_resume.py | 4 +-- tests/test_desktop_release_subject.py | 22 ++++--------- tests/test_everyday_quickstart.py | 4 +-- tests/test_packages_concurrency.py | 34 +++++--------------- tests/test_release_hosting.py | 11 ++----- tests/test_windows_governed_safety.py | 16 ++++----- tests/test_workflow_steps_before_checkout.py | 12 ++----- 10 files changed, 32 insertions(+), 106 deletions(-) diff --git a/tests/test_cli_flight.py b/tests/test_cli_flight.py index 424f23664e..48d2e73191 100644 --- a/tests/test_cli_flight.py +++ b/tests/test_cli_flight.py @@ -19,31 +19,12 @@ def captured(monkeypatch): def test_flight_passes_every_argument_and_restores_the_double_dash(captured): result = CliRunner().invoke( cli.main, - [ - "flight", - "--task-id", - "t1", - "--gate=file", - "--json", - "--", - "python", - "agent.py", - "--flag", - "-v", - ], + ["flight", "--task-id", "t1", "--gate=file", "--json", "--", "python", "agent.py", "--flag", "-v"], ) assert result.exit_code == 0, result.output assert captured["argv"] == [ - "flight", - "--task-id", - "t1", - "--gate=file", - "--json", - "--", - "python", - "agent.py", - "--flag", - "-v", + "flight", "--task-id", "t1", "--gate=file", "--json", + "--", "python", "agent.py", "--flag", "-v", ] diff --git a/tests/test_cli_pull.py b/tests/test_cli_pull.py index e0ecb74392..7a6af5def0 100644 --- a/tests/test_cli_pull.py +++ b/tests/test_cli_pull.py @@ -12,9 +12,7 @@ def test_pull_forwards_arguments(monkeypatch) -> None: monkeypatch.setattr(cli, "_flow_verbs", lambda: frozenset({"pull"})) monkeypatch.setattr(cli, "_require_supported_python", lambda: None) monkeypatch.setattr(cli, "_invoke_flow", lambda argv: seen.append(argv) or 0) - result = CliRunner().invoke( - cli.main, ["pull", "openemr/new-referral", "--out", "x"] - ) + result = CliRunner().invoke(cli.main, ["pull", "openemr/new-referral", "--out", "x"]) assert result.exit_code == 0 assert seen == [["pull", "openemr/new-referral", "--out", "x"]] diff --git a/tests/test_cli_seal.py b/tests/test_cli_seal.py index 3368c87d16..0be96cc672 100644 --- a/tests/test_cli_seal.py +++ b/tests/test_cli_seal.py @@ -15,11 +15,7 @@ def test_seal_forwards_to_agent(monkeypatch): cli_mod = types.ModuleType("openadapt_agent.cli") cli_mod.main = lambda argv: calls.append(argv) or 0 monkeypatch.setitem(sys.modules, "openadapt_agent.cli", cli_mod) - monkeypatch.setitem( - sys.modules, - "openadapt_agent.seal_cli", - types.ModuleType("openadapt_agent.seal_cli"), - ) + monkeypatch.setitem(sys.modules, "openadapt_agent.seal_cli", types.ModuleType("openadapt_agent.seal_cli")) result = CliRunner().invoke(main, ["seal", "verify", "report.json", "--json"]) assert result.exit_code == 0, result.output assert calls == [["seal", "verify", "report.json", "--json"]] diff --git a/tests/test_desktop_release_resume.py b/tests/test_desktop_release_resume.py index 8423b49ac8..b999d9df68 100644 --- a/tests/test_desktop_release_resume.py +++ b/tests/test_desktop_release_resume.py @@ -158,9 +158,7 @@ def test_a_resume_is_bound_to_the_tag_not_to_mains_current_tree() -> None: "Require that commit's Packages run and its desktop jobs to have passed", "Require that main has not changed Desktop since that commit", ): - assert gate[name]["if"].startswith("steps.state.outputs.release == 'true'"), ( - name - ) + assert gate[name]["if"].startswith("steps.state.outputs.release == 'true'"), name # A resume leaves the release output empty, so nothing builds. assert _jobs()["gate"]["outputs"]["release"] == "${{ steps.fresh.outputs.release }}" branch = _resume_branch() diff --git a/tests/test_desktop_release_subject.py b/tests/test_desktop_release_subject.py index daff7b20fa..90dd935480 100644 --- a/tests/test_desktop_release_subject.py +++ b/tests/test_desktop_release_subject.py @@ -96,9 +96,7 @@ def test_every_event_takes_the_newest_first_parent_desktop_commit() -> None: run = _gate_steps()[SUBJECT_STEP]["run"] # One subject rule for every event, never the run that started this one. assert run.count('subject="$(git log') == 1 - assert ( - 'subject="$(git log -1 --first-parent --format=%H "${GITHUB_SHA}" -- .)"' in run - ) + assert 'subject="$(git log -1 --first-parent --format=%H "${GITHUB_SHA}" -- .)"' in run assert 'subject="${PACKAGES_HEAD_SHA}"' not in run assert 'subject="${GITHUB_SHA}"' not in run # The run that started this one must still be on the history that is built. @@ -139,10 +137,7 @@ def test_only_a_history_without_desktop_changes_is_not_a_candidate() -> None: def test_a_partly_published_version_warns_on_unrelated_runs() -> None: run = _gate_steps()[STATE_STEP]["run"] - assert ( - _gate_steps()[STATE_STEP]["env"]["SUBJECT"] - == "${{ steps.subject.outputs.sha }}" - ) + assert _gate_steps()[STATE_STEP]["env"]["SUBJECT"] == "${{ steps.subject.outputs.sha }}" # Warns on another commit's Packages run or a schedule; still fails a # dispatch and the Desktop commit's own run. quiet = ( @@ -184,7 +179,7 @@ def test_the_subjects_latest_successful_push_run_decides() -> None: step = _gate_steps()[PACKAGES_STEP] assert step["id"] == "packages" run = step["run"] - lookup = run.split('passed="$(gh api', 1)[1].split(')"', 1)[0] + lookup = run.split('passed="$(gh api', 1)[1].split(")\"", 1)[0] for clause in ( 'head_sha="${SUBJECT}"', "event=push", @@ -248,12 +243,10 @@ def test_a_release_requires_macos_and_windows_on_the_oldest_python() -> None: run = _gate_steps()[PACKAGES_STEP]["run"] assert "for os in macos-latest windows-latest; do" in run assert 'job="desktop test / Python engine tests (${os}, py3.11)"' in run - assert 'grep -qxF "$(printf \'success\\t%s\' "${job}")"' in run + assert "grep -qxF \"$(printf 'success\\t%s' \"${job}\")\"" in run -def test_the_push_matrix_keeps_the_oldest_python_while_a_version_is_unreleased() -> ( - None -): +def test_the_push_matrix_keeps_the_oldest_python_while_a_version_is_unreleased() -> None: path = Path(__file__).resolve().parents[1] / ".github/workflows/desktop-test.yml" jobs = yaml.safe_load(path.read_text(encoding="utf-8"))["jobs"] pending = jobs["release-pending"] @@ -267,9 +260,6 @@ def test_the_push_matrix_keeps_the_oldest_python_while_a_version_is_unreleased() assert tests["needs"] == "release-pending" assert tests["if"] == "${{ !cancelled() }}" exclude = tests["strategy"]["matrix"]["exclude"] - assert ( - "github.event_name == 'push' && needs.release-pending.outputs.pending == 'false'" - in exclude - ) + assert "github.event_name == 'push' && needs.release-pending.outputs.pending == 'false'" in exclude assert '{"os":"macos-latest","python-version":"3.11"}' in exclude assert '{"os":"windows-latest","python-version":"3.11"}' in exclude diff --git a/tests/test_everyday_quickstart.py b/tests/test_everyday_quickstart.py index 840b17adc5..5079bc1f18 100644 --- a/tests/test_everyday_quickstart.py +++ b/tests/test_everyday_quickstart.py @@ -27,9 +27,7 @@ ) from openadapt_flow.runtime.effects.local_state import LocalStateVerifier from openadapt_flow.verify_run import VerifyConfig -except ( - ImportError -): # launcher CI installs released openadapt-flow without everyday probes +except ImportError: # launcher CI installs released openadapt-flow without everyday probes _MacosCalendarEventSource = None # type: ignore[assignment] _MacosNightShiftSource = None # type: ignore[assignment] LocalStateVerifier = None # type: ignore[assignment] diff --git a/tests/test_packages_concurrency.py b/tests/test_packages_concurrency.py index 2e41c4d705..b253a44216 100644 --- a/tests/test_packages_concurrency.py +++ b/tests/test_packages_concurrency.py @@ -23,9 +23,7 @@ import pytest import yaml -WORKFLOW = ( - Path(__file__).resolve().parents[1] / ".github" / "workflows" / "packages.yml" -) +WORKFLOW = Path(__file__).resolve().parents[1] / ".github" / "workflows" / "packages.yml" def _concurrency(workflow: Path = WORKFLOW) -> dict[str, str]: @@ -183,9 +181,7 @@ def _push(run_id: int, sha: str, commits: int = 2) -> dict[str, Any]: "ref": "refs/heads/main", "event": { "head_commit": {"id": sha}, - "commits": [ - {"id": f"{sha}{i}", "modified": []} for i in range(commits) - ], + "commits": [{"id": f"{sha}{i}", "modified": []} for i in range(commits)], }, } } @@ -203,14 +199,10 @@ def _pull_request(number: int, run_id: int) -> dict[str, Any]: def _other(event_name: str, run_id: int, sha: str = "same") -> dict[str, Any]: - return { - "github": {"event_name": event_name, "sha": sha, "run_id": run_id, "event": {}} - } + return {"github": {"event_name": event_name, "sha": sha, "run_id": run_id, "event": {}}} -def _group_and_cancel( - context: dict[str, Any], workflow: Path = WORKFLOW -) -> tuple[str, bool]: +def _group_and_cancel(context: dict[str, Any], workflow: Path = WORKFLOW) -> tuple[str, bool]: concurrency = _concurrency(workflow) group = _evaluate(concurrency["group"], context) cancel = _evaluate(str(concurrency["cancel-in-progress"]), context) @@ -221,9 +213,7 @@ def _group_and_cancel( def _desktop_push_survives(workflow: Path = WORKFLOW) -> bool: # The #1574 sequence: a Desktop-changing merge, then an unrelated merge. desktop_group, _ = _group_and_cancel(_push(40210206361, "05a84be7e"), workflow) - later_group, later_cancels = _group_and_cancel( - _push(40210715609, "a016fd67e"), workflow - ) + later_group, later_cancels = _group_and_cancel(_push(40210715609, "a016fd67e"), workflow) return desktop_group != later_group or not later_cancels @@ -267,9 +257,7 @@ def test_the_rule_does_not_read_the_push_payloads_file_lists() -> None: assert "github.event.commits" not in str(concurrency["cancel-in-progress"]) -def test_the_old_payload_rule_would_have_cancelled_the_desktop_push( - tmp_path: Path, -) -> None: +def test_the_old_payload_rule_would_have_cancelled_the_desktop_push(tmp_path: Path) -> None: # Guards the evaluator itself: the rule this replaced fails the #1574 case. old = tmp_path / "packages.yml" old.write_text( @@ -297,13 +285,7 @@ def test_the_evaluator_reads_github_semantics() -> None: # || and && return operands, missing properties are null, ! negates. context = {"github": {"a": 0, "b": "x", "event": {"commits": [{"m": ["a/b"]}]}}} assert _evaluate("${{ github.a || github.b }}", context) == "x" - assert ( - _evaluate("${{ github.event.pull_request.number || 'none' }}", context) - == "none" - ) + assert _evaluate("${{ github.event.pull_request.number || 'none' }}", context) == "none" assert _evaluate("${{ !github.event.commits[19] && 'short' }}", context) == "short" assert _evaluate("p-${{ github.b == 'x' }}", context) == "p-true" - assert ( - _evaluate("${{ contains(toJSON(github.event.commits), 'a/b') }}", context) - == "true" - ) + assert _evaluate("${{ contains(toJSON(github.event.commits), 'a/b') }}", context) == "true" diff --git a/tests/test_release_hosting.py b/tests/test_release_hosting.py index b827461327..aa7193f277 100644 --- a/tests/test_release_hosting.py +++ b/tests/test_release_hosting.py @@ -105,9 +105,7 @@ def _package_ruleset(pattern: str, *rule_types: str) -> dict: "openadapt-kernel", ], ) -def test_release_hosting_accepts_a_package_tag_under_its_own_rules( - package: str, -) -> None: +def test_release_hosting_accepts_a_package_tag_under_its_own_rules(package: str) -> None: MODULE.verify_release_hosting_documents( {"enabled": True}, [ @@ -129,12 +127,7 @@ def test_release_hosting_launcher_rules_do_not_cover_a_package_tag() -> None: @pytest.mark.parametrize( "tag", - [ - "openadapt-v2.2.0", - "openadapt-viewer-v1.0.0", - "flow-v2.2.0", - "openadapt-flow-2.2.0", - ], + ["openadapt-v2.2.0", "openadapt-viewer-v1.0.0", "flow-v2.2.0", "openadapt-flow-2.2.0"], ) def test_release_hosting_refuses_a_tag_outside_the_package_list(tag: str) -> None: with pytest.raises(ValueError, match="release tag must be"): diff --git a/tests/test_windows_governed_safety.py b/tests/test_windows_governed_safety.py index f2bcbe1cbe..6a7a2df024 100644 --- a/tests/test_windows_governed_safety.py +++ b/tests/test_windows_governed_safety.py @@ -363,9 +363,8 @@ def test_a_held_run_is_checked_through_the_real_reader( db = tmp_path / "patients.db" env = {**os.environ, "PN_DB": str(db)} - subprocess.run( - [sys.executable, str(PN_DB), "seed"], env=env, check=True, capture_output=True - ) + subprocess.run([sys.executable, str(PN_DB), "seed"], env=env, check=True, + capture_output=True) seed_rows = _read_all(db) if column is not None: con = sqlite3.connect(db) @@ -401,9 +400,8 @@ def test_a_halted_target_note_changed_to_null_through_real_reader_fails( db = tmp_path / f"patients_{phase}.db" env = {**os.environ, "PN_DB": str(db)} - subprocess.run( - [sys.executable, str(PN_DB), "seed"], env=env, check=True, capture_output=True - ) + subprocess.run([sys.executable, str(PN_DB), "seed"], env=env, check=True, + capture_output=True) seed_rows = _read_all(db) evidence = _passing() @@ -427,7 +425,5 @@ def test_a_halted_target_note_changed_to_null_through_real_reader_fails( evidence[phase]["rows"] = _read_all(db) problems = check.check(evidence) assert f"{phase}: the target holds an unexpected note" in problems - assert ( - f"{phase}: the target was written but the outcome is 'HALTED_BEFORE_EFFECT'" - in problems - ) + assert f"{phase}: the target was written but the outcome is 'HALTED_BEFORE_EFFECT'" in problems + diff --git a/tests/test_workflow_steps_before_checkout.py b/tests/test_workflow_steps_before_checkout.py index 3153a655c5..e631e81b87 100644 --- a/tests/test_workflow_steps_before_checkout.py +++ b/tests/test_workflow_steps_before_checkout.py @@ -24,13 +24,9 @@ def test_no_run_step_before_checkout_uses_a_repo_directory() -> None: problems = [] for path in sorted(WORKFLOWS.glob("*.yml")): workflow = yaml.safe_load(path.read_text(encoding="utf-8")) or {} - default = ((workflow.get("defaults") or {}).get("run") or {}).get( - "working-directory" - ) + default = ((workflow.get("defaults") or {}).get("run") or {}).get("working-directory") for name, job in (workflow.get("jobs") or {}).items(): - job_default = ((job.get("defaults") or {}).get("run") or {}).get( - "working-directory", default - ) + job_default = ((job.get("defaults") or {}).get("run") or {}).get("working-directory", default) checked_out = False for step in job.get("steps") or []: if "actions/checkout" in str(step.get("uses", "")): @@ -38,7 +34,5 @@ def test_no_run_step_before_checkout_uses_a_repo_directory() -> None: if "run" in step and not checked_out: directory = step.get("working-directory", job_default) if _inside_repo(directory): - problems.append( - f"{path.name}:{name}:{step.get('name')} -> {directory}" - ) + problems.append(f"{path.name}:{name}:{step.get('name')} -> {directory}") assert problems == [], "\n".join(problems) From d163eab5d54a238fc6d250f0cde90f4177c0b973 Mon Sep 17 00:00:00 2001 From: abrichr Date: Tue, 1 Dec 2026 05:08:50 -0500 Subject: [PATCH 3/3] test: typed-values gate holds with a click before the save; the run must finish unverified --- tests/test_transducer_v3_runtime.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/test_transducer_v3_runtime.py b/tests/test_transducer_v3_runtime.py index 5cd5c39d13..5ea45f425d 100644 --- a/tests/test_transducer_v3_runtime.py +++ b/tests/test_transducer_v3_runtime.py @@ -461,7 +461,8 @@ def test_hold_hint_names_confirmed_missing_and_where_it_looked(): assert "Enter or correct exactly" not in hint -def test_typed_value_not_read_back_blocks_verified(): +@pytest.mark.parametrize("click_before_save", [False, True]) +def test_typed_value_not_read_back_blocks_verified(click_before_save): # The task names only the comments; the agent also typed a reference number, # and the app dropped it on save. Obligations alone would verify. fill = { @@ -495,19 +496,25 @@ def test_typed_value_not_read_back_blocks_verified(): "reopened": True, } ] + before_save = ( + [{"type": "click", "target_name": "[f.s]"}] if click_before_save else [] + ) wrapped, _ = _wrap( - fill, _FB_SAVE, _FB_EDIT, *([{"type": "done"}] * 6), + fill, *before_save, _FB_SAVE, _FB_EDIT, *([{"type": "done"}] * 6), pinned=_FB_PINNED, config=SupervisorConfig(enable_obligation_compiler=True), ) # fmt: skip wrapped.act(_fb_obs(dom_blank, _HEADER), _FB_TASK) wrapped.act(_fb_obs(dom_filled, _HEADER), _FB_TASK) + if click_before_save: + wrapped.act(_fb_obs(dom_filled, _HEADER), _FB_TASK) wrapped.act(_fb_obs(_fb_dom(), _TRUNCATED), _FB_TASK) - for _ in range(5): + for _ in range(8): wrapped.act(_fb_obs(reopened, _HEADER), _FB_TASK) if wrapped.last_receipt is not None: break receipt = wrapped.last_receipt - assert receipt is None or receipt.outcome != ReceiptOutcome.VERIFIED + assert receipt is not None # the run finished + assert receipt.outcome != ReceiptOutcome.VERIFIED state = wrapped.get_state("default-run", "default-task") assert any("PA14689226" in iv.hint and "typed into a saved form" in iv.hint for iv in state.intervention_log) # fmt: skip