Working on Mori Itself

Supporting reference for mori-graph.

On this page Overview

Mori’s source is mori/ in the Jiyuu repository. The Rust binary links the C graph engine. The graph UI is written in TypeScript. Run just grammars in mori/ to fetch the pinned Tree-sitter grammars. mori/README.md covers the build, tests, and releases. https://github.com/Unique-Divine/jiyuu

Understand It With Itself

Index the checkout as its own project, excluding the grammars:

cd ~/jiyuu/mori   # your Jiyuu checkout
echo "/internal/cbm/vendored/" >> .cbmignore
echo /mori/.cbmignore >> "$(git rev-parse --git-path info/exclude)"
mori cli --quiet index_repository --repo_path "$PWD"

Then ask the graph: “who calls find_route_handler”, “trace emit_graphql_edge”.

Where GraphQL Support Lives

FileRole
src/discover/language.cFile extensions per language (.graphqls)
internal/cbm/extract_defs.cSchema types, fields, return types, @deprecated
internal/cbm/extract_calls.cOperation text from call arguments and constants
internal/cbm/service_patterns.cClient library names; operation parser and field paths
src/pipeline/pass_route_nodes.cServer Route discovery and C graph adapter
src/pipeline/graphql_ffi.rs, gqlgen.rs, route_writer.rsGraphQL Route planning, resolver selection, and metadata
src/pipeline/pass_parallel.c, pass_calls.cClient GRAPHQL_CALLS edges (large and small repos)
src/pipeline/graphql_link.rsMatch GraphQL operations to indexed providers
src/pipeline/pass_cross_repo.cCross-repo persistence and C graph adapter
src/pipeline/pipeline_incremental.cWhen an edit forces a full rebuild

Build and Test

Run these from the Jiyuu root:

just --justfile mori/justfile grammars
just mori-rs-build                    # target/release/mori
just mori-rs-check-linked             # Rust tests with the C engine linked
just --justfile mori/justfile test-graphql-rust
  • GraphQL client edges in tests need a fixture of more than 50 files to exercise the parallel path, and a smaller one for the sequential path.
  • Test a dev binary against real repos with a separate cache, so the live index and daemon are untouched: CBM_CACHE_DIR=/tmp/mori-dev CBM_RUNTIME_DIR=/tmp/mori-dev-rt target/release/mori cli ...