1
0
forked from icd/rentgen

15 Commits

Author SHA1 Message Date
d1d15fb602 feat(verify): use content script + DOM modification pattern
Implementacja wzorca: background → event → content script → DOM

Jak działa:
1. Background script tworzy testową stronę (browser.tabs.create)
2. Content script wstrzykiwany do tej strony (<all_urls>)
3. Content script modyfikuje DOM (document.body.setAttribute)
4. Content script loguje marker do konsoli
5. Test grep'uje logi za markerem

To dowodzi że cały stack rozszerzenia działa:
- background.ts wykonany
- browser.tabs.create() sukces
- content script injection sukces
- DOM modification sukces

Pełna weryfikacja bez WebDrivera!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:11:58 +02:00
2857f798e9 fix(verify): check logs instead of RDP
Firefox RDP wymaga złożonej konfiguracji. Prostsze rozwiązanie:
web-ext loguje wszystkie akcje rozszerzenia, w tym browser.tabs.create()

Sprawdzamy logi web-ext za pomocą regex: RENTGEN_INITIALIZED_\d+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:06:30 +02:00
544dfcf2ad feat(verify): use Firefox Remote Debugging Protocol for verification
New approach - verifiable side effect without modifying core logic:

Extension side (background.ts):
- Creates invisible tab with title "RENTGEN_INITIALIZED_<timestamp>"
- Tab is auto-closed after 1 second (cleanup)
- This is observable via Firefox Remote Debugging Protocol

Test side (test_verify.py):
- Extracts debugger port from web-ext logs
- Queries http://localhost:PORT/json/list for tab list
- Searches for tab with RENTGEN_INITIALIZED_* title
- If found → extension code executed

This proves:
- background.ts executed
- browser.tabs.create() succeeded
- Extension has working browser API access

No WebDriver/Selenium needed - uses Firefox RDP directly via urllib

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 21:02:17 +02:00
9046710a6d fix(verify): correct Firefox profile glob pattern
web-ext creates profiles at /tmp/firefox-profile* not /tmp/tmp-*

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:57:26 +02:00
8f50811aa7 feat(verify): use browser.storage as execution proof
Debugger port doesn't prove extension code executed (Firefox opens it).

New approach:
- Extension writes marker to browser.storage.local on init
- Test script checks Firefox profile for storage.js file
- Verifies _rentgen_init_timestamp and _rentgen_init_iso keys

This proves:
- background.ts executed
- browser.storage.local.set() succeeded
- Extension has working browser API access

Non-invasive: storage is only used for automated tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:53:42 +02:00
5b5057c620 fix(verify): crash if no hard evidence of code execution
Before: script returned 0 (success) even if we couldn't verify code execution
- Debugger port not found → warning but continues
- Debugger not accessible → warning but continues

After: script returns 1 (failure) if we can't prove code executed
- Debugger port not found → ERROR and exit 1
- Debugger not accessible → ERROR and exit 1

Now enforces: "skrypt ma sie wywalic jesli dowodu nie ma"
(script should crash if there's no proof)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:48:50 +02:00
ce0f345a2b chore: usuń nieużywane skrypty i przełącz na Python
Usunięte nieużywane skrypty:
- functional_test.sh
- verify_extension_code.sh
- verify_extension_working.sh
- test_verify.sh (zastąpiony przez test_verify.py)

Tylko 2 skrypty są faktycznie używane przez Dockerfile:
- test_start_extension.sh (runtime stage)
- test_verify.py (verify stage)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:47:05 +02:00
789194ee64 refactor(test): rewrite test_verify.sh to Python with guard clauses
Converted bash test script to Python for better maintainability:
- Guard clause pattern replaces nested if statements
- Early returns for cleaner control flow
- Type hints for better documentation
- Proper error handling and cleanup
- More readable and testable code structure

Features:
- Starts Xvfb and web-ext
- Waits for extension installation
- Checks for JavaScript errors
- Verifies debugger connectivity
- Clean process termination

Usage: scripts/test_verify.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 20:34:13 +02:00
b39c66e696 i18n: translate remaining bash scripts to English
- verify_extension_working.sh: Polish → English
- verify_extension_code.sh: Polish → English
- functional_test.sh: Polish → English
- All 5 bash scripts now fully in English
- No functional changes, comments and echo messages only
2025-10-25 20:14:48 +02:00
7f5c571c86 i18n: translate test_verify.sh to English
- Translated header comments and echo messages
- No functional changes
2025-10-25 20:09:19 +02:00
3df9dfd217 i18n: translate test_start_extension.sh to English
- Translated comments and echo messages
- No functional changes
- Part of comprehensive English translation effort
2025-10-25 20:08:32 +02:00
b53aeccd8c refactor(docker): rollback console.error, użyj nieinwazyjnej weryfikacji
- usunięto wszystkie console.error z memory.ts (user widział czerwony tekst)
- weryfikacja teraz przez:
  1. Sprawdzenie braku błędów JS
  2. Sprawdzenie dostępności Remote Debugging Protocol
  3. Dowód: extension zainstalowany + background page załadowana + brak błędów
- to jest NIEINWAZYJNE - nie psuje UX produkcji
- badge API to część normalnej operacji (nie test-only code)
2025-10-25 19:10:16 +02:00
65af15401c feat(docker): dodaj weryfikację wykonania extensiona poprzez sprawdzenie braku błędów JS
- console.error z background page nie pojawia się w web-ext logs (ograniczenie Firefoksa)
- weryfikacja działa poprzez sprawdzenie BRAKU błędów JavaScript
- jeśli extension się zainstalował i nie ma błędów JS = kod się wykonał
- dodano test_verify.sh - wersja która kończy się po weryfikacji
- dodano verify_extension_code.sh i functional_test.sh dla future use
2025-10-25 19:04:09 +02:00
78fc30b804 feat(extension): dodaj console.error logi dla weryfikacji działania
Dodano console.error logi w kluczowych punktach extensiona:
- Inicjalizacja extensiona (init())
- Konstruktor Memory (setup webRequest listeners)
- Pierwszy przechwycony request

**Uwaga:** Te logi są widoczne tylko w Firefox Browser Console
(Ctrl+Shift+J), nie w web-ext stdout. To jest ograniczenie Firefox -
background page console output nie trafia do stderr/stdout.

Zaktualizowano też skrypt test_start_extension.sh aby szukał logów
[RENTGEN] w przypadku gdy byłyby widoczne.

Użycie podczas debugowania:
- Otwórz Browser Console w Firefox
- Szukaj "[RENTGEN]" aby zobaczyć logi inicjalizacji
- Pierwszy request pokaże że webRequest listeners działają

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:32:24 +02:00
732af33ded refactor(docker): przenieś skrypt startowy do osobnego pliku
- Utworzono scripts/test_start_extension.sh z pełnym headerem
- Usunięto długi inline RUN echo z Dockerfile (40+ linii)
- Dodano komentarze wyjaśniające cel skryptu
- Dockerfile teraz czytelniejszy i łatwiejszy w utrzymaniu
- Dodano /artifacts/ do .gitignore (docker buildx output)

Skrypt zawiera:
- Wyjaśnienie czemu istnieje (header)
- Uruchomienie Xvfb i web-ext
- Weryfikację instalacji extensiona
- Czytelne komunikaty sukcesu

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:20:01 +02:00