# localhold - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 localhold 编译的 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

## 怎么开始

- `git clone https://github.com/gearboxlogic/localhold.git` 证据：`README.md` Claim：`clm_0003` supported 0.86
- `claude mcp add --scope user localhold /absolute/path/to/hold` 证据：`README.md` Claim：`clm_0004` supported 0.86

## 继续前判断卡

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

### 30 秒判断

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

### 现在可以相信

- **适合人群线索：正在使用 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

### 现在还不能相信

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

### 继续会触碰什么

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

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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

## 角色 / Skill 索引

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

- **What It Provides**（project_doc）：! CI https://github.com/gearboxlogic/localhold/actions/workflows/ci.yml/badge.svg?branch=main https://github.com/gearboxlogic/localhold/actions/workflows/ci.yml ! CodeRabbit Pull Request Reviews https://img.shields.io/coderabbit/prs/github/gearboxlogic/localhold?utm source=oss&utm medium=github&utm campaign=gearboxlogic%2Flocalhold&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Revi… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Plan of the Hold — parametric sources**（project_doc）：Plan of the Hold — parametric sources 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/brand/explorations/README.md`
- **Icon set**（project_doc）：Pictograms for docs and UI, drawn in the marks' language. Twelve glyphs mapping to LocalHold's own vocabulary: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/brand/icons/README.md`
- **Dependency Source Exposure Policy**（project_doc）：This directory contains the machine-readable policy and native evidence used by just dependency-unsafe . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`policy/dependency-unsafe/README.md`
- **Contributor Agent Guidelines**（project_doc）：These rules apply to automated coding agents working in LocalHold. Keep changes small, reviewable, and grounded in the current repository. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`AGENTS.md`
- **Agent API**（project_doc）：LocalHold is the default agent-facing MCP surface. It keeps the first-use workflow small while leaving maintenance and repair operations under explicit admin tools. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/agent-api.md`
- **Contributing**（project_doc）：LocalHold accepts contributions under the Apache License 2.0. By intentionally submitting a contribution for inclusion, you agree that it may be distributed under that license. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **Architecture**（project_doc）：LocalHold is a standalone Rust MCP server for long-term agent memory. It stores memories through a backend-neutral MemoryStore : SQLite with sqlite-vec by default, or PostgreSQL with pgvector when configured. It exposes the whole surface as MCP tools over stdio or HTTP. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/architecture.md`
- **Browse The Hold**（project_doc）：hold ui opens an interactive terminal browser over the configured store. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/browse.md`
- **Compatibility Policy**（project_doc）：LocalHold follows Semantic Versioning. The public version stream begins at 0.1.0-beta.1 ; the 0.x series is for compatibility and installation rehearsal before the first stable release. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/compatibility.md`
- **Embedding Providers**（project_doc）：LocalHold uses one OpenAI-compatible HTTP contract for local and cloud embeddings. It does not start or manage the model service. Memory content is sent to the selected endpoint when memories are indexed, and search queries are sent when semantic retrieval runs. The security, privacy, and threat model security-and-privacy.md describes the provider boundary, stored vectors, error logging, and fully local alternative. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/embedding-providers.md`
- **Real-GPU Reranker Release Gate**（project_doc）：CUDA artifacts must not be published from compilation evidence alone. The release gate runs the packaged hold binary on a protected Linux NVIDIA runner and records real inference, ranking parity, performance, and resource evidence. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/gpu-release-gate.md`
- **Installation**（project_doc）：LocalHold is not published to crates.io. GitHub releases provide CPU binary archives for Linux x86 64 and Windows x86 64 plus a self-contained CUDA 12 reranker archive for Linux x86 64. Building a locked checkout remains available for other prefixes and custom CUDA installations. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/installation.md`
- **Operations**（project_doc）：This guide covers configuration, privacy boundaries, backup, and recovery for operators running LocalHold from a release archive or source. Managed service definitions are not available during the early beta. Read the security, privacy, and threat model security-and-privacy.md before exposing a transport, selecting network storage, or sending content to external compute. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/operations.md`
- **Releasing**（project_doc）：LocalHold releases are built from reviewed commits on main . Git tags trigger the release workflow; maintainers do not upload locally built binaries. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/releasing.md`
- **Security, Privacy, And Threat Model**（project_doc）：Security, Privacy, And Threat Model 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/security-and-privacy.md`
- **Changelog**（project_doc）：All notable changes to LocalHold will be documented in this file. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CHANGELOG.md`
- **Code of Conduct**（project_doc）：LocalHold's community spaces are for focused, respectful technical collaboration. Participants must communicate professionally, assume good faith while still addressing concrete problems directly, and respect differences in experience, identity, and perspective. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CODE_OF_CONDUCT.md`
- **Security Policy**（project_doc）：LocalHold is pre-1.0. Security fixes are provided for the latest published beta or release-candidate version. Older prereleases may require an upgrade. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`SECURITY.md`
- **Support**（project_doc）：Use GitHub Issues https://github.com/gearboxlogic/localhold/issues for bug reports, installation problems, and focused feature requests. Include the LocalHold version, operating system, storage backend, transport, relevant configuration with secrets removed, and reproducible logs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`SUPPORT.md`
- **Third-Party Notices**（project_doc）：LocalHold depends on third-party Rust crates listed in Cargo.lock . Their licenses remain their own and can be inspected with: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`THIRD_PARTY_NOTICES.md`
- **Trademarks**（project_doc）：LocalHold is an open-source project from Gearbox Logic LLC. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`TRADEMARKS.md`
- **LocalHold brand**（project_doc）：Searchable context that stays yours. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/brand/BRAND.md`
- **CLI output design**（project_doc）：The terminal is LocalHold's primary surface. hold output follows the brand the same way a web page would: tinctures, calm keeping, battlements used sparingly. Run assets/brand/cli-preview.sh in a terminal to see everything below. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/brand/cli.md`
- **Diagram language**（project_doc）：Rules for architecture and flow diagrams in docs, so every diagram reads as one system. Example: diagram-example.svg . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`assets/brand/diagrams.md`

## 证据索引

- 共索引 80 条证据。

- **What It Provides**（documentation）：! CI https://github.com/gearboxlogic/localhold/actions/workflows/ci.yml/badge.svg?branch=main https://github.com/gearboxlogic/localhold/actions/workflows/ci.yml ! CodeRabbit Pull Request Reviews https://img.shields.io/coderabbit/prs/github/gearboxlogic/localhold?utm source=oss&utm medium=github&utm campaign=gearboxlogic%2Flocalhold&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews https://coderabbit.ai ! Release https://img.shields.io/github/v/release/gearboxlogic/localhold?color=C89B3C&label=release https://github.com/gearboxlogic/localhold/releases/latest ! License https://img.shields.io/badge/license-Apache--2.0-1F3A5F LICENSE 证据：`README.md`
- **Plan of the Hold — parametric sources**（documentation）：Plan of the Hold — parametric sources 证据：`assets/brand/explorations/README.md`
- **Icon set**（documentation）：Pictograms for docs and UI, drawn in the marks' language. Twelve glyphs mapping to LocalHold's own vocabulary: 证据：`assets/brand/icons/README.md`
- **Dependency Source Exposure Policy**（documentation）：This directory contains the machine-readable policy and native evidence used by just dependency-unsafe . 证据：`policy/dependency-unsafe/README.md`
- **Contributor Agent Guidelines**（documentation）：These rules apply to automated coding agents working in LocalHold. Keep changes small, reviewable, and grounded in the current repository. 证据：`AGENTS.md`
- **Agent API**（documentation）：LocalHold is the default agent-facing MCP surface. It keeps the first-use workflow small while leaving maintenance and repair operations under explicit admin tools. 证据：`docs/agent-api.md`
- **Contributing**（documentation）：LocalHold accepts contributions under the Apache License 2.0. By intentionally submitting a contribution for inclusion, you agree that it may be distributed under that license. 证据：`CONTRIBUTING.md`
- **License**（source_file）：Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ 证据：`LICENSE`
- **Architecture**（documentation）：LocalHold is a standalone Rust MCP server for long-term agent memory. It stores memories through a backend-neutral MemoryStore : SQLite with sqlite-vec by default, or PostgreSQL with pgvector when configured. It exposes the whole surface as MCP tools over stdio or HTTP. 证据：`docs/architecture.md`
- **Browse The Hold**（documentation）：hold ui opens an interactive terminal browser over the configured store. 证据：`docs/browse.md`
- **Compatibility Policy**（documentation）：LocalHold follows Semantic Versioning. The public version stream begins at 0.1.0-beta.1 ; the 0.x series is for compatibility and installation rehearsal before the first stable release. 证据：`docs/compatibility.md`
- **Embedding Providers**（documentation）：LocalHold uses one OpenAI-compatible HTTP contract for local and cloud embeddings. It does not start or manage the model service. Memory content is sent to the selected endpoint when memories are indexed, and search queries are sent when semantic retrieval runs. The security, privacy, and threat model security-and-privacy.md describes the provider boundary, stored vectors, error logging, and fully local alternative. 证据：`docs/embedding-providers.md`
- **Real-GPU Reranker Release Gate**（documentation）：CUDA artifacts must not be published from compilation evidence alone. The release gate runs the packaged hold binary on a protected Linux NVIDIA runner and records real inference, ranking parity, performance, and resource evidence. 证据：`docs/gpu-release-gate.md`
- **Installation**（documentation）：LocalHold is not published to crates.io. GitHub releases provide CPU binary archives for Linux x86 64 and Windows x86 64 plus a self-contained CUDA 12 reranker archive for Linux x86 64. Building a locked checkout remains available for other prefixes and custom CUDA installations. 证据：`docs/installation.md`
- **Operations**（documentation）：This guide covers configuration, privacy boundaries, backup, and recovery for operators running LocalHold from a release archive or source. Managed service definitions are not available during the early beta. Read the security, privacy, and threat model security-and-privacy.md before exposing a transport, selecting network storage, or sending content to external compute. 证据：`docs/operations.md`
- **Releasing**（documentation）：LocalHold releases are built from reviewed commits on main . Git tags trigger the release workflow; maintainers do not upload locally built binaries. 证据：`docs/releasing.md`
- **Security, Privacy, And Threat Model**（documentation）：Security, Privacy, And Threat Model 证据：`docs/security-and-privacy.md`
- **MCP server — official Rust SDK**（source_file）：package name = "localhold" version = "0.2.0" edition = "2024" rust-version = "1.97" description = "Local context infrastructure for AI agents" repository = "https://github.com/gearboxlogic/localhold" readme = "README.md" license = "Apache-2.0" publish = false 证据：`Cargo.toml`
- **cfg any test, feature = "testing"**（source_file）：use std::sync::Arc; ⋮---- use tracing::warn; ⋮---- pub crate struct SearchOutcome { ⋮---- impl SearchOutcome { ⋮---- fn single path results: Vec , search mode: SearchMode - Self { ⋮---- pub crate struct FusionMetadata { ⋮---- struct CandidatePoolLimits { ⋮---- enum HybridPathCandidates { ⋮---- fn hybrid path candidates strict: bool, semantic: Vec , keyword: Vec - HybridPathCandidates { ⋮---- match semantic.is empty , keyword.is empty { ⋮---- pub crate struct SearchRequest { ⋮---- pub enum ReembedRequest { ⋮---- pub crate struct StoreMemoryInput { ⋮---- pub crate struct BulkUpdateFields { ⋮---- pub crate struct BulkDeleteResult { ⋮---- pub crate struct BulkUpdateResult { ⋮---- pub struct Loc… 证据：`src/engine.rs`
- **Lib**（source_file）：pub crate mod background tasks; pub mod clock; pub mod config; pub crate mod consolidation; pub mod context; pub mod doctor; pub mod embedding; pub mod engine; pub mod error; pub crate mod fusion; pub crate mod http auth; pub mod http transport; pub crate mod ordering; pub mod reranker; pub crate mod scoring; pub mod server; pub mod store; pub mod types; pub mod ui; pub crate mod validation; 证据：`src/lib.rs`
- **Main**（source_file）：use tokio::sync::Notify; ⋮---- type AppResult = Result ; type CliExitResult = Result ; ⋮---- async fn main - AppResult { if let Some result = try run info cli { ⋮---- if let Some result = try run config cli { return finish cli result ; ⋮---- if let Some result = try run models cli .await { ⋮---- if let Some result = try run reranker cli .await { ⋮---- if let Some result = try run doctor cli .await { ⋮---- if let Some result = try run backup restore cli .await { ⋮---- if let Some result = try run migration cli .await { ⋮---- write migration cli error & error ; ⋮---- return Ok ; ⋮---- if let Some result = try run embeddings cli .await { ⋮---- if let Some result = try run ui cli .await { ⋮----… 证据：`src/main.rs`
- **Mod**（source_file）：pub crate mod seeder; 证据：`benches/common/mod.rs`
- **derive Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize**（source_file）：use super::apply parsed env; ⋮---- pub enum OpenAiAuthMode { ⋮---- fn fmt &self, f: &mut fmt::Formatter - fmt::Result { ⋮---- Self::Bearer = f.write str "bearer" , Self::ApiKey = f.write str "api key" , ⋮---- impl FromStr for OpenAiAuthMode { type Err = ParseEnumError; ⋮---- fn from str value: &str - Result { ⋮---- "bearer" = Ok Self::Bearer , "api key" = Ok Self::ApiKey , other = Err ParseEnumError format! "unknown OpenAI-compatible auth mode {other:?}, expected \"bearer\" or \"api key\"" , ⋮---- /// Startup and recovery health-check behavior for an embedding endpoint. derive Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize ⋮---- pub enum EmbeddingHealthCheck { /// Requir… 证据：`src/config/embedding.rs`
- **derive Debug, Clone, Serialize**（source_file）：use serde::Serialize; ⋮---- use crate::error::EngineError; ⋮---- pub fn load effective strict - Result { ⋮---- /// Secret-free report of the platform configuration search policy. derive Debug, Clone, Serialize ⋮---- pub struct ConfigPathsReport { /// Report contract version. pub schema version: u32, /// Canonical path used by config init , when the platform exposes one. pub canonical path: Option , /// First existing configuration file in search order, if any. pub active path: Option , /// Paths searched in precedence order. pub searched paths: Vec , ⋮---- impl ConfigPathsReport { /// Discover configuration paths for the current platform user. must use pub fn discover - Self { let config di… 证据：`src/config/operator.rs`
- **expect clippy::type complexity, reason = "BoxFuture IS the simplified alias; clippy counts the expansion"**（source_file）：pub crate mod batch; ⋮---- pub mod factory; ⋮---- pub crate mod limited; ⋮---- pub mod noop; ⋮---- pub mod openai; ⋮---- pub crate mod orchestrator; ⋮---- pub mod resilient; ⋮---- pub crate mod retry; ⋮---- pub mod status; ⋮---- pub use noop::NoopEmbedding; pub use openai::OpenAiEmbedding; pub use resilient::ResilientEmbedding; ⋮---- use crate::error::EmbeddingError; ⋮---- pub type BoxFuture = Pin + Send + 'a ; ⋮---- pub trait EmbeddingProvider: Send + Sync { ⋮---- /// Generate embedding vectors for multiple texts in a single call. /// ⋮---- /// /// The default implementation calls embed Self::embed sequentially. ⋮---- /// The default implementation calls embed Self::embed sequentially. ///… 证据：`src/embedding/mod.rs`
- **Openai**（source_file）：pub struct OpenAiEmbedding { ⋮---- fn fmt &self, f: &mut std::fmt::Formatter - std::fmt::Result { f.debug struct "OpenAiEmbedding" .field "base url", &self.base url .field "model", &self.model .field "dimensions", &self.dimensions .finish non exhaustive ⋮---- struct EmbeddingRequest { ⋮---- struct EmbeddingResponse { ⋮---- struct EmbeddingData { ⋮---- struct ModelsResponse { ⋮---- struct ModelData { ⋮---- fn normalize l2 embedding: &mut f32 - Result { let norm = embedding.iter .copied .map x x x .sum:: .sqrt ; if norm.is nan norm.is infinite { return Err EmbeddingError::Permanent "embedding contains NaN or Inf values".into ; ⋮---- return Err EmbeddingError::Permanent "cannot normalize zero… 证据：`src/embedding/openai.rs`
- **Mod**（source_file）：mod batch; ⋮---- use parking lot::Mutex; ⋮---- type EmbedKey = MemoryId, i64 ; ⋮---- pub crate struct EmbeddingOrchestrator { ⋮---- /// Coalesces duplicate in-process attempts to embed the same memory revision. inflight embeds: Arc , /// Tracks durable claims owned by currently running embed tasks so shutdown /// timeout can clear leases before aborting those tasks. ⋮---- /// timeout can clear leases before aborting those tasks. active claimed embeds: Arc , ⋮---- struct ActiveEmbedClaim { ⋮---- struct InFlightEmbed { ⋮---- struct ActiveEmbedClaimGuard { ⋮---- struct EmbedWork { ⋮---- impl Drop for InFlightEmbed { fn drop &mut self { let removed = self.inflight embeds.lock .remove &self.key… 证据：`src/embedding/orchestrator/mod.rs`
- **Mod**（source_file）：pub mod onnx; ⋮---- pub mod resilient; ⋮---- pub mod runtime; ⋮---- pub mod gate; ⋮---- pub mod operator; ⋮---- pub mod policy; ⋮---- mod download; ⋮---- pub type BoxFuture = Pin + Send + 'a ; ⋮---- pub struct RerankerScore { ⋮---- impl RerankerScore { ⋮---- pub const fn new index: usize, score: f64 - Self { ⋮---- pub enum RerankerError { ⋮---- pub trait RerankerProvider: Send + Sync { ⋮---- fn selected execution provider &self - Option { ⋮---- fn active execution provider &self - Option { self.selected execution provider 证据：`src/reranker/mod.rs`
- **Operator**（source_file）：use serde::Serialize; ⋮---- use crate::config::RerankerConfig; ⋮---- struct ReportOptions { ⋮---- pub struct ModelArtifactReport { ⋮---- pub struct ModelsReport { ⋮---- impl ModelsReport { ⋮---- pub fn confirmation refused - Self { ⋮---- command: "fetch".into , model: "not loaded".into , revision: "not loaded".into , artifact: "not loaded".into , precision: "not loaded".into , source: "not loaded".into , ⋮---- status: "refused".into , ⋮---- summary: "refusing network-capable model fetch without explicit --yes confirmation".into , ⋮---- pub fn invalid configuration command: &str, network allowed: bool - Self { ⋮---- command: command.into , ⋮---- status: "error".into , ⋮---- summary: "effecti… 证据：`src/reranker/operator.rs`
- **cfg any test, feature = "testing"**（source_file）：pub mod params; ⋮---- use axum::http::request::Parts; ⋮---- struct MemoryView { ⋮---- struct PreparedRemember { ⋮---- enum PrepareRememberError { ⋮---- impl PrepareRememberError { const fn invalid error: crate::error::ValidationError, suggested fix: &'static str - Self { ⋮---- fn into tool result self, item index: Option - Result { ⋮---- let field = item index.map or else error.field.clone , index format! "memories {index} .{}", error.field ; Ok tool error ToolErrorCode::InvalidParams, Some &field , error.to string , Some suggested fix , false ⋮---- Self::Engine error = Err error.into , Self::Tool result = Ok result , ⋮---- enum AdminFilterError { ⋮---- fn from error: EngineError - Self { ⋮… 证据：`src/server/mod.rs`
- **derive Debug, Clone, Deserialize, JsonSchema**（source_file）：use schemars::JsonSchema; ⋮---- const fn default recall limit - usize { ⋮---- const fn default list limit - Option { Some 20 ⋮---- const fn default top tags limit - usize { ⋮---- const fn default expand scopes - Option { Some true ⋮---- fn merge schema into prop: &mut serde json::Map , source: serde json::Value { ⋮---- let = prop.entry &k .or insert v ; ⋮---- fn strip nullable schema: &mut schemars::Schema { let Some obj = schema.as object mut else { ⋮---- let Some serde json::Value::Object properties = obj.get mut "properties" else { ⋮---- for prop value in properties.values mut { let Some prop = prop value.as object mut else { ⋮---- if let Some serde json::Value::Array types = prop.get mu… 证据：`src/server/params.rs`
- **Backup**（source_file）：use std::fs::File; ⋮---- use serde::Serialize; ⋮---- pub struct BackupOptions { ⋮---- impl BackupOptions { ⋮---- pub fn new database path: PathBuf, destination: PathBuf - Self { ⋮---- pub fn with clock mut self, clock: Arc - Self { ⋮---- pub struct RestoreOptions { ⋮---- impl RestoreOptions { ⋮---- pub fn new database path: PathBuf, backup path: PathBuf, embedding dimensions: usize, expected profile: Option - Self { ⋮---- pub const fn dry run mut self, dry run: bool - Self { ⋮---- pub const fn confirmed mut self, confirmed: bool - Self { ⋮---- pub struct MaintenanceReport { ⋮---- /// Stable outcome category. pub status: &'static str, ⋮---- impl MaintenanceReport { ⋮---- pub fn configuration… 证据：`src/store/backup.rs`
- **Mod**（source_file）：mod admin; pub mod backup; ⋮---- pub crate mod conformance; mod context store; pub crate mod crud; pub mod migration; mod postgres; pub crate mod postgres migrations; mod query; mod schema; mod search; mod sqlite; mod sqlite lease; pub crate mod vector; ⋮---- pub use postgres::PostgresStore; pub crate use postgres::validate published v2 metadata upgrade; ⋮---- pub use sqlite::SqliteStore; pub crate use sqlite::sqlite write tx; ⋮---- pub type MemoryContextMap = HashMap ; ⋮---- pub type MemoryContextPresence = HashSet ; ⋮---- pub type MemoryMap = HashMap ; ⋮---- pub trait ContextReader: Send + Sync { ⋮---- pub trait ContextWriter: Send + Sync { ⋮---- pub trait ContextStore: ContextReader + Co… 证据：`src/store/mod.rs`
- **Postgres Migrations**（source_file）：use std::collections::HashSet; ⋮---- use sqlx postgres::PgPool; ⋮---- use crate::error::StoreError; ⋮---- pub crate struct MigrationIdentity { ⋮---- impl MigrationIdentity { pub crate const fn version self - i64 { ⋮---- pub crate const fn name self - &'static str { ⋮---- pub crate const CURRENT SCHEMA VERSION: i64 = MIGRATIONS MIGRATIONS.len - 1 .version; ⋮---- pub crate enum MigrationMetadataState { ⋮---- pub crate async fn read migration metadata state pool: &PgPool - Result { let table exists: bool = query scalar "SELECT to regclass format '%I.%I', current schema , 'localhold migrations' IS NOT NULL" .fetch one pool ⋮---- return Ok MigrationMetadataState::Absent ; ⋮---- let rows = query… 证据：`src/store/postgres_migrations.rs`
- **derive Clone, Debug**（source_file）：use sqlite vec::sqlite3 vec init; ⋮---- fn migration failed step: &'static str, source: impl Into - StoreError { StoreError::MigrationFailed { step, source: source.into } ⋮---- fn run migration step step: &'static str, result: Result - Result ⋮---- result.map err error migration failed step, error ⋮---- struct SqliteInner { ⋮---- fn create secure database if missing path: &Path - Result { let path = database identity path .map err error StoreError::Database Box::new error ?; ⋮---- let configured = options.read true .write true .create new true ; ⋮---- let mode = options.mode 0o600 ; ⋮---- match options.open path { ⋮---- drop file ; Ok ⋮---- Err error if error.kind == ErrorKind::AlreadyExist… 证据：`src/store/sqlite.rs`
- **Mod**（source_file）：mod sqlite vec; ⋮---- pub crate use sqlite vec::SqliteVecIndex; ⋮---- use super::EmbeddingMap; ⋮---- pub crate fn validate embedding vector embedding: & f32 , dimensions: usize - Result { if embedding.len != dimensions { return Err StoreError::Conflict format! ⋮---- if let Some idx, value = embedding.iter .enumerate .find , value !value.is finite { return Err StoreError::Conflict format! "embedding contains non-finite value at index {idx}: {value}" ; ⋮---- Ok ⋮---- pub crate struct VectorHit { ⋮---- pub crate struct VectorBatch { ⋮---- pub crate trait VectorIndex : Send + Sync { 证据：`src/store/vector/mod.rs`
- **derive Debug**（source_file）：use serde::Deserialize; ⋮---- pub crate enum Focus { ⋮---- pub crate enum Mode { ⋮---- pub crate enum ContextManagerPane { ⋮---- impl ContextManagerPane { ⋮---- pub crate const fn label self - &'static str { ⋮---- const fn next self, backwards: bool - Self { ⋮---- if index == 0 { Self::ALL.len .saturating sub 1 } else { index.saturating sub 1 } } else if index.saturating add 1 == Self::ALL.len { ⋮---- index.saturating add 1 ⋮---- /// Loaded state for one governed context. derive Debug pub crate struct ContextManager { ⋮---- pub crate struct ContextPolicySnapshot { ⋮---- /// A JSON replacement draft for the active manager pane. derive Debug pub crate struct ContextManagerEdit { ⋮---- impl Co… 证据：`src/ui/app.rs`
- **Mod**（source_file）：mod app; mod editor; mod theme; mod view; ⋮---- use tokio::sync::mpsc; ⋮---- type UiError = Box ; ⋮---- pub struct UiOptions { ⋮---- impl UiOptions { ⋮---- pub const fn new principal: Option - Self { ⋮---- pub async fn run options: UiOptions - Result { ⋮---- let principal = resolve principal &config, options ?; ⋮---- let db path = config.database.sqlite path .to path buf ; let store = SqliteStore::open read only with clock &db path, config.embedding.dimensions , Arc::clone &clock ?; if let Some profile = active embedding profile &config.embedding { store.check embedding profile &profile .await?; ⋮---- let writer config = config.clone ; ⋮---- let config = writer config.clone ; ⋮---- Box::pin… 证据：`src/ui/mod.rs`
- **Cargo**（source_file）：package name = "localhold-dependency-unsafe" version = "0.1.0" edition = "2024" rust-version = "1.97" publish = false 证据：`tools/dependency-unsafe/Cargo.toml`
- **Config**（source_file）：use std::fs; use std::path::Path; ⋮---- pub struct AuditConfig { ⋮---- pub struct PlatformConfig { ⋮---- pub struct GraphConfig { ⋮---- pub enum Classification { ⋮---- struct ClassificationFragment { ⋮---- pub struct ClassificationPolicy { ⋮---- pub struct ClassificationEntry { ⋮---- impl AuditConfig { pub fn load path: &Path - Result { let bytes = fs::read path .with context format! "read audit matrix {}", path.display ?; let config: Self = serde json::from slice &bytes .with context format! "parse audit matrix {}", path.display ?; config.validate ?; Ok config ⋮---- pub fn platform &self, name: &str - Result { ⋮---- .iter .find platform platform.name == name .with context format! "audit pl… 证据：`tools/dependency-unsafe/src/config.rs`
- **Main**（source_file）：mod artifact; mod cargo env; mod cargo graph; mod config; mod report; mod scan; ⋮---- use std::env; use std::fs; ⋮---- use crate::cargo env::CargoEnvironment; ⋮---- enum Command { ⋮---- struct Args { ⋮---- fn main { if let Err error = run { eprintln! "dependency unsafe audit failed: {error: }" ; ⋮---- fn run - Result { let args = parse args env::args .skip 1 ?; let workspace = workspace root ?; let matrix path = workspace.join "policy/dependency-unsafe/matrix.json" ; let classifications path = workspace.join "policy/dependency-unsafe/classifications" ; ⋮---- let platform = matrix.platform &args.platform ?; if matches! args.command, Command::Check Command::Generate && args.platform != curren… 证据：`tools/dependency-unsafe/src/main.rs`
- **Cargo**（source_file）：package name = "localhold-maintainability" version = "0.1.0" edition = "2024" rust-version = "1.97" publish = false build = false 证据：`tools/maintainability/Cargo.toml`
- **Main**（source_file）：mod check; mod expanded; mod manifest; mod scan; mod structure; ⋮---- use std::env; use std::fs; ⋮---- use crate::manifest::UnsafeManifest; ⋮---- enum Command { ⋮---- fn main { if let Err error = run { eprintln! "maintainability check failed: {error: }" ; ⋮---- fn run - Result { let command = parse args env::args .skip 1 ?; let workspace = workspace root ?; ⋮---- let manifest path = workspace.join "policy/maintainability/unsafe.json" ; ⋮---- println! "first-party unsafe safety contract check passed" ; println! "source structure budget check passed" ; ⋮---- println! "{}", serde json::to string pretty &sites ? ; ⋮---- println! "{}", serde json::to string pretty &inventory ? ; ⋮---- Ok ⋮---- f… 证据：`tools/maintainability/src/main.rs`
- **Changelog**（documentation）：All notable changes to LocalHold will be documented in this file. 证据：`CHANGELOG.md`
- **Code of Conduct**（documentation）：LocalHold's community spaces are for focused, respectful technical collaboration. Participants must communicate professionally, assume good faith while still addressing concrete problems directly, and respect differences in experience, identity, and perspective. 证据：`CODE_OF_CONDUCT.md`
- **Security Policy**（documentation）：LocalHold is pre-1.0. Security fixes are provided for the latest published beta or release-candidate version. Older prereleases may require an upgrade. 证据：`SECURITY.md`
- **Support**（documentation）：Use GitHub Issues https://github.com/gearboxlogic/localhold/issues for bug reports, installation problems, and focused feature requests. Include the LocalHold version, operating system, storage backend, transport, relevant configuration with secrets removed, and reproducible logs. 证据：`SUPPORT.md`
- **Third-Party Notices**（documentation）：LocalHold depends on third-party Rust crates listed in Cargo.lock . Their licenses remain their own and can be inspected with: 证据：`THIRD_PARTY_NOTICES.md`
- **Trademarks**（documentation）：LocalHold is an open-source project from Gearbox Logic LLC. 证据：`TRADEMARKS.md`
- **LocalHold brand**（documentation）：Searchable context that stays yours. 证据：`assets/brand/BRAND.md`
- **CLI output design**（documentation）：The terminal is LocalHold's primary surface. hold output follows the brand the same way a web page would: tinctures, calm keeping, battlements used sparingly. Run assets/brand/cli-preview.sh in a terminal to see everything below. 证据：`assets/brand/cli.md`
- **Diagram language**（documentation）：Rules for architecture and flow diagrams in docs, so every diagram reads as one system. Example: diagram-example.svg . 证据：`assets/brand/diagrams.md`
- **Cuda Linux X86 64**（structured_config）：{ "schema version": 1, "artifact": { "name": "localhold-linux-x86 64-cuda12", "os": "linux", "architecture": "x86 64", "target": "x86 64-unknown-linux-gnu-cuda12" }, "compatibility": { "onnx runtime": "1.23.2", "cuda family": "12.x", "cuda components": "12.8", "cudnn family": "9.x bundled 9.8 ", "minimum nvidia driver linux": "570.26", "minimum glibc": "2.35", "provider policy": "CPU is always available; CUDA is selected by auto only after provider registration and health inference, and explicit cuda fails closed. TensorRT is not included." }, "system libraries": "ld-linux-x86-64.so.2", "libc.so.6", "libcuda.so.1", "libdl.so.2", "libgcc s.so.1", "libm.so.6", "libpthread.so.0", "librt.so.1",… 证据：`release/cuda-linux-x86_64.json`
- **Manifest**（structured_config）：{ "schema version": 1, "generator": { "name": "localhold-dependency-unsafe", "version": "1", "cargo": "cargo 1.97.0 c980f4866 2026-06-30 ", "rustc": "rustc 1.97.0 2d8144b78 2026-07-07 " }, "platform": { "name": "linux", "target": "x86 64-unknown-linux-gnu" }, "inputs": { "audit tool lock sha256": "0a6c907727a82c8f98d7a9aeceac54d2f88bd93b2c590f3dd0ca28429c74531a", "audit tool source sha256": "8725dafac5ab6bfdeb87a78a3b828c055f75cf3068f2effbf6cfa8b500bbabe2" }, "source records": 251, "configurations": "linux-default", "linux-all-features-ci", "linux-release-reranker", "linux-release-reranker-cuda" } 证据：`policy/dependency-unsafe/baseline/linux/manifest.json`
- **Manifest**（structured_config）：{ "schema version": 1, "generator": { "name": "localhold-dependency-unsafe", "version": "1", "cargo": "cargo 1.97.0 c980f4866 2026-06-30 ", "rustc": "rustc 1.97.0 2d8144b78 2026-07-07 " }, "platform": { "name": "windows", "target": "x86 64-pc-windows-msvc" }, "inputs": { "audit tool lock sha256": "0a6c907727a82c8f98d7a9aeceac54d2f88bd93b2c590f3dd0ca28429c74531a", "audit tool source sha256": "8725dafac5ab6bfdeb87a78a3b828c055f75cf3068f2effbf6cfa8b500bbabe2" }, "source records": 254, "configurations": "windows-default", "windows-all-features-ci", "windows-release-reranker" } 证据：`policy/dependency-unsafe/baseline/windows/manifest.json`
- **A D**（structured_config）：{ "schema version": 1, "packages": { "crates.io:ahash@0.8.12 5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75": { "classification": "pure-rust-unchecked", "rationale": "The packaged source contains Rust unsafe syntax or assembly and no native, prebuilt, or generated-source signal. This category is descriptive and is not a soundness approval.", "review issue": 124 }, "crates.io:aho-corasick@1.1.4 ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301": { "classification": "pure-rust-unchecked", "rationale": "The packaged source contains Rust unsafe syntax or assembly and no native, prebuilt, or generated-source signal. This category is descriptive and is not a sound… 证据：`policy/dependency-unsafe/classifications/a-d.json`
- **E H**（structured_config）：{ "schema version": 1, "packages": { "crates.io:either@1.16.0 91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e": { "classification": "pure-rust-unchecked", "rationale": "The packaged source contains Rust unsafe syntax or assembly and no native, prebuilt, or generated-source signal. This category is descriptive and is not a soundness approval.", "review issue": 124 }, "crates.io:encode unicode@1.0.0 34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0": { "classification": "pure-rust-unchecked", "rationale": "The packaged source contains Rust unsafe syntax or assembly and no native, prebuilt, or generated-source signal. This category is descriptive and is not a so… 证据：`policy/dependency-unsafe/classifications/e-h.json`
- **I L**（structured_config）：{ "schema version": 1, "packages": { "crates.io:iana-time-zone@0.1.65 e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470": { "classification": "other", "rationale": "The packaged source has mixed native, prebuilt, generated, or Rust unsafe exposure and is conservatively ungrouped pending package-family review. This category is not a soundness approval.", "review issue": 124 }, "crates.io:icu collections@2.2.0 2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c": { "classification": "pure-rust-unchecked", "rationale": "The packaged source contains Rust unsafe syntax or assembly and no native, prebuilt, or generated-source signal. This category is descriptive and is… 证据：`policy/dependency-unsafe/classifications/i-l.json`
- **M P**（structured_config）：{ "schema version": 1, "packages": { "crates.io:macro rules attribute-proc macro@0.2.2 670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30": { "classification": "other", "rationale": "The packaged crate defines a build-script or procedural-macro target without another recorded source-exposure signal. This category is descriptive and is not a soundness approval.", "review issue": 124 }, "crates.io:matchers@0.2.0 d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9": { "classification": "pure-rust-unchecked", "rationale": "The packaged source contains Rust unsafe syntax or assembly and no native, prebuilt, or generated-source signal. This category is descriptive and i… 证据：`policy/dependency-unsafe/classifications/m-p.json`
- **Policy**（structured_config）：{ "schema version": 1, "owner": "LocalHold maintainers", "review triggers": "version-or-checksum-change", "enabled-feature-change", "new-dependency-route", "exposure-signal-change" , "packages": {} } 证据：`policy/dependency-unsafe/classifications/policy.json`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

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

- **LocalHold 系统概述与架构设计**：importance `high`
  - source_paths: README.md, src/lib.rs, src/main.rs, src/engine.rs, src/types.rs
- **MCP 代理 API、嵌入与重排序**：importance `high`
  - source_paths: docs/agent-api.md, src/server/mod.rs, src/server/params.rs, src/embedding/mod.rs, src/embedding/openai.rs
- **存储后端、数据迁移与模式管理**：importance `high`
  - source_paths: src/store/mod.rs, src/store/sqlite.rs, src/store/postgres.rs, src/store/postgres_migrations.rs, src/store/migration.rs
- **配置、终端 UI、运维诊断与可维护性治理**：importance `high`
  - source_paths: src/config/mod.rs, src/config/embedding.rs, src/config/operator.rs, src/doctor.rs, src/ui/mod.rs

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `77af0885525a5e3be81a7631d5d41e1809c6587d`
- inspected_files: `README.md`, `docs/agent-api.md`, `docs/architecture.md`, `docs/browse.md`, `docs/compatibility.md`, `docs/embedding-providers.md`, `docs/gpu-release-gate.md`, `docs/installation.md`, `docs/operations.md`, `docs/releasing.md`, `docs/security-and-privacy.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: 能力证据存在缺口

- Trigger: Sandbox install result is missing.
- Host AI rule: 优先补证或在页面明确标记为未验证。
- Why it matters: 缺口未补前，Doramagic 不能把该能力当作可靠推荐卖点。
- Evidence: evidence.evidence_gaps | https://github.com/gearboxlogic/localhold | Sandbox install result is missing.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：Maintainability recovery program and feature freeze

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Maintainability recovery program and feature freeze
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | https://github.com/gearboxlogic/localhold/issues/123 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：Phase 0: freeze features and establish maintainability safety rails

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Phase 0: freeze features and establish maintainability safety rails
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | https://github.com/gearboxlogic/localhold/issues/124 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 安装命令尚未沙箱验证

- Trigger: 当前 install_status=documented，还只是文档/元数据线索。
- Host AI rule: 在隔离环境执行最小安装路径，记录失败原因和修复步骤。
- Why it matters: 命令可能缺步骤、过期或依赖本地环境，不能直接作为用户承诺。
- Evidence: downstream_validation.install_status | https://github.com/gearboxlogic/localhold | install_status=documented; command=git clone https://github.com/gearboxlogic/localhold.git
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

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

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

### Constraint 7: Quick Start 尚未实际跑通

- Trigger: quickstart_status=not_attempted。
- Host AI rule: 执行最小 repro plan，记录命令、输入样例、输出样例和失败原因。
- Why it matters: 用户只能看到安装线索，不能确信 10 分钟内能形成最小可试路径。
- Evidence: downstream_validation.quickstart_status | https://github.com/gearboxlogic/localhold | quickstart_status=not_attempted; sandbox_quickstart_status=missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

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

### Constraint 10: 存在安全注意事项

- Trigger: No sandbox install has been executed yet; downstream must verify before user use.
- Host AI rule: 转成明确权限清单和安全审查提示。
- Why it matters: 用户安装前需要知道权限边界和敏感操作。
- Evidence: risks.safety_notes | https://github.com/gearboxlogic/localhold | No sandbox install has been executed yet; downstream must verify before user use.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
