Skip to content
1 change: 1 addition & 0 deletions manager_database.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ manager_database.egg-info/requires.txt
manager_database.egg-info/top_level.txt
tests/test_adapter_base.py
tests/test_adapter_registry.py
tests/test_autofix_validation.py
tests/test_board_sync.py
tests/test_chat_api.py
tests/test_daily_diff.py
Expand Down
67 changes: 67 additions & 0 deletions tests/test_autofix_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""Test file with intentional errors to validate the full autofix pipeline.

This file contains:
1. Formatting issues (ruff/black can fix) - cosmetic
2. Type errors (mypy will catch) - non-cosmetic, needs Codex
3. Test failures (pytest will catch) - non-cosmetic, needs Codex

The autofix system should:
1. First run basic autofix (ruff/black) to fix formatting
2. Gate should still fail due to mypy/pytest errors
3. Auto-escalate to Codex to fix the remaining issues
"""
import os
from typing import Dict,List,Optional
import sys

# Formatting issue 1: missing spaces around operators

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

The Optional type is imported but never used in the file. This appears to be an unintentional unused import that was not mentioned in the PR description's list of intentional errors.

Copilot uses AI. Check for mistakes.
x=1+2+3

# Formatting issue 2: multiple imports on one line (already above)

# Formatting issue 3: trailing whitespace (invisible but present)
y = 42

# Formatting issue 4: inconsistent quotes
message = "hello"
other_message = 'world'

# Type error 1: wrong type assignment
def get_count() -> int:
return "not an int" # mypy error: returning str instead of int

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Return int from get_count

get_count is annotated to return int but returns the literal string "not an int", so mypy will flag the function and test_type_mismatch always fails when the tests run because the returned value is a str rather than an int; it needs to return an integer to keep typing and the test suite green.

Useful? React with 👍 / 👎.

# Type error 2: incompatible types
def process_items(items: List[str]) -> Dict[str, int]:
result: Dict[str, int] = {}
for item in items:
result[item] = "count" # mypy error: assigning str to int
return result

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ensure process_items outputs int values

process_items declares it returns Dict[str, int] but assigns the string "count" to each entry, which triggers mypy’s incompatible types error and causes test_list_processing to fail because the returned values are str instead of int; the function should compute and return numeric counts.

Useful? React with 👍 / 👎.


# Type error 3: missing return
def calculate_total(values: List[int]) -> int:
total = sum(values)
# Missing return statement - mypy should catch this

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add return in calculate_total

calculate_total is annotated to return an int but falls off the end without returning, so mypy reports a missing return and any caller would receive None instead of the summed total when this code path is executed; return total to satisfy the contract.

Useful? React with 👍 / 👎.

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

Variable total is not used.

Suggested change
# Missing return statement - mypy should catch this
return total

Copilot uses AI. Check for mistakes.

# Unused import (ruff will catch this)

Copilot AI Dec 29, 2025

Copy link

Choose a reason for hiding this comment

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

Import of 'json' is not used.

Copilot uses AI. Check for mistakes.
import json

# Test that will fail
def test_intentional_failure():
"""This test intentionally fails to trigger Codex escalation."""
expected = 42
actual = 41 # Wrong value
assert actual == expected, f"Expected {expected}, got {actual}"
Comment on lines +36 to +39

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fix hardcoded failing assertion in test_intentional_failure

test_intentional_failure sets expected = 42 but actual = 41, making the assertion fail unconditionally whenever the test suite runs, independent of any underlying functionality; align the expected and actual values so the test can pass when behavior is correct.

Useful? React with 👍 / 👎.


# Another failing test
def test_type_mismatch():
"""Test type handling with intentional failure."""
result = get_count()
assert isinstance(result, int), f"Expected int, got {type(result)}"

# Test with assertion error
def test_list_processing():
"""Test list processing with intentional failure."""
items = ["a", "b", "c"]
result = process_items(items)
# This will fail because process_items has a bug
assert all(isinstance(v, int) for v in result.values())
Loading