Repository navigation
feat(sessions): split deleted archive retention - #140793
jjjhenriksen wants to merge 6 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds an independent deleted-transcript archive retention setting and applies it across session cleanup paths. Example: An operator wants deleted archives retained for 3 days and reset archives for 14 days.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep open: this assigned PR proposes independent retention controls that current main does not provide, and maintainer engagement prevents stale cleanup. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherSession maintenance resolves configuration into archive-expiry rules, then removes eligible archive files and their SQLite recovery records. flowchart TD
A[Session configuration] --> B[Retention rule resolver]
B --> C[Session maintenance]
B --> D[Cron reaper]
C --> E[Archive cleanup]
D --> E
E --> F[Archive files]
E --> G[SQLite recovery rows]
Technical reviewBest possible solution: If approved, implement the independent cutoff in current main's existing archive owner while preserving inherited settings and fencing every deletion. Do we have a high-confidence way to reproduce the issue? Source establishes the stale-owner deletion interleaving: database closure during an awaited scan invalidates the caller, but filesystem removal still proceeds; no target code was executed. Is this the best way to solve the issue? Separate cutoffs are coherent, but the smallest current implementation extends the existing archive-maintenance owner rather than adding expiry to ordinary entry maintenance. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8873aeb433fd. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +121, Tests +291, Docs +4, Generated 0, Other +1. Total +417 across 24 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (12 earlier review cycles; latest 8 shown)
Reviewed November 1, 2026, 6:13 PM ET / 23:13 UTC (Revision 13). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9003d3fd12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
ff37eda to
0099a58
Compare
2697fc7 to
26beee6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer-readiness follow-up: the implementation findings are addressed, but the remaining gate is upgrade safety for the retention contract. The missing proof is a pre-change store upgraded in place, plus explicit-false behavior and recovery after a failed file removal; the cleanup-boundary/config-compatibility decision also needs maintainer acceptance. I’ll target those exact cases on the next update, then request a fresh ClawSweeper review on the resulting head. |
|
Exact-head integration proof pushed at The SQLite/file integration now gives deleted and reset archives the same one-day age, applies independent cutoffs (
The targeted retention set also proves explicit disablement remains disabled and a canonical row is retained while its derived file still exists (the failed/not-yet-completed removal case). Validation: 3 files, 13 tests passed. This supplies behavior evidence only; it does not substitute for the requested maintainer decision on the retention contract/deletion timing. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Author-requested withdrawal — November 4, 2026
Jacqueline Henriksen (@jjjhenriksen) explicitly requested closure of this proposal after reassessing its current value. A separate deleted-archive retention policy is not currently justified by a concrete requirement, and carrying the additional public configuration and cleanup behavior forward is not worth the integration and maintenance cost.
This is a withdrawal for insufficient current need—not a claim that the feature is already implemented, that age alone invalidates it, or that the reported cleanup-safety concerns have been resolved. The discussion and implementation remain useful context if a concrete independent-retention requirement arises later.
The original proposal and evidence below are preserved for provenance.
What Problem This Solves
session.maintenance.resetArchiveRetentionpreviously applied the same age cutoff to both reset and deleted transcript archives. This addssession.maintenance.deletedArchiveRetentionas an independent duration-or-falsecontrol.When omitted,
deletedArchiveRetentioninheritsresetArchiveRetentionfor backward compatibility. An explicit duration orfalseoverrides it independently. Both settings age archive artifacts; they do not age retained SQLite reset history or transcript rows.Implementation
Evidence
5460eaf7b0ab2221938f1b7a4dbfc052e69d9588.git diff --checkpassed.pnpm exec vitest run src/config/sessions/session-accessor.sqlite-retention.integration.test.ts src/config/sessions/session-accessor.sqlite-maintenance-writer.test.ts src/config/sessions/store.pruning.archive-retention.test.ts src/config/sessions/cleanup-service.fix-missing.test.ts --reporter=verboseResult: 4 test files passed, 22 tests passed.
configuredFreshStore: true);configuredExistingStore: true);deletedArchiveFile: false,deletedArchiveRow: false—falsehere means absent);resetArchiveFile: true).falsedisablement, ordinary SQLite archive cleanup with no session removals, maintenance-owner invalidation without reopening the store, file-before-row deletion ordering, and lifecycle-deletion failure recovery.Known Gate
This change affects persistent retention and upgrade behavior. Maintainer acceptance of the independent retention contract, ordinary-maintenance deletion timing, and the accessor cleanup boundary remains required before merge.
Worked on by