| 591 | } |
| 592 | |
| 593 | static bool cx_pyrange_exact_control(cbm_store_t *store, const char *project, |
| 594 | const cbm_node_t *caller, const char *qn, |
| 595 | const char *target_file, const char *label) { |
| 596 | if (!caller->qualified_name || !caller->file_path || !caller->label || |
| 597 | strcmp(caller->label, "Function") != 0) |
| 598 | return false; |
| 599 | cbm_node_t target = {0}; |
| 600 | cbm_edge_t *edges = NULL; |
| 601 | int count = 0, exact = 0; |
| 602 | bool ok = cbm_store_find_node_by_qn(store, project, qn, &target) == CBM_STORE_OK && |
| 603 | target.qualified_name && strcmp(target.qualified_name, qn) == 0 && target.label && |
| 604 | strcmp(target.label, label) == 0 && target.file_path && |
| 605 | strcmp(target.file_path, target_file) == 0 && |
| 606 | cbm_store_find_edges_by_source_type(store, caller->id, "CALLS", &edges, &count) == |
| 607 | CBM_STORE_OK; |
| 608 | for (int i = 0; ok && i < count; i++) { |
| 609 | if (edges[i].target_id != target.id) |
| 610 | continue; |
| 611 | yyjson_doc *doc = |
| 612 | edges[i].properties_json |
| 613 | ? yyjson_read(edges[i].properties_json, strlen(edges[i].properties_json), 0) |
| 614 | : NULL; |
| 615 | /* an LSP resolution records an lsp_* strategy */ |
| 616 | const char *strategy = |
| 617 | doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "strategy")) : NULL; |
| 618 | if (strategy && strncmp(strategy, "lsp_", 4) == 0) |
| 619 | exact++; |
| 620 | yyjson_doc_free(doc); |
| 621 | } |
| 622 | cbm_store_free_edges(edges, count); |
| 623 | cbm_node_free_fields(&target); |
| 624 | return ok && exact == 1; |
| 625 | } |
| 626 | |
| 627 | /* A remote method has no declaration in the importer/raw file registry. Its |
| 628 | * source=lsp edge proves that cross-file registry evidence reached resolution. */ |
no test coverage detected