Update qdrant_points.py, graph_utils.py, graph_derive_edges.py, and ingestion_processor.py to version 4.0.0: Implement GOLD-STANDARD identity with strict 4-parameter ID generation, eliminating rule_id and variant from ID calculations. Enhance documentation for clarity and consistency across modules, addressing ID drift and ensuring compatibility in the ingestion workflow.
This commit is contained in:
1 parent
8fd7ef804d
commit
a852975811
4 files changed
+58
-43
No files matched your search
@@ -2,7 +2,7 @@
|
||||
FILE: app/core/database/qdrant_points.py
|
||||
DESCRIPTION: Object-Mapper für Qdrant. Konvertiert JSON-Payloads (Notes, Chunks, Edges)
|
||||
in PointStructs und generiert deterministische UUIDs.
|
||||
VERSION: 1.5.3 (WP-Fix: Centralized Identity Enforcement)
|
||||
VERSION: 4.0.0 (WP-24c: Gold-Standard Identity - 4-Parameter-ID)
|
||||
STATUS: Active
|
||||
DEPENDENCIES: qdrant_client, uuid, os, app.core.graph.graph_utils
|
||||
LAST_ANALYSIS: 2026-01-10
|
||||
@@ -95,8 +95,11 @@ def _normalize_edge_payload(pl: dict) -> dict:
|
||||
def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[rest.PointStruct]]:
|
||||
"""
|
||||
Konvertiert Kanten-Payloads in PointStructs.
|
||||
WP-24c Audit v1.5.3: Nutzt die zentrale _mk_edge_id Funktion aus graph_utils.
|
||||
WP-24c v4.0.0: Nutzt die zentrale _mk_edge_id Funktion aus graph_utils.
|
||||
Dies eliminiert den ID-Drift zwischen manuellen und virtuellen Kanten.
|
||||
|
||||
GOLD-STANDARD v4.0.0: Die ID-Generierung verwendet STRICT nur die 4 Parameter
|
||||
(kind, source_id, target_id, scope). rule_id und variant werden ignoriert.
|
||||
"""
|
||||
_, _, edges_col = _names(prefix)
|
||||
points: List[rest.PointStruct] = []
|
||||
@@ -104,25 +107,23 @@ def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[
|
||||
for raw in edge_payloads:
|
||||
pl = _normalize_edge_payload(raw)
|
||||
|
||||
# Extraktion der Identitäts-Parameter
|
||||
# Extraktion der Identitäts-Parameter (GOLD-STANDARD v4.0.0: nur 4 Parameter)
|
||||
kind = pl.get("kind", "edge")
|
||||
s = pl.get("source_id", "unknown-src")
|
||||
t = pl.get("target_id", "unknown-tgt")
|
||||
scope = pl.get("scope", "note")
|
||||
|
||||
# Optionale Differenzierung (falls von graph_derive_edges gesetzt)
|
||||
rule_id = pl.get("rule_id")
|
||||
variant = pl.get("variant")
|
||||
# Hinweis: rule_id und variant werden im Payload gespeichert,
|
||||
# fließen aber NICHT in die ID-Generierung ein (v4.0.0 Standard)
|
||||
|
||||
try:
|
||||
# Aufruf der Single-Source-of-Truth für IDs
|
||||
# GOLD-STANDARD v4.0.0: Nur 4 Parameter werden verwendet
|
||||
point_id = _mk_edge_id(
|
||||
kind=kind,
|
||||
s=s,
|
||||
t=t,
|
||||
scope=scope,
|
||||
rule_id=rule_id,
|
||||
variant=variant
|
||||
scope=scope
|
||||
)
|
||||
|
||||
# Synchronisierung des Payloads mit der berechneten ID
|
||||
|
||||
Reference in new issue
Block a user