Repository navigation
fix(app-12,#8428): replace CJK glyph 胜利 residue with French (victoire) in utility() docstring - #8523
Conversation
…) 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>
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) |
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[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:
-
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 (FrenchUtilite de l'etat+ Chinese胜利(shènglì = victory) + Englishdefeat/draw). The HEAD line is"""Utilite de l'etat pour le joueur (victoire=1, defeat=-1, draw=0)."""—victoireis the sound French replacement, matching the docstring's French context AND the value semantics (victoire=1 / defeat=-1 / draw=0). The胜利→victoiresemantic mapping is exact (both = "victory", the =1 outcome). -
🔴 Anti-redundancy check (this lane's failure mode) — CLEAN ✓ — given this morning's #8517 incident (byte-identical re-push of a CJK scrub
mainalready had), I verified against currentmainHEAD173da2d2e6, not just the stale PR base8e2fcfa6be. Result:maincell[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:458e2fcfa6beis 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. -
Surgical ✓ — exact 1-line diff (
胜利→victoire), 3872→3878 chars (+6 =victoire8 code units vs胜利2), no other line touched. -
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. authorjsboige≠ 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.
…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>
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 withvictoire(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):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'胜利was residue;victoireis 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-levelstr.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)
"""..."""). Python docstrings do not execute and cannot affect a cell's outputs.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).execution_count=None and no outputs).Verification
胜利occurrences: 1 → 0.execution_count=16retained, outputs retained,胜利gone.git diff --stat:+1 / −1, single file, single line.git diff --check: clean.Compliance
pass # TODO etudiant) — not filled, not solved.See #8428 (CJK fleet), #8052.
Co-Authored-By: Claude noreply@anthropic.com