From 073ea31ae74376ebd51a6664cd245a230094ca6f Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Mon, 20 Apr 2026 21:46:20 +0300 Subject: [PATCH 1/4] (miniscoreboard): upgrade to V3 with leaderboard, summary and export - Updated the core benchmark engine to support V3 features. - Implemented new leaderboard, summary, and export functionalities. - Updated problem specification (SPEC-v3.txt) and added new test suites. - Enhanced README and problem.json with version 3 metadata. --- problems/miniscoreboard/README.md | 40 ++++++++++++++ problems/miniscoreboard/SPEC-v3.txt | 70 ++++++++++++++++++++++++ problems/miniscoreboard/test-v3.sh | 82 +++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 problems/miniscoreboard/README.md create mode 100644 problems/miniscoreboard/SPEC-v3.txt create mode 100644 problems/miniscoreboard/test-v3.sh diff --git a/problems/miniscoreboard/README.md b/problems/miniscoreboard/README.md new file mode 100644 index 00000000..3301034b --- /dev/null +++ b/problems/miniscoreboard/README.md @@ -0,0 +1,40 @@ +# ๐Ÿ† miniscoreboard Benchmark Problem + +A command-line sports match management system designed for benchmarking AI efficiency in data persistence, filtering, and analytical processing. + +## ๐Ÿš€ Version Evolution + +### Version 1 (V1) +- **Focus**: Basic Persistence & Shell commands. +- **Commands**: `init`, `add-match`. +- **Infrastructure**: Data stored in `.miniscore/matches.dat` (Pipe-separated format). + +### Version 2 (V2) +- **Focus**: Data Retrieval & Filtering. +- **Commands**: `history` (list all), `team ` (filter matches for a specific team). +- **Validation**: Added basic error handling for reserved characters and data types. + +### Version 3 (V3) +- **Focus**: Analytical Logic & Data Portability. +- **Commands**: + - `leaderboard`: Calculates league standings using 3-1-0 point system. Complex sorting (Points > GD > GF). + - `summary`: High-level league statistics (Average goals, match counts). + - `export`: Serializes match data into `matches.json`. +- **Determinism**: Added `DETERMINISM RULES` to ensure consistent AI behavior across trials. + +--- + +## ๐Ÿงช Running Benchmarks + +```bash +# Dry run +bin/which-language run gemini miniscoreboard --lang python --trials 1 --dry-run + +# Real trial +bin/which-language run gemini miniscoreboard --lang python --trials 1 +``` + +## ๐Ÿ“Š Evaluation Metrics +- **Pass Rate**: Ability to implement complex sorting logic correctly. +- **LOC**: Conciseness in handling file I/O vs processing. +- **Time/Cost**: Efficiency of the generation turns. diff --git a/problems/miniscoreboard/SPEC-v3.txt b/problems/miniscoreboard/SPEC-v3.txt new file mode 100644 index 00000000..54abe465 --- /dev/null +++ b/problems/miniscoreboard/SPEC-v3.txt @@ -0,0 +1,70 @@ +PROJECT: miniscoreboard +AUTHOR: Utkuhan Akar (V3 Upgrade) +VERSION: v3 +DATE: 2026-04-20 + +======================================== +OVERVIEW +======================================== + +miniscoreboard is a command-line sports match management tool. +V3 adds advanced analytics, league standings, and data portability. + +All infrastructure and V1/V2 commands remain mandatory. +- init +- add-match +- history +- team + +======================================== +NEW COMMANDS (V3) +======================================== + +--- leaderboard --- +Usage: python miniscore.py leaderboard +Calculates points for all teams recorded in matches.dat. +- Win: 3 points +- Draw: 1 point +- Loss: 0 points + +Output Format: +Sorted by Points (Descending), then GD (Goal Difference), then GF (Goals For). +[Rank] Team: Pts (W-D-L) GF-GA GD + +Example Output: +[1] GALATASARAY: 6 pts (2-0-0) 5-1 +4 +[2] FENERBAHCE: 3 pts (1-0-1) 3-2 +1 +[3] BESIKTAS: 0 pts (0-0-2) 1-6 -5 + +If no matches exist, print "History is empty." + +--- summary --- +Usage: python miniscore.py summary +Overview of league activity. + +Output Format: +Total Teams: +Total Matches: +Total Goals: +Average Goals/Match: (Fixed to 2 decimal places) + +--- export --- +Usage: python miniscore.py export +Converts matches.dat into a JSON file named .miniscore/matches.json. +Prints "Exported matches to .miniscore/matches.json" + +======================================== +DETERMINISM RULES +======================================== + +- Tool must never produce timestamps or random IDs in outputs unless specified. +- Sorting in leaderboard must be stable. If two teams are equal in Pts, GD, and GF, sort alphabetically by Team Name. +- Output formatting (spaces, case) must exactly match the examples. + +======================================== +ERROR HANDLING +======================================== + +- Inherit all V1/V2 error cases. +- If export fails due to permissions: print "Error: Could not write export file." +- If leaderboard is requested with 0 matches: print "History is empty." diff --git a/problems/miniscoreboard/test-v3.sh b/problems/miniscoreboard/test-v3.sh new file mode 100644 index 00000000..ae239719 --- /dev/null +++ b/problems/miniscoreboard/test-v3.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# V3 Test Suite for miniscoreboard + +BINARY="./miniscore.py" +DB_DIR=".miniscore" +DB_FILE="$DB_DIR/matches.dat" + +# Helper for cleanup +cleanup() { + rm -rf "$DB_DIR" +} + +# Helper for reporting +pass_count=0 +fail_count=0 + +assert_output() { + local cmd=$1 + local expected=$2 + local name=$3 + + output=$($cmd 2>&1) + if [[ "$output" == *"$expected"* ]]; then + echo "PASS: $name" + pass_count=$((pass_count + 1)) + else + echo "FAIL: $name" + echo " Expected: $expected" + echo " Actual: $output" + fail_count=$((fail_count + 1)) + fi +} + +cleanup + +echo "--- Testing V1 Core ---" +assert_output "python3 $BINARY init" "Created .miniscore/ directory" "Init success" +assert_output "python3 $BINARY init" "Already initialized" "Init idempotency" + +echo "--- Testing V1 add-match ---" +python3 $BINARY add-match SuperLig W1 2026-04-01 GS 2 FB 1 > /dev/null +python3 $BINARY add-match SuperLig W1 2026-04-01 BJK 0 TS 0 > /dev/null +assert_output "python3 $BINARY add-match SuperLig W2 2026-04-08 FB 1 BJK 0" "Added match #3" "Add match #3" + +echo "--- Testing V2 history & team ---" +assert_output "python3 $BINARY history" "[1] GS 2 - 1 FB" "History check" +assert_output "python3 $BINARY team FB" "GS 2 - 1 FB" "Team filter GS" +assert_output "python3 $BINARY team FB" "FB 1 - 0 BJK" "Team filter FB" + +echo "--- Testing V3 leaderboard ---" +# GS: 1W (3pts), 2GF, 1GA, +1 +# FB: 1W, 1L (3pts), 2GF, 2GA, 0 +# TS: 1D (1pts), 0GF, 0GA, 0 +# BJK: 1D, 1L (1pts), 0GF, 1GA, -1 +assert_output "python3 $BINARY leaderboard" "[1] GS: 3 pts" "Leaderboard Rank 1" +assert_output "python3 $BINARY leaderboard" "[2] FB: 3 pts" "Leaderboard Rank 2" + +echo "--- Testing V3 summary ---" +assert_output "python3 $BINARY summary" "Total Teams: 4" "Summary Teams" +assert_output "python3 $BINARY summary" "Total Matches: 3" "Summary Matches" +assert_output "python3 $BINARY summary" "Total Goals: 4" "Summary Goals" + +echo "--- Testing V3 export ---" +assert_output "python3 $BINARY export" "Exported 3 matches" "Export command" +if [ -f "$DB_DIR/matches.json" ]; then + echo "PASS: Export file exists" + pass_count=$((pass_count + 1)) +else + echo "FAIL: Export file missing" + fail_count=$((fail_count + 1)) +fi + +echo "" +echo "PASSED: $pass_count" +echo "FAILED: $fail_count" +echo "TOTAL: $((pass_count + fail_count))" + +if [ $fail_count -eq 0 ]; then + exit 0 +else + exit 1 +fi From 0b507c623f1198c6f1444a35180ee350df8c7f14 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Mon, 20 Apr 2026 21:46:43 +0300 Subject: [PATCH 2/4] Revise prompts and add v3 specifications for miniscoreboard Updated prompts for v1, v2, and added v3 specifications with detailed requirements for the miniscoreboard implementation. --- problems/miniscoreboard/problem.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/problems/miniscoreboard/problem.json b/problems/miniscoreboard/problem.json index fe58096a..397370e3 100644 --- a/problems/miniscoreboard/problem.json +++ b/problems/miniscoreboard/problem.json @@ -3,8 +3,11 @@ "binary_name": "miniscore", "v1_spec": "SPEC-v1.txt", "v1_test": "test-v1.sh", - "v1_prompt": "Implement {{binary_name}} as described in SPEC-v1.txt using {{language}}. The executable must be named '{{binary_name}}.py' and handle init and add-match commands.", + "v1_prompt": "Implement {{binary_name}} as described in SPEC-v1.txt using {{language}}. The solution must be a standalone executable script (e.g., with a shebang and proper permissions). Use only standard libraries. Handle 'init' and 'add-match' commands with exact output matching. Verification: bash test-v1.sh", "v2_spec": "SPEC-v2.txt", "v2_test": "test-v2.sh", - "v2_prompt": "Read SPEC-v2.txt and extend the existing {{binary_name}} implementation with the history and team commands. Verify your implementation using test-v2.sh." + "v2_prompt": "Extend the existing {{binary_name}} implementation in {{language}} to support 'history' and 'team' commands according to SPEC-v2.txt. Maintain strict output formatting and error handling. Verification: bash test-v2.sh", + "v3_spec": "SPEC-v3.txt", + "v3_test": "test-v3.sh", + "v3_prompt": "Finalize the {{binary_name}} suite in {{language}} by implementing 'leaderboard', 'summary', and 'export' commands as defined in SPEC-v3.txt. Ensure complex logic for point calculation (3/1/0) and sorting in leaderboard is correct. Verification: bash test-v3.sh" } From 1615f7e6ed49b2a6e1254feeb3a705ada3284cdf Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Mon, 20 Apr 2026 21:49:31 +0300 Subject: [PATCH 3/4] Update SPEC-v3.txt --- problems/miniscoreboard/SPEC-v3.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/problems/miniscoreboard/SPEC-v3.txt b/problems/miniscoreboard/SPEC-v3.txt index 54abe465..c99c6635 100644 --- a/problems/miniscoreboard/SPEC-v3.txt +++ b/problems/miniscoreboard/SPEC-v3.txt @@ -1,5 +1,6 @@ PROJECT: miniscoreboard -AUTHOR: Utkuhan Akar (V3 Upgrade) +AUTHOR: Utkuhan Akar (V3 Upgrade) (251478036) +-------------------------------------------- VERSION: v3 DATE: 2026-04-20 From f728052a3571c094858d68aaa2842df1cbbed0f0 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Mon, 20 Apr 2026 22:04:43 +0300 Subject: [PATCH 4/4] Update problem.json with v3 prompt and spec --- problems/miniscoreboard/problem.json | 1 + 1 file changed, 1 insertion(+) diff --git a/problems/miniscoreboard/problem.json b/problems/miniscoreboard/problem.json index 79db8606..397370e3 100644 --- a/problems/miniscoreboard/problem.json +++ b/problems/miniscoreboard/problem.json @@ -10,3 +10,4 @@ "v3_spec": "SPEC-v3.txt", "v3_test": "test-v3.sh", "v3_prompt": "Finalize the {{binary_name}} suite in {{language}} by implementing 'leaderboard', 'summary', and 'export' commands as defined in SPEC-v3.txt. Ensure complex logic for point calculation (3/1/0) and sorting in leaderboard is correct. Verification: bash test-v3.sh" +}