feat(#2591): hive-jobq Node lifecycle — started/finished timestamps + failure reason

Node gains started_at/finished_at (chrono DateTime<Utc>, serialized
RFC 3339 on the wire per hive_sh4re::wire_time) plus error (String).
Graph::set_state self-stamps started_at on the first Running transition
and finished_at on the first terminal one, via an internal now_utc()
clock (keeps settle/complete signatures stable). Outcome::Failed(String)
carries the failure reason, set on the terminal transition.

hive-c0re complete_node builds Outcome::Failed(msg); its node_rt
side-table stays i64 for now (double-write) until #2637 reads the Node.

Toward #2637: the jobq graph becomes the source of truth for per-node
lifecycle so the queue can be sent to the client as-is.
This commit is contained in:
atlas 2026-07-22 23:02:24 +02:00 committed by mara
commit 03eb64cb5c
5 changed files with 115 additions and 9 deletions

View file

@ -408,7 +408,13 @@ impl JobQueue {
let now = now_unix();
let (error, outcome) = match result {
Ok(()) => (None, Outcome::Done),
Err(e) => (Some(truncate_error(&e)), Outcome::Failed),
Err(e) => {
// The reason rides the crate `Outcome::Failed` (stamped onto the
// graph `Node`); the `node_rt` copy stays for now until the wire
// reads it off the node directly.
let msg = truncate_error(&e);
(Some(msg.clone()), Outcome::Failed(msg))
}
};
if let Some(rt) = inner.node_rt.get_mut(&node_id) {
rt.finished_at = Some(now);