headlesscode campaign serve runs the loopback campaign-control HTTP API and
its dashboard files. The API binds to 127.0.0.1:4391; it does not run campaign
ticks or start RSI work. On MX, scripts/campaign_control_supervisor.py
checks the listener address, process command line, working directory, and API
status before adopting the existing process. If that process exits, it starts
only the installed fixed headlesscode campaign serve command, using bounded
retry delays.
The supervisor uses the existing home-directory registration and control
files. It does not set a model, budget, adapter, credential, or alternate
data-directory environment variable. Campaign data remains under
~/.local/share/headlesscode/campaign-control/. API authentication continues
to follow the existing campaign-control server configuration.
- Node.js and the supported
headlesscodeCLI wrapper are installed. - The dashboard build exists at
~/Projects/capsize-web/apps/fleet-campaign-control/dist, the path selected bycampaign serve. - The user cron daemon is running. The installer adds one marked
@rebootentry and preserves unrelated entries. - Port 4391 is free, or the existing campaign-control API is the process being adopted. Do not start a second instance beside the existing listener.
The installer checks the wrapper and dashboard build before changing cron. It rejects a changed or duplicate managed entry and preserves cron output that it cannot verify as the explicit no-crontab case. It does not inspect or copy process environment values.
The reviewed supervisor was activated on the reference MX workstation on 2026-10-29. Use these commands to install on another authorized target or verify the existing installation.
python3 scripts/manage_campaign_control_supervisor.py install python3 scripts/manage_campaign_control_supervisor.py check
The supervisor checks every ten seconds. Restart delays increase from five
seconds to a five-minute cap. Production waits are interruptible, so rollback
can stop the supervisor promptly during backoff. It uses a private lock, PID
file, and log under
~/.local/state/headlesscode/campaign-control-supervisor/; it does not write
campaign state. If the port belongs to an unrecognized process, it leaves that
listener untouched and does not launch another process. For campaign data, use
headlesscode campaign status --json; do not use campaign tick as a service
health check.
python3 scripts/manage_campaign_control_supervisor.py rollback
Rollback validates the managed cron line before stopping the supervisor or
removing its installed artifact. It removes only its exact marked @reboot
line and stops the supervisor only when its PID matches the fixed launcher. It
does not signal the campaign API or delete registration, control state, job
history, or evidence. If the cron line or installed source was edited, rollback
stops and preserves it for review. Other cron entries are kept.
The managed check last reported the loopback supervisor healthy. An earlier
check found the supervisor stopped even though its @reboot entry remained;
the supported installer restarted the existing managed singleton, and the next
managed check passed. Reboot recovery has not been exercised, so the cron entry
is not evidence of a successful reboot test. The API is a control surface; its
health does not establish that a repository worker is ready or running.
At the latest recorded campaign check, legacy global admission was ON at epoch
20. The separate Curl repository campaign remained disabled and blocked on
prerequisites because workerQualified was false and the private worker registry
was empty. No live CVE worker was runnable or claimed. See
Fleet campaign control for the current distinction
between global admission and repository readiness.
The service check does not verify model access, qualify a worker, enable a repository campaign, run a campaign tick, or test reboot recovery. It does not change repository campaign state or publish CVE catalog content.
Run the focused unit suite through the shared build queue and compile-check the Python modules:
python3 -m py_compile scripts/campaign_control_supervisor.py scripts/manage_campaign_control_supervisor.py scripts/test_campaign_control_supervisor.py
python3 -m unittest discover -s scripts -p 'test_campaign_control_supervisor.py' -vThe tests use temporary state and mocked listeners/processes. They cover exact loopback process identity, unknown-listener refusal, singleton locking, interruptible backoff, bounded restart delay, cron preservation, error handling, rollback validation, and zombie process handling. They do not connect to the campaign API or a provider.