Skip to main content

Dispatch flow

Dispatch turns a queued idea into a worker run. Treat it as a guarded operation, not a raw script call.

1. Check health and status

curl -fsS "$ENOCH_BASE_URL/healthz"
curl -fsS -H "Authorization: Bearer $ENOCH_CONTROL_TOKEN" \
  "$ENOCH_BASE_URL/control/api/status" | python3 -m json.tool
Review dispatch_safe and dispatch_blockers before proceeding. The operator dashboard UI is at http://<control-vm>:8787/control/dashboard. The shorter /dashboard URL redirects to the same shell on current deployments. Current operator overview showing attention, running work, paper-writing, and publish/import cards Use the dashboard as a fast visual check, but trust the API response as the source of truth for automation.

2. Check queue health

curl -fsS -H "Authorization: Bearer $ENOCH_CONTROL_TOKEN" \
  "$ENOCH_BASE_URL/control/api/queue-health" | python3 -m json.tool

3. Verify worker preflight

curl -fsS -H "Authorization: Bearer $ENOCH_CONTROL_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"wake_gate_url":"http://<worker>:8787","bearer_token":"<worker-token>","require_paused":false,"strict":false}' \
  "$ENOCH_BASE_URL/control/api/preflight" | python3 -m json.tool

4. Dry-run dispatch

curl -fsS -H "Authorization: Bearer $ENOCH_CONTROL_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"dry_run":true,"requested_by":"operator"}' \
  "$ENOCH_BASE_URL/control/dispatch-next" | python3 -m json.tool
Dry run should be your default for new config, new worker hosts, and post-upgrade checks.

5. Live dispatch

Only after status, queue health, and preflight are understood should you send a non-dry-run dispatch request. Confirm live_dispatch_enabled and dispatch_script_path are intentionally configured.
curl -fsS -H "Authorization: Bearer $ENOCH_CONTROL_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"dry_run":false,"requested_by":"operator"}' \
  "$ENOCH_BASE_URL/control/dispatch-next" | python3 -m json.tool

What the control plane checks

The queue tabs show the same read model from different operator angles. Empty active and queued views are useful during smoke testing because they prove the dashboard can read canonical queue state without launching work. Current active queue tab showing bounded active-work rows Current queued queue tab showing bounded ready-queue rows The control plane checks that a queue item exists, pause and maintenance flags allow work, no conflicting active lane exists, worker preflight passes, and the dispatch script can be launched for live dispatch.