iints-sdk-python35 1.5.15__tar.gz → 1.5.17__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 (307) hide show
  1. {iints_sdk_python35-1.5.15/src/iints_sdk_python35.egg-info → iints_sdk_python35-1.5.17}/PKG-INFO +23 -2
  2. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/README.md +22 -1
  3. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/pyproject.toml +1 -1
  4. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/__init__.py +1 -1
  5. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/__init__.py +13 -0
  6. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/assistant.py +41 -2
  7. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/backends/ollama.py +18 -0
  8. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/cli.py +55 -1
  9. iints_sdk_python35-1.5.17/src/iints/ai/deterministic.py +166 -0
  10. iints_sdk_python35-1.5.17/src/iints/ai/insights.py +284 -0
  11. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/prepare.py +26 -0
  12. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/prompts.py +42 -14
  13. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/clinical_benchmark.py +22 -3
  14. iints_sdk_python35-1.5.17/src/iints/analysis/clinical_metrics.py +22 -0
  15. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/explainable_ai.py +45 -24
  16. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/population_report.py +27 -26
  17. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/reporting.py +365 -157
  18. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/cli/cli.py +307 -22
  19. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/battle_runner.py +1 -1
  20. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/hybrid_algorithm.py +42 -33
  21. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/imitation_controller.py +15 -2
  22. iints_sdk_python35-1.5.17/src/iints/core/algorithms/lstm_algorithm.py +215 -0
  23. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/mpc_controller.py +18 -4
  24. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/neural_controller.py +29 -6
  25. {iints_sdk_python35-1.5.15/src/iints/analysis → iints_sdk_python35-1.5.17/src/iints/core}/clinical_metrics.py +113 -113
  26. iints_sdk_python35-1.5.17/src/iints/core/formula_registry.py +378 -0
  27. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/advanced_metabolic_model.py +4 -5
  28. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/bergman_model.py +9 -3
  29. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/hovorka_model.py +8 -5
  30. iints_sdk_python35-1.5.17/src/iints/core/patient/physiology.py +45 -0
  31. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/safety/config.py +33 -1
  32. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/simulator.py +34 -3
  33. iints_sdk_python35-1.5.17/src/iints/core/units.py +43 -0
  34. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/adapter.py +54 -21
  35. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/realism_validator.py +1 -1
  36. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/reference_free_living_t1d.yaml +6 -3
  37. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/learning/autonomous_optimizer.py +44 -30
  38. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/learning/learning_system.py +10 -37
  39. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/metrics.py +1 -1
  40. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/__init__.py +16 -1
  41. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/config.py +2 -1
  42. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/glucose_model.py +10 -2
  43. iints_sdk_python35-1.5.17/src/iints/research/jetson_hf_trainer.py +679 -0
  44. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/losses.py +94 -6
  45. iints_sdk_python35-1.5.17/src/iints/research/physiology_calibration.py +428 -0
  46. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/predictor.py +16 -5
  47. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/results_manager.py +3 -0
  48. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/tools/ai_realism_auditor.py +12 -11
  49. iints_sdk_python35-1.5.17/src/iints/tools/theory_stress_lab.py +673 -0
  50. iints_sdk_python35-1.5.17/src/iints/utils/academic_artifacts.py +258 -0
  51. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/run_validation.py +1 -1
  52. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/schemas.py +1 -0
  53. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/visualization/cockpit.py +5 -5
  54. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17/src/iints_sdk_python35.egg-info}/PKG-INFO +23 -2
  55. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints_sdk_python35.egg-info/SOURCES.txt +11 -0
  56. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_ci_governance.py +19 -0
  57. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_research_workflows.py +1 -0
  58. iints_sdk_python35-1.5.17/tests/test_cli_theory_stress_lab.py +32 -0
  59. iints_sdk_python35-1.5.15/src/iints/core/algorithms/lstm_algorithm.py +0 -138
  60. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/LICENSE +0 -0
  61. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/LICENSE-MIT-IINTS-LEGACY +0 -0
  62. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/NOTICE +0 -0
  63. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/setup.cfg +0 -0
  64. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/backends/__init__.py +0 -0
  65. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/backends/base.py +0 -0
  66. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/backends/mistral_api.py +0 -0
  67. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/mdmp_guard.py +0 -0
  68. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/ai/model_catalog.py +0 -0
  69. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/__init__.py +0 -0
  70. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/algorithm_xray.py +0 -0
  71. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/baseline.py +0 -0
  72. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/booth_demo.py +0 -0
  73. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/carelink_workbench.py +0 -0
  74. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/clinical_tir_analyzer.py +0 -0
  75. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/diabetes_metrics.py +0 -0
  76. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/edge_efficiency.py +0 -0
  77. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/edge_performance_monitor.py +0 -0
  78. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/eucys_results.py +0 -0
  79. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/evidence_bundle.py +0 -0
  80. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/explainability.py +0 -0
  81. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/hardware_benchmark.py +0 -0
  82. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/metrics.py +0 -0
  83. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/poster.py +0 -0
  84. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/run_quality.py +0 -0
  85. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/safety_index.py +0 -0
  86. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/safety_visualizer.py +0 -0
  87. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/sensor_filtering.py +0 -0
  88. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/study_analysis.py +0 -0
  89. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/study_engine.py +0 -0
  90. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/study_experiment.py +0 -0
  91. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/study_poster.py +0 -0
  92. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/study_protocol.py +0 -0
  93. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/analysis/validator.py +0 -0
  94. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/api/__init__.py +0 -0
  95. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/api/base_algorithm.py +0 -0
  96. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/api/registry.py +0 -0
  97. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/api/template_algorithm.py +0 -0
  98. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/assets/iints_logo.png +0 -0
  99. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/cli/__init__.py +0 -0
  100. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/cli/patient_cli.py +0 -0
  101. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/__init__.py +0 -0
  102. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/__init__.py +0 -0
  103. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/clinical_baseline.py +0 -0
  104. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/correction_bolus.py +0 -0
  105. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/discovery.py +0 -0
  106. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/fixed_basal_bolus.py +0 -0
  107. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/mock_algorithms.py +0 -0
  108. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/pid_controller.py +0 -0
  109. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/algorithms/standard_pump_algo.py +0 -0
  110. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/device.py +0 -0
  111. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/device_manager.py +0 -0
  112. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/devices/__init__.py +0 -0
  113. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/devices/models.py +0 -0
  114. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/digital_twin.py +0 -0
  115. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/__init__.py +0 -0
  116. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/models.py +0 -0
  117. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/patient_factory.py +0 -0
  118. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/patient/profile.py +0 -0
  119. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/physiology_variation.py +0 -0
  120. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/safety/__init__.py +0 -0
  121. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/safety/input_validator.py +0 -0
  122. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/safety/supervisor.py +0 -0
  123. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/simulation/__init__.py +0 -0
  124. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/simulation/scenario_parser.py +0 -0
  125. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/core/supervisor.py +0 -0
  126. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/__init__.py +0 -0
  127. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/certify.py +0 -0
  128. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/column_mapper.py +0 -0
  129. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/contracts.py +0 -0
  130. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/datasets.json +0 -0
  131. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/demo/__init__.py +0 -0
  132. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/demo/demo_cgm.csv +0 -0
  133. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/evidence.py +0 -0
  134. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/guardians.py +0 -0
  135. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/importer.py +0 -0
  136. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/ingestor.py +0 -0
  137. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/mdmp_visualizer.py +0 -0
  138. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/medtronic_live.py +0 -0
  139. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/nightscout.py +0 -0
  140. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/physiology_residual_profiles.json +0 -0
  141. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/quality_checker.py +0 -0
  142. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/realism_dashboard.py +0 -0
  143. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/realism_governance.py +0 -0
  144. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/realism_reference.py +0 -0
  145. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/realism_references.json +0 -0
  146. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/registry.py +0 -0
  147. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/research_catalog.py +0 -0
  148. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/runner.py +0 -0
  149. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/study_corruption.py +0 -0
  150. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/synthetic_mirror.py +0 -0
  151. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/tidepool.py +0 -0
  152. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/universal_parser.py +0 -0
  153. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/clinic_safe_baseline.yaml +0 -0
  154. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/clinic_safe_hyper_challenge.yaml +0 -0
  155. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/clinic_safe_hypo_prone.yaml +0 -0
  156. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/clinic_safe_midnight.yaml +0 -0
  157. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/clinic_safe_pizza.yaml +0 -0
  158. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/clinic_safe_stress_meal.yaml +0 -0
  159. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/default_patient.yaml +0 -0
  160. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/patient_559_config.yaml +0 -0
  161. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/reference_azt1d_t1d.yaml +0 -0
  162. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/data/virtual_patients/reference_hupa_ucm_t1d.yaml +0 -0
  163. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/demo_assets.py +0 -0
  164. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/emulation/__init__.py +0 -0
  165. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/emulation/legacy_base.py +0 -0
  166. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/emulation/medtronic_780g.py +0 -0
  167. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/emulation/omnipod_5.py +0 -0
  168. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/emulation/tandem_controliq.py +0 -0
  169. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/highlevel.py +0 -0
  170. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/jetson/__init__.py +0 -0
  171. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/jetson/endurance.py +0 -0
  172. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/jetson/research_pipeline.py +0 -0
  173. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/learning/__init__.py +0 -0
  174. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/__init__.py +0 -0
  175. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/api.py +0 -0
  176. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/daemon.py +0 -0
  177. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/edge_benchmark.py +0 -0
  178. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/edge_ops.py +0 -0
  179. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/fpga.py +0 -0
  180. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/long_study.py +0 -0
  181. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/medtronic_direct.py +0 -0
  182. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/pico_pump.py +0 -0
  183. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/runtime.py +0 -0
  184. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/service_export.py +0 -0
  185. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/live_patient/uno_q.py +0 -0
  186. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/mdmp/__init__.py +0 -0
  187. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/mdmp/backend.py +0 -0
  188. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/mdmp/eu_ai_pact.py +0 -0
  189. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/population/__init__.py +0 -0
  190. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/population/generator.py +0 -0
  191. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/population/runner.py +0 -0
  192. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/__init__.py +0 -0
  193. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/evidence_sources.yaml +0 -0
  194. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/forecast_calibration_profiles.yaml +0 -0
  195. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/golden_benchmark.yaml +0 -0
  196. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/presets.json +0 -0
  197. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/safety_contract_default.yaml +0 -0
  198. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/presets/validation_profiles.yaml +0 -0
  199. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/audit.py +0 -0
  200. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/calibration_gate.py +0 -0
  201. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/control.py +0 -0
  202. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/control_eval.py +0 -0
  203. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/data_blend.py +0 -0
  204. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/dataset.py +0 -0
  205. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/evaluation.py +0 -0
  206. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/forecasting.py +0 -0
  207. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/local_ai.py +0 -0
  208. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/local_ai_gate.py +0 -0
  209. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/metrics.py +0 -0
  210. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/model_registry.py +0 -0
  211. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/research/neural_control.py +0 -0
  212. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/scenarios/__init__.py +0 -0
  213. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/scenarios/generator.py +0 -0
  214. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/scenarios/study_pack.py +0 -0
  215. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/__init__.py +0 -0
  216. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/default_algorithm.py +0 -0
  217. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/demos/__init__.py +0 -0
  218. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/demos/live_stage_demo.py +0 -0
  219. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/pico_pump/README.md +0 -0
  220. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/pico_pump/code.py +0 -0
  221. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/pico_pump/serial_protocol.txt +0 -0
  222. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/scenarios/__init__.py +0 -0
  223. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/scenarios/chaos_insulin_stacking.json +0 -0
  224. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/scenarios/chaos_runaway_ai.json +0 -0
  225. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/scenarios/example_scenario.json +0 -0
  226. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/scenarios/exercise_stress.json +0 -0
  227. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/uno_q/README.md +0 -0
  228. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/templates/uno_q/iints_supervisor_bridge.ino +0 -0
  229. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/tools/digital_twin_calibrator.py +0 -0
  230. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/utils/__init__.py +0 -0
  231. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/utils/csv_safety.py +0 -0
  232. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/utils/plotting.py +0 -0
  233. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/utils/run_io.py +0 -0
  234. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/utils/url_safety.py +0 -0
  235. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/__init__.py +0 -0
  236. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/golden.py +0 -0
  237. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/replay.py +0 -0
  238. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/run_doctor.py +0 -0
  239. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/validation/safety_contract.py +0 -0
  240. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/visualization/__init__.py +0 -0
  241. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints/visualization/uncertainty_cloud.py +0 -0
  242. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints_sdk_python35.egg-info/dependency_links.txt +0 -0
  243. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints_sdk_python35.egg-info/entry_points.txt +0 -0
  244. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints_sdk_python35.egg-info/requires.txt +0 -0
  245. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/iints_sdk_python35.egg-info/top_level.txt +0 -0
  246. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_ai/__init__.py +0 -0
  247. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_ai/lineage.py +0 -0
  248. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/__init__.py +0 -0
  249. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/audit.py +0 -0
  250. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/bias_hooks.py +0 -0
  251. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/bundle.py +0 -0
  252. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/certification.py +0 -0
  253. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/cli.py +0 -0
  254. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/compare.py +0 -0
  255. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/conformance.py +0 -0
  256. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/contracts.py +0 -0
  257. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/crypto.py +0 -0
  258. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/data/conformance/vectors/delegation.json +0 -0
  259. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/data/conformance/vectors/fingerprint.json +0 -0
  260. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/data/conformance/vectors/grading.json +0 -0
  261. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/data/conformance/vectors/signing.json +0 -0
  262. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/delegate.py +0 -0
  263. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/diffing.py +0 -0
  264. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/drift.py +0 -0
  265. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/exceptions.py +0 -0
  266. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/fingerprint.py +0 -0
  267. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/fingerprint_store.py +0 -0
  268. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/hf.py +0 -0
  269. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/keys/mdmp_pub_v1.pem +0 -0
  270. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/llm_provenance.py +0 -0
  271. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/migrate.py +0 -0
  272. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/policy.py +0 -0
  273. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/prov.py +0 -0
  274. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/registry.py +0 -0
  275. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/runner.py +0 -0
  276. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/schema_export.py +0 -0
  277. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/synthetic.py +0 -0
  278. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/trust.py +0 -0
  279. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_core/visualizer.py +0 -0
  280. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_flavors/__init__.py +0 -0
  281. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_integrations/__init__.py +0 -0
  282. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_integrations/dvc.py +0 -0
  283. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_integrations/mlflow.py +0 -0
  284. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/src/mdmp_integrations/wandb.py +0 -0
  285. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_bergman.py +0 -0
  286. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_algorithm_loading.py +0 -0
  287. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_booth_demo.py +0 -0
  288. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_carelink_workbench.py +0 -0
  289. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_cloud_import_security.py +0 -0
  290. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_demo_export.py +0 -0
  291. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_demo_live.py +0 -0
  292. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_edge_runtime.py +0 -0
  293. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_expo_tools.py +0 -0
  294. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_fpga.py +0 -0
  295. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_onboarding.py +0 -0
  296. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_patient_runtime.py +0 -0
  297. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_poster.py +0 -0
  298. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_cli_run_summary.py +0 -0
  299. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_install_doctor.py +0 -0
  300. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_jetson_endurance.py +0 -0
  301. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_physiology_variation.py +0 -0
  302. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_plugin_system.py +0 -0
  303. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_population.py +0 -0
  304. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_presets_realism.py +0 -0
  305. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_research_realism_tools.py +0 -0
  306. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_scientific_fidelity.py +0 -0
  307. {iints_sdk_python35-1.5.15 → iints_sdk_python35-1.5.17}/tests/test_simulator_calibration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iints-sdk-python35
3
- Version: 1.5.15
3
+ Version: 1.5.17
4
4
  Summary: A pre-clinical Edge-AI SDK for diabetes management validation.
5
5
  Author-email: Rune Bobbaers <rune.bobbaers@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -80,6 +80,27 @@ Open-source research platform for insulin delivery algorithm simulation and vali
80
80
 
81
81
  ---
82
82
 
83
+ ## Repository Map
84
+
85
+ | Path | Purpose |
86
+ | --- | --- |
87
+ | `src/iints/` | installable SDK source code |
88
+ | `docs/` | public documentation, governance, release notes, and Obsidian vault mirror |
89
+ | `examples/` | runnable examples and notebooks |
90
+ | `tests/` | unit, CLI, system, and realism tests |
91
+ | `research/` | research artifacts and benchmark snapshots |
92
+ | `tools/` | maintainer scripts for docs, CI, and release workflows |
93
+ | `data_packs/` | small bundled/demo data packs |
94
+ | `algorithms/` | example insulin algorithm entry points |
95
+
96
+ Important starting points:
97
+
98
+ - `docs/THEORY_STRESS_LAB.md` — Jetson scientific stress-test mode
99
+ - `docs/governance/API_STABILITY.md` — semver and API policy
100
+ - `docs/governance/PRIVACY_POLICY.md` and `docs/governance/TERMS_OF_USE.md` — public legal docs
101
+
102
+ ---
103
+
83
104
  ## What It Does
84
105
 
85
106
  - **Simulate** virtual patients across thousands of scenarios before any algorithm reaches a real device
@@ -129,5 +150,5 @@ Use `iints demo doctor` for clinical feedback conversations and `iints demo boot
129
150
 
130
151
  ---
131
152
 
132
- > Research software. Not a medical device. MIT Licensed.
153
+ > Research software. Not a medical device. Apache-2.0 licensed, with legacy MIT notices where applicable.
133
154
  > *Built by a 17-year-old with type 1 diabetes.*
@@ -11,6 +11,27 @@ Open-source research platform for insulin delivery algorithm simulation and vali
11
11
 
12
12
  ---
13
13
 
14
+ ## Repository Map
15
+
16
+ | Path | Purpose |
17
+ | --- | --- |
18
+ | `src/iints/` | installable SDK source code |
19
+ | `docs/` | public documentation, governance, release notes, and Obsidian vault mirror |
20
+ | `examples/` | runnable examples and notebooks |
21
+ | `tests/` | unit, CLI, system, and realism tests |
22
+ | `research/` | research artifacts and benchmark snapshots |
23
+ | `tools/` | maintainer scripts for docs, CI, and release workflows |
24
+ | `data_packs/` | small bundled/demo data packs |
25
+ | `algorithms/` | example insulin algorithm entry points |
26
+
27
+ Important starting points:
28
+
29
+ - `docs/THEORY_STRESS_LAB.md` — Jetson scientific stress-test mode
30
+ - `docs/governance/API_STABILITY.md` — semver and API policy
31
+ - `docs/governance/PRIVACY_POLICY.md` and `docs/governance/TERMS_OF_USE.md` — public legal docs
32
+
33
+ ---
34
+
14
35
  ## What It Does
15
36
 
16
37
  - **Simulate** virtual patients across thousands of scenarios before any algorithm reaches a real device
@@ -60,5 +81,5 @@ Use `iints demo doctor` for clinical feedback conversations and `iints demo boot
60
81
 
61
82
  ---
62
83
 
63
- > Research software. Not a medical device. MIT Licensed.
84
+ > Research software. Not a medical device. Apache-2.0 licensed, with legacy MIT notices where applicable.
64
85
  > *Built by a 17-year-old with type 1 diabetes.*
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "iints-sdk-python35"
7
- version = "1.5.15"
7
+ version = "1.5.17"
8
8
  authors = [
9
9
  { name="Rune Bobbaers", email="rune.bobbaers@gmail.com" },
10
10
  ]
@@ -11,7 +11,7 @@ except ImportError: # pragma: no cover - Python < 3.8 fallback
11
11
  try:
12
12
  __version__ = version("iints-sdk-python35")
13
13
  except PackageNotFoundError: # pragma: no cover - source tree fallback
14
- __version__ = "1.5.15"
14
+ __version__ = "1.5.17"
15
15
 
16
16
  # Note to developers: this SDK is currently maintained by a single author.
17
17
  # Please report bugs via GitHub issues and feel free to contribute fixes via PRs.
@@ -1,5 +1,12 @@
1
1
  from .assistant import AIResponse, IINTSAssistant
2
2
  from .backends import DEFAULT_MINISTRAL_MODEL, DEFAULT_OLLAMA_HOST, OllamaBackend
3
+ from .deterministic import (
4
+ DETERMINISTIC_DOSE_VERSION,
5
+ DeterministicDoseResult,
6
+ DoseSafetyLimits,
7
+ calculate_deterministic_dose,
8
+ )
9
+ from .insights import AI_INSIGHT_CONTEXT_VERSION, build_insight_context
3
10
  from .mdmp_guard import GuardResult, MDMPGuard
4
11
  from .model_catalog import (
5
12
  DEFAULT_MISTRAL_API_MODEL,
@@ -18,6 +25,12 @@ __all__ = [
18
25
  "DEFAULT_MINISTRAL_MODEL",
19
26
  "DEFAULT_OLLAMA_HOST",
20
27
  "OllamaBackend",
28
+ "DETERMINISTIC_DOSE_VERSION",
29
+ "DeterministicDoseResult",
30
+ "DoseSafetyLimits",
31
+ "calculate_deterministic_dose",
32
+ "AI_INSIGHT_CONTEXT_VERSION",
33
+ "build_insight_context",
21
34
  "GuardResult",
22
35
  "MDMPGuard",
23
36
  "DEFAULT_MISTRAL_API_MODEL",
@@ -5,6 +5,8 @@ from pathlib import Path
5
5
  from typing import Any
6
6
 
7
7
  from .backends import DEFAULT_MINISTRAL_MODEL, CompletionBackend, MistralAPIBackend, OllamaBackend
8
+ from .deterministic import DETERMINISTIC_DOSE_VERSION, calculate_deterministic_dose
9
+ from .insights import build_insight_context
8
10
  from .mdmp_guard import GuardResult, MDMPGuard
9
11
  from .prompts import TaskName, build_prompt
10
12
 
@@ -16,15 +18,22 @@ class AIResponse:
16
18
  backend: str
17
19
  model: str
18
20
  certification: GuardResult
21
+ deterministic_result: dict[str, Any] | None = None
22
+ insight_context: dict[str, Any] | None = None
19
23
 
20
24
  def to_dict(self) -> dict[str, Any]:
21
- return {
25
+ payload = {
22
26
  "task": self.task,
23
27
  "text": self.text,
24
28
  "backend": self.backend,
25
29
  "model": self.model,
26
30
  "certification": self.certification.to_dict(),
27
31
  }
32
+ if self.deterministic_result is not None:
33
+ payload["deterministic_result"] = self.deterministic_result
34
+ if self.insight_context is not None:
35
+ payload["insight_context"] = self.insight_context
36
+ return payload
28
37
 
29
38
 
30
39
  class IINTSAssistant:
@@ -101,6 +110,7 @@ class IINTSAssistant:
101
110
 
102
111
  def _run_task(self, task: TaskName, payload: Any) -> AIResponse:
103
112
  certification = self.guard.check()
113
+ insight_context = build_insight_context(task, payload)
104
114
  system_prompt, user_prompt = build_prompt(task, payload)
105
115
  text = self.guard.wrap(
106
116
  self.backend.complete(system_prompt=system_prompt, user_prompt=user_prompt)
@@ -117,6 +127,7 @@ class IINTSAssistant:
117
127
  backend=getattr(self.backend, "backend_name", type(self.backend).__name__),
118
128
  model=response_model,
119
129
  certification=certification,
130
+ insight_context=insight_context,
120
131
  )
121
132
 
122
133
  def explain_decision(self, step: dict[str, Any]) -> AIResponse:
@@ -128,6 +139,9 @@ class IINTSAssistant:
128
139
  def detect_anomalies(self, results: dict[str, Any]) -> AIResponse:
129
140
  return self._run_task("detect_anomalies", results)
130
141
 
142
+ def generate_insights(self, run: dict[str, Any]) -> AIResponse:
143
+ return self._run_task("generate_insights", run)
144
+
131
145
  def generate_report(self, run: dict[str, Any]) -> AIResponse:
132
146
  return self._run_task("generate_report", run)
133
147
 
@@ -135,4 +149,29 @@ class IINTSAssistant:
135
149
  return self._run_task("review_realism", run)
136
150
 
137
151
  def predict_insulin(self, payload: dict[str, Any]) -> AIResponse:
138
- return self._run_task("predict_insulin", payload)
152
+ """Resolve a fixed research dose without invoking the language model.
153
+
154
+ Kept for API compatibility. The numerical result comes exclusively
155
+ from deterministic controller output and transparent safety guards.
156
+ """
157
+
158
+ certification = self.guard.check()
159
+ result = calculate_deterministic_dose(payload)
160
+ reasons = ", ".join(result.reasons)
161
+ text = self.guard.wrap(
162
+ "Deterministic research-sandbox calculation. The language model was not invoked "
163
+ "and has no numerical authority.\n\n"
164
+ f"Calculation version: {result.calculation_version}\n"
165
+ f"Safety hold: {str(result.safety_hold).lower()}\n"
166
+ f"Reasons: {reasons}\n"
167
+ f"FINAL_DOSE: {result.final_insulin_units:.6f}\n"
168
+ f"FINAL_GLUCAGON_DOSE_MG: {result.final_glucagon_mg:.6f}"
169
+ )
170
+ return AIResponse(
171
+ task="predict_insulin",
172
+ text=text,
173
+ backend="deterministic",
174
+ model=DETERMINISTIC_DOSE_VERSION,
175
+ certification=certification,
176
+ deterministic_result=result.to_dict(),
177
+ )
@@ -35,11 +35,19 @@ class OllamaBackend:
35
35
  model_name: str = DEFAULT_MINISTRAL_MODEL,
36
36
  base_url: str | None = None,
37
37
  timeout_seconds: float = 120.0,
38
+ temperature: float = 0.0,
39
+ top_p: float = 0.85,
40
+ num_predict: int = 900,
41
+ num_ctx: int = 8192,
38
42
  ) -> None:
39
43
  self.model_name = model_name
40
44
  raw_base_url = base_url or os.getenv("OLLAMA_HOST") or DEFAULT_OLLAMA_HOST
41
45
  self.base_url = self._validate_base_url(raw_base_url)
42
46
  self.timeout_seconds = timeout_seconds
47
+ self.temperature = temperature
48
+ self.top_p = top_p
49
+ self.num_predict = num_predict
50
+ self.num_ctx = num_ctx
43
51
  self.resolved_model_name: str | None = None
44
52
 
45
53
  @staticmethod
@@ -280,10 +288,19 @@ class OllamaBackend:
280
288
  "ready": resolved is not None,
281
289
  "pull_command": None if resolved is not None else self._pull_hint(),
282
290
  "timeout_seconds": self.timeout_seconds,
291
+ "generation_options": self._generation_options(),
283
292
  "server_version": version,
284
293
  "version_ok": version_ok,
285
294
  }
286
295
 
296
+ def _generation_options(self) -> dict[str, int | float]:
297
+ return {
298
+ "temperature": self.temperature,
299
+ "top_p": self.top_p,
300
+ "num_predict": self.num_predict,
301
+ "num_ctx": self.num_ctx,
302
+ }
303
+
287
304
  def smoke_test(self) -> dict[str, object]:
288
305
  resolved_model = self.ensure_model_ready()
289
306
  payload = {
@@ -328,6 +345,7 @@ class OllamaBackend:
328
345
  "system": system_prompt,
329
346
  "prompt": user_prompt,
330
347
  "stream": False,
348
+ "options": self._generation_options(),
331
349
  }
332
350
  last_error: Exception | None = None
333
351
  for attempt in range(2):
@@ -48,6 +48,7 @@ def _default_prepared_payload(task: str, ai_dir: Path) -> Path:
48
48
  "explain": ["step_riskiest.json", "step_latest.json"],
49
49
  "trends": ["trends_payload.json"],
50
50
  "anomalies": ["anomalies_payload.json"],
51
+ "insights": ["insights_payload.json", "report_payload.json"],
51
52
  "report": ["report_payload.json"],
52
53
  "review": ["review_payload.json", "report_payload.json"],
53
54
  }.get(task, [])
@@ -78,7 +79,7 @@ def _resolve_cli_inputs(
78
79
  ai_dir = input_path / "ai"
79
80
  if (
80
81
  not ai_dir.exists()
81
- or not any((ai_dir / candidate).is_file() for candidate in ("report_payload.json", "trends_payload.json", "anomalies_payload.json", "step_riskiest.json", "review_payload.json"))
82
+ or not any((ai_dir / candidate).is_file() for candidate in ("report_payload.json", "trends_payload.json", "anomalies_payload.json", "insights_payload.json", "step_riskiest.json", "review_payload.json"))
82
83
  or (resolved_cert is None and not (ai_dir / "report.signed.mdmp").is_file())
83
84
  ):
84
85
  prepare_ai_ready_artifacts(
@@ -119,6 +120,14 @@ def _default_output_for_review(input_path: Path, output: Path | None) -> Path |
119
120
  return None
120
121
 
121
122
 
123
+ def _default_output_for_insights(input_path: Path, output: Path | None) -> Path | None:
124
+ if output is not None:
125
+ return output
126
+ if input_path.is_dir():
127
+ return input_path / "ai" / "insights.md"
128
+ return None
129
+
130
+
122
131
  def _render_response(console: Console, title: str, response: AIResponse, output: Path | None) -> None:
123
132
  console.print(Panel(response.text, title=title, border_style="cyan"))
124
133
  console.print(
@@ -136,6 +145,8 @@ def _render_local_check(console: Console, status: dict[str, object]) -> None:
136
145
  ready = bool(status.get("ready"))
137
146
  resolved_model = status.get("resolved_model") or "not found"
138
147
  smoke_text = status.get("smoke_test") or "not run"
148
+ options = status.get("generation_options")
149
+ options_text = json.dumps(options, sort_keys=True) if isinstance(options, dict) else "default"
139
150
  console.print(
140
151
  Panel(
141
152
  "\n".join(
@@ -145,6 +156,7 @@ def _render_local_check(console: Console, status: dict[str, object]) -> None:
145
156
  f"Resolved local model: {resolved_model}",
146
157
  f"Server version: {status.get('server_version') or 'unknown'}",
147
158
  f"Timeout (s): {status.get('timeout_seconds')}",
159
+ f"Insight generation options: {options_text}",
148
160
  f"Installed models: {installed_text}",
149
161
  (
150
162
  f"Pull command: {status.get('pull_command')}"
@@ -444,6 +456,48 @@ def anomalies(
444
456
  raise typer.Exit(code=1)
445
457
 
446
458
 
459
+ @app.command(name="insights")
460
+ def insights(
461
+ input_json: Annotated[Path, typer.Argument(help="Prepared run directory or JSON file with run-level simulation outputs.")],
462
+ mdmp_cert: Annotated[Optional[Path], typer.Option(help="Signed MDMP artifact required before AI analysis can run.")] = None,
463
+ mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = "auto",
464
+ model: Annotated[str, typer.Option(help="Ollama model name to use.")] = DEFAULT_MINISTRAL_MODEL,
465
+ minimum_grade: Annotated[str, typer.Option(help="Minimum MDMP grade required to allow analysis.")] = "research_grade",
466
+ public_key: Annotated[Optional[Path], typer.Option(help="Explicit MDMP public key for verification.")] = None,
467
+ trust_store: Annotated[Optional[Path], typer.Option(help="MDMP trust store for verification.")] = None,
468
+ ollama_host: Annotated[Optional[str], typer.Option(help="Override the Ollama base URL.")] = None,
469
+ timeout_seconds: Annotated[float, typer.Option(help="HTTP timeout for Ollama generation requests.")] = 120.0,
470
+ output: Annotated[Optional[Path], typer.Option(help="Optional file path to save the insight brief.")] = None,
471
+ ) -> None:
472
+ console = Console()
473
+ try:
474
+ resolved_input, resolved_cert, resolved_public_key = _resolve_cli_inputs(
475
+ task="insights",
476
+ input_path=input_json,
477
+ mdmp_cert=mdmp_cert,
478
+ public_key=public_key,
479
+ trust_store=trust_store,
480
+ )
481
+ payload = _load_json_payload(resolved_input, "Input JSON")
482
+ assistant = _build_assistant(
483
+ mdmp_cert=resolved_cert,
484
+ mode=mode,
485
+ model=model,
486
+ minimum_grade=minimum_grade,
487
+ public_key=resolved_public_key,
488
+ trust_store=trust_store,
489
+ ollama_host=ollama_host,
490
+ timeout_seconds=timeout_seconds,
491
+ )
492
+ resolved_output = _default_output_for_insights(input_json, output)
493
+ response = assistant.generate_insights(payload)
494
+ _write_output(resolved_output, response)
495
+ _render_response(console, "IINTS AI Insights", response, resolved_output)
496
+ except Exception as exc:
497
+ console.print(f"[bold red]Error:[/bold red] {exc}")
498
+ raise typer.Exit(code=1)
499
+
500
+
447
501
  @app.command(name="report")
448
502
  def report(
449
503
  input_json: Annotated[Path, typer.Argument(help="Prepared run directory or JSON file with run-level simulation outputs.")],
@@ -0,0 +1,166 @@
1
+ """Deterministic numerical boundaries for the optional AI assistant.
2
+
3
+ The language model may explain SDK results, but it must never calculate or
4
+ alter physiological metrics, insulin candidates, or glucagon candidates.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from dataclasses import dataclass
10
+ import hashlib
11
+ import json
12
+ from typing import Any, Mapping
13
+
14
+ from iints.core.safety.config import (
15
+ CONTROLLER_FALLING_TREND_GUARD_MGDL_MIN,
16
+ CONTROLLER_HIGH_IOB_GUARD_UNITS,
17
+ CONTROLLER_HYPO_GUARD_MGDL,
18
+ )
19
+ from iints.core.units import finite_value
20
+
21
+
22
+ DETERMINISTIC_DOSE_VERSION = "iints-deterministic-dose-v1"
23
+ _INPUT_UNITS = {
24
+ "mpc_recommended_units": "U/step",
25
+ "hard_max_insulin_units": "U/step",
26
+ "deterministic_glucagon_candidate_mg": "mg/step",
27
+ "hard_max_glucagon_mg": "mg/step",
28
+ "current_glucose": "mg/dL",
29
+ "current_glucose_mgdl": "mg/dL",
30
+ "predicted_glucose_30min": "mg/dL",
31
+ "predicted_glucose_30min_mgdl": "mg/dL",
32
+ "glucose_trend_mgdl_min": "mg/dL/min",
33
+ "glucose_trend": "mg/dL/min",
34
+ "insulin_on_board": "U",
35
+ "active_insulin": "U",
36
+ }
37
+
38
+
39
+ @dataclass(frozen=True)
40
+ class DoseSafetyLimits:
41
+ """Fixed research-sandbox limits applied after deterministic MPC output."""
42
+
43
+ low_glucose_mgdl: float = CONTROLLER_HYPO_GUARD_MGDL
44
+ falling_trend_mgdl_min: float = CONTROLLER_FALLING_TREND_GUARD_MGDL_MIN
45
+ high_iob_units: float = CONTROLLER_HIGH_IOB_GUARD_UNITS
46
+
47
+
48
+ @dataclass(frozen=True)
49
+ class DeterministicDoseResult:
50
+ """Auditable result produced without invoking a language model."""
51
+
52
+ final_insulin_units: float
53
+ final_glucagon_mg: float
54
+ mpc_recommended_units: float
55
+ deterministic_glucagon_candidate_mg: float
56
+ safety_hold: bool
57
+ reasons: tuple[str, ...]
58
+ calculation_version: str
59
+ input_fingerprint_sha256: str
60
+
61
+ def to_dict(self) -> dict[str, Any]:
62
+ return {
63
+ "final_insulin_units": self.final_insulin_units,
64
+ "final_glucagon_mg": self.final_glucagon_mg,
65
+ "mpc_recommended_units": self.mpc_recommended_units,
66
+ "deterministic_glucagon_candidate_mg": self.deterministic_glucagon_candidate_mg,
67
+ "safety_hold": self.safety_hold,
68
+ "reasons": list(self.reasons),
69
+ "calculation_version": self.calculation_version,
70
+ "input_fingerprint_sha256": self.input_fingerprint_sha256,
71
+ "ai_numeric_authority": False,
72
+ }
73
+
74
+
75
+ def _finite_float(payload: Mapping[str, Any], key: str, *, default: float | None = None) -> float:
76
+ raw = payload.get(key, default)
77
+ if raw is None:
78
+ raise ValueError(f"Missing deterministic numeric input: {key}")
79
+ return finite_value(raw, name=f"Deterministic numeric input '{key}'", unit=_INPUT_UNITS[key])
80
+
81
+
82
+ def _optional_finite_float(payload: Mapping[str, Any], *keys: str) -> float | None:
83
+ for key in keys:
84
+ if key in payload and payload[key] is not None:
85
+ return _finite_float(payload, key)
86
+ return None
87
+
88
+
89
+ def _fingerprint(payload: Mapping[str, Any]) -> str:
90
+ canonical = json.dumps(payload, sort_keys=True, separators=(",", ":"), default=str)
91
+ return hashlib.sha256(canonical.encode("utf-8")).hexdigest()
92
+
93
+
94
+ def calculate_deterministic_dose(
95
+ payload: Mapping[str, Any],
96
+ *,
97
+ limits: DoseSafetyLimits = DoseSafetyLimits(),
98
+ ) -> DeterministicDoseResult:
99
+ """Resolve fixed simulation doses from deterministic controller outputs.
100
+
101
+ Insulin starts from ``mpc_recommended_units`` and can only be clamped or
102
+ reduced to zero by transparent safety rules. Glucagon must be supplied by a
103
+ deterministic controller; this function never invents a rescue dose.
104
+ """
105
+
106
+ mpc_units = max(0.0, _finite_float(payload, "mpc_recommended_units"))
107
+ insulin_cap = max(
108
+ 0.0,
109
+ _finite_float(payload, "hard_max_insulin_units", default=mpc_units),
110
+ )
111
+ deterministic_glucagon = max(
112
+ 0.0,
113
+ _finite_float(payload, "deterministic_glucagon_candidate_mg", default=0.0),
114
+ )
115
+ glucagon_cap = max(
116
+ 0.0,
117
+ _finite_float(payload, "hard_max_glucagon_mg", default=deterministic_glucagon),
118
+ )
119
+
120
+ current_glucose = _optional_finite_float(payload, "current_glucose", "current_glucose_mgdl")
121
+ predicted_glucose = _optional_finite_float(
122
+ payload,
123
+ "predicted_glucose_30min",
124
+ "predicted_glucose_30min_mgdl",
125
+ )
126
+ trend = _optional_finite_float(payload, "glucose_trend_mgdl_min", "glucose_trend")
127
+ iob = _optional_finite_float(payload, "insulin_on_board", "active_insulin")
128
+
129
+ reasons: list[str] = []
130
+ safety_hold = False
131
+ if current_glucose is not None and current_glucose <= limits.low_glucose_mgdl:
132
+ safety_hold = True
133
+ reasons.append("current_glucose_at_or_below_fixed_guard")
134
+ if predicted_glucose is not None and predicted_glucose <= limits.low_glucose_mgdl:
135
+ safety_hold = True
136
+ reasons.append("predicted_glucose_at_or_below_fixed_guard")
137
+ if trend is not None and trend <= limits.falling_trend_mgdl_min:
138
+ safety_hold = True
139
+ reasons.append("falling_trend_at_or_below_fixed_guard")
140
+ if iob is not None and iob >= limits.high_iob_units:
141
+ safety_hold = True
142
+ reasons.append("iob_at_or_above_fixed_guard")
143
+
144
+ clamped_insulin = min(mpc_units, insulin_cap)
145
+ if clamped_insulin < mpc_units:
146
+ reasons.append("insulin_clamped_to_hard_cap")
147
+ final_insulin = 0.0 if safety_hold else clamped_insulin
148
+
149
+ final_glucagon = min(deterministic_glucagon, glucagon_cap)
150
+ if final_glucagon < deterministic_glucagon:
151
+ reasons.append("glucagon_clamped_to_hard_cap")
152
+ if deterministic_glucagon == 0.0:
153
+ reasons.append("no_deterministic_glucagon_candidate")
154
+ if not reasons:
155
+ reasons.append("deterministic_controller_candidate_accepted")
156
+
157
+ return DeterministicDoseResult(
158
+ final_insulin_units=final_insulin,
159
+ final_glucagon_mg=final_glucagon,
160
+ mpc_recommended_units=mpc_units,
161
+ deterministic_glucagon_candidate_mg=deterministic_glucagon,
162
+ safety_hold=safety_hold,
163
+ reasons=tuple(reasons),
164
+ calculation_version=DETERMINISTIC_DOSE_VERSION,
165
+ input_fingerprint_sha256=_fingerprint(payload),
166
+ )