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

+6 -1
View File
@@ -242,13 +242,18 @@ class IngestionService:
for ch in chunks:
new_pool = []
for cand in getattr(ch, "candidate_pool", []):
t_id = cand.get('target_id') or cand.get('note_id')
# WP-24c v4.4.1: Harmonisierung - akzeptiere sowohl "to" als auch "target_id"
# Der chunking_processor verwendet "to", daher muss die Validierung beide Keys unterstützen
t_id = cand.get('target_id') or cand.get('to') or cand.get('note_id')
if not self._is_valid_id(t_id): continue
# WP-24c v4.4.1: explicit:callout Kanten werden NICHT validiert (bereits präzise)
# Sie müssen den Pool passieren, damit sie in Phase 1 erkannt werden
if cand.get("provenance") == "global_pool" and enable_smart:
is_valid = await validate_edge_candidate(ch.text, cand, self.batch_cache, self.llm)
if is_valid: new_pool.append(cand)
else:
# WP-24c v4.4.1: Alle anderen Provenances (inkl. explicit:callout) passieren ohne Validierung
new_pool.append(cand)
ch.candidate_pool = new_pool