Copy triage and vectors across accounts by the #59 collapse key #86
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split from #59 (item 4 of its triage rulings, 2026-11-01).
Filed under: operator word "accept four leanings on #59" sha256:c22f5f83e0ab
The assessor and the embedder copy a result to a row with the same Message-ID inside one account, so Jev is not asked twice and the model does not run twice. A copy in a second account of the same instance is assessed and embedded again: one Jev call and one model run per extra account.
Proposal
Acceptance
Blocked by
Agent Brief
Category: enhancement
Summary: Copy the triage result, the vector and the attachment text to every copy of a message, in any account, by the #59 collapse key, and by that key only.
Blocked by: #59. It defines the collapse key. Build on its single definition; do not write a second one.
Operator rulings (2026-11-01). Where this brief differs from the issue body, the brief holds.
Already decided, so no work is needed:
Current behavior:
Store.copy_assessments(account)gives an unassessed row the class and score of an assessed row with the same Message-ID in the same account.Store.copy_embeddings(account, model=...)gives a row with no vector the vector of a row with the same Message-ID in the same account.Desired behavior:
apiprocess writes nothing new.Key interfaces:
Store.copy_assessments,Store.copy_embeddingsand the attachment-text copy: the match changes from Message-ID in one account to the collapse key in any account. Theaccountargument names the rows that receive a copy, not the rows that give one.Acceptance criteria:
Out of scope:
⏸ SVD architect gate: dev/imap-mailmind-mcp#86 copy-triage-and-vectors-across-accounts-by-the-59-collapse-k
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
standard· dispatch effortmediumRun:
20261101T074016Z-c97d10e9Held because: CLEAN but 4 open risk(s) (3 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
make test-stalwart; tests/integration/test_stalwart.py::test_a_switch_from_imap_keeps_the_class must pass unchanged. This proves the IMAP Date header and the JMAP sentAt give the same datetime() instant and the Froms match, so the tightened _finish_switch still keeps classes. It needs the Stalwart container, so it cannot run in a worktree. [verification]af0898c, before the first edit, runmake checkand record the failure set. After the change, the set must be identical, the only new tests are in tests/test_cross_account_copies.py, and the only edited tests are the three named in the lean. [verification]Change: Reuse #59's collapse-key fragment _same_message(row, copy) (store.py:352-359) verbatim in all four Message-ID-only copy paths, with the target in the row slot and the source in the copy slot. The paths are copy_assessments (store.py:791-803; keep the IN prefilter minus account, add an EXISTS key test, ORDER BY s.id LIMIT 1), copy_embeddings (store.py:828-841; only the JOIN clause changes, MIN(e.vec) stays), copy_attachment_texts (store.py:869-886; keep s.attachments = m.attachments and MIN(s.id)), and _adopt_attachment_text (store.py:676-690; self-join on the inserted target row t). Remove the account restriction on the source side only;
accountstill names the receiving rows. Mirror #59's f-string-plus-fragment SQL style with noqa S608 (store.py:1288/1337/1422). Callers (assess.py:245, embed.py:135/147, source.py:233, jmap.py:638-639) are unchanged. Update only the jmap._finish_switch docstring. Amend four ADR sentences (0003:17, 0005:29, 0006:13/28, 0007:62) in the house 'Amended (#86):' form. Add tests/test_cross_account_copies.py reusing the test_copies, test_assess, test_embed and test_attachments helpers. Fix the three existing tests whose 'moved copy' differs in Date or From (test_attachments x2, test_jmap switch).Files:
src/imap_mailmind_mcp/store.py·src/imap_mailmind_mcp/jmap.py·tests/test_cross_account_copies.py·tests/test_attachments.py·tests/test_jmap.py·docs/adr/0003-data-boundaries-for-external-judgement.md·docs/adr/0005-local-embeddings.md·docs/adr/0006-pluggable-mail-sources.md·docs/adr/0007-attachment-text.mdDecision: accept the 4 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-copy-triage-and-vectors-across-accounts-by-the-59-collapse-k.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-copy-triage-and-vectors-across-accounts-by-the-59-collapse-k.mdspec-verify-dispatch Half B for dev/imap-mailmind-mcp#86 copy-triage-and-vectors-across-accounts-by-the-59-collapse-k completed integration verify.
ba5a5a16eeba5a5a1. The PR head has no remote CI statuses. Local make check passed: 351 passed, 4 skipped. The focused suite passed: 160 passed, 3 skipped.ba5a5a1has no commit statuses on git.groupthink.asia. The CLAUDE.md states the architect adds .woodpecker CI files, and none exist in the tree. — reported as absent, not blocking (gh#633)codex-svd ship --run-id 20261101T075025Z-4ed83bcd --confirm-merge)