Skip to content

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

fix([issue-2100]): launch review reps with markers from skill-review recs (codex review)

Adam Eivybb4f184c3ec7
diff --git a/client/src/components/meatspace/post/PostSessionLauncher.jsx b/client/src/components/meatspace/post/PostSessionLauncher.jsx
index 828fc0120f..c4677edfbc 100644
--- a/client/src/components/meatspace/post/PostSessionLauncher.jsx
+++ b/client/src/components/meatspace/post/PostSessionLauncher.jsx
@@ -365,6 +365,27 @@ export default function PostSessionLauncher({ config, recentSessions, stats, sta
onStart(drillConfigs, buildCleanTags(tags), mode === 'train');
}
+ // Launch a single due maintenance-review rep from an "Up next" skill-review
+ // recommendation (issue #2100). The rep carries the `review`/`reviewSkillId`
+ // markers the server needs to record the re-verification — a plain focus
+ // session would NOT resolve the scheduled review. Falls back to a Full POST
+ // when no runnable rep matches (e.g. reps not yet loaded).
+ function startReviewRep(rec) {
+ const skillId = rec.id.replace(/^skill-review:/, '');
+ const rep = reviewReps.find(r => r.skillId === skillId);
+ if (!rep) return hasSessionDrills ? handleStart() : undefined;
+ const drillConfig = {
+ type: rep.type,
+ domain: DRILL_TO_DOMAIN[rep.type],
+ config: rep.config,
+ timeLimitSec: DOMAINS[DRILL_TO_DOMAIN[rep.type]]?.timeBudgetSec,
+ isReview: true,
+ reviewLabel: rep.label,
+ ...(rep.providerId && { providerId: rep.providerId }),
+ };
+ onStart([drillConfig], buildCleanTags(tags), mode === 'train');
+ }
+
const hasAnyDrills = enabledMathDrills.length > 0 || enabledLlmDrills.length > 0 || enabledCognitiveDrills.length > 0;
// Quick-session domain count reflects the sessionModules-filtered set, so the
// "Quick 5 Min (N domains)" button matches what it will actually run.
@@ -519,11 +540,17 @@ export default function PostSessionLauncher({ config, recentSessions, stats, sta
// a runnable one, else start a Full POST. Routed recs
// (/post/memory, /post/morse/copy) stay navigational links.
if (rec.deepLink === '/post/launcher') {
- const domainKey = rec.drillType ? DRILL_TO_DOMAIN[rec.drillType] : null;
- const canFocus = domainKey && sessionEnabledDomains[domainKey];
- const onClick = canFocus
- ? () => handleFocusDomain(domainKey)
- : (hasSessionDrills ? handleStart : null);
+ let onClick;
+ if (rec.kind === 'skill-review') {
+ // Launch the actual review rep (with markers), not plain practice.
+ onClick = () => startReviewRep(rec);
+ } else {
+ const domainKey = rec.drillType ? DRILL_TO_DOMAIN[rec.drillType] : null;
+ const canFocus = domainKey && sessionEnabledDomains[domainKey];
+ onClick = canFocus
+ ? () => handleFocusDomain(domainKey)
+ : (hasSessionDrills ? handleStart : null);
+ }
return (
<button key={rec.id} type="button" onClick={onClick || undefined} disabled={!onClick} className={`${rowClass} disabled:opacity-50 disabled:cursor-not-allowed`}>
{inner}
diff --git a/client/src/components/meatspace/post/PostSessionLauncher.test.jsx b/client/src/components/meatspace/post/PostSessionLauncher.test.jsx
index caaf077e64..8676c7ea4e 100644
--- a/client/src/components/meatspace/post/PostSessionLauncher.test.jsx
+++ b/client/src/components/meatspace/post/PostSessionLauncher.test.jsx
@@ -13,7 +13,7 @@ vi.mock('../../../services/api', () => ({
}));
import PostSessionLauncher, { buildCleanTags, cognitiveSummary, interleaveByDomain } from './PostSessionLauncher';
-import { getPostRecommendations, getMorseProgress, getPostProgress } from '../../../services/api';
+import { getPostRecommendations, getMorseProgress, getPostProgress, getPostReviewReps } from '../../../services/api';
// Pure-function tests for PostSessionLauncher's pre-submit helpers (issue
// #2102 gap #10). Both were lifted from component-body closures to module
@@ -141,6 +141,7 @@ describe('PostSessionLauncher render (issue #2100)', () => {
beforeEach(() => {
vi.clearAllMocks();
getPostRecommendations.mockResolvedValue({ recommendations: [] });
+ getPostReviewReps.mockResolvedValue({ reps: [] });
getMorseProgress.mockResolvedValue({ settings: { wpm: 18, farnsworthWpm: 12 } });
getPostProgress.mockResolvedValue({ series: { byDay: [] } });
});
@@ -179,6 +180,24 @@ describe('PostSessionLauncher render (issue #2100)', () => {
expect(onStart.mock.calls[0][0].some(d => d.type === 'multiplication')).toBe(true);
});
+ it('launches a review rep (with markers) for a skill-review recommendation', async () => {
+ const onStart = vi.fn();
+ getPostReviewReps.mockResolvedValue({ reps: [
+ { skillId: 'multiplication:L1', label: 'Multiplication 1×2', type: 'multiplication', module: 'mental-math', config: { count: 5, level: 1, review: true, reviewSkillId: 'multiplication:L1' } },
+ ] });
+ getPostRecommendations.mockResolvedValue({ recommendations: [
+ { id: 'skill-review:multiplication:L1', kind: 'skill-review', title: 'Re-verify Multiplication 1×2', detail: 'Maintenance rep due', deepLink: '/post/launcher', drillType: 'multiplication', priority: 0 },
+ ] });
+ renderLauncher({ onStart });
+ await waitFor(() => expect(screen.getByText('Re-verify Multiplication 1×2')).toBeTruthy());
+ fireEvent.click(screen.getByText('Re-verify Multiplication 1×2').closest('button'));
+ expect(onStart).toHaveBeenCalledTimes(1);
+ const drills = onStart.mock.calls[0][0];
+ expect(drills).toHaveLength(1);
+ expect(drills[0].isReview).toBe(true);
+ expect(drills[0].config.reviewSkillId).toBe('multiplication:L1');
+ });
+
it('counts training-log time toward the daily-minutes goal', async () => {
getPostProgress.mockResolvedValue({ series: { byDay: [{ date: new Date().toISOString().split('T')[0], minutes: 15 }] } });
renderLauncher({ config: { ...baseConfig, goals: { dailyMinutes: 20 } } });