Skip to content

Commit 801839f

Browse files
matjazonlineclaude
andcommitted
State how each retention removal guards its delete, and trim a record's trailing blank line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a534a6a commit 801839f

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎plan/memory-service/implementation-decisions.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,12 +2006,17 @@ an earlier decision here.
20062006
- D9 retention, amended by review MEM-P06-A1-R1 F5 (recorded as asked in A1-R2 F8 (c)). D9 says
20072007
"Identity, revision, level and digest stay for provenance". As implemented, they stay while
20082008
anything references the source:
2009-
- A source whose content was nulled 30 or more days ago, and that no link and no operation
2009+
- A source whose content was nulled more than 30 days ago, and that no link and no operation
20102010
names, is deleted (`remove_unreferenced_sources`,
2011-
`services/memory/src/adapters/postgres/retention.rs:541`).
2012-
- A finished operation that no observation names is deleted with its op-source rows 30 days
2013-
after it finished (`remove_unreferenced_operations`, same file, line 518). Both run from
2014-
`sweep_aged_once` (line 405), each in its own transaction that re-checks its predicate.
2011+
`services/memory/src/adapters/postgres/retention.rs:541`). The candidates are locked
2012+
first, so a save citing one waits, and the delete re-checks the references in a fresh
2013+
snapshot.
2014+
- A finished operation that no observation names is deleted with its op-source rows more
2015+
than 30 days after it finished (`remove_unreferenced_operations`, same file, line 518).
2016+
Its delete relies on the row lock taken with the candidates (`FOR UPDATE SKIP LOCKED`)
2017+
rather than a re-check; an observation names its operation only from that operation's
2018+
own commit, before it finished.
2019+
- Both run from `sweep_aged_once` (line 405), each in its own transaction.
20152020
- Consequences:
20162021
- re-recording a removed revision creates a fresh source row, because revision immutability
20172022
holds only while something references the revision;

‎plan/memory-service/phases/p05/docs/TASK.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,4 +746,3 @@ root-recomputed digests (final 88808f5a…b0a1, tree 7388d1c2). Not integrated (
746746
authorized). Carried into phase 06: B6-F1–F3 (optional), CI execution of the
747747
`memory-integration` job and the browser step, the all-target full suite and Docker checks (06C),
748748
earlier deferred F10/F16, and the 06A items recorded in implementation-decisions.md.
749-

0 commit comments

Comments
 (0)