mirror of
https://github.com/Egonex-AI/Understand-Anything.git
synced 2026-06-22 10:58:03 +08:00
Fixes #140. merge-batch-graphs.py already defaulted missing `direction` to "forward" when building the dedup key, but the value was never written back onto the edge — so the generated knowledge-graph.json shipped without the field and the dashboard validator emitted one auto-correction per edge (153k on the reporter's Go codebase). Mirror the dashboard schema validator at packages/core/src/schema.ts: lowercase the value, map "both"/"mutual" → "bidirectional", fall back to "forward" for missing or invalid values, and persist the result onto the edge before it enters edges_by_key. This also closes a latent dedup leak where "Forward" and "forward" (or "both" and "bidirectional") would have produced separate dedup keys.