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

Function architect

graph-ui/src/twin/render-model.ts:1170–1221  ·  view source on GitHub ↗
(ir: SemanticIR, presentation: ResolvedPresentation)

Source from the content-addressed store, hash-verified

1168}
1169
1170function architect(ir: SemanticIR, presentation: ResolvedPresentation): TwinViewModel {
1171 const facets = presentation.facets;
1172 const sections = visibleSections(ir, presentation);
1173 const blocks: TwinReaderBlock[] = [];
1174 if (facets.has(Facet.Logic) || facets.has(Facet.Calls)) {
1175 const rows = groundRows(ir);
1176 blocks.push({
1177 name: 'sits-on',
1178 title: GROUND_TITLE_SITS_ON,
1179 lead: GROUND_LEAD_SITS_ON,
1180 rows,
1181 emptyText: GROUND_EMPTY_SITS_ON,
1182 ...(rows.length > 0 ? { weight: rowCountLabel(rows.length) } : {})
1183 });
1184 }
1185 if (facets.has(Facet.Calls)) {
1186 const rows = carrierRows(ir, sections);
1187 blocks.push({
1188 name: 'carried-by',
1189 title: GROUND_TITLE_CARRIED,
1190 lead: GROUND_LEAD_CARRIED,
1191 rows,
1192 emptyText: GROUND_EMPTY_CARRIED,
1193 ...(rows.length > 0 ? { weight: rowCountLabel(rows.length) } : {})
1194 });
1195 }
1196 if (facets.has(Facet.Logic) || facets.has(Facet.Errors)) {
1197 const rows = debtRows(ir, sections);
1198 blocks.push({
1199 name: 'debts',
1200 title: GROUND_TITLE_DEBTS,
1201 lead: GROUND_LEAD_DEBTS,
1202 rows,
1203 emptyText: GROUND_EMPTY_DEBTS,
1204 ...(rows.length > 0 ? { weight: rowCountLabel(rows.length) } : {})
1205 });
1206 }
1207 const limits = indexLimits(ir, facets);
1208 return {
1209 ...emptyModel(ir, presentation, 'ground'),
1210 blocks,
1211 limits,
1212 rewritable: readerLines([
1213 ...blocks.flatMap((block) => [
1214 { id: `block-${block.name}-lead`, text: block.lead },
1215 { id: `block-${block.name}-empty`, text: block.rows.length === 0 ? block.emptyText : '' }
1216 ]),
1217 { id: 'limits-lead', text: GROUND_LEAD_LIMITS },
1218 ...limits.map((limit) => ({ id: limit.id, text: limit.text }))
1219 ])
1220 };
1221}
1222
1223// ---------------------------------------------------------------------------
1224// level 0, vibe coder: prose, counts, and the handful of names worth clicking

Callers 1

buildTwinViewModelFunction · 0.85

Calls 9

rowCountLabelFunction · 0.90
readerLinesFunction · 0.90
visibleSectionsFunction · 0.85
groundRowsFunction · 0.85
carrierRowsFunction · 0.85
debtRowsFunction · 0.85
indexLimitsFunction · 0.85
emptyModelFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected