From 017786564ad755ae9f855afa78c1e182714b7b24 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 31 May 2026 16:41:11 +0200 Subject: [PATCH] hive-ag3nt: scrub stale #658/#419 attribution cookies (#716 batch 2) --- hive-ag3nt/src/events.rs | 4 ++-- hive-ag3nt/src/login.rs | 8 ++++---- hive-ag3nt/src/login_session.rs | 8 ++++---- hive-ag3nt/src/paths.rs | 24 ++++++++++++------------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/hive-ag3nt/src/events.rs b/hive-ag3nt/src/events.rs index 8f0caea9..0f93eda6 100644 --- a/hive-ag3nt/src/events.rs +++ b/hive-ag3nt/src/events.rs @@ -693,8 +693,8 @@ impl Bus { /// - `"rate_limited"` writes `{state_dir}/hyperhive-rate-limited` /// (cleared by any other status). /// - `"needs_login_idle"` writes `{state_dir}/hyperhive-needs-login` - /// so a 401-triggered re-auth flag persists across harness restart - /// (#419). The web UI's `/login` POST handler clears it via + /// so a 401-triggered re-auth flag persists across harness restart. + /// The web UI's `/login` POST handler clears it via /// `clear_needs_login_sentinel` once the operator re-auths. /// - `"online"` clears both sentinels — the agent is healthy again. pub fn emit_status(&self, status: impl Into) { diff --git a/hive-ag3nt/src/login.rs b/hive-ag3nt/src/login.rs index b93b3caf..dd5d429a 100644 --- a/hive-ag3nt/src/login.rs +++ b/hive-ag3nt/src/login.rs @@ -11,10 +11,10 @@ use std::path::{Path, PathBuf}; /// Returns the Claude credentials directory for this agent. Delegates -/// to `paths::claude_dir`, which reads `$HOME/.claude` (post-#658 the -/// service runs as a non-root unix user named after the agent, so -/// `$HOME` resolves to `/home/` and the OAuth dir lives at -/// `/home//.claude`). Overridable via `HYPERHIVE_CLAUDE_DIR`. +/// to `paths::claude_dir`, which reads `$HOME/.claude`. The service +/// runs as a non-root unix user named after the agent so `$HOME` +/// resolves to `/home/` and the OAuth dir lives at +/// `/home//.claude`. Overridable via `HYPERHIVE_CLAUDE_DIR`. #[must_use] pub fn default_dir() -> PathBuf { crate::paths::claude_dir() diff --git a/hive-ag3nt/src/login_session.rs b/hive-ag3nt/src/login_session.rs index 2860ebff..e151fcbc 100644 --- a/hive-ag3nt/src/login_session.rs +++ b/hive-ag3nt/src/login_session.rs @@ -63,10 +63,10 @@ impl LoginSession { .stdout(Stdio::piped()) .stderr(Stdio::piped()) // `claude` reads $HOME/.claude for the credentials dir. The - // harness service env sets HOME to /home/ (post-#658) - // and the bind-mount lands the OAuth dir at the same path, - // so the child inherits the right HOME without any further - // wiring here. + // harness service env sets HOME to /home/ and the + // bind-mount lands the OAuth dir at the same path, so the + // child inherits the right HOME without any further wiring + // here. .kill_on_drop(true) .spawn() .with_context(|| format!("spawn `{cmd}`"))?; diff --git a/hive-ag3nt/src/paths.rs b/hive-ag3nt/src/paths.rs index 21e4aa1c..b1fef762 100644 --- a/hive-ag3nt/src/paths.rs +++ b/hive-ag3nt/src/paths.rs @@ -1,9 +1,10 @@ //! Per-agent path resolution for state and credential directories. //! -//! All agents (including the manager "hm1nd") use `/agents/{label}/state`. -//! Claude credentials live at `$HOME/.claude` (post-#658: -//! `/home//.claude` because the harness service now runs -//! as a non-root unix user matching the agent label). +//! All agents (including the manager `hm1nd`) use `/agents/{label}/state`. +//! Claude credentials live at `$HOME/.claude` (resolves to +//! `/home//.claude` because the harness service runs as a +//! non-root unix user matching the agent label — see +//! `docs/persistence.md::First-boot agent-user migration`). //! //! Both paths can be overridden via env vars (`HYPERHIVE_STATE_DIR`, //! `HYPERHIVE_CLAUDE_DIR`) for dev / test scenarios. @@ -25,12 +26,11 @@ pub fn state_dir() -> PathBuf { /// Per-turn config dir for the regenerated claude-{mcp-config,settings, /// system-prompt} files the harness drops before each turn. Set by -/// systemd via `RuntimeDirectory = "hive-config"` (#658 fixup): a -/// per-service runtime dir owned by the agent unix user, auto-cleared -/// on stop. Kept separate from `/run/hive` (the host-owned mcp.sock -/// bind) so the harness owns its own write surface and we don't have -/// to chown a bind-mounted dir. Overridable via `HYPERHIVE_CONFIG_DIR` -/// for dev / test scenarios. +/// systemd via `RuntimeDirectory = "hive-config"`: a per-service runtime +/// dir owned by the agent unix user, auto-cleared on stop. Kept separate +/// from `/run/hive` (the host-owned mcp.sock bind) so the harness owns +/// its own write surface and we don't have to chown a bind-mounted dir. +/// Overridable via `HYPERHIVE_CONFIG_DIR` for dev / test scenarios. #[must_use] pub fn config_dir() -> PathBuf { if let Some(p) = std::env::var_os("HYPERHIVE_CONFIG_DIR") { @@ -42,8 +42,8 @@ pub fn config_dir() -> PathBuf { /// Claude credentials directory for the current agent. `$HOME/.claude` /// matches what the `claude` CLI reads at runtime — both binaries see /// the same `$HOME` set by the per-service systemd `environment` -/// declaration (`/home/` post-#658). Falls back to `/root/.claude` -/// for dev / test environments where `HOME` isn't set so the previous +/// declaration (`/home/`). Falls back to `/root/.claude` for +/// dev / test environments where `HOME` isn't set so the previous /// root-by-default shape keeps working without env wiring. /// Overridable via `HYPERHIVE_CLAUDE_DIR` for dev / test scenarios. #[must_use]