feat: configurable audio & transcript retention (#119) #201
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/119-retention"
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?
Closes #119. Second issue of v3.8.0 Privacy & Data Lifecycle.
Makes retention explicit + configurable (instance defaults + per-campaign overrides) instead of the implicit "keep audio until GM approval, transcripts forever." Recommended posture: transcript-only (delete raw audio after processing).
Backend (
f31d7f8)audio_retention_policy {mode: delete_after_processing|retain_days|retain_indefinitely, days}(default delete_after_processing/7) +transcript_retention_policy {mode: retain_indefinitely|retain_months, months}(default indefinitely).get_effective_retentionresolves per-field — campaign override wins, null inherits.f1a2b3c4d5e6(round-trips).GET/PUT /admin/settings/retention.apply_post_processing_audio_retentiondeletes the WAV dir at the end of a successfulprocess_audiounderdelete_after_processing(→ terminalapproved); defensive — a delete error never fails the pipeline; the failure path keeps audio for debugging.enforce_retentionBeat task (generalizescleanup_trashed_audio): anchors audio deletion ontranscript_updated_at(processing-complete) regardless of approval state — fixes unapproved sessions hoarding audio forever;retain_monthsclearstranscript(FTS auto-clears) + purgesLoreExtractCache(summaries untouched). One idempotentretention.enforcedaudit entry per run that deleted anything.Frontend (
<head>)delete_after_processingwarning).Tests
test_retention.py) — delete_after_processing, never-approvedretain_days, transcript+FTS+cache expiry, idempotency, override resolution. Full suite 550 pass; migration round-trip verified.Notes
bot/changes → no contract concern.log_eventfrom #120.🤖 Generated with Claude Code
Makes retention explicit and configurable — instance defaults + per-campaign overrides — instead of the implicit "keep audio until GM approval, transcripts forever" behavior. Recommended posture: transcript-only (delete raw audio after processing). - Settings (settings_service): audio_retention_policy {mode: delete_after_ processing|retain_days|retain_indefinitely, days} (default delete_after_ processing/7) + transcript_retention_policy {mode: retain_indefinitely| retain_months, months} (default indefinitely). get_effective_retention resolves per-field: campaign override wins, null inherits instance default. - Campaign gains 4 nullable override columns; migration f1a2b3c4d5e6 (round-trips). GET/PUT /admin/settings/retention for instance defaults. - Pipeline: apply_post_processing_audio_retention deletes the WAV dir at the end of a successful process_audio when delete_after_processing (→ terminal approved state); defensive (never fails the pipeline); failure path keeps audio for debugging. - enforce_retention Beat task (generalizes cleanup_trashed_audio, daily): anchors audio deletion on transcript_updated_at (processing-complete) REGARDLESS of approval state — fixes unapproved sessions hoarding audio forever; retain_months clears transcript (FTS auto-clears) + purges LoreExtractCache (summaries untouched). One retention.enforced audit entry per run that deleted anything; idempotent/state-driven. - README: privacy/data-retention section. Tests: +9 (test_retention.py) — delete_after_processing, never-approved retain_days, transcript+FTS+cache expiry, idempotency, override resolution, schema round-trip. Full suite 550 pass; migration round-trip verified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>