{"spec_id":"universal-node-edge-layer","title":"Spec: Universal Node + Edge Data Layer","summary":"Coherence Network currently stores entity relationships across heterogeneous tables (ideas, tasks, nodes, edges) with no uniform contract — causing 3130 failed-task events and 447,958 wasted minutes from broken contracts at seams between pipeline stages. This spec introduces a **Universal Node + Edge data layer**: a single source of truth for all graph entities and their relationships, with a uniform `payload` column and stable `node_id` / `edge_id` keys. Every pipeline stage reads and writes th","potential_value":0.0,"actual_value":1.0,"estimated_cost":0.0,"actual_cost":1.0,"value_gap":0.0,"cost_gap":1.0,"estimated_roi":0.0,"actual_roi":1.0,"idea_id":"data-infrastructure","process_summary":"`graph_nodes` table: `id UUID PK`, `node_type VARCHAR(64) NOT NULL`, `external_id VARCHAR(256)`, `payload JSONB NOT NULL; `graph_edges` table: `id UUID PK`, `edge_type VARCHAR(64) NOT NULL`, `from_node_id UUID NOT NULL REFERENCES graph_nodes(; Unique index on `(node_type, external_id)` in `graph_nodes` to allow idempotent upserts; Index on `(edge_type, from_node_id)` and `(edge_type, to_node_id)` in `graph_edges` for traversal queries; FastAPI router `GET /api/graph/nodes/{node_id}` returns node + outgoing edges","pseudocode_summary":null,"implementation_summary":"api/app/services/graph_service.py (create_node(), get_node(), create_edge(), get_edges()); api/app/models/graph.py (Node, Edge); api/app/routers/graph.py (graph CRUD endpoints)","created_by_contributor_id":null,"updated_by_contributor_id":null,"created_at":"2026-04-09T03:10:09.062201Z","updated_at":"2026-04-09T03:10:09.062201Z","content_path":"specs/universal-node-edge-layer.md","content_hash":"8f81dab28ffa023a","workspace_id":"coherence-network"}