Commit graph

10724 commits

Author SHA1 Message Date
dawnsystem
9cb2064460
Merge pull request #52 from dawnsystem/copilot/add-deletion-request-endpoints
Add API endpoints for deletion request approval workflow
2025-11-13 07:01:00 +01:00
copilot-swe-agent[bot]
b8d554631c fix: Remove duplicate deletion approval code and fix formatting
- Removed duplicate DeletionApprovalView from views.py
- Removed duplicate DeletionApprovalSerializer from serialisers.py
- Removed duplicate URL route /api/ai/deletions/approve/
- Fixed missing blank line in serialisers.py before AISuggestionsRequestSerializer
- Kept DeletionRequestViewSet as the correct implementation

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-13 05:59:16 +00:00
dawnsystem
d9a4edf9c5
Merge branch 'dev' into copilot/add-deletion-request-endpoints 2025-11-13 06:51:58 +01:00
copilot-swe-agent[bot]
dd3536d3ff docs: Update BITACORA_MAESTRA with API endpoints implementation details
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-13 05:46:32 +00:00
dawnsystem
86060730e5
Merge pull request #69 from dawnsystem/copilot/optimize-database-indexes
feat(db): Add performance indexes for DeletionRequest queries
2025-11-13 06:40:12 +01:00
dawnsystem
00f8f2c5d8
Merge pull request #66 from dawnsystem/copilot/create-django-migration-deletion-request
Create Django migration for DeletionRequest model
2025-11-13 02:04:07 +01:00
copilot-swe-agent[bot]
3ae23cddfa docs: add migration documentation for DeletionRequest
Created comprehensive documentation for migration 1076 including:
- Overview and migration details
- Complete field descriptions
- How to apply and rollback
- Testing instructions
- Performance and security considerations

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-13 00:52:30 +00:00
copilot-swe-agent[bot]
ad2df8c7ff feat(migrations): add Django migration for DeletionRequest model
Created migration 1076_add_deletion_request.py to add the DeletionRequest model
to the database schema. This model tracks AI-initiated deletion requests that
require explicit user approval before any documents are deleted.

Migration includes:
- All model fields (created_at, updated_at, requested_by_ai, ai_reason, status, etc.)
- ManyToMany relationship with Document model
- Foreign keys to User model (user and reviewed_by)
- Custom indexes for common query patterns (status+user, created_at)
- Proper ordering and metadata

Fixes #10

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-13 00:51:41 +00:00
dawnsystem
487f6ff75d
Merge pull request #41 from dawnsystem/copilot/add-integration-tests-ai-scanner
Add integration tests for AI Scanner consumer pipeline
2025-11-13 01:40:56 +01:00
dawnsystem
9c1cd2638d
Merge pull request #42 from dawnsystem/copilot/add-granular-ai-permissions
Add granular permissions for AI features
2025-11-13 01:38:53 +01:00
copilot-swe-agent[bot]
7658a5571b Address code review feedback: fix imports, docstrings, and add comments
- Move all imports to module level (removed from inside methods)
- Add missing `status` import from rest_framework
- Fix docstring formatting to comply with PEP 257
- Add explanatory comments to empty except clauses
- Improve error message for document not found
- Add warning comment about thread-safety in config update
- Add TODO comments for storing approval/rejection reasons
- Remove unused StoragePath import from tests
- Remove duplicate permission imports at end of file

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 17:24:43 +00:00
copilot-swe-agent[bot]
7bb516a6a5 refactor: Address code review feedback for AI Scanner integration tests
- Add PAPERLESS_ENABLE_AI_SCANNER check in consumer._run_ai_scanner() method
- Move AIScanResult import to top of test file to follow DRY principle
- Create helper methods: create_empty_scan_result_mock() and get_test_file_with_name()
- Reduce code duplication by using helper methods across all tests
- Improve performance test threshold from 10s to 1s for mocked operations
- Add TODO comment for proper performance testing with real ML models
- Remove duplicate 'from documents.ai_scanner import AIScanResult' imports from 7 test methods

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 16:23:11 +00:00
copilot-swe-agent[bot]
b16394fdbb feat(db): Add performance indexes for DeletionRequest model
- Add composite index (user, status, created_at) for listing queries
- Add index for reviewed_at field for filtering reviewed requests
- Add index for completed_at field for filtering completed requests
- Create migration 1076_add_deletionrequest_performance_indexes
- Expected improvement: list queries <100ms, filter queries <50ms

Addresses: [AI Scanner] Índices de Performance para DeletionRequest
Epic: Migraciones de Base de Datos

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 15:42:00 +00:00
copilot-swe-agent[bot]
f67dd152e6 Changes before error encountered
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 15:36:48 +00:00
dawnsystem
79d9338ab6
Merge branch 'dev' into copilot/add-integration-tests-ai-scanner 2025-11-12 16:19:57 +01:00
dawnsystem
114c4c89ed
Merge pull request #40 from dawnsystem/copilot/fix-linting-and-formatting
fix(ai-scanner): Correct linting violations and standardize code quality
2025-11-12 16:16:24 +01:00
copilot-swe-agent[bot]
fe679ed6d4 Initial plan 2025-11-12 15:14:43 +00:00
copilot-swe-agent[bot]
f8f2a72c6d Initial plan 2025-11-12 15:14:41 +00:00
copilot-swe-agent[bot]
780decf543 Initial plan 2025-11-12 15:13:08 +00:00
dawnsystem
c7a338ef0c
Merge pull request #39 from dawnsystem/copilot/add-tests-for-ai-deletion-manager
Add unit tests for AI Deletion Manager and DeletionRequest model
2025-11-12 16:06:10 +01:00
copilot-swe-agent[bot]
b86f541a0d Remove unused mock import from test_ai_deletion_manager.py
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 14:03:08 +00:00
copilot-swe-agent[bot]
426e7b8e16 Add comprehensive integration tests for AI API endpoints
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 14:01:55 +00:00
copilot-swe-agent[bot]
0eb883287c Add AI API endpoints with permission-protected views
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 14:00:25 +00:00
copilot-swe-agent[bot]
476b08a23b Add AI permission classes and comprehensive tests
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 13:56:47 +00:00
copilot-swe-agent[bot]
dcd9d6cff3 Initial plan 2025-11-12 13:49:28 +00:00
copilot-swe-agent[bot]
b397ebfb21 docs: Actualizar BITACORA_MAESTRA.md con sesión de linting
- Añadir TSK-AI-SCANNER-LINTING al historial completado
- Documentar sesión detallada con timestamps y acciones
- Registrar decisiones de diseño sobre correcciones aplicadas
- Actualizar WIP a estado de espera

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 13:19:18 +00:00
copilot-swe-agent[bot]
8a5ece9e2b fix: Corregir todos los warnings de linting (ruff, black)
- Corregir import ordering (TC002) moviendo User a TYPE_CHECKING
- Corregir type hints implícitos (RUF013) usando | None
- Corregir boolean traps (FBT001/FBT002) usando keyword-only args
- Corregir logging warnings (G201) usando logger.exception()
- Formatear código con ruff format y black

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 13:17:08 +00:00
copilot-swe-agent[bot]
c691de5e87 feat(tests): Add comprehensive AI Scanner integration tests for consumer pipeline
- Add TestConsumerAIScannerIntegration test class with 10 integration tests
- Test 1: End-to-end integration (upload → consumption → AI scan → metadata)
- Test 2: ML components disabled (graceful degradation)
- Test 3: AI scanner failures (error handling)
- Test 4a-4c: Different document types (PDF, image, text)
- Test 5: Performance verification (<2s additional time)
- Test 6: Transactions and rollbacks
- Test 7: Multiple concurrent documents
- Test 8: AI scanner disabled via settings
- All tests use mocks to verify integration without requiring actual ML models
- Tests follow existing patterns in test_consumer.py
- Update BITACORA_MAESTRA.md with session details per agents.md requirements

Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 13:14:28 +00:00
copilot-swe-agent[bot]
d31bdaaab8 Add comprehensive unit tests for AI deletion manager and DeletionRequest model
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 13:10:14 +00:00
copilot-swe-agent[bot]
2d7345f0bc Initial exploration: AI Scanner linting and pre-commit hooks
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 13:09:03 +00:00
copilot-swe-agent[bot]
2933cb27dc Initial plan 2025-11-12 13:05:47 +00:00
copilot-swe-agent[bot]
496a9e7b7b Initial plan 2025-11-12 13:05:45 +00:00
copilot-swe-agent[bot]
a31305b330 Initial plan 2025-11-12 13:01:31 +00:00
dawnsystem
911f16fa41
Merge pull request #38 from dawnsystem/copilot/create-unit-tests-ai-scanner
Tests Unitarios para AI Scanner - 91 comprehensive tests with >90% coverage
2025-11-12 12:41:43 +01:00
copilot-swe-agent[bot]
2f36ac7a7b Fix code review issues: remove unused imports and variables
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 11:23:54 +00:00
copilot-swe-agent[bot]
f63c7faa92 Add comprehensive unit and integration tests for AI Scanner
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-12 10:05:58 +00:00
copilot-swe-agent[bot]
31d8fdc0d1 Initial plan 2025-11-12 09:58:50 +00:00
dawnsystem
e88ecfe17c
Merge pull request #5 from dawnsystem/copilot/add-ai-document-scanning
feat(ai): Comprehensive AI document scanner with automatic metadata management and improvement roadmap
2025-11-11 15:53:28 +01:00
copilot-swe-agent[bot]
b90172e620 feat: Add complete script to create all 35 AI Scanner GitHub issues
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 14:47:28 +00:00
copilot-swe-agent[bot]
fd7924233e docs: Add executive roadmap summary for AI Scanner improvements
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 14:43:47 +00:00
copilot-swe-agent[bot]
3b32ed6803 docs: Add comprehensive improvement plan and GitHub issues templates for AI Scanner
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 14:42:09 +00:00
copilot-swe-agent[bot]
9c41991c11 docs: Add comprehensive AI Scanner implementation documentation
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 14:07:30 +00:00
copilot-swe-agent[bot]
3e8fd1773d docs: Update BITACORA_MAESTRA with AI Scanner implementation details
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 14:04:53 +00:00
copilot-swe-agent[bot]
514af30306 feat(ai): Add deletion protection with user approval workflow
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 14:02:20 +00:00
copilot-swe-agent[bot]
089cd1fecf feat(ai): Add comprehensive AI document scanner for automatic metadata management
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-11 13:58:32 +00:00
copilot-swe-agent[bot]
2c72f4c8ab Initial plan 2025-11-11 13:49:40 +00:00
dawnsystem
9f4b9020c9
Merge pull request #4 from dawnsystem/copilot/activate-issues-in-fork
[WIP] Activate issues for personal project fork
2025-11-10 16:01:33 +01:00
copilot-swe-agent[bot]
edb56e4638 Enable issues and configure repository as standalone project
Co-authored-by: dawnsystem <42047891+dawnsystem@users.noreply.github.com>
2025-11-10 14:59:15 +00:00
copilot-swe-agent[bot]
f91c0521ff Initial plan 2025-11-10 14:55:09 +00:00
dawnsystem
156c4ae8da docs(BITACORA_MAESTRA): update next steps and session log for Docker validation
- Revised the next planned micro-step to include coordination for security review after resetting credentials.
- Added a new session log entry detailing the action of resetting the `dawnsystem` user password and its persistence in the Docker database.
- Enhanced clarity on the current state of the Docker environment and ongoing tasks for IntelliDocs validation.

This update improves documentation accuracy and provides a clearer path forward for the project.
2025-11-10 14:08:11 +01:00