feat: add Taskwarrior tasks to the kal today briefing #4
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/kal!4
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/today-tasks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
kal todaynow has a Taskwarrior block between the agenda and the birthdays:+OVERDUE status:pending): sorted by urgency, capped attasks_overdue_max(default 10), with an… N moreline for the rest+DUETODAY status:pending): sorted by due timetasks_next(default 5) by urgency fromstatus:pending -WAITING -BLOCKEDA task shows up in only one part (overdue first, then due today, then next). Each line has a priority marker (
!!!/!!/!), the description (cut at 60 chars),[project]and a relative due date (3d ago,today 19:00,tomorrow,in 4d).Graceful degradation
task rc.hooks=0 rc.verbose=nothing rc.json.array=on <filter> exportas an argv list (no shell), with stdin set to /dev/null and a 3s timeout.taskis not installed, the block is left out without any message.(unavailable: …). The first failure stops the remaining queries, so the worst case is one 3s wait.Config
Invalid values fall back to the defaults.
KalConfig.save()keeps the table, so hiding a calendar in the TUI does not wipe it. There is also akal today --no-tasksflag for a single run.Structure
kal/tasks.py. It reads tasks through an injectableRunner(filter → export JSON), and the parse, collect and format steps are pure functions.kal/today.py:format_briefing()andbriefing()take optionaltasksandnowarguments.kal/cli.py:_run_todayreadsKalConfig(honoursKAL_CONFIG) and callsgather_tasks.Tests
tests/test_today_tasks.pyhas 38 tests. They use a fake runner and fixture JSON instead of a real task DB, and cover:Full suite: 310 passed (also under
TZ=UTC);ruff check .is clean.🤖 Generated with Claude Code
The notify daemon now also pings for pending Taskwarrior tasks a configurable lead time before they are due ("due in 15 min · 21:00 · sospel"), reusing the read-only kal.tasks runner. - Pure due_task_notifications(): fires once per task per due time (key task:{uuid}@{due}, so moving the due re-arms it); skips non-pending and still-waiting (snoozed) tasks. - Date-only / end-of-day dues (local 00:00 or 23:59:59) get no 23:44 lead ping; they get one "due today" ping from task_morning instead (key task-today:{uuid}@{date}). Wall-clock rules are DST-safe. - run_once queries only the lead window plus +DUETODAY; any task failure is logged and swallowed so event notifications keep working. - Config under [notify]: tasks = true, task_lead = "15m", task_morning = "09:00". - Task gains status and wait fields parsed from the export. Co-Authored-By: Claude Opus 5.5 <[email protected]>