docs: add CLAUDE.md with project guidelines and conventions, document new devii admin quota reset endpoints and CLI commands, update README with coverage CI and devii_admin_daily_usd config, add European date normalization to ProjectForm model

This commit is contained in:
2026-06-08 22:30:25 +00:00
parent 841c1c7417
commit 547e4eda8c
45 changed files with 1844 additions and 99 deletions
+10 -7
View File
@@ -25,7 +25,7 @@ Open `http://localhost:10500`.
| Database | SQLite via `dataset` (auto-sync schema, `uid` PKs, WAL mode, 30s busy timeout) |
| Auth | Session cookie, API key (`X-API-KEY`/Bearer), or HTTP Basic; PBKDF2-SHA256 via passlib |
| Avatars | Multiavatar (local SVG generation, no external API, <5ms) |
| Validation | `hawk` (Python/JS/CSS/HTML) |
| Coverage | `coverage.py` (`.coveragerc`, subprocess-aware) |
| Load testing | Locust (locustfile.py) |
## Project structure
@@ -374,6 +374,7 @@ Configuration on the Services tab:
| `devii_fetch_timeout` | `300` | Read timeout (seconds) for the fetch tool; minimum five minutes |
| `devii_user_daily_usd` | `1.0` | Rolling 24h spend cap per signed-in user |
| `devii_guest_daily_usd` | `0.05` | Rolling 24h spend cap per guest |
| `devii_admin_daily_usd` | `0.0` | Rolling 24h spend cap per administrator (`0` = unlimited; admins are exempt by default) |
| `devii_guests_enabled` | on | Allow anonymous guests |
| `devii_price_cache_hit` / `_cache_miss` / `_output` | `0.0028` / `0.14` / `0.28` | USD per 1M tokens (drives the cap) |
| `devii_rsearch_enabled` | on | Enable the external web search tools (`rsearch_*`) |
@@ -542,16 +543,18 @@ The app runs correctly under multiple Uvicorn workers (independent processes sha
## CI/CD
Gitea Actions workflow at `.gitea/workflows/test.yaml`:
- Runs on push/PR to main
- Sets up Python 3.13, installs dependencies + Playwright
- Validates all source files with `hawk`
- Runs all tests with fail-fast
- Uploads failure screenshots as artifacts
- Runs on push/PR to `master`
- Sets up Python 3.13, installs dependencies + Playwright Chromium
- Runs the full test suite under coverage (`coverage run -m pytest -p no:xdist`)
- Builds and publishes the coverage HTML as an artifact on every run
- Uploads failure screenshots as artifacts when a test fails
Changes are promoted through automated DTAP streets: Development (`make dev`), Test (the CI suite + coverage on `master`), Acceptance (the `master` to `production` promotion via `make deploy`), and Production (the Docker Compose stack on the host). Only CI-green `master` commits reach `production`.
## Feature workflow
1. Implement the feature (router + template + CSS + JS)
2. `hawk .` - validate all source files
2. Validate each touched language (Python compiles/imports, JS parses, CSS and HTML balance)
3. `make test` - run all tests (fail-fast)
4. Add Playwright tests in `tests/test_*.py` for new functionality
5. For visual features: `falcon take --output /tmp/verify.png && falcon describe /tmp/verify.png`