Summa Work reads a person’s Outlook mailbox and calendar and divides it into topics, each with a status, a next step and the mail itself as a timeline. None of that picture is typed in by hand. It is derived: from message headers, from a model’s reading of the mail, from rules and threads. And because mail keeps arriving, it is derived again, and again.
That raises a problem that is easy to miss when you build the first version. A derived view is only useful if the person using it can correct it. The moment they correct it, every later derivation becomes a threat to their correction. This essay is about how we keep those two things — a picture that keeps updating, and a person who has the last word — from fighting each other.
The naive version
Picture the simple design. Every few hours a pass reads the recent mail and writes out the topics: titles, statuses, which message belongs where. The output replaces the previous output.
Now the member uses it. They rename “Q3 vendor review” to “Acme renewal”, because that is what it is. They drag a misfiled message from a newsletter into the right topic. They close a topic that is finished. They mark a commitment as done.
The next pass runs. The model, reading the same mail, calls the topic “Q3 vendor review” again. It places the message back with the newsletters, because nothing about the message has changed. It sees the old thread and reopens the closed topic. It reads the email in which someone asked for a quote, and the commitment to send one is back on the list.
Together these teach the user that correcting the view is pointless, and a derived surface that fights its user is worthless. A smarter model would not help: the rename is not in the mail.
Latches: one column per decision
Our answer is to record every user decision as its own fact, next to the thing it applies to, and to make every derivation pass read those facts before it writes. We call them latches. Each is a column; each blocks one specific thing a later pass might otherwise do.
| The member… | Recorded in | A later pass may not… |
|---|---|---|
| closes a topic | work_streams.closed_by_user_at | reopen it |
| renames a topic or edits its facts | title_set_by_user_at, facts_set_by_user_at | overwrite them |
| sets a topic’s status by hand | attention_override | recompute it |
| puts a message in a topic | work_mail_messages.assigned_by = user | move it |
| marks a commitment done or dismissed | work_commitments.resolved_by_user_at | put it back in front of them |
| accepts or dismisses a proposal | work_suggestions.status | resurrect it |
| edits or pastes a signature | work_signatures.origin | replace it on re-extraction |
In the code, these are small conditions at the point of writing, not a separate permission system. When the derivation upserts a topic it only sets the title if title_set_by_user_at is empty. It will set a closed topic back to active only if closed_by_user_at is empty. For commitments the check is a single early exit, with a comment that states the principle better than we can here: “They decided. A later pass may keep seeing the message that produced it; that is not a reason to put it back in front of them.”
A latch is per action, not per object. Renaming a topic does not freeze its summary or its next step; the model keeps those current. The member takes ownership of exactly the thing they touched.
One latch is deliberately weaker than the others. A status the member sets by hand is cleared when new mail arrives in that topic after they set it. That is not a model overruling them: it is a new fact. If you mark a topic “on track” and the other side then writes asking for something, it is no longer on track. A model pass alone never clears it.
Nothing is deleted, merges leave a forwarding address
Two more rules protect the structure of the view over time.
Topics go dormant instead of being deleted. Nothing in the derivation removes a topic. A topic with no mail for 90 days becomes dormant: off the main list, kept. If mail arrives again it becomes active again. A deletion would throw away the member’s renames, their placements and their resolved commitments along with it; dormancy keeps all of that for the day the topic wakes up.
A merge leaves a pointer. When the member merges two topics, everything in the absorbed topic moves to the target, but the absorbed row stays, with merged_into_id pointing at its new home. That matters because the model refers to topics by stable keys. Without the pointer, the next pass would see mail it associates with the old key, find no topic by that name, and create it again — undoing the merge. With the pointer, the key is followed to where it now lands. Chains are followed too, and a merge re-points anything that was already merged into the absorbed topic.
Whose move it is is counted, not judged
The most important thing on each topic is its status: your_move, waiting, on_track or quiet. It would be easy to ask a model for this. We compute it instead, in attention_for:
if override is not None:
return override
horizon = now - ATTENTION_HORIZON
inbound = as_naive_utc(last_inbound_at) if last_inbound_at else None
outgoing = as_naive_utc(last_outgoing_at) if last_outgoing_at else None
unanswered = inbound is not None and inbound >= horizon and (outgoing is None or outgoing < inbound)
if has_open_draft or open_you_owe > 0 or unanswered:
return "your_move"
if open_owed_to_you > 0:
return "waiting"
latest = max((stamp for stamp in (inbound, outgoing) if stamp is not None), default=None)
if latest is None or latest < horizon:
return "quiet"
return "on_track"
ATTENTION_HORIZON is 21 days. An open draft, something the member owes, or an unanswered message from the last three weeks makes it their move. Something owed to them makes it waiting. Nothing in 21 days makes it quiet. The member’s own setting comes first.
Because it is a rule rather than an opinion, the member can predict it, and when it is wrong they can see why. A model’s judgement of urgency would be harder to argue with and harder to correct.
A fixed order of trust for placing mail
Every message ends up in at most one topic, and several things have an opinion about which. They are ranked, and nothing overwrites a placement of higher rank.
- The member’s own move. Moving a message records
assigned_by = "user". It also moves the other messages in that thread that no person or rule had placed. - A saved rule. When moving a message, the member can ask Summa to remember the sender or the whole domain. Rules are re-applied on every pass; a sender rule wins over a domain rule. A rule never moves a message the member placed.
- The thread. A reply joins the topic its conversation is already in, without asking a model. The sorting pass is never shown a message that the member, a rule or its thread has already placed: the model has nothing to add to a decision that outranks it.
- The model. What is left, the model sorts. It may not move anything the member or a rule placed. When it is unsure — confidence below 0.6 — the message is shown on a Sort page for the member to confirm, rather than filed silently.
The order encodes how much each source knows. The member knows what the message is for. A rule is the member’s decision applied in advance. A thread is strong structural evidence. The model is a reasonable guess.
Signatures: the part that repeats
Replies Summa drafts need the member’s signature, and here the problem is the opposite one: Microsoft Graph cannot read Outlook signatures, which live in roaming settings with no API. So there is nothing to sync, only something to infer.
work_signatures reads the last 50 messages the member sent. Outlook on the web marks the signature with id="Signature"; classic Outlook starts it at a _MailAutoSig bookmark. When there is no marker, Summa looks for the longest run of trailing blocks that at least three sent messages share. The module’s docstring puts it in one line: “A signature is, by definition, the part that repeats.” A block that appears in fewer messages is not guessed at.
Each distinct signature is sanitised against an allowlist, since it came out of a mailbox, and named — “Full” and “Short”, or “Volledig” and “Kort” for a Dutch one. The member picks one for new mail and one for replies. If a server-side product already stamps signatures onto outgoing mail, Summa adds none.
The latch applies here as well. An edited signature keeps the fingerprint of the original, so when Summa re-reads sent mail it recognises the signature, finds the member’s version, and leaves it alone instead of adding the original back. An extracted signature that has not appeared lately is kept too: someone who has not used their English signature this week still has one.
A send is never retried
The last decision is the one with real consequences. Summa never sends on its own initiative. A draft becomes mail only when the member presses send or exports it to Outlook’s Drafts. Send waits ten seconds so that undo means something, then goes out from the member’s own mailbox.
Ordinary infrastructure wisdom says to retry a failed job. For sending mail, that is wrong. The draft is marked sending and committed before Outlook is asked, so a crash part-way leaves a durable record. A send still in that state after ten minutes is marked failed with work_send_interrupted, never re-queued, because it may already have gone out. The member sees the failure and decides whether to press send again. Sending twice is worse than not sending.
What it costs
Latches have a price. A topic the member renamed will keep that name even if its work changes completely; the model will not suggest a better one by overwriting. A message the member placed stays put even when later mail makes another topic a better fit. We accept that: the alternative is a view that is occasionally more accurate and never trusted.
Every write path also has to check the right latch, and a missed check is a bug that only shows up when a real person corrects something and watches it come back. Dormant topics and merge pointers mean rows accumulate rather than disappear. And the signature heuristic can miss a signature used in only one or two of the last 50 messages, which is why the member can paste their own.
What we would generalise
For anyone building a view that a model derives and a person corrects:
- Store user decisions as facts, separately from derived values. A column per decision is enough. A pass that overwrites a whole row cannot respect a correction it does not know about.
- Latch the action, not the object. Take ownership away from the model for exactly what the user touched, and let it keep the rest current.
- Let new facts release a latch, never new opinions. New mail can change whose move it is. A second reading of the same mail should not.
- Do not delete what the user has shaped. Retire it, and leave forwarding pointers when identities merge.
- Rank your sources and write the ranking down. When the user, their rules, the structure of the data and a model disagree, the order should be fixed and boring.
- Compute what can be computed. A status the user can predict is one they can trust and correct.
- Never retry an action with side effects someone can see. Fail loudly and let the person decide.
The model makes Summa Work possible. These rules are what make it usable.