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
fix([issue-2094]): use separated metrics in POST result/history UI (codex review)
Adam Eivy094832ff2aad
diff --git a/client/src/components/meatspace/post/PostHistory.jsx b/client/src/components/meatspace/post/PostHistory.jsxindex 7d808600fd..993ece1896 100644--- a/client/src/components/meatspace/post/PostHistory.jsx+++ b/client/src/components/meatspace/post/PostHistory.jsx@@ -260,19 +260,34 @@ export default function PostHistory({ onBack }) {if (expanded) {for (const [i, task] of (s.tasks || []).entries()) {const isLlm = LLM_DRILL_TYPES.includes(task.type);- // Non-LLM rows show correctness AND average speed separately from- // the blended score column (issue #2094). Prefer the persisted- // avgResponseMs; fall back to deriving it for legacy sessions.+ // Non-LLM rows show accuracy (answered-only), speed, and+ // completion separately from the blended score column (issue+ // #2094) — never "correct/total", which counts timed-out+ // questions as wrong. Prefer the server-persisted metrics; fall+ // back to deriving from questions[] for legacy sessions, treating+ // n-back's withheld presses as reached decisions (not skips).let detail;if (isLlm) {detail = `${task.responses?.length || 0} responses`;} else {- const answered = (task.questions || []).filter(q => q.answered != null);+ const questions = task.questions || [];+ const noGo = task.type === 'n-back';+ const reached = noGo ? questions : questions.filter(q => q.answered != null);+ const accPct = task.accuracy != null+ ? Math.round(task.accuracy * 100)+ : (reached.length ? Math.round((reached.filter(q => q.correct).length / reached.length) * 100) : null);+ const compPct = task.completion != null+ ? Math.round(task.completion * 100)+ : (questions.length ? Math.round((reached.length / questions.length) * 100) : null);+ const timed = reached.filter(q => (q.responseMs || 0) > 0);const avgMs = task.avgResponseMs != null? task.avgResponseMs- : (answered.length ? Math.round(answered.reduce((s, q) => s + (q.responseMs || 0), 0) / answered.length) : null);- const correctStr = `${task.questions?.filter(q => q.correct).length || 0}/${task.questions?.length || 0} correct`;- detail = avgMs != null ? `${correctStr} · ${(avgMs / 1000).toFixed(1)}s` : correctStr;+ : (timed.length ? Math.round(timed.reduce((s, q) => s + (q.responseMs || 0), 0) / timed.length) : null);+ const parts = [];+ if (accPct != null) parts.push(`${accPct}% acc`);+ if (avgMs != null) parts.push(`${(avgMs / 1000).toFixed(1)}s`);+ if (compPct != null && compPct < 100) parts.push(`${compPct}% done`);+ detail = parts.join(' · ') || `${questions.length} questions`;}rows.push(<tr key={`${s.id}-${i}`} className="bg-port-bg/30">diff --git a/client/src/components/meatspace/post/PostSessionResults.jsx b/client/src/components/meatspace/post/PostSessionResults.jsxindex 1a1888f331..cbcc4032e9 100644--- a/client/src/components/meatspace/post/PostSessionResults.jsx+++ b/client/src/components/meatspace/post/PostSessionResults.jsx@@ -75,19 +75,25 @@ export default function PostSessionResults({ session, tags = {}, onSaved, onBack} else {// Accuracy (answered-only) and speed are shown separately from the// blended score (issue #2094). Prefer the server-persisted metrics;- // fall back to deriving from questions[] for legacy sessions, and- // surface completion only when the drill wasn't fully answered.+ // this pre-save view falls back to deriving from questions[] since+ // the session hasn't been scored server-side yet. n-back is a go/no-go+ // task: a withheld press ("answered: null") is a deliberate no-match+ // decision, not an unreached trial — so every trial counts as reached+ // (completion 100%) and accuracy spans all trials, matching the server+ // scorer that stamps completion=1 for n-back.const questions = result.questions || [];- const answered = questions.filter(q => q.answered !== null);+ const noGo = result.type === 'n-back';+ const reached = noGo ? questions : questions.filter(q => q.answered !== null);const accPct = result.accuracy != null? Math.round(result.accuracy * 100)- : (answered.length > 0 ? Math.round((answered.filter(q => q.correct).length / answered.length) * 100) : null);+ : (reached.length > 0 ? Math.round((reached.filter(q => q.correct).length / reached.length) * 100) : null);const compPct = result.completion != null? Math.round(result.completion * 100)- : (questions.length > 0 ? Math.round((answered.length / questions.length) * 100) : null);+ : (questions.length > 0 ? Math.round((reached.length / questions.length) * 100) : null);+ const timed = reached.filter(q => q.responseMs > 0);const avgMs = result.avgResponseMs != null? result.avgResponseMs- : (answered.length > 0 ? Math.round(answered.reduce((s, q) => s + q.responseMs, 0) / answered.length) : null);+ : (timed.length > 0 ? Math.round(timed.reduce((s, q) => s + q.responseMs, 0) / timed.length) : null);const parts = [];if (accPct != null) parts.push(`${accPct}% acc`);if (avgMs != null) parts.push(`${(avgMs / 1000).toFixed(1)}s`);