Enhance compatibility in chunking and edge processing for version 4.4.1: Harmonize handling of "to" and "target_id" across chunking_processor.py, graph_derive_edges.py, and ingestion_processor.py. Ensure consistent validation and processing of explicit callouts, improving integration and reliability in edge candidate handling.

This commit is contained in:
Lars committed 2026-01-11 15:39:03 +01:00
1 parent d7d6155203
commit 2d87f9d816
3 files changed
+22 -5

No files matched your search

+8 -3
View File
@@ -340,14 +340,16 @@ def build_edges_for_note(
logger.debug(f"Note [{note_id}]: Chunk [{ch.get('index', '?')}] hat {pool_size} Kanten im Candidate-Pool ({explicit_callout_count} explicit:callout)")
for cand in pool:
raw_t = cand.get("to")
# WP-24c v4.4.1: Harmonisierung - akzeptiere sowohl "to" als auch "target_id"
raw_t = cand.get("to") or cand.get("target_id")
k = cand.get("kind", "related_to")
p = cand.get("provenance", "semantic_ai")
# WP-24c v4.4.1: String-Check - Provenance muss exakt "explicit:callout" sein (case-sensitive)
# WP-24c v4.2.9 Fix B: Wenn Provenance explicit:callout, extrahiere Key
# WP-24c v4.3.1: Key-Generierung gehärtet - Format (kind, target_id, target_section)
# Exakt konsistent mit dem globalen Scan für zuverlässige Deduplizierung
if p == "explicit:callout":
if p == "explicit:callout" and raw_t:
t, sec = parse_link_target(raw_t, note_id)
if t:
# Key-Format: (kind, target_id, target_section) - exakt wie im globalen Scan
@@ -390,7 +392,10 @@ def build_edges_for_note(
# WP-24c v4.2.9: Erstelle Kanten aus candidate_pool (Keys bereits in Phase 1 gesammelt)
pool = ch.get("candidate_pool") or ch.get("candidate_edges") or []
for cand in pool:
raw_t, k, p = cand.get("to"), cand.get("kind", "related_to"), cand.get("provenance", "semantic_ai")
# WP-24c v4.4.1: Harmonisierung - akzeptiere sowohl "to" als auch "target_id"
raw_t = cand.get("to") or cand.get("target_id")
k = cand.get("kind", "related_to")
p = cand.get("provenance", "semantic_ai")
t, sec = parse_link_target(raw_t, note_id)
if t:
# WP-24c v4.1.0: target_section fließt nun fest in die ID-Generierung ein