Skip to content

feat(people): a sender of a newsletter only is a bot, a human author too - #3370

Merged
leemour merged 3 commits into
mainfrom
feat/newsletter-bots
Nov 25, 2026
Merged

leemour merged 3 commits into
mainfrom
feat/newsletter-bots

Conversation

@leemour

@leemour leemour commented Nov 25, 2026

Copy link
Copy Markdown
Member

Task

Owner's ruling of 2026-11-25 (contact-kinds plan, #3323, "The model"): a sender who only sends a newsletter is a bot, even when a human writes it. This replaces the rule of #3339/#3356, which kept a human-written newsletter as a person with reach broadcast.

What changed

  • The rule. A person becomes a bot with reason newsletter-only on the next people list when all of these hold:

    • all their mail came from a list: List-Id, List-Unsubscribe, one-click unsubscribe, Feedback-ID, bulk Precedence, or the bulk box;
    • they have no tie (chat, mail from the owner, meeting, CRM, phone book, task);
    • they have no messenger identity and no two-way chat;
    • none of their mail came through a discussion list (3+ senders on a List-Id).

    kindSignals names newsletter-only. KIND_RULES 9 → 10, so every kind is worked out again once.

  • Give-back. feat(people): bots are their own entity, apart from people (store version 75) #3356 gives a rule's bot back once the owner writes to it. A newsletter bot now also goes back once a 1-to-1 mail comes from it: no list headers, not in the bulk box, 1 to SMALL_GROUP_MEMBERS in To and Cc. No trigger makes a kind stale for such a mail. So storeKinds checks the mail added since the last check (email id watermark in store_settings) and runs the give-back when a newsletter bot sent some. No migration.

  • Mail types. A newsletter bot is not a program for mailTypeOf. Its mail stays newsletter and is not turned into promotion. After a give-back, only the newsletter mail keeps reach broadcast.

  • The owner's choice wins. moveToPerson / moveToBot, and the sorting rules of feat(mail): sorting rules by mail, list, address and domain (store version 77) #3366 that go through them, win over the rule.

Judgment calls

  • Bcc mail alone does not count. Mail with no recipients (Bcc, undisclosed recipients) has per-mail reach broadcast, but it does not count as list mail here. One Bcc from a human would otherwise make them a bot.
  • Any tie keeps a person. The ruling defines a direct exchange narrowly, but a phone-book entry or a meeting also keeps the sender a person.
  • Only newsletter bots go back after a 1-to-1 mail. A no-reply bot sends 1-to-1 transactional mail all the time, so it does not.
  • Header trust. List-Id, List-Unsubscribe and Precedence are stored without the DKIM check that List-Unsubscribe-Post and Feedback-ID get. A forged List-Id can make a human with no tie a bot, until a reply or a 1-to-1 mail gives them back.

Testing

  • New src/store/newsletter-bots.test.ts, through syncMail with a fake source:
    • a sender with no exchange becomes a bot, and its mail stays newsletter;
    • after the owner replies, the bot goes back to a person; reach is direct, and only the newsletter mail keeps broadcast;
    • a 1-to-1 mail alone gives the bot back;
    • a person the owner writes to who also sends a newsletter stays a person, and so do a discussion list's members;
    • the owner's moveToPerson wins.
  • people-list.test.ts: in the bulk-box test, the sender now has one mail outside the bulk box. All of it in the bulk box would make her a bot.
  • Full suite passed locally. Typecheck, biome and docs:check pass.
  • Timing on 20,000 synthetic newsletter senders + 20,000 humans, machine at load 15 to 52 (perf(people): what making newsletter-only senders bots costs cli-core's people list cli-testing#414):
    • the give-back check under the write lock: 31–51 ms per kept list;
    • the first people list: 3.2–13 s (one 91 s outlier at load 48);
    • warm pages under 40 ms.

🤖 Generated with Claude Code

leemour and others added 3 commits November 25, 2026 23:45
Owner's ruling of 2026-11-25 (contact-kinds plan, PR #3323): a person whose
mail all came from a list (List-Id, List-Unsubscribe, one-click unsubscribe,
Feedback-ID, bulk Precedence or the bulk box), with no tie to the owner, no
messenger identity and no discussion-list mail, moves to a sender bot with
the reason `newsletter-only` on the next people list.

- kindOf names the new `newsletter-only` kind signal; KIND_RULES 10 works
  every kind out again once.
- ruleBotsBack also gives a newsletter-only rule bot back once a 1-to-1
  mail (no list headers, at most SMALL_GROUP_MEMBERS in To and Cc) comes
  from it, besides the owner writing to it.
- Mail types do not treat a newsletter-only bot as a program, so its mail
  stays `newsletter` rather than `promotion`.
- The owner's moveToPerson/moveToBot (and the sorting rules through them)
  still win.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r change to wake the list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 88aa5fc into main Nov 25, 2026
41 checks passed
@leemour
leemour deleted the feat/newsletter-bots branch November 25, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant