Commit graph hyperhive/docs
Author SHA1 Message Date
damocles
39fc088907 feat(#2100): add hive-metric OTLP CLI for agent-emitted custom metrics 2026-07-10 21:27:56 +02:00
damocles
342f6ab55b chore(#2358): disable claude dynamic workflows via managed settings 2026-07-10 20:30:34 +02:00
damocles
3e2565d355 fix(#2356): enable built-in bash for choom by dropping it from managed-settings deny 2026-07-10 20:03:41 +02:00
sock
6c95933775 docs(security): ci netns, knowledge .git tmpfs, matrix id/secret split
Security fixes landed without updating the security-model docs; bring them
current as present-tense invariants:

- security.md: matrix identities are public / cross-agent-readable via
  GetAgentMeta while the token stays private; name validation extends to
  GetAgentMeta; the nix-build blast radius has a network dimension (hive-ci
  netns) alongside the 0600 token policy.
- boundary.md: the core dashboard /api has no app-layer auth — protection is
  the gateway plus network isolation; stated as a standing invariant.
- ci.md: hive-ci runs in its own private netns behind the bridge, reaches the
  forge via the gateway, and cannot reach host-loopback (dashboard/forge port).
- knowledge.md: /knowledge excludes .git via tmpfs so the core token in
  .git/config isn't readable by agents.

Refs #2308, #2310, #2313.
2026-07-10 19:17:17 +02:00
lexis
d01d6d91e2 regen docs/tools/hivectl-cli.md with updated hivectl help text 2026-07-10 13:49:54 +02:00
lexis
aba3a3a4ea regen docs/tools/hivectl-cli.md per CI check 2026-07-10 13:49:54 +02:00
iris
476a7a3c9f web_ui: support unix:<path> upstreams in extraWebProxies
reqwest has no UDS transport, so unix: upstreams dial the socket
directly with a raw hyper/1.1 client per request instead. http(s)://
upstreams are unaffected (still go through the existing reqwest path).

Adds hyper (client, http1), hyper-util (tokio IO adapter), and
http-body-util as direct hive-ag3nt dependencies - all three were
already present transitively via reqwest, this just uses them
directly for the new code path.
2026-07-10 12:53:09 +02:00
damocles
89ce8790ff feat(web_ui): per-path reverse-proxy via HIVE_EXTRA_WEB_PROXIES 2026-07-10 12:14:21 +02:00
iris
ccc5e631e2 web-ui: sanitize markdown HTML with DOMPurify to fix XSS
Both mdNode implementations (agent UI app.js, dashboard common.js)
assigned marked.parse() output straight to innerHTML with no
sanitizer. marked v5+ dropped its built-in sanitize option, and there
was no DOMPurify anywhere in frontend/, so markdown containing raw
HTML/script tags rendered live in the browser.

Both sinks receive untrusted input in practice: the agent UI's mdNode
renders recv tool_result bodies, assistant prose, and send/ask/answer
payloads sourced from peer agents and matrix-relayed messages (the
documented prompt-injection adversary); the dashboard's mdNode renders
agent-authored .md files served verbatim by GET /api/state-file
(the endpoint validates path, not content). Since the per-agent UI and
dashboard are same-origin behind the gateway with operator-authority
endpoints (approve/spawn/rebuild/destroy/answer-question), injected
script would run with the operator's session.

Fix: DOMPurify.sanitize() the marked.parse() output at both sinks
before assigning to innerHTML. Added dompurify as a dependency to
both the agent and dashboard npm workspaces, recomputed npmDepsHash
in nix/frontend.nix for the updated lockfile. Also corrected
docs/web-ui/shape.md, which claimed the markdown-rendering path was
XSS-safe by construction the same way the text-node-based linkify
path is — it isn't; it's safe because it's sanitized.

CSP hardening for the dashboard (no unsafe-inline) is a separate,
larger backend change (response headers in hive-c0re) and is left as
a fast-follow rather than folded into this fix.
2026-07-10 11:54:50 +02:00
atlas
9c3884e031 docs(ci): lint jobs are required and block merge 2026-07-08 23:43:29 +02:00
atlas
260dc7bb58 docs(ci): drop bullet descriptions, keep only link + one-liner
Per mara/argus feedback: no need to describe job contents inline,
just link to the workflow file.
2026-07-08 23:43:29 +02:00
atlas
7ef90996f6 docs(ci): replace YAML copy with link to .forgejo/workflows/ci.yml
Per mara's feedback: don't copy the YAML inline, just reference the file.
2026-07-08 23:43:29 +02:00
atlas
bfba148f76 docs(ci): update CI workflow section to reflect 3-job layout 2026-07-08 23:43:29 +02:00
damocles
5027068e31 feat(#2109): harness-side idle watchdog to bail on anthropic api stall storms 2026-07-07 22:45:18 +02:00
müde
5cfb33eeed docs(forge): note forgejo-api client + remaining raw-HTTP surfaces 2026-07-07 09:25:51 +02:00
müde
5b062dca55 refactor(hive-ag3nt): split hive bin into hive-agent / hive-agent-mcp / hive-agent-wake 2026-07-06 23:48:05 +02:00
müde
0e4b5a1120 refactor(hive-c0re): group src-root files into submodules
stores/ (sqlite-backed host stores + db helper), stats/, agent_config/,
workers/ — pure git-mv moves; crate-root re-exports keep every
crate::<module> path compiling. flake_check stays at root (synchronous
approval-flow validation, not a background worker)
2026-07-06 22:38:47 +02:00
müde
b489454dc2 feat(hivectl): queue-routed lifecycle verbs with wait + DAG progress
every agent lifecycle verb on the admin socket (rebuild / restart /
restart-all / kill / stop / start) now submits job-queue DAGs and
returns their ids; hivectl polls the new HostRequest::QueueDag and
prints a live node-chain progress line per DAG (fan-out children
included), exiting non-zero on failure — --no-wait opts out. DagView
and the queue wire enums move to hive_sh4re::jobs (wire types live in
the shared crate); the last fused rebuild path (lifecycle::rebuild)
is gone. tracker: #2166
2026-07-06 22:30:49 +02:00
müde
084e12503c fix(hive-c0re): close review findings on the job-DAG queue
- deploy-window gate (meta::exclusive) + path-limited meta commits:
  a perm/lock/topology commit can no longer sweep an ApprovalDeploy's
  staged flake.lock and neuter abort_deploy (regression test included)
- cancel surfaces now buffer terminal roll-ups the scheduler drains,
  so a queued approval DAG cancelled by the operator resolves its
  approval instead of dangling, and cancelled power ops revert their
  wanted flip to the observed state
- hivectl restart / restart-all ride the queue (lease serialization,
  transient guard) and restart sets wanted=Up like the old kill+start
- exactly one Rebuilt event per rebuild DAG, emitted at terminal
- StopForUpdate pre-seeds a missing agent_power row from the pre-stop
  observation so a rebuild can't strand an unknown agent offline
- history trim keeps terminal fan-out parents with live children
- audit_log back on db::open; swarm.js badge for reconcile DAGs
2026-07-06 21:44:43 +02:00
müde
604e1c2557 docs: job-DAG queue model; fold agent_power table into broker.sqlite
coordinator.md rewrites the queue section (node inventory, DAG shapes,
resources, desired-state reconciliation, boot reconcile); approvals.md
+ persistence.md + hivectl --graceful help updated to match. agent_power
lives in broker.sqlite like approvals/questions (own connection + busy
timeout) instead of a separate db file.
2026-07-06 20:36:57 +02:00
müde
b4f54a194b fix(agent): don't eat /compact flag on failed turn; restore ctx fallback; requeue on SessionNotFound 2026-07-06 00:01:15 +02:00
müde
216eb8ae9b docs(turn-loop): split into index + claude-invocation/config/mcp sub-pages, condense the loop 2026-07-05 23:04:48 +02:00
müde
f490e07509 refactor(prompt): drop unreachable role-block defensive branches; keep marker grammar 2026-07-05 22:36:10 +02:00
müde
20ff891962 refactor(forge_notify): share render_body_excerpt across formatters; fix nits + docs 2026-07-05 22:32:00 +02:00
müde
dd7f8c5ebb docs(turn-loop): document PromptTooLong archive+requeue, TurnOutcome=Result, credential-file session detection 2026-07-05 22:27:09 +02:00
müde
90af3e8d0b refactor(mcp): split claude launch-config layer into mcp_config.rs 2026-07-05 22:24:46 +02:00
müde
4a404c1128 docs: describe hive-claude split, InfiniteSession, deferred compact, web_ui dir 2026-07-05 20:53:56 +02:00
müde
e35acca814 fix(agent): pin claude session by constant title, archive on reset 2026-07-05 18:13:54 +02:00
iris
bd0e4d1012 fixup! docs(turn-loop): document system inbox messages and link to approvals.md helper events
Per argus review: correct routing subject from 'root/manager agent' to
'submitting agent (root agent for top-level containers; approvals-group
agent for its own subtree)', and drop the deprecated 'manager' term.
2026-07-05 02:28:26 +02:00
iris
2748ce2f4c docs(turn-loop): document system inbox messages and link to approvals.md helper events
The messaging section listed the MCP tools for send/recv/ask/answer/ack_until
but didn't mention the system events agents receive from sender 'system' —
lifecycle events (spawned, rebuilt, killed, etc.) routed to the root agent and
Q&A events (question_asked, question_answered) delivered to any agent. Add a
brief paragraph that names the events and links to the canonical reference in
docs/approvals.md where the full payload shapes and routing logic live.
2026-07-05 02:24:42 +02:00
atlas
23f13d9e71 chore(docs,nix): fix stale 'localhost via shared netns' claims in forge/matrix
Agents in private netns can't reach host loopback directly; they
use forge.<domain> and matrix.<domain> via the gateway. Update four
locations that still claimed direct loopback access:

- hive-forge.nix: module header + openFirewall description
- hive-matrix.nix: openFirewall description
- docs/matrix.md: container design bullet + openFirewall section
2026-07-04 22:54:38 +02:00
atlas
9067398e3c chore(docs,nix): remove stale shared-netns references from matrix URL docs
Agents run in private netns (always-on isolation) and can't reach
host loopback directly. hive-c0re forwards HIVE_MATRIX_URL set to
`matrix.<domain>` via the gateway. Update two places that still
referenced the removed shared-netns path.
2026-07-04 22:54:38 +02:00
atlas
32e4c687b8 docs(gateway): remove stale TCP loopback fallback section
The TCP fallback was removed from gateway_nginx.rs in the previous
commit. Update docs/gateway.md to match:
- Step 4: remove 'TCP loopback for agents not yet rebuilt' — always UDS now
- Remove the 'TCP loopback fallback' subsection entirely
2026-07-04 22:42:56 +02:00
atlas
bc6353c232 docs(network): fix stale '(shared netns)' in bridge firewall table row
The parenthetical was backwards — this rule opens bridge ports so
*isolated* agents (in private netns, connected via veth) can reach
nginx. Remove the misleading '(shared netns)' tag, replace with the
accurate description.
2026-07-04 21:18:57 +02:00
atlas
480b35aac4 docs(boundary): update to reflect always-on network isolation
All three area:ops pillars are now complete: network isolation is
always on (private netns, no shared-netns mode), the gateway is live,
and hive-c0re runs as the unprivileged hive-core user.

- Rewrite the intro to say the boundary is enforced, not aspirational
- Update 'Why network isolation is the load-bearing step' section to
  use past tense for the shared-netns world and note completion
- Mark network isolation as Complete in the sequencing list
2026-07-04 20:58:55 +02:00
atlas
a363d1f317 docs(gotchas): document nix fmt failure in git worktrees 2026-07-04 20:50:50 +02:00
iris
c594de07ca docs(ci): document CI checks, local equivalents, and pre-push hook 2026-07-04 20:48:58 +02:00
atlas
902d4dd461 docs(network): rewrite for always-on isolation; remove phased-rollout rationale
The two-phase network rollout (bridge-first, then isolateContainers) is
complete. Both options are now deprecated no-ops — isolation is always on.
Update the doc to reflect current state:

- Drop the phased-rollout intro ('off by default during rollout') and the
  v1/v2 comparison table; keep a brief historical note
- Remove 'Why ship before netns isolation' section (rollout is done)
- Update configuration example: network.enable is no longer needed
- Merge firewall description into a single table (80/443 always open)
- Remove 'Prerequisites before flipping on' and 'Migration behaviour'
  subsections (isolation was a one-time flip; no longer a toggle)
- Simplify resolver wiring: hive-priv always drops the marker; remove
  'only when isolated' conditional framing
2026-07-04 20:30:23 +02:00
iris
c6e97ef600 docs(forge-tools): clarify create_repo MCP tool vs repo-create CLI
Agents cannot create repos directly via their forge token (no Create
scope; push-to-create disabled). Document the two paths:
- mcp__hyperhive__create_repo (forge tool group): creates under agents/
  org via hive-c0re, adds write-collaborator access, enables branch
  protection. The standard agent path.
- hive-forge repo-create / repo-add-collaborator (CLI): use the agent's
  own token; repo lands under agent's user account or org.
2026-07-04 19:01:07 +02:00
iris
0ae2dbd8fa docs(turn-loop): document forge + web_tools tool groups in Privileged tools section
The 'Privileged tools (by tool group)' section listed execution,
lifecycle/approvals, scheduling/diagnostics, capability-gated, and
matrix but was missing:

- forge (create_repo) — the only agent path to create a repo under the
  agents/ org; direct token creation is disabled for agents. Opt-in,
  not in any default preset.
- web_tools — enables Claude built-in WebFetch/WebSearch tools. Off by
  default. The tool whitelist section already mentioned these but the
  group was absent from the privileged-tools list.
2026-07-04 19:01:07 +02:00
iris
315f7c1f13 fix(docs/bash): fix broken prose sentence from prettier reformatting
The prettier markdown formatter (8406a452) converted a prose '+' into
a markdown list marker '-', splitting 'fires a wake...and the exit code
+ last stdout lines' into a dangling incomplete sentence followed by an
orphaned list item. Rewrite the sentence to avoid the pattern entirely.
2026-07-04 19:01:07 +02:00
iris
65dd64abd1 docs(matrix-tools): add missing open_dm to matrix tool list
open_dm(user_id) resolves (find-or-create) the DM room and returns
its room id without sending anything. It is the counterpart to
send_dm for cases where you need a room id to pass to a room-based
tool such as send_file or send_message.

The tool was present in hive-matrix-mcp (mcp.rs, handlers.rs,
protocol.rs) and the terminal-rendering icon table but was missing
from the tools/matrix.md reference doc.
2026-07-04 19:01:07 +02:00
iris
1b8b83fee1 fix(terminal-rendering): move fmtToolUse table after numbered list
The heading was inserted between items 3 and 4, breaking GFM ordered
list numbering (Forgejo renders items 4+ restarting at 1). Move the
subsection to after item 5 and update the in-prose reference to use
an anchor link instead of 'see table below'.
2026-07-04 18:56:59 +02:00
iris
8f876d0154 docs(terminal-rendering): expand fmtToolUse with complete pattern table
Replace the sparse 3-line prose description of fmtToolUse with a full
reference table covering every tool case added over the past several
PRs. Adds a new subsection listing the short-name convention (* suffix),
all Claude built-ins (Read/Write/Edit/Glob/Grep/Bash/TodoWrite), the
full hyperhive MCP surface (recv/send/ask/answer/remind/set_status/
get_loose_ends/get_agent_meta/cancel_loose_end/ack_until/kill/restart/
start/update/get_logs/get_host_journal/request_apply_commit/
request_init_config/request_update_meta_inputs), all scheduling tools
(list_schedules/cancel_schedule/fire_schedule_now/edit_schedule/
request_schedule_prompt — added in the previous PR), bash MCP tools
(run/status/kill), and matrix MCP tools (send_message/send_dm/
send_reply/send_reaction/read_room/mark_read/join_room/open_dm/
invite_user/download_file).
2026-07-04 18:56:59 +02:00
atlas
500c50745b docs(gotchas): document nixSrc stable-docs-drv approach 2026-07-04 18:46:50 +02:00
damocles
672e77c849 feat(#2102): skip startup rebuild for stopped/unchanged containers 2026-07-04 18:45:27 +02:00
iris
99347a24d9 docs(agent-ui): update effort levels to include low and max
Three references to the effort level set in docs/web-ui/agent.md still
listed the old three-item set (medium/high/xhigh). Update all three to
match the expanded set added by PR 2221: low/medium/high/xhigh/max.

Closes #2220 (docs side).
2026-07-04 18:34:23 +02:00
iris
f4727e30ba docs(web-ui): update reading path to point at terminal-rendering.md
The 'How does the per-agent terminal render tool calls?' reading path
was pointing only at web-ui/agent.md. terminal-rendering.md is the
authoritative reference (added recently with the full row taxonomy
table). Update the pointer to send readers there first, with a
note that web-ui/agent.md has the high-level summary.
2026-07-04 18:06:55 +02:00
iris
bf39e014e3 docs(agent-ui): update per-stream rendering section, cross-ref terminal-rendering.md
The 'system' bullet was stale — it only mentioned the drop list
(init/result/rate_limit_event) and omitted the five specific handlers
added recently: plugin_install (muted note), commands_changed
(expandable details), compact_boundary (compact summary note),
thinking_tokens (in-place counter), and the generic catch-all.

Expand the bullet to cover the full dispatch shape, and add a
cross-reference to docs/terminal-rendering.md which has the
authoritative row taxonomy table and full dispatch walkthrough.
2026-07-04 18:06:55 +02:00
iris
231f2ae2f4 fix(dashboard): correct topology bulk-move endpoint description
The selection bar's M0V3 action uses two different endpoints:
- single agent: POST /api/topology/set-parent (form-encoded)
- multiple agents: POST /api/topology/set-parent-bulk (JSON array)

The previous text said 'POSTs to /api/topology/set-parent ... once
per selected agent' — wrong on both counts for multi-agent moves.
The bulk endpoint lands all moves in one topology.json commit.
2026-07-04 14:34:24 +02:00