Skip to content

fix: keep Learning Lab completion evidence-valid - #8

Open
tim8es wants to merge 2 commits into
baseline/m01-learning-lab-2026-09-07from
fix/learning-lab-completion-integrity
Open

fix: keep Learning Lab completion evidence-valid#8
tim8es wants to merge 2 commits into
baseline/m01-learning-lab-2026-09-07from
fix/learning-lab-completion-integrity

Conversation

@tim8es

@tim8es tim8es commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Purpose

Prevent stale legacy completion flags from bypassing the current Learning Lab evidence contract.

Confirmed defect

A learner who completed an M01 lesson before Learning Lab was introduced could still see the lesson/module/course as completed even with zero required drills/workbook evidence.

Fix

  • add derived isLessonComplete(lesson)
  • Learning Lab completion now requires both the stored completion flag and current required lab evidence
  • use derived completion for course progress, sidebar progress, module completion, next lesson targeting, and lesson done status
  • preserve raw stored progress; no destructive migration or telemetry changes

TDD

RED: CI #105 (34123025174) — 32/34 pass, 2 expected failures reproducing stale completion.
GREEN: CI #110 (34123563102) — 34/34 pass, 0 failures on 65e143b889730f3db933a677a6130abe58675d14.

Scope

Only app.js plus one regression test. No content, router, CSS, telemetry, main, or M02 activation changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65e143b889

ℹ️ 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".

Comment thread app.js
Comment on lines +35 to +37
function isLessonComplete(lesson) {
if (!lesson || !state.completed.includes(lesson.id)) return false;
return lesson.learningLab ? labReady(lesson).ready : true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply evidence-valid completion to the validation gate

For legacy learners whose stored completed array contains both M01 lesson IDs but whose new lab evidence is absent, this helper correctly makes the course treat those lessons as incomplete, while m01-validation-app.js:isStudied() still checks only the raw flags. After answering its two separate drills, validationView() therefore unlocks the post-case and labels the learner studied despite neither Learning Lab being complete, allowing stale flags to contaminate the experiment this change is intended to protect.

Useful? React with 👍 / 👎.

Comment thread app.js
const next = allLessons[index + 1];
const checked = state.criteria[id] || [];
const done = state.completed.includes(id);
const done = isLessonComplete(lesson);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh completion UI when required evidence is removed

When a completed Learning Lab is open and the learner clears a required workbook field, the input handler saves the invalid evidence and the sidebar immediately drops the completion, but done remains this render-time snapshot. The lesson header consequently continues to say completed and the primary action remains a link to the next lesson while the status says required evidence is missing; rerender or update the completion-dependent controls when lab readiness changes.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant