Testing revealed that max_tokens=2000 parameter causes Gemini to block
requests with safety filters, even for safe content.
Removed max_tokens from generate_text() call - Gemini will use default.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Testing revealed that Gemini 2.5 safety filters block texts longer than
~2000 chars. Applied two fixes:
1. Truncate chunk text to 2000 chars in _extract_with_ai() as safety net
2. Reduce MAX_CHUNK_SIZE from 1000 to 500 tokens (~2000 chars)
This ensures all AI extraction requests stay within Gemini's safe limits.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The complex JSON schema with pipe characters was triggering Gemini 2.5's
safety filters. Simplified to minimal prompt that still produces valid output.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- wyborcza.pl - paywall Gazety Wyborczej
- rp.pl - paywall Rzeczpospolitej
- wykop.pl - agregator bez oryginalnej treści
- reddit.com - agregator
Te domeny zwracają cookie dialog zamiast treści artykułów
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dodano:
- Odmiany 'jądrowa/jądrowej/jądrowe/jądrowy'
- 'atomowa' i odmiany
- Konkretne nazwy: westinghouse, bechtel, arabelle, turbiny
- Więcej form offshore wind
- Rozszerzono infrastructure i energy keywords
Dzięki temu pytania jak 'turbiny dla elektrowni jądrowej'
będą poprawnie rozpoznawane jako ZOPK
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem: Gemini blokował treści o energetyce jako 'dangerous content'
Rozwiązanie: Przekazywanie safety_settings do API z BLOCK_NONE
Uwaga: FREE tier może nadal mieć ograniczenia
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem: Gemini blokował ekstrakcję z artykułów o energetyce
Rozwiązanie: Bardziej neutralne sformułowania promptów
- Podkreślono że to analiza PUBLICZNYCH artykułów prasowych
- Usunięto wrażliwe słowa kluczowe (nuclear, defense)
- Zmieniono 'extract' na 'identify'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem: GeminiService.generate_text() nie obsługuje parametru system_prompt
Rozwiązanie: Połączono system_prompt z user_prompt w jeden full_prompt
Dotyczy: ekstrakcji faktów, encji i relacji z artykułów ZOPK
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Scraping: domyślnie 1, max 100
- Ekstrakcja: domyślnie 1, max 100
- Embeddingi: domyślnie 1, max 500
- Usunięto stałe liczby z etykiet przycisków
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano white-space: pre-line do modala
- Wyrównano kolumny wartości
- Dodano separatory sekcji
- Usunięto zbędne emoji w nagłówkach
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano przyciski: Scrapuj treść, Ekstraktuj wiedzę, Generuj embeddingi
- Dodano przycisk Statystyki z podglądem bazy wiedzy
- Przyciski widoczne w panelu /admin/zopk/news
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Endpoint /admin/news był planowany (dokumentacja CLAUDE.md) ale nigdy
nie zaimplementowany. Tylko /admin/zopk/news istnieje.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem: Newsy z Google News RSS miały source_domain='news.google.com'
i favicon Google zamiast prawdziwego źródła.
Rozwiązanie: Nowy skrypt fix_google_news_sources.py który:
- Wyciąga nazwę źródła z tytułu (po " - ")
- Mapuje 59 źródeł na ich prawdziwe domeny
- Aktualizuje source_domain i image_url (favicon)
Wynik: 143/143 newsów zaktualizowanych z poprawnymi źródłami.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Zamieniono requests.Session() na bezpośredni requests.get()
- Dodano max_depth=3 jako zabezpieczenie przed nieskończoną rekurencją
- Jawne zamykanie response.close() po każdym request
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano context manager (with) dla sesji requests
- Jawne zamykanie odpowiedzi HTTP (response.close())
- Dodano flush=True do print dla natychmiastowego outputu
- Rozwiązuje problem 725+ otwartych połączeń
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano INCIDENT_REPORT_20260115.md dokumentujący incydent
wysokiego CPU spowodowany wielokrotnym uruchomieniem skryptu
- Dodano ostrzeżenia do CLAUDE.md o uruchamianiu skryptów:
- SSH timeout NIE oznacza nieudanego wykonania
- Sprawdzaj procesy przed ponownym uruchomieniem
- Używaj QEMU guest agent jako alternatywy
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Strategia pobierania obrazków:
1. Rozwiń URL Google News do oryginalnego źródła
2. Pobierz og:image z meta tagów strony
3. Fallback: logo domeny (Clearbit API)
4. Fallback: favicon (Google Favicon API)
Użycie: python scripts/fetch_news_images.py [--dry-run] [--limit N]
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Obrazki newsów (lub zielony placeholder z ikoną)
- Większy padding i promień zaokrąglenia kart
- Dłuższe opisy (250 znaków zamiast 200)
- Data w formacie DD.MM.YYYY w jednej linii ze źródłem
- Hover z efektem podniesienia (translateY)
- Responsive: obrazki na pełną szerokość na mobile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano pasek statystyk newsów (łącznie, dzień, tydzień, miesiąc)
- Zwiększono limit wyświetlanych newsów z 10 do 25
- Usunięto przycisk "Zobacz wszystkie" - pełny widok od razu
- Przycisk "Starsze aktualności" pojawia się gdy jest więcej niż 25
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BUG: Strona publiczna pokazywała tylko status='approved',
ale AI ustawia status='auto_approved' dla newsów 3+★.
Wynik: Newsy zatwierdzone przez AI NIE pojawiały się publicznie!
Naprawione miejsca:
- /zopk (strona główna ZOPK)
- /zopk/projekt/<slug> (szczegóły projektu)
- /zopk/aktualnosci (lista newsów)
Teraz wszystkie 3 miejsca pokazują obie wartości:
status IN ('approved', 'auto_approved')
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Były dwa elementy z tym samym ID - JavaScript znajdował pierwszy
(poza modalem) zamiast właściwego wewnątrz modala.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowa funkcja reevaluate_low_score_news() szuka newsów z 1-2★
zawierających Via Pomerania, NORDA, S6, Droga Czerwona, etc.
- Nowy endpoint POST /admin/zopk/news/reevaluate-low-scores
- Przycisk w UI "Re-ewaluuj niskie oceny" z szczegółowym raportem
- Automatyczne auto-approve jeśli nowa ocena >= 3★
Problem: Artykuły o Via Pomerania miały 1★ bo były ocenione
przed dodaniem tego tematu do promptu AI.
Rozwiązanie: Re-ewaluacja nowym promptem podniesie ich oceny.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Zamiana auto-odświeżania na przycisk OK
- Dodanie sekcji szczegółowych statystyk (12 metryk)
- Dodanie listy artykułów odrzuconych przez AI
- Śledzenie czasu przetwarzania
- API zwraca nowe pola: sent_to_ai, ai_rejected_articles, processing_time
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shows:
- Current model: gemini-2.5-flash-lite
- Prompt version: v2 (2026-01-15)
- New topics: +7 infrastructure projects
Tooltip lists: Via Pomerania, S6, Droga Czerwona, etc.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added missing topics to ZOPK AI evaluation prompt:
- Via Pomerania (highway Ustka-Bydgoszcz)
- S6 (Koszalin-Słupsk)
- Droga Czerwona (Port Gdynia)
- Pakt Bezpieczeństwa Pomorze Środkowe
- Deklaracja Bałtycka
- Izba Przedsiębiorców NORDA / Akademia Biznesu NORDA
These topics were incorrectly scored 1-2★ instead of 4-5★.
Updated examples to guide AI better.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes:
- Lower auto-approve threshold from 4★ to 3★ (verified 2026-01-15)
- Add detailed progress bar for ZOPK search process
- Add auto-approved articles list with star ratings
- Document ZOPK topics (ZOP Kaszubia) in CLAUDE.md
- Add 8-second countdown before auto-refresh
Technical:
- zopk_news_service.py: Changed score threshold from >=4 to >=3
- Templates: New CSS for progress phases and results display
- CLAUDE.md: Added "ZOP Kaszubia News" section with topic guidelines
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
429 (Too Many Requests) means the endpoint is working correctly
and is protected by rate limiting - this is expected behavior
for /register endpoint.
- Add 429 to acceptable status codes (200, 302, 304, 429)
- Update legend to explain 429 means protection is working
- Apply to all health check endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Always check INPI and Waterm profiles (fixed)
- Add 3 random company profiles each refresh
- Total 5 company profiles tested for better coverage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/health route with visual status indicators
- Create health_dashboard.html with category-based endpoint cards
- Color-coded status: green (OK), yellow (warning), red (error)
- Show response times with color indicators (fast/medium/slow)
- Add HTTP status code legend
- Auto-refresh every 2 minutes
- Add link in admin navigation menu
- Categories: public pages, auth, API, admin panel, company profiles
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Verify all software versions via SSH (NORDABIZ-01, R11-REVPROXY-01, Proxmox)
- Remove Redis (not used), Gunicorn (app runs directly via python)
- Add PostgreSQL version dynamic fetch from database
- Add Docker version for R11-REVPROXY-01
- Update all package versions to verified values
- Handle unknown versions (Fortigate) with yellow "nieznana" badge
- Add comment with verification date (2026-01-14)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /admin/status route with real-time system metrics (CPU, RAM, disk)
- Add /api/admin/status API endpoint for auto-refresh
- Add technology stack section showing all platform technologies
- Add auto-refresh (5 min) to GeoIP stats in security dashboard
- Add "Status systemu" link to admin navigation menu
- Fix /health/full endpoint list (remove non-existent endpoints)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Checks 14 critical endpoints (public + admin pages)
- Returns JSON with pass/fail status for each endpoint
- HTTP 200 if all OK, HTTP 503 if any failures
- Useful for deployment verification and monitoring
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GeoIP blocking, security panel, and stats to v1.16.0 release notes
- Add comprehensive security mechanisms table to CLAUDE.md
- Document GeoIP configuration and MaxMind setup
- List all 12 security mechanisms with star ratings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New 'Mechanisms' tab listing all security features with star ratings (5★=critical)
- New 'GeoIP' tab with blocking statistics (daily/monthly/yearly/total)
- Country breakdown with flags for blocked connections
- Status indicators for each security mechanism
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update security_service.py with BLOCKED_COUNTRIES list
- Add check_geoip() middleware in app.py
- Log blocked attempts with security alerts
- Uses MaxMind GeoLite2-Country database
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>