orihime 1.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orihime-1.9.2/PKG-INFO +399 -0
- orihime-1.9.2/README.md +368 -0
- orihime-1.9.2/orihime/__init__.py +0 -0
- orihime-1.9.2/orihime/__main__.py +363 -0
- orihime-1.9.2/orihime/complexity_pass.py +248 -0
- orihime-1.9.2/orihime/cross_resolver.py +199 -0
- orihime-1.9.2/orihime/indexer.py +1078 -0
- orihime-1.9.2/orihime/io_fanout_pass.py +298 -0
- orihime-1.9.2/orihime/java_extractor.py +1107 -0
- orihime-1.9.2/orihime/js_extractor.py +664 -0
- orihime-1.9.2/orihime/kotlin_extractor.py +771 -0
- orihime-1.9.2/orihime/language.py +78 -0
- orihime-1.9.2/orihime/license_checker.py +244 -0
- orihime-1.9.2/orihime/mcp_server.py +2697 -0
- orihime-1.9.2/orihime/parse_result.py +39 -0
- orihime-1.9.2/orihime/path_utils.py +30 -0
- orihime-1.9.2/orihime/perf_ingest.py +238 -0
- orihime-1.9.2/orihime/resolver.py +657 -0
- orihime-1.9.2/orihime/schema.py +176 -0
- orihime-1.9.2/orihime/security_config.py +277 -0
- orihime-1.9.2/orihime/skills/orihime-call-flow/SKILL.md +171 -0
- orihime-1.9.2/orihime/skills/orihime-change-impact/SKILL.md +187 -0
- orihime-1.9.2/orihime/skills/orihime-code-assist/SKILL.md +228 -0
- orihime-1.9.2/orihime/skills/orihime-design-review/SKILL.md +345 -0
- orihime-1.9.2/orihime/skills/orihime-perf-analysis/SKILL.md +228 -0
- orihime-1.9.2/orihime/skills/orihime-security-audit/SKILL.md +269 -0
- orihime-1.9.2/orihime/skills/orihime-setup/SKILL.md +184 -0
- orihime-1.9.2/orihime/ui_server.py +1841 -0
- orihime-1.9.2/orihime/walker.py +23 -0
- orihime-1.9.2/orihime/write_client.py +46 -0
- orihime-1.9.2/orihime/write_server.py +105 -0
- orihime-1.9.2/orihime.egg-info/PKG-INFO +399 -0
- orihime-1.9.2/orihime.egg-info/SOURCES.txt +37 -0
- orihime-1.9.2/orihime.egg-info/dependency_links.txt +1 -0
- orihime-1.9.2/orihime.egg-info/entry_points.txt +2 -0
- orihime-1.9.2/orihime.egg-info/requires.txt +10 -0
- orihime-1.9.2/orihime.egg-info/top_level.txt +1 -0
- orihime-1.9.2/pyproject.toml +51 -0
- orihime-1.9.2/setup.cfg +4 -0
orihime-1.9.2/PKG-INFO
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: orihime
|
|
3
|
+
Version: 1.9.2
|
|
4
|
+
Summary: Cross-repository code knowledge graph for Java/Kotlin/JS/TS — MCP server, web UI, CLI
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/srinivasan-sundaresan95/orihime
|
|
7
|
+
Project-URL: Repository, https://github.com/srinivasan-sundaresan95/orihime
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/srinivasan-sundaresan95/orihime/issues
|
|
9
|
+
Keywords: mcp,mcp-server,model-context-protocol,code-analysis,call-graph,taint-analysis,sast,java,kotlin,javascript,typescript,kuzudb,tree-sitter,security
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Security
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: kuzu>=0.6
|
|
22
|
+
Requires-Dist: tree-sitter>=0.23
|
|
23
|
+
Requires-Dist: tree-sitter-java>=0.23
|
|
24
|
+
Requires-Dist: tree-sitter-kotlin>=0.3
|
|
25
|
+
Requires-Dist: tree-sitter-javascript>=0.23
|
|
26
|
+
Requires-Dist: tree-sitter-typescript>=0.23
|
|
27
|
+
Requires-Dist: mcp[cli]>=1.0
|
|
28
|
+
Requires-Dist: fastapi>=0.111
|
|
29
|
+
Requires-Dist: uvicorn[standard]>=0.29
|
|
30
|
+
Requires-Dist: httpx>=0.27
|
|
31
|
+
|
|
32
|
+
# Orihime
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/orihime/)
|
|
35
|
+
[](https://opensource.org/licenses/MIT)
|
|
36
|
+
[](https://modelcontextprotocol.io)
|
|
37
|
+
[](https://smithery.ai/server/orihime)
|
|
38
|
+
|
|
39
|
+
A cross-repository code knowledge graph for Java/Kotlin/JavaScript/TypeScript codebases. Orihime indexes your source code into an embedded [KuzuDB](https://kuzudb.com/) graph database using [tree-sitter](https://tree-sitter.github.io/) and exposes the graph through an **MCP server** (for AI assistants), a local web UI, and a CLI.
|
|
40
|
+
|
|
41
|
+
> **Mythology**: Orihime (織姫) is Vega — the weaving princess who weaves the fabric of the cosmos. She weaves connections. The tool that weaves your codebase into a single graph.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## What It Does
|
|
46
|
+
|
|
47
|
+
- **Call graph across repositories** — who calls what, across service boundaries, including REST calls resolved to the endpoint they target
|
|
48
|
+
- **Cross-repo taint analysis** — track user-controlled data from HTTP/Kafka/JMS entry points through the call graph to dangerous sinks (SQL injection, path traversal, XXE, deserialization, SSRF, log injection, …)
|
|
49
|
+
- **Security reports** — OWASP Top 10, CWE, PCI DSS, STIG frameworks; second-order injection detection; custom sources/sinks via YAML
|
|
50
|
+
- **Entry-point reachability filtering** — suppress false positives from dead code; only surface findings reachable from real entry points (HTTP handlers, `@KafkaListener`, `@Scheduled`, `@JmsListener`, `@RabbitListener`)
|
|
51
|
+
- **Complexity hints** — static O(n²) loop detection, N+1 JPA risk, unbounded queries, recursive calls — no profiler needed
|
|
52
|
+
- **Performance correlation** — ingest Gatling/JMeter load test results; correlate with the call graph to find confirmed hotspots and Little's Law capacity ceilings per endpoint
|
|
53
|
+
- **License compliance** — scan Maven/Gradle dependencies against SPDX identifiers; flag GPL/AGPL/LGPL in commercial projects
|
|
54
|
+
- **Incremental re-index** — git blob-hash-based skip; only changed files are re-parsed on subsequent runs
|
|
55
|
+
- **Multi-language** — Java, Kotlin, JavaScript, TypeScript (Next.js, Express, React)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Quick Start — AI-first (Claude Code)
|
|
60
|
+
|
|
61
|
+
The primary way to use Orihime is through an AI assistant via MCP. You index once, then ask questions in natural language — no Cypher, no grep, no reading source files.
|
|
62
|
+
|
|
63
|
+
### 1. Install
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/srinivasan-sundaresan95/orihime.git
|
|
67
|
+
cd orihime
|
|
68
|
+
pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2. Register with Claude Code (one-time setup)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python -m orihime register # writes MCP server entry to ~/.claude/settings.json
|
|
75
|
+
python -m orihime install-skills # copies Claude Code skills to ~/.claude/skills/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Restart Claude Code. The `orihime` MCP tools and skills (`/orihime-call-flow`, `/orihime-security-audit`, `/orihime-perf-analysis`, `/orihime-change-impact`) are now active.
|
|
79
|
+
|
|
80
|
+
### 3. Index your repositories
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
python -m orihime index --repo /path/to/your/service-a --name service-a
|
|
84
|
+
python -m orihime index --repo /path/to/your/service-b --name service-b
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 4. Ask questions
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Trace the call flow for GET /api/orders in service-a
|
|
91
|
+
Find SQL injection risks in service-b
|
|
92
|
+
What breaks if I change OrderService.processPayment?
|
|
93
|
+
Which endpoints are approaching saturation?
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
No source file reads. No grep. Claude uses the graph directly — typically 5–8 tool calls vs 30+ for source-only analysis.
|
|
97
|
+
|
|
98
|
+
> **CLI alternative**: All operations above are also available as Python commands (`python -m orihime index`, `python -m orihime ui`, etc.) if you prefer working outside an AI assistant. See [CLI Reference](#cli-reference) below.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Feature Comparison
|
|
103
|
+
|
|
104
|
+
| Capability | Orihime | GitNexus | SonarQube Community | SonarQube Developer | SonarQube Enterprise |
|
|
105
|
+
|---|---|---|---|---|---|
|
|
106
|
+
| Cross-repo call graph | ✓ | ✓ | ✗ | ✗ | ✗ |
|
|
107
|
+
| REST endpoint resolution | ✓ | ✓ | ✗ | ✗ | ✗ |
|
|
108
|
+
| MCP integration (AI assistants) | ✓ | ✓ | ✓¹ | ✓¹ | ✓¹ |
|
|
109
|
+
| Claude Code hooks + skills | ✓ | ✓ | ✗ | ✗ | ✗ |
|
|
110
|
+
| Cross-file taint (SAST / injection) | ✓ | ✗ | ✗ | ✓ | ✓ |
|
|
111
|
+
| Second-order injection | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
112
|
+
| Entry-point reachability filter | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
113
|
+
| Custom sources/sinks (YAML) | ✓ | ✗ | ✗ | ✗ | ✓² |
|
|
114
|
+
| OWASP/CWE/PCI/STIG compliance reports | ✓ | ✗ | ✗ | ✗ | ✓ |
|
|
115
|
+
| Argument-level taint (value-flow) | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
116
|
+
| Complexity hints (O(n²), N+1) | ✓ | ✗ | partial | partial | partial |
|
|
117
|
+
| I/O fan-out + serial/parallel analysis | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
118
|
+
| Perf ingestion + capacity model | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
119
|
+
| Cross-service cascade risk | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
120
|
+
| License compliance | ✓ | ✗ | ✗ | ✗ | ✓³ |
|
|
121
|
+
| Embedded DB (no server daemon) | ✓ | ✓ | ✗ | ✗ | ✗ |
|
|
122
|
+
| Indexes Java / Kotlin | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
123
|
+
| Indexes JS / TS | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
124
|
+
| License | MIT | PolyForm NC | LGPL | Commercial | Commercial |
|
|
125
|
+
|
|
126
|
+
> ¹ Via the official [sonarqube-mcp-server](https://github.com/SonarSource/sonarqube-mcp-server) (SonarSource, production-ready). Works with all SonarQube editions.
|
|
127
|
+
> ² Custom taint sources/sinks require the Advanced Security add-on (Enterprise+).
|
|
128
|
+
> ³ License compliance (SBOM + policy enforcement) requires the Advanced Security add-on (Enterprise+).
|
|
129
|
+
>
|
|
130
|
+
> **GitNexus** (PolyForm Non-Commercial) provides cross-repo call graphs and MCP integration across 14 languages including Java and Kotlin. It does not cover SAST, perf analysis, or compliance reporting.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## MCP Tools Reference
|
|
135
|
+
|
|
136
|
+
### Call Graph
|
|
137
|
+
|
|
138
|
+
| Tool | Description |
|
|
139
|
+
|---|---|
|
|
140
|
+
| `find_callers(method_fqn)` | All methods that call the given method |
|
|
141
|
+
| `find_callees(method_fqn)` | All methods called by the given method |
|
|
142
|
+
| `blast_radius(method_fqn, max_depth)` | Transitive set of callers up to N hops |
|
|
143
|
+
| `find_endpoint_callers(http_method, path_pattern)` | Trace back from an HTTP endpoint to its callers |
|
|
144
|
+
| `find_implementations(interface_fqn)` | All classes implementing an interface |
|
|
145
|
+
| `find_superclasses(class_fqn, max_depth)` | Inheritance chain |
|
|
146
|
+
| `find_external_calls(repo_name)` | All calls to methods outside the indexed repo |
|
|
147
|
+
|
|
148
|
+
### Discovery
|
|
149
|
+
|
|
150
|
+
| Tool | Description |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `search_symbol(query)` | Full-text search across class/method FQNs |
|
|
153
|
+
| `get_file_location(fqn)` | File path and line number for any class or method |
|
|
154
|
+
| `list_repos()` | All indexed repositories |
|
|
155
|
+
| `list_branches(repo_name)` | All indexed branches for a repo |
|
|
156
|
+
| `list_endpoints(repo_name)` | All HTTP endpoints in a repo |
|
|
157
|
+
| `list_unresolved_calls(repo_name)` | REST calls that couldn't be matched to an endpoint |
|
|
158
|
+
| `find_repo_dependencies(repo_name)` | Cross-service DEPENDS_ON edges |
|
|
159
|
+
|
|
160
|
+
### ORM / JPA
|
|
161
|
+
|
|
162
|
+
| Tool | Description |
|
|
163
|
+
|---|---|
|
|
164
|
+
| `list_entity_relations(repo_name)` | All JPA entity relationships — also used in design review (Phase 1.5) |
|
|
165
|
+
| `find_eager_fetches(repo_name)` | EAGER-fetched collections (N+1 risk) |
|
|
166
|
+
|
|
167
|
+
### Security (SAST)
|
|
168
|
+
|
|
169
|
+
| Tool | Description |
|
|
170
|
+
|---|---|
|
|
171
|
+
| `find_taint_sinks(repo_name)` | All taint sinks reachable in the call graph |
|
|
172
|
+
| `find_taint_flows(repo_name)` | Value-flow taint: argument → parameter across CALLS edges |
|
|
173
|
+
| `find_cross_service_taint(repo_name, max_depth)` | Taint that crosses service boundaries via REST |
|
|
174
|
+
| `find_second_order_injection(repo_name)` | Taint stored to DB then re-read and used as sink |
|
|
175
|
+
| `find_entry_points(repo_name)` | All HTTP/Kafka/Scheduled/JMS/RabbitMQ entry points |
|
|
176
|
+
| `find_reachable_sinks(repo_name, show_all)` | Taint sinks filtered to those reachable from entry points only |
|
|
177
|
+
| `generate_security_report(repo_name, framework)` | Report in OWASP / CWE / PCI / STIG format |
|
|
178
|
+
| `list_security_config()` | Show active sources, sinks, and sanitizers from YAML config |
|
|
179
|
+
|
|
180
|
+
### Complexity & Performance
|
|
181
|
+
|
|
182
|
+
| Tool | Description |
|
|
183
|
+
|---|---|
|
|
184
|
+
| `find_complexity_hints(repo_name, min_severity)` | Methods flagged with O(n²), N+1, unbounded-query, recursive |
|
|
185
|
+
| `ingest_perf_results(repo_name, file_path)` | Load Gatling simulation.log, JMeter XML, or JSON perf data |
|
|
186
|
+
| `find_hotspots(repo_name)` | Complexity hints × p99 latency, sorted by risk score |
|
|
187
|
+
| `estimate_capacity(repo_name)` | Little's Law capacity per endpoint; flags near-saturation |
|
|
188
|
+
| `find_cascade_risk(repo_name)` | Cross-service cascade: upstream endpoints limited by downstream saturation |
|
|
189
|
+
|
|
190
|
+
### License Compliance
|
|
191
|
+
|
|
192
|
+
| Tool | Description |
|
|
193
|
+
|---|---|
|
|
194
|
+
| `find_license_violations(repo_name, allowed, skip_lookup)` | Flag GPL/AGPL/LGPL dependencies via Maven Central |
|
|
195
|
+
|
|
196
|
+
### Index
|
|
197
|
+
|
|
198
|
+
| Tool | Description |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `index_repo_tool(repo_path, repo_name)` | Trigger an index from within the MCP session |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## CLI Reference
|
|
205
|
+
|
|
206
|
+
All operations are also accessible directly without an AI assistant:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
python -m orihime index --repo PATH --name NAME [--db PATH] [--force] [--branch NAME]
|
|
210
|
+
python -m orihime ui [--port 7700] [--db PATH]
|
|
211
|
+
python -m orihime serve
|
|
212
|
+
python -m orihime serve-sse [--port 7702] [--db PATH]
|
|
213
|
+
python -m orihime resolve [--db PATH]
|
|
214
|
+
python -m orihime write-server [--port 7701] [--db PATH]
|
|
215
|
+
python -m orihime register [--db PATH] [--python PATH]
|
|
216
|
+
python -m orihime install-skills
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
| Command | Description |
|
|
220
|
+
|---|---|
|
|
221
|
+
| `index` | Parse a repository and write its graph into KuzuDB |
|
|
222
|
+
| `ui` | Start the local web UI on port 7700 |
|
|
223
|
+
| `serve` | Start the MCP server on stdio (for Claude Code, Claude Desktop, any MCP client) |
|
|
224
|
+
| `serve-sse` | Start the MCP server with SSE transport (for CI runners and remote clients) |
|
|
225
|
+
| `resolve` | Match RestCall URL patterns against Endpoints across all indexed repos |
|
|
226
|
+
| `write-server` | Start the write-serialization server for team/server deployments |
|
|
227
|
+
| `register` | Write the Orihime MCP server entry to `~/.claude/settings.json` |
|
|
228
|
+
| `install-skills` | Copy bundled skills to the target AI assistant's config dir (`--agent claude\|cursor\|codex\|copilot\|all`) |
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Web UI
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
http://localhost:7700
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
| Page | Description |
|
|
239
|
+
|---|---|
|
|
240
|
+
| `/` | Call graph explorer: search methods, trace callers/callees, visualize CALLS graph |
|
|
241
|
+
| `/findings` | Security + complexity findings table — filter by OWASP category, severity, file |
|
|
242
|
+
| `/api/…` | JSON endpoints backing the UI (also usable directly) |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Configuration
|
|
247
|
+
|
|
248
|
+
### Environment Variables
|
|
249
|
+
|
|
250
|
+
| Variable | Default | Description |
|
|
251
|
+
|---|---|---|
|
|
252
|
+
| `ORIHIME_DB_PATH` | `~/.orihime/orihime.db` | Path to KuzuDB database directory |
|
|
253
|
+
| `ORIHIME_SERVER_URL` | _(unset)_ | URL of the write-serialization server (team mode) |
|
|
254
|
+
|
|
255
|
+
### Custom Sources and Sinks
|
|
256
|
+
|
|
257
|
+
Create `~/.orihime/security_config.yaml` (or set `ORIHIME_SECURITY_CONFIG`):
|
|
258
|
+
|
|
259
|
+
```yaml
|
|
260
|
+
sources:
|
|
261
|
+
- method_pattern: ".*getCustomUserInput"
|
|
262
|
+
description: "Custom input source"
|
|
263
|
+
|
|
264
|
+
sinks:
|
|
265
|
+
- method_pattern: ".*legacyExec"
|
|
266
|
+
sink_type: "COMMAND_INJECTION"
|
|
267
|
+
description: "Legacy shell executor"
|
|
268
|
+
|
|
269
|
+
sanitizers:
|
|
270
|
+
- method_pattern: ".*sanitizeForLegacy"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The built-in config covers `HttpServletRequest`, `@RequestParam`, `@PathVariable`, `@RequestBody`, JDBC `execute*`, JPA native queries, `Runtime.exec`, `ProcessBuilder`, XML parsers, `ObjectInputStream`, `Files.get`, `Paths.get`, `new URL`, logging calls, and more.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Documentation
|
|
278
|
+
|
|
279
|
+
| Doc | Description |
|
|
280
|
+
|---|---|
|
|
281
|
+
| [MCP Server](docs/mcp-server.md) | All MCP tools with parameters and examples |
|
|
282
|
+
| [Extractors](docs/extractors.md) | How Java/Kotlin/JS/TS are parsed; ExtractResult schema |
|
|
283
|
+
| [Security Config](docs/security-config.md) | Custom sources, sinks, sanitizers — YAML reference |
|
|
284
|
+
| [CI Integration](docs/ci-integration.md) | GitHub Actions PR review workflow setup |
|
|
285
|
+
| [Docker](docs/docker.md) | Docker Compose setup for server deployments |
|
|
286
|
+
| [Adding a Language](docs/adding-a-language.md) | How to add a new language extractor |
|
|
287
|
+
| [Cross-Repo Resolution](docs/resolver.md) | How REST calls are matched to endpoints across repos |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Team / Server Mode
|
|
292
|
+
|
|
293
|
+
KuzuDB has a single-writer constraint. In team deployments where multiple developers re-index simultaneously, run the write-serialization server:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# On the shared server — owns the KuzuDB connection
|
|
297
|
+
python -m orihime write-server --port 7701 --db /shared/orihime.db
|
|
298
|
+
|
|
299
|
+
# Each developer's indexer sends writes to the server
|
|
300
|
+
ORIHIME_SERVER_URL=http://server:7701 python -m orihime index --repo /path --name my-service
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Developers running locally without `ORIHIME_SERVER_URL` open KuzuDB directly as always. The web UI and MCP server always read directly from KuzuDB (reads do not go through the write server).
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Architecture
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
Source files
|
|
311
|
+
│
|
|
312
|
+
▼ tree-sitter (Java, Kotlin, JS, TS)
|
|
313
|
+
ParseResult (plain Python dicts, picklable)
|
|
314
|
+
│
|
|
315
|
+
▼ ProcessPoolExecutor (parallel parse workers)
|
|
316
|
+
Phase 2: KuzuDB writes (batched by table, 500-edge transactions)
|
|
317
|
+
│
|
|
318
|
+
▼
|
|
319
|
+
KuzuDB embedded graph ←──────────────────────────────┐
|
|
320
|
+
│ │
|
|
321
|
+
├── MCP server (FastMCP, stdio) │
|
|
322
|
+
├── Web UI (Starlette, port 7700) │
|
|
323
|
+
└── Write server (FastAPI, port 7701, team mode) ──┘
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Graph schema** (SCHEMA_VERSION 10):
|
|
327
|
+
|
|
328
|
+
| Node | Key fields |
|
|
329
|
+
|---|---|
|
|
330
|
+
| `Repo` | id, name, root_path |
|
|
331
|
+
| `File` | path, language, blob_hash, branch_name |
|
|
332
|
+
| `Class` | fqn, annotations, is_interface |
|
|
333
|
+
| `Method` | fqn, line_start, annotations, is_entry_point, complexity_hint |
|
|
334
|
+
| `Endpoint` | http_method, path, path_regex |
|
|
335
|
+
| `RestCall` | http_method, url_pattern |
|
|
336
|
+
| `EntityRelation` | source_class, target_class, fetch_type, relation_type |
|
|
337
|
+
| `PerfSample` | endpoint_fqn, p50_ms, p99_ms, rps, source |
|
|
338
|
+
| `CapacityEstimate` | endpoint_fqn, saturation_rps, ceiling_concurrency, risk_level |
|
|
339
|
+
|
|
340
|
+
| Relationship | Description |
|
|
341
|
+
|---|---|
|
|
342
|
+
| `CALLS` | Method → Method; carries callee_name, caller_arg_pos, callee_param_pos |
|
|
343
|
+
| `CALLS_REST` | Method → Endpoint (resolved cross-service call) |
|
|
344
|
+
| `UNRESOLVED_CALL` | Method → RestCall (not yet resolved) |
|
|
345
|
+
| `CONTAINS_CLASS` | File → Class |
|
|
346
|
+
| `CONTAINS_METHOD` | Class → Method |
|
|
347
|
+
| `EXPOSES` | Repo → Endpoint |
|
|
348
|
+
| `DEPENDS_ON` | Repo → Repo (cross-service dependency) |
|
|
349
|
+
| `EXTENDS` | Class → Class |
|
|
350
|
+
| `IMPLEMENTS` | Class → Class |
|
|
351
|
+
| `HAS_RELATION` | Class → EntityRelation |
|
|
352
|
+
| `OBSERVED_AT` | Method → PerfSample |
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Performance
|
|
357
|
+
|
|
358
|
+
### Query performance (graph DB)
|
|
359
|
+
|
|
360
|
+
Benchmarked on an 845-file Java/Kotlin service:
|
|
361
|
+
|
|
362
|
+
| Operation | Time |
|
|
363
|
+
|---|---|
|
|
364
|
+
| Cold index | ~67s |
|
|
365
|
+
| Incremental re-index (no changes) | ~34s |
|
|
366
|
+
| `find_callers` | <5ms |
|
|
367
|
+
| `blast_radius` (depth 3) | <15ms |
|
|
368
|
+
| `find_taint_sinks` (full repo) | <25ms |
|
|
369
|
+
|
|
370
|
+
Batch write speedup vs naive per-row writes: **12×**.
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
### AI assistant benchmark — tracing a single call flow
|
|
375
|
+
|
|
376
|
+
#### Java/Kotlin codebase (845 + 224 files, measured)
|
|
377
|
+
|
|
378
|
+
Benchmarked on a 845-file Kotlin service and a 224-file Java service, tracing one controller endpoint through service → repositories → upstream APIs. GitNexus v1.6.3, Orihime v1.9, and a grep+source-read baseline were all measured on the same codebase on the same hardware (WSL2/Ubuntu, Intel i7, 2026-04-30).
|
|
379
|
+
|
|
380
|
+
| Approach | Cold index | Query latency | Avg tokens/query | Files read |
|
|
381
|
+
|---|---|---|---|---|
|
|
382
|
+
| **Baseline** — Claude reads source files directly | — | ~4–5 min | ~14,000 | 27 |
|
|
383
|
+
| **GitNexus v1.6.3** | 51.4s | 2–10s⁴ | ~1,490 | 0 |
|
|
384
|
+
| **Orihime v1.9** | **66.6s** | **3–22ms** | **~683** | **0** |
|
|
385
|
+
|
|
386
|
+
**Orihime vs baseline: 95% fewer tokens · 200–1,400× faster queries**
|
|
387
|
+
**Orihime vs GitNexus: 2.2× fewer tokens · 200–1,400× faster queries · MCP-native**
|
|
388
|
+
|
|
389
|
+
The 7 Orihime tool calls produced ~80% of the structural picture (full controller→service→repo→upstream chain, 27 test methods surfaced, resilience wiring discovered automatically). The remaining ~20% — upstream API URLs, auth headers, branch-level control flow — requires targeted source reads, scoped to ~5 specific files rather than 27.
|
|
390
|
+
|
|
391
|
+
GitNexus's cold index is ~1.3× faster on NTFS (Node.js parse throughput advantage). On native Linux this gap narrows to near parity.
|
|
392
|
+
|
|
393
|
+
> ⁴ GitNexus query latency is dominated by live GitHub API round trips (1–3 per query × 500–2,000ms each, rate-limit dependent). Blast radius returned results in the wrong direction (upstream imports rather than downstream dependents).
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## License
|
|
398
|
+
|
|
399
|
+
MIT
|