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

Function topFacts

graph-ui/src/twin/render-model.ts:803–830  ·  view source on GitHub ↗
(sections: TwinSection[], limit: number)

Source from the content-addressed store, hash-verified

801 * would be rebuilding a thing that already worked.
802 */
803export function topFacts(sections: TwinSection[], limit: number): TwinFactRow[] {
804 const queues = sections.filter(section => section.rows.length > 0);
805 const facts: TwinFactRow[] = [];
806 for (let round = 0; facts.length < limit; round++) {
807 let took = false;
808 for (const section of queues) {
809 const row = section.rows[round];
810 if (row === undefined) {
811 continue;
812 }
813 took = true;
814 facts.push({
815 id: `${section.name}-${row.id}`,
816 label: section.title,
817 name: row.label,
818 target: row.target,
819 factPath: row.factPath
820 });
821 if (facts.length === limit) {
822 return facts;
823 }
824 }
825 if (!took) {
826 return facts;
827 }
828 }
829 return facts;
830}
831
832/**
833 * The sentences a family's emptiness deserves.

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected