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

Function labelFor

graph-ui/src/twin/mini-understanding.ts:194–215  ·  view source on GitHub ↗

One sentence per category, counting the checklist and naming the facts.

(category: ChecklistCategory, items: ChecklistItem[], ir: SemanticIR)

Source from the content-addressed store, hash-verified

192
193/** One sentence per category, counting the checklist and naming the facts. */
194function labelFor(category: ChecklistCategory, items: ChecklistItem[], ir: SemanticIR): string {
195 switch (category) {
196 case 'core-logic':
197 return miniReadCalls(items.length);
198 case 'error-handling':
199 return miniErrorPath(distinct(ir.throws.value.map(entry => entry.type)));
200 case 'callers':
201 return miniCallers(items.length);
202 case 'config':
203 return miniConfig(distinct(ir.reads.value.map(entry => entry.name)));
204 case 'inputs':
205 return miniShape(distinct((ir.typeRefs?.value ?? []).map(entry => entry.name)));
206 case 'implementations':
207 return miniConstructions(items.length);
208 case 'tests':
209 // The generator emits exactly one item for the empty case, and it is
210 // a finding rather than a task, so it keeps its own wording.
211 return ir.tests.value.length === 0 ? MINI_TESTS_NONE : miniTests(ir.tests.value.length);
212 default:
213 return items[0]?.label ?? '';
214 }
215}
216
217/**
218 * The strip for one symbol.

Callers 1

buildMiniUnderstandingFunction · 0.85

Calls 8

miniReadCallsFunction · 0.90
miniErrorPathFunction · 0.90
miniCallersFunction · 0.90
miniConfigFunction · 0.90
miniShapeFunction · 0.90
miniConstructionsFunction · 0.90
miniTestsFunction · 0.90
distinctFunction · 0.70

Tested by

no test coverage detected