Prettier the phone_guard evidence and contract
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (push) Waiting to run
Python tests / test (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpA6wW2DKiovQADTdjWJoH
This commit is contained in:
Krzysztof Rudnicki 2026-09-25 16:13:05 +02:00
parent aa37852296
commit b8aa1389ef
2 changed files with 31 additions and 7 deletions

View File

@ -9,6 +9,9 @@
"android_ui --display self|<id> drives only this session's display under that app's lease; every input call carries -d.",
"Virtual-display trees come from the com.kuhy.a11ydump instrumentation helper, built from source and installed with adb install -r -t."
],
"out_of_scope": ["phone_lease scopes themselves (c0c51036)", "the ~/.claude hook wrapper, phone_deploy.sh and the phone-focus-mode whitelist (separate repos)"],
"out_of_scope": [
"phone_lease scopes themselves (c0c51036)",
"the ~/.claude hook wrapper, phone_deploy.sh and the phone-focus-mode whitelist (separate repos)"
],
"verifier": "pytest python_pkg/android_ui python_pkg/phone_guard at 100% branch coverage; pre-commit on the changed files; a real helper APK build; the live two-session run on the Pixel follows this commit."
}

View File

@ -1,6 +1,9 @@
{
"intent": "Several Claude sessions act on one phone at once without interrupting each other; a raw `adb shell input tap` (no lease) had landed in another session's app on 2026-09-25.",
"scope": ["python_pkg/phone_guard (new: classify, _remote, _need, vd_state, hook, CLI, tests)", "python_pkg/android_ui (--display, _a11y_helper + A11yDump.java, -d on every input, tests split under the 250-line cap)"],
"scope": [
"python_pkg/phone_guard (new: classify, _remote, _need, vd_state, hook, CLI, tests)",
"python_pkg/android_ui (--display, _a11y_helper + A11yDump.java, -d on every input, tests split under the 250-line cap)"
],
"changes": [
"phone_guard.classify maps every adb call in a shell command to a Need: nothing, screen, one app, whole phone, or a block",
"phone_guard.hook applies it as the Claude Code PreToolUse hook: acquires as this session, waits 40 s, exits 2 on refusal",
@ -9,10 +12,28 @@
"The helper source sits flat beside the module (A11yDump.java, a11y_dump_manifest.xml) to respect the two-directory path cap"
],
"verification": [
{"command": "pytest python_pkg/android_ui python_pkg/phone_guard --cov --cov-branch", "result": "pass", "evidence": "152 passed; every android_ui and phone_guard module 100% line and branch"},
{"command": "python3 -c 'from python_pkg.android_ui import _a11y_helper as h; print(h.build())'", "result": "pass", "evidence": "~/.cache/android_ui/a11ydump-fb2baa8888080a3c.apk built with the real SDK"},
{"command": "pre-commit run --files <changed-files>", "result": "pass", "evidence": "all hooks passed"}
{
"command": "pytest python_pkg/android_ui python_pkg/phone_guard --cov --cov-branch",
"result": "pass",
"evidence": "152 passed; every android_ui and phone_guard module 100% line and branch"
},
{
"command": "python3 -c 'from python_pkg.android_ui import _a11y_helper as h; print(h.build())'",
"result": "pass",
"evidence": "~/.cache/android_ui/a11ydump-fb2baa8888080a3c.apk built with the real SDK"
},
{
"command": "pre-commit run --files <changed-files>",
"result": "pass",
"evidence": "all hooks passed"
}
],
"risks": ["The hook passes unknown commands: it guards against interrupting other sessions, it is not a sandbox.", "The helper must stay in phone-focus-mode's whitelist or the focus-owner sweep hides it."],
"rollback": ["git revert the commit", "Remove the phone_guard_pretool.sh entry from ~/.claude/settings.json PreToolUse"]
"risks": [
"The hook passes unknown commands: it guards against interrupting other sessions, it is not a sandbox.",
"The helper must stay in phone-focus-mode's whitelist or the focus-owner sweep hides it."
],
"rollback": [
"git revert the commit",
"Remove the phone_guard_pretool.sh entry from ~/.claude/settings.json PreToolUse"
]
}