Question
Implement a durable string-to-string key-value store using the provided `FileSystem` abstraction. In the base task, `shutdown()` commits a complete snapshot using `FileSystem.save_blob(bytes)`. A newly constructed store starts empty; `restore()` recovers the latest saved snapshot. The supplied storage replaces a whole blob atomically and remains alive across store instances. It models snapshot persistence, not partial writes or a real disk. Keys and values may contain arbitrary Unicode characters, including newlines; use a length-prefixed binary format rather than delimiter-only encoding. Do not use JSON or pickle. Implement `KVStore(file_system)`, `put(key, value)`, `get(key)`, `shutdown()`, and `restore()`. `put` replaces an existing value; `get` returns the exact stored string. Public checks query only existing keys and restore only after a saved snapshot. The provided integer and string codecs are available; you may implement another lossless binary encoding. The supplied `create_store(file_system)` adapter constructs your class; `public_check.run_existing_cases(create_store)` owns the restart sequence. Implement the store rather than the check runner. ## Follow-ups 1. Extend the storage API to model interrupted writes, then design a crash-safe commit protocol and compaction. 2. Detect corruption without discarding earlier valid records. 3. Compare append-only logging with snapshot-plus-log recovery.