Commit graph

11 commits

Author SHA1 Message Date
7883ae0eba Refactor: Extract neopig package from neopig.py
Phase 1 of module restructuring as outlined in docs/REFACTOR.md:

New neopig/ package modules:
- live.py: Live media queue (get_live_queue, emit_live_media)
- state.py: AppendOnlyStateLog, state file helpers
- html_utils.py: trim_html_wrapper, extract_meta_from_html
- logging.py: TqdmLoggingHandler, job logging functions
- backfill/: markdown and screenshot backfill operations

Package features:
- Lazy import of NeoPig/main from neopig.py via __getattr__
- Full backwards compatibility with existing imports
- 42 new unit tests for extracted modules

Total: 458 tests passing
2026-01-05 17:30:58 -05:00
00bad59920 Fix test_database.py method names to match Database API
- upsert_page → store_page (2 occurrences)
- get_media → get_media_by_hash (2 occurrences)
- search_media → search_media_advanced
2026-01-05 14:57:49 -05:00
c351753290 Fix test_live_stream_endpoint_exists hanging on SSE request 2026-01-05 14:52:58 -05:00
8d2fbbf8b1 Fix test_stats_endpoint async context manager mock 2026-01-05 14:51:51 -05:00
a46f93aaf1 Extract i18n to module, add Georgian, translate about page body
- Extract 1100+ lines of translations from serp.py to i18n.py
- Add Georgian (ka) as 27th supported language
- Add 74 about page body text keys (hero, chapters, features, footer)
- Update about.html.j2 to use translation placeholders
- Full Chinese translations for all body text
- English fallback for other 25 languages (can be translated later)
- serp.py reduced from 3291 to 2142 lines
- i18n.py now 3808 lines with 190 keys per language
2026-01-05 10:16:48 -05:00
af50334a7b Fix tests for code media type, add source URL and lore 2026-01-02 13:41:10 -05:00
96a3c9c786 Update tests for filevault 2.0.0 API
- Rewrite test_filevault.py for new API (depth=9, hex pairs, content-addressable)
- Rewrite test_async_filevault.py to import from filevault module
- Fix test_screenshot.py defaults (enabled=True, 1024x768)
- Add backward compatibility exports to filevault.py
- All 196 tests passing
2025-12-31 16:03:43 -05:00
99c836e2c8 Unify filevault: merge storage.py into single sync+async module
- filevault.py: Vault (sync) + AsyncVault (async) in one file
- Delete storage.py (redundant async wrapper)
- Both classes share identical API: store, get, exists, delete, stats
- Add content_hash() and hash_to_path() utility functions
- Update all imports: neopig.py, serp.py, test files
- Update README with unified documentation
- 72 lines saved, cleaner architecture
2025-12-31 15:44:39 -05:00
36edc3b8dc modified: archive.py
modified:   tests/unit/test_screenshot.py
2025-12-29 11:35:14 -05:00
1847a2fee6 Add comprehensive unit tests for async modules
Tests for:
- async_web_fetcher: URL handling, media extraction, crawl modes, scoring
- domain_vault: VaultManager, HTML/Media/Linkpeek vaults
- screenshot: ScreenshotCapture configuration and availability
- storage: ImageVault with MD5 deduplication

185 tests total, all passing.
2025-12-22 20:40:58 -05:00
bc11c516b6 Add filevault system with async wrapper and convert sync ops to async
New files:
- filevault.py: Hash-based file storage with use_pairs option (v1.1.0)
- async_filevault.py: Async wrapper using asyncio.to_thread()
- domain_vault.py: Triple vault system for web archival (HTML, Media, Linkpeek)
- screenshot.py: Async screenshot capture using uri2png
- tests/unit/: Comprehensive test suite (85 tests)

Sync-to-async conversions:
- storage.py: Wrap Path operations in asyncio.to_thread()
- domain_vault.py: Wrap exists(), mkdir(), rglob(), os.walk() in asyncio.to_thread()
- screenshot.py: Wrap read_bytes(), write_bytes(), unlink() in asyncio.to_thread()

All sync filesystem operations now run in thread pool to avoid blocking async loop.
2025-12-22 20:18:20 -05:00