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

Function groundRows

graph-ui/src/twin/render-model.ts:1038–1072  ·  view source on GitHub ↗

* What this symbol sits on: one row per module, with how many call sites reach * into it. * * A module reached from six places and a module reached once are two different * relationships, and a flat list of twenty call sites hides which is which. * That is the whole difference between this and

(ir: SemanticIR)

Source from the content-addressed store, hash-verified

1036 * facts, grouped by the thing the architect is asking about.
1037 */
1038function groundRows(ir: SemanticIR): TwinRow[] {
1039 const byModule = new Map<string, { calls: CallSite[]; firstIndex: number }>();
1040 ir.steps.value.forEach((call, index) => {
1041 const key = call.targetFile;
1042 if (key === undefined || key.length === 0) {
1043 return;
1044 }
1045 const entry = byModule.get(key);
1046 if (entry === undefined) {
1047 byModule.set(key, { calls: [call], firstIndex: index });
1048 } else {
1049 entry.calls.push(call);
1050 }
1051 });
1052 return [...byModule.entries()].map(([uri, entry]) => {
1053 const certainty = certaintyOf(
1054 entry.calls.find((call) => call.confidence !== undefined)?.confidence,
1055 ir.steps.state
1056 );
1057 const strategy = entry.calls.find((call) => call.strategy !== undefined)?.strategy;
1058 return {
1059 id: `ground-${entry.firstIndex}`,
1060 label: moduleLabel(uri),
1061 detail: entry.calls.map((call) => call.targetName).join(', '),
1062 target: refAt(uri, entry.calls[0].targetLine ?? entry.calls[0].line, moduleLabel(uri)),
1063 factPath: `steps[${entry.firstIndex}]`,
1064 confidenceLabel: certainty.label,
1065 confidenceNote: certainty.note,
1066 extras: [
1067 groundReach(entry.calls.length),
1068 ...(strategy === undefined ? [] : [strategyLabel(strategy)])
1069 ]
1070 };
1071 });
1072}
1073
1074/** What holds this symbol up: its callers, plus what the outside world can reach. */
1075function carrierRows(ir: SemanticIR, sections: readonly TwinSection[]): TwinRow[] {

Callers 1

architectFunction · 0.85

Calls 7

refAtFunction · 0.90
groundReachFunction · 0.90
strategyLabelFunction · 0.90
certaintyOfFunction · 0.85
moduleLabelFunction · 0.70
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected