hivectl, docs: choom is not root-only, and set-limits takes no agent name

Two unrelated changes landed correctly and left their prose behind, both
on operator-facing surfaces.

`hivectl agent <name> choom` gained a `hive-admin` path when hive-c0re
started shipping a polkit rule for `machinectl shell`. `choom.rs`
implements exactly that — `euid != 0 && !in_hive_admin_group()` — but
the `Choom` variant's clap doc comment still said "Requires root and a
running container", eight weeks on. That string is what
`choom --help` prints and what renders into the generated CLI
reference, so it is the sentence an operator actually reads, and it
tells a `hive-admin` member the command is not available to them.
`docs/turn-loop/mcp.md` carried the same staleness inside a
trust-boundary argument ("an operator (root) action"), where naming a
narrower reachable set than the real one is the wrong way to be wrong.

Dating it rather than asserting it: the acceptance landed 2026-09-07,
the doc string 2026-07-16.

Separately, `docs/tools/hivectl.md` states the agent-name hoist itself
("the name is hoisted onto the parent command, so none of the verbs
below repeat it") and its own example block obeys it, then twice writes
`set-limits sock --memory-max 8G` — the pre-hoist order. The generated
reference is unambiguous: `hivectl agent <NAME> <COMMAND>` versus
`hivectl agent set-limits [OPTIONS]`, with `quota set <SIZE>` nearby
showing that positionals do render when they exist. The costly one is a
complete command in backticks inside the paragraph explaining the
footgun it illustrates.

`docs/tools/hivectl-cli.md` is regenerated rather than hand-edited; the
diff against the committed copy is exactly one line.

Closes #4236.
This commit is contained in:
atlas 2026-09-11 17:52:47 +02:00 committed by mara
commit db0eb8829b
4 changed files with 11 additions and 11 deletions

View file

@ -497,7 +497,7 @@ Replaces the agent's whole override entry rather than merging into it: any limit
Open an interactive Claude session inside this agent's container. Open an interactive Claude session inside this agent's container.
A fresh session by default, or resume a prior one. Requires root and a running container. A fresh session by default, or resume a prior one. Requires root or `hive-admin` group membership, plus a running container.
**Usage:** `hivectl agent choom [OPTIONS]` **Usage:** `hivectl agent choom [OPTIONS]`

View file

@ -201,10 +201,10 @@ they go into a systemd drop-in verbatim, and a typo there makes the
unit fail to start. unit fail to start.
**Declarative, not incremental**: each invocation replaces the agent's **Declarative, not incremental**: each invocation replaces the agent's
whole entry. `set-limits sock --memory-max 8G` leaves `sock` with _only_ whole entry. `hivectl agent sock set-limits --memory-max 8G` leaves `sock`
a memory override, reverting any previously set CPU quota to the hive with _only_ a memory override, reverting any previously set CPU quota to
default. To avoid a forgotten flag silently wiping an override, hivectl the hive default. To avoid a forgotten flag silently wiping an override,
rejects a bare `set-limits <name>` with no flags — clearing requires the hivectl rejects `set-limits` with no flags at all — clearing requires the
explicit `--reset`. explicit `--reset`.
The command rewrites the container's drop-in and reloads systemd, so The command rewrites the container's drop-in and reloads systemd, so
@ -227,9 +227,9 @@ before you were added to `hive-admin` won't see it until you log back in
It also needs the daemon socket, unlike the other exec-into-a-container It also needs the daemon socket, unlike the other exec-into-a-container
paths: the "is this actually an agent?" pre-flight reads the agents root, paths: the "is this actually an agent?" pre-flight reads the agents root,
which the daemon's user owns and which isn't group-readable, so the check which the daemon's user owns and which isn't group-readable, so the check
is a `HostRequest` rather than a local `stat`. A rootless `choom` therefore is a `HostRequest` rather than a local `stat`. An unprivileged `choom`
tells you it needs root, instead of reporting a permission problem with therefore names the grant it wants, instead of reporting a permission
the state dir. problem with the state dir.
```bash ```bash
hivectl agent iris choom # fresh blank Claude session in iris's container hivectl agent iris choom # fresh blank Claude session in iris's container

View file

@ -226,8 +226,8 @@ operator-driven `hivectl agent <name> choom` session — which passes neither `-
nor `--allowedTools` — gets claude's built-in synchronous `Bash` tool nor `--allowedTools` — gets claude's built-in synchronous `Bash` tool
(inline, human-approved). That sidesteps the async `mcp__bash__run` (inline, human-approved). That sidesteps the async `mcp__bash__run`
completion wake landing in the wrong session (the harness inbox) for a completion wake landing in the wrong session (the harness inbox) for a
choom-started task; `choom` is an operator (root) action, so choom-started task; `choom` is an operator action (root or `hive-admin`),
built-in shell there stays within the existing trust boundary. The bash MCP server so built-in shell there stays within the existing trust boundary. The bash MCP server
(`run` / `status` / `kill`) uses `allowedTools = ["*"]` so all (`run` / `status` / `kill`) uses `allowedTools = ["*"]` so all
`mcp__bash__*` tools are always available regardless of tool groups. `mcp__bash__*` tools are always available regardless of tool groups.

View file

@ -544,7 +544,7 @@ pub enum AgentCmd {
/// Open an interactive Claude session inside this agent's container. /// Open an interactive Claude session inside this agent's container.
/// ///
/// A fresh session by default, or resume a prior one. Requires root /// A fresh session by default, or resume a prior one. Requires root
/// and a running container. /// or `hive-admin` group membership, plus a running container.
Choom { Choom {
/// Resume a prior claude session by its session id, passed /// Resume a prior claude session by its session id, passed
/// through as `claude --resume <value>` (claude's `--continue` /// through as `claude --resume <value>` (claude's `--continue`