let act t ~action =
let open Trakeva.Action in
let open Trakeva.Key_in_collection in
let rec go = function
| Set ({key; collection}, v) ->
let col = get_collection t collection in
Hashtbl.replace col key v;
true
| Unset {key; collection} ->
let col = get_collection t collection in
Hashtbl.remove col key;
true
| Check _ -> true
| Sequence l ->
List.fold l ~init:true ~f:(fun prev act -> prev && go act)
in
match go action with
| true -> return `Done
| false -> return `Not_done