Lease files: put a folder on the worker, list it and remove it
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
Read src/ports/AGENTS.md, src/lease-files/AGENTS.md, and ADR 0100 first, then trace the flow through src/ports/tree-archive.ts, src/lease-files/store.ts, and the HTTP and gateway modules listed in the issue. Start with the named seams in src/daemon/lease-files.test.ts and src/ports/filesystem.test.ts; use the gateway and CLI tests to follow the request end to end. Done means the listed behavior and refusal cases pass, the OpenAPI check includes the folder route, and the slow simulator test installs and launches the app.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Part of #1636.
Scope
A caller on another machine sends a folder with simlock files put <folder> (or a tar over HTTP), sees it in simlock files list, removes it, and installs a simulator app with simlock simctl install MyApp.app, on a worker and through a gateway.
If it goes wrong, a folder arrives in part, lands outside the lease's folder, or a single file's upload behaves differently.
Technical spec
Commit d95c152c6.
Rows
- Behaviours: B1, B2, B3, B4, B5, B6, B7
- Stored state: S1, S2
- Interfaces: I1, I2, I3, I5, I8, I11
- Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X12, X14, X15, X16
Facts
| # | Fact | Source |
|---|---|---|
| F1 | tar-stream 3.1.7 reads the pax long names of macOS's tar and the GNU long names of Android's, and errors on a body cut inside an entry but not on one cut at an entry's end |
a Node script with extract() over a tar of each, 2026-11-30: a 130-character name printed whole; the cut tar rejected with Unexpected end of data, the one cut at an entry's end ended without an error |
| F2 | On a cut body the entry's own stream emits the error too, and with no error listener on it the Node process ends |
the same script without s.on("error"): the process ended with Emitted 'error' event on Source instance |
| F3 | simctl install installs a .app folder whose modes are 755 and 644 |
xcrun simctl install <udid> App.app on iOS 27.2, 2026-11-30: exit 0, and simctl launch printed a pid |
| F4 | A dynamic import() on first use keeps a package out of every command that does not need it |
src/ports/AGENTS.md, Lazy loading; src/cli/lazy-loading.test.ts |
| F5 | The iOS fixture is a simulator .app folder |
e2e/fixtures/appduct/ios/AppductPlayground.app, e2e/helpers/agent-device-targets.ts:97 |
| F6 | website/public/openapi.json is generated from the route declarations by pnpm openapi |
website/package.json:7, src/http/openapi.ts |
Modules touched
ports (filesystem.ts: symlink, and the fake; new tree-archive.ts), lease-files (store.ts, handler.ts, relay-target.ts, types.ts), http (lease-declarations.ts, app.ts, app-types.ts, test-fakes.ts), daemon (gateway-lease-files.ts, worker-composition.ts, test-lease-files.ts), cli (commands/files.ts, commands/passthrough.ts, environment.ts, the help in the command tree), package.json and the lockfile (tar-stream 3.1.7), website (copy-files, build-and-run, run-commands, cli, errors, the OpenAPI document), e2e/slow-remote-cli.test.ts. Searches: rg "HttpLeaseFiles|LeaseFilesDeps|createLeaseFiles", rg "1636|folder cannot be uploaded", rg "implements Filesystem", rg -l "simlock files" website.
flowchart LR
C[cli files put] --> T[ports TreeArchive]
C --> H[http route]
H --> G[daemon gateway-lease-files]
H --> L[lease-files]
G --> L
L --> T
T --> F[ports Filesystem]
Rules in play
- ADR 0100 §1, §2, §5: one tar stream, one port with one set of entry rules, no new daemon operation.
- ADR 0067 §2, §3, §5, §6, as narrowed by 0100: names, limits, the writer slot, lease end and the
filestarget keep their rules. src/lease-files/AGENTS.md: nonode:fs; the manual says what a folder is and that the names list holds folders.src/ports/AGENTS.md:tree-archive.tsis a port whose package loads on the first call..dependency-cruiser.mjslease-files-imports-little: the archive reaches lease-files as a port.- Documentation rule 9: the website pages above, and the OpenAPI document with the new route, in the same change.
Retired words
a folder cannot be uploaded: a folder is uploaded withsimlock files put.A folder cannot be uploaded; pack it into one file first: a folder is sent as it is.
Tests
Seams: createLeaseFiles over MemoryFilesystem (model: src/daemon/lease-files.test.ts), runCli (src/cli/index-files.test.ts), the gateway pair (src/daemon/relay-gateway-files.e2e.test.ts), the port itself (src/ports/filesystem.test.ts).
- B1: An HTTP caller puts a tar to I3; sees 201 with
kindfolderand the sum of the stored files' sizes, and the tree is in the lease's folder: one file; nested and empty folders; entries for folders that are not empty, and none for them; executable and not; inner link; long path (pax, and GNU as Android'starwrites it); a pax global header;._xand./left out; empty tar; replaces a folder, a file, another spelling; a file put replaces a folder - B2: An HTTP caller puts a tar that is refused; sees the error of I2 or I3 and the target is as before, with no temporary folder left: each refused row of the Entries example; a link where the filesystem refuses to create one; over 100,000 entries; body over 2 GiB (declared, streamed); lease full; disk low; body not a tar; body cut inside an entry; 330 s silence; second put to the name, by file or folder; lease ends during it;
Content-Lengthover 2 GiB at a gateway - B3: A caller lists and deletes; the list has files and folders with
kindandsize, a delete removes either: file; folder put; folder a command wrote; a link and a badly named folder are not listed; delete of a folder, of another spelling, of an unknown name - B4:
simlock files put <folder>packs and sends it and prints the reply withleaseandkind; put of a file printskindfile: folder; empty folder; trailing/;--name;.andmy folderwithout--name(exit 2, I5's message, nothing sent); link that leads out,\in a name, socket (exit 2, nothing sent); the farm's refusal keeps its code; 60 s with no byte; a folder unreadable part way; a file that shrinks while it is read - B5: A failed remote
simctloradbthat named a local folder prints the same notice a local file gets: folder; file as today - B6: A gateway relays the put of a folder to the lease's worker, streaming, and its refusals carry the caller's lease id: put;
LEASE_FILES_FULL; worker not connected - B7:
simlock files put MyApp.app, thensimlock simctl install MyApp.appand a launch, on a real simulator: one built simulator app - B8: Assumption: the code keeps four behaviours it has today, each pinned by a test: a worker's relay target refuses GET and DELETE on
/files/leases/<id>/<name>/folderwith 400BAD_REQUEST(createLeaseFilesrelay target);TreeArchive.packwrites an empty sub-folder as a folder entry, seen in the tar the CLI sends (runCli); a refused link (EPERM) while unpacking is refused as "cannot store", and any other link error passes through as its own error (createLeaseFilesoverMemoryFilesystem); a tar with a file and then a link at the same path ends with the link (createLeaseFiles) (decided in delivery, pending the maintainer)
Done when
src/ports/tree-archive.tsis the only file that namestar-stream, and loads it withimport().- No line outside
docs/internalstill says that a folder cannot be uploaded:rg "cannot be uploaded|#1636" src websiteprints nothing. website/scripts/check-openapi.mjspasses withPUT /v1/leases/{id}/files/{name}/folder.- Slow lane (real simulator): a new case in
e2e/slow-remote-cli.test.tsputsAppductPlayground.app, installs it withsimlock simctl install AppductPlayground.appand launches it.
Out of scope
Getting a folder back (#2005), push (#2006) and pull (#2007). Folders for the local CLI, MCP and simlock/client.
Depends on
- #1154 because:
LeaseFilesDepsand#receiveinsrc/lease-files/store.ts, where it turns the disk threshold into a reader of the live setting
Written by an agent.
- Langage dominant
- TypeScript
- Étoiles
- 730
- Forks
- 44
- Merge moyen
- 15 h 28 min
- PR mergées (30 j)
- 387
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de callstackincubator/simlock
-
bug:new
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
callstackincubator/simlock#2088 ·
Les mainteneurs répondent en général sous 1 jour
-
bug:new
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
callstackincubator/simlock#2080 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
task:ready
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
callstackincubator/simlock#2079 ·
Les mainteneurs répondent en général sous 1 jour
-
platform:ios task:ready
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 18/100
callstackincubator/simlock#2078 ·
Les mainteneurs répondent en général sous 1 jour
-
iOS copy: keep the app database at the copy's own UDIDPeut-être pris @V3RON l’a pris aujourd’hui. Ouverteplatform:ios task:ready
callstackincubator/simlock#2077 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de callstackincubator/simlock
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
earendil-works/gondolin#222 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
endora-commerce/endora-commerce#2203 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement priority:medium ready-for-human
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
wondermoney/wondermoney#1079 ·
Les mainteneurs répondent en général sous 1 jour