MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / buildLessonsBlock

Function buildLessonsBlock

src/skills/learning/failures.ts:106–112  ·  view source on GitHub ↗
(patterns: FailurePattern[], topK = 5)

Source from the content-addressed store, hash-verified

104
105/** Build the system-prompt block from confirmed patterns (top-K). Empty when none. */
106export function buildLessonsBlock(patterns: FailurePattern[], topK = 5): string {
107 if (patterns.length === 0) return '';
108 const lines = ['# Learned cautions (from your own repeated failures)', '',
109 'These mistakes have recurred across past tasks. Avoid repeating them:', ''];
110 for (const p of patterns.slice(0, topK)) lines.push(`- ${buildLesson(p)}`);
111 return lines.join('\n');
112}
113
114// ── I/O ──────────────────────────────────────────────────────────────────────
115

Callers 2

loadLessonsBlockFunction · 0.85

Calls 2

buildLessonFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected