From 5e3c3706852c3b65b84b6649b4bf58f6de632304 Mon Sep 17 00:00:00 2001 From: jsboige Date: Wed, 23 Sep 2026 07:24:08 +0200 Subject: [PATCH] test(ci,#16762): pin the two reading guards post TRANCHE13/14 dedupe Tests offered by po-2023 alongside their TRANCHE13-collision fix (commit 40c1336d1a on fix/17031-tranche13-collision) : the merged #17485 took the registry rename, these regression controls stayed behind. They pin the exact guard names of TRANCHE13 (reading-anchor) and TRANCHE14 (split-reading-cells) so a future silent redefinition turns red instead of making a guard disappear. Ratchet tranche (#12811) : touching test_fast_lane.py pulls its two pre-existing text=True-without-encoding subprocess calls into the diff gate -- both self-test calls now set encoding="utf-8", errors="replace" as the gate instructs. Grain: LIGHT/ci -- lane myia-po-2026:CoursIA -- prev: DEEP/lean #16968 Co-Authored-By: Claude Sonnet 5 --- scripts/tests/test_fast_lane.py | 36 ++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/scripts/tests/test_fast_lane.py b/scripts/tests/test_fast_lane.py index 2d7b39a3a3..ec6b1e71fd 100644 --- a/scripts/tests/test_fast_lane.py +++ b/scripts/tests/test_fast_lane.py @@ -32,7 +32,7 @@ import fast_lane # noqa: E402 from fast_lane_registry import ( # noqa: E402 FAST_LANE_NATIVE, PILOT, TRANCHE1, TRANCHE2, TRANCHE3, TRANCHE4, - TRANCHE5, TRANCHE8, TRANCHE12, TRANCHE13, Guard, + TRANCHE5, TRANCHE8, TRANCHE12, TRANCHE13, TRANCHE14, Guard, ) @@ -1196,6 +1196,7 @@ def test_tranche5_identity_byte_check_passes(): r = _sp.run( ["python", "scripts/ci/check_absorbed_check_run_identity.py", "--check"], capture_output=True, text=True, cwd=Path(__file__).resolve().parents[2], + encoding="utf-8", errors="replace", ) assert r.returncode == 0, ( f"identity byte-check a echoue (rc={r.returncode}) : \n" @@ -1292,6 +1293,39 @@ def test_tranche13_reading_anchor_advisory_guard_is_wired(): r = subprocess.run( ["python", "scripts/notebook_tools/check_reading_anchor.py", "--self-test"], capture_output=True, text=True, cwd=Path(__file__).resolve().parents[2], + encoding="utf-8", errors="replace", ) assert r.returncode == 0, f"self-test du detecteur en echec : {r.stdout}" assert "positif" in r.stdout and "PASS" in r.stdout + + +def test_tranche14_split_reading_guard_is_wired(): + """Tranche 14 = garde split-reading-cells (#16762/#17031), advisory. + + Cable a l'origine comme deuxieme TRANCHE13, il ecrasait silencieusement + le garde reading-anchor de #16704 (redefinition Python) : le postieur + cede l'index (cf. registre, commentaire TRANCHE14). + """ + assert len(TRANCHE14) == 1 + guard = TRANCHE14[0] + assert guard.name == "Split-reading-cells advisory (per-notebook, non-blocking)" + assert not guard.blocking, "advisory : signale les paires scindees, ne rougit jamais" + assert guard.absorbed, f"{guard.name} doit porter absorbed=True" + assert guard.iterates_paths + assert "--json" in guard.argv and "--fail-on-findings" in guard.argv + + +def test_both_reading_guards_alive_after_tranche14_split(): + """Controle du bug de collision : les DEUX gardes vivent dans DEUX tranches. + + La redefinition silencieuse de TRANCHE13 par #17031 faisait disparaitre + reading-anchor du registre sans aucun message (le nom pointait sur la + seule liste split-reading). Ce controle aurait ete rouge le jour du + merge : il epingle les DEUX noms, distincts, un garde par tranche. + """ + assert len(TRANCHE13) == 1 and len(TRANCHE14) == 1 + assert TRANCHE13[0].name != TRANCHE14[0].name + assert {g.name for g in TRANCHE13 + TRANCHE14} == { + "Reading-anchor advisory (lecture sans output, #16695)", + "Split-reading-cells advisory (per-notebook, non-blocking)", + }