Repository navigation
fix(ml,#8056): add metadata.cost to ML-8/ML-9/TP ML.Net family (5 NB) - #8445
Conversation
L-887 ★★★ verbatim-forensic sub-genre costfm-byte-surgical-add: - structural add ONLY (no FM removal, no value transform) - canonical 14 fields + notes, validator papermill, last_validated 2026-07-25 - Python NBs: sklearn/pandas/numpy pipeline notes - C# NBs: ML.NET DataView + Trainer pipeline notes NBs migrated: - ML-8-Clustering-Python (K-Means sklearn, 11 code cells) - ML-8-Clustering (ML.NET KMeans, 15 code cells) - ML-9-Anomaly-Detection-Python (PCA recon error sklearn, 12 code cells) - ML-9-Anomaly-Detection (ML.NET RandomizedPCA, 15 code cells) - TP-prevision-ventes (ML.NET FastTree TP assurance, 9 code cells) Completes ML tranche #8056 to 52/52 = 100% (with #8400 c.871 14 + #8438 c.899b 19 + #8432 c.897 6 + #8419 c.8419 9 + IIT-1/2 2). +85/-0 strict, 5 files exactly. Co-Authored-By: Claude <noreply@anthropic.com>
Golden-Set Execution (H.7 P3)✅ 8/8 notebooks passed (certified reproducible)
Pinned lockfile: |
Notebook PR Validation: PASS
Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns) |
…etadata.cost add Fixes Twin parity audit (#8057) CI failure introduced by the parent commit (metadata.cost add shifted both twins' blob SHAs). Per C868-L lesson (editing a registered twin trips the --per-pair gate): rebaseline csharp_sha + python_sha for the 2 affected pairs in the SAME PR, with a known_differences note documenting the parity-preserving metadata addition (identical cost values on both twins, metadata-only, 0 code churn). - ML-8 Clustering: python 1ca21ef -> 360d5e2, csharp fdc7675 -> df1f11a - ML-9 Anomaly-Detection: python c4aaf62 -> 503b126, csharp f23f681 -> d8b2e87 Local verify: check_twin_parity.py --check --per-pair --base origin/main -> drift_introduced=0, drift_pre_existing=0. See #8057 See #8056 Co-Authored-By: Claude-Code <noreply@anthropic.com>
Twin-parity rebaseline (commit
|
| Pair | python_sha | csharp_sha |
|---|---|---|
| ML-8 Clustering | 1ca21efd → 360d5e25 |
fdc76753 → df1f11ae |
| ML-9 Anomaly-Detection | c4aaf62d → 503b1266 |
f23f68174 → d8b2e870 |
The metadata.cost was added symmetrically to both twins with identical values (api_usd_est=0.0, gpu_required=false, vram_tier=NONE, free_alternative=self) — metadata-only, 0 code churn (code-cell sha1 match main==head), so behavioral parity is preserved. Local verify: check_twin_parity.py --check --per-pair --base origin/main → drift_introduced=0, drift_pre_existing=0.
TP-prevision-ventes is not a registered twin (no rebaseline needed).
jsboige
left a comment
There was a problem hiding this comment.
Forensic review (independent, po-2026) — ✅ COMMENT, CLEAN ADD verified
Method (G.6, not body table): for each of the 5 NBs, confirmed ADD pattern (no cost before, no cell#1 FM) and verified metadata.cost completeness + value-sanity + 0 code-churn (sha1 code-cell sig).
Results — 5/5 CLEAN:
- Pure ADD (no prior cost, no cell#1 FM) → field-drop / telltale checks N/A (those are MIGRATE-specific defects — c.713/c.714 telltale + c.824 indented-FM field-drop only fire when cost existed before).
- 14/14 canonical cost fields present on all 5 (api_usd_est, gpu_required, vram_tier, free_alternative, reduced_pedagogical, reproducibility, last_validated, validator…). Complete metadata.
- 0 code-cell churn (sha1 sigs match base).
- Values sane + consistent across the 3 distinct families (Clustering ML-8 Py/C#, Anomaly ML-9 Py/C#, TP-ventes): CPU-only ML.Net —
api_usd_est=0.0,gpu_required=false,vram_tier=NONE,free_alternative=self,reduced_pedagogical=self,reproducibility=HIGH. - twin_pairs.yaml (ML-8): rebaselined with explicit
reason:+known_differencesdocumenting the symmetric metadata.cost add to BOTH twins (Python+C# get identical values) — twin-parity-on-merge respected.
Cross-confirmation (c.724 catch-loop): this is po-2023's first cost-mig PR after the #8438 field-drop fix. ADD output is clean → the parsed['cost'][k] indented-FM fix generalized correctly (ADD PRs were never affected, but this confirms the script path is sound post-fix). Mergeable.
See #8056 — po-2026
…cost (byte-surgical, guard #8352) (#8518) Migration cost markdown ---YAML--- -> metadata.cost JSON, serie Audio 02-Advanced (9 notebooks). Verification anti-regression coordinateur (le shape -290/+10 est un red-flag par defaut) : PAS de perte. Les 9 blocs cost JSON portent l'integralite des champs (api_usd_est, api_provider, cpu_min, gpu_min, gpu_required, vram_gb, vram_tier, network, external_account, free_alternative, reduced_pedagogical, reproducibility, last_validated, validator) ET le champ 'notes' en prose (9/9 verifies). Le delta -290/+10 s'explique par le passage YAML multi-lignes -> JSON une ligne. Scope : 1 feature, 1 domaine, 10 fichiers -> sous les seuils composites G.4. Continuite d'une migration flotte deja mergee (#8420, #8393/#8397, #8400/#8445, #8432). Grain: MED/metadata-migration - lane myia-po-2025:CoursIA
…adata.cost (#8585) Verifie firsthand avant merge : 0 cellule code touchee, 0 execution_count, 0 output_type, 0 fichier non-ipynb (catalogue intact). Le defaut du sibling #8579 — terminateur `\n---` fuite dans `metadata.cost.notes` — n'est PAS reproduit ici (0 occurrence). C.2 N/A confirme : migration de stockage pure. 12 fichiers < seuil G.4. Note de variation (non bloquante ici, mais elle le deviendra) : c'est la **10e PR du meme recipe #8056** (#8418, #8419, #8429, #8432, #8438, #8445, #8518, #8579, #8580, celle-ci). Chacune passe le litmus LIGHT — « pourrais-je en generer une douzaine en scannant la famille suivante ? » — et le body annonce lui-meme ~37 notebooks restants, soit 4 vagues de plus. Je merge parce que le travail est propre et que le landmine `detect_markdown_rendering` est reel, pas parce que le decoupage est bon : voir le steer poste sur le dashboard pour la sortie de cette vague en **une** PR finale.
c.902 — ML/ML.Net ML-8/ML-9/TP costfm migration slice (5 NBs → metadata.cost)
Grain: MED/notebook-costfm — lane
myia-po-2023:CoursIA-2— prev: c.899b MED/notebook-costfm (ML/DSWA)Sub-genre:
costfm-byte-surgical-add(L-887 ★★★ verbatim-forensic, mirror c.871/c.897/c.899b)Issue: #8056 (costfm migration epic, ML tranche 100% complete)
Branch:
fix/c902-ml88-tp-costfmScope: 5 files, +85/-0 strict, ML/ML.Net ML-8/ML-9/TP family only
Cible
Issue #8056 costfm migration epic — tranche ML/ML.Net ML-8/ML-9/TP (5 NBs). Ferme la derniere sous-tranche ML #8056 (52/52 = 100%).
5 NBs cibles :
Approche (L-887 ★★★ verbatim-forensic)
Sub-genre :
costfm-byte-surgical-add— addmetadata.costJSON (15 champs canoniques) UNIQUEMENT, NO value transformation.setdefault()overriding existingvram_tier: NONE → LITE/free_alternative: 'self' → Nonejson.loads+ LF-only ➜metadata['cost'] = {14 fields + notes}➜json.dumps(indent=1, ensure_ascii=False).encode('utf-8')+ trailing newlinePas de L930 telltale : 5 NBs n'ont pas de cell#1 YAML FM (cohérent avec ML-1..ML-7 MERGED c.871 qui étaient déjà pure metadata add). Pas de parsing YAML nécessaire.
5 NBs migrated — canonical 14 fields + notes
Valeurs canoniques uniformisées (15 fields identiques structurellement, notes adaptées par NB) :
api_usd_est: 0.0,api_provider: "none",gpu_required: false,vram_gb: 0,vram_tier: "NONE"network: false,external_account: "none",free_alternative: "self",reduced_pedagogical: "self"cpu_min: 2,gpu_min: 0,reproducibility: "HIGH"last_validated: "2026-07-25T00:00Z",validator: "papermill"notes: pipelines sklearn (Python) ou ML.NET (C#), datasets synthétiques reproductibles, durée par NB, mode pédagogique hold-out 80/20Validations (firsthand)
git diff --statgit diff --name-onlygit diff --name-only | grep -iE "COURSE_CATALOG|README.*CATALOG-STATUS"= videb"\r\n" in raw= False partoutraw.endswith(b'\n')= True partoutjson.loadsaprès write)gh pr list --search "ML-8-Clustering"|"ML-9-Anomaly"|"TP-prevision-ventes"= videgh pr list --search "#8056" --search "ML.Net"= 4 PRs distincts (DSWA, CaseStudies, CJK-tranches) — pas ML-8/ML-9/TPGarde-fous
setdefault()overriding existing, pas de mapping. Verbatim.#8056+ML.Net= 0 PR OPEN sur slice ML-8/ML-9/TP.outputscell touched. Migration = metadata uniquement.origin/main(0 line diff).Completes ML #8056
Ce PR ferme la tranche ML/ML.Net (52/52), DSWA et CaseStudies ont déjà leurs PRs OPEN.
Hors scope (pour mémoire)
last_validated: '2026-07-25T00:00Z'(ISO strict),free_alternative: 'self'(string, littéral canonique c.871),external_account: 'none'(str, pas null). Toutes canoniques depuis c.871, préservées verbatim.Voir aussi
.claude/rules/)