Commit graph

2,250 commits

Author SHA1 Message Date
iris
a35fd1dcf2 docs(matrix-mcp): document send_file, download_file, and unread guard in server instructions
The MCP server instructions string omitted three behaviours added in
earlier PRs, leaving agents without context on them:

- send_file / download_file tools (#1829, #1830)
- [file:]/[image:]/[audio:]/[video:] attachment markers in read_room (#1830)
- unread guard: send_message, send_dm, send_file, send_reply all
  reject if the room has unread messages; read_room + mark_read
  are required first (#1828)

Closes #1828. Closes #1829. Closes #1830.
2026-07-01 19:05:54 +02:00
damocles
d2a0493092 address mara: drop clippy allow on run_graceful_stop — return () since the body is infallible, wrap the dispatch arm 2026-07-01 19:05:24 +02:00
damocles
c7bac398b2 address mara: drop CompactionMode, always checkpoint-then-compact 2026-07-01 19:05:24 +02:00
damocles
fc42f97691 parallelize graceful agent drains, serialize container stops on fast lane; unify shutdown+checkpoint+compact prompt 2026-07-01 19:05:24 +02:00
damocles
f6d9ca7f99 fold forge_cursor into hyperhive-harness.json + prose comments (mara/argus review) 2026-07-01 18:52:56 +02:00
damocles
2549cc51ba fix(#2106): persist forge-notify dedupe cursor to disk so rebuilds don't re-deliver the unread backlog 2026-07-01 18:52:56 +02:00
iris
5264828091 fix: view-queue link + agent inbox shows unread messages only
fix(dashboard): update 'view queue' link to /builds.html

The build queue moved to its own /builds.html page. The queue-summary
'view queue →' link in tabs.js still pointed at /core.html, so clicking
it landed on the wrong page.

fix(broker): filter agent inbox to unread (acked_at IS NULL)

recent_for was returning all messages regardless of ack state, so the
agent inbox showed everything even after 'mark all read'. Now filters
to acked_at IS NULL — mirroring exactly what mark_all_read drains —
so the inbox empties on reload after the operator drains it.
2026-07-01 18:41:43 +02:00
damocles
a05d093d19 harden hive-mcp-http: restart=always + document failure-mode/port-collision (atlas review) 2026-07-01 18:39:28 +02:00
iris
cf16f81dee fix(terminal): add missing .tool-result-block.error red rule 2026-07-01 18:34:03 +02:00
iris
57f936af63 fix(agent): strip tool_use_error tags and render errors in red
When a tool call fails, claude wraps the result text in
<tool_use_error>...</tool_use_error> XML tags. The terminal was
displaying these raw, producing output like:
  '<tool_use_error>File has not been read yet.</tool_use_error>'

Fix renderToolResult in app.js:
- Check c.is_error on the tool_result content block.
- Strip the <tool_use_error>...</tool_use_error> wrapper from the text.
- Render error results with a '✗' prefix under '.tool-result.error'
  (flat, ≤120c) or '.tool-result-block.error' (<details>, longer text).

Add .live .tool-result.error { color: var(--red); } to terminal.css
so error results are visually distinct (red, same as turn-end-fail).

Update terminal-rendering.md row taxonomy to document the two new
error row classes.

Closes #2104.
2026-07-01 18:34:03 +02:00
damocles
3c10b00460 feat(#2038): wire persistent hive-mcp-http daemon behind hyperhive.mcp.httpPort 2026-07-01 18:04:14 +02:00
damocles
4a82ed02cf feat(#2038): render http mcp url when HYPERHIVE_MCP_HTTP_PORT set 2026-07-01 17:58:22 +02:00
damocles
ecba548787 feat(#2038): streamable-http mcp transport for hyperhive server 2026-07-01 17:55:44 +02:00
damocles
621ee66133 fix(#2022): seed claude onboarding+trust via a boot-time oneshot 2026-06-29 18:41:42 +02:00
atlas
34e12e97a3 address argus: catch nix /* */ block comments too
mode_of mapped .nix to hash-mode (# only); nix also supports /* */ block
comments, so a long one would slip past. Split .nix into its own 'nix' mode
that handles BOTH # line comments and /* */ blocks. .sh stays hash (no block
comments in sh). Verified: tree still 6 offenders (no nix block offenders), and
a 33-line nix /* */ block is now caught.
2026-06-29 18:35:55 +02:00
atlas
bd86a3c1dd feat(#2081): CI lint for comment blocks over 30 lines
Flags any contiguous comment block longer than 30 lines — the threshold
above which a why/impl-notes block should move to docs/ rather than live
in-code (the #2077 rubric, made self-enforcing).

- scripts/check-comment-blocks.sh: git+awk, mirrors check-issue-refs.sh's
  capture-output shape (robust to xargs batching). Handles # line comments
  (nix/sh), // line comments (rs/js/ts), and /* */ (rs/js/ts/css) + <!-- -->
  (html) block comments. Blank separates line-comment blocks; a blank inside
  a /* */ / <!-- --> block stays part of it. lint:allow-long-comment escape
  hatch. Threshold is a tunable constant.
- ci.yml: own 'comment-block lint' job, kept OUT of required checks while the
  tree settles (red signal, not a merge gate), like the tracker-tag lint.

Current tree has 6 blocks > 30 (all in the frontend + hive-c0re-core #2077
slices, none in nix/infra): matrix-accounts.js, permissions.js,
stream-worker.js, terminal.js, hivectl.rs:1036, assets.rs. Non-required, so
non-blocking — they're the remaining #2077 targets for those area owners.
2026-06-29 18:35:55 +02:00
damocles
962f417509 fix(#2088): drop tracker-tags from comments.rs prose so ci lint passes 2026-06-29 18:22:12 +02:00
damocles
1cff77f5fa fix(#2088): merge pr review bodies into hive-forge comments listing 2026-06-29 18:22:12 +02:00
atlas
689a217c39 docs(#2077): drop impl-history provenance from runner.rs module doc
'Mirrors the logic previously embedded in hive-ag3nt' is pure provenance
(where the code moved from) — the #2077 rubric says drop impl-history. The
rest of my slice (nix modules + hive-priv/matrix-mcp/bash-mcp + forge.rs) is
already lean: surveyed it, the long comment blocks are all legit why/invariant/
contract docs under the 30-line threshold, not bloat.
2026-06-29 18:16:07 +02:00
damocles
d3577aad29 fix(#2058): drop false mit license tags from docs + assets derivations 2026-06-29 01:42:35 +02:00
damocles
cd5b731884 refactor(#2058): drop claude.md docs pointer, keep nix option + --add-dir 2026-06-29 01:42:35 +02:00
damocles
362d392993 refactor(#2012): docs in own derivation, ship via claude --add-dir (no ~/.claude clobber) 2026-06-29 01:42:35 +02:00
damocles
e6bc621f59 fix(#2012): gc-safe docs claude.md via /etc indirection + option clobber note 2026-06-29 01:42:35 +02:00
damocles
3fb5cb863b feat(#2012): ship hyperhive docs as a nix asset + opt-in ~/.claude pointer 2026-06-29 01:42:35 +02:00
damocles
3d33a11f3b refactor(#2077): drop dev-assets tree + nix/ pointer, keep prose layout note 2026-06-29 01:37:32 +02:00
damocles
5be8be764a refactor(#2077): collapse dev-assets tree in assets.rs to a nix/assets.nix pointer 2026-06-29 01:37:32 +02:00
iris
95b866a53d refactor(fe): trim >30-line comment blocks (second pass, #2077) 2026-06-29 01:05:53 +02:00
iris
ccc69bbc7b fix(dashboard): contain rebuild spinner within icon boundary 2026-06-29 01:05:34 +02:00
damocles
7ba5193167 refactor(#2077): drop impl-history from hive-sh4re asset/path comments 2026-06-29 00:51:38 +02:00
damocles
b1502392e5 docs(#2067): regenerate hivectl-cli.md for trimmed choom help 2026-06-29 00:50:53 +02:00
damocles
2248881be8 docs(#2067): trim choom prose in code, link to docs/tools/hivectl.md 2026-06-29 00:50:53 +02:00
damocles
0125fcfae8 feat(#2067): choom --continue passes through to claude --continue (drop --resume translation) 2026-06-29 00:50:53 +02:00
damocles
c5847e25ea feat(#2067): choom takes optional session id to resume, else blank session 2026-06-29 00:50:53 +02:00
damocles
09b83c9d1e feat(#2067): choom uses a fresh named session, drop --fresh flag 2026-06-29 00:50:53 +02:00
damocles
ce959d7700 feat(#2067): pin choom to a dedicated claude session id 2026-06-29 00:50:53 +02:00
iris
964e55f0bb docs(web-ui/agent): add back-link nav + fix stale doc pointer in screen.html 2026-06-29 00:31:06 +02:00
atlas
af7ec98542 doc: ensure_mirror_repo docstring — 409 only, not 409/422 (match the fix) 2026-06-29 00:26:41 +02:00
atlas
64e51fe3bf address argus: 422 from migrate is a validation error, not 'exists'
ensure_mirror_repo treated 409|422 as success (copied from ensure_org, where
422 *does* mean 'org exists'). For the migrate endpoint 422 is a validation
error (bad clone_addr/service); the GET-first check is the real idempotency
guard, so 409 stays as a race guard but 422 now falls through to the bail arm
(→ caller warns) instead of silently dropping a misconfigured mirror.
2026-06-29 00:26:41 +02:00
atlas
53df2c9598 rework(#2072): seed mirrors in c0re startup, not a host-side oneshot
Per mara: the mirror seeding belongs in hive-c0re's forge provisioning
sweep, where the core admin token + org-ensure already live — not a parallel
host-side nix oneshot.

- forge.rs: ensure_mirrors() reads HYPERHIVE_FORGE_MIRRORS (JSON list of
  {upstream,dest}), ensures each dest org (reuse ensure_org) + creates the
  pull-mirror via the migrate API (reuse forge_http, serde_json::json! body,
  409/existing = success). Called in ensure_all() right after the SEEDED_ORGS
  loop (token in scope, warn-and-continue like the other ensure_* steps).
- hive-forge.nix: forward effectiveMirrors to c0re via
  systemd.services.hive-c0re.environment.HYPERHIVE_FORGE_MIRRORS; drop the
  forgejo-seed-mirrors.service + its script + the host-side core-token read.
  Keep the forge.mirrors option, DEFAULT_ACTIONS_URL=self (CI-gated), and the
  dest-shape / no-c0re-namespace-collision assertions.

Verified locally: nix parse + treefmt (incl rustfmt) clean; serde/serde_json
patterns mirror dashboard.rs. cargo build runs in CI (no cc in my container).
2026-06-29 00:26:41 +02:00
atlas
6f5dade9c9 treefmt: collapse the assertion-message interpolation to one line
nixfmt wanted the ${...} on a single line (verified locally:
nix build .#checks.x86_64-linux.formatting passes). The earlier CI 'docs'
failure was a transient muede-pc2 build hiccup — the docs check builds clean
locally on the same drv.
2026-06-29 00:26:41 +02:00
atlas
990868b2e7 address argus review on the mirror seed
- drop the three cross-ref tracker tags from comments/description (prose only)
- build the orgs + migrate JSON bodies with jq -n --arg (an upstream URL
  containing a quote no longer corrupts the request)
- don't auto-append the actions/checkout mirror when the operator already
  declared that dest (avoids a duplicate effectiveMirrors entry when CI is on)
2026-06-29 00:26:41 +02:00
atlas
4a3581a3d2 feat(#2072): auto-seed Forgejo pull-mirrors (DEFAULT_ACTIONS_URL=self for CI)
General-purpose mirror mechanism for the internal forge, per mara's call on
#2074 (real Forgejo pull-mirrors, nix-configured — not a pushed clone).

- services.hyperhive.forge.mirrors: list of { upstream, dest } pull-mirrors,
  any repo. Each is created as a real Forgejo pull-mirror (re-syncs from
  upstream), dest = <owner>/<repo> in its own org.
- When forge.ci.enable is set: an actions/checkout mirror is auto-appended +
  forgejo DEFAULT_ACTIONS_URL is pointed at this instance, so CI
  'uses: actions/checkout@vN' resolves on loopback — immune to a host-resolver
  blip that previously reded every checkout (the seed/re-sync needs external
  DNS, but that's off the CI critical path).
- forgejo-seed-mirrors.service: host-side oneshot (the core admin token never
  enters a container), modelled on hive-ci-prefetch — waits <=60s for the core
  token, then idempotently ensures each dest org + creates the pull-mirror via
  the migrate API. partOf the forge container so it re-ensures on restart.
- assertions: dest must be <owner>/<repo>; mirror orgs can't shadow the
  c0re-managed namespaces (config/shared/agents/core) so the seed never races
  hive-c0re's own provisioning.

Supersedes #2074 (the raw-clone stopgap) as the durable #2072 fix.
2026-06-29 00:26:41 +02:00
atlas
b0d099274e wip(#2072): forge.mirrors option + DEFAULT_ACTIONS_URL=self when CI on
General-purpose Forgejo pull-mirror config (services.hyperhive.forge.mirrors:
list of {upstream, dest}). When CI is enabled, auto-append an actions/checkout
mirror + point forgejo DEFAULT_ACTIONS_URL at this instance so CI's
actions/checkout@vN resolves on loopback (immune to host-resolver blips, #2072).

Seed oneshot (creates the dest orgs + pull-mirrors via the migrate API) is the
next commit.
2026-06-29 00:26:41 +02:00
damocles
72c4bb18c9 refactor(#2077): drop impl-history from broker/dashboard/mcp comments 2026-06-29 00:22:54 +02:00
iris
fe6685a155 refactor(fe): fix doc pointer in stream-worker.js to shape.md 2026-06-29 00:17:19 +02:00
iris
878aade8fa refactor(fe): trim impl-history and duplicated-docs prose from comments
Remove or shorten comment blocks that:
- explain where code used to live (impl history)
- duplicate rationale already in docs/web-ui.md
- contain speculative/future-work notes

Changes:
- tabs.js: drop "SYST3M tab used to render this" history; keep badge purpose
- schedules.js: drop "used to be a card layout" history + speculative nit note
- stream-worker.js: replace 10-line problem-statement with docs pointer
  (rationale already in docs/web-ui.md SSE multiplexing section); trim
  future-work parenthetical from subscription-tracking comment
- system-sections.css: drop extraction-history prose; keep what it does
- core.css: drop move-history prose; keep what it imports and why

Part of issue cleanup per operator feedback.
2026-06-29 00:12:30 +02:00
iris
c7c4a40e49 fix(builds): remove unused form import (copy-paste residue from core.js) 2026-06-28 23:56:11 +02:00
iris
beb28d5c37 feat(builds): add /builds.html — build lifecycle hub (closes #1999)
New standalone page /builds.html consolidating rebuild queue, meta
inputs, and build log history into one place, with a new 'Builds' home
tile linking to it. Addresses mara's request: new sub-page with a new
home tile, all three items moved there.

Changes:
- builds.html: new page with three sub-tabs: R3BU1LD QU3U3, M3T4 1NPUTS,
  BUILD L0GS. Same minimal-chrome header + createTabStrip pattern as core
  and logs pages.
- builds.js: new bundle combining rebuild queue renderer (from core.js),
  meta inputs renderer (from core.js), rebuild-live-log renderer (from
  core.js), and build log history renderer (from logs.js). Deep-links to
  /builds.html?id=N#buildlogs. Count pill id: builds-tab-count-rebuild.
  BUILD L0GS tab lazy-loads on first activation.
- builds.css: @imports system-sections.css (rebuild queue + meta inputs +
  live-log styles) and logs.css (build-logs-* component styles).
- build.mjs: register builds.js, builds.css, builds.html.
- core.html: remove R3BU1LD QU3U3 + M3T4 1NPUTS tabs (now on builds.html).
  Default tab changes to K3PT ST4T3.
- core.js: remove renderMetaInputs, renderRebuildQueue + helpers,
  renderRebuildLiveLog + live-log state, elapsed-time tickers,
  updateRebuildCount, and the rebuild_queue/meta_inputs SSE handlers.
  Remove openBuildLogStream + util imports no longer needed.
- core.css: remove .rebuild-live-log-* rules (moved to system-sections.css
  so builds.css can share them via @import).
- system-sections.css: add .rebuild-live-log-* styles (moved from core.css);
  update comment to mention builds.html.
- logs.html: remove BUILD tab + pane (moved to builds.html).
- logs.js: remove fetchBuild(), fmtTs, fmtDuration, openBuildLogStream
  import, and rebuild_queue_changed SSE debounce. Default tab: 'agent'.
  SSE stream retained for audit_entry_added live-appends.
- index.html: add Builds tile (🔨, rebuild queue · meta inputs · build
  logs); update Core tile desc to 'kept state · container load'; update
  Logs tile desc to remove 'build'.
2026-06-28 23:56:11 +02:00
iris
75e49f7752 fix(permissions): clarify kept_state_names comment in get_stale_permissions
The variable was misleadingly named `tombstones` and commented as
'any name here is a tombstone', but kept_state_names() returns ALL
agents with a state dir on disk — both live containers and soft-deleted
tombstones. The logic was always correct (union with the live roster
filters both), but the comment would mislead future readers.

Rename the variable to `kept` and update comments to accurately
describe the contents.
2026-06-28 23:29:51 +02:00
iris
cffe645197 fix(permissions): collapse known-set assignment to one line (rustfmt) 2026-06-28 23:29:51 +02:00