diff --git a/swarm-controller/src/forge.rs b/swarm-controller/src/forge.rs index 5bd19bff..7b726dfe 100644 --- a/swarm-controller/src/forge.rs +++ b/swarm-controller/src/forge.rs @@ -31,19 +31,12 @@ use crate::webhook::DeliveryKind; /// The forge org that owns agent repos. Same org `hive-c0re::forge` /// already uses for its own single-hive `CreateRepo` path — this is /// the same forge instance, not a separate one, so the same org. -pub const AGENTS_ORG: &str = "agents"; - -/// The repo an agent's config lives in — one repo per agent inside -/// [`AGENTS_ORG`], named after the agent. /// -/// The identity here is the point, not an accident to be inlined: this is -/// the single home for the naming convention, so a caller holding an agent -/// name never writes the repo name itself. Callers used to pass both, which -/// meant every node payload carried the same string twice and any future -/// change to the convention would have been a search rather than an edit. -pub fn agent_repo(agent: &str) -> &str { - agent -} +/// There is no per-agent repo-vs-agent naming convention to maintain here: +/// agent names are unique and every agent's repo lives in this one org, so +/// the agent name IS the repo name at every call site (dropped the +/// `agent_repo` identity function this used to go through, per review). +pub const AGENTS_ORG: &str = "agents"; /// The `operators` team, whitelisted for the merge gate on every repo /// this client protects — provisioned by `hive-c0re::forge::repos` diff --git a/swarm-controller/src/main.rs b/swarm-controller/src/main.rs index 37100d6a..3c39cf79 100644 --- a/swarm-controller/src/main.rs +++ b/swarm-controller/src/main.rs @@ -155,7 +155,7 @@ async fn run_swarm_node( SWARM_CONTROLLER_FORGE_TOKEN_FILE unset)" .to_owned(), ), - Some(client) => match client.create_repo(forge::agent_repo(&agent)).await { + Some(client) => match client.create_repo(&agent).await { Ok(full_name) => { tracing::info!(%full_name, "swarm jobq: create_repo done"); Outcome::Done @@ -169,10 +169,7 @@ async fn run_swarm_node( SWARM_CONTROLLER_FORGE_TOKEN_FILE unset)" .to_owned(), ), - Some(client) => match client - .add_repo_member(forge::agent_repo(&agent), &agent) - .await - { + Some(client) => match client.add_repo_member(&agent, &agent).await { Ok(()) => Outcome::Done, Err(e) => Outcome::Failed(format!("{e:#}")), }, @@ -183,10 +180,7 @@ async fn run_swarm_node( SWARM_CONTROLLER_FORGE_TOKEN_FILE unset)" .to_owned(), ), - Some(client) => match client - .seed_agent_config(forge::agent_repo(&agent), &agent) - .await - { + Some(client) => match client.seed_agent_config(&agent, &agent).await { Ok(()) => Outcome::Done, Err(e) => Outcome::Failed(format!("{e:#}")), },