[P0] ZARA-006 — Repair timer parsing, execution, and completion notifications #7

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

Problem

Timers are broken across the resolver and execution layers:

  • modules/intent_resolver.pl places generic arg1/3 before timer/alarm-specific clauses, making the specific number extraction unreachable for arity-1 paths.
  • kb/intents.pl declares timer/alarm arity 2 while modules/commands.pl expects 3- or 4-element shapes that include extra tokens.
  • alarm has no real execution handler.
  • modules/alarm.pl::timer_done/1 only logs that Python handled the notification, but no Python completion callback exists.

Required fix

  • Define one typed timer command shape for seconds/minutes/hours and optional name.
  • Parse common utterances deterministically without routing through the LLM.
  • Implement timer and alarm behavior explicitly or mark alarms unsupported; do not fake success.
  • Deliver a real completion notification through the existing notification abstraction.
  • Preserve named and unnamed timers.

Required tests

  • Table-driven Prolog/Python tests for singular/plural units, numeric atoms, optional names, malformed/missing duration, and multiple concurrent timers.
  • Fake the clock/alarm scheduler; tests must finish immediately.
  • Add scripts/test-timers.sh that runs parser fixtures and a zero/near-zero fake completion path.

Acceptance

  • set a timer for 10 seconds resolves and schedules exactly 10 seconds.
  • Completion invokes the notification callback once.
  • Unsupported alarms fail honestly.
  • Tests and script pass under nix develop.

Branch

fix/zara-006-timers

Dependencies

ZARA-003, ZARA-005.

## Problem Timers are broken across the resolver and execution layers: - `modules/intent_resolver.pl` places generic `arg1/3` before timer/alarm-specific clauses, making the specific number extraction unreachable for arity-1 paths. - `kb/intents.pl` declares timer/alarm arity 2 while `modules/commands.pl` expects 3- or 4-element shapes that include extra tokens. - `alarm` has no real execution handler. - `modules/alarm.pl::timer_done/1` only logs that Python handled the notification, but no Python completion callback exists. ## Required fix - Define one typed timer command shape for seconds/minutes/hours and optional name. - Parse common utterances deterministically without routing through the LLM. - Implement timer and alarm behavior explicitly or mark alarms unsupported; do not fake success. - Deliver a real completion notification through the existing notification abstraction. - Preserve named and unnamed timers. ## Required tests - Table-driven Prolog/Python tests for singular/plural units, numeric atoms, optional names, malformed/missing duration, and multiple concurrent timers. - Fake the clock/alarm scheduler; tests must finish immediately. - Add `scripts/test-timers.sh` that runs parser fixtures and a zero/near-zero fake completion path. ## Acceptance - `set a timer for 10 seconds` resolves and schedules exactly 10 seconds. - Completion invokes the notification callback once. - Unsupported alarms fail honestly. - Tests and script pass under `nix develop`. ## Branch `fix/zara-006-timers` ## Dependencies ZARA-003, ZARA-005.
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#7
No description provided.