Mengapa (falsifiable — repro dijalankan 2026-07-13)
Fungsi Python yang dipanggil HANYA di module top-level dapat ref_count=0 / status=dead — panggilan module-level TIDAK menghasilkan edge di call graph. Ini bug #219 (module-level call extraction) tapi untuk parser Python; fix #219 hanya menyentuh js_backend/ts_backend parser (synthetic <file>:0:<module> source id), Python tak ikut.
Repro (scan file ini, cek backend.json):
def setup_app(): return 1
def helper(): return 2
def caller(): return helper()
setup_app() # module-level call
caller() # module-level call
Hasil aktual:
setup_app: rc=0 status=dead (SALAH — dipanggil module-level)
helper: rc=1 active (benar — dipanggil dari caller())
caller: rc=0 status=dead (SALAH — dipanggil module-level)
- edges: HANYA
caller->helper. Panggilan setup_app() & caller() di module-level → nol edge.
Konteks
Python core language CodeLens (proyek ini sendiri Python). Banyak script/bootstrap pakai module-level call (main(), app.run(), dsb). Semua false-flagged dead + rc undercount. Analog persis #219 yang sudah fixed untuk TS/JS via synthetic <file>:0:<module>.
Tujuan
Python parser extract module-level call (top-level statement yang memanggil fungsi) sebagai edge dgn synthetic source id <file>:0:<module> — FORMAT SAMA dgn TS/JS (is_module_level_source_id() di graph_model kenal), supaya trace --direction up juga tampilkan module-level caller (spt #223) dan rc benar.
Constraint
Definition of Done
Mengapa (falsifiable — repro dijalankan 2026-07-13)
Fungsi Python yang dipanggil HANYA di module top-level dapat
ref_count=0/status=dead— panggilan module-level TIDAK menghasilkan edge di call graph. Ini bug #219 (module-level call extraction) tapi untuk parser Python; fix #219 hanya menyentuh js_backend/ts_backend parser (synthetic<file>:0:<module>source id), Python tak ikut.Repro (scan file ini, cek backend.json):
Hasil aktual:
setup_app: rc=0 status=dead (SALAH — dipanggil module-level)helper: rc=1 active (benar — dipanggil dari caller())caller: rc=0 status=dead (SALAH — dipanggil module-level)caller->helper. Panggilansetup_app()&caller()di module-level → nol edge.Konteks
Python core language CodeLens (proyek ini sendiri Python). Banyak script/bootstrap pakai module-level call (
main(),app.run(), dsb). Semua false-flagged dead + rc undercount. Analog persis #219 yang sudah fixed untuk TS/JS via synthetic<file>:0:<module>.Tujuan
Python parser extract module-level call (top-level statement yang memanggil fungsi) sebagai edge dgn synthetic source id
<file>:0:<module>— FORMAT SAMA dgn TS/JS (is_module_level_source_id()di graph_model kenal), supayatrace --direction upjuga tampilkan module-level caller (spt #223) dan rc benar.Constraint
<file>:0:<module>(jangan bikin format baru —graph_model.is_module_level_source_id()harus kenal).SELECT COUNT(*) WHERE name='<module>'= 0).tests/test_graph_accuracy_golden.py(harness sudah punya pola TS setara — mirror untuk Python).Definition of Done
setup_app/caller(dipanggil module-level) → rc>=1, NOT deadtrace --direction up setup_apptampilkan module-level caller (module_level=True)<module>node di graph_nodes