Osnova

io.github.getdomovoi由 GitHub 账号 getdomovoi 发布v0.12.0更新于 Oct 24, 2026

Deterministic code map for AI coding agents: a tree-sitter call graph with exact file:line over MCP.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

Osnova 用 tree-sitter 把代码仓库索引成确定性的符号与调用图,并通过 MCP 提供查询,让助手获得精确到 file:line 的定义、调用方和测试信息。

可以做什么
  • 按关键词检索定义,并按符号分组查找正则或字面文本匹配
  • 列出单个文件的签名与行范围,并给出目录聚类、枢纽与热点
  • 追踪直接或传递的调用方与被调用方,并附上把调用绑定到定义的证据
  • 围绕问题收集任务上下文、某次改动的影响范围,以及引用某符号的测试文件
  • 核对声称的调用点,并列出没有索引到调用方的定义
适用场景
适合助手在仓库中修改或重构代码时使用:需要回答谁调用了某个函数、一次改动会影响什么、哪些测试覆盖某个符号,而不是靠文本搜索猜测。对拥有深度适配器的七种语言(TypeScript、JavaScript、Python、Go、Rust、Java、C#)效果最好。
运行要求
需要 Node.js 22.13 或更高版本;以本地 stdio 进程运行,通常通过 npx 或全局安装启动。可选的 setup 命令会把 MCP 条目、钩子和技能写入 Claude Code、Codex、Cursor、OpenCode、Kilo 或 Pi。无需账号、API 密钥或网络访问;OSNOVA_CACHE_DIR 用于指定缓存目录。
安装前请注意
setup 命令会写入客户端配置文件和钩子;它会先预览改动,只有加 --apply 才写入,并会备份被修改的文件。可选的搜索门禁会在本轮尚未运行 osnova 工具时拒绝 grep、rg、find 或搜索工具调用。结果是启发式的:调用方列表为空并不证明不存在调用方,未解析的调用会作为候选单独列出。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Osnova,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[osnova. A deterministic code map for AI coding agents. Ten tools over MCP and CLI.]

Osnova

[website getosnova.dev] [npm version] [license Apache-2.0] [ci] [node >=22.13] [M8ven Verified]

A deterministic code map for AI coding agents. Osnova indexes a repository into a symbol and call graph with tree-sitter, then serves it to any MCP client or from the command line. Same input, same output, byte for byte. No embeddings, no telemetry, and no network connection unless you type osnova update-check. Twenty languages, seven of them (TypeScript, JavaScript, Python, Go, Rust, Java, C#) with deep adapters.

[The getosnova.dev film in eight scenes, measured on osnova 0.12.0 indexing its own source: the word osnova; 442 files read into 7,896 symbols and 35,343 edges; one function parsed into its tree-sitter tree; eleven of the calls refreshWorkspace makes, woven as threads; an agent asks who calls refreshWorkspace and osnova_warp answers with exact file and line; two fresh builds give identical hashes; the install command.]

Osnova is the Slavic word for base or foundation. That is the job: give an agent solid ground to stand on before it edits code.

[A coding agent asks osnova a question and gets back exact file and line, the resolution basis and an omission count; osnova reads a local cache that is built and refreshed from the repository by tree-sitter parsing.]

Quick start

Node.js 22.13 or newer. Serve a repository to any MCP client:

sh
npx -y @getdomovoi/osnova mcp --workspace /path/to/repo

After npm install -g @getdomovoi/osnova, one command per kind of agent: claude wires Claude Code (MCP entry, session, prompt and stop hooks, and the skill); agents wires every installed harness that reads AGENTS.md (Codex, OpenCode, Kilo, Pi, Cursor), each with its hooks, plugin or extension, plus one shared skill in ~/.agents/skills/. Each previews its changes; --apply writes them, backing up every file it changes.

sh
osnova setup claude --applyosnova setup agents --apply

Or add the MCP entry by hand; replace osnova with npx -y @getdomovoi/osnova when there is no global install.

json
{ "mcpServers": { "osnova": { "command": "osnova", "args": ["mcp"] } } }
[One agent turn in five steps: prompt, footing, edit, settle, review; footing and settle are answered by osnova from the index, the rest are the agent or the developer acting.]

What you get back

[A terminal recording: osnova warp lists the five resolved callers of click Context.invoke, each with its receiver hint; grep finds twelve .invoke( lines; osnova plumb checks those twelve and reports five confirmed, six name-only matches on other invoke methods and one line inside a docstring.]

osnova warp src/api.ts#refreshWorkspace on this repository, cut to twelve lines (test/docs-readme-warp.test.ts fails when the first two no longer reproduce):

text
function src/api.ts#refreshWorkspace: 83 indexed edgesreach: d1 callers 83 in 14 files (3 dirs); d2 +16 in 2 files; unresolved same-name 10; tests 18d1 calls src/cli/cli.ts#ensureIndex:78 [import-binding]d1 calls src/cli/hook.ts#runHook:191,203,225,240 [import-binding]d1 calls src/mcp/server.ts#createOsnovaMcpServer.refresh:297 [import-binding]d1 calls test/verification-fastpath.test.ts#<module>:37,47,48,51,53,57,58,64,68,74,78,85,110,114,132,145,154,166,171,197 [re-export-binding]  via src/index.ts:65 refreshWorkspace -> src/api.ts (export refreshWorkspace)This does not prove absence of callers or that deletion is safe.unresolved evidence (10); not confirmed relationshipscandidates for refreshWorkspace (2, unverified): src/api.ts#refreshWorkspace, test/mcp-watch.test.ts#refreshWorkspaced1 calls refreshWorkspace test/artifact-format9.test.ts:78,85,104,120,140 [binding-blocked]d1 calls refreshWorkspace scripts/perf.mjs:485,486,491 [import-target-unresolved]

Each confirmed line names the caller, its lines and the evidence that tied the call to this definition: an import binding, a same-file definition, a re-export chain with its hop, or an identified receiver. Calls the index could not tie to a definition are listed apart as unresolved evidence, with the same-name candidates it found and the reason it stopped, so a name match is never mistaken for a caller. The reach line gives exact counts, not scores, and when the list outgrows its budget a capped: line and an omitted: footer count what was left out.

How much of the graph is exact

A call site counts as resolved when the index ties it to one definition through evidence it can name; everything else stays unresolved with a reason. These are the shares on the pinned checkouts under benchmarks/corpora/, recorded in benchmarks/results/resolution-coverage-2026-09-21b.json; the last column leaves out calls through packages outside the repository and calls to builtins, which can never resolve locally, and the reference defines every column.

CorpusLanguagesCall sitesResolvedShareExcluding externals
clickall6593290344.0%62.4%
cobraall4374198045.3%88.9%
gsonall23382847336.2%56.7%
humanizerall30517779825.6%51.3%
pyrightall585783007051.3%74.5%
ripgrepall13387612145.7%71.6%
zodall534172163040.5%73.2%

Per-language rows are in the reference. osnova coverage reports the same numbers for your own repository, per language and per reason.

Resolved is not the same as right, so the call edges are also scored against each language's type checker or compiler. Every call site in six pinned checkouts was sent to the checker for the callee's declarations, and each osnova edge was marked true when the definition it names contains that declaration and false when it does not. Measured at 0.12.0:

CorpusCheckerDecided edgesFalseFalse-edge rateIn-repo sites covered
clickpyright 1.1.414288300%90.4%
zodTypeScript 5.9.32159340.02%78.2%
cobrago/types, Go 1.27.1198000%87.5%
ripgreprust-analyzer 1.98.16066290.48%85.8%
humanizerRoslyn 5.9.0736330.04%62.2%
gsonjavac 27813340.05%72.3%

Java and C# overloads share one symbol in the index, so a call edge names the overload it binds only when the written argument count fits exactly one declaration of the type, its partial parts and its declared base classes; when it fits several or none, the edge keeps the method and names no declaration, and the oracle leaves it out of both rates (2526 edges on gson, 602 on humanizer). 0.11.0 named the last overload declared for every call, recorded a call at the first line of its call expression, and lost the rest of a C# file after a primary constructor or a raw string; it measured gson 2045 false edges (24.75%), humanizer 617 (8.25%) and ripgrep 112 (2.06%). Of the 29 left on ripgrep, 11 are functions declared once per #[cfg] branch, 6 are a test module's function named like its parent's, and 5 are calls to a local closure or parameter named like a function elsewhere. A call whose target has one declaration that fits keeps it even when a base type is outside the index, where an unseen base overload could be the one the compiler binds; this limit is kept because withdrawing those edges cost 10 recall points on humanizer for one fewer false edge. Every false edge is classified by cause in benchmarks/results/type-checker-oracle-2026-09-30.json with the method and its limits. The scripts that produce these numbers are in benchmarks/oracle/.

Grep versus the graph

The reason to keep a call graph instead of running a text search is not speed. It is that the first regex a person types is wrong more often than it looks, and nobody notices. Nine call-site sets in six languages were verified line by line; each cell shows sites found (precision / recall), and the method lists what each side got wrong.

CorpusTargetVerified sitesText searchResolved graph
clickContext.invoke depth 21312 (0.92 / 0.85)12 (1.00 / 0.92)
pyrightgetChildNodes depth 2285 (0.80 / 0.14)28 (1.00 / 1.00)
cobraCommand.Root depth 13030 (1.00 / 1.00)30 (1.00 / 1.00)
cobraCommand.PersistentFlags depth 11213 (0.92 / 1.00)12 (1.00 / 1.00)
humanizerConfigurator.GetFormatter depth 11819 (0.74 / 0.78)18 (1.00 / 1.00)
ripgrepSearcher.line_terminator depth 11232 (0.38 / 1.00)12 (1.00 / 1.00)
ripgrepLineTerminator.as_byte depth 12626 (1.00 / 1.00)26 (1.00 / 1.00)
gsonJsonReader.beginObject depth 11029 (0.34 / 1.00)10 (1.00 / 1.00)
gsonTypeToken.getRawType depth 12743 (0.63 / 1.00)27 (1.00 / 1.00)

The graph never returned a site that was not a call of the target. The record is benchmarks/results/grep-vs-graph-2026-09-21.json.

The ten tools

The names play on the foundation image. The CLI uses the same names without the prefix: osnova ground and osnova_ground are the same query.

ToolMeaningDoes
osnova_groundthe ground you stand onKeyword search: ranked definitions with exact file:line
osnova_threadthe thread you follow through the clothText search: regex or literal matches grouped by symbol
osnova_outlinethe outline of one partSignatures and line spans for one file
osnova_warpthe threads that hold the weaveCall graph: callers and callees, direct or transitive
osnova_groundworkthe groundwork under everythingRepository map: directory clusters, hubs and hotspots
osnova_footingthe footing you build onTask context: definitions, relationships and candidate tests around a question
osnova_settlehow the ground settles after a changeChange impact: the symbols a diff touches and their indexed dependents
osnova_plumbthe plumb line dropped straight throughCheck claims: which listed call sites the index confirms, and which dependents were left out
osnova_teststhe cloth pulled to see what holdsTests: the test files that reference a symbol, or the symbols one test file reaches
osnova_unreferencedthreads left loose at the edgeDefinitions with no indexed caller, each with its leads; candidates, never proof

Every MCP response opens with its index generation, says when the index is partial, and counts what its budget left out; the budgets, and which CLI subcommands carry the generation, are in the reference.

Hooks and clients

One global install serves every repository and every client: one entry in each client's global config, nothing per project, nothing written inside your repository. osnova setup claude and osnova setup agents show the diff and write nothing until --apply; agents skips a harness whose config folder is missing, --only codex,pi narrows it, and a skill or plugin file you edited is kept and reported. --uninstall reverses either family the same way, previewing first. The table lists the per-client form, for one piece at a time. What each hook prints, when it stays quiet, and what the trials measured are in the reference.

ClientHow to wireWhat it adds
Claude Codeosnova setup --apply --client claude-code --hooksMCP entry plus session, prompt and stop hooks; --skill adds the skill, --nudge the opt-in grep nudge, --gate the opt-in search gate
Claude Code, as a plugin/plugin marketplace add getdomovoi/osnova then /plugin install osnova@osnovaThe same MCP entry, hooks and skill, run through npx -y @getdomovoi/osnova@<version>, pinned to the plugin's release, with no global install; updates follow the marketplace
Codexosnova setup --apply --client codex --hooksMCP entry plus the same three hooks; trust them in /hooks or Codex skips them silently; --gate adds the search gate; step by step in Osnova with Codex
Cursorosnova setup --apply --client cursor --hooksMCP entry plus the stop hook as a follow-up message; --gate adds the search gate
OpenCodeosnova setup --apply --client opencode --pluginMCP entry plus a plugin that appends starting points to each message; the tool guidance comes from the MCP instructions; --gate adds a gate plugin. OpenCode 2.x does not load either plugin; its plugin API has no message or tool hook
Kiloosnova setup --apply --client kilo --pluginMCP entry plus the same plugin; --gate adds the gate plugin
Piosnova setup --apply --client pi --pluginMCP entry through pi-mcp-adapter plus an extension that does the same; --gate adds a gate extension

The search gate is opt-in: add --gate to osnova setup claude or osnova setup agents, or to the per-client form. It denies a grep, rg, find or search-tool call that reaches code osnova indexes until an osnova tool, or the osnova CLI, has run in the current turn; the deny names the tools to use instead. A search of data, prose or configuration files, of a path outside the repository, or of a command's output after | always runs. Codex and Pi may not report an osnova call to the gate, so there it denies once per turn until it has seen one, then holds as on the other clients. OSNOVA_GATE=off switches it off for a session.

In CI

The action runs osnova settle --base-ref against the pull request base and lists every indexed dependent of the symbols the pull request changed; the report is indexed structural evidence only, so a missing dependent is not proof that nothing depends on the change.

yaml
- uses: actions/checkout@v4  with:    fetch-depth: 0- uses: getdomovoi/[email protected]  with:    depth: "2"

Inputs and the local form are in the reference.

What osnova does not do

  • No type inference and no dynamic dispatch. Edges come from syntax: direct calls, imports, name references, declared heritage (a written superclass or interface name) and framework routes (a registration whose receiver binds to a listed framework import, with the verb and the literal path written at the site), with lexical binding and receiver hints for TypeScript, JavaScript and Python. Resolution is heuristic and says so.
  • No route table. A routes edge is one registration site tied to one handler; prefixes from mounts, blueprints and controllers are recorded on their own edges and never composed into a full path, a computed path records no path, and an inline closure or a wrapped handler records the route with no target. Express, NestJS, Flask and FastAPI are read; gin, axum, Django, Spring, ASP.NET, Rails and file-based routers are not.
  • That boundary has a measured price. Scored against a type checker on two pinned corpora, the calls osnova does not resolve are mostly calls whose receiver type is never written down: 2945 of 6359 missed sites on zod and 164 of 307 on click are a plain name carrying no annotation, and another 1478 on zod are a call result or a property chain. Only 349 missed sites on zod and 10 on click have a type written at the receiver's declaration, and 248 of those 349 are a single library idiom. Resolving every one of them would move recall from 76.9% to 78.2% on zod and from 90.4% to 90.7% on click, so the boundary costs roughly one recall point rather than ten. The full census is in benchmarks/results/receiver-boundary-census-2026-09-21.json.
  • No semantic search. osnova_ground is fielded lexical ranking over definitions. It is fast, deterministic and explainable, and it will not match a paraphrase.
  • No proof of safety. An empty caller list means the index found no caller, not that none exists.
  • No cost claims. Agent trials so far show correctness parity with and without the graph on small tasks. A benchmark that separates the two is in progress.

How it stays honest

  • Every query refreshes the index from the working tree first, uncommitted edits included, and reports its generation.
  • Every clipped output says how much was clipped. Every ranked list says how many candidates it dropped. Partial indexes say so on every response.
  • Every hit carries a file:line span, a source hash and an index generation, so you can check what the agent cites.
  • Every benchmark result in benchmarks/results/ is frozen with its corpus fingerprint, and rejected experiments stay on record next to accepted ones.
  • The cache verifies a SHA-256 over the structural core before parsing it and hash-checks each source text on read. Nothing is written outside it.

CLI

Every tool is a subcommand: osnova build <root>, osnova warp <symbol>, osnova settle --base-ref <ref>, plus coverage, check, doctor, setup and mcp. The full list is in the reference.

Library

import { buildIndex, ask, callersDetailed, renderMapCard } from "@getdomovoi/osnova". The structured APIs return complete results with omission counts; the text budgets apply to CLI and MCP presentation only. Every export is in the reference.

Contributing

Bug reports, language adapters, benchmark corpora and agent trials are all welcome. Read CONTRIBUTING.md for the gates a change must pass: lint, typecheck, tests, build, perf budgets and package smoke.

sh
pnpm installpnpm lint && pnpm typecheck && pnpm test && pnpm build && pnpm perf

Determinism is the core invariant. A change that makes incremental refresh differ from a full rebuild by one byte is a bug.

License

Apache-2.0

Privacy: PRIVACY.md. Security policy and reporting: SECURITY.md.

来源:README.md,提交 dff046f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.12.0最新Oct 2, 2026
  2. v0.11.0Oct 1, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分