ABV Nexus home

>> Notes /

Auralar: price at write time, lateness at read time

This note is about Auralar, the family wall calendar, and two decisions about time.

Every piece of data has to be either stored or calculated. Get that wrong and the app slowly starts telling families things that are not true. Two rules in Auralar show both sides.

Points are written down when the job is set

Chores and tasks are worth points. Instead of inventing a number per chore, each household sets what a normal job is worth, ten by default, and every job carries a difficulty against it:

  • very easy: half
  • easy: three quarters
  • normal: the household's number
  • hard: one and a half
  • very hard: double

So with the default, a hard job is worth 15 and a very easy one 5. With a normal of 7.5, a very easy job is worth 3.75. Points keep two decimals, with trailing zeros trimmed.

The important part is when that number is worked out. It is calculated once, when the job is written, and stored with it. When somebody ticks the job, the points awarded are copied onto that completion, and the member's total is updated from it.

The reason is fairness. A tick has to pay what the board said at the time. If a household later raises its normal from 10 to 12, nobody's past chores suddenly become worth more, and nobody's month changes under them. Calculating points on the fly would be simpler and would quietly rewrite history every time a setting changed.

Lateness is worked out when the calendar is read

Auralar has three kinds of item: events simply pass, chores repeat and a missed occurrence is just missed, and tasks have to be done. An unfinished task rolls forward onto today.

That roll-forward is never written to the database. The task keeps its real due date. Every time the calendar is read, Auralar works out that the task is overdue and shows it on today, marked with how late it is: "3 days late".

Storing the move instead, by changing the due date each morning, would need a job running at midnight, and it would destroy the one fact that matters: when this was actually due. With the calculation, "still not done since Wednesday" stays knowable however long the task sits.

A rolled task appears on today and nowhere else, so one forgotten job does not smear itself across every column of the week view. Once ticked, it moves to the day it was actually ticked, which is where its record is.

The rule underneath

Both decisions follow the same line:

  • Store what happened: the price that was agreed, the date that was set, the moment it was ticked.
  • Calculate what it means now: whether it is late, where it shows up today.

The trade-off is a little more work on every read, and some care to keep the stored totals consistent with the completions they come from. In return, nothing a family has already earned or planned changes because the calendar was opened on a different day.