Archived tasks leave orphaned child rows #1859

Closed
opened 2026-11-10 15:26:30 +00:00 by sam · 1 comment
Owner

Archiving a task deletes its row from the task table but leaves its events, transitions, step executions and model usage behind, with no parent row to join and nothing that prunes them. On the live instance 22 archived tasks left 1,140 events, 130 transitions, 420 step executions and 231 model usage rows unreachable.

Wanted: decide and implement the retention rule — prune a task's child rows with the archive after an audit window, or keep them deliberately (and make them visible through the audit feed) — and say which in the archived-task record.

Done when: archiving either removes or accounts for every child row, and a query can tell what happened to an archived task.

Archiving a task deletes its row from the task table but leaves its events, transitions, step executions and model usage behind, with no parent row to join and nothing that prunes them. On the live instance 22 archived tasks left 1,140 events, 130 transitions, 420 step executions and 231 model usage rows unreachable. Wanted: decide and implement the retention rule — prune a task's child rows with the archive after an audit window, or keep them deliberately (and make them visible through the audit feed) — and say which in the archived-task record. Done when: archiving either removes or accounts for every child row, and a query can tell what happened to an archived task.
Author
Owner

Already resolved by c155bb24 on main: archiving deliberately keeps a task's child rows (transitions, step executions, model usage, tool calls, dispatch ledger), and the archive event, which audit retention never prunes and the audit feed shows, records that rule in its data (retention: kept, the child sets, events governed by audit_retention). That satisfies the issue's 'keep deliberately and say which in the archived-task record' branch. No further code change; nothing was run for this close beyond confirming the commit is an ancestor of origin/main.

Already resolved by c155bb24 on main: archiving deliberately keeps a task's child rows (transitions, step executions, model usage, tool calls, dispatch ledger), and the archive event, which audit retention never prunes and the audit feed shows, records that rule in its data (retention: kept, the child sets, events governed by audit_retention). That satisfies the issue's 'keep deliberately and say which in the archived-task record' branch. No further code change; nothing was run for this close beyond confirming the commit is an ancestor of origin/main.
sam closed this issue 2026-11-13 16:45:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1859