Skip to content

Conversation

@cosmopax
Copy link
Owner

Summary

  • implement save_items and load_items in srs.py
  • document the persistence helpers in README and project directive
  • add unit test covering the new helpers

Testing

  • pytest -q
  • black --check chess_app tests
  • flake8 (fails: command not found)

https://chatgpt.com/codex/tasks/task_e_684ce44e7f78832ebfafdb3cc9a3182b

@gemini-code-assist
Copy link

Summary of Changes

Hello @cosmopax, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a foundational component for an 'Openings Mentor' feature by implementing a spaced repetition system (SRS) in a new srs.py module. This system allows for efficient learning and review of chess openings, complete with functions to save and load progress. Complementing this new feature, the project's setup and development environment scripts have been significantly improved for ease of use and robustness, and comprehensive project documentation has been added. Additionally, minor formatting and linting adjustments were applied across several existing Python files to maintain code quality.

Highlights

  • Spaced Repetition System (SRS) Implementation: Introduced a new srs.py module implementing the SM-2 spaced repetition algorithm, including functions to update item easiness and intervals, and to identify items due for review.
  • SRS Persistence Helpers: Added save_items and load_items functions within the srs.py module, enabling the persistence of spaced repetition items to and from JSON files.
  • Enhanced Installation and Development Setup: Updated the main installation script (install_chess_app.sh) to support non-interactive mode and dynamically fetch the latest Stockfish engine. A new install.sh script and dev-requirements.txt were added to streamline the setup of a development environment with tools like flake8, black, and pytest.
  • Comprehensive Project Documentation: A new project_directive.md file was added, providing a detailed overview of the project's goals, architecture, installation instructions, contribution guidelines, and future scope, with specific mention of the Openings Mentor and SRS module.
  • New Unit Tests for SRS: Dedicated unit tests (tests/test_srs.py) were added to cover the functionality of the new spaced repetition system, ensuring the correctness of the SM-2 algorithm and persistence helpers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a spaced-repetition system (SRS) for learning chess openings, complete with persistence helpers (save_items, load_items) and unit tests. The documentation in the README and a new project_directive.md file has been updated to reflect these changes. Additionally, the installation scripts have been significantly improved to support non-interactive mode and to dynamically fetch the latest Stockfish engine, which is a great enhancement. The code is well-formatted and the new feature is well-tested. I have one suggestion to improve the robustness of the item loading logic.

@cosmopax cosmopax requested a review from Copilot September 20, 2025 23:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds SRS (Spaced Repetition System) persistence helpers to support the Openings Mentor functionality. The implementation provides JSON-based storage and loading of training items using the SM-2 algorithm for spaced repetition scheduling.

Key changes:

  • Implements save_items and load_items functions in the new chess_app/srs.py module
  • Adds comprehensive documentation for the SRS system in README and project directive
  • Updates project configuration with auto-installer improvements and code style fixes

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
chess_app/srs.py Complete SRS module with SM-2 algorithm and persistence helpers
tests/test_srs.py Unit tests for SRS functionality including persistence testing
project_directive.md New project documentation outlining goals and architecture
README.md Updated with SRS documentation and installer instructions
install_chess_app.sh Enhanced installer with non-interactive mode and dynamic Stockfish downloads
Multiple test files Code style improvements (single to double quotes, formatting)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cosmopax and others added 2 commits September 27, 2025 15:17
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
@cosmopax cosmopax requested a review from Copilot September 27, 2025 13:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return [item for item in items if item.due <= today]


def save_items(items: Iterable[SRSItem], path: str | Path) -> None:
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function should validate that the path is writable before attempting to serialize and write data. Consider adding a check to ensure the parent directory exists and is writable.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +97
except (KeyError, ValueError):
# Optionally, you could log a warning here about the malformed entry.
continue
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silent failure when loading malformed entries could make debugging difficult. Consider logging the warning about malformed entries or returning information about skipped entries to the caller.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants