[P1] ZARA-017 — Repair todo update, recurrence, validation, and scheduling semantics #18

Closed
opened 2026-07-18 19:21:27 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-18 19:21:27 +00:00 (Migrated from github.com)

Problem

The SQLite todo path is marked “not fully baked” and contains concrete correctness gaps:

  • update_todo() uses None as “preserve,” so optional fields cannot be intentionally cleared/unscheduled.
  • Status, priority, duration, timestamps, and repeater values are not validated at the storage boundary.
  • _parse_repeater_delta() accepts - but ignores the mode and still moves forward.
  • Month/year repeaters are approximated as fixed 30/365-day deltas.
  • schedule_todo() only catches identical timestamps and ignores task durations/overlaps; the agent tool does not pass Prolog overlap logic.
  • Iterable inputs can be consumed more than once in query construction.

Required fix

  • Introduce explicit sentinel/patch semantics so fields can be preserved, changed, or cleared.
  • Validate domain values before writes.
  • Define supported recurrence syntax and calendar behavior; reject unsupported semantics honestly.
  • Implement duration-aware conflict checks in one canonical layer.
  • Make multi-table updates transactional.

Required tests

  • Temporary SQLite tests for create/edit/clear/complete/reopen, invalid status/duration/date, recurrence boundaries, month-end/year-end, duplicate tags, rollback, and overlap.
  • Add scripts/test-todos.sh that exercises the public Python skills against a temporary database.

Acceptance

  • A todo can be unscheduled and optional fields can be cleared.
  • Invalid data never partially commits.
  • Recurrences and conflicts match documented behavior.
  • The README no longer needs to state that scheduling is broken.

Branch

fix/zara-017-todo-correctness

Dependencies

ZARA-007, ZARA-015.

## Problem The SQLite todo path is marked “not fully baked” and contains concrete correctness gaps: - `update_todo()` uses `None` as “preserve,” so optional fields cannot be intentionally cleared/unscheduled. - Status, priority, duration, timestamps, and repeater values are not validated at the storage boundary. - `_parse_repeater_delta()` accepts `-` but ignores the mode and still moves forward. - Month/year repeaters are approximated as fixed 30/365-day deltas. - `schedule_todo()` only catches identical timestamps and ignores task durations/overlaps; the agent tool does not pass Prolog overlap logic. - Iterable inputs can be consumed more than once in query construction. ## Required fix - Introduce explicit sentinel/patch semantics so fields can be preserved, changed, or cleared. - Validate domain values before writes. - Define supported recurrence syntax and calendar behavior; reject unsupported semantics honestly. - Implement duration-aware conflict checks in one canonical layer. - Make multi-table updates transactional. ## Required tests - Temporary SQLite tests for create/edit/clear/complete/reopen, invalid status/duration/date, recurrence boundaries, month-end/year-end, duplicate tags, rollback, and overlap. - Add `scripts/test-todos.sh` that exercises the public Python skills against a temporary database. ## Acceptance - A todo can be unscheduled and optional fields can be cleared. - Invalid data never partially commits. - Recurrences and conflicts match documented behavior. - The README no longer needs to state that scheduling is broken. ## Branch `fix/zara-017-todo-correctness` ## Dependencies ZARA-007, ZARA-015.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara#18
No description provided.