Files
mesh-catalog/modules/mesh-mail-reader
jochen f3007eb242
mesh/merge-gate head f3007eb242f8 merged into trunk 6c6d5f681c30 — pass: builds mesh-mail, mesh-mail-web, new: modules/mesh-mail-reader → novox; no bus ste…
mesh/repo-check head f3007eb242f8 merged into trunk 6c6d5f681c30 — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-…
mesh/delivery delivered
Fix the try on 8000b637 and review round 2: RunBatches takes its gap as a parameter instead of reading the var BatchGap, and no tell while unhealthy is checked as an exact count, not a before/after that a same-pass tell could hide behind (issue 1520, 1524)
2026-10-21 01:52:58 +02:00
..

mesh-mail-reader — the default holder of mail-reading

Design 59, milestone 2 (mail reading); built from mesh-mail's own source, like mesh-mail-web and mesh-mail-notifier (novox/hq ADR 0459). One instance, held once for the mesh, on the machine mesh-mail runs on, under its own account (runs-as) — it hears mesh-mail's restricted stream MAIL, which the operator account never does. It reads mail; it moves, flags, deletes and sends nothing (ADR 0459 §11).

What it does, and what is still to land

  • Claims mail-reading (held once for the mesh), declared in mesh-mail's own manifest beside its three mail seats, serving six verbs: entries, groups, correct, lessons, undo, status (ADR 0459 §2). Each answers only a caller the trusted setting callers names (default ["mesh-mail-web"]); any other caller is refused, naming why.
  • Hears mesh-mail's added events and judges a batch of up to 10 at a time against a question put to claude_code_judge, keeping an entry per mail — never its body — in its own database (issue 1518, 1427; not yet built).
  • Keeps a health of its own, mail_reader_health: unhealthy once a judgement is refused, times out or answers out of shape; healthy again once one succeeds (issue 1519; not yet built).
  • Tells the operator at most once a batch when a mail matters, and corrects itself at once, keeping a reading lesson, when the operator says it judged wrong (issue 1428, 1429, 1522; not yet built).

Until each of those issues lands, its own verb answers that it is not built yet, once the caller check above has already passed or refused.

Its database

Its own postgres-database (issue 1517; not yet declared in the manifest until then): mail entries, mail groups, reading lessons, the mails heard but not yet read, and its own health state. No column holds a mail body or text taken from one.

Tools

tool does
mail-reading.entries every mail entry: headers, mail group, summary, mark and why, due date. Read-only
mail-reading.groups every mail group a batch has made, largest first. Read-only
mail-reading.correct correct one entry's mark, why or due date; kept at once as a reading lesson
mail-reading.lessons the reading lessons kept, at most 40. Read-only
mail-reading.undo undo one reading lesson
mail-reading.status lessons kept, undone, and per 100 mails read this week. Read-only
mail_reader_health how mesh-mail-reader is: unhealthy once a judgement is refused, times out or answers out of shape, naming which and since when; healthy once one succeeds. Read-only

Where it runs

Its own account (runs-as), because it hears mesh-mail's restricted stream MAIL (novox/hq ADR 0376 §2). Held once for the mesh, on the machine mesh-mail runs on; it is granted reading only, after issue 1227's split of mesh-mail's grants is delivered (ADR 0472: that split is won't-fix — mesh-mail's grants stays one list per account, and mesh-mail-reader is put on it after delivery, never asking to send).