Skip to content

docs(probas,#8081): Infer-3 MBML Ch.1 fidelity note + recalibration disclosure - #8531

Merged
jsboige merged 1 commit into
mainfrom
fix/c874-infer3-mbml-fidelity-note
Jul 25, 2026
Merged

jsboige merged 1 commit into
mainfrom
fix/c874-infer3-mbml-fidelity-note

Conversation

@jsboige

@jsboige jsboige commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Grain: MED/notebook-doc-honesty — lane myia-po-2024:CoursIA-2 — prev: MED/notebook-python-audit-claims (c.872 GT-13)

Problem

Infer-3-Factor-Graphs.ipynb cell[7] opens the "Murder Mystery" scenario with:

Contexte (MBML Book, Chapter 1)

…without disclosing that the conditional probabilities are recalibrated vs the canonical MBML example. A reader (or auditor) taking the header at face value expects a faithful MBML Ch.1 port and finds the weapon preference inverted (here Auburn prefers the revolver; in the book it's Grey) — which looks like a bug if the recalibration isn't documented.

The #8088 audit (2026-07-23) reached this verdict but only committed a report file; #8168 then removed that report per audit-cross-source-distillation HARD 1 ("un audit produit un verdict, pas un fichier … un finding actionnable devient une issue / le notebook la corrige ensuite en PR"). The actionable notebook correction was never applied — no open issue tracked it. This PR is that correction.

Fix (markdown-only, cell[7])

Insert a fidelity note between the "### Contexte" header and the scenario:

Fidélité à la source : Scénario adapté du Model-Based Machine Learning (Winn & Bishop), chapitre 1 « A Murder Mystery » (dotnet/mbmlbook). La structure itérative (prior → arme → cheveu) et la mécanique bayésienne suivent le livre ; les probabilités conditionnelles sont recalibrées par rapport à l'exemple canonique (dans le livre, c'est Grey qui préfère le revolver) afin d'illustrer la compensation exacte des indices (section 6, « retour au prior »).

Documents three things: (a) source attribution (dotnet/mbmlbook), (b) the iterative prior→arme→cheveu structure inherited from the book, (c) the recalibration disclosure + its pedagogical justification (cell[16] "retour au prior" — the LR product ≈ 1.0 compensation lesson, which requires the inverted preferences).

Source verified firsthand (G.1, L825)

Read github.com/dotnet/mbmlbook src/1. A Murder Mystery/ firsthand (C# WPF app):

  • Program.cs: priors = { Grey = 0.3, Auburn = 0.7 }; conditionalsWeapon = { RevolverGivenGrey = 0.9, RevolverGivenAuburn = 0.2, … }; conditionalsHair = { HairGivenGrey = 0.5, HairGivenAuburn = 0.05 }.
  • PriorKnowledgeModel.cs / ObservedWeaponModel.cs / ObservedHairModel.cs: the iterative class-inheritance model-building (prior → weapon → hair) that Infer-3 mirrors.

Confirmed: MBML has Grey preferring the revolver (0.9); Infer-3 cell[12] inverts to Auburn (Bernoulli 0.9 If / 0.2 IfNot). Hair: MBML 0.5/0.05 → Infer-3 cell[15] 0.8/0.1. Recalibration is real, coherent, and intentional (the inversion is what makes cell[16]'s exact-compensation lesson work). Not a bug — a documentation gap. Verdict: FIDÈLE + DIVERGENCE POSITIVE (recalibration enriches rather than regresses), with the PERTE DOCUMENTÉE (missing disclosure) now fixed by this note.

Scope: C# Infer-3 only (no twin asymmetry)

The Probas-3 pair (parity_level: semantic, twin of PyMC-3-Factor-Graphs.ipynb) was verified firsthand:

  • Infer-3 (C#): 2 suspects (Major Auburn 0.7 / Miss Grey 0.3), Victorian manor, hair+weapon evidence — the actual MBML Ch.1 scenario.
  • PyMC-3 (Python twin): 3 Cluedo suspects (Scarlet 0.6 / Mustard 0.3 / Peacock 0.1), M. Boddy — a different scenario, not the MBML port.

The twins pair on concept (factor graphs, discrete inference, explaining away), not scenario. The MBML recalibration note is specific to Infer-3's Auburn/Grey scenario and does not apply to PyMC-3's Cluedo scenario. (Separate observation, out of scope here: PyMC-3 cell[0] claims "MBML Ch.1" but uses a Cluedo scenario — a potential finding for the PyMC owner to assess firsthand.)

Verification (firsthand)

  • git diff --stat = +2/-0 in Infer-3 (2 new markdown source-list elements), +3/-3 in twin_pairs.yaml (SHA + date/by). Surgical.
  • Byte-surgical raw-JSON replace (not NotebookEdit — L772/L768: NotebookEdit rewrites whole notebook risking output drift): occurrences of OLD: 1 (exact unique match), JSON round-trips valid, 53 cells unchanged.
  • cell[7] = markdown, 0 outputs (C.2 exception — no re-exec needed, no output touched).
  • CRLF = 0 (*.ipynb text eol=lf respected).
  • Twin-parity rebaseline (C868-L): csharp_sha 620b7fd3b → f5158092a in the same commit. Verified post-edit: recorded csharp_sha == working-tree SHA (git hash-object) == f5158092a → CI --per-pair --base origin/main will see drift_introduced=0. python_sha unchanged (PyMC-3 not touched). YAML parses (92 pairs).
  • L898 pre-push: no OPEN PR touches Infer-3 (docs(probas,#8081): audit distillation Infer-4-Bayesian-Networks vs MBML/Russell-Norvig (verdict FIDÈLE ~80%) #8528 is Infer-4, a different notebook; docs(probas,#8081): audit distillation MBML Ch.1 Murder Mystery (Infer-3 + PyMC-3) #8088 Infer-3 audit was MERGED and only added a report file, since removed).

Context

Found by completing the #8088 audit's actionable follow-up (the audit verdict existed, the notebook fix did not). audit-cross-source-distillation.md: the audit's job is the verdict; the notebook's job is the correction — this PR is the latter. Not Closes (the #8081 epic remains open across many notebooks).

See #8081 (audit epic). See #8088 (the audit that identified this), #8168 (report hygiene).

Co-Authored-By: Claude-Code noreply@anthropic.com

…isclosure

The #8088 audit (2026-07-23) reached a verdict on Infer-3 vs MBML Ch.1
but only as a report file (since removed by #8168 per audit-cross-source-
distillation HARD 1). The actionable finding -- the notebook cites
"### Contexte (MBML Book, Chapter 1)" without disclosing that the
conditional probabilities are RECALIBRATED vs the canonical example --
was never applied to the notebook itself. No open issue tracked it.

This PR applies that finding: a markdown fidelity note in cell[7]
documenting (a) MBML Ch.1 source attribution (dotnet/mbmlbook), (b) the
iterative prior->arme->cheveu structure inherited from the book, (c) the
recalibration disclosure (in the book, Grey prefers the revolver; here
Auburn does) chosen to illustrate the exact-compensation lesson (cell[16],
"retour au prior").

Source verified firsthand: github.com/dotnet/mbmlbook src/1. A Murder
Mystery/Program.cs (priors Auburn 0.7 / Grey 0.3; RevolverGivenGrey=0.9,
RevolverGivenAuburn=0.2; HairGivenGrey=0.5, HairGivenAuburn=0.05) +
PriorKnowledgeModel.cs / ObservedWeaponModel.cs / ObservedHairModel.cs.
Infer-3 cell[12] inverts the weapon preference (Auburn 0.9 / Grey 0.2)
and cell[15] recalibrates hair (0.8 / 0.1 vs MBML 0.5 / 0.05) -- coherent,
intentional pedagogy, not a bug.

Scope: C# Infer-3 only. The PyMC-3 twin uses a different scenario
(Scarlet/Mustard/Peacock Cluedo, NOT the MBML Auburn/Grey port), so the
MBML recalibration note does not apply to it. The twins pair on CONCEPT
(factor graphs, explaining away), not scenario -- no twin asymmetry.

Markdown-only (C.2 exception, no re-exec, 0 outputs touched). Twin-parity:
Probas-3 pair is semantic; csharp_sha rebaselined 620b7fd -> f515809
in the same commit (C868-L: editing a registered twin requires same-PR
SHA rebaseline, else CI --per-pair reports drift_introduced=1).

See #8081 (audit epic, partial contribution -- not Closes).

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

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 15
  • 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

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 5.3s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 4.6s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.3s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 5.2s
Search-1-StateSpace.ipynb ✅ SUCCESS 4.3s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 3.2s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 25.4s
GameTheory-4c-NashExistence-Python.ipynb ✅ SUCCESS 3.7s

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

@jsboige
jsboige merged commit 5b22325 into main Jul 25, 2026
31 checks passed
jsboige added a commit that referenced this pull request Jul 26, 2026
…ssell-Norvig/Koller-Friedman (converts #8528 audit→notebook) (#8549)

* docs(probas,#8081): Infer-4 Bayesian-Networks source attribution (Russell-Norvig/Koller-Friedman)

PR #8528 (the Infer-4 distillation audit) was filed as a committed
AUDIT-INFER4-BAYESIAN-NETWORKS-2026-07-25.md file, which violates
audit-cross-source-distillation HARD 1 (same pattern as #8532 / #8168:
18 audit reports removed from MyIA.AI.Notebooks/**). #8528 received
CHANGES_REQUESTED with the steer: apply the findings INTO the notebook
(form #8531). This PR is that conversion.

Finding applied (the audit's PERTE DOCUMENTÉE — attribution):
- NEW fidelity cell after cell[7] (the "## 3. Le Reseau Wet Grass /
  Sprinkler / Rain" section): documents the canonical sources of the
  Wet Grass network — Russell & Norvig (AIMA, Ch.14 « Probabilistic
  Reasoning ») and Koller & Friedman (Probabilistic Graphical Models);
  the deliberate choice of Wet Grass (canonical for D-separation +
  explaining-away) over MBML's Mr Black murder-mystery narrative (which
  lives in Infer-3); and the iterative-derivation choice (MBML derives
  via dialogue, Infer-4 presents the finished model then executes).

Source attributions are textbook-standard (Wet Grass/Sprinkler/Rain is
THE canonical Bayesian-net example in AIMA Ch.14 + Koller-Friedman) —
not paraphrased from the audit. No hard cell-number cross-refs (robust
to index drift; concepts referenced by section).

Scope: Infer-4 notebook only (+8/-0, markdown-only, C.2 exception, 0
outputs touched). No AUDIT-*.md created (the conversion replaces it).
The verdict (~80% FIDÈLE, capabilities executed not workaround'd) goes
to the dashboard. The audit's PERTE PAR COMPLAISANCE POTENTIELLE
(absent EP convergence-failure diagnostic) → tracked as a dedicated
issue (per audit-cross-source-distillation: finding -> issue), not
folded into this notebook PR.

Verification: parsed-source cell splice (C876-L), CRLF=0, no
output/exec_count drift, JSON valid. L898: #8528 touched only the audit
file (no notebook collision).

See #8081 (audit epic). See #8528 (the audit-file form this
supersedes), #8531 (canonical Infer-3 fidelity-note form).

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

* chore(twin,#8057): rebaseline Probas-4 Bayesian-Networks apres modification du cote C#

Le gate de parite echouait parce que Infer-4-Bayesian-Networks.ipynb (cote csharp
de la paire) a bouge sans re-audit. La branche precedait #8586 (registre passe en
repertoire), donc la commande de rebaseline n'etait pas applicable en l'etat :
merge de main d'abord, rebaseline chirurgical ensuite.

Ecriture limitee au seul fichier de la paire (#8570) : 3 lignes, csharp_sha + date + by.

See #8057, #8586

---------

Co-authored-by: po-2024-worker <ai@myia.fr>
Co-authored-by: Claude-Code <noreply@anthropic.com>
@jsboige
jsboige deleted the fix/c874-infer3-mbml-fidelity-note branch September 2, 2026 13:16
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