On a breadth failure, explain WHY: does direct extraction (no pipeline, no * timeout) yield defs, and what node labels did the pipeline actually create for * the file? Distinguishes "extraction itself broke" from "extraction works but * the def didn't reach the graph / got an unexpected label". */
| 668 | * the file? Distinguishes "extraction itself broke" from "extraction works but |
| 669 | * the def didn't reach the graph / got an unexpected label". */ |
| 670 | static void breadth_diag(cbm_store_t *store, const char *project, const char *rel, |
| 671 | const GrammarCase *c) { |
| 672 | CBMFileResult *dr = |
| 673 | cbm_extract_file(c->src, (int)strlen(c->src), c->lang, "lc", c->path, 0, NULL, NULL); |
| 674 | int direct = dr ? dr->defs.count : -1; |
| 675 | const char *direct_label = (dr && dr->defs.count > 0) ? dr->defs.items[0].label : "-"; |
| 676 | char labels[256] = {0}; |
| 677 | cbm_node_t *nodes = NULL; |
| 678 | int count = 0; |
| 679 | if (cbm_store_find_nodes_by_file(store, project, rel, &nodes, &count) == CBM_STORE_OK) { |
| 680 | for (int i = 0; i < count && strlen(labels) < sizeof(labels) - 40; i++) { |
| 681 | char one[48]; |
| 682 | snprintf(one, sizeof(one), "%s ", nodes[i].label ? nodes[i].label : "?"); |
| 683 | strncat(labels, one, sizeof(labels) - strlen(labels) - 1); |
| 684 | } |
| 685 | } |
| 686 | cbm_store_free_nodes(nodes, count); |
| 687 | fprintf(stderr, " └─ direct_extract_defs=%d (label0=%s) graph_labels=[%s]\n", direct, |
| 688 | direct_label ? direct_label : "(null)", labels); |
| 689 | if (dr) { |
| 690 | cbm_free_result(dr); |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | /* Chialisp: a constant defined in an included .clib must resolve from the |
| 695 | * puzzle that includes it. |
no test coverage detected