Commit graph

2,576 commits

Author SHA1 Message Date
damocles
cef9e633f7 docs(#1970): rewrite for UI-driven shape (github.enable + host switch), purge githubAccount refs, regen hivectl-cli.md 2026-07-11 12:18:55 +02:00
damocles
18965ff7bd feat(#1970): host services.hyperhive.github.enable (default true) + meta.rs propagation of the off-switch 2026-07-11 12:18:55 +02:00
damocles
af9b46e80a refactor(#1970): replace githubAccount option with hyperhive.github.enable gate (default true, github.com + x-access-token) 2026-07-11 12:18:55 +02:00
damocles
3e5aff39eb fix(#1970): address argus review — # Errors doc, regen hivectl-cli.md, GET /api/github-account status 2026-07-11 12:18:55 +02:00
damocles
1b6b307aa7 feat(#1970): add POST /api/github-account dashboard endpoint for the credentials UI 2026-07-11 12:18:55 +02:00
damocles
d804859128 docs(#1970): document githubAccount + gh/git integration + hivectl github set-token 2026-07-11 12:18:55 +02:00
damocles
80ef7d8151 wip(#1970): github-token injection path (priv wire + hive-priv handler + priv_client + hivectl github set-token) 2026-07-11 12:18:55 +02:00
damocles
5fb4b9f4b0 wip(#1970): gh wrapper + git credential helper + gated env/gitconfig for githubAccount 2026-07-11 12:18:55 +02:00
damocles
303037689e wip(#1970): add hyperhive.githubAccount nix option (single-account, nullable) 2026-07-11 12:18:55 +02:00
damocles
7069732e01 fix(#2369): skip statically-configured accounts in matrix token discovery to silence spurious sidecar warning 2026-07-11 10:17:48 +02:00
atlas
dcd559e7c7 fix(#2368): AGENT_RUNTIME_ROOT → priv_proto; fix stale priv comment; cross-ref lockstep
- Add `priv_proto::AGENT_RUNTIME_ROOT` to hive-sh4re as the shared
  single source for the per-agent runtime root path.  hive-priv now
  imports it instead of carrying a local const with a stale comment
  that still pointed at `coordinator::AGENT_RUNTIME_ROOT` (removed in
  #2285/#2367 — moved to `paths::agent_runtime_root()`).

- Add 'must stay in sync' cross-ref comments on both sides of the
  privsep boundary:
    · priv_proto::META_DIR ↔ paths::meta_root()
    · priv_proto::AGENT_STATE_ROOT ↔ paths::AGENTS_ROOT
    · priv_proto::AGENT_RUNTIME_ROOT ↔ paths::RUNTIME_ROOT + agent_runtime_root()
    · paths::AGENTS_ROOT ↔ priv_proto::AGENT_STATE_ROOT
    · paths::RUNTIME_ROOT ↔ priv_proto::AGENT_RUNTIME_ROOT

  The dep graph prevents a shared import (hive-sh4re is a leaf; both
  hive-c0re and hive-priv depend on it but not each other), so the
  lockstep comments are the enforced contract.
2026-07-11 01:22:50 +02:00
damocles
4745274fca refactor(#2112): remove the dead stdio transport from hive-agent-mcp 2026-07-11 00:55:41 +02:00
damocles
1ba44b77ac feat(#2112): make http-mcp the sole transport for the built-in surface 2026-07-11 00:32:51 +02:00
müde
603c3b79dd fix(#2280): restore --bin hive-priv in daemonBins — dropped in symlinkJoin refactor 2026-07-10 22:51:00 +02:00
damocles
dfbf198ef3 fix(#2279): idempotent column-guard migrations, drop invalid ADD COLUMN IF NOT EXISTS 2026-07-10 22:05:08 +02:00
atlas
c47faf0af9 fix: idempotent migrations (ADD COLUMN IF NOT EXISTS), stale doc, safety note 2026-07-10 22:05:08 +02:00
atlas
7d36ec5e1f fix(#2279): versioned DB migrations via schema_versions table
Replace the try-and-ignore-duplicate-column approach in apply_migrations
with proper schema versioning using a shared schema_versions table.

## mechanism

New function: db::apply_versioned_migrations(conn, subsystem,
legacy_column, migrations). Tracks the applied-migration count in a
schema_versions table (one row per subsystem key). Only migrations past
the stored version run.

Legacy detection: pre-versioning databases have no schema_versions row.
The legacy_column tuple (table, column) identifies a column that exists
only in a fully-migrated legacy database. If present, all known
migrations are skipped. If absent, migrations start from 0.

## stores migrated

- broker: removes bespoke ensure_message_columns / ensure_reminder_columns.
  Unified into BROKER_MIGRATIONS (v1-v5). Legacy detector: messages.priority
  (added in the last pre-versioning migration).
- approvals: 4 historical migrations (v1-v4). Legacy detector:
  approvals.submitter.
- operator_questions: 3 historical migrations (v1-v3). Legacy detector:
  operator_questions.target.
- scheduled_prompts: 1 historical migration (v1). Legacy detector:
  scheduled_prompts.paused_at_unix.

apply_migrations removed (no callers).

## tests (db.rs)

- fresh_install_runs_all_migrations
- legacy_install_skips_all_migrations
- partial_migration_resumes_from_version
- already_at_latest_is_noop
- multiple_stores_in_same_db
2026-07-10 22:05:08 +02:00
atlas
01db1af346 feat(#2280): add --bin hive-metric to daemonBins — hive-metric now on main 2026-07-10 21:32:12 +02:00
atlas
2f16f0e438 fix(#2280): add nativeBuildInputs to daemonBins + hiveForgePkg — sqlite/pkg-config 2026-07-10 21:31:38 +02:00
atlas
4a9aff584e refactor(#2280): packages.default = symlinkJoin — one rustc per bin, no double builds
Each binary now has its own derivation (daemonBins for hive-c0re/hive-ag3nt/MCP
servers, hivectlPkg, hiveForgePkg), all sharing cargoArtifacts for a single
rustc compilation. packages.default = pkgs.symlinkJoin assembles them without
any additional compilation — no rustc is invoked more than once regardless of
which packages the operator builds together.

NixOS module consumers (pkgs.hyperhive = packages.default) are unaffected:
symlinkJoin exposes all binaries at the same /bin/ paths.
2026-07-10 21:31:38 +02:00
atlas
c1ffa12a99 feat(#2280): packages.hivectl and packages.hive-forge — single-bin splits
Operators who only want hivectl or hive-forge can now add:
  inputs.hyperhive.packages.${system}.hivectl
  inputs.hyperhive.packages.${system}.hive-forge
to their environment.systemPackages without pulling the full
workspace (hive-c0re daemon, hive-ag3nt harness, etc.) into PATH.

Both reuse the shared cargoArtifacts so there is no extra compile
cost when both packages and the default workspace are built together.

packages.hivectl carries the shell completions and the wireguard-tools
wrapper identical to what packages.default ships for hivectl.
packages.hive-forge is a lean CLI-only build.
2026-07-10 21:31:38 +02:00
damocles
d91e6eb0e2 fix(hive-metric): blocking OTLP client (no-reactor panic), reject negative counters, allow negative gauges 2026-07-10 21:27:56 +02:00
damocles
aa9f56246a chore(hive-metric): regenerate Cargo.lock after rebase onto main 2026-07-10 21:27:56 +02:00
damocles
307e4a9ad5 style(hive-metric): treefmt shutdown() call 2026-07-10 21:27:56 +02:00
damocles
4011141fd6 fix(ci): add cmake to crane build inputs for aws-lc-sys (otlp/reqwest-rustls) 2026-07-10 21:27:56 +02:00
damocles
4b8a045232 fix(hive-metric): fix usage doc order (counter|gauge) 2026-07-10 21:27:56 +02:00
damocles
61dfceb100 fix(hive-metric): multi-thread runtime + counter default 2026-07-10 21:27:56 +02:00
damocles
28605e5cdd docs(observability): remove duplicate extraResourceAttributes sentence 2026-07-10 21:27:56 +02:00
damocles
b4b5dd7fa4 fix(hive-metric): use opentelemetry-otlp SDK instead of hand-rolled OTLP 2026-07-10 21:27:56 +02:00
damocles
39fc088907 feat(#2100): add hive-metric OTLP CLI for agent-emitted custom metrics 2026-07-10 21:27:56 +02:00
damocles
7964d45a27 refactor(#2359): bare Deserialize derive + clarify error to_string scan 2026-07-10 20:43:58 +02:00
damocles
71c8b14633 refactor(#2359): typed stream-json parsing for sentinel detection 2026-07-10 20:43:58 +02:00
damocles
556a213320 refactor(#2285): inline remaining 1:1 path wrappers (meta_dir, marker fns, host_conf_path) 2026-07-10 20:32:03 +02:00
damocles
cfb84b420a refactor(#2285): drop coordinator 1:1 path accessors, callers use paths:: directly 2026-07-10 20:32:03 +02:00
damocles
187c364feb refactor(#2285): repoint all hive-c0re host-path consumers to paths.rs 2026-07-10 20:32:03 +02:00
damocles
4162f557c9 refactor(#2285): repoint knowledge + forge core-token to paths.rs consts 2026-07-10 20:32:03 +02:00
damocles
1cefaf2c16 refactor(#2285): add consolidated path fns/consts to paths.rs (foundation) 2026-07-10 20:32:03 +02:00
damocles
342f6ab55b chore(#2358): disable claude dynamic workflows via managed settings 2026-07-10 20:30:34 +02:00
damocles
9ad94190e6 fix(hive-forge): use u64::from for repo-search limit clamp (clippy cast_lossless) 2026-07-10 20:22:29 +02:00
atlas
327a3bc3bc feat(hive-forge): repo-search verb — keyword/topic search across forge repos 2026-07-10 20:22:29 +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
atlas
0fc4600d07 fix(#2332): add After=hive-tls-ca to resign service — prevent first-boot CA race
On a fresh deploy Persistent=true causes the weekly timer to fire
immediately. Without this ordering hive-tls-resign can race
hive-tls-ca before the CA key is written, failing the resign.
CA is always valid when this runs; resign is a no-op if the leaf
is still within its half-life margin.

Suggested by argus (review) + requested by mara.
2026-07-10 19:37:08 +02:00
atlas
61bd0b604d feat(#1933): weekly hive-tls-resign timer — dedicated resign service, no hive-tls-ca bounce
The parked PR (#1934) triggered re-sign by restarting hive-tls-ca
(a RemainAfterExit oneshot), which mara flagged as a hack.  This
replaces that with a dedicated hive-tls-resign.{service,timer}:

- hive-tls-ca unchanged — still handles boot-time CA generation +
  initial leaf signing; RemainAfterExit, runs before the gateway.
- hive-tls-resign.service — runs the leaf re-sign directly (openssl
  in its own PATH); does NOT touch hive-tls-ca.  Re-signs only when
  the leaf is within half its validity of expiry, so the weekly timer
  catches short-lived (30d default) leaves well before they lapse.
  Checks sha256 before/after; if the leaf rotated it propagates into
  the running gateway via systemctl -M hive-gateway (mirroring how
  hive-c0re reloads the gateway after agents.conf writes — the
  documented correct approach; an inotify path unit inside the
  container does not work across the nspawn mount-namespace boundary).
  || true on the propagation calls so a stopped gateway never fails
  the unit (its next boot imports the already-rotated leaf).
- hive-tls-resign.timer — OnCalendar=weekly, Persistent=true (fires a
  missed run on next boot so a host that was off on the scheduled day
  catches up rather than letting the leaf lapse silently).
- leafValidityDays doc updated to reflect automatic renewal.

Closes #1933.
2026-07-10 19:37:08 +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
iris
82250b8f59 fix(agent-ui): coalesce plugin_install started/completed into one row
claude emits a started tick then a completed tick per plugin install;
previously each got its own row (loading... then done) instead of one
line updating in place. Same coalescing pattern already used for
thinking_tokens and the generic status tick.
2026-07-10 19:15:24 +02:00
damocles
e0d5c98356 refactor(#2282): split dag_progress out of hivectl.rs 2026-07-10 19:09:14 +02:00
damocles
4fd3928506 feat(#2282): animated indicatif DAG progress render for hivectl wait 2026-07-10 19:09:14 +02:00
damocles
ce909a00a2 fix(#2327): handle dismissed reviews like stale (superseded helper) 2026-07-10 19:08:16 +02:00
damocles
cd092a8ae4 feat(#2327): surface forgejo stale/dismissed review flags in pr-status/reviews/merge 2026-07-10 19:08:16 +02:00
sock
078ea74ba9 fix(hive-ci): static bridge IP instead of DHCP (no DHCP server on the bridge)
hive-ci is the one container on the hive bridge that used DHCP
(networking.interfaces.eth0.useDHCP = true, from #2310 / #2336). But the
bridge has no DHCP server: dnsmasq on the bridge is DNS-only and agent
containers get deterministic static IPs (lifecycle::agent_network_ip),
so the DHCP client never gets a lease and the container hangs at boot:

  A start job is running for DHCP Client (5s / 1min 31s)

Assign a static address on eth0 (top host address of the subnet) plus a
default route via the bridge gateway, and drop useDHCP. Preserves the
#2310 netns isolation (no host-loopback reach) while letting the
container boot and reach the forge through the gateway.

Refs #2310, #2336.
2026-07-10 18:38:17 +02:00