# semgrep - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 semgrep 编译的 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_0002` supported 0.86
- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0003` supported 0.86

## 它能做什么

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

## 怎么开始

- `curl https://semgrep.dev/c/p/[name] > [name].yml` 证据：`perf/r2c-rules/README.md` Claim：`clm_0004` supported 0.86
- `curl -L -o "curl-${CURL_VERSION}.tar.gz" "https://curl.se/download/curl-${CURL_VERSION}.tar.gz"` 证据：`scripts/build-static-libcurl.sh` Claim：`clm_0005` unverified 0.25
- `curl --fail -L -X POST "$HOST/api/metric/semgrep.core.tests.$TEST_CATEGORY.unit-test.num" -d "$NUM_TESTS"` 证据：`scripts/report_test_metrics.sh` Claim：`clm_0006` unverified 0.25
- `pip install "$1"` 证据：`scripts/validate-wheel.sh` Claim：`clm_0007` unverified 0.25

## 继续前判断卡

- **当前建议**：先做角色匹配试用
- **为什么**：这个项目更像角色库，核心风险是选错角色或把角色文案当执行能力；先用 Prompt Preview 试角色匹配，再决定是否沙盒导入。

### 30 秒判断

- **现在怎么做**：先做角色匹配试用
- **最小安全下一步**：先用 Prompt Preview 试角色匹配；满意后再隔离导入
- **先别相信**：角色质量和任务匹配不能直接相信。
- **继续会触碰**：角色选择偏差、命令执行、宿主 AI 配置

### 现在可以相信

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

### 现在还不能相信

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

### 继续会触碰什么

- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`perf/r2c-rules/README.md`, `scripts/build-static-libcurl.sh`, `scripts/report_test_metrics.sh`, `scripts/validate-wheel.sh`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`AGENTS.md`, `CLAUDE.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`perf/r2c-rules/README.md`, `scripts/build-static-libcurl.sh`, `scripts/report_test_metrics.sh`, `scripts/validate-wheel.sh`
- **宿主 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_0008` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`perf/r2c-rules/README.md`, `scripts/build-static-libcurl.sh`, `scripts/report_test_metrics.sh`, `scripts/validate-wheel.sh` 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。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`perf/r2c-rules/README.md`, `scripts/build-static-libcurl.sh`, `scripts/report_test_metrics.sh`, `scripts/validate-wheel.sh` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：3945
- 重要文件覆盖：40/3945
- 证据索引条目：58
- 角色 / Skill 条目：24

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **Language support**（project_doc）：Semgrep is a fast, open-source, static analysis tool that searches code, finds bugs, and enforces secure guardrails and coding standards. Semgrep supports 30+ languages language-support and can run in an IDE, as a pre-commit check, and as part of CI/CD workflows. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Readme**（project_doc）：generated lockfiles for semgrep.opam ; see ../../opam-lockfiles/README.md as to how to update them. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`opam-lockfiles/README.md`
- **Semgrep benchmarks**（project_doc）：This folder is for running realistic benchmarks for semgrep, as opposed to more focused tests. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`perf/README.md`
- **Semgrep Guardian**（project_doc）：Semgrep https://semgrep.dev Guardian integrates natively with AI coding agents like Claude Code and Cursor to catch security issues before they ship. It bundles the Semgrep MCP server https://modelcontextprotocol.io/docs/getting-started/intro , Hooks, and Skills into a single install, and scans every file an agent generates using Semgrep Code, Supply Chain, and Secrets. When findings are detected, the agent is promp… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`cli/src/semgrep/mcp/README.md`
- **Note: DO NOT submit PRs against the semgrep-interfaces repo**（project_doc）：Note: DO NOT submit PRs against the semgrep-interfaces repo 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`cli/src/semgrep/semgrep_interfaces/README.md`
- **regexp parsers**（project_doc）：The same code base provides a configurable parser that can support the most popular regexp dialects similar to Perl's syntax. These include the syntaxes supported by the following frameworks: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`languages/regexp/README.md`
- **python-str-repr**（project_doc）：Escape strings in OCaml as if you were using Python. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`libs/python-str-repr/README.md`
- **Readme**（project_doc）：The rules in this folder are advertised rule packs on the front page of https://semgrep.dev/explore. Each one was obtained via the command 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`perf/r2c-rules/README.md`
- **Aliengrep**（project_doc）：Aliengrep is a generic mode design to complement and address the shortcomings of Spacegrep aka Semgrep's generic mode. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/aliengrep/README.md`
- **OCaml CLI wrapper**（project_doc）：See also the to-do list: TODO.md TODO.md . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/osemgrep/README.md`
- **spacegrep**（project_doc）：This is an attempt at providing a grep-like tool for finding patterns in human-readable code written in any language. It has the following properties: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/spacegrep/README.md`
- **semgrep tests**（project_doc）：Unit tests are meant to be the primary test type. This directory has tests for modules or classes that mock out any external dependencies. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`cli/tests/README.md`
- **Readme**（project_doc）：Note that the PNG file is here to test handling binary files: https://github.com/returntocorp/semgrep/issues/781 issuecomment-630786306 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`cli/tests/default/e2e/targets/basic/README.md`
- **Readme**（project_doc）： 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`cli/tests/default/e2e/targets/dependency_aware/uv/README.md`
- **Semgrep OSS Codebase Overview**（project_doc）：This is the home of Semgrep CE Community Edition . Semgrep is a fast static analysis tool that searches code, finds bugs, and enforces secure guardrails and coding standards. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`AGENTS.md`
- **Claude**（project_doc）： 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CLAUDE.md`
- **Quick start**（project_doc）：Thank you for your interest in contributing to the Semgrep source code! 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **Vendor Readme**（project_doc）：Parsy is vendored in order to add incremental line and column tracking functionality, which speeds up our lockfile parsers signficantly. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`cli/src/semdep/external/parsy/VENDOR_README.md`
- **Changelog**（project_doc）：1.166.0 https://github.com/semgrep/semgrep/releases/tag/v1.166.0 - 2026-06-11 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CHANGELOG.md`
- **Contributor Covenant Code of Conduct**（project_doc）：Contributor Covenant Code of Conduct 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CODE_OF_CONDUCT.md`
- **Security Policy**（project_doc）：This project is under active development and we do our best to support the latest versions. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`SECURITY.md`
- **Semgrep metrics**（project_doc）：Semgrep CLI may collect aggregate metrics to help improve the product. This document describes: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`metrics.md`
- **1.166.0 https://github.com/semgrep/semgrep/releases/tag/v1.166.0 - 2026-06-11**（project_doc）：1.166.0 https://github.com/semgrep/semgrep/releases/tag/v1.166.0 - 2026-06-11 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`release_changes.md`
- **osemgrep to-do list and notes**（project_doc）：The goal of this file is to track progress and share ideas about the migration of the Python CLI wrapper to OCaml, known temporarily as osemgrep. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`src/osemgrep/TODO.md`

## 证据索引

- 共索引 58 条证据。

- **Language support**（documentation）：Semgrep is a fast, open-source, static analysis tool that searches code, finds bugs, and enforces secure guardrails and coding standards. Semgrep supports 30+ languages language-support and can run in an IDE, as a pre-commit check, and as part of CI/CD workflows. 证据：`README.md`
- **Readme**（documentation）：generated lockfiles for semgrep.opam ; see ../../opam-lockfiles/README.md as to how to update them. 证据：`opam-lockfiles/README.md`
- **Semgrep benchmarks**（documentation）：This folder is for running realistic benchmarks for semgrep, as opposed to more focused tests. 证据：`perf/README.md`
- **Semgrep Guardian**（documentation）：Semgrep https://semgrep.dev Guardian integrates natively with AI coding agents like Claude Code and Cursor to catch security issues before they ship. It bundles the Semgrep MCP server https://modelcontextprotocol.io/docs/getting-started/intro , Hooks, and Skills into a single install, and scans every file an agent generates using Semgrep Code, Supply Chain, and Secrets. When findings are detected, the agent is prompted to regenerate code until Semgrep returns clean results or you choose to dismiss them. 证据：`cli/src/semgrep/mcp/README.md`
- **Note: DO NOT submit PRs against the semgrep-interfaces repo**（documentation）：Note: DO NOT submit PRs against the semgrep-interfaces repo 证据：`cli/src/semgrep/semgrep_interfaces/README.md`
- **regexp parsers**（documentation）：The same code base provides a configurable parser that can support the most popular regexp dialects similar to Perl's syntax. These include the syntaxes supported by the following frameworks: 证据：`languages/regexp/README.md`
- **python-str-repr**（documentation）：Escape strings in OCaml as if you were using Python. 证据：`libs/python-str-repr/README.md`
- **Readme**（documentation）：The rules in this folder are advertised rule packs on the front page of https://semgrep.dev/explore. Each one was obtained via the command 证据：`perf/r2c-rules/README.md`
- **Aliengrep**（documentation）：Aliengrep is a generic mode design to complement and address the shortcomings of Spacegrep aka Semgrep's generic mode. 证据：`src/aliengrep/README.md`
- **OCaml CLI wrapper**（documentation）：See also the to-do list: TODO.md TODO.md . 证据：`src/osemgrep/README.md`
- **spacegrep**（documentation）：This is an attempt at providing a grep-like tool for finding patterns in human-readable code written in any language. It has the following properties: 证据：`src/spacegrep/README.md`
- **semgrep tests**（documentation）：Unit tests are meant to be the primary test type. This directory has tests for modules or classes that mock out any external dependencies. 证据：`cli/tests/README.md`
- **Readme**（documentation）：Note that the PNG file is here to test handling binary files: https://github.com/returntocorp/semgrep/issues/781 issuecomment-630786306 证据：`cli/tests/default/e2e/targets/basic/README.md`
- **Semgrep OSS Codebase Overview**（documentation）：This is the home of Semgrep CE Community Edition . Semgrep is a fast static analysis tool that searches code, finds bugs, and enforces secure guardrails and coding standards. 证据：`AGENTS.md`
- **Claude**（documentation）：@AGENTS.md 证据：`CLAUDE.md`
- **Quick start**（documentation）：Thank you for your interest in contributing to the Semgrep source code! 证据：`CONTRIBUTING.md`
- **Package**（package_manifest）：{ "name": "test", "version": "1.0.0", "main": "ansi.js", "devDependencies": { "lodash" : "4.17.20", "ansi-html" : "0.0.7" } } 证据：`cli/tests/default/e2e/targets/dependency_aware/ansi/package.json`
- **Package**（package_manifest）：{ "name": "foodorderapp", "version": "1.0.0", "main": "foo.js", "dependencies": { "lodash":"^1.0.0" } } 证据：`cli/tests/default/e2e/targets/dependency_aware/unreachable_multiple_copies/package.json`
- **Package**（package_manifest）：{ "name": "test", "version": "1.0.0", "main": "foo.js", "dependencies": { "@babel/core": "^7.19.6" } } 证据：`cli/tests/default/e2e/targets/dependency_aware/yarn2/package.json`
- **License**（source_file）：GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 证据：`LICENSE`
- **License**（source_file）：This software is made available under the terms of either of the licenses found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made under the terms of both these licenses. 证据：`cli/src/semdep/external/packaging/LICENSE`
- **MIT license. See http://www.opensource.org/licenses/mit-license.php**（source_file）：MIT license. See http://www.opensource.org/licenses/mit-license.php 证据：`cli/src/semdep/external/parsy/LICENSE`
- **License**（source_file）：GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 证据：`cli/src/semgrep/semgrep_interfaces/LICENSE`
- **License**（source_file）：GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 证据：`libs/python-str-repr/LICENSE`
- **Vendor Readme**（documentation）：Parsy is vendored in order to add incremental line and column tracking functionality, which speeds up our lockfile parsers signficantly. 证据：`cli/src/semdep/external/parsy/VENDOR_README.md`
- **TODO use with the 'with' context**（source_file）：logger = logging.getLogger file ⋮---- handler = logging.StreamHandler stream=sys.stderr ⋮---- def activate venv path: Path - dict ⋮---- oldenv = copy.deepcopy os.environ ⋮---- def deactivate oldenv: dict ⋮---- script arguments = None venv path = Path f"semgrep-{semgrep version}" ⋮---- TODO use with the 'with' context oldenv = activate venv path.absolute ⋮---- r = subprocess.run "semgrep", "--version" , stdout=subprocess.PIPE real semgrep version = r.stdout.decode "utf-8" ⋮---- parser = argparse.ArgumentParser ⋮---- builder = venv.EnvBuilder 证据：`perf/benchmark-against-version.py`
- **Init**（source_file）：all = 证据：`cli/src/semdep/external/packaging/__init__.py`
- **Validate the version and parse it into pieces**（source_file）：all = "parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION PATTERN" InfiniteTypes = Union InfinityType, NegativeInfinityType PrePostDevType = Union InfiniteTypes, Tuple str, int SubLocalType = Union InfiniteTypes, int, str LocalType = Union CmpKey = Tuple LegacyCmpKey = Tuple int, Tuple str, ... VersionComparisonMethod = Callable Version = collections.namedtuple def parse version: str - Union "LegacyVersion", "Version" class InvalidVersion ValueError class BaseVersion ⋮---- key: Union CmpKey, LegacyCmpKey def hash self - int def lt self, other: " BaseVersion" - bool def le self, other: " BaseVersion" - bool def eq self, other: object - bool def ge self, other: " BaseVersion" - bo… 证据：`cli/src/semdep/external/packaging/version.py`
- **collect the furthest failure from self and other**（source_file）：noop = lambda x: x class ParseError RuntimeError ⋮---- def init self, expected, stream, index def line info self def str self ⋮---- expected list = sorted repr e for e in self.expected ⋮---- @dataclass frozen=True class Position ⋮---- offset: int line: int column: int ⋮---- @dataclass frozen=True class Result ⋮---- status: bool index: Position value: Any furthest: Position expected: FrozenSet str ⋮---- @staticmethod def success index, value ⋮---- @staticmethod def failure index, expected collect the furthest failure from self and other def aggregate self, other ⋮---- if we both have the same failure index, we combine the expected messages. ⋮---- class Parser ⋮---- """ A Parser is an object… 证据：`cli/src/semdep/external/parsy/__init__.py`
- **Version**（source_file）：version = "2.0" 证据：`cli/src/semdep/external/parsy/version.py`
- **Golang Version**（source_file）：@dataclass class GolangVersionCore ⋮---- major: int minor: int patch: int ⋮---- @dataclass class GolangPseudoVersion ⋮---- timestamp: datetime commit hash: str ⋮---- @dataclass class GolangPreReleaseVersion ⋮---- pre release identifiers: List str ⋮---- @dataclass class ParsedGolangVersion ⋮---- core: GolangVersionCore pseudo: Optional GolangPseudoVersion = None pre release: Optional GolangPreReleaseVersion = None ⋮---- raw timestamp = split raw version 1 ⋮---- parsed timestamp = parse golang pseudo datetime raw timestamp ⋮---- def parse golang pre release split raw version: List str - GolangPreReleaseVersion ⋮---- raw pre release = "-".join split raw version 1: split pre release = raw pre r… 证据：`cli/src/semdep/golang_version.py`
- **"Maven treats the SNAPSHOT qualifier differently from all others.**（source_file）：@dataclass class VersionCore ⋮---- major: int minor: int incrementals: Tuple int, ... parse version core = triple ⋮---- def compare version core first: VersionCore, second: VersionCore - int ⋮---- @dataclass class ParsedMavenVersion ⋮---- core: VersionCore qualifier: str raw version: str MavenVersion = Union ParsedMavenVersion, str def parse maven version version: str - MavenVersion ⋮---- m = pair parse version core, any str .parse version ⋮---- def cmp str x: str, y: str - int def cmp maven versions first: MavenVersion, second: MavenVersion - int ⋮---- core cmp = compare version core first.core, second.core ⋮---- "Maven treats the SNAPSHOT qualifier differently from all others. ⋮---- first… 证据：`cli/src/semdep/maven_version.py`
- **Init**（source_file）：VERSION = "1.166.0" 证据：`cli/src/semgrep/__init__.py`
- **Auth**（source_file）：logger = logging.getLogger name ⋮---- @telemetry.trace def get deployment from token token: str - Optional DeploymentConfig ⋮---- state = get state r = state.app session.get ⋮---- data = r.json ⋮---- @telemetry.trace def get deployment id - Optional int ⋮---- r = state.app session.get f"{state.env.semgrep url}/api/agent/deployments/current" ⋮---- deployment id = get path r.json , "deployment", "id" ⋮---- def get token - Optional str def read token from settings file - Optional str ⋮---- settings = get state .settings login token = settings.get "api token" ⋮---- def set token token: str - None ⋮---- """ Save api token to settings file """ ⋮---- def is logged in weak - bool ⋮---- token = get… 证据：`cli/src/semgrep/app/auth.py`
- **Keep consistent with config resolver.indent**（source_file）：logger = getLogger name CONFIG FILE PATTERN = re.compile r"^\.semgrepconfig \.yml \.yaml ?$" def indent msg: str - str ⋮---- Keep consistent with config resolver.indent ⋮---- @define class ProjectConfig ⋮---- FILE VERSION = "v1" version: str = field default=FILE VERSION tags: Optional List str = field default=None ⋮---- @tags.validator def check tags self, attribute: Any, value: Optional List str - None ⋮---- @staticmethod def is project config file file path: Path - bool ⋮---- @classmethod def find all config files cls, src directory: Path, cwd path: Path - List Path ⋮---- conf files = stack = {cwd path} temp path = src directory dir route = cwd path.relative to src directory ⋮---- temp pa… 证据：`cli/src/semgrep/app/project_config.py`
- **Deprecated, but used as a fallback in case**（source_file）：logger = getLogger name class ConfigPollTimeout Exception def prepare matches for app matches: list RuleMatch - list RuleMatch ⋮---- sort order = { ⋮---- class ScanHandler ⋮---- state = get state ⋮---- @property def scan id self - Optional int ⋮---- @property def always suppress errors self - bool ⋮---- """ Separate property for easy of mocking in test """ ⋮---- @property def deployment id self - Optional int ⋮---- @property def deployment name self - Optional str ⋮---- @property def autofix self - bool ⋮---- @property def deepsemgrep self - bool ⋮---- @property def resolve all deps in diff scan self - bool ⋮---- """ Normally, diff scans will resolve only the dependencies that are relevant… 证据：`cli/src/semgrep/app/scans.py`
- **Session**（source_file）：@define class UserAgent ⋮---- name: str = field default=f"Semgrep", init=False version: str = field default= VERSION , init=False tags: Set str = field init=False ⋮---- @tags.default def get default tags self - Set str ⋮---- result = set ⋮---- remote url = subprocess.check output sha = subprocess.check output ⋮---- def str self - str ⋮---- result = f"{self.name}/{self.version}" ⋮---- clean note = note.strip " " sometimes the env var has parens already ⋮---- """ If the provided SSLError wraps a SSL hostname mismatch exception, re-create the SSLError with a more descriptive error message. """ inner err: Optional Exception = None ⋮---- inner err = err.args 0 ⋮---- inner err = inner err.reason… 证据：`cli/src/semgrep/app/session.py`
- **If we know on the CLI-side that banner is marked as conditional,**（source_file）：logger = getLogger name ValidIdentifers = Literal "upgrade", "too many findings" CONDITIONAL IDENTIFIERS: Set ValidIdentifers = {"too many findings"} IDENTIFIER LOOKUP: Dict ValidIdentifers, str = { TOO MANY FINDINGS THRESHOLD = 25 ⋮---- @dataclass class VersionInfo ⋮---- current: Version api response: JsonObject def fetch latest version - Optional JsonObject ⋮---- state = get state ⋮---- resp = state.app session.get ⋮---- res = resp.json ⋮---- def get version from cache version cache path: Path - Optional JsonObject ⋮---- now = time.time ⋮---- timestamp str = f.readline .strip latest version str = f.readline .strip ⋮---- timestamp = int timestamp str ⋮---- one day = 86400 ⋮---- res = json.… 证据：`cli/src/semgrep/app/version.py`
- **Init**（source_file）：class OptionGroup class RequiredAnyOptionGroup OptionGroup class MutuallyExclusiveOptionGroup OptionGroup class RequiredMutuallyExclusiveOptionGroup OptionGroup 证据：`cli/stubs/click_option_group/__init__.py`
- **Changelog**（documentation）：1.166.0 https://github.com/semgrep/semgrep/releases/tag/v1.166.0 - 2026-06-11 证据：`CHANGELOG.md`
- **Contributor Covenant Code of Conduct**（documentation）：Contributor Covenant Code of Conduct 证据：`CODE_OF_CONDUCT.md`
- **Security Policy**（documentation）：This project is under active development and we do our best to support the latest versions. 证据：`SECURITY.md`
- **Test Version**（source_file）：@pytest.mark.kinda slow def test version ⋮---- cmd = mk semgrep base command "--version", "--disable-version-check" result = subprocess.check output 证据：`cli/tests/default/e2e/test_version.py`
- **Test App Session**（source_file）：@pytest.mark.slow @pytest.mark.osemfail def test app session sending auth header monkeypatch, mocker ⋮---- def fake send self, request, kwargs ⋮---- res = Response ⋮---- app session = AppSession ⋮---- sample first party urls = sample third party urls = ⋮---- semgrep url headers = app session.get first party url .headers ⋮---- bad url headers = app session.get third party url .headers 证据：`cli/tests/default/unit/test_app_session.py`
- **Test Golang Version**（source_file）：def test golang version comparison versions: Tuple str, str , results: bool ⋮---- def test parse golang core core: str, core components: Tuple int, int, int ⋮---- parsed core = GolangVersionCore major=major, minor=minor, patch=patch ⋮---- @pytest.mark.quick def test parse pseudo datetime ⋮---- raw timestamp = "20220225172249" parsed timestamp = parse golang pseudo datetime raw timestamp ⋮---- parsed golang core = GolangVersionCore major=major, minor=minor, patch=patch parsed golang pseudo = None parsed golang pre release = None ⋮---- parsed golang pseudo = GolangPseudoVersion ⋮---- parsed golang pre release = GolangPreReleaseVersion parsed golang version = ParsedGolangVersion ⋮---- parsed v… 证据：`cli/tests/default/unit/test_golang_version.py`
- **Test Project Config**（source_file）：CONFIG TAGS = "tags:\n- tag1\n- tag key:tag val\n" CONFIG TAGS MONOREPO 1 = "tags:\n- tag1\n- service:service-1\n" CONFIG TAGS MONOREPO 2 = "tags:\n- tag1\n- service:service-2\n" def create mock dir git tmp path, files: Sequence str - None ⋮---- out file = git tmp path / f ⋮---- @pytest.mark.quick def test projectconfig find all config files basic git tmp path ⋮---- dir files = "test.py", "main.py", "setup.py" ⋮---- config files = ProjectConfig. find all config files git tmp path, git tmp path ⋮---- @pytest.mark.quick def test projectconfig find all config files monorepo git tmp path ⋮---- dir files = ⋮---- service 1 dir = git tmp path / "service1" service 2 dir = git tmp path / "service2"… 证据：`cli/tests/default/unit/test_project_config.py`
- **Test Version**（source_file）：@pytest.mark.quick def test version check caching tmp path, mocker, monkeypatch ⋮---- tmp cache path = tmp path / "semgrep version" ⋮---- fetch mock = mocker.patch.object 证据：`cli/tests/default/unit/test_version.py`
- **Semgrep metrics**（documentation）：Semgrep CLI may collect aggregate metrics to help improve the product. This document describes: 证据：`metrics.md`
- **1.166.0 https://github.com/semgrep/semgrep/releases/tag/v1.166.0 - 2026-06-11**（documentation）：1.166.0 https://github.com/semgrep/semgrep/releases/tag/v1.166.0 - 2026-06-11 证据：`release_changes.md`
- **osemgrep to-do list and notes**（documentation）：The goal of this file is to track progress and share ideas about the migration of the Python CLI wrapper to OCaml, known temporarily as osemgrep. 证据：`src/osemgrep/TODO.md`
- **Depot**（structured_config）：{"id":"fhmxj6w9z8"} 证据：`depot.json`
- **Cheatsheet**（structured_config）：{ "TEMPLATE": { "Deep Recursive Matching": { "Deep Expression Operator": { "code": null, "code path": "POLYGLOT/deep expr operator.TEMPLATE", "highlights": , "pattern": "foo ;\n", "pattern path": "POLYGLOT/deep expr operator.sgrep" } , "Expression and Statement": { "code": null, "code path": "POLYGLOT/deep exprstmt.TEMPLATE", "highlights": , "pattern": "foo ;\nbar ;\n", "pattern path": "POLYGLOT/deep exprstmt.sgrep" } }, "Exact Matches": { "Single Statements": { "code": null, "code path": "POLYGLOT/concrete syntax.TEMPLATE", "highlights": , "pattern": "foo 1, 2 ", "pattern path": "POLYGLOT/concrete syntax.sgrep" } }, "Helpful Features": { "Constant Propagation": { "code": null, "code path":… 证据：`scripts/cheatsheet.json`
- **Lang**（structured_config）：{ "id": "apex", "name": "Apex", "keys": "apex" , "maturity": "develop", "exts": ".cls" , "example ext": null, "excluded exts": , "reverse exts": null, "shebangs": , "is target language": true, "tags": "is proprietary" }, { "id": "bash", "name": "Bash", "keys": "bash", "sh" , "maturity": "alpha", "exts": ".bash", ".sh" , "example ext": ".sh", "excluded exts": , "reverse exts": null, "shebangs": "bash", "sh" , "is target language": true, "tags": }, { "id": "c", "name": "C", "keys": "c" , "maturity": "alpha", "exts": ".c", ".h" , "example ext": null, "excluded exts": , "reverse exts": null, "shebangs": , "is target language": true, "tags": }, { "id": "cairo", "name": "Cairo", "keys": "cairo" ,… 证据：`cli/src/semgrep/semgrep_interfaces/lang.json`
- **Ci Small Repos Baseline**（structured_config）：{ "name": "semgrep.bench.zulip", "findings": { "errors": , "results": { "check id": "OSS.perf.bench.rules cache.zulip.percent-formatting", "end": { "col": 66, "line": 141, "offset": 4355 }, "extra": " ", "path": " /OSS/perf/bench/zulip/input/zulip/tools/setup/emoji/import emoji names from csv", "start": { "col": 18, "line": 141, "offset": 4307 } }, { "check id": "OSS.perf.bench.rules cache.zulip.percent-formatting", "end": { "col": 59, "line": 134, "offset": 4130 }, "extra": " ", "path": " /OSS/perf/bench/zulip/input/zulip/tools/setup/emoji/import emoji names from csv", "start": { "col": 27, "line": 134, "offset": 4098 } }, { "check id": "OSS.perf.bench.rules cache.zulip.percent-formatting"… 证据：`perf/snapshots/ci_small_repos_baseline.json`
- **- - sh - -**（source_file）：- - sh - - gitignore-like file for Codemap see https://github.com/aryx/codemap 证据：`.codemapignore`
- **coupling: if you modify this file from the pro repo, you'll have**（source_file）：.git/ coupling: if you modify this file from the pro repo, you'll have to also update .dockerignore 证据：`.dockerignore`
- **This file is used by direnv, a tool to activate hooks when entering a directory**（source_file）：This file is used by direnv, a tool to activate hooks when entering a directory see https://direnv.net/ for more info . 证据：`.envrc`
- **This causes the changelog to become incorrect with virtually**（source_file）：This causes the changelog to become incorrect with virtually every release PR that is merged. Unfortunately union-merges are quite dumb. Perhaps it's better to deal with the conflicts manually but do it well. Prevent frequent conflict resolution in the changelog by asking git to always take both sides of a branch in the changelog. As a downside, two edits to an existing line in the changelog will show up as two lines in the merged output. We should remove these duplicates at release time. CHANGELOG.md merge=union 证据：`.gitattributes`

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

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

- **项目概览**：importance `high`
  - source_paths: README.md, cli/pyproject.toml, cli/src/semgrep/mcp/README.md, cli/src/semgrep/semgrep_interfaces/README.md, languages/regexp/README.md
- **Lib 模块**：importance `high`
  - source_paths: src/spacegrep/src/lib/Comment.ml, src/spacegrep/src/lib/Comment.mli, src/spacegrep/src/lib/Doc_AST.ml, src/spacegrep/src/lib/Dump_match.ml, src/spacegrep/src/lib/Dump_match.mli
- **Lib 模块**：importance `high`
  - source_paths: libs/python-str-repr/lib/dune, libs/python-str-repr/lib/python_str_repr.ml, libs/python-str-repr/lib/python_str_repr.mli
- **Src 模块**：importance `high`
  - source_paths: src/spacegrep/src/bin/Space_main.ml, src/spacegrep/src/bin/Spacecat_main.ml, src/spacegrep/src/bin/Spacegrep_main.ml, src/spacegrep/src/bin/dune, src/spacegrep/src/lib/Comment.ml
- **Server 模块**：importance `medium`
  - source_paths: src/lsp_legacy/server/Legacy_ls_metrics.ml, src/lsp_legacy/server/Legacy_ls_metrics.mli, src/lsp_legacy/server/Legacy_lsp_.ml, src/lsp_legacy/server/Legacy_lsp_.mli, src/lsp_legacy/server/Legacy_rpc_server.ml
- **App 模块**：importance `medium`
  - source_paths: cli/src/semgrep/app/__init__.py, cli/src/semgrep/app/auth.py, cli/src/semgrep/app/project_config.py, cli/src/semgrep/app/scans.py, cli/src/semgrep/app/session.py
- **Cli 模块**：importance `medium`
  - source_paths: src/osemgrep/cli/CLI.ml, src/osemgrep/cli/CLI.mli, src/osemgrep/cli/Help.ml, src/osemgrep/cli/Help.mli, src/osemgrep/cli/dune

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `4e0501d758e51213ecf279e224d498fc71cb5b2c`
- inspected_files: `Dockerfile`, `README.md`, `src/aliengrep/README.md`, `src/osemgrep/README.md`, `src/osemgrep/TODO.md`, `src/spacegrep/README.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: 来源证据：wrong GLIBC dependency

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：wrong GLIBC dependency
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/semgrep/semgrep/issues/11760 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：Please make the pyjwt depdency looser

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Please make the pyjwt depdency looser
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | https://github.com/semgrep/semgrep/issues/11738 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

### Constraint 4: 来源证据：i got this issue when i tried to singup through email id

- Trigger: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：i got this issue when i tried to singup through email id
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/semgrep/semgrep/issues/11759 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

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

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

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

### Constraint 8: 来源证据：PartialParsing on PHP readonly-promoted constructor parameter (typed promoted property)

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：PartialParsing on PHP readonly-promoted constructor parameter (typed promoted property)
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/semgrep/semgrep/issues/11740 | 来源讨论提到 docker 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：Remove EOL PCRE 8.4 for security compliance

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Remove EOL PCRE 8.4 for security compliance
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/semgrep/semgrep/issues/11757 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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