Skip to content

feat(agent-device): simlock runs the agent-device daemon - #495

Merged
V3RON merged 9 commits into
mainfrom
task/470
Oct 12, 2026
Merged

V3RON merged 9 commits into
mainfrom
task/470

Conversation

@V3RON

@V3RON V3RON commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #470

Status

Implement: done (83/83 green) Review: round 2 + 2 fix checks passed Hardware: n/a Gate: running
Next: gate

Done when

  • The tests above pass, src/lint-rules.test.ts included.

Assumptions

  • Assumption: the AgentDeviceSupervisor constructor takes the ports and facts as named options (baseEnvironment, clock, config, driverEnvironment, filesystem, healthProbe, home, leaseMaxTtlMs (the value of lease.maxTtlMs), logger, nodePath, nodeVersion, platforms, processRunner, processSupervisor, tcpProbe) — the spec names the inputs but not the shape; the tests fix this one.

  • Assumption: the supervisor may signal the child through the runner's handle or through ProcessSupervisor; the tests accept either — the spec says only "sends SIGTERM".

  • Assumption: StartDaemonOptions.agentDeviceHealth is the test hook the spec names; the wiring tests pass it through a cast until the green step adds the field.

  • Assumption: MemoryFilesystem creates (writeFileAtomic, writeFileExclusive, mkdir) follow a symlinked ancestor, as reads already did — the spec test with SIMLOCK_HOME reached through a symlink writes daemon.json under the unresolved spelling and reads it back resolved, which no implementation could satisfy otherwise.

  • Assumption: the supervisor keeps its state dir and pid record under the real path of SIMLOCK_HOME, the spelling the marker argument uses — one spelling, so a symlinked home cannot split them.

Review

Spec review: 3 blocking, 1 fixed, 2 notes. Code review: 11 blocking, 10 fixed, 4 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 10.3M.

Rejected:

  • spec: supervisor.test.ts:1099 "removes the record" unproven — duplicate of the code finding, fixed there
  • spec: supervisor.ts:248 start-failed remedy points to an empty log — duplicate of the code finding at :244, fixed there
  • code: supervisor.test.ts:1099 deleting removeRecord stays green — duplicate of the spec finding, fixed
  • code: supervisor.ts:745 stop-waiter removal untested — the leak is not observable without asserting private state

Fixed outside review: the daemon protocol bump 29 → 30 the spec asks for (fix check passed).

Written by an agent.

@V3RON

V3RON commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • spec: src/agent-device/host/agent-device-supervisor.ts:114 a child killed by a signal reports "exited after a signal" without the signal name, though the spec asks for the code or signal.
  • spec: src/agent-device/host/agent-device-supervisor.ts:525 with iOS on but no SIMLOCK_IOS_DEVICE_SET (the e2e fake driver returns {}), the daemon gets no device set and sees the host's default simulators.
  • code: src/daemon/main.ts:485 agentDevice.stop() is awaited unguarded; if it rejects, every driver disposal is skipped, leaving simlock's adb server running.
  • code: src/agent-device/host/agent-device-supervisor.ts:598 the warn line naming the surviving pid can be deleted with a green suite, because #fail already logs a message the test matches.
  • code: src/gateway/service.test.ts:1205 test title says a worker one protocol behind lacks device.add/driverDeviceId; with max now 30 that worker has both. False since feat(leasing): physical devices that go missing become absent, end their lease device-lost, and come back reclaimed #458.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 12, 2026 22:07
@V3RON
V3RON merged commit dc272a5 into main Oct 12, 2026
47 checks passed
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.

simlock runs the agent-device daemon

1 participant