feat(server): add authenticated instance shutdown - #182
Conversation
Ark0N
commented
Aug 5, 2026
Thank you for this, and I'm sorry to give it a "no" after the care that clearly went in. I want to be straight with you about why rather than let it sit open indefinitely. The engineering here is genuinely good. Gating on the unit's actual My objection is to the feature, not to the code. 1. It is a one-way door, and the way back is not in the product. The UI can stop the server, but nothing in the UI can start it again, because the thing that would serve that UI is what just stopped. The recommended production posture (and mine) is a loopback bind reached through 2. The mechanism exists to defeat a guarantee I consider core.
3. It would be dead on the deployment it most needs to be safe on. The route requires 4. It adds a privileged surface without adding a capability. Anyone who can authenticate to Codeman already has shell on that box, by construction. They installed it, and they run agents with 5. It is a second mechanism in an area that already has one. Self-update solves the closely related "act on the process I am currently running in" problem, and it is deliberately awkward about it: a detached script that outlives the restart, plus a status file the browser polls across the connection drop. This introduces a different in-process approach to supervisor manipulation alongside it. Two subtly different mechanisms in the most hazardous corner of the codebase is a maintenance cost I would rather not take on. None of that is a knock on your work, and please don't read it as one. Points 1 through 4 would apply to any implementation of this feature, which is why I would rather decline the idea cleanly than ask you to keep revising toward something I'm not going to merge. For what it's worth, the parts I would happily look at as standalone contributions: the Closing this one. Thanks again for the time you put into it, and for splitting #173 up in the first place, that made it much easier to evaluate on its own terms. |
Summary
CODEMAN_PASSWORDauthentication in single-user mode and an administrator in multi-user mode.Security model
The route fails closed in three places:
403.403.System-level supervisor actions also fail closed when administrator access is unavailable.
Scope
This is the secure instance-shutdown slice extracted from #173. It includes the orchestration port, supervisor detection, route, confirmation UI, header policy, documentation, and focused tests. It does not depend on the mobile terminal controls.
The destructive header action stays hidden on phone widths, including wide-phone touch layouts through 480px.
Validation
npx vitest run --config config/vitest.config.ts test/instance-shutdown.test.ts test/routes/system-routes.test.ts test/mobile-header-buttons-policy.test.ts: 82 passednpx vitest run --config test/mobile/vitest.config.ts test/mobile/header-buttons.test.ts: 4 passednpm run check:frontend-syntax: 26 files passednpm run build: passedgit diff --check: passed