| 91 | export function buildLesson(p: FailurePattern): string { |
| 92 | const sig = p.signature.toLowerCase(); |
| 93 | const verb = (advice: string) => `When using \`${p.tool}\`: ${advice} (this failed ${p.count}× across ${p.distinctTasks} tasks).`; |
| 94 | if (/(not found|does not exist|cannot find|no such|unknown symbol|undefined)/.test(sig)) { |
| 95 | if (p.tool.startsWith('edit_symbol')) return verb('confirm the symbol exists first (grep / code-graph) — it has repeatedly not been found.'); |
| 96 | return verb('verify the target exists before calling it — the target has repeatedly not been found.'); |