An imported binned page whose days are up gets seven days from the import (#1055) #1059

Merged
claude-bot merged 2 commits from fix/1055-overdue-binned-page-week into main 2026-10-04 00:43:35 +00:00
Collaborator

Closes #1055. The owner's answer to Q142 (D270).

Summary

#1016 puts an imported binned wiki page straight into the bin with the day it was binned. A page whose bin time was already up would go at the next nightly clean-up, perhaps minutes after the import. Now a page that is already overdue at the moment of the import gets seven days from the import. A page with any time left, even one day, keeps its original day.

How it is stored. No migration and no new column: the page gets an adjusted deleted_at, such that deleted_at + grace is the import time plus seven days.

  • The bin's grace is an instance setting (default 30, never under 7), so the stored stamp is never after the import.
  • The stamp is still set in the INSERT, so #1016's "no update after insert" guarantee holds.
  • Only the bin list and the purge read deleted_at as a date, and both add the grace through the same trash_purge_at. The date the bin shows is therefore the date the purge uses.
  • Everything else only tests deleted_at for null. The import records no "deleted" event, so no history shows the original day.
  • One thing it does misstate, and docs/API.md says so: the list's deleted_at for an extended page is not the day it was really binned.

Re-export. The stored stamp travels as it stands. Imported again at once, the page has about seven days left, so it is left alone. The extension does not compound, and no stamp is ever in the future.

Boundary. "Already up" is deleted_at + grace <= import time, the same boundary the purge uses.

Changelog

  • changelog.d/1055-overdue-binned-page-week.changed.md

Test plan

  • Failing first. On the old import, the two new behaviour tests fail.
  • New tests, replacing the one that asserted the behaviour D270 reverses:
    • pages overdue by 200 days, with 20 days left and with 1 day left: the bin list's dates; a purge straight after the import takes nothing; a purge seven days and a minute later takes the overdue page and the 1-day page, and not the 20-day one;
    • the exact boundary;
    • a round trip of an extended page: stamps unchanged, none in the future.
  • tests/export and tests/test_lore_soft_delete.py: 253 passed. test_export_bin.py after the format commit: 28 passed.
  • ruff 0.4.4 format and check: clean. Version sync and changelog checks OK.
  • Not run locally: the full backend suite, bot, frontend. CI runs them.

🤖 Generated with Claude Code

Closes #1055. The owner's answer to Q142 (D270). ## Summary #1016 puts an imported binned wiki page straight into the bin with the day it was binned. A page whose bin time was already up would go at the next nightly clean-up, perhaps minutes after the import. Now a page that is **already overdue at the moment of the import** gets seven days from the import. A page with any time left, even one day, keeps its original day. **How it is stored.** No migration and no new column: the page gets an adjusted `deleted_at`, such that `deleted_at + grace` is the import time plus seven days. - The bin's grace is an instance setting (default 30, never under 7), so the stored stamp is never after the import. - The stamp is still set in the INSERT, so #1016's "no update after insert" guarantee holds. - Only the bin list and the purge read `deleted_at` as a date, and both add the grace through the same `trash_purge_at`. The date the bin shows is therefore the date the purge uses. - Everything else only tests `deleted_at` for null. The import records no "deleted" event, so no history shows the original day. - One thing it does misstate, and `docs/API.md` says so: the list's `deleted_at` for an extended page is not the day it was really binned. **Re-export.** The stored stamp travels as it stands. Imported again at once, the page has about seven days left, so it is left alone. The extension does not compound, and no stamp is ever in the future. **Boundary.** "Already up" is `deleted_at + grace <= import time`, the same boundary the purge uses. ## Changelog - [x] `changelog.d/1055-overdue-binned-page-week.changed.md` ## Test plan - [x] **Failing first.** On the old import, the two new behaviour tests fail. - [x] **New tests**, replacing the one that asserted the behaviour D270 reverses: - pages overdue by 200 days, with 20 days left and with 1 day left: the bin list's dates; a purge straight after the import takes nothing; a purge seven days and a minute later takes the overdue page and the 1-day page, and not the 20-day one; - the exact boundary; - a round trip of an extended page: stamps unchanged, none in the future. - [x] `tests/export` and `tests/test_lore_soft_delete.py`: 253 passed. `test_export_bin.py` after the format commit: 28 passed. - [x] ruff 0.4.4 format and check: clean. Version sync and changelog checks OK. - [ ] Not run locally: the full backend suite, bot, frontend. CI runs them. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ruff format (#1055)
All checks were successful
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m14s
CI / Backend lint (ruff) (pull_request) Successful in 45s
CI / Bot tests and audit (pull_request) Successful in 2m29s
CI / Bot/backend version sync (pull_request) Successful in 39s
CI / Docker image build (pull_request) Successful in 27s
CI / Feedback site tests (pull_request) Successful in 1m4s
CI / Does this change touch the recording path? (pull_request) Successful in 46s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Frontend (shard 1/2) (pull_request) Successful in 12m1s
CI / Frontend (shard 2/2) (pull_request) Successful in 16m34s
CI / End-to-end journeys (phone) (pull_request) Successful in 14m30s
CI / End-to-end journeys (keyboard) (pull_request) Successful in 15m50s
CI / End-to-end journeys (desktop) (pull_request) Successful in 16m27s
CI / Backend migration, tests, and audit (pull_request) Successful in 31m25s
3551757aa2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
claude-bot deleted branch fix/1055-overdue-binned-page-week 2026-10-04 00:43:38 +00:00
Sign in to join this conversation.
No description provided.