Functional Weave
Code in TypeScript

todo.list@1.0.0

vectors.json

65,249 bytes · view raw

[
  {"fn": "addTodo", "name": "the first todo in an empty list has order 0", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 0}]},
  {"fn": "addTodo", "name": "appended after the others, one past the highest order", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 2}]},
  {"fn": "addTodo", "name": "order is one past the highest, not the count, and it still goes at the end of the array", "args": [[{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 5}, {"id": "y", "title": "Y", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 5}, {"id": "y", "title": "Y", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}, {"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 6}]},
  {"fn": "addTodo", "name": "title and notes are trimmed of ASCII whitespace", "args": [[], {"title": "  Buy milk \t", "notes": "  call first \n", "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "n", "title": "Buy milk", "notes": "call first", "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 0}]},
  {"fn": "addTodo", "name": "blank notes are stored as null", "args": [[], {"title": "Buy milk", "notes": "   ", "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 0}]},
  {"fn": "addTodo", "name": "tags are normalised: # dropped, lower-case slugs, duplicates removed", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": ["#Home", " home office ", "HOME"], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": ["home", "home-office"], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 0}]},
  {"fn": "addTodo", "name": "priority, due date and recurrence are kept as given", "args": [[], {"title": "Pay rent", "notes": null, "priority": "high", "due": "2026-10-01", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-10-01"}}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "n", "title": "Pay rent", "notes": null, "done": false, "priority": "high", "due": "2026-10-01", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-10-01"}, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 0}]},
  {"fn": "addTodo", "name": "a done todo already in the list is left alone", "args": [[{"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}, {"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 2}]},
  {"fn": "addTodo", "name": "eleven tags that normalise to ten distinct ones are fine", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": ["#a", "A", "b", "c", "d", "e", "f", "g", "h", "i", "j"], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expect": [{"id": "n", "title": "Buy milk", "notes": null, "done": false, "priority": "none", "due": null, "tags": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"], "recurrence": null, "createdAt": "2026-09-28T09:30:00Z", "completedAt": null, "order": 0}]},
  {"fn": "addTodo", "name": "eleven distinct tags are too many", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expectError": "invalid todo: tags: Use no more than 10 tags."},
  {"fn": "addTodo", "name": "a blank title is refused", "args": [[], {"title": "   ", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expectError": "invalid todo: title: Enter a title."},
  {"fn": "addTodo", "name": "with a blank title and an impossible due date, the title is reported first", "args": [[], {"title": "", "notes": null, "priority": "none", "due": "2026-02-30", "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expectError": "invalid todo: title: Enter a title."},
  {"fn": "addTodo", "name": "an impossible due date", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": "2026-02-30", "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expectError": "invalid todo: due: Enter the due date as a real date, YYYY-MM-DD."},
  {"fn": "addTodo", "name": "an unknown priority", "args": [[], {"title": "Buy milk", "notes": null, "priority": "urgent", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T09:30:00Z"], "expectError": "invalid todo: priority: Choose a priority: none, low, medium or high."},
  {"fn": "addTodo", "name": "a repeat without a due date", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": {"frequency": "weekly", "interval": 1, "anchor": "2026-09-28"}}, "n", "2026-09-28T09:30:00Z"], "expectError": "invalid todo: recurrence: A repeating todo needs a due date."},
  {"fn": "addTodo", "name": "a blank id", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "  ", "2026-09-28T09:30:00Z"], "expectError": "a todo needs an id"},
  {"fn": "addTodo", "name": "an id already in the list", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "b", "2026-09-28T09:30:00Z"], "expectError": "a todo with id \"b\" already exists"},
  {"fn": "addTodo", "name": "now with an offset is not a UTC timestamp", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28T10:30:00+01:00"], "expectError": "now must be a UTC timestamp like 2026-09-28T09:30:00Z"},
  {"fn": "addTodo", "name": "now as a bare date is not a timestamp", "args": [[], {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}, "n", "2026-09-28"], "expectError": "now must be a UTC timestamp like 2026-09-28T09:30:00Z"},
  {"fn": "updateTodo", "name": "replaces the edited fields of one todo and leaves the others alone", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "b", {"title": "Pay the rent", "notes": "by standing order", "priority": "high", "due": "2026-10-01", "tags": ["home"], "recurrence": null}], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay the rent", "notes": "by standing order", "done": false, "priority": "high", "due": "2026-10-01", "tags": ["home"], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "updateTodo", "name": "a done todo stays done with its completion time", "args": [[{"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}], "b", {"title": "Pay the rent", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}], "expect": [{"id": "b", "title": "Pay the rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}]},
  {"fn": "updateTodo", "name": "trims the title and normalises tags as addTodo does", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", {"title": "  Walk the dog twice ", "notes": null, "priority": "none", "due": null, "tags": ["Dog Walks", "#dog-walks"], "recurrence": null}], "expect": [{"id": "a", "title": "Walk the dog twice", "notes": null, "done": false, "priority": "none", "due": null, "tags": ["dog-walks"], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "updateTodo", "name": "an empty notes clears the notes to null", "args": [[{"id": "a", "title": "Walk the dog", "notes": "old note", "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", {"title": "Walk the dog", "notes": "", "priority": "none", "due": null, "tags": [], "recurrence": null}], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "updateTodo", "name": "adds a repeat", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", {"title": "Walk the dog", "notes": null, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-28"}}], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-28"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "updateTodo", "name": "takes the due date and the repeat away", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-28"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", {"title": "Walk the dog", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "updateTodo", "name": "keeps the todo's place in the array and its order, even when they differ", "args": [[{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 9}, {"id": "y", "title": "Y", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 3}], "y", {"title": "Why", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}], "expect": [{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 9}, {"id": "y", "title": "Why", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 3}]},
  {"fn": "updateTodo", "name": "keeps id and createdAt of a one-item list", "args": [[{"id": "only", "title": "Old", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2025-01-01T00:00:00.123Z", "completedAt": null, "order": 4}], "only", {"title": "New", "notes": null, "priority": "low", "due": null, "tags": [], "recurrence": null}], "expect": [{"id": "only", "title": "New", "notes": null, "done": false, "priority": "low", "due": null, "tags": [], "recurrence": null, "createdAt": "2025-01-01T00:00:00.123Z", "completedAt": null, "order": 4}]},
  {"fn": "updateTodo", "name": "an unknown id", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "zz", {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}], "expectError": "no todo with id \"zz\""},
  {"fn": "updateTodo", "name": "an unknown id in an empty list", "args": [[], "a", {"title": "Buy milk", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}], "expectError": "no todo with id \"a\""},
  {"fn": "updateTodo", "name": "a blank title", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", {"title": " \t ", "notes": null, "priority": "none", "due": null, "tags": [], "recurrence": null}], "expectError": "invalid todo: title: Enter a title."},
  {"fn": "updateTodo", "name": "a repeat that starts after the due date", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", {"title": "Walk", "notes": null, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-10-01"}}], "expectError": "invalid todo: recurrence: The repeat cannot start after the due date."},
  {"fn": "toggleTodo", "name": "completing an open todo sets done and the completion time", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 0}]},
  {"fn": "toggleTodo", "name": "toggling a done todo reopens it and clears the completion time", "args": [[{"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}], "b", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}]},
  {"fn": "toggleTodo", "name": "only the named todo changes", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "b", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "toggleTodo", "name": "a daily todo done on its day stays open and is due tomorrow", "args": [[{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-29", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "monthly anchored on the 31st: January's rolls to 28 February", "args": [[{"id": "r", "title": "Pay card", "notes": null, "done": false, "priority": "none", "due": "2026-01-31", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-01-31"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-01-31T10:00:00Z", "2026-01-31"], "expect": [{"id": "r", "title": "Pay card", "notes": null, "done": false, "priority": "none", "due": "2026-02-28", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-01-31"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "monthly anchored on the 31st: February's rolls to 31 March, not the 28th", "args": [[{"id": "r", "title": "Pay card", "notes": null, "done": false, "priority": "none", "due": "2026-02-28", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-01-31"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-02-28T10:00:00Z", "2026-02-28"], "expect": [{"id": "r", "title": "Pay card", "notes": null, "done": false, "priority": "none", "due": "2026-03-31", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-01-31"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "an overdue daily todo skips the missed days: due tomorrow, not the 21st", "args": [[{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-20", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-29", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "an overdue weekly todo done on its weekday is due next week", "args": [[{"id": "r", "title": "Bins", "notes": null, "done": false, "priority": "none", "due": "2026-09-14", "tags": [], "recurrence": {"frequency": "weekly", "interval": 1, "anchor": "2026-09-07"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Bins", "notes": null, "done": false, "priority": "none", "due": "2026-10-05", "tags": [], "recurrence": {"frequency": "weekly", "interval": 1, "anchor": "2026-09-07"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "a weekdays todo done on Friday is due Monday", "args": [[{"id": "r", "title": "Stand-up", "notes": null, "done": false, "priority": "none", "due": "2026-10-02", "tags": [], "recurrence": {"frequency": "weekdays", "interval": 1, "anchor": "2026-09-28"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-10-02T17:00:00Z", "2026-10-02"], "expect": [{"id": "r", "title": "Stand-up", "notes": null, "done": false, "priority": "none", "due": "2026-10-05", "tags": [], "recurrence": {"frequency": "weekdays", "interval": 1, "anchor": "2026-09-28"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "a monthly todo done early moves past its due date, not back onto it", "args": [[{"id": "r", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": "2026-10-01", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-10-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": "2026-11-01", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-10-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "a yearly todo anchored on 29 February, done late, is due 28 February next year", "args": [[{"id": "r", "title": "Birthday card", "notes": null, "done": false, "priority": "none", "due": "2026-02-28", "tags": [], "recurrence": {"frequency": "yearly", "interval": 1, "anchor": "2024-02-29"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-03-01T08:00:00Z", "2026-03-01"], "expect": [{"id": "r", "title": "Birthday card", "notes": null, "done": false, "priority": "none", "due": "2027-02-28", "tags": [], "recurrence": {"frequency": "yearly", "interval": 1, "anchor": "2024-02-29"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "a done repeating todo is simply reopened, due date unchanged", "args": [[{"id": "r", "title": "Stretch", "notes": null, "done": true, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}], "r", "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleTodo", "name": "an unknown id", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "zz", "2026-09-28T09:30:00Z", "2026-09-28"], "expectError": "no todo with id \"zz\""},
  {"fn": "toggleTodo", "name": "now not in UTC", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", "2026-09-28T09:30:00", "2026-09-28"], "expectError": "now must be a UTC timestamp like 2026-09-28T09:30:00Z"},
  {"fn": "toggleTodo", "name": "reopening still needs a valid now", "args": [[{"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}], "b", "yesterday", "2026-09-28"], "expectError": "now must be a UTC timestamp like 2026-09-28T09:30:00Z"},
  {"fn": "toggleTodo", "name": "today that never existed", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", "2026-09-28T09:30:00Z", "2026-02-30"], "expectError": "today must be a date like 2026-09-28"},
  {"fn": "toggleTodo", "name": "today with a trailing newline", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a", "2026-09-28T09:30:00Z", "2026-09-28\n"], "expectError": "today must be a date like 2026-09-28"},
  {"fn": "toggleTodo", "name": "a stored repeating todo without a due date cannot roll forward", "args": [[{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "r", "2026-09-28T09:30:00Z", "2026-09-28"], "expectError": "repeating todo \"r\" has no due date"},
  {"fn": "removeTodo", "name": "removes the middle todo; the others keep their order values", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "b"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "removeTodo", "name": "removes the first", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "a"], "expect": [{"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "removeTodo", "name": "removes the last", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "c"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}]},
  {"fn": "removeTodo", "name": "removing the only todo leaves an empty list", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "a"], "expect": []},
  {"fn": "removeTodo", "name": "removes a done todo", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}], "b"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "removeTodo", "name": "gaps in order are left as they are", "args": [[{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "y", "title": "Y", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}, {"id": "z", "title": "Z", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 5}], "y"], "expect": [{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "z", "title": "Z", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 5}]},
  {"fn": "removeTodo", "name": "ids match exactly: removing a leaves A", "args": [[{"id": "A", "title": "Upper", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "a", "title": "Lower", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "a"], "expect": [{"id": "A", "title": "Upper", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "removeTodo", "name": "works when the array is not in order sequence", "args": [[{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 3}, {"id": "y", "title": "Y", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "z", "title": "Z", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "x"], "expect": [{"id": "y", "title": "Y", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "z", "title": "Z", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "removeTodo", "name": "an unknown id", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "zz"], "expectError": "no todo with id \"zz\""},
  {"fn": "removeTodo", "name": "an unknown id in an empty list", "args": [[], "a"], "expectError": "no todo with id \"a\""},
  {"fn": "removeTodo", "name": "an id with a space around it is a different id", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], " a"], "expectError": "no todo with id \" a\""},
  {"fn": "clearCompleted", "name": "an empty list stays empty", "args": [[]], "expect": []},
  {"fn": "clearCompleted", "name": "nothing done: the list is unchanged", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "clearCompleted", "name": "everything done: nothing left", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 2}]], "expect": []},
  {"fn": "clearCompleted", "name": "keeps the open ones in their order", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "clearCompleted", "name": "done at both ends", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 2}]], "expect": [{"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}]},
  {"fn": "clearCompleted", "name": "a single done todo", "args": [[{"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}]], "expect": []},
  {"fn": "clearCompleted", "name": "order values are not renumbered", "args": [[{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 4}, {"id": "y", "title": "Y", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}, {"id": "z", "title": "Z", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 9}]], "expect": [{"id": "x", "title": "X", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 4}, {"id": "z", "title": "Z", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 9}]},
  {"fn": "clearCompleted", "name": "an open repeating todo stays", "args": [[{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}]], "expect": [{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleAll", "name": "an empty list stays empty", "args": [[], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": []},
  {"fn": "toggleAll", "name": "all open: all completed now", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 1}]},
  {"fn": "toggleAll", "name": "some open: the open ones are completed, the done one keeps its time", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}, {"id": "c", "title": "Call mum", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 2}]},
  {"fn": "toggleAll", "name": "all done: all reopened", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "Pay rent", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}]},
  {"fn": "toggleAll", "name": "an open repeating todo rolls forward and stays open while the rest are completed", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 0}, {"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-29", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}]},
  {"fn": "toggleAll", "name": "all done, including a repeating one: all reopened", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}, {"id": "r", "title": "Stretch", "notes": null, "done": true, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleAll", "name": "only repeating todos: they roll forward and are still open afterwards", "args": [[{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-28", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Stretch", "notes": null, "done": false, "priority": "none", "due": "2026-09-29", "tags": [], "recurrence": {"frequency": "daily", "interval": 1, "anchor": "2026-09-01"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleAll", "name": "a single open todo", "args": [[{"id": "c", "title": "Call mum", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "c", "title": "Call mum", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-28T09:30:00Z", "order": 2}]},
  {"fn": "toggleAll", "name": "an overdue monthly todo anchored on the 31st rolls to 30 September", "args": [[{"id": "r", "title": "Pay card", "notes": null, "done": false, "priority": "none", "due": "2026-08-31", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-08-31"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "2026-09-28T09:30:00Z", "2026-09-28"], "expect": [{"id": "r", "title": "Pay card", "notes": null, "done": false, "priority": "none", "due": "2026-09-30", "tags": [], "recurrence": {"frequency": "monthly", "interval": 1, "anchor": "2026-08-31"}, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "toggleAll", "name": "now with an offset", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "2026-09-28T09:30:00+00:00", "2026-09-28"], "expectError": "now must be a UTC timestamp like 2026-09-28T09:30:00Z"},
  {"fn": "toggleAll", "name": "a bad now is refused even for an empty list", "args": [[], "now", "2026-09-28"], "expectError": "now must be a UTC timestamp like 2026-09-28T09:30:00Z"},
  {"fn": "toggleAll", "name": "today in Arabic-Indic digits is not a date", "args": [[{"id": "a", "title": "Walk the dog", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "2026-09-28T09:30:00Z", "٢٠٢٦-09-28"], "expectError": "today must be a date like 2026-09-28"},
  {"fn": "moveTodo", "name": "move the first to the end", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "a", 2], "expect": [{"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "moveTodo", "name": "move the last to the top", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "c", 0], "expect": [{"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "moveTodo", "name": "moving to where it already is renumbers the orders", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 3}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 7}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 8}], "b", 1], "expect": [{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "moveTodo", "name": "gaps in order: toIndex counts positions, not order values", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 5}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 9}], "a", 1], "expect": [{"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "moveTodo", "name": "array not in order sequence: positions are in manual order, not array order", "args": [[{"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}, {"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "a", 1], "expect": [{"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "moveTodo", "name": "equal orders are tied by array position", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "c", 0], "expect": [{"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}]},
  {"fn": "moveTodo", "name": "a one-item list: order becomes 0", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 7}], "a", 0], "expect": [{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}]},
  {"fn": "moveTodo", "name": "move the last of four into the middle", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}, {"id": "d", "title": "D", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 3}], "d", 1], "expect": [{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "d", "title": "D", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 3}]},
  {"fn": "moveTodo", "name": "a done todo moves like any other", "args": [[{"id": "a", "title": "A", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}], "a", 1], "expect": [{"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "a", "title": "A", "notes": null, "done": true, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": "2026-09-27T18:00:00Z", "order": 1}]},
  {"fn": "moveTodo", "name": "toIndex past the end", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "a", 3], "expectError": "toIndex must be between 0 and 2, received 3"},
  {"fn": "moveTodo", "name": "a negative toIndex", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "a", -1], "expectError": "toIndex must be between 0 and 2, received -1"},
  {"fn": "moveTodo", "name": "a fractional toIndex", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}, {"id": "b", "title": "B", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 1}, {"id": "c", "title": "C", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 2}], "a", 1.5], "expectError": "toIndex must be between 0 and 2, received 1.5"},
  {"fn": "moveTodo", "name": "an unknown id", "args": [[{"id": "a", "title": "A", "notes": null, "done": false, "priority": "none", "due": null, "tags": [], "recurrence": null, "createdAt": "2026-09-27T08:00:00Z", "completedAt": null, "order": 0}], "zz", 0], "expectError": "no todo with id \"zz\""},
  {"fn": "moveTodo", "name": "an unknown id in an empty list", "args": [[], "a", 0], "expectError": "no todo with id \"a\""}
]