fix(compiler): reject direction both on aggregation relationships
Summary
- Reject
direction: "both"on aggregation relationship queries at both validation and JSON Schema level - No product use case exists for bidirectional aggregation (all ontology edges are directional)
- Zero existing tests or known users affected
Relates to #320 (closed)
Problem
direction: "both" in aggregation generates OR join conditions:
JOIN gl_edge e0 ON (u.id = e0.source_id OR u.id = e0.target_id)This defeats ClickHouse index and projection usage entirely. The by_source and by_target projections both require equality on their respective ID columns — OR prevents either from being selected.
Neighbors handles direction: "both" correctly via UNION ALL of two directional arms. Aggregation uses build_joins which produces OR instead. Rather than building UNION ALL lowering for a feature with no product use case, reject it.
What changed
validate.rs: rejectdirection: "both"whenquery_type == aggregationwith a clear error message suggesting separate outgoing/incoming queriesgraph_query.schema.json: conditionalenum: ["outgoing", "incoming"]on relationship direction whenquery_typeisaggregation, so agents hittingorbit/toolssee the restriction before generating queries- 1 new unit test