Commit Graph

576 Commits

Author SHA1 Message Date
Christian Krakau-Louis 0bdd45ddd2 Merge pull request #253 from christianlouis/copilot/fix-test-failures-bulk-operations
fix(test): align 11 tests with refactored status tracking and renamed APIs
2026-02-12 03:57:15 +01:00
copilot-swe-agent[bot] ad39ee7afa fix(test): update 11 failing tests to match refactored status tracking and API changes
- Update test_bulk_operations.py: Use FileProcessingStep instead of ProcessingLog for status filter tests
- Update test_file_listing.py: Use FileProcessingStep for processing status determination tests
- Update test_file_detail_endpoints.py: Replace hash_file with check_text in step summary test
- Update test_path_traversal_security.py: Import get_unique_filepath_with_counter from correct module
- Update test_process_document.py: Match current duplicate handling behavior (creates new record)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 02:54:46 +00:00
copilot-swe-agent[bot] 21ae70f8d5 Initial plan 2026-02-12 02:41:45 +00:00
github-actions[bot] fbebe32409 chore(release): update build metadata files [skip ci] 2026-02-12 02:12:29 +00:00
Christian Krakau-Louis 343b4ef0e2 Merge pull request #251 from christianlouis/claude/fix-failing-tests
fix(tests): fix remaining 8 failing tests - storage reorganization and file detail enhancements
2026-02-12 03:12:05 +01:00
anthropic-code-agent[bot] 104757fd4f fix(tests): fix remaining 8 tests - storage reorganization and file detail enhancements
- Fix test_storage_reorganization.py: Use valid PDF content with EOF marker
- Fix test_file_detail_enhancements.py: Add missing sample_pdf_file fixture
- All 12 tests now passing (2 storage + 7 file detail + 3 other)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 02:08:50 +00:00
anthropic-code-agent[bot] 96d063e2a6 fix(tests): rewrite file_status_fix tests for FileProcessingStep model
- Replace ProcessingLog-based tests with FileProcessingStep-based tests
- Update to use step_manager functions (get_file_overall_status, get_step_summary)
- All 6 tests (3 status + 3 metrics) now pass

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 02:01:26 +00:00
anthropic-code-agent[bot] a08c234a53 fix(tests): update file_queries tests to use FileProcessingStep instead of ProcessingLog
- Replace ProcessingLog with FileProcessingStep in sample_files fixture
- Update test comments to reflect using steps instead of logs
- All 10 file_queries tests now pass

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 01:59:38 +00:00
anthropic-code-agent[bot] b27788a95e fix(tests): correct step_manager tests to use actual step names from MAIN_PROCESSING_STEPS
- Replace "hash_file" test step with actual MAIN_PROCESSING_STEPS names
- Fix test_get_step_summary to use upload_to_* instead of queue_* for upload counts
- All 12 step_manager tests now pass

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-12 01:57:54 +00:00
anthropic-code-agent[bot] 8a24c7462b Initial plan 2026-02-12 01:48:42 +00:00
github-actions[bot] 88f7fd6073 chore(release): update build metadata files [skip ci] 2026-02-12 01:38:26 +00:00
Christian Krakau-Louis 9a2c2d20b1 feat(duplication): implement duplicate file handling and detection across processing steps 2026-02-12 02:38:00 +01:00
Christian Krakau-Louis 70757e5644 feat(step-timeout): add automatic recovery for stalled processing steps
- Implement step timeout detection to prevent files from getting stuck in 'pending' state
- Add monitor_stalled_steps periodic task running every minute (Celery Beat)
- Automatically mark in-progress steps as failed if they exceed timeout (default: 10 minutes)
- Add step_timeout configuration setting (default: 600 seconds)
- Recover stalled steps with error message indicating when timeout was triggered
- Fix duplicate check to exclude self-comparison (file not duplicate of itself)

When processing crashes or hangs:
1. Worker detects stalled steps (in_progress for >10 minutes)
2. Marks them as failed with timeout error message
3. Updates UI to show failure status
4. Allows file to be retried or handled by user

This prevents files from being indefinitely stuck in processing state and provides
visibility into what went wrong.
2026-02-12 02:38:00 +01:00
Christian Krakau-Louis 7bbd095152 fix(deduplication): handle UNIQUE constraint violation for duplicate files
- Remove duplicate record creation to avoid UNIQUE constraint on filehash
- When duplicate detected, return original file_id instead of creating new record
- Avoids sqlite3.IntegrityError: UNIQUE constraint failed
- Simpler approach: duplicates not tracked as separate records, just rejected
- Revert filehash column back to NOT NULL (required for original files)
- Fixes error: (sqlite3.IntegrityError) UNIQUE constraint failed: files.filehash
2026-02-12 02:38:00 +01:00
Christian Krakau-Louis 974dd64660 fix(database): add runtime schema migrations for deduplication columns
- Implement lightweight migration system for is_duplicate and duplicate_of_id columns
- Migrations run automatically on application startup
- Idempotent migrations safe to run multiple times
- Fixes SQLite OperationalError for missing columns
- Resolves issue where database schema didn't match model definitions
2026-02-12 02:38:00 +01:00
Christian Krakau-Louis 4c11cfd6dd feat(deduplication): implement configurable duplicate file detection
- Add enable_deduplication and show_deduplication_step config options
- Rename hash_file step to check_for_duplicates
- Make deduplication step conditional based on configuration
- Add is_duplicate and duplicate_of_id fields to FileRecord model
- Create database migration for new deduplication fields
- Update process_document task to log deduplication results
- Update step visualization to show/hide step based on config
- Update status calculations to include deduplication step conditionally
- Default: deduplication enabled, step displayed
- Can be configured to hide from UI while still processing
2026-02-12 02:38:00 +01:00
github-actions[bot] a4f3d92d20 chore(release): update build metadata files [skip ci] 2026-02-12 00:07:53 +00:00
Christian Krakau-Louis 83c65f3c40 feat: enhance processing status tracking and UI display for file details 2026-02-12 01:07:22 +01:00
Christian Krakau-Louis 02e1445e01 Enhance file detail page with original and processed file previews, GPT metadata display, and text extraction functionality
- Added endpoints for previewing original and processed PDF files.
- Implemented on-demand text extraction from original and processed PDFs.
- Updated file detail page to show original and processed file paths with existence status.
- Introduced GPT metadata display with a collapsible JSON view.
- Enhanced front-end with PDF.js for in-browser PDF rendering and improved user experience.
- Added integration tests for new features including metadata display and file previews.
2026-02-11 23:32:29 +01:00
github-actions[bot] ce40cbcdd8 chore(release): update build metadata files [skip ci] 2026-02-11 21:53:37 +00:00
Christian Krakau-Louis 7222740204 feat(auth): add configurable admin group name for OAuth user access 2026-02-11 22:53:13 +01:00
github-actions[bot] 0a3c8987f8 chore(release): update build metadata files [skip ci] 2026-02-11 21:39:55 +00:00
Christian Krakau-Louis 50cc0035d9 feat(database): add file path columns to files table during migration
fix(general): update processed files count query to use FileRecord.id

chore: add VSCode settings for pytest configuration
2026-02-11 22:39:21 +01:00
github-actions[bot] 90b50d3625 chore(release): update build metadata files [skip ci] 2026-02-11 20:36:24 +00:00
Christian Krakau-Louis 3a23d0b2d7 Merge pull request #249 from christianlouis/copilot/reorganize-document-storage-structure
Implement immutable storage architecture with collision-resistant naming
2026-02-11 21:36:05 +01:00
copilot-swe-agent[bot] a247393e18 fix: update test to use new collision handling function
- Replace unique_filepath with get_unique_filepath_with_counter in tests
- Update test expectations for -0001 suffix format
- All 40 tests passing successfully

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 20:17:03 +00:00
copilot-swe-agent[bot] c7dff41492 docs: add comprehensive documentation for storage reorganization
- Create StorageArchitecture.md with detailed architecture explanation
- Document collision handling with -0001 suffix format
- Explain immutable original and processed file storage
- Document forced Cloud OCR reprocessing feature
- Update API.md with new reprocess-with-cloud-ocr endpoint
- Update UserGuide.md with user-facing feature descriptions
- Include database schema, lifecycle diagrams, and examples

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 20:14:56 +00:00
copilot-swe-agent[bot] 952e27b339 test: add tests for storage reorganization features
- Add tests for get_unique_filepath_with_counter collision handling
- Add tests for immutable original storage
- Add tests for metadata augmentation with file paths
- Add tests for force_cloud_ocr parameter
- Verify existing process_document tests still pass

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 20:13:17 +00:00
copilot-swe-agent[bot] 73a0222e56 feat(storage): implement immutable original/processed file storage and collision handling
- Add original_file_path and processed_file_path columns to FileRecord model
- Create database migration for new fields
- Implement get_unique_filepath_with_counter() with -0001 suffix format
- Update process_document to save immutable copy to /workdir/original
- Add force_cloud_ocr parameter to process_document for forced OCR
- Update embed_metadata to use new collision handling
- Update metadata JSON to include file path references
- Add /files/{file_id}/reprocess-with-cloud-ocr API endpoint
- Update processed_file_path in database during embedding

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 20:10:19 +00:00
copilot-swe-agent[bot] b5c669f3fe Initial plan 2026-02-11 20:04:57 +00:00
github-actions[bot] 3103ebed2b chore(release): update build metadata files [skip ci] 2026-02-11 19:58:10 +00:00
Christian Krakau-Louis 9771277239 Merge pull request #248 from christianlouis/copilot/fix-dashboard-file-status
Fix dashboard status tracking with explicit FileProcessingStep table
2026-02-11 20:57:48 +01:00
copilot-swe-agent[bot] 9145060d8e docs: Add comprehensive architecture documentation for status tracking
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 19:49:41 +00:00
copilot-swe-agent[bot] 65b6dc6985 feat: Add comprehensive tests and migration utility for status table
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 19:48:17 +00:00
copilot-swe-agent[bot] ad74bc852d feat: Add explicit FileProcessingStep table for status tracking
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 19:45:09 +00:00
copilot-swe-agent[bot] 52b65868a4 refactor: Address code review feedback - remove redundant imports and use _ for unused variables
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 19:42:17 +00:00
copilot-swe-agent[bot] 72cea0d8c9 fix: Update existing test to include timestamp in MockLog
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 19:40:34 +00:00
copilot-swe-agent[bot] d8d4294ff0 fix: Make _compute_step_summary order-independent to fix dashboard status bug
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 19:38:29 +00:00
copilot-swe-agent[bot] 2339a449b8 Initial plan 2026-02-11 19:33:10 +00:00
github-actions[bot] 97f815258d chore(release): update build metadata files [skip ci] 2026-02-11 19:15:15 +00:00
Christian Krakau-Louis 83abb3984a Merge pull request #245 from christianlouis/copilot/fix-dashboard-status-metrics
Fix file status and metrics by tracking latest state per step
2026-02-11 20:14:49 +01:00
copilot-swe-agent[bot] 0fc3fca1b2 style: format test file with black
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 18:36:42 +00:00
copilot-swe-agent[bot] 2470768599 test: add timestamps to MockLog for consistency and clarity
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 18:35:29 +00:00
copilot-swe-agent[bot] 4fb696e1eb fix: correct file status and metrics to use latest status per step
- Fix _compute_status_from_logs to track latest status per unique step
- Fix _compute_step_summary to count only latest status per step
- Add comprehensive tests for both fixes
- Resolves issue where completed files showed as "Processing"
- Resolves issue where metrics showed incorrect counts

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 18:33:41 +00:00
copilot-swe-agent[bot] 1e5cbc4f70 Initial plan 2026-02-11 18:28:35 +00:00
Christian Krakau-Louis ada648630c Merge pull request #243 from christianlouis/copilot/fix-404-error-process-url-endpoint
Add regression tests for API endpoint registration
2026-02-11 19:27:43 +01:00
copilot-swe-agent[bot] 8c5ab00428 refactor: extract test URL constant for better maintainability
Address code review feedback by extracting the hardcoded test URL
into a module-level constant to improve maintainability and ensure
consistency across all test methods.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 18:24:03 +00:00
copilot-swe-agent[bot] fad63fcf4b test: add endpoint registration verification tests
Add comprehensive tests to verify critical API endpoints are registered,
including the /api/process-url endpoint. These tests will prevent future
regressions where endpoints might not be properly registered in the app.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-11 18:22:48 +00:00
copilot-swe-agent[bot] cf88754be6 Initial plan 2026-02-11 18:14:21 +00:00
github-actions[bot] 0a20f3e0b5 chore(release): update build metadata files [skip ci] 2026-02-11 18:10:22 +00:00