MCPcopy Create free account
hub / github.com/andylow92/file-system-like-github / formatLesson

Function formatLesson

packages/shared/src/feedback.ts:385–403  ·  view source on GitHub ↗
(pairing: FeedbackPairing, diff: FeedbackDiff)

Source from the content-addressed store, hash-verified

383 * lesson has already been learned.
384 */
385export function formatLesson(pairing: FeedbackPairing, diff: FeedbackDiff): string {
386 const lines = [
387 `### Review feedback · ${CHANNEL_LABEL[pairing.channel]}`,
388 '',
389 `- Source: draft [[${labelOf(pairing.draftPath)}]] → final [[${labelOf(pairing.finalPath)}]]`,
390 `- Length: ${diff.draftWords} → ${diff.finalWords} words (${deltaLabel(diff.wordDelta)})`,
391 ];
392 if (diff.removed.length) {
393 lines.push(`- Removed: ${diff.removed.map((part) => `"${part}"`).join('; ')}`);
394 }
395 if (diff.added.length) {
396 lines.push(`- Added: ${diff.added.map((part) => `"${part}"`).join('; ')}`);
397 }
398 if (pairing.reviewReason) {
399 lines.push(`- Human note: ${pairing.reviewReason}`);
400 }
401 lines.push('', feedbackMarker(pairing.draftPath, pairing.finalPath));
402 return lines.join('\n');
403}
404
405/** A fresh per-channel playbook, seeded with its first lesson (a `type: skill` note). */
406function newPlaybook(channel: FeedbackChannel, lesson: string): string {

Callers 1

scanFeedbackFunction · 0.85

Calls 3

deltaLabelFunction · 0.85
feedbackMarkerFunction · 0.85
labelOfFunction · 0.70

Tested by

no test coverage detected