{(selectedFull?.scope as string) || selected.summary}
- {selectedFull?.penalties && ( + {Boolean(selectedFull?.penalties) && (- ⚠ {selectedFull.penalties as string} + ⚠ {selectedFull?.penalties as string}
)}{String(s.summary)}
} + {Boolean(s.summary) &&{String(s.summary)}
} )); })()} diff --git a/pyproject.toml b/pyproject.toml index c518e0c..2a9e78e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,8 @@ dependencies = [ "httpx>=0.24.0", "beautifulsoup4>=4.12.0", "lxml>=5.0.0", + "trafilatura>=2.0.0", + "diff-match-patch>=20241021", "alibabacloud-docmind-api20220711>=1.0.6", "alibabacloud-tea-openapi>=0.3.11", "alibabacloud-tea-util>=0.3.13", diff --git a/tests/test_celery_tasks.py b/tests/test_celery_tasks.py index 9498939..804e62a 100644 --- a/tests/test_celery_tasks.py +++ b/tests/test_celery_tasks.py @@ -33,6 +33,20 @@ def test_process_document_task_is_registered(): ) +def test_crawl_regulations_task_is_registered(): + """crawl_regulations_task must be discoverable in the Celery task registry. + + This is the scheduled counterpart to the manual "Refresh" button — Beat + has nothing to run on its interval unless this task is registered. + """ + import app.infrastructure.tasks.perception_tasks # noqa: F401 — triggers task registration + from app.infrastructure.tasks.celery_app import celery_app + registered = list(celery_app.tasks.keys()) + assert any("crawl_regulations_task" in name for name in registered), ( + f"crawl_regulations_task not found in {registered}" + ) + + def test_document_command_service_has_process_document(): """DocumentCommandService must expose _process_document method.""" from app.application.documents.services import DocumentCommandService