hive-c0re: pull each meta-update cascade agent's own config-repo main

mara (hyperhive#4271): "whatever is on main is trusted and should be
pulled. dont make it periodic, just add it to the meta update when
choosing the agent."

A meta-input bump previously rebuilt every affected agent against
whatever applied/<name> was already locked to. Normally current, but
silently stale forever if a past deploy failed and nothing since
retried it — the manual meta-input trigger never special-cased that
either, since nothing wired it to check the config repo's live main at
all.

run_meta_lock now relocks each cascade agent's own input alongside the
originally-requested ones, against the input's declared source (the
forge URL) rather than the local applied/<name> mirror prepare_deploy
uses for a reviewed deploy — there's no PR to review on this path, so
nothing to gate. One combined lock_update call for the whole cascade:
simpler than per-agent isolation, at the cost of one broken/unreachable
agent repo failing the whole cascade relock rather than just that
agent (the separate top-level input bump above it is unaffected).

Known gap, not fixed here: applied/<name>'s own main/deployed/* tags
never advance from this path, only a real MergeConfigPr deploy does
that — so the audit trail stays as accurate as today, it just stops
being what actually got built.
This commit is contained in:
damocles 2026-09-13 16:14:11 +02:00 committed by mara
commit f0ddbe49d0

View file

@ -548,6 +548,23 @@ async fn run_meta_lock(
Some(list) => list, Some(list) => list,
None => meta_update_cascade_agents(inputs).await, None => meta_update_cascade_agents(inputs).await,
}; };
// Pull each cascade agent's own input too — an agent's config-repo main
// is trusted, so a meta-input bump is a reasonable place to also catch
// it up. Without this, a meta-input bump rebuilds every affected agent
// against whatever `applied/<name>`
// already happened to be locked to — normally current, but silently
// stale forever if a past deploy failed and nothing since retried it.
// Relocks against each agent's *declared* input (the forge URL, not the
// local `applied/<name>` mirror `prepare_deploy` uses for a reviewed
// deploy) — this path has no PR to review, so there's nothing to gate.
// One combined call, not per-agent: simpler, at the cost of one
// unreachable/broken agent repo failing the whole cascade relock rather
// than just that agent.
if !cascade.is_empty() {
let agent_inputs: Vec<String> =
cascade.iter().map(|name| format!("agent-{name}")).collect();
crate::meta::lock_update(&agent_inputs).await?;
}
// Grow one rebuild subgraph per affected agent into *this* meta-update // Grow one rebuild subgraph per affected agent into *this* meta-update
// DAG (rooted on this `MetaLock`, so they build against the post-bump // DAG (rooted on this `MetaLock`, so they build against the post-bump
// lock), rather than fanning out child DAGs. `relock = false` — the // lock), rather than fanning out child DAGs. `relock = false` — the