Skip to content
Back to skills

Verify Approval Guard

ASecurity

Use when a change touches the approval guard (D27, D31): guard.rs, the batch loop and guard_* functions in actor.rs, guarded / guarded_batch / call_guarded / held_batch in mcp.rs, run_batch in commands.rs, or the rig in tests/support/guard_rig.rs. Runs a property test over generated batches, human answers, ask categories, protocol versions and Mrtr retries, and says whether a tap that spends money or deletes can reach the device without the human's answer.

  • 456 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 14, 2026
ai-agentspythongoshellawstestinggit

Works with

  • claude code
  • cli
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add hridaya423/phonedriver --skill verify-approval-guard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Verify Approval Guard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Verify Approval Guard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hridaya423-verify-approval-guard/badge)](https://www.skillsdirectory.com/skills/hridaya423-verify-approval-guard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: verify-approval-guard
description: Use when a change touches the approval guard (D27, D31): guard.rs, the batch loop and guard_* functions in actor.rs, guarded / guarded_batch / call_guarded / held_batch in mcp.rs, run_batch in commands.rs, or the rig in tests/support/guard_rig.rs. Runs a property test over generated batches, human answers, ask categories, protocol versions and Mrtr retries, and says whether a tap that spends money or deletes can reach the device without the human's answer.
---

# Verify the approval guard

**Promise.** A tap, or `type --submit`, on a button that spends money, deletes an account, or is in a category the human opted into (`PHONEDRIVER_ASK`) never reaches the device without the human's answer through MCP elicitation, unless `autonomous` or `PHONEDRIVER_GUARD=off`. `Allow` covers exactly the one held step. `Allow for this session` covers that category only. Decline or dismiss taps nothing. In a `batch`, the steps before a held step run once, the held step runs at most once and only after Allow, and the batch goes on from the held step. On protocol 2026-07-28 a stale or mismatched retry never taps a guarded step. One `Allow` reaches the device at most once, whatever the daemon runs again after a lost or moved connection, however often a standing order finds the button, and when a replayed Simulator tap seems dropped (D825).

**Harm if it breaks.** An agent places an order, sends money or deletes an account on someone's phone without their word.

## Tool, and why

Property-based testing (proptest) of the real code, not a model of it. Everything under test is the real daemon, the real `Mcp` server and the real `FakeDevice` log: the question here is whether the code behaves for every generated input, not whether events can interleave badly in a design, so a TLA+ model of a hand-copied state machine would check the copy. The oracle (`Model` in `crates/cli/tests/guard_property.rs`) is a 30-line re-statement of the promise above and shares no code with `mcp.rs`. Nothing to install: `proptest` is a dev-dependency of `crates/cli`.

A TLA+ model of `held_batch` was considered and not written: the retry state is one slot keyed by the batch's arguments, and the second property drives the real slot with random interleavings (see Bounds).

## Coverage record

| Check | What it drives | Code it covers |
|---|---|---|
| `a_guarded_step_reaches_the_device_only_after_the_humans_answer` | 1 to 3 calls (`batch` of 1 to 5 steps, `tap`, `type --submit`, optionally `autonomous`) with a scripted human (allow, session, decline, cancel, bare accept, junk, none) and an ask set, on 2025-11-25 (human asked over the open connection) and 2026-07-28 (question returned, client calls again). Compares the fake device's input log and the prompts shown against the oracle. | `guard.rs`: `classify`, `guarded`, `asks`, `stance`, `submit_button`. `actor.rs`: `guard_tap`, `guard_submit`, `guard_button`, `batch` (the `i == 0` approval rule). `mcp.rs`: `guarded`, `guarded_batch`, `call_guarded`, `decision`, `commitment`. `commands.rs`: `run_batch`. |
| `a_stale_or_mismatched_retry_of_a_batch_never_taps_a_guarded_step` | 2026-07-28 only, raw `call_tool_once` with hand-built `input_responses`: a pool of 1 to 3 batches, then random calls, retries with any answer (also for the wrong batch, twice, or with no question open) and call-then-answer pairs. Checks no guarded step is tapped without a matching open question, and a retry that follows its own question resumes exactly at the held step. | `mcp.rs`: `held_batch`, the retry block at the top of `guarded_batch`, `held_step`. |
| `every_answer_to_every_kind_of_held_input_on_both_protocols` | Exhaustive in its bound, about 3 seconds: 5 held inputs (a payment tap, a send tap with send asked, `type --submit`, two batches) x 7 clients (each of the 6 answers, and one that cannot ask) x 2 protocols, each called twice. It exists because the random properties miss a rare answer on a rare path; the first scratch break of this skill was one. | Same as the first row. |
| `an_allow_reaches_the_device_once_whatever_is_lost_moved_or_back_on_screen` | Exhaustive in its bound, 36 cases: a `launch --restart` carrying `dismiss:"Delete account"`, held, then sent with `once`, `session` or `autonomous`, over one connection or two (D821), the reply to the tap lost never, once or every time, and the button back on screen after the tap or not. Counts the taps on both connections. | `daemon/mod.rs`: the repeat after a drop (D697). `actor.rs`: `carry`, `handle`. `actor/approval.rs`: `guard_button`. `actor/orders.rs`: `dismiss_all`. |
| `f1_*`, `f2_*` (ignored) | Deterministic reproductions of open findings, see below. | `mcp.rs`: `guarded` (retry with an answer), `guarded_batch` (`held_batch.take()`). |

Support code: `crates/cli/tests/support/guard_rig.rs` (screens `checkout()` and `composer()`, daemon and `FakeDevice` rig; `tests/guard.rs` uses it too). The 2026-07-28 client must be started with `ClientLifecycleMode::Discover`; `.serve(..)` always negotiates 2025-11-25, whatever version `get_info` names (see F3). The retry property fails with "finished without asking" if the Discover handshake is lost, so a silent downgrade to the old path cannot go unseen.

**Sync commit: `4fc2204`** (the head when this check was written; the covered files were unchanged by the commit that added it).

2026-11-25, D127: the batch loop (`actor/wait.rs`) gives each `act` step the target of the step after it as `next`, which changes how long the reply waits and not what is held or approved: the guard reads the tapped button on the screen the step starts from, as before. `guard_property` was run on the Mac mini (with `ulimit -n 4096`: an ssh shell's 256 files give `Too many open files`, on main too). Break B1 named `actor.rs`, where the loop no longer is, and matched nothing; `breaks.py` names `actor/wait.rs` now, and with the break in place the property failed with `device saw [Tap(Place), Tap(Place)]`. The sync commit is not moved.

2026-11-26, D138: a `tap` on text that is not on screen now drags a list before it resolves the text again (`actor/act.rs`: `look_for`). The drags go through `guard_touch` as a `scroll`'s do, and the element found goes on to `guard_tap` as before, so what is held and what an answer covers are unchanged. The property's screens show every button, so it does not generate a look; `--test guard a_guarded_button_that_a_tap_scrolled_to_is_held_before_it_is_tapped` does (one drag reaches the device, the tap only with `approval`). `guard_property` on the Mac mini: 7 passed. The sync commit is not moved.
2026-11-27, D138 again: the look moved to `actor/look.rs`. Its drags forward and every pull of the way back (`back`, up to three rounds) go through `guard_touch`, each against the screen read nearest to where that pull starts, so a pull that would start on a guarded button is held as a scroll's would be. `--test guard`: 62 passed, `guard_property`: 7 passed on the Mac mini. The sync commit is not moved.

2026-11-28, D150 (standing orders): a tap an order makes is sent through `act_now` with the consent of the call that carries it, so it is held as any tap is. `guard_property` puts five orders (a `dismiss` for each button, and `alerts:allow`) on every generated call: the screens hold no interruption, so none may fire, and the promise is as before. `expect::an_order_never_taps_a_guarded_button_without_the_humans_answer` (24 cases, fake device, `launch` with generated orders, asked categories and `autonomous`) is where an order does fire: no guarded tap reaches the device without `autonomous`, and the call returns the guard's question (-32019). Break: `approval: Some(Approval::Autonomous)` in the tap `Actor::obey` sends failed that property and `an_order_never_taps_what_the_guard_would_ask_the_human_about`. `breaks.py` was not run (it builds on the machine it is on, and this work builds on win-pc only). The sync commit is not moved.

2026-11-28, `set` (D147, D148, D149): every touch of a `set` goes through `act_now`, so a tap on a guarded dropdown option, picker button or slider is held as a `batch` step's is, and the CLI and MCP `set` are a `batch` of one step, so `guarded_batch` holds and resumes it. The property does not generate `set`; `--test guard a_set_stops_at_a_guarded_tap_unless_autonomous` (daemon) and `a_set_that_reaches_a_guarded_tap_asks_the_human_on_the_open_connection` and `..._on_the_retry_protocol` (MCP, both protocols: decline taps nothing, allow taps once) do, and `--test set a_tap_the_guard_holds_stops_the_set_and_a_set_cannot_go_around_it` checks that the fields before the held one stay set. `guard_property` passed (84 tests with `--test all guard`). Break run on win-pc: `set`'s per-field taps carrying `autonomous` failed all four of those tests. The sync commit is not moved.

2026-11-29, D177 (a late first-run page in a chain): in a `batch` that began with a cold launch carrying orders, a step whose target is not found runs the orders once more with the page rule (`Actor::late_page` in `actor/orders.rs`, called from the loop in `actor/wait.rs`) and, when one fired, sends the step again with the same `ActParams`, so its approval is the step's own (`i == 0` rule unchanged). The dismissal taps go through `act_now` with the call's consent as `obey`'s do. `--test all -- expect:: guard:: guard_property::` on win-pc: 108 passed. `expect::a_late_first_run_page_never_has_a_guarded_button_tapped_by_an_order` is where it fires on a guarded button: the step fails with -32019 and only the earlier dismissal reaches the device. Break: `st.approval = Some(Approval::Autonomous)` in `late_page` failed that test (`left: -32007 right: -32019`: the Pay button was tapped). The sync commit is not moved.

2026-11-29, D178 (`set` and standing orders): between two fields of a `set` the call's orders run through `Actor::between_fields` (`actor/set.rs`, `actor/orders.rs`), whose taps go through `act_now` with the `set`'s own consent, as `obey`'s do; a held dismissal stops the `set` with the guard's error and `set.done`. `--test set an_order_between_fields_never_taps_what_the_guard_would_ask_about` (a dialog whose button is `Delete account`, ordered dismissed): -32019, only the field's own tap on the device. Break: `orders.approval = Some(Approval::Autonomous)` in `set` failed it (`left: Null right: -32019`). `--test all -- set:: expect:: guard:: guard_property::` (win-pc, `--skip a_date_picker`, which overflows its stack on Windows at `dc0d3b98` too): 127 passed. The sync commit is not moved.

2026-11-29, D196 (a late prompt between fields): after a switch a `set` turned, `Actor::between_fields` runs `dismiss_all` again every `TREE_STEP` for up to `LATE_PROMPT_WAIT`, with the same `Standing` and so the `set`'s consent. `--test set a_late_dialog_between_fields_never_has_its_guarded_button_tapped_by_an_order` (a `Delete account` dialog 900 ms after the switch's tap, ordered dismissed): -32019, only `dark` on the device. Break: `orders.approval = Some(Approval::Autonomous)` in `set` failed it and `an_order_between_fields_never_taps_what_the_guard_would_ask_about` (`left: Null right: -32019`). `--test all -- set:: expect:: guard:: guard_property::` (win-pc, `--skip a_date_picker`): 133 passed. The sync commit is not moved.

2026-11-29, `teach` (D229 to D231): a person's touches become steps, and a taught flow is replayed through `act` as any saved flow, so the guard holds a taught Pay as it holds an agent's. `actor.rs` changed (the teaching state, `acquire` refusing other sessions while a person teaches, `Call::Teach` in the no-op list) and `commands.rs` (the `teach` verb and `save_taught`); neither changes which taps are held or what an answer covers, and teaching itself sends no input to the device. The property does not generate teaching; `--test all teach::a_taught_tap_on_pay_is_asked_about_on_every_replay` does: a taught tap on `Place order · $34.10`, replayed twice with no approval, is -32019 with no gesture each time, `approval: once` taps once, and the next replay is held again. Break run on win-pc: `guard_tap` passing a found element unasked failed it (`a taught Pay is held`). `--test all -- guard:: guard_property:: teach:: live:: secret_property::`: 116 passed. The sync commit is not moved.

2026-11-30, D291: `actor.rs`'s signal branch, while teaching, reads queued touches before marking the screen changed. Teaching sends no input to the device and holds no approval, so what is held and what an answer covers are unchanged. The whole run on the Mac mini includes `guard::` and `guard_property::`. The sync commit is not moved.

2026-12-02, #21 (D546): `actor.rs` changed in one match arm (`moved_beyond`); what is held and what an answer covers are unchanged. `guard_property::` 16 passed and break B1 failed 12 of 16 as it should on the Mac mini. The sync commit is not moved.

2026-12-02, D668: the batch loop (`actor/wait.rs`) writes each step's number and `changed` onto the touches the step left for the trace, after the step ran. Which taps are held and what an answer covers are unchanged. `--test all -- guard::` ran on win-pc in the targeted run, `guard_property` in the round's whole run. The sync commit is not moved.

2026-12-02, D691: the batch loop (`actor/wait.rs`) writes `after_new_screen` onto the touches a later step left for the trace, after the step ran. Which taps are held and what an answer covers are unchanged. `--test all -- guard:: guard_property::` passed on win-pc. The sync commit is not moved.

2026-12-03, `roaming` (D819 to D823, `actor.rs`, `daemon/mod.rs`, `daemon/stop.rs`, `core/device.rs`): a call whose connection went is run once more over another connection of the phone only when no request that can reach input was let through since it began (`Stoppable`'s count), or when running it twice ends the same (the set D697 already repeats). So a held step that is rerun had not been sent. On win-pc, tree 27a3bf39: `PROPTEST_CASES=60 --test all guard_property::` 16 passed (642 s), and break B1 failed 12 of 16 there. The property drops no connection. The sync commit is not moved.

2026-12-03, D851 and D852: a tap or `type --into` may now aim below the status bar (inside the same element) and may hide the keyboard and resolve the same ref on a fresh screen. Both happen before `guard_tap` and `guard_submit`, which read the element and the screen found after them; hiding the keyboard is the `press hide-keyboard` input. `--test guard` and `guard_property` passed in the whole runs on the Mac mini and win-pc. The property's screens have no keyboard or bar, and no break was run. The sync commit is not moved.

2026-12-03, D825 (`actor.rs`: `carry`, `handle`; `actor/approval.rs`: `guard_button`; `actor/orders.rs`; `actor/act.rs`; `actor/typing.rs`; `commands.rs`: the replay resend): one `once` reaches the device at most once. The property gained the exhaustive drop, move and return cases (red on 26 of 36 before the fix). On win-pc: `PROPTEST_CASES=60 --test all guard_property::` 17 passed (1401 s, beside another build); `--test all -- guard:: guard_property:: replay:: roaming:: expect:: daemon:: secret` 665 passed; breaks B11 and B12 failed the new case and B1 failed 3 of 17. The sync commit is not moved.

2026-12-03, D944: `guard_tap` (`actor/approval.rs`) also takes a guarded element lying over the point of a named tap (`guard::lying_over`). The property's screens hold no overlapping buttons, so it does not generate one; `--test all guard::a_tap_by_name_under_a_guarded_button_that_lies_over_it_is_held` does, and was red before the change (`expected a refusal, got Ok`), which is the break for it. `--test all -- guard:: guard_property::` passed on win-pc. The sync commit is not moved.

2026-12-03, D951: a tap named for an element first moves off other elements that lie over it (`core/aim.rs`, `Actor::aim_past`), then goes to `guard_tap` with the point it moved to; `guard.rs`'s own `takes_touch` moved to `Element::takes_touch`, unchanged. The property's screens have no overlap, so it does not generate this; `--test all guard::a_tap_by_name_under_a_guarded_button_that_lies_over_it_never_reaches_the_button_unasked` does. The whole of `breaks.py` was run on win-pc after the change: all 14 were caught. The same day, D952 (`actor/approval.rs`: `keep_to_the_order`; `actor/orders.rs` sets `Actor::obeying`): a standing order's tap is not sent where a guarded button may lie over its own, instead of asking about that button. `--test all guard::a_standing_order_taps_its_own_button_or_nothing_and_never_asks_about_another` covers it. The sync commit is not moved.

2026-12-03, D960 and D970 (`guard.rs`: `classify` holds a delete verb with one or two more words as delete; `actor/orders.rs`: `dismiss_all` taps a system alert that is still up again, through `act_now` with the same consent, up to three taps). The property's screens hold no alert and no such label, so `guard::tests::delete_with_the_thing_it_deletes_is_held_as_delete` and the `expect::` alert tests cover them. On the Mac mini, tree c825ebf2: `--test all guard_property::` 17 passed (34 s, default cases), and break B8 failed 13 of 17, `guard.rs` written back. The sync commit is not moved.

When you finish a change, run:

```
git diff --stat 4fc2204 -- crates/cli/src/daemon/guard.rs crates/cli/src/daemon/guard crates/cli/src/daemon/actor.rs crates/cli/src/daemon/session.rs crates/cli/src/mcp.rs crates/cli/src/commands.rs crates/cli/tests/support/guard_rig.rs
```

Empty output means the check still describes the code. Otherwise read the diff for anything that changes: which taps are held, what an answer covers, what a batch retry does, the wire shape of an answer, or which tools take part (a new tool that taps must be added to the oracle and to `item()`). Run the check below. When it passes and you have confirmed the model and the generators still describe the code at the new commit, move the sync commit above to the new hash. Do not move it just because the test passes: a new guarded path the generators never reach passes too.

2026-12-03, `ci2` (D740, D741): the action path gained two things. A `type` the connection dropped under may run `act_now` once more with the same call, which asks the guard again before it sends anything, and may send an Enter the call had not sent yet, which first passes `guard_submit` on a fresh read of the device that came back (the first version did not; `--test all an_enter_still_owed_is_asked_about_on_the_screen_that_came_back` failed on it). Any other dropped action is never sent again. `--test all property::` 20 passed, 1 ignored on win-pc, `guard_property::` among them. The property does not drop a connection.

2026-12-03, D834 to D836 (`actor/wait.rs`, `actor/act.rs`, `actor/set.rs`, `actor.rs`): the batch loop records which apps each step asked about, puts a pushed fault into a step's result or its failure, and after its closing read names one heard late; a call whose app was declared unanswering refuses any further input. A step the guard holds uses no fault up. Nothing changes what is held or what an answer covers. On win-pc, tree 12b5694c (v0.2.0 01299c29 merged): `PROPTEST_CASES=60 --test all guard_property::` 16 passed (615 s). The property pushes no fault. No break was run. The sync commit is not moved.

## Run

```
cargo test -p phonedriver --test all guard_property::
```

About 50 seconds, and the exhaustive test 4 seconds (every tap waits 500 ms for a screen change on the fake). Each property runs as four tests (`_1` to `_4`) that split its cases, so they run side by side; `PROPTEST_CASES` is the total across the four. It prints `coverage:` lines with `--nocapture`; on a good run these are in the hundreds of calls, prompts and resumes. A deeper run: `PROPTEST_CASES=60 cargo test -p phonedriver --test all guard_property::` (about 4 minutes). If `blaze` is free, `blaze test -p phonedriver --test all guard_property::` runs the same thing. The property tests do not run `autonomous` on batch (the MCP `batch` has no such field) or `PHONEDRIVER_GUARD=off` (an environment switch would race the other tests in the process).

A failure prints the shrunk input and what the device saw against what the promise says, in the code's own words (`Tap(Place)` is the "Place order · $34.10" button, `Submit` is `type --submit`, `Batch([...])` are the steps, `Retry(i, Allow)` is a second call carrying the answer). Steps of the story are numbered from 0.

## Real bug or modelling error

A **real bug** shows a guarded input (`Tap(Place)`, `Tap(Send)` with send asked, `Submit`) in "device saw" that the promise does not list, or a step before the held one that runs twice, or an approval that carries over to a second step. Reproduce it by hand with `guard.rs`'s `rig`: send the same calls and look at `rig.gestures()`. If the three-line story reads wrong in the product's terms ("the human said Allow once and two payments were tapped"), it is a bug. Report it with the counterexample; do not change the oracle to make it pass.

A **modelling error** is when the code did what the product intends and the oracle says otherwise. Typical causes: a new category or label added to the screens (`Btn`) with no oracle entry; a deliberate change to what a session approval covers (`Model::run`, `Ans::Session`); a changed prompt text (the prompt parser in `the_session_of_calls` reads `Tap "<label>"` and `Category: <name>`). Check the decision log first: if D27 or D31 changed, update `docs/decisions.md`, then the oracle, in the same commit.

A failure that mentions "finished without asking" or "asked, but the promise says no hold" means the question flow itself is off (or the Discover handshake was lost); fix the harness first.

To see the check fail on purpose: `python3 .claude/skills/verify-approval-guard/breaks.py <name>` applies one break to the product code, runs the check, writes the file back byte for byte as it was (its line endings and uncommitted edits too), and saves the output under `target/verify-approval-guard/`. Run it with no argument for the names:

| Break | Caught by |
|---|---|
| B1 approval on every batch step (`actor.rs`) | both |
| B2 resume from step 0 on the open connection (`mcp.rs`) | first |
| B2b resume from step 0 on 2026-07-28 | both |
| B3 `held_batch` never cleared | second |
| B4 any retry resumes the held batch | second |
| B5 session approval covers every category (`guard.rs`) | both |
| B6 / B6b decline taps (open connection / 2026-07-28) | first / both |
| B7 `type --submit` not guarded | both |
| B8 opt-in categories ignored | both |
| B9 a dismissed prompt taps, single `tap` on the open connection | first and the exhaustive one |
| B11 a used `once` covers the next held input (`actor/approval.rs`) | the D825 exhaustive one |
| B12 a call the guard let through is run again after a drop (`actor.rs`) | the D825 exhaustive one |

Before a commit that touches the covered files, run at least one break whose area you changed and confirm it still fails. A check that cannot fail is dead.

2026-11-24, group 4: `files` on a physical device (D119) asks through `guarded` with a new category, `files`, that never goes through `guard::stance`: the daemon runs a transfer only with `autonomous` or with the `approved` label and details of that very transfer, so a session answer does not cover the next file. `commitment` prints a file's label without `Tap`. The property does not generate transfers; `tests/files.rs` (`on_a_physical_device_every_transfer_asks...`) and `tests/files_mcp.rs` (a decline, an allow for the session, and the next file asked again, over elicitation) cover it. Break B9 run on the Mac mini failed two checks, as it should.

2026-11-25, round 2 (D129): files are an MCP tool of their own, which calls `guarded` as `clipboard` did. A listing of a physical device's files asks too, with category `files`; its answer for the session is kept in `Session::files_listed`, not in `guard_allowed`, and covers later listings and no transfer (`tests/files.rs`, `on_a_physical_device_a_listing_asks_and_a_session_approval_covers_listings_only`, which a break that lets a transfer through on any `session` approval now fails). The property does not generate listings. Break B5 run on the Mac mini failed four tests as it should. Two things about running a break there: without `ulimit -n 8192` the run fails on `Too many open files` and proves nothing, and the script restores with `git checkout`, so on a copy without `.git` put the file back by hand.

2026-11-28, `live` (D170): a client that cannot ask is answered from the page `phonedriver live` serves, through the daemon's `approval_ask` and `approval_answer`. `guard_property` generates it (a scenario with `page`: the script's answers are allowed once or declined, a session answer counts as allow once, and no reply may hold the question); break: a page's decline answers allow, failed with `device saw [Tap(Place)] the promise says []`. `mcp.rs` (`guarded`, `guarded_batch`, `on_the_page`) changed; the sync commit is not moved.

2026-11-29, `live2` (D172): a person on the live page can take a phone over and tap it through the daemon's `person` method, which never goes through `act_now`, so the guard does not ask (a person's tap is the human's word). The promise holds because the agent cannot reach that path: the daemon refuses `takeover`, `person` and `approval_answer` from a connection that greeted as `mcp`, `person` from any session but the one that took the device over, and no MCP tool or CLI verb sends them. The property does not generate takeovers (no tool can); `--test guard an_agent_cannot_take_the_phone_over_and_a_persons_own_tap_on_pay_is_not_asked_about` does: the three methods from an MCP connection and a touch from a connection that took nothing over are refused, the fake device logs no gesture, and the page's own tap on Pay is one gesture. Break run on win-pc: the MCP refusal removed failed it (`takeover from an agent's connection: Ok(...)`). `mcp.rs` and `guard.rs` did not change; the sync commit is not moved.

2026-11-29, D255 (resume through the guard): `devices` with `resume: true` is a `Touch` and goes through `guarded` on both protocols; the daemon answers an `mcp` connection's `resume` with -32019, category `resume`, and lets it go on only with `autonomous` or an answer whose `approved` names this stop. The prompt for it offers `Allow` only (`schema` reads the prompt), and the no-answer, decline and page-decline texts say `the agent stays stopped` instead of `nothing was tapped` (`undone`). The property does not generate resumes; `--test all guard::a_resume_* guard::no_answer_to_a_resume_*` (both protocols) and `stop::an_agent_resumes_only_with_the_persons_word_and_the_reply_says_whose_it_was` do. Breaks on win-pc: an approval with any label resumes failed the stop test; `decision` taking a cancel for Allow failed 12 `guard_property` tests and both no-answer tests. `--test all -- stop:: guard::` 93 passed. The sync commit is not moved.

2026-12-02, D560: `approved` carries the app the question named, and `Actor::act` refuses before any touch or scroll when another app is in front (`actor/approval.rs`: `still_in_the_approved_app`). The property's screens stay in one app, so it does not generate this; `--test all guard::an_approval_given_in_one_app_sends_nothing_in_another` and `guard::an_allow_after_the_app_changed_*` (both protocols) do, and fail without it. On the Mac mini: 296 passed over the guard, expect, set, teach, stop, files, replay, scenes, expose and live tests, 94 for `guard::` through the farm, and break B9 failed two `guard_property` tests as it should. The sync commit is not moved.

2026-12-02, D567: `mcp.rs` (`guarded_steps`, the refusal texts, `Held`) and `commands.rs` (`run_batch`, `show_batch`) changed what a reply says after an answer, not what is held or approved. On the Mac mini `--test all -- guard:: expose` 113 passed and `guard_property::` 16; breaks B2b (14 failed) and B6 (4 failed) are caught. B2b, B3, B4, B6b, B7 and B9 no longer matched the code and were rewritten; all twelve match once, and only B2b and B6 were run. After a break on a copy without `.git`, put the file back and rebuild before using the binary: the test build leaves a broken `target/debug/phonedriver`. The sync commit is not moved.

## Findings, fixed

F1, F2 and F3 were found at sync commit `4fc2204` and fixed in the commit that follows `55741c4`. Their tests now run by default.
- **F1.** A 2026-07-28 retry of `tap` or `type` was approved by any answer it carried. Now the server keeps one open question (`Held` in `mcp.rs`), keyed by the tool name and its arguments. An answer counts only on a retry of that exact call. Any other answer is treated as dismissed, and nothing is tapped. An `autonomous: true` call ignores a stray answer. Tests: `f1_an_answer_with_no_question_taps_a_payment`, `f1_an_answer_to_one_tap_approves_another`, and the property `a_stale_or_mismatched_retry_of_a_tap_or_type_never_taps_a_guarded_step`.
- **F2.** A stray answer emptied another call's open question. Now `take_held` compares the key before it takes the question. Test: `f2_a_stray_answer_does_not_cancel_the_pending_question`. Limit: the server keeps one open question, so a second call that asks replaces the first one.
- **F3.** `tests/guard.rs` now starts its 2026-07-28 client with `ClientLifecycleMode::Discover`. A decline or a dismissal on a retry now quotes the held question, which names the button and the category.

Limit: the key binds the answer to the call's arguments, not to what the screen shows at retry time. If the same call finds a different guarded button on the retry, the daemon applies the Once approval to that button.

## Not covered

- The label classifier (which text is guarded in which language): `guard.rs` unit tests and `tests/guard.rs` cover labels; this check uses fixed English screens with five buttons.
- Concurrent calls (the harness sends one at a time); the daemon's own ordering.
- `PHONEDRIVER_GUARD=off`, `autonomous` on `batch`, the CLI (`--approval`, exit code 5), `act` called straight on the daemon.
- A tap that reaches the device by another route: `shell input tap`, a point tap on a button, a double tap or long press on a guarded button (point taps are in `tests/guard.rs`), deep links, a button the screen merges into a container.
- A real client: Claude Code's elicitation UI and what it sends on 2026-07-28 are only as modelled by `Scripted`.
- Bounds: scenarios of at most 3 calls, batches of at most 5 steps, 14 answers, five buttons, one screen that does not change, session categories as the daemon keeps them for one MCP session. A pass covers those, not every length.

2026-11-30, `expose` (D307): an exposed run is a fourth kind of call (`Item::Run`, taps only) in both properties and in the exhaustive test, served from a folder of runs the scenario writes. `guarded_batch`'s ask-and-resume loop is now `guarded_steps`, shared by a batch and an exposed run (`Steps::Batch`, `Steps::Run`); an exposed run resumes at the step its replay's refusal names, and `Run::go` sends an approved step alone (`Verb::Replay` with `until`) and the steps after it without the approval. The oracle treats a run as a batch of taps. On win-pc: `PROPTEST_CASES=60 guard_property::` 16 passed. Break: the steps after the approved one sent with the approval failed `a_guarded_step_reaches_the_device_only_after_the_humans_answer_2` (`device saw [Tap(Place), Tap(Place)] the promise says [Tap(Place)]`), a retry property, and `guard::{legacy,mrtr}::an_approval_in_an_exposed_run_covers_only_the_step_it_was_asked_for`. `mcp.rs` and `commands.rs` changed; the sync commit is not moved.

2026-11-30, `expose` final tip (7be9dd44, after the fail-closed `UNNUMBERED` change and the shared `Channel::retrying`): on win-pc `guard_property::` 16 passed at the default count (30 s) and 16 passed at `PROPTEST_CASES=60` (660 s; last coverage `scenarios 1463, ops 7428, fresh questions 2851, exact resumes 915` and `scenarios 1234, calls 2489, prompts 2124, device inputs 2721`), exposed runs among the generated calls.

2026-12-01, `expose` after merging v0.2.0's 1b5f7581 (dba70540, `act.rs` resolve path and `session.rs` changed): on win-pc `guard_property::` 16 passed at the default count and 16 passed at `PROPTEST_CASES=60` (700 s).

2026-12-01, `scenes2` (D345): `replay`'s `as` runs a scene through MCP. A replay, one phone or two, is not asked through the client: a held tap stops it with the guard's refusal naming the person, the step and the phone, and the agent does the step with `tap`, which asks. `mcp.rs` changed (`Mcp::people`, `failure`, `for_mcp`), `guarded*` did not. The property does not generate scenes; `--test all scenes_mcp::the_guard_holds_a_tap_that_spends_money_on_the_second_phone_through_mcp` (the real `phonedriver mcp` over stdio, two fake phones) and `scenes::the_guard_asks_before_a_tap_that_spends_money_on_the_second_phone` (command line) do: a tap on `Place order` on bob's phone is refused and only alice's earlier tap reaches a device. Break, on win-pc: `params["approval"] = json!("autonomous")` in `Replay::act` failed both. `--test all -- guard_property:: guard:: secret_property::`: 111 passed. The sync commit is not moved.


2026-12-02, crash push and the gesture areas (D681 to D683): `actor.rs`, `actor/act.rs`, `actor/wait.rs`, `actor/observe.rs` and `commands.rs` changed: a crash or hang the device pushed goes into a call's `crashed`, a declared hang ends an `act` or `wait` still reading and a `batch` runs no step after it. All of that is after a touch was sent; what is held and what an answer covers are unchanged. On win-pc at 854e1357: whole run with `guard_property::` 0 failed, `PROPTEST_CASES=60` 16 passed (585 s), and break B1 failed the properties as it should. The property pushes no fault. The sync commit is not moved.

2026-12-03, D833: `type --into` and `clear` move their focus tap out of the gesture areas before `guard_tap` sees it, as `tap` already did (D264); what is held is unchanged. The 16 `guard_property` tests passed in the win-pc whole run.

2026-12-03, D886: `clear` hides a covering keyboard before `guard_tap` and checks focus after its tap (`focused_by_tap`, shared with `type --into`); the guard is asked with the field's point after the keyboard is gone. `--test all guard` passed on win-pc.

2026-12-03, `hunt-ios` (D886, iOS): `clear` and `type --into` go through `Actor::uncovered` (hide the keyboard, or refuse a field under a bar) before `guard_tap`, so the guard is asked with the point that is tapped. A call it refuses sends nothing. What is held is unchanged. `guard_property` passed in the Mac mini whole run. The sync commit is not moved.

2026-12-03, `roaming-fix` (D926 to D934; `mcp.rs` `guarded` and `touch`, `actor.rs` `carry`, `handle` and `watched`, `actor/wait.rs`, `session.rs`): an MCP `launch` whose standing order needs approval asks, and an allow sends that tap alone (D926); an answer holds only on the agent that was asked (D929). The property generates neither a launch nor a replaced agent: `--test all guard::a_standing_order_of_a_launch_*` and `guard::declining_a_standing_order_of_a_launch_taps_nothing` (both protocols) and `roaming::an_answer_given_for_one_agent_is_not_acted_on_by_another` do. On win-pc at c3eba1c5: whole run 0 failed, `PROPTEST_CASES=60 guard_property::` 17 passed (648 s), break B1 failed 5 and B12 failed the D825 exhaustive test, as they should; all fourteen breaks still match the code once. The sync commit is not moved.

2026-12-03, `roaming-fix` after merging v0.2.0 `0123f74d` (D944 with D926 and D929), on win-pc at 35a68a3b: whole run 0 failed, `PROPTEST_CASES=60 guard_property::` 17 passed (667 s); breaks B1 (8 failed), B11 and B12 (the D825 exhaustive test) were caught, and D944's, `lying_over` taken out of `guard_tap` (no entry in breaks.py, the property draws no overlap), failed `guard::a_tap_by_name_under_a_guarded_button_that_lies_over_it_is_held`. A throwaway test drove an MCP `launch` whose `dismiss` order's button lies under `Place order`, on both protocols: the question named `Place order`, and the allow tapped it once. The sync commit is not moved.

2026-12-03, `roaming-fix2` (D935; `actor.rs` `open_live`, `carry` and `run`: a reopen takes only the running device that was open, and a push cut on the only connection is `interrupted`), on win-pc at 106768ac: `PROPTEST_CASES=60 guard_property::` 17 passed (694 s); break B1 failed (at least 7) and B12 failed the D825 exhaustive test (both run with `PROPTEST_CASES=20`). The sync commit is not moved.

Files in this skill

  • SKILL.md10.9 KB
  • breaks.py3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.