MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / add_parse_partial_summary

Function add_parse_partial_summary

src/mcp/mcp.c:10920–10953  ·  view source on GitHub ↗

Attach the best-effort parse-coverage summary (#963). Always emits a * top-level "parse_partial_count" (0 on clean runs). When files were flagged: * "parse_partial": {"files":[{path,error_ranges}..(<=50)], "count":N, * "truncated":bool, "note":"..."} * These files WERE indexed — constructs inside the listed 1-based line ranges * are missing from the graph because tree-si

Source from the content-addressed store, hash-verified

10918 * note spells out the best-effort framing: absence from this list is NOT a
10919 * completeness guarantee. */
10920static void add_parse_partial_summary(yyjson_mut_doc *doc, yyjson_mut_val *root,
10921 const cbm_file_error_t *errs, int count) {
10922 int partials = 0;
10923 for (int i = 0; i < count; i++) {
10924 if (is_parse_partial(&errs[i])) {
10925 partials++;
10926 }
10927 }
10928 yyjson_mut_obj_add_int(doc, root, "parse_partial_count", partials);
10929 if (!errs || partials <= 0) {
10930 return;
10931 }
10932 yyjson_mut_val *pp = yyjson_mut_obj(doc);
10933 yyjson_mut_val *files = yyjson_mut_arr(doc);
10934 int shown = 0;
10935 for (int i = 0; i < count && shown < INDEX_SKIPPED_FILE_CAP; i++) {
10936 if (!is_parse_partial(&errs[i])) {
10937 continue;
10938 }
10939 yyjson_mut_val *fe = yyjson_mut_obj(doc);
10940 yyjson_mut_obj_add_strcpy(doc, fe, "path", errs[i].path ? errs[i].path : "");
10941 yyjson_mut_obj_add_strcpy(doc, fe, "error_ranges", errs[i].reason ? errs[i].reason : "");
10942 yyjson_mut_arr_add_val(files, fe);
10943 shown++;
10944 }
10945 yyjson_mut_obj_add_val(doc, pp, "files", files);
10946 yyjson_mut_obj_add_int(doc, pp, "count", partials);
10947 yyjson_mut_obj_add_bool(doc, pp, "truncated", partials > INDEX_SKIPPED_FILE_CAP);
10948 yyjson_mut_obj_add_str(doc, pp, "note",
10949 "Indexed, but constructs in these line ranges may be missing (best-"
10950 "effort signal); examples only — full list via index_status or "
10951 "'logfile'.");
10952 yyjson_mut_obj_add_val(doc, root, "parse_partial", pp);
10953}
10954
10955/* Attach the whole-file half of the coverage summary. Always emits a top-level
10956 * "parse_unusable_count" (0 on clean runs) so the CI coverage gate can read it

Callers 2

Calls 1

is_parse_partialFunction · 0.85

Tested by

no test coverage detected