refactor(hivectl): move quota + subvol under agents

Both groups only ever act on a single managed agent's state dir, so
they belong in the `agents` namespace rather than as top-level verbs
next to `forge` / `matrix` / `wg`.

Renames `quota limit` -> `quota set`: the enclosing group already
carries the noun, so the bare verb matches the flat `set-parent` /
`set-limits` spelling without stuttering, and it removes the
`set-limits` (cpu/mem) vs `quota limit` (disk) ambiguity. Adds a
cross-pointer from `set-limits` to `agents quota`.

Handlers stay in their own modules; `run_agents` gains the reparenting
glue. Regenerates docs/tools/hivectl-cli.md.

Refs #2724
This commit is contained in:
atlas 2026-07-26 18:15:42 +02:00 committed by mara
commit 766b1f71fb
9 changed files with 215 additions and 204 deletions

View file

@ -23,11 +23,10 @@ mod client;
/// Rebuild-queue DAG progress rendering (`wait_for_dags` + the spinner /
/// plain renderers), split out to keep this file manageable.
mod dag_progress;
use cli::{Cli, Cmd, ForgeCmd, GatewayCmd, GithubCmd, QuotaCmd, WgCmd};
use cli::{Cli, Cmd, ForgeCmd, GatewayCmd, GithubCmd, WgCmd};
mod completions;
mod quota;
mod util;
use quota::{quota_enable, quota_limit, quota_show};
mod completions;
use completions::generate_completions;
mod gateway;
use gateway::{gateway_create_user, gateway_delete_user, gateway_list_users};
@ -47,9 +46,8 @@ mod agents;
use agents::run_agents;
mod power;
use power::{restart, start, stop};
mod subvol;
use subvol::dispatch_subvol;
mod approvals;
mod subvol;
use approvals::run_approvals;
#[tokio::main]
@ -122,16 +120,10 @@ async fn main() -> Result<()> {
} => stop(&socket, scope.to_scope(), graceful, no_wait).await,
Cmd::Start { scope, no_wait } => start(&socket, scope.to_scope(), no_wait).await,
Cmd::Restart { scope, graceful } => restart(&socket, scope.to_scope(), graceful).await,
Cmd::Subvol { cmd } => dispatch_subvol(&socket, cmd).await,
Cmd::Choom {
name,
resume_session,
} => choom(&name, resume_session.as_deref()),
Cmd::Quota { cmd } => match cmd {
QuotaCmd::Enable => quota_enable(&socket).await,
QuotaCmd::Show { name } => quota_show(&socket, name.as_deref()).await,
QuotaCmd::Limit { name, size } => quota_limit(&socket, &name, &size).await,
},
Cmd::MarkdownDocs => {
print!("{}", clap_markdown::help_markdown::<Cli>());
Ok(())