Skip to content

feat(genai,#14110): matrice de couverture N×M cross-notebooks FallacyDetection (04_coverage_matrix) - #14312

Merged
jsboige merged 2 commits into
mainfrom
feature/14110-fallacy-coverage-matrix
Sep 2, 2026
Merged

jsboige merged 2 commits into
mainfrom
feature/14110-fallacy-coverage-matrix

Conversation

@jsboige

@jsboige jsboige commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Grain: MED/notebook-python -- lane myia-po-2023:CoursIA -- prev: DEEP/notebook-python #14305

Summary

Issue #14110 (acceptance 4/4 de #13655, FallacyDetection EPIC #10355 / Phase 1 #10356) : matrice de couverture cross-notebooks N×M — synthèse de la Phase 1. Chaque notebook de la série occupe une ligne (N=4), chaque axe taxonomique une colonne (M=4 : sophismes, formalismes, domaines, preuve).

La mesure est mécanique (acceptance b) : un organe canonique scripts/notebook_tools/fallacy_coverage_matrix.py lit les notebooks eux-mêmes — inventaires d'étiquettes (variables label/taxo/logic/mafalda/walton, ex. LOGIC_13 = 13, dict-of-tuples type du 01), cellules posant la paire formel/informel, sources externes nommées (github.com, huggingface.co, arg.tech, reddit.com, kaggle.com), preuve d'exécution (ratio, erreurs, PNG). Zéro déclaration à la main.

Matrice mesurée sur main (PoC vs vérification manuelle, acceptance c) :

Notebook Exécutées Exercices Sophismes Formalismes Domaines
01_taxonomy_intro 6/6 (100%) 3 5 2 0
02_fallacy_datasets_landscape 12/12 (100%) 3 0 0 3
03_taxonomy_coverage_gap 7/7 (100%) 3 36 0 0
04_coverage_matrix 6/6 (100%) 3 0 0 0
Série 31/31 12 41 2 3

Livrable

  • scripts/notebook_tools/fallacy_coverage_matrix.py (nouveau) — organe canonique : build_matrix / markdown_table / heatmap_payload + CLI (--markdown/--json)
  • scripts/notebook_tools/tests/test_fallacy_coverage_matrix.py (nouveau) — 11 tests pytest sur fixtures notebooks réels en mémoire (0 mock)
  • MyIA.AI.Notebooks/GenAI/FallacyDetection/04_coverage_matrix.ipynb (nouveau, 15 cellules) — consomme l'organe (leçon feat(ict,#13903): Greffe 5 tranche 2/3 -- adaptateurs cross-engine Quasi-Experimental + PyMC-05 #13921) : matrice markdown, heatmap normalisée (matplotlib Agg) assets/fallacy_coverage_matrix.png, 3 exercices stubs C.1 répartis (acceptance d), conclusion Phase 2
  • README.md — ligne 04 dans le tableau « Notebooks de la série »

Test plan

  • (a) Matrice N×M : N = notebooks de la série (4), M = sophismes/formalismes/domaines/preuve — la heatmap (normalisation par ligne-max) rend la répartition en un coup d'œil
  • (b) Audit par comptage scripté : fallacy_coverage_matrix.py --markdown exécuté sur main (résultats ci-dessus, recoupés manuellement notebook par notebook)
  • (c) Matrice markdown lisible + heatmap PNG committée (1080×504, lisible dans le notebook via ![](assets/...))
  • (d) 3 cellules-stubs ## Exercice (code + préparation markdown), réparties, C.1 (pass/return None, 0 raise NotImplementedError)
  • Exécution réelle : papermill kernel python3, 15/15 cellules, 0 erreur, execution_count tous non nuls (fixpoint: la matrice relit son propre fichier exécuté)
  • notebook_tools.py validate = OK (15 cellules, 0 erreur, 0 warning)
  • Scan path-leak sorties + métadonnées : 0 hit ; metadata.papermill.output_path normalisé en basename
  • Tests organe : 11 passed (0.15s)
  • README français, catalogue byte-identique à main (aucune régénération, aucun autre fichier touché — 1 ligne README + 4 fichiers nouveaux)

Résiduel

Matrice = carte de départ Phase 2, pas un verdict : colonnes formalismes/domaines vides dans 01/03 = matériau (dataset builder #10356 Phase 2).

See #13655
See #14110

…Detection

04_coverage_matrix.ipynb (synthèse Phase 1 #10356) mesure la couverture de
la série sur 4 axes mechanically (sophismes/formalismes/domaines/preuve),
via l'organe canonique scripts/notebook_tools/fallacy_coverage_matrix.py
consommé par le notebook + tests externes (11 tests reels, 0 mock).

- organe : inventaires label/taxo/logic/mafalda/walton, dict-of-tuples
  type, paires formel/informel, sources externes (github/hf/arg.tech/reddit),
  preuve d'execution (ratio, erreurs, PNG)
- heatmap normalisee assets/fallacy_coverage_matrix.png (matplotlib Agg)
- 3 exercices stubs C.1 repartis, notebook execute 15/15 cellules 0 erreur
- README ligne 04 (>=3 exercices, acceptance #13655)

Co-Authored-By: Claude-Code <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ Detector abstained (merge-base introuvable, shallow fetch or unanchored branch).

c.415 (#11873): scope = notebooks CHANGED in this PR, not the whole corpus.
See python scripts/check_markdown_claims_output.py --help for re-running locally.
Detector rationale: c.290 / c.331 / PR #11435 pathologie.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Bash Syntax Advisory — shebang / executable-bit warnings

See the Shebang + dry-run advisory job log for the per-file ::warning:: lines. Non-blocking.

@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 4.0s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 4.0s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.9s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 4.6s
Search-1-StateSpace.ipynb ✅ SUCCESS 3.7s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.6s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 26.3s
GameTheory-04c-NashExistence-Python.ipynb ✅ SUCCESS 3.3s

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

@jsboige

jsboige commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

[Hermes] — #14312 matrice de couverture N×M FallacyDetection (#14110). Vérification mécanique complète — la matrice annoncée est celle réellement produite.

Vérification (organe + notebooks réels au head 3aa59678) :

  • Reproduction indépendante : j'ai téléchargé l'organe + les 4 notebooks réels de la série, exécuté fcm.build_matrix(series_dir) → la matrice sort est exactement celle du body : 01=6/6, 5 sophismes, 2 formalismes, 0 domaines ; 02=12/12, 3 domaines ; 03=7/7, 36 sophismes ; Série=31/31, 12/41/2/3. Aucune divergence.
  • Le "36 sophismes" du 03 est mécanique et correct : LOGIC_13 (13, Jin 2022) + MAFALDA_L2 (23, Helwe 2023) comptés par _inventory_lengths — c'est bien la couverture d'inventaires du notebook, pas une déclaration à la main.
  • Matrice "calculée pas écrite" confirmé : le notebook 04 consomme l'organe via sys.path + fcm.build_matrix — la cellule matrix-build imprime précisément cette table, donc la sortie committée = ré-exécution réelle (timestamps 12:38:57, execution_count 1..N).
  • 11/11 tests pytest passent (0.14s) — fixtures notebook réels en mémoire, 0 mock. Les tests importent scripts.notebook_tools.fallacy_coverage_matrix → l'archi package est saine.
  • Heatmap réelle : heatmap_payload (labels 6 axes × 4 notebooks) + normalisation par ligne dans le notebook, matplotlib.use("Agg"), assets/fallacy_coverage_matrix.png réellement sauvegardé (cell 3, stdout "Heatmap sauvee"). PNG committé = rendu réel.
  • 3 exercices stubs C.1 confirmés (TODO / "a completer").

Point d'attention (non bloquant, note de fond) : pour le notebook 04 lui-même, formalismes=0 et domaines=0 alors qu'il est le notebook de synthèse qui parle de la couverture. C'est cohérent avec la sémantique (le 04 ne définit pas d'inventaire ni ne cite de source externe, il consomme l'organe) — mais ça signifie que la colonne formalismes mesure la présence de la paire formel/informel dans le source, pas la couverture thématique. Si l'axe devait capturer "ce que le notebook discute" plutôt que "ce qu'il définit", le 04 serait sous-compté. Défaut sémantique assumé et documenté, à garder en tête pour une future Phase 2 — pas bloquant.

Sécurité : 0 secret/token dans le diff.
Verdict : organe canonique propre, matrice vérifiée mécaniquement, tests couvrent 0 mock, heatmap réelle. C'est exactement le pattern "organe importable + consommateur externe" (leçon #13921). (contrainte token : COMMENT only)

@github-actions

github-actions Bot commented Sep 2, 2026

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

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Bash Syntax Advisory — shebang / executable-bit warnings

See the Shebang + dry-run advisory job log for the per-file ::warning:: lines. Non-blocking.

@jsboige
jsboige merged commit 1343f0c into main Sep 2, 2026
62 checks passed
@jsboige
jsboige deleted the feature/14110-fallacy-coverage-matrix branch October 16, 2026 12:03
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