# sverklo - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 sverklo 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **AI 研究者或研究型 Agent 构建者**：README 明确围绕研究、实验或论文工作流展开。 证据：`README.md` Claim：`clm_0004` supported 0.86
- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0005` supported 0.86
- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md` Claim：`clm_0006` supported 0.86

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md` Claim：`clm_0001` supported 0.86
- **多宿主安装与分发**（需要安装后验证）：项目包含插件或 marketplace 配置，说明它面向一个或多个 AI 宿主的安装和分发。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json` Claim：`clm_0002` supported 0.86
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0003` supported 0.86

## 怎么开始

- `npm install -g sverklo` 证据：`README.md` Claim：`clm_0007` supported 0.86
- `npx husky add .husky/pre-commit "sverklo audit-diff"` 证据：`README.md` Claim：`clm_0008` supported 0.86
- `git clone https://github.com/sverklo/sverklo.git` 证据：`README.md` Claim：`clm_0009` supported 0.86
- `npx sverklo /path/to/your/project` 证据：`README.md` Claim：`clm_0010` supported 0.86
- `/plugin marketplace add github:sverklo/sverklo` 证据：`README.md` Claim：`clm_0011` supported 0.86
- `/plugin install sverklo-skill@sverklo-marketplace` 证据：`README.md` Claim：`clm_0012` supported 0.86

## 继续前判断卡

- **当前建议**：先做权限沙盒试用
- **为什么**：项目存在安装命令、宿主配置或本地写入线索，不建议直接进入主力环境，应先在隔离环境试装。

### 30 秒判断

- **现在怎么做**：先做权限沙盒试用
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：AI 研究者或研究型 Agent 构建者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0004` supported 0.86
- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0005` supported 0.86
- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md` Claim：`clm_0006` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md` Claim：`clm_0001` supported 0.86
- **能力存在：多宿主安装与分发**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0003` supported 0.86

### 现在还不能相信

- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json`, `plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md`
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json`
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json`, `plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`.claude-plugin/marketplace.json`, `README.md`, `plugins/sverklo-skill/.claude-plugin/plugin.json`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0013` inferred 0.45
- **宿主 AI 插件或 Skill 规则冲突**：新规则可能改变用户现有宿主 AI 的工作方式。 处理方式：安装前先检查插件 manifest 和 Skill 文件，必要时隔离测试。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json` Claim：`clm_0014` supported 0.86
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0015` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`, `skill/sverklo-skill/SKILL.md` Claim：`clm_0001` supported 0.86
- **多宿主安装与分发**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`.claude-plugin/marketplace.json`, `plugins/sverklo-skill/.claude-plugin/plugin.json` Claim：`clm_0002` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0003` supported 0.86

### 上下文规模

- 文件总数：423
- 重要文件覆盖：40/423
- 证据索引条目：80
- 角色 / Skill 条目：2

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 sverklo 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 sverklo 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 sverklo 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```


## 角色 / Skill 索引

- 共索引 2 个角色 / Skill / 项目文档条目。

- **Sverklo Code Intelligence**（skill）：Gives you deep codebase understanding — semantic search, blast-radius analysis, PR review, and health audits 激活提示：当用户任务与“Sverklo Code Intelligence”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`
- **Sverklo Code Intelligence**（skill）：Gives you deep codebase understanding — semantic search, blast-radius analysis, PR review, and health audits 激活提示：当用户任务与“Sverklo Code Intelligence”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skill/sverklo-skill/SKILL.md`

## 证据索引

- 共索引 80 条证据。

- **Give your coding agent repo memory.**（documentation）：Give your coding agent repo memory. 证据：`README.md`
- **Sverklo Code Review Action**（documentation）：AI-powered code review with risk scoring, impact analysis, and structural heuristics — posted directly on your pull requests. 证据：`action/README.md`
- **sverklo agents**（documentation）：Drop-in subagent definitions for AI coding clients that support the Claude Code subagent format https://code.claude.com/docs/en/sub-agents markdown with YAML frontmatter . 证据：`agents/README.md`
- **Sverklo Benchmark**（documentation）：This directory contains two harnesses: 证据：`benchmark/README.md`
- **Sverklo Claude Skill**（documentation）：A downloadable Claude Skill .zip that teaches Claude how to use Sverklo's code intelligence tools. 证据：`skill/README.md`
- **Sverklo telemetry endpoint**（documentation）：The Cloudflare Worker that receives opt-in telemetry events from sverklo clients. 证据：`telemetry-endpoint/README.md`
- **Bench ground-truth seed files**（documentation）：Static ground-truth tasks for the sverklo-on-itself dataset. Hand-authored. 证据：`benchmark/src/ground-truth/seed/README.md`
- **Sverklo VS Code Extension**（documentation）：Inline blast-radius decorations from sverklo's symbol graph. The extension reads the function and class headers in your active editor and renders one line per symbol showing how many other places call it — so you see the cost of changing a function before you start typing. 证据：`extensions/vscode/README.md`
- **Marketing Fixtures**（documentation）：Local-only fixtures for the Sverklo Twitter agent team workflow. 证据：`src/marketing/fixtures/README.md`
- **Package**（package_manifest）：{ "name": "sverklo", "mcpName": "io.github.sverklo/sverklo", "version": "0.29.0", "description": "Repo memory for coding agents. Local-first MCP for Claude Code, Cursor, Windsurf, and Codex CLI: symbol graph, blast radius, diff-aware review, and git-pinned decisions. MIT; no API keys or code upload.", "type": "module", "bin": { "sverklo": "dist/bin/sverklo.js" }, "main": "./dist/src/index.js", "files": "dist", "src/skills/ .md", "README.md", "LICENSE", "models.lock.json" , "scripts": { "build": "tsc && node scripts/post-build.mjs", "dev": "tsc --watch", "start": "node dist/bin/sverklo.js", "test": "vitest run", "test:watch": "vitest", "lint": "eslint src/", "lint:assets": "node scripts/lint… 证据：`package.json`
- **Package**（package_manifest）：{ "name": "sverklo-vscode", "displayName": "Sverklo — local-first code intelligence", "description": "Inline blast-radius decorations from sverklo's symbol graph. See callers, untested callers, and risk before you change a function.", "version": "0.1.0", "publisher": "sverklo", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/sverklo/sverklo.git", "directory": "extensions/vscode" }, "engines": { "vscode": "^1.85.0" }, "categories": "Other", "Linters" , "keywords": "sverklo", "code intelligence", "blast radius", "MCP", "claude code", "AI" , "activationEvents": "onLanguage:typescript", "onLanguage:javascript", "onLanguage:python", "onLanguage:go", "onLanguage:rust",… 证据：`extensions/vscode/package.json`
- **Sverklo Code Intelligence Skill**（skill_instruction）：Sverklo is a local-first code intelligence MCP server. It gives you a dependency graph, semantic search, blast-radius analysis, and risk-scored PR review — all running on the user's machine. No API keys, no cloud, no data leaves the laptop. 证据：`plugins/sverklo-skill/skills/sverklo-skill/SKILL.md`
- **Sverklo Code Intelligence Skill**（skill_instruction）：Sverklo is a local-first code intelligence MCP server. It gives you a dependency graph, semantic search, blast-radius analysis, and risk-scored PR review — all running on the user's machine. No API keys, no cloud, no data leaves the laptop. 证据：`skill/sverklo-skill/SKILL.md`
- **Marketplace**（structured_config）：{ "$schema": "https://code.claude.com/schemas/marketplace.json", "name": "sverklo-marketplace", "description": "Plugins for sverklo — the local-first code intelligence MCP server", "owner": { "name": "sverklo" }, "metadata": { "pluginRoot": "./plugins" }, "plugins": { "name": "sverklo-skill", "source": "sverklo-skill", "description": "Claude Skill — teaches Claude when to use sverklo's semantic search, blast-radius, diff review, and persistent memory tools", "version": "1.0.0", "keywords": "code-intelligence", "mcp", "retrieval", "blast-radius", "memory" , "category": "skill" } } 证据：`.claude-plugin/marketplace.json`
- **Plugin**（structured_config）：{ "name": "sverklo-skill", "description": "Teaches Claude how to use sverklo's code intelligence MCP tools — semantic search, blast-radius, PR review, codebase audit, persistent memory", "version": "1.0.0" } 证据：`plugins/sverklo-skill/.claude-plugin/plugin.json`
- **License**（source_file）：Copyright c 2026 codesearch-mcp contributors 证据：`LICENSE`
- **Sverklo Index Format**（documentation）：Status: stable for 0.2.x. Breaking changes will bump the schema version row in the meta table and trigger a full rebuild on load. 证据：`docs/index-format.md`
- **Parser parity baseline — v0.17**（documentation）：Tree-sitter is opt-in via SVERKLO PARSER=tree-sitter plus sverklo grammars install . Before we flip the default in v0.18 we want a reproducible "before" so the flip is a measurable improvement, not a gut feel. This doc captures the baseline + the script that produces it. 证据：`docs/parser-parity.md`
- **Refactor Plan: Reduce Indexer Fan-In Below F Grade**（documentation）：Refactor Plan: Reduce Indexer Fan-In Below F Grade 证据：`docs/refactor-plan-indexer-coupling.md`
- **Modes**（source_file）：export type SverkloMode = "embedded" "shared" "cloud"; ⋮---- export interface ModeResolution { mode: SverkloMode; reason: string; } ⋮---- export function resolveMode argv: string , env: NodeJS.ProcessEnv = process.env : ModeResolution ⋮---- export class SverkloModeError extends Error ⋮---- constructor message: string ⋮---- function isSverkloMode value: string undefined : value is SverkloMode ⋮---- export function notYetImplemented mode: SverkloMode : string 证据：`src/modes.ts`
- **Diff Parser**（source_file）：import { spawnSync } from "node:child process"; import { posix } from "node:path"; import type { DiffEntry, DiffSet, DiffStatus } from "./types.js"; ⋮---- export interface RunGitDiffOptions { baseRef?: string; cwd: string; } ⋮---- export class GitDiffError extends Error ⋮---- constructor message: string, public readonly stderr: string ⋮---- export function parseStatusLine line: string : DiffEntry null ⋮---- export function runGitDiff opts: RunGitDiffOptions : DiffSet ⋮---- export function getFileAtRef cwd: string, ref: string, filePath: string, : string null ⋮---- export function isAnalyzablePath p: string : boolean ⋮---- export function analyzableEntries diffSet: DiffSet : DiffEntry 证据：`src/audit-diff/diff-parser.ts`
- **Embedder**（source_file）：import { readFileSync, existsSync } from "node:fs"; import { join } from "node:path"; import { homedir } from "node:os"; import { log, logError } from "../utils/logger.js"; ⋮---- export async function initEmbedder : Promise ⋮---- async function initEmbedderWithFiles modelPath: string, tokenizerPath: string : Promise ⋮---- function findFile filename: string : string null ⋮---- function tokenize text: string : ⋮---- // Split on whitespace and punctuation BertPreTokenizer behavior ⋮---- // Pad to MAX SEQ LEN ⋮---- function wordPieceTokenize word: string : number ⋮---- function fallbackTokenize text: string : ⋮---- // Hash-based token IDs when no real tokenizer is available ⋮---- // ── ONNX Inf… 证据：`src/indexer/embedder.ts`
- **File Discovery**（source_file）：import { readdirSync, statSync } from "node:fs"; import { join, relative, sep } from "node:path"; import type { Ignore } from "ignore"; import { detectLanguage } from "../types/index.js"; ⋮---- export function toForwardSlashes p: string : string ⋮---- export interface DiscoveredFile { absolutePath: string; relativePath: string; language: string; lastModified: number; sizeBytes: number; } ⋮---- export function discoverFiles rootPath: string, ignoreFilter: Ignore : DiscoveredFile ⋮---- function walk dir: string 证据：`src/indexer/file-discovery.ts`
- **Grammars Install**（source_file）：import { existsSync, mkdirSync, writeFileSync, statSync } from "node:fs"; import { join } from "node:path"; import { homedir } from "node:os"; import { verifyArtifact } from "../utils/integrity.js"; ⋮---- export interface GrammarSpec { lang: string; wasm: string; url: string; } ⋮---- export function grammarsDir : string ⋮---- export interface InstallResult { lang: string; path: string; status: "fresh" "cached" "skipped" "error"; bytes?: number; error?: string; } ⋮---- export async function installGrammars opts: { langs?: string ; force?: boolean; onProgress?: msg: string 证据：`src/indexer/grammars-install.ts`
- **Graph Builder**（source_file）：import { resolve, dirname, join } from "node:path"; import type { ImportRef } from "../types/index.js"; import type { FileStore } from "../storage/file-store.js"; import type { GraphStore } from "../storage/graph-store.js"; import { computePageRank } from "../search/pagerank.js"; import { loadSverkloConfig, getWeight } from "../utils/config-file.js"; import { log } from "../utils/logger.js"; ⋮---- function defaultFileWeight path: string : number ⋮---- export function buildGraph fileImports: Map , fileStore: FileStore, graphStore: GraphStore, rootPath: string : void ⋮---- function resolveImport importPath: string, fromDir: string, pathToId: Map : number undefined ⋮---- // Normalize path sepa… 证据：`src/indexer/graph-builder.ts`
- **Index Code**（source_file）：import type { ChunkStore } from "../storage/chunk-store.js"; import type { SymbolRefStore } from "../storage/symbol-ref-store.js"; import type { DocEdgeStore } from "../storage/doc-edge-store.js"; import { EmbeddingStore } from "../storage/embedding-store.js"; ⋮---- export interface IndexCode { readonly chunkStore: ChunkStore; readonly symbolRefStore: SymbolRefStore; readonly docEdgeStore: DocEdgeStore; readonly embeddingStore: EmbeddingStore; embed texts: string : Promise ; } ⋮---- embed texts: string : Promise ; 证据：`src/indexer/index-code.ts`
- **Index Files**（source_file）：import type { FileStore } from "../storage/file-store.js"; import type { ChunkStore } from "../storage/chunk-store.js"; import type { IndexStatus } from "../types/index.js"; ⋮---- export interface IndexFiles { readonly fileStore: FileStore; readonly chunkStore: ChunkStore; readonly rootPath: string; getStatus : IndexStatus; } ⋮---- getStatus : IndexStatus; 证据：`src/indexer/index-files.ts`
- **Index Graph**（source_file）：import type { FileStore } from "../storage/file-store.js"; import type { GraphStore } from "../storage/graph-store.js"; ⋮---- export interface IndexGraph { readonly fileStore: FileStore; readonly graphStore: GraphStore; } 证据：`src/indexer/index-graph.ts`
- **Index Memory**（source_file）：import type { MemoryStore } from "../storage/memory-store.js"; import type { MemoryEmbeddingStore } from "../storage/memory-embedding-store.js"; import type { ConceptStore } from "../storage/concept-store.js"; import type { HandleStore } from "../storage/handle-store.js"; import type { PatternStore } from "../storage/pattern-store.js"; import type { EvidenceStore } from "../storage/evidence-store.js"; import type { MemoryJournal } from "../memory/journal.js"; ⋮---- export interface IndexMemory { readonly memoryStore: MemoryStore; readonly memoryEmbeddingStore: MemoryEmbeddingStore; readonly memoryJournal: MemoryJournal; readonly conceptStore: ConceptStore; readonly handleStore: HandleStore;… 证据：`src/indexer/index-memory.ts`
- **Parser Tree Sitter**（source_file）：import { existsSync } from "node:fs"; import { join } from "node:path"; import { homedir } from "node:os"; import type { ParseResult, ParsedChunk, ImportRef, ChunkType } from "../types/index.js"; ⋮---- interface ParserCtor { new : ParserInstance; Language: { load path: string : Promise }; } ⋮---- Language: ⋮---- interface ParserInstance { setLanguage lang: unknown : void; parse source: string : { rootNode: Node }; } ⋮---- setLanguage lang: unknown : void; parse source: string : ⋮---- interface Node { startPosition: { row: number }; endPosition: { row: number }; text: string; type: string; children: Node ; childForFieldName name: string : Node null; } ⋮---- childForFieldName name: string : N… 证据：`src/indexer/parser-tree-sitter.ts`
- **Parser**（source_file）：import type { ParsedChunk, ParseResult } from "../types/index.js"; import { parseMarkdown } from "./parser-md.js"; import { parseIpynb } from "./parser-ipynb.js"; import { parseVue } from "./parser-vue.js"; import { fallbackChunk } from "./parsers/ shared.js"; import { parseTSJS } from "./parsers/tsjs.js"; import { parsePython } from "./parsers/python.js"; import { parseGo } from "./parsers/go.js"; import { parseRust } from "./parsers/rust.js"; import { parseJava } from "./parsers/java.js"; import { parseCSharp } from "./parsers/csharp.js"; import { parseCCpp } from "./parsers/ccpp.js"; import { parseRuby } from "./parsers/ruby.js"; import { parsePHP } from "./parsers/php.js"; import { pars… 证据：`src/indexer/parser.ts`
- **Symbol Extractor**（source_file）：export function extractReferences content: string, selfName: string null = null : ⋮---- function stripStringsAndComments line: string : string ⋮---- // Remove string literals double, single, template 证据：`src/indexer/symbol-extractor.ts`
- **Export**（source_file）：import { writeFileSync, mkdirSync } from "node:fs"; import { join, dirname } from "node:path"; import type { IndexMemory } from "../indexer/index-memory.js"; import type { Memory, MemoryCategory } from "../types/index.js"; ⋮---- export interface ExportOptions { format: "markdown" "notion" "json"; to: string; kind?: "episodic" "semantic" "procedural"; includeInvalidated?: boolean; notionDatabase?: string; } ⋮---- export interface ExportReport { format: ExportOptions "format" ; written: string ; rowsExported: number; byCategory: Record ; } ⋮---- export function runMemoryExport indexer: IndexMemory, opts: ExportOptions : ExportReport ⋮---- function writeMarkdown rows: Memory , outDir: string :… 证据：`src/memory/export.ts`
- **Import**（source_file）：import { readFileSync, existsSync } from "node:fs"; import { join } from "node:path"; import { spawnSync } from "node:child process"; import type { IndexMemory } from "../indexer/index-memory.js"; import type { MemoryCategory } from "../types/index.js"; import { embed } from "../indexer/embedder.js"; import { log } from "../utils/logger.js"; import { getGitState } from "./git-state.js"; import { validatePositiveInt } from "../utils/git-validation.js"; ⋮---- interface ExtractedMemory { content: string; category: MemoryCategory; tags: string ; related files: string ; confidence: number; } ⋮---- export async function importExistingMemories indexer: IndexMemory, projectPath: string, options: {… 证据：`src/memory/import.ts`
- **Mine Chats**（source_file）：import { existsSync, readdirSync, readFileSync, statSync } from "node:fs"; import { homedir } from "node:os"; import { join, resolve } from "node:path"; import type { MemoryCategory } from "../types/index.js"; import { log } from "../utils/logger.js"; ⋮---- interface ExtractedMemory { content: string; category: MemoryCategory; tags: string ; related files: string ; confidence: number; } ⋮---- export interface MinedChatsResult { memories: ExtractedMemory ; filesScanned: number; matchedDir: string null; } ⋮---- export function mineClaudeCodeChats projectPath: string : MinedChatsResult ⋮---- function findTranscriptDir projectsRoot: string, absProject: string : string null ⋮---- function encode… 证据：`src/memory/mine-chats.ts`
- **Prune**（source_file）：import type { IndexMemory } from "../indexer/index-memory.js"; import type { Memory } from "../types/index.js"; import { cosineSimilarity } from "../indexer/embedder.js"; import { getGitState } from "./git-state.js"; import { ollamaChat } from "../utils/ollama.js"; ⋮---- export interface PruneOptions { dryRun?: boolean; maxAgeDays?: number; staleScoreThreshold?: number; recencyDecayRate?: number; similarityThreshold?: number; minClusterSize?: number; withOllama?: boolean; ollamaModel?: string; ollamaBaseUrl?: string; } ⋮---- export interface PruneReport { scanned: number; decayed: number; consolidatedClusters: number; consolidatedMembers: number; newSemanticMemoryIds: number ; dryRun: boole… 证据：`src/memory/prune.ts`
- **Hybrid Search**（source_file）：import type { IndexFiles } from "../indexer/index-files.js"; import type { IndexCode } from "../indexer/index-code.js"; import { cosineSimilarity } from "../indexer/embedder.js"; import type { SearchResult, CodeChunk, FileRecord, ChunkType } from "../types/index.js"; import { log } from "../utils/logger.js"; import { entryPointBonus, pathSuffixAlignmentBonus, currentFileDistancePenalty, } from "./boost.js"; import { dedupChunks, groupByDirectory, middleTruncate } from "./compact.js"; ⋮---- interface SearchOptions { query: string; tokenBudget: number; scope?: string; language?: string; type?: ChunkType "any"; currentFile?: string; } ⋮---- function classifyQueryShape query: string : ⋮---- fun… 证据：`src/search/hybrid-search.ts`
- **Audit Analysis**（source_file）：import type { IndexFiles } from "../indexer/index-files.js"; import type { IndexCode } from "../indexer/index-code.js"; import type { IndexGraph } from "../indexer/index-graph.js"; ⋮---- export interface HealthDimension { name: string; grade: string; score: number; detail: string; } ⋮---- export interface HealthScore { grade: string; numericScore: number; dimensions: HealthDimension ; } ⋮---- export interface SecurityIssue { file: string; line: number; pattern: string; severity: "critical" "high" "medium" "low"; snippet: string; } ⋮---- export interface AuditAnalysis { healthScore: HealthScore; securityIssues: SecurityIssue ; circularDeps: string ; } ⋮---- function numericToGrade score: num… 证据：`src/server/audit-analysis.ts`
- **Audit Html**（source_file）：export function generateAuditHtml markdownContent: string, projectName: string, projectPath: string : string ⋮---- function esc s: string : string ⋮---- function gradeColor grade: string : string ⋮---- function inline text: string : string ⋮---- // Known temp/scratch directory prefixes produced by benchmark scripts. These // must not leak into published audit reports. ⋮---- // versioned variants: v12-, v9-, v0.12-, etc. ⋮---- export function cleanProjectName projectName: string, projectPath: string : string ⋮---- // Prefer basename of the absolute path; fall back to the provided name. ⋮---- // Convert "expressjs express" style separators used by benchmark scripts // into "expressjs/express"… 证据：`src/server/audit-html.ts`
- **Audit Obsidian**（source_file）：import type { IndexFiles } from "../indexer/index-files.js"; import type { IndexCode } from "../indexer/index-code.js"; import type { IndexGraph } from "../indexer/index-graph.js"; import { type AuditAnalysis, isVendoredPath } from "./audit-analysis.js"; ⋮---- export function generateAuditObsidian indexer: IndexFiles & IndexCode & IndexGraph, analysis: AuditAnalysis, projectName: string, : string ⋮---- // ─── 2. Health Score ─── ⋮---- // ─── 3. File Dependency Map ─── ⋮---- // ─── 4. God Nodes ─── // Same ranking signal as sverklo audit refs × √distinct-files, // restricted to non-vendored project definitions . Dogfood T2. ⋮---- // ─── 5. Circular Dependencies ─── ⋮---- // ─── 6. Hub Files… 证据：`src/server/audit-obsidian.ts`
- **Mcp Server**（source_file）：import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from "@modelcontextprotocol/sdk/types.js"; import { ALL PROMPTS, findPrompt } from "./prompts.js"; import { HintEngine } from "./hints.js"; import { Indexer } from "../indexer/indexer.js"; import { startWatcher } from "../indexer/watcher.js"; import { getProjectConfig } from "../utils/config.js"; import { log, logError } from "../utils/logger.js"; import { searchTool, handleSearch }… 证据：`src/server/mcp-server.ts`
- **Prompts**（source_file）：export interface PromptArgument { name: string; description: string; required?: boolean; } ⋮---- export interface PromptDefinition { name: string; description: string; arguments: PromptArgument ; build: args: Record = string; } ⋮---- // ── Research recipes v0.14, P1-16 . Leverage investigate + // verify so answers stay grounded in evidence the user can audit. ⋮---- export function findPrompt name: string : PromptDefinition undefined 证据：`src/server/prompts.ts`
- **Tool Overrides**（source_file）：export interface ToolLike { name: string; description: string; inputSchema: unknown; } ⋮---- interface OverrideCache { disabled: Set ; descriptions: Map ; profile: Set null; } ⋮---- function normalizeEnvSuffix name: string : string ⋮---- function canonicalize name: string : string ⋮---- function buildCache : OverrideCache ⋮---- function getCache : OverrideCache ⋮---- export function applyToolOverrides tools: T : T ⋮---- export function resetToolOverrideCache : void ⋮---- export function isToolEnabled name: string : boolean 证据：`src/server/tool-overrides.ts`
- **Context**（source_file）：import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import type { IndexGraph } from "../../indexer/index-graph.js"; import type { IndexMemory } from "../../indexer/index-memory.js"; import { hybridSearch } from "../../search/hybrid-search.js"; import { handleRecall } from "./recall.js"; import { estimateTokens } from "../../utils/tokens.js"; import type { CodeChunk, FileRecord } from "../../types/index.js"; ⋮---- type DetailLevel = "minimal" "normal" "full"; ⋮---- export async function handleContext indexer: IndexFiles & IndexCode & IndexGraph & IndexMemory, args: Record : Promise ⋮---- // ─── 1. Codebase header ─────… 证据：`src/server/tools/context.ts`
- **Critique**（source_file）：import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import type { IndexMemory } from "../../indexer/index-memory.js"; import { verifyEvidence } from "../../memory/evidence.js"; import type { VerifyResult } from "../../types/index.js"; ⋮---- export function handleCritique indexer: IndexFiles & IndexCode & IndexMemory, args: Record : string ⋮---- function isSameFile chunk: { file id: number }, verified: VerifyResult, indexer: IndexFiles & IndexCode & IndexMemory : boolean ⋮---- interface CritiqueData { claim: string null; verify: VerifyResult ; stale: VerifyResult ; moved: VerifyResult ; hubsCited: string ; missedHubs:… 证据：`src/server/tools/critique.ts`
- **Diff Search**（source_file）：import { spawnSync } from "node:child process"; import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import type { IndexGraph } from "../../indexer/index-graph.js"; import { hybridSearch, formatResults } from "../../search/hybrid-search.js"; import type { ChunkType } from "../../types/index.js"; import { resolveBudget } from "../../utils/budget.js"; import { validateGitRef } from "../../utils/git-validation.js"; ⋮---- export async function handleDiffSearch indexer: IndexFiles & IndexCode & IndexGraph, args: Record : Promise ⋮---- // Format with diff-context header 证据：`src/server/tools/diff-search.ts`
- **Find References**（source_file）：import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import type { FileRecord, SearchResult, CodeChunk } from "../../types/index.js"; import { resolveBudget } from "../../utils/budget.js"; import { rerank, rerankerConfigFromEnv } from "../../search/rerank.js"; ⋮---- function buildSymbolMatcher symbol: string, exact: boolean : line: string = boolean ⋮---- export async function handleFindReferences indexer: IndexFiles & IndexCode, args: Record : Promise ⋮---- const exact = args.exact !== false; // default true ⋮---- // Use FTS to find candidate chunks mentioning the symbol at all. // FTS still does substring-ish matching… 证据：`src/server/tools/find-references.ts`
- **Impact**（source_file）：import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import { findWorkspaceForProject, getWorkspaceDbPath } from "../../workspace/workspace-config.js"; import { CrossRepoDb } from "../../workspace/cross-db.js"; import type { InterfaceContract } from "../../workspace/cross-db.js"; import { partitionPlan, formatPlan, DEFAULT PARTITION THRESHOLD, } from "../../search/partition.js"; ⋮---- export function handleImpact indexer: IndexFiles & IndexCode, args: Record : string ⋮---- // Then references ⋮---- function getCrossRepoImpact indexer: IndexFiles & IndexCode, symbol: string : string null ⋮---- function formatCrossImpact… 证据：`src/server/tools/impact.ts`
- **Lookup**（source_file）：import type { IndexCode } from "../../indexer/index-code.js"; import { formatLookup } from "../../search/token-budget.js"; import type { FileRecord, ChunkType, SearchResult, CodeChunk } from "../../types/index.js"; import { resolveBudget } from "../../utils/budget.js"; import { rerank, rerankerConfigFromEnv } from "../../search/rerank.js"; ⋮---- export async function handleLookup indexer: IndexCode, args: Record : Promise 证据：`src/server/tools/lookup.ts`
- **Recall**（source_file）：import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexMemory } from "../../indexer/index-memory.js"; import { checkStaleness } from "../../memory/staleness.js"; import { track } from "../../telemetry/index.js"; import type { Memory, MemoryCategory, MemoryTier, MemoryKind } from "../../types/index.js"; import { validateEnum } from "./ validation.js"; ⋮---- export async function handleRecall indexer: IndexFiles & IndexMemory, args: Record : Promise ⋮---- // Soft-limit warning: too many core memories is an anti-pattern. ⋮---- const fmt = memory: Memory, fromWorkspace: boolean : string = ⋮---- function formatAge timestamp: number : string 证据：`src/server/tools/recall.ts`
- **Rename Aliases.Test**（source_file）：import { describe, it, expect } from "vitest"; import { LEGACY TOOL ALIASES, resolveToolName, } from "../mcp-server.js"; 证据：`src/server/tools/rename-aliases.test.ts`
- **Review Format**（source_file）：import { spawnSync } from "node:child process"; import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import type { IndexGraph } from "../../indexer/index-graph.js"; import { getDiffHunks, runAllHeuristics, type HeuristicFinding, } from "./diff-heuristics.js"; import { handleReviewDiff } from "./review-diff.js"; import { validateGitRef } from "../../utils/git-validation.js"; ⋮---- export type RiskLevel = "critical" "high" "medium" "low"; ⋮---- export interface InlineComment { path: string; line: number; side: "RIGHT" "LEFT"; severity: HeuristicFinding "severity" ; body: string; } ⋮---- export interface ReviewJson { ref:… 证据：`src/server/tools/review-format.ts`
- **Search**（source_file）：import type { Indexer } from "../../indexer/indexer.js"; import { hybridSearchWithConfidence, formatResults } from "../../search/hybrid-search.js"; import type { SearchResult } from "../../types/index.js"; import { bundleResults, formatBundle } from "../../search/bundle.js"; import { emitForHits } from "../../memory/evidence-emit.js"; import type { ChunkType } from "../../types/index.js"; import { resolveBudget } from "../../utils/budget.js"; import { validateEnum, requireString } from "./ validation.js"; ⋮---- export async function handleSearch indexer: Indexer, args: Record : Promise ⋮---- function formatRefsOnly results: SearchResult : string 证据：`src/server/tools/search.ts`
- **Wakeup**（source_file）：import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexMemory } from "../../indexer/index-memory.js"; ⋮---- export function handleWakeup indexer: IndexFiles & IndexMemory, args: Record : string ⋮---- export function generateWakeup indexer: IndexFiles & IndexMemory, options: { maxTokens?: number; format?: "markdown" "plain" } = {} : string 证据：`src/server/tools/wakeup.ts`
- **Memory Embedding Store**（source_file）：import type { Database, Statement } from "./database.js"; ⋮---- function rowToVector buf: Buffer : Float32Array ⋮---- function cosine a: Float32Array, b: Float32Array : number ⋮---- export class MemoryEmbeddingStore ⋮---- constructor private db: Database ⋮---- insert memoryId: number, vector: Float32Array : void ⋮---- get memoryId: number : Float32Array undefined ⋮---- getAll : Map ⋮---- findTopK query: Float32Array, k: number, minScore = 0 : Array ⋮---- delete memoryId: number : void 证据：`src/storage/memory-embedding-store.ts`
- **Memory Store**（source_file）：import type { Database, Statement } from "./database.js"; import { transaction } from "./database.js"; import type { Memory, MemoryCategory, MemoryTier, MemoryKind } from "../types/index.js"; ⋮---- function parsePinsSet pins: string null undefined : Set ⋮---- function defaultKindFor category: MemoryCategory : MemoryKind ⋮---- export class MemoryStore ⋮---- constructor private db: Database ⋮---- setTrajectory id: number, trajectoryJson: string : void ⋮---- getTrajectory id: number : string null ⋮---- insert category: MemoryCategory, content: string, tags: string null, confidence: number, gitSha: string null, gitBranch: string null, relatedFiles: string null, tier: MemoryTier = "archive", kin… 证据：`src/storage/memory-store.ts`
- **Performance Benchmarks**（documentation）：Real measurements on real codebases. Reproducible — the harness is at scripts/perf-benchmark.mjs ./scripts/perf-benchmark.mjs . 证据：`BENCHMARKS.md`
- **Sverklo Brand Spec — v1.0**（documentation）：This is the source of truth for sverklo's visual and verbal identity. It is what we hand to a designer or contributor when something visual is being made logo asset, social card, slide, conference talk, GitHub social preview, dashboard re-skin . Every claim here is informed by two independent brand audits run in 2026-04 one due-diligence, one adversarial-competitor — both converged on the same set of fixes. 证据：`BRAND.md`
- **Changelog**（documentation）：All notable changes to sverklo are documented here. 证据：`CHANGELOG.md`
- **Sverklo Dogfood Protocol**（documentation）：Dogfood session 3 — 2026-04-08 on v0.2.16 证据：`DOGFOOD.md`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`README.md`, `action/README.md`, `agents/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`README.md`, `action/README.md`, `agents/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **Sverklo简介**：importance `high`
  - source_paths: README.md, src/index.ts, CLAUDE.md
- **快速入门指南**：importance `high`
  - source_paths: src/init.ts, src/doctor.ts, src/prove.ts, package.json
- **与其他工具的对比**：importance `medium`
  - source_paths: docs/parser-parity.md
- **系统架构**：importance `high`
  - source_paths: src/indexer/indexer.ts, src/server/mcp-server.ts, src/search/hybrid-search.ts, src/storage/database.ts, src/indexer/embedder.ts
- **检索引擎原理**：importance `high`
  - source_paths: src/search/investigate.ts, src/search/hybrid-search.ts, src/search/boost.ts, src/search/rerank.ts
- **索引器系统**：importance `high`
  - source_paths: src/indexer/parser.ts, src/indexer/parser-tree-sitter.ts, src/indexer/symbol-extractor.ts, src/indexer/graph-builder.ts, src/indexer/embedder.ts
- **MCP工具集**：importance `high`
  - source_paths: src/server/tools/search.ts, src/server/tools/impact.ts, src/server/tools/lookup.ts, src/server/tools/recall.ts, src/server/tools/review-diff.ts
- **双时态记忆系统**：importance `high`
  - source_paths: src/memory/mine-chats.ts, src/memory/import.ts, src/memory/export.ts, src/memory/prune.ts, src/storage/memory-store.ts

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `86f824b2758e8e6c86cd83933663c2b054e5b492`
- inspected_files: `package.json`, `README.md`, `docs/parser-parity.md`, `docs/refactor-plan-indexer-coupling.md`, `docs/index-format.md`, `src/prove.ts`, `src/prove.test.ts`, `src/doctor.ts`, `src/modes.test.ts`, `src/init-hotfix.test.ts`, `src/receipt.ts`, `src/workspace.ts`, `src/init.test.ts`, `src/index.ts`, `src/modes.ts`, `src/init.ts`, `src/digest.ts`, `src/init-global.test.ts`, `src/init-global.ts`, `src/marketing-cli.test.ts`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 需要 API Key 或环境变量

- Trigger: 项目说明中出现 API Key / 环境变量相关需求。
- Host AI rule: 提取必需 env 列表，确认是否有最小无密钥试用路径。
- Why it matters: 用户必须准备账号、额度或密钥；密钥配置错误会导致运行失败或泄漏风险。
- Evidence: packet_text.keyword_scan | github_repo:1203034717 | https://github.com/sverklo/sverklo | matched api key / env var keyword
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：MCP tool names double-prefixed (sverklo_sverklo_*) when server registered under 'sverklo' key

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：MCP tool names double-prefixed (sverklo_sverklo_*) when server registered under 'sverklo' key
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | cevd_7a50e3a046d2438db185ba21d580ec9e | https://github.com/sverklo/sverklo/issues/71 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：Only ~49% of chunks receive embeddings, with no diagnostic explaining skipped chunks

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Only ~49% of chunks receive embeddings, with no diagnostic explaining skipped chunks
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_13e1bc9ab7fa41a0866eb6c4f814875c | https://github.com/sverklo/sverklo/issues/60 | 来源讨论提到 node 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：Semantic search observability: results always report `method: "fts"` and vector contribution is opaque

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Semantic search observability: results always report `method: "fts"` and vector contribution is opaque
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_a8bdc3779b264243b8362d6e57096e25 | https://github.com/sverklo/sverklo/issues/61 | 来源讨论提到 node 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 来源证据：`reindex --force` reports success after EBUSY and appears to reuse stale index on Windows

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：`reindex --force` reports success after EBUSY and appears to reuse stale index on Windows
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_c0c1f6a71a764af596178de506d0b2c3 | https://github.com/sverklo/sverklo/issues/58 | 来源讨论提到 node 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 来源证据：fingerprintOf is defined but never called — provider-change auto-rebuild is unwired

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fingerprintOf is defined but never called — provider-change auto-rebuild is unwired
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | cevd_6be83aacd98c4e3abb6ae6361bf81940 | https://github.com/sverklo/sverklo/issues/69 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 来源证据：sverklo init --global: one-time setup with memory import, skip per-project boilerplate

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：sverklo init --global: one-time setup with memory import, skip per-project boilerplate
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_fc3cc34d92454d5a92ab4a196b178799 | https://github.com/sverklo/sverklo/issues/72 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 来源证据：sverklo reindex does not update registry.json lastIndexed timestamp

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：sverklo reindex does not update registry.json lastIndexed timestamp
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_bf329d5553724c3281773c6aee96cae5 | https://github.com/sverklo/sverklo/issues/74 | 来源讨论提到 node 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：sverklo unregister should accept --by-path for agent-driven worktree teardown

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：sverklo unregister should accept --by-path for agent-driven worktree teardown
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | cevd_42920ecfbbc54f4f8b207e386dfc9ebd | https://github.com/sverklo/sverklo/issues/73 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 可能修改宿主 AI 配置

- Trigger: 项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。
- Host AI rule: 列出会写入的配置文件、目录和卸载/回滚步骤。
- Why it matters: 安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。
- Evidence: capability.host_targets | github_repo:1203034717 | https://github.com/sverklo/sverklo | host_targets=mcp_host, claude, claude_code, cursor
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
