Repository navigation
feat(tooling,#8056): check_cost_metadata reads metadata.cost first (canonical) + doc PR A - #8376
Conversation
…anonical), fallback cell-scan (legacy)
…re ---YAML cell from mandate Rewrites docs/notebook-metadata/cost-matrix.md per #8056 design-gate c.866: - Schema section: canonical = nb.metadata['cost'] (JSON, invisible to markdown render); the ---YAML markdown cell is RETIRED from the mandate (markdown-it promotes it to setext-H2 supersize, guard #8352 blocks ERROR). - Drop redundant title field (H1 of notebook suffices) from mandatory table. - Pilot examples: clarifying note — YAML used only for inline-comment readability (JSON is comment-free); field VALUES identical, storage = metadata['cost']. - Student-facing cost disclosure = OPTIONAL (md badge, never raw YAML). - Update #8052 litmus + acceptance criterion 1 + sortie-attendue references. Pairs with the validator change (900f5fb27) which reads metadata.cost first, falls back to cell-scan. Exemplar #8323 (Infer-3/4). See #8056. Co-Authored-By: Claude-Code <noreply@anthropic.com>
c.865 — Verification comment on #8376 (po-2023, no worktree commit, verify-only)G.1 firsthand sign-off (po-2023 c.865, audit-only, no code edit on the branch — verified from Diff scope (atomic, G.4 strict)
Verifications (post-
|
| Test | Notebook | Expected | Result |
|---|---|---|---|
| T1 | Infer-3-Factor-Graphs | metadata.cost canonical | cost_source: 'metadata' ✓ |
| T2 | (T2 not re-run, T1 covered it structurally — same metadata.cost shape) |
— | inferred OK |
| T3 | GenAI/Audio 01-1-OpenAI-TTS-Intro | legacy ----cell backward-compat |
cost_source: 'markdown_cell' ✓ |
| T4 | Infer-1-Setup | no cost matrix | cost_meta_found: False, cost_source: None ✓ |
| T5 | Audio 01-1 (litmus) | free_alternative finding | free_alternative_missing MAJOR ✓ |
4. Secrets: grep -E "sk-|ghp_|AIza|os.getenv.*literal|API_KEY = .*\\\"\w" .py — 0 hit. The HF_TOKEN / TOKEN_PATTERNS references in check_cost_metadata.py are literals in the anti-leak detector (it scans for these patterns), not actual secrets.
5. LF-only CR=0: git diff origin/main...origin/feature/cost-metadata-parser-8056 | grep -c $'\r$' = 0 ✓.
6. Catalog-pr-hygiene R1: git diff --stat origin/main...origin/feature/cost-metadata-parser-8056 -- COURSE_CATALOG.* = empty ✓ (catalog-guard CI already SUCCESS).
Scope discipline (G.4 atomicity)
- No composite features: 1 subject = canonical-form pivot (
metadata['cost']+ retire---YAML---). - Out-of-scope bonus (correctly excluded): T5 surfaces a real data defect (
Audio 01-1'sfree_alternative: '01-5-Kokoro-TTS-Local'points to absent file). PR body explicitly defers this to a follow-up — kept tight. - No notebook edits, no output edits (C.2 N/A), no scope creep to other families.
Hand-off to ai-01 (merge gate)
- CI status: All SUCCESS (catalog-guard, codeQL, regression-guard, secret-scan, stale-base, link-check, scripts-tests IN_PROGRESS at 17:00Z but the body commit is 2026-07-24T16:55Z — well before CI start at 17:00Z, so test is on current code).
- Awaiting: ai-01 merge per
gh auth switch -u jsboige(coordinator-discipline R1). - No coord-blockers identified: this PR is CLEAN MERGEABLE.
Honest scope note (mandat user slow-cadence 2026-07-24)
This cycle is a verify-only delivery (L721 ★ stale-tracker guard + L898 ★★★ collision guard prevented a self-pick on a jsboige-finalized PR; the right call is post verification and let coord merge). po-2023 will pivot to a fresh DEEP/MED grain in c.866 — gh issue list --state open filtered for tractable non-Probas candidates identified but not started this cycle (per user "ralentir ton cron à 2h pour l'attérissage des crédits hebdomadaires" + "tu pourras remonter à 1h à partir de lundi 2026-07-27").
…nonical), fixes #8352 guard Resolves the markdown-rendering guard (#8352) failure on #8378. cell#0 carried a `---`-YAML frontmatter (title + cost + notes) that markdown-it promotes to setext-H2 supersize = ERROR-level guard violation. The frontmatter was pre-existing legacy; the #8378 notes edit triggered the guard to re-evaluate cell#0. Fix per merged #8376 design-gate (canonical = nb.metadata['cost']): - Migrate `cost:` -> nb.metadata['cost'] (invisible JSON, all values preserved). - Drop redundant `title` (H1 `# 10. Hébergement Local...` already exists in cell#0). - Merge top-level `notes` into cost.notes (canonical placement per #8323/#8376). - Remove the entire `---...---` block from cell#0 source. Validation: detect_markdown_rendering.py --check --baseline = OK (exit 0, no new ERROR-level violations). Cross-tool: check_cost_metadata.py reads cost_source: 'metadata'. 0 code cells modified -> no re-exec (C.2 N/A; metadata + markdown-only). byte-delta -737 (verbose YAML w/ comments -> compact JSON). See #8369 · See #8056 · See #8376 Co-Authored-By: Claude-Code <noreply@anthropic.com>
…t (canonical) Move the cost: YAML block from cell[0] frontmatter to nb.metadata['cost'] (canonical JSON, per #8376 design-gate / #8323 exemplar) on 15 QC-Py Python pedagogical notebooks (QC-Py-01..26). Pays down guard #8352 frontmatter_rawyaml landmines: violations 17 -> 6 on the QC-Py dir (the 11 cell#0 frontmatter landmines resolved; the 6 remaining are preexisting mid-notebook hr FPs). Storage-format migration: values migrated verbatim (not re-estimated). QC-Py notebooks are QuantBook()-gated (QC Cloud) so not local-re-executable; committed last_validated/validator preserved transparently. check_cost_metadata reports cost_source='metadata' (canonical) on all 15. H.3 validate_pr_notebooks 3/3 PASS. See #8056. See #4208. Co-Authored-By: Claude-Code <noreply@anthropic.com>
…ntmatter → metadata.cost (fixes #8352 guard) (#8378) * fix(genai-texte,#8369): clarify 10_LocalLlama scope — 2 non-local endpoints, GPU required = pedagogical target Stop & Repair discipline (secrets-hygiene rule 6): honest scope clarification rather than hand-edited cell outputs. Substance: 1 fichier, +11/-10 strict, 2 changements minimalistes dans cell[0] (markdown intro only, 0 code cell touched, 0 output hand-edited, no Papermill re-exec). Change 1: costfm-frontmatter notes: (ligne 18) — clarifie que gpu_required=true est la cible pedagogique (Exercice 3 deploye vLLM/Ollama via Docker), pas la demo commited. Change 2: Note d'execution (lignes 74-82) — actualise 'un seul endpoint' (OBSOLETE) vers '2 endpoints OpenAI-compatibles non-locaux (cloud-gpt5.2 + openweight-llama4)'. Aucun serveur vLLM/Ollama n'est demarre dans cette execution. Verifications: H.3 PASS (1/1, 19 code cells, python3 kernel), LF-only CR=0 (237142 bytes), 0 leak (detect_solution_leaks.py), 0 catalog diff vs origin/main, fast-forward merge origin/main OK (3 commits #8372/#8374/#8373 sans impact). L898 + L977 collision guard: 0 PR OPEN de po-2023 sur 10_LocalLlama ou Local LLM. L954 pivot genre honoré (c.864 tool-metadata vs c.865 notebook-genai-honest-retitle). G-VAR-1/2/3 OK. Co-Authored-By: Claude <noreply@anthropic.com> * fix(genai-texte,#8369): migrate cost frontmatter -> metadata.cost (canonical), fixes #8352 guard Resolves the markdown-rendering guard (#8352) failure on #8378. cell#0 carried a `---`-YAML frontmatter (title + cost + notes) that markdown-it promotes to setext-H2 supersize = ERROR-level guard violation. The frontmatter was pre-existing legacy; the #8378 notes edit triggered the guard to re-evaluate cell#0. Fix per merged #8376 design-gate (canonical = nb.metadata['cost']): - Migrate `cost:` -> nb.metadata['cost'] (invisible JSON, all values preserved). - Drop redundant `title` (H1 `# 10. Hébergement Local...` already exists in cell#0). - Merge top-level `notes` into cost.notes (canonical placement per #8323/#8376). - Remove the entire `---...---` block from cell#0 source. Validation: detect_markdown_rendering.py --check --baseline = OK (exit 0, no new ERROR-level violations). Cross-tool: check_cost_metadata.py reads cost_source: 'metadata'. 0 code cells modified -> no re-exec (C.2 N/A; metadata + markdown-only). byte-delta -737 (verbose YAML w/ comments -> compact JSON). See #8369 · See #8056 · See #8376 Co-Authored-By: Claude-Code <noreply@anthropic.com> --------- Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
…nche (7 nb) + twin rebaseline (#8379) * feat(probas,#8056): metadata.cost peuplement — Infer foundational tranche (7 notebooks) PR C tranche 1 of #8056 (continuation of merged #8376 parser + #8323 Infer-3/4 exemplar). Adds nb.metadata['cost'] to the foundational Probas/Infer.NET notebooks that lacked a cost matrix: Infer-1-Setup, Infer-2-Gaussian-Mixtures, Infer-5-Causal-Inference, Infer-6-Debugging, Infer-7-Skills-IRT, Infer-8-TrueSkill, Infer-9-Classification. All CPU-only / deterministic (Infer.NET VMP) / no API / no GPU / no network / no external account — verified firsthand in the #8081 fidelity audit (13/13 Infer FIDÈLE). cpu_min=2 = cold-NuGet-restore-aware (matches #8323; warm papermill.duration documented verbatim in each notes field, e.g. Infer-1 9s, Infer-2 19s, Infer-6 16s). Infer-5 has no recorded duration -> explicit estimate in its notes. Technique: SURGICAL text insertion of the cost block as the first notebook-level metadata key (after ` "metadata": {`). Byte-identity preserved on all cells + existing metadata — no json.dumps round-trip (which churned Infer-2's compact `}]` cells closing). LF-only (no CRLF). metadata['cost'] is notebook-level JSON -> 0 code cells modified -> no re-exec required (rule C.2 N/A). Validator reads each as cost_source: 'metadata' (canonical, per #8376). See #8056. Part of #4208. Co-Authored-By: Claude-Code <noreply@anthropic.com> * chore(twin-parity,#8057): rebaseline 6 Probas csharp_sha post cost-metadata add Rebaselines Probas-2/5/6/7/8/9 csharp_sha in twin_pairs.yaml after the cost-metadata addition in the previous commit (metadata['cost'] changes the notebook blob SHA). Semantic parity holds (verified firsthand in #8081 audit, 13/13 FIDÈLE; the change is a metadata field, not teaching content). Follows the going-forward precedent (#8250/#8262/#8372): any PR modifying a registered twin rebaselines its sha in the same PR, keeping twin-parity CI green. check_twin_parity.py --check: OK=39 DRIFT=0. See #8057 · See #8264 Co-Authored-By: Claude-Code <noreply@anthropic.com> --------- Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…notebooks 1-9 (guard #8352) (#8384) Migrate legacy `---`-YAML cost frontmatter to nb.metadata['cost'] (canonical JSON, per merged #8376 design-gate) on the foundational GenAI/Texte series (notebooks 1-9). The frontmatter cells render as setext-H2 supersize = ERROR-level under guard #8352 (HARD-enforced in CI). Values migrated verbatim; title preserved as H1 (injected where cell#0 was frontmatter-only, kept pre-existing descriptive H1 otherwise); top-level notes merged into cost.notes. Validation: guard #8352 --check --baseline = OK exit 0 (no new ERROR); check_cost_metadata reads cost_source='metadata' x9; 0 code cells modified (C.2 N/A, verified cell-by-cell); byte-identity gate per-notebook; LF-only (CRLF=0). Diff: 9 files +147/-180. See #8056, #8352, #8376, #8378. Part of #4208. Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…notebooks 11-20 (guard #8352) (#8385) Tranche 2 of the GenAI/Texte cost-frontmatter migration (tranche 1 = #8384 nb 1-9). Migrate legacy `---`-YAML cost frontmatter to nb.metadata['cost'] (canonical JSON per #8376) on notebooks 11-20. nb10 excluded (open #8378). Values migrated verbatim; title preserved as H1 (injected where cell#0 was frontmatter-only [11,12]; kept pre-existing descriptive H1 elsewhere [13-20] -- no duplicates); top-level notes merged into cost.notes. Validation: guard #8352 --check --baseline = OK exit 0 (no new ERROR); check_cost_metadata reads cost_source='metadata' x10; 0 code cells modified (C.2 N/A, verified cell-by-cell); byte-identity gate per-notebook; LF-only (CRLF=0); h1 count = 1 per notebook. See #8056, #8352, #8376, #8384, #8378. Part of #4208. Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…t (canonical) (#8386) Move the cost: YAML block from cell[0] frontmatter to nb.metadata['cost'] (canonical JSON, per #8376 design-gate / #8323 exemplar) on 15 QC-Py Python pedagogical notebooks (QC-Py-01..26). Pays down guard #8352 frontmatter_rawyaml landmines: violations 17 -> 6 on the QC-Py dir (the 11 cell#0 frontmatter landmines resolved; the 6 remaining are preexisting mid-notebook hr FPs). Storage-format migration: values migrated verbatim (not re-estimated). QC-Py notebooks are QuantBook()-gated (QC Cloud) so not local-re-executable; committed last_validated/validator preserved transparently. check_cost_metadata reports cost_source='metadata' (canonical) on all 15. H.3 validate_pr_notebooks 3/3 PASS. See #8056. See #4208. Co-authored-by: Claude-Code <noreply@anthropic.com>
…books (guard #8352) (#8387) Family pivot (R6) in the #8056 cost-frontmatter rollout. Migrate legacy `---`-YAML cost frontmatter to nb.metadata['cost'] (canonical JSON per #8376) on the 3 IIT notebooks (IIT-1/2/3, PyPhi). Values migrated verbatim (storage-format, not re-estimation); pre-existing descriptive H1 kept (h1=1 each, no injection); top-level notes merged into cost.notes. Validation: guard #8352 --check --baseline = OK exit 0 (no new ERROR); check_cost_metadata reads cost_source='metadata' x3; 0 code cells modified (C.2 N/A, verified cell-by-cell); byte-identity gate per-notebook; LF-only (CRLF=0). IIT 0 registered twins -> twin-parity N/A. Recon correction (G.1): firsthand census on fresh origin/main worktree = 109 landmines (the "218" c.879 figure was scanned against the stale shared tree po2023-main-sync). See #8056, #8352, #8376, #8384, #8385. Part of #4208. Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…W-12/SL-11/SL-9 (guard #8352) (#8388) Continue the #8056 cost-frontmatter rollout on the 3 SymbolicAI landmines (SemanticWeb/SW-12-Python-GraphRAG, SymbolicLearning/SL-11-Capstone, SL-9-LLM-SymbolicLearning). Migrate legacy `---`-YAML cost frontmatter to nb.metadata['cost'] (canonical JSON per #8376). Values verbatim; pre-existing descriptive H1 kept (h1=1 each); top-level notes merged into cost.notes. Validation: guard #8352 --check --baseline = OK exit 0 (no new ERROR); check_cost_metadata reads cost_source='metadata' x3; 0 code cells modified (C.2 N/A, verified cell-by-cell); byte-identity gate per-notebook; LF-only (CRLF=0). SymbolicAI 0 registered twins -> N/A. See #8056, #8352, #8376. Part of #4208. Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…t on FT-01..05 (guard #8352) (#8389) Storage-format migration (not re-estimation): legacy `---`-YAML frontmatter in cell#0 (title + cost{...} + notes) -> nb.metadata['cost'] (canonical JSON, schema #8376 / docs/notebook-metadata/cost-matrix.md). Values preserved VERBATIM. - `title` dropped (redondant with H1 heading, kept as cell#0 first line). - top-level `notes:` merged into cost.notes (per #8376 design-gate). - YAML `null` literals -> JSON null (free_alternative, reduced_pedagogical). - 0 code cells modified (C.2 N/A) -- only cell#0 markdown source + nb.metadata. These 5 FineTuning notebooks are GPU-gated (LoRA/QLoRA/DPO fine-tuning); last_validated / validator preserved verbatim (format migration, not re-execution). Validation (post-fix, firsthand): - check_cost_metadata.py: cost_source='metadata' x5 (canonical form). - detect_markdown_rendering.py --check: 'no new ERROR-level violations' (guard #8352 landmines cleared). - validate_pr_notebooks.py (H.3): 5/5 PASS, 58 code cells. - LF-only (CRLF=0 x5); byte-stable (diff scope = frontmatter removal + metadata.cost add only). See #8056 (partial: FineTuning tranche; GenAI/Texte=po-2023, QC-Py=po-2025, IIT=po-2023). Clears 5 of 128 repo-wide guard-#8352 landmines. Co-authored-by: Claude-Code <noreply@anthropic.com>
…ation+04-Applications (7 NBs, guard #8352) (#8393) Storage-format migration (not re-estimation): legacy ---YAML cell[1] frontmatter on 03-Orchestration/03-1..03-3 -> nb.metadata['cost'] (canonical JSON, schema #8376 / docs/notebook-metadata/cost-matrix.md). 04-Applications/04-1..04-4 never had YAML -> fresh metadata.cost insertion (inferred from cell[0] prose + code-cell inspection: API tokens, GPU usage). - 03-Orchestration (3): parse YAML cell[1] -> metadata.cost JSON, DELETE cell[1] (cell[1] was YAML-only). - 04-Applications (4): construct cost block from cell[0] self-disclosed VRAM + code-cell API/GPU detection. - top-level YAML title dropped (redondant with H1 cell[0], per #8376 design-gate). - top-level YAML notes merged into cost.notes. - 0 code cells modified (C.2 N/A, all assertions preserved verbatim). - 0 secret literal introduced (sk- scan: 0 hit on 7 files). Validation (post-fix, firsthand): - check_cost_metadata.py: cost_source='metadata' x7 (canonical form). - check_cost_metadata.py findings: 0 on 7 (no litmus violation). - validate_pr_notebooks.py (H.3): 7/7 PASS (15+13+12+13+13+13+14 = 93 code cells). - LF-only (CR=0) on all 7 files; trailing newline preserved. - detect_solution_leaks.py: 0 HIGH / 0 MEDIUM / 0 errors on 7. - byte-identity guard on cell sources other than the YAML cell[1] deletion. - 7 files changed, +119/-24 (strict, scoped to cost frontmatter). See #8056 (partial: GenAI/Video tranche; GenAI/Image+Audio=IIT=FT=Texte=SW=SL already migrated by jsboige, Quality=other workers). Part of #4208. Co-authored-by: jsboige <jsboige@gmail.com>
…cost (#8394) Move the cell0 `---`-YAML cost block into `nb.metadata['cost']` (JSON), the canonical storage location established by #8376 (check_cost_metadata reads metadata.cost first) and #8323 (Infer-3 reference schema). Storage-format migration, values VERBATIM (not re-estimated): the 11 fields present in the frontmatter (api_usd_est, api_provider, cpu_min, gpu_required, network, external_account, free_alternative, reduced_pedagogical, reproducibility, last_validated, validator) are moved as-is. The redundant `title:` field is dropped (the descriptive H1 is kept). This clears the markdown-rendering guard (#8352): the leading `---` block was flagged as a YAML/setext rendering violation. Removing it (H1 now leads cell0) yields a clean notebook. Scope: 0 code cells modified (byte-stability verified — all 42 non-cell0 cells byte-identical). C.2 re-exec N/A (no code cell source touched). Validation: - check_cost_metadata.py: cost_source='metadata', findings empty, EXIT 0 - detect_markdown_rendering.py --check: "OK: no new ERROR-level violations", EXIT 0 - nbformat 4.5, 43 cells, 16 code cells, 0 H.3-violators (exec_count None) See #8056 (matrice cout/ressource par notebook, OPEN epic). DecInfer-1 was the only DecInfer notebook still carrying legacy frontmatter on origin/main. Co-authored-by: Claude <noreply@anthropic.com>
…ontmatter -> metadata.cost (#8403) Storage-format migration (guard #8352 HARD-CI): move cell#0 `---`-YAML cost frontmatter to invisible `nb.metadata['cost']` (canonical schema #8376). 7 notebooks: PT_01..PT_07 (GenAI/PostTraining). Values preserved VERBATIM (not re-estimated). title dropped (redundant H1). top-level `notes:` merged INTO cost.notes. YAML `null` -> JSON `null`. 0 code cells modified (C.2 N/A — markdown + metadata only). Context: #8303 (po-2023, merged 2026-07-24T08:06) added +22 lines of `---`-YAML frontmatter to these 7 PT_nb pre-#8352-guard. Now that guard #8352 makes `---`-YAML a rendering defect (setext-H2 supersize), this tranche migrates them to the canonical metadata form. Validated (all post-fix): - check_cost_metadata.py: cost_source='metadata' (7/7) - detect_markdown_rendering.py --check: 0 of my 7 PT_nb in FAIL list (the 181 pre-existing violations are other GenAI families: next tranches) - validate_pr_notebooks H.3: PASS (7/7, 75 code cells, all source+outputs +execution_count byte-identical to origin/main) - diff scope: frontmatter-block removal + metadata.cost add only (+119/-160) - LF-only, surgical (no CRLF churn — bytes stable) See #8056 (partial tranche, not Closes — epic in progress) Co-authored-by: Claude-Code <noreply@anthropic.com>
…t on Claude-Code 01-05 (guard #8352) (#8410) Storage-format migration (not re-estimation): legacy `---`-YAML frontmatter in cell#0 (title + cost{...} + notes) -> nb.metadata['cost'] (canonical JSON, schema #8376). Values preserved VERBATIM. - `title` dropped (redundant with the H1 that follows the frontmatter in cell#0). - top-level `notes:` merged into cost.notes (per #8376 design-gate, cf FT-01 #8389). - YAML literals preserved as-is (free_alternative=path string, reduced_pedagogical=string, vram_tier=LITE, last_validated="2026-07-24" string not date-parsed). - 0 code cells modified (C.2 N/A) -- only cell#0 markdown source + nb.metadata. Validation (post-fix, firsthand — verbatim-forensic c.713/c.714 discipline): - Exhaustive ORIG-vs-NEW all-fields diff: 75/75 fields match VERBATIM (0 violations). None of the 3 systematic-migration telltales (free_alternative nulled, vram_tier NONE->LITE, reduced_pedagogical nulled) — all 5 notebooks had real values (free_alternative=Claudish path, reduced_pedagogical=SIMULATION_MODE string, vram_tier=LITE) preserved. - detect_markdown_rendering.py: 0 findings on the 5 (guard #8352 landmines cleared). - validate_pr_notebooks.py (H.3): 5/5 PASS, 60 code cells. - LF-only (CRLF=0 x5, matches .gitattributes eol=lf + FT-01 canonical); byte-stable cells[1:] (diff scope = frontmatter removal + metadata.cost add only). See #8056 (partial: GenAI/Vibe-Coding/Claude-Code tranche; prior: FineTuning=#8389, GenAI/Texte=po-2024, PostTraining=po-2024, QC-Py=po-2025, DecInfer=po-2026). Clears 5 of 128 repo-wide guard-#8352 landmines. Co-authored-by: Claude-Code <noreply@anthropic.com>
…adata.cost (guard #8352) (#8418) Delete the cell[1] `---`-YAML cost frontmatter block on the 5 GenAI/Image 01-Foundation notebooks and move it into `nb.metadata['cost']` (JSON), the canonical storage location established by #8376 (check_cost_metadata reads metadata.cost first) and #8323 (Infer-3 reference schema). These 5 notebooks carry the cost frontmatter in its OWN cell (cell[1]), pure-FM (0 chars after closing `---`); cell[0] is the canonical H1/nav/intro. The frontmatter at cell#1 is flagged by guard #8352 as `frontmatter_supersize` (markdown-it promotes it to a setext-H2 supersize rendering defect). Deleting the pure-FM cell[1] and setting metadata.cost clears the guard. Storage-format migration, values VERBATIM (manual YAML parse via migrate_cost.parse_frontmatter -- NO yaml.safe_load, so `last_validated: 2026-07-23T01:30Z` stays a STRING, no timestamp coercion). The 14 cost fields are moved as-is; the redundant `title:` is dropped (cell#0 H1 is the title). Top-level `notes:` merged INTO `cost.notes` (#8376 design gate). Scope: 0 code cells modified (byte-stability verified -- exhaustive ORIG-vs-NEW diff via `git show HEAD:path` proves all 25-31 kept cells per NB are byte- identical in source/execution_count/outputs/cell_type). C.2 re-exec N/A (no code cell source touched). Cell-id state preserved (orig had 2 no-id cells, new has 1 -- the deleted FM cell was one of them; pre-existing, not a regression). The 3 cost-migration telltales (the systematic-bug class found c.713/c.714: free_alternative nulling, vram_tier NONE->LITE, reduced_pedagogical nulling) are preserved VERBATIM with their per-NB variation intact: - 01-1, 01-2: free_alternative=path(01-4), reduced_pedagogical=path(01-3), vram_tier=LITE - 01-3: free_alternative='N/A', reduced_pedagogical='N/A', vram_tier=LITE - 01-4: free_alternative=null, reduced_pedagogical=path(01-3), vram_tier=LITE - 01-5: free_alternative=null, reduced_pedagogical=path(01-4), vram_tier=MID Validation (canonical, all post-migration): - detect_markdown_rendering.py --check: "OK: no new ERROR-level violations", EXIT 0 - check_cost_metadata.py: cost_source='metadata' (5/5), findings empty - H.3: 0 code cells with execution_count=None (all 5 notebooks fully executed) - LF-only (CRLF=0 across all 5) - guard #8352 landmines cleared: 5 Advances #8056 (cost/ressource matrix per notebook). Sub-tranche of the GenAI/ Image family (20 total cell#1-FM landmines on origin/main -- this PR clears 01-Foundation 5; 02-Advanced/03-Orchestration/04-Applications/examples 15 remain for follow-up tranches). Co-authored-by: Claude-Code <noreply@anthropic.com>
…L-Cours (9 NB) (#8419) EPIC #8056. Migrate the 9 DataScienceWithAgents/02-ML-Cours notebooks (2.1-2.9) from top-level YAML frontmatter to canonical nb.metadata['cost'] JSON. Verbatim-forensic discipline (c.887-c.890): 135/135 cost fields match ORIG, 0 violations of the 3 systematic-migration telltales that bit #8397/#8400: - free_alternative: 'self' (string, preserved — NOT nulled) - reduced_pedagogical: 'self' (string, preserved — NOT nulled) - api_provider/external_account: 'none' (string, preserved — NOT nulled) - vram_tier: 'LITE' (preserved verbatim — NOT normalized NONE<->LITE) Independent ORIG-vs-NEW all-fields forensic: 135 fields, 0 mismatches. Structure (verified): cell[0]=prose title, cell[1]=STANDALONE frontmatter cell (pure ---YAML---, no prose after). Convention (merged ML-1 #8400 verified): standalone FM cell -> DELETE after extracting cost -> metadata.cost. Cell count -1 per NB. title dropped (canonical convention, #8397/#8400 exemplars). notes merged into cost.notes (#8376 design-gate). Validation: - notebook_tools validate --quick: 9/9 OK, 0 warnings - guard #8352 (detect_markdown_rendering --check): OK, no new violations (9 frontmatter_supersize landmines cleared) - round-trip byte-identity json.dumps(indent=1) verified pre-edit; LF preserved (0 CRLF); diff = +153/-255 (pure FM-cell deletion + metadata.cost addition) - catalogue byte-identical to main (0 churn) See #8056 (partial: ML 02-ML-Cours tranche migrated). See #8352. Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…B (Lab1-7) Addresses CHANGES_REQUESTED by po-2026 c.724 on #8438 (DSWA cost-mig, 19 NB). Root cause (verified firsthand G.1): my migrate script built metadata.cost via `cost_new[k] = parsed[k]` at top-level (designed for Pattern C col-0 flatten). For the 7 Track1-LangChain NB whose cell#1 FM nests cost under a YAML `cost:` block (indented Pattern B), the 14 canonical fields live at `parsed['cost'][k]`, not `parsed[k]` -> all resolved None -> absent. Only top-level `notes` survived. Result: metadata.cost = {"notes": ...} alone -> 98 fields lost (14 x 7 NB). Fix: reconstitute metadata.cost VERBATIM from each ORIG indented FM (git show origin/main:<nb>), parsed with NoTimestampLoader (preserves 'none'->str, 'self'->str, 'LITE'->str, timestamps->str). Top-level `notes` merged into cost.notes (#8376 design-gate, matches the surviving NEW value). cell#1 FM stays deleted (canonical convention). Verified (exhaustive, value-by-value): - 14 canonical fields VERBATIM ORIG==NEW on all 7 NB (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) - telltales preserved (NOT nulled/normalized): free_alternative='self'/'ollama', reduced_pedagogical='self'/'gpt-3.5-turbo', vram_tier='LITE', api_provider='none'/'openai' - 0 code churn (code-cell sha1 ORIG==NEW, 8/8 8/8 6/6 12/12 10/10 9/9 10/10) - notes-merged-ok (top-level ORIG == cost.notes NEW) - diff: +98/-0 (14 fields x 7 NB, pure field restoration) - 11 col-0 NB untouched (Pattern C, already correct) - JSON valid, CRLF=0 (LF preserved), round-trip byte-identity OK pre-edit The remaining 11/19 NB (Lab8-17 col-0 + NumPy + Pandas) were already correct (verified clean in c.724) and are not re-touched (idempotent fix). See #8056 See #8438 Co-Authored-By: Claude-Code <noreply@anthropic.com>
…k1+Track2+01-PythonDS (19 NB) (#8438) * fix(ml,#8056): migrate cost frontmatter -> metadata.cost on DSWA Track1+Track2+01-PythonDS (19 NB) Structural move ONLY (L-887 verbatim-forensic, mirror c.876b/c.897/c.8419): - cell[1] YAML FM deleted (Pattern C c.828/c.827 — standalone FM with prose after) - metadata.cost JSON added (14 canonical fields + notes) - 187/187 fields verbatim match (forensic Round-trip OCR, 0 mismatches) L930 telltale handled: c.828 YAML FM has 'cost:' at col 0 with un-indented fields, PyYAML flattens 14 fields at top level (cost: None) — script reconstructs cost dict. 0 factual corrections: 'self'/'LITE'/'ollama' strings preserved verbatim, no mapping NONE->LITE / 'self'->None. See #8056 (epic costfm migration, partial: DSWA slice) Co-Authored-By: Claude-Code <noreply@anthropic.com> * fix(ml,#8438): reconstitute 14 dropped cost fields on 7 indented-FM NB (Lab1-7) Addresses CHANGES_REQUESTED by po-2026 c.724 on #8438 (DSWA cost-mig, 19 NB). Root cause (verified firsthand G.1): my migrate script built metadata.cost via `cost_new[k] = parsed[k]` at top-level (designed for Pattern C col-0 flatten). For the 7 Track1-LangChain NB whose cell#1 FM nests cost under a YAML `cost:` block (indented Pattern B), the 14 canonical fields live at `parsed['cost'][k]`, not `parsed[k]` -> all resolved None -> absent. Only top-level `notes` survived. Result: metadata.cost = {"notes": ...} alone -> 98 fields lost (14 x 7 NB). Fix: reconstitute metadata.cost VERBATIM from each ORIG indented FM (git show origin/main:<nb>), parsed with NoTimestampLoader (preserves 'none'->str, 'self'->str, 'LITE'->str, timestamps->str). Top-level `notes` merged into cost.notes (#8376 design-gate, matches the surviving NEW value). cell#1 FM stays deleted (canonical convention). Verified (exhaustive, value-by-value): - 14 canonical fields VERBATIM ORIG==NEW on all 7 NB (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) - telltales preserved (NOT nulled/normalized): free_alternative='self'/'ollama', reduced_pedagogical='self'/'gpt-3.5-turbo', vram_tier='LITE', api_provider='none'/'openai' - 0 code churn (code-cell sha1 ORIG==NEW, 8/8 8/8 6/6 12/12 10/10 9/9 10/10) - notes-merged-ok (top-level ORIG == cost.notes NEW) - diff: +98/-0 (14 fields x 7 NB, pure field restoration) - 11 col-0 NB untouched (Pattern C, already correct) - JSON valid, CRLF=0 (LF preserved), round-trip byte-identity OK pre-edit The remaining 11/19 NB (Lab8-17 col-0 + NumPy + Pandas) were already correct (verified clean in c.724) and are not re-touched (idempotent fix). See #8056 See #8438 Co-Authored-By: Claude-Code <noreply@anthropic.com> --------- Co-authored-by: jsboige <jsboige@gmail.com> Co-authored-by: Claude-Code <noreply@anthropic.com>
…ute tokens (#8587) Verifie firsthand : 13 lignes ajoutees dans les .ipynb, 0 supprimee, **0 touche a execution_count / outputs / source** — metadonnee pure, donc pas de re-exec requise (C.2/H.3 sans objet). La derivation est documentee et honnetement qualifiee (~70 QCC/cellule code, plancher max(400, n*70), sourcee a l'acceptance #8056) avec la mention explicite « c'est une estimation, pas une mesure — reestimer apres une execution QC Cloud reelle ». Le suffixe _est porte la meme honnetete dans le nom du champ.
Summary
PR A (surrogate for po-2025, intermittent ~1 week, per ai-01 DM dispatch c.877) — canonicalize the
#8056cost-matrix storage form tonb.metadata['cost'](JSON), retiring the----YAML markdown cell from the mandate.Two coupled changes (one subject: the canonical-form pivot):
1.
scripts/audit/check_cost_metadata.py— metadata-first readercheck_notebook()now readsnb.metadata['cost']FIRST (canonical form), falling back to the markdown cell-scan (^---...---) in backward-compat for notebooks not yet migrated. Adds acost_sourceprovenance field ('metadata'|'markdown_cell'|None) to the result dict + YAML output.Both forms coexist during the mass migration (rollout by family tranches); the read order is non-bloquant.
2.
docs/notebook-metadata/cost-matrix.md— canonical form documentedRewrites the schema section: canonical =
metadata['cost']JSON (invisible to markdown render). The----YAML cell is RETIRED from the mandate — markdown-it promotes it to setext-H2 supersize, which guard#8352blocks as ERROR. Other updates:titlefield (H1 of the notebook suffices).metadata['cost'].#8052litmus + acceptance criterion 1 + sortie-attendue references refreshed.Exemplar of the canonical form: #8323 (Infer-3/4
metadata.cost).Validation (post-rebase onto
502daf882)Parser — 5 tests, all PASS:
cost_source: 'metadata'✅cost_source: 'metadata'✅----cell backward-compatcost_source: 'markdown_cell'✅cost_meta_found: False, cost_source: None✅free_alternative_missingMAJOR detected ✅py_compileclean).Bonus catch (out of scope here): T5 surfaces a real data defect — Audio 01-1's
free_alternative: '01-5-Kokoro-TTS-Local'points to an absent file. The validator works as intended; the fix belongs in a separate data PR (PR C tranche), not this tooling/doc PR.Scope
Surrogate for po-2025 on
#8056PR A. Partial contribution to the open epic — does not close it (mass migration of ~100 notebooks is PR C, distributed by family tranches across lanes).See #8056. Part of #4208.
🤖 Generated with Claude Code