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

Function overviewClauses

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

* The lead paragraph, assembled from the clauses the active lenses allow. * * Each clause is gated by the facet that owns its fact, so a reader who turned * Data off is not told how many environment values there are. The alternative, * one fixed sentence over all three counts, would quietly rein

(ir: SemanticIR, facets: ReadonlySet<Facet>)

Source from the content-addressed store, hash-verified

704 * the facets were asked to remove.
705 */
706function overviewClauses(ir: SemanticIR, facets: ReadonlySet<Facet>): string[] {
707 const clauses = [proseLead(ir.symbol.name, ir.symbol.kind)];
708 const absent: string[] = [];
709 if (facets.has(Facet.Logic) || facets.has(Facet.Calls)) {
710 const callees = ir.steps.value.map((call) => call.targetName).filter((name) => name.length > 0);
711 if (callees.length > 0) {
712 clauses.push(proseCalls(ir.symbol.name, callees));
713 } else {
714 absent.push('outgoing call');
715 }
716 }
717 if (facets.has(Facet.Data)) {
718 const reads = ir.reads.value.map((entry) => entry.name).filter((name) => name.length > 0);
719 if (reads.length > 0) {
720 clauses.push(proseReads(ir.symbol.name, reads));
721 } else if (sharedNames(ir).length === 0) {
722 absent.push('environment read');
723 }
724 }
725 if (facets.has(Facet.Errors)) {
726 const errors = ir.throws.value.map((entry) => entry.type).filter((name) => name.length > 0);
727 if (errors.length > 0) {
728 clauses.push(proseThrows(ir.symbol.name, errors));
729 } else {
730 absent.push('stopping error');
731 }
732 }
733 if (absent.length > 0) {
734 clauses.push(`The index records no ${joinNames(absent)} for ${ir.symbol.name}.`);
735 }
736 return clauses;
737}
738
739/** The first factual sentence on every level, including the positive leaf case. */
740function subjectLine(ir: SemanticIR): string {

Callers 2

juniorFunction · 0.85
narrativeFunction · 0.85

Calls 7

proseLeadFunction · 0.90
proseCallsFunction · 0.90
proseReadsFunction · 0.90
proseThrowsFunction · 0.90
joinNamesFunction · 0.90
sharedNamesFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected