refactor(#2772): enumflags2 for the edge set; drop re-export shims

Review follow-ups on #2785.

`DepWhen` wraps `BitFlags<TerminalState>` instead of a hand-rolled `u8`,
so the bit manipulation belongs to the library and `TerminalState` gains
its flag value from `#[bitflags]` rather than a `bit()` match anyone
could get wrong. `of`/`accepts`/`is_empty` become one-liners over it.

Serialization is written out by hand rather than derived: clippy's
`unsafe_derive_deserialize` fires on deriving over a type with unsafe
internals, and the honest fix is to say what the wire form is. It is now
the list of accepted outcomes — `["done","failed"]` — which reads better
than a bitmask and survives the bits being renumbered.

Also drops the `pub use` re-export of `DepWhen` / `TerminalState` from
hive-c0re's `model`. It existed so that `use super::model::…` kept
compiling, which is a shim for one consumer's convenience; the sites
import from `hive_jobq` directly now.

And removes comments narrating what the code used to be. Git holds that.
This commit is contained in:
atlas 2026-07-27 17:07:27 +02:00 committed by mara
commit 940c928fee
8 changed files with 74 additions and 50 deletions

View file

@ -11,7 +11,9 @@ use std::sync::Arc;
use anyhow::{Context as _, Result};
use super::Claim;
use super::model::{NodeKind, NodeSpec, TerminalState};
use hive_jobq::TerminalState;
use super::model::{NodeKind, NodeSpec};
use crate::coordinator::Coordinator;
use crate::power::{ReconcileAction, reconcile_action};