Refactor edge processing in graph_derive_edges.py and ingestion_processor.py for consistency and efficiency

Implement deterministic sorting of semantic groups in graph_derive_edges.py to ensure consistent edge extraction across batches. Update ingestion_processor.py to enhance change detection logic, ensuring that hash checks are performed before artifact checks to prevent redundant processing. These changes improve the reliability and efficiency of the edge building and ingestion workflows.
This commit is contained in:
Lars committed 2026-01-12 08:04:28 +01:00
1 parent 78fbc9b31b
commit 6047e94964
2 files changed
+17 -6

No files matched your search

+6 -1
View File
@@ -910,7 +910,12 @@ def build_edges_for_note(
# Schritt 3: ID-Zuweisung nach Scope-Entscheidung
final_edges: List[dict] = []
for semantic_key, group in semantic_groups.items():
# WP-24c v4.5.9: Deterministische Sortierung der semantic_groups für konsistente Edge-Extraktion
# Verhindert Varianz zwischen Batches (33 vs 34 Kanten)
sorted_semantic_keys = sorted(semantic_groups.keys())
for semantic_key in sorted_semantic_keys:
group = semantic_groups[semantic_key]
# WP-24c v4.4.0-DEBUG: Schnittstelle 4 - De-Duplizierung Entscheidung
# Prüfe, ob diese Gruppe Callout-Kanten enthält
has_callouts = any(e.get("provenance") == "explicit:callout" for e in group)