Bandwidth

What this layer does

Phase 12 keeps push and pull cheap. Tiny files go raw. Mid-size files get gzipped before upload with Content-Encoding: gzip. Large files hit a hard 10 MB ceiling that surfaces as a clear rejection. Append-only ndjson logs are eligible for tail-only delta uploads (v2 feature; v1 just gzips and re-uploads).

Files involved

bin/cli.js push for files in the 100 KB - 10 MB band.

Content-Encoding: gzip on upload, stores compressed.

used by the v2 tail-only future feature.

Size bands

SizeTreatment
<100 KBRaw POST /_push, negligible cost
100 KB - 10 MBgzip body before push, Content-Encoding: gzip header to Worker, Worker stores compressed
>10 MBREJECT with clear error: "file too large for snappy-os sync; should this be in sources/?"

Append-only ndjson special case

Files in SYNC_ALLOW that are append-only (changelog.ndjson, evals.aggregate.ndjson, snapshots.ndjson) are good candidates for tail-only delta uploads. v2 feature: ship a sidecar <file>.last-pushed-offset so push only uploads the new tail.

v1 just gzips and re-uploads the full file. Acceptable until any single ndjson exceeds ~1 MB; the gzip ratio on ndjson is typically 8-12x so 1 MB compresses to ~100 KB and stays under the negligible-cost band.

Operational gotchas

practical limits and because anything that large probably belongs in a different store (DO Spaces direct via Robert admin path, R2, or sources/ if it's content the human owns).

enough to justify the CPU cost; larger files start showing visible egress savings.

Content-Encoding: gzip header so client pull can decompress on the way down. Mixing compressed-store with uncompressed-serve burns bandwidth.

alternative. Without that hint, Joes hit the ceiling and don't know the workaround.

evals.aggregate.ndjson grows past 1 MB. Monitor and prioritize the v2 tail-only feature accordingly.

How to verify it's working

shows bytes close to file size.

Worker wrangler tail shows Content-Encoding: gzip on the request.

any network call.

and the local SHA matches the manifest entry.

expected v1 tenant count.