Files
news-benchmark/milestone/m2-setup-backend-scoring.md
T
Daniel Samson 48fcbf16f6 feat: update M2 backend setup with correct structure
- Move backend to proper subfolder structure (newzy/backend/)
- Add .gitignore file for Python exclusions
- Add Dockerfile for containerization
- Update requirements.txt and docker-compose references
- Expand scoring rubric to 19 points for comprehensive evaluation
2026-10-29 15:46:22 +00:00

75 lines
5.4 KiB
Markdown

# M2: Setup Backend - Scoring Rubric
## Acceptance Criteria Scoring Table
| Score | Criteria |
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0 | Agent failed to implement acceptance criteria:<br>- No FastAPI application created<br>- Database session not configured<br>- Models missing or broken<br>- No endpoints implemented<br>- Missing required files (.gitignore, Dockerfile) |
| 1 | Agent partially implemented acceptance criteria that builds successfully:<br>- Basic FastAPI app runs but incomplete structure<br>- Backend folder missing key components<br>- Only one endpoint working<br>- Some models incomplete |
| 2 | Agent fully implemented acceptance criteria that builds successfully:<br>- FastAPI application in backend/main.py<br>- SQLAlchemy configured with SQLite in Docker volume<br>- All three models (Article, Author, Category) created<br>- Both /health and /api/v1/version endpoints working<br>- requirements.txt present with dependencies<br>- .gitignore file included |
| 3 | Agent fully implemented acceptance criteria that builds successfully, includes Pydantic schemas for all models with validation<br>- Schemas properly integrated in API responses<br>- Dockerfile creates runnable container image |
| 4 | Agent fully implemented acceptance criteria that builds successfully, includes passing unit tests for:<br>- Model CRUD operations<br>- Database session management<br>- Schema validation<br>- Endpoint response formats |
| 5 | Agent fully implemented acceptance criteria that builds successfully, includes all content from Score 4 AND:<br>- End-to-end integration test demonstrating full Docker workflow (build → run → query)<br>- Complete docker-compose.yml with backend service and persistent storage<br>- Performance benchmarks showing acceptable latency under load |
## Scoring Breakdown by Criterion
### Application Structure (Max 2 points)
- **0 pts**: No FastAPI application or main.py missing<br>- Backend folder not created properly
- **1 pt**: main.py exists but incomplete structure (missing core/, db/, etc.)<br>- Inconsistent folder organization
- **2 pts**: Complete directory structure with all expected folders and files (api/, core/, db/, models/, schemas/)<br>- Proper __init__.py files in each package
### Database Setup (Max 2 points)
- **0 pts**: No SQLAlchemy configuration or session setup<br>- Database connection fails
- **1 pt**: Session created but SQLite not configured properly<br>- Can connect to memory database only
- **2 pts**: Full SQLAlchemy setup with SQLite file storage, proper session management<br>- Volume persistence configured for Docker
### Models Implementation (Max 3 points)
- **0 pts**: No models defined<br>- All three required models missing
- **1 pt**: One model partially or incorrectly implemented<br>- Missing relationships or fields
- **2 pts**: All three models created with correct fields and relationships<br>- Can query without errors, proper foreign keys
- **3 pts**: Models fully functional with proper indexes, cascade deletes configured
### Endpoints (Max 2 points)
- **0 pts**: No endpoints implemented<br>- Health endpoint missing or returns error
- **1 pt**: Health endpoint works but version endpoint broken<br>- Only one path defined
- **2 pts**: Both /health and /api/v1/version working with correct JSON responses<br>- Proper status codes
### Documentation (Max 3 points)
- **0 pts**: No README.md or incomplete<br>- No API documentation
- **1 pt**: README exists with basic info only<br>- Missing endpoint examples
- **2 pts**: Comprehensive README with full API documentation, examples, and usage instructions
- **3 pts**: README includes setup guide, configuration notes, and troubleshooting tips
### Docker Support (Max 2 points)
- **0 pts**: No Dockerfile or .dockerignore<br>- Cannot containerize application
- **1 pt**: Basic Dockerfile present but not working<br>- Fails to build or run
- **2 pts**: Dockerfile works correctly with all dependencies installed<br>- Application runs successfully in container
### Code Quality (Max 3 points)
- **0 pts**: No error handling<br>- Poor code organization
- **1 pt**: Basic error handling present<br>- Some best practices followed
- **2 pts**: Proper exception handling, standardized responses, follows FastAPI/SQLAlchemy conventions
- **3 pts**: Clean separation of concerns, type hints, docstrings for all functions
## Total Possible Score: 19 points
## Evaluation Notes
- Partial credit given for incomplete but working implementations (Score 1)
- Full credit requires all acceptance criteria met with passing verification (Score 2 minimum)
- Higher scores require additional value-add content beyond baseline requirements
- Score 0 indicates agent did not attempt the task or application won't run
## Bonus Points Consideration
**+1 point** for:
- Proper exception handling with appropriate HTTP status codes
- Input validation at schema level
**+2 points** for:
- Unit tests covering core functionality (models, endpoints)
- README includes startup instructions and configuration examples
**+3 points** for:
- Docker Compose setup enabling easy local development
- Performance optimizations (connection pooling, async queries)