retention: compose the audit detail in the store with the real body count

RetainWithAudit now takes only the actor; the store builds the detail after
body clearing so bodies_cleared is a real number, and still writes the row
before the cap.
This commit is contained in:
Builder
2026-10-13 10:44:01 +11:00
parent d8788ef8e7
commit 453d8a2dc9
3 changed files with 16 additions and 11 deletions

View File

@@ -130,7 +130,7 @@ func TestRetainWithAuditCountsItsOwnRow(t *testing.T) {
}
}
res, err := s.RetainWithAudit(ctx, RetentionPolicy{ActionsLogMaxRows: 3}, "scheduler", "bodies_cleared=0")
res, err := s.RetainWithAudit(ctx, RetentionPolicy{ActionsLogMaxRows: 3}, "scheduler")
if err != nil {
t.Fatalf("RetainWithAudit() error = %v", err)
}