Deletion, Reconcile, Forget and Rebuild #13
Labels
No labels
boundary:crosses
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/messages-mind-mcp#13
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?
Parent: #6. Records: ADR 0005 (
docs/adr/0005-chat-selection-and-redaction.md), ADR 0006 (docs/adr/0006-retention-deletion-and-forget.md), ADR 0007 (docs/adr/0007-store-encryption-and-backup.md).What to build
Everything that removes a row from the Mirror, and the Rebuild that follows a lost volume.
syncreads the deletion records by deletion time. The row leaves the Mirror and the event log carries its removal.syncreads the deletion records that are still present and the all-time count. When the count has moved further than those records explain,syncruns Reconcile at once.Acceptance criteria
Blocked by
Filed under: operator word "go" sha256:4cd0e21a9a07
messages-people/1.0with the evidence scope #16One correction and five facts from the architect gate of
#12(2026-11-13). They bind this slice. The facts describe the approved spec of#12; check each against the merged code before this slice starts.Correction. A comment on
#12said that the hard-deletion hash match binds#12. That was wrong.#12builds no removal. Two duties from "Whatsyncmust do" incontracts/feeder-v1/README.mdbelong to this slice:guidthat the Mirror holds.What
#12leaves for this slice.#12removes no message and no Chat, and it writes nodelevent. Until this slice lands, a message that is deleted on the Source stays in the Mirror, and a new deny-list entry removes nothing. The README of#12states this, and this slice removes that statement.#12takes migration 2: a reply target, anattachmentstable and the action of a Tapback. A schema change in this slice is migration 3. The Mirror holds no column and no index for the hash of aguid, so the hash match needs one or a scan.#12skips a row that matches a Tombstone, in the one function that writes a row. Reconcile and Rebuild must write through that function.0.1.0. A Tapback that leaves the Mirror therefore writes no event either.Two items from the review of pull request #30 (the sync worker of #12). Neither blocks #12. Both belong with the work of this slice.
1. A row id that the Mirror holds under another guid.
messages.source_rowidandtapbacks.source_rowidareUNIQUE.apply_rowinsrc/messages_mind_mcp/sync.pyinserts a new guid with no rule for a conflict on the row id. When the Feeder offers a row whose row id the Mirror holds under another guid, the insert fails and the page rolls back. The pass ends withstore-unavailable, and each later pass fails in the same way.newest_row_idis not lower than the held position. Thesource-replacedtest comparesnewest_row_idonly.store-unavailablenames the wrong cause, and it is not a stop code, so the loop tries again without end.This slice decides what a replaced Source means, because it owns Reconcile and Rebuild. At the least, this condition needs a code that names the cause, that code must be a stop code, and a test must cover it.
2. The Tapback view tests use one sender. The five Tapback sequences in
tests/test_sync.pyall come from the Owner. Add two cases when this slice edits that file:removefrom one sender leaves the Tapback of another sender on the same message;⏸ SVD architect gate: dev/messages-mind-mcp#13 deletion-reconcile-forget-and-rebuild
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
substrate· dispatch efforthighRun:
20261113T120736Z-7b56ab30Held because: CLEAN but 7 open risk(s) (1 verification · 6 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
sync(not --rebuild) on an empty volume creates an empty Tombstone store and re-mirrors forgotten messages. This spec adds no guard. Question: should sync refuse (e.g. tombstones-not-restored) when the Mirror is absent and tombstone_export_path names an existing file? Lean: yes, in a follow-up slice. [decision]messagesmind sync --reconcilewith a large Chat removed from the deny list, and confirm the pass ends within poll_seconds. Otherwise raise a contract issue for a batched fetch, because the contract fixes limit=1. [verification]Change: 1. Add three reads to the Source seam (source.py:25-30): recent_deletions, hard_deletions and reconcile. Each follows FeederSource.changed (source.py:101-102) and goes through _smaller.
2. Funnel every removal through one sync.remove_row(conn, guid). For a message it writes one events row (kind 'del', message_id, chat_id), in the shape of sync.py:154-157, then deletes the message. The FTS, Tapback and attachment cleanup comes from the existing triggers and cascades. A Tapback is deleted with no event.
3. Extend _run_pass (sync.py:171-227) after the changed-rows step:
messagesmind forget m<id>(Verb literal plus a README column);sync --reconcile;sync --rebuild EXPORT, which refuses an existing store, restores the Tombstones, opens a new store (new epoch at store.py:232) and runs passes until backfill_left is 0.Files:
src/messages_mind_mcp/source.py·src/messages_mind_mcp/sync.py·src/messages_mind_mcp/tombstones.py·src/messages_mind_mcp/config.py·src/messages_mind_mcp/startup.py·src/messages_mind_mcp/cli.py·tests/test_sync.py·tests/test_deletion.py·tests/test_config_cli.py·README.md·SECURITY.md·config.example.tomlDecision: accept the 7 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-13-deletion-reconcile-forget-and-rebuild.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-deletion-reconcile-forget-and-rebuild.mdspec-verify-dispatch Half B for dev/messages-mind-mcp#13 deletion-reconcile-forget-and-rebuild completed integration verify.
59d0cf5cb2codex-svd ship --run-id 20261114T210605Z-367d7999 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#13 deletion-reconcile-forget-and-rebuild completed integration verify.
42539fecdecodex-svd ship --run-id 20261114T210605Z-367d7999 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#13 deletion-reconcile-forget-and-rebuild completed integration verify.
42539fecde42539fe: Woodpecker ci/woodpecker/pr/validation green. Local suite 1104 passed, 52 skipped. No blockers.python3 -m pytestlacked tiktoken in the host interpreter; collection and the run useduv runwith the worktree .venv instead.codex-svd ship --run-id 20261114T210605Z-367d7999 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#13 deletion-reconcile-forget-and-rebuild completed integration verify.
f660fbab98python3 -m pyteston PATH lacks tiktoken; collection and tests ran throughuv run, which provisions the project environment.codex-svd ship --run-id 20261114T210605Z-367d7999 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#13 deletion-reconcile-forget-and-rebuild completed integration verify.
c2f08bb1f9codex-svd ship --run-id 20261114T210605Z-367d7999 --confirm-merge)