Repository navigation
Description
Part of #1635.
Scope
In remote mode simlock files put, get, list and rm move files to and from the lease's folder on its worker, so simlock files put app-debug.apk then simlock adb install app-debug.apk installs a local build. A transfer of any size goes on while bytes move and ends after 60 s of silence. A folder is refused with a pointer to #1636. A remote simctl or adb that fails after naming a path on this machine prints one hint saying the command ran on the worker.
A user would notice: an upload cut while it was still moving, a file landing under another lease, a download written partly, or a hint on a command that succeeded.
Technical spec
Commit 1cd9315.
Rows
Behaviours: B8, B9
Interfaces: I8, I9
Existing code: X14, X15, X29, X30, X19 (reference/cli.mdx (a simlock files section), using-devices/remote-agents.mdx lease files)
Facts
| # | Fact | Source |
|---|---|---|
| F1 | The upload route takes the file's raw bytes as the body, up to 2 GiB a file and 4 GiB a lease, answers 201, and lists UPLOAD_STALLED, FILE_BUSY, FILE_TOO_LARGE, LEASE_FILES_FULL, INSUFFICIENT_DISK_SPACE |
src/http/lease-declarations.ts:387-446 |
| F2 | get and rm answer UNKNOWN_FILE for a name the folder lacks |
src/http/lease-declarations.ts:423, :434 |
| F3 | A lease file name is 1 to 128 characters of letters, digits, ., _ and -, starting with a letter or digit |
src/contract/operations-leases.ts:93 |
| F4 | The CLI's HTTP port today is GET only, 10 s per call, 1 MiB body | src/ports/http-json.ts:1, :10 |
| F5 | A remote passthrough's output arrives as separate stdout and stderr chunks and ends with the tool's exit code | src/cli/commands/passthrough.ts:61-73 |
Modules touched
src/cli/ (commands/files.ts (new), tree.ts (the files node and its children), index.ts (the files lines of USAGE), commands/passthrough.ts (the hint), environment.ts (the streaming port and a local stat), types.ts, lazy-loading.test.ts, AGENTS.md), src/ports/ (a streaming HTTP adapter beside http-json.ts, its fake, index.ts or testing.ts, AGENTS.md), e2e/slow-remote-cli.test.ts (its Android case), and the website pages reference/cli.mdx and using-devices/remote-agents.mdx. Searches: HttpJson, httpJson, /files, LEASE_FILE_NAME_PATTERN, runRemotePassthrough, tree.ts command nodes.
Rules in play
- ADR 0067: the routes and their limits are the farm's; files stay flat and single (§ "not in this decision": no unpacking).
src/ports/AGENTS.md: a new adapter with its fake; every wait bounded (connect 10 s, 60 s silence).src/cli/AGENTS.md: a new command node; the router loads nothing; errors as one JSON line.- Documentation rule 9: the two website pages.
Tests
Seam: runCli with a fake streaming HTTP port answering the lease-files routes and a fake filesystem, with the fake clock (models: src/cli/tunnel.test.ts for the HTTP fake, src/cli/passthrough.test.ts).
- B8:
simlock files:put;put --name;putof a missing file;putof a folder;getto stdout and to-o;list;rm; each I11 case; 413FILE_TOO_LARGE; 413LEASE_FILES_FULL; 409FILE_BUSY; 422INSUFFICIENT_DISK_SPACE; 408UPLOAD_STALLED; 404UNKNOWN_LEASE; 404UNKNOWN_FILE; 401; unreachable; 60 s silent; a long upload with bytes moving; local mode - B9: the remote path hint: a local file and exit 1; a local folder and exit 1; exit 0; no such local path; two local paths; local mode
Done when
pnpm test:changedpasses, with every Tests line above as a test.pnpm checkpasses,lazy-loading.test.tsincluded.- On a Mac with the Android SDK:
scripts/slow-e2e.sh e2e/slow-remote-cli.test.tspasses its Android case. A CLI in remote mode against a worker's HTTP address leases an emulator,files put e2e/fixtures/appduct/android/AppductPlayground.apk, thenadb install AppductPlayground.apkexits 0 andadb shell pm list packagesnames the app. - The website build passes:
pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs.
Out of scope
- Uploading a folder or unpacking an archive (Put folders into a lease's folder, and copy files into and out of an app's container #1636).
Depends on
Written by an agent.
Activity
test: simlock files put names the file, and refuses a missing file, a…
feat(cli): simlock files put refuses a missing file, a folder and loc…
test: simlock files get, list and rm call the lease-files routes and …
feat(cli): simlock files get, list and rm call the lease's folder rou…
test: simlock files keeps a route's error code and exit code, reports…
feat(cli): simlock files keeps a route's error code, reports a farm t…
test: simlock files ends a transfer after 60 s with no byte moving, a…
feat(cli): simlock files ends a transfer after 60 s with no byte movi…
test: a remote simctl or adb that fails after naming a path on this m…
feat(cli): a remote simctl or adb that fails after naming a path on t…
4 remaining items
test: files keeps a cut download's leftover out, reports an unknown e…
fix(cli): a failure of this machine's disk in files get is not report…
test: a download over 60 s with bytes moving is not cut (#1643)
test: the 10 s bound on making a connection is read off a fake clock (#…
docs: the files manual line keeps only what the code cannot say; the …
docs: the files manual line names its file by path (#1643)
fix: a download whose rename fails removes its own part file (#1643)
V3RON commentedon Nov 17, 2026
Handoff
Done: PR #1684 (base
task/1641). B8 and B9 built; review round 1, round 2 and the final fix-check passed with no open finding (local failures reported as the farm, a.partfile this run did not write deleted, two untested timers, three manual and page lines). Ready, labelledneeds-hardware.Not done: the Android slow-lane line (
e2e/slow-remote-cli.test.ts).pnpm checkwaits for CI on c3120e5. The PR is not yet linked into stack #1680: it joins on top of #1685 once that passes review.Findings: none open. Two review notes posted.
Blocked on: the lane check refuses this machine: 11.3 GiB free disk, the lane needs 15. Free space, or run the line on a machine that can, then tick it and re-run
deliver 1635.Written by an agent.
chore: merge the reconnect of a queued request into the file transfer…
docs(adr): 0081 to Accepted (#1643)
feat(cli): simlock files moves files to and from a lease's folder, an…