# codeatlas - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

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

## Claim 消费规则

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

## 它最适合谁

- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `pip install codeatlas` 证据：`README.md` Claim：`clm_0003` supported 0.86, `clm_0004` supported 0.86, `clm_0005` supported 0.86, `clm_0006` supported 0.86
- `pip install codeatlas[mcp]` 证据：`README.md` Claim：`clm_0004` supported 0.86
- `pip install codeatlas[search]` 证据：`README.md` Claim：`clm_0005` supported 0.86
- `pip install codeatlas[all]` 证据：`README.md` Claim：`clm_0006` supported 0.86
- `git clone https://github.com/AryanSaini26/CodeAtlas.git` 证据：`README.md` Claim：`clm_0007` supported 0.86

## 继续前判断卡

- **当前建议**：需要管理员/安全审批
- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：角色质量和任务匹配不能直接相信。
- **继续会触碰**：角色选择偏差、命令执行、本地环境或项目文件

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0003` supported 0.86, `clm_0004` supported 0.86, `clm_0005` supported 0.86, `clm_0006` supported 0.86

### 现在还不能相信

- **角色质量和任务匹配不能直接相信。**（unverified）：角色库证明有很多角色，不证明每个角色都适合你的具体任务，也不证明角色能产生高质量结果。
- **不能把角色文案当成真实执行能力。**（unverified）：安装前只能判断角色描述和任务画像是否匹配，不能证明它能在宿主 AI 里完成任务。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。

### 继续会触碰什么

- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`README.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：先用交互式试用验证任务画像和角色匹配，不要先导入整套角色库。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **保留原始角色选择记录**：如果输出偏题，可以回到任务画像阶段重新选择角色，而不是继续沿着错误角色推进。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

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

## 哪些必须安装后验证

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

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0008` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0009` 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。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

请严格输出四段：
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
请基于 codeatlas 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

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

- **docs/assets**（project_doc）：Screencast GIFs and screenshots referenced from README.md and docs/landing/index.md . SVG placeholders are committed so README images never break; replace them with recorded GIFs before launch. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/assets/README.md`
- **Stratum**（project_doc）：! CI https://github.com/AryanSaini26/CodeAtlas/actions/workflows/ci.yml/badge.svg https://github.com/AryanSaini26/CodeAtlas/actions/workflows/ci.yml ! codecov https://codecov.io/gh/AryanSaini26/CodeAtlas/branch/main/graph/badge.svg https://codecov.io/gh/AryanSaini26/CodeAtlas ! PyPI https://img.shields.io/pypi/v/codeatlas.svg https://pypi.org/project/codeatlas/ ! Python 3.11+ https://img.shields.io/badge/python-3.11… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **CodeAtlas examples**（project_doc）：End-to-end demos you can copy-paste. Each example is self-contained and assumes you have codeatlas on your PATH pip install codeatlas all . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/README.md`
- **CodeAtlas web UI**（project_doc）：React + Vite + Tailwind front-end for the CodeAtlas HTTP API. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`frontend/README.md`
- **CodeAtlas VS Code Extension**（project_doc）：Query your CodeAtlas knowledge graph from the editor. Assumes codeatlas server or codeatlas ui is running and reachable at codeatlas.apiBase default http://127.0.0.1:8080 . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`vscode-extension/README.md`
- **Agent Eval Fixture**（project_doc）：Tiny local fixture used for deterministic mock-agent A/B benchmark artifacts. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/agent-fixture/README.md`
- **Data Pipeline Fixture**（project_doc）：Small dbt/Airflow/SQL fixture used by CodeAtlas data-lineage demos and tests. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/data-pipeline/README.md`
- **demo-monorepo**（project_doc）：A tiny polyglot-style monorepo with a deliberate dependency chain, used to demo CodeAtlas's PR intelligence and impact analysis: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/demo-monorepo/README.md`
- **Example: index Flask and explore the graph**（project_doc）：Example: index Flask and explore the graph 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/flask/README.md`
- **Example: use CodeAtlas as an MCP tool from Claude Code / Cursor**（project_doc）：Example: use CodeAtlas as an MCP tool from Claude Code / Cursor 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/mcp-claude/README.md`
- **Example: index a TypeScript monorepo**（project_doc）：Example: index a TypeScript monorepo 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`examples/ts-monorepo/README.md`
- **Contributing to CodeAtlas**（project_doc）：Thanks for your interest in contributing! Here's how to get started. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **AI Infra Case Study**（project_doc）：CodeAtlas is code-intelligence infrastructure for AI coding agents. It turns a repository into a persistent graph, then serves that graph through a CLI, HTTP API, React UI, and MCP server so agents can retrieve the right context before editing code. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/ai-infra-case-study.md`
- **Architecture**（project_doc）：Each parser wraps a tree-sitter grammar and emits a ParseResult list of Symbol + list of RelationshipEdge . The base LanguageParser handles file I/O, UTF-8 byte offsets, test-file detection, and doc-comment extraction so each language parser can focus on its grammar. ParserRegistry dispatches by file extension. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/architecture.md`
- **Changelog**（project_doc）： 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/changelog.md`
- **CLI reference**（project_doc）：Every CodeAtlas CLI subcommand. Run codeatlas --help for option details. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/cli.md`
- **Demo video script 2–3 min Loom**（project_doc）：A tight, recruiter-friendly walkthrough. Record at 1080p, talk over it, keep it under 3 minutes. The goal: someone who never opens the repo still understands the problem, the product, and the technical depth. Export a 10–15s slice as the README hero GIF. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/demo-script.md`
- **Deploying Stratum Hosted to DigitalOcean**（project_doc）：Deploying Stratum Hosted to DigitalOcean 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/deploy-digitalocean.md`
- **Deploying Stratum Hosted to Fly.io**（project_doc）：This is the runbook for putting the hosted control plane on a real public URL. The repository ships everything needed except the secrets — those are set in Fly's secret store and never committed . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/deploy-fly.md`
- **Deploying Stratum Hosted to Google Cloud Always Free**（project_doc）：Deploying Stratum Hosted to Google Cloud Always Free 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/deploy-gcp.md`
- **Deploying Stratum Hosted to Oracle Cloud Always Free**（project_doc）：Deploying Stratum Hosted to Oracle Cloud Always Free 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/deploy-oracle.md`
- **Getting started**（project_doc）：- Python 3.11+ - A git-managed codebase 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/getting-started.md`
- **Stratum Hosted MVP**（project_doc）：Stratum is the hosted team context gateway powered by the open-source CodeAtlas engine. The current implementation is a local-dev hosted control plane plus a GitHub App sync foundation. It is not full SaaS yet, but it exercises the product path without requiring live GitHub OAuth credentials, Stripe, external cloning, or paid APIs in CI. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/hosted-mvp.md`
- **Stratum / CodeAtlas**（project_doc）：Hosted team context for AI coding agents, powered by real-time CodeAtlas knowledge graphs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/index.md`
- **Supported languages**（project_doc）：CodeAtlas ships 24 tree-sitter parsers out of the box. Run codeatlas languages for the live list. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/languages.md`
- **Launch draft — CodeAtlas 1.0**（project_doc）：This file is an internal draft. Copy sections into HN / Reddit / X / the blog when it's time to ship. The GIFs live under docs/assets/ and need to be recorded before posting. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/launch-post.md`
- **Known limitations**（project_doc）：Stated plainly — these are deliberate tradeoffs, not surprises. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/limitations.md`
- **MCP tools**（project_doc）：CodeAtlas exposes 30 tools over the Model Context Protocol. Agents call them the same way they call filesystem or web-fetch tools. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/mcp-tools.md`
- **Observability**（project_doc）：The HTTP server exposes Prometheus metrics at /metrics no auth — scrape it from inside your network or behind the reverse proxy . Metrics are emitted only when prometheus-client is installed it ships with the api extra ; otherwise /metrics returns 503 and the app runs unaffected. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/observability.md`
- **Release Checklist**（project_doc）：This document outlines the steps to fully ship CodeAtlas after the initial v1.0.0 tag. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/release-checklist.md`
- **Resume Bullets**（project_doc）：Use these as raw material, then tailor numbers to the latest benchmarks/report.md before sending applications. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/resume.md`
- **Stratum Startup Roadmap**（project_doc）：Stratum should not compete as another AI coding assistant. Cursor, GitHub Copilot, Claude Code, Codex, Sourcegraph Amp, and Devin-like products already own that framing. Stratum is stronger as agent infrastructure powered by CodeAtlas: the persistent context, sync, eval, security, and observability layer that makes any coding agent more repo-aware and measurable. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/startup-roadmap.md`
- **Stratum Startup Plan**（project_doc）：Stratum is the hosted product built on the CodeAtlas open-source engine. The business should not be positioned as another coding assistant. The wedge is agent infrastructure: persistent repository context, sync, eval, security, and observability for teams using Claude Code, Codex, Cursor, Copilot, and whatever agent comes next. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/stratum-startup-plan.md`
- **Threat model**（project_doc）：A lightweight threat model for the hosted control plane Stratum . The CLI/MCP engine running locally trusts the operator's machine; the analysis below is about the internet-facing hosted service . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/threat-model.md`
- **Stratum — persistent context infrastructure for AI agents**（project_doc）：Stratum — persistent context infrastructure for AI agents 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/landing/index.md`
- **Changelog**（project_doc）：All notable changes to CodeAtlas are documented in this file. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CHANGELOG.md`
- **Security Policy**（project_doc）：Please report security issues privately via GitHub Security Advisories https://github.com/AryanSaini26/CodeAtlas/security/advisories/new or by email to aryan.26.saini@gmail.com . Do not open a public issue for suspected vulnerabilities. We aim to acknowledge reports within a few days. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`SECURITY.md`
- **CodeAtlas Flagship Proof Report**（project_doc）：This report ties together the recruiter-facing proof assets for CodeAtlas: agent outcome evaluation, retrieval quality, scale/performance, and data-lineage generalization. All numbers below are generated from committed local fixtures or the local CodeAtlas repository so they are reproducible without paid APIs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/flagship-report.md`
- **CodeAtlas Benchmark**（project_doc）：Metric Value -------- ------- Repo . Workers 1 Files 154 Symbols 3,371 Relationships 10,837 LOC 35,052 Elapsed 3.448s Files/sec 44.7 Symbols/sec 977.7 LOC/sec 10,166 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/report.md`
- **Two-stage retrieval: cross-encoder reranking benchmark**（project_doc）：Two-stage retrieval: cross-encoder reranking benchmark 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/rerank-report.md`
- **CodeAtlas Agent Outcome Eval**（project_doc）：Metric Value -------- ------- Mode live Tasks 1 Context mode pagerank Agent adapter mock Safety label mock agent Live variants 2 Solve rate 100.00% Verification pass rate 50.00% Baseline vs context delta 100.00% Avg runtime 0.089s Avg context tokens 212.0 Avg context savings 0.00% Retrieval symbol recall 1.000 Retrieval file recall 1.000 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/agent-live/report.md`
- **CodeAtlas Agent Outcome Eval**（project_doc）：Metric Value -------- ------- Mode dry-run Tasks 6 Context mode pagerank Live variants 0 Solve rate n/a Verification pass rate n/a Baseline vs context delta n/a Avg runtime n/a Avg context tokens 0.0 Avg context savings 0.00% Retrieval symbol recall 0.000 Retrieval file recall 0.000 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/agent/report.md`
- **CodeAtlas Data Lineage**（project_doc）：Nodes - airflow:dag:daily orders airflow dag - airflow:task:build customer ltv airflow task - airflow:task:extract orders airflow task - dbt:exposure:exec dashboard dbt exposure - dbt:model:customer ltv dbt model - dbt:model:orders dbt model - dbt:source:raw customers dbt source - dbt:source:raw orders dbt source - sql:query:models/customer ltv.sql sql query - sql:query:models/orders.sql sql query - sql:table:marts.… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/data-lineage/report.md`
- **CodeAtlas OSS Benchmark Suite**（project_doc）：Metric Value -------- ------- Repos 3 Files 314 Symbols 7,581 Relationships 21,443 LOC 90,546 Total indexing time 1.093s 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/oss/report.md`
- **CodeAtlas Scale And Systems Report**（project_doc）：Metric Value -------- ------- Repos 3 Files 481 Symbols 11,077 Relationships 33,036 LOC 127,697 Wall time 2.281s Files/sec 210.9 Symbols/sec 4,856.2 Relationships/sec 14,483.1 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/perf/report.md`
- **CodeAtlas Eval Report**（project_doc）：Mode Effective Symbol recall@k File recall@k Precision@k nDCG@k Edit loc Density MRR Avg latency Context savings Misses ------ ----------- ----------------- --------------- ------------- -------- ---------- --------- ----- ------------- ----------------- -------- fts fts 1.000 0.000 0.702 0.988 0.000 0.702 0.983 348.31 ms 32.47% 0 bm25 fts 1.000 0.000 0.702 0.988 0.000 0.702 0.983 342.22 ms 32.47% 0 pagerank pageran… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/retrieval-v2/report.md`

## 证据索引

- 共索引 80 条证据。

- **docs/assets**（documentation）：Screencast GIFs and screenshots referenced from README.md and docs/landing/index.md . SVG placeholders are committed so README images never break; replace them with recorded GIFs before launch. 证据：`docs/assets/README.md`
- **Stratum**（documentation）：! CI https://github.com/AryanSaini26/CodeAtlas/actions/workflows/ci.yml/badge.svg https://github.com/AryanSaini26/CodeAtlas/actions/workflows/ci.yml ! codecov https://codecov.io/gh/AryanSaini26/CodeAtlas/branch/main/graph/badge.svg https://codecov.io/gh/AryanSaini26/CodeAtlas ! PyPI https://img.shields.io/pypi/v/codeatlas.svg https://pypi.org/project/codeatlas/ ! Python 3.11+ https://img.shields.io/badge/python-3.11+-blue.svg https://www.python.org/downloads/ ! License: MIT https://img.shields.io/badge/License-MIT-green.svg LICENSE 证据：`README.md`
- **CodeAtlas examples**（documentation）：End-to-end demos you can copy-paste. Each example is self-contained and assumes you have codeatlas on your PATH pip install codeatlas all . 证据：`examples/README.md`
- **CodeAtlas web UI**（documentation）：React + Vite + Tailwind front-end for the CodeAtlas HTTP API. 证据：`frontend/README.md`
- **CodeAtlas VS Code Extension**（documentation）：Query your CodeAtlas knowledge graph from the editor. Assumes codeatlas server or codeatlas ui is running and reachable at codeatlas.apiBase default http://127.0.0.1:8080 . 证据：`vscode-extension/README.md`
- **Agent Eval Fixture**（documentation）：Tiny local fixture used for deterministic mock-agent A/B benchmark artifacts. 证据：`examples/agent-fixture/README.md`
- **Data Pipeline Fixture**（documentation）：Small dbt/Airflow/SQL fixture used by CodeAtlas data-lineage demos and tests. 证据：`examples/data-pipeline/README.md`
- **demo-monorepo**（documentation）：A tiny polyglot-style monorepo with a deliberate dependency chain, used to demo CodeAtlas's PR intelligence and impact analysis: 证据：`examples/demo-monorepo/README.md`
- **Example: index Flask and explore the graph**（documentation）：Example: index Flask and explore the graph 证据：`examples/flask/README.md`
- **Example: use CodeAtlas as an MCP tool from Claude Code / Cursor**（documentation）：Example: use CodeAtlas as an MCP tool from Claude Code / Cursor 证据：`examples/mcp-claude/README.md`
- **Example: index a TypeScript monorepo**（documentation）：Example: index a TypeScript monorepo 证据：`examples/ts-monorepo/README.md`
- **Package**（package_manifest）：{ "name": "codeatlas-web", "version": "1.0.0", "private": true, "type": "module", "description": "Web UI for CodeAtlas — explore your code knowledge graph", "scripts": { "dev": "vite", "build": "tsc -b && vite build", "preview": "vite preview", "lint": "eslint . --ext .ts,.tsx" }, "dependencies": { "@tanstack/react-query": "^5.28.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-force-graph-2d": "^1.25.4", "react-router-dom": "^6.22.0", "zustand": "^4.5.0" }, "devDependencies": { "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "autoprefixer": "^10.4.19", "postcss": "^8.4.38", "tailwindcss": "^3.4.4", "typescript": "^5.4.5", "vite": "^5.3.1" }… 证据：`frontend/package.json`
- **Package**（package_manifest）：{ "name": "codeatlas-vscode", "displayName": "CodeAtlas", "description": "Query your CodeAtlas knowledge graph from VS Code.", "version": "0.1.0", "publisher": "aryansaini26", "repository": { "type": "git", "url": "https://github.com/AryanSaini26/CodeAtlas.git", "directory": "vscode-extension" }, "engines": { "vscode": "^1.85.0" }, "categories": "Other" , "activationEvents": "onStartupFinished" , "main": "./dist/extension.js", "contributes": { "commands": { "command": "codeatlas.openUi", "title": "CodeAtlas: Open Web UI" }, { "command": "codeatlas.searchSymbols", "title": "CodeAtlas: Search Symbols" }, { "command": "codeatlas.showSymbolDetails", "title": "CodeAtlas: Show Symbol at Cursor" }… 证据：`vscode-extension/package.json`
- **Contributing to CodeAtlas**（documentation）：Thanks for your interest in contributing! Here's how to get started. 证据：`CONTRIBUTING.md`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`vscode-extension/LICENSE`
- **AI Infra Case Study**（documentation）：CodeAtlas is code-intelligence infrastructure for AI coding agents. It turns a repository into a persistent graph, then serves that graph through a CLI, HTTP API, React UI, and MCP server so agents can retrieve the right context before editing code. 证据：`docs/ai-infra-case-study.md`
- **Architecture**（documentation）：Each parser wraps a tree-sitter grammar and emits a ParseResult list of Symbol + list of RelationshipEdge . The base LanguageParser handles file I/O, UTF-8 byte offsets, test-file detection, and doc-comment extraction so each language parser can focus on its grammar. ParserRegistry dispatches by file extension. 证据：`docs/architecture.md`
- **Changelog**（documentation）：--8<-- "CHANGELOG.md" 证据：`docs/changelog.md`
- **CLI reference**（documentation）：Every CodeAtlas CLI subcommand. Run codeatlas --help for option details. 证据：`docs/cli.md`
- **Demo video script 2–3 min Loom**（documentation）：A tight, recruiter-friendly walkthrough. Record at 1080p, talk over it, keep it under 3 minutes. The goal: someone who never opens the repo still understands the problem, the product, and the technical depth. Export a 10–15s slice as the README hero GIF. 证据：`docs/demo-script.md`
- **Deploying Stratum Hosted to DigitalOcean**（documentation）：Deploying Stratum Hosted to DigitalOcean 证据：`docs/deploy-digitalocean.md`
- **Deploying Stratum Hosted to Fly.io**（documentation）：This is the runbook for putting the hosted control plane on a real public URL. The repository ships everything needed except the secrets — those are set in Fly's secret store and never committed . 证据：`docs/deploy-fly.md`
- **Deploying Stratum Hosted to Google Cloud Always Free**（documentation）：Deploying Stratum Hosted to Google Cloud Always Free 证据：`docs/deploy-gcp.md`
- **Deploying Stratum Hosted to Oracle Cloud Always Free**（documentation）：Deploying Stratum Hosted to Oracle Cloud Always Free 证据：`docs/deploy-oracle.md`
- **Getting started**（documentation）：- Python 3.11+ - A git-managed codebase 证据：`docs/getting-started.md`
- **Stratum Hosted MVP**（documentation）：Stratum is the hosted team context gateway powered by the open-source CodeAtlas engine. The current implementation is a local-dev hosted control plane plus a GitHub App sync foundation. It is not full SaaS yet, but it exercises the product path without requiring live GitHub OAuth credentials, Stripe, external cloning, or paid APIs in CI. 证据：`docs/hosted-mvp.md`
- **Stratum / CodeAtlas**（documentation）：Hosted team context for AI coding agents, powered by real-time CodeAtlas knowledge graphs. 证据：`docs/index.md`
- **Supported languages**（documentation）：CodeAtlas ships 24 tree-sitter parsers out of the box. Run codeatlas languages for the live list. 证据：`docs/languages.md`
- **Launch draft — CodeAtlas 1.0**（documentation）：This file is an internal draft. Copy sections into HN / Reddit / X / the blog when it's time to ship. The GIFs live under docs/assets/ and need to be recorded before posting. 证据：`docs/launch-post.md`
- **Known limitations**（documentation）：Stated plainly — these are deliberate tradeoffs, not surprises. 证据：`docs/limitations.md`
- **MCP tools**（documentation）：CodeAtlas exposes 30 tools over the Model Context Protocol. Agents call them the same way they call filesystem or web-fetch tools. 证据：`docs/mcp-tools.md`
- **Observability**（documentation）：The HTTP server exposes Prometheus metrics at /metrics no auth — scrape it from inside your network or behind the reverse proxy . Metrics are emitted only when prometheus-client is installed it ships with the api extra ; otherwise /metrics returns 503 and the app runs unaffected. 证据：`docs/observability.md`
- **Release Checklist**（documentation）：This document outlines the steps to fully ship CodeAtlas after the initial v1.0.0 tag. 证据：`docs/release-checklist.md`
- **Resume Bullets**（documentation）：Use these as raw material, then tailor numbers to the latest benchmarks/report.md before sending applications. 证据：`docs/resume.md`
- **Stratum Startup Roadmap**（documentation）：Stratum should not compete as another AI coding assistant. Cursor, GitHub Copilot, Claude Code, Codex, Sourcegraph Amp, and Devin-like products already own that framing. Stratum is stronger as agent infrastructure powered by CodeAtlas: the persistent context, sync, eval, security, and observability layer that makes any coding agent more repo-aware and measurable. 证据：`docs/startup-roadmap.md`
- **Stratum Startup Plan**（documentation）：Stratum is the hosted product built on the CodeAtlas open-source engine. The business should not be positioned as another coding assistant. The wedge is agent infrastructure: persistent repository context, sync, eval, security, and observability for teams using Claude Code, Codex, Cursor, Copilot, and whatever agent comes next. 证据：`docs/stratum-startup-plan.md`
- **Threat model**（documentation）：A lightweight threat model for the hosted control plane Stratum . The CLI/MCP engine running locally trusts the operator's machine; the analysis below is about the internet-facing hosted service . 证据：`docs/threat-model.md`
- **Stratum — persistent context infrastructure for AI agents**（documentation）：Stratum — persistent context infrastructure for AI agents 证据：`docs/landing/index.md`
- **Index**（source_file）：CodeAtlas 证据：`frontend/index.html`
- **Graphpage**（source_file）：import { useEffect, useMemo, useRef, useState } from "react"; import { useQuery } from "@tanstack/react-query"; import ForceGraph2D from "react-force-graph-2d"; import { useNavigate } from "react-router-dom"; import { api, type GraphNode } from "../api"; import { KIND COLOR, Skeleton } from "../components/ui"; import { Icon } from "../components/Icon"; type VizNode = GraphNode & { val?: number; x?: number; y?: number }; type VizLink = { source: string VizNode; target: string VizNode; kind: string; confidence?: string }; type FGMethods = { zoomToFit: ms?: number, padding?: number = void; centerAt: x?: number, y?: number, ms?: number = void; zoom: k?: number, ms?: number = void; }; function n… 证据：`frontend/src/pages/GraphPage.tsx`
- **Overview**（source_file）：import { useEffect, useState } from "react"; import { useQuery } from "@tanstack/react-query"; import { Link } from "react-router-dom"; import { api } from "../api"; import { Card, CardBody, CardHeader, EmptyState, FilePath, KindBadge, KindDot, PulseDot, Skeleton, StatTile, } from "../components/ui"; import { Icon } from "../components/Icon"; import { useLiveStats } from "../hooks/useLiveStats"; import { useRecentSymbols } from "../hooks/useRecentSymbols"; 证据：`frontend/src/pages/Overview.tsx`
- **Searchpage**（source_file）：import { useEffect, useState } from "react"; import { useQuery } from "@tanstack/react-query"; import { Link } from "react-router-dom"; import { api, type SearchHit } from "../api"; import { Badge, EmptyState, FilePath, KindBadge, KindDot, Skeleton, } from "../components/ui"; import { Icon } from "../components/Icon"; ⋮---- function useDebounce value: T, ms: number : T ⋮---- href={ vscode://file/${d.file}:${d.start line} } ⋮---- onClick= 证据：`frontend/src/pages/SearchPage.tsx`
- **App**（source_file）：def route prefix path: str - str ⋮---- store = GraphStore Path db path hosted store = None sync worker = None ⋮---- hosted store = HostedStore Path hosted db path sync worker = SyncJobWorker Path hosted db path ⋮---- @asynccontextmanager async def lifespan : FastAPI - AsyncIterator None app = FastAPI ⋮---- eval report path = Path db path .parent / "eval" / "report.json" ⋮---- @app.middleware "http" async def metrics middleware request: Request, call next: Any - Response ⋮---- start = time.monotonic response: Response = await call next request ⋮---- @app.get "/health" def health - dict str, str ⋮---- @app.get "/metrics", include in schema=False def metrics - Response ⋮---- exposition = obser… 证据：`src/codeatlas/api/app.py`
- **Hosted Routes**（source_file）：class BootstrapRequest BaseModel ⋮---- email: str = "dev@codeatlas.local" name: str = "CodeAtlas Dev" team slug: str = "default" team name: str = "Default Team" class TeamCreateRequest BaseModel ⋮---- slug: str = Field min length=1 name: str = Field min length=1 class RepoCreateRequest BaseModel ⋮---- local path: str = Field min length=1 provider: str = "local" provider repo: str None = None provider repo id: str None = None provider installation id: str None = None default branch: str None = None clone url: str None = None class TokenCreateRequest BaseModel ⋮---- name: str = "repo token" scopes: list str = Field default factory=lambda: "context:read", "repo:sync" class GitHubInstallationRe… 证据：`src/codeatlas/api/hosted_routes.py`
- **Routes**（source_file）：MAX LIMIT = 500 def clamp limit limit: int, field: str = "limit" - int def check auth api key: str None, header value: str None - None ⋮---- async def auth dep x api key: str None = Header default=None - None dependencies = Depends auth dep if api key is not None else router = APIRouter dependencies=dependencies ⋮---- @router.get "/stats", response model=schemas.StatsResponse async def get stats : None = None - schemas.StatsResponse ⋮---- base = store.get stats ⋮---- opts = ExportOptions data = json.loads export json store, opts nodes = data "nodes" links = data "links" truncated = False ⋮---- kept ids = {n "id" for n in nodes :limit } nodes = nodes :limit links = lk for lk in links if lk "… 证据：`src/codeatlas/api/routes.py`
- **Schemas**（source_file）：class GraphNode BaseModel ⋮---- id: str name: str qualified name: str kind: str file: str community id: str None = None class GraphLink BaseModel ⋮---- source: str target: str ⋮---- confidence: str = "extracted" class GraphResponse BaseModel ⋮---- nodes: list GraphNode links: list GraphLink truncated: bool = False class StatsResponse BaseModel ⋮---- files: int symbols: int relationships: int languages: dict str, int kinds: dict str, int class SymbolRef BaseModel ⋮---- line: int None = None class SymbolDetails BaseModel ⋮---- start line: int end line: int signature: str None = None docstring: str None = None incoming: list SymbolRef = Field default factory=list outgoing: list SymbolRef = Fie… 证据：`src/codeatlas/api/schemas.py`
- **Github App**（source_file）：class GitHubAppConfig BaseModel ⋮---- app id: str None = None client id: str None = None client secret: str None = None webhook secret: str None = None private key: str None = None private key path: str None = None public url: str None = None installation token: str None = None api base: str = "https://api.github.com" oauth base: str = "https://github.com" repos fixture path: str None = None ⋮---- @property def configured self - bool ⋮---- @property def oauth configured self - bool ⋮---- @property def webhook configured self - bool class GitHubWebhookResult BaseModel ⋮---- event: str delivery id: str None = None status: str message: str repo id: str None = None provider repo id: str None =… 证据：`src/codeatlas/github_app.py`
- **sync events.status stays "success"/"error" the run outcome ; the repo**（source_file）：TokenSubject = Literal "team", "repo" SyncStatus = Literal "never", "pending", "cloning", "indexing", "ready", "failed" IN PROGRESS SYNC STATUSES = frozenset {"pending", "cloning", "indexing"} SCRYPT N = 2 14 SCRYPT R = 8 SCRYPT P = 1 SCRYPT DKLEN = 32 SCRYPT MAXMEM = 64 1024 1024 def now ms - int def hash token token: str, , salt: bytes None = None - str ⋮---- salt = salt if salt is not None else secrets.token bytes 16 derived = hashlib.scrypt ⋮---- def verify token hash token: str, encoded: str - bool ⋮---- parts = encoded.split "$" ⋮---- salt = base64.b64decode parts 4 expected = base64.b64decode parts 5 ⋮---- def row to dict row: sqlite3.Row - dict str, Any def commit sha repo path: Pat… 证据：`src/codeatlas/hosted.py`
- **Hosted Eval**（source_file）：def estimate tokens text: str - int ⋮---- store = GraphStore Path graph db path ⋮---- pack = build context pack store, query, budget tokens=budget, limit=limit, mode="pagerank" ⋮---- with tokens = int pack "estimated tokens" files = sorted root = Path repo root without tokens = 0 counted: list str = ⋮---- path = root / rel ⋮---- without tokens = max without tokens, with tokens savings = 0.0 if without tokens == 0 else 1.0 - with tokens / without tokens ⋮---- EVAL MODES: tuple EvalMode, ... = "fts", "bm25", "pagerank" SAMPLE KINDS = "function", "method", "class" def build self retrieval suite store: GraphStore, , limit: int = 15 - list dict str, Any ⋮---- seen: set str = set tasks: list dict… 证据：`src/codeatlas/hosted_eval.py`
- **Hosted Worker**（source_file）：logger = logging.getLogger name class SyncJobWorker ⋮---- def init self, db path: Path str, , max workers: int = 1 - None ⋮---- store = HostedStore self.db path ⋮---- future = self. executor.submit ⋮---- def discard self, future: Future SyncResult - None ⋮---- def wait for idle self, timeout: float None = None - None ⋮---- pending = set self. futures ⋮---- def shutdown self, , wait: bool = True - None 证据：`src/codeatlas/hosted_worker.py`
- **Check for const qualifier**（source_file）：CPP LANGUAGE = Language tscpp.language def node span node: Node - Span def node text node: Node, source: bytes - str def build id file path: str, qualified name: str - str def get doc comment node: Node, source: bytes - str None ⋮---- """Extract preceding /// or / / doc comments.""" prev = node.prev sibling ⋮---- text = node text prev, source .strip ⋮---- inner = text 3:-2 .strip lines = ln.lstrip " " .strip for ln in inner.split "\n" ⋮---- doc lines: list str = cur: Node None = prev ⋮---- t = node text cur, source .strip ⋮---- cur = cur.prev sibling ⋮---- def get base classes node: Node, source: bytes - list str ⋮---- bases: list str = clause = None ⋮---- clause = child ⋮---- def get decla… 证据：`src/codeatlas/parsers/cpp_parser.py`
- **Extract the namespace being imported**（source_file）：CSHARP LANGUAGE = Language tscs.language def node span node: Node - Span def node text node: Node, source: bytes - str def build id file path: str, qualified name: str - str def get xml doc comment node: Node, source: bytes - str None ⋮---- """Extract preceding /// XML doc comments and return the text.""" lines: list str = prev = node.prev sibling ⋮---- text = node text prev, source .strip ⋮---- prev = prev.prev sibling ⋮---- joined = "\n".join lines plain = re.sub r" + ", "", joined .strip ⋮---- def get base types node: Node, source: bytes - list str ⋮---- """Extract base type names from a base list.""" bases: list str = ⋮---- def get modifiers node: Node, source: bytes - list str class CS… 证据：`src/codeatlas/parsers/csharp_parser.py`
- **implements**（source_file）：JAVA LANGUAGE = Language tsjava.language def node span node: Node - Span def node text node: Node, source: bytes - str def build id file path: str, qualified name: str - str def get javadoc node: Node, source: bytes - str None ⋮---- """Extract a preceding Javadoc or block comment.""" prev = node.prev sibling ⋮---- text = node text prev, source lines = text.strip "/ \n" .split "\n" cleaned = line.strip .lstrip " " .strip for line in lines result = " ".join line for line in cleaned if line ⋮---- text = node text prev, source .lstrip "/ " .strip ⋮---- def get annotations node: Node, source: bytes - list str ⋮---- annotations: list str = ⋮---- name node = mod.child by field name "name" ⋮---- cl… 证据：`src/codeatlas/parsers/java_parser.py`
- **Walk class body**（source_file）：KOTLIN LANGUAGE = Language tskotlin.language def node span node: Node - Span def node text node: Node, source: bytes - str def build id file path: str, qualified name: str - str def get doc comment node: Node, source: bytes - str None ⋮---- """Extract preceding // or / / comment.""" prev = node.prev sibling ⋮---- text = node text prev, source .strip ⋮---- inner = text.lstrip "/" .lstrip " " .rstrip " " .rstrip "/" .strip lines = ln.strip .lstrip " " .strip for ln in inner.splitlines ⋮---- def is interface node: Node - bool def get modifiers text node: Node, source: bytes - str def get class body node: Node - Node None def get function body block node: Node - Node None def get params node no… 证据：`src/codeatlas/parsers/kotlin_parser.py`
- **Walk class body**（source_file）：RUBY LANGUAGE = Language tsruby.language def node span node: Node - Span def node text node: Node, source: bytes - str def build id file path: str, qualified name: str - str def get doc comment node: Node, source: bytes - str None ⋮---- """Extract preceding comment lines as docstring.""" lines: list str = prev = node.prev sibling ⋮---- text = node text prev, source ⋮---- prev = prev.prev sibling ⋮---- class RubyParser BaseParser ⋮---- def init self - None ⋮---- @property def language self - str ⋮---- @property def supported extensions self - list str def parse file self, path: Path - ParseResult ⋮---- source = path.read bytes ⋮---- def parse source self, source: str, file path: str - ParseR… 证据：`src/codeatlas/parsers/ruby_parser.py`
- **val definition at top level are variables; no const in Scala**（source_file）：SCALA LANGUAGE = Language tsscala.language def node span node: Node - Span def node text node: Node, source: bytes - str def build id file path: str, qualified name: str - str def get doc comment node: Node, source: bytes - str None ⋮---- """Extract preceding // or / / comment.""" prev = node.prev sibling ⋮---- text = node text prev, source .strip ⋮---- stripped = text ⋮---- stripped = stripped 3: ⋮---- stripped = stripped 2: ⋮---- stripped = stripped :-2 lines = ln.strip .lstrip " " .strip for ln in stripped.splitlines ⋮---- def get identifier node: Node, source: bytes - str None ⋮---- name node = node.child by field name "name" ⋮---- class ScalaParser BaseParser ⋮---- def init self - None… 证据：`src/codeatlas/parsers/scala_parser.py`
- **Determine actual kind from preceding keyword sibling**（source_file）：SWIFT LANGUAGE = Language tsswift.language def node text node: Node, source: bytes - str def node span node: Node - Span def build id file path: str, qualified name: str - str def get doc comment node: Node, source: bytes - str None ⋮---- """Collect preceding /// or / / comment lines.""" lines: list str = prev = node.prev sibling ⋮---- text = node text prev, source .strip ⋮---- inner = text 3: ⋮---- inner = inner :-2 ⋮---- prev = prev.prev sibling ⋮---- class SwiftParser BaseParser ⋮---- def init self - None ⋮---- @property def language self - str ⋮---- @property def supported extensions self - list str def parse file self, path: Path - ParseResult ⋮---- source = path.read bytes ⋮---- def p… 证据：`src/codeatlas/parsers/swift_parser.py`
- **Changelog**（documentation）：All notable changes to CodeAtlas are documented in this file. 证据：`CHANGELOG.md`
- **Security Policy**（documentation）：Please report security issues privately via GitHub Security Advisories https://github.com/AryanSaini26/CodeAtlas/security/advisories/new or by email to aryan.26.saini@gmail.com . Do not open a public issue for suspected vulnerabilities. We aim to acknowledge reports within a few days. 证据：`SECURITY.md`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

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

- **核心引擎:解析、图存储、检索、CLI 与 MCP**：importance `high`
  - source_paths: src/codeatlas/parsers/__init__.py, src/codeatlas/parsers/base.py, src/codeatlas/graph/store.py, src/codeatlas/graph/export.py, src/codeatlas/search/embeddings.py
- **托管网关:控制平面、GitHub App、远程 MCP 与安全**：importance `high`
  - source_paths: src/codeatlas/hosted.py, src/codeatlas/hosted_worker.py, src/codeatlas/hosted_eval.py, src/codeatlas/api/app.py, src/codeatlas/api/routes.py
- **Web 前端与 VS Code 扩展**：importance `medium`
  - source_paths: frontend/src/App.tsx, frontend/src/main.tsx, frontend/src/api.ts, frontend/src/index.css, frontend/src/components/Layout.tsx
- **部署、可观测性、评估与运维**：importance `medium`
  - source_paths: Dockerfile, docker-compose.yml, deploy/Caddyfile, deploy/Dockerfile, deploy/stratum.service

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `b87f22eec523eab0524ded39eb6f614a4dede4b6`
- inspected_files: `Dockerfile`, `README.md`, `docker-compose.yml`, `pyproject.toml`, `docs/ai-infra-case-study.md`, `docs/architecture.md`, `docs/assets/README.md`, `docs/changelog.md`, `docs/cli.md`, `docs/demo-script.md`, `docs/deploy-digitalocean.md`, `docs/deploy-fly.md`, `docs/deploy-gcp.md`, `docs/deploy-oracle.md`, `docs/getting-started.md`, `docs/hosted-mvp.md`, `docs/index.md`, `docs/landing/index.md`, `docs/languages.md`, `docs/launch-post.md`

宿主 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: 可能修改宿主 AI 配置

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

### Constraint 2: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | https://github.com/AryanSaini26/CodeAtlas | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | https://github.com/AryanSaini26/CodeAtlas | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://github.com/AryanSaini26/CodeAtlas | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://github.com/AryanSaini26/CodeAtlas | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: issue/PR 响应质量未知

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: 抽样最近 issue/PR，判断是否长期无人处理。
- Why it matters: 用户无法判断遇到问题后是否有人维护。
- Evidence: evidence.maintainer_signals | https://github.com/AryanSaini26/CodeAtlas | issue_or_pr_quality=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 发布节奏不明确

- Trigger: release_recency=unknown。
- Host AI rule: 确认最近 release/tag 和 README 安装命令是否一致。
- Why it matters: 安装命令和文档可能落后于代码，用户踩坑概率升高。
- Evidence: evidence.maintainer_signals | https://github.com/AryanSaini26/CodeAtlas | release_recency=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
