Skip to main content

codingest

CI crates.io PyPI Docs License: MIT

Parse polyglot codebases into queryable kglite knowledge graphs — tree-sitter parsers for 14 languages, call / type / inheritance / route edges, an optional markdown-docs pass, and multi-git-revision merged graphs.

codingest is the standalone home of KGLite's former in-tree code_tree component. The graph engine (storage backends, the Cypher pipeline, .kgl persistence) and the MCP protocol server are imported from kglite as cargo libraries — this repo owns only the code-tree component itself. Four surfaces ship from one workspace: a CLI, an MCP server, a Python wheel, and a Rust crate.

Documentation: codingest.readthedocs.io

Requirements — kglite ≥ 0.14.4

codingest builds against 0.14-only engine APIs (kglite::api::code_entities, kglite_mcp_server::run_with_code_tree_hooks) that KGLite added when it removed its in-tree builder. The 0.14.4 floor also aligns codingest with KGLite's current Postcard-only persistence and MCP fixes. Cargo and pip install this compatible engine automatically.

Install

pip install codingest          # Python wheel (grammars bundled) — ALSO installs the `codingest` CLI
cargo install codingest-cli    # pure-Rust `codingest` builder CLI (no Python)
cargo install codingest-mcp    # the code-graph MCP server

The Python wheel bundles the codingest terminal command (the codingest-cli Rust library is linked into the wheel's extension), so pip install codingest alone gives you both import codingest and codingest build/status — the cargo install codingest-cli route is only needed for a pure-Rust install. This makes the pip-only flow pip install kglite codingest && kglite skill install self-sufficient (the installed code-review skill shells out to codingest build/status).

Quick start

CLI

# Build a code graph from a checkout
codingest build /path/to/repo
# → /path/to/repo/.kglite/code-review.kgl

# Build committed content at specific revisions (multi-rev merged graph)
codingest build /path/to/repo --revs v1.0 v2.0

# Check whether an existing graph is stale relative to the tree
codingest status /path/to/repo

Then query or describe the .kgl with kglite (kglite.load(...), the kglite shell, or any MCP/Bolt client).

MCP server

# Serve a live code-graph workbench over stdio for an MCP client / agent
codingest-mcp --root-dir /path/to/repo

codingest-mcp embeds the kglite-mcp-server tool surface (set_root_dir, graph_overview, cypher_query, read_code_source, …) and injects the codingest builder, so set_root_dir builds a graph. Running plain kglite-mcp-server against a workspace refuses to build — it has no in-tree builder anymore. See the MCP docs.

Python wheel

import codingest

g = codingest.build(".")                 # returns a real kglite.KnowledgeGraph
g.cypher("MATCH (f:Function) RETURN f.name LIMIT 10")
codingest.build(".", save_to="code.kgl") # also persist the .kgl
codingest.build(".", rev="v1.0")         # build a git revision (or revs=[...])
codingest.repo_tree("owner/name")        # clone a GitHub repo and build

The .kgl-bytes handoff. The codingest and kglite wheels are two separate compiled extensions and can't share live Rust objects, so build() constructs the graph with codingest's native builder, serializes it to a .kgl, then calls the installed kglite wheel's load() and returns that object — a genuine kglite.KnowledgeGraph, so every downstream kglite API works.

Bundled CLI. The same wheel also provides the codingest terminal command (a codingest/cli.py console-script shim forwarding into the linked codingest-cli library), so codingest build/status works straight after pip install codingest — identical semantics to cargo install codingest-cli.

Rust crate

[dependencies]
codingest = "0.1"
kglite = "0.14.4"
use codingest::build_code_tree; // = builder::run_with_options
let graph = build_code_tree(dir, /*verbose=*/false, /*include_tests=*/true,
                            /*save_to=*/None, /*max_loc=*/None, /*include_docs=*/false)?;
// Query with kglite's Cypher pipeline, persist with kglite::api::io, …

Workspace layout

Crate What it is
crates/codingest The component library (codingest): builder, parsers, manifest reader, docs pass, multi-rev merge, cross-language edges. Extracted from the former KGLite/crates/kglite/src/code_tree/ (removed upstream 2026-07-16) and re-targeted at the public kglite::api facade. Ships the codingest_stats + codingest_bench binaries.
crates/codingest-cli codingest binary — build a checkout or git revision(s) into a .kgl graph, status to check staleness.
crates/codingest-mcp codingest-mcp binary — the full MCP tool surface imported from the kglite-mcp-server library, with the codingest builder injected.
crates/codingest-py PyO3 wrapper built by maturin into the codingest wheel (pip install codingest). Python package source is codingest/; pyproject.toml drives the maturin build. Not published to crates.io (publish = false).

CI-equivalent local gate: make gate

make gate is the single-entry-point local gate that mirrors CI (cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, workspace build + test incl. the golden oracle) and adds codingest-specific checks (determinism reproducer, codingest_bench parity smoke, the wheel build + the tests/python acceptance suite). Run it before pushing. Individual steps are also targets (make clippy, make determinism, …); make fmt auto-formats.

The golden-digest oracle

KGLite deleted its in-tree code_tree builder on 2026-07-16, so the old two-builder parity sweep is gone. The authority it enforced was frozen while the builders were still verified identical, into per-corpus SHA-256 digests under crates/codingest/tests/goldens/ (committed fixtures — no network). The golden_parity test builds each corpus with only the codingest builder, digests a canonical exhaustive graph rendering, and compares to the frozen golden. The multi-rev fixture is guarded instead by rev_self_consistency. Regenerate goldens only for deliberate builder-behavior changes: cargo test -p codingest --test parity -- --ignored capture_goldens (details in crates/codingest/tests/goldens/README.md).

Dependency policy

kglite and kglite-mcp-server use matching crates.io requirements with a 0.14.4 minimum and a shared lockfile. This keeps the builder, persistence handoff, and embedded MCP server on one compatible engine patch line.

Parity with the (now-removed) in-tree component

codingest was extracted to be feature- and performance-identical to kglite's in-tree code_tree. KGLite removed that module on 2026-07-16, so parity is now enforced against a frozen record of its last-known-good output rather than live cross-comparison. See PARITY.md (stats-diff + timing), BENCHMARKS.md (build-time + Cypher benchmarks), crates/codingest/tests/parity.rs (the golden oracle), and docs/mcp-parity.md (the MCP↔builder coupling and the hook).

tests/python-legacy/ preserves KGLite's full 47-file kglite.code_tree behavioral suite verbatim as the dormant behavioral spec — the source of truth for what the Python builder guaranteed (see its README).

License

MIT © Kristian dF Kollsgård. codingest is an independent project; it depends on kglite at runtime but is not otherwise affiliated with it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codingest-0.1.1.tar.gz (237.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

codingest-0.1.1-cp310-abi3-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

codingest-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

codingest-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

codingest-0.1.1-cp310-abi3-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

codingest-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file codingest-0.1.1.tar.gz.

File metadata

  • Download URL: codingest-0.1.1.tar.gz
  • Upload date:
  • Size: 237.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for codingest-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fb47fdebd8b26de0b8509281056a6d756db4ee216abf0d7a9c65bda18ed02bce
MD5 82b2a1253e0201dadce3738be6dcae3e
BLAKE2b-256 943a4050db5ae4b88ea80de6a096b2860b014f87e3f543ae622af7f37803791a

See more details on using hashes here.

Provenance

The following attestation bundles were made for codingest-0.1.1.tar.gz:

Publisher: release.yml on kkollsga/codingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codingest-0.1.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: codingest-0.1.1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for codingest-0.1.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dc8956b93a81be2f863235c7424aaf489fa74e77ac38e8bc1bff3ccc56ae7ec6
MD5 912996b21c2092f5defa14fd35e4f05b
BLAKE2b-256 28ded94b39dd995fa8fe2f23bbd9abec3f711efe8adf0765f7a7e1680d489f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for codingest-0.1.1-cp310-abi3-win_amd64.whl:

Publisher: release.yml on kkollsga/codingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codingest-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for codingest-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6d3c5224826e7af46c55cd7ec9f83bb97ff1a30560c5fda3e919e67447c70a64
MD5 8d7c38272d9a99027221ff8110bb37bc
BLAKE2b-256 3f15466707434bbdff4d57482aef66fe1b22e7be3bae8d87c31af1e321711981

See more details on using hashes here.

Provenance

The following attestation bundles were made for codingest-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on kkollsga/codingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codingest-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for codingest-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef5ff9fb371c0fa4925da2af0b339d129c857f9ab85b7c1f3ed76b780f5e2580
MD5 9a50563e033266d62f276ea67263cfc0
BLAKE2b-256 80ca71fd251a3df443b35ddf950d5daaa0c0cc17d5a1c1af9a07f3c2de073f9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for codingest-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on kkollsga/codingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codingest-0.1.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codingest-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8e92be3b5bf12b2e3a08a43785ebdf18e2c774dc3f1b5b438b70562c5148cd5
MD5 c36beb66a24be5987de8c2b9417e395c
BLAKE2b-256 9f78627876118dc3929b47ca93750721d1db2182ba1d8dac00faa3a3906b0ec4

See more details on using hashes here.

Provenance

The following attestation bundles were made for codingest-0.1.1-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on kkollsga/codingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codingest-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for codingest-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 25a35db4069f737da05b3888b8828972c5eaa98c02a921cf693e463249908e2f
MD5 4901063a483a35c8aeac162c4b83734b
BLAKE2b-256 6224a91245e317099b2fc41ffeb3724962575f6a15a72a91a50b0eb637a4f344

See more details on using hashes here.

Provenance

The following attestation bundles were made for codingest-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on kkollsga/codingest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page