Closes 2718. The operator has been going through agent dirs by hand with ncdu, deleting 20+GB target dirs. Agents had no way to know they were the ones sitting on the space. New `disk_watch` module in the harness: every 15 minutes it statvfs's the filesystem backing the agent's state dir and, past 80%, raises a keyed `disk` todo telling the agent to free space — with the operator's rules inline: only delete things that are actually big, build output first, and never delete something still needed, ask for more space instead. Over threshold it also walks the agent's own tree (`/agents/<label>` plus `$HOME`) and names the directories worth looking at, so the todo says where the bytes actually went rather than just that the disk is full. The walk is bounded on every axis — entry budget, recursion cap, report depth — pinned to the state dir's device so it can't wander into `/nix` or the shared bind mounts, and it does not traverse symlinks. It reports the deepest oversized directory on each branch, so the agent gets pointed at `<workspace>/target` rather than at `/agents/<label>`. Anti-nag is the whole design constraint. The todo is keyed, and the summary is deliberately stable: the percentage is bucketed to 5 points and no raw byte counts appear anywhere in it. An unchanged situation re-upserts as `changed == false` and never fires the wake, so a disk that has been steady at 89% for a week sits quietly in the loose-ends list; crossing into a new bucket speaks up once. Dropping back under the threshold clears the row. Harness-local by construction, per the operator's call that this gets no core wiring: hive-c0re cannot push a todo at all (the store and its wake live inside the container), and running in-process means this skips even the in-agent socket and calls `Todos::upsert` directly. Worth recording, since it shaped the scope: btrfs does NOT fold qgroup limits into statfs. Measured with quota counting enabled and a 20G limit set on a real subvolume, statvfs returns byte-identical whole-FS numbers for that subvolume, an ordinary agent dir, and the root. So this watches host-FS pressure, which is valid before and after the planned subvolume migration; per-agent quota awareness would need the limit handed to the agent explicitly.
45 lines
1.1 KiB
TOML
45 lines
1.1 KiB
TOML
[package]
|
|
name = "hive-agent"
|
|
edition.workspace = true
|
|
version.workspace = true
|
|
readme = "README.md"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
axum.workspace = true
|
|
reqwest.workspace = true
|
|
hyper.workspace = true
|
|
hyper-util.workspace = true
|
|
http-body-util.workspace = true
|
|
forgejo-api.workspace = true
|
|
url.workspace = true
|
|
time.workspace = true
|
|
futures-util = "0.3"
|
|
clap.workspace = true
|
|
hive-claude.workspace = true
|
|
hive-agent-sock.workspace = true
|
|
hive-core-agent-sock.workspace = true
|
|
hive-sh4re.workspace = true
|
|
libc.workspace = true
|
|
rmcp.workspace = true
|
|
rusqlite.workspace = true
|
|
schemars.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
tokio.workspace = true
|
|
tokio-stream.workspace = true
|
|
tower-http.workspace = true
|
|
tracing.workspace = true
|
|
tracing-subscriber.workspace = true
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
|
|
# Single harness serve-loop binary: `hive-agent` (from `src/main.rs`).
|
|
# The sibling MCP server is its own bin crate now (`hive-agent-mcp`).
|
|
# Privilege boundary is enforced server-side at the socket (tool
|
|
# groups / manager surface).
|
|
# See `docs/turn-loop.md::Harness binary shape`.
|