`publish <file> --tree <dir> --meta <dir>` places the outputs itself: the
tree is add-only (a name already there is touched, another size is refused),
CAS objects are hardlinked in, __meta/ goes to its own directory with the
links pointed into the tree, and __files/__digest record the publish. The
deploy verb, deploy.json5, the manifest/tar negotiation with `smogonctl assets
upload`, the progress bar and `run --tar` go with it; smogon.com's
sprites-sync service runs build and publish on the server now. The output
root is the served tree, no sprites/ prefix.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNa8LzaaMo3QbEVuFUtFGU
Every deploy tarred the whole published tree into `smogonctl assets upload`:
a few hundred megabytes of stamped files the home already had, and a 512-byte
header for each of the thousands of links under __meta/. A served name carries
a content hash and the tree is add-only, so a name the home has is a file that
needn't travel.
The deploy now opens the same stdin with a manifest -- every name with its
size, every link -- and reads the reply off the command's stdout: the
positions it hasn't got. Only those and the __meta/ files are then tarred
into the same stream. The format is binary and length prefixed, so a name is
whatever bytes a tar would carry for it.
The reply is read strictly from the first byte: anything else on stdout, the
command's own refusal or a shell profile printing over ssh, is relayed whole,
stdin is closed so the command sees the end of the stream, and the deploy
fails with its exit code. The progress bar counts what travels. `run --tar`
still writes a bare tar, which the upload also takes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014b7csvcRmyygDYQun3mE6E