Skip to content

refactor: remove the unwired managed-local device allocation (follow Simlock's lease-and-point design) - #3372

Merged
thymikee merged 4 commits into
chore/fallow-3from
chore/remove-managed-local
Oct 10, 2026
Merged

thymikee merged 4 commits into
chore/fallow-3from
chore/remove-managed-local

Conversation

@thymikee

@thymikee thymikee commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Simlock closed its half of ADR 0021's in-process allocator integration (simlock#70, not planned) in favor of agents leasing devices themselves. agent-device follows: an agent runs simlock lease … --export-env and drives the device through ordinary local runtimes (--ios-simulator-device-set "$SIMLOCK_IOS_DEVICE_SET" for iOS; the daemon inherits ANDROID_ADB_SERVER_PORT for Android).

Removes the never-activated foundations:

  • the managed-allocation package, managed request admission and reachability, and the managed-local runtime owner
  • the managed-local owner kind, managed binding fence and managedDevice scope in contracts
  • allocator-held device claims (schema 3) and their device status/release --stale rendering
  • managed branches in Android deployment/readiness and Apple simulator readiness

Released v0.21.24 could decode or print these shapes, but no shipped path produced them. A persisted managed-local envelope now decodes as unreattachable, and a schema-3 claim as inconsistent; tests cover both. ADR 0021 is rewritten to the replacing decision, and ADRs 0007, 0029 and 0033 plus the glossary are updated. Codex reviewed the plan and the diff.

122 files, +225/−9,861 (production: +53/−4,935). This exceeds the 1,000-line budget because it is almost entirely deletion.

Validation

Tested 71f0ab2db (rebased on main 19203c620): pnpm check:affected --run passed (full check set). Ordinary paths keep their coverage: device claims (92 tests), contracts/gateway/binding (122), and Android/Apple platform (2,086). This is a dead-path removal, so no live device run applies.

🤖 Generated with Claude Code

@thymikee
thymikee added this pull request to stack #3371 October 10, 2026 14:39
@thymikee thymikee changed the title chore/remove managed local refactor: remove the unwired managed-local device allocation (follow Simlock's lease-and-point design) Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

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

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.16 MB 5.14 MB -12.9 kB
Package (unpacked) 5.16 MB 5.14 MB -12.9 kB
Package (download) 1.55 MB 1.55 MB -4.2 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.1 ms 22.3 ms +1.2 ms
CLI --help 64.7 ms 66.7 ms +2.0 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 122 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/adr/0033-collocation-decision-table.md Outdated
@thymikee
thymikee force-pushed the chore/remove-managed-local branch from cda5c8b to 020e971 Compare October 10, 2026 15:13
@thymikee

Copy link
Copy Markdown
Member Author

The removal looks right at 020e971. Nothing in a shipped path produced these shapes, and a saved managed-local session or a schema-3 claim now fails safe: the session decodes as descriptor-invalid, open still refuses with DEVICE_IN_USE, and release --stale refuses and leaves the file untouched. No references to the deleted modules remain outside ADR history.

One leftover: the Android private-adb-server lane in adb-provider-scope.ts is now dead too. The only production caller that set a construction-time serverPort was src/managed-device-reachability.ts, which this PR deletes, so createScopedHostTransport, execOnScopedTransport, the lease branch of deviceServerPort and most of requireScopedSerial have no caller. Could you remove the scope-level serverPort and its scope-only tests in adb-provider-scope.test.ts, keeping the public per-call AndroidAdbExecutorOptions.serverPort? A named follow-up is fine too.

Not blocking: ADR 0021 §3 says SDK callers can pass serverPort through agent-device/android-adb, but every function there takes the caller's own executor, so that line could be reworded. The PR body says it is rebased on main, but the base is chore/fallow-3.

The earlier CI runs were cancelled when this push replaced them, and the new run is still going. There are no conflicts.

thymikee and others added 4 commits October 10, 2026 18:26
Simlock closed its side of ADR 0021's in-process allocator integration
(simlock#70, not planned): agents now lease a device themselves and point
agent-device at it. The agent-device foundations for the old design never
ran in a shipped production path, so they go:

- the managed-allocation package (operation journal, store, records,
  decision), managed request admission and reachability, and the
  managed-local runtime owner with its gateway registration
- the managed-local RuntimeOwnerRef kind, the managed binding fence, and
  PlatformRequestScope.managedDevice from contracts; capture-kit no longer
  decodes a managed-local owner, so such an envelope is unreattachable
- allocator-held device claims (schema 3): admission, conflicts,
  inspection classifications, settlement, session-open refusal, and the
  `device status`/`release --stale` allocator rendering; an unknown-schema
  record stays inconsistent and is never released as stale
- the managed device scope in Android deployment and readiness and Apple
  simulator readiness

Ordinary local runtimes, process-owned claims, simulator-set scoping and
the Android private-server transport are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR 0021 now records the replacing decision: agents lease devices from
Simlock and drive them through ordinary local runtimes, with
--ios-simulator-device-set for iOS and the daemon's ANDROID_ADB_SERVER_PORT
for Android. The withdrawn Host design is summarized for git-history
recovery. ADR 0007 drops its managed-device durability amendment, ADR 0029 stops
naming the removed Host, ADR 0033 gains a dated note that rows citing the
removed package no longer bind, and the glossary drops the managed-allocation
terms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…was later deleted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pins and export exemption

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Note: I reviewed 020e971. The branch now sits at 71f0ab2, which carries the same four commits rebased onto the updated chore/fallow-3, so the review below still applies, and the CI ask now means a completed green run at 71f0ab2.

The code in 020e971 looks right to me, but I can't call it ready yet: CI at this head has not finished. The 11 non-passing jobs show cancelled, not failed, because the push of 020e971 replaced those runs. This change deletes a workspace package, its lockfile entries, tsconfig references and fallow entries, so it touches every listed route (typecheck, lint, repo guards, fallow, unit and integration, bundle size). Please get a completed green run at 020e971 before merge. I did not run the tests or pnpm check:affected myself, so the PR body's claim that the full set passes is still unconfirmed. There are no conflicts.

Not blocking, take or leave: (1) The only production code that set a construction-time serverPort was the deleted src/managed-device-reachability.ts, so the scope-level serverPort in packages/platform-android/src/adb-provider-scope.ts (https://github.com/callstack/agent-device/blob/020e971/packages/platform-android/src/adb-provider-scope.ts#L399) and the matching lease branches in adb-transport.ts can no longer be reached. The rule would be that a port reaches adb only through the per-call AndroidAdbExecutorOptions.serverPort. The sites are AndroidAdbProviderScopeOptions, withAndroidAdbProvider, createDeviceAdbExecutor, createLocalAndroidAdbProvider and createSerialAdbSpawner, plus the scope-only tests. A named follow-up issue linked from the PR would also do. (2) In docs/adr/0021-host-simlock-managed-device-allocation.md (https://github.com/callstack/agent-device/blob/020e971/docs/adr/0021-host-simlock-managed-device-allocation.md#L60), section 3 says SDK callers can pass serverPort through agent-device/android-adb, but those functions run the caller's own executor, so the option only works if that executor reads it. Please say that. (3) The PR body counts (+53/-4,935) do not match the diff (+54/-5305), and it says "rebased on main" while the base is chore/fallow-3. The doc comment in src/daemon/device/device-claim-rule.ts (https://github.com/callstack/agent-device/blob/020e971/src/daemon/device/device-claim-rule.ts#L8) also has one overlong line, so please run pnpm format.

Is the scope-level Android serverPort lane worth deleting here, since this PR removes its only producer? The rest is deletion across contracts, daemon, platform packages and CLI, so the size looks fair, and the replacement already lives in --ios-simulator-device-set and the inherited ANDROID_ADB_SERVER_PORT.

The cubic-dev-ai P2 thread on the 0033 decision table is fixed at this head, because the dated 2026-10-10 note now also covers the managed-device-allocation.ts row and Batch 1, so please resolve it: #3372 (comment)

@thymikee
thymikee merged commit c2c09d4 into main Oct 10, 2026
31 of 42 checks passed
@thymikee
thymikee deleted the chore/remove-managed-local branch October 10, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant