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.

Automatic rebuild requests: page requests and deploys hand read-model rebuilds to the queue through AutomaticReadModelRebuild (source unavailable), with reasons read_model_stale and read_model_schema; repeat requests reuse one task, and a detached worker starts only when cron is not running and FORUM_TASK_QUEUE_EMERGENCY_LAUNCH_ENABLED is set.

Workers without cron: ./v3 start runs a one-task worker every 5 seconds through DevServerWorker (source unavailable) (--no-worker turns it off). Tools → Import and the local start page start one detached worker for their own request with DetachedTaskQueueLauncher::launchForOperator() (source unavailable) unless a worker is running at that moment; that entry is not gated by the emergency variable. A fresh heartbeat does not stop the launch, because it may come from a one-task worker that has already exited. Tests run against a per-run queue (tests/run.php), never the checkout's own.

Task types: read-model rebuild, retraction sweep, Fastmod sweep, local meta training and local score sweep (train and apply the local meta model; no provider), offline snapshot, agent reply, Railspike assessment, application update and push notices (push_notify: sends waiting DM and reply notices, requeued while follow-ups are held; see push subscription). 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).