Expand description
radar - the repository cartographer for AI agents.
Compiles a repository into a small set of tiny, committed MAP.md routers
so agents navigate by map instead of grep. Deterministic facts come from
parallel scanning + tree-sitter; semantics are delegated to the host agent
through slot-filling. See ARCHITECTURE.md at the repository root for the
implemented architecture and design contracts.
Modules§
- agentcmd
radar agentstarts the selected coding agent through radar: refresh the maps, verify the navigation contract, exec the agent already pointed at the front door. radar spawns and exits - never a session manager.- browse
radar browse- read-only two-pane TUI over the map tree.- cache
- Disposable, self-healing scan cache under
.radar/. - check
radar check- invariants N1–N6, staleness, budgets, and the static 4× routing-chain cap. One violation per line, stableRULE:prefixes, grep-able.- config
radar.toml- a flat, honest TOML subset:[section]headers,key = "string",key = ["a", "b"],key = 123,key = true,#comments. Every key radar writes is a key radar honors; nesting and exotic TOML are rejected by omission (unknown lines are ignored with the degrade-don’t-block stance - a hand-written full-TOML file still parses for the flat keys we care about).- exit
- Process exit codes are a stable external contract.
- export
radar export --html: the whole knowledge base as one self-contained human-readable page - GitHub-ish embedded CSS (light/dark), stable anchors per scope, resolved cross-links, a static SVG graph of the map topology, client-side filter - no CDN, no framework, no network.- extract
- Symbol extraction: tree-sitter queries → defs (with per-language visibility semantics) and references.
- frontmatter
- Strict frontmatter subset: looks like YAML, is not YAML.
- gitfacts
- Git facts via shell-out: git is an optional ACCELERATOR - every caller has a git-less fallback. No gix, no libgit2; porcelain formats are stable public contracts.
- graph
- File-granularity reference graph and PageRank ranking.
- impact
- Deterministic review-impact analysis over the cached file graph.
- initcmd
radar initinstalls the consumption kit: the MAPs→source navigation contract into AGENTS.md (and CLAUDE.md when present; README.md as the fallback so the contract always lands), plus a repo-scoped Claude and Codex skills, and a radar.toml stub of honored keys only.- jsonrpc
- Minimal synchronous JSON-RPC 2.0 over stdio with LSP-style Content-Length framing. radar is a batch compiler, not an editor: blocking request/response with a hard deadline is all it needs - no async runtime, no framework. The same framing serves the LSP client and the MCP server.
- lang
- Language detection and the tier-1 grammar registry.
- lock
- Concurrency guard: one radar writer per repo.
- lsp
- LSP enrichment at refresh time: spawn a language server
OFFLINE, verify the symbols the maps already carry, upgrade
fidelity:. Never on the agent’s read path; any failure degrades to the syntax tier. - mapfile
- MAP.md model and deterministic emitter.
- mcp
radar serve --mcp- Model Context Protocol over stdio. Uses MCP’s newline-delimited stdio transport with compatibility for the original Content-Length framing. Every tool answers from precomputed state in milliseconds with no daemon state beyond the process.- place
- Shape-driven map placement: maps anchor to knowledge units, not to directory depth. One deterministic post-order pass.
- progress
- Hand-rolled progress spinner: stderr only, TTY-only, auto-disabled when piped / quiet / JSON. No dependencies.
- routes
.radar/ROUTES.md- the solved-navigation cache (memoized routing).- scan
- Parallel repository scan: walk + hash + extract in one pass, with checkpointed caches so interrupted runs resume.
- slots
- Semantic slots: radar computes facts, the host agent fills
the ~25-word semantics.
slotslists pending work with tiny context packets;fillvalidates and stamps. - symbols
.radar/SYMBOLS.md- a committed-format, ctags-style exact-symbol index (research pass: LocAgent’s ablation found keyword→entity lookup the single most impactful navigation tool; sorted text beats bloom filters - zero false positives, offset-readable, greppable under the map-directed contract).- tree
radar tree- bash-tree-style topology view of the maps: bare minimum per node - scope, fidelity, ~tokens, staleness marker.
Constants§
- VERSION
- Crate version as reported by
radar --version.