hive-c0re: render the new agent option paths into generated agent flakes

meta.rs writes each agent's flake, and it still named the pre-move
`hyperhive.*` paths — so every agent rebuild would print a rename
deprecation warning about a line no human wrote and no operator could fix.
A warning nobody can act on trains everyone to ignore the ones that matter,
which is the whole value of the alias shims.

Repoints the FORWARDED_VAR_OPTIONS table and every other emitted option
assignment (otel.*, docs.source, claudeCodePath, github.enable, user.name,
claudeMemoryMaxBytes) to `services.hyperhive.agent.*`, with the test
expectations that pin the rendered text. The flake input named `hyperhive`
(`hyperhive.url`, `hyperhive.inputs.nixpkgs.follows`,
`hyperhive.nixosConfigurations.*`), hive-tier `services.hyperhive.*` paths,
and the `@hyperhive.local` git identity share the word and are untouched.

Also repoints the same option paths where they appear in comments, rustdoc
and runtime message strings across the other crates — a refusal message
naming `hyperhive.allowedRecipients` sends an operator to a path that will
stop existing. Prose under docs/ is deliberately not in this commit.

Refs #4473
This commit is contained in:
atlas 2026-09-17 20:19:30 +02:00
commit 6ea81aae65
30 changed files with 138 additions and 121 deletions

View file

@ -8,7 +8,7 @@
//! `<state>/matrix-sdk-state`) and the daemon-wide `HIVE_MATRIX_URL`.
//! Any **extra** accounts come from the `HIVE_MATRIX_ACCOUNTS` env var
//! (JSON, written by the nix harness module from
//! `hyperhive.matrixAccounts`) and are appended after `main`.
//! `services.hyperhive.agent.matrixAccounts`) and are appended after `main`.
//!
//! So a single-account agent (no `HIVE_MATRIX_ACCOUNTS`) gets exactly
//! `main` — zero config, same behaviour as before: omitting `account` on

View file

@ -271,7 +271,7 @@ async fn bring_up_account(
) -> Result<Option<(Client, SyncLoop)>> {
let Some(homeserver) = cfg.homeserver() else {
// No homeserver for this account: the hive has none to offer (no
// matrix vhost) or this agent's `hyperhive.matrix.url` is null. Same
// matrix vhost) or this agent's `services.hyperhive.agent.matrix.url` is null. Same
// no-op as a missing token — an absent integration, not a guess at
// one.
tracing::info!(

View file

@ -11,7 +11,7 @@
//!
//! Multi-account: every tool carries an optional `account` arg naming
//! which matrix account to act as (a `name` from
//! `hyperhive.matrixAccounts`); omitting it selects the agent's primary
//! `services.hyperhive.agent.matrixAccounts`); omitting it selects the agent's primary
//! account (or errors, listing the choices, when more than one account
//! is configured — see [`crate::accounts::Registry::resolve`]).
@ -49,7 +49,7 @@ struct SendMessageArgs {
/// Message body. Markdown is rendered to HTML by the daemon
/// (`text_markdown`); plain text passes through unchanged.
body: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -62,7 +62,7 @@ struct SendDmArgs {
/// the recipient.
user_id: String,
body: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -79,7 +79,7 @@ struct SendFileArgs {
/// Optional caption, sent as a follow-up text message in the room.
#[serde(default)]
caption: Option<String>,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -90,7 +90,7 @@ struct OpenDmArgs {
/// Matrix user id (`@user:server`) to open a DM with. The DM room is
/// created if one doesn't already exist.
user_id: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -104,7 +104,7 @@ struct SendReactionArgs {
/// Reaction key — usually an emoji (`👍`, `❤️`) but any string
/// works per matrix spec.
key: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -115,7 +115,7 @@ struct SendReplyArgs {
room: String,
event_id: String,
body: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -125,7 +125,7 @@ struct SendReplyArgs {
struct MarkReadArgs {
room: String,
event_id: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -139,7 +139,7 @@ struct SendRedactArgs {
/// Optional human-readable reason recorded on the redaction event.
#[serde(default)]
reason: Option<String>,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -147,7 +147,7 @@ struct SendRedactArgs {
#[derive(Debug, Deserialize, JsonSchema)]
struct ListRoomsArgs {
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -156,7 +156,7 @@ struct ListRoomsArgs {
#[derive(Debug, Deserialize, JsonSchema)]
struct ListRoomMembersArgs {
room: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -179,7 +179,7 @@ struct ReadRoomArgs {
/// Mutually exclusive with `from`.
#[serde(default)]
until: Option<String>,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -196,7 +196,7 @@ struct DownloadFileArgs {
/// named after the attachment; the returned `path` is where to read it.
#[serde(default)]
dest_path: Option<String>,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -204,7 +204,7 @@ struct DownloadFileArgs {
#[derive(Debug, Deserialize, JsonSchema)]
struct ListInvitesArgs {
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -214,7 +214,7 @@ struct ListInvitesArgs {
struct JoinRoomArgs {
/// Matrix room id (`!abc:server`) or canonical alias (`#name:server`).
room: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -228,7 +228,7 @@ struct ResolveInviteArgs {
/// What to do with the invite: `"accept"` (join the room) or
/// `"reject"` (decline and leave).
action: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,
@ -241,7 +241,7 @@ struct InviteUserArgs {
room: String,
/// Matrix user id of the invitee (`@user:server`).
user_id: String,
/// Matrix account to act as (a `name` from `hyperhive.matrixAccounts`).
/// Matrix account to act as (a `name` from `services.hyperhive.agent.matrixAccounts`).
/// Omit to use the agent's primary account.
#[serde(default)]
account: Option<String>,

View file

@ -2,7 +2,7 @@
//!
//! All paths are overridable via env vars for dev / test scenarios and
//! to let the harness point the daemon at non-default locations when
//! the operator overrides `hyperhive.matrix.*` options.
//! the operator overrides `services.hyperhive.agent.matrix.*` options.
use std::path::PathBuf;