fix(webapp): each "keep the audio" choice means what it says (#834, A1/D179) #860

Merged
claude-bot merged 3 commits from fix/834-retention-semantics into main 2026-09-26 21:59:45 +00:00
Collaborator

Closes #834. This is the owner's A1 answer (D179).

Behaviour, before and after

Mode Before After
Default (renamed trash_after_processing → trash_after_approval) Binned the moment processing succeeded, before any GM read the summary Binned when the GM approves the summary. Until then it stays, limited only by the instance cap
Keep for N days Approval also binned it early Approval leaves it alone; it's binned N days after transcription
Keep it Approval also binned it ("keep" really meant "until approved") Approval leaves it alone; it's kept until someone removes it
A failed run Its N-day debug window Unchanged: kept for its N-day debug window so it can be retried
Nightly sweep "Already transcribed → goes at once" "Already approved → goes at once"
  • apply_post_processing_audio_retention is now a documented no-op.
  • The old stored values (delete_after_processing, trash_after_processing) are normalised on read. There's no migration; the new name is written on the next save.
  • Privacy page: its audio line switched on a value the server never stored, so it could never match. It's now true.
  • Self-hosters: under the default, audio is now kept until approval, which is longer than before. The CHANGELOG says so.

e2e seed

The J5 fixture's campaign-level override only existed to work around this bug, so it's removed; the default now does what J5 needs. J5 needs its CI run to confirm this.

Tests

  • New: one test per mode and state, plus the sweep, in test_retention.py. Two approval regressions in test_sessions.py (retain_days and retain_indefinitely untouched by approval).
  • Rewritten for the new semantics: the cap and preview tests.
  • Backend targeted: 328 + 100 passed.
  • Frontend: 2,471 passed; eslint has 0 errors.
  • ruff is clean.

It adds no Depends(get_db). It merges cleanly with main, #854 included.

🤖 Generated with Claude Code

Closes #834. This is the owner's A1 answer (D179). ## Behaviour, before and after | Mode | Before | After | |---|---|---| | **Default** (renamed `trash_after_processing` → **`trash_after_approval`**) | Binned the moment processing succeeded, before any GM read the summary | Binned when the GM **approves** the summary. Until then it stays, limited only by the instance cap | | **Keep for N days** | Approval also binned it early | Approval leaves it alone; it's binned N days after transcription | | **Keep it** | Approval also binned it ("keep" really meant "until approved") | Approval leaves it alone; it's kept until someone removes it | | **A failed run** | Its N-day debug window | Unchanged: kept for its N-day debug window so it can be retried | | **Nightly sweep** | "Already transcribed → goes at once" | "Already **approved** → goes at once" | - `apply_post_processing_audio_retention` is now a documented no-op. - The old stored values (`delete_after_processing`, `trash_after_processing`) are normalised on read. There's no migration; the new name is written on the next save. - **Privacy page:** its audio line switched on a value the server never stored, so it could never match. It's now true. - **Self-hosters:** under the default, audio is now kept until approval, which is longer than before. The CHANGELOG says so. ## e2e seed The J5 fixture's campaign-level override only existed to work around this bug, so it's removed; the default now does what J5 needs. **J5 needs its CI run to confirm this.** ## Tests - **New:** one test per mode and state, plus the sweep, in `test_retention.py`. Two approval regressions in `test_sessions.py` (`retain_days` and `retain_indefinitely` untouched by approval). - **Rewritten** for the new semantics: the cap and preview tests. - Backend targeted: 328 + 100 passed. - Frontend: 2,471 passed; eslint has 0 errors. - ruff is clean. It adds no `Depends(get_db)`. It merges cleanly with main, #854 included. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The default mode now bins audio when the GM approves the summary, not the
moment process_audio succeeds — apply_post_processing_audio_retention is a
documented no-op, and the nightly sweep's "already transcribed" catch becomes
"already approved" (Session.content_approved_at). "Keep for N days" and "Keep
it" no longer get overridden by approval: POST /sessions/{id}/approve only
trashes audio under trash_after_approval now, and the review tab's
audio_bin_days only appears when approving would actually bin something. A
failed run keeps its usual debug window regardless of mode.

Renamed the stored mode trash_after_processing -> trash_after_approval, with
delete_after_processing and trash_after_processing both read as legacy
spellings (settings_service, exactly as #427 did). No migration.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The setup wizard, the admin retention form, the campaign override form and
the legacy /manage dropdown all wrote trash_after_processing; the public
Privacy page's own switch-case couldn't match it either, since the backend
was already sending the old spelling. All four now write/match
trash_after_approval, and the copy that claimed audio is binned "once
transcribed" now says "once approved" — true, now that the backend does it.

e2e seed: no campaign override is needed any more to get a `ready` recording
for J5 to review — the instance default already leaves audio ready until
approval. expected_audio_status() always answers `ready` and says why.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
docs(webapp): describe trash_after_approval, and log #834 in the CHANGELOG
All checks were successful
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m56s
CI / Bot tests and audit (pull_request) Successful in 1m54s
CI / Feedback site tests (pull_request) Successful in 47s
CI / Backend lint (ruff) (pull_request) Successful in 1m9s
CI / Bot/backend version sync (pull_request) Successful in 29s
CI / Does this change touch the recording path? (pull_request) Successful in 30s
CI / Docker image build (pull_request) Successful in 1m16s
CI / Backend migration, tests, and audit (pull_request) Successful in 14m6s
CI / Frontend tests, audit, and build (pull_request) Successful in 19m4s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Successful in 13m19s
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Successful in 17m32s
3d25f28b87
API.md's retention-preview docs and two lingering test docstrings still
described the pre-#834 "bins every already-transcribed recording" behaviour.
Also adds the [webapp] Fixed bullet for self-hosters: audio is now kept until
approval, which is longer than before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.