Assign without losing the upload
An upload queue reads add, retry and replace commands from stdin. Each upload owns one storage slot; the report lists the queue, counts slot copies and shows how many slots are still open after shutdown. Storage is an authored integer-slot model, not file/network I/O: copy rejects byte counts over 1000. Easy inputs use 0–1000-byte files because its copy-only growth may otherwise reject an add while relocating old elements; Medium/Hard allow 0–1000000 bytes: Medium requires the learner to add safe move support, which Hard already supplies. Inputs are well-formed complete commands, nonempty token names, valid indices, up to 100 queued uploads and distinct target/source indices for graded replace commands. Self-assignment remains a separate ungraded diagnostic because legal implementations can make different copy counts. Host allocation failure in std::string/map/vector, arbitrary moved-from describe calls and malformed input are outside the reported profile. The Hard target guarantee covers its name and slot contents on modeled copy rejection.
What needs to change
Change Upload’s assignment so a failed replace leaves the target upload valid and unchanged.
Reproduce
- Run the sample: replace c with a, then replace a with big, which is too large to copy. Compare the queue.
Acceptance criteria
Your review marks · Saved in this browser. Test acceptance is tracked separately.
Notes
replace assigns one queued upload to another. storage::copy throws for files over 1000 bytes; main prints the failure and continues.