Repository navigation
feat(cli): managers update, doctor, service install --refresh, MANAGERS_IN_DOCKER (F3) - #22
Merged
Merged
Conversation
Ported from Paddock, whose CLI this is, by three-way merging Paddock's own
changes onto Managers: B1 (paddock#981, #983), the launchd bootout/bootstrap
race fix (paddock#984) and the systemd restart-an-active-unit fix (paddock#986).
- /api/health answers { ok, version } (version.ts, shared with the OpenAPI
document and the management MCP handshake).
- `serve`, with `start` a permanent alias; the server logs to stderr so the
first stdout line is `Managers <version>: <url>`.
- Exit codes: usage errors 2 with the usage after; `service status` 0/3/4;
logs/start/stop/restart 4 with no unit; an install that never answers 1.
- `service status --json`, `service logs [-f] [-n]`; Linux logs go to
<data>/logs/service.log, rotated by copy-and-truncate.
- Units: realpath'd Node, a rebuilt PATH, quoted ExecStart, a linger check.
- launchd: poll until a bootout has finished, retry bootstrap on 5/37.
- systemd: install restarts a unit that was already active.
- Real-service CI (scripts/service-real.mjs) and the conformance runner
(@edspencer/cli-conformance ^0.2.0): 7 passed, 2 skipped (busy, F2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a SIGTERM that finishes or records (F2) Ported from Paddock's C1 (paddock#984) by three-way merge, plus Managers' own: - /api/busy gains `run`: trigger runs in flight (ManagersState.liveRuns), from the running record being written until it is finished and committed. - SIGTERM waits up to 8s for in-flight turns and runs to end by themselves, then finishes each run still in flight as failed, "interrupted by shutdown", through its own (now once-only) completion hook. Bounded at 15s overall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # .github/workflows/ci.yml # README.md # cli-contract.json # packages/server/src/cli/args.ts # packages/server/src/cli/managers.ts # packages/server/src/cli/service/index.ts # packages/server/src/routes/meta.ts # packages/server/src/start.ts # packages/server/test/unit/cli-contract.test.ts # scripts/service-real.mjs
…#991) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A supervisor whose kill timeout is shorter than the 8 s wait (PM2's is 1.6 s) otherwise left no record at all of what it cut short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md # packages/server/src/cli/args.ts # packages/server/src/cli/busy-command.ts # packages/server/src/cli/busy.ts # packages/server/src/cli/managers.ts # packages/server/src/cli/output.ts # packages/server/src/shutdown-drain.ts # packages/server/src/start.ts # packages/server/test/unit/cli-contract.test.ts # packages/server/test/unit/shutdown-drain.test.ts
The auto-merge of main (F2's squash, identical to this branch's F2 content) added busyCheck() and the restart guard a second time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y a refused first install) Also restores the reference's own wording in those two files (a blanket rename had made Paddock's 0.80.0 launchd race read as Managers'). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nit description is Managers', not Paddock's The stand-in systemctl hands the rig's env to the service, and Managers refuses MANAGERS_DRIVE_MODE=batch at boot without the opt-in, so the service never answered and the service-backed scenarios failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave F3 of the CLI-contract rollout (SPEC 0.2), ported from Paddock 0.82 (paddock#986, #989, #991) and the contract's
reference/.What's in it
managers update [--check] [--to <version|tag>] [--yes] [--force] [--json], withupgradeas a hidden alias. This is SPEC §5's sequence in order: lock, install detection, registry, busy check, prompt, fetch, stop, install, hand-over viaservice install --refresh, health check on the target version, and rollback (exit 6 or 7). The generic code is the reference copied in (cli/update/*, with headers). Managers' own hooks are incli/update-command.ts: the synthesized@edspencer/managerspackage layout, the busy guard with the keeper-chat trap, and the service.MANAGERS_UPDATE_HINTis honoured: a managed install prints it and exits 5.managers doctor [--json] [--offline]runs SPEC §1's eight checks, thenconfig(the configuration loads) andsecurity.securityfolds in/api/security's posture warnings: it asks the running instance, or computes the posture this shell would boot with, using the server's own rule.service install --refresh.status --jsoncarriesupdate(absent, never null).start/restartrunreset-failedfirst.cli/service/{launchd,systemd,manager,path-env,logs}.tsare the reference copies, including cli-contract#7: a refused first install leaves no unit behind.MANAGERS_IN_DOCKER=1, andmanagersonPATHas a shim, sodocker exec … managers busyworks as a Watchtower pre-update hook.UPDATING.mdis new, with a pointer from the README. Managers has no docs site.update-serviceandupdate-rollbackrun in the real launchd/systemd jobs withCI_REAL_SERVICE=1.HOST/PORTare nulled in the config'senv.Update (fake registry)job on ubuntu and macOS (scripts/update-registry.mjs,fake-registry.mjsandstandin-systemctl.mjs, ported from Paddock). It is the non-root job, so the non-writable-prefix case runs there.The changeset is a minor (new commands, and new exit codes 5/6/7 on
update).Testing
update-not-writablebecause this box runs as root, and the two real-service checks, which run in CI.UI unaffected: CLI and image only.
🤖 Generated with Claude Code