Skip to content

refactor: tighten capture ownership boundaries - #1736

Merged
thymikee merged 1 commit into
mainfrom
agent/tighten-capture-boundaries
Aug 11, 2026
Merged

refactor: tighten capture ownership boundaries#1736
thymikee merged 1 commit into
mainfrom
agent/tighten-capture-boundaries

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Make Apple runner recording cancellation stop only the exact acquired runner session; if no durable runner identity exists, fail closed instead of issuing a blind stop.

Make shared Apple and Android provider scenarios reject unmodeled tool calls, while explicitly modeling the lifecycle, settings, and state probes their workflows own. Surface unconfirmed HarmonyOS recording cleanup as a composed warning, and delete three unreachable post-cutover helpers.

This is internal reliability and test-infrastructure tightening; it does not change the CLI surface or daemon wire protocol.

Validation

  • Seen red: Apple cancellation omitted expectedRunnerSessionId; unknown simctl/ADB calls silently succeeded; HarmonyOS cleanup residue was hidden; strict provider scenarios exposed missing lifecycle/state fixtures.
  • pnpm check:affected --run
    • 91 affected test files / 388 tests passed
    • changed-line coverage: 16/17 (94.12%); changed branches: 8/8
    • format, lint, typecheck, layering, fallow, build, package, Node integration, provider integration, replay compatibility, and daemon wire compatibility passed
  • GitHub remains authoritative for native helper builds and iOS, Android, macOS, and web smoke lanes.

Docs/skills are unchanged because behavior and CLI guidance are unchanged; this tightens ownership, diagnostics, and test fixtures.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.17 MB 2.17 MB +363 B
JS gzip 709.3 kB 709.5 kB +127 B
npm tarball 835.5 kB 835.6 kB +104 B
npm unpacked 2.91 MB 2.91 MB +363 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.7 ms 27.1 ms +0.4 ms
CLI --help 65.6 ms 65.9 ms +0.3 ms

Top changed chunks: no changes in the largest emitted chunks.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed exact head 2dcfaea0. The Apple cancellation cleanup is now scoped to the captured runner session, the missing-identity case correctly avoids a blind stop, Harmony cleanup warnings compose without clobbering finalizer warnings, the strict provider fixtures are coherent, and the removed helpers have no remaining references. The focused regressions are non-vacuous and all 31 CI checks are green. One readiness blocker remains: this changes a device-facing cancellation path, but current iOS smoke proves only normal recording/finalization and the PR supplies no live abort-after-runner-acquisition evidence. Please run the exact head on an iOS simulator/device, cancel after acquisition, and show that the captured runner session is stopped while no replacement or unrelated session is touched. Until then: code-review clean, not yet merge-ready; no ready-for-human label.

@thymikee

Copy link
Copy Markdown
Member Author

Exact-head live cancellation evidence is complete on 2dcfaea0b948b79b0c82602a7369db8b8fd5ec69 using the booted iPhone 17 Pro simulator (UDID 6044A251-23C2-4584-B7DB-87A16B787757). A standalone probe exercised the real production Apple runner transport and real XCTest runner, overriding only that request signal's post-acquisition throwIfAborted so cancellation landed deterministically after a live durable session existed.\n\n- Captured session before abort: 6044A251-23C2-4584-B7DB-87A16B787757:57672:1786449125500\n- Expected background outcome: request canceled\n- Replacement session: 6044A251-23C2-4584-B7DB-87A16B787757:57733:1786449133946\n- Replacement recording start and exact stop both succeeded. Since the recording slot is exclusive, the successful replacement start proves the canceled recorder was stopped; the different runner-session ID proves stale cleanup did not authorize against the replacement.\n\nThe first physical-device attempt was environment-blocked before recording because its developer disk image could not mount; no claim is made from that attempt. Cleanup is complete: the public setup session was closed, isolated daemon stopped cleanly, Settings terminated, runner lease/process absent, temporary probe removed, and the exact-head worktree is clean. All 31 GitHub checks remain green.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Aug 11, 2026
@thymikee
thymikee merged commit b8dd6a5 into main Aug 11, 2026
31 checks passed
@thymikee
thymikee deleted the agent/tighten-capture-boundaries branch August 11, 2026 11:55
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-11 11:56 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant