What you are looking at
A small job on a clock, not a clever assistant.
The automaton does four plain things: it wakes on a schedule, reads the unread threads, files each one against a rule you can read, and writes a digest. There is no model deciding what matters on your behalf and no irreversible action anywhere in the loop.
That restraint is the design. Because it only labels, a mistake costs a second to undo. Because it records why it filed each thread, you can audit it. Because it leaves anything unmatched for you, it never quietly makes a call it should not. Trust comes from the small, reversible job, not from cleverness.
Why this one is safe to run unattended
Four choices turn "an automation touching my inbox" into something you would actually leave running.
Each of these is a deliberate limit. Together they are why you can hand this job to a schedule and stop thinking about it.
Reversible only
It labels, and nothing else
A label is undone with one click and loses nothing. Deleting, archiving, or auto-replying are not reversible in the same way, so they stay out of the loop. The automaton can be wrong and it still cannot hurt you.
Readable rules
You can read every rule
Invoices to Finance, a known client domain to Client, bulk senders to Read later. Rules in plain language, owned by you, not a hidden classifier. When something files wrong, you can see exactly which rule did it and fix that rule.
Leaves the hard ones
Ambiguous mail stays with you
Anything no rule matches is left in the inbox, unlabelled, for a human. The automaton does the obvious 80 percent and hands you the 20 percent that needs judgement, rather than guessing and being confidently wrong.
Writes it down
Every decision has a reason
The digest records why each thread was filed where it was. That turns the pass from a black box into an audit trail, and it is what lets you trust it after the first few mornings.
// Runs every weekday at 07:00, before you open your laptop.
// The whole value is that it fires whether or not anyone is watching.
schedule('0 7 * * 1-5', triageInbox);One cron expression. 0 7 * * 1-5 means minute 0, hour 7, any day of the month, any month, weekdays only. The scheduler wakes the job; the job does the rest.
// Plain-language rules you own. First match wins; order them by confidence.
const RULES = [
{ label: 'Finance', why: 'invoice or receipt', match: t => /invoice|receipt/i.test(t.subject) },
{ label: 'Client', why: 'known client domain', match: t => CLIENTS.includes(domainOf(t.from)) },
{ label: 'Read later', why: 'bulk newsletter', match: t => t.headers['List-Unsubscribe'] != null },
{ label: 'Calendar', why: 'calendar invite', match: t => t.hasAttachment('text/calendar') },
];Each rule is a label, a human-readable reason, and a test. They are readable on purpose: when a thread files wrong, you can see which rule caught it and adjust that one line rather than debugging a model.
async function triageInbox() {
const threads = await mail.listUnread();
const report = [];
for (const t of threads) {
const rule = RULES.find(r => r.match(t));
if (!rule) continue; // no match, leave it for the human
await mail.addLabel(t.id, rule.label); // only ever labels, never deletes
report.push({ subject: t.subject, label: rule.label, why: rule.why });
}
await mail.draftNote('Morning triage', digest(report, threads.length));
}The whole automaton. It reads, it labels the matches, it skips the rest, and it drafts a digest. There is no delete, no archive, no reply, so the worst a bug can do is put the wrong label on a thread, which you undo in a second.
function digest(report, total) {
const byLabel = groupBy(report, r => r.label);
const lines = Object.entries(byLabel).map(([label, rs]) => `${rs.length} → ${label}`);
return [
`${report.length} of ${total} sorted, ${total - report.length} left for you`,
...lines,
].join('\n');
}The report you actually read. Counts per label, and how many were left for you, so a glance tells you whether the morning is calm or needs you. The per-thread reasons live alongside it for when something looks off.
The rule of thumb
Give an automaton a small, reversible job and a schedule, and it earns trust.
The win is not a clever classifier. It is that the loop runs without you, writes down why it did each thing, only ever labels, and hands back anything it is unsure about. Start there, and you can leave it running.
