Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(post): show missed examples in scoring feedback for compound-chain and verbal-fluency
Adam Eivyf3394dfb2f9f
diff --git a/client/src/components/meatspace/post/PostLlmDrillRunner.jsx b/client/src/components/meatspace/post/PostLlmDrillRunner.jsxindex 914af73bba..23fa367bbb 100644--- a/client/src/components/meatspace/post/PostLlmDrillRunner.jsx+++ b/client/src/components/meatspace/post/PostLlmDrillRunner.jsx@@ -127,6 +127,7 @@ export default function PostLlmDrillRunner({ drill, timeLimitSec, drillIndex, drscoring: false,score: fb.score ?? scored?.score ?? 0,feedback: fb.feedback || scored?.evaluation?.summary || 'No feedback available',+ missedExamples: fb.missedExamples,});return;}@@ -226,8 +227,18 @@ export default function PostLlmDrillRunner({ drill, timeLimitSec, drillIndex, dr<FbIcon size={40} className={fbScoreColor} /><div className={`text-3xl font-mono font-bold mt-2 ${fbScoreColor}`}>{trainingFeedback.score}</div></div>- <div className="bg-port-card border border-port-border rounded-lg p-4">+ <div className="bg-port-card border border-port-border rounded-lg p-4 space-y-2"><p className="text-sm text-gray-300">{trainingFeedback.feedback}</p>+ {trainingFeedback.missedExamples?.length > 0 && (+ <div className="pt-2 border-t border-port-border">+ <p className="text-xs text-gray-500 mb-1">You could also have said:</p>+ <div className="flex flex-wrap gap-1.5">+ {trainingFeedback.missedExamples.map((ex, i) => (+ <span key={i} className="px-2 py-0.5 bg-port-accent/10 text-port-accent text-xs rounded">{ex}</span>+ ))}+ </div>+ </div>+ )}</div><buttononClick={acknowledgeTrainingFeedback}diff --git a/client/src/components/meatspace/post/WordplayTrainer.jsx b/client/src/components/meatspace/post/WordplayTrainer.jsxindex fb18c3280e..4a4c220dbb 100644--- a/client/src/components/meatspace/post/WordplayTrainer.jsx+++ b/client/src/components/meatspace/post/WordplayTrainer.jsx@@ -114,6 +114,7 @@ export default function WordplayTrainer({ onBack, config }) {feedback: fb.feedback || scored?.evaluation?.summary || 'No feedback available',validCount: fb.validCount,invalidItems: fb.invalidItems,+ missedExamples: fb.missedExamples,});setResults(prev => [...prev, {...responseObj,@@ -268,13 +269,23 @@ export default function WordplayTrainer({ onBack, config }) {<FbIcon size={40} className={fbScoreColor} /><div className={`text-3xl font-mono font-bold mt-2 ${fbScoreColor}`}>{feedback.score}</div></div>- <div className="bg-port-card border border-port-border rounded-lg p-4">+ <div className="bg-port-card border border-port-border rounded-lg p-4 space-y-2"><p className="text-sm text-gray-300">{feedback.feedback}</p>{feedback.validCount != null && (- <p className="text-xs text-gray-500 mt-2">Valid items: {feedback.validCount}</p>+ <p className="text-xs text-gray-500">Valid items: {feedback.validCount}</p>)}{feedback.invalidItems?.length > 0 && (- <p className="text-xs text-port-error mt-1">Invalid: {feedback.invalidItems.join(', ')}</p>+ <p className="text-xs text-port-error">Invalid: {feedback.invalidItems.join(', ')}</p>+ )}+ {feedback.missedExamples?.length > 0 && (+ <div className="pt-2 border-t border-port-border">+ <p className="text-xs text-gray-500 mb-1">You could also have said:</p>+ <div className="flex flex-wrap gap-1.5">+ {feedback.missedExamples.map((ex, i) => (+ <span key={i} className="px-2 py-0.5 bg-port-accent/10 text-port-accent text-xs rounded">{ex}</span>+ ))}+ </div>+ </div>)}</div><buttondiff --git a/server/services/meatspacePostLlm.js b/server/services/meatspacePostLlm.jsindex 1bfb3e6d19..4b68280816 100644--- a/server/services/meatspacePostLlm.js+++ b/server/services/meatspacePostLlm.js@@ -337,7 +337,7 @@ Return ONLY valid JSON (no markdown, no explanation):{"challenges":[{"rootWord":"paper","position":"prefix","examples":["paperback","paper trail","paperweight","paper clip","paper thin"],"minExpected":8}]}position is "prefix" if the root starts the compound (firehouse), "suffix" if it ends it (campfire), or "both" if common either way (light→lighthouse, flashlight).-The examples field should contain 5 sample answers. minExpected is the target count.`;+The examples field should contain 10-15 sample answers for reference. minExpected is the target count.`;const response = await callAI(prompt, providerId, model);const data = parseJsonFromAI(response);@@ -524,7 +524,7 @@ function scoreLocalBridgeWord(drillData, userResponses) {function scoreLocalCompoundChain(drillData, userResponses) {const scores = userResponses.map((r, i) => {const challenge = drillData.challenges?.[i];- if (!challenge?.rootWord) return { score: 0, feedback: 'No root word', validCount: 0, invalidItems: [] };+ if (!challenge?.rootWord) return { score: 0, feedback: 'No root word', validCount: 0, invalidItems: [], missedExamples: [] };const root = challenge.rootWord.toLowerCase();const seen = new Set();const valid = [];@@ -544,7 +544,12 @@ function scoreLocalCompoundChain(drillData, userResponses) {const fb = valid.length >= target? `${valid.length} valid compounds — great job!`: `${valid.length} valid compound${valid.length !== 1 ? 's' : ''} (target: ${target})`;- return { score, feedback: fb, validCount: valid.length, invalidItems: invalid };+ // Show examples the user didn't find+ const validLower = new Set(valid.map(v => v.toLowerCase().replace(/[\s-]/g, '')));+ const missedExamples = (challenge.examples || []).filter(ex =>+ !validLower.has(ex.toLowerCase().replace(/[\s-]/g, ''))+ );+ return { score, feedback: fb, validCount: valid.length, invalidItems: invalid, missedExamples };});const overallScore = averageScore(scores);return { overallScore, scores, summary: `Average ${overallScore}% across ${scores.length} challenges` };@@ -558,11 +563,13 @@ function scoreLocalVerbalFluency(drillData, userResponses) {const uniqueCount = seen.size;const target = cat?.minExpected || 15;const score = Math.round(Math.min(1, uniqueCount / target) * 100);+ const missedExamples = (cat?.examples || []).filter(ex => !seen.has(ex.toLowerCase().trim()));return {score,feedback: `${uniqueCount} unique item${uniqueCount !== 1 ? 's' : ''} (target: ${target})`,validCount: uniqueCount,invalidItems: [],+ missedExamples,};});const overallScore = averageScore(scores);