Commit graph

3,572 commits

Author SHA1 Message Date
iris
8542f2ca42 swarm-ui: header links menu for swarm-wide services (hyperhive#3289)
Single 🔗 button in the Shell header (direction 1 of 3 proposed on the
issue) — one fixed element regardless of link count, so it can't
clutter as the list grows, and visible on every route since Shell
wraps all of them. Opens a popover listing whatever GET /api/links
returns (icon + label, opens in a new tab); hidden entirely when the
list is empty, same "don't render a dead affordance" rule the old
dashboard's H0M3 tiles follow for Forge/Matrix.

Docs: docs/swarm/ui.md gets a short section on the feature + the
contribute-your-own-entry idiom.

Verified: npm run build + npm run typecheck clean, headless-chromium
screenshots of both the closed and (temporarily forced open for the
screenshot only) open states, pixel-sampled to confirm the popover is
actually using the dark theme vars and not just looking that way in a
downscaled preview.
2026-08-15 14:24:52 +02:00
iris
ba3a9ed94f swarm-controller: serve swarm-wide service quick links (hyperhive#3289)
New `services.hyperhive.swarm.controller.links` option (listOf {label,
icon, url}, same shape as the per-agent hyperhive.dashboardLinks) plus
a new GET /api/links route serving it, same pattern as the existing
hives/GET /api/hives.

Rather than one central hardcoded list, each service's own module
contributes its own entry when actually enabled on the controller's
host: swarm-authelia.nix, hive-matrix.nix (gated on gui.enable too,
since / on that vhost only serves fluffychat then) and
hive-forge/default.nix (gated on behindGateway) each push one entry,
the same list-merge idiom services.hyperhive.gateway.localNames
already uses. swarm-ui.nix contributes a static entry for its own
same-origin swagger docs. Adding a future service's link is a nix-only
change to that service's own module.

Verified: cargo build/clippy/test -p swarm-controller clean, a
throwaway nixosSystem eval confirms all 4 entries merge correctly into
SWARM_CONTROLLER_LINKS, nix build .#swarm-controller succeeds.
2026-08-15 14:24:52 +02:00
atlas
176d95c0f0 feat(swarm-authelia): let an oidc client say it is a machine client
`renderClient` could only emit the authorization-code shape, so a
daemon client was expressed as an interactive one with an empty
redirect list. Authelia permits only the grants a client names, and an
omitted `grant_types` means authorization-code alone — so that shape
cannot obtain a token at all.

Measured against authelia 4.39.20, rendering exactly what this module
produced for `swarm-nats`:

    client_secret_basic → unauthorized_client: The OAuth 2.0 Client is
                          not allowed to use authorization grant
                          'client_credentials'
    introspection       → {"active":false}   (works)

Introspection is all the queue's responder needs today, which is why
nothing was visibly broken while the comment in `swarm-nats.nix`
described a grant that was never configured.

Adds `kind = "interactive" | "machine"` rather than inferring from an
empty `redirectUris`, because the two differ in what authelia permits
and not merely in what is populated. `openid` is dropped from a machine
client's scopes because authelia refuses that combination outright — a
daemon receives an access token and never an id-token.

An assertion rejects redirect URIs on a machine client: they are not
harmlessly unused, they mean the author believed a browser was
involved.

Refs #3274.
2026-08-15 13:33:31 +02:00
iris
cfc8f2b22c swarm-ui: add a components-library page (hyperhive#3288)
New /components route showing every ui primitive (Panel, StatusChip,
Table) in each mode it supports: Panel with/without a title,
StatusChip's four tones, Table populated and empty. Sample data only,
no API calls, so it renders identically regardless of backend state.
Linked from the Shell nav next to "overview".

Verified with npm run build + npm run typecheck, and a headless
chromium screenshot of the built dist.
2026-08-15 12:57:57 +02:00
iris
1e0ec9b5af docs(conventions): fix one more stale hive-c0re.nix bare-file ref
Same bug class the facts sweep hunted for across everything else —
hive-c0re.nix is a module directory now
(nix/host-modules/hive-c0re/), environment.nix is where
HYPERHIVE_HIVE_DOMAIN is actually set. Caught doing a final grep
across the merged sweep for the known bad patterns before pushing.
2026-08-15 12:45:22 +02:00
iris
3e9d7c68d8 docs(matrix): fix invite-wake mechanism and todo message format 2026-08-15 12:45:22 +02:00
iris
6eb43ba2c5 docs(forge): fix ci-log source ordering and binary path claim 2026-08-15 12:45:22 +02:00
iris
c870e230bf docs(conventions): fix stale internal refs verified against source
- MAX_AGENT_NAME lives in lifecycle/mod.rs, not bare lifecycle.rs
- agent_server::handle_send -> socket_server::handle_send (no agent_server
  module exists)
- AgentMeta response is missing matrix_accounts in the field list
- tool-group table missing list_containers/ack_until (added since written)
  and the forge/web_tools groups entirely
- #[tool] fns live on AgentServer in hive-agent-mcp/src/mcp/mod.rs, not a
  HiveServer in a nonexistent hive-ag3nt/src/mcp.rs; ToolGroup::tools()
  lives in hive-sh4re/src/permissions.rs, not lib.rs
- Capability + as_str also moved to permissions.rs; capability-check
  handler list was stale (agent_server.rs/mcp.rs don't exist)
- async-forms listener is bindAsyncForms in frontend/packages/shared,
  not assets/tabs.js + assets/app.js
- 'rebuild is the reconcile verb' described a monolithic lifecycle::rebuild
  that no longer exists — it's job_queue::templates::rebuild building a DAG,
  and flake.nix is no longer regenerated host-side on rebuild at all
2026-08-15 12:45:22 +02:00
iris
1cc1ace681 docs(approvals): fix stale internal refs verified against source
- meta::sync_agents signature (now takes &HiveEnv, not 3 loose params)
- lifecycle.rs -> lifecycle/host_config.rs bare-file ref
- nixosConfigurations.manager -> .ruth (no 'manager' name in flake.nix)
- manager socket path/owner: no /run/hyperhive/manager/ or manager_server,
  it's socket_server::start_manager on the standard per-agent runtime dir
- Spawn approval also fires ApprovalResolved (finish_approval always does,
  for every kind), not push_todo instead of a HelperEvent
- /agents/<n>/applied.git -> /applied/<n>/.git (matches the actual RO bind)
- lifecycle::rebuild / auto_update::rebuild_agent don't exist anymore;
  the reconcile verb is job_queue::templates::rebuild
2026-08-15 12:45:22 +02:00
iris
62f3cc4b19 docs(coordinator): fix stale DAG-history cap, wire request name, infra container list 2026-08-15 12:45:22 +02:00
iris
a17cc3612b docs(persistence): fix stale facts — reminders/todos moved in-container, vacuum ownership, topology writer, matrix glob, qgroup quotas shipped 2026-08-15 12:45:22 +02:00
iris
90be37c0c8 docs(swarm): fix stale hivectl peer-config claim, verified against hivectl/src/wg.rs 2026-08-15 12:45:22 +02:00
iris
3b24d08226 docs(swarm): fix stale four-wiring-sites table, verified against hive-gateway modules 2026-08-15 12:45:22 +02:00
iris
f5182d6804 docs(swarm): fix authelia's default vhost domain, verified against swarm-authelia.nix 2026-08-15 12:45:22 +02:00
iris
cfb50d8a40 docs(forge): fix stale nix option namespace (services.hyperhive.swarm.forge) 2026-08-15 12:45:22 +02:00
iris
8361d3f6a1 docs(ci): fix stale nix option namespace and ensure_mirrors file path 2026-08-15 12:45:22 +02:00
iris
af83a868e4 docs(knowledge): fix stale collaborator model and webhook delivery claims 2026-08-15 12:45:22 +02:00
iris
fd891913b0 docs(forge): fix stale config-PR framing and wrong timestamp-helper name 2026-08-15 12:45:22 +02:00
iris
0e84e72c21 docs(gateway): fix stale gateway.enable, selfSignedTls, rootUrl, vhost claims
Verified against nix/host-modules/hive-gateway/*.nix + hive-matrix.nix +
hive-forge/default.nix:
- services.hyperhive.gateway.enable was removed (gateway is now
  unconditional) — fixes the Dashboard link shape + Firewall posture
  sections, which described a gateway-off mode that no longer exists.
- gateway.selfSignedTls is a removed option (fails eval), not a
  deprecated-and-ignored one.
- The forge rootUrl auto-derivation now uses https:// behind the
  gateway (httpsPort), not http://.
- Vhost map + discovery-flow + local-dev sections used matrix.<hive> /
  forge.<hive>; current defaults are chat.<swarm-domain> and
  forge.<swarm-domain> (both swarm-domain-rooted, per hive-matrix.nix's
  gatewayHost and hive-forge's domain option).
- hive-c0re.nix is now a directory (nix/host-modules/hive-c0re/); pointed
  the HIVE_FORGE_URL reference at the actual file, environment.nix.
2026-08-15 12:45:22 +02:00
iris
150cb1be76 docs(matrix): fix stale matrix.<hive> vhost + assertion-list claims
Verified against nix/host-modules/hive-matrix.nix: gatewayHost's current
default is chat.<swarm-domain>, not matrix.<hive>, so the GUI mount point
and fluffychat client line were stale. Also rewrote the Assertion
rationale section, which named an assertion (hyperhiveDomain/serverName)
that doesn't exist in this module and missed the three SSO assertions
that do.
2026-08-15 12:45:22 +02:00
iris
f41acfcc6e docs(network): fix stale forge/matrix zone claim in resolver behaviour
Verified against nix/host-modules/hive-gateway/dnsmasq.nix + gateway.localNames
contributors (hive-forge, hive-matrix, swarm-authelia): forge and the matrix
gateway vhost are swarm-domain names (forge.<swarm-domain>, chat.<swarm-domain>),
not sub-domains of the hive's own domain as the doc previously claimed.
2026-08-15 12:45:22 +02:00
iris
066cd712ea docs(terminal-rendering): re-attribute dispatch logic to stream_enrich.rs, fix Write/TodoWrite/Bash dead-path claims
Verified against hive-agent/src/stream_enrich.rs and frontend/packages/agent/src/app.js:
- per-tool icon/summary/category classification moved server-side to
  stream_enrich.rs::enrich() a while ago; fmtToolUse/fmtArgsGeneric/toolIcon no
  longer exist in app.js -- the client now just dispatches on the backend-stamped
  _icon/_summary/_category/_body/_body_type fields. Rewrote the 'Renderer dispatch'
  and 'Salient-arg formatting' (was 'fmtToolUse patterns') sections to match, and
  retargeted the per-tool table's 'Everything else' row to fmt_args_generic.
- Write is no longer a rich diff row -- is_rich_tool() doesn't include it, and
  fmt_builtin_tool formats it identically to Read (flat, no count). Only Edit
  still gets the rich diff.
- TodoWrite and built-in Bash aren't in ALLOWED_BUILTIN_TOOLS (mcp_config.rs) any
  more than Task is -- flagged both as dead paths for consistency with the
  existing Task annotation.
- fixed stray 'ask* has an inline answer form' table note that contradicted the
  doc's own later 'Inline ask-operator answer' section (no such form exists).
- terminal.css path: frontend/packages/shared/src/terminal/terminal.css, not
  .../shared/src/terminal.css; marked npm dep is v18.x, not v4.x.
2026-08-15 12:45:22 +02:00
iris
4388719b76 docs(web-ui/agent): fix stale NavLink type name
Verified against hive-agent/src/web_ui/state.rs: the struct is AgentLink
(AgentLinkKind for kind), not NavLink -- NavLink doesn't exist anywhere in
the Rust or frontend source.
2026-08-15 12:45:22 +02:00
iris
26b55f34d3 docs(web-ui/shape): fix stale CSS bundle count, SSE route prefix, bind-retry cap claims
Verified against frontend/packages/dashboard/build.mjs, hive-c0re/src/dashboard/mod.rs,
and hive-agent/src/web_ui/mod.rs:
- dashboard ships 9 page CSS bundles + colors/theme/common, not 4
- dashboard SSE routes are /api/dashboard/stream + /api/dashboard/history, not
  /dashboard/stream + /dashboard/history
- per-agent bind_with_retry has a MAX_BIND_ATTEMPTS=12 cap (gives up), unlike the
  dashboard's genuinely uncapped retry loop
- assets/swarm.js, assets/call.js -> swarm.js, call.js (no assets/ dir exists)
2026-08-15 12:45:22 +02:00
iris
3e9f2f2fd5 docs(dashboard): fix stale facts found in source-verification sweep
- server-warnings banner: was described as disk-pressure-only; it's now
  a push-based registry with multiple producers (forge/CI boot
  failures, agent-state warnings), and shown on more standalone pages
  than listed
- browser tab title: actual default/format is "hyperhive // h1ve-c0re",
  not "hive / c0re"
- SW4RM container tree: ContainerView.parent comes from
  agent_config/topology.rs, not the ambiguous dashboard/topology.rs
  (which only holds set-parent endpoints)
- T00L GR0UPS: tool-group enumeration was missing "forge"; root agent's
  default (MANAGER_DEFAULT) is not literally "all groups" -- it excludes
  forge and web_tools
- ST4TS moved to its own /stats.html page a while back; section still
  called it a dashboard tab
- P33RS is a headline block within the SW4RM tab, not its own tab --
  contradicted the doc's own chrome-header description
- active model badge: reads hyperhive-harness.json's active_model
  field, not a bare harness/hyperhive-model file
- themed dialogs: modal.js lives in the shared package
  (@hive/shared/modal.js), and themedToast takes (message, opts) not
  a single options object
- graceful stop: backend uses a Signal/Drain job-queue node pair, not
  a "GracefulStop" transient kind; hivectl flag is `stop --graceful`,
  not a bare `--graceful`
- container_state_changed event: named a nonexistent
  auto_update::rebuild_agent as an emit site; actual sites are
  actions::approve and the job queue's own node execution

Verified against hive-c0re/src (dashboard/, stats/, job_queue/,
container_view.rs), hive-sh4re/src/permissions.rs, and the dashboard
frontend package (tabs.js, stats.js, swarm.js, builds.js, modal.js).

No structural/prose changes beyond what the fact corrections required.
2026-08-15 12:45:22 +02:00
iris
723e33ae6c docs(agent-hierarchy): fix stale topology.rs path, ManagerRequest, dead reminder_scheduler.rs ref, and hardcoded forge URLs 2026-08-15 12:45:22 +02:00
iris
720e5340de docs(boundary): fix answer-question path and nonexistent AgentRequest type 2026-08-15 12:45:22 +02:00
iris
1277f5d4ca docs(security): fix stale forge.rs path, GetAgentMeta validator, hive-priv table 2026-08-15 12:45:22 +02:00
iris
3e49652511 docs(gotchas): fix wrong claim that hyperhive-events.sqlite lives in state dir
Verified against hive-agent/src/paths.rs: harness-internal files
(hyperhive-events.sqlite, hyperhive-turn-stats.sqlite, hyperhive-model)
live in the separate harness dir, specifically kept out of the
agent-visible state dir.
2026-08-15 12:45:22 +02:00
iris
637d36a11f docs(turn-loop): fix wrong HelperEvent lifecycle-event list
Verified against hive-sh4re/src/manager.rs and docs/approvals.md: only
ApprovalResolved/ContainerCrash/NeedsUpdate/QuestionAsked/QuestionAnswered
are HelperEvents delivered as inbox messages. spawned/rebuilt/killed/
destroyed/needs_login/logged_in/config_ready aren't HelperEvent variants
at all — they deliver via Coordinator::push_todo/push_todo_submitter
(the in-container todo socket), not the broker inbox.
2026-08-15 12:45:22 +02:00
iris
efc30a0bcf docs(turn-loop): fix stale topology::parent_of reference
Verified against hive-c0re/src/agent_config/topology.rs: there is no
parent_of function; <parent> sentinel resolution happens in
topology::resolve_recipient.
2026-08-15 12:45:22 +02:00
iris
b662bc8578 docs(turn-loop): fix stale plugin defaults + dashboardLinks reader
Verified against nix/agent-modules/claude-settings.nix (claudeMarketplaces
and claudePlugins defaults both gained a second entry — the hive's own
claude-plugins marketplace and base@hyperhive plugin — that the doc never
picked up) and hive-agent/src/web_ui/state.rs (dashboardLinks is read by
the harness's own per-agent web UI, not hive-c0re / the operator
dashboard).
2026-08-15 12:45:22 +02:00
iris
6d74476572 docs(turn-loop): fix stale rmcp version + AgentRequest::Wake reference
Verified against Cargo.lock (rmcp resolves to 2.2.0, Cargo.toml pins
"2") and hive-core-agent-sock/src/lib.rs (the Wake variant lives on
Request there; hive_sh4re::AgentRequest doesn't exist).
2026-08-15 12:45:22 +02:00
iris
0f92e58ebb docs(turn-loop): fix stale context_window_tokens module path + on-boot files dir
Verified against hive-agent/src/harness_state.rs (context_window_tokens
lives there, only imported into events.rs) and hive-agent/src/paths.rs
(config_dir() defaults to /run/hive-config, deliberately separate from
/run/hive/ which holds the per-agent socket).
2026-08-15 12:45:22 +02:00
iris
ac58823eb3 docs(turn-loop): fix stale AgentRequest/ManagerRequest wire-type names
Verified against hive-agent/src/main.rs and hive-core-agent-sock/src/lib.rs:
there is no AgentRequest/AgentResponse or ManagerRequest/ManagerResponse
alias anywhere in the tree — hive-agent uses hive_core_agent_sock's
unified Request/Response enum directly.
2026-08-15 12:45:22 +02:00
iris
844337ca91 docs(gotchas): fix stale set_nspawn_flags path + SPA-fallback file/paths
Verified against hive-c0re/src/lifecycle/host_config.rs (function lives
in the host_config submodule, not bare lifecycle::) and
nix/host-modules/hive-matrix.nix (the working Accept-header SPA
fallback lives there, serving fluffychat at the vhost root /index.html,
not a /matrix/ path prefix in a nonexistent hive-gateway.nix).
2026-08-15 12:45:22 +02:00
iris
4f03a82cc5 docs: fix 3 more stale dashboard.rs refs argus caught in review
hive-c0re/src/dashboard.rs became a module directory
(hive-c0re/src/dashboard/) a while back; three more references to it
as a single file survived the #3281 sweep (conventions.md x2,
web-ui/shape.md's StateSnapshot pointer). Same bug class the sweep
was hunting for, argus caught it in review.
2026-08-15 12:45:22 +02:00
iris
dd8b5db7ab docs: fix remaining stale internal references from the #3281 sweep
Two follow-ups the per-file sweep workers flagged but couldn't fix
themselves (either not their assignment, or not visible from their
worktree):

- web-ui/dashboard.md's P33RS tab named dashboard.rs, which no longer
  exists (hive-c0re/src/dashboard/ is a module dir now); the function
  moved to state_snapshot.rs.
- approvals.md and conventions.md used hive_ag3nt:: as a Rust
  module-path prefix. hive-agent is a bin-only crate (no lib target),
  so that prefix never resolved to anything; also fixed the
  hive-ag3nt/prompts/system.md path to the real hive-agent/prompts/.

All three verified directly against the current source tree, not
guessed.
2026-08-15 12:45:22 +02:00
iris
a7f375190a docs(readme): drop Rust function-name citation for plain-language behavior 2026-08-15 12:45:22 +02:00
iris
f29df9cadb docs(approvals): trim historical framing, dedupe ask/answer with conventions.md 2026-08-15 12:45:22 +02:00
iris
ea18ebeff4 docs(snapshot-store): cross-link the state subvolume to persistence.md 2026-08-15 12:45:22 +02:00
iris
e418de0f73 docs(coordinator): trim changelog-style framing, drop review-comment quote 2026-08-15 12:45:22 +02:00
iris
c14d932687 docs(persistence): dedupe destroy/purge + agent_power against other sections, trim historical framing 2026-08-15 12:45:22 +02:00
iris
79a02f6859 docs(swarm): trim tuwunel internals to the operator-relevant fact 2026-08-15 12:45:22 +02:00
iris
b02af39007 docs(swarm): point sso.md's secrets section at secrets.md instead of restating it 2026-08-15 12:45:22 +02:00
iris
42282410ad docs(swarm): cross-link services.md to sso.md and secrets.md 2026-08-15 12:45:22 +02:00
iris
c681b8a340 docs(swarm): dedupe CA summary, drop stale/inaccurate fn refs 2026-08-15 12:45:22 +02:00
iris
93bb3a294f docs(forge): reframe changelog-style asides as present-tense gotchas 2026-08-15 12:45:22 +02:00
iris
8a2ffbbef7 docs(ci): fix required-check contradiction, dedupe bootstrap, trim history 2026-08-15 12:45:22 +02:00
iris
fea40ed770 docs(matrix): rephrase build-fix intro away from changelog framing 2026-08-15 12:45:22 +02:00