Potbot can now keep the pieces of an unfinished upload and report which ones are missing. A client can continue from that saved state, send the remaining pieces in a different order and check the completed file against its original SHA-256 hash.
This is the other direction of the bounded artifact reads. Reading an existing output was already covered. The new work retains incoming chunks and gives each upload a durable completion record.
Five SYN Cogs handle opening an upload, storing a chunk, inspecting missing slots, committing the complete file and aborting unfinished access. They use the existing artifact store and work ledger. The authenticated workspace, owner, policy, expected length and whole-file hash stay pinned throughout.
The end-to-end test uses 131,117 synthetic binary bytes. Each chunk is at most 8 KiB, keeping the encoded request below the existing 16 KiB inline limit. After the first two chunks, fresh controller and service instances inspect the missing slots. The remaining chunks arrive backwards, followed by a repeat of the first chunk.
There are 17 unique chunks at the end. An identical repeat counts once. A repeat with different bytes is rejected. The commit assembles the ordered source through a temporary file, verifies the complete length and SHA-256, and checks current permission and expiry again before publication. The test then reads the completed artifact through the existing range Cogs and reconstructs the exact original bytes.

Two clients also try to commit the same upload concurrently. Both receive the same artifact identity. Transaction advisory locks serialize those decisions while preserving the immutable tables’ existing permissions. Inspection returns at most 128 missing offsets per page, so a large upload cannot turn into one unbounded status response.
The rejection tests cover incomplete uploads, conflicting parameters, changed policy or workspace, expired sessions, missing or corrupted staged bytes and a wrong whole-file hash. They withdraw a host grant during staging and assembly. An injected monotonic clock shift also checks the deadline guard; that is a controlled test, rather than a measured long wait.
The existing cautious write policy remains in place. A write that raises after dispatch is marked indeterminate and fences that controller. A trusted replacement must inspect the durable state under current permission before continuing. Start, actual progress and terminal statistics remain visible through the same REST and WebSocket monitoring routes.
Aborting stops further upload work. It leaves staged artifacts in place and cannot delete a committed file. Physical retention and garbage collection still need their own implementation. Chunk sizes are logical bounds; peak process memory and physical disk traffic remain unavailable where they have not been measured.
The 0.5.0.dev8 source preview and upload Cog guide retain the code and limits. This qualifies the existing local POSIX backend and controller recreation within one Python test process. Actual network disconnections, process crashes, other backends and real devices remain separate work.
Featured artwork: a generated conceptual illustration. The screenshot and video use actual synthetic CI data.


Leave a Reply