testsAndMisc/docs/superpowers/contracts/phone-lease-2026-09-20.json
Krzysztof kuhy Rudnicki b7e537fe01
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
Pre-commit checks / pre-commit (push) Has been cancelled
Python tests / test (push) Has been cancelled
Shell tests / shell-tests (push) Has been cancelled
Shell tests / arch-tests (push) Has been cancelled
phone_lease: one session drives the phone at a time; android_ui takes the lease on every call
Two sessions driving the same phone interleave their taps: on 2026-09-20 a
tap meant for the workout sandbox opened another session's manga reader,
twice. The lease is a flock-guarded JSON file per serial under
~/.cache/phone-lease/, owned by the nearest ancestor `claude` process (one per
session), refreshed on every android_ui call and expiring 180 s after the
last one, so a quiet session frees the phone without anyone remembering to.
A foreign fresh lease makes a call wait up to 60 s, then exit 3 naming the
holder and pointing at the alternatives (the phone's virtual display, the
headless emulator) instead of inviting a retry loop. phone_deploy.sh takes
the same lease (exit 40).

The oldest evidence artifact is pruned to stay under the 60-file cap; it
remains in history.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YbBZqUaNWyhHYfzz6zGC7q
2026-09-20 18:50:26 +02:00

16 lines
1.0 KiB
JSON

{
"title": "One phone, one driving session at a time",
"objective": "Every sanctioned path that touches the phone (android_ui, phone_deploy.sh) is mutually exclusive across Claude sessions, with automatic expiry so no session has to remember to release, and a refusal that names the holder and the alternatives.",
"acceptance_criteria": [
"A second session's android_ui call against a phone leased by another session waits up to 60 s then exits 3 naming the holder",
"The same session's calls refresh the lease without waiting",
"A lease untouched for 180 s no longer blocks anyone",
"python_pkg.phone_lease and python_pkg.android_ui keep 100% line and branch coverage"
],
"out_of_scope": [
"Making two sessions drive the same screen concurrently (virtual display / emulator scripts cover that)",
"Raw adb commands, which bypass the tools"
],
"verifier": "pre-commit run --files <changed> (pytest with --cov-fail-under=100), plus the two-session refusal reproduced on the real phone"
}