Xale's model Intentions

Habits Frequency and logs

A Habit is something the person repeats, with a cadence that is a soft target. Xale counts progress in the current period and never counts streaks.

View as Markdown

Fields

xale_read_habits returns active Habits (filter with areaId):

FieldWhat it is
id, titleThe Habit
cadenceHow often, below
surfaceKindhabit, or event, meaning it's offered on set weekdays
anchor{ "dows": [1, 3, 5] }: ISO weekdays, 1 is Monday, 7 is Sunday
archivedtrue or false
areaIds, linkedProjectIdsAreas, Projects
workerIdsThe People who do it
stepsCheckable steps with IDs, labels and optional durations
linkedMilestoneIds, milestonesVisible link IDs and bounded details (id, title, date, endDate)
milestonesTruncatedSome linked Milestone lookups were skipped

A batch looks up at most 500 distinct Milestone IDs across all Habits. A single-Habit retry gets its own budget of up to 20. If milestonesTruncated is true, pass the Habit's id for an individual read. For other visible linkedMilestoneIds, use xale_read_milestone.

A Habit has no time of day. To give it time, put an occurrence into a day with xale_schedule_intention (kind: "habit").

Cadence

cadenceTarget
{ "kind": "daily" }Once a day
{ "kind": "perWeek", "target": 3 }1 to 21 a week
{ "kind": "perMonth", "target": 2 }1 to 62 a month
{ "kind": "perQuarter", "target": 1 }1 to 92 a quarter
{ "kind": "perYear", "target": 2 }1 to 366 a year: “twice a year”

The target is soft: Xale never counts streaks.

Progress

xale_read_today gives each active Habit's progress in the current period: completed, target (1 for daily) and remaining.

Creating and changing

ToUse
Createxale_create_habit: title, cadence, optional durationMin (5 to 480), areaIds, description, people, projects, milestones, ordered steps titles, and a requestId
Change title, description, cadence, duration (durationMinDefault, 5 to 1,440), surfaceKind, weekdays, or the Note or Mindmap behind itxale_update_habit
Add or edit Stepsxale_update_habit with steps, merged by ID. A label-only edit keeps the existing duration.
Change linked Milestonesxale_change_links on the Habit with milestones
Archivexale_prepare_removal with archive_habit, then the person's yes

Logs

ToUse
Complete a day's occurrence (today unless date is given)xale_complete_habit. Completing it twice changes nothing. If the day has several occurrences, the refusal lists them; send instanceId.
Complete it through its time blockxale_complete_block
Keep a dated entry in the person's wordsxale_record_entry with kind: "habit": it goes on the Habit's log Note, made and linked the first time

Nudges

If the person wants nudging about a Habit, offer a check-in at a time they choose. It reaches them when your own app runs it: see Check-ins.

Limits

Pro allows 500 Habits.

  • Checked against main d2feeb6e

Was this helpful?

habits-frequency-and-logs.md · main@c1725f34