Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a43a9f1cd | ||
|
|
0a51f7d60f | ||
|
|
e64b72454f | ||
|
|
7f0c49ff6c | ||
|
|
f371d15c18 | ||
|
|
10da55b377 | ||
|
|
b27ef3ae19 | ||
|
|
b49cdc7f01 | ||
|
|
0824474e70 |
No files matched your search
+104
@@ -0,0 +1,104 @@
|
||||
# OS Files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Dependencies
|
||||
node_modules/
|
||||
.pnp.*
|
||||
yarn-error.log
|
||||
|
||||
# Build outputs
|
||||
dist/
|
||||
build/
|
||||
*.js
|
||||
*.ts.map
|
||||
*.bundle.js
|
||||
.next/
|
||||
out/
|
||||
coverage/
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.example # Only if you want to commit it (usually shouldn't)
|
||||
|
||||
# Logs
|
||||
logs/
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor and IDE files
|
||||
.idea/
|
||||
.vscode/
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.project
|
||||
.classpath
|
||||
.settings/
|
||||
.svn/
|
||||
|
||||
# Testing
|
||||
.nyc_output/
|
||||
.jest.cache/
|
||||
.pnp.loader.mjs
|
||||
|
||||
# Debugging
|
||||
.debugger
|
||||
.debug.*
|
||||
.history/
|
||||
|
||||
# Misc
|
||||
.cache/
|
||||
.temp/
|
||||
.tmp/
|
||||
.pid
|
||||
*.pid.lock
|
||||
*.seed
|
||||
session_data/
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.cache
|
||||
*~
|
||||
|
||||
# Database files (if applicable)
|
||||
*.sqlite
|
||||
*.db
|
||||
*.sql.backup
|
||||
|
||||
# Local configuration
|
||||
config.local.json
|
||||
local.conf
|
||||
settings.local.*
|
||||
|
||||
# Package lock files (choose one - don't commit multiple)
|
||||
yarn.lock # if using yarn instead of npm
|
||||
package-lock.json # if not using yarn
|
||||
|
||||
# Documentation generation (if used)
|
||||
docs/_build/
|
||||
*.html.unchecked
|
||||
|
||||
# Linting (if using tools that generate config)
|
||||
.eslintcache
|
||||
|
||||
# Secrets and tokens
|
||||
.gitcredentials
|
||||
.azure-devops.yml
|
||||
.vscode/settings.json
|
||||
@@ -1,73 +1,21 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
MIT License
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
Copyright (c) 2024 newzy contributors
|
||||
|
||||
1. Definitions.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright 2026 daniel
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,55 +0,0 @@
|
||||
# News Benchmark
|
||||
|
||||
A benchmark that tests how local language models perform on real world software engineering tasks.
|
||||
|
||||
## The challenge:
|
||||
|
||||
Make and maintain a news web application.
|
||||
|
||||
## Structure
|
||||
|
||||
Most real applications, are not made in a single shot. This benchmark reflects this by simulating tickets as milestones. Each milestone is a separate markdown file, containing prompt, description, acceptance criteria, technical details, and QA notes.
|
||||
|
||||
## Scoring
|
||||
|
||||
The model performing the benchmark will be scored against the acceptance criteria and the tests written as proof of work:
|
||||
|
||||
| Score | Criteria |
|
||||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 0 | Agent failed to implement acceptance criteria |
|
||||
| 1 | Agent partially implemented acceptance criteria that builds successfully |
|
||||
| 2 | Agent fully implemented acceptance criteria that builds successfully |
|
||||
| 3 | Agent fully implemented acceptance criteria that builds successfully, includes passing unit/integration tests with 50% code coverage |
|
||||
| 4 | Agent fully implemented acceptance criteria that builds successfully, includes passing unit/integration tests, passing end-to-end tests, with 80% code coverage |
|
||||
| 5 | Agent fully implemented acceptance criteria that builds successfully, includes passing unit/integration tests, and passing end-to-end tests with 100% code coverage |
|
||||
|
||||
## Milestones
|
||||
|
||||
This benchmark consists of multiple milestones, each representing a separate task:
|
||||
|
||||
### M1: Git Repository Setup
|
||||
- [M1 - Setup Git Project](milestone/m1-setup-git-project-prompt.md)
|
||||
- [M1 - Setup Git Project Scoring](milestone/m1-setup-git-project-scoring.md)
|
||||
|
||||
### M2: Backend Infrastructure
|
||||
- [M2 - Setup Backend](milestone/m2-setup-backend-prompt.md)
|
||||
- [M2 - Setup Backend Scoring](milestone/m2-setup-backend-scoring.md)
|
||||
|
||||
### M3: Frontend Application
|
||||
This benchmark consists of multiple milestones, each representing a separate task:
|
||||
|
||||
### M5: Authentication System
|
||||
- [M5 - Setup Authentication](milestone/m5-setup-authentication-prompt.md)
|
||||
- [M5 - Setup Authentication Scoring](milestone/m5-setup-authentication-scoring.md)
|
||||
|
||||
### M6: Admin Area
|
||||
- [M6 - Setup Admin Area](milestone/m6-setup-admin-area-prompt.md)
|
||||
- [M6 - Setup Admin Area Scoring](milestone/m6-setup-admin-area-scoring.md)
|
||||
|
||||
|
||||
## Tech Stack Variations
|
||||
|
||||
### Python
|
||||
- **Backend:** Python, FastAPI, SQLAlchemy, SQLite (data persisted in a Docker volume)
|
||||
- **Frontend:** React + TypeScript (Vite), lucide-react icons, served by nginx
|
||||
- **Compose:** two services, frontend proxies /api to the backend
|
||||
@@ -0,0 +1,44 @@
|
||||
# M1: Setup Git Project - Score Report
|
||||
|
||||
**Model:** qwen3.8-27b
|
||||
**Repository scored:** `../newz` (`/home/daniel/Gitea/daniel/newz`), recreated repo
|
||||
**Origin:** `https://gitea.samson.media/daniel/newz-qwen-27b.git`
|
||||
**Rubric:** `milestone/m1-setup-git-project-scoring.md`
|
||||
|
||||
## Total Score: 7 / 9 (Overall level 1 - partial)
|
||||
|
||||
The only deduction is the repository name. The project is "newzy" and the README title says so, but the repo is `newz` locally and `newz-qwen-27b` on origin. This is the same judgment used for the qwen3.5-9b run, so the two scores are comparable. If the name is accepted as-is, the score is 9 / 9.
|
||||
|
||||
## Verification Performed
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `git ls-remote origin` | `main` and `develop` both point to `357a721`, matching local. |
|
||||
| `main` vs `develop` | Identical (single commit `357a721 chore: initial project setup for newzy`). |
|
||||
| Tracked files | 9 files, all committed in the initial commit. |
|
||||
| `.gitignore` | Present. Excludes `node_modules`, `.env*` (with `!.env.example` exception), logs, build output, IDE files, OS files, `data/`, and DB files. |
|
||||
| `.env.example` | Not ignored (the `!.env.example` rule takes effect). |
|
||||
| `hooks/pre-push` | Present and executable in the repo, but **inactive**: `core.hooksPath` is not set. CONTRIBUTING says to run `git config core.hooksPath hooks` per clone. |
|
||||
| Prompt parity | `milestones/m1-setup-git-project-prompt.md` is byte-identical to the copy in the benchmark repo. |
|
||||
|
||||
## Scoring by Criterion
|
||||
|
||||
| Criterion | Score | Max | Notes |
|
||||
|---|---|---|---|
|
||||
| Repository Setup | 0 | 2 | Repo is named `newz` / `newz-qwen-27b`, not `newzy`. `.gitignore` and an initial commit are present, so the only failing check is the name. |
|
||||
| Branch Strategy | 2 | 2 | `main` and `develop` both exist on local and origin, at the same commit. `docs/branching.md` documents the model, feature/bugfix/hotfix flows, and merge and rebase procedures. |
|
||||
| Documentation Files | 3 | 3 | `.gitignore`, `README.md` (52 lines, quick start and status table), `CONTRIBUTING.md` (104 lines, workflow, review, releasing), and `LICENSE` (MIT, 2026). Plus `docs/` with `branching.md` (89 lines), `commits.md` (81 lines), and `conventions.md` (57 lines). |
|
||||
| Git Best Practices | 2 | 2 | `docs/commits.md` explains Conventional Commits with an allowed-types table, six sample messages (including a breaking change), and rules of thumb. Merge and rebase workflows are in `docs/branching.md`. |
|
||||
| **Total** | **7** | **9** | |
|
||||
|
||||
## Other Observations
|
||||
|
||||
- The README quick start clones `newz-qwen-27b.git` into a directory named `newzy`. That is internally consistent, but it does not match the repo name, so new contributors will see two names.
|
||||
- The pre-push hook is versioned but does nothing until each clone runs `git config core.hooksPath hooks`. The rubric lists "pre-push hooks for code quality checks" as a git configuration requirement, so enabling it by default (for example, a setup script or `make` target) would close that gap.
|
||||
- The `hooks/pre-push` script is a no-op because there is no `package.json` yet, which matches the documented behaviour.
|
||||
- Commit identity is `Daniel Samson <daniel@samson.media>`, correctly configured.
|
||||
|
||||
## Path to a Higher Score
|
||||
|
||||
1. Rename the repository and the origin remote to `newzy`, so the directory, remote, and README agree.
|
||||
2. Document how to activate the hooks in one step, or add a setup target that runs `git config core.hooksPath hooks`.
|
||||
@@ -0,0 +1,56 @@
|
||||
# M2: Setup Backend - Score Report
|
||||
|
||||
**Model:** qwen3.8-27b
|
||||
**Repository scored:** `../newz` (`/home/daniel/Gitea/daniel/newz`), committed HEAD `9a6f75e` on `feature/setup-backend`
|
||||
**Rubric:** `milestone/m2-setup-backend-scoring.md`
|
||||
|
||||
## Total Score: 24 (21 / 25 base + 3 bonus) - Overall level 2
|
||||
|
||||
The committed backend is complete and runs. The points lost are a missing cascade configuration on the relationships and a few endpoints the M2 prompt does not require.
|
||||
|
||||
## Verification Performed
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `git archive HEAD backend` → clean venv from `requirements.txt` → `pytest` | **19 passed**, 1 warning, **95% coverage** (400 statements, 21 missed). |
|
||||
| `uvicorn main:app` on the committed tree | `GET /health` 200 `{"status":"ok","version":"0.1.0"}`; `GET /api/v1/health` 200; `GET /api/v1/version` 200 `{"app":"newzy","version":"0.1.0"}`; unknown route 404 with `{"detail":"Not Found","code":"not_found"}`. |
|
||||
| `docker build` of `backend/Dockerfile` | **Succeeds.** |
|
||||
| `docker run` of the built image | `/health` and `/api/v1/version` both return 200. |
|
||||
| Prompt parity | `milestones/m2-setup-backend-prompt.md` is byte-identical to the benchmark copy. |
|
||||
| Remote | `origin/main` and `origin/develop` are still at the M1 commit. **The M2 commit exists only on the local `feature/setup-backend` branch and is not pushed.** |
|
||||
|
||||
## Scoring by Criterion
|
||||
|
||||
| Criterion | Score | Max | Notes |
|
||||
|---|---|---|---|
|
||||
| Application Structure | 2 | 2 | `core/`, `api/v1/`, `db/`, `models/`, `schemas/`, `tests/` (conftest, test_health, test_version, test_models), `main.py`, `config.py`, `requirements.txt`, `Dockerfile`, `.gitignore`, `pytest.ini`, `README.md`. |
|
||||
| Database Setup | 2 | 2 | SQLAlchemy 2.0 engine from `DATABASE_URL`, parent directory auto-created, `PRAGMA foreign_keys=ON` on every SQLite connection, `./data/db` bind-mounted in compose, and `VOLUME /app/data/db` in the Dockerfile. |
|
||||
| Models Implementation | 2 | 3 | Article, Author, and Category have the specified fields, unique constraints (title, name, email, slug), foreign keys with indexes, and relationships. **No cascade delete is configured** on the relationships, so this is not level 3. |
|
||||
| Endpoints | 2 | 2 | `GET /health`, `GET /api/v1/health`, and `GET /api/v1/version` return correct JSON with 200. |
|
||||
| Documentation | 2 | 2 | `backend/README.md` (199 lines): project structure, local and Docker startup, test commands, configuration table, endpoint examples, error format, data model, Docker notes, and limitations. |
|
||||
| Test Infrastructure | 3 | 3 | `pytest.ini` (discovery, coverage, `pythonpath`), `conftest.py` with per-test temporary SQLite databases, and all three test files present. |
|
||||
| Test Coverage | 3 | 3 | All 19 tests pass. Coverage is 95%, above the 70% target. |
|
||||
| Docker Support | 2 | 2 | The image builds, starts under uvicorn on port 8000, and serves the endpoints. |
|
||||
| Code Quality | 3 | 3 | Standardized `{detail, code, errors?}` envelope for HTTP, validation (422), and unhandled (500) errors. Type hints and docstrings throughout. Clear separation of config, session, models, schemas, and routes. |
|
||||
| **Base total** | **21** | **25** | |
|
||||
|
||||
### Bonus
|
||||
|
||||
- **+1 Exception handling with status codes and schema-level validation:** awarded. Errors map to codes such as `not_found` and `validation_error`, and the schemas use `Field` constraints.
|
||||
- **+2 Unit tests for core functionality and README with startup and configuration examples:** awarded. Models and endpoints are tested, and the README has startup steps and a configuration table.
|
||||
- **+3 Docker Compose plus performance optimizations:** Compose is present, but there are no connection pooling or async query optimizations, so this is **not awarded**.
|
||||
|
||||
Bonus total: +3.
|
||||
|
||||
## Other Observations
|
||||
|
||||
- The M2 commit is on `feature/setup-backend`, which is checked out locally and has not been pushed. It is based on the M1 commit, so `develop` does not yet contain the backend.
|
||||
- The commit message says "19 tests, ~95% coverage", which matches the verified result.
|
||||
- The Article, Author and Category models have no cascade rules. Deleting an author who has articles will fail when foreign keys are enforced (the FK pragma is on), which is safe, but the behaviour is not documented.
|
||||
- The Docker healthcheck in `docker-compose.yml` uses `python -c urllib...` against `localhost:8000`. This works inside the container, which is the correct place for it.
|
||||
|
||||
## Path to a Higher Score
|
||||
|
||||
1. Add `cascade="all, delete-orphan"` (or an explicit `ondelete` policy) to the Author and Category relationships, and document the chosen behaviour in the README.
|
||||
2. Push `feature/setup-backend` and merge it into `develop` through a pull request, so the backend is on the integration branch.
|
||||
3. For the +3 bonus, add a connection-pool setting for the non-SQLite case or an async session option, if the project will need them.
|
||||
@@ -0,0 +1,73 @@
|
||||
# M3: Setup Frontend - Score Report
|
||||
|
||||
**Model:** qwen3.8-27b
|
||||
**Repository scored:** `../newz` (`/home/daniel/Gitea/daniel/newz`), committed `frontend/` on `develop` (merge `253052c`, PR #3)
|
||||
**Rubric:** `milestone/m3-setup-frontend-scoring.md`
|
||||
|
||||
## Total Score: 41 (35 base + 6 bonus) - Overall level 1 as delivered
|
||||
|
||||
**Overall level 1 as delivered.** A clean checkout of `develop` does not build: `src/pages/Home.tsx` and `src/pages/CategoriesPage.tsx` import `../data/sample`, which is not committed. The root `.gitignore` excludes `data/`, which also matches `frontend/src/data/`. The file exists in the working tree only. With that file restored, the build, lint, unit tests, E2E tests and Docker image all pass, and the overall level would be 3.
|
||||
|
||||
## Verification Performed
|
||||
|
||||
All checks ran on a clean `git archive` export of `develop`, except where noted.
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `npm ci` | Installs. Warnings about esbuild install scripts only. |
|
||||
| `npm run build` (clean export) | **Fails.** `TS2307: Cannot find module '../data/sample'` in `Home.tsx` and `CategoriesPage.tsx`, followed by implicit-any errors. |
|
||||
| `npm run build` (with `src/data/sample.ts` copied in) | **Passes.** `tsc` reports 0 errors; `vite build` produces `dist/`. |
|
||||
| `npm run lint` | Exit 0. |
|
||||
| `npx vitest run` | **5 files, 23 tests, all pass.** |
|
||||
| Unit coverage (`src/components`, `src/pages`, `src/api`) | Components: 100% statements, 93.9% branches, 100% lines. Pages and API client are not exercised by unit tests. |
|
||||
| `npx playwright test --project=chromium` (with sample file) | **9 passed.** Covers the shell and branding, featured article and grid, router-link navigation without a full reload, article card to placeholder, console errors, and four API-client tests. |
|
||||
| `docker build` (clean export) | **Fails** with the same missing-module error (`npm run build` exit 2). |
|
||||
| `docker build` (with sample file) and `docker run` | Builds. SPA routes `/`, `/articles`, `/categories`, `/articles/1` and unknown paths return 200 (the unknown path renders the 404 component). `/api/v1/version` returns 502 because the backend is not running in this test. |
|
||||
|
||||
## Scoring by Criterion
|
||||
|
||||
| Criterion | Score | Max | Notes |
|
||||
|---|---|---|---|
|
||||
| Project Setup | 2 | 2 | `frontend/` contains `public/`, `src/` (`assets/`, `components/`, `pages/`, `types/`, `api/`, `tests/`, `lib/`), and `playwright/`. |
|
||||
| TypeScript & Dependencies | 4 | 5 | `strict: true`. `react-router-dom ^6.20.0`, `lucide-react` and typed API client are used by components. `tsc` passes with the sample file present. Not level 5 because the build fails from a clean checkout. |
|
||||
| UI Components | 5 | 5 | `Header` uses `NavLink` with Home, FileText and Settings icons, a mobile menu with `aria-expanded` and `aria-controls`, and labelled navigation. `Layout`, `ArticleCard`, `AuthorAvatar` and `CategoryBadge` exist and are tested. |
|
||||
| React Router Configuration | 5 | 5 | `BrowserRouter` wraps the app in `App.tsx`. Routes: `/`, `/articles`, `/articles/:id`, `/categories`, and a `*` 404 route. Navigation uses `NavLink`/`Link`. The E2E test checks that navigation does not trigger a full page load. |
|
||||
| Page Components | 3 | 3 | `Home`, `ArticlePage` and `CategoriesPage` live in `pages/` and are mapped in `App.tsx`. |
|
||||
| API Integration | 2 | 2 | `api/client.ts` has a configurable base URL, a fetch wrapper that converts failures to `ApiError`, and typed endpoint functions. |
|
||||
| Unit Testing | 3 | 4 | 23 tests across Header, Layout, ArticleCard, AuthorAvatar and CategoryBadge, using React Testing Library. No unit tests for the API client's error handling (level 4 requires them). |
|
||||
| E2E Testing | 5 | 6 | 9 Playwright tests (chromium) pass, covering layout, navigation without reload, and the article card flow. No accessibility-scanner checks, so level 6 is not met. |
|
||||
| Docker Configuration | 2 | 3 | Multi-stage Dockerfile (`node:20-alpine` build, `nginx:1.27-alpine` serve). The compose file has `frontend` on port 3000:80 with `depends_on: backend: service_healthy`. But the build fails from a clean checkout, so level 3 is not met. |
|
||||
| Code Quality | 2 | 2 | ESLint runs and passes. TypeScript strict mode. Consistent React and hooks rules. |
|
||||
| Documentation | 2 | 3 | `frontend/README.md` (240 lines) covers scripts, structure, routing, API client, testing, Docker, environment variables, lucide icons and troubleshooting. No per-component prop documentation, so level 3 is not met. |
|
||||
| **Base total** | **35** | **49** | |
|
||||
|
||||
### Bonus
|
||||
|
||||
- **+1 ESLint rules configured:** awarded. `.eslintrc.cjs` enables TypeScript, React and hooks rules, and lint passes.
|
||||
- **+2 TypeScript strict mode and typed components:** awarded. `strict: true`, and components have typed props and interfaces.
|
||||
- **+3 Root compose orchestration, SPA `try_files` fallback, and E2E routing checks without reloads:** awarded. All three are present.
|
||||
|
||||
Bonus total: +6.
|
||||
|
||||
### Critical Requirements Checklist (from rubric)
|
||||
|
||||
- [x] `lucide-react` installed and used
|
||||
- [x] `react-router-dom` installed and used
|
||||
- [x] `BrowserRouter` configured in `App.tsx`
|
||||
- [x] `<Link>`/`<NavLink>` used for navigation (no plain anchors in the app)
|
||||
|
||||
## Other Issues Found
|
||||
|
||||
1. **Missing `src/data/sample.ts` in git.** The root `.gitignore` line `data/` excludes `frontend/src/data/`. Narrow the rule (for example, `/data/` anchored at the repo root), or move the sample module to `src/lib/` or `src/mocks/`, and commit it. This is the single blocker for the build and the Docker image.
|
||||
2. **API proxy only tested without a backend.** Nginx returns 502 for `/api` when the backend is down. This is correct behaviour, but the frontend renders a fallback. A full stack run has not been tested in this scoring pass.
|
||||
3. **No unit tests for `api/client.ts`.** The fetch wrapper, `ApiError` mapping, and network-error path are untested.
|
||||
4. **Pages and API client have no coverage in the unit run.** Only components are exercised.
|
||||
5. **No "Search" icon** in the Header, although the M3 acceptance criteria list `Search` among the lucide icons. The search bar is also absent.
|
||||
|
||||
## Path to a Higher Score
|
||||
|
||||
1. Commit `src/data/sample.ts` (fix the `.gitignore` rule), then confirm `npm run build` and `docker build` pass from a fresh clone. This moves the overall level to 3.
|
||||
2. Add unit tests for `api/client.ts`: success, non-2xx error envelope, and network failure.
|
||||
3. Add an accessibility check to the E2E suite (for example, `@axe-core/playwright`).
|
||||
4. Add prop documentation for the shared components (`Header`, `Layout`, `ArticleCard`, `AuthorAvatar`, `CategoryBadge`) to the README.
|
||||
5. Add the `Search` icon to the header or to the planned search bar.
|
||||
@@ -0,0 +1,72 @@
|
||||
# M4: Setup Developer Environment - Score Report
|
||||
|
||||
**Model:** qwen3.8-27b
|
||||
**Repository scored:** `../newz` (`/home/daniel/Gitea/daniel/newz`), committed `origin/develop` at `ed7b304` (M4 commit, after `9144411` sample-data fix)
|
||||
**Rubric:** `milestone/m4-setup-developer-environment-scoring.md`
|
||||
|
||||
## Total Score: 20 (17 / 29 base + 3 bonus) - Overall level 1 as delivered
|
||||
|
||||
**Overall level 1 as delivered.** On this machine, `make dev` (`docker compose up -d --build`) fails in the repo's own directory. The compose file hardcodes subnet `172.28.0.0/16` for `newzy-network`, and that range is already used by the running `newz_newzy-network` network from your working copy. Docker reports `Pool overlaps with other one on this address space`, so the stack does not start. The stack does work once the subnet line is removed (tested in a temp copy, see below). The rubric's level 2 also asks for a `.env` file with defaults, and the repo has only `.env.example`.
|
||||
|
||||
## Verification Performed
|
||||
|
||||
All checks ran on a clean `git archive` export of `origin/develop` in a temp directory. I did not touch the running `newz` stack.
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| `docker compose config -q` | Passes. |
|
||||
| `make help` and `make -n` for dev, stop, restart, backend-start, frontend-start, clean | Targets expand as documented. |
|
||||
| `docker compose up -d --build` (as committed) | **Fails:** `Pool overlaps with other one on this address space` for `172.28.0.0/16`. |
|
||||
| Existing host state | A `newz` compose project is already running from `/home/daniel/Gitea/daniel/newz`, holding ports 3000 and 8000. I did not stop it. |
|
||||
| Same stack with the `ipam` block removed and host ports 13000/18000 (temp copy only) | **Starts.** Backend healthy. Via the frontend proxy: `/` and `/articles` return the SPA (200); `/api/v1/version` and `/api/v1/health` return 200 through nginx. |
|
||||
| Frontend container healthcheck | **Fails** with exit code 1 on every run. `wget http://localhost/` tries `[::1]:80`, but nginx listens on IPv4 only. The container reports `unhealthy`. (Confirmed on the running `newz-frontend-1` container as well.) |
|
||||
| Backend `pytest` (temp export) | 19 passed, 95% coverage. |
|
||||
| Frontend `npm run test` (temp export) | 23 passed in 5 files. |
|
||||
| Frontend `npm run e2e -- --project=chromium` (temp export) | 9 passed. |
|
||||
| Data directory after compose run | `./data/db` and `newzy.db` are created **owned by root**, so a non-root `rm -rf data/` (`make clean`) fails with `Permission denied`. |
|
||||
|
||||
## Scoring by Criterion
|
||||
|
||||
| Criterion | Score | Max | Notes |
|
||||
|---|---|---|---|
|
||||
| docker-compose Configuration | 3 | 4 | Both services with the right build contexts, ports 3000 and 8000, a bridge network, the `./data/db` volume, `depends_on` with `service_healthy`, and restart policies. Backend has a working healthcheck. Frontend healthcheck is broken (see above). The hardcoded subnet stops the stack from starting on hosts where that range is taken. |
|
||||
| Environment Configuration | 2 | 3 | `.env.example` documents each variable with comments and defaults. `.env` is not in the repo; the README asks users to copy the template. `.env*` is git-ignored, with `!.env.example`. |
|
||||
| Development Commands | 3 | 4 | `dev`, `stop`, `restart`, `backend-start`, `frontend-start`, `build`, `logs`, `status`, shells, and `help` are present. `make test` runs frontend unit and backend tests, but E2E is a separate `make e2e` target, so `test` does not cover both. `clean` runs `rm -rf data/`, which fails on the root-owned database directory. `docker image prune -f` removes only dangling images. |
|
||||
| Security & Best Practices | 2 | 3 | `.env`, `.env.*`, and `data/` are git-ignored. `data/.gitignore` keeps the directory structure while excluding the database. `.dockerignore` files exist for both services. Deduction: the backend image runs as root (no `USER`). |
|
||||
| Documentation | 3 | 3 | README section covers prerequisites, quick start, services, ports, networking and storage, environment variables, Makefile reference, troubleshooting (including the `data/` ownership fix), and running without Docker. Subnet conflicts are not documented. |
|
||||
| Service Communication | 1 | 2 | Bridge network with frontend → backend proxying verified through nginx. Deduction: the fixed subnet prevents startup on hosts with an overlapping network, and the frontend healthcheck fails, so services are reported as not healthy. |
|
||||
| Build Optimization | 3 | 3 | Backend uses `python:3.11-slim`, `pip --no-cache-dir`, `PYTHONDONTWRITEBYTECODE`, and `PYTHONUNBUFFERED`. Frontend is multi-stage (`node:20-alpine` build, `nginx:1.27-alpine` serve) with `npm ci`. Both services have `.dockerignore`. |
|
||||
| **Base total** | **17** | **29** | |
|
||||
|
||||
### Bonus
|
||||
|
||||
- **+1 Logs command and restart policies:** awarded. `make logs` and `restart: unless-stopped` on both services.
|
||||
- **+2 README Docker troubleshooting and `.dockerignore` files:** awarded. Troubleshooting section present, and both `.dockerignore` files exclude build artifacts.
|
||||
- **+3 Full test automation and clean that removes images:** not awarded. `make test` skips E2E, and `clean` does not remove all images.
|
||||
|
||||
Bonus total: +3.
|
||||
|
||||
### Critical Requirements Checklist (from rubric)
|
||||
|
||||
- [x] `docker-compose.yml` defines both backend and frontend services
|
||||
- [x] Ports 3000 and 8000 configured
|
||||
- [x] Docker network defined (but its fixed subnet clashes on this host)
|
||||
- [x] `.env.example` present (`.env` not committed)
|
||||
|
||||
## Other Issues Found
|
||||
|
||||
1. **Hardcoded subnet `172.28.0.0/16`.** Remove the `ipam` block (let Docker pick a range), or make the subnet configurable. Currently `make dev` fails on any host where that range is taken, including this one.
|
||||
2. **Frontend healthcheck fails.** Change the Dockerfile `HEALTHCHECK` to `wget -qO- http://127.0.0.1/` (or make nginx listen on `[::]:80` as well). The container otherwise serves correctly.
|
||||
3. **Root-owned `data/` after first run.** The backend container creates `./data/db` as root. Use a non-root `user:` in compose, or pre-create the directory in the Makefile. Otherwise `make clean` fails for ordinary users.
|
||||
4. **`make test` does not include E2E.** Either add `e2e` to the `test` target, or document that `make test` is unit-only.
|
||||
5. **No `.env` default file.** The M4 prompt asks for one. A committed `.env` with dev defaults, or a `make env` target that copies the template, would satisfy it.
|
||||
6. **Backend runs as root.** Add a non-root `USER` to `backend/Dockerfile`.
|
||||
7. **Running stack from your working copy** is still up on ports 3000 and 8000, and its frontend container is `unhealthy` (see item 2).
|
||||
|
||||
## Path to a Higher Score
|
||||
|
||||
1. Remove the fixed subnet from `docker-compose.yml`.
|
||||
2. Fix the frontend `HEALTHCHECK` target to `127.0.0.1`.
|
||||
3. Make the database directory writable by the host user, and confirm `make clean` works from a non-root shell.
|
||||
4. Add `e2e` to `make test` and add a `.env` default or a copy target.
|
||||
5. Run the backend container as a non-root user.
|
||||
@@ -0,0 +1,78 @@
|
||||
# M5: Setup Authentication - Score Report
|
||||
|
||||
**Model:** qwen3.8-27b
|
||||
**Repository scored:** `../newz` (`/home/daniel/Gitea/daniel/newz`), local `develop` at `b186d0f` (M5 commit, **not yet pushed**; `origin/develop` is at `ed7b304`)
|
||||
**Rubric:** `milestone/m5-setup-authentication-scoring.md`
|
||||
|
||||
## Total Score: 44 (40 base + 4 bonus) - Overall level 5
|
||||
|
||||
Overall level 5: all level 2 to 4 criteria are met, all three auth pages exist, and the forms validate input with loading states and status-coded errors. The backend, frontend build and tests all pass on the committed tree.
|
||||
|
||||
## Verification Performed
|
||||
|
||||
All checks ran on a clean `git archive b186d0f` export in a temp directory.
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| Prompt parity | `milestones/m5-setup-authentication-prompt.md` in the commit is identical to the benchmark copy. |
|
||||
| Backend `pytest` | **51 passed**, 97% coverage (649 statements, 18 missed). |
|
||||
| Live backend (uvicorn) | `register` 201 with JWT; `me` 200 with a valid token; `me` 401 with no token and with a tampered token; `login` 200 on correct password and 401 on wrong password; duplicate register 400; invalid username 422; `logout` 204. The token's `exp - iat` is 604800 seconds (7 days). |
|
||||
| Password storage | No plaintext password appears in any database file. |
|
||||
| Frontend `npm ci` and `npm run build` | Pass (`tsc` and `vite build`, no errors). |
|
||||
| Frontend `npx vitest run` | **9 files, 53 tests, all pass.** |
|
||||
| Frontend `npm run e2e -- --project=chromium` | **19 passed**, including `auth.spec.ts`. |
|
||||
| `/api/auth/*` (path in the milestone prompt) | Returns 404. The routes live under `/api/v1/auth/*`, following the M2 prefix. The commit message records this as a deliberate choice. |
|
||||
| Docker | Not re-run in this pass. On this host, `make dev` still fails on the hardcoded subnet from M4. |
|
||||
|
||||
## Scoring by Criterion
|
||||
|
||||
| Criterion | Score | Max | Notes |
|
||||
|---|---|---|---|
|
||||
| Backend User Model | 3 | 3 | `User` has `id`, `username` (String(60), unique, indexed), `password_hash` (String(128)), and `created_at` (timezone-aware, defaulted). |
|
||||
| Password Hashing | 4 | 4 | PBKDF2-HMAC-SHA256 with 120,000 iterations. Salt from `secrets.token_hex(16)`, stored as `salt$digest`. `verify_password` uses `secrets.compare_digest`. Tests cover round-trip, unique salts, and malformed stored values. |
|
||||
| JWT Token System | 5 | 5 | `create_token` sets `sub`, `iat`, `exp` (7 days), signs with HS256 using `HN_SECRET_KEY` (dev default marked as change-me). Decoding validates the signature, expiry, and that the user still exists. Tests cover wrong key and expired tokens. |
|
||||
| Backend Auth Endpoints | 5 | 5 | `register` (201, `{token, username}`, username regex, duplicate check), `login` (hash check, 401 on failure), `logout` (204, requires a token), `me` (Bearer validation). The duplicate-username check returns 400, matching the QA notes. Deviation: `/api/v1/auth/*` instead of `/api/auth/*`. |
|
||||
| Frontend Authentication Context | 5 | 5 | `AuthProvider` exposes `username`, `ready`, `login`, `register`, and `logout`. On load it calls `GET /auth/me` with the stored token and drops the token on failure. `Login` and `Register` go through the context, so the token is stored on success. `RequireAuth` guards protected routes. |
|
||||
| Token Storage & Management | 3 | 3 | `AUTH_TOKEN` is used consistently. Login and register store the token, logout removes it, and an invalid stored token is cleared on restore. |
|
||||
| API Client Auth Methods | 4 | 4 | `login`, `register`, `logout`, and `me` are implemented. The `Authorization: Bearer` header is attached to every request when a token exists. Non-2xx responses throw `ApiError`. |
|
||||
| Frontend Auth Pages | 5 | 6 | `Login`, `Register` (with client-side username, password-length and password-match checks, a disabled submit while busy, and error messages), and `SignOut` (routed at `/sign-out`, clears the token, redirects to `/login`). Deduction: no explicit success message after login or register, only a redirect. |
|
||||
| Security Implementation | 4 | 4 | PBKDF2 at 120k iterations, HS256, secret from `HN_SECRET_KEY` with a dev-only default, no plaintext passwords, and CORS configured from M2. |
|
||||
| Git Configuration | 2 | 2 | `backend/.gitignore` excludes `*.db`, `*.sqlite`, and `data/`. Root `.gitignore` excludes `.env` and `.env.*`. `data/.gitignore` names `newzy.db` and `data.db`. |
|
||||
| **Base total** | **40** | **46** | |
|
||||
|
||||
### Bonus
|
||||
|
||||
- **+1 Input validation and password strength:** awarded. Username regex `^[a-zA-Z0-9_]{3,20}$` on the backend and frontend, and passwords need at least 8 characters.
|
||||
- **+2 Non-leaking errors and rate-limit placeholders:** not awarded. Login errors are generic ("Invalid username or password"), but there are no rate-limit placeholder comments or code.
|
||||
- **+3 Complete error handling and protected-route redirect:** awarded. Errors are shown to the user, and `RequireAuth` redirects unauthenticated users to `/login`.
|
||||
|
||||
Bonus total: +4.
|
||||
|
||||
### Critical Requirements Checklist (from rubric)
|
||||
|
||||
**Must have for score above 1:**
|
||||
- [x] Passwords never stored as plaintext
|
||||
- [x] PBKDF2 with at least 100,000 iterations (SHA256)
|
||||
- [x] JWT uses HS256
|
||||
- [x] `HN_SECRET_KEY` used for signing
|
||||
- [x] Token `exp` is 7 days after `iat`
|
||||
|
||||
**Must have for score above 3:**
|
||||
- [x] Context provides login, register, logout
|
||||
- [x] `AUTH_TOKEN` persistence in localStorage
|
||||
- [x] Session check on load calls `/auth/me`
|
||||
- [x] 401 responses for invalid tokens
|
||||
|
||||
## Other Observations
|
||||
|
||||
1. **M5 is not on `origin/develop`.** The commit `b186d0f` exists only on local `develop`. Push it, or open a pull request from it, before treating M5 as delivered.
|
||||
2. **Endpoint path differs from the prompt.** The prompt says `/api/auth/*`, but the implementation uses `/api/v1/auth/*`, consistent with the M2 prefix. Either update the prompt or add an alias route.
|
||||
3. **No rate limiting.** The prompt lists rate limiting as a known limitation, so this is expected, but the bonus placeholder is missing.
|
||||
4. **Docker not re-verified.** The M4 subnet conflict on this host still blocks `make dev`, so the auth changes were not run inside containers in this pass.
|
||||
|
||||
## Path to a Higher Score
|
||||
|
||||
1. Push `develop` (or open a pull request) so M5 is on the remote.
|
||||
2. Add a success notice after login and register, to reach level 6 on the auth pages.
|
||||
3. Add a rate-limit placeholder comment or middleware stub on the auth endpoints for the +2 bonus.
|
||||
4. Reconcile the endpoint path with the milestone prompt, either by updating the prompt or adding `/api/auth` aliases.
|
||||
Reference in new issue
Block a user