Skip to content

fix(search,#8428): remove CJK 胜利 residue from App-12-ConnectFour cell[41] docstring - #8527

Closed
jsboige wants to merge 1 commit into
mainfrom
fix/lean11-cjk-8428
Closed

jsboige wants to merge 1 commit into
mainfrom
fix/lean11-cjk-8428

Conversation

@jsboige

@jsboige jsboige commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the last executable CJK LLM-translation residue from the fleet-wide #8428 sweep: 胜利=1 (Chinese "victory=1") inside a code-cell docstring in Search/Applications/Search/App-12-ConnectFour.ipynb cell[41] (AIMA Game framework).

- """Utilite de l'etat pour le joueur (胜利=1, defeat=-1, draw=0)."""
+ """Utilite de l'etat pour le joueur (victoire=1, defeat=-1, draw=0)."""

胜利 (shènglì = victory) → victoire, matching the surrounding French prose (Utilite, etat, joueur).

Fleet status (firsthand, fresh origin/main @03c797621)

A fresh full-fleet CJK scan ([\u4e00-\u9fff] across MyIA.AI.Notebooks/**/*.ipynb, excluding the legit JP 02-8-Expressive-TTS demo) found only 4 glyphs in 2 notebooks remaining fleet-wide — the #8428 inventory was stale (most entries already fixed by #8426/#8433). The 2 residuals:

Notebook Cell Glyphs Type Status
Search/Applications/Search/App-12-ConnectFour.ipynb cell[41] 胜利 code-cell docstring FIXED here
QuantConnect/Python/QC-Py-Cloud-03-Risk-Parity.ipynb cell[14] 简化 code comment residual (QuantBook, QC-Cloud-gated — cannot re-exec locally, cf #6891/#7575)

Fix + C.2 re-exec (per #8428)

#8428 fix-pattern point 2: code-cell CJK requires re-exec (not the markdown-only C.2 exception). Re-executed end-to-end via papermill (kernel python3, 59/59 cells, 6m05s, 0 errors):

  • Source change is surgical: ONLY cell[41] docstring (胜利→victoire). Verified programmatically — 0 source diffs in the other 58 cells (papermill preserved source).
  • Outputs refreshed: stochastic game-AI cells (MCTS 1000-iter, tournament 5-IA, minimax depth-comparison, ID-AB benchmark) regenerated with this run's outputs. Non-deterministic (random draws) — any valid run is C.2-acceptable; spot-checked all sensible (MCTS wins, tournament completes, benchmark ID-AB 3/3 victoires).
  • ec: 1..22 sequential, 0 null-ec code cells (H.3 PASS).
  • papermill metadata: input_path/output_path normalized to the relative notebook path (matching origin/main convention) — no temp-path leak.

Validation

  • EXEC_PROVED (§D): papermill end-to-end, 0 errors, all 22 code cells execution_count 1..22 + coherent outputs.
  • C.1: 0 violations (the docstring 1/-1/0 utility-value prose is a false positive for a 1/0 division check — it is descriptive text inside a docstring, not runtime arithmetic).
  • H.3: PASS (no code cell with ec=None + empty outputs).
  • Byte-stable: json.dumps(indent=1) raw-bytes LF write (matches origin/main: 0 CRLF, trailing newline); round-trip verified.
  • Secrets: 0 inline tokens.
  • CJK post-fix: 0 glyphs in sources (verified).

Scope

See #8428 · See #8364

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

…[41] docstring

Last executable CJK residual from fleet-wide #8428 sweep. Fresh fleet scan
(origin/main @03c797621) found only 4 glyphs in 2 notebooks; the other
(QC-Py-Cloud-03 简化) is QuantBook/QC-Cloud-gated.

cell[41] AIMA Game docstring: 胜利=1 -> victoire=1 (matches surrounding
French prose). Code-cell change -> end-to-end papermill re-exec per #8428
(59/59 cells, 0 errors, ec 1..22). Source surgical: only cell[41] docstring
changed; stochastic game-AI outputs refreshed. EXEC_PROVED.

See #8428, #8364

Co-Authored-By: Claude-Code <noreply@anthropic.com>
@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 6.0s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 4.3s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.0s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 5.0s
Search-1-StateSpace.ipynb ✅ SUCCESS 4.1s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 3.1s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 27.5s
GameTheory-4c-NashExistence-Python.ipynb ✅ SUCCESS 3.7s

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

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

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

@jsboige

jsboige commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as duplicate of #8523 (po-2026, MERGED 12:08:17Z) — which fixed the identical 胜利→victoire in the identical cell[41] docstring ~30 min before I created this PR.

My collision guard failed: I searched gh pr list --search "Lean-11-TorchLean CJK" and --search "8428" but did not search the notebook name App-12-ConnectFour — so I missed po-2026's already-OPEN #8523. Lesson: the collision guard must search by the notebook/file name, not just the issue number (the #8428 inventory lists many notebooks; each is an independent claim surface).

po-2026's #8523 (+1/−1) is the better fix and the cluster should merge that approach, not this one:

  • A docstring is non-executable prose — it does not affect runtime output. The C.2 "markdown-only exception" applies (outputs unaffected by the edit), so no re-exec is required.
  • My +341/−37 (full papermill re-exec, refreshing stochastic MCTS/tournament/benchmark outputs) was over-engineering — it churns non-deterministic outputs unnecessarily and violates "solution la plus simple pour un problème simple". The docstring-only surgical edit is correct.
  • I over-interpreted [RESCOPE] Residus CJK notebooks : 1 seul reel (QC-Py-Cloud-03, 2 glyphes) — 54/56 = contenu legitime, detecteur aveugle au contenu #8428 fix-pattern §2 ("code-comment instances → need re-exec") as applying to docstrings; a docstring is closer to a comment than to executable code, and re-exec added no value.

Closing this PR. The fix is delivered via #8523 (already merged). No action needed on #8527.

See #8428, #8523.

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

@jsboige jsboige closed this Jul 25, 2026
@jsboige
jsboige deleted the fix/lean11-cjk-8428 branch July 25, 2026 12:43
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