mirror of
https://github.com/overcuriousity/trace.git
synced 2025-12-21 05:22:21 +00:00
This commit addresses 20 bugs discovered during comprehensive code review, focusing on data integrity, concurrent access, and user experience. CRITICAL FIXES: - Fix GPG key listing to support keys with multiple UIDs (crypto.py:40) - Implement cross-platform file locking to prevent concurrent access corruption (storage.py) - Fix evidence detail delete logic that could delete wrong note (tui.py:2481-2497) - Add corrupted JSON handling with user prompt and automatic backup (storage.py, tui.py) DATA INTEGRITY: - Fix IOC/Hash pattern false positives by checking longest hashes first (models.py:32-95) - Fix URL pattern to exclude trailing punctuation (models.py:81, 152, 216) - Improve IOC overlap detection with proper range tracking (models.py) - Fix note deletion to use note_id instead of object identity (tui.py:2498-2619) - Add state validation to detect and clear orphaned references (storage.py:355-384) SCROLLING & NAVIGATION: - Fix evidence detail view to support full scrolling instead of "last N" (tui.py:816-847) - Fix filter reset index bounds bug (tui.py:1581-1654) - Add scroll_offset validation after all operations (tui.py:1608-1654) - Fix division by zero in scroll calculations (tui.py:446-478) - Validate selection bounds across all views (tui.py:_validate_selection_bounds) EXPORT & CLI: - Fix multi-line note export with proper markdown indentation (cli.py:129-143) - Add stderr warnings for GPG signature failures (cli.py:61, 63) - Validate active context and show warnings in CLI (cli.py:12-44) TESTING: - Update tests to support new lock file mechanism (test_models.py) - All existing tests pass with new changes Breaking changes: None Backward compatible: Yes (existing data files work unchanged)