fix(daemon): harden command input handling for type, alert, push, clipboard, paths and artifacts
Merged
TH
12h ago+700+700+012345678901234567890123456789-159-159-012345678901234567890123456789
Summary
Fixes audit findings DEXEC-1/2/3/7, DSESS-1/4/6, CMD2-1 and DCORE-4 from the 2026-11-10 audit.
type(DEXEC-1/2): refuses only real snapshot refs (@e12,@e12~s3); text such as@elenaor@refundis now typed. Validation runs before binding, dialog recovery and ref-frame expiry, so thefill @eNhint names a live ref. Thetypeleg offindtypes its value verbatim.trigger-app-event(DEXEC-3): reads per-platform URL templates only on ios, macos and android. The refusal hint names only the variables that are actually read.alert(DEXEC-7): parses its subaction case-insensitively and refuses an unknown one before binding.push(DSESS-1): inline JSON longer than NAME_MAX is parsed as JSON instead of failing as a file path. The payload is resolved once.- Relative paths (DSESS-4): install, reinstall, trace and perf resolve them against the caller's cwd (
requestCwd). clipboard write ""(CMD2-1): now reaches the daemon as the clear request.- Recorded clearing
fill(DCORE-4): writesfill <selector> "". doctor(DSESS-6): reads platform inventories concurrently.- Deferred:
- DEXEC-6 (tar on artifact listing): it needs a protocol bump or a client that tolerates a missing
sizeBytes, because released CLIs print the field without a guard. The first attempt was reverted in this PR. - DEXEC-4 (sessionless
wait <ms>): it needs a selector runtime that works without a device.
- DEXEC-6 (tar on artifact listing): it needs a protocol bump or a client that tolerates a missing
About 28 files changed.
Validation
- Tested SHA
12c6599:pnpm check:affected --run --head,exactCommit=true. Format, lint, typecheck, layering, fallow, build and the related tests pass. The unit suite failed only on the 7 known root-only chmod tests. - Revert head
7e3682f: the affected tests (193),pnpm check:quickandpnpm check:daemon-wire-compatpass. All wire paths are identical tomain. - Risk:
alertnow refuses unknown subactions that it used to treat asget.
š¤ Generated with Claude Code