@@ -201,10 +201,17 @@ const addEndpoint = (
201201 input . value . module_runtime ,
202202 ) ?? input . asset ;
203203 const key = compactStringIdentityKey ( input . value . value ) ;
204- const label = `${ input . value . kind } endpoint` ;
204+ const candidate = input . value . interpretation === "candidate" ;
205+ const candidateLimitation =
206+ "The unbound method-like argument is only a candidate; its receiver does not establish a network call." ;
207+ const label = `${ input . value . kind } ${ candidate ? "endpoint candidate" : "endpoint" } ` ;
205208 const node = context . accumulator . addNode ( {
206209 kind : "endpoint" ,
207- identity : artifactLocalIdentity ( input . file . sha256 , input . value . kind , key ) ,
210+ identity : artifactLocalIdentity (
211+ input . file . sha256 ,
212+ input . value . kind ,
213+ JSON . stringify ( [ input . value . interpretation ?? "literal" , key ] ) ,
214+ ) ,
208215 observations : [
209216 {
210217 label :
@@ -213,14 +220,25 @@ const addEndpoint = (
213220 endpoint_kind : input . value . kind ,
214221 value : input . value . value ,
215222 mechanism : input . value . mechanism ,
223+ ...( candidate ? { interpretation : input . value . interpretation } : { } ) ,
216224 } ,
217- evidence : astObservationEvidence ( {
218- sha256 : input . file . sha256 ,
219- path : input . file . path ,
220- range : input . value . location ,
221- operation : "discover-static-endpoint" ,
222- coverage : input . coverage ,
223- } ) ,
225+ evidence : candidate
226+ ? staticInferenceEvidence ( {
227+ sha256 : input . file . sha256 ,
228+ path : input . file . path ,
229+ range : input . value . location ,
230+ operation : "classify-static-endpoint-candidate" ,
231+ coverage : input . coverage ,
232+ confidence : "low" ,
233+ limitations : [ candidateLimitation ] ,
234+ } )
235+ : astObservationEvidence ( {
236+ sha256 : input . file . sha256 ,
237+ path : input . file . path ,
238+ range : input . value . location ,
239+ operation : "discover-static-endpoint" ,
240+ coverage : input . coverage ,
241+ } ) ,
224242 } ,
225243 ] ,
226244 } ) ;
@@ -231,7 +249,16 @@ const addEndpoint = (
231249 range : input . value . location ,
232250 coverage : input . coverage ,
233251 relation : input . value . kind === "route" ? "exposes" : "calls" ,
234- properties : { mechanism : input . value . mechanism } ,
252+ properties : {
253+ mechanism : input . value . mechanism ,
254+ ...( candidate ? { interpretation : input . value . interpretation } : { } ) ,
255+ } ,
256+ ...( candidate
257+ ? {
258+ confidence : "low" as const ,
259+ limitations : [ candidateLimitation ] ,
260+ }
261+ : { } ) ,
235262 } ) ;
236263} ;
237264
0 commit comments