Structure webber into three independent subprojects: - webber-api/: FastAPI backend server with all agent code - webber-cli/: Standalone CLI client (renamed from cli/ to webber_cli/) - webber-sandbox/: Test project for functional testing Key changes: - Each subproject has its own .venv (Python 3.12+) - Added sandbox.sh for managing test project templates - Created sandbox-templates/ with calculator-cli and empty starter - Updated CI/CD for prefixed tags (api/v*, cli/v*) - Added comprehensive AGENTS.md with operational instructions - Added gitignore filtering to glob and grep tools - Created pyproject.toml for each subproject Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Calculator CLI - Tasks for Webber
A simple calculator with intentional bugs and missing features for testing Webber's capabilities.
Bugs to Fix
High Priority
- Division by zero -
operations.py:divide()crashes when dividing by zero instead of returning an error - Invalid operation name -
main.py:get_operation()raises KeyError for unknown operations instead of helpful error message
Medium Priority
- Power function broken -
operations.py:power()doesn't handle negative exponents or fractional exponents correctly - No input validation -
main.pydoesn't validate that command-line arguments are valid numbers
Missing Tests
-
Add
TestDivideclass with tests for:- Normal division
- Division by zero (should test error handling once bug is fixed)
- Division with negative numbers
-
Add
TestPowerclass with tests for:- Positive integer exponents
- Zero exponent (should return 1)
- Negative exponents
-
Complete existing test classes:
test_add_zerotest_add_floatstest_subtract_negativetest_multiply_by_zero
Features to Add
- Expose power operation - Add 'pow' to the operations dictionary in
main.py - Add modulo operation - Implement
modulo(a, b)in operations.py - Add --verbose flag - Show step-by-step calculation
- Add history command - Track and display recent calculations
- Add REPL mode - Interactive calculator loop
Code Quality
- Add type hints to all functions
- Add docstrings following Google style
- Fix any linting errors (run
ruff check src/)
How to Run
# Setup
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Run calculator
python -m calculator.main 10 5 add
python -m calculator.main 10 5 div
# Run tests
pytest tests/ -v
# See failing tests (division by zero)
python -m calculator.main 10 0 div