refactor(#2815): held_transients -> running_transients

mara on !2910: "rename now, we will see if we can remove it later when
some of the users have been removed or work differently."

Nothing is held. The old name described a transient the DAG declared and
kept for its whole lifetime — precisely the thing this PR replaces — so
it outlived its own meaning the moment the derivation landed. The value
is recomputed from the running set on every call.

Kept as a function rather than inlined at its single call site, per the
above: removing it is a later step that depends on its users changing,
not something this PR should force.

Rename plus its two references (the call in `reconcile_transients` and
the module doc link). No behaviour change; the doc comment records what
the old name meant so the rename doesn't erase the reason for it.

Checked with clippy (`--all-targets -D warnings`), `cargo test -p
hive-c0re -p hive-jobq` (322 + 41 passed) and `nix fmt`.
This commit is contained in:
atlas 2026-08-01 16:39:38 +02:00
commit 17500a391d
2 changed files with 23 additions and 28 deletions

View file

@ -5,7 +5,7 @@
//!
//! Owns the per-agent transient guard (dashboard pill + crash-watch
//! suppression) that the sync queue core can't hold itself. The guard set is
//! *reconciled* each loop from [`super::JobQueue::held_transients`], which
//! *reconciled* each loop from [`super::JobQueue::running_transients`], which
//! reports what is **running right now** under each held agent lease — so the
//! label tracks the DAG's progress (signal → swap → reconcile) instead of
//! repeating one intent the template declared before any of it started.
@ -171,9 +171,9 @@ fn reconcile_transients(
coord: &Arc<Coordinator>,
transients: &mut HashMap<String, (String, crate::coordinator::TransientGuard)>,
) {
let held = coord.job_queue.held_transients();
transients.retain(|agent, (label, _)| held.iter().any(|(a, l, _)| a == agent && l == label));
for (agent, label, takes_down) in held {
let running = coord.job_queue.running_transients();
transients.retain(|agent, (label, _)| running.iter().any(|(a, l, _)| a == agent && l == label));
for (agent, label, takes_down) in running {
transients.entry(agent.clone()).or_insert_with(|| {
let guard = coord.transient_guard(&agent, label.clone(), takes_down);
(label, guard)