Watch
0
0
Fork
You've already forked hyperhive
0

hive-bash-mcp: count bash commands over OTEL in the daemon, drop the sqlite hand-off

This commit is contained in:
damocles 2026-11-18 19:44:18 +01:00 • committed by mara
commit 076df804e4

View file

@ -43,19 +43,13 @@ Retention:
### `/harness/hyperhive-turn-stats.sqlite` (per agent)
The `hive-bash-daemon` writes a `bash_commands(ts INTEGER, head TEXT)`
table in it: one row per executed bash task recording the normalised command head -
the basename of the first real command, looking past `cd repo &&`
prefixes, env-assignments, and prefix-runners like `sudo`/`env`. It
feeds the bash-command counter in the agent's OTEL metrics. Best-effort and created on first write
(`CREATE TABLE IF NOT EXISTS`), so it's absent until a bash
task runs.
The file has **no vacuum**. Older harnesses also wrote a per-turn `turn_stats`
table and a `sessions` table there; nothing writes them now and nothing in the
harness reads them, but they stay in existing files, where the
[legacy stats viewer](https://forge.constellation.darkest.space/hyperhive/legacy-stats-viewer)
can still turn them into the old stats page.
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)
@ -228,7 +222,6 @@ Under `/var/lib/hyperhive/agents/<name>/`:
swept — same "audit trail, not cache" treatment as the c0re-side
tables above.
- `hyperhive-turn-stats.sqlite` — the bash command heads the bash daemon records.
- `hyperhive-model` / `hyperhive-effort` — single-line model name and
effort level files, read-only fallbacks.