docs: drop the turn-stats sqlite section and stale mentions, point the grafana check at the daemon
This commit is contained in:
parent
076df804e4
commit
fc8ec13620
6 changed files with 16 additions and 27 deletions
|
|
@ -41,16 +41,6 @@ Retention:
|
||||||
successful turn, so `requeue_inflight` can still requeue
|
successful turn, so `requeue_inflight` can still requeue
|
||||||
an unacked row on a crash.
|
an unacked row on a crash.
|
||||||
|
|
||||||
### `/harness/hyperhive-turn-stats.sqlite` (per agent)
|
|
||||||
|
|
||||||
Nothing writes or reads this file now. Older harnesses wrote per-turn
|
|
||||||
`turn_stats` and `sessions` tables there, and an older `hive-bash-daemon` a
|
|
||||||
`bash_commands` table; they stay in existing files, which are safe to delete
|
|
||||||
by hand. The bash daemon counts executed commands itself and exports them
|
|
||||||
over OTEL (see
|
|
||||||
[`observability.md`](../scheduler/observability.md)), and the one value the
|
|
||||||
harness reads back between runs lives in `hyperhive-harness.json`, below.
|
|
||||||
|
|
||||||
### `/state/hyperhive-harness.json` (per agent)
|
### `/state/hyperhive-harness.json` (per agent)
|
||||||
|
|
||||||
Consolidated harness state file written atomically (`.tmp` + rename) by
|
Consolidated harness state file written atomically (`.tmp` + rename) by
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,8 @@ across `destroy`/recreate (`--purge` wipes them).
|
||||||
The harness exposes the same path
|
The harness exposes the same path
|
||||||
via `$HYPERHIVE_STATE_DIR`. System prompts tell agents to keep
|
via `$HYPERHIVE_STATE_DIR`. System prompts tell agents to keep
|
||||||
durable knowledge here (`notes.md`, anything else) — the harness's own
|
durable knowledge here (`notes.md`, anything else) — the harness's own
|
||||||
internal files (`hyperhive-turn-stats.sqlite`,
|
internal files (`hyperhive-model`,
|
||||||
`hyperhive-model`) live in the separate `harness` dir instead, so they
|
`hyperhive-effort`) live in the separate `harness` dir instead, so they
|
||||||
don't clutter what claude sees as "my notes dir" (see
|
don't clutter what claude sees as "my notes dir" (see
|
||||||
[`docs/4-implementation/agent-state/persistence.md`](../../4-implementation/agent-state/persistence.md)). Survives `destroy`/recreate
|
[`docs/4-implementation/agent-state/persistence.md`](../../4-implementation/agent-state/persistence.md)). Survives `destroy`/recreate
|
||||||
alongside the claude dir.
|
alongside the claude dir.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
//!
|
//!
|
||||||
//! All agents (including the manager `root`) use `/agents/{label}/state`
|
//! All agents (including the manager `root`) use `/agents/{label}/state`
|
||||||
//! for agent-owned durable notes, and `/agents/{label}/harness` for
|
//! for agent-owned durable notes, and `/agents/{label}/harness` for
|
||||||
//! harness-internal files (`hyperhive-turn-stats.sqlite`, `hyperhive-model`, etc.)
|
//! harness-internal files (`hyperhive-model`, etc.)
|
||||||
//! that should not clutter what claude sees as "my notes dir".
|
//! that should not clutter what claude sees as "my notes dir".
|
||||||
//! Claude credentials live at `$HOME/.claude` (resolves to
|
//! Claude credentials live at `$HOME/.claude` (resolves to
|
||||||
//! `/home/<agent-name>/.claude` because the harness service runs as a
|
//! `/home/<agent-name>/.claude` because the harness service runs as a
|
||||||
|
|
@ -28,8 +28,7 @@ pub fn state_dir() -> PathBuf {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Harness-internal state directory. Holds files the harness owns
|
/// Harness-internal state directory. Holds files the harness owns
|
||||||
/// (`hyperhive-turn-stats.sqlite`,
|
/// (`hyperhive-model`, ...) so they do not appear inside the agent-visible
|
||||||
/// `hyperhive-model`) so they do not appear inside the agent-visible
|
|
||||||
/// `/agents/{label}/state` tree. Delegates to the shared canonical
|
/// `/agents/{label}/state` tree. Delegates to the shared canonical
|
||||||
/// resolver in `hive_agent_sock::paths` so the harness + every
|
/// resolver in `hive_agent_sock::paths` so the harness + every
|
||||||
/// out-of-process MCP daemon resolve this identically (reads
|
/// out-of-process MCP daemon resolve this identically (reads
|
||||||
|
|
|
||||||
|
|
@ -750,8 +750,7 @@ impl Coordinator {
|
||||||
|
|
||||||
/// Per-agent harness-internal state dir. Bind-mounted RW into the
|
/// Per-agent harness-internal state dir. Bind-mounted RW into the
|
||||||
/// agent container at `/agents/{name}/harness`. Holds sqlite dbs
|
/// agent container at `/agents/{name}/harness`. Holds sqlite dbs
|
||||||
/// and config files owned by the harness (`hyperhive-turn-stats.sqlite`,
|
/// and config files owned by the harness (`hyperhive-model`, ...) — kept separate
|
||||||
/// `hyperhive-model`) — kept separate
|
|
||||||
/// from the agent-visible `state/` so claude's "my notes" view is
|
/// from the agent-visible `state/` so claude's "my notes" view is
|
||||||
/// uncluttered and the host vacuum has a clean sweep root.
|
/// uncluttered and the host vacuum has a clean sweep root.
|
||||||
pub fn agent_harness_dir(name: &hive_types::Ident) -> PathBuf {
|
pub fn agent_harness_dir(name: &hive_types::Ident) -> PathBuf {
|
||||||
|
|
|
||||||
|
|
@ -325,9 +325,6 @@ async fn cmd_serve(
|
||||||
// now run agent-side in the harness (`hive_agent::vacuum`): the files are
|
// now run agent-side in the harness (`hive_agent::vacuum`): the files are
|
||||||
// agent-owned, so host-side deletes hit PermissionDenied / readonly-db
|
// agent-owned, so host-side deletes hit PermissionDenied / readonly-db
|
||||||
// under privsep. See issue tracker "perms borked".
|
// under privsep. See issue tracker "perms borked".
|
||||||
// (hyperhive-turn-stats.sqlite has no vacuum: it holds only the bash
|
|
||||||
// command heads now, small, and the legacy stats viewer reads what older
|
|
||||||
// harnesses left in it.)
|
|
||||||
// Slow per-container disk sampler: hive-priv measures each agent's state/
|
// Slow per-container disk sampler: hive-priv measures each agent's state/
|
||||||
// + work/ + writable rootfs every 30 min, cached so a sample only reads
|
// + work/ + writable rootfs every 30 min, cached so a sample only reads
|
||||||
// cgroup files. Feeds `disk_bytes` to the OTEL exporter. See
|
// cgroup files. Feeds `disk_bytes` to the OTEL exporter. See
|
||||||
|
|
|
||||||
|
|
@ -567,11 +567,12 @@ let
|
||||||
&& lib.any (e: lib.hasInfix "hyperhive.container.memory.oom_kills" e) exprs;
|
&& lib.any (e: lib.hasInfix "hyperhive.container.memory.oom_kills" e) exprs;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
# The agents board's turns tab reads the turn, tool, bash command, reminder
|
# The agents board's turns tab reads the turn, tool, reminder and session
|
||||||
# and session metrics the harness records, grouped by the labels it sets on them. A renamed instrument or
|
# metrics the harness records, and the bash command counter the bash
|
||||||
# label there is a tab of empty panels, so each must still be spelled in the
|
# daemon records, grouped by the labels they set. A renamed instrument or
|
||||||
# harness; and the duration percentiles are only right while the histogram
|
# label there is a tab of empty panels, so each must still be spelled in
|
||||||
# has bounds past the SDK's 10 s default ceiling.
|
# the harness or the daemon; and the duration percentiles are only right
|
||||||
|
# while the histogram has bounds past the SDK's 10 s default ceiling.
|
||||||
name = "the agents dashboard's turns tab reads the turn metrics and labels the harness records";
|
name = "the agents dashboard's turns tab reads the turn metrics and labels the harness records";
|
||||||
ok =
|
ok =
|
||||||
let
|
let
|
||||||
|
|
@ -582,6 +583,7 @@ let
|
||||||
n: map (q: q.spec.query.spec.expr) board.spec.elements.${n}.spec.data.spec.queries
|
n: map (q: q.spec.query.spec.expr) board.spec.elements.${n}.spec.data.spec.queries
|
||||||
) names;
|
) names;
|
||||||
recorded = builtins.readFile ../../hive-agent/src/otel_turn_metrics.rs;
|
recorded = builtins.readFile ../../hive-agent/src/otel_turn_metrics.rs;
|
||||||
|
bashRecorded = builtins.readFile ../../hive-bash-mcp/src/stats.rs;
|
||||||
in
|
in
|
||||||
tab != null
|
tab != null
|
||||||
&& lib.length names == 14
|
&& lib.length names == 14
|
||||||
|
|
@ -590,16 +592,18 @@ let
|
||||||
"hyperhive.agent.turn.duration"
|
"hyperhive.agent.turn.duration"
|
||||||
"hyperhive.agent.session.count"
|
"hyperhive.agent.session.count"
|
||||||
"hyperhive.agent.tool.calls"
|
"hyperhive.agent.tool.calls"
|
||||||
"hyperhive.agent.bash.commands"
|
|
||||||
"hyperhive.agent.reminders"
|
"hyperhive.agent.reminders"
|
||||||
"hyperhive.agent.first_turn.context"
|
"hyperhive.agent.first_turn.context"
|
||||||
"wake_from"
|
"wake_from"
|
||||||
"result_kind"
|
"result_kind"
|
||||||
"model"
|
"model"
|
||||||
"tool"
|
"tool"
|
||||||
"command"
|
|
||||||
"event"
|
"event"
|
||||||
]
|
]
|
||||||
|
&& lib.all (m: lib.hasInfix "\"${m}\"" bashRecorded) [
|
||||||
|
"hyperhive.agent.bash.commands"
|
||||||
|
"command"
|
||||||
|
]
|
||||||
&& lib.all (l: lib.any (e: lib.hasInfix l e) exprs) [
|
&& lib.all (l: lib.any (e: lib.hasInfix l e) exprs) [
|
||||||
"wake_from"
|
"wake_from"
|
||||||
"result_kind"
|
"result_kind"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue