refactor(#2302): type socket wire fields as ident, validated by serde on deserialize

This commit is contained in:
damocles 2026-07-20 21:21:03 +02:00 committed by mara
commit 84b750fba5
33 changed files with 333 additions and 263 deletions

View file

@ -141,7 +141,7 @@ pub async fn run(coord: &Arc<Coordinator>) -> Result<()> {
/// and into the sibling harness dir. Best-effort: logs warnings but never
/// fails. Idempotent — each file is only moved if present at the old path
/// and absent at the new path.
fn migrate_harness_files(name: &hive_host_sock::Ident) {
fn migrate_harness_files(name: &hive_types::Ident) {
const HARNESS_FILES: &[&str] = &[
"hyperhive-events.sqlite",
"hyperhive-turn-stats.sqlite",
@ -267,7 +267,7 @@ async fn rename_manager_container(coord: &Arc<Coordinator>) {
}
}
async fn enumerate_agents() -> Vec<hive_host_sock::Ident> {
async fn enumerate_agents() -> Vec<hive_types::Ident> {
let containers = lifecycle::list().await.unwrap_or_default();
containers
.into_iter()
@ -277,7 +277,7 @@ async fn enumerate_agents() -> Vec<hive_host_sock::Ident> {
} else {
c.strip_prefix(AGENT_PREFIX)?
};
hive_host_sock::Ident::parse(name).ok()
hive_types::Ident::parse(name).ok()
})
.collect()
}
@ -353,7 +353,7 @@ async fn repoint_container(name: &str) -> Result<()> {
/// Idempotent — skips when entry already present. Prevents a silent tool
/// downgrade when upgrading from a build that relied on the manager-flavor
/// fallback in `effective_tool_groups()`.
fn backfill_manager_tool_groups(names: &[hive_host_sock::Ident]) {
fn backfill_manager_tool_groups(names: &[hive_types::Ident]) {
if !names.iter().any(|n| n.as_str() == MANAGER_NAME) {
return; // ruth not deployed — nothing to backfill
}