Repository source: docs/concepts/internal_task_queue.md
Internal task queue
Purpose: Run allowlisted maintenance work outside visitor requests, one task at a time, with deduplication and visible status.
Scenario: A retraction enqueues a cleanup sweep and a reader's agent-reply request enqueues a reply; an operator then queues a deploy. At the next cron minute the worker claims the deploy first (deploys go ahead of other queued work), runs it and marks it completed; the sweep and the reply follow on later runs in the order they were queued. Asking for the same work again while it is still queued returns the existing task instead of adding another. Each worker run records a heartbeat, which status pages use to warn when cron has stopped.
Sources: store, task types and claim order (source unavailable) (enqueue(), claimNext(), executorHeartbeatStatus()), worker (source unavailable), CLI and cron line (source unavailable), operator guide.
Task types: read-model rebuild, retraction sweep, Fastmod sweep, offline snapshot, agent reply, Railspike assessment and application update. The queue stores no per-task payload; work that needs one keeps it beside the queue (the deploy requester is in state/app_update_queued.txt).