Commit graph

1,661 commits

Author SHA1 Message Date
iris
60042d877e docs(options): emit markdown only, render HTML in website
Per #1407 review: the options reference should be markdown here; the
HTML + CSS belongs in the website repo where the theme lives and the
stylesheet can be shared with /docs.

- nix/docs/default.nix: drop the cmark-gfm HTML rendering, the inline
  <style>, and the HTML index. Emit index.md + host.md + agent.md only
  (CommonMark from nixosOptionsDoc).
- Remove nix/docs/style.css.
- Update docs/gotchas.md + CLAUDE.md to describe the md-only output and
  point at the website for HTML rendering.

The website (hyperhive/website#26) renders these .md to themed HTML for
/options/, sharing one docs.css with the prose /docs/ tree.
2026-06-05 19:36:54 +02:00
iris
9f06899238 docs(web-ui): move css-vars.md into web-ui/
The CSS theme-variable reference documents the dashboard/agent web-UI
stylesheets, so it belongs under docs/web-ui/ alongside shape/dashboard/
agent. Wire it into the web-ui.md index (split list + reading path) and
the CLAUDE.md file map. Closes #1405.
2026-06-05 19:21:43 +02:00
iris
f84336b287 docs(gateway): drop openFirewall default-change note
Per review: remove the 'used to default to true' breaking-change
paragraph from the forge openFirewall section.
2026-06-05 19:06:10 +02:00
iris
093116f5e1 docs(gateway): document forge httpPort, sshPort, openFirewall, rootUrl options
The "hive-forge container shape" section described the container
isolation model but omitted the port and firewall knobs that operators
need when exposing forge externally or overriding the Forgejo ROOT_URL.

Add two subsections:

"Network and port configuration" — covers httpPort (default 3000),
sshPort (default 2222), and openFirewall (default false, was previously
true — breaking change note included). Explains the shared-netns
rationale for why openFirewall is safe to leave off for agent use but
must be set for browser/external-git-client access. Clarifies that
forge.behindGateway obviates forge.openFirewall for HTTP reach.

"rootUrl override" — documents forge.rootUrl (default null) with the
auto-derivation table (behindGateway ? http://domain/ : http://domain:port/)
and explains when to override (TLS, https:// clone URLs, bespoke shapes).
Notes the auto-derivation always produces http://, so TLS operators must
set rootUrl explicitly.
2026-06-05 19:06:10 +02:00
damocles
782438be89 fix(#1374): make /shared writable by all agents (sticky world-writable) 2026-06-05 18:46:16 +02:00
iris
f2d57c8538 fix: drop stale claim that ruth is always reachable in allowedRecipients
The sentence 'ruth is always reachable regardless of the list' documents
a bug in check_send_allowed (name-based carve-out), not intended
behavior. The structural parent carve-out is fine to mention since it's
topology-based, not name-based.

Updated example to show [ "operator" ] (restrict to operator-only)
and replaced the ruth-name claim with a note about the parent carve-out.
2026-06-05 18:45:06 +02:00
iris
da8892aac2 fix(docs/turn-loop): correct allowedRecipients example name to ruth
The manager's logical name is 'ruth' (MANAGER_AGENT post-#954).
The example used the stale 'manager' placeholder.
2026-06-05 18:45:06 +02:00
iris
3328b396e7 docs(turn-loop): document allowedRecipients, claudePlugins, cargo.shortMessages
Five per-agent agent.nix options were undocumented:

- hyperhive.allowedRecipients — restricts which peers send() accepts;
  note added inline to the send tool description
- hyperhive.claudeMarketplaces — Claude Code plugin marketplace sources
  (default: official Anthropic marketplace)
- hyperhive.claudePlugins — plugin specs installed at harness boot
- hyperhive.claudePluginsAutoUpdate — pull latest marketplace index
  before install; off by default
- hyperhive.cargo.shortMessages — shell wrapper injecting
  --message-format short on cargo compile subcommands; on by default
2026-06-05 18:45:06 +02:00
iris
9a19919943 fix: correct auto-accept invites claim — daemon wakes agent, agent decides
The daemon does not call join_room_by_id. It fires a wake and writes
to mcp-loose-ends/matrix.json; the agent calls list_invites + join_room.

Replace the inaccurate 'Auto-accept invites' paragraph with 'Invite
wakes' describing the actual flow. Merge the pending-invites paragraph
into a single accurate block.
2026-06-05 18:43:41 +02:00
iris
19a09c865e docs(tools/matrix): document auto-accept invites and pending-invite loose ends 2026-06-05 18:43:41 +02:00
iris
010d0a422a docs(matrix): document trustedServers and maxRequestSize options
The matrix.md provisioning section mentioned trustedServers in passing
("wired up later by extending trustedServers") but never explained it
as a configurable option, and maxRequestSize was undocumented entirely.

Add a "Configuration tuning" subsection before "Assertion rationale":
- trustedServers (default []) — list of peer homeserver names to trust;
  federation is protocol-on but no peer trusted until listed; link to
  swarm.md for the multi-hive use case.
- maxRequestSize (default 20 MB) — request body limit matching the
  matrix-spec recommendation; when and why to raise or lower it.
2026-06-05 18:40:52 +02:00
iris
09e2ad326c fix: update PrivRequest table to match actual hive-sh4re::priv_proto variants
Replace stale AddBindMount/RemoveBindMount/SetNetworkIsolation/ReloadGateway
entries with the actual current variants from hive-sh4re/src/priv_proto.rs:

- WriteNspawnFlags (replaces AddBindMount/RemoveBindMount/SetNetworkIsolation)
- WriteResourceLimits (new)
- RemoveServiceDropin (new)
- DaemonReload (new)
- ChownSocketDir / ChmodSocketDir (new)
- RunForgeAdmin (new)
- RestartMatrixDaemon (new)
- ReloadGatewayNginx (renamed from ReloadGateway)
2026-06-05 18:40:44 +02:00
iris
a960dcf91a docs(boundary): rewrite sequencing list as prose, drop checklist markers 2026-06-05 18:40:44 +02:00
iris
28df69286d docs(security): document hive-priv privilege separation model 2026-06-05 18:40:44 +02:00
damocles
b33b3f315c fix(#1397): point send-refused message at <parent> sentinel not stale manager name 2026-06-05 18:36:42 +02:00
iris
330fdf8dc7 fix(docs/turn-loop): correct forge.url tea-login description
The tea-login oneshot writes ~/.config/tea/config.yml directly via
heredoc; it never calls 'tea login add'. Fix the implementation detail.
2026-06-05 18:30:29 +02:00
iris
20269873bd docs(turn-loop): also document hyperhive.icon option
SVG path for per-agent visual identity — used in the page header,
favicon, Forgejo profile avatar (forge-avatar-sync), and Matrix
profile avatar (matrix-avatar-sync).
2026-06-05 18:30:29 +02:00
iris
8f4a8fbc07 docs(turn-loop): document passwordlessSudo, dashboardLinks, extraFiles, connectivity overrides
Five previously undocumented per-agent agent.nix options:

- hyperhive.user.passwordlessSudo: default-true sudo grant; note added
  with cross-reference to companion user.* options in agent-hierarchy.md
- hyperhive.dashboardLinks: declarative extra nav links on the dashboard
  card and per-agent page header; table of fields (label/url/icon)
- hyperhive.frontend.extraFiles: overlay files over the default agent dist;
  source/target semantics, constraints, collision guard, mergedDist
- hyperhive.forge.url: per-agent Forgejo base URL for tea login; default
  localhost:3000; validation note
- hyperhive.matrix.url: per-agent matrix-sdk homeserver URL; default
  localhost:8008; per-agent override use-cases (remote hive, VPN)
2026-06-05 18:30:29 +02:00
iris
83059a0fcb docs(turn-loop): document hyperhive.autoCompact nix option
The compaction section already documented HIVE_COMPACT_WATERMARK_TOKENS
but didn't mention the per-agent nix option (hyperhive.autoCompact,
default true) that maps to it.

Add a short note after the watermark paragraph explaining that operators
can set autoCompact = false in agent.nix to disable proactive compaction,
and note the reactive path still applies. Useful for sonnet/opus agents
where the 75% heuristic fires before the session is actually full.
2026-06-05 18:28:43 +02:00
iris
2c7d723de6 docs(coordinator): document agentCpuQuota, agentMemoryMax, preBuildAgentTemplates
Three host-level NixOS options in services.hyperhive.c0re were
undocumented. Add a new 'Host-level resource + performance options'
section to coordinator.md covering:

- agentCpuQuota (default 200%) — CPUQuota= drop-in per container
- agentMemoryMax (default 4G) — MemoryMax= drop-in per container
- preBuildAgentTemplates (default false) — pre-fetch agent closures
  into host nix store; trade system closure size for first-spawn speed;
  warn against enabling on aarch64 hosts
2026-06-05 18:27:05 +02:00
iris
9d7a3a7d9a docs(matrix): document hive Matrix Space creation and persistence 2026-06-05 18:25:19 +02:00
iris
975ffd08a2 docs(tools/forge): note pr-reviews list includes inline comments per review 2026-06-05 18:24:03 +02:00
iris
a10a3a8699 docs(tools/bash): document daemon+bridge architecture and transient wake 2026-06-05 17:02:31 +02:00
iris
fdd100194e docs(gateway): document security headers + HSTS opt-in option 2026-06-05 17:01:05 +02:00
iris
c1d1328426 docs(gateway): document custom 401 page in HTTP Basic auth section 2026-06-05 17:01:05 +02:00
iris
f79b0e601f docs(dashboard): add descriptions field to tool-groups + capabilities API response shape
GET /api/tool-groups and GET /api/capabilities both return a
descriptions map (name → short string) added in feat(#1082). The
map drives native browser tooltips on column headers in the
P3RM1SS10NS tab. The API docs still showed the old 2-field shape.
2026-06-05 16:59:29 +02:00
iris
76040407b6 docs(tools/matrix): update wake body format to reflect rich unread summary
The matrix wake body description said '[matrix] <sender> in <room>:
<first-100c>...' (old single-line teaser). After feat(#1137) it's now
a richer format:
- Single room, 1 message: terse one-liner with sender + body
- Single room, N messages: count + room name
- Multi-room: bulleted list with per-room summaries

Also note that the same breakdown appears in get_loose_ends via the
UnreadMatrix entry.
2026-06-05 16:58:14 +02:00
iris
972a3ead68 docs(knowledge): document hive-wide knowledge repo + /knowledge bind-mount
The internal/knowledge forge repo and its /knowledge container bind-mount
have been live since feat(#1167) but had no docs/ entry — only a mention
in the agent system prompt.

Add docs/knowledge.md covering:
- Agent access (/knowledge read-only bind-mount inside every container)
- Repository layout (internal/knowledge, auto-seeded README)
- Sync mechanism (webhook on push + periodic pull fallback)
- State paths (/var/lib/hyperhive/knowledge on host)
- Contribution workflow (fork + PR, no direct push)

Also add a file-map entry and reading-path bullet in CLAUDE.md.
2026-06-05 16:56:00 +02:00
damocles
fb726197ea fix(#1375): clean up pedantic warnings and re-enable -D warnings without pedantic bypass 2026-06-05 16:55:09 +02:00
iris
da7f1d6c45 docs(tools): add hivectl.md — operator host CLI reference
hivectl has verbs scattered across CLAUDE.md and domain docs (gateway.md
has the gateway subcommands, matrix.md has a brief mention) but no
single cheatsheet. Add docs/tools/hivectl.md covering all subcommands:

- forge create-user: provision/refresh agent or human forge accounts
- matrix create-user / sync-admin / promote-user / reset-password
- gateway create-user / delete-user / list-users (htpasswd management)
- agents restart / restart-all (container lifecycle via admin socket)
- choom <name> [--fresh]: interactive claude session in agent container

Also add a reading-path entry to CLAUDE.md pointing at the new file.
2026-06-05 16:53:46 +02:00
iris
a650187d23 docs: fix bash-tasks retention + matrix provisioning daemon restart
persistence.md: bash-tasks/ says "persist until container purge" but
bash_tasks_vacuum now runs hourly and deletes terminal task trios older
than 48 hours. Update the description to reflect actual retention policy.

matrix.md: add step 6 to the Provisioning flow section documenting that
hive-c0re restarts hive-matrix-daemon immediately after writing the
access_token (fix for issue #1329). Previously the doc stopped at token
write; the restart + .path-trigger fallback interplay was undocumented.
2026-06-05 15:45:14 +02:00
iris
7d1d5d9bff docs(agent): add GET /api/state, /api/dashboard-state, /api/loose-ends, /api/stats to per-agent endpoints 2026-06-05 15:35:33 +02:00
iris
0d84e11dcd docs(persistence): document hyperhive-status in state/ and mcp-loose-ends/ in harness/ 2026-06-05 15:32:22 +02:00
atlas
734fe88858 fix(ci): unblock nix flake check after clippy 0.1.95 bump (#1368)
The nixpkgs bump to clippy 0.1.95 / cargo 1.95.0 added + strengthened a
large batch of lints. CI denied ALL warnings (`-D warnings`) against the
`pedantic = warn` workspace lint, so the bump hard-failed `nix flake
check` workspace-wide with zero code changes — and would recur on every
future clippy bump.

Posture fix (the durable part): CI now runs
`-D warnings -A clippy::pedantic`, so the default/correctness/style lints
stay a hard gate while the "extra, opinionated" pedantic group is
advisory only (still `warn` for local `cargo clippy` via the workspace
lints table, just non-blocking in CI). `-A` rather than `-W` so the
group drop doesn't re-enable the specific pedantic lints the workspace
allows (e.g. `must_use_candidate`).

Also fixes the genuine DEFAULT/STYLE lints the bump surfaced across the
workspace (doc_lazy_continuation, collapsible_if, ptr_arg,
match_like_matches_macro, …) via `cargo clippy --fix` + manual stragglers
(`too_many_arguments` #[allow] on the host-config constructors), and
three tests that had rotted while the CI runner was offline (#1221):
- topology::top_level_agents_in_multi_root — hardcoded unsorted expected
- rebuild_queue::depends_on_evicted_dep_counts_as_resolved — needs
  MAX_HISTORY_PER_KIND newer terminals to evict, not one
- coordinator::agent_paths doctest — illustrative pseudo-code, now `ignore`

Validated: clippy + formatting + cargo-test checks all pass.
2026-06-05 15:32:07 +02:00
iris
35717c7bac docs(tools/forge): add comments --tail and pr-reviews --approve/--request-changes/--comment to cheatsheet 2026-06-05 15:30:33 +02:00
damocles
f201f04d4e fix(#1329): restart hive-matrix-daemon after token write so new credential is picked up immediately 2026-06-05 15:30:21 +02:00
iris
92b32d06fb fix(clippy): fix all clippy warnings in hive-ag3nt, hive-forge, hive-matrix-mcp, hive-sh4re
Fixes all clippy -D warnings errors in the crates iris owns:

hive-sh4re:
- doc_lazy_continuation: add blank /// separator in priv_proto.rs
- doc_markdown: backtick PRIVATE_NETWORK=0 / PRIVATE_NETWORK=1

hive-matrix-mcp:
- map_unwrap_or: map().unwrap_or_else() -> map_or_else() in paths.rs
- collapsible_if: if-let chains in wake.rs
- doc_markdown: backtick M_UNKNOWN_TOKEN in main.rs
- cast_possible_truncation: usize/u64 -> u32::try_from in handlers.rs
- map_unwrap_or: map_or_else() in handlers.rs
- manual_let_else: match Ok(r) => r, Err => return -> let Ok in handlers.rs
- unused_async: remove async from list_invites; update socket.rs call site

hive-forge:
- doc_markdown: backtick REQUEST_CHANGES / APPROVED / COMMENT in pr_reviews.rs
- unnecessary_wraps: list_reviews_text returns () not Result<()>
- doc_markdown: backtick start_page / last_page in comments.rs
- cast_possible_truncation: PAGE_SIZE u64 -> usize; remove as usize casts

hive-ag3nt:
- collapsible_if: if-let chains in events.rs and mcp.rs
- single_match_else: match -> if let in events.rs and mcp.rs
- items_after_statements: hoist STATUS_MAX_CHARS const in mcp.rs
- map_unwrap_or: map_or_else() in mcp.rs and mcp_loose_ends.rs
- cast_possible_truncation: usize -> u32::try_from in mcp.rs
- doc_markdown: backtick snake_case in mcp.rs, needs_update/deployed_sha
  in web_ui.rs, HISTORY_CAPACITY in web_ui.rs
- identical_match_arms: combine manage_root_agent | query_agent_state
- redundant_closure: |s| s.to_string() -> ToString::to_string in web_ui.rs
- duration_suboptimal_units: from_secs(3600) -> from_hours(1) in turn.rs

Remaining failures in hive-c0re (39), hive-priv (8), hive-bash-mcp (11)
are owned by damocles.
2026-06-05 14:35:12 +02:00
iris
6a35f48458 fix(sh4re): add blank doc comment line to fix clippy doc_lazy_continuation 2026-06-05 14:35:12 +02:00
iris
058035d10a docs(dashboard): note status-age chip data-set-at live-tick in container row docs 2026-06-05 14:32:09 +02:00
iris
429b0583ad docs(shape): document keyed DOM cache pattern alongside paintAtomic 2026-06-05 14:31:59 +02:00
iris
a9c28088cb docs(tools/matrix): add invite_user, join_room, list_invites to matrix tool docs 2026-06-05 14:31:30 +02:00
iris
9e555e228b docs(dashboard): note that queued + terminal rebuild-queue timestamps also live-tick 2026-06-05 14:31:16 +02:00
iris
1c1e1dc5a9 docs(dashboard): document live countdown ticker for schedule next-fire and reminder due-at labels 2026-06-05 13:50:44 +02:00
iris
c0d7ec6572 feat(dashboard): live countdown ticker for reminder + schedule due-at labels
Reminder due-at labels ("in 3m 45s") and schedule next-fire cells
were computed once at render time and never updated. For short-horizon
reminders the stale count was visually misleading.

Both renderers now stamp data-due-at=<unix> on their respective
elements (.reminder-due / .sched-due). A shared 1s setInterval
ticker walks all live elements and rewrites textContent using
fmtDuration / fmtAgo — same zero-re-render pattern as the
existing question TTL chip ticker.
2026-06-05 13:50:44 +02:00
iris
bf25d71fc9 docs(agent): update model quick-picker description — list is now configurable 2026-06-05 13:48:03 +02:00
iris
1f54a07195 feat(agent): read available models from HIVE_AVAILABLE_MODELS env var
web_ui.rs: add available_models() helper that reads HIVE_AVAILABLE_MODELS
(comma-separated, injected by services.hyperhive.availableModels nix option).
Falls back to ["haiku", "sonnet", "opus"] when absent or empty. Field added
to StateSnapshot so the frontend receives the list on cold-load.

app.js: replace hardcoded MODEL_ALIASES array with availableModels module var.
Seeded from state.available_models before setHeader/populateOverflowMenu on
first /api/state load. Well-known aliases (haiku/sonnet/opus) still get their
descriptive labels; operator-declared custom model names show the name itself.

Implements the frontend + web_ui.rs side of issue #1359 (nix option shipped
separately in PR #1360 by atlas).
2026-06-05 13:48:03 +02:00
iris
6c57b2b4e0 fix(dashboard): preserve checked meta-input checkboxes across MetaInputsChanged re-renders
renderMetaInputs snapshots the set of checked data-meta-input values before
calling root.replaceChildren(), then restores them after rebuilding the list.

Without this, a MetaInputsChanged SSE event (e.g. fired when a concurrent
meta-update completes) would silently wipe any checkboxes the operator had
ticked but not yet submitted — forcing them to re-select their inputs.
2026-06-05 13:47:40 +02:00
atlas
e5da9654f1 feat: add hyperhive.availableModels option for configurable model picker
Adds a per-agent hyperhive.availableModels list option (default
[ haiku sonnet opus ]) rendered into the HIVE_AVAILABLE_MODELS env var
(comma-separated) so the per-agent web UI model quick-picker lists
exactly the configured models instead of a hardcoded set. Operators set
a shared default hive-wide or narrow it per-agent.

An assertion guards that hyperhive.model is present in the list so the
picker can always offer the model the agent is actually running.
2026-06-05 13:47:33 +02:00
iris
b6cda34371 docs(web-ui): note live-ticking approval request-age chip + precise stale threshold 2026-06-05 13:47:00 +02:00
iris
4731b64f3e feat(dashboard): live ticker for approval request-age chips + precise stale threshold
Approval cards render their age label ("requested N ago") at
render time from a cold /api/state or an approval_added /
approval_resolved SSE event. An approval sitting pending for
an hour would show a stale "0s ago" unless one of those events
fired in the meantime.

Fix: stamp data-requested-at=<unix> on each .approval-ts span.
A 1s setInterval ticker reads all live chips, recomputes the
relative time via fmtAgo, and toggles .stale (amber highlight)
at exactly the 1-hour threshold — no longer dependent on
the next full re-render cycle to apply the amber colour.
2026-06-05 13:47:00 +02:00