@@ -75,7 +75,7 @@ def project(app: PyApplication, app_name: str) -> GraphRows:
7575 )
7676
7777 # Level-3 CPG overlay (present only at -a 3): the same program_graphs IR
78- # projected as :CFGNode nodes and the shared cross-language edge types.
78+ # projected as :PyCFGNode nodes and PY_-namespaced dependence edge types.
7979 if app .program_graphs is not None :
8080 _project_program_graphs (b , app )
8181
@@ -99,16 +99,18 @@ def _signature_modules(app: PyApplication) -> dict:
9999
100100
101101def _cfg_node_ref (b : RowBuilder , sig : str , node_id : int ) -> NodeRef :
102- return NodeRef ("CFGNode " , "id" , f"{ sig } #{ node_id } " )
102+ return NodeRef ("PyCFGNode " , "id" , f"{ sig } #{ node_id } " )
103103
104104
105105def _project_program_graphs (b : RowBuilder , app : PyApplication ) -> None :
106- """CFG/PDG/SDG rows: node label ``CFGNode`` (merge key ``id`` =
107- ``<signature>#<node_id>``) and edge types ``HAS_CFG_NODE`` / ``CFG_NEXT``
108- (prop ``kind``) / ``CDG`` / ``DDG`` (prop ``var``) / ``PARAM_IN`` /
109- ``PARAM_OUT`` / ``SUMMARY`` — the shared cross-language vocabulary, so no
110- ``PY_`` prefix. Parameter nodes ride the same label with their HRB kinds
111- plus ``var``/``call_node`` props (an additive, recorded extension)."""
106+ """CFG/PDG/SDG rows: node label ``PyCFGNode`` (merge key ``id`` =
107+ ``<signature>#<node_id>``) and edge types ``PY_HAS_CFG_NODE`` /
108+ ``PY_CFG_NEXT`` (prop ``kind``) / ``PY_CDG`` / ``PY_DDG`` (prop ``var``) /
109+ ``PY_PARAM_IN`` / ``PY_PARAM_OUT`` / ``PY_SUMMARY``. The vocabulary is
110+ cross-language in shape but PY_-namespaced like every other row family, so
111+ a multi-language database never mingles analyzers' dependence edges.
112+ Parameter nodes ride the same label with their HRB kinds plus
113+ ``var``/``call_node`` props (an additive, recorded extension)."""
112114 pg = app .program_graphs
113115 sig_module = _signature_modules (app )
114116
@@ -117,7 +119,7 @@ def _project_program_graphs(b: RowBuilder, app: PyApplication) -> None:
117119 module = sig_module .get (sig )
118120 for n in (fg .cfg .nodes if fg .cfg else []):
119121 ref = b .node (
120- ["CFGNode " ],
122+ ["PyCFGNode " ],
121123 "id" ,
122124 f"{ sig } #{ n .id } " ,
123125 prune (
@@ -129,10 +131,10 @@ def _project_program_graphs(b: RowBuilder, app: PyApplication) -> None:
129131 }
130132 ),
131133 )
132- b .edge ("HAS_CFG_NODE " , owner , ref )
134+ b .edge ("PY_HAS_CFG_NODE " , owner , ref )
133135 for p in fg .param_nodes or []:
134136 ref = b .node (
135- ["CFGNode " ],
137+ ["PyCFGNode " ],
136138 "id" ,
137139 f"{ sig } #{ p .id } " ,
138140 prune (
@@ -146,17 +148,17 @@ def _project_program_graphs(b: RowBuilder, app: PyApplication) -> None:
146148 }
147149 ),
148150 )
149- b .edge ("HAS_CFG_NODE " , owner , ref )
151+ b .edge ("PY_HAS_CFG_NODE " , owner , ref )
150152 for e in (fg .cfg .edges if fg .cfg else []):
151153 b .edge (
152- "CFG_NEXT " ,
154+ "PY_CFG_NEXT " ,
153155 _cfg_node_ref (b , sig , e .source ),
154156 _cfg_node_ref (b , sig , e .target ),
155157 {"kind" : e .kind },
156158 )
157159 for e in (fg .pdg .edges if fg .pdg else []):
158160 b .edge (
159- e .type , # CDG | DDG
161+ f"PY_ { e .type } " , # PY_CDG | PY_DDG
160162 _cfg_node_ref (b , sig , e .source ),
161163 _cfg_node_ref (b , sig , e .target ),
162164 prune ({"var" : e .var }),
@@ -166,7 +168,7 @@ def _project_program_graphs(b: RowBuilder, app: PyApplication) -> None:
166168 if e .type == "CALL" :
167169 continue # the callable-level PY_CALLS twin already carries calls
168170 b .edge (
169- e .type , # PARAM_IN | PARAM_OUT | SUMMARY
171+ f"PY_ { e .type } " , # PY_PARAM_IN | PY_PARAM_OUT | PY_SUMMARY
170172 _cfg_node_ref (b , e .source .signature , e .source .node ),
171173 _cfg_node_ref (b , e .target .signature , e .target .node ),
172174 prune ({"var" : e .var }),
0 commit comments