feat: add optional description to request_apply_commit and request_spawn

This commit is contained in:
damocles 2026-05-16 14:26:12 +02:00
parent a6d1464071
commit 4a8a668348
9 changed files with 97 additions and 30 deletions

View file

@ -131,12 +131,14 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
message: format!("{e:#}"),
},
},
ManagerRequest::RequestSpawn { name } => {
ManagerRequest::RequestSpawn { name, description } => {
tracing::info!(%name, "manager: request_spawn");
match coord
.approvals
.submit_kind(name, hive_sh4re::ApprovalKind::Spawn, "")
{
match coord.approvals.submit_kind(
name,
hive_sh4re::ApprovalKind::Spawn,
"",
description.as_deref(),
) {
Ok(id) => {
tracing::info!(%id, %name, "spawn approval queued");
ManagerResponse::Ok
@ -257,9 +259,13 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
},
}
}
ManagerRequest::RequestApplyCommit { agent, commit_ref } => {
ManagerRequest::RequestApplyCommit {
agent,
commit_ref,
description,
} => {
tracing::info!(%agent, %commit_ref, "manager: request_apply_commit");
match submit_apply_commit(coord, agent, commit_ref).await {
match submit_apply_commit(coord, agent, commit_ref, description.as_deref()).await {
Ok((id, sha)) => {
tracing::info!(%id, %agent, manager_ref = %commit_ref, %sha, "approval queued + proposal tag planted");
ManagerResponse::Ok
@ -287,6 +293,7 @@ async fn submit_apply_commit(
coord: &Arc<Coordinator>,
agent: &str,
commit_ref: &str,
description: Option<&str>,
) -> anyhow::Result<(i64, String)> {
let proposed_dir = crate::coordinator::Coordinator::agent_proposed_dir(agent);
let applied_dir = crate::coordinator::Coordinator::agent_applied_dir(agent);
@ -304,7 +311,12 @@ async fn submit_apply_commit(
}
let id = coord
.approvals
.submit(agent, commit_ref)
.submit_kind(
agent,
hive_sh4re::ApprovalKind::ApplyCommit,
commit_ref,
description,
)
.map_err(|e| anyhow::anyhow!("queue approval row: {e:#}"))?;
let tag = format!("proposal/{id}");
let sha = match crate::lifecycle::git_fetch_to_tag(