WP24c - Agentic Edge Validation & Chunk-Aware Multigraph-System (v4.5.8) #22

Merged
Lars merged 71 commits from WP24c into main 2026-01-12 10:53:20 +01:00
Owner

feat: Phase 3 Agentic Edge Validation & Chunk-Aware Multigraph-System (v4.5.8)

Phase 3 Agentic Edge Validation

  • Finales Validierungs-Gate für Kanten mit candidate: Präfix
  • LLM-basierte semantische Prüfung gegen Kontext (Note-Scope vs. Chunk-Scope)
  • Differenzierte Fehlerbehandlung: Transiente Fehler erlauben Kante, permanente Fehler lehnen ab
  • Kontext-Optimierung: Note-Scope nutzt Note-Summary/Text, Chunk-Scope nutzt spezifischen Chunk-Text
  • Implementierung in app/core/ingestion/ingestion_validation.py (v2.14.0)

Automatische Spiegelkanten (Invers-Logik)

  • Automatische Erzeugung von Spiegelkanten für explizite Verbindungen
  • Phase 2 Batch-Injektion am Ende des Imports
  • Authority-Check: Explizite Kanten haben Vorrang (keine Duplikate)
  • Provenance Firewall: System-Kanten können nicht manuell überschrieben werden
  • Implementierung in app/core/ingestion/ingestion_processor.py (v2.13.12)

Note-Scope Zonen (v4.2.0)

  • Globale Verbindungen für ganze Notizen (scope: note)
  • Konfigurierbare Header-Namen via ENV-Variablen
  • Höchste Priorität bei Duplikaten
  • Phase 3 Validierung nutzt Note-Summary/Text für bessere Präzision
  • Implementierung in app/core/graph/graph_derive_edges.py (v1.1.2)

Chunk-Aware Multigraph-System

  • Section-basierte Links: Note#Section wird präzise in target_id und target_section aufgeteilt
  • Multigraph-Support: Mehrere Kanten zwischen denselben Knoten möglich (verschiedene Sections)
  • Semantische Deduplizierung basierend auf src->tgt:kind@sec Key
  • Metadaten-Persistenz: target_section, provenance, confidence bleiben erhalten

Code-Komponenten

  • app/core/ingestion/ingestion_validation.py: v2.14.0 (Phase 3 Validierung, Kontext-Optimierung)
  • app/core/ingestion/ingestion_processor.py: v2.13.12 (Automatische Spiegelkanten, Authority-Check)
  • app/core/graph/graph_derive_edges.py: v1.1.2 (Note-Scope Zonen, LLM-Validierung Zonen)
  • app/core/chunking/chunking_processor.py: v2.13.0 (LLM-Validierung Zonen Erkennung)
  • app/core/chunking/chunking_parser.py: v2.12.0 (Header-Level Erkennung, Zonen-Extraktion)

Konfiguration

  • Neue ENV-Variablen für konfigurierbare Header:
    • MINDNET_LLM_VALIDATION_HEADERS (Default: "Unzugeordnete Kanten,Edge Pool,Candidates")
    • MINDNET_LLM_VALIDATION_HEADER_LEVEL (Default: 3)
    • MINDNET_NOTE_SCOPE_ZONE_HEADERS (Default: "Smart Edges,Relationen,Global Links,Note-Level Relations,Globale Verbindungen")
    • MINDNET_NOTE_SCOPE_HEADER_LEVEL (Default: 2)
  • config/llm_profiles.yaml: ingest_validator Profil für Phase 3 Validierung (Temperature 0.0)
  • config/prompts.yaml: edge_validation Prompt für Phase 3 Validierung

Dokumentation

  • 01_knowledge_design.md: Automatische Spiegelkanten, Phase 3 Validierung, Note-Scope Zonen
  • NOTE_SCOPE_ZONEN.md: Phase 3 Validierung integriert
  • LLM_VALIDIERUNG_VON_LINKS.md: Phase 3 statt global_pool, Kontext-Optimierung
  • 02_concept_graph_logic.md: Phase 3 Validierung, automatische Spiegelkanten, Note-Scope vs. Chunk-Scope
  • 03_tech_data_model.md: candidate: Präfix, verified Status, virtual Flag, scope Feld
  • 03_tech_configuration.md: Neue ENV-Variablen dokumentiert
  • 04_admin_operations.md: Troubleshooting für Phase 3 Validierung und Note-Scope Links
  • 05_testing_guide.md: WP-24c Test-Szenarien hinzugefügt
  • 00_quality_checklist.md: WP-24c Features in Checkliste aufgenommen
  • README.md: Version auf v4.5.8 aktualisiert, WP-24c Features verlinkt

Breaking Changes

  • Keine Breaking Changes für Endbenutzer
  • Vollständige Rückwärtskompatibilität
  • Bestehende Notizen funktionieren ohne Änderungen

Migration

  • Keine Migration erforderlich
  • System funktioniert ohne Änderungen
  • Optional: ENV-Variablen können für Custom-Header konfiguriert werden

Status: WP-24c ist zu 100% implementiert und audit-geprüft.
Nächster Schritt: WP-25c (Kontext-Budgeting & Erweiterte Prompt-Optimierung).


---

## Zusammenfassung

Dieser Merge führt die **Phase 3 Agentic Edge Validation** und das **Chunk-Aware Multigraph-System** in MindNet ein. Das System validiert nun automatisch Kanten mit `candidate:` Präfix, erzeugt automatisch Spiegelkanten für explizite Verbindungen und unterstützt Note-Scope Zonen für globale Verbindungen.

**Kern-Features:**
- Phase 3 Agentic Edge Validation (finales Validierungs-Gate)
- Automatische Spiegelkanten (Invers-Logik)
- Note-Scope Zonen (globale Verbindungen)
- Chunk-Aware Multigraph-System (Section-basierte Links)

**Technische Integrität:**
- Alle Kanten durchlaufen Phase 3 Validierung (falls candidate: Präfix)
- Spiegelkanten werden automatisch erzeugt (Phase 2)
- Note-Scope Links haben höchste Priorität
- Kontext-Optimierung für bessere Validierungs-Genauigkeit

**Dokumentation:**
- Vollständige Aktualisierung aller relevanten Dokumente
- Neue ENV-Variablen dokumentiert
- Troubleshooting-Guide erweitert
- Test-Szenarien hinzugefügt

**Deployment:**
- Keine Breaking Changes
- Optional: ENV-Variablen für Custom-Header konfigurieren
- System funktioniert ohne Änderungen
feat: Phase 3 Agentic Edge Validation & Chunk-Aware Multigraph-System (v4.5.8) ### Phase 3 Agentic Edge Validation - Finales Validierungs-Gate für Kanten mit candidate: Präfix - LLM-basierte semantische Prüfung gegen Kontext (Note-Scope vs. Chunk-Scope) - Differenzierte Fehlerbehandlung: Transiente Fehler erlauben Kante, permanente Fehler lehnen ab - Kontext-Optimierung: Note-Scope nutzt Note-Summary/Text, Chunk-Scope nutzt spezifischen Chunk-Text - Implementierung in app/core/ingestion/ingestion_validation.py (v2.14.0) ### Automatische Spiegelkanten (Invers-Logik) - Automatische Erzeugung von Spiegelkanten für explizite Verbindungen - Phase 2 Batch-Injektion am Ende des Imports - Authority-Check: Explizite Kanten haben Vorrang (keine Duplikate) - Provenance Firewall: System-Kanten können nicht manuell überschrieben werden - Implementierung in app/core/ingestion/ingestion_processor.py (v2.13.12) ### Note-Scope Zonen (v4.2.0) - Globale Verbindungen für ganze Notizen (scope: note) - Konfigurierbare Header-Namen via ENV-Variablen - Höchste Priorität bei Duplikaten - Phase 3 Validierung nutzt Note-Summary/Text für bessere Präzision - Implementierung in app/core/graph/graph_derive_edges.py (v1.1.2) ### Chunk-Aware Multigraph-System - Section-basierte Links: [[Note#Section]] wird präzise in target_id und target_section aufgeteilt - Multigraph-Support: Mehrere Kanten zwischen denselben Knoten möglich (verschiedene Sections) - Semantische Deduplizierung basierend auf src->tgt:kind@sec Key - Metadaten-Persistenz: target_section, provenance, confidence bleiben erhalten ### Code-Komponenten - app/core/ingestion/ingestion_validation.py: v2.14.0 (Phase 3 Validierung, Kontext-Optimierung) - app/core/ingestion/ingestion_processor.py: v2.13.12 (Automatische Spiegelkanten, Authority-Check) - app/core/graph/graph_derive_edges.py: v1.1.2 (Note-Scope Zonen, LLM-Validierung Zonen) - app/core/chunking/chunking_processor.py: v2.13.0 (LLM-Validierung Zonen Erkennung) - app/core/chunking/chunking_parser.py: v2.12.0 (Header-Level Erkennung, Zonen-Extraktion) ### Konfiguration - Neue ENV-Variablen für konfigurierbare Header: - MINDNET_LLM_VALIDATION_HEADERS (Default: "Unzugeordnete Kanten,Edge Pool,Candidates") - MINDNET_LLM_VALIDATION_HEADER_LEVEL (Default: 3) - MINDNET_NOTE_SCOPE_ZONE_HEADERS (Default: "Smart Edges,Relationen,Global Links,Note-Level Relations,Globale Verbindungen") - MINDNET_NOTE_SCOPE_HEADER_LEVEL (Default: 2) - config/llm_profiles.yaml: ingest_validator Profil für Phase 3 Validierung (Temperature 0.0) - config/prompts.yaml: edge_validation Prompt für Phase 3 Validierung ### Dokumentation - 01_knowledge_design.md: Automatische Spiegelkanten, Phase 3 Validierung, Note-Scope Zonen - NOTE_SCOPE_ZONEN.md: Phase 3 Validierung integriert - LLM_VALIDIERUNG_VON_LINKS.md: Phase 3 statt global_pool, Kontext-Optimierung - 02_concept_graph_logic.md: Phase 3 Validierung, automatische Spiegelkanten, Note-Scope vs. Chunk-Scope - 03_tech_data_model.md: candidate: Präfix, verified Status, virtual Flag, scope Feld - 03_tech_configuration.md: Neue ENV-Variablen dokumentiert - 04_admin_operations.md: Troubleshooting für Phase 3 Validierung und Note-Scope Links - 05_testing_guide.md: WP-24c Test-Szenarien hinzugefügt - 00_quality_checklist.md: WP-24c Features in Checkliste aufgenommen - README.md: Version auf v4.5.8 aktualisiert, WP-24c Features verlinkt ### Breaking Changes - Keine Breaking Changes für Endbenutzer - Vollständige Rückwärtskompatibilität - Bestehende Notizen funktionieren ohne Änderungen ### Migration - Keine Migration erforderlich - System funktioniert ohne Änderungen - Optional: ENV-Variablen können für Custom-Header konfiguriert werden --- **Status:** ✅ WP-24c ist zu 100% implementiert und audit-geprüft. **Nächster Schritt:** WP-25c (Kontext-Budgeting & Erweiterte Prompt-Optimierung). ``` --- ## Zusammenfassung Dieser Merge führt die **Phase 3 Agentic Edge Validation** und das **Chunk-Aware Multigraph-System** in MindNet ein. Das System validiert nun automatisch Kanten mit `candidate:` Präfix, erzeugt automatisch Spiegelkanten für explizite Verbindungen und unterstützt Note-Scope Zonen für globale Verbindungen. **Kern-Features:** - Phase 3 Agentic Edge Validation (finales Validierungs-Gate) - Automatische Spiegelkanten (Invers-Logik) - Note-Scope Zonen (globale Verbindungen) - Chunk-Aware Multigraph-System (Section-basierte Links) **Technische Integrität:** - Alle Kanten durchlaufen Phase 3 Validierung (falls candidate: Präfix) - Spiegelkanten werden automatisch erzeugt (Phase 2) - Note-Scope Links haben höchste Priorität - Kontext-Optimierung für bessere Validierungs-Genauigkeit **Dokumentation:** - Vollständige Aktualisierung aller relevanten Dokumente - Neue ENV-Variablen dokumentiert - Troubleshooting-Guide erweitert - Test-Szenarien hinzugefügt **Deployment:** - Keine Breaking Changes - Optional: ENV-Variablen für Custom-Header konfigurieren - System funktioniert ohne Änderungen
Lars added 71 commits 2026-01-12 10:52:40 +01:00
Update qdrant_points.py, graph_utils.py, ingestion_db.py, ingestion_processor.py, and import_markdown.py: Enhance UUID generation for edge IDs, improve error handling, and refine documentation for clarity. Implement atomic consistency in batch upserts and ensure strict phase separation in the ingestion workflow. Update versioning to reflect changes in functionality and maintain compatibility with the ingestion service.
Implement functions to extract LLM validation zones from Markdown, allowing for configurable header identification via environment variables. Enhance the existing note scope zone extraction to differentiate between note scope and LLM validation zones. Update edge building logic to handle LLM validation edges with a 'candidate:' prefix, ensuring proper processing and avoiding duplicates in global scans. This update improves the overall handling of edge data and enhances the flexibility of the extraction process.
Implement support for H2 headers in LLM validation zone detection, allowing for improved flexibility in header recognition. Update the extraction logic to track zones during callout processing, ensuring accurate differentiation between LLM validation and standard zones. This enhancement improves the handling of callouts and their associated metadata, contributing to more precise edge construction.
Enhance the extraction logic to store the zone status before header updates, ensuring accurate context during callout processing. Initialize the all_chunk_callout_keys set prior to its usage to prevent potential UnboundLocalError. These improvements contribute to more reliable edge construction and better handling of LLM validation zones.
Enhance the edge validation process by introducing logic to validate edges with rule IDs starting with "candidate:". This includes extracting target IDs, validating against the entire note text, and updating rule IDs upon successful validation. Rejected edges are logged for traceability, improving the overall handling of edge data during ingestion.
Remove LLM validation from the candidate edge processing loop, shifting it to a later phase for improved context handling. Introduce a new validation mechanism that aggregates note text for better decision-making and optimizes the validation criteria to include both rule IDs and provenance. Update logging to reflect the new validation phases and ensure rejected edges are not processed further. This enhances the overall efficiency and accuracy of edge validation during ingestion.
Introduce a new method for persisting rejected edges for audit purposes, enhancing traceability and validation logic. Update the decision engine to utilize a generic fallback template for improved error handling during LLM validation. Revise documentation across multiple files to reflect the new versioning, context, and features related to Phase 3 validation, including automatic mirror edges and note-scope zones. This update ensures better graph integrity and validation accuracy in the ingestion process.
Implement path normalization to ensure consistent hash checks by converting file paths to absolute paths. Update change detection logic to handle hash comparisons more robustly, treating missing hashes as content changes for safety. This prevents redundant processing and improves efficiency in the ingestion workflow.
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.
Add detailed debug and warning logs to the change detection process, providing insights into hash comparisons and artifact checks. This update aims to facilitate better traceability and debugging during ingestion, particularly when handling hash changes and missing hashes. The changes ensure that the ingestion workflow is more transparent and easier to troubleshoot.
Change debug logs to info and warning levels in ingestion_processor.py to enhance the visibility of change detection processes, including hash comparisons and artifact checks. Additionally, ensure .env is loaded before logging setup in import_markdown.py to correctly read the DEBUG environment variable. These adjustments aim to improve traceability and debugging during ingestion workflows.
Add comprehensive logging for hash input, body length comparisons, and frontmatter key checks in the change detection process. This update aims to improve traceability and facilitate debugging by providing insights into potential discrepancies between new and old payloads during ingestion workflows.
Update the ingestion process to utilize the parsed object instead of note_pl for hash input, body, and frontmatter extraction. This change ensures that the correct content is used for comparisons, enhancing the reliability of change detection diagnostics and improving overall ingestion accuracy.
Update the ingestion process to convert the parsed object to a dictionary before passing it to the hash input function. This change ensures compatibility with the updated function requirements and improves the accuracy of hash comparisons during ingestion workflows.
Update the logging statement to provide additional context during the ingestion process by including the normalized file path and note title. This change aims to improve traceability and debugging capabilities in the ingestion workflow.
Add a check for ID collisions during the ingestion process to prevent multiple files from using the same note_id. Update logging levels to DEBUG for detailed diagnostics on hash comparisons, body lengths, and frontmatter keys, improving traceability and debugging capabilities in the ingestion workflow.
Implement a new method to log ID collisions into a separate file (logs/id_collisions.log) for manual analysis. This update captures relevant metadata in JSONL format, enhancing traceability during the ingestion process. The logging occurs when a conflict is detected between existing and new files sharing the same note_id, improving error handling and diagnostics.
Update the logging mechanism for ID collisions to include more structured metadata, enhancing the clarity of logged information. This change aims to facilitate easier analysis of conflicts during the ingestion process and improve overall traceability.
Lars merged commit d0012355b9 into main 2026-01-12 10:53:20 +01:00
Lars deleted branch WP24c 2026-01-12 10:53:20 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Lars/mindnet#22
No description provided.