Settle abandoned query generations and remove old ones
What It Does
The five-minute generation reconciliation schedule invokes the cleanup operation.
The Flow
Invoke reconciliation on the generation function every five minutes. Visit eligible workspaces and fail working generations older than the worker deadline and margin. Remove generation rows beyond thirty-day retention, irrespective of status.
When Something Fails
A missed invocation leaves work for a later scheduled pass. Abandoned rows remain working until a successful pass reaches them. Log the workspace failure for a later pass. Some abandoned outcomes can remain unsettled longer. A later pass retries unfinished cleanup. Old request and outcome text remains retained until cleanup succeeds.
Idempotency and Concurrency
Abandonment uses the same working-status condition as worker settlement. Repeated deletion of already-removed rows has no additional effect. The reconciler uses workspace and time bounds rather than guaranteeing all outstanding rows finish in one invocation. A worker settlement can win the conditional update.