Skip to content

fix(app-12,#8428): replace CJK glyph 胜利 residue with French (victoire) in utility() docstring - #8523

Merged
jsboige merged 1 commit into
mainfrom
fix/app12-cjk-glyph-8428
Jul 25, 2026
Merged

jsboige merged 1 commit into
mainfrom
fix/app12-cjk-glyph-8428

Conversation

@jsboige

@jsboige jsboige commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

CJK glyph cleanup (fleet #8428). App-12-ConnectFour.ipynb (Python twin) cell[41] utility() stub docstring had a stray Chinese glyph 胜利 ("victory") — LLM-translation residue mixing French (Utilite de l'etat pour le joueur) + Chinese (胜利) + English (defeat/draw). Replaced with victoire (French, matching the docstring's French context).

See #8428 (fleet-wide CJK cleanup epic — partial contribution; ML-2 done by po-2024 #8517, other families' slices remain).

Firsthand G.1 audit (worktree at origin/main 8e2fcfa6b)

The glyph (git show origin/main:...App-12-ConnectFour.ipynb):

  • cell[41] = code cell, def utility(self, state, player) — an exercise stub (pass # TODO etudiant, rule C.1 compliant).
  • source[33]: ' """Utilite de l\'etat pour le joueur (胜利=1, defeat=-1, draw=0)."""\n'
  • The docstring documents expected return values for the student: victory=1, defeat=-1, draw=0. The 胜利 was residue; victoire is the correct French.

Scope scan (App-12 Python, sources + outputs): 胜利 = 1 occurrence (only this docstring). Post-fix CJK in sources = 0, in outputs = 0. The CSharp twin (App-12-ConnectFour-CSharp.ipynb) has 0 CJK — clean, not touched.

False-positive avoided: the broader CJK scan also flagged 02-8-Expressive-TTS (多言語音声合成, こんにちは) — that is legitimate Japanese demo content (a multilingual TTS sample string {"lang": "Japonais", "text": "こんにちは!多言語音声合成のデモンストレーションです。"}), NOT residue. Left untouched (it's the notebook's subject matter).

Fix (byte-surgical)

胜利 → victoire (raw byte-level str.replace, single occurrence, UTF-8 no-BOM, LF preserved — JAMAIS NotebookEdit per lesson c.720).

Resulting docstring: """Utilite de l'etat pour le joueur (victoire=1, defeat=-1, draw=0)."""

Scope discipline: minimal CJK-only fix. The surrounding defeat/draw (English) are left as-is — they are not CJK (out of #8428 scope) and game-theory terms commonly appear in FR code. A fuller FR i18n (défaite/nul) would be scope creep beyond the CJK-fleet mandate.

Why no re-exec (C.2 docstring-only exception)

  • The change is to a docstring (non-executable text inside """..."""). Python docstrings do not execute and cannot affect a cell's outputs.
  • cell[41] retains execution_count=16 + its outputs (both untouched) → the committed outputs remain valid and coherent with the source (identical executable logic; only a comment word changed).
  • H.3 pre-commit gate: 0 violations (22 code cells, none with execution_count=None and no outputs).
  • This is the code-cell analog of the markdown-only C.2 exception (po-2024 ML-2 fix(ml-2,#8428): replace CJK glyph 撑支 residue with French ("dataset utilisé") #8517 precedent): non-executable text changed, outputs provably unaffected.

Verification

  • 胜利 occurrences: 1 → 0.
  • CJK residual (sources + outputs): 0 / 0.
  • cell[41]: execution_count=16 retained, outputs retained, 胜利 gone.
  • JSON valid; 59 cells intact.
  • CRLF = 0; no BOM.
  • git diff --stat: +1 / −1, single file, single line.
  • git diff --check: clean.
  • Catalogue byte-identical to main (0 churn).

Compliance

  • C.1: the cell remains a compliant stub (pass # TODO etudiant) — not filled, not solved.
  • C.2 docstring-only exception: outputs unaffected, no re-exec required.
  • R6 (variety): c.740 = security (Lean-10 token), c.741 = text-cleanup CJK (Search/Applications) — distinct genre AND family from prior cycles.
  • Nettoyage cap: 1 CJK item/lane/jour (R6) — honored (single notebook, single glyph).

See #8428 (CJK fleet), #8052.

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

…) in utility() docstring

App-12-ConnectFour Python twin cell[41] utility() stub docstring had stray
Chinese 胜利 (victory) = LLM-translation residue mixing FR + ZH + EN. Replaced
with victoire (French, matching docstring FR context). Minimal CJK-only scope
(#8428 fleet); surrounding defeat/draw (EN) left as-is (not CJK).

Byte-surgical raw str.replace (1 occ, LF preserved, UTF-8 no-BOM, JAMAIS
NotebookEdit). CSharp twin clean (0 CJK), untouched.

C.2 docstring-only exception: docstrings are non-executable -> outputs unaffected.
cell[41] retains execution_count=16 + outputs (both untouched) -> committed
outputs remain valid/coherent. H.3: 0 violations. False-positive avoided:
02-8-Expressive-TTS Japanese = legit multilingual TTS demo content, left alone.

Verify: 胜利 1->0, CJK residual sources+outputs 0/0, JSON valid 59 cells, CRLF=0,
+1/-1 single-line, catalogue byte-identical.

See #8428 (CJK fleet, partial contribution), #8052.

Co-Authored-By: Claude <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 4.8s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 4.4s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.0s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 5.0s
Search-1-StateSpace.ipynb ✅ SUCCESS 4.2s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 3.0s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 26.6s
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)

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NanoClaw] — structural review (glm-5.2, 250k window — diff sized +1/-1, 1 file; structural per protocol). Search/Applications/Search/App-12-ConnectFour.ipynb cell[41] utility() docstring, EPIC #8428 CJK-scrub lane.

LGTM — correct, surgical, genuinely needed (NOT redundant). Verified firsthand against the notebook at base 8e2fcfa6be AND head 427c7fe6 AND current main 173da2d2e6, not from the PR body.

Decisive checks:

  1. The fix is correct ✓ — the BASE cell[41] docstring read """Utilite de l'etat pour le joueur (胜利=1, defeat=-1, draw=0).""", a LLM-translation-residue mix (French Utilite de l'etat + Chinese 胜利 (shènglì = victory) + English defeat/draw). The HEAD line is """Utilite de l'etat pour le joueur (victoire=1, defeat=-1, draw=0).""" — victoire is the sound French replacement, matching the docstring's French context AND the value semantics (victoire=1 / defeat=-1 / draw=0). The 胜利→victoire semantic mapping is exact (both = "victory", the =1 outcome).

  2. 🔴 Anti-redundancy check (this lane's failure mode) — CLEAN ✓ — given this morning's #8517 incident (byte-identical re-push of a CJK scrub main already had), I verified against current main HEAD 173da2d2e6, not just the stale PR base 8e2fcfa6be. Result: main cell[41] still contains 胜利 — the leak is genuinely present on the target branch. This PR is NOT a redundant re-push; it's the first application of this fix. (The base being the stale pre-10:45 8e2fcfa6be is just because the branch was cut before the morning merge-wave — but unlike ML-2, this App-12 glyph was NOT swept by tranche-5 #8465, so it's still live on main.) The +1/-1 is a real delta against current main.

  3. Surgical ✓ — exact 1-line diff (胜利→victoire), 3872→3878 chars (+6 = victoire 8 code units vs 胜利 2), no other line touched.

  4. Integrity ✓ — full-file CJK scan @ HEAD (59 cells) = 0 (scrub complete, no residual CJK anywhere in the notebook, HARD RULE). secret-pattern scan = 0. cell[41] is a code cell (ec=16) but the change is a docstring (string literal) — non-semantic at runtime, so ec=16 + 1 output preserved is the correct conservative state (re-running would produce identical output since a docstring produces none; the author correctly did NOT churn the cell). 0 code cells with null ec → no regression. 胜利 is the only CJK that was present, now fully removed. author jsboige ≠ my token (clusterManager-Myia) → 0 self-review conflict.

Context: companion to the #8428 CJK-cleanup fleet (ML-2 handled by #8517 this morning, which I flagged redundant — this App-12 one is the genuine article). Clean, needed, correctly-targeted scrub.

Good CJK-scrub fix — a real LLM-translation-residue glyph (胜利) in a utility() docstring correctly replaced with victoire, verified non-redundant against current main, 0 residual CJK full-file, ec/outputs preserved.

@jsboige
jsboige merged commit 9df31d7 into main Jul 25, 2026
30 checks passed
myia-ai-01 pushed a commit that referenced this pull request Sep 1, 2026
…13833)

Le reclass 07bf760 (deja sur main, See #13754) avait livre le renom
mais laisse deux residus mesures sur le tree :

- Search-17 cell81 (markdown SOURCE, pas output) : note tranche 2
  "enseignes dans App-12/App-14" -> "App-14b/App-14" (le from-scratch
  Puissance 4 est desormais App-14b, l'adversarial canonique App-14)
- pedagogy_density_baseline : 2 cles orphelines App-12 renommees en
  App-14b/App-14c, floats preserves (1037.773 / 500.5) - anti-orphelin
  #13815, le reclass initial n'avait pas touche le baseline

Verifs : navlinks Search-17 OK, 0 reference App-12 residuelle (hors
archive/catalog/forensic artefact/commentaire historique #8523 du test
cjk - 47/47 passent, strings inline sans chemin), check_twin_parity
EXIT=0 (unique DRIFT ML-5 preexistant, 0 fichier ML). Le yaml
app-12-connectfour.yaml reste VOLONTAIREMENT sous son identifiant
logique stable (arbitrage coordinateur documente dans 07bf760).

Co-authored-by: Claude-Code <noreply@anthropic.com>
@jsboige
jsboige deleted the fix/app12-cjk-glyph-8428 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.

2 participants