@cyning/harness 1.0.1 → 1.1.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 +29 -0
- package/README.md +2 -1
- package/docs/USER_GUIDE_v1.0_zh.md +58 -5
- 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/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 +153 -7
- package/lib/graph-yaml.js +547 -0
- package/lib/verify.js +58 -9
- package/ontology.yaml +1 -1
- package/package.json +4 -1
- package/schema/inform_graph.v3.schema.json +134 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cyning.dev/schemas/cyning-harness/inform_graph.v3.json",
|
|
4
|
+
"title": "cyning-harness Inform Graph YAML v3",
|
|
5
|
+
"description": "Graph Source v3 编辑源 schema · YAML → Mermaid MD + graph.json(Inform 轨 · v1.1+)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["graph_id", "title", "nodes", "edges"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "inform_graph.v3",
|
|
13
|
+
"description": "Inform Graph YAML schema 版本(v1.1+ 产品化后固定)"
|
|
14
|
+
},
|
|
15
|
+
"graph_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^[a-zA-Z0-9_]+$",
|
|
18
|
+
"description": "图 ID · 与文件名 <graph_id>.graph.yaml 一致"
|
|
19
|
+
},
|
|
20
|
+
"title": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "人类可读图标题"
|
|
24
|
+
},
|
|
25
|
+
"description": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "图用途简述"
|
|
28
|
+
},
|
|
29
|
+
"version": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "编辑源版本号或日期"
|
|
32
|
+
},
|
|
33
|
+
"direction": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": ["TD", "TB", "BT", "LR", "RL"],
|
|
36
|
+
"default": "TD",
|
|
37
|
+
"description": "Mermaid flowchart 方向"
|
|
38
|
+
},
|
|
39
|
+
"notes": {
|
|
40
|
+
"oneOf": [
|
|
41
|
+
{ "type": "string" },
|
|
42
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
43
|
+
],
|
|
44
|
+
"description": "附加说明 · compile 后写入 MD"
|
|
45
|
+
},
|
|
46
|
+
"nodes": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": { "$ref": "#/$defs/node" },
|
|
49
|
+
"minItems": 1
|
|
50
|
+
},
|
|
51
|
+
"edges": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": { "$ref": "#/$defs/edge" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"$defs": {
|
|
57
|
+
"node": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": ["id", "label"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"id": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
65
|
+
"description": "节点唯一标识 · Mermaid 节点 ID"
|
|
66
|
+
},
|
|
67
|
+
"label": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"minLength": 1,
|
|
70
|
+
"description": "节点显示标签"
|
|
71
|
+
},
|
|
72
|
+
"kind": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": ["flow", "struct", "external"],
|
|
75
|
+
"description": "节点种类(可选)"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"edge": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": ["from", "to"],
|
|
83
|
+
"properties": {
|
|
84
|
+
"from": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
87
|
+
"description": "源节点 ID"
|
|
88
|
+
},
|
|
89
|
+
"to": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
92
|
+
"description": "目标节点 ID"
|
|
93
|
+
},
|
|
94
|
+
"mark": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Mermaid 箭头标记 · 如 -> ~> ?> ::branches [ok]"
|
|
97
|
+
},
|
|
98
|
+
"label": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "边语义标签"
|
|
101
|
+
},
|
|
102
|
+
"type": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "边类型 · 覆盖 mark 推断"
|
|
105
|
+
},
|
|
106
|
+
"anchors": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"items": { "$ref": "#/$defs/anchor" }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"anchor": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": false,
|
|
115
|
+
"required": ["path"],
|
|
116
|
+
"properties": {
|
|
117
|
+
"path": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"minLength": 1,
|
|
120
|
+
"description": "代码/文档相对路径"
|
|
121
|
+
},
|
|
122
|
+
"symbol": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"description": "符号名 · 与 line 二选一或共存"
|
|
125
|
+
},
|
|
126
|
+
"line": {
|
|
127
|
+
"type": "integer",
|
|
128
|
+
"minimum": 1,
|
|
129
|
+
"description": "行号 · 与 symbol 二选一或共存"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|