# notebooklm-py - Doramagic AI Context Pack

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

## 充分原则

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

## 给宿主 AI 的使用方式

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

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 怎么开始

- `pip install "notebooklm-py[browser]"   # core + Playwright` 证据：`README.md` Claim：`clm_0005` supported 0.86
- `pip install notebooklm-py               # ~10 MB; ship a pre-acquired storage_state.json` 证据：`README.md` Claim：`clm_0006` supported 0.86
- `npx skills add teng-lin/notebooklm-py` 证据：`README.md` Claim：`clm_0007` supported 0.86

## 继续前判断卡

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

### 30 秒判断

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

### 现在可以相信

- **适合人群线索：AI 研究者或研究型 Agent 构建者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0003` supported 0.86
- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0004` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`SKILL.md` Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0005` 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`, `SKILL.md`
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。

### 继续会触碰什么

- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`AGENTS.md`, `CLAUDE.md`, `SKILL.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_0008` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0009` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

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

### 任务路由

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

### 上下文规模

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

### 证据不足时的处理

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

## Prompt Recipes

### 适配判断

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

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

### 安装前体验

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

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

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


## 角色 / Skill 索引

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

- **Architecture Decision Records**（project_doc）：This directory holds the canonical decisions that shape the notebooklm-py codebase. Each record explains why a load-bearing pattern exists so that future contributors don't re-litigate or silently re-introduce the trade-off. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/README.md`
- **Repository Guidelines**（project_doc）：Status: Active Last Updated: 2026-05-09 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`AGENTS.md`
- **CLAUDE.md**（project_doc）：This file provides guidance to Claude Code claude.ai/code when working with code in this repository. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CLAUDE.md`
- **notebooklm-py**（project_doc）：A Comprehensive NotebookLM Skill & Unofficial Python API. Full programmatic access to NotebookLM's features—including capabilities the web UI doesn't expose—via Python, CLI, and AI agents like Claude Code, Codex, and OpenClaw. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Auth cookie lifecycle — design notes and field findings**（project_doc）：Auth cookie lifecycle — design notes and field findings 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/auth-cookie-lifecycle.md`
- **Configuration**（project_doc）：Status: Active Last Updated: 2026-05-29 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/configuration.md`
- **Installation**（project_doc）：This is the canonical installation guide for notebooklm-py . The README has a quickstart; everything else lives here. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/installation.md`
- **Contributing to notebooklm-py**（project_doc）：Run the full pre-commit suite matches what CI runs . IMPORTANT: use the broad . scope, not src/ tests/ — the pre-commit hook in CI invokes ruff-format on the whole tree and is stricter than a narrow scope. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **notebooklm**（skill）：Complete API for Google NotebookLM - full programmatic access including features not in the web UI. Create notebooks, add sources, generate all artifact types, download in multiple formats. Activates on explicit /notebooklm or intent like "create a podcast about X 激活提示：当用户任务与“notebooklm”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`SKILL.md`
- **Architecture post-v0.5.0**（project_doc）：This document describes the runtime shape of notebooklm-py after the v0.5.0 refactor program closed. It is the canonical post-refactor map; the historical narrative lives in docs/refactor-history.md ./refactor-history.md . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/architecture.md`
- **CLI Exit-Code Convention**（project_doc）：Status: Active Last Updated: 2026-05-27 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/cli-exit-codes.md`
- **CLI Reference**（project_doc）：Status: Active Last Updated: 2026-05-15 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/cli-reference.md`
- **Naming Conventions**（project_doc）：Status: Active Last Updated: 2026-05-21 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/conventions.md`
- **Deprecations**（project_doc）：This page is the single source of truth for currently-deprecated APIs in notebooklm-py . Each row lists what is deprecated, the recommended replacement, when the deprecation was introduced, when it is scheduled for removal, and any cross-references. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/deprecations.md`
- **Contributing Guide**（project_doc）：Status: Active Last Updated: 2026-05-23 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/development.md`
- **Python API Reference**（project_doc）：Status: Active Last Updated: 2026-05-15 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/python-api.md`
- **Tier 12 / Tier 13 Refactor — Historical Record**（project_doc）：Tier 12 / Tier 13 Refactor — Historical Record 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/refactor-history.md`
- **Release Checklist**（project_doc）：Status: Active Last Updated: 2026-05-23 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/releasing.md`
- **RPC Development Guide**（project_doc）：Status: Active Last Updated: 2026-05-23 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/rpc-development.md`
- **RPC & UI Reference**（project_doc）：Status: Active Last Updated: 2026-05-14 Source of Truth: src/notebooklm/rpc/types.py Purpose: Complete reference for RPC methods, UI selectors, and payload structures 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/rpc-reference.md`
- **API Stability and Versioning**（project_doc）：Status: Active Last Updated: 2026-05-23 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/stability.md`
- **Troubleshooting**（project_doc）：Status: Active Last Updated: 2026-05-14 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/troubleshooting.md`
- **ADR-NNN:**（project_doc）：One of: Proposed , Accepted , Accepted Sunset = , Superseded by ADR-NNN PR , Deprecated , Rejected . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0000-template.md`
- **ADR-001: Layered core seams and the property-bridge policy**（project_doc）：ADR-001: Layered core seams and the property-bridge policy 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0001-layered-core-seams-and-property-bridge-policy.md`
- **ADR-002: Capability Protocol pattern SessionCapabilities fat union**（project_doc）：ADR-002: Capability Protocol pattern SessionCapabilities fat union 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0002-capability-protocol-pattern.md`
- **ADR-003: auth.py write-through facade AuthFacadeModule**（project_doc）：ADR-003: auth.py write-through facade AuthFacadeModule 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0003-auth-facade-write-through.md`
- **ADR-004: Loop-affinity contract for NotebookLMClient**（project_doc）：ADR-004: Loop-affinity contract for NotebookLMClient 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0004-loop-affinity-contract.md`
- **ADR-005: Mutating-RPC idempotency taxonomy**（project_doc）：ADR-005: Mutating-RPC idempotency taxonomy 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0005-idempotency-taxonomy.md`
- **ADR-006: VCR cassette scrubber strategy**（project_doc）：ADR-006: VCR cassette scrubber strategy 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0006-vcr-scrubber-strategy.md`
- **ADR-007: Test-monkeypatch policy — constructor-injection via tests/ fixtures/**（project_doc）：ADR-007: Test-monkeypatch policy — constructor-injection via tests/ fixtures/ 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0007-test-monkeypatch-policy.md`
- **ADR-008: cli/services/ extraction pattern**（project_doc）：ADR-008: cli/services/ extraction pattern 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0008-cli-services-extraction-pattern.md`
- **ADR-009: Middleware chain for cross-cutting transport concerns**（project_doc）：ADR-009: Middleware chain for cross-cutting transport concerns 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0009-middleware-chain.md`
- **ADR-010: Session/Kernel split**（project_doc）：Superseded by ADR-013 0013-composable-session-capabilities.md 866 . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0010-session-kernel-split.md`
- **ADR-011: Schema validation policy strict-decode default**（project_doc）：ADR-011: Schema validation policy strict-decode default 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0011-schema-validation-policy.md`
- **ADR-012: Implementation surface convention underscore-prefix policy**（project_doc）：ADR-012: Implementation surface convention underscore-prefix policy 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0012-implementation-surface-convention.md`
- **ADR-013: Composable Session Capabilities and Feature-Local Runtimes**（project_doc）：ADR-013: Composable Session Capabilities and Feature-Local Runtimes 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0013-composable-session-capabilities.md`
- **ADR-014: Feature-local runtime adapters as Protocol satisfiers**（project_doc）：ADR-014: Feature-local runtime adapters as Protocol satisfiers 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0014-feature-local-runtime-adapters.md`
- **ADR-015: Typed JSON error envelope covers post-parse ClickException failures**（project_doc）：ADR-015: Typed JSON error envelope covers post-parse ClickException failures 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0015-json-envelope-contract-for-post-parse-click-exceptions.md`
- **ADR-016: Auth Identity and Core Logger Compatibility**（project_doc）：ADR-016: Auth Identity and Core Logger Compatibility 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/adr/0016-auth-identity-and-core-logger-compatibility.md`

## 证据索引

- 共索引 80 条证据。

- **Architecture Decision Records**（documentation）：This directory holds the canonical decisions that shape the notebooklm-py codebase. Each record explains why a load-bearing pattern exists so that future contributors don't re-litigate or silently re-introduce the trade-off. 证据：`docs/adr/README.md`
- **Repository Guidelines**（documentation）：Status: Active Last Updated: 2026-05-09 证据：`AGENTS.md`
- **CLAUDE.md**（documentation）：This file provides guidance to Claude Code claude.ai/code when working with code in this repository. 证据：`CLAUDE.md`
- **notebooklm-py**（documentation）：A Comprehensive NotebookLM Skill & Unofficial Python API. Full programmatic access to NotebookLM's features—including capabilities the web UI doesn't expose—via Python, CLI, and AI agents like Claude Code, Codex, and OpenClaw. 证据：`README.md`
- **Auth cookie lifecycle — design notes and field findings**（documentation）：Auth cookie lifecycle — design notes and field findings 证据：`docs/auth-cookie-lifecycle.md`
- **Configuration**（documentation）：Status: Active Last Updated: 2026-05-29 证据：`docs/configuration.md`
- **Installation**（documentation）：This is the canonical installation guide for notebooklm-py . The README has a quickstart; everything else lives here. 证据：`docs/installation.md`
- **Contributing to notebooklm-py**（documentation）：Run the full pre-commit suite matches what CI runs . IMPORTANT: use the broad . scope, not src/ tests/ — the pre-commit hook in CI invokes ruff-format on the whole tree and is stricter than a narrow scope. 证据：`CONTRIBUTING.md`
- **NotebookLM Automation**（skill_instruction）：Complete programmatic access to Google NotebookLM—including capabilities not exposed in the web UI. Create notebooks, add sources URLs, YouTube, PDFs, audio, video, images , chat with content, generate all artifact types, and download results in multiple formats. 证据：`SKILL.md`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE`
- **Architecture post-v0.5.0**（documentation）：This document describes the runtime shape of notebooklm-py after the v0.5.0 refactor program closed. It is the canonical post-refactor map; the historical narrative lives in docs/refactor-history.md ./refactor-history.md . 证据：`docs/architecture.md`
- **CLI Exit-Code Convention**（documentation）：Status: Active Last Updated: 2026-05-27 证据：`docs/cli-exit-codes.md`
- **CLI Reference**（documentation）：Status: Active Last Updated: 2026-05-15 证据：`docs/cli-reference.md`
- **Naming Conventions**（documentation）：Status: Active Last Updated: 2026-05-21 证据：`docs/conventions.md`
- **Deprecations**（documentation）：This page is the single source of truth for currently-deprecated APIs in notebooklm-py . Each row lists what is deprecated, the recommended replacement, when the deprecation was introduced, when it is scheduled for removal, and any cross-references. 证据：`docs/deprecations.md`
- **Contributing Guide**（documentation）：Status: Active Last Updated: 2026-05-23 证据：`docs/development.md`
- **Python API Reference**（documentation）：Status: Active Last Updated: 2026-05-15 证据：`docs/python-api.md`
- **Tier 12 / Tier 13 Refactor — Historical Record**（documentation）：Tier 12 / Tier 13 Refactor — Historical Record 证据：`docs/refactor-history.md`
- **Release Checklist**（documentation）：Status: Active Last Updated: 2026-05-23 证据：`docs/releasing.md`
- **RPC Development Guide**（documentation）：Status: Active Last Updated: 2026-05-23 证据：`docs/rpc-development.md`
- **RPC & UI Reference**（documentation）：Status: Active Last Updated: 2026-05-14 Source of Truth: src/notebooklm/rpc/types.py Purpose: Complete reference for RPC methods, UI selectors, and payload structures 证据：`docs/rpc-reference.md`
- **API Stability and Versioning**（documentation）：Status: Active Last Updated: 2026-05-23 证据：`docs/stability.md`
- **Troubleshooting**（documentation）：Status: Active Last Updated: 2026-05-14 证据：`docs/troubleshooting.md`
- **ADR-NNN:**（documentation）：One of: Proposed , Accepted , Accepted Sunset = , Superseded by ADR-NNN PR , Deprecated , Rejected . 证据：`docs/adr/0000-template.md`
- **ADR-001: Layered core seams and the property-bridge policy**（documentation）：ADR-001: Layered core seams and the property-bridge policy 证据：`docs/adr/0001-layered-core-seams-and-property-bridge-policy.md`
- **ADR-002: Capability Protocol pattern SessionCapabilities fat union**（documentation）：ADR-002: Capability Protocol pattern SessionCapabilities fat union 证据：`docs/adr/0002-capability-protocol-pattern.md`
- **ADR-003: auth.py write-through facade AuthFacadeModule**（documentation）：ADR-003: auth.py write-through facade AuthFacadeModule 证据：`docs/adr/0003-auth-facade-write-through.md`
- **ADR-004: Loop-affinity contract for NotebookLMClient**（documentation）：ADR-004: Loop-affinity contract for NotebookLMClient 证据：`docs/adr/0004-loop-affinity-contract.md`
- **ADR-005: Mutating-RPC idempotency taxonomy**（documentation）：ADR-005: Mutating-RPC idempotency taxonomy 证据：`docs/adr/0005-idempotency-taxonomy.md`
- **ADR-006: VCR cassette scrubber strategy**（documentation）：ADR-006: VCR cassette scrubber strategy 证据：`docs/adr/0006-vcr-scrubber-strategy.md`
- **ADR-007: Test-monkeypatch policy — constructor-injection via tests/ fixtures/**（documentation）：ADR-007: Test-monkeypatch policy — constructor-injection via tests/ fixtures/ 证据：`docs/adr/0007-test-monkeypatch-policy.md`
- **ADR-008: cli/services/ extraction pattern**（documentation）：ADR-008: cli/services/ extraction pattern 证据：`docs/adr/0008-cli-services-extraction-pattern.md`
- **ADR-009: Middleware chain for cross-cutting transport concerns**（documentation）：ADR-009: Middleware chain for cross-cutting transport concerns 证据：`docs/adr/0009-middleware-chain.md`
- **ADR-010: Session/Kernel split**（documentation）：Superseded by ADR-013 0013-composable-session-capabilities.md 866 . 证据：`docs/adr/0010-session-kernel-split.md`
- **ADR-011: Schema validation policy strict-decode default**（documentation）：ADR-011: Schema validation policy strict-decode default 证据：`docs/adr/0011-schema-validation-policy.md`
- **ADR-012: Implementation surface convention underscore-prefix policy**（documentation）：ADR-012: Implementation surface convention underscore-prefix policy 证据：`docs/adr/0012-implementation-surface-convention.md`
- **ADR-013: Composable Session Capabilities and Feature-Local Runtimes**（documentation）：ADR-013: Composable Session Capabilities and Feature-Local Runtimes 证据：`docs/adr/0013-composable-session-capabilities.md`
- **ADR-014: Feature-local runtime adapters as Protocol satisfiers**（documentation）：ADR-014: Feature-local runtime adapters as Protocol satisfiers 证据：`docs/adr/0014-feature-local-runtime-adapters.md`
- **ADR-015: Typed JSON error envelope covers post-parse ClickException failures**（documentation）：ADR-015: Typed JSON error envelope covers post-parse ClickException failures 证据：`docs/adr/0015-json-envelope-contract-for-post-parse-click-exceptions.md`
- **ADR-016: Auth Identity and Core Logger Compatibility**（documentation）：ADR-016: Auth Identity and Core Logger Compatibility 证据：`docs/adr/0016-auth-identity-and-core-logger-compatibility.md`
- **Refresh Browser Cookies**（source_file）：def main - int ⋮---- missing = ⋮---- profile = os.environ "NOTEBOOKLM REFRESH PROFILE" storage = os.environ "NOTEBOOKLM REFRESH STORAGE PATH" browser = os.environ.get "NOTEBOOKLM REFRESH BROWSER", "chrome" 证据：`examples/refresh_browser_cookies.py`
- **Wait for completion**（source_file）：async def main ⋮---- nb = await client.notebooks.create "Quickstart Demo" ⋮---- url = "https://en.wikipedia.org/wiki/Artificial intelligence" source = await client.sources.add url nb.id, url ⋮---- result = await client.chat.ask nb.id, "What are the main topics covered?" ⋮---- status = await client.artifacts.generate audio ⋮---- Wait for completion final = await client.artifacts.wait for completion 证据：`docs/examples/quickstart.py`
- **Init**（source_file）：logger = logging.getLogger name ⋮---- version = version "notebooklm-py" ⋮---- version = "0.0.0.dev0" ⋮---- all = 证据：`src/notebooklm/__init__.py`
- **extract interactive tree leaf re-raises UnknownRPCMethodError**（source_file）：logger = logging.getLogger name ⋮---- TRUSTED DOWNLOAD DOMAINS = ".google.com", ".googleusercontent.com", ".googleapis.com" ⋮---- DOWNLOAD WRITER QUEUE SIZE = 8 ⋮---- join task = asyncio.ensure future asyncio.to thread writer thread.join cancelled error: asyncio.CancelledError None = None ⋮---- cancelled error = exc ⋮---- @dataclass frozen=False class DownloadResult ⋮---- succeeded: list str = field default factory=list failed: list tuple str, Exception = field default factory=list ⋮---- @property def all succeeded self - bool ⋮---- @property def partial self - bool ⋮---- def load httpx cookies storage path: Any - Any ⋮---- def is trusted download host hostname: str None - bool ⋮---- hostna… 证据：`src/notebooklm/_artifact_downloads.py`
- **Artifact Payloads**（source_file）：STATIC REPORT CONFIGS: dict ReportFormat, dict str, str = { ⋮---- source ids triple = nest source ids source ids, 2 source ids double = nest source ids source ids, 1 ⋮---- format code = audio format.value if audio format is not None else AudioFormat.DEEP DIVE.value length code = audio length.value if audio length is not None else AudioLength.DEFAULT.value ⋮---- format code = video format.value if video format is not None else VideoFormat.EXPLAINER.value style code = video style.value if video style is not None else VideoStyle.AUTO SELECT.value ⋮---- video config = ⋮---- config = report config report format, custom prompt ⋮---- config = { config, "prompt": f"{config 'prompt' }\n\n{extra inst… 证据：`src/notebooklm/_artifact_payloads.py`
- **Pop the registry entry before resolving the future so a waiter**（source_file）：logger = logging.getLogger name ⋮---- POLL MAX RETRIES = 3 IN PROGRESS STATUS = "in progress" ⋮---- ListRawCallback = Callable str , Awaitable builtins.list Any PollStatusCallback = Callable str, str , Awaitable GenerationStatus MediaReadyCallback = Callable builtins.list Any , int , bool ArtifactTypeNameCallback = Callable int , str ArtifactErrorCallback = Callable builtins.list Any , str None StatusChangeCallback = Callable GenerationStatus , object ⋮---- class ArtifactPollingService ⋮---- @property def poll registry self - PollRegistry ⋮---- def resolve sleep self - Sleep ⋮---- def resolve monotonic self - Monotonic ⋮---- async def drain self - None ⋮---- poll tasks = self. poll registry… 证据：`src/notebooklm/_artifact_polling.py`
- **Only accept name when it is a non-empty str — a**（source_file）：logger = logging.getLogger name ⋮---- class ArtifactsAPI ⋮---- async def get self, notebook id: str, artifact id: str - Artifact None ⋮---- result = await self. get or none notebook id, artifact id ⋮---- async def get or none self, notebook id: str, artifact id: str - Artifact None ⋮---- async def list audio self, notebook id: str - builtins.list Artifact ⋮---- async def list video self, notebook id: str - builtins.list Artifact ⋮---- async def list reports self, notebook id: str - builtins.list Artifact ⋮---- async def list quizzes self, notebook id: str - builtins.list Artifact ⋮---- async def list flashcards self, notebook id: str - builtins.list Artifact ⋮---- async def list infographic… 证据：`src/notebooklm/_artifacts.py`
- **Atomic Io**（source_file）：logger = logging.getLogger name ⋮---- STORAGE STATE FILENAME = "storage state.json" ⋮---- FSYNC UNSUPPORTED ERRNOS = frozenset ⋮---- def is unsupported fsync error exc: OSError - bool ⋮---- WINDOWS REPLACE TRANSIENT WINERRORS = { WINDOWS REPLACE MAX ATTEMPTS = 10 WINDOWS REPLACE INITIAL DELAY SECONDS = 0.001 WINDOWS REPLACE MAX DELAY SECONDS = 0.05 ⋮---- def is retryable windows replace error exc: PermissionError - bool ⋮---- winerror = getattr exc, "winerror", None ⋮---- def fsync dir directory: Path - None ⋮---- dir fd = os.open directory, os.O RDONLY ⋮---- def replace file atomically temp path: Path, path: Path - None ⋮---- delay = WINDOWS REPLACE INITIAL DELAY SECONDS ⋮---- delay = min… 证据：`src/notebooklm/_atomic_io.py`
- **Init**（source_file）：all = "extraction", "headers", "keepalive", "paths", "refresh", "tokens" 证据：`src/notebooklm/_auth/__init__.py`
- **Cookie domains we extract / accept by default.**（source_file）：logger = logging.getLogger "notebooklm.auth" ⋮---- def cookie names from storage storage state: Mapping str, Any - set str ⋮---- cookies = storage state.get "cookies", ⋮---- MINIMUM REQUIRED COOKIES = {"SID", " Secure-1PSIDTS"} ⋮---- EXTRACTION HINT = ⋮---- SECONDARY BINDING WARNED = False ⋮---- def has valid secondary binding cookie names: set str - bool ⋮---- """Enforce the Tier 1 cookie-set rule raise and warn on Tier 2 violation. Hybrid rollout: Tier 1 MINIMUM REQUIRED COOKIES is a hard requirement because its ablation evidence is unambiguous — Google rejects deterministically and there is no recovery path inside the library. Tier 2 secondary binding, see has valid secondary binding is… 证据：`src/notebooklm/_auth/cookie_policy.py`
- **Inline Secure-1PSIDTS recovery issue 865 — same as the**（source_file）：logger = logging.getLogger "notebooklm.auth" ⋮---- CookieKey: TypeAlias = tuple str, str, str DomainCookieMap: TypeAlias = dict CookieKey, str FlatCookieMap: TypeAlias = dict str, str ⋮---- LegacyDomainCookieMap: TypeAlias = dict tuple str, str , str CookieInput: TypeAlias = DomainCookieMap LegacyDomainCookieMap FlatCookieMap ⋮---- MINIMUM REQUIRED COOKIES = cookie policy.MINIMUM REQUIRED COOKIES EXTRACTION HINT = cookie policy. EXTRACTION HINT auth domain priority = cookie policy. auth domain priority is allowed auth domain = cookie policy. is allowed auth domain is allowed cookie domain = cookie policy. is allowed cookie domain ⋮---- validate required cookies = cookie policy. validate req… 证据：`src/notebooklm/_auth/cookies.py`
- **2. Single-quoted variant: 'key':'value' with escaped-quote support.**（source_file）：def build wiz field patterns key: str - list re.Pattern str ⋮---- escaped = re.escape key ⋮---- 2. Single-quoted variant: 'key':'value' with escaped-quote support. ⋮---- 3. HTML-escaped: &quot;key&quot;:&quot;value&quot; Tempered dot so the value can contain other entities like &amp;. ⋮---- def extract wiz field html: str, key: str, , strict: bool = True - str None ⋮---- """Extract a WIZ global data key value from a NotebookLM HTML response. NotebookLM and other Google products embed a JavaScript object literal named WIZ global data in the page chrome. Tokens like SNlM0e CSRF and FdrFJe session ID live inside that object. This helper is the single place that knows how to parse the embedding… 证据：`src/notebooklm/_auth/extraction.py`
- **Paths**（source_file）：NOTEBOOKLM REFRESH CMD ENV = "NOTEBOOKLM REFRESH CMD" NOTEBOOKLM REFRESH CMD USE SHELL ENV = "NOTEBOOKLM REFRESH CMD USE SHELL" REFRESH ATTEMPTED ENV = " NOTEBOOKLM REFRESH ATTEMPTED" ⋮---- NOTEBOOKLM DISABLE KEEPALIVE POKE ENV = "NOTEBOOKLM DISABLE KEEPALIVE POKE" ⋮---- def storage state lock path storage path: Path - Path ⋮---- def rotation lock path storage path: Path None - Path None 证据：`src/notebooklm/_auth/paths.py`
- **Shouldn't happen with the seeded production registry, but**（source_file）：logger = logging.getLogger name ⋮---- T = TypeVar "T" ⋮---- RETRYABLE TRANSPORT ERRORS: tuple type BaseException , ... = ⋮---- last error: BaseException None = None ⋮---- last error = exc ⋮---- existing = await probe ⋮---- class IdempotencyPolicy str, Enum ⋮---- UNCLASSIFIED = "unclassified" PROBE THEN CREATE = "probe then create" IDEMPOTENT SET OP = "idempotent set op" AT LEAST ONCE ACCEPTED = "at least once accepted" NON IDEMPOTENT NO RETRY = "non idempotent no retry" ⋮---- POLICIES THAT FORCE DISABLE: frozenset IdempotencyPolicy = frozenset ⋮---- ProbeKeyFn = Callable list Any , Any ⋮---- @dataclass frozen=True class IdempotencyEntry ⋮---- policy: IdempotencyPolicy probe key fn: ProbeKey… 证据：`src/notebooklm/_idempotency.py`
- **Kernel**（source_file）：class Kernel ⋮---- @property def http client self - httpx.AsyncClient None ⋮---- @property def cookies self - httpx.Cookies ⋮---- def get http client self - httpx.AsyncClient ⋮---- http timeout = httpx.Timeout cookies = ⋮---- async def aclose self - None ⋮---- client = self. http client ⋮---- all = "Kernel" 证据：`src/notebooklm/_kernel.py`
- **Middleware**（source_file）：@dataclass frozen=True class RpcRequest ⋮---- url: str ⋮---- headers: Mapping str, str ⋮---- body: bytes ⋮---- context: dict str, Any = field default factory=dict ⋮---- @dataclass frozen=True class RpcResponse ⋮---- response: httpx.Response ⋮---- request = materialize build request build request, snapshot ⋮---- NextCall = Callable RpcRequest , Awaitable RpcResponse ⋮---- class Middleware Protocol ⋮---- def make wrapper mw: Middleware, next call: NextCall - NextCall ⋮---- async def wrapped request: RpcRequest - RpcResponse ⋮---- chain: NextCall = terminal ⋮---- chain = make wrapper mw, chain ⋮---- all = 证据：`src/notebooklm/_middleware.py`
- **Mark AFTER a successful refresh a refresh failure raised above**（source_file）：class AuthRefreshMiddleware ⋮---- log label = request.context.get RPC CONTEXT LOG LABEL, " " ⋮---- budget = cast already refreshed = ⋮---- original auth error = exc ⋮---- Mark AFTER a successful refresh a refresh failure raised above and never reaches here . Consuming the shared budget is what blocks the decoded-RPC layer in RpcExecutor from refreshing a second time on the SAME logical call issue 1205 . The per-chain boolean is also set so a 429 thrown by the retry then caught by RetryMiddleware outside us doesn't trigger a second refresh when it re-enters our chain leg, and so the terminal freshness rebuild observes the post-refresh marker. ⋮---- retry request = await self. rebuild request… 证据：`src/notebooklm/_middleware_auth_refresh.py`
- **Middleware Chain**（source_file）：class MiddlewareChainBuilder ⋮---- def build self - list Middleware 证据：`src/notebooklm/_middleware_chain.py`
- **Middleware Chain Host**（source_file）：@dataclass class MiddlewareChainHost ⋮---- auth refresh: AuthRefreshCoordinator rate limit max retries: int server error max retries: int refresh retry delay: float authed post chain: NextCall None = None transport: RuntimeTransport None = None ⋮---- def bind transport self, transport: RuntimeTransport - None ⋮---- async def authed post chain terminal self, request: RpcRequest - RpcResponse ⋮---- transport = self. transport ⋮---- async def await refresh self - None ⋮---- all = "MiddlewareChainHost" 证据：`src/notebooklm/_middleware_chain_host.py`
- **Middleware Context**（source_file）：RPC CONTEXT RPC METHOD: Final = "rpc method" RPC CONTEXT DISABLE INTERNAL RETRIES: Final = "disable internal retries" RPC CONTEXT BUILD REQUEST: Final = "build request" RPC CONTEXT LOG LABEL: Final = "log label" RPC CONTEXT AUTH SNAPSHOT: Final = "auth snapshot" RPC CONTEXT AUTH REFRESHED: Final = "auth refreshed" RPC CONTEXT RPC QUEUE WAIT SECONDS: Final = "rpc queue wait seconds" ⋮---- RPC CONTEXT REFRESH BUDGET: Final = "refresh budget" ⋮---- ALLOWED RPC CONTEXT KEYS: Final frozenset str = frozenset ⋮---- all = 证据：`src/notebooklm/_middleware_context.py`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

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

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/adr/README.md`, `AGENTS.md`, `CLAUDE.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/adr/README.md`, `AGENTS.md`, `CLAUDE.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, src/notebooklm/__init__.py, src/notebooklm/client.py, src/notebooklm/_kernel.py
- **快速开始**：importance `high`
  - source_paths: docs/installation.md, src/notebooklm/_auth/extraction.py, src/notebooklm/auth.py, examples/quickstart.py
- **客户端架构**：importance `high`
  - source_paths: src/notebooklm/client.py, src/notebooklm/_client_composed.py, src/notebooklm/_client_seams.py, src/notebooklm/_runtime_init.py, src/notebooklm/_kernel.py
- **RPC 协议层**：importance `high`
  - source_paths: src/notebooklm/rpc/types.py, src/notebooklm/rpc/_batchexecute.py, src/notebooklm/rpc/_exceptions.py, docs/rpc-reference.md, docs/rpc-development.md
- **中间件链**：importance `medium`
  - source_paths: src/notebooklm/_middleware.py, src/notebooklm/_middleware_chain.py, src/notebooklm/_middleware_chain_host.py, src/notebooklm/_middleware_tracing.py, src/notebooklm/_middleware_metrics.py
- **笔记本 API**：importance `high`
  - source_paths: src/notebooklm/_notebooks.py, src/notebooklm/_notebook_metadata.py, src/notebooklm/cli/notebook_cmd.py, src/notebooklm/_sharing_manager.py
- **源与制品 API**：importance `high`
  - source_paths: src/notebooklm/_sources.py, src/notebooklm/_source_add.py, src/notebooklm/_source_content.py, src/notebooklm/_source_upload.py, src/notebooklm/_source_polling.py
- **内容生成**：importance `high`
  - source_paths: src/notebooklm/_generate.py, src/notebooklm/_artifact_polling.py, src/notebooklm/_mind_maps_api.py, src/notebooklm/cli/generate_cmd.py, src/notebooklm/cli/download_cmd.py

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

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `ad992bbbe75ee73db81fec947ed120ecaf686721`
- inspected_files: `pyproject.toml`, `README.md`, `uv.lock`, `docs/stability.md`, `docs/cli-exit-codes.md`, `docs/architecture.md`, `docs/conventions.md`, `docs/troubleshooting.md`, `docs/cli-reference.md`, `docs/configuration.md`, `docs/installation.md`, `docs/releasing.md`, `docs/python-api.md`, `docs/development.md`, `docs/refactor-history.md`, `docs/rpc-development.md`, `docs/rpc-reference.md`, `docs/auth-cookie-lifecycle.md`, `docs/deprecations.md`, `docs/adr/0002-capability-protocol-pattern.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: 来源证据：API: route client.mind_maps mutation sites through MindMapNotFoundError (rename/get_tree bare ValueError)

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：API: route client.mind_maps mutation sites through MindMapNotFoundError (rename/get_tree bare ValueError)
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | cevd_84d8e36f2175420382af42f6a85f022e | https://github.com/teng-lin/notebooklm-py/issues/1291 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：v0.8.0: flip sources/artifacts/notes/mind_maps.get() to raise *NotFoundError

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：v0.8.0: flip sources/artifacts/notes/mind_maps.get() to raise *NotFoundError
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | cevd_aed84a2b0ce748519e8c4b04b34e3b67 | https://github.com/teng-lin/notebooklm-py/issues/1247 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 失败模式：security_permissions: Test hygiene: run the cassette-cleanliness guard inside pytest (defense-in-depth for credenti...

- Trigger: Developers should check this security_permissions risk before relying on the project: Test hygiene: run the cassette-cleanliness guard inside pytest (defense-in-depth for credential leaks)
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: Test hygiene: run the cassette-cleanliness guard inside pytest (defense-in-depth for credential leaks). Context: Source discussion did not expose a precise runtime context.
- Why it matters: Developers may expose sensitive permissions or credentials: Test hygiene: run the cassette-cleanliness guard inside pytest (defense-in-depth for credential leaks)
- Evidence: failure_mode_cluster:github_issue | fmev_bc923eee3d22d09a307c9b8bd9e67b45 | https://github.com/teng-lin/notebooklm-py/issues/1292 | Test hygiene: run the cassette-cleanliness guard inside pytest (defense-in-depth for credential leaks)
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 失败模式：installation: v0.2.1

- Trigger: Developers should check this installation risk before relying on the project: v0.2.1
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.2.1. Context: Observed during installation or first-run setup.
- Why it matters: Upgrade or migration may change expected behavior: v0.2.1
- Evidence: failure_mode_cluster:github_release | fmev_1785f1babed9cb7123f6ce16f7cabd8c | https://github.com/teng-lin/notebooklm-py/releases/tag/v0.2.1 | v0.2.1
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 失败模式：installation: v0.3.0

- Trigger: Developers should check this installation risk before relying on the project: v0.3.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.3.0. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v0.3.0
- Evidence: failure_mode_cluster:github_release | fmev_0682708a98e1c2658031a1fb85382b73 | https://github.com/teng-lin/notebooklm-py/releases/tag/v0.3.0 | v0.3.0
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 失败模式：installation: v0.4.0

- Trigger: Developers should check this installation risk before relying on the project: v0.4.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.4.0. Context: Observed when using python, playwright, windows
- Why it matters: Upgrade or migration may change expected behavior: v0.4.0
- Evidence: failure_mode_cluster:github_release | fmev_9ca899a22a1723caa88b91f3b23aa94a | https://github.com/teng-lin/notebooklm-py/releases/tag/v0.4.0 | v0.4.0
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 失败模式：installation: v0.6.0

- Trigger: Developers should check this installation risk before relying on the project: v0.6.0
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.6.0. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v0.6.0
- Evidence: failure_mode_cluster:github_release | fmev_6697b8c66b7baff65ef8991167386a38 | https://github.com/teng-lin/notebooklm-py/releases/tag/v0.6.0 | v0.6.0
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

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

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

### Constraint 9: 失败模式：configuration: v0.3.3

- Trigger: Developers should check this configuration risk before relying on the project: v0.3.3
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.3.3. Context: Observed when using python
- Why it matters: Upgrade or migration may change expected behavior: v0.3.3
- Evidence: failure_mode_cluster:github_release | fmev_d5e632c85b71175c7dccae55b7dcb9b1 | https://github.com/teng-lin/notebooklm-py/releases/tag/v0.3.3 | v0.3.3
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 失败模式：configuration: v0.4.1

- Trigger: Developers should check this configuration risk before relying on the project: v0.4.1
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.4.1. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Upgrade or migration may change expected behavior: v0.4.1
- Evidence: failure_mode_cluster:github_release | fmev_46b7bc285e00c2407204e85451de0016 | https://github.com/teng-lin/notebooklm-py/releases/tag/v0.4.1 | v0.4.1
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
