Implement run_kv(operations): process a list of operations against one key-value store and return the list of outputs, one entry per output-producing operation, in order. Keys and values are ASCII strings that may contain :, ; or |.
Each operation is a list whose first element is the command:
["set", key, value]: store the value (overwriting keeps the key's original position; a new key goes last). No output.["get", key]: output the stored value, or None if absent.["del", key]: remove the key if present. No output.["dump"]: output the whole store as one string in the exact format below.["restart", blob]: replace the store with the one encoded in blob (a string from dump), keeping the blob's key order.["down"]: mark the store unavailable; subsequent set/get/del are queued in arrival order and not executed.["up"]: mark it available and execute the queue in order; get outputs produced during this flush appear at this point.Dump format (length-prefixed, so separator characters inside strings stay unambiguous): the number of entries in decimal, then ;, then for each key-value pair in insertion order <len(key)>:<key><len(value)>:<value> with decimal lengths and no other separators. An empty store dumps as "0;"; the store {"a:b": "1|2", "c": "d;e"} dumps as "2;3:a:b3:1|21:c3:d;e".
dump and restart only occur while the store is available.