testsAndMisc/docs/superpowers/evidence/phone-guard-2026-09-25.json
Krzysztof kuhy Rudnicki b8aa1389ef
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
Prettier the phone_guard evidence and contract
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpA6wW2DKiovQADTdjWJoH
2026-09-25 16:13:05 +02:00

40 lines
2.0 KiB
JSON

{
"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)"
],
"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",
"android_ui --display self|<id> resolves the session's phone_vd display and takes its package lease; a foreign display is refused (exit 5)",
"_a11y_helper builds a tiny instrumentation APK (javac, d8, aapt2, apksigner; no Gradle), cached by source hash, reading getWindowsOnAllDisplays()",
"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"
}
],
"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"
]
}