@cyning/harness 1.0.2 → 2.0.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/CHANGELOG.md +45 -0
- package/README.md +4 -2
- package/docs/USER_GUIDE_v1.0_zh.md +95 -6
- package/docs/methodology/graph/DECISIONS_hgm_g1_maintainer_v1_zh.md +196 -0
- package/docs/methodology/graph/HGM_UPGRADE_OUTLINE_v1_zh.md +12 -6
- package/docs/methodology/graph/INFORM_YAML_MIGRATION_v1_zh.md +81 -0
- package/docs/methodology/graph/PROMPT_ontology_inventory_scan_G0_v1_zh.md +313 -0
- package/docs/methodology/graph/README.md +2 -0
- package/docs/methodology/graph/inventory/ONTOLOGY_INVENTORY_ai_ink_brain_api_python_v1.yaml +283 -0
- package/docs/methodology/graph/inventory/ONTOLOGY_INVENTORY_cyning_harness_v1.yaml +233 -0
- package/docs/methodology/graph/schemas/hgm_event_v1.schema.json +301 -0
- package/examples/demo_checkout/00_main.graph.yaml +42 -0
- package/examples/demo_checkout/00_main.md +66 -0
- package/examples/demo_checkout/README.md +3 -0
- package/examples/demo_checkout/graph.json +111 -0
- package/lib/cli.js +276 -3
- package/lib/graph-hgm.js +563 -0
- package/lib/graph-yaml.js +547 -0
- package/ontology.yaml +1 -1
- package/package.json +4 -1
- package/schema/inform_graph.v3.schema.json +134 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Prompt · 项目本体构成扫描 · HGM G0(v1.3)
|
|
2
|
+
|
|
3
|
+
| 项 | 内容 |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| **状态** | `active` · G0 讨论素材 · **须满足执行前提 P1–P5** |
|
|
6
|
+
| **用途** | 扫描产品仓或试点仓 · 产出 **本体清单报告**(不修改 DESIGN_ONTOLOGY) |
|
|
7
|
+
| **触发时机** | Inform YAML 闭环 **done** + **HG-TASK-DRAFT** 签收 · 见 [`task_ontology_inventory_scan_g0_v1.md`](../../../../docs/harness/tasks/active/task_ontology_inventory_scan_g0_v1.md) · [`HGM_UPGRADE_OUTLINE_v1_zh.md`](./HGM_UPGRADE_OUTLINE_v1_zh.md) G0 |
|
|
8
|
+
| **关联 task** | [`task_ontology_inventory_scan_g0_v1.md`](../../../../docs/harness/tasks/active/task_ontology_inventory_scan_g0_v1.md) · [`task_cyning_harness_g1_hgm_v2_v1.md`](../../../../docs/harness/tasks/active/task_cyning_harness_g1_hgm_v2_v1.md)(HGM G1 · deferred) |
|
|
9
|
+
| **语义真值(执行时必读)** | [`../product/DESIGN_ONTOLOGY_v1_zh.md`](../product/DESIGN_ONTOLOGY_v1_zh.md) · [`HARNESS_GRAPH_MODEL_design_v0_zh.md`](./HARNESS_GRAPH_MODEL_design_v0_zh.md) |
|
|
10
|
+
| **预期产出** | [`inventory/ONTOLOGY_INVENTORY_cyning_harness_v1.yaml`](./inventory/ONTOLOGY_INVENTORY_cyning_harness_v1.yaml)(主)· [`inventory/ONTOLOGY_INVENTORY_ai_ink_brain_api_python_v1.yaml`](./inventory/ONTOLOGY_INVENTORY_ai_ink_brain_api_python_v1.yaml)(试点) |
|
|
11
|
+
| **Open Folder** | **`cyning-harness/`** 或 **`ai-ink-brain-api-python/`** · **禁止**工作区根全量扫描 |
|
|
12
|
+
| **invoke** | [`PROMPT_START_30_v1.md`](../../../../docs/harness/invokes/by-task/ontology-inventory-scan-g0/PROMPT_START_30_v1.md) |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 执行 Prompt(v1.3 · P3 放宽 · 先扫描后删 ai.md)
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
# 任务:扫描当前项目,生成“项目本体构成报告”
|
|
20
|
+
|
|
21
|
+
> **维护者决策 D-G0-P3(v1.3)**:试点仓 **允许** 仍存在 `@deprecated` 的 `*.ai.md`。
|
|
22
|
+
> 扫描须将其列入 `legacy_pending_delete` · **不在本任务删除** · 删源见后继 task `graph-yaml-remove-ai-md`。
|
|
23
|
+
|
|
24
|
+
## ⚠️ 执行前提(硬性检查,不满足则终止)
|
|
25
|
+
|
|
26
|
+
在开始扫描之前,**必须先确认以下条件全部满足**。任一 **硬门槛** 不满足,输出 fail_msg 并终止。
|
|
27
|
+
|
|
28
|
+
**试点仓检查顺序**:**P1 → P2 → P4 → P5** · **P3 为盘点项(不阻断扫描)**
|
|
29
|
+
|
|
30
|
+
### 前置条件清单
|
|
31
|
+
|
|
32
|
+
preconditions:
|
|
33
|
+
# 1. 仓库范围确认(硬门槛)
|
|
34
|
+
- id: "P1"
|
|
35
|
+
check: "当前所在目录是 cyning-harness/ 或 ai-ink-brain-api-python/"
|
|
36
|
+
fail_msg: "请在产品仓(cyning-harness/)或试点仓(ai-ink-brain-api-python/)下执行此扫描。工作区根不执行全量扫描。"
|
|
37
|
+
|
|
38
|
+
# 2. YAML 图源就绪(试点仓 · 硬门槛)
|
|
39
|
+
- id: "P2"
|
|
40
|
+
check: "test -s docs/_tech_graph/00_main.graph.yaml"
|
|
41
|
+
fail_msg: "docs/_tech_graph/00_main.graph.yaml 不存在或为空。请先完成 00_main YAML 迁移。"
|
|
42
|
+
note: "试点仓执行时检查;产品仓跳过 P2"
|
|
43
|
+
|
|
44
|
+
# 3. deprecated .ai.md 盘点(试点仓 · 软门槛 · 不阻断)
|
|
45
|
+
- id: "P3"
|
|
46
|
+
check: "find docs/_tech_graph -name '*.ai.md' 2>/dev/null"
|
|
47
|
+
fail_msg: null
|
|
48
|
+
note: |
|
|
49
|
+
试点仓:若存在 .ai.md → 逐文件列入报告 legacy_pending_delete(status: deprecated_readonly)。
|
|
50
|
+
**不得** 因 .ai.md 存在而终止扫描。
|
|
51
|
+
产品仓跳过 P3。
|
|
52
|
+
|
|
53
|
+
# 4. 维护者审批(硬门槛)
|
|
54
|
+
- id: "P4"
|
|
55
|
+
check: "HG-TASK-DRAFT approved(task_ontology_inventory_scan_g0_v1)"
|
|
56
|
+
fail_msg: "请先获得维护者签收 HG-TASK-DRAFT 后再执行。"
|
|
57
|
+
|
|
58
|
+
# 5. 扫描目的声明
|
|
59
|
+
- id: "P5"
|
|
60
|
+
note: "本次扫描仅为 G0 讨论提供素材,不代替 HGM G1 开发规格,不修改 DESIGN_ONTOLOGY。"
|
|
61
|
+
|
|
62
|
+
### 扫描范围规则
|
|
63
|
+
|
|
64
|
+
- 若在 **cyning-harness/** 下执行 → 输出 **产品仓主报告**
|
|
65
|
+
- 若在 **ai-ink-brain-api-python/** 下执行 → 输出 **试点仓辅助报告**
|
|
66
|
+
- 若在其他目录 → **终止**并提示
|
|
67
|
+
|
|
68
|
+
两份报告各自独立;**产品仓报告为「主报告」**,试点仓报告为「验证参考」。
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 角色设定
|
|
73
|
+
|
|
74
|
+
你是一位精通**本体论(Ontology)**、**图论(Graph Theory)**和**知识工程**的架构分析师。你的任务是扫描给定的代码仓库/文档目录,识别其中隐含的「本体结构」,并按标准化格式输出报告。
|
|
75
|
+
|
|
76
|
+
## 本体定义(给你判断用的标准)
|
|
77
|
+
|
|
78
|
+
在软件工程中,**本体(Ontology)** = 对某一领域内的**概念(类)、属性、关系、公理(约束)** 的显式、形式化规范说明。
|
|
79
|
+
|
|
80
|
+
你需要区分:
|
|
81
|
+
- **元本体(Meta-Ontology)**:定义「如何定义本体」的顶层框架
|
|
82
|
+
- **子本体(Sub-Ontology)**:针对特定领域的具体概念模型(如 Task/Hat/Gate;Node/Edge/Anchor)
|
|
83
|
+
|
|
84
|
+
## 判断标准:什么是「本体文件」?
|
|
85
|
+
|
|
86
|
+
清单内文件 **默认** 为本体载体;若某文件不在清单中但符合以下 **≥2 条**,可追加到报告 `gaps` 或 `additional_files`:
|
|
87
|
+
1. 定义 **类/实体**
|
|
88
|
+
2. 定义 **关系**
|
|
89
|
+
3. 定义 **约束/公理**
|
|
90
|
+
4. 作为 **唯一真相源**
|
|
91
|
+
5. 在 **CI 或工具链** 中用于校验/生成
|
|
92
|
+
|
|
93
|
+
## 四原语分类框架(T/K/H/B)
|
|
94
|
+
|
|
95
|
+
| 原语 | 全称 | 判断标准 | 示例 |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| **T** | Topic | 分类节点 · 抽象概念 · 领域名称 | RAG、Track、Hat |
|
|
98
|
+
| **K** | Keyword | 检索/验证锚点 · 阈值 · 约束 | payload_min_keys、test_strategy=required |
|
|
99
|
+
| **H** | History | 时序节点 · 状态变更 · 执行轨迹 | InvokeSnapshot、AuditReview、Git commit |
|
|
100
|
+
| **B** | Business | 终端业务实体/产物 | Task 实例、documents 表、npm 包 |
|
|
101
|
+
|
|
102
|
+
## 四原语定位说明(重要)
|
|
103
|
+
|
|
104
|
+
T/K/H/B 四原语**仅作为本次扫描报告的「分类标签」(Lens)**,用于标记扫描到的本体元素属于哪种原语类型。
|
|
105
|
+
|
|
106
|
+
**它们不写入 HGM Schema、不修改 DESIGN_ONTOLOGY、不作为 HGM 节点类型。** HGM 节点类型保持项目现有命名:
|
|
107
|
+
Task, Hat, HumanGate, InformArtifact, AuditReview, InvokeSnapshot, FailureReport
|
|
108
|
+
|
|
109
|
+
**映射规则**(报告中 `primitives_used` 字段使用此表):
|
|
110
|
+
|
|
111
|
+
| 原语 | 映射到项目中的 | 示例 |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| **T (Topic)** | Track, Hat, Epic, OrchestratorHat | 概念分类、领域名称 |
|
|
114
|
+
| **K (Keyword)** | _contract_manifest 中 payload_min_keys/allowed_events;embedding;RAG_MATCH_THRESHOLD | 检索锚点、约束阈值 |
|
|
115
|
+
| **H (History)** | trace.json, InvokeSnapshot, AuditReview, Git commit, .version/ 索引 | 时序节点、状态变更 |
|
|
116
|
+
| **B (Business)** | Task 实例, User, Project, documents/code_chunks 表, npm 包 | 终端业务实体/产物 |
|
|
117
|
+
|
|
118
|
+
**报告中不出现「T/K/H/B 是 HGM 节点类型」的表述。**
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 你需要执行的具体步骤
|
|
123
|
+
|
|
124
|
+
### 第1步:扫描固定文件清单(不使用通配符)
|
|
125
|
+
|
|
126
|
+
**不要**使用 `*.ontology.yaml` 等模糊匹配。仅扫描以下清单中的文件(若不存在则跳过并记入 gaps)。
|
|
127
|
+
|
|
128
|
+
#### 产品仓 cyning-harness/ 清单
|
|
129
|
+
|
|
130
|
+
product_manifest:
|
|
131
|
+
- path: "docs/methodology/STRATEGY_ONTOLOGY_cyning_harness_v1_zh.md"
|
|
132
|
+
role: "战略本体"
|
|
133
|
+
- path: "docs/methodology/product/DESIGN_ONTOLOGY_v1_zh.md"
|
|
134
|
+
role: "产品设计本体(主)"
|
|
135
|
+
- path: "docs/methodology/product/PRODUCT_ONTOLOGY_v1.1.md"
|
|
136
|
+
role: "产品设计本体(v1.1,若存在)"
|
|
137
|
+
- path: "docs/methodology/graph/HGM_UPGRADE_OUTLINE_v1_zh.md"
|
|
138
|
+
role: "HGM 升级大纲(G0)"
|
|
139
|
+
- path: "docs/methodology/graph/HARNESS_GRAPH_MODEL_design_v0_zh.md"
|
|
140
|
+
role: "HGM 设计稿(v0)"
|
|
141
|
+
- path: "docs/methodology/ROADMAP_v1_zh.md"
|
|
142
|
+
role: "路线图"
|
|
143
|
+
- path: "harness/meta/ontology.yaml"
|
|
144
|
+
role: "机器可读本体(v0.4+ 规划,若存在)"
|
|
145
|
+
|
|
146
|
+
#### 试点仓 ai-ink-brain-api-python/ 清单
|
|
147
|
+
|
|
148
|
+
pilot_manifest:
|
|
149
|
+
- path: "docs/_tech_graph/00_main.graph.yaml"
|
|
150
|
+
role: "图源 YAML(主流程)"
|
|
151
|
+
- path: "docs/_tech_graph/*.graph.yaml"
|
|
152
|
+
role: "图源 YAML(全量 flow)· 展开 glob 后逐文件扫描"
|
|
153
|
+
- path: "docs/_tech_graph/*.ai.md"
|
|
154
|
+
role: "legacy · @deprecated 只读对照 · 须列入 legacy_pending_delete · 本任务不删"
|
|
155
|
+
- path: "docs/_tech_graph/_manifest.json"
|
|
156
|
+
role: "端点/表/env 索引本体"
|
|
157
|
+
- path: "docs/_tech_graph/_contract_manifest.json"
|
|
158
|
+
role: "契约/公理本体"
|
|
159
|
+
- path: "docs/_tech_graph/99_spec.md"
|
|
160
|
+
role: "治理/规约本体"
|
|
161
|
+
- path: "docs/_tech_graph/01_struct.md"
|
|
162
|
+
role: "数据结构本体"
|
|
163
|
+
- path: "docs/_tech_graph/graph.json"
|
|
164
|
+
role: "物化图(由 YAML 生成,非手写)"
|
|
165
|
+
|
|
166
|
+
#### 工作区共有(仅引用,不重复扫描)
|
|
167
|
+
|
|
168
|
+
- Projects/docs/harness/guides/POST_V1_0_SEQUENCE_v1_zh.md(上下文引用)
|
|
169
|
+
- Projects/docs/harness/tasks/active/*.md(**仅** Task 模板结构,不扫描实例全文)
|
|
170
|
+
|
|
171
|
+
输出:每个已扫描文件的路径 + role + 是否存在。
|
|
172
|
+
|
|
173
|
+
### 第2步:对每个本体文件,提取其核心内容
|
|
174
|
+
|
|
175
|
+
对每个文件,回答:
|
|
176
|
+
- 定义了哪些 **类/实体**?
|
|
177
|
+
- 定义了哪些 **关系**(类型与方向)?
|
|
178
|
+
- 定义了哪些 **约束/公理**(摘录)?
|
|
179
|
+
- **primitives_used**(T/K/H/B 标签 · 仅 Lens)
|
|
180
|
+
|
|
181
|
+
### 第3步:识别子本体(对齐 Track 命名)
|
|
182
|
+
|
|
183
|
+
子本体分组**必须**使用以下 Track 名称,避免三「图」混淆:
|
|
184
|
+
|
|
185
|
+
| 子本体 ID | 名称 | 职责 | 典型文件 |
|
|
186
|
+
|---|---|---|---|
|
|
187
|
+
| PROCESS_TRACK | 过程本体 | Task/Hat/Gate/Review | DESIGN_ONTOLOGY §1–§5 |
|
|
188
|
+
| GRAPH_TRACK | 图源本体 | YAML 源 → graph.json | docs/_tech_graph/*.graph.yaml、graph.json |
|
|
189
|
+
| WIKI_TRACK | 知识库本体 | coding_wiki 叙事 | coding_wiki/syntheses/*.md |
|
|
190
|
+
| STANDARDS_TRACK | 约束本体 | 编码规范、L2 | standards/、.cursor/rules/ |
|
|
191
|
+
| VERIFY_TRACK | 验证本体 | CI、测试样本 | .github/workflows/、ci/samples/ |
|
|
192
|
+
| IDE_TRACK | IDE 适配本体 | IDE 片段、marker | ide/adapters/、CLAUDE.md |
|
|
193
|
+
| GOVERNANCE_TRACK | 治理本体 | CI 校验、漂移、规约 | 99_spec.md、_contract_manifest.json |
|
|
194
|
+
|
|
195
|
+
若某子本体无对应项,可新增并标注「新增 Track · 待维护者确认」。
|
|
196
|
+
|
|
197
|
+
### 第4步:分析关系——元路径(`*b` 模式)
|
|
198
|
+
|
|
199
|
+
扫描是否隐含元路径(T→K→B、T→H→B、H→T→B 等),并指出在哪些文件/流程中被隐式使用。
|
|
200
|
+
**注明**:元路径为分析 Lens,**非** HGM 边类型(HGM 边见 design v0 §1.2)。
|
|
201
|
+
|
|
202
|
+
### 第5步:Epic 映射(对齐 Harness 术语)
|
|
203
|
+
|
|
204
|
+
项目定义:**Epic 是 Task 的特化子类**(DESIGN_ONTOLOGY §1.4),**不**单独升格为一等类(v1)。
|
|
205
|
+
|
|
206
|
+
报告中须含:
|
|
207
|
+
|
|
208
|
+
epic_task_mapping:
|
|
209
|
+
definition: "EpicTask 是 Task 的特化子类"
|
|
210
|
+
evidence: "DESIGN_ONTOLOGY_v1_zh.md §1.4"
|
|
211
|
+
fields:
|
|
212
|
+
- depends_on: "string[] — 子 Task slug 列表"
|
|
213
|
+
- completion_policy: "must_complete_all | any_completes"
|
|
214
|
+
related_gate: "HG-EPIC-ROADMAP(Epic CLOSE 专用闸门)"
|
|
215
|
+
note: "Epic 不直接执行 30,通过子 Task 状态聚合判断完成"
|
|
216
|
+
|
|
217
|
+
### 第6步:输出「项目本体构成报告」
|
|
218
|
+
|
|
219
|
+
YAML 结构(字段名须保留):
|
|
220
|
+
|
|
221
|
+
project: "<cyning-harness | ai-ink-brain-api-python>"
|
|
222
|
+
scan_date: "<YYYY-MM-DD>"
|
|
223
|
+
report_role: "<primary | pilot_reference>"
|
|
224
|
+
|
|
225
|
+
meta_ontology:
|
|
226
|
+
- 是否隐式定义顶层原语 Lens(T/K/H/B)?在哪些文档?
|
|
227
|
+
- 是否有显式元路径约定?
|
|
228
|
+
- 是否有全局公理约束所有子本体?
|
|
229
|
+
|
|
230
|
+
sub_ontologies:
|
|
231
|
+
- id: "<PROCESS_TRACK | ...>"
|
|
232
|
+
name: "<Track 名称>"
|
|
233
|
+
files: ["..."]
|
|
234
|
+
primitives_used: ["T", "K"]
|
|
235
|
+
core_classes: ["..."]
|
|
236
|
+
key_relations: ["..."]
|
|
237
|
+
key_axioms: ["..."]
|
|
238
|
+
|
|
239
|
+
epic_task_mapping: { ... 见第5步 ... }
|
|
240
|
+
|
|
241
|
+
graph_summary:
|
|
242
|
+
primitive_lens_used: ["T", "K", "H", "B"]
|
|
243
|
+
hgm_node_labels: ["Task", "Hat", ...] # 来自 DESIGN_ONTOLOGY · 非 T/K/H/B
|
|
244
|
+
meta_paths_observed: ["tkb", "htb"]
|
|
245
|
+
missing_meta_paths: ["..."]
|
|
246
|
+
|
|
247
|
+
legacy_pending_delete: # 试点仓 · v1.3 新增 · 仅盘点
|
|
248
|
+
- path: "docs/_tech_graph/00_main.ai.md"
|
|
249
|
+
status: "deprecated_readonly"
|
|
250
|
+
successor: "docs/_tech_graph/00_main.graph.yaml"
|
|
251
|
+
note: "删源 task: graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后"
|
|
252
|
+
# ... 其余 6× flow .ai.md 同理 ...
|
|
253
|
+
|
|
254
|
+
gaps:
|
|
255
|
+
- "..."
|
|
256
|
+
|
|
257
|
+
### 与 harness ontology-check 的关系
|
|
258
|
+
|
|
259
|
+
| 维度 | 本次扫描 | harness ontology-check(v0.4+ 规划) |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| 目的 | 发现本体文件、分组、原语 Lens | 验证 DESIGN_ONTOLOGY 与 ontology.yaml 一致性 |
|
|
262
|
+
| 输出 | 盘点报告 YAML | PASS/FAIL + 差异列表 |
|
|
263
|
+
| 时机 | G0 讨论前执行一次 | CI / 产品变更时 |
|
|
264
|
+
| 关系 | **串联**:先扫描了解现状,再校验一致性。**扫描不替代校验。** |
|
|
265
|
+
|
|
266
|
+
### 输出要求
|
|
267
|
+
|
|
268
|
+
- **报告格式**:YAML
|
|
269
|
+
- **落盘路径**(根据执行目录):
|
|
270
|
+
- 产品仓扫描:`cyning-harness/docs/methodology/graph/inventory/ONTOLOGY_INVENTORY_cyning_harness_v1.yaml`
|
|
271
|
+
- 试点仓扫描:`cyning-harness/docs/methodology/graph/inventory/ONTOLOGY_INVENTORY_ai_ink_brain_api_python_v1.yaml`
|
|
272
|
+
(试点仓执行时仍写入产品仓 inventory/ · 若无法跨仓写入则落盘 invoke 附件并提示维护者手动拷贝)
|
|
273
|
+
- **提交策略**:维护者审阅后 **须提交 Git 留档**(本链 D-G0-ARCHIVE)· 签 HG-INVENTORY-ARCHIVED · 此后方可删 `.ai.md`。
|
|
274
|
+
- **若目录不存在**:mkdir -p docs/methodology/graph/inventory/ 后写入。
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 整合执行流程
|
|
279
|
+
|
|
280
|
+
1. 检查执行前提 **P1 → P2 → P4 → P5** → 硬门槛失败则终止
|
|
281
|
+
2. 试点仓执行 **P3 盘点** → 填充 `legacy_pending_delete` · **不终止**
|
|
282
|
+
3. 确定当前目录 → 产品仓 or 试点仓
|
|
283
|
+
4. 读取固定文件清单 → 逐个解析(含 deprecated `.ai.md` 只读摘要)
|
|
284
|
+
5. 标注原语类型 T/K/H/B(仅 Lens)
|
|
285
|
+
6. 按 Track 命名分组 → sub_ontologies
|
|
286
|
+
7. 输出 epic_task_mapping
|
|
287
|
+
8. 生成报告 → 落盘到 inventory/ 指定路径
|
|
288
|
+
9. 提示维护者:「扫描完成 · 请审阅 · 留档 merge 后签 HG-INVENTORY-ARCHIVED · 再开删 ai.md task」
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 重要约束
|
|
293
|
+
|
|
294
|
+
- 不要编造;不存在则写「未发现」
|
|
295
|
+
- 必须打开文件阅读内容,不只靠文件名
|
|
296
|
+
- 冲突处标记「冲突点」
|
|
297
|
+
- 优先使用项目内部术语(Hat、InvokeSnapshot 等)
|
|
298
|
+
- **禁止**修改 DESIGN_ONTOLOGY 或任何真值文件
|
|
299
|
+
|
|
300
|
+
开始执行
|
|
301
|
+
满足 P1–P5 后,按上述流程扫描并生成报告。无法判断的文件列入 gaps 并标注「待确认」。
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 修订记录
|
|
307
|
+
|
|
308
|
+
| 版本 | 日期 | 说明 |
|
|
309
|
+
| --- | --- | --- |
|
|
310
|
+
| v1.0 | 2026-06-16 | 初版落盘 |
|
|
311
|
+
| v1.1 | 2026-06-16 | 整合修正:P1–P5 前提 · T/K/H/B Lens · 固定清单 · Track 分组 · epic_task_mapping · inventory 落盘 · ontology-check 关系 |
|
|
312
|
+
| v1.2 | 2026-06-16 | P2 路径改为 `docs/_tech_graph/00_main.graph.yaml` · P3 前置为硬门槛(全删 `.ai.md` 后方可执行)· pilot_manifest 去 `src/` |
|
|
313
|
+
| v1.3 | 2026-06-17 | **D-G0-P3**:P3 改为软门槛 · `legacy_pending_delete` 盘点 · 先扫描后删 ai.md · 落盘须 Git 留档 · 关联 task_ontology_inventory_scan_g0_v1 · 试点产出文件名统一 |
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
| 文档 | 状态 | 说明 |
|
|
6
6
|
| --- | --- | --- |
|
|
7
7
|
| **[`HARNESS_GRAPH_MODEL_design_v0_zh.md`](./HARNESS_GRAPH_MODEL_design_v0_zh.md)** | proposal · **v2.0+** | **真值稿** · 节点/边/事件 · CLI 路线 |
|
|
8
|
+
| [`HGM_UPGRADE_OUTLINE_v1_zh.md`](./HGM_UPGRADE_OUTLINE_v1_zh.md) | outline | G0 讨论入口 · 依赖链 |
|
|
9
|
+
| [`PROMPT_ontology_inventory_scan_G0_v1_zh.md`](./PROMPT_ontology_inventory_scan_G0_v1_zh.md) | active · **v1.3** | G0 本体扫描 · P3 软门槛 · legacy 盘点 · inventory/ 落盘 |
|
|
8
10
|
| [`HARNESS_GRAPH_MODEL_dialogue_archive_v1_zh.md`](./HARNESS_GRAPH_MODEL_dialogue_archive_v1_zh.md) | archive | 对话参考 · **非真值** |
|
|
9
11
|
|
|
10
12
|
```text
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# G0 本体构成扫描 · 试点仓辅助报告
|
|
2
|
+
# 生成:ontology-inventory-scan-g0 · 30 执行 · freeze_id ONTOLOGY-INVENTORY-G0
|
|
3
|
+
# 约束:只读扫描 · 未删 .ai.md · 未改 export/compile
|
|
4
|
+
|
|
5
|
+
project: ai-ink-brain-api-python
|
|
6
|
+
scan_date: "2026-06-17"
|
|
7
|
+
report_role: pilot_reference
|
|
8
|
+
prompt_version: "1.3"
|
|
9
|
+
freeze_id: ONTOLOGY-INVENTORY-G0
|
|
10
|
+
|
|
11
|
+
preconditions:
|
|
12
|
+
P1: pass # 扫描源 = ai-ink-brain-api-python/
|
|
13
|
+
P2: pass # docs/_tech_graph/00_main.graph.yaml 存在且非空
|
|
14
|
+
P3: inventory_only # 7× .ai.md 列入 legacy_pending_delete · 不阻断
|
|
15
|
+
P4: pass # HG-TASK-DRAFT approved
|
|
16
|
+
P5: pass # G0 讨论素材
|
|
17
|
+
|
|
18
|
+
scanned_manifest:
|
|
19
|
+
pilot_manifest:
|
|
20
|
+
- path: docs/_tech_graph/00_main.graph.yaml
|
|
21
|
+
role: 图源 YAML(主流程)
|
|
22
|
+
exists: true
|
|
23
|
+
graph_id: "00_main"
|
|
24
|
+
node_count: 24
|
|
25
|
+
- path: docs/_tech_graph/10_flow_rag.graph.yaml
|
|
26
|
+
role: 图源 YAML(RAG 子流程)
|
|
27
|
+
exists: true
|
|
28
|
+
graph_id: "10_flow_rag"
|
|
29
|
+
- path: docs/_tech_graph/11_flow_text2sql.graph.yaml
|
|
30
|
+
role: 图源 YAML(Text2SQL 子流程)
|
|
31
|
+
exists: true
|
|
32
|
+
graph_id: "11_flow_text2sql"
|
|
33
|
+
- path: docs/_tech_graph/12_flow_fts.graph.yaml
|
|
34
|
+
role: 图源 YAML(FTS 子流程)
|
|
35
|
+
exists: true
|
|
36
|
+
graph_id: "12_flow_fts"
|
|
37
|
+
- path: docs/_tech_graph/13_flow_supabase_rpc.graph.yaml
|
|
38
|
+
role: 图源 YAML(Supabase RPC 子流程)
|
|
39
|
+
exists: true
|
|
40
|
+
graph_id: "13_flow_supabase_rpc"
|
|
41
|
+
- path: docs/_tech_graph/14_runtime_observability.graph.yaml
|
|
42
|
+
role: 图源 YAML(运行时可观测)
|
|
43
|
+
exists: true
|
|
44
|
+
graph_id: "14_runtime_observability"
|
|
45
|
+
- path: docs/_tech_graph/15_e2e_boundary.graph.yaml
|
|
46
|
+
role: 图源 YAML(E2E 边界)
|
|
47
|
+
exists: true
|
|
48
|
+
graph_id: "15_e2e_boundary"
|
|
49
|
+
- path: docs/_tech_graph/_manifest.json
|
|
50
|
+
role: 端点/表/env 索引本体
|
|
51
|
+
exists: true
|
|
52
|
+
schema_version: tech_graph_manifest_v1
|
|
53
|
+
endpoint_count: 18
|
|
54
|
+
table_count: 5
|
|
55
|
+
env_count: 53
|
|
56
|
+
- path: docs/_tech_graph/_contract_manifest.json
|
|
57
|
+
role: 契约/公理本体
|
|
58
|
+
exists: true
|
|
59
|
+
schema_version: tech_graph_contract_manifest_v1
|
|
60
|
+
topic: unified_chat_sse_contract
|
|
61
|
+
- path: docs/_tech_graph/99_spec.md
|
|
62
|
+
role: 治理/规约本体
|
|
63
|
+
exists: true
|
|
64
|
+
- path: docs/_tech_graph/01_struct.md
|
|
65
|
+
role: 数据结构本体
|
|
66
|
+
exists: true
|
|
67
|
+
- path: docs/_tech_graph/graph.json
|
|
68
|
+
role: 物化图(由 YAML export 生成,非手写)
|
|
69
|
+
exists: true
|
|
70
|
+
node_count: 135
|
|
71
|
+
edge_count: 186
|
|
72
|
+
graph_ids: [00_main, 10_flow_rag, 11_flow_text2sql, 12_flow_fts, 13_flow_supabase_rpc, 14_runtime_observability, 15_e2e_boundary]
|
|
73
|
+
|
|
74
|
+
meta_ontology:
|
|
75
|
+
implicit_primitive_lens:
|
|
76
|
+
present: true
|
|
77
|
+
documents:
|
|
78
|
+
- 99_spec.md # AI 行为约束 C1–C6 · drift_check 锚点
|
|
79
|
+
- _contract_manifest.json # payload_min_keys · allowed_events 作 K 类锚点
|
|
80
|
+
explicit_meta_path_convention:
|
|
81
|
+
present: true
|
|
82
|
+
documents:
|
|
83
|
+
- 99_spec.md # YAML 单源 → compile → .md · export → graph.json
|
|
84
|
+
note: Inform YAML 闭环(P0–P1 done)· .ai.md 已 deprecated
|
|
85
|
+
global_axioms:
|
|
86
|
+
present: true
|
|
87
|
+
source: 99_spec.md + CI tools/
|
|
88
|
+
axioms_sample:
|
|
89
|
+
- 禁止编造不存在的表/字段/RPC/端点
|
|
90
|
+
- 端点/RPC/表/env 变更须同步 _manifest.json
|
|
91
|
+
- graph.json 禁止手改 · 由 YAML export 生成
|
|
92
|
+
- _contract_manifest payload_min_keys 删改导致 contract_check 失败
|
|
93
|
+
|
|
94
|
+
sub_ontologies:
|
|
95
|
+
- id: GRAPH_TRACK
|
|
96
|
+
name: 图源本体
|
|
97
|
+
files:
|
|
98
|
+
- docs/_tech_graph/00_main.graph.yaml
|
|
99
|
+
- docs/_tech_graph/10_flow_rag.graph.yaml
|
|
100
|
+
- docs/_tech_graph/11_flow_text2sql.graph.yaml
|
|
101
|
+
- docs/_tech_graph/12_flow_fts.graph.yaml
|
|
102
|
+
- docs/_tech_graph/13_flow_supabase_rpc.graph.yaml
|
|
103
|
+
- docs/_tech_graph/14_runtime_observability.graph.yaml
|
|
104
|
+
- docs/_tech_graph/15_e2e_boundary.graph.yaml
|
|
105
|
+
- docs/_tech_graph/graph.json
|
|
106
|
+
primitives_used: [T, K, H]
|
|
107
|
+
core_classes:
|
|
108
|
+
- GraphNode
|
|
109
|
+
- GraphEdge
|
|
110
|
+
- Anchor
|
|
111
|
+
- InformArtifact
|
|
112
|
+
key_relations:
|
|
113
|
+
- graph.yaml --compile--> *.md
|
|
114
|
+
- graph.yaml --export--> graph.json
|
|
115
|
+
- Node --depends_on--> Node # mark -> ~> ?> 等拓扑边
|
|
116
|
+
- Edge --anchor--> api/*.py symbol
|
|
117
|
+
key_axioms:
|
|
118
|
+
- 单图编辑源为 .graph.yaml
|
|
119
|
+
- flowchart 须遵循 99_mermaid_protocol.md 拓扑协议(历史 .ai.md 承载)
|
|
120
|
+
|
|
121
|
+
- id: GOVERNANCE_TRACK
|
|
122
|
+
name: 治理本体
|
|
123
|
+
files:
|
|
124
|
+
- docs/_tech_graph/99_spec.md
|
|
125
|
+
- docs/_tech_graph/_contract_manifest.json
|
|
126
|
+
- docs/_tech_graph/_manifest.json
|
|
127
|
+
- docs/_tech_graph/_test_manifest.json
|
|
128
|
+
primitives_used: [K, H]
|
|
129
|
+
core_classes:
|
|
130
|
+
- ContractManifest
|
|
131
|
+
- TechGraphManifest
|
|
132
|
+
- TestManifest
|
|
133
|
+
key_relations:
|
|
134
|
+
- CI --validates--> _manifest.json
|
|
135
|
+
- CI --validates--> _contract_manifest.json
|
|
136
|
+
- drift_check --scans--> docs/_tech_graph/*.md
|
|
137
|
+
key_axioms:
|
|
138
|
+
- tech_graph_manifest_check.py 门禁
|
|
139
|
+
- tech_graph_contract_check.py SSE 键名校验
|
|
140
|
+
- tech_graph_drift_check.py 子串匹配防静默过期
|
|
141
|
+
|
|
142
|
+
- id: STANDARDS_TRACK
|
|
143
|
+
name: 约束本体(数据结构规约)
|
|
144
|
+
files:
|
|
145
|
+
- docs/_tech_graph/01_struct.md
|
|
146
|
+
primitives_used: [T, B]
|
|
147
|
+
core_classes:
|
|
148
|
+
- documents
|
|
149
|
+
- code_chunks
|
|
150
|
+
- chatbi_access_tokens
|
|
151
|
+
- rag_conversation_logs
|
|
152
|
+
- FileMeta
|
|
153
|
+
key_relations:
|
|
154
|
+
- documents --> FileMeta : metadata
|
|
155
|
+
- code_chunks --> FileMeta : metadata
|
|
156
|
+
key_axioms:
|
|
157
|
+
- Struct 表达 DB 结构 · 来源 supabase/sql/*.sql
|
|
158
|
+
|
|
159
|
+
- id: PROCESS_TRACK
|
|
160
|
+
name: 过程本体
|
|
161
|
+
files:
|
|
162
|
+
- docs/tasks/active/
|
|
163
|
+
- docs/harness/
|
|
164
|
+
- docs/tasks/RECENT_TASK_SCHEDULE.md
|
|
165
|
+
primitives_used: [T, H, B]
|
|
166
|
+
core_classes:
|
|
167
|
+
- Task
|
|
168
|
+
- InvokeSnapshot
|
|
169
|
+
- HumanGate
|
|
170
|
+
key_relations:
|
|
171
|
+
- Task --mustRead--> InformArtifact # _tech_graph/*
|
|
172
|
+
- Task --blocks--> graph-yaml-remove-ai-md # 待 G0 关账后
|
|
173
|
+
key_axioms:
|
|
174
|
+
- Harness SDD 帽链 10→22→30→40
|
|
175
|
+
- Inform 闭环 P0–P1 done(PR #178)
|
|
176
|
+
|
|
177
|
+
- id: VERIFY_TRACK
|
|
178
|
+
name: 验证本体
|
|
179
|
+
files:
|
|
180
|
+
- .github/workflows/tech-graph.yml
|
|
181
|
+
- tools/tech_graph_manifest_check.py
|
|
182
|
+
- tools/tech_graph_contract_check.py
|
|
183
|
+
- tools/tech_graph_drift_check.py
|
|
184
|
+
- tools/tech_graph_test_manifest_check.py
|
|
185
|
+
- tools/graph_yaml_compile.py
|
|
186
|
+
- tools/graph_yaml_export.py
|
|
187
|
+
primitives_used: [K, H]
|
|
188
|
+
core_classes:
|
|
189
|
+
- VerifyArtifact
|
|
190
|
+
- GateCheckRun
|
|
191
|
+
key_relations:
|
|
192
|
+
- CI --runs--> manifest_check / contract_check / drift_check
|
|
193
|
+
- export --generates--> graph.json
|
|
194
|
+
key_axioms:
|
|
195
|
+
- pytest 排除 intent_eval / intent_benchmark
|
|
196
|
+
- graph.json 白名单手改禁止
|
|
197
|
+
|
|
198
|
+
- id: WIKI_TRACK
|
|
199
|
+
name: 知识库本体
|
|
200
|
+
files:
|
|
201
|
+
- docs/coding_wiki/syntheses/
|
|
202
|
+
- docs/spec/governance/SPEC-Governance-Wiki-TechGraph-Bridge-v1.md
|
|
203
|
+
primitives_used: [T, K]
|
|
204
|
+
core_classes:
|
|
205
|
+
- WikiSynthesis
|
|
206
|
+
- graph_nodes # frontmatter 种子
|
|
207
|
+
key_relations:
|
|
208
|
+
- WikiSynthesis --graph_nodes--> GraphNode
|
|
209
|
+
- graph_query.py --neighbors/downstream/upstream--> graph.json
|
|
210
|
+
key_axioms:
|
|
211
|
+
- coding_wiki_graph_nodes_lint.py 校验 frontmatter
|
|
212
|
+
|
|
213
|
+
- id: IDE_TRACK
|
|
214
|
+
name: IDE 适配本体
|
|
215
|
+
files:
|
|
216
|
+
- AGENTS.md
|
|
217
|
+
- .cursor/rules/
|
|
218
|
+
primitives_used: [K]
|
|
219
|
+
core_classes:
|
|
220
|
+
- ConstrainArtifact
|
|
221
|
+
key_relations:
|
|
222
|
+
- Task --constrainedBy--> ConstrainArtifact
|
|
223
|
+
key_axioms: []
|
|
224
|
+
|
|
225
|
+
epic_task_mapping:
|
|
226
|
+
definition: EpicTask 是 Task 的特化子类
|
|
227
|
+
evidence: cyning-harness DESIGN_ONTOLOGY_v1_zh.md §1.4(试点仓引用产品语义真值)
|
|
228
|
+
fields:
|
|
229
|
+
- depends_on: string[] — 子 Task slug 列表
|
|
230
|
+
- completion_policy: must_complete_all | any_completes
|
|
231
|
+
related_gate: HG-EPIC-ROADMAP
|
|
232
|
+
note: 试点仓 RECENT_TASK_SCHEDULE §1.7 G0 链 #1/3 为本扫描 task
|
|
233
|
+
|
|
234
|
+
graph_summary:
|
|
235
|
+
primitive_lens_used: [T, K, H, B]
|
|
236
|
+
hgm_node_labels:
|
|
237
|
+
- InformArtifact # _tech_graph/* 映射
|
|
238
|
+
- Task
|
|
239
|
+
- HumanGate
|
|
240
|
+
- InvokeSnapshot
|
|
241
|
+
meta_paths_observed:
|
|
242
|
+
- tkb # flow 图 Topic → contract payload_min_keys → 业务端点/表实体
|
|
243
|
+
- htb # git/02_version → YAML 版本字段 → graph.json 物化
|
|
244
|
+
- tkh # Track 命名(GRAPH vs PROCESS)→ CI 键校验 → merge 门禁
|
|
245
|
+
missing_meta_paths:
|
|
246
|
+
- HGM events/*.jsonl 未启用(G1 deferred)
|
|
247
|
+
- 部分 Sub-graph 死链(并行 task graph-yaml-subgraph-nit)
|
|
248
|
+
|
|
249
|
+
legacy_pending_delete:
|
|
250
|
+
- path: docs/_tech_graph/00_main.ai.md
|
|
251
|
+
status: deprecated_readonly
|
|
252
|
+
successor: docs/_tech_graph/00_main.graph.yaml
|
|
253
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
254
|
+
- path: docs/_tech_graph/10_flow_rag.ai.md
|
|
255
|
+
status: deprecated_readonly
|
|
256
|
+
successor: docs/_tech_graph/10_flow_rag.graph.yaml
|
|
257
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
258
|
+
- path: docs/_tech_graph/11_flow_text2sql.ai.md
|
|
259
|
+
status: deprecated_readonly
|
|
260
|
+
successor: docs/_tech_graph/11_flow_text2sql.graph.yaml
|
|
261
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
262
|
+
- path: docs/_tech_graph/12_flow_fts.ai.md
|
|
263
|
+
status: deprecated_readonly
|
|
264
|
+
successor: docs/_tech_graph/12_flow_fts.graph.yaml
|
|
265
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
266
|
+
- path: docs/_tech_graph/13_flow_supabase_rpc.ai.md
|
|
267
|
+
status: deprecated_readonly
|
|
268
|
+
successor: docs/_tech_graph/13_flow_supabase_rpc.graph.yaml
|
|
269
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
270
|
+
- path: docs/_tech_graph/14_runtime_observability.ai.md
|
|
271
|
+
status: deprecated_readonly
|
|
272
|
+
successor: docs/_tech_graph/14_runtime_observability.graph.yaml
|
|
273
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
274
|
+
- path: docs/_tech_graph/15_e2e_boundary.ai.md
|
|
275
|
+
status: deprecated_readonly
|
|
276
|
+
successor: docs/_tech_graph/15_e2e_boundary.graph.yaml
|
|
277
|
+
note: 删源 task graph-yaml-remove-ai-md · 须 HG-INVENTORY-ARCHIVED 后
|
|
278
|
+
|
|
279
|
+
gaps:
|
|
280
|
+
- 7× .ai.md 仍存 · 已标 legacy_pending_delete · 待后继 task 删除
|
|
281
|
+
- Sub-graph 死链未修(非本 task 范围 · graph-yaml-subgraph-nit 并行)
|
|
282
|
+
- HGM G1 ingest 未实现(task_cyning_harness_g1_hgm_v2_v1 · blocked)
|
|
283
|
+
- 02_version.md 未列入 pilot_manifest 固定清单(存在但未逐文件展开)
|