lx-annotate 1.2.3__tar.gz → 1.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (345) hide show
  1. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/PKG-INFO +4 -3
  2. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/__init__.py +2 -0
  3. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/admin.py +2 -0
  4. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/api_urls.py +15 -0
  5. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/apps.py +1 -1
  6. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/asgi.py +2 -1
  7. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/checks.py +7 -1
  8. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/dtypes_api_urls.py +2 -1
  9. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_audit.py +0 -1
  10. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_jobs.py +2 -1
  11. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_state.py +25 -4
  12. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/dispatch_hub_export_recovery.py +0 -1
  13. lx_annotate-1.2.5/lx_annotate/management/commands/monitoring_status.py +32 -0
  14. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/start_filewatcher.py +2 -0
  15. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/middleware/__init__.py +2 -0
  16. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/middleware/lookup_tracker.py +0 -1
  17. lx_annotate-1.2.5/lx_annotate/monitoring/__init__.py +1 -0
  18. lx_annotate-1.2.5/lx_annotate/monitoring/configuration.py +31 -0
  19. lx_annotate-1.2.5/lx_annotate/monitoring/contracts.py +98 -0
  20. lx_annotate-1.2.5/lx_annotate/monitoring/database.py +222 -0
  21. lx_annotate-1.2.5/lx_annotate/monitoring/runtime.py +179 -0
  22. lx_annotate-1.2.5/lx_annotate/monitoring/service.py +348 -0
  23. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/permissions.py +14 -0
  24. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/serializers.py +3 -0
  25. lx_annotate-1.2.5/lx_annotate/services/report_llm.py +358 -0
  26. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/config.py +3 -2
  27. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/secret_key.py +2 -0
  28. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/settings_base.py +12 -0
  29. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/settings_dev.py +1 -0
  30. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/settings_test.py +4 -2
  31. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/urls.py +2 -0
  32. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/anonymization_overview.py +11 -0
  33. lx_annotate-1.2.5/lx_annotate/views/monitoring.py +25 -0
  34. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/quarantine.py +4 -5
  35. lx_annotate-1.2.5/lx_annotate/views/report_llm.py +104 -0
  36. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/wsgi.py +2 -0
  37. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/pyproject.toml +4 -3
  38. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/.vite/manifest.json +35 -2
  39. lx_annotate-1.2.5/staticfiles/AdministrationPage.css +1 -0
  40. lx_annotate-1.2.5/staticfiles/AdministrationPage.js +1 -0
  41. lx_annotate-1.2.5/staticfiles/AiDatasetBucketsPage.js +1 -0
  42. lx_annotate-1.2.5/staticfiles/AiDatasetSettingsPage.js +1 -0
  43. lx_annotate-1.2.5/staticfiles/AnnotationDashboard.css +1 -0
  44. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnnotationDashboard.js +1 -1
  45. lx_annotate-1.2.5/staticfiles/AnnotationDashboard2.js +1 -0
  46. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnonymizationCorrectionComponent.js +1 -1
  47. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnonymizationEvaluation.js +1 -1
  48. lx_annotate-1.2.5/staticfiles/AnonymizationMetrics.js +1 -0
  49. lx_annotate-1.2.5/staticfiles/AnonymizationOverview.css +1 -0
  50. lx_annotate-1.2.5/staticfiles/AnonymizationOverview.js +1 -0
  51. lx_annotate-1.2.5/staticfiles/AnonymizationValidationComponent.css +1 -0
  52. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnonymizationValidationComponent.js +1 -1
  53. lx_annotate-1.2.5/staticfiles/ApplicationSettingsPage.js +1 -0
  54. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/CaseResolutionPage.js +1 -1
  55. lx_annotate-1.2.5/staticfiles/CaseSetupPage.css +1 -0
  56. lx_annotate-1.2.5/staticfiles/CaseSetupPage.js +1 -0
  57. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Dashboard.js +1 -1
  58. lx_annotate-1.2.5/staticfiles/Export.js +1 -0
  59. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/FinalizedResultPage.js +1 -1
  60. lx_annotate-1.2.5/staticfiles/FindingsCapturePage.js +1 -0
  61. lx_annotate-1.2.5/staticfiles/FrameAnnotation.css +1 -0
  62. lx_annotate-1.2.5/staticfiles/FrameAnnotation.js +1 -0
  63. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/FrameSelectorPage.js +1 -1
  64. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/HubExport.js +1 -1
  65. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ModelTrainingPage.js +2 -2
  66. lx_annotate-1.2.5/staticfiles/MonitoringPage.css +1 -0
  67. lx_annotate-1.2.5/staticfiles/MonitoringPage.js +1 -0
  68. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PageOverview.js +1 -1
  69. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PatientDocumentsPage.js +1 -1
  70. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PatientMedicationPage.js +1 -1
  71. lx_annotate-1.2.5/staticfiles/PatientOverview.js +1 -0
  72. lx_annotate-1.2.5/staticfiles/ReportEditorPage.css +1 -0
  73. lx_annotate-1.2.5/staticfiles/ReportEditorPage.js +6 -0
  74. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ReportExportPage.css +1 -1
  75. lx_annotate-1.2.5/staticfiles/ReportExportPage.js +3 -0
  76. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ReportTemplateBuilderPage.js +1 -1
  77. lx_annotate-1.2.5/staticfiles/ReportingShell.css +1 -0
  78. lx_annotate-1.2.5/staticfiles/ReportingShell.js +1 -0
  79. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ReportingWorklistPage.js +1 -1
  80. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/StudyCohortPage.js +1 -1
  81. lx_annotate-1.2.5/staticfiles/Timeline.css +1 -0
  82. lx_annotate-1.2.5/staticfiles/Timeline.js +2 -0
  83. lx_annotate-1.2.5/staticfiles/VideoExamination.css +1 -0
  84. lx_annotate-1.2.5/staticfiles/VideoExamination.js +1 -0
  85. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/administrationApi.js +1 -1
  86. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/aiDatasetApi.js +1 -1
  87. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/applicationSettingsApi.js +1 -1
  88. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/casesApi.js +1 -1
  89. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/SETUP_GUIDE.html +1 -1
  90. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/documentation_options.js +1 -1
  91. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/api/index.html +2 -2
  92. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/genindex.html +32 -2
  93. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/ai-training-data-export.html +1 -1
  94. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/anonymization-validation-correction-workflow.html +1 -1
  95. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/asset-deployment.html +1 -1
  96. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/core-concept-contract.html +1 -1
  97. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/core-concept-readiness-verdict.html +1 -1
  98. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/core-concept-type-matrix.html +1 -1
  99. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/deployment-strategy.html +1 -1
  100. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/dtypes-findings-migration.html +1 -1
  101. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/encrypted-model-weights-inference.html +1 -1
  102. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/encrypted-storage-process.html +1 -1
  103. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/frame-annotation-availability.html +1 -1
  104. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/general-documentation.html +1 -1
  105. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/hub-export-workflow.html +1 -1
  106. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/hub-storage-load-balancing.html +1 -1
  107. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/openapi-type-generation.html +1 -1
  108. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/pypi.html +1 -1
  109. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/reporting-shell-aaa-testing.html +1 -1
  110. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/reporting-template-requirements-page.html +1 -1
  111. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/runtime-environment-contract-test.html +1 -1
  112. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/secure-backup-disaster-recovery.html +1 -1
  113. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/segment-annotation-workflow.html +1 -1
  114. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/terminology-delivery.html +1 -1
  115. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/guides/wheel-deployment.html +1 -1
  116. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/index.html +1 -1
  117. lx_annotate-1.2.5/staticfiles/docs/objects.inv +0 -0
  118. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/py-modindex.html +1 -1
  119. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/search.html +1 -1
  120. lx_annotate-1.2.5/staticfiles/docs/searchindex.js +1 -0
  121. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/examinationStore.js +1 -1
  122. lx_annotate-1.2.5/staticfiles/frameStreams.js +1 -0
  123. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/knowledgeBaseGraphApi.js +1 -1
  124. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/main.css +1 -1
  125. lx_annotate-1.2.5/staticfiles/main.js +39 -0
  126. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/mediaTypeStore.js +1 -1
  127. lx_annotate-1.2.5/staticfiles/mediaUrls.js +1 -0
  128. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/patientExaminationStore.js +1 -1
  129. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/patientService.js +1 -1
  130. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/patientStore.js +1 -1
  131. lx_annotate-1.2.5/staticfiles/reportExportApi.js +1 -0
  132. lx_annotate-1.2.5/staticfiles/reportingPresentation.js +1 -0
  133. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/reportingTimelineApi.js +1 -1
  134. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/studyApi.js +1 -1
  135. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/studyCohortExportStore.js +1 -1
  136. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/terminologyStore.js +1 -1
  137. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/timeHelpers.js +1 -1
  138. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/useAuthenticatedVideoStream.js +1 -1
  139. lx_annotate-1.2.5/staticfiles/useDebug.js +1 -0
  140. lx_annotate-1.2.5/staticfiles/useFindingSelectors.js +1 -0
  141. lx_annotate-1.2.5/staticfiles/useReportTemplates.js +1 -0
  142. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/useReportingKnowledgeBase.js +1 -1
  143. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/uv.lock +22 -341
  144. lx_annotate-1.2.3/staticfiles/AdministrationPage.css +0 -1
  145. lx_annotate-1.2.3/staticfiles/AdministrationPage.js +0 -1
  146. lx_annotate-1.2.3/staticfiles/AiDatasetBucketsPage.js +0 -1
  147. lx_annotate-1.2.3/staticfiles/AiDatasetSettingsPage.js +0 -1
  148. lx_annotate-1.2.3/staticfiles/AnnotationDashboard.css +0 -1
  149. lx_annotate-1.2.3/staticfiles/AnnotationDashboard2.js +0 -1
  150. lx_annotate-1.2.3/staticfiles/AnonymizationMetrics.js +0 -1
  151. lx_annotate-1.2.3/staticfiles/AnonymizationOverview.css +0 -1
  152. lx_annotate-1.2.3/staticfiles/AnonymizationOverview.js +0 -1
  153. lx_annotate-1.2.3/staticfiles/AnonymizationValidationComponent.css +0 -1
  154. lx_annotate-1.2.3/staticfiles/ApplicationSettingsPage.js +0 -1
  155. lx_annotate-1.2.3/staticfiles/CaseSetupPage.css +0 -1
  156. lx_annotate-1.2.3/staticfiles/CaseSetupPage.js +0 -1
  157. lx_annotate-1.2.3/staticfiles/Export.js +0 -1
  158. lx_annotate-1.2.3/staticfiles/FindingsCapturePage.js +0 -1
  159. lx_annotate-1.2.3/staticfiles/FrameAnnotation.css +0 -1
  160. lx_annotate-1.2.3/staticfiles/FrameAnnotation.js +0 -1
  161. lx_annotate-1.2.3/staticfiles/PatientOverview.js +0 -1
  162. lx_annotate-1.2.3/staticfiles/ReportEditorPage.css +0 -1
  163. lx_annotate-1.2.3/staticfiles/ReportEditorPage.js +0 -4
  164. lx_annotate-1.2.3/staticfiles/ReportExportPage.js +0 -3
  165. lx_annotate-1.2.3/staticfiles/ReportingShell.css +0 -1
  166. lx_annotate-1.2.3/staticfiles/ReportingShell.js +0 -1
  167. lx_annotate-1.2.3/staticfiles/Timeline.css +0 -1
  168. lx_annotate-1.2.3/staticfiles/Timeline.js +0 -2
  169. lx_annotate-1.2.3/staticfiles/VideoExamination.css +0 -1
  170. lx_annotate-1.2.3/staticfiles/VideoExamination.js +0 -1
  171. lx_annotate-1.2.3/staticfiles/docs/objects.inv +0 -0
  172. lx_annotate-1.2.3/staticfiles/docs/searchindex.js +0 -1
  173. lx_annotate-1.2.3/staticfiles/main.js +0 -39
  174. lx_annotate-1.2.3/staticfiles/mediaUrls.js +0 -1
  175. lx_annotate-1.2.3/staticfiles/reportingPresentation.js +0 -1
  176. lx_annotate-1.2.3/staticfiles/useDebug.js +0 -1
  177. lx_annotate-1.2.3/staticfiles/useFindingSelectors.js +0 -1
  178. lx_annotate-1.2.3/staticfiles/useReportTemplates.js +0 -1
  179. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/.gitignore +0 -0
  180. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/LICENSE +0 -0
  181. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/README.md +0 -0
  182. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/celery.py +0 -0
  183. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/cli.py +0 -0
  184. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/file_watcher.py +15 -15
  185. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/__init__.py +0 -0
  186. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_cleanup.py +0 -0
  187. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_contracts.py +0 -0
  188. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_envelope.py +0 -0
  189. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_health.py +1 -1
  190. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_payloads.py +0 -0
  191. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_reconciliation.py +0 -0
  192. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/hub_export_worker.py +0 -0
  193. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/node_provisioning.py +0 -0
  194. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_balance_worker.py +0 -0
  195. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_ingest.py +0 -0
  196. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_orchestration.py +0 -0
  197. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_provider.py +0 -0
  198. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_publication.py +0 -0
  199. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_reconciliation.py +0 -0
  200. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_recovery.py +0 -0
  201. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_rekey.py +0 -0
  202. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_report_provider.py +0 -0
  203. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_resolver.py +0 -0
  204. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_telemetry.py +0 -0
  205. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/storage_transfer_client.py +0 -0
  206. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/hub/transfer_transport.py +0 -0
  207. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/__init__.py +0 -0
  208. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/__init__.py +0 -0
  209. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/check_hub_export_health.py +0 -0
  210. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/check_migration_compatibility.py +0 -0
  211. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/export_openapi.py +0 -0
  212. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/export_route_manifest.py +0 -0
  213. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/provision_hub_nodes.py +0 -0
  214. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/reap_verified_hub_exports.py +0 -0
  215. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/recover_runtime_data.py +0 -0
  216. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/repair_legacy_migration_history.py +0 -0
  217. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/repair_managed_payloads.py +0 -0
  218. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/run_filewatcher.py +0 -0
  219. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/runtime_acceptance.py +0 -0
  220. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/management/commands/verify_encrypted_storage.py +0 -0
  221. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migration_history_safety.py +0 -0
  222. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0001_outboundhubtransferjob.py +0 -0
  223. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0002_outboundhubtransferjob_local_cleanup_fields.py +0 -0
  224. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0003_outboundhubtransferjob_failure_class.py +0 -0
  225. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0004_storagenodeactionreceipt.py +0 -0
  226. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0005_storageoperatordispatchreceipt.py +0 -0
  227. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0006_storageartifactpublication.py +0 -0
  228. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/0007_outbound_hub_receipt_cleanup.py +0 -0
  229. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/__init__.py +0 -0
  230. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/migrations/max_migration.txt +0 -0
  231. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/models.py +0 -0
  232. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/operational_support.py +0 -0
  233. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/runtime_commands/__init__.py +0 -0
  234. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/services/__init__.py +0 -0
  235. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/services/access_management.py +2 -2
  236. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/services/runtime_recovery.py +0 -0
  237. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/__init__.py +0 -0
  238. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/oidc.py +0 -0
  239. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/settings/settings_prod.py +0 -0
  240. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/signals.py +0 -0
  241. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/storage/__init__.py +0 -0
  242. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/storage/encrypted.py +0 -0
  243. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/storage/encryption.py +0 -0
  244. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/tasks.py +0 -0
  245. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/templates/base.html +0 -0
  246. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/__init__.py +0 -0
  247. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/administration.py +0 -0
  248. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/application_settings.py +0 -0
  249. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/frame_annotation.py +0 -0
  250. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/hub_export.py +0 -0
  251. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/study_export.py +0 -0
  252. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/lx_annotate/views/video_state_repair.py +0 -0
  253. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/manage.py +0 -0
  254. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AboutUs.js +0 -0
  255. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AiDatasetBucketsPage.css +0 -0
  256. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AiDatasetSettingsPage.css +0 -0
  257. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnonymizationCorrectionComponent.css +0 -0
  258. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnonymizationEvaluation.css +0 -0
  259. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/AnonymizationMetrics.css +0 -0
  260. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ApplicationSettingsPage.css +0 -0
  261. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ColoReg.png +0 -0
  262. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Comfortaa-Bold.ttf +0 -0
  263. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Comfortaa-Regular.ttf +0 -0
  264. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Documentation.css +0 -0
  265. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Documentation.js +0 -0
  266. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Export.css +0 -0
  267. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/FindingsCapturePage.css +0 -0
  268. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/FrameSelectorPage.css +0 -0
  269. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/HubExport.css +0 -0
  270. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ModelTrainingPage.css +0 -0
  271. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PageOverview.css +0 -0
  272. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PatientDocumentsPage.css +0 -0
  273. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PatientMedicationPage.css +0 -0
  274. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/PatientOverview.css +0 -0
  275. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/Profile.js +0 -0
  276. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/ReportTemplateBuilderPage.css +0 -0
  277. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/StudyCohortPage.css +0 -0
  278. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/annotationPrincipal.js +0 -0
  279. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/dateHelpers.js +0 -0
  280. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/.buildinfo +0 -0
  281. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/SETUP_GUIDE.md.txt +0 -0
  282. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/api/index.md.txt +0 -0
  283. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/ai-training-data-export.md.txt +0 -0
  284. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/anonymization-validation-correction-workflow.md.txt +0 -0
  285. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/asset-deployment.md.txt +0 -0
  286. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/core-concept-contract.md.txt +0 -0
  287. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/core-concept-readiness-verdict.md.txt +0 -0
  288. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/core-concept-type-matrix.md.txt +0 -0
  289. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/deployment-strategy.md.txt +0 -0
  290. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/dtypes-findings-migration.md.txt +0 -0
  291. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/encrypted-model-weights-inference.md.txt +0 -0
  292. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/encrypted-storage-process.md.txt +0 -0
  293. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/frame-annotation-availability.md.txt +0 -0
  294. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/general-documentation.md.txt +0 -0
  295. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/hub-export-workflow.md.txt +0 -0
  296. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/hub-storage-load-balancing.md.txt +0 -0
  297. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/openapi-type-generation.md.txt +0 -0
  298. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/pypi.md.txt +0 -0
  299. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/reporting-shell-aaa-testing.md.txt +0 -0
  300. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/reporting-template-requirements-page.md.txt +0 -0
  301. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/runtime-environment-contract-test.md.txt +0 -0
  302. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/secure-backup-disaster-recovery.md.txt +0 -0
  303. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/segment-annotation-workflow.md.txt +0 -0
  304. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/terminology-delivery.md.txt +0 -0
  305. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/guides/wheel-deployment.md.txt +0 -0
  306. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_sources/index.md.txt +0 -0
  307. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/basic.css +0 -0
  308. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/check-solid.svg +0 -0
  309. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/clipboard.min.js +0 -0
  310. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/copy-button.svg +0 -0
  311. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/copybutton.css +0 -0
  312. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/copybutton.js +0 -0
  313. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/copybutton_funcs.js +0 -0
  314. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/debug.css +0 -0
  315. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/doctools.js +0 -0
  316. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/file.png +0 -0
  317. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/language_data.js +0 -0
  318. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/minus.png +0 -0
  319. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/plus.png +0 -0
  320. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/pygments.css +0 -0
  321. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/scripts/furo-extensions.js +0 -0
  322. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/scripts/furo.js +0 -0
  323. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/scripts/furo.js.LICENSE.txt +0 -0
  324. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/scripts/furo.js.map +0 -0
  325. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/searchtools.js +0 -0
  326. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/skeleton.css +0 -0
  327. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/sphinx_highlight.js +0 -0
  328. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/styles/furo-extensions.css +0 -0
  329. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/styles/furo-extensions.css.map +0 -0
  330. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/styles/furo.css +0 -0
  331. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/docs/_static/styles/furo.css.map +0 -0
  332. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/img/favicon.png +0 -0
  333. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/nucleo-icons.eot +0 -0
  334. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/nucleo-icons.svg +0 -0
  335. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/nucleo-icons.ttf +0 -0
  336. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/nucleo-icons.woff +0 -0
  337. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/nucleo-icons.woff2 +0 -0
  338. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/pdf.js +0 -0
  339. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/pdf.worker.min.js +0 -0
  340. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/pdf.worker.min.mjs +0 -0
  341. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/reportTemplateLifecycleContext.js +0 -0
  342. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/reportingError.js +0 -0
  343. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/reportingExaminationResolution.js +0 -0
  344. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/reportingIndicationContract.js +0 -0
  345. {lx_annotate-1.2.3 → lx_annotate-1.2.5}/staticfiles/useReportTemplates.css +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lx-annotate
3
- Version: 1.2.3
3
+ Version: 1.2.5
4
4
  Summary: This webapp provides a frontend interface for pseudonymizing and annotating data and applying AI predictions.
5
5
  Author-email: Max Hild <hild_m@ukw.de>, "Thomas J. Lux" <lux_t1@ukw.de>
6
6
  Maintainer: Hamza Zahid
@@ -14,6 +14,7 @@ Classifier: Operating System :: POSIX :: Linux
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
16
16
  Requires-Python: <3.13,>=3.12.0
17
+ Requires-Dist: asgiref>=3.12.1
17
18
  Requires-Dist: celery>=5.5.3
18
19
  Requires-Dist: cryptography>=45.0.0
19
20
  Requires-Dist: daphne>=4.2.1
@@ -28,9 +29,9 @@ Requires-Dist: django-webpack-loader>=0.7.0
28
29
  Requires-Dist: django==6.0.3
29
30
  Requires-Dist: djangorestframework>=3.12.4
30
31
  Requires-Dist: drf-spectacular>=0.28.0
31
- Requires-Dist: endoreg-db==1.2.0
32
+ Requires-Dist: endoreg-db==1.2.7
32
33
  Requires-Dist: gunicorn>=23.0.0
33
- Requires-Dist: lx-dtypes==0.2.37
34
+ Requires-Dist: lx-dtypes==0.3.2
34
35
  Requires-Dist: mozilla-django-oidc>=4.0.1
35
36
  Requires-Dist: numpy>=1.21.0
36
37
  Requires-Dist: pillow>=9.0.0
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from .celery import app as celery_app
2
4
 
3
5
  __all__ = ["celery_app"]
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from django.contrib import admin
2
4
 
3
5
  from .models import OutboundHubTransferJob
@@ -14,6 +14,7 @@ from lx_annotate.views.administration import (
14
14
  )
15
15
  from lx_annotate.views.anonymization_overview import (
16
16
  LifecycleAnonymizationOverviewView,
17
+ LifecycleUploadJobDismissView,
17
18
  LifecycleUploadJobRetryView,
18
19
  )
19
20
  from lx_annotate.views.application_settings import primary_annotation_settings_detail
@@ -25,11 +26,25 @@ from lx_annotate.views.hub_export import (
25
26
  hub_export_retry,
26
27
  hub_export_unmark,
27
28
  )
29
+ from lx_annotate.views.monitoring import monitoring_snapshot
28
30
  from lx_annotate.views.quarantine import quarantine_overview
31
+ from lx_annotate.views.report_llm import report_llm_generate, report_llm_status
29
32
  from lx_annotate.views.study_export import study_export_options, study_export_xlsx
30
33
  from lx_annotate.views.video_state_repair import VideoStateRepairView
31
34
 
32
35
  urlpatterns = [
36
+ path(
37
+ "administration/monitoring/",
38
+ monitoring_snapshot,
39
+ name="administration-monitoring",
40
+ ),
41
+ path("reporting/llm/status/", report_llm_status, name="report-llm-status"),
42
+ path("reporting/llm/generate/", report_llm_generate, name="report-llm-generate"),
43
+ path(
44
+ "anonymization/upload-jobs/<uuid:job_id>/dismiss/",
45
+ LifecycleUploadJobDismissView.as_view(),
46
+ name="anonymization_upload_job_dismiss",
47
+ ),
33
48
  path(
34
49
  "anonymization/items/overview/",
35
50
  LifecycleAnonymizationOverviewView.as_view(),
@@ -56,7 +56,7 @@ class LxAnnotateConfig(AppConfig):
56
56
  from . import (
57
57
  checks,
58
58
  signals, # noqa: F401
59
- )
59
+ ) # type: ignore
60
60
 
61
61
  command = sys.argv[1] if len(sys.argv) > 1 else ""
62
62
  if not self._should_skip_runtime_checks(command):
@@ -1,10 +1,11 @@
1
1
  """ASGI config for lx-annotate."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  import os
4
6
 
5
7
  from django.core.asgi import get_asgi_application
6
8
 
7
-
8
9
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lx_annotate.settings.settings_prod")
9
10
 
10
11
  application = get_asgi_application()
@@ -531,12 +531,18 @@ def _knowledge_base_registry_messages() -> list[CheckMessage]:
531
531
  return []
532
532
 
533
533
 
534
- def lx_annotate_environment_checks(app_configs, **kwargs): # type: ignore[unused-argument]
534
+ def runtime_configuration_messages() -> list[CheckMessage]:
535
+ """Collect configuration checks shared by startup and runtime monitoring."""
535
536
  messages: list[CheckMessage] = []
536
537
  messages.extend(_native_capability_messages())
537
538
  messages.extend(_environment_readiness_messages())
538
539
  messages.extend(_protected_media_url_messages())
539
540
  messages.extend(_protected_media_root_messages())
541
+ return messages
542
+
543
+
544
+ def lx_annotate_environment_checks(app_configs, **kwargs): # type: ignore[unused-argument]
545
+ messages = runtime_configuration_messages()
540
546
  messages.extend(_host_models_module_messages())
541
547
  messages.extend(_knowledge_base_registry_messages())
542
548
 
@@ -1,4 +1,5 @@
1
- from lx_dtypes.django.api.main import api as lx_dtypes_api
1
+ from __future__ import annotations
2
2
 
3
+ from lx_dtypes.django.api.main import api as lx_dtypes_api
3
4
 
4
5
  urlpatterns, app_name, namespace = lx_dtypes_api.urls
@@ -6,7 +6,6 @@ from typing import Any
6
6
 
7
7
  from endoreg_db.utils.structured_logging import emit_structured_event
8
8
 
9
-
10
9
  logger = logging.getLogger("lx_annotate.hub_export.audit")
11
10
 
12
11
 
@@ -1027,6 +1027,7 @@ def _validate_failed_job_for_operator_retry(
1027
1027
  elif job.resource_kind == OutboundHubTransferJob.ResourceKind.REPORT:
1028
1028
  if job.raw_pdf_file_id is None or not is_report_hub_export_eligible(
1029
1029
  job.raw_pdf_file,
1030
+ verify_processed_media=True,
1030
1031
  ):
1031
1032
  raise ValueError(
1032
1033
  "The failed report transfer is no longer eligible for hub export.",
@@ -1171,7 +1172,7 @@ def _mark_report_for_hub_upload(
1171
1172
  marked_by: Any,
1172
1173
  ) -> tuple[OutboundHubTransferJob, bool]:
1173
1174
  report = RawPdfFile.objects.select_related("center").get(pk=resource_id)
1174
- if not is_report_hub_export_eligible(report):
1175
+ if not is_report_hub_export_eligible(report, verify_processed_media=True):
1175
1176
  raise ValueError(f"Report {resource_id} is not eligible for hub export.")
1176
1177
  return OutboundHubTransferJob.objects.get_or_create(
1177
1178
  raw_pdf_file=report,
@@ -276,22 +276,43 @@ def is_video_hub_export_eligible(video: VideoFile) -> bool:
276
276
  return resolve_video_hub_export_state(video).transfer_eligible
277
277
 
278
278
 
279
- def report_hub_export_blocked_reason(report: RawPdfFile) -> str:
279
+ def report_hub_export_blocked_reason(
280
+ report: RawPdfFile,
281
+ *,
282
+ verify_processed_media: bool = False,
283
+ ) -> str:
280
284
  if report.center is None:
281
285
  return "source center missing"
282
286
  state = report.state
283
- if state is None or not state.anonymization_validated:
287
+ if state is None or state.anonymization_status != AnonymizationState.VALIDATED:
284
288
  return "not ready for export"
285
289
  processed_file_sha256 = getattr(state, "processed_file_sha256", None)
286
290
  if processed_file_sha256 is not None and not str(processed_file_sha256).strip():
287
291
  return "processed media missing"
288
292
  if not has_usable_processed_artifact(report):
289
293
  return "processed media missing"
294
+ if verify_processed_media:
295
+ try:
296
+ actual_digest = sha256_file(report.processed_file)
297
+ except (OSError, TypeError, ValueError):
298
+ return "processed media unreadable"
299
+ if actual_digest != processed_file_sha256:
300
+ return "processed media hash mismatch"
290
301
  return ""
291
302
 
292
303
 
293
- def is_report_hub_export_eligible(report: RawPdfFile) -> bool:
294
- return report_hub_export_blocked_reason(report) == ""
304
+ def is_report_hub_export_eligible(
305
+ report: RawPdfFile,
306
+ *,
307
+ verify_processed_media: bool = False,
308
+ ) -> bool:
309
+ return (
310
+ report_hub_export_blocked_reason(
311
+ report,
312
+ verify_processed_media=verify_processed_media,
313
+ )
314
+ == ""
315
+ )
295
316
 
296
317
 
297
318
  def _sync_outbound_jobs(
@@ -3,7 +3,6 @@ from __future__ import annotations
3
3
  from argparse import ArgumentParser
4
4
 
5
5
  from django.core.management.base import BaseCommand, CommandError
6
-
7
6
  from endoreg_db.models import NetworkNode
8
7
 
9
8
 
@@ -0,0 +1,32 @@
1
+ from __future__ import annotations
2
+
3
+ from django.core.management.base import BaseCommand, CommandError, CommandParser
4
+
5
+ from lx_annotate.monitoring.service import build_monitoring_snapshot
6
+
7
+
8
+ class Command(BaseCommand):
9
+ help = "Read-only runtime monitoring (exit 0 healthy, 1 warning, 2 error)."
10
+ requires_system_checks = [] # type: ignore[assignment]
11
+
12
+ def add_arguments(self, parser: CommandParser) -> None:
13
+ parser.add_argument("--format", choices=["json", "text"], default="json")
14
+
15
+ def handle(self, *args: object, **options: object) -> None:
16
+ del args
17
+ snapshot = build_monitoring_snapshot()
18
+ if options["format"] == "json":
19
+ self.stdout.write(snapshot.model_dump_json())
20
+ else:
21
+ self.stdout.write(
22
+ f"{snapshot.status.upper()} version={snapshot.version or 'unknown'} observed_at={snapshot.observed_at.isoformat()}"
23
+ )
24
+ for check in snapshot.checks:
25
+ self.stdout.write(
26
+ f"{check.status.upper()} {check.key}: {check.summary}"
27
+ )
28
+ if snapshot.status != "ok":
29
+ raise CommandError(
30
+ "Runtime monitoring reported an unhealthy state.",
31
+ returncode=2 if snapshot.status == "error" else 1,
32
+ )
@@ -1,3 +1,5 @@
1
1
  """Compatibility alias for the canonical ``run_filewatcher`` command."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from .run_filewatcher import Command # noqa: F401
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import re
2
4
 
3
5
  PDF_STREAM_PATH_RE = re.compile(r"^/api/media/pdfs/\d+/stream/?$")
@@ -13,7 +13,6 @@ from typing import Any
13
13
  from django.conf import settings
14
14
  from django.http import HttpRequest, HttpResponse
15
15
  from django.utils.deprecation import MiddlewareMixin
16
-
17
16
  from endoreg_db.utils.file_operations import (
18
17
  advisory_file_lock,
19
18
  atomic_write_file,
@@ -0,0 +1 @@
1
+ """Read-only administrator diagnostics; API and command share one snapshot."""
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+
5
+ from django.conf import settings
6
+
7
+ from .contracts import MonitoringConfiguration, StorageLocation
8
+
9
+ MAX_CONFIGURATION_BYTES = 65536
10
+
11
+
12
+ def load_configuration() -> tuple[MonitoringConfiguration, bool]:
13
+ """Only deployment-owned configuration; request parameters never enter here."""
14
+ configured = str(
15
+ getattr(settings, "LX_ANNOTATE_MONITORING_CONFIG_FILE", "")
16
+ ).strip()
17
+ if configured:
18
+ with Path(configured).open("rb") as stream:
19
+ content = stream.read(MAX_CONFIGURATION_BYTES + 1)
20
+ if len(content) > MAX_CONFIGURATION_BYTES:
21
+ raise ValueError("Monitoring configuration exceeds its size limit")
22
+ return MonitoringConfiguration.model_validate_json(content), True
23
+ return MonitoringConfiguration(
24
+ storage=[
25
+ StorageLocation(key="protected_data", path=Path(settings.APP_DATA_DIR)),
26
+ StorageLocation(key="media", path=Path(settings.PROTECTED_MEDIA_ROOT)),
27
+ StorageLocation(
28
+ key="terminology", path=Path(settings.LX_DTYPES_TERMINOLOGY_IMPORT_ROOT)
29
+ ),
30
+ ]
31
+ ), False
@@ -0,0 +1,98 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import datetime
4
+ from pathlib import Path
5
+ from typing import Annotated, Literal, Self
6
+
7
+ from pydantic import BaseModel, ConfigDict, Field, JsonValue, model_validator
8
+
9
+ CheckStatus = Literal["ok", "warning", "error", "unknown"]
10
+ SnapshotStatus = Literal["ok", "warning", "error"]
11
+ SafeKey = Annotated[str, Field(pattern=r"^[a-z][a-z0-9_.-]{0,63}$")]
12
+
13
+
14
+ class MonitoringCheck(BaseModel):
15
+ model_config = ConfigDict(extra="forbid", frozen=True)
16
+ key: str = Field(pattern=r"^[a-z][a-z0-9_.-]{0,95}$")
17
+ status: CheckStatus
18
+ summary: str
19
+ detail: str | None = None
20
+ observed_at: datetime
21
+ metadata: dict[str, JsonValue] = Field(default_factory=dict)
22
+
23
+
24
+ def aggregate_status(checks: list[MonitoringCheck]) -> SnapshotStatus:
25
+ if any(check.status == "error" for check in checks):
26
+ return "error"
27
+ if not checks or any(check.status in {"warning", "unknown"} for check in checks):
28
+ return "warning"
29
+ return "ok"
30
+
31
+
32
+ class MonitoringSnapshot(BaseModel):
33
+ model_config = ConfigDict(extra="forbid", frozen=True)
34
+ schema_version: Literal[1] = 1
35
+ status: SnapshotStatus
36
+ observed_at: datetime
37
+ version: str | None
38
+ checks: list[MonitoringCheck]
39
+
40
+ @model_validator(mode="after")
41
+ def consistent_status(self) -> Self:
42
+ if self.status != aggregate_status(self.checks):
43
+ raise ValueError("Snapshot status must match its checks")
44
+ if len({check.key for check in self.checks}) != len(self.checks):
45
+ raise ValueError("Check keys must be unique")
46
+ return self
47
+
48
+
49
+ class StorageLocation(BaseModel):
50
+ model_config = ConfigDict(extra="forbid", frozen=True)
51
+ key: SafeKey
52
+ path: Path
53
+ required: bool = True
54
+ writable: bool = True
55
+
56
+ @model_validator(mode="after")
57
+ def absolute_path(self) -> Self:
58
+ if not self.path.is_absolute():
59
+ raise ValueError("Storage locations must be absolute")
60
+ return self
61
+
62
+
63
+ class ServiceExpectation(BaseModel):
64
+ model_config = ConfigDict(extra="forbid", frozen=True)
65
+ key: SafeKey
66
+ unit: str = Field(
67
+ pattern=r"^[A-Za-z0-9][A-Za-z0-9_.@:-]*\.(service|timer|socket|path)$",
68
+ max_length=160,
69
+ )
70
+ required: bool = True
71
+ expected_active: bool = True
72
+
73
+
74
+ class MonitoringConfiguration(BaseModel):
75
+ model_config = ConfigDict(extra="forbid", frozen=True)
76
+ schema_version: Literal[1] = 1
77
+ deployment_revision: str | None = Field(
78
+ default=None, pattern=r"^[0-9a-fA-F]{7,64}$"
79
+ )
80
+ services: list[ServiceExpectation] = Field(default_factory=list, max_length=40)
81
+ storage: list[StorageLocation] = Field(default_factory=list, max_length=24)
82
+ disk_warning_free_percent: float = Field(default=10, gt=0, lt=100)
83
+ disk_error_free_percent: float = Field(default=5, ge=0, lt=100)
84
+ pending_warning_seconds: int = Field(default=3600, ge=60, le=604800)
85
+ recent_failure_window_seconds: int = Field(default=86400, ge=60, le=604800)
86
+ systemctl_path: Path | None = None
87
+ systemctl_timeout_seconds: int = Field(default=3, ge=1, le=5)
88
+
89
+ @model_validator(mode="after")
90
+ def validate_invariants(self) -> Self:
91
+ if self.disk_error_free_percent >= self.disk_warning_free_percent:
92
+ raise ValueError("Disk error threshold must be below warning threshold")
93
+ for values in (self.services, self.storage):
94
+ if len({value.key for value in values}) != len(values):
95
+ raise ValueError("Monitoring aliases must be unique")
96
+ if self.systemctl_path is not None and not self.systemctl_path.is_absolute():
97
+ raise ValueError("systemctl executable must be absolute")
98
+ return self
@@ -0,0 +1,222 @@
1
+ from __future__ import annotations
2
+
3
+ from contextlib import contextmanager
4
+ from dataclasses import dataclass
5
+ from datetime import datetime, timedelta
6
+ from typing import Iterator
7
+
8
+ from django.apps import apps
9
+ from django.db import DatabaseError, connections
10
+ from django.db.backends.base.base import BaseDatabaseWrapper
11
+ from django.db.migrations.exceptions import InconsistentMigrationHistory
12
+ from django.db.migrations.executor import MigrationExecutor
13
+ from django.utils import timezone
14
+ from django.utils.dateparse import parse_datetime
15
+
16
+ from lx_annotate.migration_history_safety import (
17
+ MigrationHistorySafetyError,
18
+ check_migration_compatibility,
19
+ )
20
+
21
+ from .contracts import MonitoringCheck, MonitoringConfiguration
22
+
23
+
24
+ @contextmanager
25
+ def diagnostic_connection() -> Iterator[BaseDatabaseWrapper]:
26
+ original = connections["default"]
27
+ if original.vendor == "sqlite":
28
+ # A copied in-memory SQLite connection is a different database.
29
+ yield original
30
+ return
31
+ connection = original.copy()
32
+ if connection.vendor == "postgresql":
33
+ options = dict(connection.settings_dict.get("OPTIONS", {}))
34
+ options["connect_timeout"] = 2
35
+ options["options"] = (
36
+ str(options.get("options", ""))
37
+ + " -c statement_timeout=2000 -c default_transaction_read_only=on"
38
+ )
39
+ connection.settings_dict["OPTIONS"] = options
40
+ try:
41
+ yield connection
42
+ finally:
43
+ connection.close()
44
+
45
+
46
+ def check_connectivity(connection: BaseDatabaseWrapper) -> None:
47
+ with connection.cursor() as cursor:
48
+ cursor.execute("SELECT 1")
49
+ if cursor.fetchone() != (1,):
50
+ raise DatabaseError("Database probe did not return expected result")
51
+
52
+
53
+ def migration_check(connection: BaseDatabaseWrapper, now: datetime) -> MonitoringCheck:
54
+ try:
55
+ plans = check_migration_compatibility(connection)
56
+ executor = MigrationExecutor(connection)
57
+ loader = executor.loader
58
+ loader.check_consistent_history(connection)
59
+ recognized = set(loader.disk_migrations)
60
+ for migration in loader.replacements.values():
61
+ recognized.update(migration.replaces)
62
+ unknown = set(loader.applied_migrations) - recognized
63
+ if unknown or any(
64
+ plan.status not in {"canonical", "empty", "current", "no_history"}
65
+ and plan.additions
66
+ for plan in plans
67
+ ):
68
+ return MonitoringCheck(
69
+ key="database.migrations",
70
+ status="error",
71
+ summary="Recorded migrations are incompatible with installed packages.",
72
+ observed_at=now,
73
+ metadata={
74
+ "reason_code": "unknown_or_legacy_history",
75
+ "unknown_count": len(unknown),
76
+ },
77
+ )
78
+ pending = executor.migration_plan(loader.graph.leaf_nodes())
79
+ return MonitoringCheck(
80
+ key="database.migrations",
81
+ status="warning" if pending else "ok",
82
+ summary="Unapplied migrations require attention."
83
+ if pending
84
+ else "Migration history is consistent and current.",
85
+ observed_at=now,
86
+ metadata={
87
+ "reason_code": "unapplied" if pending else "current",
88
+ "unapplied_count": len(pending),
89
+ },
90
+ )
91
+ except (MigrationHistorySafetyError, InconsistentMigrationHistory):
92
+ return MonitoringCheck(
93
+ key="database.migrations",
94
+ status="error",
95
+ summary="Recorded migrations are incompatible with installed packages.",
96
+ detail="Run check_migration_compatibility and review the installed release before migrating.",
97
+ observed_at=now,
98
+ metadata={"reason_code": "incompatible_history"},
99
+ )
100
+
101
+
102
+ @dataclass(frozen=True)
103
+ class JobSource:
104
+ key: str
105
+ model_name: str
106
+ pending: tuple[str, ...]
107
+ processing: tuple[str, ...]
108
+ failed: tuple[str, ...]
109
+ lease_field: str | None = None
110
+
111
+
112
+ JOB_SOURCES = (
113
+ JobSource(
114
+ "ingestion",
115
+ "UploadJob",
116
+ ("pending", "retrying"),
117
+ ("processing",),
118
+ ("error", "lost"),
119
+ "processing_lease_expires_at",
120
+ ),
121
+ JobSource(
122
+ "hls",
123
+ "VideoHlsArtifact",
124
+ ("queued",),
125
+ ("materializing", "validated"),
126
+ ("failed",),
127
+ ),
128
+ JobSource(
129
+ "video_processing",
130
+ "VideoProcessingHistory",
131
+ ("pending",),
132
+ ("running",),
133
+ ("failure",),
134
+ ),
135
+ JobSource(
136
+ "report_import",
137
+ "ReportImportAttempt",
138
+ ("idle",),
139
+ ("active",),
140
+ ("failed", "lost"),
141
+ "lease_expires_at",
142
+ ),
143
+ )
144
+
145
+
146
+ def processing_check(
147
+ connection: BaseDatabaseWrapper,
148
+ source: JobSource,
149
+ config: MonitoringConfiguration,
150
+ now: datetime,
151
+ ) -> MonitoringCheck:
152
+ """Single aggregate query per existing ledger; no jobs or patient data leave it."""
153
+ model = apps.get_model("endoreg_db", source.model_name)
154
+ quote = connection.ops.quote_name
155
+ table = quote(model._meta.db_table)
156
+ status_column = quote(model._meta.get_field("status").column)
157
+ created = quote(model._meta.get_field("created_at").column)
158
+ updated = quote(model._meta.get_field("updated_at").column)
159
+ parameters: list[str | datetime] = []
160
+
161
+ def predicate(states: tuple[str, ...]) -> str:
162
+ parameters.extend(states)
163
+ return f"{status_column} IN ({','.join(['%s'] * len(states))})"
164
+
165
+ expressions = [
166
+ f"COUNT(CASE WHEN {predicate(states)} THEN 1 END)"
167
+ for states in (source.pending, source.processing, source.failed)
168
+ ]
169
+ expressions.append(
170
+ f"COUNT(CASE WHEN {predicate(source.failed)} AND {updated} >= %s THEN 1 END)"
171
+ )
172
+ parameters.append(now - timedelta(seconds=config.recent_failure_window_seconds))
173
+ expressions.append(f"MIN(CASE WHEN {predicate(source.pending)} THEN {created} END)")
174
+ if source.lease_field:
175
+ lease = quote(model._meta.get_field(source.lease_field).column)
176
+ expressions.append(
177
+ f"COUNT(CASE WHEN {predicate(source.processing)} AND {lease} <= %s THEN 1 END)"
178
+ )
179
+ parameters.append(now)
180
+ else:
181
+ expressions.append("0")
182
+ with connection.cursor() as cursor:
183
+ cursor.execute(f"SELECT {', '.join(expressions)} FROM {table}", parameters)
184
+ row = cursor.fetchone()
185
+ if row is None:
186
+ raise DatabaseError("Missing aggregate result")
187
+ pending, processing, failed, recent, oldest, expired = row
188
+ if isinstance(oldest, str):
189
+ oldest = parse_datetime(oldest)
190
+ if isinstance(oldest, datetime) and timezone.is_naive(oldest):
191
+ oldest = timezone.make_aware(oldest)
192
+ age = (
193
+ max(0, int((now - oldest).total_seconds()))
194
+ if isinstance(oldest, datetime)
195
+ else None
196
+ )
197
+ stalled = bool(expired) or (
198
+ age is not None and age >= config.pending_warning_seconds
199
+ )
200
+ return MonitoringCheck(
201
+ key=f"processing.{source.key}",
202
+ status="warning" if failed or stalled else "ok",
203
+ summary="Processing failures or delayed work require attention."
204
+ if failed or stalled
205
+ else "No processing failures or overdue pending work observed.",
206
+ observed_at=now,
207
+ metadata={
208
+ "pending": int(pending),
209
+ "processing": int(processing),
210
+ "failed": int(failed),
211
+ "recent_failure_count": int(recent),
212
+ "recent_failure_window_seconds": config.recent_failure_window_seconds,
213
+ "oldest_pending_at": oldest.isoformat()
214
+ if isinstance(oldest, datetime)
215
+ else None,
216
+ "oldest_pending_age_seconds": age,
217
+ "pending_warning_seconds": config.pending_warning_seconds,
218
+ "expired_processing_leases": int(expired),
219
+ "pending_overdue": age is not None
220
+ and age >= config.pending_warning_seconds,
221
+ },
222
+ )