hive-c0re: scrub manager-surface cookies + SetParent doc fix (#715 batch 7)

This commit is contained in:
damocles 2026-05-31 17:42:57 +02:00 committed by mara
commit 2bdb8c7d51
5 changed files with 37 additions and 37 deletions

View file

@ -23,7 +23,7 @@ pub fn start(coord: Arc<Coordinator>) -> Result<()> {
}
let listener = UnixListener::bind(&socket)
.with_context(|| format!("bind manager socket {}", socket.display()))?;
// 0666 so the in-container hm1nd user (post-#658) can connect;
// 0666 so the in-container hm1nd user (non-root) can connect;
// the bind source dir is manager-only on host. See agent_server.rs.
use std::os::unix::fs::PermissionsExt as _;
std::fs::set_permissions(&socket, std::fs::Permissions::from_mode(0o666))
@ -116,8 +116,9 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
// Resolve magic-recipient sentinels (currently `<parent>`)
// against topology.json; no-op for ordinary names. The
// manager has no parent in topology, so `<parent>`
// resolves to OPERATOR_RECIPIENT — matching mara's
// "no parent → tell the operator" rule (#692).
// resolves to OPERATOR_RECIPIENT — the "no parent → tell
// the operator" fallback. See `docs/conventions.md::
// Recipient sentinels`.
let resolved = crate::topology::resolve_recipient(MANAGER_AGENT, to);
match coord.broker.send(&Message {
from: MANAGER_AGENT.to_owned(),
@ -502,7 +503,7 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
}
}
ManagerRequest::SetStatus { text } => {
// #720: cap length + reject multi-line so a confused caller
// Cap length + reject multi-line so a confused caller
// can't dump a multi-paragraph session report into the
// dashboard chip.
if let Err(message) = crate::limits::check_status_text(text) {
@ -533,10 +534,10 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
}
ManagerRequest::GetAgentMeta { name } => {
let target = name.as_deref().unwrap_or(MANAGER_AGENT);
// #432: gate status on the target's running state so a
// stopped container's stale on-disk status doesn't leak
// through. Also surface `running` itself so callers can
// tell (e.g. "iris is down" vs "iris has no status set").
// Gate status on the target's running state so a stopped
// container's stale on-disk status doesn't leak through.
// Also surface `running` itself so callers can tell
// (e.g. "iris is down" vs "iris has no status set").
let (status_text, status_set_at, running) =
crate::container_view::read_agent_status_live(target).await;
let role = if target == MANAGER_AGENT {
@ -676,7 +677,7 @@ async fn submit_apply_commit(
.approvals
.set_fetched_sha(id, &sha)
.map_err(|e| anyhow::anyhow!("persist fetched_sha: {e:#}"))?;
// #317 pre-flight gates: both reject the apply before approval if
// Pre-flight gates: both reject the apply before approval if
// the agent's flake state would inflate meta's lock with duplicates
// or lie about what nix will fetch. Both checks independently read
// `<tag>:flake.lock` via git — they don't share state. Order matters
@ -889,8 +890,8 @@ async fn handle_fire_schedule_now(
}
}
/// Authorize + dispatch a `EditSchedule` patch (#474). Same
/// ownership rules as `CancelSchedule` — the manager can edit
/// Authorize + dispatch a `EditSchedule` patch. Same ownership
/// rules as `CancelSchedule` — the manager can edit
/// schedules it owns + any owned by an agent in its subtree.
/// Forwards the partial payload to
/// `ScheduledPrompts::update` which enforces the cancelled-row /