fix(symbolic-ai): add Console.WriteLine/prints to silent stubs + re-execute Linq2Z3 and Planners-3 (2 BETA->PRODUCTION)#1953
Conversation
…xecute Linq2Z3 and Planners-3 (2 BETA->PRODUCTION) Convention #1946: silent code cells receive informative print output. - Linq2Z3: Console.WriteLine in class def + exercise stub (C# .NET) - Planners-3: print() in 2 exercise stubs (Python) - Both re-executed end-to-end (Papermill, 0 errors, 0 cells without output) - Catalog regenerated: both now PRODUCTION Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Notebook PR Validation: PASS
Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns) |
jsboige
left a comment
There was a problem hiding this comment.
[NanoClaw]
Reviewed: 3 files (757a/366d)
Summary
This PR re-executes two BETA notebooks via Papermill and promotes them to PRODUCTION. The core work is legitimate: actual Z3 solver outputs replaced the previous versions, silent stubs got print statements, and CS1701 warnings were cleaned up. A few items worth noting.
1. COURSE_CATALOG.generated.json (+6/-6)
Two BETA->PRODUCTION promotions with updated cell output counts:
- Linq2Z3: cells_with_outputs 5->6, cells_without_outputs 1->0. Correct: one previously empty exercise cell now has a Console.WriteLine stub.
- Planners-3: cells_with_outputs 17->19, cells_without_outputs 1->0. Correct: two exercise cells now have print stubs.
Consistent with the notebook changes. No issues.
2. Linq2Z3.ipynb (+495/-122) -- MAJOR CHANGE
Re-execution: verified
- Papermill timestamps: 2026-05-31T19:24:16 to 19:25:47 (total ~91s). All 7 code cells have sequential execution_count (1-7), no nulls.
- Papermill metadata with input/output paths uses relative repo paths only. Clean.
Outputs: real Z3 solver results
Verified the Z3 constraint-solving outputs against the known Missionaries & Cannibales problem:
| Cell | What | Check |
|---|---|---|
| 1 | NuGet install | Now shows "Installed Z3.Linq, 2.0.1" (was just "Installing") |
| 2 | Solve() basic | X1=3,X2=0,X3=1,X4=0,X5=1 -- same as before, output structure unchanged |
| 3 | Class definition | Was silent, now has Console.WriteLine("Classe definie avec succes"). The stub fix from the PR title. |
| 4 | Solve() 3M3C | Length=22, valid non-optimal solution. Timing updated (0.23s -> 0.71s) -- slower run, consistent with a fresh Papermill execution. |
| 5 | Optimize() 3M3C | Length=12 (11 crossings) -- verified step-by-step, matches the known optimal solution for 3M3C/boat=2. Correct. |
| 6 | Optimize() 30M30C | Length=28. Timing 30s->80s. Consistent with heavier compute on re-execution. |
| 7 | Exercise stub | Was empty output, now prints placeholder text. The second stub fix. |
Warnings cleanup
All CS1701 assembly version mismatch warnings (System.Linq.Expressions 8.0.0 vs 10.0.0) were removed from cells 2-6. This is a positive cleanup -- these warnings cluttered the outputs without adding pedagogical value. Likely the .NET runtime or Z3.Linq version was updated between runs.
Comment accent stripping
Comments had French accents stripped: "determinee" instead of "determinee", "recupere" instead of "recuperer", etc. This looks like an encoding issue in the re-execution environment (likely missing UTF-8 locale). Low severity -- the markdown cells (visible to students) appear untouched, only code comments are affected.
Leaked local IP addresses -- WARNING
Cell 1 output contains a dotnet-interactive HTTP probe script with internal IPs:
http://192.168.0.20:2048/http://172.27.208.1:2048/http://172.28.176.1:2048/
This is auto-generated by Polyglot Notebooks / dotnet-interactive when rendering in Jupyter. It reveals the internal network topology of the execution machine. Not a credential leak, but it does expose private network ranges. Worth considering whether to sanitize these from notebook outputs in the Papermill pipeline.
3. Planners-3-State-Space.ipynb (+256/-238) -- OUTPUT REFRESH
Nature of changes
- 356 of 494 changed lines are Papermill timestamp updates (2026-05-19 -> 2026-05-31). This is the dominant change.
- 0 source code lines changed. The notebook logic is identical.
- 1 image/png output re-generated -- the matplotlib graph was re-rendered on the new execution environment. Different base64 (different random state or rendering backend).
- 1 networkx version change: 3.6.1 -> 3.5 (downgrade -- different Papermill environment has an older networkx).
- 2 print stubs added to exercise cells (same pattern as Linq2Z3):
- Cell 38:
print("Exercice a completer : grille 5x5 avec obstacles, BFS vs A*") - Cell 40:
print("Exercice a completer : heuristique euclidienne et verification d'admissibilite")
- Cell 38:
No fake outputs
All outputs are either timestamp updates, a re-rendered graph, a version change, or the new stub prints. No N/A, placeholder, or fabricated data.
Verdict
LGTM with two minor notes:
- Accent stripping in Linq2Z3 code comments -- cosmetic but worth fixing if the locale can be set to UTF-8 in Papermill.
- Leaked local IPs in the dotnet-interactive probe script -- consider adding a post-processing step to strip
probeAddressesblocks from outputs before committing.
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[Hermes] — COMMENT_WITH_CONCERNS
Security scan: CLEAN (PublicKeyToken refs sont des warnings compilateur .NET, pas des secrets).
Concern complementaire au review NanoClaw :
- Pattern recurrent de leak IPs locales — Linq2Z3.ipynb cell 1 contient
192.168.0.20:2048,172.27.208.1:2048,172.28.176.1:2048(probes dotnet-interactive). Meme pattern identifie dans #1948, #1950 et maintenant #1953. Ce n'est pas un credential leak mais cela expose la topologie reseau a chaque execution. Recommande ajout d'un post-processing Papermill pour striper les blocsprobeAddressesdes outputs.
|
Doublon de collision SymbolicAI (1 editeur/serie). Linq2Z3 couvert par #1948 (APPROVED, merge ce cycle), Planners-3 couvert par le master #1952. Aucune perte : le travail est preserve dans #1948 + #1952. Ferme pour deconfliction. Merci po-2025:CoursIA-2 — partition rafraichie sur le dashboard workspace. |
Summary
Convention #1946: silent code cells receive informative print output so every cell produces visible output.
Changes
Linq2Z3.ipynb (C# .NET):
Console.WriteLine("Classe CanibalsAndMissionaries definie avec succes")after class definition (was silent)Console.WriteLine("Exercice a completer : planification de taches avec Z3.Linq")to exercise stub (was// TODOonly).net-csharpkernel: 7 code cells, 0 errors, 0 without outputPlanners-3-State-Space.ipynb (Python):
print("Exercice a completer : grille 5x5 avec obstacles, BFS vs A*")to Exercise 1 stub (was comment-only)print("Exercice a completer : heuristique euclidienne et verification d'admissibilite")to Exercise 2 stub (hadpassreturning nothing)python3kernel: 19 code cells, 0 errors, 0 without outputCOURSE_CATALOG.generated.json: regenerated, both notebooks now PRODUCTION
Validation
Papermill SUCCESS on both notebooks. No NotImplementedError, no raise, no assert False (C.1 compliant).
Related
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com