-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcode-review-graph@1.json
More file actions
165 lines (165 loc) · 6.21 KB
/
Copy pathcode-review-graph@1.json
File metadata and controls
165 lines (165 loc) · 6.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://understand-quickly.dev/schemas/code-review-graph@1.json",
"title": "code-review-graph@1",
"description": "Knowledge-graph payload produced by tirth8205/code-review-graph (https://github.com/tirth8205/code-review-graph). The tool persists to SQLite under .code-review-graph/, but its visualize/export pipeline serializes the graph to JSON via code_review_graph.visualization.export_graph_data(). That dict shape is what this schema describes.",
"type": "object",
"required": ["nodes", "edges", "stats"],
"properties": {
"nodes": {
"type": "array",
"description": "Code-symbol nodes. Shape from code_review_graph.graph.node_to_dict + community_id/params/return_type added by export_graph_data.",
"items": {
"type": "object",
"required": ["id", "kind", "name", "qualified_name", "file_path"],
"properties": {
"id": { "type": "integer", "minimum": 1 },
"kind": {
"type": "string",
"enum": ["File", "Class", "Function", "Type", "Test"]
},
"name": { "type": "string", "minLength": 1 },
"qualified_name": { "type": "string", "minLength": 1 },
"file_path": { "type": "string" },
"line_start": { "type": ["integer", "null"], "minimum": 0 },
"line_end": { "type": ["integer", "null"], "minimum": 0 },
"language": { "type": ["string", "null"] },
"parent_name": { "type": ["string", "null"] },
"params": { "type": ["string", "null"] },
"return_type": { "type": ["string", "null"] },
"is_test": {
"description": "0/1 from SQLite or boolean once normalised.",
"type": ["boolean", "integer"],
"enum": [false, true, 0, 1]
},
"community_id": { "type": ["integer", "null"] }
}
}
},
"edges": {
"type": "array",
"description": "Relations between symbols. Shape from code_review_graph.graph.edge_to_dict.",
"items": {
"type": "object",
"required": ["id", "kind", "source", "target"],
"properties": {
"id": { "type": "integer", "minimum": 1 },
"kind": {
"type": "string",
"enum": [
"CALLS",
"IMPORTS_FROM",
"INHERITS",
"IMPLEMENTS",
"CONTAINS",
"TESTED_BY",
"DEPENDS_ON",
"REFERENCES"
]
},
"source": { "type": "string", "minLength": 1 },
"target": { "type": "string", "minLength": 1 },
"file_path": { "type": "string" },
"line": { "type": "integer", "minimum": 0 },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 },
"confidence_tier": {
"type": "string",
"enum": ["EXTRACTED", "INFERRED", "AMBIGUOUS"]
}
}
}
},
"stats": {
"type": "object",
"description": "GraphStats dataclass (code_review_graph.graph.GraphStats).",
"required": [
"total_nodes",
"total_edges",
"nodes_by_kind",
"edges_by_kind",
"languages",
"files_count"
],
"properties": {
"total_nodes": { "type": "integer", "minimum": 0 },
"total_edges": { "type": "integer", "minimum": 0 },
"nodes_by_kind": {
"type": "object",
"additionalProperties": { "type": "integer", "minimum": 0 }
},
"edges_by_kind": {
"type": "object",
"additionalProperties": { "type": "integer", "minimum": 0 }
},
"languages": {
"type": "array",
"items": { "type": "string" }
},
"files_count": { "type": "integer", "minimum": 0 },
"last_updated": { "type": ["string", "null"] }
}
},
"flows": {
"type": "array",
"description": "Stored flows (code_review_graph.flows.get_flows). Empty array when the flows table is missing or unpopulated.",
"items": {
"type": "object",
"required": ["id", "name"],
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"entry_point_id": { "type": ["integer", "null"] },
"depth": { "type": ["integer", "null"], "minimum": 0 },
"node_count": { "type": ["integer", "null"], "minimum": 0 },
"file_count": { "type": ["integer", "null"], "minimum": 0 },
"criticality": { "type": ["number", "null"] },
"path": {
"type": "array",
"items": { "type": "string" }
},
"created_at": { "type": ["string", "number", "null"] },
"updated_at": { "type": ["string", "number", "null"] }
}
}
},
"communities": {
"type": "array",
"description": "Detected communities (code_review_graph.communities.get_communities).",
"items": {
"type": "object",
"required": ["id", "name", "size", "members"],
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"level": { "type": ["integer", "null"] },
"cohesion": { "type": ["number", "null"] },
"size": { "type": "integer", "minimum": 0 },
"dominant_language": { "type": "string" },
"description": { "type": "string" },
"members": {
"type": "array",
"items": { "type": "string" }
}
}
}
},
"metadata": {
"type": "object",
"description": "Optional ingestion metadata. Not emitted by upstream today, but ingestors are expected to fill it.",
"properties": {
"tool": { "const": "code-review-graph" },
"tool_version": { "type": "string" },
"generated_at": { "type": "string", "format": "date-time" }
}
},
"mode": {
"type": "string",
"description": "Set when the payload comes from an aggregated render (community/file modes in visualization.py).",
"enum": ["full", "community", "file"]
},
"community_details": {
"type": "object",
"description": "Per-community drill-down nodes/edges, present only in community-aggregated exports."
}
}
}