Skip to content

Commit b4182bb

Browse files
test: generate the v1 side-document fixture with Core's own writers
The v1 analysis was hand-written and broke the format Core writes: one-character ids, a raw-key member, all_edges on a nested relation, a top-level relation between parents and an edges table missing an edge. Its expected extra edge came only from that nested all_edges, and #174's reader, which now reads the single v1 form, fails on it. The pair is now one analysis written by Core's two writers, both after align_relation_edges at 3adb6969: legacy at main 53f0bb8e, v1 at 3adb6969. Each method sits in one leaf, top-level relations join leaves, and ids are Core's 12-character ones. The test still asserts both give the same side document, and which edges stay extra once the calls are left to the graph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9b502c9 commit b4182bb

3 files changed

Lines changed: 518 additions & 39 deletions

File tree

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
{
2+
"metadata": {
3+
"generated_at": "2026-11-12T00:00:00Z",
4+
"source_tree_hash": "",
5+
"repo_name": "pkg",
6+
"depth_level": 2,
7+
"depth_cap": 2,
8+
"file_coverage_summary": {
9+
"total_files": 3,
10+
"analyzed": 3,
11+
"not_analyzed": 0,
12+
"not_analyzed_by_reason": {}
13+
},
14+
"tree_spec": {}
15+
},
16+
"description": "fixture",
17+
"files": {
18+
"pkg/a.py": {
19+
"method_keys": [
20+
"pkg/a.py|pkg.a.run",
21+
"pkg/a.py|pkg.a.helper"
22+
],
23+
"content_hash": "",
24+
"module_hash": ""
25+
},
26+
"pkg/b.py": {
27+
"method_keys": [
28+
"pkg/b.py|pkg.b.save",
29+
"pkg/b.py|~Weird"
30+
],
31+
"content_hash": "",
32+
"module_hash": ""
33+
},
34+
"pkg/c.py": {
35+
"method_keys": [
36+
"pkg/c.py|pkg.c.load"
37+
],
38+
"content_hash": "",
39+
"module_hash": ""
40+
}
41+
},
42+
"methods_index": {
43+
"pkg/a.py|pkg.a.run": {
44+
"file_path": "pkg/a.py",
45+
"qualified_name": "pkg.a.run",
46+
"start_line": 1,
47+
"end_line": 5,
48+
"type": "FUNCTION",
49+
"content_hash": "h1"
50+
},
51+
"pkg/a.py|pkg.a.helper": {
52+
"file_path": "pkg/a.py",
53+
"qualified_name": "pkg.a.helper",
54+
"start_line": 6,
55+
"end_line": 8,
56+
"type": "FUNCTION",
57+
"content_hash": "h2"
58+
},
59+
"pkg/b.py|pkg.b.save": {
60+
"file_path": "pkg/b.py",
61+
"qualified_name": "pkg.b.save",
62+
"start_line": 1,
63+
"end_line": 4,
64+
"type": "FUNCTION",
65+
"content_hash": "h3"
66+
},
67+
"pkg/b.py|~Weird": {
68+
"file_path": "pkg/b.py",
69+
"qualified_name": "~Weird",
70+
"start_line": 10,
71+
"end_line": 12,
72+
"type": "FUNCTION",
73+
"content_hash": "h4"
74+
},
75+
"pkg/c.py|pkg.c.load": {
76+
"file_path": "pkg/c.py",
77+
"qualified_name": "pkg.c.load",
78+
"start_line": 1,
79+
"end_line": 3,
80+
"type": "FUNCTION",
81+
"content_hash": "h5"
82+
}
83+
},
84+
"components": [
85+
{
86+
"name": "Core",
87+
"description": "d1",
88+
"key_entities": [],
89+
"source_cluster_ids": [],
90+
"file_methods": [
91+
{
92+
"file_path": "pkg/a.py",
93+
"methods": [
94+
"pkg.a.run",
95+
"pkg.a.helper"
96+
]
97+
},
98+
{
99+
"file_path": "pkg/b.py",
100+
"methods": [
101+
"pkg.b.save",
102+
"~Weird"
103+
]
104+
}
105+
],
106+
"component_id": "1",
107+
"can_expand": true,
108+
"components": [
109+
{
110+
"name": "Run",
111+
"description": "",
112+
"key_entities": [],
113+
"source_cluster_ids": [],
114+
"file_methods": [
115+
{
116+
"file_path": "pkg/a.py",
117+
"methods": [
118+
"pkg.a.run",
119+
"pkg.a.helper"
120+
]
121+
}
122+
],
123+
"component_id": "1.1",
124+
"can_expand": false,
125+
"components": [],
126+
"components_relations": []
127+
},
128+
{
129+
"name": "Store",
130+
"description": "",
131+
"key_entities": [],
132+
"source_cluster_ids": [],
133+
"file_methods": [
134+
{
135+
"file_path": "pkg/b.py",
136+
"methods": [
137+
"pkg.b.save",
138+
"~Weird"
139+
]
140+
}
141+
],
142+
"component_id": "1.2",
143+
"can_expand": false,
144+
"components": [],
145+
"components_relations": []
146+
}
147+
],
148+
"components_relations": [
149+
{
150+
"relation": "saves",
151+
"src_name": "Run",
152+
"dst_name": "Store",
153+
"evidence": "",
154+
"key_edges": [],
155+
"src_id": "1.1",
156+
"dst_id": "1.2",
157+
"is_static": false,
158+
"all_edges": [
159+
{
160+
"source": "pkg/a.py|pkg.a.run",
161+
"target": "pkg/b.py|pkg.b.save",
162+
"call_sites": [
163+
{
164+
"line": 3,
165+
"column": 8
166+
}
167+
],
168+
"description": ""
169+
},
170+
{
171+
"source": "pkg/a.py|pkg.a.helper",
172+
"target": "pkg/b.py|pkg.b.save",
173+
"call_sites": [],
174+
"description": ""
175+
}
176+
]
177+
}
178+
]
179+
},
180+
{
181+
"name": "Also",
182+
"description": "",
183+
"key_entities": [],
184+
"source_cluster_ids": [],
185+
"file_methods": [
186+
{
187+
"file_path": "pkg/c.py",
188+
"methods": [
189+
"pkg.c.load"
190+
]
191+
}
192+
],
193+
"component_id": "2",
194+
"can_expand": false,
195+
"components": [],
196+
"components_relations": []
197+
}
198+
],
199+
"components_relations": [
200+
{
201+
"relation": "saves",
202+
"src_name": "Run",
203+
"dst_name": "Store",
204+
"evidence": "",
205+
"key_edges": [],
206+
"src_id": "1.1",
207+
"dst_id": "1.2",
208+
"is_static": false,
209+
"all_edges": [
210+
{
211+
"source": "pkg/a.py|pkg.a.run",
212+
"target": "pkg/b.py|pkg.b.save",
213+
"call_sites": [
214+
{
215+
"line": 3,
216+
"column": 8
217+
}
218+
],
219+
"description": ""
220+
},
221+
{
222+
"source": "pkg/a.py|pkg.a.helper",
223+
"target": "pkg/b.py|pkg.b.save",
224+
"call_sites": [],
225+
"description": ""
226+
}
227+
]
228+
},
229+
{
230+
"relation": "uses",
231+
"src_name": "Run",
232+
"dst_name": "Also",
233+
"evidence": "",
234+
"key_edges": [],
235+
"src_id": "1.1",
236+
"dst_id": "2",
237+
"is_static": false,
238+
"all_edges": [
239+
{
240+
"source": "pkg/a.py|pkg.a.run",
241+
"target": "pkg/c.py|pkg.c.load",
242+
"call_sites": [
243+
{
244+
"line": 4,
245+
"column": 4
246+
}
247+
],
248+
"description": ""
249+
}
250+
]
251+
},
252+
{
253+
"relation": "loads",
254+
"src_name": "Store",
255+
"dst_name": "Also",
256+
"evidence": "",
257+
"key_edges": [],
258+
"src_id": "1.2",
259+
"dst_id": "2",
260+
"is_static": false,
261+
"all_edges": [
262+
{
263+
"source": "pkg/b.py|~Weird",
264+
"target": "pkg/c.py|pkg.c.load",
265+
"call_sites": [],
266+
"description": ""
267+
}
268+
]
269+
},
270+
{
271+
"relation": "reads",
272+
"src_name": "Also",
273+
"dst_name": "Store",
274+
"evidence": "",
275+
"key_edges": [],
276+
"src_id": "2",
277+
"dst_id": "1.2",
278+
"is_static": false,
279+
"all_edges": [
280+
{
281+
"source": "pkg/c.py|pkg.c.load",
282+
"target": "pkg/b.py|pkg.b.save",
283+
"call_sites": [],
284+
"description": ""
285+
}
286+
]
287+
}
288+
]
289+
}

0 commit comments

Comments
 (0)