math-skill 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: math-research-activator
3
3
  description: |
4
- Mathematical research OS — auto-diagnoses user intent, routes to thinking lenses, math knowledge base, or design translation layer. Triggers on architecture/operator design, theoretical analysis, math-to-AI transfer. Does NOT trigger for pure engineering tasks (debug, refactoring, hyperparameter tuning).
4
+ Mathematical research OS — auto-diagnoses user intent, routes to thinking lenses, activation anchors, or design translation layer. Triggers on architecture/operator design, theoretical analysis, math-to-AI transfer, and cryptographic definitions, constructions, reductions, or protocol analysis. Does NOT trigger for pure engineering tasks (debug, refactoring, hyperparameter tuning).
5
5
  ---
6
6
 
7
7
 
@@ -11,7 +11,7 @@ description: |
11
11
 
12
12
  > "The thinking system does not hand out theorems, the knowledge system does not indulge in loose inspiration, and the design layer does not fake profundity."
13
13
 
14
- This system is a mathematical staff office for AI architecture innovation — not an arsenal, but one that tells you: **what kind of battle this is, which arms to deploy, how to deploy them, and where things could go wrong.**
14
+ This system is a mathematical staff office for AI architecture innovation and cryptographic research — not an arsenal, but one that tells you: **what kind of battle this is, which arms to deploy, how to deploy them, and where things could go wrong.**
15
15
 
16
16
  ## Core Principle
17
17
 
@@ -26,36 +26,15 @@ This system is a mathematical staff office for AI architecture innovation — no
26
26
  | Layer | Responsibility | Directory | Core Question |
27
27
  |-------|---------------|-----------|--------------|
28
28
  | **Thinking Lenses** | Diagnose problem structure, recommend mathematical perspectives | `../../lenses/*.en.md` | Which perspective should we view this problem through? |
29
- | **Math Knowledge** | Provide concrete mathematical tools (definitions/theorems/formulas) | `../../knowledge-base/*/*.en.md` | What specific mathematics does this perspective require? |
29
+ | **Activation Anchors** | Activate high-frequency math structures; trigger Knowledge Gap Protocol when insufficient | `../../knowledge-base/*/*.en.md` | What math structures does this perspective require? |
30
30
  | **Design Translation** | Translate mathematics into AI modules/losses/operators | `../../design-patterns/*/*.en.md` | How does this mathematics become model architecture? |
31
31
 
32
32
  Auxiliary layers:
33
33
  - `../../references/books/*.en.md`: Distilled notes from 7 textbooks; full context when deeper understanding is needed
34
+ - `../../references/books/applied-cryptography.md`, `../../references/books/foundations-of-cryptography.md`, `../../references/books/introduction-to-modern-cryptography.md`: 3 English-language cryptography distillations; see `../../references/skill-index.en.md`
34
35
  - `../../references/gpu-friendly-math.en.md`: GPU Eight-Dimension Acceptance Gate (single source of truth)
35
36
  - `../../agents/math-critic.en.md`: Math-engineering dual critic
36
37
 
37
- ## Intent Diagnosis (5 Scenarios)
38
-
39
- | Scenario | Diagnostic Signal | Invocation Path |
40
- |----------|------------------|-----------------|
41
- | **A. Problem Analysis** | "Is this design sound?" "Are there gaps in the reasoning chain?" | Lenses → critic |
42
- | **B. Mechanism Design** | "Design a new attention mechanism" "Transfer X to Y" | Lenses → Knowledge → Design → critic |
43
- | **C. Knowledge Query** | "What is a tangent space on a manifold?" "How is the projection theorem applied?" | Knowledge |
44
- | **D. Verification & Review** | "Does this formula hold?" "What guarantees does this loss provide?" | Knowledge → relevant design patterns (if a concrete AI construct is cited) → critic |
45
- | **E. Pure Engineering** | Debugging, refactoring, hyperparameter tuning, code review | **Do not invoke the math system** |
46
-
47
- ## Lens Library (15 Mathematical Perspectives)
48
-
49
- 15 lenses covering: Axiomatization, Duality, Symmetry, Spectral Decomposition, Geometric, Projection & Decomposition, Variational, Local-to-Global, Topological, Categorical, Perturbation, Causal, Game-Theoretic, Probabilistic & Statistical, Algorithmic. Directory: `../../lenses/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
50
-
51
- ## Knowledge Base (Organized by Mathematical Domain)
52
-
53
- 7 domains: Matrix Analysis, Optimization, Differential Geometry, Lie Theory, Topology, Probability & Information, Information Geometry. Directory: `../../knowledge-base/*/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
54
-
55
- ## Design Pattern Library (Organized by AI Component)
56
-
57
- 5 component types: Attention, Loss Functions, Routing, Representation, Compression. Directory: `../../design-patterns/*/*.en.md`. Full catalog table: `../../references/skill-index.en.md`.
58
-
59
38
  ## Automatic Trigger Conditions
60
39
 
61
40
  **All of Gate 1 + Gate 2 + Gate 3 must be satisfied simultaneously for intervention:**
@@ -64,36 +43,85 @@ Auxiliary layers:
64
43
  The following tasks **never** trigger the system regardless of workspace contents: code review, debugging, refactoring, hyperparameter tuning, build/deployment, purely factual queries, general software engineering.
65
44
 
66
45
  ### Gate 1 · Environment Signal
67
- The workspace contains architecture-level core code (attention/transformer/MoE, `*.cu`/kernel) or research notes. Routine files like `model.py` or `trainer.py` alone **do not** constitute an environment signal.
46
+ The workspace contains architecture-level core code (attention/transformer/MoE, `*.cu`/kernel) or research notes, **or** cryptography-related code / protocol descriptions / security proof drafts. Routine files like `model.py` or `trainer.py` alone **do not** constitute an environment signal.
68
47
 
69
48
  ### Gate 2 · Task Signal
70
- The user's task involves **designing/improving** a new architecture/operator, **analyzing** theoretical properties, **transferring** mathematical structures into AI design, or **querying math knowledge relevant to AI research** (e.g., "how is tangent space used in optimization?"). Pure encyclopedic math queries (e.g., "what is a group?" with no AI context) do not auto-trigger, but can be accessed via `/ask`.
49
+ The user's task involves **designing/improving** a new architecture/operator, **analyzing** theoretical properties, **transferring** mathematical structures into AI design, **analyzing cryptographic constructions/security definitions/reduction proofs/protocols**, or **querying math knowledge relevant to AI research** (e.g., "how is tangent space used in optimization?"). Pure encyclopedic math or cryptography fact queries do not auto-trigger, but can be accessed via `/ask`.
71
50
 
72
51
  ### Gate 3 · Intent Match
73
52
  The user's intent matches one of scenarios A/B/C/D. Pure engineering tasks matching scenario E → no intervention.
74
53
 
75
54
  > **`/ask` entry**: Manual invocation skips Gate 1 and Gate 2, executing only Gate 0 (exclusion) + Gate 3 (intent match), allowing direct access to any scenario including knowledge queries.
76
55
 
56
+ ## Domain Router (new in v3.2.0)
57
+
58
+ > AI research and cryptography **share** mathematical foundations but each has **exclusive** specialty layers. After intent diagnosis and before lens invocation, Domain Router determines the problem's domain and decides which anchors/books/design patterns to load, avoiding cross-domain pollution and token waste.
59
+
60
+ ### Three-Layer Domain Classification
61
+
62
+ | Layer | Signal Keyword Examples | Loaded Content | Exclusive/Shared |
63
+ |-------|------------------------|----------------|-------------------|
64
+ | **AI Research Layer** | attention, loss, routing, representation, compression, MoE, transformer, KV-cache, LoRA, SSM, diffusion, RL | `../../knowledge-base/` (7 domains, 31 anchors) + `../../design-patterns/` (5 types, 22 patterns) + 7 AI books | AI-exclusive |
65
+ | **Cryptography Layer** | encryption, signature, MAC, PRF/PRG/PRP, OWF, CCA, CPA, AE, zero-knowledge, reduction proof, attack game, DL/CDH/DDH, RSA, ECC, lattice crypto | 3 crypto books + shared math anchors (on demand) + temporary knowledge cards | Crypto-exclusive |
66
+ | **Shared Math Layer** | probability, information theory, entropy, group, ring, field, matrix, spectrum, optimization, convexity, perturbation, complexity | Corresponding anchors in `../../knowledge-base/` + `../../lenses/` lenses | Shared |
67
+
68
+ ### Routing Rules
69
+
70
+ 1. **Judge domain first**: Determine primary domain (AI / Crypto / pure math query) from user keywords.
71
+ 2. **No redundant loading of shared math**: If the domain is cryptography, load shared math anchors (e.g., `../../knowledge-base/probability/entropy.md`, `../../knowledge-base/matrix-analysis/spectral-decomposition.md`) on demand; do **NOT** load AI-exclusive `../../design-patterns/`.
72
+ - **"On demand" criterion**: Load if and only if the problem's mathematical structure maps to that shared anchor's core definition/formulas — i.e., the problem statement explicitly mentions the anchor's core concept (e.g., "spectrum," "entropy," "convex," "perturbation"), or a lens/critic explicitly routes to it. **The domain tag does not decide whether shared anchors load; the problem structure does.**
73
+ 3. **Explicit annotation on cross-domain**: If the problem is genuinely AI×crypto intersection (e.g., "use PRF for model watermarking," "reduction proof for adversarial examples"), Domain Router explicitly lists both domains' loaded items and annotates intersection points.
74
+ - **Intersection annotation template** (4-tuple, feeds critic dim 19 checkpoint 6):
75
+ 1. **Crypto primitive + security property** (e.g., "PRF + pseudorandomness")
76
+ 2. **AI module + functional requirement** (e.g., "watermark + unique traceability")
77
+ 3. **Transfer direction** (crypto→AI / AI→crypto)
78
+ 4. **Assumption achievability after transfer** (Is the original assumption still achievable in the AI scenario? E.g., "Is the PRF assumption satisfiable in ML deployment?")
79
+ 4. **No pollution when not cross-domain**: Pure AI problems do not load cryptography books; pure crypto problems do not load AI design patterns. Avoids token waste and conceptual confusion.
80
+ 5. **Domain-tagged gap protocol**: Temporary knowledge cards generated by Knowledge Gap Protocol are tagged with domain (AI/Crypto/Shared) for subsequent upgrade to corresponding formal cards.
81
+
82
+ ### Domain Router Decision Flow
83
+
84
+ ```
85
+ User question
86
+
87
+ [Gate 0-3 triggered?]
88
+ ↓ yes
89
+ Domain Router: keyword-based primary domain judgment
90
+ ├─ AI research → load knowledge-base + design-patterns + AI books
91
+ ├─ Cryptography → load crypto books + shared math anchors (on demand)
92
+ ├─ Pure math → only load lenses + corresponding knowledge-base anchors
93
+ └─ AI×Crypto → dual-domain load + intersection annotation
94
+
95
+ [Scenario A/B/C/D routing]
96
+
97
+ [Lenses → anchors/books → design translation (AI only) / reduction template (crypto only) → critic]
98
+ ```
99
+
77
100
  ## Main Workflow
78
101
 
79
102
  ### Step 1: Diagnose Intent
80
103
  1. Determine which scenario (A/B/C/D/E) the user's intent belongs to
81
- 2. Extract the core tension of the problem: what to preserve? what to suppress? what are the constraints? what is the engineering bottleneck?
82
- 3. Output a problem-type classification
104
+ 2. **Domain Router judgment**: problem domain (AI / Crypto / pure math / intersection)
105
+ 3. Extract the core tension of the problem: what to preserve? what to suppress? what are the constraints? what is the engineering bottleneck?
106
+ 4. Output a problem-type classification + domain tag
83
107
 
84
108
  ### Step 2: Route Invocation
85
109
 
86
110
  ```
87
111
  Scenario A (Analysis): Select 1–3 lenses → output perspective diagnosis → critic review
88
112
  Scenario B (Design): Select 1–3 lenses → invoke relevant activation anchors; if no coverage, enter Knowledge Gap Protocol → generate formal/temporary design patterns → critic review
89
- Scenario C (Query): Prefer loading relevant activation anchors; if no coverage, generate temporary knowledge card → output per knowledge activation protocol
113
+ · AI domain: design patterns from design-patterns/; output attention/loss/routing/representation/compression
114
+ · Crypto domain: design patterns from cryptography books' construction paradigms (SPN/Feistel/Merkle-Damgård/KEM-DEM/Fiat-Shamir); output encryption/MAC/signature/protocols
115
+ Scenario C (Query): Prefer loading relevant activation anchors or crypto books; if no coverage, generate temporary knowledge card → output per knowledge activation protocol
90
116
  Scenario D (Verification): Load relevant anchors or temporary knowledge cards → critic reviews conditions and boundaries
117
+ · AI domain: pass GPU Eight-Dimension Acceptance Gate
118
+ · Crypto domain: pass reduction tightness + assumption dependency + implementation pitfall checks (GPU gate not required)
91
119
  Scenario E (Engineering): No intervention
92
120
  ```
93
121
 
94
122
  ### Step 3: Output Format
95
123
 
96
- **Token-economy rule**: The following is the maximum structure, not the default full template. Trim to the user's question; for simple knowledge queries, provide only the needed definition / formula / risk. Expand design and GPU sections only when relevant, and do not restate loaded cards verbatim.
124
+ **Token-economy rule**: The following is the maximum structure, not the default full template. Trim to the user's question; for simple knowledge queries, provide only the needed definition / formula / risk. Expand design and GPU/reduction sections only when relevant, and do not restate loaded cards verbatim. **After Domain Router determines the domain, only expand the domain-specific subsection.**
97
125
 
98
126
  **Scenario A/B Output**:
99
127
  1. **[Diagnosis]** Problem type + core tension
@@ -137,7 +165,7 @@ See the quantitative checklist in `../../references/gpu-friendly-math.en.md`.
137
165
  ## Depth-of-Consultation Protocol
138
166
 
139
167
  - **Light**: Read knowledge cards (`../../knowledge-base/*/*.en.md`); self-contained and immediately usable
140
- - **Medium**: Read distilled book notes (`../../references/books/*.en.md`) for more complete context
168
+ - **Medium**: Read distilled book notes (`../../references/books/*.en.md`) for more complete context; for cryptography, also consult the 3 English-language `.md` files listed in `../../references/skill-index.en.md`
141
169
  - **Deep**: When `math_book/<PDF>` is available locally, the agent automatically runs `pdftotext` + grep to locate the original page
142
170
 
143
171
  ## Knowledge Gap Protocol
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: math-research-activator
3
3
  description: |
4
- 数学研究操作系统:自动诊断用户意图,路由到思想透镜、数学知识库或设计翻译层。触发于设计/改进模型架构/算子/注意力、分析理论性质、迁移数学结构到 AI 设计。不触发于纯工程任务(debug、重构、调参)。
5
- English: Mathematical research OS — auto-diagnoses user intent, routes to thinking lenses, math knowledge base, or design translation layer. Triggers on architecture/operator design, theoretical analysis, math-to-AI transfer. Does NOT trigger for pure engineering tasks.
4
+ 数学研究操作系统:自动诊断用户意图,路由到思想透镜、激活锚点或设计翻译层。触发于设计/改进模型架构/算子/注意力、分析理论性质、迁移数学结构到 AI 设计,以及密码学安全定义、构造、归约证明与协议分析。不触发于纯工程任务(debug、重构、调参)。
5
+ English: Mathematical research OS — auto-diagnoses user intent, routes to thinking lenses, activation anchors, or design translation layer. Triggers on architecture/operator design, theoretical analysis, math-to-AI transfer, and cryptographic definitions, constructions, reductions, or protocol analysis. Does NOT trigger for pure engineering tasks.
6
6
  ---
7
7
 
8
8
  > **语言路由与混合输入规则**:看句式/动词/语气词主框架判定主语言。AI/数学/工程术语不计入。代码/路径/公式不计入。中英接近时沿用上一轮,无上下文默认中文。显式要求优先。中文→本文件,英文→`SKILL.en.md`。完整规则见 `../../references/skill-index.md`。
@@ -11,7 +11,7 @@ description: |
11
11
 
12
12
  > "思想系统不负责给定理,知识系统不负责乱启发,设计层不负责装深刻。"
13
13
 
14
- 本系统是面向 AI 架构创新的数学参谋部——不是武器库,而是告诉你:**这场仗是什么仗、该用什么兵种、怎么部署、哪里会翻车。**
14
+ 本系统是面向 AI 架构创新与密码学研究的数学参谋部——不是武器库,而是告诉你:**这场仗是什么仗、该用什么兵种、怎么部署、哪里会翻车。**
15
15
 
16
16
  ## 核心原则
17
17
 
@@ -26,11 +26,11 @@ description: |
26
26
  | 层 | 职责 | 目录 | 核心问题 |
27
27
  |----|------|------|---------|
28
28
  | **思想透镜** | 诊断问题结构,推荐数学视角 | `../../lenses/*.md` | 这个问题该用什么视角看? |
29
- | **数学知识** | 提供具体数学工具(定义/定理/公式) | `../../knowledge-base/*/*.md` | 这个视角需要哪些具体数学? |
29
+ | **激活锚点** | 激活高频数学结构,并在不足时触发 Knowledge Gap Protocol | `../../knowledge-base/*/*.md` | 这个视角需要激活哪些数学结构? |
30
30
  | **设计翻译** | 把数学变成 AI 模块/loss/算子 | `../../design-patterns/*/*.md` | 这些数学怎么变成模型结构? |
31
31
 
32
32
  辅助层:
33
- - `../../references/books/*.md`:7 本书的蒸馏稿,需要深入时的完整上下文
33
+ - `../../references/books/*.md`:10 本书的蒸馏稿,需要深入时的完整上下文;其中 3 本密码学书稿见 `../../references/skill-index.md`
34
34
  - `../../references/gpu-friendly-math.md`:GPU 八维验收门(唯一权威)
35
35
  - `../../agents/math-critic.md`:数学-工程双重批判器
36
36
 
@@ -39,16 +39,16 @@ description: |
39
39
  | 场景 | 诊断信号 | 调用路径 |
40
40
  |------|---------|---------|
41
41
  | **A. 问题分析** | "这个设计合理吗?""逻辑链有没有漏洞?" | 透镜 → critic |
42
- | **B. 机制设计** | "设计新 attention""把 X 迁移到 Y" | 透镜 → 知识 → 设计 → critic |
43
- | **C. 知识查询** | "流形上的切空间是什么?""投影定理怎么用?" | 知识 |
44
- | **D. 验证审查** | "这个公式成立吗?""loss 能保证什么?" | 知识 → 相关设计模式(若引用具体 AI 构造)→ critic |
42
+ | **B. 机制设计** | "设计新 attention""把 X 迁移到 Y" | 透镜 → 激活锚点 → 设计 → critic |
43
+ | **C. 知识查询** | "流形上的切空间是什么?""投影定理怎么用?" | 激活锚点 |
44
+ | **D. 验证审查** | "这个公式成立吗?""loss 能保证什么?" | 激活锚点 → 相关设计模式(若引用具体 AI 构造)→ critic |
45
45
  | **E. 纯工程** | debug、重构、调参、代码审查 | **不调用数学系统** |
46
46
 
47
47
  ## 透镜库(15 个数学视角)
48
48
 
49
49
  15 个透镜覆盖:公理化、对偶、对称性、谱分解、几何、投影与分解、变分、局部到整体、拓扑、范畴化、扰动、因果、博弈、概率统计、算法。目录:`../../lenses/*.md`。完整目录表见 `../../references/skill-index.md`。
50
50
 
51
- ## 知识库(按数学领域组织)
51
+ ## 激活锚点(按数学领域组织)
52
52
 
53
53
  7 个领域:矩阵分析、最优化、微分几何、李理论、拓扑、概率与信息、信息几何。目录:`../../knowledge-base/*/*.md`。完整目录表见 `../../references/skill-index.md`。
54
54
 
@@ -64,36 +64,85 @@ description: |
64
64
  以下任务**无论工作区含什么**都不触发:代码审查、debug、重构、调参、构建部署、纯事实查询、通用软件工程。
65
65
 
66
66
  ### Gate 1 · 环境信号
67
- 工作区含架构核心代码(attention/transformer/MoE、`*.cu`/kernel)或研究笔记。仅 `model.py`、`trainer.py` 等常规文件**不构成**环境信号。
67
+ 工作区含架构核心代码(attention/transformer/MoE、`*.cu`/kernel)或研究笔记,**或**密码学相关代码/协议描述/安全证明草稿。仅 `model.py`、`trainer.py` 等常规文件**不构成**环境信号。
68
68
 
69
69
  ### Gate 2 · 任务信号
70
- 用户任务涉及**设计/改进**新架构/算子、**分析**理论性质、**迁移**数学结构到 AI 设计,或**查询与 AI 研究相关的数学知识**(如"切空间在优化中怎么用")。纯百科式数学查询(如"什么是群"且无 AI 上下文)不自动触发,但可通过 `/ask` 手动进入。
70
+ 用户任务涉及**设计/改进**新架构/算子、**分析**理论性质、**迁移**数学结构到 AI 设计、**分析密码学构造/安全定义/归约证明/协议**,或**查询与 AI 研究相关的数学知识**(如"切空间在优化中怎么用")。纯百科式数学或密码学事实查询不自动触发,但可通过 `/ask` 手动进入。
71
71
 
72
72
  ### Gate 3 · 意图匹配
73
73
  用户意图匹配场景 A/B/C/D 之一。纯工程任务匹配场景 E → 不介入。
74
74
 
75
75
  > **`/ask` 入口**:手动调用时跳过 Gate 1 和 Gate 2,仅执行 Gate 0(排除门)+ Gate 3(意图匹配),可直接进入任意场景包括知识查询。
76
76
 
77
+ ## Domain Router(v3.2.0 新增)
78
+
79
+ > AI 研究与密码学**共享**数学根基,但**独有**各自的专业层。Domain Router 在意图诊断后、调用透镜前,先判定问题归属,决定加载哪些锚点/书稿/设计模式,避免跨域污染与 token 浪费。
80
+
81
+ ### 三层归属判定
82
+
83
+ | 层 | 信号词示例 | 加载内容 | 独有/共用 |
84
+ |----|-----------|---------|----------|
85
+ | **AI 研究层** | attention、loss、routing、representation、compression、MoE、transformer、KV-cache、LoRA、SSM、扩散、RL | `../../knowledge-base/`(7 领域 31 锚点)+ `../../design-patterns/`(5 类 22 模式)+ AI 方向 7 本书 | AI 独有 |
86
+ | **密码学层** | 加密、签名、MAC、PRF/PRG/PRP、OWF、CCA、CPA、AE、零知识、归约证明、攻击游戏、DL/CDH/DDH、RSA、ECC、格密码 | 3 本密码学书稿 + 共用数学锚点(按需)+ 临时知识卡 | 密码独有 |
87
+ | **共用数学层** | 概率、信息论、熵、群、环、域、矩阵、谱、优化、凸性、扰动、复杂度 | `../../knowledge-base/` 中的对应锚点 + `../../lenses/` 透镜 | 共用 |
88
+
89
+ ### 路由规则
90
+
91
+ 1. **先判 domain**:从用户关键词判定主 domain(AI / 密码 / 纯数学查询)。
92
+ 2. **共用数学不重复加载**:若 domain 是密码学,共用数学锚点(如 `../../knowledge-base/probability/entropy.md`、`../../knowledge-base/matrix-analysis/spectral-decomposition.md`)按需加载,**不**加载 AI 专属的 `../../design-patterns/`。
93
+ - **"按需"判定条件**:当且仅当问题的数学结构映射到该共用锚点的核心定义/公式时加载。即问题陈述中显式出现该锚点对应的核心概念(如"谱""熵""凸""扰动"),或透镜路由/critic 明确指向该锚点。**domain 标签不决定共用锚点加载与否,问题结构决定。**
94
+ 3. **跨域时显式标注**:若问题确实是 AI×密码交叉(如"用 PRF 做模型水印""对抗样本的归约证明"),Domain Router 显式列出两个 domain 的加载项,并标注交叉点。
95
+ - **交叉点标注模板**(四元组,供 critic 第 19 维第 6 检查点审查):
96
+ 1. **密码学原语 + 安全性质**(如"PRF + 伪随机性")
97
+ 2. **AI 模块 + 功能需求**(如"水印 + 唯一可追踪性")
98
+ 3. **迁移方向**(密码→AI / AI→密码)
99
+ 4. **迁移后假设可达性**(原假设在 AI 场景是否仍可达成?如"PRF 的 PRF 假设在 ML 部署中是否可满足")
100
+ 4. **不跨域时不污染**:纯 AI 问题不加载密码学书稿;纯密码学问题不加载 AI 设计模式。避免 token 浪费与概念混淆。
101
+ 5. **缺口协议分 domain**:Knowledge Gap Protocol 生成的临时知识卡标注 domain(AI/密码/共用),便于后续升级到对应正式卡片。
102
+
103
+ ### Domain Router 判定流程图
104
+
105
+ ```
106
+ 用户问题
107
+
108
+ [Gate 0-3 触发?]
109
+ ↓ 是
110
+ Domain Router: 关键词判定主 domain
111
+ ├─ AI 研究 → 加载 knowledge-base + design-patterns + AI 书稿
112
+ ├─ 密码学 → 加载密码学书稿 + 共用数学锚点(按需)
113
+ ├─ 纯数学 → 只加载 lenses + 对应 knowledge-base 锚点
114
+ └─ AI×密码 → 双 domain 加载 + 交叉点标注
115
+
116
+ [场景 A/B/C/D 路由]
117
+
118
+ [透镜 → 锚点/书稿 → 设计翻译(仅 AI)/ 归约模板(仅密码)→ critic]
119
+ ```
120
+
77
121
  ## 主流程
78
122
 
79
123
  ### 第一步:诊断意图
80
124
  1. 判断用户意图属于场景 A/B/C/D/E 哪个
81
- 2. 提取问题核心张力:想保留什么?想抑制什么?约束是什么?工程瓶颈是什么?
82
- 3. 输出问题类型分类
125
+ 2. **Domain Router 判定**:问题归属(AI / 密码 / 纯数学 / 交叉)
126
+ 3. 提取问题核心张力:想保留什么?想抑制什么?约束是什么?工程瓶颈是什么?
127
+ 4. 输出问题类型分类 + domain 标注
83
128
 
84
129
  ### 第二步:路由调用
85
130
 
86
131
  ```
87
132
  场景 A(分析):选 1-3 个透镜 → 输出视角诊断 → critic 审查
88
133
  场景 B(设计):选 1-3 个透镜 → 调用相关激活锚点;若无覆盖则进入 Knowledge Gap Protocol → 生成正式/临时设计模式 → critic 审查
89
- 场景 C(查询):优先加载相关激活锚点;若无覆盖则生成临时知识卡 按知识激活协议输出
134
+ · AI domain:设计模式来自 design-patterns/,产出 attention/loss/routing/representation/compression
135
+ · 密码 domain:设计模式来自密码学书稿的构造范式(SPN/Feistel/Merkle-Damgård/KEM-DEM/Fiat-Shamir),产出加密/MAC/签名/协议
136
+ 场景 C(查询):优先加载相关激活锚点或密码学书稿;若无覆盖则生成临时知识卡 → 按知识激活协议输出
90
137
  场景 D(验证):加载相关锚点或临时知识卡 → critic 审查条件与边界
138
+ · AI domain:过 GPU 八维验收门
139
+ · 密码 domain:过归约紧度 + 假设依赖 + 实现陷阱检查(不必过 GPU 门)
91
140
  场景 E(工程):不介入
92
141
  ```
93
142
 
94
143
  ### 第三步:输出格式
95
144
 
96
- **Token 经济原则**:以下是最长结构,不是默认全文模板。按用户问题裁剪;简单知识查询只给必要定义/公式/风险,设计与 GPU 内容只在与问题有关时展开;避免复述已加载卡片全文。
145
+ **Token 经济原则**:以下是最长结构,不是默认全文模板。按用户问题裁剪;简单知识查询只给必要定义/公式/风险,设计与 GPU/归约内容只在与问题有关时展开;避免复述已加载卡片全文;**Domain Router 已判定 domain 后,只展开该 domain 的专属小节**。
97
146
 
98
147
  **场景 A/B 输出**:
99
148
  1. **[诊断]** 问题类型 + 核心张力
@@ -137,7 +186,7 @@ description: |
137
186
  ## 深度查阅协议
138
187
 
139
188
  - **轻度**:读知识卡片(`../../knowledge-base/*/*.md`),自足可用
140
- - **中度**:读书蒸馏稿(`../../references/books/*.md`),获取更完整上下文
189
+ - **中度**:读书蒸馏稿(`../../references/books/*.md`),获取更完整上下文;密码学问题优先查阅 `../../references/skill-index.md` 列出的 3 本专门书稿
141
190
  - **深度**:本机有 `math_book/<PDF>` 时,Agent 自动 `pdftotext` + grep 定位原文页
142
191
 
143
192
  ## 知识缺口协议 / Knowledge Gap Protocol