Language Intelligence Graph
10 sections
Overview
Build a cross-language design-memory system that gives the Ori compiler proactive intelligence from 10 reference compilers. The system integrates a Neo4j graph database (issues, PRs, code structure, ontology) into the Ori Claude ecosystem so that every design decision, bug fix, and review is informed by the collective failure modes and design rationale of Rust, Go, Zig, TypeScript, Gleam, Elm, Roc, Swift, Koka, and Lean 4.
Completed
10 sections
Infrastructure & Canonical Helper
Create the single canonical helper script that all intelligence integrations call. Handles availability check, Neo4j health probe, venv activation, query execution, and structured output. Fix real bugs in query_graph.py before any integration.
Claude Rules & Commands
Create the intelligence rule file (auto-loaded every conversation) and the /query-intel slash command for direct access.
Skill Integration: TPR + Fix-Bug (Tier 1)
Insert intelligence pre-queries into the two highest-value skills: /tpr-review (evidence packets for reviewers) and /fix-bug (investigation phase). Intelligence AUGMENTS existing workflows — it does not replace manual reference repo inspection.
Skill Integration: Remaining Skills (Tier 2+3)
Complete the Claude ecosystem integration by adding intelligence queries to design-pattern-review, create-draft-proposal, continue-roadmap, and review-bugs — following the Tier 1 integration contract established in Section 03.
Code Graph: Parser Adapters
Set up tree-sitter parsing infrastructure for all 11 repos with per-language adapters, query file families, adapter API contract, and validation matrix.
Code Graph: Symbol Extraction
Extract structural symbols (Module, Function, Struct, Trait, Method) and relationships (CALLS, IMPORTS, IMPLEMENTS) from tree-sitter ASTs into a normalized intermediate format.
Code Graph: Neo4j Import Pipeline
Load extracted symbol and relationship records into Neo4j, extending the schema with code graph nodes and creating a unified structural graph connected to the existing issue graph via shared Repo nodes.
Issue-to-Code Bridge
Extract code references from issue/PR/comment bodies and link them to code symbols via CodeReference intermediary nodes with confidence scoring. Seed the ontology with Concept, FailureMode, and CompilerPhase taxonomy nodes.
Ori Live Sync
Keep Ori's code graph in Neo4j continuously updated via a lefthook post-commit hook that triggers a background sync script in lang_intelligence/, using Ori's own built binary for parsing and the existing upsert_file_symbols() API for atomic Neo4j updates.
Sentiment & Issue Signals
Enrich the intelligence graph with per-emoji reaction data and materialized sentiment metrics so that design decisions, bug fixes, and reviews are informed by cross-language user pain, excitement, and controversy signals.