Commit graph

2,892 commits

Author SHA1 Message Date
atlas
c7feeb7f5b test(#2591): assert hivectl header shows source, not a derived label 2026-07-23 18:01:26 +02:00
atlas
0ee4647d1e refactor(#2591): drop the client-side DAG label map — show source + node kinds
Per mara (#2660): the client shouldn't re-derive a friendly name from
node kinds — that re-bakes the domain knowledge the raw-graph redesign
removed. The queue card / hivectl header now shows what the backend sends
(the DAG's source + the raw node kinds); the node chain conveys the
operation. Removes the DagView::label() helper (hivectl was its only
consumer after iris dropped the frontend map in #2660) and points
hivectl's header at d.source instead.
2026-07-23 18:01:26 +02:00
damocles
63b1a6fe39 docs(#2659): note bash extraMcpServers example is illustrative, tracks bashHttpPort 2026-07-23 18:01:20 +02:00
damocles
c4fcf7fbf1 feat(#2659): serve hive-bash-mcp over persistent streamable-http, drop stdio bridge 2026-07-23 18:01:20 +02:00
iris
ecc2ebe682 feat(#2637): rework builds.js for new DagView wire shape
- SSE live-log → 2s polling on GET /api/build-log/<node_id> ({stdout,stderr} JSON)
- DagView top-level started_at/finished_at used directly (isoToSecs); no client
  min/max derivation
- rollupState/entryKind/isoToSecs derive state+kind from NodeView[]; Done nodes
  absent from wire so fully-done DAGs disappear naturally
- rollupState([]) returns 'done' defensively for empty node arrays
- Log links and live-log panel gated on n.has_log (backend field, mirrors old
  build_log_id != null — excludes lock/noop/store-only nodes)
- Raw download: /api/build-log/<node_id>/raw (text/plain)
2026-07-23 18:00:17 +02:00
damocles
29f45ddd48 docs(#2627): crate READMEs for the harness column (hive-agent, hive-agent-mcp, hive-agent-wake, hive-bash-mcp) 2026-07-23 16:41:05 +02:00
atlas
0ae0780089 style(#2591): reword render_dag_line doc so clippy doesn't read it as a list 2026-07-23 16:40:46 +02:00
atlas
acffb6333b test(#2591): update queue tests for Done-nodes-vanish semantics
Two tests asserted the old behaviour where completed nodes/DAGs stayed
in the snapshot. Under the redesign, Done nodes are filtered off the wire
(a fully-Done DAG disappears; a Failed one lingers + is history-capped):
- failed_node test: the completed reconcile is Done → assert it's absent,
  not Done-present (its run is already verified by the claim).
- history-eviction test: fail the nodes so the DAGs linger (Done ones
  would vanish), then assert the grace window + per-template cap.
2026-07-23 16:40:46 +02:00
atlas
33c3fb3b34 refactor(#2591): hivectl derives DagView label + roll-up state from nodes
hivectl/dag_progress.rs was reading the now-removed DagView.kind/state.
Derive both from the node set via the shared DagView::rollup_state() +
DagView::label() helpers (added to hive-sh4re). Timestamps are DateTime<Utc>
now — elapsed calcs compare in unix seconds. Dropped the live step display
(step left the wire). Test fixtures updated to the slim shape.
2026-07-23 16:40:46 +02:00
atlas
52dd9ede23 feat(#2591): add GET /api/build-log/<node_id> {,/raw} query endpoints
The raw-graph wire drops the inline build_log_id; the client fetches a
node's captured output on demand. Two handlers resolve node id -> log-row
id (JobQueue::build_log_id_of, now keyed by the wire u64) then delegate to
the existing get_full / raw handlers: /api/build-log/<node_id> serves the
BuildLogFull JSON ({stdout, stderr} + header), /raw serves text/plain.
404 when the node has no linked log.
2026-07-23 16:40:46 +02:00
atlas
02e2bf895e refactor(#2591): DagView carries host-computed timestamps + NodeView.has_log
Reconcile with mara + argus's review on the frontend PR (#2660):

- DagView regains started_at/finished_at (DateTime<Utc>), computed
  host-side as min/max over ALL subtree nodes (including the Done ones
  filtered off the wire). The client can't derive these — the
  earliest/only-started node is often Done and absent — so the backend
  sets them, per mara's call.
- NodeView gains has_log: bool = build_log_id.is_some(), the precise
  old 'node has a captured build log' guard so the dashboard only shows
  a log link for nodes that actually produce one.
2026-07-23 16:40:46 +02:00
atlas
f3207ce9f8 refactor(#2591): drop never-constructed Template::{Destroy,Reconcile}
Now that Template is internal to hive-c0re (not a pub wire enum), the
dead-code lint flags the two variants nothing ever constructs. Removed
them + their as_str arms; terminal_hook's catch-all arm is unaffected.
2026-07-23 16:40:46 +02:00
atlas
51bcad1adb refactor(#2591): fix wire-shape consumers (server await_dags, tests)
- server::await_dags: a DAG is settled when gone from the snapshot (fully
  Done) or present with all nodes terminal; pending only with a non-terminal
  node (DagView no longer carries a rolled-up state).
- DagView::rollup_state() added to hive-sh4re — the shared node-set roll-up
  derivation every Rust consumer uses.
- JobQueue::build_log_id_of(node_id) — the node_id -> build_logs lookup the
  query endpoint will use; tests assert log-id via it now.
- tests: derive roll-up state; drop the off-wire step/build_log_id wire asserts.
2026-07-23 16:40:46 +02:00
atlas
c574948d7c refactor(#2591): read node lifecycle off the jobq Node; slim DagView build (WIP)
hive-c0re side of the raw-graph wire: dag_view now projects the slim
DagView, reading started_at/finished_at/error straight off the
hive_jobq Node (removes the node_rt double-write from #2645), excludes
Done nodes, and rides approval_id/inputs on the owning node. Template
moved into hive-c0re (model.rs) — no longer on the wire. Still WIP:
build-log endpoint + hivectl derive + compile fixes to follow.
2026-07-23 16:40:46 +02:00
atlas
54d144b647 refactor(#2591): slim the job-queue wire types to a raw-graph projection
WIP (hive-sh4re only; hive-c0re construction follows). Reshapes the
dashboard/hivectl queue wire per mara's redesign (#2637):

- DagView is now a thin projection: { id, source, reason, created_at, nodes }.
  Dropped the rolled-up kind (Template)/state/started_at/finished_at/inputs/
  approval_id — the client derives label + roll-up state + DAG timestamps
  from the node set.
- NodeView drops step + inline build_log_id; started_at/finished_at are
  chrono DateTime<Utc> (off the hive_jobq Node); non-derivable per-node
  payload rides the owning node (approval_id on the approval node, inputs
  on the meta_lock node).
- Deleted the Template enum entirely.

Done nodes are excluded from the wire (a fully-done DAG disappears; a
failed DAG lingers until the history cap). Build logs move to an on-demand
GET /api/build-log/<node_id> query (next commits).
2026-07-23 16:40:46 +02:00
damocles
a7f0f3d231 fix(#2635): drop obsolete todos_db/reminders_db path aliases 2026-07-23 15:05:19 +02:00
damocles
c316dc852d feat(#2635): consolidate todos + reminders into one hyperhive-state.sqlite 2026-07-23 15:05:19 +02:00
atlas
64a14718fe docs(#2627): clarify hive-sh4re owns payloads, not the wire envelopes
Land argus's review nit from #2654 (it was pushed to that PR's branch as
fc4230f2 but got orphaned when the branch was merged + auto-deleted before
the fix landed). The hive-sh4re README opening said 'Agent / Manager
request + response shapes', which reads as if the wire envelopes still live
here; they moved to the per-socket crates. Now says 'shared payload
vocabulary' and notes where the envelopes live.
2026-07-23 14:23:16 +02:00
iris
7176ce6322 docs(#2627): add README for hive-screen-mcp 2026-07-23 14:17:47 +02:00
atlas
bbfc578c95 docs(#2627): add READMEs for the remaining infra crates
Second increment of the per-crate README effort, covering the rest of the
infra/wire/priv column: hive-priv, hive-metric, hive-types, hive-sh4re,
hive-core-agent-sock, hive-agent-sock. Same shape as the first batch —
purpose + when-to-use, and point at the crate-root //! docs plus the
relevant docs/ pages rather than duplicating them. Wires
readme = "README.md" into each Cargo.toml [package].

Disjoint from the batch-1 crates, so the two increments compose cleanly.
2026-07-23 13:16:29 +02:00
atlas
4017a57350 docs(#2627): add READMEs for hive-jobq + the socket wire crates
Adds crate READMEs (matching the hive-claude precedent) and wires
readme = "README.md" into each Cargo.toml [package] for hive-jobq,
hive-host-sock, and hive-priv-sock — the crates squarely in the infra
lane. Each README leads with purpose + when-to-use and points at the
crate-root //! docs for depth rather than duplicating them.

First increment of the per-crate-README effort; the shape here is the
proposed template for the remaining crates (see issue discussion).
2026-07-23 12:34:22 +02:00
damocles
e9df5def02 add agent-facing compact tool gated on context usage 2026-07-23 12:34:20 +02:00
iris
5e1abe4836 fix comment: remove tracker tag from schedules.js module doc 2026-07-23 09:54:40 +02:00
iris
fab2fdcc0a fix(#2650,#2649): drop reminders tab + pending_reminders chip
hive-c0re's broker reminder store and /api/reminders endpoint were
removed in PR #2644 (reminders migrated to in-container sqlite store).
The dashboard had a QU3U3D R3M1ND3RS section on the schedules tab backed
by that endpoint, and a per-agent badge driven by pending_reminders
(always 0 after the migration).

Remove both. Per-agent reminders now surface through get_loose_ends /
the todos pill on the agent page, consistent with the todos migration.

- frontend/packages/dashboard/src/schedules.js: drop refreshReminders,
  renderReminders, applyRemindersChanged; drop appendLinkified import
  (no longer used); update module comment.
- frontend/packages/dashboard/src/tabs.js: drop applyRemindersChanged
  and refreshReminders imports; remove reminders-section from managed
  list; remove refreshReminders call site; drop reminders_changed from
  SSE dispatch; simplify countdown ticker (reminder-due gone).
- frontend/packages/dashboard/src/dashboard.html: remove QU3U3D
  R3M1ND3RS section.
- frontend/packages/dashboard/src/dashboard.css: remove reminder list +
  row CSS.
- frontend/packages/dashboard/src/common.css: remove .badge-reminder.
- frontend/packages/dashboard/src/swarm.js: remove pending_reminders
  from fingerprint key and badge render.
2026-07-23 09:54:40 +02:00
damocles
ee072149c9 fix(#2038): don't treat MCP 'pending' status as degraded
pending is the claude CLI's normal init-event race for a freshly
spawned stdio server (status reported before the handshake completes,
then flips to connected moments later in the same turn — see
anthropics/claude-agent-sdk-typescript#368). flagging it fired on
nearly every turn for all three configured servers with zero actual
impact, which is why #2038's persistent-vs-one-turn repro question
looked answered when it wasn't — that was this false positive, not
the real bug.
2026-07-23 07:47:56 +02:00
damocles
a80d0b0fed delete c0re-side reminder plumbing (#2635 inc 1 commit 6) 2026-07-23 00:12:30 +02:00
damocles
dcb2b79715 strip issue-tag comments from #2635 inc1 commits per hive-rules 2026-07-23 00:12:30 +02:00
damocles
e11e8294a3 repoint post_turn_counts + dedup web_ui stats onto todo_server::dial (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
e8d101d663 repoint remind/cancel_loose_end/get_loose_ends to the local reminder socket (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
8b35b8c4af repoint per-agent stats reminder rollup off the broker (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
ecd9030305 wire reminder ops into the in-agent socket dispatch (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
174e277340 add reminder delivery timer + main.rs wiring (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
92276e4e14 add harness-local reminder store (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
18d21237bf add reminder ops to the in-agent socket protocol (#2635 inc 1) 2026-07-23 00:12:30 +02:00
damocles
94a172cba3 docs: stop claiming tracker-tag/comment-block lint are non-required 2026-07-23 00:10:59 +02:00
atlas
03eb64cb5c feat(#2591): hive-jobq Node lifecycle — started/finished timestamps + failure reason
Node gains started_at/finished_at (chrono DateTime<Utc>, serialized
RFC 3339 on the wire per hive_sh4re::wire_time) plus error (String).
Graph::set_state self-stamps started_at on the first Running transition
and finished_at on the first terminal one, via an internal now_utc()
clock (keeps settle/complete signatures stable). Outcome::Failed(String)
carries the failure reason, set on the terminal transition.

hive-c0re complete_node builds Outcome::Failed(msg); its node_rt
side-table stays i64 for now (double-write) until #2637 reads the Node.

Toward #2637: the jobq graph becomes the source of truth for per-node
lifecycle so the queue can be sent to the client as-is.
2026-07-22 23:58:30 +02:00
atlas
30a2a2e9de feat(#2641): sudoless hivectl via a hive-admin group on the host socket
The host admin socket `/run/hyperhive/host.sock` was `0660 root:root` (no
SocketGroup), so hivectl needed sudo. Group-own it by a new `hive-admin`
group and add a `services.hyperhive.c0re.adminUsers` allowlist: listed users
join `hive-admin` and drive hivectl without root.

- `SocketGroup = "hive-admin"`, `SocketMode = "0660"` on the hive-c0re.socket
  unit.
- `/run/hyperhive` -> `0751` (traverse-only, no listing) so the group can reach
  the socket path; the socket's own `0660 hive-admin` mode gates the
  connection, and the per-agent subdirs keep their own restrictive perms.
- Empty `adminUsers` (the default) leaves `hive-admin` memberless -> root-only,
  as before.

The admin socket is full hive control (spawn/kill/destroy/deploy), so
`adminUsers` is an explicit, opt-in trust grant. Documented in
docs/boundary.md (host admin socket access) + docs/tools/hivectl.md.
2026-07-22 22:50:27 +02:00
damocles
c4deca99db fix(#2639): cancel_loose_end kind="todo" clears without a bash round-trip
Adds a real MCP-side path for the workaround #2639 documented: dial the
in-container HIVE_AGENT_SOCKET directly from cancel_loose_end (kind:"todo")
instead of shelling out via a tracked bash task (nc -U ...), which is what
was spawning a fresh completion todo on every clear and cascading forever.

hive-agent-mcp/src/mcp/render.rs: renamed local_todos's socket-dial guts
into a shared dial_agent_socket(req) helper, added mark_local_todo_done(id)
on top of it (MarkTodoDone request already existed server-side, unused
until now). mod.rs wires kind:"todo" into cancel_loose_end ahead of the
question/reminder/approval parse. args.rs + render.rs + docs/tools/bash.md
text updated to point at the new path instead of the old raw nc invocation.
2026-07-22 21:46:16 +02:00
damocles
4989bcdb5e type Message.from as Ident 2026-07-22 21:10:17 +02:00
damocles
76647415af type Approval.agent as Ident 2026-07-22 21:10:17 +02:00
damocles
8c1979f05c type get_agent_meta target as Ident (#2621) 2026-07-22 21:10:17 +02:00
damocles
3df565789c type ask to target as Ident (#2621) 2026-07-22 21:10:17 +02:00
atlas
0ab6b764be docs(#2591): fix stale Claim.agent doc + explain cancel's container roll-up (argus review) 2026-07-22 19:47:30 +02:00
atlas
600bc051e1 refactor(#2591): move the perm-change payload onto the WritePermFile node 2026-07-22 19:47:30 +02:00
atlas
be2dfa8cd3 refactor(#2591): make NodeKind the queue payload — drop JobPayload, agent into variants 2026-07-22 19:47:30 +02:00
atlas
2294cd4516 feat(#2591): auto-complete the DAG container + run terminal hooks inline 2026-07-22 19:47:30 +02:00
atlas
a78280feed refactor(#2591): model a DAG as a container node — grouping side-tables become graph walks 2026-07-22 19:47:30 +02:00
atlas
8834161fb9 feat(#2591): add NodeKind::Dag DAG-container variant 2026-07-22 19:47:30 +02:00
atlas
50172d1716 refactor(#2591): derive PartialEq/Eq/Serialize on TransientKind 2026-07-22 19:47:30 +02:00
atlas
456847eaa1 fix(#2591): validate() rejects out-of-bounds/forward parent index (argus review) 2026-07-22 19:47:30 +02:00