Node contraction for node deletion while keeping provenance - #7569
Node contraction for node deletion while keeping provenance#7569agoscinski wants to merge 3 commits into
Conversation
Allow explicitly selected provenance regions to be deleted while preserving surviving boundary reachability through contracted links and process markers. Expose the behavior through the Python and CLI deletion interfaces, and support contracted provenance in archives and graph visualization.
Create one contracted link per surviving boundary node while retaining the original link mappings as marker metadata. Support rendering contraction markers and add regression coverage and demonstration scripts.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7569 +/- ##
===========================================
- Coverage 80.67% 30.18% -50.48%
===========================================
Files 581 583 +2
Lines 47068 47394 +326
===========================================
- Hits 37967 14302 -23665
- Misses 9101 33092 +23991 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
ping @giovannipizzi |
|
Thanks! This is a sort of "git rebase with squash" in a sense? Interesting, but I would like to discuss if we really need to break the rule on not having Calc to Calc nodes just for this (requires also adapting QueryBuilder and a number of other places, eg how to navigate from node to node), and see in practice how we would use it. Also, the deletion issue is slightly more general. Eg I might want to delete just on output node with raw data, keeping the actual nodes there (or even a single file), ideally keeping track of the fact I deleted stuff from a node. Maybe thinking first to a global solution would help (contraction might not be needed if I keep all nodes but remove the actual content? This also should help in not having to rewrite traversal queries, since with the compaction proposed here, the graph topology changes. This feature might still be useful, but I would suggest to first identify the actual use cases we want to cover |
Design
To delete intermediate nodes without loosing provenance information, we offer users to contract the graph at the points where the nodes are delete. An example
The contraction of nodes C_1, C_2 and D_mid results in in the provenance of
So it is lost how exactly the result has been calculated but not that these nodes were connected. Note that these contracted new links as a consequence can connect two ProcessNodes. In case we delete D_mid we get
One use case would be to delete all the restarts or retries of a Workflow without deleting the connection.
User API
An integration into
delete_nodesdid not make sense because contraction delete_nodes has the travers rules as argument and contraction is not compliant with deletion by traversal rules. So this features gets its own function with almost the same interface asdelete_nodesSimilar I think we will offer in verdi the endpoint
verdi node contractExamples
Example 1


Example 2


Example 3


Considerations on v3
No API break is needed. Even no database migration is needed because it introduces only a new LinkType which is stored as string in the database so no migration needed.
Considerations on collab
@khsrali
There shouldn't be much problems with the collaboration feature, because this replacement deletion works in 2 steps, it deletes existing nodes/links and adds new nodes/links, there is no mutation of existing nodes happening. The collaboration feature can already handle deletions so this shouldn't be an issue to support this replacement deletion.