feat: Aufgaben a-01 bis a-03 und b-04 bis b-06
Aufgaben unter tasks/ mit prompt.md, task.toml, start/ und check.sh. Musterlösungen bestehen die Checks, eine leere Lösung scheitert. b-06 erkennt fünf Mutationen; behoben: veralteter Bytecode in Mutantenkopien. Echter Lauf mit qwen3:0.6b auf srv04: 0 von 6 bestanden. Ein Repo-Test prüft die Gültigkeit der Aufgaben. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
19
tasks/B/b-06/check.sh
Executable file
19
tasks/B/b-06/check.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# Score: 0.5 für grüne Tests auf dem Original, weitere 0.5 wenn die Tests
|
||||
# eingebaute Fehler (Mutationen) erkennen. Letzte Zeile ist JSON.
|
||||
cd /work || { echo '{"score": 0.0, "notes": "kein /work"}'; exit 0; }
|
||||
# Kein Bytecode-Cache: sonst nutzt Python bei gleicher Größe und Zeit veralteten Code der Mutation.
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
[ -f test_rechner.py ] || { echo '{"score": 0.0, "notes": "test_rechner.py fehlt"}'; exit 0; }
|
||||
python3 -m pytest -q -p no:cacheprovider test_rechner.py >/tmp/orig.log 2>&1 || { echo '{"score": 0.0, "notes": "Tests auf dem Original rot"}'; exit 0; }
|
||||
caught=0; total=0
|
||||
for m in 's/a + b/a - b/' 's/a - b/a + b/' 's/a \* b/a + b/' 's/return a \/ b/return a \/\/ b/' 's/if b == 0:/if b == 1:/'; do
|
||||
total=$((total+1))
|
||||
rm -rf /checks/mut && mkdir -p /checks/mut && cp -r /work/. /checks/mut/ && rm -rf /checks/mut/__pycache__
|
||||
sed -i "$m" /checks/mut/rechner.py
|
||||
if ! (cd /checks/mut && python3 -m pytest -q -p no:cacheprovider test_rechner.py >/dev/null 2>&1); then
|
||||
caught=$((caught+1))
|
||||
fi
|
||||
done
|
||||
score=$(python3 -c "print(round(0.5 + 0.5*$caught/$total, 2))")
|
||||
echo "{\"score\": $score, \"notes\": \"Mutationen erkannt: $caught von $total\"}"
|
||||
Reference in New Issue
Block a user