From a8804a7d10ba12aec5b151c465cc1d2bfd31f787 Mon Sep 17 00:00:00 2001 From: jsboige Date: Sat, 10 Oct 2026 11:05:51 +0200 Subject: [PATCH] Fix(ci,#20174): amputation tripwire + scanner C.2 emettant [] sur selection vide Deux angles morts reveles par le checkout ampute du run 38015702551 (PR #19814) : la garde NB_COUNT ne voyait que le zero absolu (2 probes scripts/ restees presentes), et check_c2_compliance.py imprimait la prose 'No notebooks to check.' en mode --json, tuant le desambiguiseur #14799 ('Expecting value: line 1 column 1'). - notebook-validation.yml : plancher 1000 carnets sous MyIA.AI.Notebooks/ (mesure 1516 sur main ; le corpus ne croit que) avant tout step aval. - check_c2_compliance.py : selection vide en --json -> '[]' rc=0, le contrat 'a completing run always prints its report' tient. Contre-preuve locale : scanner sain sur arbre complet (1376/1376 entrees catalogue, rc=0) ; le rouge etait purement l'arbre ampute. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/notebook-validation.yml | 14 ++++++++++++++ scripts/notebook_tools/check_c2_compliance.py | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/notebook-validation.yml b/.github/workflows/notebook-validation.yml index f9a86e6718..6f73a8ccce 100644 --- a/.github/workflows/notebook-validation.yml +++ b/.github/workflows/notebook-validation.yml @@ -82,6 +82,20 @@ jobs: exit 1 fi + # Amputation tripwire (#20174): the ZERO guard above is not enough. + # A sparse-checkout residue can leave a handful of stray .ipynb + # OUTSIDE the notebook tree (measured 2026-10-10, run 38015702551 on + # PR #19814: exactly 2 probe notebooks under scripts/notebook_tools/, + # zero under MyIA.AI.Notebooks/ out of 1516) — NB_COUNT stays > 0, + # the guard stays silent, and the C.2 catalog filter downstream then + # matches nothing. The corpus only grows, so 1000 is a floor far + # below the real count and far above any partial tree. + NB_TREE_COUNT=$(find MyIA.AI.Notebooks -name "*.ipynb" -not -path "*/.ipynb_checkpoints/*" -not -path "*/.*/*" | wc -l) + if [ "$NB_TREE_COUNT" -lt 1000 ]; then + echo "::error::MyIA.AI.Notebooks holds $NB_TREE_COUNT .ipynb (floor 1000, expected ~1500) — checkout amputated (sparse-checkout residue, #20174); NB_COUNT=$NB_COUNT across the whole tree" + exit 1 + fi + if [ $ERRORS -gt 0 ]; then echo "FAILED: $ERRORS notebook(s) with errors" exit 1 diff --git a/scripts/notebook_tools/check_c2_compliance.py b/scripts/notebook_tools/check_c2_compliance.py index 300eb0c318..fa4353cc16 100644 --- a/scripts/notebook_tools/check_c2_compliance.py +++ b/scripts/notebook_tools/check_c2_compliance.py @@ -312,6 +312,16 @@ def main(): targets = get_target_notebooks(args) if not targets: + # JSON mode is the workflow's crash/completion disambiguator (#14799): + # a completing run ALWAYS prints its report, and prose is not a report. + # An empty selection must surface as an empty JSON list, never as + # prose that kills the downstream parser ("Expecting value: line 1 + # column 1"). Measured instance (2026-10-10, run 38015702551): an + # amputated runner checkout (#20174) left zero notebooks under + # MyIA.AI.Notebooks/, so the catalog filter matched nothing. + if args.json: + print("[]") + return 0 print("No notebooks to check.") return 0