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.
package/README.en-US.md CHANGED
@@ -2,9 +2,7 @@
2
2
  <a href="README.md">中文</a> | <a href="README.en-US.md">English</a>
3
3
  </p>
4
4
 
5
- # 📐 Math Skill A Mathematical Research Operating System for AI Architecture Design
6
-
7
- > **The thinking system does not hand out theorems. The knowledge system does not improvise inspiration. The design layer does not fake profundity.**
5
+ # 📐 Math Skill: A Mathematical Research Operating System for AI and Cryptography Innovation
8
6
 
9
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
10
8
  [![npm version](https://img.shields.io/npm/v/math-skill.svg)](https://www.npmjs.com/package/math-skill)
@@ -16,6 +14,14 @@
16
14
 
17
15
  ---
18
16
 
17
+ ## 📢 Community Announcements
18
+
19
+ > **This skill is under rapid iteration — your feedback and suggestions are warmly welcome!** Your input is the core driver of our continuous evolution. Feel free to reach out via GitHub Issues or Discussions.
20
+
21
+ > **v3.2.0 is live**: The cryptography track is officially integrated — 3 distilled classics of modern cryptography (Boneh-Shoup / Goldreich / Katz-Lindell) plus a Domain Router layer. AI and cryptography share mathematical foundations but each has exclusive specialty layers, with no cross-domain pollution. See the changelog for details.
22
+
23
+ ---
24
+
19
25
  ## Inspiration
20
26
 
21
27
  The story of Sophus Lie forging a "dragon-slaying blade" tells us this: the Lie group–Lie algebra machinery invented to solve differential equations ended up becoming the lingua franca for describing symmetry and robot state estimation — the value of a mathematical tool far outlives its original intent, which is exactly the prototype of "cross-domain activation." See [`references/inspiration.en.md`](references/inspiration.en.md).
@@ -58,9 +64,22 @@ Critic: Mathematically sound? Engineering-feasible?
58
64
  | **Design Translation** | Bridge math to AI modules/losses/operators | `design-patterns/*/*.md` | 22 |
59
65
 
60
66
  Supporting layers:
61
- - `references/books/*.md`: 7 book distillations for deep context
67
+ - `references/books/*.md`: 10 book distillations (7 AI-direction + 3 cryptography-direction) for deep context
62
68
  - `references/gpu-friendly-math.en.md`: GPU 8-dimension acceptance gate
63
- - `agents/math-critic.en.md`: Math-engineering dual critic
69
+ - `agents/math-critic.en.md`: Math-engineering dual critic (19 dimensions, including cryptographic security review)
70
+
71
+ ### Domain Router (new in v3.2.0)
72
+
73
+ AI research and cryptography **share** mathematical foundations (probability/information/algebra/matrix/spectrum/optimization) 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.
74
+
75
+ | Domain | Loaded Content | Signal Keywords |
76
+ |--------|----------------|------------------|
77
+ | **AI Research** | `knowledge-base/` (7 domains, 31 anchors) + `design-patterns/` (5 types, 22 patterns) + 7 AI books | attention/loss/routing/representation/compression/MoE/transformer/KV-cache/LoRA/SSM/diffusion/RL |
78
+ | **Cryptography** | 3 crypto books + shared math anchors (on demand) | encryption/signature/MAC/PRF/PRG/PRP/OWF/CCA/CPA/AE/ZK/reduction/DL/CDH/DDH/RSA/ECC/lattice |
79
+ | **Pure Math** | `lenses/` + corresponding `knowledge-base/` anchors | probability/information/entropy/group/ring/field/matrix/spectrum/optimization/convexity/perturbation/complexity |
80
+ | **AI×Crypto** | dual-domain load + intersection annotation | "PRF for watermarking," "adversarial example reduction," "verifiable inference" |
81
+
82
+ > Rules: domain judgment precedes lens invocation; shared math is not redundantly loaded; no pollution across non-cross domains; gap-protocol temporary cards are domain-tagged.
64
83
 
65
84
  ### 15 Thinking Lenses
66
85
 
@@ -84,7 +103,7 @@ Supporting layers:
84
103
 
85
104
  ### Activation Anchors (by math domain)
86
105
 
87
- | Domain | Cards |
106
+ | Domain | Anchors |
88
107
  |--------|-------|
89
108
  | Matrix Analysis | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
90
109
  | Optimization | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
@@ -127,9 +146,9 @@ git clone https://github.com/the-thinker0/math-skill.git
127
146
  | Scenario | Signal | Path |
128
147
  |----------|--------|------|
129
148
  | Problem Analysis | "Is this design sound?" | Lenses → Critic |
130
- | Mechanism Design | "Design a new attention" | Lenses → Knowledge → Design → Critic |
131
- | Knowledge Query | "What is tangent space and how does it relate to gradient optimization?" | Knowledge |
132
- | Verification | "Does this formula hold?" | Knowledge → Critic |
149
+ | Mechanism Design | "Design a new attention" | Lenses → Anchors / Temporary Card → Design → Critic |
150
+ | Knowledge Query | "What is tangent space and how does it relate to gradient optimization?" | Anchors; Knowledge Gap Protocol if insufficient |
151
+ | Verification | "Does this formula hold?" | Anchors / Temporary Card → Critic |
133
152
  | Pure Engineering | debug, refactoring, tuning | **Not triggered** |
134
153
 
135
154
  **Manual trigger**:
@@ -158,10 +177,11 @@ Step 2 Lens Selection:
158
177
  2. Information-theoretic (preserve max mutual information states)
159
178
  3. Topological (preserve key connection points in sequence structure)
160
179
 
161
- Step 3 Knowledge Query:
162
- → low-rank-approximation (matrix analysis)
163
- → leverage-score-selection (matrix analysis)
164
- → information-bottleneck (probability & information)
180
+ Step 3 Activation Anchors:
181
+ → low-rank-approximation (Matrix Analysis anchor)
182
+ → leverage-score-selection (Design Pattern: compression)
183
+ → information-bottleneck (Probability & Information anchor)
184
+ If existing anchors are insufficient, enter Knowledge Gap Protocol to generate a temporary knowledge card.
165
185
 
166
186
  Step 4 Design Translation:
167
187
  Candidate A: Spectral KV Compression (low-rank + leverage score)
@@ -182,7 +202,7 @@ math-skill/
182
202
  ├── skills/
183
203
  │ └── math-research-activator/ # Orchestrator: intent diagnosis + routing
184
204
  ├── lenses/ # 15 thinking lenses (reasoning methodology)
185
- ├── knowledge-base/ # Math knowledge (by domain)
205
+ ├── knowledge-base/ # Activation anchors by math domain, not a closed encyclopedia
186
206
  │ ├── matrix-analysis/ # Matrix analysis (5 cards)
187
207
  │ ├── optimization/ # Optimization (5 cards)
188
208
  │ ├── differential-geometry/ # Differential geometry (6 cards)
@@ -197,11 +217,11 @@ math-skill/
197
217
  │ ├── representation/ # Representation (4 patterns)
198
218
  │ └── compression/ # Compression (4 patterns)
199
219
  ├── references/ # Reference layer
200
- │ ├── books/ # 7 book distillations
220
+ │ ├── books/ # 10 book distillations (7 AI + 3 crypto)
201
221
  │ ├── gpu-friendly-math.en.md # GPU 8-dimension gate
202
222
  │ ├── agentic-workflow.en.md # Collaboration style
203
223
  │ └── inspiration.en.md # Inspiration
204
- ├── agents/math-critic.en.md # Math-engineering dual critic
224
+ ├── agents/math-critic.en.md # Math-engineering dual critic (19 dims, with crypto security review)
205
225
  ├── commands/ask.en.md # /ask manual entry
206
226
  ├── math_book/ # Local PDFs (not published)
207
227
  └── README.md / LICENSE
@@ -211,15 +231,27 @@ math-skill/
211
231
 
212
232
  ## Recommended Books
213
233
 
234
+ ### AI Direction (7 books)
235
+
236
+ | # | Title | Author(s) | Publisher / Edition | Year | ISBN | Distillation |
237
+ |---|-------|-----------|-------------------|------|------|-------------|
238
+ | 1 | *Contemporary Abstract Algebra* | Joseph A. Gallian | Brooks/Cole, Cengage, 8th ed. | 2013 | 978-1-133-59971-5 | `abstract-algebra.en.md` |
239
+ | 2 | *The Rising Sea: Foundations of Algebraic Geometry* | Ravi Vakil | Princeton University Press | 2025 | 978-0-691-26866-8 | `algebraic-geometry-rising-sea.en.md` |
240
+ | 3 | *Manifolds and Differential Geometry* | Jeffrey M. Lee | AMS, Graduate Studies in Math Vol. 107 | 2009 | 978-0-8218-4815-9 | `differential-geometry.en.md` |
241
+ | 4 | *Matrix Analysis* | Roger A. Horn, Charles R. Johnson | Cambridge University Press, 2nd ed. | 2013 | 978-0-521-83940-2 | `matrix-analysis.en.md` |
242
+ | 5 | *A micro Lie theory for state estimation in robotics* | Joan Solà et al. | arXiv:1812.01537v9 | 2021 | — | `micro-lie-theory.en.md` |
243
+ | 6 | *An Introduction to Optimization, With Applications to ML* | Chong, Lu, Żak | John Wiley & Sons, 5th ed. | 2024 | 978-1-119-87763-9 | `optimization-ml.en.md` |
244
+ | 7 | *Introduction to Smooth Manifolds* | John M. Lee | Springer, GTM 218, 2nd ed. | 2013 | 978-1-4419-9981-8 | `smooth-manifolds.en.md` |
245
+
246
+ ### Cryptography Direction (3 books, new in v3.2.0)
247
+
214
248
  | # | Title | Author(s) | Publisher / Edition | Year | ISBN | Distillation |
215
249
  |---|-------|-----------|-------------------|------|------|-------------|
216
- | 1 | *Contemporary Abstract Algebra* | Joseph A. Gallian | Brooks/Cole, Cengage, 8th ed. | 2013 | 978-1-133-59971-5 | `abstract-algebra.md` |
217
- | 2 | *The Rising Sea: Foundations of Algebraic Geometry* | Ravi Vakil | Princeton University Press | 2025 | 978-0-691-26866-8 | `algebraic-geometry-rising-sea.md` |
218
- | 3 | *Manifolds and Differential Geometry* | Jeffrey M. Lee | AMS, Graduate Studies in Math Vol. 107 | 2009 | 978-0-8218-4815-9 | `differential-geometry.md` |
219
- | 4 | *Matrix Analysis* | Roger A. Horn, Charles R. Johnson | Cambridge University Press, 2nd ed. | 2013 | 978-0-521-83940-2 | `matrix-analysis.md` |
220
- | 5 | *A micro Lie theory for state estimation in robotics* | Joan Solà et al. | arXiv:1812.01537v9 | 2021 | | `micro-lie-theory.md` |
221
- | 6 | *An Introduction to Optimization, With Applications to ML* | Chong, Lu, Żak | John Wiley & Sons, 5th ed. | 2024 | 978-1-119-87763-9 | `optimization-ml.md` |
222
- | 7 | *Introduction to Smooth Manifolds* | John M. Lee | Springer, GTM 218, 2nd ed. | 2013 | 978-1-4419-9981-8 | `smooth-manifolds.md` |
250
+ | 8 | *A Graduate Course in Applied Cryptography* | Dan Boneh & Victor Shoup | v0.4 online | 2017 | | `applied-cryptography.md` |
251
+ | 9 | *Foundations of Cryptography, Volume 1: Basic Tools* | Oded Goldreich | Cambridge University Press | 2001 | 978-0-521-79235-9 | `foundations-of-cryptography.md` |
252
+ | 10 | *Introduction to Modern Cryptography* | Jonathan Katz & Yehuda Lindell | CRC Press, 2nd ed. | 2015 | 978-1-4665-7026-1 | `introduction-to-modern-cryptography.md` |
253
+
254
+ > Crypto book contents are already in English, so they use the `.md` suffix (no CN/EN split). They are loaded when Domain Router determines the problem is cryptography or AI×crypto intersection.
223
255
 
224
256
  Distillation files ship with the npm package. For full-fidelity lookups, place PDFs in the `math_book/` folder.
225
257
 
@@ -227,6 +259,34 @@ Distillation files ship with the npm package. For full-fidelity lookups, place P
227
259
 
228
260
  ## Changelog
229
261
 
262
+ ### v3.2.0 — Cryptography Track + Domain Router
263
+
264
+ **Cryptography track officially landed**: reference layer expanded from 7 to 10 books, with 3 modern cryptography classics distilled into the same activation-index format as AI-direction books (~125-155 lines each, preserving core ideas and key bridging facts).
265
+
266
+ - **3 new crypto books**:
267
+ - `references/books/applied-cryptography.md` (Boneh & Shoup): attack games / reduction proofs / constructions / protocols
268
+ - `references/books/foundations-of-cryptography.md` (Goldreich): computational indistinguishability / OWF-PRG-PRF equivalence chain / simulation paradigm / meta-theorems
269
+ - `references/books/introduction-to-modern-cryptography.md` (Katz & Lindell): formal definitions / CPA-CCA-AE / construction paradigms / implementation pitfalls
270
+ - **Domain Router** (core innovation): after intent diagnosis and before lens invocation, judges problem domain (AI/Crypto/pure-math/intersection), loads domain-specific content, shared math not redundantly loaded, avoids cross-domain pollution and token waste
271
+ - **SKILL.md / SKILL.en.md**: new Domain Router section + routing rules + decision flow diagram; main workflow integrates domain tags and domain-specific routing (AI uses design-patterns + GPU gate; crypto uses reduction templates + assumption/pitfall checks)
272
+ - **math-critic upgraded to 19 dimensions**: new dim 19 "Cryptographic Security Review" (security definitions / reduction tightness / assumption dependency / composition pitfalls / anti-patterns / cross-domain transfer validity / Domain Router consistency)
273
+ - **skill-index / overview**: added Domain Router overview table and crypto book activation-family tags; overview gained Domain Router loading note
274
+ - **Token optimization**: crypto books compressed from 2084 to 404 lines (~80% reduction); Domain Router trims output by domain, avoiding full-load; output format emphasizes "after domain judgment, only expand the domain-specific subsection". Quantified estimate: pure AI problems skip the 3 crypto books entirely (saving ~400 lines/call), pure crypto problems skip all 22 AI design-patterns (saving ~2200-3300 lines/call); the crypto books' own compression saves another ~872 lines/call
275
+ - **File cleanup**: removed duplicate `SKILL.md/SKILL.en.md/original-texts.md/original-texts.en.md` mistakenly placed in repo root by the contributor (canonical versions live in `skills/math-research-activator/`); fixed SKILL relative paths in `agents/math-critic.{en,}.md` and `knowledge-base/overview.en.md`
276
+ - **AI/Cryptography isolation guarantee**: Domain Router rule 4 explicitly states "pure AI problems do not load crypto books; pure crypto problems do not load AI design patterns," preventing conceptual confusion at the loading layer
277
+
278
+ ### v3.1.1 — Terminology Consistency Cleanup
279
+
280
+ - **skill-index alignment**: title, knowledge base section, and workflow example updated from "knowledge base / knowledge query" to "activation anchors"
281
+ - **package.json description**: updated to new positioning
282
+ - **README usage table**: mechanism design, knowledge query, and verification paths updated from "Knowledge" to "Anchors / Temporary Card"
283
+ - **README workflow example**: Step 3 changed from "Knowledge Query" to "Activation Anchors"; `leverage-score-selection` label corrected from "matrix analysis" to "Design Pattern: compression"
284
+ - **README directory structure**: `knowledge-base/` comment updated from "Math knowledge" to "Activation anchors"
285
+ - **README activation anchors table**: column header changed from "Cards" to "Anchors"
286
+ - **SKILL.md / SKILL.en.md**: three-layer architecture table and intent diagnosis table updated from "Math Knowledge" to "Activation Anchors"
287
+ - **English README book links**: distillation files changed from `.md` to `.en.md`
288
+ - **validate keywords**: checks updated from "Math Knowledge" to "Activation Anchors"
289
+
230
290
  ### v3.1.0 — Activation Anchors & Knowledge Gap Protocol
231
291
 
232
292
  **Repositioning**: from "math knowledge base" to "math activation system" — the knowledge base is not a closed encyclopedia but a collection of activation anchors.
package/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
  <a href="README.md">中文</a> | <a href="README.en-US.md">English</a>
3
3
  </p>
4
4
 
5
- # 📐 Math Skill 面向 AI 架构创新的数学研究操作系统
6
-
7
- > **思想系统不负责给定理,知识系统不负责乱启发,设计层不负责装深刻。**
5
+ # 📐 Math Skill: 面向 AI 与密码学创新的数学研究操作系统
8
6
 
9
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
10
8
  [![npm version](https://img.shields.io/npm/v/math-skill.svg)](https://www.npmjs.com/package/math-skill)
@@ -16,6 +14,14 @@
16
14
 
17
15
  ---
18
16
 
17
+ ## 📢 社区公告
18
+
19
+ > **本 Skill 正在快速迭代中,欢迎各位使用者提出宝贵的使用感受和改进建议!** 你的反馈是我们持续进化的核心动力。欢迎通过 GitHub Issues 或 Discussions 与我们交流。
20
+
21
+ > **v3.2.0 已上线**:密码学方向正式接入——3 本现代密码学经典(Boneh-Shoup / Goldreich / Katz-Lindell)精简蒸馏稿 + Domain Router 路由层,AI 与密码学共享数学根基、独有专业层,互不污染。详见变更日志。
22
+
23
+ ---
24
+
19
25
  ## 灵感来源
20
26
 
21
27
  Sophus Lie 打造"屠龙刀"的故事告诉我们:为解微分方程发明的李群-李代数,最终成为描述对称性、机器人状态估计的通用语言——数学工具的价值远超初衷,这正是「跨领域激活」的原型。详见 [`references/inspiration.md`](references/inspiration.md)。
@@ -58,9 +64,22 @@ Sophus Lie 打造"屠龙刀"的故事告诉我们:为解微分方程发明的
58
64
  | **设计翻译** | 把数学变成 AI 模块/loss/算子 | `design-patterns/*/*.md` | 22 |
59
65
 
60
66
  辅助层:
61
- - `references/books/*.md`:7 本书蒸馏稿,需要深入时的完整上下文
67
+ - `references/books/*.md`:10 本书蒸馏稿(7 本 AI 方向 + 3 本密码学方向),需要深入时的完整上下文
62
68
  - `references/gpu-friendly-math.md`:GPU 八维验收门
63
- - `agents/math-critic.md`:数学-工程双重批判器
69
+ - `agents/math-critic.md`:数学-工程双重批判器(19 维,含密码学安全审视)
70
+
71
+ ### Domain Router(v3.2.0 新增)
72
+
73
+ AI 研究与密码学**共享**数学根基(概率/信息/代数/矩阵/谱/优化),但**独有**各自专业层。Domain Router 在意图诊断后、调用透镜前,先判定问题归属,决定加载哪些锚点/书稿/设计模式,避免跨域污染与 token 浪费。
74
+
75
+ | Domain | 加载内容 | 信号词 |
76
+ |--------|---------|--------|
77
+ | **AI 研究** | `knowledge-base/`(7 领域 31 锚点)+ `design-patterns/`(5 类 22 模式)+ AI 方向 7 本书 | attention/loss/routing/representation/compression/MoE/transformer/KV-cache/LoRA/SSM/扩散/RL |
78
+ | **密码学** | 3 本密码学书稿 + 共用数学锚点(按需) | 加密/签名/MAC/PRF/PRG/PRP/OWF/CCA/CPA/AE/零知识/归约/DL/CDH/DDH/RSA/ECC/格密码 |
79
+ | **纯数学** | `lenses/` + `knowledge-base/` 对应锚点 | 概率/信息/熵/群/环/域/矩阵/谱/优化/凸性/扰动/复杂度 |
80
+ | **AI×密码交叉** | 双 domain 加载 + 交叉点标注 | "PRF 做模型水印""对抗样本归约""可验证推理" |
81
+
82
+ > 规则:domain 判定先于透镜调用;共用数学不重复加载;不跨域时不污染;缺口协议临时卡标注 domain。
64
83
 
65
84
  ### 15 个思想透镜
66
85
 
@@ -84,7 +103,7 @@ Sophus Lie 打造"屠龙刀"的故事告诉我们:为解微分方程发明的
84
103
 
85
104
  ### 激活锚点(按数学领域)
86
105
 
87
- | 领域 | 知识卡片 |
106
+ | 领域 | 锚点 |
88
107
  |------|---------|
89
108
  | 矩阵分析 | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
90
109
  | 最优化 | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
@@ -127,9 +146,9 @@ git clone https://github.com/the-thinker0/math-skill.git
127
146
  | 场景 | 诊断信号 | 调用路径 |
128
147
  |------|---------|---------|
129
148
  | 问题分析 | "这个设计合理吗?" | 透镜 → critic |
130
- | 机制设计 | "设计新 attention" | 透镜 → 知识设计 → critic |
131
- | 知识查询 | "切空间和梯度优化有什么关系?" | 知识 |
132
- | 验证审查 | "这个公式成立吗?" | 知识 → critic |
149
+ | 机制设计 | "设计新 attention" | 透镜 → 激活锚点/临时知识卡设计翻译 → critic |
150
+ | 知识查询 | "切空间和梯度优化有什么关系?" | 激活锚点;不足则 Knowledge Gap Protocol |
151
+ | 验证审查 | "这个公式成立吗?" | 激活锚点/临时知识卡 → critic |
133
152
  | 纯工程 | debug、重构、调参 | **不调用** |
134
153
 
135
154
  **手动触发**:
@@ -158,10 +177,11 @@ git clone https://github.com/the-thinker0/math-skill.git
158
177
  2. 信息论(保留最大互信息状态)
159
178
  3. 拓扑(保留序列结构关键连接点)
160
179
 
161
- 第三步 知识查询:
162
- → low-rank-approximation(矩阵分析)
163
- → leverage-score-selection(矩阵分析)
164
- → information-bottleneck(概率与信息)
180
+ 第三步 激活锚点:
181
+ → low-rank-approximation(矩阵分析锚点)
182
+ → leverage-score-selection(压缩设计模式)
183
+ → information-bottleneck(概率与信息锚点)
184
+ 若现有锚点不足,进入 Knowledge Gap Protocol 生成临时知识卡。
165
185
 
166
186
  第四步 设计翻译:
167
187
  候选 A:Spectral KV Compression(低秩 + leverage score)
@@ -182,7 +202,7 @@ math-skill/
182
202
  ├── skills/
183
203
  │ └── math-research-activator/ # 总控:意图诊断 + 路由
184
204
  ├── lenses/ # 15 个思想透镜(推理方法论)
185
- ├── knowledge-base/ # 数学知识库(按领域组织)
205
+ ├── knowledge-base/ # 激活锚点(按数学领域组织,非封闭百科)
186
206
  │ ├── matrix-analysis/ # 矩阵分析(5 卡片)
187
207
  │ ├── optimization/ # 最优化(5 卡片)
188
208
  │ ├── differential-geometry/ # 微分几何(6 卡片)
@@ -197,11 +217,11 @@ math-skill/
197
217
  │ ├── representation/ # 表示(4 模式)
198
218
  │ └── compression/ # 压缩(4 模式)
199
219
  ├── references/ # 参考层
200
- │ ├── books/ # 7 本书蒸馏稿
220
+ │ ├── books/ # 10 本书蒸馏稿(7 AI + 3 密码学)
201
221
  │ ├── gpu-friendly-math.md # GPU 八维验收门
202
222
  │ ├── agentic-workflow.md # 协作方式
203
223
  │ └── inspiration.md # 灵感来源
204
- ├── agents/math-critic.md # 数学-工程双重批判器
224
+ ├── agents/math-critic.md # 数学-工程双重批判器(19 维,含密码学安全审视)
205
225
  ├── commands/ask.md # /ask 手动入口
206
226
  ├── math_book/ # 本地 PDF(不发布)
207
227
  └── README.md / LICENSE
@@ -211,6 +231,8 @@ math-skill/
211
231
 
212
232
  ## 推荐书目
213
233
 
234
+ ### AI 方向(7 本)
235
+
214
236
  | # | 书名 | 作者 | 出版社 / 版次 | 年份 | ISBN | 蒸馏文件 |
215
237
  |---|------|------|-------------|------|------|---------|
216
238
  | 1 | *Contemporary Abstract Algebra* | Joseph A. Gallian | Brooks/Cole, Cengage, 8th ed. | 2013 | 978-1-133-59971-5 | `abstract-algebra.md` |
@@ -221,12 +243,50 @@ math-skill/
221
243
  | 6 | *An Introduction to Optimization, With Applications to ML* | Chong, Lu, Żak | John Wiley & Sons, 5th ed. | 2024 | 978-1-119-87763-9 | `optimization-ml.md` |
222
244
  | 7 | *Introduction to Smooth Manifolds* | John M. Lee | Springer, GTM 218, 2nd ed. | 2013 | 978-1-4419-9981-8 | `smooth-manifolds.md` |
223
245
 
246
+ ### 密码学方向(3 本,v3.2.0 新增)
247
+
248
+ | # | 书名 | 作者 | 出版社 / 版次 | 年份 | ISBN | 蒸馏文件 |
249
+ |---|------|------|-------------|------|------|---------|
250
+ | 8 | *A Graduate Course in Applied Cryptography* | Dan Boneh & Victor Shoup | v0.4 在线版 | 2017 | — | `applied-cryptography.md` |
251
+ | 9 | *Foundations of Cryptography, Volume 1: Basic Tools* | Oded Goldreich | Cambridge University Press | 2001 | 978-0-521-79235-9 | `foundations-of-cryptography.md` |
252
+ | 10 | *Introduction to Modern Cryptography* | Jonathan Katz & Yehuda Lindell | CRC Press, 2nd ed. | 2015 | 978-1-4665-7026-1 | `introduction-to-modern-cryptography.md` |
253
+
254
+ > 密码学书稿正文为英文,沿用 `.md` 后缀(不分中英);Domain Router 判定为密码学或 AI×密码交叉时加载。
255
+
224
256
  蒸馏文件已随 npm 包发布。如需全保真原文,将 PDF 放入 `math_book/` 文件夹即可。
225
257
 
226
258
  ---
227
259
 
228
260
  ## 变更日志
229
261
 
262
+ ### v3.2.0 — 密码学方向接入 + Domain Router
263
+
264
+ **密码学方向正式落地**:参考层从 7 本扩到 10 本,新增 3 本现代密码学经典蒸馏稿,精简为与 AI 方向书稿一致的激活索引格式(约 125-155 行/本,保留核心思想与关键桥接事实)。
265
+
266
+ - **新增 3 本密码学书稿**:
267
+ - `references/books/applied-cryptography.md`(Boneh & Shoup):攻击游戏/归约证明/构造/协议
268
+ - `references/books/foundations-of-cryptography.md`(Goldreich):计算不可区分/OWF-PRG-PRF 等价链/模拟范式/元定理
269
+ - `references/books/introduction-to-modern-cryptography.md`(Katz & Lindell):形式化定义/CPA-CCA-AE/构造范式/实现陷阱
270
+ - **Domain Router 路由层**(核心创新):在意图诊断后、透镜调用前判定问题 domain(AI/密码/纯数学/交叉),按 domain 加载专属内容,共用数学不重复加载,避免跨域污染与 token 浪费
271
+ - **SKILL.md / SKILL.en.md**:新增 Domain Router 小节 + 路由规则 + 判定流程图;主流程整合 domain 标注与 domain-specific 路由(AI 走 design-patterns + GPU 门,密码走归约模板 + 假设/陷阱检查)
272
+ - **math-critic 升级为 19 维**:新增第 19 维「密码学安全审视」(安全定义/归约紧度/假设依赖/合成陷阱/反模式/跨域迁移合理性/Domain Router 一致性)
273
+ - **skill-index / overview**:补 Domain Router 总览表与密码学书稿激活家族标注;overview 增 Domain Router 加载提示
274
+ - **Token 优化**:密码学书稿从 2084 行精简到 404 行(压缩 ~80%);Domain Router 按 domain 裁剪输出,避免全量加载;输出格式强调"domain 判定后只展开该 domain 专属小节"。量化估算:纯 AI 问题完全不加载 3 本密码学书稿(省约 400 行/次),纯密码学问题完全不加载 22 个 AI design-patterns(省约 2200-3300 行/次);密码学书稿本身的精简再省约 872 行/次
275
+ - **文件清理**:删除朋友误放在根目录的重复 `SKILL.md/SKILL.en.md/original-texts.md/original-texts.en.md`(权威版本在 `skills/math-research-activator/`);修正 `agents/math-critic.{en,}.md` 与 `knowledge-base/overview.en.md` 中的 SKILL 相对路径
276
+ - **AI 与密码学隔离保证**:Domain Router 规则 4 明确"纯 AI 问题不加载密码学书稿;纯密码学问题不加载 AI 设计模式",从加载层防止概念混淆
277
+
278
+ ### v3.1.1 — 术语闭环清洁
279
+
280
+ - **skill-index 口径统一**:标题、知识库小节、工作流范例从"知识库/知识查询"改为"激活锚点"
281
+ - **package.json description**:更新为新定位描述
282
+ - **README 使用表**:机制设计、知识查询、验证审查路径从"知识"改为"激活锚点/临时知识卡"
283
+ - **README 工作流范例**:第三步从"知识查询"改为"激活锚点",`leverage-score-selection` 标签从"矩阵分析"改为"压缩设计模式"
284
+ - **README 目录结构**:`knowledge-base/` 注释从"数学知识库"改为"激活锚点"
285
+ - **README 激活锚点表头**:列名从"知识卡片"改为"锚点"
286
+ - **SKILL.md / SKILL.en.md**:三层架构表和意图诊断表从"数学知识/Math Knowledge"改为"激活锚点/Activation Anchors"
287
+ - **英文 README 书目链接**:蒸馏文件从 `.md` 改为 `.en.md`
288
+ - **validate 关键词**:从检查"数学知识/Math Knowledge"改为"激活锚点/Activation Anchors"
289
+
230
290
  ### v3.1.0 — 激活锚点与知识缺口协议
231
291
 
232
292
  **定位升级**:从"数学知识库"转为"数学激活系统"——知识库不是封闭百科,而是激活锚点集合。
@@ -26,7 +26,7 @@ You should give equal weight to two categories of responsibility: on one hand, s
26
26
 
27
27
  ## Review Dimensions
28
28
 
29
- The first 15 dimensions cover the core review angles — assumptions, logic, models, computation — most of which correspond to the v3 thinking lenses in `../lenses/`; Dimensions 16–18 are cross-cutting: tool selection, GPU feasibility, and modern math activation. **Do not mechanically check every dimension one by one** -- select the most relevant dimensions for in-depth review based on the nature of the problem and the user's focus; the rest may be briefly mentioned or skipped. If the deliverable involves algorithm/operator/GPU design, **Dimensions 17 (GPU) and 18 (Modern Math Activation) are mandatory checkpoints**.
29
+ The first 15 dimensions cover the core review angles — assumptions, logic, models, computation — most of which correspond to the v3 thinking lenses in `../lenses/`; Dimensions 16–19 are cross-cutting: tool selection, GPU feasibility, modern math activation, and cryptographic security. **Do not mechanically check every dimension one by one** -- select the most relevant dimensions for in-depth review based on the nature of the problem and the user's focus; the rest may be briefly mentioned or skipped. If the deliverable involves algorithm/operator/GPU design, **Dimensions 17 (GPU) and 18 (Modern Math Activation) are mandatory checkpoints**; if the deliverable involves cryptographic constructions / security proofs / protocols, **Dimension 19 (Cryptographic Security) is a mandatory checkpoint**.
30
30
 
31
31
  ### 1. Assumption Review -> axiomatization lens
32
32
 
@@ -151,13 +151,25 @@ The first 15 dimensions cover the core review angles — assumptions, logic, mod
151
151
  - Is the transfer a "cross-domain activation" (the structure already exists; only a cross-domain mapping is missing), or is it a forced transplant (borrowing terminology without borrowing structure)?
152
152
  - Does the deliverable simultaneously pass the **dual-acceptance gate**: mathematically correct **AND** (friendly or retrofittable on the eight dimensions)? Are candidates that fail either criterion eliminated?
153
153
 
154
+ ### 19. Cryptographic Security Review -> `../references/books/` (3 crypto books)
155
+
156
+ > **Mandatory** when the deliverable involves cryptographic constructions / security proofs / protocol design (triggered when Domain Router determines the problem is cryptography or AI×crypto intersection). Corresponds to the cryptographic version of the "dual-acceptance gate": security definitions correct **AND** reduction tightness acceptable.
157
+
158
+ - **Security definitions**: Is the security goal defined via a formal attack game? Does the threat-model tier (CPA/CCA/AE/EUF-CMA) match the requirement? Avoid "intuitively secure" hand-waving.
159
+ - **Reduction tightness**: How large is Q in the reduction loss ε_scheme ≈ Q·ε_assumption? Are parameters compensated? Does the proof claim "loose reduction = secure"?
160
+ - **Assumption dependency**: Which assumption does the scheme rely on (OWF/DL/CDH/DDH/RSA/LWE)? Is it minimized? Are black-box separation results relevant? Does it need upgrading under quantum threats (Shor/Grover)?
161
+ - **Composition & implementation pitfalls**: Is EtM/MtE/EaM chosen correctly? Are keys independent? Are IVs/nonces unique? Is MAC comparison constant-time? Is context (identity/transcript) bound?
162
+ - **Anti-pattern check**: Is ROM treated as an absolute guarantee? Is deterministic encryption treated as CPA-secure? Is Merkle-Damgård treated as ROM? Plain RSA signatures?
163
+ - **Cross-domain transfer validity** (AI×crypto only): When transferring cryptographic concepts to ML (e.g., PRF for watermarking, reductions for robustness certificates), are security semantics preserved, or is only terminology borrowed? Are assumptions still achievable after transfer?
164
+ - **Domain Router consistency**: Does a pure crypto problem avoid loading AI design-patterns? Does a pure AI problem avoid loading crypto books? Does an intersection problem load both and annotate intersection points?
165
+
154
166
  ## Workflow
155
167
 
156
168
  ### Review Phase
157
169
 
158
170
  1. **Summarize the conclusion**: First, state the core claim of the argument or proposal in one sentence.
159
171
  2. **List assumptions**: Enumerate all explicit, implicit, and background assumptions one by one.
160
- 3. **Select dimensions**: Based on the nature of the problem, choose the 3-5 most relevant review dimensions from the eighteen for in-depth inspection; if algorithm/GPU design is involved, **Dimensions 17 and 18 are mandatory**. The remaining dimensions may be briefly mentioned or skipped.
172
+ 3. **Select dimensions**: Based on the nature of the problem, choose the 3-5 most relevant review dimensions from the nineteen for in-depth inspection; if algorithm/GPU design is involved, **Dimensions 17 and 18 are mandatory**; if cryptography is involved, **Dimension 19 is mandatory**. The remaining dimensions may be briefly mentioned or skipped.
161
173
  4. **Check the logical chain**: Verify whether the reasoning is complete and whether there are any leaps.
162
174
  5. **Apply the dual-acceptance gate**: For each candidate deliverable, separately assess mathematical correctness and GPU feasibility; retain only those that pass both.
163
175
  6. **Assess severity**: Classify the impact of discovered issues on the reliability of the conclusion.
@@ -181,7 +193,7 @@ The structure below is the full-report template, not the default response. For s
181
193
  ### Review Section
182
194
 
183
195
  #### Dimensions Focused on in This Review
184
- - [List the 3-5 dimensions selected for in-depth review and the rationale; if algorithm/GPU is involved, note that Dimensions 17/18 are included]
196
+ - [List the 3-5 dimensions selected for in-depth review and the rationale; if algorithm/GPU is involved, note that Dimensions 17/18 are included; if cryptography is involved, note that Dimension 19 is included]
185
197
 
186
198
  #### Dual-Acceptance Gate Results
187
199
  - [Candidate 1]: Math correctness [pass/fail] | GPU eight-dimension [friendly / retrofittable / unfriendly] | Passed [yes/no]
@@ -26,7 +26,7 @@
26
26
 
27
27
  ## 审视维度
28
28
 
29
- 前 15 个维度覆盖假设、逻辑、模型、计算等核心审视角度(多数对应 `../lenses/` 中的 v3 思想透镜),第 16–18 维为横切维度:工具选择、GPU 可行性、现代数学激活。**不需要机械地逐一检查所有维度**——应根据问题性质和用户关注点,选择最相关的维度深入审视,其余可简略提及或跳过。若产出涉及算法/算子/GPU 设计,**第 17(GPU)与第 18(现代数学激活)维为强制检查项**。
29
+ 前 15 个维度覆盖假设、逻辑、模型、计算等核心审视角度(多数对应 `../lenses/` 中的 v3 思想透镜),第 16–19 维为横切维度:工具选择、GPU 可行性、现代数学激活、密码学安全。**不需要机械地逐一检查所有维度**——应根据问题性质和用户关注点,选择最相关的维度深入审视,其余可简略提及或跳过。若产出涉及算法/算子/GPU 设计,**第 17(GPU)与第 18(现代数学激活)维为强制检查项**;若产出涉及密码学构造/安全证明/协议,**第 19(密码学安全)维为强制检查项**。
30
30
 
31
31
  ### 1. 假设审查 / Assumption Review -> axiomatization(公理化透镜)
32
32
 
@@ -151,13 +151,25 @@
151
151
  - 迁移是否是「跨领域激活」(结构本就在那里,只差一次跨域映射),还是生搬硬套(只借名词不借结构)?
152
152
  - 产出是否同时通过**双验收门**:数学正确 **AND**(八维友好或可改造)?未同时通过的候选是否被剔除?
153
153
 
154
+ ### 19. 密码学安全审视 / Cryptographic Security Review -> `../references/books/`(密码学 3 本)
155
+
156
+ > 产出涉及密码学构造/安全证明/协议设计时为**强制项**(Domain Router 判定为密码学或 AI×密码交叉时触发)。对应「双验收门」的密码学版:安全定义正确 **AND** 归约紧度可接受。
157
+
158
+ - **安全定义**:是否用形式化攻击游戏定义了安全目标?威胁模型层级(CPA/CCA/AE/EUF-CMA)是否匹配需求?避免"直觉上安全"的空话。
159
+ - **归约紧度**:归约损失 ε_scheme ≈ Q·ε_assumption 中的 Q 多大?参数是否补偿?是否声称"松归约=安全"?
160
+ - **假设依赖**:方案依赖哪条假设(OWF/DL/CDH/DDH/RSA/LWE)?是否最小化?是否有黑盒分离结果限制?量子威胁下是否需升级(Shor/Grover)?
161
+ - **合成与实现陷阱**:EtM/MtE/EaM 选对了吗?密钥是否独立?IV/nonce 是否唯一?MAC 比较是否常数时间?上下文(身份/转录)是否绑定?
162
+ - **反模式检查**:是否把 ROM 当绝对保证?确定性加密当 CPA 安全?Merkle-Damgård 当 ROM?plain RSA 签名?
163
+ - **跨域迁移合理性**(仅 AI×密码交叉):把密码学概念迁移到 ML(如 PRF 做水印、归约做鲁棒性证书)时,是否保留了安全语义,还是只借名词?迁移后假设是否仍可达成?
164
+ - **Domain Router 一致性**:纯密码问题是否避免加载 AI design-patterns?纯 AI 问题是否避免加载密码学书稿?交叉问题是否双 domain 加载并标注交叉点?
165
+
154
166
  ## 工作流程
155
167
 
156
168
  ### 审视阶段
157
169
 
158
170
  1. **概括结论**:先一句话概述该论点或方案的核心主张。
159
171
  2. **列出假设**:显式、隐式和背景假设一一列出。
160
- 3. **选择维度**:根据问题性质,从十八个审视维度中选择最相关的 3–5 个深入检查;若涉及算法/GPU 设计,**第 17、18 维必选**。其余可简略提及或跳过。
172
+ 3. **选择维度**:根据问题性质,从十九个审视维度中选择最相关的 3–5 个深入检查;若涉算法/GPU,**第 17、18 维必选**;若涉密码学,**第 19 维必选**。其余可简略提及或跳过。
161
173
  4. **检查逻辑链**:验证推理是否完整、是否存在跳跃。
162
174
  5. **过双验收门**:对每个候选产出,分别判数学正确性与 GPU 可行性,只保留同时通过的。
163
175
  6. **评估严重性**:根据发现的问题对结论可靠性的影响分级。
@@ -181,7 +193,7 @@
181
193
  ### 审视部分
182
194
 
183
195
  #### 本次重点审视维度
184
- - [列出本次选择深入审视的 3–5 个维度及原因;若涉算法/GPU,标注 17/18 已纳入]
196
+ - [列出本次选择深入审视的 3–5 个维度及原因;若涉算法/GPU,标注 17/18 已纳入;若涉密码学,标注 19 已纳入]
185
197
 
186
198
  #### 双验收门结果
187
199
  - [候选1]: 数学正确[v/x] | GPU 八维[友好/可改造/不友好] | 通过[是/否]
@@ -36,6 +36,8 @@ The current 31 anchors cover the most commonly used mathematical structures in A
36
36
  2. Enter the **Knowledge Gap Protocol** defined in `../skills/math-research-activator/SKILL.en.md` to generate a temporary knowledge card
37
37
  3. Never respond with "knowledge base does not cover this" or force-fit the closest card
38
38
 
39
+ > **Domain Router note** (v3.2.0): This knowledge base primarily serves the **AI Research Layer** and **Shared Math Layer**. If Domain Router determines the problem belongs to the **Cryptography Layer**, first consult the three crypto books listed in `../references/skill-index.en.md`; shared math anchors (e.g., `probability/entropy`, `matrix-analysis/spectral-decomposition`) are loaded on demand without redundancy. Crypto-specific concepts (OWF/PRF/CCA/reduction proofs etc.) are not among these 31 anchors; activate them via temporary knowledge cards or the crypto books.
40
+
39
41
  ## Domain Extension Index
40
42
 
41
43
  Each domain has an `*/index.en.md` that lists: domain trigger signals, core anchors, extended concepts, reference book directions, and temporary activation rules.
@@ -33,9 +33,11 @@
33
33
  现有 31 个锚点覆盖 AI 研究中最常用的数学结构。当问题需要的数学工具不在其中时:
34
34
 
35
35
  1. 查看对应领域的 `*/index.md`(如 `topology/index.md`),获取扩展概念和参考书方向
36
- 2. 进入 SKILL.md 中定义的**知识缺口协议**,生成临时知识卡
36
+ 2. 进入 `../skills/math-research-activator/SKILL.md` 中定义的**知识缺口协议**,生成临时知识卡
37
37
  3. 不得回答"知识库未覆盖"或强行套用最相近卡片
38
38
 
39
+ > **Domain Router 提示**(v3.2.0):本知识库主要服务 **AI 研究层** 与 **共用数学层**。若 Domain Router 判定问题属**密码学层**,优先查阅 `../references/skill-index.md` 列出的 3 本密码学书稿;共用数学锚点(如 `probability/entropy`、`matrix-analysis/spectral-decomposition`)按需加载,不重复。密码学专属概念(OWF/PRF/CCA/归约证明等)不在此 31 锚点内,通过临时知识卡或密码学书稿激活。
40
+
39
41
  ## 领域扩展索引
40
42
 
41
43
  每个领域有一个 `*/index.md`,列出:领域触发信号、核心锚点、扩展概念、参考书方向、临时激活规则。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-skill",
3
- "version": "3.1.0",
4
- "description": "面向 AI 架构创新的数学研究操作系统 v3:三层正交架构(思想透镜 / 数学知识库 / 设计翻译层),自动诊断用户意图并路由。Math Research OS for AI architecture design: thinking lenses + math knowledge base + design translation layer with auto intent diagnosis.",
3
+ "version": "3.2.0",
4
+ "description": "面向 AI 架构创新与密码学研究的数学研究操作系统 v3.2:思想透镜 / 激活锚点 / 设计翻译原型 + Domain Router(AI/密码/纯数学/交叉),支持知识缺口协议与临时知识卡。Math Research OS for AI architecture & cryptography research: thinking lenses + activation anchors + design translation prototypes + Domain Router with Knowledge Gap Protocol.",
5
5
  "keywords": [
6
6
  "math",
7
7
  "mathematics",
@@ -46,7 +46,13 @@
46
46
  "lenses",
47
47
  "knowledge-base",
48
48
  "design-patterns",
49
- "math-research-os"
49
+ "math-research-os",
50
+ "cryptography",
51
+ "crypto",
52
+ "security",
53
+ "reduction-proof",
54
+ "attack-game",
55
+ "domain-router"
50
56
  ],
51
57
  "license": "MIT",
52
58
  "author": "the-thinker0",