Repository navigation
Open
Labels
area:appcore, ports, adapters, HTTP
Description
Context
#59 (the daily hard delete, F-D10, D-001) deletes, at 00:00 UTC, work items that were deleted for longer than THRUST_HARD_DELETE_AFTER_DAYS (30) with their join rows, history and attachment blobs, and dispatched outbox rows older than THRUST_OUTBOX_RETENTION_DAYS (90). It was scoped to those two by the owner on 2026-11-18 (the plan for #59, and ADR-0043's issue #59 update).
projects, states, labels and assets also carry deleted_at and nothing ever deletes them for good, so they keep growing the way work items did before #59.
What is known
- Every foreign key in the schema is
NO ACTION, so a row cannot be deleted while another row names it: the order is children first, and a parent waits for its children (as a work item waits for a child that is not old, in feat(jobs): daily hard-delete retention cleanup (F-D10, 30-day default per D-001) #59). project_sequencesis never touched by the work-item purge (ADR-0043 B1: a purged number is not handed out again). A purged project is a different case.- Attachments are blobs under
<workspace>/<project>/<work item>/, deleted before the row they belong to (run_retention). - The job is
run_retention(crates/core/usecases/src/retention.rs), the schedule is incrates/core/usecases/src/schedules.rs, and the database half ispurgeable_*/purge_*onDatabase(crates/core/ports/src/lib.rs), memory and Postgres.
To decide (these are questions, not decisions)
- The rule per table. The same strict
deleted_at < now - windowas for work items, with one window, or one per table? - A deleted label or state that something live still names. A
work_item_labelsrow or a work item'sstate_idwould block the delete. Delete the join rows with the label (and what happens to a work item whose state was deleted), or wait until nothing names it, as a parent waits for a child? - A purged project. What goes with it: its members, states, labels, work items (all of them, deleted or not?), attachments (the blobs under
<workspace>/<project>/), and itsproject_sequencesrow. Is the counter deleted with the project (a project id is not reused), or kept? - Identifiers. Does a purged project's identifier (and a label's or state's name) become free to use again? What the unique indexes say today decides this; check before choosing.
- Assets. An asset's blob goes before its row, as an attachment's does; which other rows name an asset?
Acceptance
- The shape of feat(jobs): daily hard-delete retention cleanup (F-D10, 30-day default per D-001) #59's tests for each table: a use-case matrix of 31 days, 30 days + 1 s, 30 days and 29 days in both tenants, a property over any window and deletion ages, the adapters' own rule tests (memory and Postgres), the contract test in the
sweeperpass on all four targets, and a mutation control per rule inscripts/mutants.sh. - Any deviation from Plane recorded in
DEVIATIONS.md, as D-043 was. docs/src/testing/status.mdG-50's "not purged" item closed.
Not in scope
API logs, email logs and webhook logs: F-D10 names them, and there are no such tables yet.
Metadata
Metadata
Assignees
Labels
area:appcore, ports, adapters, HTTP
Activity
docs: name the follow-up issue, #348, in G-50 and ADR-0043 (#349)