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 01/25] (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 02/25] 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 03/25] 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 04/25] 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" +} From 00f5bea05aee58f57dbb2e1f49ca66759aca2ac1 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:25:28 +0300 Subject: [PATCH 05/25] Add development plan for miniscoreboard project Document the development plan for the miniscoreboard project, detailing phases and tasks. --- problems/miniscoreboard/plan.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 problems/miniscoreboard/plan.md diff --git a/problems/miniscoreboard/plan.md b/problems/miniscoreboard/plan.md new file mode 100644 index 00000000..a10af013 --- /dev/null +++ b/problems/miniscoreboard/plan.md @@ -0,0 +1,20 @@ +# Development Plan - miniscoreboard + +This document outlines the evolutionary steps of the miniscoreboard project, focusing on a structured progression from basic data entry to advanced analytics. + +## Phase 1: Core Foundation (V1) - [DONE] +- [x] Establish project directory structure (.miniscore/). +- [x] Implement `init` command for environment setup. +- [x] Implement `add-match` for atomic data entry. +- [x] Ensure basic file I/O operations for `matches.dat`. + +## Phase 2: Data Retrieval (V2) - [DONE] +- [x] Implement `history` command to list all matches. +- [x] Implement `team` command for filtered search. +- [x] Enforce stable formatting for CLI output. + +## Phase 3: Analytics & Portability (V3) - [CURRENT] +- [x] **Leaderboard System:** Develop a multi-tier sorting algorithm (Points > GD > GF > Alphabetical). +- [x] **League Summary:** Global calculation of match count, team count, and scoring averages. +- [x] **Data Export:** Build a JSON serializer to allow third-party tool integration. +- [x] **Deterministic Testing:** Ensure `test-v3.sh` yields 100% consistent results. From ff560c177e1d1c97562eeffaf1b41a47c8942457 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:27:12 +0300 Subject: [PATCH 06/25] Add walkthrough for V3 implementation details This document outlines the technical details of the V3 upgrade for miniscoreboard, including advanced leaderboard logic, statistical analytics, and data portability features. --- problems/miniscoreboard/walkthrough.md | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 problems/miniscoreboard/walkthrough.md diff --git a/problems/miniscoreboard/walkthrough.md b/problems/miniscoreboard/walkthrough.md new file mode 100644 index 00000000..5c9f95f3 --- /dev/null +++ b/problems/miniscoreboard/walkthrough.md @@ -0,0 +1,32 @@ +# Walkthrough - V3 Implementation Details + +This document provides a technical overview of the changes introduced in the V3 upgrade of `miniscoreboard`. + +## Technical Achievements + +### 1. Advanced Leaderboard Logic +The core challenge of V3 was the `leaderboard` command. It requires a stable sorting mechanism to handle league standings correctly. +- **Sorting Priority:** The implementation uses a descending sort on Points, followed by Goal Difference (GD), then Goals For (GF). +- **Tie-Breaking:** To ensure determinism (a key project requirement), if all stats are equal, the system falls back to an alphabetical sort by Team Name. +- **Implementation:** Leveraged Python's `sorted()` with a multi-key lambda function for efficiency. + +### 2. Statistical Analytics (Summary) +The `summary` command provides a snapshot of the league's health. +- It dynamically calculates the number of unique teams and total goals. +- It formats the average goals per match to exactly **2 decimal places**, ensuring compliance with the `SPEC-v3.txt` requirements. + +### 3. Data Portability (Export) +The `export` feature bridge the gap between human-readable `.dat` files and machine-readable `.json` formats. +- All match data is serialized into a structured JSON array. +- The output is stored in `.miniscore/matches.json`, facilitating easy import into web dashboards or spreadsheets. + +## Verification & Testing +The implementation was rigorously tested using the `test-v3.sh` suite. +- **Test Results:** 7/7 Tests Passed. +- **Edge Cases Handled:** + - Requesting a leaderboard with an empty history prints a user-friendly error. + - Handling ties in the leaderboard shows consistent ranking orders. + - JSON export overwrites previous exports to keep data fresh. + +## Project Context +Following the **Vibe Coding** philosophy, the architecture focuses on system-level reliability and clean documentation, allowing AI agents and human contributors to understand the codebase instantly. From a29129f5cf856946ef18799c3eae650a14a70dc0 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:38:11 +0300 Subject: [PATCH 07/25] Update problem.json --- problems/miniscoreboard/problem.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/miniscoreboard/problem.json b/problems/miniscoreboard/problem.json index 397370e3..0ff06c5b 100644 --- a/problems/miniscoreboard/problem.json +++ b/problems/miniscoreboard/problem.json @@ -10,4 +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" -} +} \ No newline at end of file From dcc9d8d58066689716f01586f944db2adcd38858 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:45:42 +0300 Subject: [PATCH 08/25] Update SPEC-v1.txt --- problems/miniscoreboard/SPEC-v1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/miniscoreboard/SPEC-v1.txt b/problems/miniscoreboard/SPEC-v1.txt index ae4a6cd6..da1182db 100644 --- a/problems/miniscoreboard/SPEC-v1.txt +++ b/problems/miniscoreboard/SPEC-v1.txt @@ -48,4 +48,4 @@ ERROR HANDLING - Inputs containing '|': print "Error: The '|' character is reserved." - Non-numeric scores: print "Error: Scores must be positive numbers." - Empty team names: print "Error: Team names cannot be empty." -- Team playing itself: print "Error: A team cannot play against itself." +- Team playing itself: print "Error: A team cannot play against itself." From 1adcc6f94de0e8d5f7830a24d372b4bf36a6985f Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:45:51 +0300 Subject: [PATCH 09/25] Update SPEC-v2.txt --- problems/miniscoreboard/SPEC-v2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/miniscoreboard/SPEC-v2.txt b/problems/miniscoreboard/SPEC-v2.txt index 1aa54cf6..2eec6b43 100644 --- a/problems/miniscoreboard/SPEC-v2.txt +++ b/problems/miniscoreboard/SPEC-v2.txt @@ -62,4 +62,4 @@ ERROR HANDLING - Inputs containing '|': print "Error: The '|' character is reserved." - Non-numeric scores: print "Error: Scores must be positive numbers." - Empty team names: print "Error: Team names cannot be empty." -- Team playing itself: print "Error: A team cannot play against itself." \ No newline at end of file +- Team playing itself: print "Error: A team cannot play against itself." \ No newline at end of file From 8fc12b66d5aa9f7d2780ab0f02e921ef874902c4 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:46:01 +0300 Subject: [PATCH 10/25] Update test-v1.sh --- problems/miniscoreboard/test-v1.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/problems/miniscoreboard/test-v1.sh b/problems/miniscoreboard/test-v1.sh index 014d2326..2f879f55 100644 --- a/problems/miniscoreboard/test-v1.sh +++ b/problems/miniscoreboard/test-v1.sh @@ -27,3 +27,4 @@ fi echo "All V1 tests passed." exit 0 + From 3a9a8f15bff2a285d83371ebdc1982b7352f9590 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:46:11 +0300 Subject: [PATCH 11/25] Update test-v2.sh --- problems/miniscoreboard/test-v2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/miniscoreboard/test-v2.sh b/problems/miniscoreboard/test-v2.sh index 120e3271..b6352794 100644 --- a/problems/miniscoreboard/test-v2.sh +++ b/problems/miniscoreboard/test-v2.sh @@ -47,4 +47,4 @@ if [[ "$TEAM_OUT" != *"TS"* ]] || [[ "$TEAM_OUT" == *"Galatasaray"* ]]; then fi echo "All V1 and V2 tests passed." -exit 0 \ No newline at end of file +exit 0 From 42b7cda069db9658ae726265405ea382887d146d Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:47:02 +0300 Subject: [PATCH 12/25] Update problem.json --- problems/miniscoreboard/problem.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/problems/miniscoreboard/problem.json b/problems/miniscoreboard/problem.json index 0ff06c5b..96460376 100644 --- a/problems/miniscoreboard/problem.json +++ b/problems/miniscoreboard/problem.json @@ -3,11 +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 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", + "v1_prompt": "Implement {{binary_name}} as described in SPEC-v1.txt. Use standard libraries. Verification: bash test-v1.sh", "v2_spec": "SPEC-v2.txt", "v2_test": "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", + "v2_prompt": "Extend {{binary_name}} to support 'history' and 'team' commands according to SPEC-v2.txt. 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" + "v3_prompt": "Finalize {{binary_name}} with 'leaderboard', 'summary', and 'export' as defined in SPEC-v3.txt. Verification: bash test-v3.sh" } \ No newline at end of file From bc38ae3c38885ae2b9846e44aa1f0a8abd05d0dc Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:26:21 +0300 Subject: [PATCH 13/25] Delete README.md --- problems/miniscoreboard/README.md | 40 ------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 problems/miniscoreboard/README.md diff --git a/problems/miniscoreboard/README.md b/problems/miniscoreboard/README.md deleted file mode 100644 index 3301034b..00000000 --- a/problems/miniscoreboard/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# πŸ† 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. From 93ecfa65c109ff562ef1f2e1427a428d61dd62f9 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:26:31 +0300 Subject: [PATCH 14/25] Delete plan.md --- problems/miniscoreboard/plan.md | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 problems/miniscoreboard/plan.md diff --git a/problems/miniscoreboard/plan.md b/problems/miniscoreboard/plan.md deleted file mode 100644 index a10af013..00000000 --- a/problems/miniscoreboard/plan.md +++ /dev/null @@ -1,20 +0,0 @@ -# Development Plan - miniscoreboard - -This document outlines the evolutionary steps of the miniscoreboard project, focusing on a structured progression from basic data entry to advanced analytics. - -## Phase 1: Core Foundation (V1) - [DONE] -- [x] Establish project directory structure (.miniscore/). -- [x] Implement `init` command for environment setup. -- [x] Implement `add-match` for atomic data entry. -- [x] Ensure basic file I/O operations for `matches.dat`. - -## Phase 2: Data Retrieval (V2) - [DONE] -- [x] Implement `history` command to list all matches. -- [x] Implement `team` command for filtered search. -- [x] Enforce stable formatting for CLI output. - -## Phase 3: Analytics & Portability (V3) - [CURRENT] -- [x] **Leaderboard System:** Develop a multi-tier sorting algorithm (Points > GD > GF > Alphabetical). -- [x] **League Summary:** Global calculation of match count, team count, and scoring averages. -- [x] **Data Export:** Build a JSON serializer to allow third-party tool integration. -- [x] **Deterministic Testing:** Ensure `test-v3.sh` yields 100% consistent results. From c4bcf8c4138d270239a2ea7ee2997e7635aa3b44 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:26:41 +0300 Subject: [PATCH 15/25] Delete walkthrough.md --- problems/miniscoreboard/walkthrough.md | 32 -------------------------- 1 file changed, 32 deletions(-) delete mode 100644 problems/miniscoreboard/walkthrough.md diff --git a/problems/miniscoreboard/walkthrough.md b/problems/miniscoreboard/walkthrough.md deleted file mode 100644 index 5c9f95f3..00000000 --- a/problems/miniscoreboard/walkthrough.md +++ /dev/null @@ -1,32 +0,0 @@ -# Walkthrough - V3 Implementation Details - -This document provides a technical overview of the changes introduced in the V3 upgrade of `miniscoreboard`. - -## Technical Achievements - -### 1. Advanced Leaderboard Logic -The core challenge of V3 was the `leaderboard` command. It requires a stable sorting mechanism to handle league standings correctly. -- **Sorting Priority:** The implementation uses a descending sort on Points, followed by Goal Difference (GD), then Goals For (GF). -- **Tie-Breaking:** To ensure determinism (a key project requirement), if all stats are equal, the system falls back to an alphabetical sort by Team Name. -- **Implementation:** Leveraged Python's `sorted()` with a multi-key lambda function for efficiency. - -### 2. Statistical Analytics (Summary) -The `summary` command provides a snapshot of the league's health. -- It dynamically calculates the number of unique teams and total goals. -- It formats the average goals per match to exactly **2 decimal places**, ensuring compliance with the `SPEC-v3.txt` requirements. - -### 3. Data Portability (Export) -The `export` feature bridge the gap between human-readable `.dat` files and machine-readable `.json` formats. -- All match data is serialized into a structured JSON array. -- The output is stored in `.miniscore/matches.json`, facilitating easy import into web dashboards or spreadsheets. - -## Verification & Testing -The implementation was rigorously tested using the `test-v3.sh` suite. -- **Test Results:** 7/7 Tests Passed. -- **Edge Cases Handled:** - - Requesting a leaderboard with an empty history prints a user-friendly error. - - Handling ties in the leaderboard shows consistent ranking orders. - - JSON export overwrites previous exports to keep data fresh. - -## Project Context -Following the **Vibe Coding** philosophy, the architecture focuses on system-level reliability and clean documentation, allowing AI agents and human contributors to understand the codebase instantly. From ce5fb6e61a76eb1e633c4af3f4f84616c2fdf785 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:27:57 +0300 Subject: [PATCH 16/25] Delete test-v3.sh --- problems/miniscoreboard/test-v3.sh | 82 ------------------------------ 1 file changed, 82 deletions(-) delete mode 100644 problems/miniscoreboard/test-v3.sh diff --git a/problems/miniscoreboard/test-v3.sh b/problems/miniscoreboard/test-v3.sh deleted file mode 100644 index ae239719..00000000 --- a/problems/miniscoreboard/test-v3.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/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 de2032153be903abf70beba6853b520373247a78 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:28:03 +0300 Subject: [PATCH 17/25] Delete SPEC-v3.txt --- problems/miniscoreboard/SPEC-v3.txt | 71 ----------------------------- 1 file changed, 71 deletions(-) delete mode 100644 problems/miniscoreboard/SPEC-v3.txt diff --git a/problems/miniscoreboard/SPEC-v3.txt b/problems/miniscoreboard/SPEC-v3.txt deleted file mode 100644 index c99c6635..00000000 --- a/problems/miniscoreboard/SPEC-v3.txt +++ /dev/null @@ -1,71 +0,0 @@ -PROJECT: miniscoreboard -AUTHOR: Utkuhan Akar (V3 Upgrade) (251478036) --------------------------------------------- -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." From ee0778ea0a8d60555d0f74d5a5336479a7d64005 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:28:21 +0300 Subject: [PATCH 18/25] Update problem.json --- problems/miniscoreboard/problem.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/problems/miniscoreboard/problem.json b/problems/miniscoreboard/problem.json index 96460376..4b85047b 100644 --- a/problems/miniscoreboard/problem.json +++ b/problems/miniscoreboard/problem.json @@ -6,8 +6,5 @@ "v1_prompt": "Implement {{binary_name}} as described in SPEC-v1.txt. Use standard libraries. Verification: bash test-v1.sh", "v2_spec": "SPEC-v2.txt", "v2_test": "test-v2.sh", - "v2_prompt": "Extend {{binary_name}} to support 'history' and 'team' commands according to SPEC-v2.txt. Verification: bash test-v2.sh", - "v3_spec": "SPEC-v3.txt", - "v3_test": "test-v3.sh", - "v3_prompt": "Finalize {{binary_name}} with 'leaderboard', 'summary', and 'export' as defined in SPEC-v3.txt. Verification: bash test-v3.sh" + "v2_prompt": "Extend {{binary_name}} to support 'history' and 'team' commands according to SPEC-v2.txt. Verification: bash test-v2.sh" } \ No newline at end of file From acba9b6cad61022db6f9460f6d17934f952b35e9 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:37:35 +0300 Subject: [PATCH 19/25] Update SPEC-v2.txt --- problems/miniscoreboard/SPEC-v2.txt | 57 +++++++++++------------------ 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/problems/miniscoreboard/SPEC-v2.txt b/problems/miniscoreboard/SPEC-v2.txt index 2eec6b43..b735e934 100644 --- a/problems/miniscoreboard/SPEC-v2.txt +++ b/problems/miniscoreboard/SPEC-v2.txt @@ -8,58 +8,45 @@ OVERVIEW ======================================== miniscoreboard is a command-line sports match management tool. -It stores match records in a plain text file and supports -initializing the system, adding new match results, viewing -historical matches, and filtering by team. - -All data is persisted in a directory called .miniscore/ -in the current working directory. +This version improves the system by adding data retrieval, +filtering capabilities, and stronger validation rules. ======================================== -COMMANDS +NEW FEATURES (V2 IMPROVEMENTS) ======================================== ---- init --- -Usage: python miniscore.py init -Creates a .miniscore/ directory and an empty matches.dat file. -If .miniscore/ already exists, prints "Already initialized". +1. Match History Retrieval +2. Team-based Filtering +3. Input Validation Enhancements ---- add-match --- -Usage: python miniscore.py add-match -Appends a new match to matches.dat. -Each match has: id (auto-increment), league, week, date, teama, scorea, teamb, scoreb. -Prints "Added match #: [ - ] - on " +======================================== +COMMANDS +======================================== --- history --- Usage: python miniscore.py history -Reads the .miniscore/matches.dat file and prints all matches. -Format per line: [] - () +Lists all matches in the system. If no matches exist, prints "History is empty." --- team --- Usage: python miniscore.py team -Filters matches and prints only the ones where played -(either as TeamA or TeamB). -Format per line: [ - ] - () -If no matches are found, prints "No matches found for ." +Filters matches where the given team participated. +If no matches found, prints "No matches found for ." ======================================== -DATA FORMAT +VALIDATION RULES ======================================== -File: .miniscore/matches.dat -Format: One match per line, fields separated by | -Example: -1|SuperLig|W1|2026-04-01|GALATASARAY|2|FENERBAHCE|1 +- Input cannot contain '|' +- Scores must be numeric and positive +- Team names cannot be empty +- A team cannot play against itself ======================================== -ERROR HANDLING +IMPROVEMENT SUMMARY ======================================== -- Running any command before "init": print "Not initialized." -- Invalid command: print "Unknown command: " -- Missing arguments: print "Usage: python miniscore.py [args]" -- Inputs containing '|': print "Error: The '|' character is reserved." -- Non-numeric scores: print "Error: Scores must be positive numbers." -- Empty team names: print "Error: Team names cannot be empty." -- Team playing itself: print "Error: A team cannot play against itself." \ No newline at end of file +Compared to V1: +- System now supports reading stored data +- Users can filter matches by team +- Input errors are handled more strictly \ No newline at end of file From d7cfa672fad1de350ad3339989cce037e55be876 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:40:12 +0300 Subject: [PATCH 20/25] Update test-v1.sh --- problems/miniscoreboard/test-v1.sh | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/problems/miniscoreboard/test-v1.sh b/problems/miniscoreboard/test-v1.sh index 2f879f55..47f072e9 100644 --- a/problems/miniscoreboard/test-v1.sh +++ b/problems/miniscoreboard/test-v1.sh @@ -1,30 +1,18 @@ #!/bin/bash -# miniscoreboard v1 test script - rm -rf .miniscore -# Test 1: Init Command +# Test 1: Init INIT_OUT=$(python3 miniscore.py init) -if [[ "$INIT_OUT" != *"Initialized"* ]]; then - echo "FAIL: Init command did not work." - exit 1 -fi +echo "$INIT_OUT" | grep -E "Initialized|Created" || exit 1 -# Test 2: Add Match Command -ADD_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-03-31 Galatasaray 2 Fenerbahce 1) -if [[ "$ADD_OUT" != *"Added match #1"* ]]; then - echo "FAIL: Add match command did not work correctly." - exit 1 -fi +# Test 2: Add Match +ADD_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-03-31 GS 2 FB 1) +echo "$ADD_OUT" | grep "Added match #1" || exit 1 -# Test 3: Validation (Clone Match) +# Test 3: Validation (same team) CLONE_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-03-31 GS 2 GS 1) -if [[ "$CLONE_OUT" != *"Error"* ]]; then - echo "FAIL: Security validation failed for clone teams." - exit 1 -fi - -echo "All V1 tests passed." -exit 0 +echo "$CLONE_OUT" | grep "Error" || exit 1 +echo "All V1 tests passed" +exit 0 \ No newline at end of file From cf838732f0b8deec268091d81f2c7f146fd456a2 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:40:27 +0300 Subject: [PATCH 21/25] Update test-v2.sh --- problems/miniscoreboard/test-v2.sh | 79 +++++++++++++++--------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/problems/miniscoreboard/test-v2.sh b/problems/miniscoreboard/test-v2.sh index b6352794..e4c9ccba 100644 --- a/problems/miniscoreboard/test-v2.sh +++ b/problems/miniscoreboard/test-v2.sh @@ -1,50 +1,49 @@ #!/bin/bash -# miniscoreboard v2 test script (Includes V1 + V2 capabilities) - rm -rf .miniscore -# --- V1 COMMAND TESTS --- +# --- SETUP --- +python3 miniscore.py init -# Test 1: Init Command -INIT_OUT=$(python3 miniscore.py init) -if [[ "$INIT_OUT" != *"Initialized"* ]]; then - echo "FAIL: Init command did not work." - exit 1 -fi +python3 miniscore.py add-match SuperLig W1 2026-04-01 GS 2 FB 1 > /dev/null +python3 miniscore.py add-match SuperLig W2 2026-04-07 BJK 3 TS 0 > /dev/null +python3 miniscore.py add-match SuperLig W3 2026-04-10 FB 1 BJK 1 > /dev/null -# Test 2: Add Match Command -ADD_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-04-01 Galatasaray 2 Fenerbahce 1) -if [[ "$ADD_OUT" != *"Added match #1"* ]]; then - echo "FAIL: Add match command did not work correctly." - exit 1 -fi +# --- V1 TESTS --- +ADD_CHECK=$(python3 miniscore.py add-match SuperLig W4 2026-04-11 TS 2 GS 0) +echo "$ADD_CHECK" | grep "Added match #4" || exit 1 -# Test 3: Validation (Clone Match) -CLONE_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-04-01 GS 2 GS 1) -if [[ "$CLONE_OUT" != *"Error"* ]]; then - echo "FAIL: Security validation failed for clone teams." - exit 1 -fi +# --- V2 TESTS --- -# --- V2 COMMAND TESTS --- +# History +HIST=$(python3 miniscore.py history) +echo "$HIST" | grep "GS" || exit 1 +echo "$HIST" | grep "BJK" || exit 1 -# Add more data for V2 filtering tests -python3 miniscore.py add-match SuperLig W2 2026-04-07 BJK 3 TS 0 > /dev/null +# Team filter +TEAM=$(python3 miniscore.py team BJK) +echo "$TEAM" | grep "TS" || exit 1 + +# Validation +INVALID=$(python3 miniscore.py add-match SuperLig W5 2026-04-12 GS 2 GS 1) +echo "$INVALID" | grep "Error" || exit 1 + +# --- ADVANCED (SENΔ°N V3 = HOCANIN V2) --- + +# Leaderboard +LB=$(python3 miniscore.py leaderboard) +echo "$LB" | grep "\[1\]" || exit 1 + +# Summary +SUM=$(python3 miniscore.py summary) +echo "$SUM" | grep "Total Matches" || exit 1 + +# Export +EXP=$(python3 miniscore.py export) +echo "$EXP" | grep "Exported" || exit 1 + +# File check +[ -f ".miniscore/matches.json" ] || exit 1 -# Test 4: History Command -HIST_OUT=$(python3 miniscore.py history) -if [[ "$HIST_OUT" != *"Galatasaray"* ]] || [[ "$HIST_OUT" != *"BJK"* ]]; then - echo "FAIL: History command did not list all matches." - exit 1 -fi - -# Test 5: Team Filter Command -TEAM_OUT=$(python3 miniscore.py team BJK) -if [[ "$TEAM_OUT" != *"TS"* ]] || [[ "$TEAM_OUT" == *"Galatasaray"* ]]; then - echo "FAIL: Team command filtering is broken." - exit 1 -fi - -echo "All V1 and V2 tests passed." -exit 0 +echo "All V1 + V2 (enhanced) tests passed" +exit 0 \ No newline at end of file From 84cb4ab23999a9e5264e038741768eaa811f6dba Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:45:09 +0300 Subject: [PATCH 22/25] Update test-v2.sh --- problems/miniscoreboard/test-v2.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/problems/miniscoreboard/test-v2.sh b/problems/miniscoreboard/test-v2.sh index e4c9ccba..0e5d47d3 100644 --- a/problems/miniscoreboard/test-v2.sh +++ b/problems/miniscoreboard/test-v2.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rm -rf .miniscore # --- SETUP --- From 69c59a78e27c6f3b8a34559d14e497ec8a497890 Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:45:29 +0300 Subject: [PATCH 23/25] Update test-v1.sh --- problems/miniscoreboard/test-v1.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/problems/miniscoreboard/test-v1.sh b/problems/miniscoreboard/test-v1.sh index 47f072e9..f2ee7bc9 100644 --- a/problems/miniscoreboard/test-v1.sh +++ b/problems/miniscoreboard/test-v1.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + rm -rf .miniscore # Test 1: Init From 512d8f50f6eac15c21cf6f6341e167df63db63eb Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:47:13 +0300 Subject: [PATCH 24/25] Update test-v1.sh --- problems/miniscoreboard/test-v1.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/problems/miniscoreboard/test-v1.sh b/problems/miniscoreboard/test-v1.sh index f2ee7bc9..5d5be5a7 100644 --- a/problems/miniscoreboard/test-v1.sh +++ b/problems/miniscoreboard/test-v1.sh @@ -1,20 +1,19 @@ #!/bin/bash - set -e rm -rf .miniscore # Test 1: Init INIT_OUT=$(python3 miniscore.py init) -echo "$INIT_OUT" | grep -E "Initialized|Created" || exit 1 +echo "$INIT_OUT" | grep -E "Initialized|Created" >/dev/null || exit 1 # Test 2: Add Match ADD_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-03-31 GS 2 FB 1) -echo "$ADD_OUT" | grep "Added match #1" || exit 1 +echo "$ADD_OUT" | grep "Added match #1" >/dev/null || exit 1 # Test 3: Validation (same team) CLONE_OUT=$(python3 miniscore.py add-match SuperLig W1 2026-03-31 GS 2 GS 1) -echo "$CLONE_OUT" | grep "Error" || exit 1 +echo "$CLONE_OUT" | grep "Error" >/dev/null || exit 1 echo "All V1 tests passed" exit 0 \ No newline at end of file From 8f00758c23eb8cfed7a5c9f74485fa216b6422af Mon Sep 17 00:00:00 2001 From: Utkuhan Akar <249804008+utkuhanakar@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:47:42 +0300 Subject: [PATCH 25/25] Update test-v2.sh --- problems/miniscoreboard/test-v2.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/problems/miniscoreboard/test-v2.sh b/problems/miniscoreboard/test-v2.sh index 0e5d47d3..1913f7a3 100644 --- a/problems/miniscoreboard/test-v2.sh +++ b/problems/miniscoreboard/test-v2.sh @@ -1,5 +1,4 @@ #!/bin/bash - set -e rm -rf .miniscore @@ -13,36 +12,36 @@ python3 miniscore.py add-match SuperLig W3 2026-04-10 FB 1 BJK 1 > /dev/null # --- V1 TESTS --- ADD_CHECK=$(python3 miniscore.py add-match SuperLig W4 2026-04-11 TS 2 GS 0) -echo "$ADD_CHECK" | grep "Added match #4" || exit 1 +echo "$ADD_CHECK" | grep "Added match #4" >/dev/null || exit 1 # --- V2 TESTS --- # History HIST=$(python3 miniscore.py history) -echo "$HIST" | grep "GS" || exit 1 -echo "$HIST" | grep "BJK" || exit 1 +echo "$HIST" | grep "GS" >/dev/null || exit 1 +echo "$HIST" | grep "BJK" >/dev/null || exit 1 # Team filter TEAM=$(python3 miniscore.py team BJK) -echo "$TEAM" | grep "TS" || exit 1 +echo "$TEAM" | grep "TS" >/dev/null || exit 1 # Validation INVALID=$(python3 miniscore.py add-match SuperLig W5 2026-04-12 GS 2 GS 1) -echo "$INVALID" | grep "Error" || exit 1 +echo "$INVALID" | grep "Error" >/dev/null || exit 1 -# --- ADVANCED (SENΔ°N V3 = HOCANIN V2) --- +# --- ADVANCED --- # Leaderboard LB=$(python3 miniscore.py leaderboard) -echo "$LB" | grep "\[1\]" || exit 1 +echo "$LB" | grep "\[1\]" >/dev/null || exit 1 # Summary SUM=$(python3 miniscore.py summary) -echo "$SUM" | grep "Total Matches" || exit 1 +echo "$SUM" | grep "Total Matches" >/dev/null || exit 1 # Export EXP=$(python3 miniscore.py export) -echo "$EXP" | grep "Exported" || exit 1 +echo "$EXP" | grep "Exported" >/dev/null || exit 1 # File check [ -f ".miniscore/matches.json" ] || exit 1