Skip to main content

Crate hank

Crate hank 

Source
Expand description

Hank — an in-memory, multi-tenant code-analysis engine.

Hank extracts precise structure from a codebase (AST, symbols, call graph, and — in later phases — control/data dependence and LSP facts), keeps it hot in memory, and serves it per tenant so a whole team can edit concurrently without corrupting each other’s view. It is the third peer in the Bobbin × Hank × Quipu stack; see docs/hank-spec.md for the full design.

This crate is an early Phase-1 skeleton: tree-sitter structural extraction, a config model, a typed fact model, and a CLI. The MCP/HTTP serving layer (mcp feature), CPG/dataflow (cpg), LSP precision (lsp), and Quipu promotion (quipu) land in subsequent phases.

Re-exports§

pub use errors::Error;
pub use errors::Result;

Modules§

action
action — resolve a shell command line to (verb, target, target_class), or ABSTAIN.
audit
audit — what a guard decision RECORDS about its subject (hank #77).
change
What does this CHANGE do? — the change-time half of the git baseline.
cli
The hank command-line interface.
community
Deterministic Louvain community detection over the in-memory graph (FR-9).
config
Hank configuration.
daemon
The resident engine — Phase 3, stage 1 (FR-31, hank #1 / aegis-1qze).
dataflow
Intra-procedural data-dependence — the Rust-native start of the CPG tier.
docref
Doc→code reference extraction — the markdown side of the referential graph (spec §5.10 / FR-33).
errors
Error and result types for Hank.
export
Export the referential structure as RDF Turtle in the bobbin: code ontology.
extract
Fast structural extraction via tree-sitter — the always-on breadth tier.
git
Git baseline access — resolving the base_ref to a commit and diffing commits for promotion.
graph
The in-memory call graph and the blast-radius reachability primitive.
hook
Harness hook adapters — the edit-reactive interface (§5.9/FR-30).
metrics
metrics — the usage spool (aegis-0nng: the measurement layer for the aegis-m9ln policy circuit).
plate
plate — read the agent’s current work item, published by the work-item tracker.
policy
Capability-scoped edit policy — the §5.8 trust boundary, made concrete.
reconcile
Reconcile a structural reachable set with a historical co-change set (FR-11).
rules
Structural (tree-sitter-tier) edit policies — the “rule” plane.
textrules
Text-tier edit policies — language-INDEPENDENT rules over the raw text an edit introduces (aegis-m9ln, consuming aegis-mqnl’s rule catalogue).
types
The typed fact model Hank serves.
verify
Monitor-guided edit verification — a verdict on a proposed buffer.
watch
File-watch, debounce, and tiered re-extraction scheduling (FR-17).