From 8407ab6be04e9a2180c5c99b942581cab10358b8 Mon Sep 17 00:00:00 2001 From: Justin Visser Date: Fri, 27 Feb 2026 11:06:38 +0100 Subject: [PATCH] docs(agents): expand testing section with ruff, mypy, and frontend gates Co-Authored-By: Claude Opus 4.6 --- agents.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/agents.md b/agents.md index 7200d7a..9f81a20 100644 --- a/agents.md +++ b/agents.md @@ -10,6 +10,7 @@ Adhere strictly to these constraints when working on this codebase. - **Negative space programming:** Fail fast with explicit assertions and guard clauses. No silent failures, especially in DOM parsing. - **Cyclomatic complexity:** Flatten with early returns. No deep nesting. No magic numbers. - **No dead code:** Do not leave commented-out code, unused imports, or backward-compatibility shims. Delete cleanly. +- **Variable naming:** Any variable outside of a lambda functions or iterators should be descriptive. Code should be readable for maintainers. ## 2. Architecture @@ -74,9 +75,11 @@ Follow [Conventional Commits](https://www.conventionalcommits.org/): Types: `feat`, `fix`, `docs`, `ci`, `refactor`, `test`, `chore`, `perf`. -## 7. Testing +## 7. Testing & Quality Gates -All tests run inside containers: +All commands run inside containers. Do not run bare `npm`, `pytest`, or `ruff` on the host. + +### Backend ```bash # Unit tests (default, excludes integration) @@ -84,9 +87,34 @@ docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm app pyth # Integration tests docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm app python -m pytest -m integration + +# Linting +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm app ruff check . +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm app ruff format --check . + +# Type checking +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm app mypy app/ ``` -Markers: `integration`, `db`, `migrations`, `schema`, `smoke`. +Pytest markers: `integration`, `db`, `migrations`, `schema`, `smoke`. + +### Frontend + +```bash +# Type checking +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm frontend npm run typecheck + +# Unit tests +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm frontend npm run test:run + +# Lint +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm frontend npm run lint + +# Production build +docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm frontend npm run build +``` + +All four gates must pass before a PR is considered ready. ## 8. Frontend