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

Function notesOf

graph-ui/src/pseudocode/step-insights.ts:290–311  ·  view source on GitHub ↗

The notes one callee's outgoing edges produce, strongest first.

(edges: readonly InsightEdge[], byId: ReadonlyMap<number, InsightNode>)

Source from the content-addressed store, hash-verified

288
289/** The notes one callee's outgoing edges produce, strongest first. */
290function notesOf(edges: readonly InsightEdge[], byId: ReadonlyMap<number, InsightNode>): StepInsight[] {
291 const raised = named(edges, RELATION.raises, byId);
292 const env = named(edges, RELATION.configures, byId);
293 const calls = edges.filter((edge) => edge.type === RELATION.calls).length;
294
295 const notes: StepInsight[] = [];
296 // Raised errors first: of the three, it is the one a reader of the calling
297 // code cannot see at all and the one that changes what they do next.
298 if (raised.length > 0) {
299 notes.push({ kind: 'raises', text: listed(raised, insightRaises) });
300 }
301 for (const key of env.slice(0, STEP_INSIGHT_CAP)) {
302 notes.push({ kind: 'reads-env', text: insightReadsEnv(key) });
303 }
304 if (env.length > STEP_INSIGHT_CAP) {
305 notes.push({ kind: 'reads-env', text: insightMore(env.length - STEP_INSIGHT_CAP) });
306 }
307 if (calls > 0) {
308 notes.push({ kind: 'calls-on', text: insightCalls(calls) });
309 }
310 return notes;
311}
312
313/** The names one relation points at, deduplicated, in the graph's order. */
314function named(

Callers 1

stepInsightsOfFunction · 0.70

Calls 6

insightReadsEnvFunction · 0.90
insightMoreFunction · 0.90
insightCallsFunction · 0.90
namedFunction · 0.70
listedFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected