2026-07-26 22:52:10 +02:00
|
|
|
# retoor <retoor@molodetz.nl>
|
2026-07-25 16:58:41 +02:00
|
|
|
# typosaurus-sandbox
|
|
|
|
|
|
|
|
|
|
A minimal Python calculator used to verify the Typosaurus agent system.
|
|
|
|
|
|
|
|
|
|
## Conventions
|
|
|
|
|
- Every source file starts with the `# retoor <retoor@molodetz.nl>` header.
|
|
|
|
|
- Full type annotations on every function signature.
|
|
|
|
|
- No comments or docstrings in source files.
|
|
|
|
|
|
feat(nadia): Implement FastAPI application with calculator endpoints
```yaml
Outcome: done
Changed:
- pyproject.toml:1-18
- src/typosaurus_sandbox/__init__.py:1-4
- src/typosaurus_sandbox/__main__.py:1-8
- src/typosaurus_sandbox/app.py:1-18
- src/typosaurus_sandbox/domain/__init__.py:1-1
- src/typosaurus_sandbox/domain/calculator/__init__.py:1-6
- src/typosaurus_sandbox/domain/calculator/operations.py:1-23
- src/typosaurus_sandbox/presentation/__init__.py:1-1
- src/typosaurus_sandbox/presentation/api/__init__.py:1-1
- src/typosaurus_sandbox/presentation/api/v1/__init__.py:1-1
- src/typosaurus_sandbox/presentation/api/v1/calculator.py:1-63
- tests/__init__.py (unchanged)
- tests/test_calculator.py:1-95
- tests/test_api.py:1-120
- Makefile:2
- CLAUDE.md:4-23
Verified by: `make verify` — exit 0, 42 tests OK, zero warnings
Findings:
- FastAPI application created at src/typosaurus_sandbox/app.py with App importable as `from typosaurus_sandbox import App`.
- Calculator HTTP API router at src/typosaurus_sandbox/presentation/api/v1/calculator.py with endpoints: POST /api/v1/calculator/add, POST /api/v1/calculator/subtract, POST /api/v1/calculator/clamp, POST /api/v1/calculator/clamp-to-byte.
- Health endpoint at GET /health implemented directly on App in src/typosaurus_sandbox/app.py.
- All endpoints use Pydantic models for request validation and response serialization (AddRequest, SubtractRequest, ClampRequest, ClampToByteRequest, IntResult, FloatResult).
- 42 tests pass (16 unit tests for calculator function
Typosaurus-Run: d4f7c095ea9d49c69663ae6d01a21513
Typosaurus-Node: d0f507214bf6453cab8f8d19b8fd2040
Typosaurus-Agent: @nadia
Refs: #15
2026-07-26 18:38:43 +02:00
|
|
|
## Python backend
|
|
|
|
|
|
|
|
|
|
- Package manifest: `pyproject.toml`
|
|
|
|
|
- Entry module: `src/typosaurus_sandbox/__main__.py`
|
|
|
|
|
- Framework: FastAPI
|
|
|
|
|
- Serve frontend: no
|
|
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
|
|
- Backend serves frontend: no
|
|
|
|
|
- Module root: `src/typosaurus_sandbox/`
|
|
|
|
|
- Calculator business logic: `src/typosaurus_sandbox/domain/calculator/operations.py`
|
|
|
|
|
- HTTP API layer: `src/typosaurus_sandbox/presentation/api/v1/calculator.py`
|
|
|
|
|
|
2026-07-25 16:58:41 +02:00
|
|
|
## Verification
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
make verify
|
|
|
|
|
```
|
2026-07-26 22:52:10 +02:00
|
|
|
|
|
|
|
|
## CI
|
|
|
|
|
|
|
|
|
|
- Workflow file: `.gitea/workflows/ci.yml`
|
|
|
|
|
- Trigger: push to `main` or `master` branches
|
|
|
|
|
- Steps: checkout, Python 3.12 setup, dependency install, `make verify`
|
|
|
|
|
|
|
|
|
|
|