# reviewbot - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

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

## Claim 消费规则

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

## 它最适合谁

- **想在安装前理解开源项目价值和边界的用户**：当前证据主要来自项目文档。 Claim：`clm_0002` unverified 0.25

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`docker/base/scripts/install-tools.sh` Claim：`clm_0001` unverified 0.25

## 怎么开始

- `curl https://sh.rustup.rs -sSf | sh -s -- -y --profile=minimal` 证据：`docker/base/scripts/install-tools.sh` Claim：`clm_0003` unverified 0.25
- `curl -sSL \` 证据：`docker/base/scripts/install-tools.sh` Claim：`clm_0004` unverified 0.25, `clm_0005` unverified 0.25
- `curl -sSL -o /tmp/pmd.zip \` 证据：`docker/base/scripts/install-tools.sh` Claim：`clm_0005` unverified 0.25
- `npm install -g ${npm_packages[@]}` 证据：`docker/base/scripts/install-tools.sh` Claim：`clm_0006` unverified 0.25

## 继续前判断卡

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

### 30 秒判断

- **现在怎么做**：仅建议沙盒试装
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：真实输出质量不能在安装前相信。
- **继续会触碰**：命令执行、本地环境或项目文件、宿主 AI 上下文

### 现在可以相信

- **证据不足，暂时没有可作为事实的继续依据。**（unverified）：没有 supported claim 可进入“现在可以相信”。

### 现在还不能相信

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

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`docker/base/scripts/install-tools.sh`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`docker/base/scripts/install-tools.sh`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

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

### 退出方式

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

## 哪些只能预览

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

## 哪些必须安装后验证

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

## 边界与风险判断卡

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

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`docker/base/scripts/install-tools.sh`

### 上下文规模

- 文件总数：149
- 重要文件覆盖：40/149
- 证据索引条目：48
- 角色 / Skill 条目：1

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **Readme**（project_doc）：Unit Test Dependencies ====================== 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`bot/tests/deps/README.md`

## 证据索引

- 共索引 48 条证据。

- **Readme**（documentation）：Unit Test Dependencies ====================== 证据：`bot/tests/deps/README.md`
- **Readme**（source_file）：Review Bot automates parts of the code review process, using a wide range of industry-standard code checking tools to look over your code and catch problems so your developers can focus on the bigger picture. 证据：`README.rst`
- **Readme**（source_file）：================= Review Bot Worker ================= 证据：`bot/README.rst`
- **Setup**（source_file）：class DevelopCommand develop ⋮---- def install for development self def run pip self, args ⋮---- cmd = subprocess.list2cmdline sys.executable, '-m', 'pip' + args ret = os.system cmd ⋮---- long description = fp.read 证据：`bot/setup.py`
- **Readme**（source_file）：==================== Review Bot Extension ==================== 证据：`extension/README.rst`
- **Setup**（source_file）：class DevelopCommand develop ⋮---- def install for development self def run pip self, args ⋮---- cmd = subprocess.list2cmdline sys.executable, '-m', 'pip' + args ret = os.system cmd ⋮---- long description = fp.read 证据：`extension/setup.py`
- **Init**（source_file）：VERSION = 5, 0, 0, 0, 'alpha', 0, False def get version string ⋮---- version = '%s.%s' % VERSION 0 , VERSION 1 ⋮---- version = '%s.%s' % version, VERSION 2 ⋮---- version = '%s.%s' % version, VERSION 3 tag = VERSION 4 ⋮---- version = '%s RC%s' % version, VERSION 5 ⋮---- version = '%s %s %s' % version, tag, VERSION 5 ⋮---- def get package version ⋮---- version = '%d.%d' % VERSION 0 , VERSION 1 ⋮---- tag = 'a' ⋮---- tag = 'b' version = '%s%s%s' % version, tag, VERSION 5 ⋮---- def is release version info = VERSION :-1 version = get package version 证据：`bot/reviewbot/__init__.py`
- **Repositories**（source_file）：logger = get logger name repositories = {} repository backends = class BaseRepository object ⋮---- repo types = None tool name = None def init self, name, clone path def sync self def checkout self, commit id def eq self, other def repr self class GitRepository BaseRepository ⋮---- repo types = 'git', tool name = 'Git' ⋮---- workdir = make tempdir branchname = 'br-%s-%s' % commit id, uuid4 ⋮---- class HgRepository BaseRepository ⋮---- repo types = 'hg', 'mercurial' tool name = 'Mercurial' ⋮---- def fetch repositories url, user=None, token=None ⋮---- root = get api root url=url, ⋮---- repos = root.get repositories tool=repository cls.tool name, ⋮---- clone path = None ⋮---- clone path = path… 证据：`bot/reviewbot/repositories.py`
- **Init**（source_file）：all = autodoc excludes = all 证据：`bot/reviewbot/tools/__init__.py`
- **Init**（source_file）：all = 证据：`bot/reviewbot/tools/base/__init__.py`
- **: The name of a tool setting for a comma-separated list of extensions.**（source_file）：glob escape pattern = re.compile r' ? ' def glob escape path class FilePatternsFromSettingMixin object ⋮---- """Mixin to set file patterns based on a configured tool setting. Subclasses can base file patterns off either a setting representing a comma-separated list of file patterns, or a setting representing a comma-separated list of file extensions. If both are provided, both will be checked, with the file patterns taking precedence over file extensions. If neither are provided by the user, the default list of file patterns set by the subclass if any will be used. Version Added: 3.0 """ : The name of a tool setting for a comma-separated list of extensions. : : Type: : str file extensions s… 证据：`bot/reviewbot/tools/base/mixins.py`
- **: A short description of the tool.**（source_file）：class BaseTool object ⋮---- name = '' : A short description of the tool. : : Type: : str description = '' : The compatibility version of the tool. ⋮---- : This should only be changed for major breaking updates. It will break : compatibility with existing integration configurations, requiring : manual updates to those configurations. Any existing configurations : referencing the old version will not be run, unless an older version : of the tool is being handled through another Review Bot worker providing : the older tool. ⋮---- version = '1' exe dependencies = file patterns = options = working directory required = False timeout = None def init self, settings=None, kwargs ⋮---- @property def… 证据：`bot/reviewbot/tools/base/tool.py`
- **Cap the output length.**（source_file）：class CargoTool FullRepositoryToolMixin, BaseTool ⋮---- name = 'CargoTool' version = '1.0' description = timeout = 120 exe dependencies = 'cargo', 'cargo-clippy' file patterns = ' .rs' options = TEST GROUP RE = re.compile TEST LINES LIMIT = 100 def build base command self, kwargs ⋮---- """Build the base command line used to review files. Args: kwargs dict, unused : Additional keyword arguments. Returns: list of str: The base command line. """ ⋮---- def handle files self, files, review, base command, kwargs ⋮---- settings = self.settings ⋮---- def handle file self, f, path, file results, kwargs ⋮---- results = file results os.path.realpath path ⋮---- message data = result 'message' message =… 证据：`bot/reviewbot/tools/cargotool.py`
- **Clang**（source_file）：class ClangTool FullRepositoryToolMixin, BaseTool ⋮---- name = 'Clang Static Analyzer' version = '1.0' description = 'Checks code using clang --analyze.' timeout = 30 exe dependencies = 'clang' file patterns = options = def build base command self, kwargs ⋮---- settings = self.settings configured args = settings.get 'cmdline args', '' .strip cmd = ⋮---- def handle file self, f, path, base command, kwargs ⋮---- outfile = make tempfile command = list base command ⋮---- output = execute command, ignore errors=True ⋮---- results = plist load fp ⋮---- filename = results 'files' diagnostic 'location' 'file' ⋮---- range info = self. find range diagnostic ⋮---- def find range self, diagnostic ⋮----… 证据：`bot/reviewbot/tools/clang.py`
- **Doc8**（source_file）：class Doc8Tool BaseTool ⋮---- name = 'doc8' version = '1.0' description = 'Checks reStructuredText for style.' timeout = 30 exe dependencies = 'doc8' file patterns = ' .rst' options = LINE RE = re.compile def build base command self, kwargs ⋮---- """Build the base command line used to review files. Args: kwargs dict, unused : Additional keyword arguments. Returns: list of str: The base command line. """ settings = self.settings ⋮---- def handle file self, f, path, base command, kwargs ⋮---- output = execute base command + path , line re = self.LINE RE ⋮---- m = line re.match line 证据：`bot/reviewbot/tools/doc8.py`
- **Gotool**（source_file）：class GoTool FullRepositoryToolMixin, BaseTool ⋮---- name = 'GoTool' version = '1.0' description = timeout = 90 exe dependencies = 'go' file patterns = ' .go' options = ⋮---- """Return whether this tool can handle a given file. Args: review file reviewbot.processing.review.File : The file to check. kwargs dict, unused : Additional keyword arguments passed to :py:meth: execute . This is intended for future expansion. Returns: bool: True if the file can be handled. False if it cannot. """ ⋮---- def handle files self, files, review, kwargs ⋮---- packages = set patched files map = {} ⋮---- settings = self.settings run test = settings.get 'test', False run vet = settings.get 'vet', False ⋮---- d… 证据：`bot/reviewbot/tools/gotool.py`
- **Jshint**（source_file）：class JSHintTool FilePatternsFromSettingMixin, BaseTool ⋮---- name = 'JSHint' version = '1.0' description = timeout = 30 exe dependencies = 'jshint' file patterns = ' .js' file extension setting = 'extra ext checks' options = REPORTER PATH = os.path.abspath os.path.join file , '..', 'support', def build base command self, kwargs ⋮---- settings = self.settings cmd = config content = self.settings 'config' ⋮---- def handle file self, f, path, base command, kwargs ⋮---- output = execute base command + path , ⋮---- errors = json.loads output 证据：`bot/reviewbot/tools/jshint.py`
- **Now try PMD 6.**（source_file）：class PMDTool JavaToolMixin, FilePatternsFromSettingMixin, BaseTool ⋮---- name = 'PMD' version = '1.0' description = 'Checks code for errors using the PMD source code checker.' timeout = 90 exe dependencies = 'java', 'pmd' file extensions setting = 'file ext' options = base command: list str pmd version: Optional int = None ⋮---- @property def pmd version self - int ⋮---- pmd path = cast str, config 'exe paths' 'pmd' output = cast str, execute ⋮---- Now try PMD 6. ⋮---- def build base command self, kwargs ⋮---- """Build the base command line used to review files. This creates a command line for running PMD that specifies the correct output format and the rulesets generating a temporary rule… 证据：`bot/reviewbot/tools/pmd.py`
- **Codeclimate**（source_file）：def add comment from codeclimate issue issue payload, review file ⋮---- positions = issue payload 'location' 'positions' begin = positions 'begin' end = positions 'end' first line = begin 'line' 证据：`bot/reviewbot/tools/utils/codeclimate.py`
- **Init**（source_file）：VERSION = 5, 0, 0, 0, 'alpha', 0, False def get version string ⋮---- version = '%s.%s' % VERSION 0 , VERSION 1 ⋮---- version = '%s.%s' % version, VERSION 2 ⋮---- version = '%s.%s' % version, VERSION 3 tag = VERSION 4 ⋮---- version = '%s RC%s' % version, VERSION 5 ⋮---- version = '%s %s %s' % version, tag, VERSION 5 ⋮---- def get package version ⋮---- version = '%d.%d' % VERSION 0 , VERSION 1 ⋮---- tag = 'a' ⋮---- tag = 'b' version = '%s%s%s' % version, tag, VERSION 5 ⋮---- def is release version info = VERSION :-1 version = get package version 证据：`extension/reviewbotext/__init__.py`
- **Init**（source_file）：SEQUENCE = 证据：`extension/reviewbotext/evolutions/__init__.py`
- **Forms**（source_file）：class ToolForm forms.ModelForm ⋮---- class Meta ⋮---- model = Tool fields = ' all ' class ReviewBotConfigForm IntegrationConfigForm ⋮---- COMMENT ON UNMODIFIED CODE DEFAULT = False DROP OLD ISSUES DEFAULT = True OPEN ISSUES DEFAULT = True MAX COMMENTS DEFAULT = 30 NOTIFY OWNER ONLY DEFAULT = False RUN MANUALLY DEFAULT = False conditions = ReviewRequestConditionsField required=False tool = forms.ModelChoiceField comment on unmodified code = forms.BooleanField open issues = forms.BooleanField drop old issues = forms.BooleanField run manually = forms.BooleanField max comments = forms.IntegerField notify owner only = forms.BooleanField ⋮---- extension = ReviewBotExtension.instance ⋮---- def loa… 证据：`extension/reviewbotext/forms.py`
- **Integration**（source_file）：logger = logging.getLogger name class ReviewBotIntegration Integration ⋮---- name = 'Review Bot' description = 'Performs automated analysis and review on code changes.' config form cls = ReviewBotConfigForm def initialize self - None ⋮---- @cached property def icon static urls self - Mapping str, str ⋮---- extension = ReviewBotExtension.instance ⋮---- matching configs = ⋮---- tool id = config.settings.get 'tool' ⋮---- tool = Tool.objects.get pk=tool id ⋮---- review settings = { ⋮---- tool options = json.loads ⋮---- tool options = {} ⋮---- review request id = review request.get display id diffset = review request.get latest diffset ⋮---- fields changed = changedesc.fields changed ⋮---- match… 证据：`extension/reviewbotext/integration.py`
- **Resources**（source_file）：class GeneralCommentData TypedDict ⋮---- issue opened: bool issue status: str None rich text: bool text: str class DiffCommentData GeneralCommentData ⋮---- filediff: NotRequired FileDiff filediff id: NotRequired int first line: int interfilediff: NotRequired None num lines: int class InvalidFormDataError Exception class ToolResource WebAPIResource ⋮---- name = 'tool' allowed methods = 'GET', 'POST' model object key = 'id' uri object key = 'tool id' ⋮---- extension = ReviewBotExtension.instance ⋮---- tools = json.loads tools ⋮---- tool resource = ToolResource class ReviewBotReviewResource WebAPIResource ⋮---- name = 'review bot review' allowed methods = 'GET', 'POST', ⋮---- """Create a new r… 证据：`extension/reviewbotext/resources.py`
- **Init**（source_file）：all = 证据：`bot/reviewbot/testing/__init__.py`
- **Testcases**（source_file）：UNSET = object class FileAttachmentItemResource ItemResource class FileAttachmentListResource FileAttachmentListResource ⋮---- def upload attachment self, kwargs class DummyFileDiffResource FileDiffResource ⋮---- def getattribute self, name def get patch self, kwargs def get original file self, kwargs def get patched file self, kwargs def get diff data self, kwargs class RepositoryListResource ListResource ⋮---- def init self, kwargs class ReviewBotReviewResource ItemResource class ReviewBotReviewsResource ListResource ⋮---- def create self, kwargs class ReviewBotToolsResource ListResource class ReviewBotExtensionResource ItemResource ⋮---- def get review bot reviews self, kwargs def get to… 证据：`bot/reviewbot/testing/testcases.py`
- **Test Repositories**（source_file）：class RepositoriesTests kgb.SpyAgency, TestCase ⋮---- def tearDown self def test init repositories with servers self ⋮---- api transport = self.api transport rb1 url = 'https://rb1.example.com/' api root1 = DummyRootResource ⋮---- rb2 url = 'https://rb2.example.com/' api root2 = DummyRootResource ⋮---- def test init repositories with servers missing keys self ⋮---- rb url = 'https://rb1.example.com/' api root = DummyRootResource ⋮---- repo config2 = { ⋮---- def test init repositories with repositories self def test init repositories with repositories missing keys self ⋮---- repo config1 = { 证据：`bot/reviewbot/tests/test_repositories.py`
- **Init**（source_file）：all = 证据：`bot/reviewbot/tools/testing/__init__.py`
- **Testcases**（source_file）：class ToolTestCaseMetaclass type ⋮---- def new meta, name, bases, d ⋮---- tool class = d.get 'tool class' ⋮---- added = False ⋮---- new name = meta.tag func name func name, 'integration' ⋮---- added = True ⋮---- new name = meta.tag func name func name, 'simulation' ⋮---- @classmethod def tag func name meta, func name, tag ⋮---- @classmethod def make integration test func meta, func, func name ⋮---- @wraps func def wrapper self, args, kwargs ⋮---- old path = os.environ 'PATH' old tool exe path = self.tool exe path ⋮---- @classmethod def make simulation test func meta, func, func name class BaseToolTestCase kgb.SpyAgency, TestCase ⋮---- tool class = None tool exe config key = None tool exe pa… 证据：`bot/reviewbot/tools/testing/testcases.py`
- **Test Base Tool**（source_file）：class DummyTool BaseTool ⋮---- exe dependencies = 'foo', 'bar' class BaseToolTests kgb.SpyAgency, TestCase ⋮---- def test check dependencies with all found in path self ⋮---- tool = DummyTool ⋮---- def test check dependencies with config and files found self ⋮---- new config = { ⋮---- def test check dependencies with config and files not found self def test check dependencies with missing deps self def test get can handle file with empty list self ⋮---- class PatternsTool BaseTool review = self.create review review file = self.create review file review tool = PatternsTool ⋮---- def test get can handle file with matching filename self ⋮---- review file1 = self.create review file review, revi… 证据：`bot/reviewbot/tools/tests/test_base_tool.py`
- **Test Cargotool**（source_file）：class CargoToolTests BaseToolTestCase, metaclass=ToolTestCaseMetaclass ⋮---- tool class = CargoTool tool exe config key = 'cargo' tool exe path = '/path/to/cargo' BAD RS CODE1 = BAD RS CODE2 = GOOD RS CODE1 = GOOD RS CODE2 = BAD RS 1 TEST = BAD RS N TESTS = BAD RS TESTS SYNTAX ERROR = GOOD RS TESTS = def setUp self ⋮---- def test execute with clippy true self ⋮---- def test execute with clippy true and 0 issues self ⋮---- def test execute with test true 1 failed self ⋮---- general comments = review.general comments ⋮---- comment = general comments 0 ⋮---- def test execute with test true gt 1 failures self ⋮---- def test execute with test true 0 failures self ⋮---- def test execute with test… 证据：`bot/reviewbot/tools/tests/test_cargotool.py`
- **Test Clang**（source_file）：class ClangToolTests BaseToolTestCase, metaclass=ToolTestCaseMetaclass ⋮---- tool class = ClangTool tool exe config key = 'clang' tool exe path = '/path/to/clang' ⋮---- def test execute with c self ⋮---- def test execute with objc self ⋮---- def test execute with objc and compiler error self ⋮---- def test execute with objcpp self ⋮---- def test execute with objcpp and compiler error self ⋮---- def test execute with cmdline args self def setup simulation test self, plist data=None, output=None ⋮---- @self.spy for execute def execute cmdline, args, kwargs ⋮---- filename = cmdline -1 证据：`bot/reviewbot/tools/tests/test_clang.py`
- **Test Doc8**（source_file）：class Doc8ToolTests BaseToolTestCase, metaclass=ToolTestCaseMetaclass ⋮---- tool class = Doc8Tool tool exe config key = 'doc8' tool exe path = '/path/to/doc8' ⋮---- def test execute self ⋮---- def test execute with encoding self ⋮---- def test execute with max line length self ⋮---- @integration test @simulation test output= def test execute with success self def setup simulation test self, output= 证据：`bot/reviewbot/tools/tests/test_doc8.py`
- **Test Gotool**（source_file）：class GoToolTests BaseToolTestCase, metaclass=ToolTestCaseMetaclass ⋮---- tool class = GoTool tool exe config key = 'go' tool exe path = '/path/to/go' SAMPLE GO CODE = SAMPLE SYNTAX ERROR GO CODE = SAMPLE TEST CODE = def setUp self def tearDown self ⋮---- def test execute with test self ⋮---- comments = review.general comments ⋮---- comment = comments 0 ⋮---- def test execute with test and syntax error self ⋮---- def test execute with vet self ⋮---- comments = sorted review.comments, key=lambda c: c 'first line' ⋮---- first comment = comments 0 ⋮---- def test execute with vet and syntax error self ⋮---- def test execute with test and vet self ⋮---- def test execute with test and vet and suc… 证据：`bot/reviewbot/tools/tests/test_gotool.py`
- **Test Jshint**（source_file）：class JSHintToolTests BaseToolTestCase, metaclass=ToolTestCaseMetaclass ⋮---- tool class = JSHintTool tool exe config key = 'jshint' tool exe path = '/path/to/jshint' ⋮---- def test execute self ⋮---- def test execute with config self ⋮---- config path = tmpfiles -1 ⋮---- def setup simulation test self, output payload 证据：`bot/reviewbot/tools/tests/test_jshint.py`
- **Test Pmd**（source_file）：class PMDToolTests BaseToolTestCase, metaclass=ToolTestCaseMetaclass ⋮---- tool class = PMDTool tool exe config key = 'pmd' tool exe path = '/path/to/pmd' tool extra exe paths = { def test check dependencies with no config self ⋮---- tool = PMDTool ⋮---- def test check dependencies with pmd not found self ⋮---- new config = { ⋮---- def test check dependencies with pmd found self ⋮---- def test execute with ruleset names self ⋮---- class names num lines = 1 ⋮---- class names num lines = 7 ⋮---- def test execute with ruleset xml self ⋮---- ruleset xml = ⋮---- def test execute with no errors self ⋮---- def test execute with syntax errors self ⋮---- filename = 'test.java' ⋮---- filename = f'{tm… 证据：`bot/reviewbot/tools/tests/test_pmd.py`
- **Wildcards**（source_file）：Files reviewbot-cookies.txt .coverage .DS Store 证据：`.gitignore`
- **.reviewboardrc**（source_file）：REVIEWBOARD URL = 'https://reviews.reviewboard.org' REPOSITORY = 'ReviewBot' REPOSITORY TYPE = 'git' BRANCH = 'release-5.x' TRACKING BRANCH = 'origin/%s' % BRANCH LAND DEST BRANCH = BRANCH 证据：`.reviewboardrc`
- **Authors**（source_file）：Allyshia Sewdat André Klitzing Anselina Chia Cecilia Wei Christian Hammond Daniel Laird David Trowbridge Jacob Blazusiak Joshua Cannon Max Rabkin Ross Guairno Steven MacLeod Sujeevan Rasaratnam Wesley Ellis 证据：`AUTHORS`
- **Copying**（source_file）：Copyright c 2012 Steven MacLeod Copyright c 2012-2017 Beanbag, Inc. 证据：`COPYING`
- **Manifest**（source_file）：include README.rst include setup.cfg include -requirements.txt 证据：`bot/MANIFEST.in`
- **Dev Requirements**（source_file）：kgb~=7.3 rbtools~=5.3 reviewbot-worker all 证据：`bot/dev-requirements.txt`
- **Setup**（source_file）：aliases release = egg info --no-date --tag-build= 证据：`bot/setup.cfg`
- **Dockerfile for Review Bot.**（source_file）：Dockerfile for Review Bot. Copyright C 2022 Beanbag, Inc. 证据：`docker/Dockerfile-base`
- **Build**（source_file）：docker dir = os.path.dirname file ⋮---- IMAGE FMT = 'beanbag/reviewbot-%s' IMAGES = ARCHS = ⋮---- argparser = argparse.ArgumentParser ⋮---- options = argparser.parse args package version = get package version major version = '%s' % VERSION 0 major minor version = '%s.%s' % VERSION :2 image version = package version ⋮---- package version = '%s.dev0' % package version package path = os.path.join docker dir, 'base', 'packages', ⋮---- base image = IMAGE FMT % 'base' build args = all tags = ⋮---- image name = IMAGE FMT % image tags = '%s:%s' % image name, image version ⋮---- cmd = 'docker', 'build' + build args ⋮---- p = subprocess.Popen cmd, ⋮---- p = subprocess.Popen 'docker', 'push', tag , 证据：`docker/build.py`
- **Manifest**（source_file）：recursive-include reviewbotext/templates .html 证据：`extension/MANIFEST.in`
- **Conftest**（source_file）：pytest plugins = 'reviewboard.testing.pytest fixtures' 证据：`extension/conftest.py`
- **Setup**（source_file）：aliases release = egg info --no-date --tag-build= 证据：`extension/setup.cfg`

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

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

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

- 你准备在哪个宿主 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。

- **项目概述与核心特性**：importance `high`
  - source_paths: README.rst, docs/releasenotes/4.1.rst, docs/releasenotes/3.2.rst
- **系统架构与组件设计**：importance `high`
  - source_paths: bot/reviewbot/celery.py, bot/reviewbot/tasks.py, bot/reviewbot/main.py, bot/reviewbot/config.py, extension/reviewbotext/extension.py
- **工具插件系统与支持的检查器**：importance `high`
  - source_paths: bot/reviewbot/tools/base/tool.py, bot/reviewbot/tools/base/mixins.py, bot/reviewbot/tools/base/registry.py, bot/reviewbot/tools/clang.py, bot/reviewbot/tools/jshint.py
- **部署方式与运维指南**：importance `medium`
  - source_paths: docker/Dockerfile-base, docker/base/Dockerfile, docker/base/scripts/docker-entrypoint.sh, docker/base/scripts/docker-healthcheck.sh, docker/base/scripts/install-tools.sh

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `6fd3bfa1eaf04215a472f1e9392ad7aeb065fb83`
- inspected_files: `README.rst`, `docs/reviewbot/conf.py`, `docs/releasenotes/conf.py`, `docs/releasenotes/_ext/extralinks.py`

宿主 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: 能力判断依赖假设

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

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

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

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

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

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

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

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

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

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