hyperhive/hive-agent/Cargo.toml
atlas 8cc7f90c98 log: send records natively to journald, keep stdout off-unit
A record written to stdout carries no priority, so journald files the
whole stream at one level and the swarm log store shows `info` whatever
level `tracing` gave it. Under a systemd unit the process's stdout
already *is* the journal, so the fix is to speak the journal protocol
directly and let each record carry its own severity.

New `hive-log` crate holds the one sink chooser, called by `hive-c0re`,
`hive-agent` and `swarm-controller`. It builds the same `EnvFilter`
those binaries always built, then installs exactly one layer — never
both, since a journald layer stacked on the `fmt` layer under a unit
stores every record twice.

The choice is an fstat compare, not a presence test: a child inherits
`$JOURNAL_STREAM` even when its own stdout was redirected elsewhere, so
the variable existing proves nothing. The crate parses `dev:inode` out
of it and compares both numbers against an fstat of stdout, the
descriptor the `fmt` layer writes to by default. No match, unset, or
unparseable takes the `fmt` branch. A journald layer that fails to
construct despite a match falls back to `fmt` and warns through it —
a process must never fail to start because of its logger.
2026-09-21 15:52:57 +02:00

54 lines
1.6 KiB
TOML

[package]
name = "hive-agent"
edition.workspace = true
version.workspace = true
readme = "README.md"
[lints]
workspace = true
[dependencies]
anyhow.workspace = true
# Named directly only for the client type the terminal publisher holds; the
# connect and the credential handling live in `swarm-queue-client` below.
async-nats.workspace = true
axum.workspace = true
chrono.workspace = true
reqwest.workspace = true
hyper.workspace = true
hyper-util.workspace = true
http-body-util.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-log.workspace = true
hive-sh4re.workspace = true
hive-sock-client.workspace = true
libc.workspace = true
opentelemetry.workspace = true
opentelemetry_sdk.workspace = true
opentelemetry-otlp.workspace = true
rmcp.workspace = true
rusqlite.workspace = true
schemars.workspace = true
serde.workspace = true
serde_json.workspace = true
# Bare: `kv`/`notices` name buckets and streams this harness opens neither end
# of. The terminal publisher is a plain core-subject publish, so it needs the
# connect and the payload limit and nothing from JetStream.
swarm-queue-client.workspace = true
tokio.workspace = true
tokio-stream.workspace = true
tower-http.workspace = true
tracing.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/README.md::Harness binary shape`.