Outcome: done
Changed:
src/typosaurus_sandbox/presentation/api/v1/calculator.py — added imports (average, median, variance, percentage, logging), ValuesRequest model, PercentageRequest model, and four new endpoint handlers with logging and ValueError → 422 conversion
tests/test_api.py — added 26 test cases across four new test classes
Verified by: `make verify` — 93 tests, 0 failures, 0 new warnings
Findings:
- `ValuesRequest` model accepts `values: list[float]` and serves /average, /median, /variance
- `PercentageRequest` model accepts `value: float, total: float` for /percentage
- All four endpoints log at DEBUG level on invocation
- Empty list (average, median, variance) and zero total (percentage) produce HTTP 422 with descriptive detail
Open: none
Confidence: high — 26 new tests pass, zero regressions, pattern matches existing endpoint conventions
Typosaurus-Run: 34b5946ec981488091bee588eb919ff2
Typosaurus-Node: 644d226aefca431c81cf8be8a46d2070
Typosaurus-Agent: @nadia
Refs: #28
Outcome: done
Changed: app/__init__.py:11-14 | src/calculator.py deleted
Verified by: `make verify` — passed, 67 tests, no failures, zero warnings
Findings:
- src/calculator.py deleted — was a near-exact duplicate of src/typosaurus_sandbox/domain/calculator/operations.py
- app/__init__.py imports now use typosaurus_sandbox.domain.calculator (canonical module) instead of src.calculator
- All 67 existing tests pass with no regressions
- Flask app continues to serve its HTML frontend via the same routes
Open: none
Confidence: high — syntactic correctness verified by `py_compile`, functional correctness verified by `make verify` passing all 67 tests
Typosaurus-Run: 34b5946ec981488091bee588eb919ff2
Typosaurus-Node: 467304eb286a457189bfd6050e235fcf
Typosaurus-Agent: @nadia
Refs: #28
Outcome: done
Changed: tests/test_api.py:53-68,75-85,90-98 — added clamp low>high, missing-field, and subtract missing-field tests; src/typosaurus_sandbox/presentation/api/v1/calculator.py:2,51-55 — added HTTPException import and ValueError catch in calculate_clamp
Verified by: `make verify` — exit 0, 47 tests OK, zero warnings, zero compile errors
Findings:
- tests/test_api.py now contains 22 integration tests covering all five endpoints with success, validation errors (missing fields, wrong types), and the clamp low>high ValueError boundary.
- clamp low>high error is returned as 422 via HTTPException in the route handler, matching the acceptance criterion.
- All 47 tests (25 unit + 22 integration) pass with zero warnings.
Open: none
Confidence: high — all acceptance criteria addressed, all tests pass, verification gate passed
Typosaurus-Run: d4f7c095ea9d49c69663ae6d01a21513
Typosaurus-Node: 9fe1a5bb3c164f6eb359366ca55b1067
Typosaurus-Agent: @sveta
Refs: #15