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

@ -201,10 +201,10 @@ they go into a systemd drop-in verbatim, and a typo there makes the
unit fail to start.
**Declarative, not incremental**: each invocation replaces the agent's
whole entry. `set-limits sock --memory-max 8G` leaves `sock` with _only_
a memory override, reverting any previously set CPU quota to the hive
default. To avoid a forgotten flag silently wiping an override, hivectl
rejects a bare `set-limits <name>` with no flags — clearing requires the
whole entry. `hivectl agent sock set-limits --memory-max 8G` leaves `sock`
with _only_ a memory override, reverting any previously set CPU quota to
the hive default. To avoid a forgotten flag silently wiping an override,
hivectl rejects `set-limits` with no flags at all — clearing requires the
explicit `--reset`.
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
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
is a `HostRequest` rather than a local `stat`. A rootless `choom` therefore
tells you it needs root, instead of reporting a permission problem with
the state dir.
is a `HostRequest` rather than a local `stat`. An unprivileged `choom`
therefore names the grant it wants, instead of reporting a permission
problem with the state dir.
```bash
hivectl agent iris choom # fresh blank Claude session in iris's container