refactor(#2591): fix wire-shape consumers (server await_dags, tests)

- server::await_dags: a DAG is settled when gone from the snapshot (fully
  Done) or present with all nodes terminal; pending only with a non-terminal
  node (DagView no longer carries a rolled-up state).
- DagView::rollup_state() added to hive-sh4re — the shared node-set roll-up
  derivation every Rust consumer uses.
- JobQueue::build_log_id_of(node_id) — the node_id -> build_logs lookup the
  query endpoint will use; tests assert log-id via it now.
- tests: derive roll-up state; drop the off-wire step/build_log_id wire asserts.
This commit is contained in:
atlas 2026-07-23 15:01:58 +02:00 committed by mara
commit 51bcad1adb
4 changed files with 69 additions and 13 deletions

View file

@ -361,7 +361,6 @@ impl JobQueue {
let mut inner = self.lock();
let inner = &mut *inner;
let started = inner.sched.settle();
let now = now_unix();
let mut claims = Vec::with_capacity(started.len());
for id in started {
let Some(node) = inner.sched.graph().node(id) else {
@ -511,6 +510,17 @@ impl JobQueue {
true
}
/// The `build_logs` row id linked to `node_id`, if any — the lookup behind
/// the `GET /api/build-log/<node_id>` query endpoint (the client fetches a
/// node's captured build output on demand rather than receiving it inline).
#[must_use]
pub fn build_log_id_of(&self, node_id: NodeId) -> Option<i64> {
self.lock()
.node_rt
.get(&node_id)
.and_then(|r| r.build_log_id)
}
/// A DAG's terminal roll-up summary, computed on demand from its container.
/// `None` if the DAG id is unknown. Test-only — production reads the summary
/// `complete_node` returns when the container rolls up terminal.