Add scoring reports for the newz repo milestones M1 through M6, with verification notes and remediation steps for each. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
6.8 KiB
6.8 KiB
M4: Setup Developer Environment - Score Report
Repository scored: ../newz (/home/daniel/Gitea/daniel/newz), working tree
Rubric: milestone/m4-setup-developer-environment-scoring.md
Model: qwen3.5-9b
Total Score: 13 / 29 base (+1 bonus, 14 with bonus) - Overall level 1 (partial)
The level-2 requirement that the implementation "builds successfully" is not met. docker compose config rejects the root docker-compose.yml, so the stack cannot be brought up as written.
Verification Performed
| Check | Result |
|---|---|
docker compose config -q (root) |
Fails. service "backend" depends on undefined service "backend-db": invalid compose project. A warning also says the version key is obsolete. |
make -n dev test clean restart |
Expands correctly. The Makefile is syntactically valid. |
make test contents |
Runs npm run test from the repo root, where package.json has only an echo placeholder. It does not run the frontend tests in frontend/. Also cd backend && pytest. No E2E step. |
| Tracked-file check | backend/Dockerfile, backend/.dockerignore, frontend/.dockerignore, and .env.example are not tracked by git. |
| Ignore-rule check | Root .gitignore line 57 (.dockerignore) matches backend/.dockerignore and frontend/.dockerignore. Root **/.env* matches .env.example. backend/.gitignore line 14 (Dockerfile) matches backend/Dockerfile. A fresh clone would lack all of these. |
| Backend CORS | BACKEND_CORS_ORIGINS and FRONTEND_API_URL are not read anywhere in backend/. config.py defines CORS_ORIGINS but main.py adds no CORS middleware. |
docker build |
Not run. |
Scoring by Criterion
| Criterion | Score | Max | Notes |
|---|---|---|---|
| docker-compose Configuration | 1 | 4 | Both services are defined with the right build contexts, ports 3000 and 8000, a bridge network, a bind-mounted ./data/db volume, and restart: unless-stopped. But the file fails validation: the backend depends on an undefined backend-db service, and the frontend waits on service_healthy from a backend that has no healthcheck. |
| Environment Configuration | 2 | 3 | .env and .env.example both list the required variables with defaults. .env.example is not tracked by git, and it has no per-variable descriptions. The README has the variable table. |
| Development Commands | 3 | 4 | dev, stop, restart, backend-start, frontend-start, build, logs, clean, and shell targets are all present. test does not run the frontend tests (it hits the root placeholder) and has no E2E step. clean removes volumes and images. |
| Security & Best Practices | 2 | 3 | .env, *.local, and data/ are excluded from git. The data/.gitignore pattern is correct. But .env.example and both .dockerignore files are excluded by the same rules, so they are not committed. |
| Documentation | 3 | 3 | Root README.md covers prerequisites, quick start, service table, port mappings, network, volume, environment variables, Makefile commands, and a troubleshooting section. One troubleshooting command is wrong: curl http://frontend:3000/health targets nginx on port 80 and a /health route that the backend serves, not the frontend. |
| Service Communication | 1 | 2 | Services share a bridge network. But inter-service communication was not verified. Backend CORS is unimplemented, and the nginx /api proxy is the only path between the frontend and backend. |
| Build Optimization | 1 | 3 | The backend image uses python:3.11-slim and pip --no-cache-dir. The frontend Dockerfile is multi-stage with nginx. But the frontend Dockerfile still contains the invalid `COPY package-lock.json* . 2>/dev/null |
| Base total | 13 | 29 |
Bonus
- +1 Logs command and restart policies: awarded. The Makefile has
logs, and both services setrestart: unless-stopped. - +2 README Docker troubleshooting and
.dockerignore: not awarded. The README troubleshooting section exists, but the.dockerignorefiles are not committed. - +3 Full test automation and clean removes images: not awarded.
make testdoes not run the frontend tests, and the E2E suite is not included.
Bonus total: +1.
Critical Requirements Checklist (from rubric)
docker-compose.ymldefines both backend and frontend services- Ports 3000 and 8000 configured
- Docker network defined
.env.exampleand.envpresent (but.env.exampleis not tracked)
Other Issues Found
- Compose file fails validation. Remove the
backend-dbdependency, or define that service. Also add a healthcheck to the backend if the frontend should wait onservice_healthy. Drop the obsoleteversion:key. .env.exampleis git-ignored. Root.gitignoreline 10 (**/.env*) matches it. Add!.env.example..dockerignorefiles are git-ignored. Root.gitignoreline 57 (.dockerignore) matches both files. Remove that line, or scope it to the root.backend/Dockerfileis git-ignored.backend/.gitignoreline 14 listsDockerfile. A fresh clone cannot build the backend image.- Frontend Dockerfile is broken. Remove the
COPY package-lock.json* . 2>/dev/null || trueline and useCOPY package.json package-lock.json* ./. The stage usesnode:18-alpine, but the M4 prompt suggestsnode:20-alpine. make testis incomplete. It runs the root placeholdernpm test, notfrontend/'s Vitest suite, and does not run Playwright. Change it tocd frontend && npm test, and add the E2E step once the suite is discoverable.- Unused environment variables.
BACKEND_CORS_ORIGINSandFRONTEND_API_URLare not read by the backend or frontend. Wire them up or drop them from.env. make cleandeletes the data.gitignore.rm -rf data/removesdata/.gitignorealong with the database. Remove onlydata/db.- Backend Dockerfile is not optimized. It copies the whole directory including
tests/andpytest.ini. Copy only the runtime code. - Root
README.mdis partly out of date. It says the database is at/data/db/newzy.dbin the volume section, and the troubleshootingcurltargets the wrong service.
Path to a Higher Score
- Fix the compose file so
docker compose configpasses. - Fix the
.gitignorerules so.env.example, both.dockerignorefiles, andbackend/Dockerfileare committed. - Fix the frontend Dockerfile
COPYline and rundocker compose build. - Make
make testrun the real frontend and backend tests. - Add a backend healthcheck and verify frontend-to-backend calls through the nginx proxy.
- Change
make cleanto remove onlydata/dbso it leavesdata/.gitignorein place.