- worker: commands run with spawn in their own process group (same
timeout, 10 MB output limit and result fields as exec). A new
cancel_command message (by command_id, or every command of an
execution) sends SIGTERM to the group, then SIGKILL after 5 s; the
result reports cancelled: true. Old workers ignore the message.
- server: the abort route sends cancel_command to the worker running each
of the execution's commands.
- Tests: the whole process tree dies on cancel (a background child too),
execution-wide cancel leaves other executions alone, and end to end an
aborted quick command's process is gone from the worker. Liveness
checks treat zombies as dead (an orphan waits to be reaped).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The worker reports its commit (VERSION file, or git rev-parse in a
checkout) in worker_connect and heartbeat metadata. The server keeps it
per live socket and /healthz lists worker_versions.
- deploy/pulse_worker_deploy.sh <sha> <ts>, for the webhook on a worker
host: replay and age checks, commit must be on main, installs worker.js
and the npm manifests from exactly that commit, writes VERSION, npm ci,
restarts, waits until /healthz lists the sha, else restores the
previous files. Sandbox tests cover deploy, replay, stale and malformed
input, off-main commits, no-op redeploys and rollback.
- New CI job Deploy worker after Deploy: only when worker/ or the npm
manifests changed since the commit the workers report, so unrelated
merges don't restart the worker; then waits for the worker to reconnect
on the new commit.
- README: Worker deploys (install, hook definition, adding a worker host).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- worker/worker.js exports PulseWorker and starts only when run directly
(no behaviour change for the service; CT 153 needs no redeploy).
- tests/worker.test.js: success, exit code and stderr, timeout kill,
capacity rejection, slot release after failure, ping/pong, no sends
while disconnected.
- jest coverage floors (ratchet at today's levels): lib/ 90% lines and
statements, 80% branches and functions; worker/ 40%.
- The audit job writes a CycloneDX SBOM of production dependencies and
keeps it 90 days for each main build.
Part of #45 phases 3 and 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>