Skip to content

fix(pedagogy): move exercises before ending sections (44 notebooks) - #330

Merged
jsboige merged 1 commit into
mainfrom
fix/structural-corruption-exercises-after-ending
Apr 20, 2026
Merged

jsboige merged 1 commit into
mainfrom
fix/structural-corruption-exercises-after-ending

Conversation

@jsboige

@jsboige jsboige commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

PR #303 (git merge -X theirs, commit ce90797) corrupted 44 notebooks by placing exercise cells AFTER conclusion/navigation/synthesis sections. Students would reach the end of the notebook without seeing any exercises.

What this PR fixes

  • Moves exercise cells before the first ending marker (conclusion, navigation, or synthesis section)
  • Removes duplicate navigation/conclusion cells that appeared at the end
  • Resets execution_count and clears outputs for moved code cells

Scope

Directory Fixed Nav-only Total
Search/Part1-Foundations 2 3 5
Search/Part2-CSP 3 3 6
Search/Applications 5 6 11
Sudoku 22 0 22
Total 32 12 44

Follows PR #327 and #329

Verification

A Python script (notebook-cleanup-plan-b.py) was used to detect and fix the corruption:

  • Ending detection: matches ## Conclusion, ## Synthèse, Et ensuite?, navigation cells (after midpoint)
  • Exercise detection: matches Exercice, TODO, A COMPLETER, NotImplementedError, NotImplementedException
  • False positive filtering: skips header cells (first 3), inline ### Synthèse in interpretation sections, navigation headers

Test plan

  • Spot-check 3-4 notebooks to verify exercise cells appear before conclusion
  • Verify no code cell outputs leaked (all moved code cells have outputs: [])
  • Verify navigation links still point to valid notebooks in the same series
  • Run on EPITA machines to confirm notebooks open and execute correctly

🤖 Generated with Claude Code

Structural corruption from PR #303 (git merge -X theirs) placed exercise
cells AFTER conclusion/navigation sections in 44 notebooks. Students would
reach the end of the notebook without seeing the exercises.

Changes:
- Move exercise cells before the first ending marker (conclusion/nav/synthesis)
- Remove duplicate navigation/conclusion cells at the end
- Reset execution_count and clear outputs for moved code cells

Scope: 44 notebooks fixed across Search (Part1, Part2-CSP, Applications) and Sudoku.
All exercise cells now appear before the notebook's ending section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jsboige

jsboige commented Apr 20, 2026

Copy link
Copy Markdown
Owner Author

Note: 3 notebooks with complex remaining corruption

The automated fix handles the most common pattern (exercises placed after the last ending marker). Three notebooks have more complex interleaved corruption from the merge that requires manual review:

  1. CSP-1-Fundamentals: Sections 5-6 (Heuristiques, python-constraint) appear AFTER the "Et ensuite?" ending. These entire content sections were displaced by the merge.
  2. Sudoku-3-Genetic-Csharp: Interpretation cells appear after the conclusion.
  3. CSPs_Intro: References section appears after ending (may be intentional).

These 3 are not blocking for EPITA — the exercises are accessible — but the reading flow is disrupted. Manual review recommended.

@jsboige
jsboige merged commit 6c26b01 into main Apr 20, 2026
1 check passed
@jsboige
jsboige deleted the fix/structural-corruption-exercises-after-ending branch April 20, 2026 00:22
jsboige added a commit that referenced this pull request Apr 21, 2026
…#403)

Bug reporte par un etudiant pendant le cours EPITA du 21/04/2026 :
le notebook CSP-1-Fundamentals est structurellement casse.

Problemes identifies :

1. BLOC DUPLIQUE (9 cellules) : la Section 7 (Recapitulatif + Exercices
   1-3 + "Et ensuite" + Exercice 4) apparaissait DEUX fois : une fois
   entre la Section 4 et la Section 5, puis de nouveau (correctement)
   avant la Conclusion. Les deux blocs partageaient les MEMES cell IDs
   (2cd7141e, 3586d6ec, bfd0af8f, 43775d9c, 08fcbcc6, 63846a3f,
   bcbf03dd, 46d47e13, fr0whufd), trahissant un copy-paste accidentel.

2. SECTION 4.3 MAL PLACEE : "### 4.3 Visualisation du processus de
   backtracking" apparaissait APRES le header "## 5. Heuristiques",
   donc logiquement dans la Section 5 alors que son contenu appartient
   a la Section 4.

3. CODE ORPHELIN (exercice 4 Sudoku code dup id=suhmqzd7qko) : une
   10eme cellule du bloc duplique, laissee apres suppression partielle.

Fix applique :
- Suppression du bloc duplique (9 cellules) apres Section 4
- Suppression du code orphelin Exercice 4 dup (1 cellule)
- Deplacement de Section 4.3 (5 cellules) AVANT le header Section 5

Structure finale (71 cellules) conforme au plan pedagogique :
1. Introduction
2. Formalisation CSP
3. Exemple coloration Australie
4. Backtracking (4.1 principe, 4.2 trace, 4.3 visualisation)
5. Heuristiques (5.1 MRV, 5.2 LCV)
6. Bibliotheque python-constraint
7. Recapitulatif et exercices (4 exercices)
Conclusion

Verification : 0 cellule avec IDs dupliques (avant : 10 duplicats).
Tous les autres notebooks CSP-2 a CSP-9 scannes : aucun bug similaire.

Origine probable : merge accidentel lors de PR #330 (fix pedagogy move
exercises before ending sections, 44 notebooks) ou suivante.

Etudiants impactes : ~80 eleves EPITA SCIA 2026 en cours pendant ce
matin (21/04/2026). Bug remonte oralement avant la 2eme fournee de TP.

Refs CLAUDE.md 2026-04-20 : non-detection = review superficielle lors
de PR #330. Tous les notebooks enrichis a cette epoque meritent un
scan de coherence structurelle (duplicate section headers).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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