f7dd0aedab stripped target_message/summary only from mutation receipts whose
result.session_id was a deleted id. A local owner's receipts are keyed by the
logical id, but rewind copies the rewound turn from the PHYSICAL target (a
reset child). Deleting just that child (legacy delete_session / dashboard row)
left the logical owner alive, so its gateway.mutation.v1 rewind receipt still
held the deleted turn and an exact retry returned it.
Retirement now matches a receipt by every session id its result names
(session_id, target_message.session_id, target_session_id,
previous_target_session_id), and also nulls a user-set title (rename/sidebar),
which otherwise outlived a full delete in its receipt.
Raw state.db / -wal bytes still hold the deleted rows until SQLite reuses the
freed pages; main's delete_session behaves the same (secure_delete off, PASSIVE
checkpoints) and that is left as a policy decision.
Review: https://github.com/NousResearch/hermes-agent/pull/106742#issuecomment-6073624820
(cherry picked from commit 0a4b3e550b7f2192d363bf2e5661d51713a052a0)