Forget: stop a failed legacy-text pass restoring a forgotten address to the checkpoint #59

Closed
opened 2026-11-03 22:35:39 +00:00 by piers · 3 comments
Owner

Outcome

After Forget, a failed legacy-text pass cannot write a forgotten address back into the legacy pending checkpoint.

Context

The #54 architect gate (2026-11-04) deferred this race out of #54 (Open Risk 2 of its spec). #54 makes Forget purge forgotten addresses from the legacy checkpoint in source_state (ADR 0003 Amendment 1, rule 4). The race can still reintroduce one:

  1. A legacy-text pass starts its fetch.
  2. Forget commits and purges the address from source_state.
  3. The fetch fails. run_pass writes the in-memory source.state back, and its pending still holds the forgotten address (sync.py:114-121 at 511e7ce).
  4. The address stays in the checkpoint until the next successful pass resets it to {"cursor": ...} (sources/mailmind.py:264).

Ingest still skips the address as tombstoned, so this is a physical-erasure gap, not a logical-absence gap. No production code calls Forget until the people_forget mount (Phase B, gated by #55).

Scope

Make the fetch-failure checkpoint write in run_pass drop any pending address that matches a Tombstone before it writes source_state. Add a test that runs a Forget between fetch start and fetch failure and asserts the address is absent from the decoded checkpoint.

Decision

Fix it before the people_forget mount (operator, triage 2026-11-04). Forget's stated guarantee is physical erasure, and this is a known gap in it. At b698c2e the fetch-failure write is sync.py:111-121; #54 left it unchanged by design.

Blocked by

Filed under: operator word "ruling leans accepted" sha256:74398dc59a44 (#52 #53 #54 gate)

## Outcome After Forget, a failed `legacy-text` pass cannot write a forgotten address back into the legacy pending checkpoint. ## Context The #54 architect gate (2026-11-04) deferred this race out of #54 (Open Risk 2 of its spec). #54 makes Forget purge forgotten addresses from the legacy checkpoint in `source_state` (ADR 0003 Amendment 1, rule 4). The race can still reintroduce one: 1. A `legacy-text` pass starts its fetch. 2. Forget commits and purges the address from `source_state`. 3. The fetch fails. `run_pass` writes the in-memory `source.state` back, and its `pending` still holds the forgotten address (`sync.py:114-121` at `511e7ce`). 4. The address stays in the checkpoint until the next successful pass resets it to `{"cursor": ...}` (`sources/mailmind.py:264`). Ingest still skips the address as tombstoned, so this is a physical-erasure gap, not a logical-absence gap. No production code calls Forget until the `people_forget` mount (Phase B, gated by #55). ## Scope Make the fetch-failure checkpoint write in `run_pass` drop any `pending` address that matches a Tombstone before it writes `source_state`. Add a test that runs a Forget between fetch start and fetch failure and asserts the address is absent from the decoded checkpoint. ## Decision Fix it before the `people_forget` mount (operator, triage 2026-11-04). Forget's stated guarantee is physical erasure, and this is a known gap in it. At `b698c2e` the fetch-failure write is `sync.py:111-121`; #54 left it unchanged by design. ## Blocked by - dev/people-mind-mcp#54 Filed under: operator word "ruling leans accepted" sha256:74398dc59a44 (#52 #53 #54 gate)
Collaborator

This was generated by AI during triage.

Agent brief

Category: bug. State: ready-for-agent (CONV-40 rule 2: one source file plus one test).

Verified at b698c2e: on a fetch failure, run_pass writes the in-memory source.state back to source_state (sync.py:111-121). #54 (PR #63) added the Forget-side purge and left this path unchanged by design, so the race in the body still holds.

Decision (operator): fix it before the people_forget mount. The body's ## Scope is the contract. Its blocker #54 is closed.

Out of scope: restore-safe Tombstones (#55); any change to Forget itself.

> *This was generated by AI during triage.* ## Agent brief **Category:** bug. **State:** ready-for-agent (CONV-40 rule 2: one source file plus one test). **Verified at `b698c2e`:** on a fetch failure, `run_pass` writes the in-memory `source.state` back to `source_state` (`sync.py:111-121`). #54 (PR #63) added the Forget-side purge and left this path unchanged by design, so the race in the body still holds. **Decision (operator):** fix it before the `people_forget` mount. The body's `## Scope` is the contract. Its blocker #54 is closed. **Out of scope:** restore-safe Tombstones (#55); any change to Forget itself.
Collaborator

✅ SVD architect gate: dev/people-mind-mcp#59 forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten

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 effort medium

Run: 20261104T035302Z-8077356f

Change: In run_pass's fetch-failure branch (sync.py:110-121), keep the existing five-clause guard unchanged, including source.state != loaded_state on the unfiltered state. Inside the existing BEGIN IMMEDIATE with transaction(conn): block (sync.py:112), write encode_state(_drop_forgotten_pending(conn, source.state, salt)) instead of encode_state(source.state). The new helper sits beside encode_state/decode_state (sync.py:57-65). It returns a new dict whose pending drops every address with a Tombstone, using the _mail_allowed idiom (sync.py:152-158: graph.FIND_TOMBSTONE + tombstone_hash(salt, normalise_email(address))) and the _purge_legacy_pending comprehension shape (graph.py:394-405). It keeps cursor/full, and an emptied pending stays {}. Leave source.state in memory, the success write (:99), graph.py, mailmind.py and the Mail peer v1 path untouched. Add one test in tests/test_mailmind.py after :226. It runs Forget on a separate open_writer(cfg.store.path) connection from FakeMail.on_request on the first mail_evidence request, then sets fake.refusal='tool' to fail the fetch. It asserts the decoded checkpoint and the raw zlib bytes lack the forgotten address, while a second address (zoe@gmail.com) is kept. An optional resume proof shows the forgotten address is never queried.

Files: src/people_mind_mcp/sync.py · tests/test_mailmind.py

Decision: dispatch this spec (svd:go)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten.md

### ✅ SVD architect gate: dev/people-mind-mcp#59 forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten **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 effort `medium` **Run:** `20261104T035302Z-8077356f` **Change:** In run_pass's fetch-failure branch (sync.py:110-121), keep the existing five-clause guard unchanged, including source.state != loaded_state on the unfiltered state. Inside the existing BEGIN IMMEDIATE `with transaction(conn):` block (sync.py:112), write encode_state(_drop_forgotten_pending(conn, source.state, salt)) instead of encode_state(source.state). The new helper sits beside encode_state/decode_state (sync.py:57-65). It returns a new dict whose `pending` drops every address with a Tombstone, using the _mail_allowed idiom (sync.py:152-158: graph.FIND_TOMBSTONE + tombstone_hash(salt, normalise_email(address))) and the _purge_legacy_pending comprehension shape (graph.py:394-405). It keeps cursor/full, and an emptied pending stays {}. Leave source.state in memory, the success write (:99), graph.py, mailmind.py and the Mail peer v1 path untouched. Add one test in tests/test_mailmind.py after :226. It runs Forget on a separate open_writer(cfg.store.path) connection from FakeMail.on_request on the first mail_evidence request, then sets fake.refusal='tool' to fail the fetch. It asserts the decoded checkpoint and the raw zlib bytes lack the forgotten address, while a second address (zoe@gmail.com) is kept. An optional resume proof shows the forgotten address is never queried. **Files:** `src/people_mind_mcp/sync.py` · `tests/test_mailmind.py` **Decision:** dispatch this spec (`svd:go`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#59 forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten completed integration verify.

  • PR: #65
  • Branch: feat/svd-dev-people-mind-mcp-59-forget-stop-a-failed-legacy-t-d489b029
  • Commit: 503ecd1532
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/73/pipeline/28/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Remote check ci/woodpecker/pr/validation was still pending when this lens returned; the runner should re-poll.
  • Warning: The PR body Co-Authored-By line names gpt-6.1-sol, not the attribution line the session specifies. Non-blocking.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261104T041019Z-d489b029 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#59 forget-stop-a-failed-legacy-text-pass-restoring-a-forgotten completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/65 - Branch: feat/svd-dev-people-mind-mcp-59-forget-stop-a-failed-legacy-t-d489b029 - Commit: 503ecd1532ff002cb3cea677fef4490aa57c386a - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/73/pipeline/28/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Remote check ci/woodpecker/pr/validation was still pending when this lens returned; the runner should re-poll. - Warning: The PR body Co-Authored-By line names gpt-6.1-sol, not the attribution line the session specifies. Non-blocking. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261104T041019Z-d489b029 --confirm-merge`)
svc-svd-writer 2026-11-04 04:59:51 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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/people-mind-mcp#59
No description provided.