Documentation Index
Fetch the complete documentation index at: https://docs.canthus.org/llms.txt
Use this file to discover all available pages before exploring further.
Key tables
Tasks: task definitions (relativeCost, duration, body/mind weights, timing fields, essential flag, and default details copy).
TaskOccurrences: canonical per-instance schedule and state rows (dueDatetime, completion/cancellation/deferral, per-instance edits).
Every task is seeded with at least one persisted occurrence row at creation time (including timingType=none) so ingest paths are uniform. For recurring tasks, due slots are generated in the active horizon window at read time and inserted idempotently using deterministic occurrence keys before compute runs.
CheckIns: daily body/mind/mood ratings, check-in tier, day-type classification.
Events: append-only audit log; source of truth for rebuilding derived state.
ManaCalibrationSnapshots: per-day derived calibration state (algorithmVersion, pool/coefficient EWMA, confidence, alpha/bias, daily spend ratio inputs) used for deterministic fast reads and migration checkpoints.
ManaCalibrationMigrations: append-only algorithm migration/rollback records (fromVersion, toVersion, migration type, timestamp, optional rollback checkpoint reference).
manaCost is not stored as source-of-truth. It is computed at read time from task properties and today’s axis factor.Key fields
| Table | Field | Type | Notes | |
|---|---|---|---|---|
| Task | details | string? | default details/instructions for this task | |
| Task | relativeCost | double | effort relative to baseline | |
| Task | isEssential | bool | user-controlled | |
| Task | timingType | enum | none, deadline, scheduled | |
| Task | recurrenceRule | string? | RFC 5545 RRule | |
| TaskOccurrence | id | int | auto-increment local surrogate ID | |
| TaskOccurrence | taskId | string | FK to task definition (Tasks.id) | |
| TaskOccurrence | dueDatetime | datetime | canonical due timestamp for this instance | |
| TaskOccurrence | occurrenceKey | string | deterministic identity key: `taskId | dueDatetimeUtcMillis` |
| TaskOccurrence | details | string? | per-instance override; if null, UI can use Task.details | |
| CheckIn | checkInDate | datetime | local calendar day identity, normalized to local midnight | |
| CheckIn | checkInTier | enum | full, quick, momentum, none with confidence weights 1.0, 0.7, 0.4, 0.1 | |
| CheckIn | dayType | enum | normal, packed, blocked, unusual; carries opportunity weights 1.0, 0.25, 0.0, 0.0 | |
| ManaCalibrationSnapshot | day | datetime | normalized local day identity for the snapshot | |
| ManaCalibrationSnapshot | algorithmVersion | int | explicit algorithm state version tag | |
| ManaCalibrationSnapshot | poolEwma | double | persisted pool EWMA state | |
| ManaCalibrationSnapshot | coefficientEwma | double | persisted coefficient EWMA state | |
| ManaCalibrationSnapshot | confidence | double | persisted confidence value used for bias | |
| ManaCalibrationSnapshot | baselineSpend | double | day-level baseline spend input for EWMA updates | |
| ManaCalibrationSnapshot | dailyRatio | double | baselineSpend / allocatedMana ratio used for coefficient learning | |
| ManaCalibrationMigration | fromVersion / toVersion | int | version transition boundary | |
| ManaCalibrationMigration | type | enum-like string | parameter_only, state_transform, recompute, rollback | |
| UserProfile | lastCheckInDate | datetime | absence detection | |
| UserProfile | returnRecoveryDaysRemaining | int | 3-step return recovery | |
| PemEvent | attributionConfidence | double | 0.4-1.0 window-based | |
| PemEvent | userAttributedTrigger | string? | optional user attribution | |
| PersonalTaskEntry | observedHRResponse | JSON? | reserved for wearable integration |
Schema examples by task type
Atemporal task (timingType = none)
Deadline task (timingType = deadline, non-recurring)
dueDatetime is in the past and state = active, surfacing derives missed.
Scheduled task (timingType = scheduled, recurring)
Recurrence exception (edit this occurrence only)
Partial completion
Storage model
- Encrypted local SQLite via Drift + SQLCipher
- No remote DB, no cloud sync
- Offline-first behavior
- Encryption key in platform keystore (not cloud backed up)
shared_preferences and persist across health-data reset.
Runtime recurrence query
Recurrence parsing contract
- Stored recurrence input may be either:
- a full content line (
RRULE:FREQ=...) - or a bare rule value (
FREQ=...)
- a full content line (
- If
DTSTARTexists in the stored string, it is used as the recurrence anchor. - If
DTSTARTis absent, the anchor defaults toTask.createdAt. - Line parsing splits on both Unix and Windows line endings (
\\n,\\r\\n). - Implementation detail: the parser uses regex pattern
[\\r\\n]+to split lines.\\rmatches carriage return,\\nmatches newline,+collapses one-or-more line break chars into one separator.- Example:
DTSTART:...\\r\\nRRULE:...andDTSTART:...\\n\\nRRULE:...both split into the same two logical lines.
- Invalid recurrence strings fail soft:
- no generated slots are returned
- a typed warning is emitted by the recurrence service
Derived status contract
missedis derived at read time in domain scheduling logic.missedis not persisted inTaskOccurrences.deferredUntilshifts an occurrence’s effective due time used by scheduling.