-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
The adaptive difficulty system progresses sessions all the way to Hard with no user override. Users preparing for mid-tier companies (where Easy/Medium covers ~90% of interviews) have no way to prevent trick-based Hard problems from appearing. The only recourse today is skipping with "not relevant" — a reactive fix for a problem that should be preventable.
Solution
Add a Max Difficulty dropdown to the Guardrails section of the Goals page. Users can set a ceiling that the adaptive system cannot exceed.
Options:
| Value | Label |
|---|---|
all (default) |
All difficulties (Easy, Medium, Hard) |
Medium |
Easy & Medium only |
Easy |
Easy only |
Default is all — no behavioral change for existing users.
Key Finding
maxDifficulty is already a field in the guardrails data contract in dashboardGoalsHelpers.js (line 78) but is hardcoded to "Medium" and never read from settings. The slot already exists in the schema.
End-to-End Flow
User selects "Easy & Medium only"
→ onGuardrailChange('maxDifficulty', 'Medium')
→ debouncedSave() writes maxDifficulty: 'Medium' to settings
→ buildAdaptiveSessionSettings() reads settings.maxDifficulty
→ applyUserDifficultyCeiling('Hard', 'Medium') returns 'Medium'
→ filterProblemsByDifficultyCap filters out Hard candidates
→ Session assembled with Easy & Medium only
filterProblemsByDifficultyCap already exists in problemSelectionHelpers.js and is called in session assembly — no changes needed there.
Files to Change
src/shared/services/storage/storageService.js
Add maxDifficulty: 'all' to _createDefaultSettings()
src/app/services/dashboard/dashboardGoalsHelpers.js
Line 78 — replace hardcoded "Medium" with settings.maxDifficulty || 'all'
src/app/pages/progress/goals.jsx
- Add
maxDifficulty: 'all'touseGuardrailsinitial state - Load
maxDifficultyfromappState.learningPlan.guardrails?.maxDifficultyinupdateLearningPlanData - Add
maxDifficulty: guardrailsRef.current.maxDifficultyto thesaveSettingsmapping
src/app/pages/progress/GuardrailsSection.jsx
- Replace the read-only "Adaptive Difficulty Progression"
Alertwith aSelectdropdown - Add a short descriptive line beneath: "The system adapts difficulty progression up to this ceiling."
src/shared/db/stores/sessions.js — buildAdaptiveSessionSettings()
Add applyUserDifficultyCeiling(adaptiveCap, userCap) helper and apply it at line ~491:
// Before
const finalDifficultyCap = focusDecision.onboarding ? "Easy" : updatedSessionState.current_difficulty_cap;
// After
const adaptiveCap = focusDecision.onboarding ? "Easy" : updatedSessionState.current_difficulty_cap;
const finalDifficultyCap = applyUserDifficultyCeiling(adaptiveCap, settings.maxDifficulty);Helper:
function applyUserDifficultyCeiling(adaptiveCap, userCap) {
if (!userCap || userCap === 'all') return adaptiveCap;
const order = { Easy: 1, Medium: 2, Hard: 3 };
return (order[adaptiveCap] || 3) <= (order[userCap] || 3) ? adaptiveCap : userCap;
}settings is already available via loadSessionContext — no extra fetch needed.
Related
- Issue feat(db): add excluded_problems store to permanently filter not-relevant problems #257 —
excluded_problemsstore for permanent "not relevant" exclusions (reactive fix) - This issue is the proactive fix — prevent irrelevant Hard problems from being selected in the first place