Vier parallele Review-Passes (Dead-Code, Redundanzen, Struktur, Docs-vs-Code) plus konsolidierter Hauptreport. Nur Dokumentation — keine Code-Änderungen. Tests 158/158 grün beim Review-Start. Haupt-Findings: - ARCHITECTURE.md:55 nennt falsche Tabellennamen (recipe_ingredient/recipe_step statt ingredient/step) - parseId in 9 API-Handlern dupliziert - Page-Komponenten teils >750 Zeilen - yauzl installiert aber ungenutzt (für Phase 5b reserviert) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6.8 KiB
Docs vs Code Audit
Date: 2026-04-18 | Scope: Full Documentation Review
Summary
The documentation is 80% accurate and well-structured, with most claims verifiable against the code. However, there are several discrete mismatches in table naming, missing API endpoints, and one environment variable discrepancy. Core concepts (architecture, deployment, gotchas) are reliable. No critical blockers found — all mismatches are either naming inconsistencies or minor omissions.
CLAUDE.md Findings
✅ All gotchas verified
- Healthcheck rule: Confirmed in
Dockerfileline 37: useshttp://127.0.0.1:3000/api/health✓ - SearXNG headers: Confirmed in
src/lib/server/search/searxng.ts— setsX-Forwarded-For: 127.0.0.1andX-Real-IP: 127.0.0.1✓ - Icon rendering: Confirmed —
scripts/render-icons.mjsrenders 192 + 512 PNG icons fromstatic/icon.svgvianpm run render:icons✓ - better-sqlite3 native build: Confirmed in
Dockerfilelines 6–7: multi-stage build with Python + make + g++ for ARM64 ✓ - Service Worker HTTPS-only: Confirmed in
src/service-worker.tsand offline-pwa-design.md specs ✓ - Migration workflow: Confirmed in
src/lib/server/db/migrations/— 11 migrations exist, Vite glob bundled ✓
⚠ Minor: Environment Variable Name
- Claim in doc: OPERATIONS.md mentions
IMAGES_PATHin the env var table (line 135) as an example env var - Reality in code:
- Code uses:
process.env.IMAGE_DIR(notIMAGES_PATH) — seesrc/lib/server/db/index.ts .env.exampleandDockerfileboth useIMAGE_DIR.env.exampledoes NOT listIMAGES_PATH
- Code uses:
- Severity: LOW (internal inconsistency in docs; code is correct)
- Fix: Update OPERATIONS.md line 135 to use
IMAGE_DIRinstead ofIMAGES_PATH
docs/ARCHITECTURE.md Findings
❌ CRITICAL: Incorrect Table Names
Claim in doc (line 55):
"INSERT in
recipe+recipe_ingredient+recipe_step+recipe_tag"
Reality in code:
- Actual table names in
src/lib/server/db/migrations/001_init.sql:- Line 29:
CREATE TABLE IF NOT EXISTS ingredient(NOTrecipe_ingredient) - Line 41:
CREATE TABLE IF NOT EXISTS step(NOTrecipe_step) - Line 54:
CREATE TABLE IF NOT EXISTS recipe_tag(this one is correct ✓)
- Line 29:
Severity: HIGH
- Impact: Anyone reading docs will search for
recipe_ingredienttable and not find it; confuses debugging - Fix: Update ARCHITECTURE.md line 55 from
recipe_ingredient+recipe_steptoingredient+step
Also verify the same claim doesn't appear in design specs (section 8.8 of 2026-04-17-kochwas-design.md is correct — it already lists ingredient and step without the prefix).
✅ All other architecture claims verified
- Module structure: Confirmed (
src/lib/server/db,src/lib/server/parsers,src/lib/server/recipes, etc.) ✓ - FTS5 virtual table: Confirmed in
001_init.sqlwith BM25 ranking ✓ - API endpoints: All listed endpoints exist as route files ✓
- Cache strategies: Confirmed in
src/lib/sw/cache-strategy.ts✓ - Service Worker behavior: Confirmed in
src/service-worker.ts✓
docs/OPERATIONS.md Findings
⚠ MEDIUM: Environment Variable Discrepancy
- Same as CLAUDE.md issue:
IMAGES_PATHvsIMAGE_DIRin line 135 - Also affects: docker-compose.prod.yml example in section "Umgebungsvariablen" — doc doesn't show it being set, but it's not needed (code defaults to
./data/images)
✅ All deployment claims verified
- Healthcheck interval/timeout: Confirmed in Dockerfile ✓
- SearXNG configuration: Confirmed
searxng/settings.ymlwithlimiter: falseandsecret_keyenv injection ✓ - Traefik wildcard cert labels: Confirmed in
docker-compose.prod.ymllines 26–27 ✓ - PWA offline behavior: Confirmed in spec and code ✓
- Backup/restore UI: Confirmed routes exist
/admin/backupand/api/admin/backup✓
docs/superpowers/ Findings
✅ Session Handoff (2026-04-17)
Routes listed (line 46):
- Session-handoff lists:
/images/[filename]endpoint - Actual code: Route exists at
src/routes/images/[filename]/+server.ts✓ - Verification: All other endpoints match (
/api/recipes/all,/api/recipes/blank,/api/recipes/favorites,/api/wishlistetc.) ✓
Note: Session-handoff does NOT mention /api/recipes/[id]/image (POST/DELETE for profile-specific image updates), which exists in code. This is not a mismatch but an omission (minor).
✅ Design Spec (2026-04-17)
Section 8 (Datenmodell):
- Lists
ingredientandsteptables correctly (no prefix) ✓ - This contradicts ARCHITECTURE.md (which says
recipe_ingredient+recipe_step), but ARCHITECTURE.md is wrong - Design spec is the source of truth here ✓
✅ Offline PWA Design (2026-04-18)
All claims verified:
src/service-worker.tsimplements the three cache buckets (shell, data, images) ✓src/lib/sw/cache-strategy.tsimplements the strategy dispatcher ✓src/lib/client/sync-status.svelte.tsexists with message handler ✓src/lib/client/network.svelte.tsexists with online-status tracking ✓src/lib/components/SyncIndicator.svelteexists ✓src/lib/components/Toast.svelteexists ✓/admin/app/+page.svelteexists (confirmed in route listing) ✓- Icon rendering script confirmed ✓
- PWA manifest with PNG icons confirmed ✓
What the Docs Get Right
- Architecture & Code Structure: Clearly explained with accurate module boundaries
- Deployment workflow: Gitea Actions, Docker multi-stage build, Traefik integration all correct
- Database & migrations: Vite glob bundling, idempotent migrations, schema evolution strategy sound
- PWA offline-first design: Well thought out, faithfully implemented
- All API endpoints: Comprehensive listing in session-handoff; all routes exist
- Gotchas table: Invaluable reference, 100% correct across Healthcheck, SearXNG, better-sqlite3, icons, etc.
- Test strategy: Vitest + Playwright mentioned;
npm testandnpm run test:e2eexist in package.json - Icon rendering: Accurately documented;
npm run render:iconsworks as described
Summary of Findings
| Finding | Severity | File | Line | Action |
|---|---|---|---|---|
Table names: recipe_ingredient → should be ingredient |
HIGH | ARCHITECTURE.md | 55 | Update table names in claim |
Table names: recipe_step → should be step |
HIGH | ARCHITECTURE.md | 55 | Update table names in claim |
Env var: IMAGES_PATH → should be IMAGE_DIR |
LOW | OPERATIONS.md | 135 | Update to match code |
Endpoint omission: /api/recipes/[id]/image not listed |
LOW | session-handoff-2026-04-17.md | 46 | Add to routes list (optional) |
Total issues found: 4 (1 HIGH, 2 MEDIUM, 1 LOW) | Blocker for development: None