script_Überprüfung und Kommentarheader
Deploy mindnet to llm-node / deploy (push) Successful in 4s

This commit is contained in:
Lars committed 2025-12-28 10:40:28 +01:00
1 parent 23b1cb2966
commit e9532e8878
30 files changed
+1835 -542

No files matched your search

+57 -12
View File
@@ -1,19 +1,64 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
scripts/edges_full_check.py
Zählt und validiert Kanten in Qdrant. Erkennt folgende Rule-Gruppen:
- explicit_total: rule_id startswith "explicit:" (z.B. explicit:wikilink, explicit:note_scope)
- callout_total: rule_id == "callout:edge"
- inline_total: rule_id startswith "inline:" (z.B. inline:rel)
- defaults_total: rule_id startswith "edge_defaults:"
- structure: rule_id in {"structure:belongs_to","structure:order"}
FILE: scripts/edges_full_check.py
VERSION: 2.1.0 (2025-12-15)
STATUS: Active
COMPATIBILITY: v2.9.1 (Post-WP14/WP-15b)
Gibt zusätzlich:
- edges_by_kind (aggregiert)
- notes/chunks/edges Anzahlen
- multi_callout_detected: True, falls ein Chunk mehrere Callout-Ziele der gleichen Relation enthält
- per_note_checks: belongs_to == chunks, next == prev == (chunks-1)
Zweck:
-------
Umfassende Validierung der Edge-Struktur in Qdrant.
Analysiert Edge-Typen, Rule-Gruppen und strukturelle Integrität.
Funktionsweise:
---------------
1. Lädt alle Edges aus {prefix}_edges
2. Gruppiert Edges nach rule_id:
- explicit: rule_id startswith "explicit:" (wikilink, note_scope)
- callout: rule_id == "callout:edge"
- inline: rule_id startswith "inline:" (rel)
- defaults: rule_id startswith "edge_defaults:"
- structure: rule_id in {"structure:belongs_to", "structure:order"}
3. Prüft strukturelle Integrität:
- belongs_to == chunks pro Note
- next == prev == (chunks-1) pro Note
- Multi-Callout-Erkennung
4. Aggregiert Statistiken
Ergebnis-Interpretation:
------------------------
- Ausgabe: JSON mit umfassender Analyse
* counts: notes/chunks/edges Anzahlen
* edges_by_kind: Aggregierte Edge-Anzahl pro Typ
* rule_groups: Zählung nach Rule-Gruppen
* per_note_checks: Strukturelle Validierung pro Note
* multi_callout_detected: Boolean
- Exit-Code 0: Erfolgreich
Verwendung:
-----------
- Umfassende Graph-Analyse
- Validierung nach größeren Änderungen
- Debugging von Edge-Problemen
Hinweise:
---------
- Kann bei großen Graphen langsam sein
- Prüft strukturelle, nicht semantische Korrektheit
Aufruf:
-------
python3 -m scripts.edges_full_check --prefix mindnet
Parameter:
----------
--prefix TEXT Collection-Präfix (Default: ENV COLLECTION_PREFIX oder mindnet)
Änderungen:
-----------
v2.1.0 (2025-12-15): Dokumentation aktualisiert
v1.0.0: Initial Release
"""
from __future__ import annotations