Skip to content

docs(people): plan bots as their own entity, with reach and tie - #3323

Open
leemour wants to merge 12 commits into
mainfrom
docs/contact-kinds-rfc
Open

leemour wants to merge 12 commits into
mainfrom
docs/contact-kinds-rfc

Conversation

@leemour

@leemour leemour commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Task

Answer the RFC in #3314 with a plan that can be built.

Why

Every person gets one kind (person, organization, automated, stranger, unsorted). That one value answers several questions at once, and when one answer has to win the wrong one often does: bank alerts and no-reply senders land in Strangers, newsletter addresses fill merge review, the owner's second address looks like a stranger. As long as a bot is a person with a mark, every list and every scan must remember to skip it.

The four bugs behind it are split out: #3319, #3320, #3322 merged (#3328, #3326); #3321 waits on mail-cli.

What

A draft plan, docs/dev/plans/2026-11-24-contact-kinds.md, and its backlog item CORE-71:

  • Bots become their own entity (bots table) beside persons and organizations. Identities move between a person and a bot, logged; the owner's choice wins.
  • Two answers on persons and bots: reach (direct, group, broadcast) and tie. Deleted and nameless rows become a mark, not a tab.
  • Four tabs: People, Subscriptions, Bots, Organizations. Strangers becomes a filter inside People.
  • Local, deterministic signals in order of strength, each with its source. Headers count only under a passed DKIM signature.
  • Bots and shared mailboxes grouped under an organization by registrable domain, with exceptions for free mail and sending platforms.
  • Domain lists that can be downloaded whole and matched locally (Wikidata, UT1, disposable mail, Public Suffix List), and why lookup services and spam lists are not used.
  • AI classification is out of scope: its own command and plan.
  • Order of work: signals with no store change first; the bots migration after the 1.0 store version 73 (feat!: cli-core 1.0.0-rc.0, the stable API, store version 73 and the 1.0 fixes #3288).

Testing

Docs only. markdownlint-cli2 and scripts/docs-check.ts pass locally.

🤖 Generated with Claude Code

One kind per person answers three questions at once: who sent it, how it
reached the owner and whether the owner knows them. Service mail lands in
Strangers and newsletters in merge review because one answer has to win.

The plan splits the kind into sender (human, bot, organization), reach
(direct, group, broadcast) and tie, lists the local signals that decide each
one with their sources, groups bots under organizations by registrable domain,
names the domain lists that can be shipped and matched locally, and keeps AI
classification for its own plan. The four bugs behind the RFC are #3319-#3322.

Refs #3314

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner chose to keep bots apart from people: a bot in its own table
cannot be proposed as the same person, assigned a task or counted as
known, so no list has to remember to skip it. The sender field goes; reach
and tie stay on persons and bots. Identities move between a person and a
bot, logged, with the owner's choice winning. The order of work now starts
with signals that need no store change, and the bots migration waits for
the 1.0 store version 73 (#3288).

Refs #3314

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour leemour changed the title docs(people): plan contact kinds as sender, reach and tie docs(people): plan bots as their own entity, with reach and tie Nov 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour added a commit that referenced this pull request Nov 25, 2026
… headers (#3334)

## Task

Slice 1a of the contact-kinds plan ([plan PR
#3323](#3323), not merged).
It builds plan steps 2 and 3 in a read-only form: nothing new is stored
on `persons`. Part of #3314.

## Why

Service mail shows up under Strangers. An example is a bank's statements
from an address with no no-reply word. The mail itself says a program
sent it (`Auto-Submitted`, an empty Return-Path) or that it went to a
list (one-click unsubscribe, `Feedback-ID`). Until now the store did not
keep these headers.

Coordinator decisions for this slice:
- **No migration.** #3288 (1.0) keeps store version 73. Storing
`sender`/`reach` waits until it merges.
- **No `sender`/`reach` columns.** Bots may become an entity of their
own; the owner is deciding that.

## What

- **Mail headers** (`src/mail/headers.ts`). `mailHeadersOf` now also
keeps three headers in `emails.headers`: `auto-submitted` (unless `no`
or `auto-replied`), `list-unsubscribe-post` (one-click only) and
`feedback-id`.
- Each is kept only when a DKIM signature that Gmail's `mx.google.com`
stamp passed covers that header, and the signature's domain has the
From's registrable domain (`signedFieldsOf`, reuses `registrableOf`).
- An empty Return-Path is kept as `null-return-path`, unless the mail is
an auto-reply: an out-of-office makes no bot.
  - No store version: these are JSON keys.
- **Gap, documented in MAIL.md.** Only Gmail's own stamp is trusted.
Mail from an IMAP server never keeps the three signed headers.
- **`people.list` rows** get `reach` (`direct`, `group`, `broadcast` or
`null`) and `signals`. Both come from
`src/store/sqlite/sender-signals.ts`: a pure `senderSignalsOf` plus
`sentMailOf`, a query for the page's people. They are worked out for the
returned page only and never stored.
- **Kind.** A signed `Auto-Submitted` or an empty Return-Path on most of
a sender's mail makes them `automated` (new `KindSignal`s), unless the
owner wrote to them. `KIND_RULES` goes from 5 to 6, so stored kinds are
worked out again. Everything else is unchanged.

Defaults chosen for the plan's open questions:
- **Q2, mixed sender.** One sender. The reach most of their mail had
wins, the wider on a tie. Mail the owner wrote them, or a private chat
both wrote in, makes it `direct`.
- **Q3, discussion lists.** A List-Id that 3 or more addresses send to
(`+tag` aside) is `group`. One sender is a newsletter, `broadcast`.
- **Owner's position.** Only "no To or Cc at all" counts as `broadcast`.
The owner missing from a To/Cc that names others proves nothing, because
an alias the store does not know looks the same. The position comes from
`email_recipients`, which already holds every To/Cc, so old mail counts
too.

Notes for the re-plan:
- **PERF.** On a page with List-Id mail, `sentMailOf` reads every stored
email's List-Id. There is no index, and adding one needs a migration. A
follow-up for the stored version.
- **Inconsistency, existing behaviour.** A discussion-list member can
have `reach: group` and still be `kind: automated` through today's
`bulk-mail` rule. It is left as it is on purpose.
- **Downstream.** cli-memo only reads `ListedPerson` and `kindSignals`.
The widened union is listed under "Changed — may break callers".

## Testing

All with `--maxWorkers=1`:
- New: `src/mail/sender-signals.test.ts` (sync through the fake mail
source to the people list, 3), `src/mail/headers.test.ts` (5),
`src/store/sqlite/sender-signals.test.ts` (3).
- Existing: people-list, people-kinds-stored, person-doubts,
people-matching-rules, mail/score, mail/own (86 passed); mail/sync,
store/mail, mail/rules, sender-scores, probe, mail/cli (135 passed).
- `pnpm typecheck`, `pnpm ci:quick`, `pnpm schema:check`, `pnpm
docs:check`, Biome on the changed files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour added a commit that referenced this pull request Nov 25, 2026
Rebased onto main after #3338 (store version 73, which replaced #3288).
Version 74 was regenerated from 73's snapshot. Its new tables use
`AUTOINCREMENT`, as 1.0 asks, and `minCompatible` stays 73.
`api/store.api.txt` and `docs/reasons.md` were regenerated.
`version-73.test.ts` now migrates only up to 73, so a later version does
not break it. The changelog entry is under "Changed — experimental":
`KindSignal` and the people list are `@experimental`, and the rest only
adds things, so no major is needed.

## Task

Plan steps 3 and 4 of the contact-kinds plan ([plan
#3323](#3323)): bots as
their own entity, and the owner's choice to move a sender between a
person and a bot. Owner's ruling NEED-109 A. Part of #3314.

## Why

A bot was a person with the kind `automated`. Every list, merge scan and
tie check had to remember to skip it, and each one that forgot was a bug
(#3320 was one). The owner also had no way to say "this is a bot" or
"this is a person" in a way that holds.

## What

**Schema chosen (store version 74).** Tables, an index and triggers
added only. `minCompatible` stays 73.
- `sender_bots` (id, `person_id` unique, name, `organization_id`, author
`rules` or `owner`, reason, times). `bots` was already taken by agents,
and `bot:<n>` refs mean agents, so the table is `sender_bots` and the
ref is `sender-bot:<id>`.
- **A bot keeps the person row it was sorted from.** Its identities stay
in `identity_links` on that row. I chose this over
`identity_links.bot_id` or a `bot_identities` table:
- `identity_links.person_id` is `NOT NULL`. Making it nullable needs a
table rebuild.
- About 60 modules join `identity_links`. Taking an identity out of it
means ingest creates a new person on the next sync (`ensurePerson`). The
emptied person also shows as "added by hand".
- Desktop accepts only `person:<uid>` refs (`person_ref` in
`people.rs`). `people show person:<uid>` keeps working.
- `sender_bot_moves`: one row per identity per move. It holds from
(person or bot), to, author `rules` or `owner`, reason, and time.
- **No foreign keys** on either table, as `document_changes` does, so an
older build can still erase a person or purge an account. Triggers drop
the rows with the person or identity, and clear the organization. Other
triggers clear the stored kind when a bot or a move is written.
- **PERF from #3334:** an expression index `emails_by_list_id` on the
exact List-Id expression `sentMailOf` uses. No new column and no
backfill: `CREATE INDEX` fills it. A test asserts that `EXPLAIN QUERY
PLAN` of the real statement (`LIST_SENDERS`) uses the index. The schema
codegen now passes an expression key through.

**Rule move** (`people-list.ts`, `KIND_RULES` 7). When kinds are kept, a
person moves to a bot when all of these hold:
- their kind is `automated` by a program's signal: the platform bot
flag, a no-reply or notification address, a signed Auto-Submitted, a
null return path, or `bulk_never_replied`;
- the owner wrote them nothing: no mail tie and no two-way private chat
(the platform flag holds anyway);
- no `ALWAYS_SHOWN` reason applies;
- every identity is the program's, or they have only one.

Other cases:
- `automated-name` or a bulk mailbox alone marks a person and moves
nothing. A newsletter a human writes stays a person.
- A rule's bot goes back to a person when the rules stop holding, for
example when the owner writes to it. This is logged.
- No person is emptied by a rule move.

**Owner's choice.** `store.people.moveToBot(subject, by, { bot?, name?,
reason? })` and `moveToPerson(subject, by, { person?, reason? })`.
Subject: `person:<uid>`, `sender-bot:<id>` or an `IdentityRef`. Owner
only (`identity.owner-only`).
- One identity of a person with several gets a person row of its own
first (an owner's unlink).
- A bot the owner made is `author = 'owner'`. An identity whose latest
move is the owner's, to a person, is never moved by a rule. Both survive
`KIND_RULES` bumps (tested).

**Bots are left out of:**
- the matcher (`identity.not-a-person` for email and phone joins too;
name scans already skip `automated`);
- `tasks.assign` (new reason `sender-bot.assignee`);
- `people.similar`;
- `people.ties` (empty).

**`kind:automated` compatibility.** A bot is still listed as `automated`
under its `person:<uid>` ref, with the same counts and paging. The row
gains `bot: "sender-bot:<id>" | null` and has empty `ties`. memo's
`personRow` and Desktop's `listed()` read named fields only, so both
keep working unchanged.

**People counts.** `people.list` counts are the only people tallies in
cli-core. Bots count under `automated` and never under `person`.

**Alias joining the owner later (item 4).** I found no stale kind.
`person_kind_email_au` clears the recipients' kinds when `markOwnMail`
flips `outgoing`. A new test in `src/mail/own.test.ts` proves it:
stranger first, person after the alias joins. No fix was needed.

**Not in this PR (memo needs):** `bots list` and a command for the two
moves (for example `people bot <ref>` and `people person <ref>`), and a
field for the bot ref on `people list` rows. Call that field
`sender_bot`, not `bot`: Desktop's `Listed.bot` already means "has the
messenger bot signal". Desktop needs a Bots tab (plan step 7). No
downstream implements `PeopleStore` (grep of cli-memo, wirecat-desktop,
cli-template).

**RISK.** The first list after the upgrade creates every bot under the
write lock. A synthetic store with 20,000 no-reply senders took 1.4 s
for that list, against 0.66 s with nothing to move (load average about
30). The lock part stays under the other writers' 5 s wait. Chunk it if
a real store shows more.

## Testing

All runs used `--maxWorkers=1`.
- New `src/store/sender-bots.test.ts` (8 tests):
  - a rule move, kept through a sync;
- the owner's moves both ways, through a `KIND_RULES` change, refused
for an agent and for the owner's own person;
  - one identity moved to a new bot and into an existing one;
  - no join by address, and no task assignee;
- an upgrade from 73 moves the programs, and `EXPLAIN` shows the index
is used;
  - a rule's bot goes back once the owner writes to it;
  - a purge and an erase take the bot's rows with them;
  - no proposal by name.
- Existing suites: people-list (19), people-kinds-stored (6),
people-matching-rules (23), person-match-scan (34), person-doubts,
person-merges, schema, sender-signals, mail/own (8), store, upgrade,
rollback-copy, transaction, doctor, store-tables, store-maintenance.
- Under load (average 30–45), one people-list test and one
people-kinds-stored test passed only when run alone. They were over the
time limit, not wrong.
- `pnpm typecheck`, `ci:quick`, `schema:check`, `docs:check`, and Biome
on the changed files.
- Line limits were raised for `spec.mjs` (+2), `schema.ts` (+5) and
`reasons.ts` (in the 1010 group), as version 72 did.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour added a commit that referenced this pull request Nov 25, 2026
## Task

Plan step 5 of the contact-kinds plan ([plan
#3323](#3323), "Grouping
under an organization"): organizations from mail domains, with the three
exceptions. Part of #3314.

## Why

After #3339 a program that writes to the owner is a sender bot, but
nothing says whose bot it is. Ten no-reply and `info@` addresses of one
bank showed as ten unrelated senders. People at that bank had no link to
it either.

## What

**The rule** (`src/store/sqlite/domain-organizations.ts`, run from
`keep()` in `people-list.ts` after the rule moves and before the kinds
are written):
- A sender bot, or a shared mailbox (kind `organization` by
`role-address`), at a company domain joins the organization of its
registrable domain (`registrableOf` / tldts `getDomain`: `mail.bank.ru`
and `bank.ru` are one).
- The organization is the one already holding an address at that domain.
Otherwise a new `company` is made, named by the sender when the name is
a company's (`isCompanyName`) or equals the domain's own word (`Bank`
for `bank.ru`); otherwise it is named by the domain.
- The addresses go to `organization_identities` with method `domain`,
author `rules`, and the bot's `sender_bots.organization_id` is set.
  - This never goes to merge review and makes no proposal.
- A human with an address at that domain gets a `member-of` link (author
`rule`, `metadata.derived = "mail-domain"`, confirmed). They are never
merged. A new organization also links the humans already stored at its
domain.
- **Exceptions:** `FREE_MAIL`; throwaway mail from
`disposable-email-domains-js` (CC0, already a dependency, so nothing was
vendored); and `SENDING_PLATFORMS`, a hand table. A platform domain
never groups anything.
- **The owner's word wins:**
- The owner removes a membership (`knowledge.removeRelation`). The
existing rejected `relationship` proposal is checked, and the link is
never added again.
- The owner erases an organization (`knowledge.eraseOrganization`). This
leaves a rejected `proposed_actions` row of kind `organization-domain`
for each company domain it held, and the rule never makes an
organization for that domain again. The row is written only from the
owner-facing erase, not from a CRM purge's clean-up.
- The owner moves a bot to a person (`moveToPerson`). The rule's holds
on those identities go. A person the owner kept as a person holds
nothing; they can still be a member.
- `KIND_RULES` goes to 8, so the first list after the upgrade groups the
senders already stored.

**Decisions I made (owner asleep):**
- **No migration.** `sender_bots.organization_id`,
`organization_identities.method/author` and `links.author` already
exist, so I made no #3157 reservation.
- **A human alone makes no organization.** Otherwise every
correspondent's company becomes one. A human is linked only to an
organization that already holds the domain.
- **New organizations get scope `personal`**, the schema default. The
other automatic creators use `work`, but these senders are mostly
services the owner uses privately.
- **`member-of` role is null.** The rule cannot tell an employee from a
contact.
- **The owner and test people are left out.**
- **A domain that two organizations hold is skipped**, not guessed.
- **Link source `owner`, author `rule`** follows the `tasks.ts`
`answered-by` precedent. `LINK_ORIGINS` has no `rule`.
- **Only `From` is matched.** The plan's DKIM-domain matching and
grouping by `List-Id` or display name inside a platform are not built.
The bounce and DKIM entries in the table guard mail whose `From` carries
them.

**Sending platforms, checked against vendor pages on 2026-11-25:**

| Status | Domains |
|---|---|
| Verified on the vendor's own page | `amazonses.com`
([AWS](https://docs.aws.amazon.com/ses/latest/dg/mail-from.html)),
`mandrillapp.com`
([Mailchimp](https://mailchimp.com/developer/transactional/docs/authentication-delivery/)),
`mtasv.net`
([Postmark](https://postmarkapp.com/support/article/910-how-do-i-add-a-custom-return-path)),
`ghost.io` ([Ghost](https://ghost.org/help/custom-sending-domains/)),
`mcsv.net`, `mcdlv.net`, `mailchimpapp.net`, `rsgsv.net`
([Mailchimp](https://mailchimp.com/help/my-campaign-from-name-shows-mcsvnet/))
|
| Partial | `sendgrid.net`
([Twilio](https://www.twilio.com/docs/sendgrid/ui/account-and-settings/how-to-set-up-domain-authentication);
the page does not name the header), `buttondown.email` ([Buttondown
blog](https://buttondown.com/blog/sending-email-address), not docs),
`mailgun.org` ([sandbox
only](https://documentation.mailgun.com/docs/mailgun/user-manual/domains/domains-sandbox))
|
| Search excerpt of a vendor page only (the page refused the fetch or
redirects) | `substack.com`, `sparkpostmail.com`, `brevosend.com`,
`beehiiv.com` |
| Unverified | `buttondown.com`, `list-manage.com`, `postmarkapp.com`,
`mailgun.net`, `convertkit-mail.com`, `sendinblue.com`, `mlsend.com` |

**PERF (found, not fixed here):** `isDisposableEmailDomain` builds its
whole set on every call, about 0.5 ms each. The new module builds the
set once. `src/mail/score.ts` still calls the slow function per sender.

**Gaps left:**
- The owner can take one bot or mailbox out of its organization only by
erasing the organization or by `moveToPerson`. No store method detaches
one address. memo needs one before it can offer "not this company".
- No `category` from domain lists (out of scope).
- memo and Desktop do not show organizations of bots yet.

## Testing

All runs used `--maxWorkers=1`.
- New `src/store/domain-organizations.test.ts` (7 integration tests):
- a bot and an `info@` at `mail.bank.ru` / `bank.ru` → one organization
named `Bank`, and the bot's `organization_id` is set;
  - a name that is no company's → named by the domain;
  - `gmail.com` and `mailinator.com` → none;
- two newsletters on `substack.com` plus one on `ghost.io` → no
organization, no membership;
- a human at a company domain → `member-of`, whether the human came
first or later, and no proposal;
- the owner's separations (a removed membership, an erased organization,
a bot moved to a person) are not undone after every kind is worked out
again;
  - a second full pass changes no row.
- `people-list.test.ts`: the shared mailbox `info@hotel.ru` now also has
the `organization` signal, because an organization holds it.
- Existing suites passed: sender-bots, people-list, people-kinds-stored,
people-matching-rules, person-match-scan, person-doubts, person-merges,
person-separation, person-erase, organization-erase, agent-links,
crm-email-join, identity-links, identity-splits, same-email-join,
mail-findings, mail, records-matching, people-owner, mail/own,
mail/sender-signals, crm/relations, messenger, proposals registry,
private-people, owner-labels, people-owner-guard, rollback-copy, store,
upgrade, version-61, version-66, mcp-doctor, store-maintenance,
store-tables.
- `pnpm typecheck`, `pnpm lint`, `schema:check`, `docs:check`, and
`command-lint`.

**Cost**, on a synthetic store with 22,000 senders: 10,000 no-reply bots
and 4,000 role mailboxes across 2,000 domains, 6,000 humans at those
domains, and 2,000 at gmail. Load average was about 15.

| Step | Time |
|---|---|
| First list after the upgrade (rule moves, kinds, grouping) | 1.6 s |
| The grouping pass alone, making 2,000 organizations, 14,000 holds,
6,000 links | 0.64 s |
| The same pass with nothing to do | 0.16 s |
| The pass for 50 people | 30 ms |
| A list after a small sync | 0.55 s |

All of it runs under the write lock, well under the other writers' 5 s
wait. Before the disposable-set fix, the pass with nothing to do took 13
s.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
leemour and others added 2 commits November 25, 2026 05:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#3350 stores the sector in organization metadata as `sector`, since
`category` already means client, supplier or partner. #3349 made the
throwaway-domain check one prebuilt set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pikerr

pikerr commented Nov 25, 2026

Copy link
Copy Markdown

Thanks for the thorough breakdown and for rapidly isolating the four underlying bugs (#3319–#3322). The plan in docs/dev/plans/2026-11-24-contact-kinds.md is a massive step forward.

However, addressing Open Question 1 ("Tab names. People / Subscriptions / Bots / Organizations. Are four tabs right, or should Bots sit inside Organizations?"), introducing a top-level "Subscriptions" tab alongside People, Bots, and Organizations repeats the exact same category error as Strangers.

Here is why elevating "Subscriptions" to a top-level navigation entity breaks domain clarity:


1. In terms of GLOSSARY.md: A Subscription is not an Actor

The core principle in docs/dev/GLOSSARY.md is "One word, one meaning".
If we examine the fundamental nature of the entities:

  • Person: An Actor (a human subject capable of mutual, interactive dialog).
  • Bot: An Actor (a software daemon emitting automated messages into the socket).
  • Organization: An aggregate Container (a legal entity, platform, or domain linking actors).

What is a Subscription?
A Subscription has no hands. It does not write bytes to a socket. It is not an Actor.
A Subscription is a Relationship / Delivery Mode (how content is consumed), not an entity in an address book. Placing a delivery mode alongside actors on the top-level tab hierarchy is a textbook Category Error.


2. The "Human Substack Author" Paradox

The draft plan states:

"A newsletter author is usually a person, so 'newsletter' is a way of reaching you, not a sender type."

From a systemic and recipient perspective, this is an illusion:

  • It does not matter whether a newsletter issue was drafted by a human or generated by an LLM.
  • The author does not open a mail client to write to the owner personally. They click "Publish" on a SaaS platform.
  • The platform’s automated MTA mass-dispatches the email to thousands of recipients via bulk SMTP relay with Precedence: bulk, List-Unsubscribe, and Feedback-ID.
  • You cannot engage in a bi-directional dialog with it. An incoming reply almost always bounces to a no-reply address or drops into a black-hole support ticketing queue.

To the system, this is 100% automated broadcast traffic emitted by a bot/daemon.


3. The 4-Tab UX Dilemma (Cognitive Friction for the User)

Dividing automated communications into sibling tabs Subscriptions and Bots forces the user into constant mental ambiguity:

  • When GitHub sends a daily notification digest — is it a Subscription (I subscribed to the repo) or a Bot?
  • When Medium or an industry portal sends a weekly digest — is it a Subscription or a Bot?
  • When an e-commerce platform (Sportmaster / Amazon) sends promo offers — is it a Subscription or a Bot?
  • If the owner wants to find an automated alert, where do they click: Bots or Subscriptions?

Users shouldn't have to guess the internal editorial workflow of the sender to find a message. All machine-generated, non-dialogue traffic belongs together.


4. What is the real role of reach (direct, group, broadcast)?

The reach dimension proposed in the plan is a fantastic concept, but its true power lies in Search Ranking, Scoring, and Signal Weighting, not in splitting the address book:

  • When searching via memo search all "contract", hits with reach: direct should naturally rank higher than reach: broadcast.
  • When assessing relationship strength, reach: direct feeds the tie metric, whereas reach: broadcast is explicitly ignored for ties.

Recommended Architecture & Glossary Updates

  1. Update GLOSSARY.md:
    Formally introduce canonical definitions for:

    • bot: one software agent or service emitting automated/unidirectional messages (newsletters, 2FA, system alerts, chatbots) (bot:<uid>). Never assigned tasks, never merged with persons.
    • subscription: a relationship between the owner and a bot/feed for recurring broadcast content (reach: broadcast). Not an address-book entity.
  2. Clean 3-Pillar Navigation:

    [ 👤 People ]        [ 🤖 Bots / Automated ]        [ 🏢 Organizations ]
    
    • People: Strictly real humans with whom interaction/dialogue is possible.
    • Bots / Automated: All software actors, broadcast feeds, transactional daemons, and newsletters. Inside this tab, Subscriptions / Newsletters is simply a filter tag (category: newsletter), alongside Alerts, Billing, and Auth.
    • Organizations: Grouping container for company employees and company bots.

This preserves strict conceptual invariants, eliminates UI ambiguity, and aligns the implementation directly with the core glossary.

@pikerr pikerr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed architectural review and recommendations on Open Question #1 (GLOSSARY.md alignment, entity taxonomy, and avoiding the Subscriptions category error) posted in the main conversation thread: #3323 (comment)

@pikerr

pikerr commented Nov 25, 2026

Copy link
Copy Markdown

Here are concise architectural recommendations for Open Questions 2–5 in the plan:


Q2: Mixed Senders (Direct contact + Newsletter author)

Recommendation: Single Person entity, properties per message.

  • Splitting a human into two identities (Ivan-Human vs Ivan-Newsletter) creates artificial duplicates that will haunt future merge reviews.
  • A person is a single entity (person:ivan). The presence of any reach: direct interaction permanently grants them genuine contact status.
  • The reach: broadcast attribute attaches to individual newsletter messages/threads so they don't pollute priority search scoring.

Q3: Discussion Mailing Lists

Recommendation: Adopt the 3+ distinct senders heuristic (reach: group).

  • This is spot-on. A multi-party technical mailing list (e.g., LKML, Google Groups) is functionally identical to a public chat group.
  • Contributors should be ingested as Person with reach: group and tie: false (no personal relationship until mutual 1-to-1 communication occurs).

Q4: Domain Lists & Knowledge Sources

Recommendation: Pragmatic split — keep it lightweight.

  • In-bundle (Compile-time): Public Suffix List + top consumer/disposable webmail domains (gmail.com, outlook.com, etc.). These are lightweight (<100 KB compressed), completely offline, and essential to prevent grouping individual users into a fake "Gmail Inc" organization.
  • Avoid bundling Wikidata / UT1 sector dumps: Shipping static dumps of the global economy bloats the package (violating CORE-3) and goes stale quickly. Determining economic sector (banking, travel) is non-critical for basic entity grouping and belongs in an optional enrichment step if needed at all.

Q5: The Full Split of Bots (bot:<id>)

Recommendation: Full entity split into a dedicated bots table.

@leemour

leemour commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Thanks Petya, went through both comments and checked them against what's already built.

Agree

  • Q5, full split. Same direction: a bot gets its own table and a bot: ref. feat(people): sender bots apart from people (store version 74) #3339 is the first form (a sender_bots row anchored on a person), and people: never propose bots, automated senders or organizations as the same person by name #3320 was exactly the bug you describe, the name-match scan didn't skip bots. This is the next step for bots.
  • Q3, discussion lists. Already the default in the plan: a List-Id with 3+ distinct senders is group, members stay people, a tie comes only from 1-to-1.
  • Q2, one person, not split by address. Matches what we decided for the plan: a newsletter written by a human stays a person.
  • reach for ranking. Good use, I'll add it to the plan: direct hits rank above broadcast in search all, and broadcast never feeds tie. Today reach is worked out per sender. For ranking it should be per message.
  • GLOSSARY. bot goes in with the full split. subscription as a relationship and not an entity, agree.

Subscriptions tab. Right, a subscription is not an actor. In the plan it isn't a table either, it's a view of reach: broadcast. But your Amazon example breaks that view: one bot sends receipts and promos, and a per-sender reach puts all of it into one tab. One thing to settle with a 3-tab layout: human newsletter authors stay people, so People needs the same broadcast filter, otherwise Substack authors fill People again (half of #3314). I'll decide on the tabs and update the plan.

One contradiction. Point 2 of the first comment says a Substack newsletter is 100% bot traffic, Q2 says the author is one person. Which do you mean? My take: the person stays a person, and their newsletter messages are broadcast.

Q4, domain lists. Sectors are already built in #3350, so here is the real cost: 25,639 domains from Wikidata, 358 KB raw and 139 KB gzipped, against a 238 MB install (CORE-3). Staleness is real: the file is rebuilt at release, and a sector is never cleared yet. Agree it's enrichment and grouping doesn't need it. The Public Suffix List and free and disposable mail lists are in the bundle, as you suggest. If sectors turn out to be noise, it's one file to drop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pikerr

pikerr commented Nov 25, 2026

Copy link
Copy Markdown

Actually, there's no contradiction between Point 2 and Q2 — the boundary is simply whether a direct 1-to-1 relationship exists:

  1. Pure newsletter / Substack senders (no direct interaction) → Bot.
    From the system's point of view, an unsolicited or subscribed bulk relay (Precedence: bulk, List-Unsubscribe, no 1-to-1 dialog) is automated broadcast traffic regardless of whether a human or an LLM drafted the text. They belong in Bots (under a newsletter / broadcast filter), not in People.
  2. Mixed senders (Q2 edge case — e.g. Ivan writes to me personally and also sends a newsletter) → Person + per-message reach: broadcast.
    Here, the presence of reach: direct wins so we don't drop a real contact out of People or split them into two identities. Only their newsletter messages get tagged reach: broadcast (for search ranking and excluding from tie).

And if a pure Substack sender ever starts a real 1-to-1 thread later, moving the identity from bots to persons (which is already in the plan) handles the rare promotion cleanly.

Why this also solves the 3-tab concern:
You mentioned that in a 3-tab layout (People / Bots / Organizations), human newsletter authors would fill People again (half of #3314). With the rule above, they don't:

  • Pure Substack / newsletter relays go straight to Bots (filtered by Transactional vs Broadcast / Newsletters, which also handles the mixed Amazon bot cleanly once reach is per-message).
  • People stays strictly for real human contacts (with Strangers as a filter for group-only / tie: false).
  • Organizations groups both People and Bots.

Q4 (Wikidata sectors):
139 KB gzipped against a 238 MB install is completely reasonable, and keeping it as a single droppable file resolves my bloat concern. No objection there.

Everything else looks solid — happy with the direction!

… decided

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… domain sources

Adds two research notes beside the plan (how mail products sort mail; a
catalogue of domain sources with licences) and a Mail categories section:
a type per mail, a sector per sender, rules by mail, list, address and
domain, scoped corrections. Records the owner's answers on tabs and on
mixed senders, and adds the paid-product question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour

leemour commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Update after thinking it through, the plan is updated.

  • Tabs are views, not tables. A tab shows filtered data, so how bots or subscriptions are stored doesn't limit the UI. Four tabs stay.
  • Each mail gets its own type, apart from its sender (order, shipping, bill, security, newsletter, promotion, personal and so on). The sender's view is a summary of its mails, so the Amazon case works: receipts under Bots, promos under Subscriptions. reach is per mail too, which also covers your ranking point.
  • Rules work on two levels, address first, then domain. A person rarely writes from a newsletter address, but often from the same domain. Domain rules are refused for free-mail domains.
  • Bots get the full split with their own table and bot: ref, in progress now.

Research behind it, in the same PR:

The contradiction question from my last comment still stands. Would be great if you look at the new "Mail categories" section.

leemour added a commit that referenced this pull request Nov 25, 2026
…tity (#3355)

## Task

Reserve store version 75 for the full split of bots from people
(contact-kinds plan step 3, full form; plan in #3323). Owner's ruling,
2026-11-25: a bot is its own entity, never a person.

## Why

`docs/dev/COORDINATION.md` asks for a reservation in a pull request of
its own, merged before the migration: the runner skips every version at
or below the file's.

## What

One line: the next free version becomes 76, and version 75 is described.

## Testing

Docs only; the commit hooks ran Markdown lint and spelling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@pikerr

pikerr commented Nov 25, 2026

Copy link
Copy Markdown

Looks like our comments crossed in the air — I answered the contradiction question right before your update: #3323 (comment) (short version: pure bulk relays with no direct dialog → Bot; mixed senders with direct → Person + per-message reach: broadcast).

On Mail categories:
The new section is very strong. Per-mail type + reach, schema.org / Zero-style header signals, two-level address→domain rules (refusing domain rules for free-mail), and splitting large domain lists into a separate versioned data pack all make a lot of sense.

One remaining pushback — Subscriptions inside Contacts (and the HEY mismatch):
I see the HEY inspiration (Imbox / The Feed / Paper Trail), and that model is great — for an inbox of messages, not for a Contacts screen.

Transplanting The Feed (Subscriptions: newsletters, Telegram channels, marketing) as a top-level tab inside Contacts mixes two different mental models:

  • Contacts answers "who is this entity?"
  • Subscriptions answers "what content streams do I read or unsubscribe from?"

Even with per-mail categories, putting Subscriptions in Contacts means a single entity like Amazon or a bank ends up smeared across three tabs at once (Organizations as a company, Bots for receipts/2FA, and Subscriptions for promos), while Telegram channels end up sitting in an address book.

If you want to carry the HEY model all the way through, Subscriptions / Feed belongs in the Mail / Feed / Reading view (sorting messages and streams), while Contacts stays a clean 3-tab directory of entities (People, Bots, Organizations). Either way, having the clean 3-table model + per-mail categories underneath is the main win.

leemour and others added 2 commits November 25, 2026 17:20
…ial lists for free WireCat only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… data pack

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour added a commit that referenced this pull request Nov 25, 2026
## Task

Reserve store version 76 for the per-mail type classifier (contact-kinds
plan #3323, section "Mail categories"). Owner's rulings, 2026-11-25:
every mail gets its own type apart from its sender, and `reach` is
worked out per mail.

## Why

`docs/dev/COORDINATION.md` asks for a reservation in a pull request of
its own, merged before the migration: the runner skips every version at
or below the file's.

## What

One line: the next free version becomes 77, and version 76 is described
(columns `mail_type`, `reach`, `type_signal` on `emails`, two indexes,
triggers; `minCompatible` stays 73).

## Testing

Docs only; the commit hooks ran Markdown lint and spelling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants