Skip to content

Build: fleet file transfer — get / put / copy verbs (SCP-class, any-to-any) #10355

Open

Description

@dezren39

Build: fleet file transfer — get / put / copy verbs (SCP-class, any-to-any)

Origin: Drew, 2026-11-14 — "we should add it as its own build item." This is the
implementation issue for the design in #5759 (fleet proxy get/put over the
agent channel), with the read-path alternative in #5757 §3 and Drew's
2026-11-14 requirements folded in. Epic: #5412. Daemon: #5343.

Verified current state (2026-11-14)

  • No file-transfer verb exists anywhere in the fleet binary. Domains:
    queue, serve, proxy, dispatch, dispatch-test, secrets, gh, search,
    laptop-agent. Everything carried today is commands and small JSON.
  • The laptop-agent daemon's routes are exec + jobs only; every body is JSON.
    Files cross today only as (a) base64 inside exec calls (manual, ~33% size
    tax, ~1 MiB/stream practical cap, no resume), (b) stdin pushes over the
    real-SSH fallback (fetch-charge-inputs.py, atlas-backup.py — the two
    scripts Design: fleet proxy get/put — file transfer over the agent channel #5759 names as waiting on this channel), or (c) out-of-band staging
    (the rclone-crypt → R2 path built for the sandbox-home backup move,
    hatch-personal#50 — proven both directions 2026-11-14, but it is a backup
    pipeline, not a general verb).
  • The "more performant HTTP version" in Drew's memory is the agent's exec
    transport (commands over HTTP through pooled CONNECT tunnels) — it has
    never carried files. Recorded already on Design: fleet proxy get/put — file transfer over the agent channel #5759 (2026-11-04).

Requirements (Drew, 2026-11-14)

  1. At least SCP-capable. fleet get, fleet put, and a fleet copy
    that takes SCP-style addressing on BOTH sides:
    fleet copy sandbox:/home/hatch/test.txt laptop:/home/user/test2.txt.
    Either side may be a remote; a bare path means the local host.
  2. The target is a parameter, never a hardcoded "the laptop." Every
    connect-family verb takes an explicit remote/endpoint name
    (--remote NAME or the host: prefix). Today everything silently
    defaults to the one laptop; the addressing must generalize to
    laptop1/laptop2/pool members without a redesign. (Coordinator/pool
    routing — a lookup that picks the endpoint by command, load, or
    stickiness — is future work; the addressing must not preclude it.)
  3. Integrity end-to-end. Hash-verified transfer (the Design: fleet proxy get/put — file transfer over the agent channel #5759
    begin/write/commit protocol already specifies sha256 + deterministic
    temp names + atomic commit — implement that; the Connection perf: coalesce queue claim flow to 1 round trip, cross-service batch, real file-transfer verb #5757 §3 raw
    byte-range GET is the candidate read path if profiling wants it).
  4. Resumable + clean. An interrupted transfer resumes the same temp
    file instead of restarting; partial transfers are never visible at the
    destination path; abandoned temps are swept.
  5. Delegated (direct-path) copy is designed in from the start. When
    source and destination can reach each other directly, the controller
    should be able to authorize and instruct the copy instead of relaying
    every byte through itself: the source validates the instruction and
    pushes/pulls directly. The naive relay path is the fallback and may
    ship first — but if the delegated path is not in v1, it MUST be split
    out as its own follow-on issue before this one closes (Drew: "it is
    not a question of whether it's a thing — that should be a thing").
  6. Performance close-out. Report measured throughput for a 100 MiB
    file sandbox↔laptop against: base64-over-exec (today), scp over the
    proxy SSH path, and the new verb. The bar: decisively beat base64-exec,
    at least match scp.

Acceptance

  • 100 MiB file sandbox→laptop and laptop→sandbox, sha256-identical.
  • Transfer killed mid-flight resumes and completes; destination path
    never shows partial content.
  • fleet copy laptop:/path sandbox:/path and the reverse both work
    with explicit host addressing.
  • The two waiting scripts (fetch-charge-inputs.py,
    atlas-backup.py) migrated off SSH-stdin pushes, or a recorded
    reason they stay.
  • Delegated copy: working, OR follow-on issue filed and linked here.
  • Throughput numbers posted in the close-out comment.

Related: #5759 (design), #5757 (perf census), #5697 (fleet proxy ssh),
#5972 (fallback connection mode), #5345 / #1794 (the ID project's own
server-to-server transfer designs — coordinate so the fleet verb and the
ID protocol do not grow into two incompatible answers).

Activity

  1. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged — task 19235 (lane code-a)

    • Work kind: task/small-fix (step-scoped build) · Priority: priority/high · Effort: effort/l (the full build; the routed step is the daemon half)
    • Fresh evidence (2026-11-17): the issue's "no file-transfer verb exists" premise is half stale — the client shipped: pkgs/fleet/crates/fleet-proxy/src/files.rs (da6a5bf, Design: fleet proxy get/put — file transfer over the agent channel #5759 v1) implements fleet proxy get/put speaking stat/begin/write/commit/abort/read with sha256-at-commit and deterministic resume temps, wired into the fleet CLI. But a live probe just now — fleet proxy get /tmp/probe-19235.txt ./probe-dl.txt — failed with daemon /files/stat: no such route: the laptop-agent daemon (port 4799) never got its /files/* routes (the client module itself flags that side as "separately owned"). Also verified: no copy verb exists yet, and get/put still address the laptop implicitly (requirement 2's generalized addressing unimplemented).
    • Routing: step-1 follow-on enqueued as task 20573 (priority 20): implement the daemon /files/* routes to the shipped client's protocol, pin down the daemon's source home + deployment path, and prove acceptance items 1–2 for the get/put pair (100 MiB both directions sha256-identical; kill-resume with no partial visibility). Later steps stay for their own packets, per the issue's structure: fleet copy + host addressing, the two script migrations, delegated copy (or its follow-on issue, which requirement 5 mandates before close), and the throughput close-out.
  3. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    state: parked — step 1 scouted, not started (deployment-risk + budget)
    lane: any-b, worker: repo-worker-code, task 20573

    Scouting record for #10355 step 1 (2026-11-17, lane any-b): the work is located and mapped; implementation was NOT started, for the two reasons at the end.

    • Client half: done. pkgs/fleet/crates/fleet-proxy/src/files.rs (1,575 lines on origin/main) implements fleet proxy get/put against a hermetic fake daemon: framed-JSON RPC (stat, begin, write, commit, abort, read), 2 MiB base64 chunks, whole-file SHA-256 verified at commit/after last chunk, deterministic resume temps (.<name>.fleet-part-<sha256[..12]>), idempotent offset writes. put -r works client-side; get -r is deferred (no daemon list route; follow-up on Design: fleet proxy get/put — file transfer over the agent channel #5759).
    • Daemon half: the step-1 work. The daemon is python3 /home/user/laptop-agent/laptop_agent.py on the laptop (single 573-line file, hand-managed with .bak siblings, NOT a git checkout; listening on the tailnet address :4799). It serves exec via do_GET/do_POST and has no /files routes. Step 1 = add the six protocol ops to that daemon, matching fleet-proxy-proto envelopes and the client module's expectations, then E2E: fleet proxy get/put sandbox↔laptop with sha256-identical results.
    • Why parked instead of started: (1) Deploying means editing + restarting the shared laptop-agent daemon — the same daemon every lane's execution surface (including this shift's) runs through; a bad restart strands the fleet, so it wants a deliberate window, not the tail of a shift. (2) ~75 minutes of shift budget remained at claim time — not enough to implement the protocol, restart safely, and run the E2E matrix. The task is parked 1h with this map; the next claimant should budget a full session and coordinate the daemon restart first.
  4. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/highImportant and time-sensitive
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    on Nov 17, 2026
  5. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    state: parked
    task: 20573 (repo-health-code-pilot, lane code-g, origin openchamber-scheduled-lane)

    Picked up step 1 (daemon /files/* routes) and parked before any edit. The daemon is ~/laptop-agent/laptop_agent.py, a shared hand-managed daemon that every lane uses, so implementing and restarting it needs a deliberate window and a full session budget. The scheduled-lane run is too short for that.

    Resume condition: a session with a full budget takes the step-1 scope from the packet. Implement the /files/* routes (stat, begin, write, commit, abort, read) to match the shipped client in pkgs/fleet/crates/fleet-proxy/src/files.rs. Then verify 100 MiB both directions by sha256, plus a kill-resume drill with no partial visibility. Record the daemon source home and deployment path here.

  6. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent note — task 20573 step 1 first step DONE: daemon source home + deployment path pinned (lane any-l, 2026-11-17)

    The packet's first step was to pin down the daemon's source home and deployment path and record it here. Fresh findings:

    • Canonical source home: pkgs/laptop-agent/src/laptop_agent.py in this repo (developing-today/code) — 1159 lines, the laptop-agent daemon source reconciliation — prerequisite for M2 (#5769) #10131 reconciled union of the two daemon lineages, with pkgs/laptop-agent/package.nix ("the reconciled single source (code#10131)") and pkgs/laptop-agent/tests/ (test_laptop_agent.py, parity_roundtrip.py).
    • Live deployment: systemd user unit laptop-agent.service on the laptop, ExecStart=/usr/bin/env python3 %h/laptop-agent/laptop_agent.py — a hand-copied file at ~/laptop-agent/laptop_agent.py with a .bak-* trail (manual copy + service restart is the deploy act; the running process was verified live today).
    • The divergence that gates implementation: the live file is 573 lines and DIFFERS from the canonical source — it is the older live lineage (timeout semantics, trip logging, /exec cancel, disconnect reap, a singular /file route), NOT the 1159-line reconciled union. The reconciled source is not what is running.
    • Consequence for the /files/ implementation:* the routes (stat, begin, write, commit, abort, read — per the shipped client in pkgs/fleet/crates/fleet-proxy/src/files.rs, 1575 lines) must be implemented in the canonical source, and deployment is not a file copy: it is either (a) a parity-gated swap of the live daemon to the reconciled source (the parity_roundtrip.py harness exists for this) with /files added, or (b) /files implemented in both lineages. Choosing silently would either strand the feature in an undeployed file or regress live-only behavior. That choice is the implementation's first decision; the transport the whole fleet runs on is this daemon, so the swap path needs its own verification window.
    • No code was changed under this claim and the live daemon was not touched. Task 20573 is parked resumable with this record; the remaining step-1 work (implement /files/* + the 100 MiB sha256-identical put/get acceptance + kill-mid-flight resume) proceeds from the fork above.
  7. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: parked (resumable)
    task: 20573
    lane: any-w

    Pickup, 2026-11-17: revalidated fresh — issue #10355 OPEN (priority/high, effort/l); step 1 is DONE per lane any-l's note on this issue (canonical daemon source home pinned: pkgs/laptop-agent/src/laptop_agent.py, package.nix, tests/). Remaining work is the implementation bulk of this 120-minute packet: add the /files/* routes to the daemon (stat/get/put with resumable, atomic-publish semantics), deploy the daemon through its Nix path, and run the acceptance verifications (fleet proxy get/put end-to-end against the live daemon; 100 MiB transfers both directions sha256-identical; killed-mid-flight transfer resumes and the destination never shows partial content).

    Parked by lane any-w because this shift's remaining budget (~45 min at pickup) cannot cover implementation + deployment + the 100 MiB verification honestly; a fresh full-budget shift should take it from any-l's step-1 record. No code was changed in this pass.

  8. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed on Nov 17, 2026
  9. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked up
    task: 20573
    lane: any-n
    worker: repo-worker-code

    Revalidated #10355 OPEN. The daemon source/deployment mapping is already recorded by lane any-l: canonical pkgs/laptop-agent/src/laptop_agent.py; live deployment is a divergent hand-copied ~/laptop-agent/laptop_agent.py under laptop-agent.service. I am checking out the claim, but will not begin implementation or restart the shared daemon in this short scheduled window; the remaining packet needs a deliberate full-budget deployment/verification session.

  10. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: parked (resumable)
    task: 20573
    lane: any-n
    worker: repo-worker-code

    Parked this claim without code changes. The route work affects the shared laptop-agent.service transport: canonical source is pkgs/laptop-agent/src/laptop_agent.py, while the live hand-copied ~/laptop-agent/laptop_agent.py is a divergent older lineage. The 30-minute scheduled lane cannot safely implement, deploy/restart, and complete the acceptance matrix. Resume in a full-budget session with a deliberate daemon deployment window; implement /files/* and verify 100 MiB transfers both directions plus kill-resume/no partial destination visibility. Source/deployment mapping is already recorded in the earlier any-l note.

  11. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 17, 2026
  12. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor
    {"schema":"agent-note/v1","at":"2026-11-17T16:52:00Z","worker":"repo-worker-code","lane":"code-g","platform":"openchamber","event":"picked_up","task":"20573","artifact":"PR #11323 (https://github.com/developing-today/code/pull/11323)","detail":"Four prior lanes parked step 1 because it needed a shared-daemon deployment window. This lane instead implemented the daemon half in canonical source: pkgs/laptop-agent/src/laptop_agent.py now serves /files/stat, /files/begin, /files/write, /files/commit, /files/abort and /files/read with the exact route semantics of the shipped client fake daemon (the protocol oracle). Invariants: deterministic .<name>.fleet-part-<sha12> temps, offset-idempotent writes with conflict refusal, whole-file sha256 at commit then atomic os.replace so partial content is never visible at the destination, resume from the temp size. A dedicated transfer body cap handles the client 2 MiB base64 chunks because /exec MAX_BODY is 1 MiB.","tests":"82/82 tests pass (65 pre-existing + 17 new in tests/test_files_routes.py); parity_roundtrip.py extended to drive every route; black clean; 100 MiB put+get sha256-identical both directions; kill-resume drill completes with destination never existing mid-flight.","not_done":"The shared laptop-agent.service restart/deploy is not part of this PR; it stays with the issue along with #10355 later steps (copy verb, SCP addressing, script migrations, throughput close-out)."}
  13. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 17, 2026
  14. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: done
    task: 20573
    summary: Daemon-side /files/* routes (stat/begin/write/commit/abort/read) merged via PR #11323 (merge ccb195b). Source home: pkgs/laptop-agent/src/laptop_agent.py (laptop-agent, port 4799). Evidence: 82 laptop-agent tests pass; parity round-trip pass; 100 MiB put/get sha256-identical; kill-resume leaves no partial destination. Later steps (fleet copy + host addressing, script migrations, delegated copy, throughput) remain open on this issue.

  15. removed their assignment
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lLarge: multi-day or open-ended; expect staged check-insepic/fleet-orchestrationReprioritization program epic (2026-11-12)priority/highImportant and time-sensitivequeue/parkedQueue task is parked (waiting on CI, time, or an event)status/parkedDeliberately paused with a recorded resume conditiontask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions