Skip to content

fix(genai-texte,#8056): migrate cost frontmatter -> metadata.cost on notebooks 11-20 (guard #8352) - #8385

Merged
jsboige merged 1 commit into
mainfrom
feature/genai-texte-cost-frontmatter-prD-8056
Jul 24, 2026
Merged

jsboige merged 1 commit into
mainfrom
feature/genai-texte-cost-frontmatter-prD-8056

Conversation

@myia-po-2023

Copy link
Copy Markdown
Collaborator

Grain: MED/genai-texte-cost-frontmatter-migration-tranche2 — lane myia-po-2023:CoursIA — prev: c.880/#8384 (tranche 1, nb 1-9) — continues #8056 PR C rollout

fix(genai-texte,#8056): migrate cost frontmatter → metadata.cost on GenAI/Texte 11-20 (guard #8352)

Scope

Tranche 2 of the GenAI/Texte cost-frontmatter migration. Direct continuation of #8384 (tranche 1, notebooks 1-9) + the merged #8376 design-gate. Covers the advanced GenAI/Texte series (notebooks 11-20). 10_LocalLlama is excluded (covered by the open #8378).

Same technique as #8384: each notebook had a legacy ----YAML cell#0 (title + cost + notes) flagged by guard #8352 as [frontmatter_supersize] ERROR-level (HARD-enforced in CI). This PR migrates cost: → nb.metadata['cost'] (invisible JSON), removes the ---...--- block, preserves the pedagogical title.

What changed (per notebook)

  • cost → metadata.cost: values migrated VERBATIM (storage-format migration, not re-estimation). nb11 (Quantization) has 15 cost keys (extra quant_method field preserved); the rest have 14.
  • Frontmatter block removed from cell#0.
  • Title preserved as H1:
    • Frontmatter-only cell#0 (11, 12): injected # <title> from the frontmatter title: field.
    • Pre-existing descriptive H1 after the frontmatter (13-20): kept the authored H1, no injection (no duplicate). E.g. nb13 keeps # 13. Orchestration agentique du test-time scaling (descriptive), not the short frontmatter label.
  • Top-level notes: merged into cost.notes.

Validation

  • Guard feat(ci): systematic markdown-rendering guard (frontmatter/setext + plural hint fix) #8352: detect_markdown_rendering.py --check --baseline on GenAI/Texte = OK, exit 0, no new ERROR-level violations.
  • Parser: check_cost_metadata.py reads each as canonical — cost_source: 'metadata' × 10, cost_meta_found: True × 10.
  • 0 code cells modified → no re-exec (rule C.2 N/A; metadata + markdown-only). Verified cell-by-cell against origin/main: code_changed == [] for all 10.
  • Byte-identity gate per-notebook (c.878 lesson); migrator ABORTs on any cells-churn. write_text(newline='') preserves LF (CRLF=0 confirmed).
  • H1 count = 1 per notebook (no duplicates).

Notes

  • Values are the committed estimates (authored under the appropriate RECOVERABLE-* verdict for each notebook — Quantization/OWUI/etc.). Re-estimation is a separate epic concern, out of scope.
  • GenAI has 0 registered twins → twin-parity N/A (collision-free).

Rebase note

Fresh worktree off origin/main (a10c94332). Catalogue untouched (byte-identical to main). Independent of #8384 (separate branch off main, not stacked).

See #8056 · See #8352 · See #8376 (design-gate) · See #8384 (tranche 1) · See #8378 (nb10) · Part of #4208

🤖 Generated with Claude Code

…notebooks 11-20 (guard #8352)

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: Claude-Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 10
  • Code cells validated: 114
  • 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 7.7s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 2.9s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 3.1s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 3.7s
Search-1-StateSpace.ipynb ✅ SUCCESS 4.3s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.2s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 15.7s
GameTheory-4c-NashExistence-Python.ipynb ✅ SUCCESS 2.8s

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

@jsboige
jsboige merged commit 185a00c into main Jul 24, 2026
30 checks passed
jsboige added a commit that referenced this pull request Jul 24, 2026
…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>
@jsboige
jsboige deleted the feature/genai-texte-cost-frontmatter-prD-8056 branch September 2, 2026 13:14
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.

2 participants