Expand description
grove-core — the structural code-intelligence library behind the grove CLI and MCP server.
This crate hosts the tree-sitter AST engine, the grammar registry, grammar
fetching, and source ingest. It is clap-free: command-line concerns live in
the grove binary crate, which consumes this library via grove_core::.
§Overview
The consumer-facing surface is the ops module — a small set of structural
queries that work for any registered language (grammars load from the
registry as wasm, so nothing is compiled in):
ops::outline— the definitions in one file (its symbol skeleton).ops::symbols— find symbols across a directory, gitignore-aware.ops::source— the full source text of one symbol, by id or name.ops::check— the syntactic defects (ERROR / MISSING) in one file.ops::callers— every reference to a name, with its enclosing function.ops::map— a directory’s definitions and their outgoing references.ops::definition/ops::definition_at— go-to-def by name or use site.
init::provision_project is the grammar-provisioning entry point used by
grove init. The lower-level engine, fetch, and ingest modules are
public for hosts that need deeper access.
§Example
use std::path::Path;
use grove_core::ops;
// Every definition under `src/`, gitignore-aware.
let symbols = ops::symbols(Path::new("src"), None, None, false, false)?;
for s in &symbols {
println!("{} {} — {}:{}", s.kind, s.name, s.file, s.line);
}Re-exports§
pub use engine::Defect;pub use engine::Symbol;pub use ops::CallSite;pub use ops::FileMap;pub use ops::MapEntry;pub use ops::SourceResult;pub use init::provision_project;pub use config::active_mode;pub use config::GroveConfig;pub use config::Mode;pub use config::ModeChoice;pub use registry::LockVerifyEntry;pub use registry::LockVerifyStatus;
Modules§
- config
- Grove project configuration —
.grove/config.json. - doctor
core::doctor— project health diagnostics.- engine
- The structural engine: parse + tag extraction + syntax check, over grammars loaded from the registry as wasm.
- fetch
grove fetch— pull grammars from the hosted registry into the OS cache.- harness
- Harness shape constants and per-mode query functions.
- ingest
grove ingest— build registry artifacts from curated source specs.- init
- Grammar provisioning for
grove init— the clap-free half. - ops
- The operations, as a library — the single engine both faces call.
- proxy
- Shared proxy resolution for grove’s
ureqHTTP clients — used byfetchhere and by thegrove-explore-corecrate’s chat/health clients. Shared proxy configuration for grove’sureq-based HTTP clients. - registry
- The grammar registry — Phase 2 spine.
- render
- Human text rendering for the read-only structural verbs, shared by the CLI
(
cli/src/main.rs) and the explore inner toolset (core::explore::toolset) so both faces emit identical output. See ADR 0003.