Marquis03 commited on
Commit
51c1cb7
·
verified ·
1 Parent(s): a56e2b1

Upload folder using huggingface_hub (part 45)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +81 -0
  2. thephysicsguys--physics3d.00691d/tests/programgym_evaluator.py +1201 -0
  3. thephysicsguys--physics3d.00691d/tests/programgym_task.json +1005 -0
  4. thephysicsguys--physics3d.00691d/tests/test.sh +82 -0
  5. thephysicsguys--physics3d.00691d/tests/workspace.tar.gz +3 -0
  6. theryangeary--choose.f1c53ee/environment/Dockerfile +70 -0
  7. theryangeary--choose.f1c53ee/environment/docker-compose.yaml +11 -0
  8. theryangeary--choose.f1c53ee/environment/download.sh +350 -0
  9. theryangeary--choose.f1c53ee/environment/executable +3 -0
  10. theryangeary--choose.f1c53ee/environment/harbor_configure_apt_mirror.sh +37 -0
  11. theryangeary--choose.f1c53ee/environment/harbor_prepare_download_env.sh +37 -0
  12. theryangeary--choose.f1c53ee/environment/workspace.tar.gz +3 -0
  13. theryangeary--choose.f1c53ee/instruction.md +98 -0
  14. theryangeary--choose.f1c53ee/solution/solve.sh +33 -0
  15. theryangeary--choose.f1c53ee/task.toml +69 -0
  16. theryangeary--choose.f1c53ee/tests/Dockerfile +79 -0
  17. theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  18. theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  19. theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  20. theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  21. theryangeary--choose.f1c53ee/tests/blobs/tests/generated_upstream.tar.gz +3 -0
  22. theryangeary--choose.f1c53ee/tests/docker-compose.yaml +11 -0
  23. theryangeary--choose.f1c53ee/tests/download.sh +350 -0
  24. theryangeary--choose.f1c53ee/tests/executable +3 -0
  25. theryangeary--choose.f1c53ee/tests/harbor_configure_apt_mirror.sh +37 -0
  26. theryangeary--choose.f1c53ee/tests/harbor_prepare_download_env.sh +37 -0
  27. theryangeary--choose.f1c53ee/tests/programgym_evaluator.py +1201 -0
  28. theryangeary--choose.f1c53ee/tests/programgym_task.json +0 -0
  29. theryangeary--choose.f1c53ee/tests/test.sh +82 -0
  30. theryangeary--choose.f1c53ee/tests/workspace.tar.gz +3 -0
  31. thesephist--ink.b6fd222/environment/Dockerfile +64 -0
  32. thesephist--ink.b6fd222/environment/download.sh +138 -0
  33. thesephist--ink.b6fd222/environment/executable +3 -0
  34. thesephist--ink.b6fd222/environment/harbor_prepare_download_env.sh +34 -0
  35. thesephist--ink.b6fd222/environment/programgym-go.tar.gz +3 -0
  36. thesephist--ink.b6fd222/environment/workspace.tar.gz +3 -0
  37. thesephist--ink.b6fd222/instruction.md +98 -0
  38. thesephist--ink.b6fd222/solution/solve.sh +33 -0
  39. thesephist--ink.b6fd222/task.toml +69 -0
  40. thesephist--ink.b6fd222/tests/Dockerfile +73 -0
  41. thesephist--ink.b6fd222/tests/blobs/tests/generated_module_01.tar.gz +3 -0
  42. thesephist--ink.b6fd222/tests/blobs/tests/generated_module_02.tar.gz +3 -0
  43. thesephist--ink.b6fd222/tests/blobs/tests/generated_module_03.tar.gz +3 -0
  44. thesephist--ink.b6fd222/tests/blobs/tests/generated_module_04.tar.gz +3 -0
  45. thesephist--ink.b6fd222/tests/download.sh +138 -0
  46. thesephist--ink.b6fd222/tests/executable +3 -0
  47. thesephist--ink.b6fd222/tests/harbor_prepare_download_env.sh +34 -0
  48. thesephist--ink.b6fd222/tests/programgym-go.tar.gz +3 -0
  49. thesephist--ink.b6fd222/tests/programgym_evaluator.py +1201 -0
  50. thesephist--ink.b6fd222/tests/programgym_task.json +715 -0
.gitattributes CHANGED
@@ -2626,3 +2626,84 @@ thelartians--pegparser.99ea226/environment/executable filter=lfs diff=lfs merge=
2626
  thelartians--pegparser.99ea226/tests/executable filter=lfs diff=lfs merge=lfs -text
2627
  thephysicsguys--physics3d.00691d/environment/executable filter=lfs diff=lfs merge=lfs -text
2628
  thephysicsguys--physics3d.00691d/tests/executable filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2626
  thelartians--pegparser.99ea226/tests/executable filter=lfs diff=lfs merge=lfs -text
2627
  thephysicsguys--physics3d.00691d/environment/executable filter=lfs diff=lfs merge=lfs -text
2628
  thephysicsguys--physics3d.00691d/tests/executable filter=lfs diff=lfs merge=lfs -text
2629
+ theryangeary--choose.f1c53ee/environment/executable filter=lfs diff=lfs merge=lfs -text
2630
+ theryangeary--choose.f1c53ee/tests/executable filter=lfs diff=lfs merge=lfs -text
2631
+ thesephist--ink.b6fd222/environment/executable filter=lfs diff=lfs merge=lfs -text
2632
+ thesephist--ink.b6fd222/tests/executable filter=lfs diff=lfs merge=lfs -text
2633
+ thevxn--dish.612b960/environment/executable filter=lfs diff=lfs merge=lfs -text
2634
+ thevxn--dish.612b960/tests/executable filter=lfs diff=lfs merge=lfs -text
2635
+ thewtex--tmux-mem-cpu-load.041d5/environment/executable filter=lfs diff=lfs merge=lfs -text
2636
+ thewtex--tmux-mem-cpu-load.041d5/tests/executable filter=lfs diff=lfs merge=lfs -text
2637
+ theycallmemac--odin.a01d039/environment/executable filter=lfs diff=lfs merge=lfs -text
2638
+ theycallmemac--odin.a01d039/tests/executable filter=lfs diff=lfs merge=lfs -text
2639
+ theykk--git-switcher.b4d0bd2/environment/executable filter=lfs diff=lfs merge=lfs -text
2640
+ theykk--git-switcher.b4d0bd2/tests/executable filter=lfs diff=lfs merge=lfs -text
2641
+ thomas-995--construct.2bd2229/environment/executable filter=lfs diff=lfs merge=lfs -text
2642
+ thomas-995--construct.2bd2229/tests/executable filter=lfs diff=lfs merge=lfs -text
2643
+ thomaskeck--fastbdt.e67f715/environment/executable filter=lfs diff=lfs merge=lfs -text
2644
+ thomaskeck--fastbdt.e67f715/tests/executable filter=lfs diff=lfs merge=lfs -text
2645
+ thomasmarsh--ode.bcfb66c/environment/executable filter=lfs diff=lfs merge=lfs -text
2646
+ thomasmarsh--ode.bcfb66c/tests/executable filter=lfs diff=lfs merge=lfs -text
2647
+ thosakwe--t2b.2e141c2/environment/executable filter=lfs diff=lfs merge=lfs -text
2648
+ thosakwe--t2b.2e141c2/tests/executable filter=lfs diff=lfs merge=lfs -text
2649
+ thu-pacman--geminigraph.170e7d3/environment/executable filter=lfs diff=lfs merge=lfs -text
2650
+ thu-pacman--geminigraph.170e7d3/tests/executable filter=lfs diff=lfs merge=lfs -text
2651
+ thunlp--thulac.a4bb407/environment/executable filter=lfs diff=lfs merge=lfs -text
2652
+ thunlp--thulac.a4bb407/tests/executable filter=lfs diff=lfs merge=lfs -text
2653
+ tidwall--gjson.rs.85124aa/environment/executable filter=lfs diff=lfs merge=lfs -text
2654
+ tidwall--gjson.rs.85124aa/tests/executable filter=lfs diff=lfs merge=lfs -text
2655
+ tidwall--jj.ab3eb1e/environment/executable filter=lfs diff=lfs merge=lfs -text
2656
+ tidwall--jj.ab3eb1e/tests/executable filter=lfs diff=lfs merge=lfs -text
2657
+ timnn--cargo-lipo.341cee9/environment/executable filter=lfs diff=lfs merge=lfs -text
2658
+ timnn--cargo-lipo.341cee9/tests/executable filter=lfs diff=lfs merge=lfs -text
2659
+ timothyye--glance.01d03db/environment/executable filter=lfs diff=lfs merge=lfs -text
2660
+ timothyye--glance.01d03db/tests/executable filter=lfs diff=lfs merge=lfs -text
2661
+ timtadh--lexmachine.8eded60/environment/executable filter=lfs diff=lfs merge=lfs -text
2662
+ timtadh--lexmachine.8eded60/tests/executable filter=lfs diff=lfs merge=lfs -text
2663
+ timvw--qv.20ceb44/environment/executable filter=lfs diff=lfs merge=lfs -text
2664
+ timvw--qv.20ceb44/tests/executable filter=lfs diff=lfs merge=lfs -text
2665
+ tinganho--l10ns.7442cea/environment/executable filter=lfs diff=lfs merge=lfs -text
2666
+ tinganho--l10ns.7442cea/tests/executable filter=lfs diff=lfs merge=lfs -text
2667
+ tinynetwork--tinet.345f8b2/environment/executable filter=lfs diff=lfs merge=lfs -text
2668
+ tinynetwork--tinet.345f8b2/tests/executable filter=lfs diff=lfs merge=lfs -text
2669
+ tj--go-tea.3bb6781/environment/executable filter=lfs diff=lfs merge=lfs -text
2670
+ tj--go-tea.3bb6781/tests/executable filter=lfs diff=lfs merge=lfs -text
2671
+ tj--gobinaries.bffcba3/environment/executable filter=lfs diff=lfs merge=lfs -text
2672
+ tj--gobinaries.bffcba3/tests/executable filter=lfs diff=lfs merge=lfs -text
2673
+ tj--sponsors-api.7b8247b/environment/executable filter=lfs diff=lfs merge=lfs -text
2674
+ tj--sponsors-api.7b8247b/tests/executable filter=lfs diff=lfs merge=lfs -text
2675
+ tkrajina--typescriptify-golang-s/environment/executable filter=lfs diff=lfs merge=lfs -text
2676
+ tkrajina--typescriptify-golang-s/tests/executable filter=lfs diff=lfs merge=lfs -text
2677
+ tlx--tlx.2dd63ab/environment/executable filter=lfs diff=lfs merge=lfs -text
2678
+ tlx--tlx.2dd63ab/tests/executable filter=lfs diff=lfs merge=lfs -text
2679
+ tmc--pqstream.c9027a0/environment/executable filter=lfs diff=lfs merge=lfs -text
2680
+ tmc--pqstream.c9027a0/tests/executable filter=lfs diff=lfs merge=lfs -text
2681
+ tmccombs--hcl2json.29dd119/environment/executable filter=lfs diff=lfs merge=lfs -text
2682
+ tmccombs--hcl2json.29dd119/tests/executable filter=lfs diff=lfs merge=lfs -text
2683
+ tokio-rs--rdbc.dcaa6ff/environment/executable filter=lfs diff=lfs merge=lfs -text
2684
+ tokio-rs--rdbc.dcaa6ff/tests/executable filter=lfs diff=lfs merge=lfs -text
2685
+ tokozedg--sman.a68809f/environment/executable filter=lfs diff=lfs merge=lfs -text
2686
+ tokozedg--sman.a68809f/tests/executable filter=lfs diff=lfs merge=lfs -text
2687
+ tommy-muehle--go-mnd.86c7103/environment/executable filter=lfs diff=lfs merge=lfs -text
2688
+ tommy-muehle--go-mnd.86c7103/tests/executable filter=lfs diff=lfs merge=lfs -text
2689
+ tomnomnom--anew.d67d68d/environment/executable filter=lfs diff=lfs merge=lfs -text
2690
+ tomnomnom--anew.d67d68d/tests/executable filter=lfs diff=lfs merge=lfs -text
2691
+ tomnomnom--meg.5cc1d34/environment/executable filter=lfs diff=lfs merge=lfs -text
2692
+ tomnomnom--meg.5cc1d34/tests/executable filter=lfs diff=lfs merge=lfs -text
2693
+ tomnomnom--unfurl.8f10d05/environment/executable filter=lfs diff=lfs merge=lfs -text
2694
+ tomnomnom--unfurl.8f10d05/tests/executable filter=lfs diff=lfs merge=lfs -text
2695
+ tomtom-international--cpp-depend/environment/executable filter=lfs diff=lfs merge=lfs -text
2696
+ tomtom-international--cpp-depend/tests/executable filter=lfs diff=lfs merge=lfs -text
2697
+ tomwright--mermaid-server.59cf30/environment/executable filter=lfs diff=lfs merge=lfs -text
2698
+ tomwright--mermaid-server.59cf30/tests/executable filter=lfs diff=lfs merge=lfs -text
2699
+ tonistiigi--binfmt.e29e7d7/environment/executable filter=lfs diff=lfs merge=lfs -text
2700
+ tonistiigi--binfmt.e29e7d7/tests/executable filter=lfs diff=lfs merge=lfs -text
2701
+ torognes--vsearch.fe039fb/environment/executable filter=lfs diff=lfs merge=lfs -text
2702
+ torognes--vsearch.fe039fb/tests/executable filter=lfs diff=lfs merge=lfs -text
2703
+ tpoechtrager--wclang.8bbb475/environment/executable filter=lfs diff=lfs merge=lfs -text
2704
+ tpoechtrager--wclang.8bbb475/tests/executable filter=lfs diff=lfs merge=lfs -text
2705
+ traccar--traccar-geocoder.0f8287/environment/executable filter=lfs diff=lfs merge=lfs -text
2706
+ traccar--traccar-geocoder.0f8287/tests/executable filter=lfs diff=lfs merge=lfs -text
2707
+ trailofbits--pe-parse.a98bacf/environment/executable filter=lfs diff=lfs merge=lfs -text
2708
+ trailofbits--pe-parse.a98bacf/tests/executable filter=lfs diff=lfs merge=lfs -text
2709
+ transformrs--ata.a644a6c/environment/executable filter=lfs diff=lfs merge=lfs -text
thephysicsguys--physics3d.00691d/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
thephysicsguys--physics3d.00691d/tests/programgym_task.json ADDED
@@ -0,0 +1,1005 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_cli_args.test_arbitrary_single_dash_flag_is_tolerated",
9
+ "eval.tests.test_cli_args.test_double_dash_option_with_value_is_tolerated_and_boots_headlessly",
10
+ "eval.tests.test_cli_args.test_multiple_single_dash_flags_are_all_tolerated",
11
+ "eval.tests.test_cli_args.test_option_name_is_not_treated_as_a_technology_flag",
12
+ "eval.tests.test_cli_args.test_single_dash_mmx_disables_but_odd_positional_does_not_change_header",
13
+ "eval.tests.test_cli_args.test_trailing_option_without_value_aborts_before_any_logging",
14
+ "eval.tests.test_cpu_technology_flags.test_disable_lines_emitted_in_names_order_regardless_of_argv[argv0-disabled0]",
15
+ "eval.tests.test_cpu_technology_flags.test_disable_lines_emitted_in_names_order_regardless_of_argv[argv1-disabled1]",
16
+ "eval.tests.test_cpu_technology_flags.test_disable_lines_emitted_in_names_order_regardless_of_argv[argv2-disabled2]",
17
+ "eval.tests.test_cpu_technology_flags.test_disable_three_technologies_matches_golden",
18
+ "eval.tests.test_cpu_technology_flags.test_disabling_nothing_emits_no_disable_or_enabled_lines",
19
+ "eval.tests.test_cpu_technology_flags.test_duplicate_flag_disables_technology_only_once",
20
+ "eval.tests.test_cpu_technology_flags.test_equals_in_flag_name_does_not_disable[AVX512_F]",
21
+ "eval.tests.test_cpu_technology_flags.test_equals_in_flag_name_does_not_disable[AVX]",
22
+ "eval.tests.test_cpu_technology_flags.test_equals_in_flag_name_does_not_disable[FMA]",
23
+ "eval.tests.test_cpu_technology_flags.test_equals_in_flag_name_does_not_disable[MMX]",
24
+ "eval.tests.test_cpu_technology_flags.test_equals_in_flag_name_does_not_disable[SSE]",
25
+ "eval.tests.test_cpu_technology_flags.test_lowercase_technology_flags_are_ignored[avx]",
26
+ "eval.tests.test_cpu_technology_flags.test_lowercase_technology_flags_are_ignored[fma]",
27
+ "eval.tests.test_cpu_technology_flags.test_lowercase_technology_flags_are_ignored[mmx]",
28
+ "eval.tests.test_cpu_technology_flags.test_lowercase_technology_flags_are_ignored[sse]",
29
+ "eval.tests.test_cpu_technology_flags.test_multiple_disable_flags_accumulate[disabled0]",
30
+ "eval.tests.test_cpu_technology_flags.test_multiple_disable_flags_accumulate[disabled1]",
31
+ "eval.tests.test_cpu_technology_flags.test_multiple_disable_flags_accumulate[disabled2]",
32
+ "eval.tests.test_cpu_technology_flags.test_multiple_disable_flags_accumulate[disabled3]",
33
+ "eval.tests.test_cpu_technology_flags.test_multiple_disable_flags_accumulate[disabled4]",
34
+ "eval.tests.test_cpu_technology_flags.test_option_pair_consumes_a_flag_looking_value",
35
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[AVX2]",
36
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[AVX512_F]",
37
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[AVX]",
38
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[FMA]",
39
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[MMX]",
40
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[SSE2]",
41
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[SSE3]",
42
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[SSE4_1]",
43
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[SSE4_2]",
44
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[SSE]",
45
+ "eval.tests.test_cpu_technology_flags.test_single_disable_removes_exactly_that_technology[SSSE3]",
46
+ "eval.tests.test_cpu_technology_flags.test_technology_flag_alongside_unrelated_flag_still_disables",
47
+ "eval.tests.test_cpu_technology_flags.test_unknown_flag_does_not_disable_any_technology",
48
+ "eval.tests.test_disable_full_channel.test_disable_stdout_and_log_share_header_but_differ_in_closing_stage",
49
+ "eval.tests.test_disable_full_channel.test_full_latest_log_after_technology_disable_matches_golden",
50
+ "eval.tests.test_disable_full_channel.test_full_latest_log_single_disable_is_header_plus_tail",
51
+ "eval.tests.test_disable_full_channel.test_stdout_carries_disable_header_but_not_closing_lines",
52
+ "eval.tests.test_headless_boot.test_boot_stages_appear_in_fixed_order",
53
+ "eval.tests.test_headless_boot.test_closing_physics_and_screen_lines_follow_failure",
54
+ "eval.tests.test_headless_boot.test_empty_stderr_with_app_own_output_only",
55
+ "eval.tests.test_headless_boot.test_latest_log_is_created_in_working_directory_with_exact_content",
56
+ "eval.tests.test_headless_boot.test_no_arg_boot_produces_same_latest_log_as_quickboot",
57
+ "eval.tests.test_headless_boot.test_process_dies_by_sigsegv_after_reporting_glfw_failure",
58
+ "eval.tests.test_headless_boot.test_stdout_matches_the_headless_golden",
59
+ "eval.tests.test_parser_edges.test_bare_double_dash_trailing_aborts_before_any_logging",
60
+ "eval.tests.test_parser_edges.test_bare_single_dash_stores_empty_flag_and_disables_nothing",
61
+ "eval.tests.test_parser_edges.test_double_dash_empty_name_with_value_is_tolerated",
62
+ "eval.tests.test_parser_edges.test_positional_scene_arg_with_technology_flag",
63
+ "eval.tests.test_parser_edges.test_technology_flag_plus_option_pair_in_same_argv",
64
+ "eval.tests.test_parser_edges.test_technology_name_as_substring_does_not_disable[FMA_extra-FMA]",
65
+ "eval.tests.test_parser_edges.test_technology_name_as_substring_does_not_disable[MMX2-MMX]",
66
+ "eval.tests.test_parser_edges.test_technology_name_as_substring_does_not_disable[_SSSE3-SSSE3]",
67
+ "eval.tests.test_parser_edges.test_technology_name_as_substring_does_not_disable[xAVX-AVX]",
68
+ "eval.tests.test_parser_option_values.test_double_dash_token_consumed_as_option_value",
69
+ "eval.tests.test_parser_option_values.test_multiple_option_pairs_plus_technology_flag",
70
+ "eval.tests.test_parser_option_values.test_quickboot_flag_with_option_pair_and_technology_flag",
71
+ "eval.tests.test_parser_option_values.test_technology_token_consumed_as_option_value_is_not_disabled",
72
+ "eval.tests.test_parser_option_values.test_triple_dash_token_throws_for_missing_value"
73
+ ]
74
+ },
75
+ "generated_module_02": {
76
+ "ignore_reason": "",
77
+ "ignored": false,
78
+ "ignored_tests": [],
79
+ "tests": [
80
+ "eval.tests.test_argparse.TestFlagParsing.test_multiple_flags_accepted",
81
+ "eval.tests.test_argparse.TestFlagParsing.test_single_dash_is_flag_reaching_glfw_failure[-123]",
82
+ "eval.tests.test_argparse.TestFlagParsing.test_single_dash_is_flag_reaching_glfw_failure[-a]",
83
+ "eval.tests.test_argparse.TestFlagParsing.test_single_dash_is_flag_reaching_glfw_failure[-quick]",
84
+ "eval.tests.test_argparse.TestFlagParsing.test_single_dash_is_flag_reaching_glfw_failure[-x]",
85
+ "eval.tests.test_argparse.TestOptionalParsing.test_dangling_double_dash_aborts[--name]",
86
+ "eval.tests.test_argparse.TestOptionalParsing.test_dangling_double_dash_aborts[--opt]",
87
+ "eval.tests.test_argparse.TestOptionalParsing.test_dangling_double_dash_aborts[--quickBoot]",
88
+ "eval.tests.test_argparse.TestOptionalParsing.test_optional_before_positional_consumes_following",
89
+ "eval.tests.test_argparse.TestOptionalParsing.test_optional_with_value_ok",
90
+ "eval.tests.test_argparse.TestOptionalParsing.test_well_formed_option_groups[groups0]",
91
+ "eval.tests.test_argparse.TestOptionalParsing.test_well_formed_option_groups[groups1]",
92
+ "eval.tests.test_argparse.TestParserMixedOrder.test_mixed_flag_optional_positional",
93
+ "eval.tests.test_argparse.TestParserMixedOrder.test_mixed_with_dangling_trailing_throws",
94
+ "eval.tests.test_argparse.TestPositionalParsing.test_positionals_after_flags_kept",
95
+ "eval.tests.test_argparse.TestPositionalParsing.test_single_positional_is_input_arg",
96
+ "eval.tests.test_argparse_terminal_token_edges.TestDoubleDashWithValueConsumesFollowingToken.test_empty_key_option_consumes_technology_value",
97
+ "eval.tests.test_argparse_terminal_token_edges.TestDoubleDashWithValueConsumesFollowingToken.test_empty_key_option_plus_gating_flag",
98
+ "eval.tests.test_argparse_terminal_token_edges.TestEmptyStringArgumentIsPositional.test_empty_string_among_gating_flags_is_inert",
99
+ "eval.tests.test_argparse_terminal_token_edges.TestEmptyStringArgumentIsPositional.test_empty_string_arg_is_a_positional",
100
+ "eval.tests.test_argparse_terminal_token_edges.TestLoneSingleDashIsEmptyFlag.test_empty_flag_can_precede_a_gating_flag",
101
+ "eval.tests.test_argparse_terminal_token_edges.TestLoneSingleDashIsEmptyFlag.test_empty_flag_name_never_gates",
102
+ "eval.tests.test_argparse_terminal_token_edges.TestLoneSingleDashIsEmptyFlag.test_lone_dash_is_a_plain_flag",
103
+ "eval.tests.test_argparse_terminal_token_edges.TestLoneTrailingDoubleDashAborts.test_lone_double_dash_throws",
104
+ "eval.tests.test_argparse_terminal_token_edges.TestLoneTrailingDoubleDashAborts.test_trailing_double_dash_after_gating_flag_aborts",
105
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_all_eleven_technologies_listed",
106
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[AVX2]",
107
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[AVX512_F]",
108
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[AVX]",
109
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[FMA]",
110
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[MMX]",
111
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[SSE2]",
112
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[SSE3]",
113
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[SSE4_1]",
114
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[SSE4_2]",
115
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[SSE]",
116
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_each_named_technology_present[SSSE3]",
117
+ "eval.tests.test_cpuid_flag_gating.TestCapabilityLine.test_no_gating_records_by_default",
118
+ "eval.tests.test_cpuid_flag_gating.TestGatedBootGolden.test_gated_boot_log_matches_golden",
119
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_disabled_flag_respects_flag_not_positional",
120
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_enabled_list_omits_only_disabled_technologies",
121
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_gating_runs_before_glfw",
122
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_multiple_flags_remove_multiple_technologies",
123
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_single_flag_disables_technology[-AVX-AVX]",
124
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_single_flag_disables_technology[-AVX512_F-AVX512_F]",
125
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_single_flag_disables_technology[-FMA-FMA]",
126
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_single_flag_disables_technology[-MMX-MMX]",
127
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_single_flag_disables_technology[-SSE2-SSE2]",
128
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_single_flag_disables_technology[-SSE3-SSE3]",
129
+ "eval.tests.test_cpuid_flag_gating.TestTechnologyDisableFlags.test_unknown_flag_emits_no_gating",
130
+ "eval.tests.test_cpuid_gating_matrix.TestDashStyleDistinction.test_double_dash_with_value_is_plain_optional_not_gating",
131
+ "eval.tests.test_cpuid_gating_matrix.TestDashStyleDistinction.test_single_dash_gates_double_dash_dangling_aborts",
132
+ "eval.tests.test_cpuid_gating_matrix.TestDashStyleDistinction.test_unknown_technology_flag_is_passthrough",
133
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_mixed_exact_and_non_exact_only_gates_the_exact_one",
134
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-AVX2F]",
135
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-AVX512F]",
136
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-AVX512]",
137
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-FMA2]",
138
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-MM]",
139
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-SSE4]",
140
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-SSE4_2X]",
141
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-SSEI]",
142
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-SSSE]",
143
+ "eval.tests.test_cpuid_gating_matrix.TestExactNameMatchOnly.test_non_exact_spelling_does_not_gate[-SS]",
144
+ "eval.tests.test_cpuid_gating_matrix.TestGatingInteractionWithOtherArgKinds.test_gating_flag_after_a_positional_still_gates",
145
+ "eval.tests.test_cpuid_gating_matrix.TestGatingInteractionWithOtherArgKinds.test_positional_technology_name_is_not_a_gating_flag",
146
+ "eval.tests.test_cpuid_gating_matrix.TestGatingInteractionWithOtherArgKinds.test_repeated_gating_flag_is_idempotent",
147
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[AVX2]",
148
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[AVX512_F]",
149
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[AVX]",
150
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[FMA]",
151
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[MMX]",
152
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[SSE2]",
153
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[SSE3]",
154
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[SSE4_1]",
155
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[SSE4_2]",
156
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[SSE]",
157
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_hardware_detection_line_is_unchanged_by_gating[SSSE3]",
158
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[AVX2]",
159
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[AVX512_F]",
160
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[AVX]",
161
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[FMA]",
162
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[MMX]",
163
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[SSE2]",
164
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[SSE3]",
165
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[SSE4_1]",
166
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[SSE4_2]",
167
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[SSE]",
168
+ "eval.tests.test_cpuid_gating_matrix.TestIndividualTechnologyGating.test_single_flag_disables_exactly_one_technology[SSSE3]",
169
+ "eval.tests.test_cpuid_gating_matrix.TestMultiFlagGating.test_disable_all_eleven_yields_empty_enabled_list",
170
+ "eval.tests.test_cpuid_gating_matrix.TestMultiFlagGating.test_multiple_flags_disable_exact_subset[flags0-disabled0]",
171
+ "eval.tests.test_cpuid_gating_matrix.TestMultiFlagGating.test_multiple_flags_disable_exact_subset[flags1-disabled1]",
172
+ "eval.tests.test_cpuid_gating_matrix.TestMultiFlagGating.test_multiple_flags_disable_exact_subset[flags2-disabled2]",
173
+ "eval.tests.test_cpuid_gating_matrix.TestMultiFlagGating.test_out_of_order_flags_emit_names_order_records",
174
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_position_rotation_roundtrip[4294967293-position3-rotation3-[DEBUG]: Part cframe: GlobalCFrame((12, -4, 3), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
175
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_position_rotation_roundtrip[4294967294-position2-rotation2-[DEBUG]: Part cframe: GlobalCFrame((0, 0, -9), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
176
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_position_rotation_roundtrip[4294967295-position0-rotation0-[DEBUG]: Part cframe: GlobalCFrame((4, 0, -2), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
177
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_position_rotation_roundtrip[4294967295-position1-rotation1-[DEBUG]: Part cframe: GlobalCFrame((-3, 7, 0), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
178
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_position_rotation_roundtrip[4294967295-position4-rotation4-[DEBUG]: Part cframe: GlobalCFrame((2, 2, 2), (-1, 0, 0; 0, -1, 0; 0, 0, 1; ))]",
179
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_position_rotation_roundtrip[4294967295-position5-rotation5-[DEBUG]: Part cframe: GlobalCFrame((0, 0, 0), (1, 0, 0; 0, 0, 1; 0, -1, 0; ))]",
180
+ "eval.tests.test_geometry_shape_decode.TestNativePartsBuilderRoundTrip.test_builder_stream_with_fresh_position_decodes",
181
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_cylinder_class_bucket_accepts_decode",
182
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_negative_position_fix_roundtrip",
183
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_non_identity_rotation_matrix_roundtrip",
184
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_shape_fixture_decodes_exact_cframe[box_pos3_neg1_5.nativeParts-[DEBUG]: Part cframe: GlobalCFrame((3, -1, 5), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
185
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_shape_fixture_decodes_exact_cframe[box_rot90z.nativeParts-[DEBUG]: Part cframe: GlobalCFrame((0, 2, 0), (0, 1, 0; -1, 0, 0; 0, 0, 1; ))]",
186
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_shape_fixture_decodes_exact_cframe[cylinder_first.nativeParts-[DEBUG]: Part cframe: GlobalCFrame((0, 2, 0), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
187
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_shape_fixture_decodes_exact_cframe[sphere_first.nativeParts-[DEBUG]: Part cframe: GlobalCFrame((0, 2, 0), (1, 0, 0; 0, 1, 0; 0, 0, 1; ))]",
188
+ "eval.tests.test_geometry_shape_decode.TestNativePartsGeometryShapes.test_sphere_class_bucket_accepts_decode",
189
+ "eval.tests.test_geometry_shape_decode.TestNativePartsMultiPart.test_two_part_stream_decodes_first_part",
190
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_dangling_double_dash_optional_throws",
191
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_dangling_optional_never_reaches_glfw[--foo]",
192
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_dangling_optional_never_reaches_glfw[--headless]",
193
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_dangling_optional_never_reaches_glfw[--quickBoot]",
194
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_dangling_optional_never_reaches_glfw[--x]",
195
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_empty_arguments_proceed_to_glfw",
196
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_flag_followed_by_positional_proceeds",
197
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_option_with_value_does_not_throw",
198
+ "eval.tests.test_headless_boot.TestArgumentParserReachability.test_single_dash_flag_does_not_throw",
199
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_emits_capabilities",
200
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_is_first_record",
201
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_lists_each_technology[AVX2]",
202
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_lists_each_technology[AVX]",
203
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_lists_each_technology[FMA]",
204
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_lists_each_technology[MMX]",
205
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_lists_each_technology[SSE]",
206
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_lists_each_technology[SSSE3]",
207
+ "eval.tests.test_headless_boot.TestCpuFeatureDetection.test_cpu_detection_prefix",
208
+ "eval.tests.test_headless_boot.TestHeadlessGlewFailure.test_no_display_exit_139",
209
+ "eval.tests.test_headless_boot.TestHeadlessGlewFailure.test_no_display_full_log_matches_golden",
210
+ "eval.tests.test_headless_boot.TestHeadlessGlewFailure.test_no_display_logs_glfw_failure",
211
+ "eval.tests.test_headless_boot.TestHeadlessGlewFailure.test_no_display_runs_clean_shutdown_sequence",
212
+ "eval.tests.test_headless_boot.TestLogFileOutput.test_latest_log_contains_cpu_and_glfw_records",
213
+ "eval.tests.test_headless_boot.TestLogFileOutput.test_latest_log_created_in_cwd",
214
+ "eval.tests.test_headless_boot.TestLogFileOutput.test_log_errors_have_error_level_tag",
215
+ "eval.tests.test_headless_boot.TestLogFileOutput.test_log_level_info_included",
216
+ "eval.tests.test_headless_boot.TestStartupOrdering.test_cpu_before_glfw",
217
+ "eval.tests.test_headless_boot.TestStartupOrdering.test_glfw_init_before_failure",
218
+ "eval.tests.test_headless_boot.TestStartupOrdering.test_shutdown_after_errors",
219
+ "eval.tests.test_serialization.TestInvalidShapeClassId.test_unknown_shape_id_aborts_with_message",
220
+ "eval.tests.test_serialization.TestInvalidShapeClassId.test_unknown_shape_id_never_reports_clean_load",
221
+ "eval.tests.test_serialization.TestLoadDispatch.test_load_reaches_file_reader[box.nativeParts]",
222
+ "eval.tests.test_serialization.TestLoadDispatch.test_load_reaches_file_reader[box1.world]",
223
+ "eval.tests.test_serialization.TestLoadDispatch.test_load_reaches_file_reader[garbage.world]",
224
+ "eval.tests.test_serialization.TestLoadDispatch.test_recognised_extensions_log_reading",
225
+ "eval.tests.test_serialization.TestLoadDispatch.test_unsupported_extension_is_noop",
226
+ "eval.tests.test_serialization.TestLoadingErrors.test_bad_worlds_never_report_clean_load[garbage.world]",
227
+ "eval.tests.test_serialization.TestLoadingErrors.test_bad_worlds_never_report_clean_load[truncated.world]",
228
+ "eval.tests.test_serialization.TestLoadingErrors.test_missing_file_aborts_on_null_path",
229
+ "eval.tests.test_serialization.TestLoadingErrors.test_truncated_world_never_completes_cleanly",
230
+ "eval.tests.test_serialization.TestLoadingErrors.test_wrong_version_world_rejected",
231
+ "eval.tests.test_serialization.TestNativePartsDeserialization.test_nativeparts_decodes_part_cframe",
232
+ "eval.tests.test_serialization.TestNativePartsDeserialization.test_nativeparts_position_preserved",
233
+ "eval.tests.test_serialization.TestNativePartsDeserialization.test_nativeparts_then_graphics_register_crash",
234
+ "eval.tests.test_serialization.TestShapeClassDeserializationVariants.test_multi_shape_parts_stream_reaches_reader",
235
+ "eval.tests.test_serialization.TestShapeClassDeserializationVariants.test_three_parts_deserialize_all_shapes",
236
+ "eval.tests.test_serialization.TestShapeClassDeserializationVariants.test_three_parts_reach_prescribed_cframe",
237
+ "eval.tests.test_serialization.TestWorldVersionHeader.test_correct_version_header_accepted",
238
+ "eval.tests.test_serialization.TestWorldVersionHeader.test_zero_version_header_aborts",
239
+ "eval.tests.test_serialization.TestWrongVersionGuard.test_wrong_version_aborts_with_exact_message[0]",
240
+ "eval.tests.test_serialization.TestWrongVersionGuard.test_wrong_version_aborts_with_exact_message[1]",
241
+ "eval.tests.test_serialization.TestWrongVersionGuard.test_wrong_version_aborts_with_exact_message[2147483647]",
242
+ "eval.tests.test_serialization.TestWrongVersionGuard.test_wrong_version_aborts_with_exact_message[3]",
243
+ "eval.tests.test_serialization.TestWrongVersionGuard.test_wrong_version_aborts_with_exact_message[99]",
244
+ "eval.tests.test_world_boot.TestBootStability.test_boot_consistently_lists_cpu",
245
+ "eval.tests.test_world_boot.TestBootStability.test_boot_does_not_abort_on_shader",
246
+ "eval.tests.test_world_boot.TestBootStability.test_boot_no_glfw_error_trace",
247
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_compiles_shaders",
248
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_emits_cpu_detection",
249
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_glfw_init_occurs",
250
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_initializes_mesh_registry",
251
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_process_runs_until_timeout",
252
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_reaches_screen_initialization",
253
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_reaches_world_creation",
254
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_reports_opengl_vendor",
255
+ "eval.tests.test_world_boot.TestDefaultWorldBoot.test_boot_world_init_logged_twice",
256
+ "eval.tests.test_world_boot.TestQuickBootWorld.test_quickboot_parses_as_option",
257
+ "eval.tests.test_world_boot.TestQuickBootWorld.test_quickboot_runs_until_timeout",
258
+ "eval.tests.test_world_boot.TestQuickBootWorld.test_quickboot_still_initializes_glfw"
259
+ ]
260
+ },
261
+ "generated_module_04": {
262
+ "ignore_reason": "",
263
+ "ignored": false,
264
+ "ignored_tests": [
265
+ {
266
+ "name": "eval.tests.test_variant_duplicate.test_duplicate_stage_warning_is_emitted_twice",
267
+ "reasons": [
268
+ {
269
+ "id": "all_assertions_weak",
270
+ "message": "pytest test uses only weak assertions",
271
+ "path": "eval/tests/test_variant_duplicate.py",
272
+ "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.",
273
+ "severity": "error",
274
+ "stage": "static_lint"
275
+ }
276
+ ]
277
+ },
278
+ {
279
+ "name": "eval.tests.test_variant_stages.test_each_stage_variant_emits_only_its_own_stage_failure",
280
+ "reasons": [
281
+ {
282
+ "id": "if_no_else",
283
+ "message": "pytest test has a conditional assertion with no else branch",
284
+ "path": "eval/tests/test_variant_stages.py",
285
+ "repair_hint": "Add an else branch that fails, or assert the condition before making conditional checks.",
286
+ "severity": "error",
287
+ "stage": "static_lint"
288
+ }
289
+ ]
290
+ }
291
+ ],
292
+ "tests": [
293
+ "eval.tests.test_boot_sequence.test_cpu_features_first_line_matches_golden",
294
+ "eval.tests.test_boot_sequence.test_cpu_features_list_is_nonempty_and_multi_flag",
295
+ "eval.tests.test_boot_sequence.test_default_world_is_created_when_no_file_arg",
296
+ "eval.tests.test_boot_sequence.test_glew_init_follows_glfw_context",
297
+ "eval.tests.test_boot_sequence.test_glfw_init_precedes_world_initialization",
298
+ "eval.tests.test_boot_sequence.test_glsl_shader_version_is_4_50",
299
+ "eval.tests.test_boot_sequence.test_maximum_texture_units_matches_slot_list",
300
+ "eval.tests.test_boot_sequence.test_mesh_registry_init_before_screen",
301
+ "eval.tests.test_boot_sequence.test_mode_phases_occur_exactly_once_in_expected_order",
302
+ "eval.tests.test_boot_sequence.test_no_context_fatal_error_on_healthy_boot",
303
+ "eval.tests.test_boot_sequence.test_opengl_renderer_is_llvmpipe_software",
304
+ "eval.tests.test_boot_sequence.test_opengl_vendor_is_mesa",
305
+ "eval.tests.test_boot_sequence.test_opengl_version_is_at_least_330",
306
+ "eval.tests.test_boot_sequence.test_render_loop_handoff_is_last_info_line",
307
+ "eval.tests.test_gui_debug.test_debug_hook_line_identical_across_all_variants",
308
+ "eval.tests.test_gui_debug.test_debug_hooks_registered_on_init",
309
+ "eval.tests.test_gui_debug.test_debug_init_precedes_debug_hooks",
310
+ "eval.tests.test_gui_debug.test_gui_shader_links_among_world_program_set",
311
+ "eval.tests.test_gui_debug.test_gui_shader_uniforms_established_during_layer_init",
312
+ "eval.tests.test_gui_debug.test_render_loop_entered_only_after_full_module_init",
313
+ "eval.tests.test_gui_debug.test_screen_init_precedes_debug_init",
314
+ "eval.tests.test_log_consistency.test_boot_phase_is_target_unit_of_observation",
315
+ "eval.tests.test_log_consistency.test_context_mesh_world_screen_compile_ordered",
316
+ "eval.tests.test_log_consistency.test_gui_debug_init_precedes_render_handoff",
317
+ "eval.tests.test_log_consistency.test_init_duration_reported_as_finite_positive_ms",
318
+ "eval.tests.test_log_consistency.test_stage_warning_set_is_exact_four_logs",
319
+ "eval.tests.test_log_consistency.test_world_shaders_compile_before_gui_shader",
320
+ "eval.tests.test_module_invariants.test_basic_removed_turns_created_uniforms_into_empty_guards",
321
+ "eval.tests.test_module_invariants.test_basic_shader_created_uniforms_flip_across_variants",
322
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[broken]",
323
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[canonical]",
324
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[compute]",
325
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[duplicate]",
326
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[geometry]",
327
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[nobasic]",
328
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[nostage]",
329
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[postprocess]",
330
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[tesscontrol]",
331
+ "eval.tests.test_module_invariants.test_every_variant_reaches_render_and_debug[tesseval]",
332
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[broken]",
333
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[canonical]",
334
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[compute]",
335
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[duplicate]",
336
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[geometry]",
337
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[nobasic]",
338
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[nostage]",
339
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[postprocess]",
340
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[tesscontrol]",
341
+ "eval.tests.test_module_invariants.test_gui_uniform_table_is_exact_in_every_variant[tesseval]",
342
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[broken]",
343
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[canonical]",
344
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[compute]",
345
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[duplicate]",
346
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[geometry]",
347
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[nobasic]",
348
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[nostage]",
349
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[postprocess]",
350
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[tesscontrol]",
351
+ "eval.tests.test_module_invariants.test_instance_shader_guard_arithmetic_is_constant[tesseval]",
352
+ "eval.tests.test_module_invariants.test_no_variant_reuses_a_program_id",
353
+ "eval.tests.test_module_invariants.test_postprocess_variant_clears_read_error_canonical_keeps_it",
354
+ "eval.tests.test_module_invariants.test_presence_flip_alone_changes_final_program_id",
355
+ "eval.tests.test_resource_loading.test_failed_texture_yields_resource_not_loaded",
356
+ "eval.tests.test_resource_loading.test_font_resource_not_reported_as_failed",
357
+ "eval.tests.test_resource_loading.test_missing_tool_icon_texture_subject_reported",
358
+ "eval.tests.test_resource_loading.test_no_other_asset_subject_block",
359
+ "eval.tests.test_resource_loading.test_resource_errors_precede_render",
360
+ "eval.tests.test_resource_loading.test_resource_failure_block_identical_across_variants",
361
+ "eval.tests.test_resource_loading.test_resource_not_loaded_in_add_subject_order",
362
+ "eval.tests.test_resource_loading.test_texture_failure_is_single_count",
363
+ "eval.tests.test_shader_compile.test_canonical_full_log_equals_golden_exactly",
364
+ "eval.tests.test_shader_compile.test_canonical_program_count_is_eighteen",
365
+ "eval.tests.test_shader_compile.test_canonical_program_id_set_matches_golden",
366
+ "eval.tests.test_shader_compile.test_error_stage_diagnostics_order_matches_golden",
367
+ "eval.tests.test_shader_compile.test_error_stream_order_is_deterministic_across_variants",
368
+ "eval.tests.test_shader_compile.test_every_success_logs_exact_info_message",
369
+ "eval.tests.test_shader_compile.test_first_core_shaders_link_before_postprocess_failure",
370
+ "eval.tests.test_shader_compile.test_fragment_compile_failure_reported",
371
+ "eval.tests.test_shader_compile.test_glsl_compiler_diagnostic_verbatim",
372
+ "eval.tests.test_shader_compile.test_gui_shader_links_among_late_program_ids",
373
+ "eval.tests.test_shader_compile.test_link_failure_reported_after_stage_failure",
374
+ "eval.tests.test_shader_compile.test_no_program_binds_to_gl_id_zero",
375
+ "eval.tests.test_shader_compile.test_postprocess_read_failure_is_exactly_once",
376
+ "eval.tests.test_shader_compile.test_postprocess_read_failure_reported_exactly",
377
+ "eval.tests.test_shader_compile.test_program_ids_are_strictly_increasing",
378
+ "eval.tests.test_shader_parse.test_canonical_stage_warnings_are_four_identical_line_one",
379
+ "eval.tests.test_shader_parse.test_file_backed_nostage_shader_emits_multi_line_warnings",
380
+ "eval.tests.test_shader_parse.test_inline_shaders_interleave_warnings_with_late_compiles",
381
+ "eval.tests.test_shader_parse.test_stage_warnings_use_warn_severity_and_exact_message",
382
+ "eval.tests.test_shader_parse.test_warning_program_boundaries_are_alternating",
383
+ "eval.tests.test_shader_uniforms.test_basic_shader_material_uniform_ids_ascend_from_seven",
384
+ "eval.tests.test_shader_uniforms.test_basic_shader_material_uniforms_created_in_exact_order",
385
+ "eval.tests.test_shader_uniforms.test_created_uniform_debug_lines_match_golden_set",
386
+ "eval.tests.test_shader_uniforms.test_created_uniform_shaders_are_only_basic_and_gui",
387
+ "eval.tests.test_shader_uniforms.test_empty_shader_instance_guard_has_31_request_lines",
388
+ "eval.tests.test_shader_uniforms.test_empty_shader_instance_guard_has_31_set_lines",
389
+ "eval.tests.test_shader_uniforms.test_guarded_uniform_set_never_creates_a_location",
390
+ "eval.tests.test_shader_uniforms.test_gui_shader_uniforms_created_in_exact_pair",
391
+ "eval.tests.test_shader_uniforms.test_request_and_set_guards_are_slotwise_paired",
392
+ "eval.tests.test_shader_uniforms.test_total_created_uniforms_is_eight",
393
+ "eval.tests.test_variant_broken.test_broken_and_shipped_fragment_failures_coexist",
394
+ "eval.tests.test_variant_broken.test_broken_file_is_read_without_read_failure",
395
+ "eval.tests.test_variant_broken.test_broken_shader_consumes_a_program_id_slot",
396
+ "eval.tests.test_variant_broken.test_broken_shader_does_not_link",
397
+ "eval.tests.test_variant_broken.test_broken_stage_compile_failure_is_reported_exactly",
398
+ "eval.tests.test_variant_broken.test_broken_stage_failure_is_followed_by_link_abort",
399
+ "eval.tests.test_variant_broken.test_broken_variant_still_reaches_debug_and_render",
400
+ "eval.tests.test_variant_broken.test_full_broken_log_matches_golden_exactly",
401
+ "eval.tests.test_variant_duplicate.test_duplicate_parse_differs_only_by_two_warning_lines",
402
+ "eval.tests.test_variant_duplicate.test_duplicate_stage_warning_is_emitted_twice",
403
+ "eval.tests.test_variant_duplicate.test_duplicate_variant_id_set_equals_valid_postprocess",
404
+ "eval.tests.test_variant_duplicate.test_duplicate_variant_reaches_debug_and_render",
405
+ "eval.tests.test_variant_duplicate.test_duplicate_warnings_are_full_line_exact",
406
+ "eval.tests.test_variant_duplicate.test_duplicate_warnings_surround_early_world_compiles",
407
+ "eval.tests.test_variant_duplicate.test_full_duplicate_log_matches_golden_exactly",
408
+ "eval.tests.test_variant_duplicate.test_no_other_variant_emits_duplicate_stage_warning",
409
+ "eval.tests.test_variant_duplicate.test_no_read_error_and_file_still_links",
410
+ "eval.tests.test_variant_nobasic.test_basic_material_uniforms_are_not_created",
411
+ "eval.tests.test_variant_nobasic.test_basic_read_failure_is_reported_exactly_once",
412
+ "eval.tests.test_variant_nobasic.test_basic_removed_drops_one_program_from_count",
413
+ "eval.tests.test_variant_nobasic.test_basic_shader_read_failure_reported_exactly",
414
+ "eval.tests.test_variant_nobasic.test_full_nobasic_log_matches_golden_exactly",
415
+ "eval.tests.test_variant_nobasic.test_gui_shader_uniforms_unaffected",
416
+ "eval.tests.test_variant_nobasic.test_material_uniform_access_trips_empty_shader_guard",
417
+ "eval.tests.test_variant_nobasic.test_material_uniform_guard_pair_is_exact",
418
+ "eval.tests.test_variant_nobasic.test_postprocess_read_failure_remains",
419
+ "eval.tests.test_variant_nobasic.test_variant_reaches_render_loop",
420
+ "eval.tests.test_variant_nostage.test_file_backed_no_stage_shader_flags_multi_line_warnings",
421
+ "eval.tests.test_variant_nostage.test_file_backed_warnings_precede_inline_warnings",
422
+ "eval.tests.test_variant_nostage.test_full_nostage_log_matches_golden_exactly",
423
+ "eval.tests.test_variant_nostage.test_no_stage_compile_reports_failed_create_stage",
424
+ "eval.tests.test_variant_nostage.test_no_stage_shader_drops_a_slot_and_keeps_count_at_eighteen",
425
+ "eval.tests.test_variant_nostage.test_no_stage_shader_file_is_read_without_read_error",
426
+ "eval.tests.test_variant_nostage.test_no_stage_variant_reaches_debug_and_render",
427
+ "eval.tests.test_variant_nostage.test_shipped_flat_failure_still_present",
428
+ "eval.tests.test_variant_postprocess.test_full_postprocess_log_matches_golden_exactly",
429
+ "eval.tests.test_variant_postprocess.test_gui_shader_uniforms_unaffected",
430
+ "eval.tests.test_variant_postprocess.test_postprocess_compile_precedes_render_handoff",
431
+ "eval.tests.test_variant_postprocess.test_postprocess_read_failure_is_absent_when_file_provided",
432
+ "eval.tests.test_variant_postprocess.test_postprocess_shader_now_compiles_as_last_program",
433
+ "eval.tests.test_variant_postprocess.test_provided_file_raises_program_count_to_nineteen",
434
+ "eval.tests.test_variant_postprocess.test_world_material_uniforms_unaffected",
435
+ "eval.tests.test_variant_stages.test_canonical_emits_none_of_the_four_stage_failures",
436
+ "eval.tests.test_variant_stages.test_each_stage_variant_emits_only_its_own_stage_failure",
437
+ "eval.tests.test_variant_stages.test_full_stage_variant_log_matches_golden_exactly[compute]",
438
+ "eval.tests.test_variant_stages.test_full_stage_variant_log_matches_golden_exactly[geometry]",
439
+ "eval.tests.test_variant_stages.test_full_stage_variant_log_matches_golden_exactly[tesscontrol]",
440
+ "eval.tests.test_variant_stages.test_full_stage_variant_log_matches_golden_exactly[tesseval]",
441
+ "eval.tests.test_variant_stages.test_injected_failure_verbatim_diagnostic_and_link_abort[compute]",
442
+ "eval.tests.test_variant_stages.test_injected_failure_verbatim_diagnostic_and_link_abort[geometry]",
443
+ "eval.tests.test_variant_stages.test_injected_failure_verbatim_diagnostic_and_link_abort[tesscontrol]",
444
+ "eval.tests.test_variant_stages.test_injected_failure_verbatim_diagnostic_and_link_abort[tesseval]",
445
+ "eval.tests.test_variant_stages.test_injected_stage_failure_is_reported_once[compute]",
446
+ "eval.tests.test_variant_stages.test_injected_stage_failure_is_reported_once[geometry]",
447
+ "eval.tests.test_variant_stages.test_injected_stage_failure_is_reported_once[tesscontrol]",
448
+ "eval.tests.test_variant_stages.test_injected_stage_failure_is_reported_once[tesseval]",
449
+ "eval.tests.test_variant_stages.test_injected_stage_failure_precedes_shipped_flat_failure[compute]",
450
+ "eval.tests.test_variant_stages.test_injected_stage_failure_precedes_shipped_flat_failure[geometry]",
451
+ "eval.tests.test_variant_stages.test_injected_stage_failure_precedes_shipped_flat_failure[tesscontrol]",
452
+ "eval.tests.test_variant_stages.test_injected_stage_failure_precedes_shipped_flat_failure[tesseval]",
453
+ "eval.tests.test_variant_stages.test_no_read_error_and_eighteen_programs[compute]",
454
+ "eval.tests.test_variant_stages.test_no_read_error_and_eighteen_programs[geometry]",
455
+ "eval.tests.test_variant_stages.test_no_read_error_and_eighteen_programs[tesscontrol]",
456
+ "eval.tests.test_variant_stages.test_no_read_error_and_eighteen_programs[tesseval]"
457
+ ]
458
+ },
459
+ "generated_module_05": {
460
+ "ignore_reason": "",
461
+ "ignored": false,
462
+ "ignored_tests": [],
463
+ "tests": [
464
+ "eval.tests.test_arg_bucket_classification.test_case_sensitive_tech_flag_matching",
465
+ "eval.tests.test_arg_bucket_classification.test_double_dash_option_value_never_enters_flags_bucket",
466
+ "eval.tests.test_arg_bucket_classification.test_double_dash_quickboot_with_value_is_plain_optional",
467
+ "eval.tests.test_arg_bucket_classification.test_mixed_argv_only_tech_flag_disables",
468
+ "eval.tests.test_arg_bucket_classification.test_quickboot_all_disabled_coloured_stdout_golden",
469
+ "eval.tests.test_arg_bucket_classification.test_quickboot_combined_with_a_disable_keeps_the_disable",
470
+ "eval.tests.test_arg_bucket_classification.test_quickboot_recognized_only_in_single_dash_flags_bucket",
471
+ "eval.tests.test_arg_bucket_classification.test_quickboot_with_all_disabled_keeps_empty_enabled",
472
+ "eval.tests.test_arg_bucket_classification.test_quickboot_with_multi_disable_matches_combo",
473
+ "eval.tests.test_arg_bucket_classification.test_tech_name_after_double_dash_option_is_not_a_disable",
474
+ "eval.tests.test_arg_bucket_classification.test_trailing_double_dash_tech_option_without_value_aborts",
475
+ "eval.tests.test_arg_bucket_classification.test_truncated_tech_token_does_not_match",
476
+ "eval.tests.test_cmdparser_edge_punctuation.test_bare_double_dash_with_value_is_an_empty_optional",
477
+ "eval.tests.test_cmdparser_edge_punctuation.test_bare_single_dash_is_an_empty_flag_not_a_disable",
478
+ "eval.tests.test_cmdparser_edge_punctuation.test_empty_string_positional_keeps_nominal_boot",
479
+ "eval.tests.test_cmdparser_edge_punctuation.test_quickboot_with_same_name_optional_keeps_nominal",
480
+ "eval.tests.test_cmdparser_edge_punctuation.test_same_name_optional_after_disable_does_not_double_disable",
481
+ "eval.tests.test_cmdparser_edge_punctuation.test_tech_names_as_option_names_with_values_stay_nominal",
482
+ "eval.tests.test_cmdparser_edge_punctuation.test_three_dash_token_is_optional_with_flag_like_option_name",
483
+ "eval.tests.test_cmdparser_edge_punctuation.test_trailing_bare_double_dash_aborts_as_trailing_optional",
484
+ "eval.tests.test_cmdparser_edge_punctuation.test_trailing_three_dash_token_aborts",
485
+ "eval.tests.test_cmdparser_parsing.test_double_dash_optionals_do_not_disable",
486
+ "eval.tests.test_cmdparser_parsing.test_optional_plus_positional_keeps_baseline",
487
+ "eval.tests.test_cmdparser_parsing.test_positional_argument_does_not_disable_technologies",
488
+ "eval.tests.test_cmdparser_parsing.test_positional_argument_matches_baseline_log",
489
+ "eval.tests.test_cmdparser_parsing.test_quickboot_flag_does_not_disable_technologies",
490
+ "eval.tests.test_cmdparser_parsing.test_quickboot_recognized_but_cpu_untouched",
491
+ "eval.tests.test_cmdparser_parsing.test_single_dash_non_tech_flag_is_treated_as_plain_flag",
492
+ "eval.tests.test_cmdparser_parsing.test_single_dash_tech_flag_names_preserved_exactly",
493
+ "eval.tests.test_cmdparser_parsing.test_tech_named_value_after_double_dash_option_does_not_disable",
494
+ "eval.tests.test_cmdparser_parsing.test_unknown_flag_preserves_default_cpu_info",
495
+ "eval.tests.test_cpu_technology_combinations.test_argv_reordering_yields_identical_log",
496
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_AVX_AVX2_AVX512_F_latest]",
497
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_AVX_FMA_latest]",
498
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_MMX_AVX2_SSE4_1_latest]",
499
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_MMX_AVX_FMA_latest]",
500
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_MMX_SSE2_SSSE3_latest]",
501
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE2_FMA_AVX_latest]",
502
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE3_AVX2_latest]",
503
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE4_1_AVX512_F_latest]",
504
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE4_1_SSE4_2_latest]",
505
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE_SSE2_AVX_latest]",
506
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE_SSE2_SSE3_SSSE3_latest]",
507
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSE_SSE3_AVX_AVX512_F_latest]",
508
+ "eval.tests.test_cpu_technology_combinations.test_combo_all_disabled_names_dropped_from_enabled[combo_SSSE3_SSE4_2_AVX2_latest]",
509
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_AVX_AVX2_AVX512_F_latest]",
510
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_AVX_FMA_latest]",
511
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_MMX_AVX2_SSE4_1_latest]",
512
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_MMX_AVX_FMA_latest]",
513
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_MMX_SSE2_SSSE3_latest]",
514
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE2_FMA_AVX_latest]",
515
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE3_AVX2_latest]",
516
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE4_1_AVX512_F_latest]",
517
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE4_1_SSE4_2_latest]",
518
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE_SSE2_AVX_latest]",
519
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE_SSE2_SSE3_SSSE3_latest]",
520
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSE_SSE3_AVX_AVX512_F_latest]",
521
+ "eval.tests.test_cpu_technology_combinations.test_combo_disable_exact_golden[combo_SSSE3_SSE4_2_AVX2_latest]",
522
+ "eval.tests.test_cpu_technology_combinations.test_combo_real_enabled_subset_is_consistent",
523
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_AVX_AVX2_AVX512_F_latest]",
524
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_AVX_FMA_latest]",
525
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_MMX_AVX2_SSE4_1_latest]",
526
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_MMX_AVX_FMA_latest]",
527
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_MMX_SSE2_SSSE3_latest]",
528
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE2_FMA_AVX_latest]",
529
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE3_AVX2_latest]",
530
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE4_1_AVX512_F_latest]",
531
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE4_1_SSE4_2_latest]",
532
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE_SSE2_AVX_latest]",
533
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE_SSE2_SSE3_SSSE3_latest]",
534
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSE_SSE3_AVX_AVX512_F_latest]",
535
+ "eval.tests.test_cpu_technology_combinations.test_combo_reports_each_disabled_flag_once[combo_SSSE3_SSE4_2_AVX2_latest]",
536
+ "eval.tests.test_cpu_technology_combinations.test_order_of_disabled_lines_follows_technology_index_order",
537
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_deduplicate_mixed_duplicate_flags",
538
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_deduplicate_single_duplicate_flag",
539
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_deduplicate_single_duplicate_flag_exact_golden",
540
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_enabled_set_is_empty",
541
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_except_AVX512_F_leaves_only_AVX512_F",
542
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_except_MMX_leaves_only_MMX",
543
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_except_SSE3_leaves_only_SSE3",
544
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_plus_extra_unknown_flag",
545
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_reports_every_technology_disabled",
546
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_stdout_carries_empty_enabled_report",
547
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_disable_all_technologies_exact_golden",
548
+ "eval.tests.test_cpu_technology_dedup_and_extremes.test_survivor_goldens_mutually_distinct",
549
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[AVX2]",
550
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[AVX512_F]",
551
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[AVX]",
552
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[FMA]",
553
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[MMX]",
554
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[SSE2]",
555
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[SSE3]",
556
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[SSE4_1]",
557
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[SSE4_2]",
558
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[SSE]",
559
+ "eval.tests.test_cpu_technology_detection.test_single_disable_enabled_list_drops_technology[SSSE3]",
560
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[AVX2]",
561
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[AVX512_F]",
562
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[AVX]",
563
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[FMA]",
564
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[MMX]",
565
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[SSE2]",
566
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[SSE3]",
567
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[SSE4_1]",
568
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[SSE4_2]",
569
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[SSE]",
570
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_exact_golden[SSSE3]",
571
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[AVX2]",
572
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[AVX512_F]",
573
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[AVX]",
574
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[FMA]",
575
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[MMX]",
576
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[SSE2]",
577
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[SSE3]",
578
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[SSE4_1]",
579
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[SSE4_2]",
580
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[SSE]",
581
+ "eval.tests.test_cpu_technology_detection.test_single_disable_flag_reports_disabled_technology[SSSE3]",
582
+ "eval.tests.test_cpu_technology_detection.test_single_disable_outputs_are_pairwise_distinct",
583
+ "eval.tests.test_logging_surface.test_boot_log_has_info_then_error_ordering",
584
+ "eval.tests.test_logging_surface.test_cpu_info_line_ends_with_trailing_space",
585
+ "eval.tests.test_logging_surface.test_default_invocation_creates_latest_log",
586
+ "eval.tests.test_logging_surface.test_detected_cpu_technologies_are_stated",
587
+ "eval.tests.test_logging_surface.test_log_lines_are_recorded_with_level_prefixes",
588
+ "eval.tests.test_logging_surface.test_multiple_invocations_write_independent_logs",
589
+ "eval.tests.test_logging_surface.test_shutdown_lines_report_physics_and_screen_close",
590
+ "eval.tests.test_parsed_args_abort.test_multiple_trailing_optionals_also_abort",
591
+ "eval.tests.test_parsed_args_abort.test_non_tech_flag_alone_does_not_abort",
592
+ "eval.tests.test_parsed_args_abort.test_trailing_optional_abort_writes_no_latest_log",
593
+ "eval.tests.test_parsed_args_abort.test_trailing_optional_abort_writes_no_stdout",
594
+ "eval.tests.test_parsed_args_abort.test_trailing_optional_without_value_aborts",
595
+ "eval.tests.test_parsed_args_abort.test_well_formed_version_does_not_abort",
596
+ "eval.tests.test_stdout_cpu_report.test_baseline_stdout_matches_golden",
597
+ "eval.tests.test_stdout_cpu_report.test_optional_pairs_leave_stdout_unchanged",
598
+ "eval.tests.test_stdout_cpu_report.test_quickboot_stdout_matches_baseline",
599
+ "eval.tests.test_stdout_cpu_report.test_stdout_abort_path_is_empty",
600
+ "eval.tests.test_stdout_cpu_report.test_stdout_all_but_AVX512_F_survivor_golden",
601
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_AVX_FMA]",
602
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_MMX_AVX2_SSE4_1]",
603
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_MMX_SSE2_SSSE3]",
604
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_SSE2_FMA_AVX]",
605
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_SSE4_1_AVX512_F]",
606
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_SSE_SSE2_AVX]",
607
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_SSE_SSE3_AVX_AVX512_F]",
608
+ "eval.tests.test_stdout_cpu_report.test_stdout_combo_disable_golden[combo_SSSE3_SSE4_2_AVX2]",
609
+ "eval.tests.test_stdout_cpu_report.test_stdout_contains_plain_disabled_and_enabled_lines",
610
+ "eval.tests.test_stdout_cpu_report.test_stdout_cpu_report_consistent_across_runs",
611
+ "eval.tests.test_stdout_cpu_report.test_stdout_multi_disable_mmx_avx_golden",
612
+ "eval.tests.test_stdout_cpu_report.test_stdout_only_MMX_survivor_golden",
613
+ "eval.tests.test_stdout_cpu_report.test_stdout_reordered_argv_matches_inorder_golden",
614
+ "eval.tests.test_stdout_cpu_report.test_stdout_report_uses_cyan_for_info_and_red_for_error",
615
+ "eval.tests.test_stdout_cpu_report.test_stdout_single_disable_sse3_golden",
616
+ "eval.tests.test_stdout_cpu_report.test_stdout_unknown_flag_matches_baseline",
617
+ "eval.tests.test_stream_partition_and_stderr.test_abort_path_stderr_carries_exact_terminate_message",
618
+ "eval.tests.test_stream_partition_and_stderr.test_boot_path_emits_no_stderr",
619
+ "eval.tests.test_stream_partition_and_stderr.test_disable_run_keeps_shutdown_tail_and_empty_stderr",
620
+ "eval.tests.test_stream_partition_and_stderr.test_latest_log_equals_plain_stdout_plus_shutdown_lines",
621
+ "eval.tests.test_stream_partition_and_stderr.test_quickboot_run_emits_no_stderr_and_plain_log",
622
+ "eval.tests.test_stream_partition_and_stderr.test_shutdown_lines_absent_from_stdout",
623
+ "eval.tests.test_terminal_color.test_abort_path_has_no_colour_because_no_stdout",
624
+ "eval.tests.test_terminal_color.test_coloured_stdout_and_plain_log_share_payload_text",
625
+ "eval.tests.test_terminal_color.test_disable_flag_error_path_keeps_same_colour_scheme",
626
+ "eval.tests.test_terminal_color.test_error_line_uses_red_foreground",
627
+ "eval.tests.test_terminal_color.test_info_and_error_colours_differ",
628
+ "eval.tests.test_terminal_color.test_info_line_uses_cyan_foreground",
629
+ "eval.tests.test_terminal_color.test_logfile_plain_text_has_same_lines",
630
+ "eval.tests.test_terminal_color.test_reset_to_normal_white_after_coloured_line",
631
+ "eval.tests.test_terminal_color.test_stdout_carries_ansi_escapes_but_logfile_does_not"
632
+ ]
633
+ },
634
+ "generated_module_06": {
635
+ "ignore_reason": "",
636
+ "ignored": false,
637
+ "ignored_tests": [
638
+ {
639
+ "name": "eval.tests.test_sink_and_grammar.test_abort_has_no_ansi_colour_control_on_stderr",
640
+ "reasons": [
641
+ {
642
+ "id": "golden_docstring",
643
+ "message": "pytest test docstring mentions golden data that is not used in the body",
644
+ "path": "eval/tests/test_sink_and_grammar.py",
645
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
646
+ "severity": "error",
647
+ "stage": "static_lint"
648
+ },
649
+ {
650
+ "id": "golden_no_equality",
651
+ "message": "pytest test references golden data without equality comparison",
652
+ "path": "eval/tests/test_sink_and_grammar.py",
653
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
654
+ "severity": "error",
655
+ "stage": "static_lint"
656
+ }
657
+ ]
658
+ },
659
+ {
660
+ "name": "eval.tests.test_sink_and_grammar.test_parser_abort_writes_to_stderr_and_nothing_else",
661
+ "reasons": [
662
+ {
663
+ "id": "golden_docstring",
664
+ "message": "pytest test docstring mentions golden data that is not used in the body",
665
+ "path": "eval/tests/test_sink_and_grammar.py",
666
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
667
+ "severity": "error",
668
+ "stage": "static_lint"
669
+ },
670
+ {
671
+ "id": "golden_no_equality",
672
+ "message": "pytest test references golden data without equality comparison",
673
+ "path": "eval/tests/test_sink_and_grammar.py",
674
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
675
+ "severity": "error",
676
+ "stage": "static_lint"
677
+ }
678
+ ]
679
+ },
680
+ {
681
+ "name": "eval.tests.test_sink_and_grammar.test_trailing_bound_technology_option_aborts",
682
+ "reasons": [
683
+ {
684
+ "id": "no_assertions",
685
+ "message": "pytest test contains no assert statements",
686
+ "path": "eval/tests/test_sink_and_grammar.py",
687
+ "repair_hint": "Add concrete assert statements over observable executable behavior.",
688
+ "severity": "error",
689
+ "stage": "static_lint"
690
+ },
691
+ {
692
+ "id": "golden_docstring",
693
+ "message": "pytest test docstring mentions golden data that is not used in the body",
694
+ "path": "eval/tests/test_sink_and_grammar.py",
695
+ "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.",
696
+ "severity": "error",
697
+ "stage": "static_lint"
698
+ },
699
+ {
700
+ "id": "golden_no_equality",
701
+ "message": "pytest test references golden data without equality comparison",
702
+ "path": "eval/tests/test_sink_and_grammar.py",
703
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
704
+ "severity": "error",
705
+ "stage": "static_lint"
706
+ }
707
+ ]
708
+ },
709
+ {
710
+ "name": "eval.tests.test_swallow_grammar_and_prefix_matching.test_disable_run_writes_exact_log_in_cwd",
711
+ "reasons": [
712
+ {
713
+ "id": "skip_without_fixture",
714
+ "message": "pytest test skips when fixture assets are missing",
715
+ "path": "eval/tests/test_swallow_grammar_and_prefix_matching.py",
716
+ "repair_hint": "Bundle required fixtures with the branch instead of skipping when they are missing.",
717
+ "severity": "error",
718
+ "stage": "static_lint"
719
+ }
720
+ ]
721
+ },
722
+ {
723
+ "name": "eval.tests.test_swallow_grammar_and_prefix_matching.test_disable_runs_keep_stderr_empty",
724
+ "reasons": [
725
+ {
726
+ "id": "golden_no_equality",
727
+ "message": "pytest test references golden data without equality comparison",
728
+ "path": "eval/tests/test_swallow_grammar_and_prefix_matching.py",
729
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
730
+ "severity": "error",
731
+ "stage": "static_lint"
732
+ }
733
+ ]
734
+ },
735
+ {
736
+ "name": "eval.tests.test_swallow_grammar_and_prefix_matching.test_quickboot_option_swallows_following_disable_flag",
737
+ "reasons": [
738
+ {
739
+ "id": "golden_no_equality",
740
+ "message": "pytest test references golden data without equality comparison",
741
+ "path": "eval/tests/test_swallow_grammar_and_prefix_matching.py",
742
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
743
+ "severity": "error",
744
+ "stage": "static_lint"
745
+ }
746
+ ]
747
+ },
748
+ {
749
+ "name": "eval.tests.test_swallow_grammar_and_prefix_matching.test_technology_named_option_swallows_following_tech_flag",
750
+ "reasons": [
751
+ {
752
+ "id": "golden_no_equality",
753
+ "message": "pytest test references golden data without equality comparison",
754
+ "path": "eval/tests/test_swallow_grammar_and_prefix_matching.py",
755
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
756
+ "severity": "error",
757
+ "stage": "static_lint"
758
+ }
759
+ ]
760
+ },
761
+ {
762
+ "name": "eval.tests.test_swallow_grammar_and_prefix_matching.test_two_options_each_swallow_a_tech_flag",
763
+ "reasons": [
764
+ {
765
+ "id": "golden_no_equality",
766
+ "message": "pytest test references golden data without equality comparison",
767
+ "path": "eval/tests/test_swallow_grammar_and_prefix_matching.py",
768
+ "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.",
769
+ "severity": "error",
770
+ "stage": "static_lint"
771
+ }
772
+ ]
773
+ }
774
+ ],
775
+ "tests": [
776
+ "eval.tests.test_additional_reachable.test_enabled_recap_preserves_detected_order_on_both_sinks",
777
+ "eval.tests.test_additional_reachable.test_mixed_disable_and_option_combos_converge_to_boot[combo0]",
778
+ "eval.tests.test_additional_reachable.test_mixed_disable_and_option_combos_converge_to_boot[combo1]",
779
+ "eval.tests.test_additional_reachable.test_mixed_disable_and_option_combos_converge_to_boot[combo2]",
780
+ "eval.tests.test_additional_reachable.test_mixed_disable_and_option_combos_converge_to_boot[combo3]",
781
+ "eval.tests.test_additional_reachable.test_parser_abort_leaves_working_directory_pristine",
782
+ "eval.tests.test_additional_reachable.test_single_dash_quickboot_with_disable_flag_applies_disable",
783
+ "eval.tests.test_additional_reachable.test_world_positional_does_not_create_world_if_absent",
784
+ "eval.tests.test_additional_reachable.test_world_positional_never_rewrites_existing_file",
785
+ "eval.tests.test_arg_parsing.test_any_trailing_option_without_value_is_rejected[--X]",
786
+ "eval.tests.test_arg_parsing.test_any_trailing_option_without_value_is_rejected[--quickBoot]",
787
+ "eval.tests.test_arg_parsing.test_any_trailing_option_without_value_is_rejected[--someoption]",
788
+ "eval.tests.test_arg_parsing.test_bare_single_dash_is_treated_as_flag_without_throw",
789
+ "eval.tests.test_arg_parsing.test_boot_not_reached_after_parser_throw",
790
+ "eval.tests.test_arg_parsing.test_dangling_option_after_bound_option_still_throws",
791
+ "eval.tests.test_arg_parsing.test_dangling_option_survives_previous_option_consumption",
792
+ "eval.tests.test_arg_parsing.test_double_dash_at_end_aborts_without_any_value",
793
+ "eval.tests.test_arg_parsing.test_double_dash_followed_by_value_treats_it_as_option_value",
794
+ "eval.tests.test_arg_parsing.test_double_dash_option_with_value_parses_and_boots",
795
+ "eval.tests.test_arg_parsing.test_empty_quoted_positional_arg_is_accepted",
796
+ "eval.tests.test_arg_parsing.test_empty_string_value_binds_without_throw",
797
+ "eval.tests.test_arg_parsing.test_mix_of_flag_and_malformed_trailing_option_aborts",
798
+ "eval.tests.test_arg_parsing.test_mixed_positionals_options_and_flags_parse",
799
+ "eval.tests.test_arg_parsing.test_multiple_positional_args_parse_and_boot",
800
+ "eval.tests.test_arg_parsing.test_option_value_consuming_a_dash_flag_does_not_throw",
801
+ "eval.tests.test_arg_parsing.test_option_value_consuming_a_double_dash_lookalike_does_not_throw",
802
+ "eval.tests.test_arg_parsing.test_option_value_is_bound_repeatedly_without_throw",
803
+ "eval.tests.test_arg_parsing.test_parser_throw_implies_abort_signal_exit",
804
+ "eval.tests.test_arg_parsing.test_positional_argument_boots_without_parser_error",
805
+ "eval.tests.test_arg_parsing.test_throw_override_before_dangling_option_does_not_rescue",
806
+ "eval.tests.test_arg_parsing.test_trailing_double_dash_option_without_value_aborts_before_init",
807
+ "eval.tests.test_arg_parsing.test_two_single_dash_flags_parse_without_throw",
808
+ "eval.tests.test_boot_sequence.test_detected_technologies_include_known_x86_extensions",
809
+ "eval.tests.test_boot_sequence.test_empty_stdin_does_not_hang_boot",
810
+ "eval.tests.test_boot_sequence.test_error_level_messages_and_info_messages_preserved_in_log_order",
811
+ "eval.tests.test_boot_sequence.test_latest_log_content_is_ansi_free_even_though_stdout_is_coloured",
812
+ "eval.tests.test_boot_sequence.test_latest_log_created_in_working_directory",
813
+ "eval.tests.test_boot_sequence.test_log_cpu_banner_echoes_stdout_banner_identical_after_stripping_ansi",
814
+ "eval.tests.test_boot_sequence.test_no_args_writes_full_boot_sequence_to_log_and_stdout",
815
+ "eval.tests.test_boot_sequence.test_run_without_explicit_cwd_target_still_creates_latest_log",
816
+ "eval.tests.test_boot_sequence.test_shutdown_closing_events_reach_only_the_log_not_stdout",
817
+ "eval.tests.test_cpuid_disable.test_baseline_reports_every_known_technology_as_present",
818
+ "eval.tests.test_cpuid_disable.test_cpuid_report_also_printed_to_stdout_with_banner",
819
+ "eval.tests.test_cpuid_disable.test_disable_adjacent_sse_detects_specific_unit",
820
+ "eval.tests.test_cpuid_disable.test_disable_avx512_leaves_fma_reported",
821
+ "eval.tests.test_cpuid_disable.test_disable_flag_after_bound_option_still_applies",
822
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[AVX2]",
823
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[AVX512_F]",
824
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[AVX]",
825
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[FMA]",
826
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[MMX]",
827
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[SSE2]",
828
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[SSE3]",
829
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[SSE4_1]",
830
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[SSE4_2]",
831
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[SSE]",
832
+ "eval.tests.test_cpuid_disable.test_disable_line_names_exactly_the_flag_technology[SSSE3]",
833
+ "eval.tests.test_cpuid_disable.test_disable_multiple_technologies_accumulates_lines_and_set",
834
+ "eval.tests.test_cpuid_disable.test_disable_one_leaves_the_rest_enabled",
835
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[AVX2]",
836
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[AVX512_F]",
837
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[AVX]",
838
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[FMA]",
839
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[MMX]",
840
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[SSE2]",
841
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[SSE3]",
842
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[SSE4_1]",
843
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[SSE4_2]",
844
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[SSE]",
845
+ "eval.tests.test_cpuid_disable.test_disable_single_technology_removes_it_from_enabled_set[SSSE3]",
846
+ "eval.tests.test_cpuid_disable.test_disabling_technology_already_absent_is_harmless",
847
+ "eval.tests.test_cpuid_disable.test_no_disable_line_when_no_cpuid_flag_is_given",
848
+ "eval.tests.test_cpuid_disable.test_option_value_that_looks_like_technology_does_not_disable",
849
+ "eval.tests.test_cpuid_disable.test_repeating_disable_flag_for_same_technology_is_idempotent",
850
+ "eval.tests.test_cpuid_disable.test_single_dash_full_duplication_only_reports_each_technology_once",
851
+ "eval.tests.test_cpuid_disable.test_unknown_single_dash_flag_does_not_disable_any_technology",
852
+ "eval.tests.test_log_file_side_effect.test_boot_terminates_with_nonzero_return_consistently",
853
+ "eval.tests.test_log_file_side_effect.test_latest_log_created_in_each_unique_working_directory[alpha]",
854
+ "eval.tests.test_log_file_side_effect.test_latest_log_created_in_each_unique_working_directory[beta]",
855
+ "eval.tests.test_log_file_side_effect.test_latest_log_created_in_each_unique_working_directory[deep/nested/dir]",
856
+ "eval.tests.test_log_file_side_effect.test_log_written_in_process_cwd_not_branch_dir",
857
+ "eval.tests.test_log_file_side_effect.test_parser_error_run_produces_no_latest_log",
858
+ "eval.tests.test_log_file_side_effect.test_second_run_truncates_previous_latest_log",
859
+ "eval.tests.test_quickboot_and_flags.test_disable_does_not_alter_the_first_detected_banner",
860
+ "eval.tests.test_quickboot_and_flags.test_enabled_list_preserves_detected_order_excluding_disabled",
861
+ "eval.tests.test_quickboot_and_flags.test_every_configurable_name_accepts_exact_flag_without_parser_throw",
862
+ "eval.tests.test_quickboot_and_flags.test_lowercase_flag_does_not_disable_technology",
863
+ "eval.tests.test_quickboot_and_flags.test_non_exact_flag_spellings_do_not_disable[-AaVx]",
864
+ "eval.tests.test_quickboot_and_flags.test_non_exact_flag_spellings_do_not_disable[-Avx]",
865
+ "eval.tests.test_quickboot_and_flags.test_non_exact_flag_spellings_do_not_disable[-MMX ]",
866
+ "eval.tests.test_quickboot_and_flags.test_non_exact_flag_spellings_do_not_disable[-fma]",
867
+ "eval.tests.test_quickboot_and_flags.test_non_exact_flag_spellings_do_not_disable[-sse2]",
868
+ "eval.tests.test_quickboot_and_flags.test_quickboot_double_dash_with_numeric_value_boots",
869
+ "eval.tests.test_quickboot_and_flags.test_quickboot_double_dash_with_value_is_accepted",
870
+ "eval.tests.test_quickboot_and_flags.test_quickboot_empty_value_binds_and_boots",
871
+ "eval.tests.test_quickboot_and_flags.test_quickboot_flag_position_variant_resolves_to_same_boot",
872
+ "eval.tests.test_quickboot_and_flags.test_quickboot_flag_with_cpuid_disable_combo",
873
+ "eval.tests.test_quickboot_and_flags.test_quickboot_single_dash_is_accepted_and_boots",
874
+ "eval.tests.test_sink_and_grammar.test_abort_has_no_ansi_colour_control_on_stderr",
875
+ "eval.tests.test_sink_and_grammar.test_double_dash_technology_name_is_not_a_disable_flag",
876
+ "eval.tests.test_sink_and_grammar.test_parser_abort_writes_to_stderr_and_nothing_else",
877
+ "eval.tests.test_sink_and_grammar.test_stderr_is_empty_on_normal_boot",
878
+ "eval.tests.test_sink_and_grammar.test_stdout_is_coloured_only_for_boot_and_not_for_abort",
879
+ "eval.tests.test_sink_and_grammar.test_stdout_never_emits_the_shutdown_closings",
880
+ "eval.tests.test_sink_and_grammar.test_trailing_bound_technology_option_aborts",
881
+ "eval.tests.test_stdout_colour_grammar.test_banner_carries_trailing_space_in_console_stream",
882
+ "eval.tests.test_stdout_colour_grammar.test_boot_event_lines_are_exactly_colour_encoded",
883
+ "eval.tests.test_stdout_colour_grammar.test_boot_stdout_ends_with_bare_colour_reset_line",
884
+ "eval.tests.test_stdout_colour_grammar.test_disable_reporting_lines_on_stdout_are_uncoloured",
885
+ "eval.tests.test_stdout_colour_grammar.test_info_and_error_events_use_distinct_sgr_colours",
886
+ "eval.tests.test_stdout_colour_grammar.test_plain_log_sink_has_no_reset_line_vs_console",
887
+ "eval.tests.test_stream_structure_and_value_grammar.test_equals_form_final_option_aborts_as_dangling",
888
+ "eval.tests.test_stream_structure_and_value_grammar.test_equals_form_option_with_following_value_boots_silently",
889
+ "eval.tests.test_stream_structure_and_value_grammar.test_no_arg_stdout_is_exactly_five_raw_lines_and_reset_terminated",
890
+ "eval.tests.test_stream_structure_and_value_grammar.test_technology_name_as_option_value_does_not_disable",
891
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_disable_run_writes_exact_log_in_cwd",
892
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_disable_runs_keep_stderr_empty",
893
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_disabled_lines_follow_table_order_not_argv_order",
894
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_empty_option_value_then_disable_flag_applies",
895
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_partial_swallow_only_unconsumed_flag_disables",
896
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_prefix_spelling_flag_does_not_disable_exact_name[-AVX512-AVX512_F]",
897
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_prefix_spelling_flag_does_not_disable_exact_name[-AVX512F-AVX512_F]",
898
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_prefix_spelling_flag_does_not_disable_exact_name[-MM-MMX]",
899
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_prefix_spelling_flag_does_not_disable_exact_name[-SS-SSE]",
900
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_quickboot_option_swallows_following_disable_flag",
901
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_technology_named_option_swallows_following_tech_flag",
902
+ "eval.tests.test_swallow_grammar_and_prefix_matching.test_two_options_each_swallow_a_tech_flag",
903
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_option_value_swallows_following_disable_flag",
904
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[0]",
905
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[1]",
906
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[]",
907
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[n]",
908
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[on]",
909
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[true]",
910
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[y]",
911
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_shape_accepts_and_boots[yes]",
912
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_with_disable_flag_still_disables[1]",
913
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_with_disable_flag_still_disables[on]",
914
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_quickboot_value_with_disable_flag_still_disables[true]",
915
+ "eval.tests.test_value_swallowing_and_quickboot_matrix.test_same_flag_disables_once_value_is_consumed"
916
+ ]
917
+ }
918
+ },
919
+ "commit": "00691dffa552afb4fb1345aaa5cb7e479af9dbb1",
920
+ "data_source": "synthetic_programgym",
921
+ "difficulty": "medium",
922
+ "difficulty_score": 3.5106977906478543,
923
+ "eval_clean_hashes": [
924
+ "5f49c5da1e95006af71e46046ef4d5a6747b09b2117f08ebbb42f2e72feab7a8"
925
+ ],
926
+ "input_record": {
927
+ "commit": "00691dffa552afb4fb1345aaa5cb7e479af9dbb1",
928
+ "difficulty": "medium",
929
+ "difficulty_code_lines": 54019,
930
+ "difficulty_has_tests": true,
931
+ "difficulty_product_code_lines": 54019,
932
+ "difficulty_runtime_deps": 5,
933
+ "difficulty_score": 3.5106977906478543,
934
+ "difficulty_test_code_lines": 7068,
935
+ "full_name": "ThePhysicsGuys/Physics3D",
936
+ "input_joern_zip": "cpp_joern/ThePhysicsGuys__Physics3D.zip",
937
+ "joern_status": true,
938
+ "joern_time": 1503.8694606290665,
939
+ "language": "cpp",
940
+ "pb_match": [
941
+ {
942
+ "pb_fullname": "gromacs/gromacs",
943
+ "rank": 496,
944
+ "similarity": 0.48047804832458496
945
+ }
946
+ ],
947
+ "repo_path": "cpp/ThePhysicsGuys__Physics3D",
948
+ "source": "commit:00691dffa552afb4fb1345aaa5cb7e479af9dbb1",
949
+ "status": "done",
950
+ "url": "https://github.com/ThePhysicsGuys/Physics3D"
951
+ },
952
+ "instance_id": "ThePhysicsGuys__Physics3D.00691df",
953
+ "language": "cpp",
954
+ "module_iterations": [
955
+ {
956
+ "actual_iterations": 7,
957
+ "branch_name": "generated_module_01",
958
+ "iteration_limit": 15,
959
+ "module_index": 1,
960
+ "module_kind": "source",
961
+ "termination_reason": "early_stopping"
962
+ },
963
+ {
964
+ "actual_iterations": 5,
965
+ "branch_name": "generated_module_02",
966
+ "iteration_limit": 15,
967
+ "module_index": 2,
968
+ "module_kind": "source",
969
+ "termination_reason": "early_stopping"
970
+ },
971
+ {
972
+ "actual_iterations": 8,
973
+ "branch_name": "generated_module_03",
974
+ "iteration_limit": 15,
975
+ "module_index": 3,
976
+ "module_kind": "source",
977
+ "termination_reason": "early_stopping"
978
+ },
979
+ {
980
+ "actual_iterations": 6,
981
+ "branch_name": "generated_module_04",
982
+ "iteration_limit": 15,
983
+ "module_index": 4,
984
+ "module_kind": "source",
985
+ "termination_reason": "early_stopping"
986
+ },
987
+ {
988
+ "actual_iterations": 6,
989
+ "branch_name": "generated_module_05",
990
+ "iteration_limit": 15,
991
+ "module_index": 5,
992
+ "module_kind": "source",
993
+ "termination_reason": "early_stopping"
994
+ },
995
+ {
996
+ "actual_iterations": 5,
997
+ "branch_name": "generated_module_06",
998
+ "iteration_limit": 15,
999
+ "module_index": 6,
1000
+ "module_kind": "source",
1001
+ "termination_reason": "early_stopping"
1002
+ }
1003
+ ],
1004
+ "repository": "ThePhysicsGuys/Physics3D"
1005
+ }
thephysicsguys--physics3d.00691d/tests/test.sh ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets).
5
+ export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}"
6
+
7
+ mkdir -p /logs/verifier /logs/artifacts
8
+
9
+ write_failure() {
10
+ local code="$1"
11
+ local details="$2"
12
+ python3 - "$code" "$details" <<'PY'
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ code, details = sys.argv[1:3]
18
+ try:
19
+ metadata = json.loads(Path("/tests/programgym_task.json").read_text())
20
+ n_tests = sum(
21
+ len([
22
+ name for name in info.get("tests", [])
23
+ if name not in {item.get("name") for item in info.get("ignored_tests", [])}
24
+ ])
25
+ for branch, info in metadata.get("branches", {}).items()
26
+ if not info.get("ignored")
27
+ )
28
+ except Exception:
29
+ n_tests = 0
30
+ result = {
31
+ "test_results": [],
32
+ "error_code": code,
33
+ "error_details": details,
34
+ "log": [],
35
+ "solution_branch": "submission",
36
+ "test_branches": [],
37
+ "test_branch_errors": {
38
+ "__infra__": [{"error_code": code, "error_details": details}]
39
+ },
40
+ "executable_hash": None,
41
+ "warnings": [],
42
+ }
43
+ diagnostics = {
44
+ "pass_rate": 0.0,
45
+ "resolved": 0,
46
+ "n_passed": 0,
47
+ "n_tests": n_tests,
48
+ "n_branch_errors": 1,
49
+ "infra_error": 1,
50
+ "executable_hash_present": 0,
51
+ }
52
+ Path("/logs/verifier/programgym_eval.json").write_text(
53
+ json.dumps(result, indent=2, sort_keys=True)
54
+ )
55
+ Path("/logs/verifier/harbor_diagnostics.json").write_text(
56
+ json.dumps(diagnostics, indent=2, sort_keys=True)
57
+ )
58
+ Path("/logs/verifier/reward.json").write_text(
59
+ json.dumps(
60
+ {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0},
61
+ indent=2,
62
+ sort_keys=True,
63
+ )
64
+ )
65
+ Path("/logs/verifier/reward.txt").write_text("0.0")
66
+ Path("/logs/verifier/programgym_eval.log").write_text(details)
67
+ PY
68
+ }
69
+
70
+ if ! command -v python3 >/dev/null 2>&1; then
71
+ write_failure "missing_python3" "python3 is required in the cleanroom image"
72
+ exit 0
73
+ fi
74
+
75
+ if ! python3 /tests/programgym_evaluator.py; then
76
+ if [ ! -s /logs/verifier/reward.txt ]; then
77
+ write_failure "evaluator_crashed" \
78
+ "programgym_evaluator.py exited non-zero with no reward written"
79
+ fi
80
+ fi
81
+
82
+ exit 0
thephysicsguys--physics3d.00691d/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8c9fa37ccdc7981c2267b0ab47a81607bdc87837bc9cbb1a3d0b308f3e504e5
3
+ size 181386
theryangeary--choose.f1c53ee/environment/Dockerfile ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM rust:1.97.1-bookworm
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV CARGO_HOME=/usr/local/cargo
35
+ ENV RUSTUP_HOME=/usr/local/rustup
36
+ ENV RUSTUP_TOOLCHAIN=1.97.1
37
+ ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1
38
+ ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
39
+ ENV PAGER=cat
40
+ ENV MANPAGER=cat
41
+ ENV LESS=-R
42
+ ENV TQDM_DISABLE=1
43
+ RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/*
44
+ RUN rustup component add llvm-tools-preview --toolchain 1.97.1
45
+ RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov"
46
+ RUN rustc --version && cargo --version && rustup show active-toolchain
47
+ WORKDIR /workspace
48
+ ADD workspace.tar.gz /workspace/
49
+ COPY executable /workspace/executable
50
+ COPY download.sh /tmp/programgym-download.sh
51
+ RUN chmod 755 /tmp/programgym-download.sh
52
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
53
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
54
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
55
+ && rm -f /tmp/programgym-download.sh \
56
+ && rm -f /tmp/harbor_prepare_download_env.sh
57
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
58
+ RUN chmod 111 /workspace/executable
59
+ WORKDIR /workspace
60
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
61
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
62
+ # submission handed to the separate verifier. Keep the reference executable
63
+ # execute-only; the oracle temporarily restores owner read permission.
64
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
65
+ RUN mkdir -p /home/agent \
66
+ && chown -R agent:agent /home/agent /workspace \
67
+ && chown agent:agent /workspace/executable \
68
+ && chmod 111 /workspace/executable
69
+ ENV HOME=/home/agent
70
+ WORKDIR /workspace
theryangeary--choose.f1c53ee/environment/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
theryangeary--choose.f1c53ee/environment/download.sh ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # download.sh for theryangeary/choose (Rust single-binary CLI crate "choose")
2
+ #
3
+ # This script is sourced via `source /source_ro/download.sh` during the networked
4
+ # download stage. It prefetches every Cargo dependency required by the offline
5
+ # build into the cargo registry cache. It performs NO compilation or build steps.
6
+ #
7
+ # It is fully standalone: it does not read any repository file (Cargo.toml,
8
+ # Cargo.lock, Makefile, ...). The generated manifest and the full locked
9
+ # resolution are embedded inline below, reproducing the repository's exact
10
+ # dependency graph and versions.
11
+
12
+ export CARGO_NET_OFFLINE="false"
13
+
14
+ # Cache prefetched dependency sources in the cargo home so the offline
15
+ # build.sh in /workspace/source can compile without network access.
16
+ if [ -z "${CARGO_HOME:-}" ]; then
17
+ export CARGO_HOME="${HOME}/.cargo"
18
+ fi
19
+
20
+ # Build in a temporary directory so we never run cargo from the repo root and
21
+ # never touch repository files.
22
+ _fetch_dir="$(mktemp -d /tmp/choose-download.XXXXXX)"
23
+
24
+ # Write the generated manifest, reproducing the crate's dependency closure from
25
+ # its package metadata. The [[bin]] target needs a stub source file.
26
+ cat > "${_fetch_dir}/Cargo.toml" <<'EOF'
27
+ [package]
28
+ name = "choose"
29
+ version = "1.3.7"
30
+ edition = "2024"
31
+
32
+ [[bin]]
33
+ name = "choose"
34
+ path = "src/main.rs"
35
+
36
+ [dependencies]
37
+ structopt = "0.3"
38
+ regex = "1"
39
+ lazy_static = "1"
40
+ backslash = "0"
41
+ EOF
42
+
43
+ # Scaffold the minimal source stub required by the [[bin]] target so cargo can
44
+ # resolve the generated manifest in isolation.
45
+ mkdir -p "${_fetch_dir}/src"
46
+ cat > "${_fetch_dir}/src/main.rs" <<'EOF'
47
+ fn main() {}
48
+ EOF
49
+
50
+ # Write the full locked resolution inline. These exact versions (and checksums)
51
+ # match the repository's Cargo.lock, so the crates cached here are precisely
52
+ # the ones the offline build resolves against.
53
+ cat > "${_fetch_dir}/Cargo.lock" <<'LOCKEOF'
54
+ # This file is automatically @generated by Cargo.
55
+ # It is not intended for manual editing.
56
+ version = 4
57
+
58
+ [[package]]
59
+ name = "aho-corasick"
60
+ version = "1.1.3"
61
+ source = "registry+https://github.com/rust-lang/crates.io-index"
62
+ checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
63
+ dependencies = [
64
+ "memchr",
65
+ ]
66
+
67
+ [[package]]
68
+ name = "ansi_term"
69
+ version = "0.12.1"
70
+ source = "registry+https://github.com/rust-lang/crates.io-index"
71
+ checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
72
+ dependencies = [
73
+ "winapi",
74
+ ]
75
+
76
+ [[package]]
77
+ name = "atty"
78
+ version = "0.2.14"
79
+ source = "registry+https://github.com/rust-lang/crates.io-index"
80
+ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
81
+ dependencies = [
82
+ "hermit-abi",
83
+ "libc",
84
+ "winapi",
85
+ ]
86
+
87
+ [[package]]
88
+ name = "backslash"
89
+ version = "0.2.0"
90
+ source = "registry+https://github.com/rust-lang/crates.io-index"
91
+ checksum = "fc9fc0782bff70e4ea109606bc4e37162191a39a513416ae04c8fcadc983e42d"
92
+
93
+ [[package]]
94
+ name = "bitflags"
95
+ version = "1.3.2"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
98
+
99
+ [[package]]
100
+ name = "choose"
101
+ version = "1.3.7"
102
+ dependencies = [
103
+ "backslash",
104
+ "lazy_static",
105
+ "regex",
106
+ "structopt",
107
+ ]
108
+
109
+ [[package]]
110
+ name = "clap"
111
+ version = "2.34.0"
112
+ source = "registry+https://github.com/rust-lang/crates.io-index"
113
+ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
114
+ dependencies = [
115
+ "ansi_term",
116
+ "atty",
117
+ "bitflags",
118
+ "strsim",
119
+ "textwrap",
120
+ "unicode-width",
121
+ "vec_map",
122
+ ]
123
+
124
+ [[package]]
125
+ name = "heck"
126
+ version = "0.3.3"
127
+ source = "registry+https://github.com/rust-lang/crates.io-index"
128
+ checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
129
+ dependencies = [
130
+ "unicode-segmentation",
131
+ ]
132
+
133
+ [[package]]
134
+ name = "hermit-abi"
135
+ version = "0.1.19"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
138
+ dependencies = [
139
+ "libc",
140
+ ]
141
+
142
+ [[package]]
143
+ name = "lazy_static"
144
+ version = "1.5.0"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
147
+
148
+ [[package]]
149
+ name = "libc"
150
+ version = "0.2.175"
151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
152
+ checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
153
+
154
+ [[package]]
155
+ name = "memchr"
156
+ version = "2.7.5"
157
+ source = "registry+https://github.com/rust-lang/crates.io-index"
158
+ checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
159
+
160
+ [[package]]
161
+ name = "proc-macro-error"
162
+ version = "1.0.4"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
165
+ dependencies = [
166
+ "proc-macro-error-attr",
167
+ "proc-macro2",
168
+ "quote",
169
+ "syn",
170
+ "version_check",
171
+ ]
172
+
173
+ [[package]]
174
+ name = "proc-macro-error-attr"
175
+ version = "1.0.4"
176
+ source = "registry+https://github.com/rust-lang/crates.io-index"
177
+ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
178
+ dependencies = [
179
+ "proc-macro2",
180
+ "quote",
181
+ "version_check",
182
+ ]
183
+
184
+ [[package]]
185
+ name = "proc-macro2"
186
+ version = "1.0.101"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
189
+ dependencies = [
190
+ "unicode-ident",
191
+ ]
192
+
193
+ [[package]]
194
+ name = "quote"
195
+ version = "1.0.40"
196
+ source = "registry+https://github.com/rust-lang/crates.io-index"
197
+ checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
198
+ dependencies = [
199
+ "proc-macro2",
200
+ ]
201
+
202
+ [[package]]
203
+ name = "regex"
204
+ version = "1.11.2"
205
+ source = "registry+https://github.com/rust-lang/crates.io-index"
206
+ checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
207
+ dependencies = [
208
+ "aho-corasick",
209
+ "memchr",
210
+ "regex-automata",
211
+ "regex-syntax",
212
+ ]
213
+
214
+ [[package]]
215
+ name = "regex-automata"
216
+ version = "0.4.10"
217
+ source = "registry+https://github.com/rust-lang/crates.io-index"
218
+ checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
219
+ dependencies = [
220
+ "aho-corasick",
221
+ "memchr",
222
+ "regex-syntax",
223
+ ]
224
+
225
+ [[package]]
226
+ name = "regex-syntax"
227
+ version = "0.8.6"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
230
+
231
+ [[package]]
232
+ name = "strsim"
233
+ version = "0.8.0"
234
+ source = "registry+https://github.com/rust-lang/crates.io-index"
235
+ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
236
+
237
+ [[package]]
238
+ name = "structopt"
239
+ version = "0.3.26"
240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
241
+ checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10"
242
+ dependencies = [
243
+ "clap",
244
+ "lazy_static",
245
+ "structopt-derive",
246
+ ]
247
+
248
+ [[package]]
249
+ name = "structopt-derive"
250
+ version = "0.4.18"
251
+ source = "registry+https://github.com/rust-lang/crates.io-index"
252
+ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0"
253
+ dependencies = [
254
+ "heck",
255
+ "proc-macro-error",
256
+ "proc-macro2",
257
+ "quote",
258
+ "syn",
259
+ ]
260
+
261
+ [[package]]
262
+ name = "syn"
263
+ version = "1.0.109"
264
+ source = "registry+https://github.com/rust-lang/crates.io-index"
265
+ checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
266
+ dependencies = [
267
+ "proc-macro2",
268
+ "quote",
269
+ "unicode-ident",
270
+ ]
271
+
272
+ [[package]]
273
+ name = "textwrap"
274
+ version = "0.11.0"
275
+ source = "registry+https://github.com/rust-lang/crates.io-index"
276
+ checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
277
+ dependencies = [
278
+ "unicode-width",
279
+ ]
280
+
281
+ [[package]]
282
+ name = "unicode-ident"
283
+ version = "1.0.18"
284
+ source = "registry+https://github.com/rust-lang/crates.io-index"
285
+ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
286
+
287
+ [[package]]
288
+ name = "unicode-segmentation"
289
+ version = "1.12.0"
290
+ source = "registry+https://github.com/rust-lang/crates.io-index"
291
+ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
292
+
293
+ [[package]]
294
+ name = "unicode-width"
295
+ version = "0.1.14"
296
+ source = "registry+https://github.com/rust-lang/crates.io-index"
297
+ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
298
+
299
+ [[package]]
300
+ name = "vec_map"
301
+ version = "0.8.2"
302
+ source = "registry+https://github.com/rust-lang/crates.io-index"
303
+ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
304
+
305
+ [[package]]
306
+ name = "version_check"
307
+ version = "0.9.5"
308
+ source = "registry+https://github.com/rust-lang/crates.io-index"
309
+ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
310
+
311
+ [[package]]
312
+ name = "winapi"
313
+ version = "0.3.9"
314
+ source = "registry+https://github.com/rust-lang/crates.io-index"
315
+ checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
316
+ dependencies = [
317
+ "winapi-i686-pc-windows-gnu",
318
+ "winapi-x86_64-pc-windows-gnu",
319
+ ]
320
+
321
+ [[package]]
322
+ name = "winapi-i686-pc-windows-gnu"
323
+ version = "0.4.0"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
326
+
327
+ [[package]]
328
+ name = "winapi-x86_64-pc-windows-gnu"
329
+ version = "0.4.0"
330
+ source = "registry+https://github.com/rust-lang/crates.io-index"
331
+ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
332
+ LOCKEOF
333
+
334
+ # Prefetch all locked dependencies into the cargo registry cache so the offline
335
+ # build needs no network. --locked uses exactly the versions listed above, and
336
+ # --manifest-path keeps cargo away from the repository root.
337
+ cargo fetch --locked --manifest-path "${_fetch_dir}/Cargo.toml"
338
+
339
+ _fetch_status=$?
340
+ if [ "${_fetch_status}" -ne 0 ]; then
341
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
342
+ return "${_fetch_status}"
343
+ else
344
+ exit "${_fetch_status}"
345
+ fi
346
+ fi
347
+
348
+ # Remove the temporary generated manifest; only the registry cache and the
349
+ # resolved lockfile (now embedded in the build workspace's cache) are needed.
350
+ rm -rf "${_fetch_dir}"
theryangeary--choose.f1c53ee/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:015a0fc20713c97185af81920d650abfffceea5ea0364c5bd2a83608ed534602
3
+ size 3477152
theryangeary--choose.f1c53ee/environment/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
theryangeary--choose.f1c53ee/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ command -v cargo
4
+ command -v rustc
5
+ command -v rustup
6
+ cd /workspace
7
+ set -a
8
+ source /tmp/programgym-download.sh
9
+ set +a
10
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
11
+ import os
12
+ import shlex
13
+
14
+ ignored = {
15
+ "ALL_PROXY",
16
+ "HTTP_PROXY",
17
+ "HTTPS_PROXY",
18
+ "NO_PROXY",
19
+ "OLDPWD",
20
+ "PIP_PROXY",
21
+ "PWD",
22
+ "SHLVL",
23
+ "_",
24
+ "all_proxy",
25
+ "http_proxy",
26
+ "https_proxy",
27
+ "no_proxy",
28
+ "pip_proxy",
29
+ }
30
+ for key in sorted(os.environ):
31
+ if key in ignored or key.startswith("BASH_FUNC_"):
32
+ continue
33
+ value = os.environ[key]
34
+ if "\n" in value:
35
+ continue
36
+ print(f"export {key}={shlex.quote(value)}")
37
+ PY
theryangeary--choose.f1c53ee/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6baf7a139155bba41b7b645e706433c17d0d9b3276366a1c188232b3b29a044d
3
+ size 2294
theryangeary--choose.f1c53ee/instruction.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are a helpful assistant that can interact with a computer.
2
+
3
+ This is a reverse-engineering benchmark. You are given a compiled binary and its documentation.
4
+ Your job is to write a new, original codebase from scratch that produces an executable with identical behavior.
5
+ You must figure out the behavior solely by running and interacting with the provided binary.
6
+ Writing original code based on observed behavior is the entire point of this benchmark.
7
+
8
+ Any approach that shortcuts this — finding existing source code, wrapping the binary,
9
+ or installing the original tool — does not count as a solution. It will be detected by an
10
+ automated judge, marked as a disqualification, and scored as a failure.
11
+ The trace will be posted to an online wall of shame.
12
+
13
+ <RULES>
14
+ ## What is not allowed
15
+
16
+ ### 1. Obtaining source code
17
+
18
+ The only source of truth about what the executable does is the executable itself and its
19
+ bundled documentation. You must not search the internet, package registries, or any external
20
+ source for information about this project's source code. Even if you recognize what the
21
+ executable is, you must reimplement it from behavioral observation alone.
22
+
23
+ This includes but is not limited to:
24
+ - Cloning or browsing the original GitHub repository, its forks, or mirrors
25
+ - Downloading the project from package registries: `cargo install <project>`, `go get github.com/<org>/<project>`, `pip install <project>`, `apt-get source <project>`, `npm install <project>`, etc.
26
+ - Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`)
27
+ - Using a package manager to download the project as a dependency and then reading its cached source (e.g., navigating into `~/.cargo/registry/src/` or `$(go env GOPATH)/pkg/mod/`)
28
+ - Searching the web for the project's source code or implementation details
29
+
30
+ ### 2. Wrapping or reusing the original binary
31
+
32
+ Your submission must be a genuine reimplementation. The provided `./executable` is for
33
+ observation only — your final solution must not depend on it or any other pre-built version
34
+ of the same tool at runtime.
35
+
36
+ This includes but is not limited to:
37
+ - Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`)
38
+ - Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`)
39
+ - Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`)
40
+ - Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`)
41
+ - Re-linking prebuilt `.o` object files found in the workspace without writing new source code
42
+
43
+ ### 3. Binary analysis of the provided executable
44
+
45
+ All information about the provided `./executable` must be obtained by interacting with it
46
+ through its normal user interface (CLI flags, stdin/stdout, etc.).
47
+ - You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it
48
+ - You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable`
49
+
50
+ Note: this restriction applies ONLY to the provided `./executable`. You are free to use any
51
+ analysis tools on binaries that you produce yourself during development.
52
+
53
+ ## What IS allowed
54
+
55
+ - Running the executable with any inputs, flags, and arguments to observe its behavior
56
+ - Reading any documentation files bundled in the workspace
57
+ </RULES>
58
+
59
+ ## Task context
60
+
61
+ We want to write the source code for a given executable.
62
+ The executable is located at `./executable` in the workspace root.
63
+
64
+ You also have access to the existing documentation.
65
+
66
+ ## Your task
67
+
68
+ Implement the source code to generate an executable of exactly identical behavior as the original.
69
+
70
+ No project-specific dependencies are pre-installed.
71
+ You do NOT have access to the internet.
72
+ **IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file.
73
+ Finally, commit your changes.
74
+
75
+ Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root.
76
+ `compile.sh` should be executable and should install any dependencies needed to compile the executable.
77
+ If your compile.sh fails to compile on a fresh checkout, your task has failed.
78
+
79
+ ## Important: This is a reverse-engineering benchmark
80
+
81
+ Your goal is to write original code from scratch that reproduces the executable's behavior.
82
+ The only way to learn what the executable does is to run it and read its bundled documentation.
83
+
84
+ Any attempt to obtain source code — whether successful or not — or to wrap/reuse the
85
+ provided binary will be detected by an automated judge, disqualified, and scored as zero.
86
+ See the full rules in the system prompt above. Key points:
87
+
88
+ - Do NOT search the internet, clone repos, or download the project from any package registry
89
+ - Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool
90
+ - Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine)
91
+ - You SHOULD extensively test the executable to understand its behavior before writing code.
92
+ If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it.
93
+
94
+ ## Recommended Workflow
95
+
96
+ 1. Explore all documentation files
97
+ 2. Play with the executable to understand its behavior (however, you MUST NOT decompile `./executable` or perform any other form of binary or strace/ltrace analysis on it)
98
+ 3. Write the source code to implement the behavior
theryangeary--choose.f1c53ee/solution/solve.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Oracle-only ceiling check. The reference is execute-only for normal agents;
3
+ # because the oracle runs as the owning `agent` user it can temporarily add read
4
+ # permission and encode the binary for Harbor's normal artifact handoff.
5
+ set -euo pipefail
6
+ test -f ./executable
7
+ chmod u+r ./executable
8
+ python3 - <<'PY'
9
+ import base64
10
+ from pathlib import Path
11
+
12
+ Path(".programgym_oracle_reference").write_bytes(
13
+ base64.b64encode(Path("executable").read_bytes())
14
+ )
15
+ PY
16
+ chmod u-r ./executable
17
+ cat > compile.sh <<'EOF'
18
+ #!/usr/bin/env bash
19
+ set -euo pipefail
20
+ if [ -f ./.programgym_oracle_reference ]; then
21
+ python3 - <<'PY'
22
+ import base64
23
+ from pathlib import Path
24
+
25
+ Path("executable").write_bytes(
26
+ base64.b64decode(Path(".programgym_oracle_reference").read_bytes())
27
+ )
28
+ PY
29
+ fi
30
+ test -f ./executable
31
+ chmod +x ./executable
32
+ EOF
33
+ chmod +x compile.sh
theryangeary--choose.f1c53ee/task.toml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ source = "ProgramGym"
3
+ artifacts = [
4
+ "/logs/verifier/programgym_eval.json",
5
+ "/logs/verifier/harbor_diagnostics.json",
6
+ "/logs/verifier/programgym_eval.log",
7
+ "/logs/verifier/reward.json",
8
+ "/logs/verifier/reward.txt",
9
+ # Keep agent/runtime state out of the submission handoff. In particular,
10
+ # Claude Code installs an absolute symlink under .local/bin; transferring it
11
+ # makes Python's safe tar extraction reject the entire workspace archive.
12
+ { source = "/workspace", exclude = [
13
+ "executable",
14
+ ".git",
15
+ ".bashrc",
16
+ ".cache",
17
+ ".cc-switch",
18
+ ".claude",
19
+ ".local",
20
+ ] },
21
+ ]
22
+
23
+ [task]
24
+ name = "programgym/theryangeary--choose.f1c53ee"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for theryangeary/choose"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "theryangeary__choose.f1c53ee"
32
+ repository = "theryangeary/choose"
33
+ commit = "f1c53eef5706a767b7327889c2bf1c09a3c4006e"
34
+ language = "rust"
35
+ difficulty = "easy"
36
+ difficulty_score = 1.7558748556724915
37
+ test_branches = 5
38
+ test_count = 1067
39
+
40
+ [agent]
41
+ timeout_sec = 14400
42
+ user = "agent"
43
+ network_mode = "allowlist"
44
+ allowed_hosts = ["api.anthropic.com", "api.openai.com"]
45
+
46
+ [verifier]
47
+ timeout_sec = 7200
48
+ user = "root"
49
+ environment_mode = "separate"
50
+
51
+ [verifier.env]
52
+ PROGRAMGYM_XDIST_WORKERS = "8"
53
+
54
+ [verifier.environment]
55
+ build_timeout_sec = 1800
56
+ cpus = 8
57
+ memory_mb = 16384
58
+ storage_mb = 30720
59
+ gpus = 0
60
+ workdir = "/workspace"
61
+
62
+ [environment]
63
+ network_mode = "public"
64
+ build_timeout_sec = 1800
65
+ cpus = 8
66
+ memory_mb = 16384
67
+ storage_mb = 30720
68
+ gpus = 0
69
+ workdir = "/workspace"
theryangeary--choose.f1c53ee/tests/Dockerfile ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM rust:1.97.1-bookworm
2
+ ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
3
+ ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
4
+ ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
5
+ ARG PROGRAMGYM_NPM_STRICT_SSL="true"
6
+ ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
7
+ ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
8
+ ARG PROGRAMGYM_UV_INSECURE_HOST=""
9
+ ENV GOPROXY=${PROGRAMGYM_GOPROXY}
10
+ ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
11
+ ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
12
+ ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
13
+ ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
14
+ ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
15
+ ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
16
+ COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
17
+ RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
18
+ && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
19
+ && rm -f /tmp/harbor_configure_apt_mirror.sh
20
+ ENV DEBIAN_FRONTEND=noninteractive
21
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
22
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
23
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
24
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
25
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
26
+ ENV GOSUMDB=sum.golang.google.cn
27
+ ENV GOTOOLCHAIN=auto
28
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
29
+ ENV npm_config_cache=/workspace/.cache/npm
30
+ ENV HOME=/workspace
31
+ ENV XDG_CACHE_HOME=/workspace/.cache
32
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
33
+ ENV PYTHONUSERBASE=/workspace/.local
34
+ ENV CARGO_HOME=/usr/local/cargo
35
+ ENV RUSTUP_HOME=/usr/local/rustup
36
+ ENV RUSTUP_TOOLCHAIN=1.97.1
37
+ ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1
38
+ ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
39
+ ENV PAGER=cat
40
+ ENV MANPAGER=cat
41
+ ENV LESS=-R
42
+ ENV TQDM_DISABLE=1
43
+ RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/*
44
+ RUN rustup component add llvm-tools-preview --toolchain 1.97.1
45
+ RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov"
46
+ RUN rustc --version && cargo --version && rustup show active-toolchain
47
+ WORKDIR /workspace
48
+ ADD workspace.tar.gz /workspace/
49
+ COPY executable /workspace/executable
50
+ COPY download.sh /tmp/programgym-download.sh
51
+ RUN chmod 755 /tmp/programgym-download.sh
52
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
53
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
54
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
55
+ && rm -f /tmp/programgym-download.sh \
56
+ && rm -f /tmp/harbor_prepare_download_env.sh
57
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
58
+ RUN chmod 111 /workspace/executable
59
+ WORKDIR /workspace
60
+ # Harbor uses tests/ as the separate verifier build context. Start with the
61
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
62
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
63
+ && mkdir -p /workspace /tests
64
+
65
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
66
+ # Installing a newer pytest alone leaves that apt package importable and creates
67
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
68
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
69
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
70
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
71
+ RUN python3 -m pip install --break-system-packages \
72
+ --no-cache-dir --disable-pip-version-check \
73
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
74
+
75
+ COPY test.sh /tests/test.sh
76
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
77
+ COPY programgym_task.json /tests/programgym_task.json
78
+ COPY blobs/ /tests/blobs/
79
+ RUN chmod +x /tests/test.sh
theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_01.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:067f253e4b6b3f5db26a375c91aafd638ea2332bac580ad8a48467c93db0e68f
3
+ size 24063
theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_02.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9c8c743e45afd5448ec941320df232366f3e55ed290791167f40c2bacbbf4c3
3
+ size 19337
theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_03.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfccddc0c844c11dfc62c3868e654835778f67c253e30560d60d10e8a139fd20
3
+ size 19329
theryangeary--choose.f1c53ee/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a98ebed19246e432d686d3107fdd703cc29d336acf2de502f3ab5ae53fd7356
3
+ size 8337
theryangeary--choose.f1c53ee/tests/blobs/tests/generated_upstream.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5578291589adf7892b7d543ce4533b2ec5c8e56d1510d8efc8566dee3ac0145
3
+ size 8188
theryangeary--choose.f1c53ee/tests/docker-compose.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ main:
3
+ build:
4
+ args:
5
+ PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-}
6
+ PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct}
7
+ PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/}
8
+ PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true}
9
+ PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple}
10
+ PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-}
11
+ PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-}
theryangeary--choose.f1c53ee/tests/download.sh ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # download.sh for theryangeary/choose (Rust single-binary CLI crate "choose")
2
+ #
3
+ # This script is sourced via `source /source_ro/download.sh` during the networked
4
+ # download stage. It prefetches every Cargo dependency required by the offline
5
+ # build into the cargo registry cache. It performs NO compilation or build steps.
6
+ #
7
+ # It is fully standalone: it does not read any repository file (Cargo.toml,
8
+ # Cargo.lock, Makefile, ...). The generated manifest and the full locked
9
+ # resolution are embedded inline below, reproducing the repository's exact
10
+ # dependency graph and versions.
11
+
12
+ export CARGO_NET_OFFLINE="false"
13
+
14
+ # Cache prefetched dependency sources in the cargo home so the offline
15
+ # build.sh in /workspace/source can compile without network access.
16
+ if [ -z "${CARGO_HOME:-}" ]; then
17
+ export CARGO_HOME="${HOME}/.cargo"
18
+ fi
19
+
20
+ # Build in a temporary directory so we never run cargo from the repo root and
21
+ # never touch repository files.
22
+ _fetch_dir="$(mktemp -d /tmp/choose-download.XXXXXX)"
23
+
24
+ # Write the generated manifest, reproducing the crate's dependency closure from
25
+ # its package metadata. The [[bin]] target needs a stub source file.
26
+ cat > "${_fetch_dir}/Cargo.toml" <<'EOF'
27
+ [package]
28
+ name = "choose"
29
+ version = "1.3.7"
30
+ edition = "2024"
31
+
32
+ [[bin]]
33
+ name = "choose"
34
+ path = "src/main.rs"
35
+
36
+ [dependencies]
37
+ structopt = "0.3"
38
+ regex = "1"
39
+ lazy_static = "1"
40
+ backslash = "0"
41
+ EOF
42
+
43
+ # Scaffold the minimal source stub required by the [[bin]] target so cargo can
44
+ # resolve the generated manifest in isolation.
45
+ mkdir -p "${_fetch_dir}/src"
46
+ cat > "${_fetch_dir}/src/main.rs" <<'EOF'
47
+ fn main() {}
48
+ EOF
49
+
50
+ # Write the full locked resolution inline. These exact versions (and checksums)
51
+ # match the repository's Cargo.lock, so the crates cached here are precisely
52
+ # the ones the offline build resolves against.
53
+ cat > "${_fetch_dir}/Cargo.lock" <<'LOCKEOF'
54
+ # This file is automatically @generated by Cargo.
55
+ # It is not intended for manual editing.
56
+ version = 4
57
+
58
+ [[package]]
59
+ name = "aho-corasick"
60
+ version = "1.1.3"
61
+ source = "registry+https://github.com/rust-lang/crates.io-index"
62
+ checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
63
+ dependencies = [
64
+ "memchr",
65
+ ]
66
+
67
+ [[package]]
68
+ name = "ansi_term"
69
+ version = "0.12.1"
70
+ source = "registry+https://github.com/rust-lang/crates.io-index"
71
+ checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
72
+ dependencies = [
73
+ "winapi",
74
+ ]
75
+
76
+ [[package]]
77
+ name = "atty"
78
+ version = "0.2.14"
79
+ source = "registry+https://github.com/rust-lang/crates.io-index"
80
+ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
81
+ dependencies = [
82
+ "hermit-abi",
83
+ "libc",
84
+ "winapi",
85
+ ]
86
+
87
+ [[package]]
88
+ name = "backslash"
89
+ version = "0.2.0"
90
+ source = "registry+https://github.com/rust-lang/crates.io-index"
91
+ checksum = "fc9fc0782bff70e4ea109606bc4e37162191a39a513416ae04c8fcadc983e42d"
92
+
93
+ [[package]]
94
+ name = "bitflags"
95
+ version = "1.3.2"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
98
+
99
+ [[package]]
100
+ name = "choose"
101
+ version = "1.3.7"
102
+ dependencies = [
103
+ "backslash",
104
+ "lazy_static",
105
+ "regex",
106
+ "structopt",
107
+ ]
108
+
109
+ [[package]]
110
+ name = "clap"
111
+ version = "2.34.0"
112
+ source = "registry+https://github.com/rust-lang/crates.io-index"
113
+ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
114
+ dependencies = [
115
+ "ansi_term",
116
+ "atty",
117
+ "bitflags",
118
+ "strsim",
119
+ "textwrap",
120
+ "unicode-width",
121
+ "vec_map",
122
+ ]
123
+
124
+ [[package]]
125
+ name = "heck"
126
+ version = "0.3.3"
127
+ source = "registry+https://github.com/rust-lang/crates.io-index"
128
+ checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
129
+ dependencies = [
130
+ "unicode-segmentation",
131
+ ]
132
+
133
+ [[package]]
134
+ name = "hermit-abi"
135
+ version = "0.1.19"
136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
137
+ checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
138
+ dependencies = [
139
+ "libc",
140
+ ]
141
+
142
+ [[package]]
143
+ name = "lazy_static"
144
+ version = "1.5.0"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
147
+
148
+ [[package]]
149
+ name = "libc"
150
+ version = "0.2.175"
151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
152
+ checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
153
+
154
+ [[package]]
155
+ name = "memchr"
156
+ version = "2.7.5"
157
+ source = "registry+https://github.com/rust-lang/crates.io-index"
158
+ checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
159
+
160
+ [[package]]
161
+ name = "proc-macro-error"
162
+ version = "1.0.4"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
165
+ dependencies = [
166
+ "proc-macro-error-attr",
167
+ "proc-macro2",
168
+ "quote",
169
+ "syn",
170
+ "version_check",
171
+ ]
172
+
173
+ [[package]]
174
+ name = "proc-macro-error-attr"
175
+ version = "1.0.4"
176
+ source = "registry+https://github.com/rust-lang/crates.io-index"
177
+ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
178
+ dependencies = [
179
+ "proc-macro2",
180
+ "quote",
181
+ "version_check",
182
+ ]
183
+
184
+ [[package]]
185
+ name = "proc-macro2"
186
+ version = "1.0.101"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
189
+ dependencies = [
190
+ "unicode-ident",
191
+ ]
192
+
193
+ [[package]]
194
+ name = "quote"
195
+ version = "1.0.40"
196
+ source = "registry+https://github.com/rust-lang/crates.io-index"
197
+ checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
198
+ dependencies = [
199
+ "proc-macro2",
200
+ ]
201
+
202
+ [[package]]
203
+ name = "regex"
204
+ version = "1.11.2"
205
+ source = "registry+https://github.com/rust-lang/crates.io-index"
206
+ checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
207
+ dependencies = [
208
+ "aho-corasick",
209
+ "memchr",
210
+ "regex-automata",
211
+ "regex-syntax",
212
+ ]
213
+
214
+ [[package]]
215
+ name = "regex-automata"
216
+ version = "0.4.10"
217
+ source = "registry+https://github.com/rust-lang/crates.io-index"
218
+ checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
219
+ dependencies = [
220
+ "aho-corasick",
221
+ "memchr",
222
+ "regex-syntax",
223
+ ]
224
+
225
+ [[package]]
226
+ name = "regex-syntax"
227
+ version = "0.8.6"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
230
+
231
+ [[package]]
232
+ name = "strsim"
233
+ version = "0.8.0"
234
+ source = "registry+https://github.com/rust-lang/crates.io-index"
235
+ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
236
+
237
+ [[package]]
238
+ name = "structopt"
239
+ version = "0.3.26"
240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
241
+ checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10"
242
+ dependencies = [
243
+ "clap",
244
+ "lazy_static",
245
+ "structopt-derive",
246
+ ]
247
+
248
+ [[package]]
249
+ name = "structopt-derive"
250
+ version = "0.4.18"
251
+ source = "registry+https://github.com/rust-lang/crates.io-index"
252
+ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0"
253
+ dependencies = [
254
+ "heck",
255
+ "proc-macro-error",
256
+ "proc-macro2",
257
+ "quote",
258
+ "syn",
259
+ ]
260
+
261
+ [[package]]
262
+ name = "syn"
263
+ version = "1.0.109"
264
+ source = "registry+https://github.com/rust-lang/crates.io-index"
265
+ checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
266
+ dependencies = [
267
+ "proc-macro2",
268
+ "quote",
269
+ "unicode-ident",
270
+ ]
271
+
272
+ [[package]]
273
+ name = "textwrap"
274
+ version = "0.11.0"
275
+ source = "registry+https://github.com/rust-lang/crates.io-index"
276
+ checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
277
+ dependencies = [
278
+ "unicode-width",
279
+ ]
280
+
281
+ [[package]]
282
+ name = "unicode-ident"
283
+ version = "1.0.18"
284
+ source = "registry+https://github.com/rust-lang/crates.io-index"
285
+ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
286
+
287
+ [[package]]
288
+ name = "unicode-segmentation"
289
+ version = "1.12.0"
290
+ source = "registry+https://github.com/rust-lang/crates.io-index"
291
+ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
292
+
293
+ [[package]]
294
+ name = "unicode-width"
295
+ version = "0.1.14"
296
+ source = "registry+https://github.com/rust-lang/crates.io-index"
297
+ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
298
+
299
+ [[package]]
300
+ name = "vec_map"
301
+ version = "0.8.2"
302
+ source = "registry+https://github.com/rust-lang/crates.io-index"
303
+ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
304
+
305
+ [[package]]
306
+ name = "version_check"
307
+ version = "0.9.5"
308
+ source = "registry+https://github.com/rust-lang/crates.io-index"
309
+ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
310
+
311
+ [[package]]
312
+ name = "winapi"
313
+ version = "0.3.9"
314
+ source = "registry+https://github.com/rust-lang/crates.io-index"
315
+ checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
316
+ dependencies = [
317
+ "winapi-i686-pc-windows-gnu",
318
+ "winapi-x86_64-pc-windows-gnu",
319
+ ]
320
+
321
+ [[package]]
322
+ name = "winapi-i686-pc-windows-gnu"
323
+ version = "0.4.0"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
326
+
327
+ [[package]]
328
+ name = "winapi-x86_64-pc-windows-gnu"
329
+ version = "0.4.0"
330
+ source = "registry+https://github.com/rust-lang/crates.io-index"
331
+ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
332
+ LOCKEOF
333
+
334
+ # Prefetch all locked dependencies into the cargo registry cache so the offline
335
+ # build needs no network. --locked uses exactly the versions listed above, and
336
+ # --manifest-path keeps cargo away from the repository root.
337
+ cargo fetch --locked --manifest-path "${_fetch_dir}/Cargo.toml"
338
+
339
+ _fetch_status=$?
340
+ if [ "${_fetch_status}" -ne 0 ]; then
341
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
342
+ return "${_fetch_status}"
343
+ else
344
+ exit "${_fetch_status}"
345
+ fi
346
+ fi
347
+
348
+ # Remove the temporary generated manifest; only the registry cache and the
349
+ # resolved lockfile (now embedded in the build workspace's cache) are needed.
350
+ rm -rf "${_fetch_dir}"
theryangeary--choose.f1c53ee/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:015a0fc20713c97185af81920d650abfffceea5ea0364c5bd2a83608ed534602
3
+ size 3477152
theryangeary--choose.f1c53ee/tests/harbor_configure_apt_mirror.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ repository_base="${1%/}"
5
+ if [[ -z "$repository_base" ]]; then
6
+ exit 0
7
+ fi
8
+
9
+ . /etc/os-release
10
+ codename="${VERSION_CODENAME:-}"
11
+ if [[ -z "$codename" ]]; then
12
+ echo "VERSION_CODENAME is not set" >&2
13
+ exit 1
14
+ fi
15
+
16
+ if [[ "$ID" == "ubuntu" ]]; then
17
+ repository_name="apt-proxy"
18
+ components="main universe restricted multiverse"
19
+ else
20
+ repository_name="debian-proxy"
21
+ components="main contrib non-free non-free-firmware"
22
+ fi
23
+
24
+ install -d /etc/apt/sources.list.d
25
+ rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
26
+ printf 'deb [trusted=yes] %s/%s %s %s\n' \
27
+ "$repository_base" "$repository_name" "$codename" "$components" \
28
+ >/etc/apt/sources.list
29
+ printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \
30
+ "$repository_base" "$repository_name" "$codename" "$components" \
31
+ >>/etc/apt/sources.list
32
+
33
+ if [[ "$ID" != "ubuntu" ]]; then
34
+ printf 'deb [trusted=yes] %s/%s %s-security %s\n' \
35
+ "$repository_base" "debian-proxy-security" "$codename" "$components" \
36
+ >>/etc/apt/sources.list
37
+ fi
theryangeary--choose.f1c53ee/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ command -v cargo
4
+ command -v rustc
5
+ command -v rustup
6
+ cd /workspace
7
+ set -a
8
+ source /tmp/programgym-download.sh
9
+ set +a
10
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
11
+ import os
12
+ import shlex
13
+
14
+ ignored = {
15
+ "ALL_PROXY",
16
+ "HTTP_PROXY",
17
+ "HTTPS_PROXY",
18
+ "NO_PROXY",
19
+ "OLDPWD",
20
+ "PIP_PROXY",
21
+ "PWD",
22
+ "SHLVL",
23
+ "_",
24
+ "all_proxy",
25
+ "http_proxy",
26
+ "https_proxy",
27
+ "no_proxy",
28
+ "pip_proxy",
29
+ }
30
+ for key in sorted(os.environ):
31
+ if key in ignored or key.startswith("BASH_FUNC_"):
32
+ continue
33
+ value = os.environ[key]
34
+ if "\n" in value:
35
+ continue
36
+ print(f"export {key}={shlex.quote(value)}")
37
+ PY
theryangeary--choose.f1c53ee/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
theryangeary--choose.f1c53ee/tests/programgym_task.json ADDED
The diff for this file is too large to render. See raw diff
 
theryangeary--choose.f1c53ee/tests/test.sh ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets).
5
+ export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}"
6
+
7
+ mkdir -p /logs/verifier /logs/artifacts
8
+
9
+ write_failure() {
10
+ local code="$1"
11
+ local details="$2"
12
+ python3 - "$code" "$details" <<'PY'
13
+ import json
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ code, details = sys.argv[1:3]
18
+ try:
19
+ metadata = json.loads(Path("/tests/programgym_task.json").read_text())
20
+ n_tests = sum(
21
+ len([
22
+ name for name in info.get("tests", [])
23
+ if name not in {item.get("name") for item in info.get("ignored_tests", [])}
24
+ ])
25
+ for branch, info in metadata.get("branches", {}).items()
26
+ if not info.get("ignored")
27
+ )
28
+ except Exception:
29
+ n_tests = 0
30
+ result = {
31
+ "test_results": [],
32
+ "error_code": code,
33
+ "error_details": details,
34
+ "log": [],
35
+ "solution_branch": "submission",
36
+ "test_branches": [],
37
+ "test_branch_errors": {
38
+ "__infra__": [{"error_code": code, "error_details": details}]
39
+ },
40
+ "executable_hash": None,
41
+ "warnings": [],
42
+ }
43
+ diagnostics = {
44
+ "pass_rate": 0.0,
45
+ "resolved": 0,
46
+ "n_passed": 0,
47
+ "n_tests": n_tests,
48
+ "n_branch_errors": 1,
49
+ "infra_error": 1,
50
+ "executable_hash_present": 0,
51
+ }
52
+ Path("/logs/verifier/programgym_eval.json").write_text(
53
+ json.dumps(result, indent=2, sort_keys=True)
54
+ )
55
+ Path("/logs/verifier/harbor_diagnostics.json").write_text(
56
+ json.dumps(diagnostics, indent=2, sort_keys=True)
57
+ )
58
+ Path("/logs/verifier/reward.json").write_text(
59
+ json.dumps(
60
+ {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0},
61
+ indent=2,
62
+ sort_keys=True,
63
+ )
64
+ )
65
+ Path("/logs/verifier/reward.txt").write_text("0.0")
66
+ Path("/logs/verifier/programgym_eval.log").write_text(details)
67
+ PY
68
+ }
69
+
70
+ if ! command -v python3 >/dev/null 2>&1; then
71
+ write_failure "missing_python3" "python3 is required in the cleanroom image"
72
+ exit 0
73
+ fi
74
+
75
+ if ! python3 /tests/programgym_evaluator.py; then
76
+ if [ ! -s /logs/verifier/reward.txt ]; then
77
+ write_failure "evaluator_crashed" \
78
+ "programgym_evaluator.py exited non-zero with no reward written"
79
+ fi
80
+ fi
81
+
82
+ exit 0
theryangeary--choose.f1c53ee/tests/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6baf7a139155bba41b7b645e706433c17d0d9b3276366a1c188232b3b29a044d
3
+ size 2294
thesephist--ink.b6fd222/environment/Dockerfile ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:24.04
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
4
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
5
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
7
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
8
+ ENV GOPROXY="https://proxy.golang.org,direct"
9
+ ENV GOSUMDB=sum.golang.google.cn
10
+ ENV GOTOOLCHAIN=auto
11
+ ENV UV_INSECURE_HOST=""
12
+ ENV UV_INDEX_URL="https://pypi.org/simple"
13
+ ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
14
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
15
+ ENV npm_config_registry="https://registry.npmjs.org/"
16
+ ENV npm_config_strict_ssl=false
17
+ ENV npm_config_cache=/workspace/.cache/npm
18
+ ENV PIP_INDEX_URL="https://pypi.org/simple"
19
+ ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
20
+ ENV PIP_TRUSTED_HOST=""
21
+ ENV HOME=/workspace
22
+ ENV XDG_CACHE_HOME=/workspace/.cache
23
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
24
+ ENV PYTHONUSERBASE=/workspace/.local
25
+ ENV GOROOT=/usr/local/go
26
+ ENV GOPATH=/workspace/.go
27
+ ENV GOCACHE=/workspace/.cache/go-build
28
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
29
+ ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
30
+ ENV PAGER=cat
31
+ ENV MANPAGER=cat
32
+ ENV LESS=-R
33
+ ENV TQDM_DISABLE=1
34
+ ENV VIRTUAL_ENV=/opt/programgym-venv
35
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
36
+ COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
37
+ RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
38
+ RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
39
+ WORKDIR /workspace
40
+ ADD workspace.tar.gz /workspace/
41
+ COPY executable /workspace/executable
42
+ COPY download.sh /workspace/download.sh
43
+ RUN chmod 755 /workspace/download.sh
44
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
45
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
46
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
47
+ && rm -f /workspace/download.sh \
48
+ && rm -f /tmp/harbor_prepare_download_env.sh
49
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
50
+ RUN chmod 111 /workspace/executable
51
+ WORKDIR /workspace
52
+ # programgym-runtime-workspace-cleanup: v1
53
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
54
+ # Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user.
55
+ # Keep tool/runtime state under /home/agent and reserve /workspace for the
56
+ # submission handed to the separate verifier. Keep the reference executable
57
+ # execute-only; the oracle temporarily restores owner read permission.
58
+ RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
59
+ RUN mkdir -p /home/agent \
60
+ && chown -R agent:agent /home/agent /workspace \
61
+ && chown agent:agent /workspace/executable \
62
+ && chmod 111 /workspace/executable
63
+ ENV HOME=/home/agent
64
+ WORKDIR /workspace
thesephist--ink.b6fd222/environment/download.sh ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
3
+ # Generated deterministically from repository module metadata; do not edit.
4
+ set -u
5
+ export GOTOOLCHAIN=auto
6
+ mkdir -p /workspace/.programgym_build_env/go-prefetch
7
+ cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
8
+ module github.com/thesephist/ink
9
+
10
+ go 1.14
11
+ PROGRAMGYM_GO_MOD_EOF
12
+ PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
13
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
14
+ case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
15
+ *"|"*|*","*)
16
+ PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
17
+ PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
18
+ if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
19
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
20
+ fi
21
+ ;;
22
+ esac
23
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
24
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
25
+ fi
26
+ cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
27
+ import os
28
+ import signal
29
+ import subprocess
30
+ import sys
31
+ import time
32
+
33
+ sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
34
+ if not command:
35
+ raise SystemExit(125)
36
+ environment = os.environ.copy()
37
+ environment["GOPROXY"] = proxy
38
+ process = subprocess.Popen(command, env=environment, start_new_session=True)
39
+ try:
40
+ returncode = process.wait(timeout=float(timeout_text))
41
+ except subprocess.TimeoutExpired:
42
+ with open(sentinel_path, "w", encoding="utf-8") as sentinel:
43
+ sentinel.write("expired\n")
44
+ try:
45
+ os.killpg(process.pid, signal.SIGTERM)
46
+ except ProcessLookupError:
47
+ pass
48
+ deadline = time.monotonic() + float(grace_text)
49
+ group_alive = True
50
+ while time.monotonic() < deadline:
51
+ process.poll()
52
+ try:
53
+ os.killpg(process.pid, 0)
54
+ except ProcessLookupError:
55
+ group_alive = False
56
+ break
57
+ time.sleep(0.05)
58
+ if group_alive:
59
+ try:
60
+ os.killpg(process.pid, signal.SIGKILL)
61
+ except ProcessLookupError:
62
+ pass
63
+ process.wait()
64
+ raise SystemExit(124)
65
+ if returncode < 0:
66
+ returncode = 128 - returncode
67
+ raise SystemExit(returncode)
68
+ PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
69
+ PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
70
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
71
+ printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
72
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
73
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
74
+ return 1
75
+ else
76
+ exit 1
77
+ fi
78
+ fi
79
+ if ! command -v python3 >/dev/null 2>&1; then
80
+ printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
81
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
82
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
83
+ return 1
84
+ else
85
+ exit 1
86
+ fi
87
+ fi
88
+ _programgym_go_with_nexus_timeout() {
89
+ local programgym_go_rc
90
+ local programgym_go_timeout_sentinel
91
+ if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
92
+ return 1
93
+ fi
94
+ if python3 /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py "$programgym_go_timeout_sentinel" "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" "5" "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" "$@"; then
95
+ programgym_go_rc=0
96
+ else
97
+ programgym_go_rc=$?
98
+ fi
99
+ if [ ! -s "$programgym_go_timeout_sentinel" ]; then
100
+ rm -f "$programgym_go_timeout_sentinel"
101
+ return "$programgym_go_rc"
102
+ fi
103
+ rm -f "$programgym_go_timeout_sentinel"
104
+ if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
105
+ printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; GOPROXY has no explicit non-empty fallback remainder" >&2
106
+ return "$programgym_go_rc"
107
+ fi
108
+ printf '%s\n' "download.sh: Nexus-first Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
109
+ env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
110
+ }
111
+ PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
112
+ if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
113
+ printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
114
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
115
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
116
+ return 1
117
+ else
118
+ exit 1
119
+ fi
120
+ fi
121
+ if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
122
+ PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
123
+ mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
124
+ cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
125
+ export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
126
+ else
127
+ export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
128
+ fi
129
+ export PATH="$GOROOT/bin:$PATH"
130
+ export GOTOOLCHAIN=local
131
+ # No external Go module dependencies to prefetch.
132
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
133
+ unset -f _programgym_go_with_nexus_timeout
134
+ unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
135
+ unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
136
+ unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
137
+ unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
138
+ unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
thesephist--ink.b6fd222/environment/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae9b4d923ec9dc78382a8c855ed0d67da2f7a8ae40c0fa5a5c7338fa419f4532
3
+ size 9449646
thesephist--ink.b6fd222/environment/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
thesephist--ink.b6fd222/environment/programgym-go.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
3
+ size 59908810
thesephist--ink.b6fd222/environment/workspace.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5b70449669ff5ac1cb0ffa3a1c84ceea123b7476f6ea38daef35da843791883
3
+ size 148657
thesephist--ink.b6fd222/instruction.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are a helpful assistant that can interact with a computer.
2
+
3
+ This is a reverse-engineering benchmark. You are given a compiled binary and its documentation.
4
+ Your job is to write a new, original codebase from scratch that produces an executable with identical behavior.
5
+ You must figure out the behavior solely by running and interacting with the provided binary.
6
+ Writing original code based on observed behavior is the entire point of this benchmark.
7
+
8
+ Any approach that shortcuts this — finding existing source code, wrapping the binary,
9
+ or installing the original tool — does not count as a solution. It will be detected by an
10
+ automated judge, marked as a disqualification, and scored as a failure.
11
+ The trace will be posted to an online wall of shame.
12
+
13
+ <RULES>
14
+ ## What is not allowed
15
+
16
+ ### 1. Obtaining source code
17
+
18
+ The only source of truth about what the executable does is the executable itself and its
19
+ bundled documentation. You must not search the internet, package registries, or any external
20
+ source for information about this project's source code. Even if you recognize what the
21
+ executable is, you must reimplement it from behavioral observation alone.
22
+
23
+ This includes but is not limited to:
24
+ - Cloning or browsing the original GitHub repository, its forks, or mirrors
25
+ - Downloading the project from package registries: `cargo install <project>`, `go get github.com/<org>/<project>`, `pip install <project>`, `apt-get source <project>`, `npm install <project>`, etc.
26
+ - Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`)
27
+ - Using a package manager to download the project as a dependency and then reading its cached source (e.g., navigating into `~/.cargo/registry/src/` or `$(go env GOPATH)/pkg/mod/`)
28
+ - Searching the web for the project's source code or implementation details
29
+
30
+ ### 2. Wrapping or reusing the original binary
31
+
32
+ Your submission must be a genuine reimplementation. The provided `./executable` is for
33
+ observation only — your final solution must not depend on it or any other pre-built version
34
+ of the same tool at runtime.
35
+
36
+ This includes but is not limited to:
37
+ - Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`)
38
+ - Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`)
39
+ - Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`)
40
+ - Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`)
41
+ - Re-linking prebuilt `.o` object files found in the workspace without writing new source code
42
+
43
+ ### 3. Binary analysis of the provided executable
44
+
45
+ All information about the provided `./executable` must be obtained by interacting with it
46
+ through its normal user interface (CLI flags, stdin/stdout, etc.).
47
+ - You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it
48
+ - You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable`
49
+
50
+ Note: this restriction applies ONLY to the provided `./executable`. You are free to use any
51
+ analysis tools on binaries that you produce yourself during development.
52
+
53
+ ## What IS allowed
54
+
55
+ - Running the executable with any inputs, flags, and arguments to observe its behavior
56
+ - Reading any documentation files bundled in the workspace
57
+ </RULES>
58
+
59
+ ## Task context
60
+
61
+ We want to write the source code for a given executable.
62
+ The executable is located at `./executable` in the workspace root.
63
+
64
+ You also have access to the existing documentation.
65
+
66
+ ## Your task
67
+
68
+ Implement the source code to generate an executable of exactly identical behavior as the original.
69
+
70
+ No project-specific dependencies are pre-installed.
71
+ You do NOT have access to the internet.
72
+ **IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file.
73
+ Finally, commit your changes.
74
+
75
+ Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root.
76
+ `compile.sh` should be executable and should install any dependencies needed to compile the executable.
77
+ If your compile.sh fails to compile on a fresh checkout, your task has failed.
78
+
79
+ ## Important: This is a reverse-engineering benchmark
80
+
81
+ Your goal is to write original code from scratch that reproduces the executable's behavior.
82
+ The only way to learn what the executable does is to run it and read its bundled documentation.
83
+
84
+ Any attempt to obtain source code — whether successful or not — or to wrap/reuse the
85
+ provided binary will be detected by an automated judge, disqualified, and scored as zero.
86
+ See the full rules in the system prompt above. Key points:
87
+
88
+ - Do NOT search the internet, clone repos, or download the project from any package registry
89
+ - Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool
90
+ - Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine)
91
+ - You SHOULD extensively test the executable to understand its behavior before writing code.
92
+ If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it.
93
+
94
+ ## Recommended Workflow
95
+
96
+ 1. Explore all documentation files
97
+ 2. Play with the executable to understand its behavior (however, you MUST NOT decompile `./executable` or perform any other form of binary or strace/ltrace analysis on it)
98
+ 3. Write the source code to implement the behavior
thesephist--ink.b6fd222/solution/solve.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Oracle-only ceiling check. The reference is execute-only for normal agents;
3
+ # because the oracle runs as the owning `agent` user it can temporarily add read
4
+ # permission and encode the binary for Harbor's normal artifact handoff.
5
+ set -euo pipefail
6
+ test -f ./executable
7
+ chmod u+r ./executable
8
+ python3 - <<'PY'
9
+ import base64
10
+ from pathlib import Path
11
+
12
+ Path(".programgym_oracle_reference").write_bytes(
13
+ base64.b64encode(Path("executable").read_bytes())
14
+ )
15
+ PY
16
+ chmod u-r ./executable
17
+ cat > compile.sh <<'EOF'
18
+ #!/usr/bin/env bash
19
+ set -euo pipefail
20
+ if [ -f ./.programgym_oracle_reference ]; then
21
+ python3 - <<'PY'
22
+ import base64
23
+ from pathlib import Path
24
+
25
+ Path("executable").write_bytes(
26
+ base64.b64decode(Path(".programgym_oracle_reference").read_bytes())
27
+ )
28
+ PY
29
+ fi
30
+ test -f ./executable
31
+ chmod +x ./executable
32
+ EOF
33
+ chmod +x compile.sh
thesephist--ink.b6fd222/task.toml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ source = "ProgramGym"
3
+ artifacts = [
4
+ "/logs/verifier/programgym_eval.json",
5
+ "/logs/verifier/harbor_diagnostics.json",
6
+ "/logs/verifier/programgym_eval.log",
7
+ "/logs/verifier/reward.json",
8
+ "/logs/verifier/reward.txt",
9
+ # Keep agent/runtime state out of the submission handoff. In particular,
10
+ # Claude Code installs an absolute symlink under .local/bin; transferring it
11
+ # makes Python's safe tar extraction reject the entire workspace archive.
12
+ { source = "/workspace", exclude = [
13
+ "executable",
14
+ ".git",
15
+ ".bashrc",
16
+ ".cache",
17
+ ".cc-switch",
18
+ ".claude",
19
+ ".local",
20
+ ] },
21
+ ]
22
+
23
+ [task]
24
+ name = "programgym/thesephist--ink.b6fd222"
25
+ description = "Synthetic ProgramGym cleanroom reconstruction task for thesephist/ink"
26
+ authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }]
27
+ keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"]
28
+
29
+ [metadata]
30
+ source = "ProgramGym"
31
+ instance_id = "thesephist__ink.b6fd222"
32
+ repository = "thesephist/ink"
33
+ commit = "b6fd222ba018da374825ceb5ed2fddb0db81ab14"
34
+ language = "go"
35
+ difficulty = "easy"
36
+ difficulty_score = 1.6570558528571038
37
+ test_branches = 4
38
+ test_count = 604
39
+
40
+ [agent]
41
+ timeout_sec = 14400
42
+ user = "agent"
43
+ network_mode = "allowlist"
44
+ allowed_hosts = ["api.anthropic.com", "api.openai.com"]
45
+
46
+ [verifier]
47
+ timeout_sec = 7200
48
+ user = "root"
49
+ environment_mode = "separate"
50
+
51
+ [verifier.env]
52
+ PROGRAMGYM_XDIST_WORKERS = "8"
53
+
54
+ [verifier.environment]
55
+ build_timeout_sec = 1800
56
+ cpus = 8
57
+ memory_mb = 16384
58
+ storage_mb = 30720
59
+ gpus = 0
60
+ workdir = "/workspace"
61
+
62
+ [environment]
63
+ network_mode = "public"
64
+ build_timeout_sec = 1800
65
+ cpus = 8
66
+ memory_mb = 16384
67
+ storage_mb = 30720
68
+ gpus = 0
69
+ workdir = "/workspace"
thesephist--ink.b6fd222/tests/Dockerfile ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:24.04
2
+ ENV DEBIAN_FRONTEND=noninteractive
3
+ ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org"
4
+ ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup"
5
+ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6
+ ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/"
7
+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
8
+ ENV GOPROXY="https://proxy.golang.org,direct"
9
+ ENV GOSUMDB=sum.golang.google.cn
10
+ ENV GOTOOLCHAIN=auto
11
+ ENV UV_INSECURE_HOST=""
12
+ ENV UV_INDEX_URL="https://pypi.org/simple"
13
+ ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple
14
+ ENV UV_CACHE_DIR=/workspace/.cache/uv
15
+ ENV npm_config_registry="https://registry.npmjs.org/"
16
+ ENV npm_config_strict_ssl=false
17
+ ENV npm_config_cache=/workspace/.cache/npm
18
+ ENV PIP_INDEX_URL="https://pypi.org/simple"
19
+ ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple
20
+ ENV PIP_TRUSTED_HOST=""
21
+ ENV HOME=/workspace
22
+ ENV XDG_CACHE_HOME=/workspace/.cache
23
+ ENV PIP_CACHE_DIR=/workspace/.cache/pip
24
+ ENV PYTHONUSERBASE=/workspace/.local
25
+ ENV GOROOT=/usr/local/go
26
+ ENV GOPATH=/workspace/.go
27
+ ENV GOCACHE=/workspace/.cache/go-build
28
+ ENV PIP_BREAK_SYSTEM_PACKAGES=1
29
+ ENV PATH=/opt/programgym-venv/bin:/usr/local/go/bin:/workspace/.go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
30
+ ENV PAGER=cat
31
+ ENV MANPAGER=cat
32
+ ENV LESS=-R
33
+ ENV TQDM_DISABLE=1
34
+ ENV VIRTUAL_ENV=/opt/programgym-venv
35
+ RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip curl wget xz-utils unzip zip bzip2 zstd patch file binutils python3-venv tar && rm -rf /var/lib/apt/lists/*
36
+ COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz
37
+ RUN set -eux; rm -rf /usr/local/go; tar -C /usr/local -xzf /tmp/programgym-go.tar.gz; rm -f /tmp/programgym-go.tar.gz; if [ ! -x /usr/local/go/bin/go ]; then echo "official Go tarball did not create /usr/local/go/bin/go" >&2; exit 1; fi; /usr/local/go/bin/go version
38
+ RUN python3 -m venv /opt/programgym-venv && /opt/programgym-venv/bin/python -m pip install --no-cache-dir --only-binary=:all: pytest pytest-xdist coverage
39
+ WORKDIR /workspace
40
+ ADD workspace.tar.gz /workspace/
41
+ COPY executable /workspace/executable
42
+ COPY download.sh /workspace/download.sh
43
+ RUN chmod 755 /workspace/download.sh
44
+ COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh
45
+ RUN chmod 755 /tmp/harbor_prepare_download_env.sh \
46
+ && /bin/bash /tmp/harbor_prepare_download_env.sh \
47
+ && rm -f /workspace/download.sh \
48
+ && rm -f /tmp/harbor_prepare_download_env.sh
49
+ ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh
50
+ RUN chmod 111 /workspace/executable
51
+ WORKDIR /workspace
52
+ # programgym-runtime-workspace-cleanup: v1
53
+ RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]
54
+ # Harbor uses tests/ as the separate verifier build context. Start with the
55
+ # same toolchain as the agent, then remove every cleanroom workspace artifact.
56
+ RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \
57
+ && mkdir -p /workspace /tests
58
+
59
+ # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0.
60
+ # Installing a newer pytest alone leaves that apt package importable and creates
61
+ # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log).
62
+ # Install and constrain the verifier test runner as one coherent pip toolchain.
63
+ RUN printf 'pytest<9\n' > /etc/pip-constraint.txt
64
+ ENV PIP_CONSTRAINT=/etc/pip-constraint.txt
65
+ RUN python3 -m pip install --break-system-packages \
66
+ --no-cache-dir --disable-pip-version-check \
67
+ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout
68
+
69
+ COPY test.sh /tests/test.sh
70
+ COPY programgym_evaluator.py /tests/programgym_evaluator.py
71
+ COPY programgym_task.json /tests/programgym_task.json
72
+ COPY blobs/ /tests/blobs/
73
+ RUN chmod +x /tests/test.sh
thesephist--ink.b6fd222/tests/blobs/tests/generated_module_01.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2d3aa4ad07a01c43cc32bb0e3f466bd5043c2b8e9f2961d07495a360fa7ad9c
3
+ size 5437
thesephist--ink.b6fd222/tests/blobs/tests/generated_module_02.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecf390b43a8bc133c95c6eb872ec1221d39a4b6f00bca772d028843559078e63
3
+ size 6705
thesephist--ink.b6fd222/tests/blobs/tests/generated_module_03.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca88cfeea57bf28d47334aa3b4584f0e3e4a6bdc5fe7cf5cbd2a6dc22d088c0b
3
+ size 6945
thesephist--ink.b6fd222/tests/blobs/tests/generated_module_04.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75871676709908215d26e56fca56c8d6702fbaa04b41ceb8c3af0e5a0d2f668e
3
+ size 21181
thesephist--ink.b6fd222/tests/download.sh ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1
3
+ # Generated deterministically from repository module metadata; do not edit.
4
+ set -u
5
+ export GOTOOLCHAIN=auto
6
+ mkdir -p /workspace/.programgym_build_env/go-prefetch
7
+ cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF'
8
+ module github.com/thesephist/ink
9
+
10
+ go 1.14
11
+ PROGRAMGYM_GO_MOD_EOF
12
+ PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}"
13
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
14
+ case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in
15
+ *"|"*|*","*)
16
+ PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}"
17
+ PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}"
18
+ if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then
19
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}"
20
+ fi
21
+ ;;
22
+ esac
23
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then
24
+ PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY=""
25
+ fi
26
+ cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF'
27
+ import os
28
+ import signal
29
+ import subprocess
30
+ import sys
31
+ import time
32
+
33
+ sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:]
34
+ if not command:
35
+ raise SystemExit(125)
36
+ environment = os.environ.copy()
37
+ environment["GOPROXY"] = proxy
38
+ process = subprocess.Popen(command, env=environment, start_new_session=True)
39
+ try:
40
+ returncode = process.wait(timeout=float(timeout_text))
41
+ except subprocess.TimeoutExpired:
42
+ with open(sentinel_path, "w", encoding="utf-8") as sentinel:
43
+ sentinel.write("expired\n")
44
+ try:
45
+ os.killpg(process.pid, signal.SIGTERM)
46
+ except ProcessLookupError:
47
+ pass
48
+ deadline = time.monotonic() + float(grace_text)
49
+ group_alive = True
50
+ while time.monotonic() < deadline:
51
+ process.poll()
52
+ try:
53
+ os.killpg(process.pid, 0)
54
+ except ProcessLookupError:
55
+ group_alive = False
56
+ break
57
+ time.sleep(0.05)
58
+ if group_alive:
59
+ try:
60
+ os.killpg(process.pid, signal.SIGKILL)
61
+ except ProcessLookupError:
62
+ pass
63
+ process.wait()
64
+ raise SystemExit(124)
65
+ if returncode < 0:
66
+ returncode = 128 - returncode
67
+ raise SystemExit(returncode)
68
+ PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF
69
+ PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}"
70
+ if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
71
+ printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2
72
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
73
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
74
+ return 1
75
+ else
76
+ exit 1
77
+ fi
78
+ fi
79
+ if ! command -v python3 >/dev/null 2>&1; then
80
+ printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2
81
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
82
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
83
+ return 1
84
+ else
85
+ exit 1
86
+ fi
87
+ fi
88
+ _programgym_go_with_nexus_timeout() {
89
+ local programgym_go_rc
90
+ local programgym_go_timeout_sentinel
91
+ if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then
92
+ return 1
93
+ fi
94
+ if python3 /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py "$programgym_go_timeout_sentinel" "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" "5" "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" "$@"; then
95
+ programgym_go_rc=0
96
+ else
97
+ programgym_go_rc=$?
98
+ fi
99
+ if [ ! -s "$programgym_go_timeout_sentinel" ]; then
100
+ rm -f "$programgym_go_timeout_sentinel"
101
+ return "$programgym_go_rc"
102
+ fi
103
+ rm -f "$programgym_go_timeout_sentinel"
104
+ if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then
105
+ printf '%s\n' "download.sh: primary Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; GOPROXY has no explicit non-empty fallback remainder" >&2
106
+ return "$programgym_go_rc"
107
+ fi
108
+ printf '%s\n' "download.sh: Nexus-first Go request exceeded ${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}s; retrying with GOPROXY=${PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY}" >&2
109
+ env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@"
110
+ }
111
+ PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)"
112
+ if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then
113
+ printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2
114
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
115
+ if [ "${BASH_SOURCE[0]}" != "$0" ]; then
116
+ return 1
117
+ else
118
+ exit 1
119
+ fi
120
+ fi
121
+ if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then
122
+ PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain
123
+ mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
124
+ cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/"
125
+ export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT"
126
+ else
127
+ export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT"
128
+ fi
129
+ export PATH="$GOROOT/bin:$PATH"
130
+ export GOTOOLCHAIN=local
131
+ # No external Go module dependencies to prefetch.
132
+ rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py
133
+ unset -f _programgym_go_with_nexus_timeout
134
+ unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY
135
+ unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY
136
+ unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY
137
+ unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER
138
+ unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS
thesephist--ink.b6fd222/tests/executable ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae9b4d923ec9dc78382a8c855ed0d67da2f7a8ae40c0fa5a5c7338fa419f4532
3
+ size 9449646
thesephist--ink.b6fd222/tests/harbor_prepare_download_env.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd /workspace
4
+ set -a
5
+ source /workspace/download.sh
6
+ set +a
7
+ python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh
8
+ import os
9
+ import shlex
10
+
11
+ ignored = {
12
+ "ALL_PROXY",
13
+ "HTTP_PROXY",
14
+ "HTTPS_PROXY",
15
+ "NO_PROXY",
16
+ "OLDPWD",
17
+ "PIP_PROXY",
18
+ "PWD",
19
+ "SHLVL",
20
+ "_",
21
+ "all_proxy",
22
+ "http_proxy",
23
+ "https_proxy",
24
+ "no_proxy",
25
+ "pip_proxy",
26
+ }
27
+ for key in sorted(os.environ):
28
+ if key in ignored or key.startswith("BASH_FUNC_"):
29
+ continue
30
+ value = os.environ[key]
31
+ if "\n" in value:
32
+ continue
33
+ print(f"export {key}={shlex.quote(value)}")
34
+ PY
thesephist--ink.b6fd222/tests/programgym-go.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3
3
+ size 59908810
thesephist--ink.b6fd222/tests/programgym_evaluator.py ADDED
@@ -0,0 +1,1201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """In-place ProgramGym evaluator.
3
+
4
+ Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container,
5
+ no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's
6
+ cleanroom container after Harbor flips the verifier-phase network policy.
7
+
8
+ Differences from ``programgym.eval.eval.Evaluator`` that are structural to
9
+ running in one container:
10
+
11
+ * No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace``
12
+ copy a post-compile workspace snapshot to a temp directory and restore it
13
+ before each branch; ``cleanup_lingering_processes`` kills leftover branch
14
+ processes between attempts to approximate the fresh-container boundary.
15
+ * No ``docker commit``. The post-compile workspace snapshot serves the same
16
+ role as the committed image upstream.
17
+ * Hidden test blobs are fetched on demand from HuggingFace via
18
+ ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``)
19
+ rather than being pre-staged into ``/tests/blobs/``. Override with
20
+ ``PROGRAMGYM_BLOB_DIR`` for offline reruns.
21
+
22
+ Everything else (eval_clean_hashes scrub, deterministic synthetic git seed,
23
+ ``compile.sh`` then stash + hash the executable, best-effort
24
+ ``pytest-rerunfailures``, per-branch test-tar overlay, executable hash
25
+ ``--max-worker-restart=4``, xdist worker-crash retry with serial fallback,
26
+ best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is
27
+ preserved.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import hashlib
33
+ import json
34
+ import os
35
+ import re
36
+ import shlex
37
+ import shutil
38
+ import signal
39
+ import subprocess
40
+ import tempfile
41
+ import time
42
+ import traceback
43
+ import xml.etree.ElementTree as ET
44
+ from pathlib import Path
45
+ from typing import Any
46
+
47
+ WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace"))
48
+ STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify")
49
+ METADATA_PATH = Path(
50
+ os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json")
51
+ )
52
+ LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier"))
53
+ WORKER_CRASH_PHRASE = "worker '"
54
+ XDIST_COLLAPSE_MARKERS = (
55
+ "maximum crashed workers reached",
56
+ "xdist: maximum crashed",
57
+ )
58
+
59
+ DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests"
60
+ DEFAULT_HF_REVISION = "main"
61
+
62
+ # Oracle agent handoff files (see solution/solve.sh). Must not appear in the
63
+ # post-compile workspace snapshot or they pollute tree-scanning tests (dutree).
64
+ _ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",)
65
+
66
+ _TOOLCHAIN_BIN_DIR_CANDIDATES = (
67
+ "/usr/local/go/bin",
68
+ "/go/bin",
69
+ "/usr/local/cargo/bin",
70
+ "/root/.cargo/bin",
71
+ "/root/.ghcup/bin",
72
+ )
73
+
74
+
75
+ def toolchain_bin_dirs() -> list[str]:
76
+ """Return toolchain bin directories that exist on this image."""
77
+ candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES)
78
+ candidates.extend(
79
+ str(path)
80
+ for path in sorted(Path("/usr/lib").glob("go-*/bin"))
81
+ if _is_accessible_dir(path)
82
+ )
83
+ seen: set[str] = set()
84
+ present: list[str] = []
85
+ for path in candidates:
86
+ if path in seen:
87
+ continue
88
+ seen.add(path)
89
+ if _is_accessible_dir(path):
90
+ present.append(path)
91
+ return present
92
+
93
+
94
+ def _is_accessible_dir(path: str | Path) -> bool:
95
+ """Return whether path is a directory without failing on protected homes."""
96
+ try:
97
+ return Path(path).is_dir()
98
+ except OSError:
99
+ return False
100
+
101
+
102
+ def bootstrap_toolchain_path() -> str:
103
+ """Prepend discovered toolchain dirs to PATH (idempotent)."""
104
+ prepend = toolchain_bin_dirs()
105
+ current_parts = [part for part in os.environ.get("PATH", "").split(":") if part]
106
+ merged: list[str] = []
107
+ for path in prepend + current_parts:
108
+ if path not in merged:
109
+ merged.append(path)
110
+ new_path = ":".join(merged)
111
+ os.environ["PATH"] = new_path
112
+ return new_path
113
+
114
+
115
+ def _bash_login_command(command: str) -> str:
116
+ """Run ``command`` under bash -lc with an explicit PATH export."""
117
+ path = bootstrap_toolchain_path()
118
+ return f"export PATH={shlex.quote(path)}; {command}"
119
+
120
+
121
+ def sha256(path: Path) -> str:
122
+ h = hashlib.sha256()
123
+ with path.open("rb") as f:
124
+ for chunk in iter(lambda: f.read(1024 * 1024), b""):
125
+ h.update(chunk)
126
+ return h.hexdigest()
127
+
128
+
129
+ def write_json(path: Path, data: dict[str, Any]) -> None:
130
+ tmp = path.with_suffix(path.suffix + ".tmp")
131
+ tmp.write_text(json.dumps(data, indent=2, sort_keys=True))
132
+ tmp.replace(path)
133
+
134
+
135
+ def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str:
136
+ if path is None or not path.exists():
137
+ return ""
138
+ data = path.read_bytes()
139
+ if len(data) <= max_bytes:
140
+ return data.decode(errors="replace")
141
+ return data[-max_bytes:].decode(errors="replace")
142
+
143
+
144
+ def _close_pipes(proc: subprocess.Popen[Any]) -> None:
145
+ for stream in (proc.stdout, proc.stderr):
146
+ if stream is not None:
147
+ try:
148
+ stream.close()
149
+ except OSError:
150
+ pass
151
+
152
+
153
+ def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None:
154
+ try:
155
+ os.killpg(proc.pid, signal.SIGKILL)
156
+ except ProcessLookupError:
157
+ pass
158
+ try:
159
+ proc.kill()
160
+ except ProcessLookupError:
161
+ pass
162
+
163
+
164
+ _PKILL_PATTERNS = (
165
+ f"{WORKSPACE}/eval/",
166
+ f"{WORKSPACE}/tests/",
167
+ "tail -f",
168
+ "development.log",
169
+ " less ",
170
+ " less$",
171
+ "/less ",
172
+ )
173
+
174
+
175
+ def _pkill_aggressive() -> str:
176
+ """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback)."""
177
+ notes: list[str] = []
178
+ workspace = str(WORKSPACE)
179
+ patterns = list(_PKILL_PATTERNS) + [
180
+ f"pytest.*{workspace}",
181
+ f"xdist.*{workspace}",
182
+ ]
183
+ for pattern in patterns:
184
+ result = subprocess.run(
185
+ ["pkill", "-9", "-f", pattern],
186
+ capture_output=True,
187
+ text=True,
188
+ )
189
+ notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}")
190
+ return "\n".join(notes)
191
+
192
+
193
+ def run_step(
194
+ command: str,
195
+ cwd: Path,
196
+ *,
197
+ timeout: int,
198
+ env: dict[str, str] | None = None,
199
+ step: str,
200
+ accept_failure: bool = False,
201
+ log_output: bool | None = None,
202
+ max_output_bytes: int = 65536,
203
+ ) -> dict[str, Any]:
204
+ if log_output is None:
205
+ log_output = step == "run_tests" or timeout >= 60
206
+
207
+ started = time.monotonic()
208
+ stdout_path: Path | None = None
209
+ stderr_path: Path | None = None
210
+ stdout_f = None
211
+ stderr_f = None
212
+
213
+ if log_output:
214
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
215
+ log_id = f"{step}-{int(started * 1000)}"
216
+ stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log"
217
+ stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log"
218
+ stdout_f = stdout_path.open("w", encoding="utf-8")
219
+ stderr_f = stderr_path.open("w", encoding="utf-8")
220
+ popen_stdout: Any = stdout_f
221
+ popen_stderr: Any = stderr_f
222
+ else:
223
+ popen_stdout = subprocess.PIPE
224
+ popen_stderr = subprocess.PIPE
225
+
226
+ proc = subprocess.Popen(
227
+ ["bash", "-lc", _bash_login_command(command)],
228
+ cwd=cwd,
229
+ env={**os.environ, **(env or {})},
230
+ stdout=popen_stdout,
231
+ stderr=popen_stderr,
232
+ start_new_session=True,
233
+ text=True,
234
+ )
235
+ timed_out = False
236
+ stdout = ""
237
+ stderr = ""
238
+ try:
239
+ if log_output:
240
+ proc.wait(timeout=timeout)
241
+ else:
242
+ stdout, stderr = proc.communicate(timeout=timeout)
243
+ except subprocess.TimeoutExpired:
244
+ timed_out = True
245
+ _terminate_process_tree(proc)
246
+ cleanup_lingering_processes(aggressive=True)
247
+ try:
248
+ proc.wait(timeout=5)
249
+ except subprocess.TimeoutExpired:
250
+ proc.kill()
251
+ if not log_output:
252
+ _close_pipes(proc)
253
+ finally:
254
+ if stdout_f is not None:
255
+ stdout_f.close()
256
+ if stderr_f is not None:
257
+ stderr_f.close()
258
+
259
+ if timed_out:
260
+ if log_output:
261
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
262
+ stderr_path, max_output_bytes
263
+ )
264
+ else:
265
+ output = ""
266
+ entry = {
267
+ "step": step,
268
+ "command": command,
269
+ "wall_time": time.monotonic() - started,
270
+ "output": output,
271
+ "returncode": 124,
272
+ "exception_info": f"timed out after {timeout}s",
273
+ }
274
+ else:
275
+ if log_output:
276
+ output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail(
277
+ stderr_path, max_output_bytes
278
+ )
279
+ else:
280
+ output = stdout + stderr
281
+ entry = {
282
+ "step": step,
283
+ "command": command,
284
+ "wall_time": time.monotonic() - started,
285
+ "output": output,
286
+ "returncode": proc.returncode,
287
+ "exception_info": "",
288
+ }
289
+ if entry["returncode"] and not accept_failure:
290
+ raise RuntimeError(
291
+ f"{step} failed: {entry['exception_info'] or entry['output']}"
292
+ )
293
+ return entry
294
+
295
+
296
+ def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]:
297
+ started = time.monotonic()
298
+ patterns = [
299
+ str(WORKSPACE / "executable"),
300
+ f"{WORKSPACE}/eval/",
301
+ f"{WORKSPACE}/tests/",
302
+ # lazygit --logs/-l tests spawn `tail -f` outside /workspace/.
303
+ "tail -f",
304
+ "development.log",
305
+ ]
306
+ killed: list[int] = []
307
+ proc_root = Path("/proc")
308
+ proc_available = proc_root.exists()
309
+ if proc_available:
310
+ for proc_dir in proc_root.iterdir():
311
+ if not proc_dir.name.isdigit():
312
+ continue
313
+ pid = int(proc_dir.name)
314
+ if pid in {os.getpid(), os.getppid()}:
315
+ continue
316
+ try:
317
+ raw = (proc_dir / "cmdline").read_bytes()
318
+ except (FileNotFoundError, PermissionError, ProcessLookupError):
319
+ continue
320
+ cmdline = raw.replace(b"\0", b" ").decode(errors="replace")
321
+ if not any(pattern in cmdline for pattern in patterns):
322
+ continue
323
+ try:
324
+ os.kill(pid, signal.SIGKILL)
325
+ except (PermissionError, ProcessLookupError):
326
+ continue
327
+ killed.append(pid)
328
+ pkill_output = ""
329
+ if aggressive or not proc_available:
330
+ pkill_output = _pkill_aggressive()
331
+ output_parts = []
332
+ if killed:
333
+ output_parts.append("\n".join(str(pid) for pid in killed))
334
+ if pkill_output:
335
+ output_parts.append(pkill_output)
336
+ return {
337
+ "step": "cleanup_lingering_processes",
338
+ "command": "kill leftover branch processes referencing the workspace",
339
+ "wall_time": time.monotonic() - started,
340
+ "output": "\n".join(output_parts),
341
+ "returncode": 0,
342
+ "exception_info": "",
343
+ }
344
+
345
+
346
+ def extract_trusted_blob(tar_path: Path, dest: Path) -> None:
347
+ import tarfile
348
+
349
+ with tarfile.open(tar_path, "r:gz") as tf:
350
+ try:
351
+ tf.extractall(dest, filter="fully_trusted")
352
+ except TypeError:
353
+ tf.extractall(dest)
354
+
355
+
356
+ def find_results_xml() -> Path | None:
357
+ """Return the junit xml path if pytest wrote one."""
358
+ for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"):
359
+ if candidate.exists():
360
+ return candidate
361
+ return None
362
+
363
+
364
+ def remove_oracle_handoff_artifacts() -> list[str]:
365
+ """Drop oracle-agent handoff files from /workspace before snapshot/restore."""
366
+ removed: list[str] = []
367
+ for name in _ORACLE_HANDOFF_NAMES:
368
+ path = WORKSPACE / name
369
+ if path.exists():
370
+ if path.is_dir():
371
+ shutil.rmtree(path)
372
+ else:
373
+ path.unlink()
374
+ removed.append(name)
375
+ return removed
376
+
377
+
378
+ def _remove_tree(path: Path) -> None:
379
+ """Remove a file or directory tree, with a shell fallback for overlay races."""
380
+ if path.is_symlink() or path.is_file():
381
+ path.unlink(missing_ok=True)
382
+ return
383
+ if not path.is_dir():
384
+ path.unlink(missing_ok=True)
385
+ return
386
+ for attempt in range(3):
387
+ try:
388
+ shutil.rmtree(path)
389
+ if not path.exists():
390
+ return
391
+ except OSError:
392
+ if attempt == 2:
393
+ run_step(
394
+ f"rm -rf {shlex.quote(str(path))}",
395
+ path.parent,
396
+ timeout=120,
397
+ step="clear_workspace_fallback",
398
+ accept_failure=True,
399
+ )
400
+ if not path.exists():
401
+ return
402
+ raise
403
+
404
+
405
+ def ensure_workspace_dir() -> None:
406
+ """Guarantee WORKSPACE exists as a writable directory (not a symlink/file)."""
407
+ if WORKSPACE.exists() and not WORKSPACE.is_dir():
408
+ if WORKSPACE.is_symlink() or WORKSPACE.is_file():
409
+ WORKSPACE.unlink()
410
+ else:
411
+ shutil.rmtree(WORKSPACE)
412
+ WORKSPACE.mkdir(parents=True, exist_ok=True)
413
+
414
+
415
+ def clear_workspace() -> None:
416
+ ensure_workspace_dir()
417
+ for path in list(WORKSPACE.iterdir()):
418
+ _remove_tree(path)
419
+
420
+
421
+ def restore_reference_executable() -> None:
422
+ """Write the stashed reference binary into /workspace after a branch overlay.
423
+
424
+ Branch blobs may ship ``executable`` as a dangling symlink into
425
+ ``target/release/...``; ``shutil.copy2`` would follow it and raise
426
+ ``FileNotFoundError``. Drop whatever the blob left and copy the stashed
427
+ reference as a regular file.
428
+ """
429
+ ensure_workspace_dir()
430
+ if not STASHED_EXECUTABLE.is_file():
431
+ raise FileNotFoundError(
432
+ f"missing stashed reference executable at {STASHED_EXECUTABLE}"
433
+ )
434
+ dest = WORKSPACE / "executable"
435
+ if dest.exists() or dest.is_symlink():
436
+ if dest.is_dir():
437
+ shutil.rmtree(dest)
438
+ else:
439
+ dest.unlink(missing_ok=True)
440
+ shutil.copy2(STASHED_EXECUTABLE, dest)
441
+ dest.chmod(0o755)
442
+
443
+
444
+ def snapshot_workspace(dest: Path) -> None:
445
+ if dest.exists():
446
+ shutil.rmtree(dest)
447
+ shutil.copytree(WORKSPACE, dest, symlinks=True)
448
+
449
+
450
+ def restore_workspace(source: Path) -> None:
451
+ clear_workspace()
452
+ shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True)
453
+ ensure_workspace_dir()
454
+
455
+
456
+ def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]:
457
+ removed: list[str] = []
458
+ for path in root.rglob("*"):
459
+ if path.is_file() and not path.is_symlink():
460
+ try:
461
+ if sha256(path) in hashes:
462
+ path.unlink()
463
+ removed.append(str(path.relative_to(root)))
464
+ except OSError:
465
+ continue
466
+ return removed
467
+
468
+
469
+ def branch_tests(branch_info: dict[str, Any]) -> list[str]:
470
+ ignored = {
471
+ item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item
472
+ }
473
+ return [name for name in branch_info.get("tests", []) if name not in ignored]
474
+
475
+
476
+ def ignored_tests(metadata: dict[str, Any]) -> set[str]:
477
+ result: set[str] = set()
478
+ for branch, info in metadata.get("branches", {}).items():
479
+ result.update(
480
+ f"{branch}/{item['name']}"
481
+ for item in info.get("ignored_tests", [])
482
+ if "name" in item
483
+ )
484
+ return result
485
+
486
+
487
+ def active_tests(metadata: dict[str, Any]) -> set[str]:
488
+ active: set[str] = set()
489
+ for branch, info in metadata.get("branches", {}).items():
490
+ if info.get("ignored"):
491
+ continue
492
+ ignored = {
493
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
494
+ }
495
+ active.update(
496
+ f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored
497
+ )
498
+ return active
499
+
500
+
501
+ def inject_not_run(
502
+ result: dict[str, Any], branch: str, tests: list[str], error_code: str
503
+ ) -> None:
504
+ result["test_results"].extend(
505
+ {
506
+ "name": name,
507
+ "branch": branch,
508
+ "status": "not_run",
509
+ "extra": {"error_code": error_code},
510
+ }
511
+ for name in tests
512
+ )
513
+
514
+
515
+ def testcase_name(case: ET.Element) -> str:
516
+ classname = case.attrib.get("classname", "")
517
+ name = case.attrib.get("name", "")
518
+ return f"{classname}.{name}" if classname else name
519
+
520
+
521
+ # Only these tags under <testcase> represent a result. <system-out> /
522
+ # <system-err> are stdout/stderr captures and must not be treated as results
523
+ # (a leading <system-out> followed by <failure> would otherwise be classified
524
+ # as a stdout-only "passed").
525
+ JUNIT_RESULT_TAGS = {"skipped", "failure", "error"}
526
+
527
+
528
+ def parse_junit(
529
+ raw_xml: str, branch: str, expected: list[str], ignored: set[str]
530
+ ) -> tuple[list[dict[str, Any]], list[str]]:
531
+ root = ET.fromstring(raw_xml)
532
+ got: set[str] = set()
533
+ results: list[dict[str, Any]] = []
534
+ for case in root.iter("testcase"):
535
+ name = testcase_name(case)
536
+ got.add(name)
537
+ extra: dict[str, Any] = {}
538
+ if "time" in case.attrib:
539
+ try:
540
+ extra["time"] = float(case.attrib["time"])
541
+ except ValueError:
542
+ extra["time"] = case.attrib["time"]
543
+ result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS]
544
+ # Collapse duplicate same-tag result children. Pytest's
545
+ # "pytest.internal" pseudo-test sometimes emits two identical <error>
546
+ # entries; treating that as a system_error would over-flag a real
547
+ # single failure. Mirrors upstream eval.py:816-820.
548
+ if len(result_children) > 1 and len({c.tag for c in result_children}) == 1:
549
+ result_children = [result_children[0]]
550
+ if not result_children:
551
+ status = "passed"
552
+ elif len(result_children) != 1:
553
+ status = "system_error"
554
+ extra["error_details"] = (
555
+ f"Expected 1 result for {name}, got {len(result_children)}: "
556
+ f"{[c.tag for c in result_children]}"
557
+ )
558
+ else:
559
+ first = result_children[0]
560
+ status = first.tag # "skipped" | "failure" | "error"
561
+ extra["message"] = first.attrib.get("message") or ""
562
+ if first.text:
563
+ extra["text"] = first.text
564
+ results.append(
565
+ {"name": name, "branch": branch, "status": status, "extra": extra}
566
+ )
567
+
568
+ active_expected = [name for name in expected if name not in ignored]
569
+ missing = [name for name in active_expected if name not in got]
570
+ results.extend(
571
+ {
572
+ "name": name,
573
+ "branch": branch,
574
+ "status": "not_run",
575
+ "extra": {"error_code": "missing_from_junit_xml"},
576
+ }
577
+ for name in missing
578
+ )
579
+ unexpected = got - set(expected) - ignored
580
+ warnings = (
581
+ [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"]
582
+ if unexpected
583
+ else []
584
+ )
585
+ return results, warnings
586
+
587
+
588
+ def count_worker_crashes(raw_xml: str) -> int:
589
+ if WORKER_CRASH_PHRASE not in raw_xml:
590
+ return 0
591
+ try:
592
+ root = ET.fromstring(raw_xml)
593
+ except ET.ParseError:
594
+ return 0
595
+ crashes = 0
596
+ for case in root.iter("testcase"):
597
+ for child in case:
598
+ text = (child.get("message") or "") + " " + (child.text or "")
599
+ if (
600
+ child.tag in {"error", "failure"}
601
+ and WORKER_CRASH_PHRASE in text
602
+ and "crashed" in text
603
+ ):
604
+ crashes += 1
605
+ break
606
+ return crashes
607
+
608
+
609
+ def run_output_indicates_xdist_collapse(output: str) -> bool:
610
+ lower = output.lower()
611
+ return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS)
612
+
613
+
614
+ def count_junit_failures(raw_xml: str) -> int:
615
+ try:
616
+ root = ET.fromstring(raw_xml)
617
+ except ET.ParseError:
618
+ return 0
619
+ failures = 0
620
+ for case in root.iter("testcase"):
621
+ for child in case:
622
+ if child.tag in {"failure", "error"}:
623
+ failures += 1
624
+ break
625
+ return failures
626
+
627
+
628
+ def count_junit_passed(raw_xml: str) -> int:
629
+ try:
630
+ root = ET.fromstring(raw_xml)
631
+ except ET.ParseError:
632
+ return 0
633
+ passed = 0
634
+ for case in root.iter("testcase"):
635
+ if not any(child.tag in JUNIT_RESULT_TAGS for child in case):
636
+ passed += 1
637
+ return passed
638
+
639
+
640
+ def branch_attempt_metrics(
641
+ raw_xml: str, *, run_output: str, expected_tests: int
642
+ ) -> tuple[int, int, int, int]:
643
+ """Return (crashes, n_testcases, failures, missing_from_xml)."""
644
+ crashes = count_worker_crashes(raw_xml)
645
+ if run_output_indicates_xdist_collapse(run_output):
646
+ crashes = max(crashes, 1)
647
+ n_tests = count_testcases(raw_xml)
648
+ failures = count_junit_failures(raw_xml)
649
+ missing = max(0, expected_tests - n_tests)
650
+ return crashes, n_tests, failures, missing
651
+
652
+
653
+ def needs_serial_retry(
654
+ *,
655
+ serial: bool,
656
+ crashes: int,
657
+ missing: int,
658
+ failures: int,
659
+ n_tests: int,
660
+ expected_tests: int,
661
+ run_output: str,
662
+ ) -> bool:
663
+ if serial:
664
+ return False
665
+ high_failure_rate = (
666
+ expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8
667
+ )
668
+ return (
669
+ crashes > 0
670
+ or missing > 0
671
+ or high_failure_rate
672
+ or run_output_indicates_xdist_collapse(run_output)
673
+ )
674
+
675
+
676
+ def count_testcases(raw_xml: str) -> int:
677
+ try:
678
+ return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase"))
679
+ except ET.ParseError:
680
+ return 0
681
+
682
+
683
+ def scored_results(
684
+ result: dict[str, Any], metadata: dict[str, Any]
685
+ ) -> list[dict[str, Any]]:
686
+ active = active_tests(metadata)
687
+ by_key = {
688
+ f"{test['branch']}/{test['name']}": test
689
+ for test in result["test_results"]
690
+ if f"{test['branch']}/{test['name']}" in active
691
+ }
692
+ return [
693
+ by_key.get(
694
+ key,
695
+ {
696
+ "branch": key.split("/", 1)[0],
697
+ "name": key.split("/", 1)[1],
698
+ "status": "not_run",
699
+ "extra": {"error_code": "missing_from_results"},
700
+ },
701
+ )
702
+ for key in sorted(active)
703
+ ]
704
+
705
+
706
+ def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
707
+ scored = scored_results(result, metadata)
708
+ n_passed = sum(t["status"] == "passed" for t in scored)
709
+ n_tests = len(scored)
710
+ pass_rate = n_passed / n_tests if n_tests else 0.0
711
+ # Multi-key reward: Harbor's default Mean aggregates each key independently
712
+ # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is
713
+ # the proportion of tasks scoring a perfect pass-rate and mean of
714
+ # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the
715
+ # per-task pass-rate whose mean is the overall mean reward.
716
+ return {
717
+ "reward": pass_rate,
718
+ "resolved": 1.0 if pass_rate >= 1.0 else 0.0,
719
+ "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0,
720
+ }
721
+
722
+
723
+ def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]:
724
+ scored = scored_results(result, metadata)
725
+ n_passed = sum(t["status"] == "passed" for t in scored)
726
+ n_tests = len(scored)
727
+ pass_rate = n_passed / n_tests if n_tests else 0.0
728
+ return {
729
+ "pass_rate": pass_rate,
730
+ "resolved": int(
731
+ bool(
732
+ n_tests
733
+ and n_passed == n_tests
734
+ and not result["test_branch_errors"]
735
+ and not result["error_code"]
736
+ )
737
+ ),
738
+ "n_passed": n_passed,
739
+ "n_tests": n_tests,
740
+ "n_branch_errors": len(result["test_branch_errors"]),
741
+ "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])),
742
+ "executable_hash_present": int(bool(result.get("executable_hash"))),
743
+ }
744
+
745
+
746
+ def use_script_pty() -> bool:
747
+ return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1"
748
+
749
+
750
+ def script_pty_available() -> bool:
751
+ return shutil.which("script") is not None
752
+
753
+
754
+ def branch_env(
755
+ *,
756
+ serial: bool,
757
+ has_rerunfailures: bool,
758
+ extras: dict[str, str] | None = None,
759
+ ) -> dict[str, str]:
760
+ addopts = ["--max-worker-restart=4"]
761
+ # A serial fallback is already a complete second execution. Re-running each
762
+ # failing test two more times makes large, failure-heavy suites prohibitively
763
+ # slow and adds little signal.
764
+ if has_rerunfailures and not serial:
765
+ addopts.extend(["--reruns=2", "--reruns-delay=1"])
766
+ env = {
767
+ "PYTEST_ADDOPTS": " ".join(addopts),
768
+ # Match upstream non-TTY regression environments (dirble log format, etc.).
769
+ "NO_COLOR": "1",
770
+ "TERM": "dumb",
771
+ "CLICOLOR": "0",
772
+ "CLICOLOR_FORCE": "0",
773
+ "COLORTERM": "",
774
+ }
775
+ if extras:
776
+ env.update(extras)
777
+ xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS")
778
+ if serial:
779
+ xdist_workers = "1"
780
+ if xdist_workers:
781
+ env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers
782
+ return env
783
+
784
+
785
+ _SERIAL_RUN_SH = ".programgym_run_serial.sh"
786
+ # ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides
787
+ # ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries.
788
+ _RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)")
789
+
790
+
791
+ def prepare_serial_run_sh(run_sh: Path) -> Path:
792
+ """Write a serial-only copy of ``eval/run.sh`` with xdist disabled."""
793
+ serial_sh = run_sh.with_name(_SERIAL_RUN_SH)
794
+ patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text())
795
+ serial_sh.write_text(patched)
796
+ serial_sh.chmod(0o755)
797
+ return serial_sh
798
+
799
+
800
+ def run_tests_command(*, serial: bool) -> str:
801
+ if serial:
802
+ inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}"
803
+ else:
804
+ inner = "chmod +x ./eval/run.sh && ./eval/run.sh"
805
+ if use_script_pty() and script_pty_available():
806
+ return f"script -q -c {shlex.quote(inner)} /dev/null"
807
+ return inner
808
+
809
+
810
+ BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs"))
811
+
812
+
813
+ def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path:
814
+ """Locate the per-instance blob directory.
815
+
816
+ Resolution order:
817
+
818
+ 1. ``/tests/blobs/`` if pre-fetched into the task at generation time
819
+ (``programgym-adapter --download-blobs``). Verifier-only mount, so
820
+ agent never sees these.
821
+ 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped
822
+ tree on disk (``<dir>/<instance_id>/tests/<branch>.tar.gz``). Useful
823
+ for offline reruns sharing a cache across many tasks.
824
+ 3. ``huggingface_hub.snapshot_download`` from
825
+ ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision).
826
+
827
+ The returned directory contains ``tests/<branch>.tar.gz`` per active
828
+ branch — same shape as ``programgym/ProgramGym-Tests/<instance_id>/``
829
+ on HF.
830
+ """
831
+ if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists():
832
+ return BAKED_BLOB_DIR
833
+
834
+ local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip()
835
+ if local:
836
+ candidate = Path(local) / instance_id
837
+ if candidate.exists():
838
+ return candidate
839
+ raise FileNotFoundError(
840
+ f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist"
841
+ )
842
+
843
+ repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get(
844
+ "hf_repo_id", DEFAULT_HF_REPO_ID
845
+ )
846
+ revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get(
847
+ "hf_revision", DEFAULT_HF_REVISION
848
+ )
849
+
850
+ from huggingface_hub import snapshot_download
851
+
852
+ cache_root = Path(
853
+ snapshot_download(
854
+ repo_id,
855
+ repo_type="dataset",
856
+ revision=revision,
857
+ allow_patterns=f"{instance_id}/**",
858
+ )
859
+ )
860
+ blob_dir = cache_root / instance_id
861
+ if not blob_dir.exists():
862
+ raise FileNotFoundError(
863
+ f"HF blob directory missing for {instance_id} at {blob_dir}"
864
+ )
865
+ return blob_dir
866
+
867
+
868
+ def evaluate(metadata: dict[str, Any]) -> dict[str, Any]:
869
+ bootstrap_toolchain_path()
870
+ branches = metadata.get("branches", {})
871
+ active_branch_items = [
872
+ (name, info) for name, info in branches.items() if not info.get("ignored")
873
+ ]
874
+ result: dict[str, Any] = {
875
+ "test_results": [],
876
+ "error_code": None,
877
+ "error_details": None,
878
+ "log": [],
879
+ "solution_branch": "submission",
880
+ "test_branches": [name for name, _ in active_branch_items],
881
+ "test_branch_errors": {},
882
+ "executable_hash": None,
883
+ "warnings": [],
884
+ }
885
+
886
+ instance_id = metadata["instance_id"]
887
+
888
+ compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900"))
889
+ branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600"))
890
+
891
+ def fail_all(error_code: str, details: str) -> dict[str, Any]:
892
+ result["error_code"] = error_code
893
+ result["error_details"] = details
894
+ for branch, info in active_branch_items:
895
+ inject_not_run(result, branch, branch_tests(info), error_code)
896
+ return result
897
+
898
+ with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp:
899
+ compiled_snapshot = Path(tmp) / "compiled"
900
+
901
+ started = time.monotonic()
902
+ removed = remove_hashed_files(
903
+ WORKSPACE, set(metadata.get("eval_clean_hashes", []))
904
+ )
905
+ result["log"].append(
906
+ {
907
+ "step": "remove_hashed_files",
908
+ "command": "remove files matching eval_clean_hashes",
909
+ "wall_time": time.monotonic() - started,
910
+ "output": "".join(f"removed '{path}'\n" for path in removed),
911
+ "returncode": 0,
912
+ "exception_info": "",
913
+ }
914
+ )
915
+
916
+ compile_sh = WORKSPACE / "compile.sh"
917
+ if not compile_sh.exists():
918
+ return fail_all(
919
+ "missing_compile_sh", "submission did not contain compile.sh"
920
+ )
921
+
922
+ seed = (
923
+ "if [ ! -d .git ]; then "
924
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
925
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
926
+ "git -c init.defaultBranch=gold init -q && "
927
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && "
928
+ "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' "
929
+ "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' "
930
+ "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; "
931
+ "fi"
932
+ )
933
+ try:
934
+ result["log"].append(
935
+ run_step(seed, WORKSPACE, timeout=300, step="seed_git")
936
+ )
937
+ compile_log = run_step(
938
+ "chmod +x ./compile.sh && ./compile.sh",
939
+ WORKSPACE,
940
+ timeout=compile_timeout,
941
+ step="compile",
942
+ accept_failure=True,
943
+ )
944
+ result["log"].append(compile_log)
945
+ if compile_log["returncode"]:
946
+ return fail_all("compile_failed", compile_log["output"])
947
+ executable = WORKSPACE / "executable"
948
+ if not executable.exists():
949
+ return fail_all(
950
+ "missing_executable",
951
+ "compile.sh completed but did not create ./executable",
952
+ )
953
+ STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True)
954
+ # `move` (not copy) so /workspace doesn't keep a parallel copy of
955
+ # the agent's executable during the stash→restore window. Mirrors
956
+ # upstream `mv ./executable {STASHED}` (eval.py:472).
957
+ shutil.move(str(executable), STASHED_EXECUTABLE)
958
+ result["executable_hash"] = sha256(STASHED_EXECUTABLE)
959
+ result["log"].append(
960
+ run_step(
961
+ "pip3 install -q --disable-pip-version-check pytest-rerunfailures",
962
+ WORKSPACE,
963
+ timeout=120,
964
+ step="install_rerunfailures",
965
+ accept_failure=True,
966
+ )
967
+ )
968
+ has_rerunfailures = result["log"][-1]["returncode"] == 0
969
+ handoff_removed = remove_oracle_handoff_artifacts()
970
+ if handoff_removed:
971
+ result["log"].append(
972
+ {
973
+ "step": "remove_oracle_handoff",
974
+ "command": "remove oracle handoff artifacts from workspace",
975
+ "wall_time": 0.0,
976
+ "output": "".join(
977
+ f"removed '{name}'\n" for name in handoff_removed
978
+ ),
979
+ "returncode": 0,
980
+ "exception_info": "",
981
+ }
982
+ )
983
+ snapshot_workspace(compiled_snapshot)
984
+ except Exception as exc:
985
+ return fail_all(type(exc).__name__, str(exc))
986
+
987
+ try:
988
+ blob_dir = resolve_blob_dir(instance_id, metadata)
989
+ except Exception as exc:
990
+ details = f"{type(exc).__name__}: {exc}"
991
+ for branch, info in active_branch_items:
992
+ result["test_branch_errors"][branch] = [
993
+ {
994
+ "error_code": "blob_resolution_failed",
995
+ "error_details": details,
996
+ }
997
+ ]
998
+ inject_not_run(
999
+ result, branch, branch_tests(info), "blob_resolution_failed"
1000
+ )
1001
+ return result
1002
+
1003
+ for branch, info in active_branch_items:
1004
+ tests = branch_tests(info)
1005
+ blob = blob_dir / "tests" / f"{branch}.tar.gz"
1006
+ if not blob.exists():
1007
+ result["test_branch_errors"][branch] = [
1008
+ {"error_code": "missing_test_blob", "error_details": blob.name}
1009
+ ]
1010
+ inject_not_run(result, branch, tests, "missing_test_blob")
1011
+ continue
1012
+
1013
+ best_xml = ""
1014
+ # Prefer a complete, clean XML result, then the result covering the
1015
+ # most expected tests, and only then the one with the most passes.
1016
+ # Pass-count-only ranking can retain a partial xdist result over a
1017
+ # complete serial result.
1018
+ best_quality = (-1, -1, -1)
1019
+ serial = bool(metadata.get("force_serial_branches"))
1020
+ branch_log: list[dict[str, Any]] = []
1021
+ branch_ignored = {
1022
+ item["name"] for item in info.get("ignored_tests", []) if "name" in item
1023
+ }
1024
+ n_expected = len([name for name in tests if name not in branch_ignored])
1025
+
1026
+ def merge_best_xml(raw_xml: str) -> None:
1027
+ try:
1028
+ parsed, warnings = parse_junit(
1029
+ raw_xml, branch, list(info.get("tests", [])), branch_ignored
1030
+ )
1031
+ except Exception as exc:
1032
+ result["test_branch_errors"][branch] = [
1033
+ {"error_code": "xml_parse_error", "error_details": str(exc)}
1034
+ ]
1035
+ inject_not_run(result, branch, tests, "xml_parse_error")
1036
+ else:
1037
+ result["test_results"].extend(parsed)
1038
+ result["warnings"].extend(warnings)
1039
+
1040
+ while True:
1041
+ branch_log.append(cleanup_lingering_processes())
1042
+ restore_workspace(compiled_snapshot)
1043
+ extract_trusted_blob(blob, WORKSPACE)
1044
+ restore_reference_executable()
1045
+ actual_hash = sha256(WORKSPACE / "executable")
1046
+ if actual_hash != result["executable_hash"]:
1047
+ result["test_branch_errors"][branch] = [
1048
+ {
1049
+ "error_code": "executable_hash_mismatch",
1050
+ "error_details": (
1051
+ f"expected {result['executable_hash']}, got {actual_hash}"
1052
+ ),
1053
+ }
1054
+ ]
1055
+ inject_not_run(result, branch, tests, "executable_hash_mismatch")
1056
+ break
1057
+ run_sh = WORKSPACE / "eval" / "run.sh"
1058
+ if not run_sh.exists():
1059
+ result["test_branch_errors"][branch] = [
1060
+ {
1061
+ "error_code": "missing_run_sh",
1062
+ "error_details": "eval/run.sh missing",
1063
+ }
1064
+ ]
1065
+ inject_not_run(result, branch, tests, "missing_run_sh")
1066
+ break
1067
+ # Upstream rewrites thread→signal so xdist workers fail cleanly
1068
+ # instead of os._exit(1) on timeout. That works in fresh
1069
+ # containers per branch; here we reuse one container and
1070
+ # signal timeouts leave TUI/log-watcher subprocesses alive
1071
+ # (e.g. lazygit --logs + tail -f), wedging pytest for up to
1072
+ # branch_timeout. Keep the blob's thread method and rely on
1073
+ # cleanup_lingering_processes + serial fallback after crashes.
1074
+ env = branch_env(
1075
+ serial=serial,
1076
+ has_rerunfailures=has_rerunfailures,
1077
+ extras=metadata.get("branch_env"),
1078
+ )
1079
+ branch_log.append(
1080
+ run_step(
1081
+ "rm -f eval/results.xml results.xml",
1082
+ WORKSPACE,
1083
+ timeout=120,
1084
+ step="clean_stale_results",
1085
+ accept_failure=True,
1086
+ )
1087
+ )
1088
+ if serial:
1089
+ prepare_serial_run_sh(run_sh)
1090
+ run_entry = run_step(
1091
+ run_tests_command(serial=serial),
1092
+ WORKSPACE,
1093
+ timeout=branch_timeout,
1094
+ env=env,
1095
+ step="run_tests",
1096
+ accept_failure=True,
1097
+ )
1098
+ branch_log.append(run_entry)
1099
+ branch_log.append(cleanup_lingering_processes())
1100
+ xml_path = find_results_xml()
1101
+ if xml_path is None:
1102
+ if best_xml:
1103
+ merge_best_xml(best_xml)
1104
+ break
1105
+ if serial:
1106
+ result["test_branch_errors"][branch] = [
1107
+ {
1108
+ "error_code": "missing_results_xml",
1109
+ "error_details": "eval/results.xml was not produced",
1110
+ }
1111
+ ]
1112
+ inject_not_run(result, branch, tests, "missing_results_xml")
1113
+ break
1114
+ serial = True
1115
+ continue
1116
+ raw_xml = xml_path.read_text(errors="replace")
1117
+ crashes, n_tests, failures, missing = branch_attempt_metrics(
1118
+ raw_xml,
1119
+ run_output=run_entry.get("output", ""),
1120
+ expected_tests=n_expected,
1121
+ )
1122
+ useful = count_junit_passed(raw_xml)
1123
+ quality = (
1124
+ int(crashes == 0 and missing == 0),
1125
+ n_tests,
1126
+ useful,
1127
+ )
1128
+ if quality > best_quality:
1129
+ best_xml = raw_xml
1130
+ best_quality = quality
1131
+ retry = needs_serial_retry(
1132
+ serial=serial,
1133
+ crashes=crashes,
1134
+ missing=missing,
1135
+ failures=failures,
1136
+ n_tests=n_tests,
1137
+ expected_tests=n_expected,
1138
+ run_output=run_entry.get("output", ""),
1139
+ )
1140
+ if not retry:
1141
+ merge_best_xml(best_xml)
1142
+ break
1143
+ serial = True
1144
+ for entry in branch_log:
1145
+ entry["branch"] = branch
1146
+ result["log"].extend(branch_log)
1147
+
1148
+ return result
1149
+
1150
+
1151
+ def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None:
1152
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1153
+ write_json(LOG_DIR / "programgym_eval.json", result)
1154
+ write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata))
1155
+ rewards = summarize(result, metadata)
1156
+ write_json(LOG_DIR / "reward.json", rewards)
1157
+ (LOG_DIR / "reward.txt").write_text(str(rewards["reward"]))
1158
+
1159
+
1160
+ def main() -> None:
1161
+ LOG_DIR.mkdir(parents=True, exist_ok=True)
1162
+ log_path = LOG_DIR / "programgym_eval.log"
1163
+ metadata = json.loads(METADATA_PATH.read_text())
1164
+ branches = metadata.get("branches", {})
1165
+ try:
1166
+ result = evaluate(metadata)
1167
+ except Exception as exc:
1168
+ error_code = type(exc).__name__
1169
+ result = {
1170
+ "test_results": [],
1171
+ "error_code": error_code,
1172
+ "error_details": str(exc),
1173
+ "log": [
1174
+ {
1175
+ "step": "evaluator_exception",
1176
+ "exception_info": traceback.format_exc(),
1177
+ "returncode": 1,
1178
+ }
1179
+ ],
1180
+ "solution_branch": "submission",
1181
+ "test_branches": [
1182
+ name for name, info in branches.items() if not info.get("ignored")
1183
+ ],
1184
+ "test_branch_errors": {
1185
+ "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}]
1186
+ },
1187
+ "executable_hash": None,
1188
+ "warnings": [],
1189
+ }
1190
+ for branch, info in branches.items():
1191
+ if info.get("ignored"):
1192
+ continue
1193
+ inject_not_run(result, branch, branch_tests(info), error_code)
1194
+ log_path.write_text(traceback.format_exc())
1195
+ else:
1196
+ log_path.write_text("")
1197
+ write_outputs(result, metadata)
1198
+
1199
+
1200
+ if __name__ == "__main__":
1201
+ main()
thesephist--ink.b6fd222/tests/programgym_task.json ADDED
@@ -0,0 +1,715 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "branches": {
3
+ "generated_module_01": {
4
+ "ignore_reason": "",
5
+ "ignored": false,
6
+ "ignored_tests": [],
7
+ "tests": [
8
+ "eval.tests.test_cli.test_debug_flags_combined_with_version",
9
+ "eval.tests.test_cli.test_debug_lex_flag_emits_lex_debug",
10
+ "eval.tests.test_cli.test_debug_lex_lexes_identifiers",
11
+ "eval.tests.test_cli.test_debug_parse_flag_emits_parse_debug",
12
+ "eval.tests.test_cli.test_dump_flag_emits_frame_dump",
13
+ "eval.tests.test_cli.test_dump_has_no_effect_without_eval_output_beyond_dump",
14
+ "eval.tests.test_cli.test_empty_file_arg_with_stdin_uses_stdin",
15
+ "eval.tests.test_cli.test_eval_beats_stdin",
16
+ "eval.tests.test_cli.test_eval_emits_out_no_newline",
17
+ "eval.tests.test_cli.test_eval_empty_string_exits_zero",
18
+ "eval.tests.test_cli.test_eval_expression_produces_no_output",
19
+ "eval.tests.test_cli.test_eval_multiple_statements",
20
+ "eval.tests.test_cli.test_eval_prefers_over_file_argument",
21
+ "eval.tests.test_cli.test_eval_runtime_error_fatal",
22
+ "eval.tests.test_cli.test_eval_string_concatenation",
23
+ "eval.tests.test_cli.test_eval_syntax_error_fatal",
24
+ "eval.tests.test_cli.test_eval_with_function_def_and_call",
25
+ "eval.tests.test_cli.test_file_argument_multiline_program",
26
+ "eval.tests.test_cli.test_file_argument_runs_source",
27
+ "eval.tests.test_cli.test_file_beats_stdin",
28
+ "eval.tests.test_cli.test_file_missing_reports_system_error",
29
+ "eval.tests.test_cli.test_file_syntax_error_fatal",
30
+ "eval.tests.test_cli.test_help_dominates_repl_default",
31
+ "eval.tests.test_cli.test_help_flag_long",
32
+ "eval.tests.test_cli.test_help_flag_short",
33
+ "eval.tests.test_cli.test_help_is_not_a_side_effect_of_version",
34
+ "eval.tests.test_cli.test_help_lists_usage_examples",
35
+ "eval.tests.test_cli.test_help_reports_flags_on_stderr",
36
+ "eval.tests.test_cli.test_isolate_combined_with_debug",
37
+ "eval.tests.test_cli.test_isolate_disallows_read",
38
+ "eval.tests.test_cli.test_no_read_and_no_write_combo",
39
+ "eval.tests.test_cli.test_only_first_file_argument_executed",
40
+ "eval.tests.test_cli.test_permission_flag_still_runs_eval[-isolate]",
41
+ "eval.tests.test_cli.test_permission_flag_still_runs_eval[-no-exec]",
42
+ "eval.tests.test_cli.test_permission_flag_still_runs_eval[-no-net]",
43
+ "eval.tests.test_cli.test_permission_flag_still_runs_eval[-no-read]",
44
+ "eval.tests.test_cli.test_permission_flag_still_runs_eval[-no-write]",
45
+ "eval.tests.test_cli.test_repl_clear_builtin_emits_escape",
46
+ "eval.tests.test_cli.test_repl_exits_clean_on_empty_input",
47
+ "eval.tests.test_cli.test_repl_multiple_lines",
48
+ "eval.tests.test_cli.test_repl_overrides_auto_stdin",
49
+ "eval.tests.test_cli.test_repl_prompts_and_evaluates",
50
+ "eval.tests.test_cli.test_stdin_empty_exits_zero",
51
+ "eval.tests.test_cli.test_stdin_multiline",
52
+ "eval.tests.test_cli.test_stdin_piped_interpreted",
53
+ "eval.tests.test_cli.test_stdin_syntax_error_fatal",
54
+ "eval.tests.test_cli.test_verbose_emits_frame_dump",
55
+ "eval.tests.test_cli.test_verbose_emits_lex_debug",
56
+ "eval.tests.test_cli.test_verbose_emits_parse_debug",
57
+ "eval.tests.test_cli.test_version_beats_stdin",
58
+ "eval.tests.test_cli.test_version_dominates_eval",
59
+ "eval.tests.test_cli.test_version_dominates_file",
60
+ "eval.tests.test_cli.test_version_dominates_help",
61
+ "eval.tests.test_cli.test_version_flag_long",
62
+ "eval.tests.test_cli.test_version_flag_short"
63
+ ]
64
+ },
65
+ "generated_module_02": {
66
+ "ignore_reason": "",
67
+ "ignored": false,
68
+ "ignored_tests": [],
69
+ "tests": [
70
+ "eval.tests.test_lexer_behavior.test_accessor_vs_decimal[.5-expected3]",
71
+ "eval.tests.test_lexer_behavior.test_accessor_vs_decimal[.x-expected2]",
72
+ "eval.tests.test_lexer_behavior.test_accessor_vs_decimal[1.5-expected0]",
73
+ "eval.tests.test_lexer_behavior.test_accessor_vs_decimal[5.-expected4]",
74
+ "eval.tests.test_lexer_behavior.test_accessor_vs_decimal[a.b-expected1]",
75
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a%b-expected4]",
76
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a&b-expected5]",
77
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a*b-expected2]",
78
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a+b*c-expected12]",
79
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a+b-expected0]",
80
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a-b-expected1]",
81
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a/b-expected3]",
82
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a<b-expected8]",
83
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a=b-expected11]",
84
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a>b-expected9]",
85
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a^b-expected7]",
86
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[a|b-expected6]",
87
+ "eval.tests.test_lexer_behavior.test_binary_and_unary_operators[~x-expected10]",
88
+ "eval.tests.test_lexer_behavior.test_boolean_literals[false true-expected3]",
89
+ "eval.tests.test_lexer_behavior.test_boolean_literals[false-expected1]",
90
+ "eval.tests.test_lexer_behavior.test_boolean_literals[true false-expected2]",
91
+ "eval.tests.test_lexer_behavior.test_boolean_literals[true-expected0]",
92
+ "eval.tests.test_lexer_behavior.test_boolean_literals[truex-expected4]",
93
+ "eval.tests.test_lexer_behavior.test_boolean_literals[xfalse-expected5]",
94
+ "eval.tests.test_lexer_behavior.test_comments_and_shebang[#!/usr/bin/env ink\\nx-expected_seq4]",
95
+ "eval.tests.test_lexer_behavior.test_comments_and_shebang[a `` c-expected_seq2]",
96
+ "eval.tests.test_lexer_behavior.test_comments_and_shebang[a `` c\\nb-expected_seq0]",
97
+ "eval.tests.test_lexer_behavior.test_comments_and_shebang[a ``* c *`` b-expected_seq3]",
98
+ "eval.tests.test_lexer_behavior.test_comments_and_shebang[a``b-expected_seq1]",
99
+ "eval.tests.test_lexer_behavior.test_composite_program_token_streams[add(1, 2)-expected2]",
100
+ "eval.tests.test_lexer_behavior.test_composite_program_token_streams[square := x => x * x-expected0]",
101
+ "eval.tests.test_lexer_behavior.test_composite_program_token_streams[{key: 'v', n: 3}-expected1]",
102
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a->b-expected2]",
103
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a-b-expected6]",
104
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a::b-expected3]",
105
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a:=b-expected0]",
106
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a:b-expected4]",
107
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a=>b-expected1]",
108
+ "eval.tests.test_lexer_behavior.test_compound_operators_and_keyvalue[a=b-expected5]",
109
+ "eval.tests.test_lexer_behavior.test_debug_flag_gated_output",
110
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[((a))-expected7]",
111
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[()-expected3]",
112
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[(a[1])-expected8]",
113
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[(abc)-expected0]",
114
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[[1,2]-expected1]",
115
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[[1]-expected6]",
116
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[[]-expected4]",
117
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[{a}-expected2]",
118
+ "eval.tests.test_lexer_behavior.test_delimiters_and_auto_separators[{}-expected5]",
119
+ "eval.tests.test_lexer_behavior.test_empty_or_blank_program_lexes_to_nothing[ ]",
120
+ "eval.tests.test_lexer_behavior.test_empty_or_blank_program_lexes_to_nothing[\\n]",
121
+ "eval.tests.test_lexer_behavior.test_empty_or_blank_program_lexes_to_nothing[]",
122
+ "eval.tests.test_lexer_behavior.test_explicit_comma_separator",
123
+ "eval.tests.test_lexer_behavior.test_identifier_position_reflects_buffer_end",
124
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[_-expected3]",
125
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[__-expected6]",
126
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[_x-expected4]",
127
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[a_b-expected7]",
128
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[foo-expected0]",
129
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[foo123-expected1]",
130
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[nottrue-expected2]",
131
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[x_-expected5]",
132
+ "eval.tests.test_lexer_behavior.test_identifiers_and_empty_identifier[x_y_z-expected8]",
133
+ "eval.tests.test_lexer_behavior.test_lexer_runs_before_evaluation_error",
134
+ "eval.tests.test_lexer_behavior.test_multiline_string_preserves_newline",
135
+ "eval.tests.test_lexer_behavior.test_newline_and_whitespace_separators[a b-expected3]",
136
+ "eval.tests.test_lexer_behavior.test_newline_and_whitespace_separators[a\\n\\nb-expected1]",
137
+ "eval.tests.test_lexer_behavior.test_newline_and_whitespace_separators[a\\nb-expected0]",
138
+ "eval.tests.test_lexer_behavior.test_newline_and_whitespace_separators[a\\nb\\nc-expected2]",
139
+ "eval.tests.test_lexer_behavior.test_newline_and_whitespace_separators[a\\tb-expected4]",
140
+ "eval.tests.test_lexer_behavior.test_number_literals[0-expected0]",
141
+ "eval.tests.test_lexer_behavior.test_number_literals[0.5-expected4]",
142
+ "eval.tests.test_lexer_behavior.test_number_literals[007-expected2]",
143
+ "eval.tests.test_lexer_behavior.test_number_literals[1 2 3-expected8]",
144
+ "eval.tests.test_lexer_behavior.test_number_literals[1e3-expected6]",
145
+ "eval.tests.test_lexer_behavior.test_number_literals[2.5e2-expected7]",
146
+ "eval.tests.test_lexer_behavior.test_number_literals[3.14-expected3]",
147
+ "eval.tests.test_lexer_behavior.test_number_literals[42-expected1]",
148
+ "eval.tests.test_lexer_behavior.test_number_literals[42.0-expected5]",
149
+ "eval.tests.test_lexer_behavior.test_number_parse_error_is_reported[1.2.3x-parsing error in number]",
150
+ "eval.tests.test_lexer_behavior.test_number_parse_error_is_reported[12e-parsing error in number]",
151
+ "eval.tests.test_lexer_behavior.test_number_parse_error_is_reported[1ff-parsing error in number]",
152
+ "eval.tests.test_lexer_behavior.test_number_with_non_digit_is_fatal_syntax_error",
153
+ "eval.tests.test_lexer_behavior.test_position_line_increments_on_newline",
154
+ "eval.tests.test_lexer_behavior.test_position_tracking_single_line",
155
+ "eval.tests.test_lexer_behavior.test_string_literal_position_uses_string_start",
156
+ "eval.tests.test_lexer_behavior.test_string_literals[''-expected1]",
157
+ "eval.tests.test_lexer_behavior.test_string_literals['a b'-expected2]",
158
+ "eval.tests.test_lexer_behavior.test_string_literals['a\\\\\\\\'-expected6]",
159
+ "eval.tests.test_lexer_behavior.test_string_literals['a\\\\\\\\b'-expected5]",
160
+ "eval.tests.test_lexer_behavior.test_string_literals['hi'-expected0]",
161
+ "eval.tests.test_lexer_behavior.test_string_literals['it\\\\'s'-expected4]",
162
+ "eval.tests.test_lexer_behavior.test_string_literals['say hi' 'again'-expected3]",
163
+ "eval.tests.test_lexer_behavior.test_unterminated_string_at_eof_is_dropped"
164
+ ]
165
+ },
166
+ "generated_module_03": {
167
+ "ignore_reason": "",
168
+ "ignored": false,
169
+ "ignored_tests": [],
170
+ "tests": [
171
+ "eval.tests.test_parser_ast.test_binary_expressions[accessor]",
172
+ "eval.tests.test_parser_ast.test_binary_expressions[arith_add]",
173
+ "eval.tests.test_parser_ast.test_binary_expressions[arith_div]",
174
+ "eval.tests.test_parser_ast.test_binary_expressions[arith_float]",
175
+ "eval.tests.test_parser_ast.test_binary_expressions[arith_mod]",
176
+ "eval.tests.test_parser_ast.test_binary_expressions[arith_mul]",
177
+ "eval.tests.test_parser_ast.test_binary_expressions[arith_sub]",
178
+ "eval.tests.test_parser_ast.test_binary_expressions[cmp_eq]",
179
+ "eval.tests.test_parser_ast.test_binary_expressions[cmp_gt]",
180
+ "eval.tests.test_parser_ast.test_binary_expressions[cmp_lt]",
181
+ "eval.tests.test_parser_ast.test_binary_expressions[define]",
182
+ "eval.tests.test_parser_ast.test_binary_expressions[logic_and]",
183
+ "eval.tests.test_parser_ast.test_binary_expressions[logic_or]",
184
+ "eval.tests.test_parser_ast.test_binary_expressions[logic_xor]",
185
+ "eval.tests.test_parser_ast.test_collection_literals[list_empty]",
186
+ "eval.tests.test_parser_ast.test_collection_literals[list_mixed_types]",
187
+ "eval.tests.test_parser_ast.test_collection_literals[list_nested]",
188
+ "eval.tests.test_parser_ast.test_collection_literals[list_numbers]",
189
+ "eval.tests.test_parser_ast.test_collection_literals[object_empty]",
190
+ "eval.tests.test_parser_ast.test_collection_literals[object_list_value]",
191
+ "eval.tests.test_parser_ast.test_collection_literals[object_mixed_values]",
192
+ "eval.tests.test_parser_ast.test_collection_literals[object_multi_entry]",
193
+ "eval.tests.test_parser_ast.test_collection_literals[object_single_entry]",
194
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[call_four_args]",
195
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[call_grouped_var]",
196
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[call_nested_call]",
197
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[call_two_args]",
198
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[call_var_arg]",
199
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[call_with_group_fun]",
200
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[define_and_call]",
201
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[define_expression]",
202
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[define_number]",
203
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[fn_multi_arg]",
204
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[fn_single_arg]",
205
+ "eval.tests.test_parser_ast.test_function_and_call_syntax[fn_zero_arg]",
206
+ "eval.tests.test_parser_ast.test_literal_atoms[boolean_false]",
207
+ "eval.tests.test_parser_ast.test_literal_atoms[boolean_true]",
208
+ "eval.tests.test_parser_ast.test_literal_atoms[empty_identifier]",
209
+ "eval.tests.test_parser_ast.test_literal_atoms[identifier]",
210
+ "eval.tests.test_parser_ast.test_literal_atoms[number_decimal]",
211
+ "eval.tests.test_parser_ast.test_literal_atoms[number_int]",
212
+ "eval.tests.test_parser_ast.test_literal_atoms[number_large_integer]",
213
+ "eval.tests.test_parser_ast.test_literal_atoms[number_leading_zero]",
214
+ "eval.tests.test_parser_ast.test_literal_atoms[number_trailing_zero_dot_normalised]",
215
+ "eval.tests.test_parser_ast.test_literal_atoms[number_zero]",
216
+ "eval.tests.test_parser_ast.test_literal_atoms[string_empty]",
217
+ "eval.tests.test_parser_ast.test_literal_atoms[string_simple]",
218
+ "eval.tests.test_parser_ast.test_match_expressions[match_condition_is_binary]",
219
+ "eval.tests.test_parser_ast.test_match_expressions[match_empty_body]",
220
+ "eval.tests.test_parser_ast.test_match_expressions[match_plain_with_empty_identifier]",
221
+ "eval.tests.test_parser_ast.test_match_expressions[match_two_clauses]",
222
+ "eval.tests.test_parser_ast.test_multiple_top_level_expressions[comma_separated_top_level]",
223
+ "eval.tests.test_parser_ast.test_multiple_top_level_expressions[define_then_use_two_expressions]",
224
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[accessor_left_assoc]",
225
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[add_left_assoc]",
226
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[equality_loosest]",
227
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[logic_ops_priority_and_xor_tighter_than_or]",
228
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[modulo_then_add]",
229
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[mul_binds_tighter_than_add]",
230
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[mul_left_then_add]",
231
+ "eval.tests.test_parser_ast.test_operator_precedence_builds_tree[subtract_left_assoc]",
232
+ "eval.tests.test_parser_ast.test_parenthesised_expressions[group_empty]",
233
+ "eval.tests.test_parser_ast.test_parenthesised_expressions[group_multi_expression]",
234
+ "eval.tests.test_parser_ast.test_parenthesised_expressions[group_nested]",
235
+ "eval.tests.test_parser_ast.test_parenthesised_expressions[group_single]",
236
+ "eval.tests.test_parser_ast.test_unary_expression[negation_bool]",
237
+ "eval.tests.test_parser_ast.test_unary_expression[negation_identifier]",
238
+ "eval.tests.test_parser_ast.test_unary_expression[negation_nested]",
239
+ "eval.tests.test_parser_errors.test_parse_failure_hides_ast",
240
+ "eval.tests.test_parser_errors.test_parse_success_shows_ast_before_runtime_failure",
241
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[( =>-unexpected end of input at '=>']",
242
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[(1 2)-unexpected token number literal '2' following an expression]",
243
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[(:-unexpected end of input at '(']",
244
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[(a x) => c-unexpected token identifier 'x' following an expression]",
245
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[(x =>-unexpected end of input]",
246
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[)-unexpected start of atom, found ')']",
247
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[+-unexpected end of input at '+']",
248
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[.-unexpected end of input at '.']",
249
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[1 +)-unexpected start of atom, found ')']",
250
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[1 +-unexpected end of input]",
251
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[1 2-unexpected token number literal '2' following an expression]",
252
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[1 :: { -> 5 }-unexpected start of atom, found '->']",
253
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[1 :: { 1, 2 }-expected '->', but got number literal '2']",
254
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[1 :: { true }-expected '->', but got '}']",
255
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[[1 2]-unexpected token number literal '2' following an expression]",
256
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[[1,-unexpected end of input at ',']",
257
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[]-unexpected start of atom, found ']']",
258
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[a =>-unexpected end of input]",
259
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[f x-unexpected token identifier 'x' following an expression]",
260
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[f() => 1-unexpected token '=>' following an expression]",
261
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[f() g-unexpected token identifier 'g' following an expression]",
262
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[f(:-unexpected end of input at '(']",
263
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[f(x y)-unexpected token identifier 'y' following an expression]",
264
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[f(x-unexpected end of input at ',']",
265
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[x =>-unexpected end of input]",
266
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[{a => 1}-expected ':' after composite key, found '}']",
267
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[{a: 1 b: 2}-unexpected token identifier 'b' following an expression]",
268
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[{a:}-unexpected start of atom, found '}']",
269
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[{a}-expected ':' after composite key, found '}']",
270
+ "eval.tests.test_parser_errors.test_parser_syntax_errors[}-unexpected start of atom, found '}']"
271
+ ]
272
+ },
273
+ "generated_module_04": {
274
+ "ignore_reason": "",
275
+ "ignored": false,
276
+ "ignored_tests": [],
277
+ "tests": [
278
+ "eval.tests.test_access.test_access_non_composite_error",
279
+ "eval.tests.test_access.test_access_non_integer_string_index_error",
280
+ "eval.tests.test_access.test_composite_access[access-dynamic-key]",
281
+ "eval.tests.test_access.test_composite_access[access-list-index]",
282
+ "eval.tests.test_access.test_composite_access[access-list-oob]",
283
+ "eval.tests.test_access.test_composite_access[access-missing-key]",
284
+ "eval.tests.test_access.test_composite_access[access-named-key]",
285
+ "eval.tests.test_access.test_nested_access",
286
+ "eval.tests.test_access.test_string_access[str-index]",
287
+ "eval.tests.test_access.test_string_access[str-last-index]",
288
+ "eval.tests.test_access.test_string_access[str-oob]",
289
+ "eval.tests.test_access.test_string_index_preserves_null_byte",
290
+ "eval.tests.test_arithmetic.test_arithmetic[add-ints]",
291
+ "eval.tests.test_arithmetic.test_arithmetic[div-exact]",
292
+ "eval.tests.test_arithmetic.test_arithmetic[div-fractional]",
293
+ "eval.tests.test_arithmetic.test_arithmetic[modulus-float-left]",
294
+ "eval.tests.test_arithmetic.test_arithmetic[modulus-positive]",
295
+ "eval.tests.test_arithmetic.test_arithmetic[mul-ints]",
296
+ "eval.tests.test_arithmetic.test_arithmetic[parens-override]",
297
+ "eval.tests.test_arithmetic.test_arithmetic[precedence-mul-over-add]",
298
+ "eval.tests.test_arithmetic.test_arithmetic[sub-ints]",
299
+ "eval.tests.test_arithmetic.test_arithmetic_errors[add-str-num]",
300
+ "eval.tests.test_arithmetic.test_arithmetic_errors[div-bools]",
301
+ "eval.tests.test_arithmetic.test_arithmetic_errors[div-by-zero]",
302
+ "eval.tests.test_arithmetic.test_arithmetic_errors[mod-by-zero]",
303
+ "eval.tests.test_arithmetic.test_arithmetic_errors[mod-non-int-right]",
304
+ "eval.tests.test_arithmetic.test_arithmetic_errors[sub-num-str]",
305
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[bool-and-both]",
306
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[bool-and]",
307
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[bool-or-both-false]",
308
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[bool-or-inverse]",
309
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[bool-or]",
310
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[str-concat-empty-left]",
311
+ "eval.tests.test_arithmetic.test_arithmetic_overloads[str-concat]",
312
+ "eval.tests.test_assignment.test_assignment_errors[assign-empty-ident]",
313
+ "eval.tests.test_assignment.test_assignment_errors[assign-literal]",
314
+ "eval.tests.test_assignment.test_assignment_errors[assign-num-context]",
315
+ "eval.tests.test_assignment.test_assignment_errors[prop-dot-chain]",
316
+ "eval.tests.test_assignment.test_property_assignment[prop-add-new]",
317
+ "eval.tests.test_assignment.test_property_assignment[prop-assign-dynamic-key]",
318
+ "eval.tests.test_assignment.test_property_assignment[prop-assign]",
319
+ "eval.tests.test_assignment.test_string_index_append_at_end",
320
+ "eval.tests.test_assignment.test_string_index_write",
321
+ "eval.tests.test_assignment.test_string_index_write_errors[str-write-non-int]",
322
+ "eval.tests.test_assignment.test_string_index_write_errors[str-write-oob]",
323
+ "eval.tests.test_assignment.test_string_multi_index_write",
324
+ "eval.tests.test_assignment.test_variable_define[define-bool]",
325
+ "eval.tests.test_assignment.test_variable_define[define-int]",
326
+ "eval.tests.test_assignment.test_variable_define[define-list]",
327
+ "eval.tests.test_assignment.test_variable_define[define-object]",
328
+ "eval.tests.test_assignment.test_variable_define[define-string]",
329
+ "eval.tests.test_assignment.test_variable_define[redefine]",
330
+ "eval.tests.test_bitwise_unary.test_bitwise_float_errors[band-float]",
331
+ "eval.tests.test_bitwise_unary.test_bitwise_float_errors[bor-float]",
332
+ "eval.tests.test_bitwise_unary.test_bitwise_float_errors[bxor-float]",
333
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[bitand-int]",
334
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[bitor-int]",
335
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[bitxor-int]",
336
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[int-chain]",
337
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[logical-and-bool]",
338
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[logical-or-bool]",
339
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[logical-xor-both-true]",
340
+ "eval.tests.test_bitwise_unary.test_bitwise_logical[logical-xor-mixed]",
341
+ "eval.tests.test_bitwise_unary.test_string_bitwise[str-bitand-bytes]",
342
+ "eval.tests.test_bitwise_unary.test_string_bitwise[str-bitand-zero-extend]",
343
+ "eval.tests.test_bitwise_unary.test_string_bitwise[str-bitor-bytes]",
344
+ "eval.tests.test_bitwise_unary.test_string_bitwise[str-bitor-result-length]",
345
+ "eval.tests.test_bitwise_unary.test_string_bitwise[str-bitxor-bytes]",
346
+ "eval.tests.test_bitwise_unary.test_unary_negation[negate-bool-false]",
347
+ "eval.tests.test_bitwise_unary.test_unary_negation[negate-bool-true]",
348
+ "eval.tests.test_bitwise_unary.test_unary_negation[negate-expr]",
349
+ "eval.tests.test_bitwise_unary.test_unary_negation[negate-num]",
350
+ "eval.tests.test_bitwise_unary.test_unary_negation_errors[negate-null]",
351
+ "eval.tests.test_bitwise_unary.test_unary_negation_errors[negate-string]",
352
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[char-no-arg]",
353
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[exit-no-arg]",
354
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[exit-non-number]",
355
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[keys-no-arg]",
356
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[keys-non-composite]",
357
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[len-no-arg]",
358
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[load-no-arg]",
359
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[number-no-arg]",
360
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[point-no-arg]",
361
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[string-no-arg]",
362
+ "eval.tests.test_builtin_guard_errors.test_conversion_and_introspection_guards[type-no-arg]",
363
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[acos-no-arg]",
364
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[acos-non-number]",
365
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[asin-no-arg]",
366
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[asin-non-number]",
367
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[cos-no-arg]",
368
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[cos-non-number]",
369
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[floor-no-arg]",
370
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[floor-non-number]",
371
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[ln-no-arg]",
372
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[ln-non-number]",
373
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[pow-no-arg]",
374
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[pow-type-mismatch]",
375
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[sin-no-arg]",
376
+ "eval.tests.test_builtin_guard_errors.test_math_builtin_guards[sin-non-number]",
377
+ "eval.tests.test_builtins.test_args_builtin_returns_composite",
378
+ "eval.tests.test_builtins.test_builtin_arity_and_type_errors[char-non-number]",
379
+ "eval.tests.test_builtins.test_builtin_arity_and_type_errors[out-arity]",
380
+ "eval.tests.test_builtins.test_builtin_arity_and_type_errors[out-non-string]",
381
+ "eval.tests.test_builtins.test_builtin_arity_and_type_errors[point-empty-string]",
382
+ "eval.tests.test_builtins.test_builtin_arity_and_type_errors[point-non-string]",
383
+ "eval.tests.test_builtins.test_builtin_arity_and_type_errors[urand-negative]",
384
+ "eval.tests.test_builtins.test_builtin_error_paths[acos-out-of-range]",
385
+ "eval.tests.test_builtins.test_builtin_error_paths[asin-out-of-range]",
386
+ "eval.tests.test_builtins.test_builtin_error_paths[len-number]",
387
+ "eval.tests.test_builtins.test_builtin_error_paths[ln-negative]",
388
+ "eval.tests.test_builtins.test_builtin_error_paths[ln-zero]",
389
+ "eval.tests.test_builtins.test_builtin_error_paths[pow-negative-fractional]",
390
+ "eval.tests.test_builtins.test_builtin_error_paths[pow-zero-zero]",
391
+ "eval.tests.test_builtins.test_env_builtin_returns_composite",
392
+ "eval.tests.test_builtins.test_exit_builtin_code",
393
+ "eval.tests.test_builtins.test_keys_builtin",
394
+ "eval.tests.test_builtins.test_len_builtin[len-empty-object]",
395
+ "eval.tests.test_builtins.test_len_builtin[len-empty-str]",
396
+ "eval.tests.test_builtins.test_len_builtin[len-list]",
397
+ "eval.tests.test_builtins.test_len_builtin[len-object]",
398
+ "eval.tests.test_builtins.test_len_builtin[len-str]",
399
+ "eval.tests.test_builtins.test_math_builtins[acos-one]",
400
+ "eval.tests.test_builtins.test_math_builtins[char-cp]",
401
+ "eval.tests.test_builtins.test_math_builtins[cos-zero]",
402
+ "eval.tests.test_builtins.test_math_builtins[floor-desc]",
403
+ "eval.tests.test_builtins.test_math_builtins[floor-negative-truncates-toward-zero]",
404
+ "eval.tests.test_builtins.test_math_builtins[ln-one]",
405
+ "eval.tests.test_builtins.test_math_builtins[point-char]",
406
+ "eval.tests.test_builtins.test_math_builtins[pow]",
407
+ "eval.tests.test_builtins.test_math_builtins[sin-zero]",
408
+ "eval.tests.test_builtins.test_number_builtin[number-composite-zero]",
409
+ "eval.tests.test_builtins.test_number_builtin[number-false]",
410
+ "eval.tests.test_builtins.test_number_builtin[number-identity]",
411
+ "eval.tests.test_builtins.test_number_builtin[number-parse-fail-null]",
412
+ "eval.tests.test_builtins.test_number_builtin[number-parse-float]",
413
+ "eval.tests.test_builtins.test_number_builtin[number-parse-int]",
414
+ "eval.tests.test_builtins.test_number_builtin[number-true]",
415
+ "eval.tests.test_builtins.test_rand_and_urand",
416
+ "eval.tests.test_builtins.test_time_is_positive_number",
417
+ "eval.tests.test_builtins.test_type_builtin[type-bool]",
418
+ "eval.tests.test_builtins.test_type_builtin[type-composite]",
419
+ "eval.tests.test_builtins.test_type_builtin[type-function]",
420
+ "eval.tests.test_builtins.test_type_builtin[type-native-function]",
421
+ "eval.tests.test_builtins.test_type_builtin[type-null]",
422
+ "eval.tests.test_builtins.test_type_builtin[type-number]",
423
+ "eval.tests.test_builtins.test_type_builtin[type-string]",
424
+ "eval.tests.test_builtins.test_value_edge_cases[exit-three-code]",
425
+ "eval.tests.test_builtins.test_value_edge_cases[exit-zero-code]",
426
+ "eval.tests.test_builtins.test_value_edge_cases[keys-empty-composite]",
427
+ "eval.tests.test_builtins.test_value_edge_cases[number-empty-string-null]",
428
+ "eval.tests.test_builtins.test_value_edge_cases[number-scientific]",
429
+ "eval.tests.test_builtins.test_value_edge_cases[number-whitespace-not-trimmed]",
430
+ "eval.tests.test_builtins.test_value_edge_cases[urand-32-bytes]",
431
+ "eval.tests.test_builtins.test_value_edge_cases[urand-single-byte]",
432
+ "eval.tests.test_builtins.test_value_edge_cases[urand-zero-length]",
433
+ "eval.tests.test_cli.test_debug_lex_flag_emits_lex_logs",
434
+ "eval.tests.test_cli.test_debug_parse_flag_emits_parse_logs",
435
+ "eval.tests.test_cli.test_dump_flag_emits_frame_dump",
436
+ "eval.tests.test_cli.test_eval_error_exit_codes[runtime-error-exit2]",
437
+ "eval.tests.test_cli.test_eval_error_exit_codes[syntax-error-exit1]",
438
+ "eval.tests.test_cli.test_eval_error_exit_codes[undefined-var-exit2]",
439
+ "eval.tests.test_cli.test_help_flag_prints_usage",
440
+ "eval.tests.test_cli.test_help_is_short_flag",
441
+ "eval.tests.test_cli.test_repl_error_is_safe_nonfatal",
442
+ "eval.tests.test_cli.test_repl_evaluates_and_prints_expression",
443
+ "eval.tests.test_cli.test_stdin_interpretation",
444
+ "eval.tests.test_cli.test_unknown_flag_fails",
445
+ "eval.tests.test_cli.test_verbose_flag_combines_all_debug",
446
+ "eval.tests.test_cli.test_version_flag",
447
+ "eval.tests.test_cli.test_version_takes_precedence_over_eval",
448
+ "eval.tests.test_comparison.test_comparison_equality[eq-bool-diff]",
449
+ "eval.tests.test_comparison.test_comparison_equality[eq-bool]",
450
+ "eval.tests.test_comparison.test_comparison_equality[eq-int-false]",
451
+ "eval.tests.test_comparison.test_comparison_equality[eq-int-true]",
452
+ "eval.tests.test_comparison.test_comparison_equality[eq-null]",
453
+ "eval.tests.test_comparison.test_comparison_equality[eq-str-diff]",
454
+ "eval.tests.test_comparison.test_comparison_equality[eq-str]",
455
+ "eval.tests.test_comparison.test_comparison_equality[gt-false]",
456
+ "eval.tests.test_comparison.test_comparison_equality[gt-str]",
457
+ "eval.tests.test_comparison.test_comparison_equality[gt-true]",
458
+ "eval.tests.test_comparison.test_comparison_equality[lt-equal-false]",
459
+ "eval.tests.test_comparison.test_comparison_equality[lt-false]",
460
+ "eval.tests.test_comparison.test_comparison_equality[lt-str]",
461
+ "eval.tests.test_comparison.test_comparison_type_errors[gt-bool]",
462
+ "eval.tests.test_comparison.test_comparison_type_errors[gt-composite]",
463
+ "eval.tests.test_comparison.test_comparison_type_errors[lt-null-num]",
464
+ "eval.tests.test_comparison.test_composite_deep_equality",
465
+ "eval.tests.test_comparison.test_equality_empty_identifier_matches_all",
466
+ "eval.tests.test_fs_builtins.test_delete_errors[delete-arity]",
467
+ "eval.tests.test_fs_builtins.test_delete_errors[delete-path-not-string]",
468
+ "eval.tests.test_fs_builtins.test_delete_missing_path_succeeds",
469
+ "eval.tests.test_fs_builtins.test_delete_removes_path[delete-directory-recursive]",
470
+ "eval.tests.test_fs_builtins.test_delete_removes_path[delete-file]",
471
+ "eval.tests.test_fs_builtins.test_dir_empty_directory",
472
+ "eval.tests.test_fs_builtins.test_dir_entry_fields_name_len_dir_mod",
473
+ "eval.tests.test_fs_builtins.test_dir_entry_names_and_types",
474
+ "eval.tests.test_fs_builtins.test_dir_errors[dir-arity]",
475
+ "eval.tests.test_fs_builtins.test_dir_errors[dir-cb-not-function]",
476
+ "eval.tests.test_fs_builtins.test_dir_errors[dir-path-not-string]",
477
+ "eval.tests.test_fs_builtins.test_dir_lists_entries",
478
+ "eval.tests.test_fs_builtins.test_dir_missing_path_errors",
479
+ "eval.tests.test_fs_builtins.test_dir_numeric_keys_count_entries",
480
+ "eval.tests.test_fs_builtins.test_make_creates_directory[make-nested-dirs]",
481
+ "eval.tests.test_fs_builtins.test_make_creates_directory[make-single-dir]",
482
+ "eval.tests.test_fs_builtins.test_make_creates_directory[make-then-write-sequenced]",
483
+ "eval.tests.test_fs_builtins.test_make_errors[make-arity]",
484
+ "eval.tests.test_fs_builtins.test_make_errors[make-path-not-string]",
485
+ "eval.tests.test_fs_builtins.test_make_over_existing_file_errors",
486
+ "eval.tests.test_fs_builtins.test_read_empty_file",
487
+ "eval.tests.test_fs_builtins.test_read_errors[read-arity]",
488
+ "eval.tests.test_fs_builtins.test_read_errors[read-cb-not-function]",
489
+ "eval.tests.test_fs_builtins.test_read_errors[read-offset-not-number]",
490
+ "eval.tests.test_fs_builtins.test_read_from_offset_zero_full_length",
491
+ "eval.tests.test_fs_builtins.test_read_missing_file_returns_error",
492
+ "eval.tests.test_fs_builtins.test_read_offset_beyond_file_is_empty",
493
+ "eval.tests.test_fs_builtins.test_read_offset_length[read-first-bytes]",
494
+ "eval.tests.test_fs_builtins.test_read_offset_length[read-mid-range]",
495
+ "eval.tests.test_fs_builtins.test_read_offset_length[read-past-end-clamped]",
496
+ "eval.tests.test_fs_builtins.test_read_offset_length[read-zero-length]",
497
+ "eval.tests.test_fs_builtins.test_read_whole_file",
498
+ "eval.tests.test_fs_builtins.test_stat_directory",
499
+ "eval.tests.test_fs_builtins.test_stat_errors[stat-arity]",
500
+ "eval.tests.test_fs_builtins.test_stat_errors[stat-cb-not-function]",
501
+ "eval.tests.test_fs_builtins.test_stat_errors[stat-path-not-string]",
502
+ "eval.tests.test_fs_builtins.test_stat_errors_chained_on_directory_callback",
503
+ "eval.tests.test_fs_builtins.test_stat_existing_file",
504
+ "eval.tests.test_fs_builtins.test_stat_missing_returns_null",
505
+ "eval.tests.test_fs_builtins.test_stat_mod_is_positive_timestamp",
506
+ "eval.tests.test_fs_builtins.test_write_append_mode[append-empty-file]",
507
+ "eval.tests.test_fs_builtins.test_write_append_mode[append-nonempty-file]",
508
+ "eval.tests.test_fs_builtins.test_write_callback_multi_statement_sequence",
509
+ "eval.tests.test_fs_builtins.test_write_creates_file[write-callback-marker]",
510
+ "eval.tests.test_fs_builtins.test_write_creates_file[write-create]",
511
+ "eval.tests.test_fs_builtins.test_write_creates_file[write-empty-buffer]",
512
+ "eval.tests.test_fs_builtins.test_write_into_existing_nested_dir",
513
+ "eval.tests.test_fs_builtins.test_write_multiple_appends",
514
+ "eval.tests.test_fs_builtins.test_write_seek_offset[write-seek-at-end]",
515
+ "eval.tests.test_fs_builtins.test_write_seek_offset[write-seek-extend]",
516
+ "eval.tests.test_fs_builtins.test_write_seek_offset[write-seek-middle]",
517
+ "eval.tests.test_fs_builtins.test_write_seek_offset[write-seek-start]",
518
+ "eval.tests.test_fs_builtins.test_write_to_unsupported_path_errors",
519
+ "eval.tests.test_fs_builtins.test_write_type_errors[write-cb-not-function]",
520
+ "eval.tests.test_fs_builtins.test_write_type_errors[write-data-not-string]",
521
+ "eval.tests.test_fs_builtins.test_write_type_errors[write-offset-not-number]",
522
+ "eval.tests.test_fs_builtins.test_write_type_errors[write-path-not-string]",
523
+ "eval.tests.test_functions.test_closures[closure-in-closure]",
524
+ "eval.tests.test_functions.test_closures[closure-read-upvalue]",
525
+ "eval.tests.test_functions.test_closures[closure-sees-latest-frame]",
526
+ "eval.tests.test_functions.test_function_call[call-return-value]",
527
+ "eval.tests.test_functions.test_function_call[call-returns-bool]",
528
+ "eval.tests.test_functions.test_function_call[call-single-arg]",
529
+ "eval.tests.test_functions.test_function_call[call-two-args]",
530
+ "eval.tests.test_functions.test_function_call[call-zero-args]",
531
+ "eval.tests.test_functions.test_function_call_errors[call-native-type-name-num]",
532
+ "eval.tests.test_functions.test_function_call_errors[call-nonfunc]",
533
+ "eval.tests.test_functions.test_function_identity_equality",
534
+ "eval.tests.test_functions.test_missing_argument_binds_as_null",
535
+ "eval.tests.test_functions.test_partial_application_is_not_automatic",
536
+ "eval.tests.test_functions.test_recursion_factorial",
537
+ "eval.tests.test_functions.test_recursion_fibonacci",
538
+ "eval.tests.test_functions.test_tail_call_optimization[c := n => (n = 50000) :: {true -> n, _ -> c(n + 1)}, out(string(c(0)))-50000-deep-tail-recursion]",
539
+ "eval.tests.test_functions.test_tail_call_optimization[loop := n => (n = 200000) :: {true -> 'done', _ -> loop(n + 1)}, out(loop(0))-done-tail-recursion-200k]",
540
+ "eval.tests.test_match.test_match[match-bool]",
541
+ "eval.tests.test_match.test_match[match-composite]",
542
+ "eval.tests.test_match.test_match[match-default]",
543
+ "eval.tests.test_match.test_match[match-list]",
544
+ "eval.tests.test_match.test_match[match-mid-clause]",
545
+ "eval.tests.test_match.test_match[match-no-clause-null]",
546
+ "eval.tests.test_match.test_match[match-number]",
547
+ "eval.tests.test_match.test_match[match-string]",
548
+ "eval.tests.test_match.test_match_first_clause_wins",
549
+ "eval.tests.test_match.test_match_inside_functions[cat := x => x :: {0 -> 'none', 1 -> 'one', _ -> 'many'}, out(cat(1) + ',' + cat(5))-one,many-match-fn-returns]",
550
+ "eval.tests.test_match.test_match_inside_functions[fizz := n => n :: {0 -> 'zero', _ -> 'other'}, out(fizz(0))-zero-match-value-in-fn]",
551
+ "eval.tests.test_match.test_match_with_computed_case_expression",
552
+ "eval.tests.test_permissions.test_isolate_disables_exec",
553
+ "eval.tests.test_permissions.test_isolate_disables_net",
554
+ "eval.tests.test_permissions.test_isolate_disables_read",
555
+ "eval.tests.test_permissions.test_no_exec_returns_fake_close_function",
556
+ "eval.tests.test_permissions.test_no_net_listen_returns_fake_close",
557
+ "eval.tests.test_permissions.test_no_net_req_returns_fake_close",
558
+ "eval.tests.test_permissions.test_no_read_dir_reports_zero_entries",
559
+ "eval.tests.test_permissions.test_no_read_read_returns_empty_string",
560
+ "eval.tests.test_permissions.test_no_read_stat_reports_zeroed_metadata",
561
+ "eval.tests.test_permissions.test_no_write_delete_fires_end_and_preserves_file[-isolate]",
562
+ "eval.tests.test_permissions.test_no_write_delete_fires_end_and_preserves_file[-no-write]",
563
+ "eval.tests.test_permissions.test_no_write_make_fires_end_without_creating[-isolate]",
564
+ "eval.tests.test_permissions.test_no_write_make_fires_end_without_creating[-no-write]",
565
+ "eval.tests.test_permissions.test_no_write_write_fires_end_without_writing",
566
+ "eval.tests.test_process_builtins.test_exec_captures_stdout[exec-arg-passthrough]",
567
+ "eval.tests.test_process_builtins.test_exec_captures_stdout[exec-multi-args]",
568
+ "eval.tests.test_process_builtins.test_exec_captures_stdout[exec-stdin-passthrough]",
569
+ "eval.tests.test_process_builtins.test_exec_echo_stdout_text",
570
+ "eval.tests.test_process_builtins.test_exec_errors[exec-args-not-list]",
571
+ "eval.tests.test_process_builtins.test_exec_errors[exec-args-not-string]",
572
+ "eval.tests.test_process_builtins.test_exec_errors[exec-argv-not-composite]",
573
+ "eval.tests.test_process_builtins.test_exec_errors[exec-arity]",
574
+ "eval.tests.test_process_builtins.test_exec_missing_command_errors",
575
+ "eval.tests.test_process_builtins.test_exec_nonzero_exit_still_reports_data",
576
+ "eval.tests.test_process_builtins.test_exec_stdout_with_args_and_prefix",
577
+ "eval.tests.test_process_builtins.test_in_end_event_on_empty_stdin",
578
+ "eval.tests.test_process_builtins.test_in_errors[in-arity]",
579
+ "eval.tests.test_process_builtins.test_in_errors[in-cb-not-function]",
580
+ "eval.tests.test_process_builtins.test_in_reads_stdin_lines",
581
+ "eval.tests.test_process_builtins.test_in_stops_when_callback_returns_false",
582
+ "eval.tests.test_process_builtins.test_load_brings_in_module_bindings",
583
+ "eval.tests.test_process_builtins.test_load_caches_module_after_first_import",
584
+ "eval.tests.test_process_builtins.test_load_errors[load-arity]",
585
+ "eval.tests.test_process_builtins.test_load_errors[load-non-string]",
586
+ "eval.tests.test_process_builtins.test_load_module_bindings_are_visible",
587
+ "eval.tests.test_process_builtins.test_load_nested_module_reexports",
588
+ "eval.tests.test_process_builtins.test_load_resolves_relative_to_main_file",
589
+ "eval.tests.test_process_builtins.test_wait_errors[wait-arity]",
590
+ "eval.tests.test_process_builtins.test_wait_errors[wait-non-number]",
591
+ "eval.tests.test_process_builtins.test_wait_runs_callback_after_delay",
592
+ "eval.tests.test_process_builtins.test_wait_sequence_order_with_main_then_callback",
593
+ "eval.tests.test_runtime_value_forms.test_dump_lists_native_function_repr[dump-exit]",
594
+ "eval.tests.test_runtime_value_forms.test_dump_lists_native_function_repr[dump-len]",
595
+ "eval.tests.test_runtime_value_forms.test_dump_lists_native_function_repr[dump-sin]",
596
+ "eval.tests.test_runtime_value_forms.test_dump_lists_native_function_repr[dump-urand]",
597
+ "eval.tests.test_runtime_value_forms.test_dump_lists_native_function_repr[dump-write]",
598
+ "eval.tests.test_runtime_value_forms.test_dump_native_function_repr_exact",
599
+ "eval.tests.test_runtime_value_forms.test_dump_native_functions_listed_multiple",
600
+ "eval.tests.test_runtime_value_forms.test_error_composite_carries_type_and_message",
601
+ "eval.tests.test_runtime_value_forms.test_math_and_byte_boundaries[out(string(floor(5)))-5-floor-integer-passthrough]",
602
+ "eval.tests.test_runtime_value_forms.test_math_and_byte_boundaries[out(string(point('A') + point('B')))-131-point-two-chars-sum]",
603
+ "eval.tests.test_runtime_value_forms.test_math_and_byte_boundaries[out(string(point('\\xe9')))-195-point-multibyte-first-byte]",
604
+ "eval.tests.test_runtime_value_forms.test_math_and_byte_boundaries[out(string(point(char(255))))-255-char-255-roundtrip]",
605
+ "eval.tests.test_runtime_value_forms.test_native_and_user_function_string_repr[string-native-dir]",
606
+ "eval.tests.test_runtime_value_forms.test_native_and_user_function_string_repr[string-native-exit]",
607
+ "eval.tests.test_runtime_value_forms.test_native_and_user_function_string_repr[string-native-out]",
608
+ "eval.tests.test_runtime_value_forms.test_native_and_user_function_string_repr[string-user-function]",
609
+ "eval.tests.test_runtime_value_forms.test_native_function_equality[out(string((exit = exit)) + ',' + string((exit = out)))-true,false-native-equality-by-name]",
610
+ "eval.tests.test_runtime_value_forms.test_native_function_equality[out(string((type = type)) + ',' + string((write = read)))-true,false-native-equality-more]",
611
+ "eval.tests.test_runtime_value_forms.test_permission_flags_are_accepted_together_with_eval[-isolate]",
612
+ "eval.tests.test_runtime_value_forms.test_permission_flags_are_accepted_together_with_eval[-no-net]",
613
+ "eval.tests.test_runtime_value_forms.test_permission_flags_are_accepted_together_with_eval[-no-read]",
614
+ "eval.tests.test_runtime_value_forms.test_permission_flags_are_accepted_together_with_eval[-no-write]",
615
+ "eval.tests.test_runtime_value_forms.test_type_of_native_function_is_function",
616
+ "eval.tests.test_values.test_composite_string_repr[out(string([1, 2, 3]))-{0: 1, 1: 2, 2: 3}-list-repr-three]",
617
+ "eval.tests.test_values.test_composite_string_repr[out(string({a: 'x'}))-{a: 'x'}-obj-repr-string-quoted]",
618
+ "eval.tests.test_values.test_composite_string_repr[out(string({a: 1, b: 2}))-{a: 1, b: 2}-obj-repr]",
619
+ "eval.tests.test_values.test_composite_string_repr[out(string({s: 'a\\\\'b'}))-{s: 'a\\\\'b'}-obj-repr-escaped-quote]",
620
+ "eval.tests.test_values.test_empty_expression_list_returns_null",
621
+ "eval.tests.test_values.test_equals_representation[eq-compares-bools]",
622
+ "eval.tests.test_values.test_equals_representation[eq-is-transitive]",
623
+ "eval.tests.test_values.test_equals_representation[int-equals-float]",
624
+ "eval.tests.test_values.test_list_literal_indexed_from_zero",
625
+ "eval.tests.test_values.test_object_literal_expressions",
626
+ "eval.tests.test_values.test_primitive_string_repr[bool-false]",
627
+ "eval.tests.test_values.test_primitive_string_repr[bool-true]",
628
+ "eval.tests.test_values.test_primitive_string_repr[exprlist-last-wins]",
629
+ "eval.tests.test_values.test_primitive_string_repr[null-singleton]",
630
+ "eval.tests.test_values.test_primitive_string_repr[num-float]",
631
+ "eval.tests.test_values.test_primitive_string_repr[num-int]",
632
+ "eval.tests.test_values.test_primitive_string_repr[num-large-int]"
633
+ ]
634
+ }
635
+ },
636
+ "commit": "b6fd222ba018da374825ceb5ed2fddb0db81ab14",
637
+ "data_source": "synthetic_programgym",
638
+ "difficulty": "easy",
639
+ "difficulty_score": 1.6570558528571038,
640
+ "eval_clean_hashes": [
641
+ "ae9b4d923ec9dc78382a8c855ed0d67da2f7a8ae40c0fa5a5c7338fa419f4532"
642
+ ],
643
+ "input_record": {
644
+ "commit": "b6fd222ba018da374825ceb5ed2fddb0db81ab14",
645
+ "commits": 373,
646
+ "contributors": 1,
647
+ "difficulty": "easy",
648
+ "difficulty_code_lines": 4540,
649
+ "difficulty_has_tests": false,
650
+ "difficulty_product_code_lines": 4540,
651
+ "difficulty_runtime_deps": 0,
652
+ "difficulty_score": 1.6570558528571038,
653
+ "difficulty_test_code_lines": 0,
654
+ "full_name": "thesephist/ink",
655
+ "github_stars": 577,
656
+ "input_joern_zip": "go_joern/thesephist__ink.zip",
657
+ "joern_status": true,
658
+ "joern_time": 14.397347141988575,
659
+ "language": "go",
660
+ "pb_match": [
661
+ {
662
+ "pb_fullname": "alecthomas/chroma",
663
+ "rank": 400,
664
+ "similarity": 0.49667465686798096
665
+ },
666
+ {
667
+ "pb_fullname": "eliukblau/pixterm",
668
+ "rank": 780,
669
+ "similarity": 0.4966352581977844
670
+ }
671
+ ],
672
+ "repo_age": 7.2,
673
+ "repo_path": "go/thesephist__ink",
674
+ "source": "commit:b6fd222ba018da374825ceb5ed2fddb0db81ab14",
675
+ "status": "done",
676
+ "url": "https://github.com/thesephist/ink"
677
+ },
678
+ "instance_id": "thesephist__ink.b6fd222",
679
+ "language": "go",
680
+ "module_iterations": [
681
+ {
682
+ "actual_iterations": 2,
683
+ "branch_name": "generated_module_01",
684
+ "iteration_limit": 5,
685
+ "module_index": 1,
686
+ "module_kind": "source",
687
+ "termination_reason": "module_coverage_threshold_reached"
688
+ },
689
+ {
690
+ "actual_iterations": 3,
691
+ "branch_name": "generated_module_02",
692
+ "iteration_limit": 5,
693
+ "module_index": 2,
694
+ "module_kind": "source",
695
+ "termination_reason": "module_coverage_threshold_reached"
696
+ },
697
+ {
698
+ "actual_iterations": 2,
699
+ "branch_name": "generated_module_03",
700
+ "iteration_limit": 5,
701
+ "module_index": 3,
702
+ "module_kind": "source",
703
+ "termination_reason": "module_coverage_threshold_reached"
704
+ },
705
+ {
706
+ "actual_iterations": 5,
707
+ "branch_name": "generated_module_04",
708
+ "iteration_limit": 5,
709
+ "module_index": 4,
710
+ "module_kind": "source",
711
+ "termination_reason": "max_iterations"
712
+ }
713
+ ],
714
+ "repository": "thesephist/ink"
715
+ }