Skip to content

[GOOD FIRST ISSUE] Fix Black config inconsistency & stabilize threshold test #457

@hiroshitanaka-creator

Description

@hiroshitanaka-creator

Track

ai-easy (AI/Engineering - Easy)

Task Description

Background

  • Black formatting differs between Python 3.9 and 3.11
  • W_Ethics Gate shows flaky behavior at threshold boundary (0.50)

Tasks

  1. Align Python version requirements in pyproject.toml (e.g. python>=3.10)
  2. Configure Black and Ruff consistently (version pin recommended)
  3. Add or update pre-commit hooks
  4. Add minimal reproducible test for threshold boundary
  5. Ensure CI passes on Python 3.10 and 3.11

Acceptance Criteria

  • pre-commit run --all-files passes locally
  • CI is green (lint/type/security/unit)
  • Boundary test is stable across 50 repeated runs

How to Start

make setup
make test
If tests fail, capture logs and share them in the issue.

Skills Needed

  • Basic Python programming (>=3.10)
  • Understanding of code formatting tools (Black, Ruff)
  • Familiarity with pre-commit hooks
  • Basic knowledge of unit testing (pytest)
  • Ability to reproduce and debug flaky tests
  • (Optional) Familiarity with floating-point precision issues

Learning Outcome

By completing this task, contributors will learn:

  • How to stabilize CI pipelines across Python versions
  • How to configure and enforce code formatting with pre-commit
  • How to design minimal reproducible tests for flaky behavior
  • How to debug boundary conditions involving floating-point values
  • Best practices for contributing to a production-grade open source project

Resources & Guidance

Resources & Guidance

Relevant Files

  • pyproject.toml
  • .pre-commit-config.yaml
  • po_core/ethics/gate.py
  • tests/test_ethics_gate_min.py

Related Concepts

Tips

  • Run pre-commit run --all-files before pushing
  • If CI fails, compare Python versions locally

Suggested Implementation Steps

Suggested Implementation Steps

  1. Run tests and confirm failure
    make test
    

2.Run formatter
pre-commit run --all-files

Prerequisites

  • Read the README
  • Set up development environment
  • Review the contribution guidelines
  • Join our Discussions

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions