donna.scheduling.time_intent¶
donna.scheduling.time_intent
¶
TimeIntent — the structured representation of when a task should happen.
Captures the five temporal kinds Donna recognizes (exact, window, constrained,
recurring, none) and derives the legacy deadline / deadline_type values
so existing consumers (reminders, overdue detector, weekly planner) keep working
unchanged. See docs/superpowers/specs/2026-06-05-challenger-and-scheduling-intake-design.md.
TimeIntent
dataclass
¶
TimeIntent(kind: Kind = 'none', due_at: datetime | None = None, earliest: datetime | None = None, latest: datetime | None = None, strictness: Strictness = 'soft', constraints: dict[str, Any] | None = None, recurrence: dict[str, Any] | None = None)
Normalized temporal intent extracted from a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
Kind
|
One of exact | window | constrained | recurring | none. |
'none'
|
due_at
|
datetime | None
|
Concrete deadline for |
None
|
earliest
|
datetime | None
|
Lower bound for |
None
|
latest
|
datetime | None
|
Upper bound for |
None
|
strictness
|
Strictness
|
hard | soft. Ignored when kind == none/recurring. |
'soft'
|
constraints
|
dict[str, Any] | None
|
e.g. {"weekday": [0], "time_of_day": "morning"} for |
None
|
recurrence
|
dict[str, Any] | None
|
e.g. {"rrule_or_cron": "0 9 * * 3", "human_readable": "every Wednesday 9am"}. |
None
|
from_dict
classmethod
¶
Build a TimeIntent from a loosely-typed dict (e.g. LLM JSON).
Source code in src/donna/scheduling/time_intent.py
from_json
classmethod
¶
Deserialize from the JSON string stored on the task row.
to_json
¶
Serialize to a JSON string for the time_intent_json column.
Source code in src/donna/scheduling/time_intent.py
derive_deadline
¶
Back-compat deadline: due_at (exact) or latest (window/constrained); else None.
Source code in src/donna/scheduling/time_intent.py
derive_deadline_type
¶
Back-compat deadline_type: strictness for time-bound kinds, else 'none'.