Skip to content

Add non-working mode and workday boundary rules to /timebox#23

Merged
cristoforows merged 3 commits into
mainfrom
wesley/timebox-workday-rules
Jul 11, 2026
Merged

Add non-working mode and workday boundary rules to /timebox#23
cristoforows merged 3 commits into
mainfrom
wesley/timebox-workday-rules

Conversation

@cristoforows

Copy link
Copy Markdown
Owner

What

Extends /timebox with a third day type and sharper working-day rules, per a grilled-out spec.

Non-working day mode

  • New 🌴 Day off option alongside Office/WFH.
  • Picking it asks for a start time before collecting tasks: 24-hour free text (900→09:00, 1330→13:30, 0930, colon form 9:00 also accepted; anything ambiguous/out-of-range re-asks), or a Start 09:00 default button.
  • Non-working days get no commute, no work window, and no focus filling — just tasks around lunch/dinner from the chosen start.

Workday boundary rules (office/wfh)

New TIMEBOX_WORK_START / TIMEBOX_WORK_END (soft) / TIMEBOX_WORK_END_HARD bound a work window inside the day. The planner now:

  • Classifies each task work vs non-work by inference.
  • Keeps work tasks inside 09:00–17:00, spilling to 18:00 only when needed (avoiding 17–18), never past the hard end — overflow is dropped and reported.
  • Caps non-work at ≤60 min total inside the work window; the rest goes to the evening.
  • Fills empty gaps with placeholder focus slots: Work Focus (90m) + Break (15m) in 09:00–17:00, Personal Focus + Break in 17:00–23:30.

Other

  • Day end extended to 23:59 so the evening is plannable.
  • Dropped tasks now surface a clear "⚠️ N task(s) couldn't be scheduled (ran out of time)" notice in both the text-only and calendar-published replies.

Implementation notes

  • One system prompt, _MODE_BLOCK fragment-switches the commute line and the work-window rules are injected only for working days — no prompt triplication.
  • DayConfig gains the work window; _day_config(start_override=…) threads the non-working start time in without mutating the frozen config.
  • Generated Focus/Break events carry the existing source=timebox tag, so redo's clear-then-write removes them cleanly.

Testing

  • tests/test_scheduler.py updated + new cases: work-window/focus rules present for office/wfh, absent for nonworking; dropped-notice wording. 17 passed locally.

New TIMEBOX_WORK_START/END/END_HARD bound the working band inside the
day; day end moves to 23:59 so the evening is plannable.
- Mode gains 'nonworking'; commute line switches via a _MODE_BLOCK map
- DayConfig carries the work window; working days get boundary + focus-fill
  rules (work tasks inside the window, <=60m non-work inside it, Work/Personal
  Focus placeholders filling gaps to 23:30), injected for office/wfh only
- Dropped tasks now render a shared 'couldn't be scheduled' notice
Picking 'Day off' asks for a start time (24h free text like 900/1330, or a
09:00 default button) before collecting tasks, overriding the day start.
@cristoforows
cristoforows merged commit 367f7b7 into main Jul 11, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant