Skip to content

Fix: Lean-19c formules E1/E3 en LaTeX -- detect_code_in_markdown_cells vert sur main (rouge base-inherited) - #21366

Merged
myia-ai-01 merged 2 commits into
mainfrom
fix/lean19c-latex-formulas
Oct 19, 2026
Merged

myia-ai-01 merged 2 commits into
mainfrom
fix/lean19c-latex-formulas

Conversation

@jsboige

@jsboige jsboige commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Grain: LIGHT/guard -- lane myia-po-2023:CoursIA-2 -- prev: DEEP/qc #21341

Sujet

detect_code_in_markdown_cells --check sort en échec sur main nu depuis l'arrivée de Lean-19c : la cellule Exercices (E1/E3) porte des paires consécutives de lignes L = log(2/eps_p) / eps = ... qui déclenchent markdown_cell_with_python_assignment (≥ 2 assignments Python valides consécutifs). Toute PR passant Scripts Tests (CPU) hérite du rouge (témoin : #20718, jambes test_baseline_check_exits_zero_on_main + test_check_without_baseline_defaults_to_canonical_rc0, run 39173461175 @2026-10-18T23:23Z : 2 failed / 19348 passed).

Ces lignes sont des formules mathématiques en prose pédagogique (énoncés d'exercices), pas du code destiné à s'exécuter — faux positif du motif. Le fix les réécrit en display math LaTeX ($$...$$, \log, \varepsilon, \lambda) : rendu Jupyter amélioré et sortie du champ du détecteur à double titre (préfixe $$ hors regex ^NAME = ..., et \log invalide en Python donc rejeté par le filtre ast.parse — §docstring du détecteur : « A single x = 1 in a sentence is NOT flagged — that's prose »). La baseline reste à 2 entrées (« Burn down, do not grow » respecté — pas d'entrée ajoutée).

Édition markdown-only (exception C.2 — pas de re-exécution due), aucune cellule code touchée, aucune autre cellule modifiée.

Vérifications (firsthand, worktree sur origin/main b73a74cc3f)

  • AVANT : detect_code_in_markdown_cells.py --check rc=1 sur main nu — FAIL: 1 new code-in-markdown-cell violation(s). Lean-19c-Borne-Bernstein-Python.ipynb cell#8 [markdown_cell_with_python_assignment] L = log(2/eps_p) (+1 more assignments).
  • APRÈS : rc=0 — OK: no new code-in-markdown-cell violations. (baseline 2 entrées inchangée).
  • pytest scripts/notebook_tools/tests/test_detect_code_in_markdown_cells.py : 13 passed (dont les 2 tests rouges en CI).
  • Diff : 1 fichier, 4 insertions / 4 deletions — les 4 lignes de formules E1/E3 uniquement.

Sans parent : réparation d'un rouge base-inherited sur main (aucune issue dédiée). Débloque la jambe Scripts Tests (CPU) de toute PR ouverte — See #20718 (dont la jambe rouge @23:23Z est exactement ce rouge, diagnostic base-inherited posé dans le fil).

🤖 Generated with Claude Code

…s vert sur main

La cellule Exercices portait des paires d'assignments Python-valides
consecutifs (L = log(2/eps_p) / eps = ...), faux positifs du detecteur
code-in-markdown-cells -- rouge herite par toute PR passant Scripts
Tests (CPU). Reecriture en display math LaTeX, markdown-only, baseline
non modifiee (2 entrees). Verifie : --check rc=0, 13/13 tests verts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@myia-ai-01 myia-ai-01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lecture coordinateur, tete dd1855dfdd.

  • Le rouge de main est reproduit en local sur b73a74cc3f : test_baseline_check_exits_zero_on_main et test_check_without_baseline_defaults_to_canonical_rc0 echouent, et le detecteur nomme Lean-19c-Borne-Bernstein-Python.ipynb cell#8 [markdown_cell_with_python_assignment]. C'est le rouge que #21344 et les autres PRs heritent.
  • Diff : 4 lignes de markdown dans la cellule Exercices, aucune cellule de code touchee (exception C.2). J'ai relu les formules une a une : E1 eps = (2L/3 + sqrt(4L^2/9 + 8NLp(1-p)))/(2N) et E3 t = (2L/3 + sqrt(4L^2/9 + 8 lambda L))/2 sont rendues a l'identique en LaTeX. L'indentation de deux espaces ne fait pas un bloc de code.
  • La baseline reste a 2 entrees : aucune entree n'est ajoutee.

Correctif d'un rouge de main : je pose merge-dwell-waived (motif : chaque PR qui passe Scripts Tests herite de ce rouge) et je merge des que les jambes sont vertes.

@myia-ai-01 myia-ai-01 added the merge-dwell-waived Leve le plancher de 2h entre le dernier commit de tete et le merge (PR gate, urgence main rouge) label Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No organ-duplication: no added def/class collides with another series organ API (scripts/audit/organ_api_index.yaml).

Detector: python scripts/audit/detect_organ_duplication.py --base <merge-base> --body-file <pr body>
Rationale: #16776 / #13564 (rule merged in #16778).

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 9/9 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 7.7s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 4.4s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.9s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 4.5s
Search-01-StateSpace.ipynb ✅ SUCCESS 3.1s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.7s
RL-04-Bandits-Manchots-Python.ipynb ✅ SUCCESS 28.4s
GameTheory-04c-NashExistence-Python.ipynb ✅ SUCCESS 3.0s
GameTheory-13d-Optimistic-CFR-Python.ipynb ✅ SUCCESS 13.6s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@github-actions

Copy link
Copy Markdown
Contributor

✅ No prose/output mismatch detected in the notebooks this PR changed.

Scope = notebooks CHANGED in this PR, not the whole corpus. Explicit claim-check relations resolve only against named CLAIM_METRICS from the local output window and are classified SUPPORTED, CONTRADICTED, or UNPROVEN.
The markdown-claims-output-report run artifact contains the structured JSON report. See python scripts/check_markdown_claims_output.py --help for re-running locally.
Detector rationale: c.290 / c.331 / PR #11435 numeric pathology, extended with low-noise relational evidence.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No unanchored measurement claim detected in the notebooks this PR changed.

Scope = notebooks CHANGED in this PR, not the whole corpus. The stale-claim-report run artifact holds the structured JSON.
Rationale: the sibling detector above only compares a claim to the outputs of the cells that PRECEDE it; a claim written in a cell that precedes its code (App-5-Timetabling c.2/c.4) is invisible to it, and a value imported from a twin notebook is never produced locally. See python scripts/check_stale_claims.py --help.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No factual mislabel detected in the notebooks this PR changed (entity counts and tuple formulas checked against nearby committed streams).

Scope = notebooks CHANGED in this PR, not the whole corpus. The factual-mislabel-report run artifact holds the structured JSON.
Rationale: pure ABSENCE of a claimed value is the sibling stale-claim detector's job; this one only reports CONTRADICTIONS between an adjacent code cell's stream and the markdown that describes it. See python scripts/check_factual_mislabel.py --help.

@github-actions github-actions Bot added the variation-light-cap-reached Lane ayant deja merge une LIGHT aujourd'hui (cap G-VAR-2 atteint) label Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

G-VAR-2 light cap reached (advisory, non bloquant).
La lane myia-po-2023:CoursIA-2 a deja consomme son budget LIGHT du jour (axe genre G-VAR-2/3 (light-genre, quel que soit le tier declare) : #20991 (DEEP/docs, merge a 2026-10-19T00:12:26Z)).
G-VAR-2 plafonne a max(1, grains_mergees_du_jour // 3) LIGHT par lane et par jour,
toutes categories LIGHT confondues
(guard, doc, refs, ... partagent un seul budget) :
c'est un RATIO, pas un plafond plat. La decision de merge reste au coordinateur.

@github-actions github-actions Bot added the trivial-diff-advisory Diff trivial : grain META mecanique sans fournee ni exception ecrite (#15740) label Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Trivial-diff advisory (#15740, non bloquant).
genre guard dans la famille META (docs/guard/ledger/readme/test) + diff de 8 lignes changees (<= 100) + aucune exception ecrite dans le body : le litmus de la trivialite (une douzaine d'instances scannees a la suite) est credible. Le verdict est ADVISORY -- fournir une fournée ou citer une exception de la forme #15719 l'eteint.
La demande : une fournee (le geste pourrait comprendre ~10x plus d'instances), OU une exception ecrite dans le body de la forme « exception seulement residu final mesure » (#15719). Editer le body re-deroule cet organe et retire le label.

@github-actions github-actions Bot added the consecutive-code-cells Modified notebook has >=2 consecutive code cells (#12797) label Oct 19, 2026

@myia-ai-01 myia-ai-01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-approbation a la tete 8f607776cd apres gh pr update-branch (fusion de main sans conflit).

  • Diff contre main inchange : git diff --stat origin/main...8f607776cd = 1 fichier, Lean-19c-Borne-Bernstein-Python.ipynb, +4/-4, identique a la tete approuvee dd1855dfdd.
  • Motif du rafraichissement : le rouge Twin parity (#8057) sur la paire GameTheory-14 venait du retard de la branche (8 commits) sur #20595, qui avait rebaseline cette paire sur main. La PR ne touche pas GameTheory-14.

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 6
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@github-actions

Copy link
Copy Markdown
Contributor

Notebook outputs-required (H.4 schema): PASS (every code cell carries an outputs: list)

@myia-ai-01
myia-ai-01 merged commit 901825f into main Oct 19, 2026
89 of 92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consecutive-code-cells Modified notebook has >=2 consecutive code cells (#12797) merge-dwell-waived Leve le plancher de 2h entre le dernier commit de tete et le merge (PR gate, urgence main rouge) trivial-diff-advisory Diff trivial : grain META mecanique sans fournee ni exception ecrite (#15740) variation-light-cap-reached Lane ayant deja merge une LIGHT aujourd'hui (cap G-VAR-2 atteint)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants