Skip to content

feat(runtime): add contained transports for managed leases - #2285

Merged
thymikee merged 1 commit into
mainfrom
codex/adr-0021-contained-reachability
Sep 5, 2026
Merged

feat(runtime): add contained transports for managed leases#2285
thymikee merged 1 commit into
mainfrom
codex/adr-0021-contained-reachability

Conversation

@thymikee

@thymikee thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add request-local Android ADB provider and host transport support for managed lease private server ports.
  • Add the exact managed lease environment reachability adapter for the iOS simulator set and Android ADB port.
  • Add adversarial and fake-ADB tests proving transport isolation without mutating process environment.

This PR is the contained-transport foundation only. It deliberately does not register managed owners, acquire allocator claims, or wire a Host/Simlock granted lease into the exact request binding. The current managed-owner boundary fails closed until that Host integration exists, as required by ADR 0021.

Validation

  • pnpm check:affected --run passed on the exact head.
  • Focused managed reachability and Android transport suite: 45 tests passed.
  • Android package suite: 626 tests passed.
  • Apple simulator and inventory suite: 61 tests passed.
  • Apple XCTest suite: 103 tests passed.
  • Planted-red proof: reverting the Android transport implementation made 8 new tests fail.
  • Live Simlock-managed device evidence was unavailable locally: no active managed lease or private endpoint existed, and no device was mutated.

Follow-up

Host/Simlock integration must pass the granted lease into the exact managed runtime binding, wrap the admitted command in reachability.run, and add routed Android inventory/operation plus iOS simulator-set proof. This PR does not claim that production managed commands are wired yet.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.61 MB 2.61 MB +1.6 kB
JS gzip 878.4 kB 879.0 kB +586 B
npm bundled raw 2.61 MB 2.61 MB +1.6 kB
npm bundled gzip 878.4 kB 879.0 kB +586 B
npm tarball 1.04 MB 1.04 MB +506 B
npm unpacked 3.52 MB 3.52 MB +1.6 kB
npm clean-installed 3.52 MB 3.52 MB +1.6 kB

npm unpacked components

Component Base Current Diff
JS / dist source 2.77 MB 2.77 MB +1.6 kB
Apple runner source/project 544.4 kB 544.4 kB 0 B
Apple snapshot presentation source 33.8 kB 33.8 kB 0 B
Apple Simulator snapshot bridge source 30.5 kB 30.5 kB 0 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 43.3 kB 43.3 kB 0 B
Other package files 46.7 kB 46.7 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 23.9 ms 24.3 ms +0.4 ms
CLI --help 61.0 ms 61.7 ms +0.7 ms

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

Top changed packed files

Packed file Base Current Diff
dist/src/adb-executor.js 4.7 kB 5.8 kB +1.0 kB
dist/src/platform-runtime-android-adb-host.js 2.5 kB 3.1 kB +524 B
dist/src/device-input-state.d.ts 8.7 kB 8.7 kB +23 B

@thymikee

thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Review at exact head f9ee5d9 is blocked. P1: createManagedLeaseReachability is only referenced by its new test; no granted lease, managed runtime binding, or request route imports it. Therefore neither the iOS simulator-set path nor Android private-ADB-port scope can affect a real managed command, and the fake-ADB tests remain green even if production can never reach the adapter. Wire it at the single granted-lease → exact managed runtime-binding boundary and add a routed regression from a granted lease through a representative Android operation/inventory proving the private port (and iOS simulator-set path), or explicitly reframe this as unused foundation rather than a routing feature. The PR has ~321 net production lines and +1.6 kB unpacked, below the escalation thresholds; all completed checks pass, iOS Smoke is still pending, and live managed-lease evidence remains unavailable.

@thymikee thymikee changed the title feat: route managed leases through contained transports feat(runtime): add contained transports for managed leases Sep 5, 2026
@thymikee

thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Addressed the P1 by narrowing this PR scope. The title/body now describe the contained transport foundation, not production managed-command routing. The current tree intentionally has no Host/Simlock grant route or production managed-owner registration; ADR 0021 and the existing exact-owner refusal path make that integration a separate follow-up. The reachability adapter remains the typed seam that follow-up must use at the granted-lease → exact managed binding boundary, with routed Android inventory/operation and iOS simulator-set proof. Current head f9ee5d9 is unchanged and all GitHub checks pass.

@thymikee

thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

Reviewed exact head f9ee5d97214000986996b1e9b7e4c40c9c88659f after the rescope: READY as the explicitly contained transport foundation. ADR 0021's managed-owner boundary still fails closed because createManagedLeaseReachability has no production grant caller; this PR does not claim otherwise. Within scope, Android reachability is request-local, overrides caller port/env attempts at the root host, restores on failure, and has concurrent isolation coverage; iOS materializes the existing simulator-set identity consumed by Apple mechanics. All 17 applicable checks are green. Residual follow-up: Host/Simlock integration must bind the granted device inside reachability.run and add routed/live lease proof before claiming production managed-command routing.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 5, 2026
@thymikee
thymikee merged commit 54df6f3 into main Sep 5, 2026
18 of 19 checks passed
@thymikee
thymikee deleted the codex/adr-0021-contained-reachability branch September 5, 2026 17:10
@github-actions

github-actions Bot commented Sep 5, 2026

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

thymikee added a commit that referenced this pull request Sep 5, 2026
* origin/main:
  perf: bundle runtime dependencies and report full install size (#2310)
  ci: avoid unrelated Apple runner cache invalidation (#2303)
  fix(web): preserve the backend ref so snapshot refs match actionable refs (#2283)
  test(daemon): session-open-url-prewarm through the request seam (#2304)
  test(daemon): session-devices-batch-runtime through the request seam (#2305)
  chore(gates): layering baselines ratchet against merge-base (#2299)
  test(daemon): one typed conformance helper for the daemon runtime suites (#2298)
  chore(layering): derive the contracts export inventory from package.json (#2297)
  perf: bundle tar-stream to reduce install footprint (#2286)
  docs: simplify agent context and resolve conflicting guidance (#2287)
  refactor(cli): let help resolve command aliases itself and retire R12 (#2293)
  refactor(commands): retire the navigation-only type projection (#2294)
  feat(runtime): route managed leases through contained transports (#2285)
  refactor(contracts): build unavailable runtime facts once (#2291)
  refactor(cli): derive the common flag readers from the common-field table (#2292)
  feat(daemon): add managed allocation operation journal (#2284)
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