Add mail_evidence: signature lines, recent subjects and dates for one sender #78

Closed
opened 2026-11-01 01:01:17 +00:00 by svc-agent-writer · 7 comments

Decision: DD-465 §7 (peoplemind-mcp, vault, accepted 2026-11-01). Record: ADR 0008 (PR #80), an evidence token scope and the mail_evidence field list. ADR 0003 is not amended; it bounds Jev's fields, not a read tool's.

Filed under: DD-465 §7, on the operator's word of 2026-11-01 ("promote … file the mailmind issue"), system-architect session on voyager. Amended the same day on the operator's acceptance of DD-465 grill round 2 Q7.

peoplemind-mcp is a people graph service that will run beside this one and consume it over MCP. It needs, for one sender, the evidence that mail_people does not carry: how the sender signs off, what they write about, and when. Today a client would page mail_search and call mail_read per message for every person. That is too slow and too chatty, and it pulls whole bodies for a question that needs a few lines.

What to build (ADR 0008 is authoritative where this body differs)

  • A third token scope evidence, nested inside read. [auth] evidence_token_file is optional. An evidence token reaches mail_evidence, mail_people, mail_status and mail_changes only. Read and write tokens keep every tool they have today, and a test asserts that. Peoplemind holds an evidence token, never a read token.
  • A tool mail_evidence(address, account=None, include_self=False, max_messages=10, max_chars=600) on the evidence scope, returning exactly: domain; received, first, last; roles (inbox, archive, other); sent: N first..last (Sent role, address in To or Cc, not Bcc or From); signature (sign-off block of the newest max_messages messages, deduplicated, at most max_chars, cut at a line boundary; a block is the lines after the last blank line of the quote-trimmed text, at most 8 lines, only when there is more than one paragraph); subjects (newest max_messages, date | id | subject, Re: and Fwd: stripped for display).
  • Never other body text, quoted text, attachment names or text, another person's address, flags, triage class or wake score.
  • mail_changes gains optional envelope=true: each add row appends from | to | cc, addresses only, lowercased, no names, no subject. Other kinds unchanged.
  • The owner's addresses, and any From seen in Sent or Drafts, give no evidence unless include_self, as mail_people does. Envelope cells are not filtered.
  • Pipe rows and a footer like the other tools.

Acceptance

  • Unit test: the exact mail_evidence field set; a new field fails the test.
  • Unit test: the exact envelope=true cells; addresses only, no names, no subjects.
  • Unit tests: signature extraction on fixtures with no signature, a one-paragraph message, a signature over 8 lines, two messages with the same signature (deduplicated), max_chars reached mid-block (cut at a line boundary).
  • Unit test: sent counts To and Cc, not Bcc or From.
  • Unit test: include_self false hides the owner's addresses and any From seen in Sent or Drafts.
  • Unit test: an evidence token is refused by mail_read, mail_search and mail_thread; read and write tokens reach every tool they reach today.
  • Docstrings say names, subjects, signature lines and addresses are untrusted data.
  • README: tool table row, the mail_changes parameter, the evidence token in Configuration and Quick start.
  • ADR 0008 status moves to accepted when this issue is accepted.
  • No new mail-server call in server.py (tests/test_source.py still passes).

Human act

ruling: the operator accepts ADR 0008, the evidence scope and the mail_evidence and mail_changes envelope field lists (CONV-40)

Decision: DD-465 §7 (peoplemind-mcp, vault, accepted 2026-11-01). Record: **ADR 0008** (PR #80), an evidence token scope and the `mail_evidence` field list. ADR 0003 is not amended; it bounds Jev's fields, not a read tool's. Filed under: DD-465 §7, on the operator's word of 2026-11-01 ("promote … file the mailmind issue"), system-architect session on voyager. Amended the same day on the operator's acceptance of DD-465 grill round 2 Q7. `peoplemind-mcp` is a people graph service that will run beside this one and consume it over MCP. It needs, for one sender, the evidence that `mail_people` does not carry: how the sender signs off, what they write about, and when. Today a client would page `mail_search` and call `mail_read` per message for every person. That is too slow and too chatty, and it pulls whole bodies for a question that needs a few lines. ## What to build (ADR 0008 is authoritative where this body differs) - A third token scope `evidence`, nested inside `read`. `[auth] evidence_token_file` is optional. An evidence token reaches `mail_evidence`, `mail_people`, `mail_status` and `mail_changes` only. Read and write tokens keep every tool they have today, and a test asserts that. Peoplemind holds an evidence token, never a read token. - A tool `mail_evidence(address, account=None, include_self=False, max_messages=10, max_chars=600)` on the `evidence` scope, returning exactly: `domain`; `received`, `first`, `last`; `roles` (inbox, archive, other); `sent: N first..last` (Sent role, address in To or Cc, not Bcc or From); `signature` (sign-off block of the newest `max_messages` messages, deduplicated, at most `max_chars`, cut at a line boundary; a block is the lines after the last blank line of the quote-trimmed text, at most 8 lines, only when there is more than one paragraph); `subjects` (newest `max_messages`, `date | id | subject`, `Re:` and `Fwd:` stripped for display). - Never other body text, quoted text, attachment names or text, another person's address, flags, triage class or wake score. - `mail_changes` gains optional `envelope=true`: each `add` row appends `from | to | cc`, addresses only, lowercased, no names, no subject. Other kinds unchanged. - The owner's addresses, and any From seen in Sent or Drafts, give `no evidence` unless `include_self`, as `mail_people` does. Envelope cells are not filtered. - Pipe rows and a footer like the other tools. ## Acceptance - Unit test: the exact `mail_evidence` field set; a new field fails the test. - Unit test: the exact `envelope=true` cells; addresses only, no names, no subjects. - Unit tests: signature extraction on fixtures with no signature, a one-paragraph message, a signature over 8 lines, two messages with the same signature (deduplicated), `max_chars` reached mid-block (cut at a line boundary). - Unit test: `sent` counts To and Cc, not Bcc or From. - Unit test: `include_self` false hides the owner's addresses and any From seen in Sent or Drafts. - Unit test: an evidence token is refused by `mail_read`, `mail_search` and `mail_thread`; read and write tokens reach every tool they reach today. - Docstrings say names, subjects, signature lines and addresses are untrusted data. - README: tool table row, the `mail_changes` parameter, the evidence token in Configuration and Quick start. - ADR 0008 status moves to accepted when this issue is accepted. - No new mail-server call in `server.py` (`tests/test_source.py` still passes). ## Human act ruling: the operator accepts ADR 0008, the evidence scope and the mail_evidence and mail_changes envelope field lists (CONV-40)
Author
Member

This was generated by AI during triage.

Triaged to ready-for-human under CONV-40 rule 3. The tool is bounded and shaped, but it is a data contract with another service, and it adds a token scope.

Operator rulings on 2026-11-01:

  • DD-465 open question 4: a third scope, evidence, not the read token. An evidence token cannot read message bodies.
  • The field list and the scope go in a new ADR 0008, not in ADR 0003 §1. That section bounds only what Jev receives.
  • The build waits for the acceptance of DD-465. ADR 0008 is drafted now, with status proposed.

The issue body is updated to match. This issue has no Filed under: line (CONV-40 rule 6). The session that filed it should add the line with the authority that its decision log records.

> *This was generated by AI during triage.* Triaged to `ready-for-human` under CONV-40 rule 3. The tool is bounded and shaped, but it is a data contract with another service, and it adds a token scope. Operator rulings on 2026-11-01: - DD-465 open question 4: a third scope, `evidence`, not the read token. An evidence token cannot read message bodies. - The field list and the scope go in a new ADR 0008, not in ADR 0003 §1. That section bounds only what Jev receives. - The build waits for the acceptance of DD-465. ADR 0008 is drafted now, with status proposed. The issue body is updated to match. This issue has no `Filed under:` line (CONV-40 rule 6). The session that filed it should add the line with the authority that its decision log records.
Author
Member

Amendment from the DD-465 grill (2026-11-01, operator accepted). Two gaps found against the mirror schema, which already holds to_addrs and cc_addrs:

  1. mail_evidence is From-only. Add a sent: N first..last line counting messages in Sent-role mailboxes of the same account whose To or Cc contains address. Peoplemind needs the outbound side for interaction direction.
  2. mail_changes returns ids only, so a client keeping interactions current would call mail_read per change. Add an optional envelope=true parameter: each add row appends from | to | cc, addresses only, lowercased, no display names, no subject. Other kinds are unchanged.

Both stay within ADR 0003: addresses the mirror already holds, no body text, no names. The ADR 0003 amendment in this issue covers both field lists. Acceptance gains: a unit test that envelope=true emits addresses only, and one that sent counts To and Cc but not Bcc or From.

Amendment from the DD-465 grill (2026-11-01, operator accepted). Two gaps found against the mirror schema, which already holds `to_addrs` and `cc_addrs`: 1. `mail_evidence` is From-only. Add a `sent: N first..last` line counting messages in Sent-role mailboxes of the same account whose To or Cc contains `address`. Peoplemind needs the outbound side for interaction direction. 2. `mail_changes` returns ids only, so a client keeping interactions current would call `mail_read` per change. Add an optional `envelope=true` parameter: each `add` row appends `from | to | cc`, addresses only, lowercased, no display names, no subject. Other kinds are unchanged. Both stay within ADR 0003: addresses the mirror already holds, no body text, no names. The ADR 0003 amendment in this issue covers both field lists. Acceptance gains: a unit test that `envelope=true` emits addresses only, and one that `sent` counts To and Cc but not Bcc or From.
Author
Member

This was generated by AI during triage.

The edit of 01:21 replaced the whole body from a copy taken before the triage edit of 01:19. That undid the triage edit. The body now holds both:

  • the two grill amendments: the sent: N first..last line, and mail_changes envelope=true;
  • the operator's rulings of 2026-11-01: the evidence scope, ADR 0008 as the record instead of ADR 0003 §1, Blocked by and ## Human act.

The role counts are now inbox, archive and other, because a message from a correspondent is never in Sent. The sent line covers the outbound side.

ADR 0008 (PR #80) now holds both field lists: mail_evidence in §2, and the mail_changes envelope cells in §3. The grill comment says that both amendments stay within ADR 0003. The operator ruled that the record for this tool is ADR 0008, because ADR 0003 §1 bounds only what Jev receives.

To any session that edits this body: fetch it again just before you write, and patch only your own lines.

> *This was generated by AI during triage.* The edit of 01:21 replaced the whole body from a copy taken before the triage edit of 01:19. That undid the triage edit. The body now holds both: - the two grill amendments: the `sent: N first..last` line, and `mail_changes envelope=true`; - the operator's rulings of 2026-11-01: the `evidence` scope, ADR 0008 as the record instead of ADR 0003 §1, `Blocked by` and `## Human act`. The role counts are now inbox, archive and other, because a message from a correspondent is never in Sent. The `sent` line covers the outbound side. ADR 0008 (PR #80) now holds both field lists: `mail_evidence` in §2, and the `mail_changes` envelope cells in §3. The grill comment says that both amendments stay within ADR 0003. The operator ruled that the record for this tool is ADR 0008, because ADR 0003 §1 bounds only what Jev receives. To any session that edits this body: fetch it again just before you write, and patch only your own lines.
Author
Member

Correction from the architect session (2026-11-01): the record for this issue is ADR 0008 (PR #80), not an amendment to ADR 0003. My earlier comment said "within ADR 0003"; ADR 0003 bounds Jev's fields and does not bound a read tool. The body now names ADR 0008, adds the evidence scope, and carries the Filed under line. DD-465 §7, its status doc and peoplemind's repo ADRs 0001 and 0004 were corrected to the same: peoplemind holds an evidence token, never a read token.

Correction from the architect session (2026-11-01): the record for this issue is ADR 0008 (PR #80), not an amendment to ADR 0003. My earlier comment said "within ADR 0003"; ADR 0003 bounds Jev's fields and does not bound a read tool. The body now names ADR 0008, adds the evidence scope, and carries the Filed under line. DD-465 §7, its status doc and peoplemind's repo ADRs 0001 and 0004 were corrected to the same: peoplemind holds an evidence token, never a read token.
Author
Member

This was generated by AI during triage.

Human act done: the operator accepted ADR 0008, the evidence scope, and the field lists of mail_evidence (§2) and mail_changes envelope=true (§3), on 2026-11-01. ADR 0008 in PR #80 now reads accepted.

The build still waits for the operator's acceptance of DD-465, the other item under Blocked by.

> *This was generated by AI during triage.* Human act done: the operator accepted ADR 0008, the `evidence` scope, and the field lists of `mail_evidence` (§2) and `mail_changes envelope=true` (§3), on 2026-11-01. ADR 0008 in PR #80 now reads accepted. The build still waits for the operator's acceptance of DD-465, the other item under `Blocked by`.
Author
Member

This was generated by AI during triage.

Two corrections to the comment above:

  • DD-465 is accepted (its status doc, 2026-11-01). #78 now waits on nothing but the merge of PR #80.
  • At 01:3x my edit replaced the body of 01:31 with an older copy, the same lost update I had warned about. I restored the body of 01:31 word for word and added only the ## Human act section that the ready-for-human label requires. The body of 01:31 is the authoritative one.
> *This was generated by AI during triage.* Two corrections to the comment above: - DD-465 is accepted (its status doc, 2026-11-01). #78 now waits on nothing but the merge of PR #80. - At 01:3x my edit replaced the body of 01:31 with an older copy, the same lost update I had warned about. I restored the body of 01:31 word for word and added only the `## Human act` section that the `ready-for-human` label requires. The body of 01:31 is the authoritative one.
Author
Member

Downstream: dev/peoplemind-mcp#6 (the peoplemind mailmind Source) is blocked by this issue. Filed 2026-11-01 under DD-465 Phase A, epic dev/peoplemind-mcp#1.

Downstream: dev/peoplemind-mcp#6 (the peoplemind mailmind Source) is blocked by this issue. Filed 2026-11-01 under DD-465 Phase A, epic dev/peoplemind-mcp#1.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/mail-mind-mcp#78
No description provided.