feat(#2500): validate NodeId references on insert and deserialize
Per mara's direction — validate ids as they enter the graph so internal iteration can trust every id the graph holds; the generational route for removal comes later. Adds GraphError; insert() now rejects a dangling Dep::Node / parent id (it is fallible); validate() checks all internal id references resolve and that next_id is past the largest existing id; deserialization runs validate() via #[serde(try_from = "GraphData<N>")], so a loaded graph can never carry a dangling reference. 5 new tests; serde_json added as a dev-dependency for the round-trip cases.
This commit is contained in:
parent
570188fa1a
commit
11df4a1bf5
3 changed files with 214 additions and 14 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -1667,6 +1667,7 @@ name = "hive-jobq"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.18",
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue