Tools & Backend Architecture
The CURD internal backend is built symmetrically around completely isolated functional logic domains via distinct “Engines”. These engines surface atomic behaviors uniformly to CLI, REPL, Python/Node bindings, and MCP frontends via a Unified Routing Layer.
This prevents “interface drift”:
- The CLI is not a bypass.
- MCP is not a privileged lane.
- Every tool call flows through the same capability and policy gate.
Backend Architecture
GraphEngine: Builds a memory-mapped internal Directed Graph of Symbol Dependencies using purely semantic AST queries.SearchEngine(New in v0.7.1): Now features BM25 / FTS-backed ranked search as part of the indexed path, returning results in ~10ms even on massive 200k+ file repos.EditEngine: A state-machine managing a “Shadow Workspace”, caching edits virtually, injecting semantic diffs, and committing to disk explicitly per transaction.ShellEngine: Acts as a strictly gated subprocess sandbox. It enforces foreground timeout, workspace-boundcwdvalidation, and background task count limits.
The Tooling Interface
When using CURD via MCP or .curd scripts, agents are exposed to high-fidelity functions natively designed to eliminate blind regex/text-mutation.
In v0.7.1, tools/list provides canonical operation types and structural metadata, nudging the LLM towards these optimized paths natively over standard OS fallbacks.
| Tool Call | Capability Atom | Description |
|---|---|---|
search | lookup | Instant BM25 / FTS-backed Semantic Graph search. Replaces grep and find. |
graph | traverse | Query the Universal Semantic Linker for O(1) blast radius mapping. |
read | read | Read files, functions, or classes directly using exact AST boundaries. Replaces cat and head. |
edit | change.apply | Modify AST symbols directly. Operates within the Shadow Workspace. Requires an active session. Replaces sed and awk. |
shell | exec.command | Execute a shell command safely within the sandbox. Intercepts compiler diagnostics to propagate graph fault states automatically. |
plugin_tool | plugin.manage | Install and manage .curdt native tool extensions. |
plugin_language | plugin.manage | Install and manage .curdl language grammar extensions. |
The Auditing Flow (curd test)
v0.7.1 introduces the curd test command. This performs a Graph and Cohesion Audit. It scans the active workspace and triggers a fast scan of the indexed graph to verify semantic integrity and identify poisoned (failing) nodes before executing further plans.