Repository navigation
feat(ci,#3801): SVG decimal-comma gate — wire #6959 detector as per-PR gate - #6965
Conversation
…R gate Per-PR gate mirroring cell-order-gate.yml: for every notebook changed by the PR, run scripts/notebook_tools/detect_svg_decimal_commas.py --check and FAIL if any commits an inline SVG with French decimal commas in coordinate attributes (renders broken on Chromium = GitHub/nbviewer). Absolute semantics (baseline main = 0 defects, validated at #6959 across 930 notebooks). Catches the #6946 defect class (Infer-17 Kalman, 1485 decimal-commas, 44-pt zigzag instead of 22) at CI time for the 21 sister #6927 rollout PRs. Root cause: C# :F1/:F2 culture-sensitive on fr-FR machines. Validated: TN #6946 merged Infer-17 = rc=0 (clean, InvariantCulture fix on main); TP synthetic broken notebook = rc=1 (gate FAILs with points-tokens/coord-attrs report + FIX). YAML parses (on: key matches cell-order canon under GitHub parser). See #3801 (EPIC SOTA axe-2). See #6927 (SVG inline rollout). See #6959 (detector). Co-Authored-By: Claude <noreply@anthropic.com>
|
[po-2024 forensics c.632 — PR OWN CI gate defense-in-depth de #6959] Forensics firsthand sur PR #6965 (branch Partition-mienne = leverage max. Je suis l'auteur de Anti-doublon first-mover : PR #6966 ( Substance canon LGTM:
Écarts mineurs (optionnels, non-bloquants) :
Verdict H.5 : Pattern OWNDOC dotable : ce gate est le 3ᵉ défense-in-depth dans la chaîne canon #6927 rollout (helper canon SvgChartHelper.cs #6942 + detector #6959 + gate #6965). Le détecteur transforme le finding vision-QA c.581/#6946 en gate mécanique ; ce PR câble la gate en CI sur chaque PR future. Conforme à sota-not-workaround.md Prong-A : vrai outil SOTA + cause-level fix + prevention tooling durable. Recommandation : merge. ★★ qualité partition-mienne (defense-in-depth de mon propre travail #6959), scope atomique workflow-only (1 file +117/-0, R1 catalog-pr-hygiene respecté), patterns cohérents avec canon. L632-L1 ★ NEW : defense-in-depth de son propre détecteur via CI gate = levier forensics max pour 1 PR workflow-only = — po-2024 forensics · c.632 · 2026-07-17 |
#6970) The canonical detector (#6959) only matched double-quoted SVG coordinate attributes (points="...", cx="..."). Single-quoted attrs are equally valid SVG, and some C# builders emit them: MGS-15 (#6960) uses <circle cx='{px:F1}'> -> cx='170,9' (single-quote). A decimal-comma bug in a single-quoted coord would BYPASS the #6965 CI gate entirely. Fix: _POINTS_RE and _COORD_ATTR_RE now accept either quote via a backreference ((["'])(.*?)\1), consumers read group(2) (the value). Minimal (9+/5- on the detector). Confirmed firsthand: single-quote cx='170,9' and points='70,0,334,4' now detected; double-quote unchanged. Add scripts/tests/test_detect_svg_decimal_commas.py (13 tests) covering the canonical API (detect_svg / detect_cell / scan_notebook): the two bug signatures, the Graphviz legit-integer NON-FP case, list-blob handling, file-level scan + error path. These tests revealed the single-quote gap (failing pre-fix), now green -- they lock both the detection and the fix. Repo-wide re-scan post-fix: 0 defects (0 new false positives -- clean SVGs use decimal-dot in either quote style, Graphviz uses double-quote + integer coords). Follows ai-01's close-as-duplicate guidance on #6968 ('reopen as a targeted PR testing the plural canonical detector'). Co-authored-by: Claude-Code <noreply@anthropic.com>
…ne helper-load (mirror #6978 canon) (#6990) * ci(notebook-tools,#6927): SVG empty-display gate — wire #6971 detector as per-PR gate Per-PR CI gate that runs scripts/notebook_tools/detect_svg_empty_display.py in --check mode on every notebook changed by the PR and FAILs if any cell commits an empty display (chart-display pattern in source + execution_count set + outputs==[] = white figure on GitHub/nbviewer). Why this gate (mirror of svg-decimal-comma-gate.yml #6965) ---------------------------------------------------------- The SVG inline rollout #6927 has TWO failure modes that both render as broken/blank on GitHub but require DIFFERENT detectors because they inspect different layers: 1. SVG emitted with French decimal commas (content defect) -> detect_svg_decimal_commas.py (#6959) parses SVG payload -> svg-decimal-comma-gate.yml (#6965) wires it as per-PR gate -> RENDERS BROKEN (zigzag, "Expected length" errors) 2. Cell commits an empty `outputs` list despite a chart-display pattern in source (pipeline defect) -> detect_svg_empty_display.py (#6971) inspects cell structure -> svg-empty-display-gate.yml (THIS PR) wires it as per-PR gate -> RENDERS BLANK (no SVG at all to parse) Both gates are NEEDED, neither is sufficient. PR #6963 (DecInfer-6, po-2025 fr-FR) committed 4 cells (29/35/45/49) with the empty-output defect. Both `svg-decimal-comma-gate` and `check_plotly_static_risk.py` passed (the SVG was never emitted, so there were no decimal-commas to find; the source had no Plotly-CDN script). Result: 4 white figures on GitHub, invisible to code review and structural validation. Detected by vision-QA only. This gate would have caught it pre-merge. Verification (mirror of #6965 methodology): - YAML parses cleanly (yaml.safe_load). - Detector CLI returns TN baseline 930/0 (matches #6971 claim). - Synthetic TP (cell with display(SvgChartHelper.Bar(...)) + exec_count set + outputs==[]) -> detector exit 1 (caught). - TN (clean notebook with real SVG output) -> detector exit 0. - Edge: missing file path -> detector exit 2 (handled as ::warning). - Workflow branch logic identical to svg-decimal-comma-gate.yml (`[ "$rc" -eq 1 ]` fail / `[ "$rc" -eq 2 ]` warn / `::notice` clean). Scope: - 1 file, +171/-0. - Workflow YAML static, no re-exec needed. - Mirror of svg-decimal-comma-gate.yml #6965 (same step sequence, same permissions, same per-PR diff scope, same exit-code handling). - Paths trigger: notebook changes + detector changes + gate changes. Closes gap in CI coverage for #6927 rollout: helper canon SvgChartHelper.cs + detector 1 (#6959) + gate 1 (#6965) + detector 2 (#6971) + gate 2 (this PR) = 5/5 chain complete. EPIC #3801 axe-2 SOTA enforcement. ai-01 explicit greenlight on CoursIA-2 dashboard 2026-07-17T04:52Z: "Follow-up po-2024 (ton next-step) : gate CI soeur #6971 (mirror #6965) = greenlight ta lane defense-in-depth." Co-Authored-By: Claude-Code <noreply@anthropic.com> * fix(notebook-tools,#6927,#6981): gate FIX-prose leads with cause-racine helper-load (mirror #6978 canon) ai-01 CHANGES_REQUESTED (review PRR_kwDOH2Odns8AAAABGVBAAg) sur #6981 : le mécanisme du gate (détection 3-condition, wiring mirror #6965) est correct et validé firsthand, MAIS le FIX-prose imprimé aux workers sur échec embarque la théorie §4 RÉFUTÉE (« make the chart the LAST EXPRESSION, drop display() »). Preuve firsthand : MERGED #6967 DecInfer-7 cell[32] utilise display() et capture le <svg> (26 outputs) ; display() ET last-expression rendent TOUS DEUX quand le helper est chargé. La vraie cause du vide = helper/Formatter non chargés (#load non résolu depuis cwd réel du nbclient, Formatter.Register jamais exécuté, SvgChartHelper.<chart> falls through à no-op). Cette PR est le miroir exact de la correction portée par #6978 (MERGED sur le détecteur detect_svg_empty_display.py docstring/FIX) appliquée au gate YAML : cohérence tool + gate avec le canon corrigé. Edits prose-only (1 file +15/-14, 0 logique) : 1. L28 « display()-vs-return pitfall » → « helper/Formatter-not-loaded pitfall (#load unresolved from exec cwd) » + cross-ref svg-6927-canon.md §4. 2. L62-80 « Fix (mirror ... point 1) » → « Fix (mirror ... §4 cause-racine helper-load) ». Suppression de « Make the chart the LAST EXPRESSION » comme fix (la cause-racine prime). Suppression de (C) « display() captures display_data only for SOME object types » (qui impliquait display-vs-). Conservation de (A) cwd-kernel et (B) Formatter.Register comme les deux vraies causes. Ajout preuve display() rend quand helper chargé (ref #6967). 3. L168 (le $GITHUB_STEP_SUMMARY réellement lu par un worker sur échec) « FIX: make the chart the LAST EXPRESSION ... (point 1) » → « FIX: the empty outputs list means the helper's Formatter.Register did NOT run in this exec — ... the discriminator is helper-load, NOT display-vs-expression. See svg-6927-canon.md §4 (cause-racine helper-load) and the detector docstring. » Wiring inchangé : 3 steps (checkout@v4 fetch-depth 0 / setup-python@v5 3.11 / gate inline), permissions contents:read, paths scope, branch logic (rc=1 ::error / rc=2 ::warning / else notice), stdlib-only deps detector. yaml.safe_load OK ; structure identique à svg-decimal-comma-gate.yml #6965. Validation : - YAML structure préservé (jobs=1 svg-empty-display, steps=3, first step actions/checkout@v4, last step Gate changed notebooks). - 0 occurrence de « LAST EXPRESSION » (grep -n verify). - « §4 / svg-6927-canon / Formatter.Register / helper-load » canon refs présentes L28, L64, L66, L71, L77, L80, L169. - Diff +15/-14 atomique sur 1 file (workflow YAML), 0 autre fichier touché. Pre-flight collision scan L539-L1 ★★★ : - origin/feature/c635-svg-empty-display-ci-gate (= PR #6981 base) ✓ - origin/feature/svg-empty-display-detector-3801 (= #6971 MERGED) ✓ - origin/feature/svg-emptydisplay-fixguidance (= PR tierce docstring FIX) ✓ - origin/docs/svg-6927-mergegate-readme (= PR tierce README sequence, NOUVELLE tierce : cible = docs/notebook_tools/*.md, pas workflow YAML = PAS COLLISION) - main a avancé dbe6df1..365486c (Heatmap #6982 + Infer-19 #6983 + Sudoku accents #6984 + Infer-18 #6985) — pas de conflit (workflow YAML indépendant du contenu notebooks). References : - Closes intent of CHANGES_REQUESTED PRR_kwDOH2Odns8AAAABGVBAAg (ai-01) - Mirror #6978 (MERGED detector docstring/FIX correction) - See #6967 (DecInfer-7 display() proof that helper-load is discriminator) - See #6971 (companion detector MERGED) --------- Co-authored-by: Claude-Code <noreply@anthropic.com>
What
New per-PR CI gate
.github/workflows/svg-decimal-comma-gate.ymlthat runs thedetect_svg_decimal_commas.pydetector (#6959, MERGED) on every notebook a PR changes, and FAILs if any commits an inline SVG with French decimal commas in coordinate attributes.This is the follow-up to #6959 — turning the one-off vision-QA forensic catch (c.581, #6946 Infer-17) into a deterministic merge-gate that prevents the defect class from reaching
mainagain.Why (the defect class)
Per the SVG spec, comma AND whitespace are both coordinate separators. On a fr-FR machine, C#
xp.ToString("F1")/:F1/:F2emit a comma instead of a dot. So:<polyline points="70,0,334,4 84,7,342,5">→ Chromium parses 4 numbers = 2 points (70,0)(334,4) instead of 1 point (70.0, 334.4) → chaotic zigzag (the fix(infer-17,#6927): Plotly CDN-script -> SVG inline (C548-L2 fix cell 1/22) #6946 Infer-17 chart: 22 intended points rendered as 44 zigzag points).<circle cx="70,0">→ console[ERROR] attribute cx: Expected length→ value dropped, defaults to 0.The PR's literal goal "render on GitHub/nbviewer" is then unmet even though the XML is well-formed and the code executes → invisible to code-forensics (4 forensics missed it on #6946), only caught by vision/render-QA.
All
po-*workers run fr-FR culture → any inline-SVG helper using:F*is at risk. This protects the 21 sister #6927 rollout PRs (Plotly-CDN→SVG inline fleet-wide).Design
cell-order-gate.yml(the canon per-PR notebook gate):paths:trigger on.ipynb+ the detector + the workflow itself;git diff base...head --name-onlyto find changed notebooks;::errorannotation +<details>in `` per defect;workflow_dispatchescape.maincarries 0 defects (validated at feat(notebook-tools,#3801): detect_svg_decimal_commas.py — flag SVG broken by French decimal commas #6959 across 930 notebooks), so any decimal-comma SVG in a changed notebook is a defect the PR introduces/carries and must be fixed before merge. (cell-orderuses regression semantics because it has many pre-existing legacy findings tracked under [EPIC] Skill + scanner d'enchainement de cellules — productioniser #2639 (glissements d'ordre canonique + oublis) #3240; the SVG detector has zero pre-existing findings, so the rationale for regression doesn't apply.)--checkmode (exit 1 on defect, exit 0 clean, exit 2 unreadable). No detector code change — pure CI wiring.Fix guidance (emitted in the gate output)
Force
InvariantCulturein the cell source (xp.ToString("F1", CultureInfo.InvariantCulture),FormattableString.Invariant(...), orCultureInfo.DefaultThreadCurrentCulture = InvariantCultureat cell top) then re-execute the .NET kernel — the committed output then carries dot-decimals. Or reuse the canonSvgChartHelper.cs(#6942, already uses InvariantCulture). Stop&Repair: fix the cause + re-execute, never scrub the output by hand.Validation
on:key matches cell-order canon under GitHub parser)rc=0clean (0 defects)points="70,0,334,4",cx="70,0")rc=1gate FAILs (points-tokens:2, coord-attrs:2+ FIX report)Scope
See #3801(EPIC SOTA axe-2 — prevention tooling).See #6927(SVG inline rollout — what this protects).See #6959(the detector). NotCloses— this is prevention infra for an open epic, not a full resolution.