@@ -201,6 +201,21 @@ static int assert_no_resolvable_edge_files(const RFile *files, int nfiles,
201201 return 1 ;
202202 }
203203 int rc = 0 ;
204+ /* Exercised-check: the fixture MUST produce at least one callable-sourced
205+ * CALLS edge (its in-fixture control call). Without it the "no edge to
206+ * <callee>" invariant is VACUOUS — it also passes when extraction silently
207+ * produced nothing, so a green would not prove the unresolvable call was
208+ * actually processed and correctly dropped. */
209+ int module_sourced = -1 ;
210+ int callable_sourced = -1 ;
211+ inv_count_calls_by_source (store , lp .project , & module_sourced , & callable_sourced );
212+ (void )module_sourced ;
213+ if (callable_sourced <= 0 ) {
214+ printf (" %sFAIL%s %s:%d: no callable-sourced CALLS edge — fixture not "
215+ "exercised; the no-edge invariant for %s is vacuous\n" ,
216+ tf_red (), tf_reset (), __FILE__ , __LINE__ , callee_substr );
217+ rc = 1 ;
218+ }
204219 if (!inv_no_calls_edge_to_qn (store , lp .project , callee_substr )) {
205220 printf (" %sFAIL%s %s:%d: a CALLS edge unexpectedly targets %s "
206221 "(expected NONE — callee is unresolvable)\n" ,
@@ -309,11 +324,11 @@ static const RFile kGoCrossFile[] = {
309324 * "lsp_unresolved"). NOTE: emit_unresolved_call uses confidence 0.0, so the
310325 * pipeline may not promote it into a CALLS edge with the strategy tag — this
311326 * fixture documents whether "lsp_unresolved" surfaces in the graph. */
312- static const char kGoUnresolved [] =
313- "package main \n"
314- "func caller(v int) int {\n"
315- " return totallyUnknownFn(v)\n"
316- "}\n" ;
327+ static const char kGoUnresolved [] = "package main\n"
328+ "func known(x int) int { return x + 1 } \n"
329+ "func caller(v int) int {\n"
330+ " return known(v) + totallyUnknownFn(v)\n"
331+ "}\n" ;
317332
318333/* ── Python fixtures ───────────────────────────────────────────────────────── */
319334
@@ -386,13 +401,13 @@ static const RFile kPyModuleAttr[] = {
386401 * symbol lookup misses → best-effort "module.attr" QN, low confidence). helpers
387402 * defines nothing named missing_fn. */
388403static const RFile kPyModuleAttrUnresolved [] = {
389- {"helpers.py" ,
390- "def do_work(x): \n"
391- " return x + 9 \n"},
392- { "main.py" ,
393- "import helpers \n"
394- "def caller(v):\n"
395- " return helpers.missing_fn(v)\n" },
404+ {"helpers.py" , "def do_work(x):\n"
405+ " return x + 9 \n"},
406+ { "main.py" , "import helpers \n"
407+ "def known(x):\n"
408+ " return x + 1 \n"
409+ "def caller(v):\n"
410+ " return known(v) + helpers.missing_fn(v)\n" },
396411};
397412
398413/* lsp_dict_dispatch — funcs["key"]() where funcs is a dict-literal dispatch
@@ -571,23 +586,14 @@ TEST(repro_lsp_py_operator_dunder) {
571586}
572587
573588TEST (repro_lsp_py_builtin ) {
574- /* PARKED for release: lsp_builtin (len(v)) needs a typeshed/builtins registry
575- * so builtin functions have target nodes; without it the resolution has no
576- * node to form a CALLS edge to (callable=0). Tracked for a future builtins
577- * registry. */
578- printf (" %sSKIP%s parked: needs builtins/typeshed registry (len has no node)\n" , tf_dim (),
579- tf_reset ());
580- return -1 ; /* skip — not counted as pass or fail */
589+ /* len(v) resolves to the injected builtins.len node (py_builtins.c) and
590+ * emits lsp_builtin with a real CALLS edge. */
581591 return assert_lsp_strategy ("main.py" , kPyBuiltin , "lsp_builtin" );
582592}
583593
584594TEST (repro_lsp_py_builtin_constructor ) {
585- /* PARKED for release: lsp_builtin_constructor (str(v)) needs a builtins/
586- * typeshed registry so the builtin type str has a node to target. Tracked
587- * for a future builtins registry. */
588- printf (" %sSKIP%s parked: needs builtins/typeshed registry (str type has no node)\n" , tf_dim (),
589- tf_reset ());
590- return -1 ; /* skip — not counted as pass or fail */
595+ /* str(v) resolves to the injected builtins.str type node (py_builtins.c)
596+ * and emits lsp_builtin_constructor with a real CALLS edge. */
591597 return assert_lsp_strategy ("main.py" , kPyBuiltinConstructor ,
592598 "lsp_builtin_constructor" );
593599}
0 commit comments