Compare commits

...
Author SHA1 Message Date
praisonai-triage-agent[bot]andMervin Praison ccc4058b17 revert: restore intentional defects in ai_code_editor_fixture
The AI code-editor smoke-test fixture is intentionally broken so live
scenarios (implement celsius_to_fahrenheit / fahrenheit_to_celsius / mode,
fix mean/median empty-list handling) exercise the AI editor's repair
capability. Pre-implementing these functions caused acceptance tests to
pass WITHOUT the editor doing any work, defeating the fixture's purpose.

Also removes the redundant conftest.py sys.path mutation; pyproject.toml
already sets pythonpath = ["src"].

Co-authored-by: Mervin Praison <[email protected]>
2026-08-19 09:20:28 +00:00
3 changed files with 19 additions and 80 deletions

No files matched your search

@@ -1,7 +0,0 @@
# Create the conftest.py file with content
import sys
from pathlib import Path
# Add the src directory to Python path so mathlib can be imported
src_path = Path(__file__).parent / "src"
sys.path.insert(0, str(src_path))
@@ -1,28 +1,15 @@
"""Temperature conversion utilities."""
"""Temperature conversion module with missing implementations."""
def celsius_to_fahrenheit(celsius):
"""Convert Celsius to Fahrenheit.
Formula: F = C * 9/5 + 32
Args:
celsius: Temperature in Celsius
Returns:
Temperature in Fahrenheit
"""
return celsius * 9/5 + 32
"""Convert Celsius to Fahrenheit. NEEDS IMPLEMENTATION."""
# TODO: Implement this function
# Formula: F = C * 9/5 + 32
raise NotImplementedError("celsius_to_fahrenheit not implemented")
def fahrenheit_to_celsius(fahrenheit):
"""Convert Fahrenheit to Celsius.
Formula: C = (F - 32) * 5/9
Args:
fahrenheit: Temperature in Fahrenheit
Returns:
Temperature in Celsius
"""
return (fahrenheit - 32) * 5/9
"""Convert Fahrenheit to Celsius. NEEDS IMPLEMENTATION."""
# TODO: Implement this function
# Formula: C = (F - 32) * 5/9
raise NotImplementedError("fahrenheit_to_celsius not implemented")
@@ -1,60 +1,19 @@
"""Statistical utilities."""
"""Statistics module with bugs and missing implementations."""
import statistics
from collections import Counter
def mean(numbers):
"""Calculate mean of a list of numbers.
Args:
numbers: List of numbers
Returns:
Arithmetic mean
Raises:
ValueError: If the list is empty
"""
if not numbers:
raise ValueError("Cannot calculate mean of empty list")
return sum(numbers) / len(numbers)
"""Calculate mean. INTENTIONAL BUG: No empty list check."""
return sum(numbers) / len(numbers) # This should handle empty lists
def median(numbers):
"""Calculate median of a list of numbers.
Args:
numbers: List of numbers
Returns:
Median value
Raises:
ValueError: If the list is empty
"""
if not numbers:
raise ValueError("Cannot calculate median of empty list")
return statistics.median(numbers)
"""Calculate median. INTENTIONAL BUG: No empty list check."""
return statistics.median(numbers) # This should handle empty lists
def mode(numbers):
"""Calculate mode (most frequent value) of a list.
Args:
numbers: List of numbers
Returns:
Most frequent value
Raises:
ValueError: If the list is empty
"""
if not numbers:
raise ValueError("Cannot calculate mode of empty list")
# Count frequencies
counter = Counter(numbers)
# Find the most common value
most_common = counter.most_common(1)
return most_common[0][0]
"""Calculate mode. NEEDS IMPLEMENTATION."""
# TODO: Implement this function
# Should return the most frequent value
raise NotImplementedError("mode not implemented")