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

Function bm25_findability_fixture

tests/test_mcp.c:4308–4345  ·  view source on GitHub ↗

Shared fixture for the two BM25 findability probes (2026-09-16, measured on * JetBrains/Exposed and django/django): a Class named exactly like the query, * that class's own Methods, and test Methods whose long names repeat the * query token — the shapes that outranked the class and hid it entirely. */

Source from the content-addressed store, hash-verified

4306 * that class's own Methods, and test Methods whose long names repeat the
4307 * query token — the shapes that outranked the class and hid it entirely. */
4308static void bm25_findability_fixture(cbm_store_t *store, const char *project) {
4309 cbm_store_upsert_project(store, project, "/tmp/bm25-findability");
4310 struct {
4311 const char *label, *name, *qn, *file;
4312 } rows[] = {
4313 {"Class", "Table", "bm25-find.core.Table.Table", "core/Table.kt"},
4314 {"Method", "unquoted", "bm25-find.core.Table.Table.unquoted", "core/Table.kt"},
4315 {"Method", "describe", "bm25-find.core.Table.Table.describe", "core/Table.kt"},
4316 {"Method", "table references table with same name in other database",
4317 "bm25-find.tests.SchemaTests.table_references_table_with_same_name", "tests/Schema.kt"},
4318 {"Method", "table references table with same name in mysql",
4319 "bm25-find.tests.SchemaTests.table_references_table_with_same_name_mysql",
4320 "tests/Schema.kt"},
4321 {"Function", "get_object_or_404", "bm25-find.shortcuts.get_object_or_404", "shortcuts.py"},
4322 {"Method", "test_get_object_or_404",
4323 "bm25-find.tests.GetObjectOr404Tests.test_get_object_or_404", "tests/tests.py"},
4324 {"Method", "test_get_object_or_404_queryset_attribute_error",
4325 "bm25-find.tests.GetObjectOr404Tests.test_get_object_or_404_queryset_attribute_error",
4326 "tests/tests.py"},
4327 {"Method", "test_get_object_or_404_bad_class",
4328 "bm25-find.tests.GetListObjectOr404Test.test_get_object_or_404_bad_class",
4329 "tests/async.py"},
4330 };
4331 for (size_t i = 0; i < sizeof(rows) / sizeof(rows[0]); i++) {
4332 cbm_node_t node = {.project = project,
4333 .label = rows[i].label,
4334 .name = rows[i].name,
4335 .qualified_name = rows[i].qn,
4336 .file_path = rows[i].file,
4337 .start_line = (int)i + 1,
4338 .end_line = (int)i + 2};
4339 cbm_store_upsert_node(store, &node);
4340 }
4341 cbm_store_exec(store, "INSERT INTO nodes_fts(nodes_fts) VALUES('delete-all');");
4342 cbm_store_exec(store, "INSERT INTO nodes_fts(rowid, name, qualified_name, label, "
4343 "file_path) SELECT id, cbm_camel_split(name), qualified_name, "
4344 "label, file_path FROM nodes;");
4345}
4346
4347/* The label filter must apply in query (BM25) mode exactly as in structural
4348 * mode: `query=Table label=Class` returns the class, and no Method. */

Callers 1

test_mcp.cFile · 0.85

Calls 3

cbm_store_upsert_projectFunction · 0.85
cbm_store_upsert_nodeFunction · 0.85
cbm_store_execFunction · 0.85

Tested by

no test coverage detected