Skip to content

Commit 059dd13

Browse files
committed
fix(split-graph): implement exclusive outgoing edge corrections for split graph
1 parent b96e263 commit 059dd13

File tree

13 files changed

+201
-74
lines changed

13 files changed

+201
-74
lines changed

lib/dal/src/workspace_snapshot/node_weight.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ use crate::{
7676
},
7777
geometry_node_weight::GeometryNodeWeight,
7878
secret_node_weight::SecretNodeWeight,
79-
traits::SiVersionedNodeWeight,
79+
traits::{
80+
ExclusiveOutgoingEdges,
81+
SiVersionedNodeWeight,
82+
SplitCorrectExclusiveOutgoingEdge,
83+
},
8084
view_node_weight::ViewNodeWeight,
8185
},
8286
},
@@ -1324,8 +1328,9 @@ impl CorrectTransforms for NodeWeight {
13241328
Ok(self.correct_exclusive_outgoing_edges(workspace_snapshot_graph, updates))
13251329
}
13261330
}
1327-
1328-
impl CorrectExclusiveOutgoingEdge for NodeWeight {
1331+
impl CorrectExclusiveOutgoingEdge for NodeWeight {}
1332+
impl SplitCorrectExclusiveOutgoingEdge for NodeWeight {}
1333+
impl ExclusiveOutgoingEdges for NodeWeight {
13291334
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
13301335
match self {
13311336
NodeWeight::Action(weight) => weight.exclusive_outgoing_edges(),

lib/dal/src/workspace_snapshot/node_weight/approval_requirement_definition_node_weight/v1.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717
node_weight::traits::{
1818
CorrectExclusiveOutgoingEdge,
1919
CorrectTransforms,
20+
ExclusiveOutgoingEdges,
2021
SiNodeWeight,
2122
},
2223
},
@@ -51,7 +52,9 @@ impl ApprovalRequirementDefinitionNodeWeightV1 {
5152

5253
impl CorrectTransforms for ApprovalRequirementDefinitionNodeWeightV1 {}
5354

54-
impl CorrectExclusiveOutgoingEdge for ApprovalRequirementDefinitionNodeWeightV1 {
55+
impl CorrectExclusiveOutgoingEdge for ApprovalRequirementDefinitionNodeWeightV1 {}
56+
57+
impl ExclusiveOutgoingEdges for ApprovalRequirementDefinitionNodeWeightV1 {
5558
fn exclusive_outgoing_edges(&self) -> &[crate::EdgeWeightKindDiscriminants] {
5659
&[]
5760
}

lib/dal/src/workspace_snapshot/node_weight/diagram_object_node_weight/v1.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use crate::{
3232
CorrectTransforms,
3333
CorrectTransformsError,
3434
CorrectTransformsResult,
35+
ExclusiveOutgoingEdges,
3536
SiNodeWeight,
3637
},
3738
},
@@ -207,7 +208,9 @@ impl CorrectTransforms for DiagramObjectNodeWeightV1 {
207208
}
208209
}
209210

210-
impl CorrectExclusiveOutgoingEdge for DiagramObjectNodeWeightV1 {
211+
impl CorrectExclusiveOutgoingEdge for DiagramObjectNodeWeightV1 {}
212+
213+
impl ExclusiveOutgoingEdges for DiagramObjectNodeWeightV1 {
211214
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
212215
&[]
213216
}

lib/dal/src/workspace_snapshot/node_weight/geometry_node_weight/v1.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use crate::{
4545
CorrectTransforms,
4646
CorrectTransformsError,
4747
CorrectTransformsResult,
48+
ExclusiveOutgoingEdges,
4849
SiNodeWeight,
4950
},
5051
},
@@ -280,7 +281,9 @@ impl CorrectTransforms for GeometryNodeWeightV1 {
280281
}
281282
}
282283

283-
impl CorrectExclusiveOutgoingEdge for GeometryNodeWeightV1 {
284+
impl CorrectExclusiveOutgoingEdge for GeometryNodeWeightV1 {}
285+
286+
impl ExclusiveOutgoingEdges for GeometryNodeWeightV1 {
284287
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
285288
&[EdgeWeightKindDiscriminants::Represents]
286289
}

lib/dal/src/workspace_snapshot/node_weight/input_socket_node_weight/v1.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use crate::{
2020
traits::{
2121
CorrectExclusiveOutgoingEdge,
2222
CorrectTransforms,
23+
ExclusiveOutgoingEdges,
2324
SiNodeWeight,
2425
},
2526
},
@@ -62,7 +63,9 @@ impl InputSocketNodeWeightV1 {
6263

6364
impl CorrectTransforms for InputSocketNodeWeightV1 {}
6465

65-
impl CorrectExclusiveOutgoingEdge for InputSocketNodeWeightV1 {
66+
impl CorrectExclusiveOutgoingEdge for InputSocketNodeWeightV1 {}
67+
68+
impl ExclusiveOutgoingEdges for InputSocketNodeWeightV1 {
6669
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
6770
&[]
6871
}

lib/dal/src/workspace_snapshot/node_weight/management_prototype_node_weight/v1.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717
node_weight::traits::{
1818
CorrectExclusiveOutgoingEdge,
1919
CorrectTransforms,
20+
ExclusiveOutgoingEdges,
2021
SiNodeWeight,
2122
},
2223
},
@@ -89,7 +90,8 @@ impl SiNodeWeight for ManagementPrototypeNodeWeightV1 {
8990
}
9091

9192
impl CorrectTransforms for ManagementPrototypeNodeWeightV1 {}
92-
impl CorrectExclusiveOutgoingEdge for ManagementPrototypeNodeWeightV1 {
93+
impl CorrectExclusiveOutgoingEdge for ManagementPrototypeNodeWeightV1 {}
94+
impl ExclusiveOutgoingEdges for ManagementPrototypeNodeWeightV1 {
9395
fn exclusive_outgoing_edges(&self) -> &[crate::EdgeWeightKindDiscriminants] {
9496
&[]
9597
}

lib/dal/src/workspace_snapshot/node_weight/reason_node_weight/v1.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717
node_weight::traits::{
1818
CorrectExclusiveOutgoingEdge,
1919
CorrectTransforms,
20+
ExclusiveOutgoingEdges,
2021
SiNodeWeight,
2122
},
2223
},
@@ -45,8 +46,8 @@ impl ReasonNodeWeightV1 {
4546
}
4647

4748
impl CorrectTransforms for ReasonNodeWeightV1 {}
48-
49-
impl CorrectExclusiveOutgoingEdge for ReasonNodeWeightV1 {
49+
impl CorrectExclusiveOutgoingEdge for ReasonNodeWeightV1 {}
50+
impl ExclusiveOutgoingEdges for ReasonNodeWeightV1 {
5051
fn exclusive_outgoing_edges(&self) -> &[crate::EdgeWeightKindDiscriminants] {
5152
&[]
5253
}

lib/dal/src/workspace_snapshot/node_weight/schema_variant_node_weight/v1.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ use crate::{
5353
traits::{
5454
CorrectExclusiveOutgoingEdge,
5555
CorrectTransforms,
56+
ExclusiveOutgoingEdges,
5657
SiNodeWeight,
5758
},
5859
},
@@ -568,8 +569,8 @@ impl CorrectTransforms for SchemaVariantNodeWeightV1 {
568569
Ok(updates)
569570
}
570571
}
571-
572-
impl CorrectExclusiveOutgoingEdge for SchemaVariantNodeWeightV1 {
572+
impl CorrectExclusiveOutgoingEdge for SchemaVariantNodeWeightV1 {}
573+
impl ExclusiveOutgoingEdges for SchemaVariantNodeWeightV1 {
573574
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
574575
&[]
575576
}

lib/dal/src/workspace_snapshot/node_weight/traits.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ use crate::{
2323

2424
pub mod correct_exclusive_outgoing_edge;
2525

26-
pub use correct_exclusive_outgoing_edge::CorrectExclusiveOutgoingEdge;
26+
pub use correct_exclusive_outgoing_edge::{
27+
CorrectExclusiveOutgoingEdge,
28+
ExclusiveOutgoingEdges,
29+
SplitCorrectExclusiveOutgoingEdge,
30+
};
2731

2832
#[remain::sorted]
2933
#[derive(Debug, Error)]
@@ -51,7 +55,9 @@ pub trait CorrectTransforms {
5155
}
5256
}
5357

54-
pub trait SiNodeWeight: CorrectTransforms + CorrectExclusiveOutgoingEdge + Sized {
58+
pub trait SiNodeWeight:
59+
CorrectTransforms + CorrectExclusiveOutgoingEdge + ExclusiveOutgoingEdges + Sized
60+
{
5561
fn content_hash(&self) -> ContentHash;
5662
fn id(&self) -> Ulid;
5763
fn lineage_id(&self) -> Ulid;
@@ -184,6 +190,12 @@ impl<T> CorrectExclusiveOutgoingEdge for T
184190
where
185191
T: SiVersionedNodeWeight,
186192
NodeInformation: for<'a> From<&'a T>,
193+
{
194+
}
195+
196+
impl<T> ExclusiveOutgoingEdges for T
197+
where
198+
T: SiVersionedNodeWeight,
187199
{
188200
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
189201
self.inner().exclusive_outgoing_edges()

0 commit comments

Comments
 (0)