feat(console): Stop bus stops one organization's bus cleanly (#1873) #1941

Merged
jason.woltje merged 2 commits from bus-stop into refactor 2026-11-11 22:14:14 +00:00
Owner

Stop bus (#1873): a Console control and route that stops one organization's bus cleanly, through the same owner-checked path as Restart bus.

  • POST /api/orgs/<org>/stop/bus follows restartBus for authority, same-origin checks, trail and receipt. A deployed Console keeps its operator rules; a dev-local-owner Console passes as it does for Restart bus.
  • The host stops gracefully and leaves no host.lock or writer.lock; an offline schema migrate succeeds right after. An already-stopped bus answers state: stopped and changes nothing. An unprovable host refuses with files unchanged.
  • A Stop bus control sits beside Restart bus with the same confirm style. No new confirmation step.

Why now: lane agent-guard makes mosaic bus stop refuse inside an agent run. The uiorg deploy script will stop buses through this route instead.

Tests: new tests fail on BASE (8 in org-admin, 1 in bus-stop). Lane gate 40 files, 404/0.

Review: build (Opus) approve with 3 P3, two fixed, one is a deploy-script note. Security (daybreak-blue) 1 P2 deferred: PID reuse in stopHost, shared with the CLI stop and Restart bus, pre-existing. Lead check: 12 files on 5dbd7e72d (bus-stop, org-admin, unified-workspace-browser and every test that reads org-admin or console-restart), 118/0.

Deferred: the PID reuse hardening in shared stopHost; a clean stop drops the saved start options (as bus stop does), so an org started with the chief comes back without it; restartBus has the same trail pattern fixed here for stopBus; header and focus after repaint.

Stop bus (#1873): a Console control and route that stops one organization's bus cleanly, through the same owner-checked path as Restart bus. - `POST /api/orgs/<org>/stop/bus` follows `restartBus` for authority, same-origin checks, trail and receipt. A deployed Console keeps its operator rules; a dev-local-owner Console passes as it does for Restart bus. - The host stops gracefully and leaves no `host.lock` or `writer.lock`; an offline schema migrate succeeds right after. An already-stopped bus answers `state: stopped` and changes nothing. An unprovable host refuses with files unchanged. - A Stop bus control sits beside Restart bus with the same confirm style. No new confirmation step. Why now: lane agent-guard makes `mosaic bus stop` refuse inside an agent run. The uiorg deploy script will stop buses through this route instead. Tests: new tests fail on BASE (8 in org-admin, 1 in bus-stop). Lane gate 40 files, 404/0. Review: build (Opus) approve with 3 P3, two fixed, one is a deploy-script note. Security (daybreak-blue) 1 P2 deferred: PID reuse in `stopHost`, shared with the CLI stop and Restart bus, pre-existing. Lead check: 12 files on 5dbd7e72d (bus-stop, org-admin, unified-workspace-browser and every test that reads org-admin or console-restart), 118/0. Deferred: the PID reuse hardening in shared `stopHost`; a clean stop drops the saved start options (as `bus stop` does), so an org started with the chief comes back without it; restartBus has the same trail pattern fixed here for stopBus; header and focus after repaint.
jason.woltje added 2 commits 2026-11-11 22:14:12 +00:00
POST /api/orgs/ID/stop/bus runs busStop the way mosaic bus stop does: a
graceful SIGTERM close that leaves no host.lock or writer.lock, so an
offline schema migration can open the store straight after. It follows
restartBus for authority, same-origin checks, trail and receipt. A bus
already stopped answers done with state stopped and changes nothing; a
host identity the Console cannot prove refuses with every file unchanged.

The organization header gains a Stop bus button beside Restart bus, one
press, sharing its receipt and busy state. The restart icon now lives
inside its button, so a wide receipt no longer pulls it off the button.
A stop that may already have signalled the host (a timeout or an
unexpected error) is trailed as failed, not refused; only exit 3 comes
before the signal. The response's stopped flag follows what busStop
reports, so a host that exited on its own between the read and the stop
is not reported as stopped by this press.
jason.woltje merged commit a5f227e9fc into refactor 2026-11-11 22:14:14 +00:00
Sign in to join this conversation.