feat: validate M01 learning loop end to end - #2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 050ea6d261
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <a class="button subtle" href="#/lesson/system-diagnostic">Урок 2 · Диагностика до вмешательства</a> | ||
| </div> | ||
| <p class="validation-state">Уроки: ${studied ? 'изучены ✓' : 'нужно завершить оба'} · Drills: ${drillsDone ? '2/2 ✓' : `${Object.keys(state.drills).length}/2`}</p> | ||
| <div class="validation-drills">${DATA.decisionDrills.map(drillBlock).join('')}</div> |
There was a problem hiding this comment.
Keep drills locked until both lessons are complete
After any baseline submission, learningBlock() renders both Decision Drills as enabled controls even when isStudied() is false. A participant can therefore answer the drills and receive their explanatory feedback before opening either lesson, then mark the lessons complete and unlock the post-case with a sequence different from the documented lessons-then-drills experiment; hide or disable these controls until both M01 lessons are complete.
Useful? React with 👍 / 👎.
| if (!window.confirm('Удалить только данные M01 validation в этом браузере? Прогресс основного курса не изменится.')) return; | ||
| try { | ||
| localStorage.removeItem(validationStorageKey); | ||
| state = emptyValidationState(); |
There was a problem hiding this comment.
Reset session-scoped lesson completion for new participants
When the same browser is reused after a participant completes M01, this reset removes only the validation key while isStudied() continues reading those lesson IDs from pm01-state-v1. The next participant—an explicitly documented use of this reset—will immediately be shown that both lessons are studied and can unlock the post-case without completing them, contaminating every subsequent shared-browser session; the reset must also clear the relevant completion evidence or the validation flow must track study completion per session.
Useful? React with 👍 / 👎.
| document.querySelectorAll('[data-reasoning]').forEach((textarea) => textarea.addEventListener('change', () => { | ||
| const key = textarea.dataset.reasoning; | ||
| if (state[key].submittedAt) return; | ||
| state[key].reasoning = textarea.value; | ||
| saveValidationState('Черновик reasoning сохранен.'); |
There was a problem hiding this comment.
Persist textarea edits while the user is typing
Textarea drafts are copied into state only on change, so reloading or closing the page while a textarea remains focused can discard all edits since its last focus loss. The field and reflection handlers repeat the same pattern, making long experiment responses vulnerable to silent loss despite the persistence guarantee; save on input (optionally debounced) or flush focused controls before unload.
Useful? React with 👍 / 👎.
Goal
Implement Phase 1 from the approved platform foundation: validate one representative module (
M01 — Проект как система) end-to-end before any v1 rewrite.Scope
Explicitly out of scope
Plan
docs/superpowers/plans/2026-09-06-m01-learning-validation.mdThis PR is stacked on
docs/platform-foundationand should be reviewed/merged after PR #1.