simple-skills 1.8.7 → 1.9.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.md +2 -1
- package/package.json +1 -1
- package/skills/engineering/knowledge-base/SKILL.md +122 -0
- package/skills/engineering/knowledge-base/references/consumption.md +171 -0
- package/skills/engineering/knowledge-base/references/format.md +565 -0
- package/skills/engineering/knowledge-base/scripts/knowledge.py +2175 -0
- package/skills/engineering/teach/DIAGRAM-TEACHING.md +133 -0
- package/skills/engineering/teach/SKILL.md +13 -1
- package/skills/engineering/teach/templates/diagram.css +104 -0
- package/skills/engineering/teach/templates/diagram.js +132 -0
package/README.md
CHANGED
|
@@ -80,6 +80,7 @@ rm -rf ~/.claude/skills # 若当初装了这份
|
|
|
80
80
|
| [diagnosing-bugs](./skills/engineering/diagnosing-bugs/SKILL.md) | 针对疑难 bug 和性能回退的纪律化诊断循环:变红反馈回路 → 最小化 → 假设 → 插桩 → 修复 → 回归测试 |
|
|
81
81
|
| [prototype](./skills/engineering/prototype/SKILL.md) | 构建一次性原型来回答设计问题:用一个可分享的 HTML 文件承载状态/逻辑,或多个可切换的 UI 变体 |
|
|
82
82
|
| [research](./skills/engineering/research/SKILL.md) | 对照高可信度 primary source 调查问题,把结果以带引用的 Markdown 文件存入 repo,以后台 agent 方式运行 |
|
|
83
|
+
| [knowledge-base](./skills/engineering/knowledge-base/SKILL.md) | 创建、校验、消费 Markdown + YAML frontmatter 知识库:目录结构、来源/信任/过期、受证计算、索引与检索 |
|
|
83
84
|
| [tdd](./skills/engineering/tdd/SKILL.md) | 采用 red-green-refactor 循环的测试驱动开发,一次构建一个垂直切片的功能或修复一个 bug |
|
|
84
85
|
| [codebase-design](./skills/engineering/codebase-design/SKILL.md) | 设计深模块的共享纪律与词汇:小接口、干净的 seam、可经由接口测试 |
|
|
85
86
|
| [code-review](./skills/engineering/code-review/SKILL.md) | 对 diff 做双轴评审:**Standards**(编码规范 + Fowler 坏味道基线)与 **Spec**(是否忠实实现原始 issue/spec),以并行子 agent 运行 |
|
|
@@ -91,7 +92,7 @@ rm -rf ~/.claude/skills # 若当初装了这份
|
|
|
91
92
|
| [skill-translator](./skills/engineering/skill-translator/SKILL.md) | 批量翻译 skills 目录或文档树到目标语言,生成结构一致的副本并执行技能精简 |
|
|
92
93
|
| [verification-before-completion](./skills/engineering/verification-before-completion/SKILL.md) | 宣称完成或修复前必须运行验证命令,始终用证据支撑断言 |
|
|
93
94
|
| [handoff](./skills/engineering/handoff/SKILL.md) | 将当前对话压缩成一份交接文档,让另一个 agent 可以继续这项工作 |
|
|
94
|
-
| [teach](./skills/engineering/teach/SKILL.md) |
|
|
95
|
+
| [teach](./skills/engineering/teach/SKILL.md) | 跨多个会话教用户一项新技能或概念,以当前目录作为有状态的教学工作区,每节课配可翻页的模型图 |
|
|
95
96
|
|
|
96
97
|
## 基本工作流
|
|
97
98
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knowledge-base
|
|
3
|
+
description: 创建、校验和消费 Markdown + YAML frontmatter 的知识库。当用户提到知识库/bundle、知识文档、数据目录/表/指标/计算口径、知识来源与可信度、verified/stale 状态、Attested Computation(受证计算),或要求搭建、检查、索引、查询、遍历知识库时使用;也用于把现有文档或元数据整理成 Agent 可渐进读取的结构。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 知识库
|
|
7
|
+
|
|
8
|
+
知识库格式 v0.2:目录树中每个 `.md` 是一个 concept,YAML frontmatter 放可查询元数据,正文放知识;`index.md` 做渐进披露,`log.md` 记变更。
|
|
9
|
+
|
|
10
|
+
所有确定性操作走 `<skill-dir>/scripts/knowledge.py`(本 SKILL.md 所在目录),脚本不调用 LLM;依赖 Python 3.9+ 与 PyYAML,完整参数见 `--help`。跨模式时按 创建 → 校验 → 消费,不要跳过校验。
|
|
11
|
+
|
|
12
|
+
## 默认知识库路径
|
|
13
|
+
|
|
14
|
+
用户未指定 bundle 时按此解析:
|
|
15
|
+
|
|
16
|
+
- 项目级:`<repo>/docs/knowledge/`,`<repo>` 是最近的包含 `.git` 的祖先目录。
|
|
17
|
+
- 全局级:`~/.agents/knowledge/`。
|
|
18
|
+
|
|
19
|
+
读取:项目级存在就用项目级,否则用全局级;两级都存在也不合并,项目级胜出。创建库(`init`):仓库内默认项目级,仓库外默认全局级。写入已有库(`new`/`log`):按读取规则选库,两级都不存在时先 `init`。一次操作只用一个库,并明确告知实际路径。
|
|
20
|
+
|
|
21
|
+
命令中用 `-` 代替 `BUNDLE` 即按此规则解析(如 `knowledge.py list -`、`knowledge.py show - computations/revenue-ytd`)。`knowledge.py where [--json]` 输出解析结果;两级都不存在时退出 1。`init` 省略路径或传 `-` 时按写入规则创建默认库。不要在其他命令里自动创建知识库。
|
|
22
|
+
|
|
23
|
+
## 创建
|
|
24
|
+
|
|
25
|
+
初始化只写根 `index.md`(含 `format_version`)与 `log.md`,不建 concept:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python3 <skill-dir>/scripts/knowledge.py init --name "团队知识库" # 默认路径
|
|
29
|
+
python3 <skill-dir>/scripts/knowledge.py init ./knowledge --name "团队知识库" # 显式路径
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
新增 concept:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python3 <skill-dir>/scripts/knowledge.py new ./knowledge tables/orders \
|
|
36
|
+
--type "BigQuery Table" --title "Customer Orders" \
|
|
37
|
+
--description "One row per completed customer order." --tags sales,orders
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
也可直接写文件;写前读 `references/format.md`,不要凭记忆拼字段。`type: Attested Computation` 会自动套计算模板,需要 `--runtime` 与 `--param`。
|
|
41
|
+
|
|
42
|
+
### 写文档的硬规则
|
|
43
|
+
|
|
44
|
+
- **`type` 必填且非空**。`title`、`description`、`tags` 建议填;`description` 保持一句话,会被 index 和检索复用;概念绑定具体资产时填 `resource`。
|
|
45
|
+
- **正文结构化**:`# Schema`、`# Examples`、`# Computation` 是约定标题,没有必需的正文小节。
|
|
46
|
+
- **来源放 `sources`**(每项 `resource` 必填),逐条归因用脚注 `[^source-id]`,label 必须是某个 `sources[].id`。禁止 v0.1 的正文 `# Citations`。
|
|
47
|
+
- **内部链接**优先 bundle 根相对路径(`/tables/orders.md`),也可用相对路径。坏链接允许存在(可能只是尚未写的知识),校验只提示。
|
|
48
|
+
- **时间**必须 ISO 8601 且带时区,如 `2026-06-30T14:00:00Z`;`stale_after` 是绝对时刻,不是 TTL。
|
|
49
|
+
- **actor**:`generated.by` / `verified[].by` 用 `<producer>/<version>`、`human:<id>` 或 `process:<id>`;`human:` 前缀决定 trust tier,手写或人工确认的内容必须用它。
|
|
50
|
+
- **生命周期**:`status` 取 `draft | stable | deprecated`,缺省 `stable`。
|
|
51
|
+
- **受证计算是独立 concept**:`runtime` 必填,声明 `parameters`、`executor`、`attester`;计算放正文 `# Computation` 围栏或 `computation:` 文件。Agent 只能填参数值,禁止改写 computation;正文数字只有 attester 通过后才能作为结果。
|
|
52
|
+
- **禁止编造** `resource`、`sources`、时间或 `verified`。不知道就留空、标 `status: draft`,或用真实来源。
|
|
53
|
+
|
|
54
|
+
写完执行:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python3 <skill-dir>/scripts/knowledge.py validate ./knowledge
|
|
58
|
+
python3 <skill-dir>/scripts/knowledge.py index ./knowledge --write
|
|
59
|
+
python3 <skill-dir>/scripts/knowledge.py log ./knowledge --kind Creation --message "Created ..."
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`index` 默认只预览,`--write` 才落盘。
|
|
63
|
+
|
|
64
|
+
## 校验
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python3 <skill-dir>/scripts/knowledge.py validate ./knowledge # --json / --strict / --now
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- 退出码:`0` 无 conformance error;`1` 有 error,或 `--strict` 下有 warning;`2` 命令失败。
|
|
71
|
+
- **error** 只对应格式规范 §11 硬性符合性:frontmatter 无法解析(含 `index.md`/`log.md`)、`type` 缺失或为空。必须修。
|
|
72
|
+
- **warning** 是 SHOULD 与写作质量问题:推荐字段、时间格式、`sources` 形状、坏链接、缺 index、计算契约不完整。逐条判断;禁止为消除 warning 编造内容。
|
|
73
|
+
- 宽容是规范要求:可选字段缺失、未知 `type`/key、坏链接、缺 `index.md` 都不是 error,consumer 不得因此拒绝 bundle。
|
|
74
|
+
- `index --check` 在索引漂移时退出 1,可用于 CI。
|
|
75
|
+
|
|
76
|
+
## 消费
|
|
77
|
+
|
|
78
|
+
默认只读;除非用户要求,不要修改 bundle。
|
|
79
|
+
|
|
80
|
+
1. 先读根 `index.md` 或 `list`,不要把全库塞进上下文。
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
python3 <skill-dir>/scripts/knowledge.py list ./knowledge --tag finance --trust human-reviewed
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. 用 `search` 缩小范围(匹配 id、title、tags、description、正文);`--type` / `--tag` / `--status` / `--stale` / `--trust` 过滤。
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
python3 <skill-dir>/scripts/knowledge.py search ./knowledge "revenue"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. 用 `show` 读全文;默认输出原文,`--json` 附带 frontmatter、trust、stale、出链与 backlinks。
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
python3 <skill-dir>/scripts/knowledge.py show ./knowledge computations/revenue-ytd --json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
4. 用 `graph --format json` 看有向边和未解析链接;用 `show --json` 的 `backlinks` 找引用者。
|
|
99
|
+
|
|
100
|
+
5. 过决策门,禁止静默使用:
|
|
101
|
+
- `status: deprecated` 只用于历史/链接,不作为当前事实。
|
|
102
|
+
- `stale_after` 已过:明示过期并建议重新验证,不当作最新事实。
|
|
103
|
+
- trust tier:`unverified` < `machine-confirmed` < `human-reviewed`;关键结论优先 human-reviewed,并给出依据。
|
|
104
|
+
- `sources` 的 `author`、`usage_count`、`last_modified` 是客观信号;不要合成「可信分数」。
|
|
105
|
+
- 回答时给 concept id 与来源;区分「文档这么写」与「有人验证过」。
|
|
106
|
+
|
|
107
|
+
6. 受证计算按 `references/consumption.md` 的六步执行。禁止直接相信正文数字,也禁止用改写过的查询替代 sanctioned computation。
|
|
108
|
+
|
|
109
|
+
## 参考文件
|
|
110
|
+
|
|
111
|
+
- `references/format.md` — 字段表、结构、路径/链接、index/log、受证计算、符合性、v0.1 兼容。写文档或改 schema 前读。
|
|
112
|
+
- `references/consumption.md` — 渐进读取、检索、信任/新鲜度门、受证计算协议、JSON 形状。做 Agent/RAG 集成时读。
|
|
113
|
+
- 当前 v0.2 是初始约定,格式细节与字段表见 `references/format.md`;后续可独立演进。
|
|
114
|
+
|
|
115
|
+
## 常见错误
|
|
116
|
+
|
|
117
|
+
- 来源写成正文 `# Citations` → 移到 `sources`,用脚注按 id 归因。
|
|
118
|
+
- `stale_after` 写成日期 → 必须带时区的完整时刻。
|
|
119
|
+
- 伪造 `human:` 验证 → trust tier 会算错;按 actor 约定写。
|
|
120
|
+
- 手改生成的 `index.md` → 改 concept 的 `title`/`description` 后重新生成。
|
|
121
|
+
- 消费时全量读入 → 先用 `list`/`search` 缩小,再 `show`。
|
|
122
|
+
- 把 `deprecated` 或已过期概念当成当前事实 → 显式标注并寻找替代。
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# 消费知识库
|
|
2
|
+
|
|
3
|
+
消费的目标不是「把整个 bundle 读进上下文」,而是**按需、可追溯、带信任判断**地把相关概念取出来。知识库的目录树、`index.md`、frontmatter 和链接图就是为渐进披露准备的。
|
|
4
|
+
|
|
5
|
+
## 1. 读取顺序
|
|
6
|
+
|
|
7
|
+
未指定 bundle 时按 SKILL.md 的默认路径约定:项目 `<repo>/docs/knowledge/` → 全局 `~/.agents/knowledge/`;项目存在时不合并全局。命令中用 `-` 占位,或先跑 `knowledge.py where` 确认实际路径。
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
根 index.md(先看有什么)
|
|
11
|
+
→ list / search(按 type、tag、query 缩小)
|
|
12
|
+
→ show(只读命中的 concept)
|
|
13
|
+
→ graph / backlinks(沿关系扩展)
|
|
14
|
+
→ 受证计算按需执行
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
不要跳过前两步直接 `cat` 全库。一个 200 篇 concept 的 bundle 全量读入既贵又会稀释上下文。
|
|
18
|
+
|
|
19
|
+
### 命令行入口
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
kb="python3 <skill-dir>/scripts/knowledge.py"
|
|
23
|
+
|
|
24
|
+
$kb list knowledge
|
|
25
|
+
$kb list knowledge --type "BigQuery Table" --tag finance --trust human-reviewed
|
|
26
|
+
$kb search knowledge "revenue" -n 5
|
|
27
|
+
$kb show knowledge computations/revenue-ytd
|
|
28
|
+
$kb show knowledge computations/revenue-ytd --json
|
|
29
|
+
$kb graph knowledge --format json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`show` 默认输出原始 markdown,适合直接读;`--json` 附带解析后的 frontmatter、trust、stale、出链和 backlinks,适合程序化决策。
|
|
33
|
+
|
|
34
|
+
## 2. 检索策略
|
|
35
|
+
|
|
36
|
+
从宽到窄,避免一次命中太多:
|
|
37
|
+
|
|
38
|
+
1. **结构过滤**:`--type`、`--tag`、`--status`、`--trust`、`--stale`。
|
|
39
|
+
2. **关键词**:`search` 匹配 id、title、tags、description、正文;标题和标签权重更高。
|
|
40
|
+
3. **读全文**:只对少量候选 `show`。
|
|
41
|
+
4. **扩展**:用 `show --json` 的 `links` / `backlinks` 找上下游概念。
|
|
42
|
+
5. **兜底**:没有 `index.md` 不影响消费;`list` 直接扫描 frontmatter。
|
|
43
|
+
|
|
44
|
+
检索时保留 concept id(相对路径去掉 `.md`),回答中引用它,让用户能回到原文。
|
|
45
|
+
|
|
46
|
+
## 3. 信任与新鲜度门
|
|
47
|
+
|
|
48
|
+
每个 concept 在消费时至少判断三件事:
|
|
49
|
+
|
|
50
|
+
| 信号 | 取值 | 消费动作 |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `status` | `deprecated` | 不作为当前事实;只用于历史、链接或迁移说明 |
|
|
53
|
+
| `stale_after` | 已过(`now >= stale_after`) | 明示「已过期」,建议重新验证;关键结论不要直接采用 |
|
|
54
|
+
| `trust` | `unverified` | 视为未确认;优先找其他来源 |
|
|
55
|
+
| `trust` | `machine-confirmed` | 机器可复现,但没人签核;适合低风险事实 |
|
|
56
|
+
| `trust` | `human-reviewed` | 最高建议等级;关键结论优先,但仍要给出处 |
|
|
57
|
+
|
|
58
|
+
Trust tier 由 `verified` 推导,不由 consumer 自定:
|
|
59
|
+
|
|
60
|
+
- 无 `verified` → `unverified`
|
|
61
|
+
- 只有 `process:` / agent actor → `machine-confirmed`
|
|
62
|
+
- 任意 `human:<id>` → `human-reviewed`
|
|
63
|
+
|
|
64
|
+
另看 `sources` 的客观信号:
|
|
65
|
+
|
|
66
|
+
- `author`:来源是否来自权威团队/系统。
|
|
67
|
+
- `usage_count` + `usage_window`:来源是否活跃、被广泛使用。只读作趋势和数量级,不做跨类型精确排名。
|
|
68
|
+
- `last_modified`:来源本身是否近期变化;与 `generated.at`(concept 写入时间)不同。
|
|
69
|
+
|
|
70
|
+
不要合成一个「可信分数」。本格式故意不存分数,因为分数主观、不可移植、会过期。
|
|
71
|
+
|
|
72
|
+
## 4. 回答时的证据纪律
|
|
73
|
+
|
|
74
|
+
- 区分三种陈述:
|
|
75
|
+
1. **文档写了**:concept 正文的 claim;
|
|
76
|
+
2. **来源支持**:`sources` 指向的材料,最好能跟随;
|
|
77
|
+
3. **有人验证过**:`verified` 里有 `human:` 事件。
|
|
78
|
+
- 引用 concept id,必要时给文件路径和来源 URL。
|
|
79
|
+
- 发现 `deprecated` 或过期时,主动说明并寻找替代 concept。
|
|
80
|
+
- 多篇 concept 冲突时,先比较 trust tier 和 `generated.at`/`stale_after`,再比较来源权威性;不要静默挑一个。
|
|
81
|
+
- 坏链接不是错误;可能表示知识尚未写完。不要为了「修好」它而编造目标文档。
|
|
82
|
+
|
|
83
|
+
## 5. 受证计算(Attested Computation)
|
|
84
|
+
|
|
85
|
+
### 5.1 为什么不能直接相信正文数字
|
|
86
|
+
|
|
87
|
+
受证计算把「值的定义」和「值的产生方式」分开:
|
|
88
|
+
|
|
89
|
+
- `verified` 确认**定义**仍符合 policy(文档级、慢速、存进 bundle)。
|
|
90
|
+
- attestation 确认**这一次运行**确实按 sanctioned computation 产生值(每次调用、运行时、不存进 bundle)。
|
|
91
|
+
|
|
92
|
+
正文里的数字可能来自上一次运行、Agent 的即兴查询,或错误的参数。只有 attester 通过的 receipt 才能当结果。
|
|
93
|
+
|
|
94
|
+
### 5.2 六步协议
|
|
95
|
+
|
|
96
|
+
1. **Discover**
|
|
97
|
+
- 通过 `type: Attested Computation`、`index.md` 或使用它的 `Metric`/`Table` concept 的链接找到计算。
|
|
98
|
+
2. **Load**
|
|
99
|
+
- 从 frontmatter 读 `runtime`、`parameters`、`executor`、`attester`。
|
|
100
|
+
- 从 `# Computation` 围栏或 `computation:` 路径读计算内容。
|
|
101
|
+
- 如果 `now >= stale_after`,先标记过期;仍可运行,但结果要带警告。
|
|
102
|
+
3. **Parameterize**
|
|
103
|
+
- 只为声明的 `parameters` 提供值,类型要匹配。
|
|
104
|
+
- **不得**改写计算、替换表、增加过滤条件或改参数含义。Agent 的权限边界就是参数值。
|
|
105
|
+
4. **Execute**
|
|
106
|
+
- 按 `executor.resource` 的说明运行,返回 `executor.receipt` 声明的字段。
|
|
107
|
+
- 典型 receipt:`job_id`、`executed_sql` / `compiled_sql`、`result`。
|
|
108
|
+
5. **Attest**
|
|
109
|
+
- 运行 `attester.resource` 指向的确定性代码(无 LLM)。
|
|
110
|
+
- 它至少检查两件事:
|
|
111
|
+
- **Provenance**:receipt 里实际执行的 artifact,等于 sanctioned computation 绑定声明参数后的结果;
|
|
112
|
+
- **Fidelity**:准备展示的值,等于 receipt 的权威结果(按 job id 重读,而不是相信 Agent 文本)。
|
|
113
|
+
- 比较应发生在展开/编译后的 artifact 上,这样改写查询、换计算文件、篡改依赖都会失败。
|
|
114
|
+
6. **Gate**
|
|
115
|
+
- attestation 失败 → **拒绝展示该值**,说明原因,不要降级成「大概对」。
|
|
116
|
+
- `stale_after` 已过 → 警告或拒绝,取决于任务风险;至少显式标注。
|
|
117
|
+
- 成功 → 展示 verdict(例如 job log 链接、attester 版本),让用户能复核。
|
|
118
|
+
|
|
119
|
+
### 5.3 读取示例
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
$kb show knowledge computations/revenue-ytd --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
关注字段:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"type": "Attested Computation",
|
|
130
|
+
"runtime": "bigquery",
|
|
131
|
+
"status": "stable",
|
|
132
|
+
"trust": "human-reviewed",
|
|
133
|
+
"stale": false,
|
|
134
|
+
"frontmatter": {
|
|
135
|
+
"parameters": [{"name": "year", "type": "integer", "required": true}],
|
|
136
|
+
"executor": {"resource": "skills/run-on-bq.md", "receipt": ["job_id", "executed_sql", "result"]},
|
|
137
|
+
"attester": {"resource": "attesters/sql_equality.py"}
|
|
138
|
+
},
|
|
139
|
+
"body": "# Computation\n\n```sql\n..."
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 5.4 失败模式
|
|
144
|
+
|
|
145
|
+
| 现象 | 处理 |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| 没有 `runtime` / `parameters` | 契约不完整;不要运行,先修 concept |
|
|
148
|
+
| `attester` 不存在 | 不能确认 provenance/fidelity;不要把值当受证结果 |
|
|
149
|
+
| receipt 缺少声明字段 | attestation 无法完成;视为失败 |
|
|
150
|
+
| executed SQL 与 sanctioned computation 不一致 | **拒绝**该值 |
|
|
151
|
+
| 展示值与 receipt 结果不一致 | **拒绝**该值 |
|
|
152
|
+
| `stale_after` 已过但 attester 通过 | 值可复现,但定义可能过期;警告并建议重新验证 |
|
|
153
|
+
| 计算概念 `deprecated` | 不作为当前口径;找替代计算 |
|
|
154
|
+
|
|
155
|
+
## 6. 上下文打包建议
|
|
156
|
+
|
|
157
|
+
当要把知识库内容交给另一个模型/搜索索引时:
|
|
158
|
+
|
|
159
|
+
- **第一层**:只给 id、type、title、description、tags、status、trust、stale。这通常足够做路由。
|
|
160
|
+
- **第二层**:给命中的 concept 全文,以及它的 `sources` / 链接目标 id。
|
|
161
|
+
- **第三层**:按需展开链接目标;不要递归整张图。
|
|
162
|
+
- 预算有限时,优先保留:定义、口径、约束、示例;省略长表格的重复行和与问题无关的历史。
|
|
163
|
+
- 始终保留 `status`、`trust`、`stale` 和 concept id,否则下游无法做同样的门控。
|
|
164
|
+
|
|
165
|
+
## 7. 只读纪律
|
|
166
|
+
|
|
167
|
+
消费默认只读:
|
|
168
|
+
|
|
169
|
+
- 不要为了「让检索更顺」而改 concept、`index.md` 或 `log.md`。
|
|
170
|
+
- 需要修复时,先向用户说明问题,再进入创建/校验模式。
|
|
171
|
+
- 运行受证计算可能调用外部系统;执行前确认凭据、成本和用户授权。
|