Files
news-benchmark/reports/qwen3.5-9b/m3-setup-frontend-score.md
T
Daniel SamsonandClaude Haiku 5.5 5168b13044 docs(reports): add qwen3.5-9b milestone scores M1-M6
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>
2026-10-30 11:49:52 +00:00

78 lines
6.4 KiB
Markdown

# M3: Setup Frontend - Score Report
**Repository scored:** `../newz` (`/home/daniel/Gitea/daniel/newz`), `frontend/` working tree
**Rubric:** `milestone/m3-setup-frontend-scoring.md`
**Model:** qwen3.5-9b
## Total Score: 24 / 49 (Overall level 1 - partial)
The level-2 requirement that the project "builds successfully" is not met. `npm run build` fails at the `tsc` step, so the build script does not pass.
## Verification Performed
Run in a temporary copy of `frontend/` (node 26.11.1, `node_modules` copied from the working tree):
| Check | Result |
|---|---|
| `npm run build` (`tsc && vite build`) | **Fails.** `tsc` reports 4 `TS6133` errors: unused `render`, `ArticleCard` and `Header` imports in `src/tests/*.test.tsx`. |
| `npx vite build` (alone) | Succeeds. Output in `dist/`. |
| `npx vitest run` | 2 of 2 test files pass, but each test is `expect(1).toBe(1)`. |
| `npm run lint` | **Fails.** ESLint cannot find `eslint-plugin-react`, which `.eslintrc.cjs` requires. Lint does not run. |
| `npx playwright test --list` | **0 tests found.** `playwright.config.ts` sets `testDir: './e2e'`, but the specs live in `playwright/e2e/`. |
| Playwright browsers | Not installed (`~/.cache/ms-playwright` missing). E2E tests were not run. |
| `docker build` | Not run. The Dockerfile has an invalid line, described below. |
## Scoring by Criterion
| Criterion | Score | Max | Notes |
|---|---|---|---|
| Project Setup | 2 | 2 | All required folders present: `public/`, `src/`, `assets/`, `components/`, `pages/`, `types/`, `api/`, `tests/`. |
| TypeScript & Dependencies | 3 | 5 | Interfaces for Article, Author, Category, and `ApiResponse<T>` exist. `react-router-dom ^6.20.0` and `lucide-react` are installed. The components do not use the shared types from `src/types/`; `ArticleCard` and `Home` define their own inline types. The build fails with TypeScript errors, so the level-4 requirement is not met. |
| UI Components | 4 | 5 | `Header`, `Layout`, `ArticleCard`, `AuthorAvatar`, `CategoryBadge` all exist and render. The `Search` icon from the acceptance criteria is missing. Header links are icon-only with no accessible name, so role-based queries like `getByRole('link', { name: /home/i })` cannot match. |
| React Router Configuration | 5 | 5 | `BrowserRouter` in `App.tsx`, routes for `/`, `/articles`, `/categories`, pages imported from `src/pages/`, and `<Link>` used for navigation. |
| Page Components | 3 | 3 | `Home`, `ArticlePage`, `CategoriesPage` exist under `pages/` and are mapped in `App.tsx`. |
| API Integration | 2 | 2 | `src/api/client.ts` has a base URL, a fetch wrapper with error handling, and typed endpoint functions. Nothing in the app calls it yet. |
| Unit Testing | 1 | 4 | Vitest is configured and both test files run. Neither test checks anything (`expect(1).toBe(1)`), and the comments say routing context is tested via E2E, which never runs. |
| E2E Testing | 1 | 6 | Playwright is installed and two spec files exist, but `testDir` is wrong, so zero tests are discovered. Browsers are not installed. |
| Docker Configuration | 1 | 3 | Multi-stage Dockerfile (Node build, Nginx serve) and a root `docker-compose.yml` with a frontend service on port `3000:80` and `depends_on: backend`. But the Dockerfile contains `COPY package-lock.json* . 2>/dev/null \|\| true`, which is not valid Dockerfile syntax, so the build should fail. The compose file also mounts `./data` onto `/usr/share/nginx/html`, which hides the built files. |
| Code Quality | 0 | 2 | ESLint does not run, so the "linting passes" requirement is not met. |
| Documentation | 2 | 3 | `frontend/README.md` (253 lines) covers setup, scripts, Lucide icons, routing, Docker, and known limitations. It has no per-component prop documentation, so it does not reach level 3. |
| **Total** | **24** | **49** | |
### Bonus
None awarded.
- **+1 ESLint:** not awarded, because the ESLint config is not runnable.
- **+2 TypeScript strict mode with react-router types:** not awarded. `strict: true` is set, but the build fails under `tsc`.
- **+3 Compose orchestrating both services, SPA fallback, and E2E routing tests:** partially met. The compose file orchestrates both services and `nginx.conf` has `try_files ... /index.html`. The E2E routing tests do not run.
### Critical Requirements Checklist (from rubric)
- [x] `lucide-react` installed
- [x] `react-router-dom` installed
- [x] `BrowserRouter` configured in `App.tsx`
- [x] `<Link>` used for navigation
## Other Issues Found
1. **`npm run build` fails** because unused imports in `src/tests/*.test.tsx` trip `noUnusedLocals`.
2. **ESLint cannot run.** `eslint-plugin-react` is required by `.eslintrc.cjs` but is not in `devDependencies`.
3. **Playwright discovers no tests.** `playwright.config.ts` says `testDir: './e2e'`; the specs are in `playwright/e2e/`.
4. **Invalid Dockerfile line.** `COPY package-lock.json* . 2>/dev/null || true` is not valid Docker syntax. Use `COPY package.json package-lock.json* ./`.
5. **Compose volume shadows the build output.** `./data:/usr/share/nginx/html` in the root `docker-compose.yml` replaces the built `dist` with the host `data/` folder. Remove that volume.
6. **Tailwind is not set up.** `globals.css` uses `@tailwind` directives, but `tailwindcss` is not installed, and there is no `tailwind.config` or PostCSS config. The directives pass through unprocessed.
7. **Favicon and logo references.** `public/index.html` links `/vite.svg`, which does not exist. `src/assets/logo.svg` is not used.
8. **Test placeholders.** The unit tests assert nothing and do not exercise the components.
9. **Git state.** `frontend/`, root `docker-compose.yml`, and `milestones/m3-setup-frontend-prompt.md` are untracked. `backend/` and the M1 files are also uncommitted.
## Path to a Higher Score
1. Remove the unused imports in the test files so `npm run build` passes.
2. Add `eslint-plugin-react` to `devDependencies`, and make the lint script pass.
3. Fix `playwright.config.ts` `testDir` to `./playwright/e2e`, install browsers with `npx playwright install`, and run the E2E suite.
4. Replace the placeholder unit tests with real tests for Header (icons and links) and ArticleCard, wrapped in `MemoryRouter`.
5. Fix the Dockerfile `COPY` line, remove the `./data` volume from the root compose file, and run `docker compose build frontend`.
6. Add the `Search` icon, use the shared types from `src/types/` in components, and give icon-only links an `aria-label`.
7. Add `tailwindcss`, `postcss` and `autoprefixer` with config files, or remove the `@tailwind` directives.