Expand description
Code-tree: parse polyglot codebases into KGLite knowledge graphs.
Tree-sitter grammars are compiled into the kglite crate’s extension surface — no optional dependencies.
Entry points:
builder::run_with_options— parse a directory or manifest-rooted project, returnsArc<DirGraph>manifest::read_manifest— extract project metadatarepo::clone_and_build— shallow-clone a GitHub repo and build, returnsArc<DirGraph>
The PyO3 wrapper crate (kglite-py) exposes these as
kglite.code_tree.build etc.
Modules§
- builder
- Builder: orchestrates parse → model → load phases.
- cross_
lang - Cross-language HTTP boundary edges — links client calls to server routes. Cross-language HTTP boundary edges (Phase C.1).
- docs
- Optional docs pass — ingests a repo’s markdown as
:Docnodes and links them to code symbols. Reuses the OKF parser, so it’s gated on theokffeature. Optional docs pass forcode_tree. - manifest
- Project manifest readers — pyproject.toml, Cargo.toml.
- models
- Data models for parsed code entities (ported from parsers/models.py).
- parsers
- Language parsers: one file per language grammar.
- repo
- GitHub shallow-clone helper (ported from repo.py).
- rev
- Build a code graph from a git revision (git-archive → tempdir → build),
without disturbing the working tree. Exposed as
code_tree.build(rev=…). Build a code graph from a git revision without disturbing the working tree.