agentloop-profiler 0.2.10__tar.gz → 0.3.1__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 (456) hide show
  1. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/PKG-INFO +5 -5
  2. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/README.md +3 -3
  3. agentloop_profiler-0.3.1/agentloop/__init__.py +243 -0
  4. agentloop_profiler-0.3.1/agentloop/acceptance.py +310 -0
  5. agentloop_profiler-0.3.1/agentloop/cli.py +325 -0
  6. agentloop_profiler-0.3.1/agentloop/cli_analysis.py +593 -0
  7. agentloop_profiler-0.3.1/agentloop/cli_onboarding.py +157 -0
  8. agentloop_profiler-0.3.1/agentloop/cli_remote.py +242 -0
  9. agentloop_profiler-0.3.1/agentloop/cli_runtime.py +94 -0
  10. agentloop_profiler-0.3.1/agentloop/cli_setup.py +79 -0
  11. agentloop_profiler-0.3.1/agentloop/cli_store.py +377 -0
  12. agentloop_profiler-0.3.1/agentloop/conditioned_calibration.py +307 -0
  13. agentloop_profiler-0.3.1/agentloop/content_capture.py +391 -0
  14. agentloop_profiler-0.3.1/agentloop/content_fingerprints.py +265 -0
  15. agentloop_profiler-0.3.1/agentloop/content_rules.py +231 -0
  16. agentloop_profiler-0.3.1/agentloop/cross_run.py +912 -0
  17. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/decorators.py +52 -13
  18. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/entrypoint.py +6 -4
  19. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/estimates.py +16 -0
  20. agentloop_profiler-0.3.1/agentloop/execution_ir.py +653 -0
  21. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/finding_benchmark_types.py +1 -1
  22. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/finding_benchmarks.py +7 -0
  23. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/findings.py +12 -1
  24. agentloop_profiler-0.3.1/agentloop/improvement.py +66 -0
  25. agentloop_profiler-0.3.1/agentloop/improvement_capture.py +375 -0
  26. agentloop_profiler-0.3.1/agentloop/improvement_compare.py +135 -0
  27. agentloop_profiler-0.3.1/agentloop/improvement_decision.py +555 -0
  28. agentloop_profiler-0.3.1/agentloop/improvement_planning.py +287 -0
  29. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/langgraph.py +91 -7
  30. agentloop_profiler-0.3.1/agentloop/mcp_server.py +844 -0
  31. agentloop_profiler-0.3.1/agentloop/optimization_search.py +862 -0
  32. agentloop_profiler-0.3.1/agentloop/optimization_session.py +1075 -0
  33. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/patches.py +172 -4
  34. agentloop_profiler-0.3.1/agentloop/pilot_records.py +469 -0
  35. agentloop_profiler-0.3.1/agentloop/plan_passes.py +330 -0
  36. agentloop_profiler-0.3.1/agentloop/process_tree.py +193 -0
  37. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/ranking.py +45 -1
  38. agentloop_profiler-0.3.1/agentloop/request_reuse.py +395 -0
  39. agentloop_profiler-0.3.1/agentloop/retry_passes.py +439 -0
  40. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/rules.py +20 -3
  41. agentloop_profiler-0.3.1/agentloop/schedule_compiler.py +245 -0
  42. agentloop_profiler-0.3.1/agentloop/session_cli.py +220 -0
  43. agentloop_profiler-0.3.1/agentloop/session_workflow.py +266 -0
  44. agentloop_profiler-0.3.1/agentloop/source_provenance.py +461 -0
  45. agentloop_profiler-0.3.1/agentloop/stage_passes.py +538 -0
  46. agentloop_profiler-0.3.1/agentloop/store.py +83 -0
  47. agentloop_profiler-0.3.1/agentloop/store_common.py +426 -0
  48. agentloop_profiler-0.3.1/agentloop/store_keys.py +81 -0
  49. agentloop_profiler-0.3.1/agentloop/store_postgres.py +726 -0
  50. agentloop_profiler-0.3.1/agentloop/store_sqlite.py +674 -0
  51. agentloop_profiler-0.3.1/agentloop/store_types.py +149 -0
  52. agentloop_profiler-0.3.1/agentloop/system_telemetry.py +355 -0
  53. agentloop_profiler-0.3.1/agentloop/timing_sensitivity.py +407 -0
  54. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/tracer.py +9 -1
  55. agentloop_profiler-0.3.1/agentloop/transformations.py +974 -0
  56. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/version.py +1 -1
  57. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop_profiler.egg-info/PKG-INFO +5 -5
  58. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop_profiler.egg-info/SOURCES.txt +94 -0
  59. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop_profiler.egg-info/requires.txt +1 -1
  60. agentloop_profiler-0.3.1/dashboard/app.py +174 -0
  61. agentloop_profiler-0.3.1/dashboard/common.py +343 -0
  62. agentloop_profiler-0.3.1/dashboard/views/__init__.py +1 -0
  63. agentloop_profiler-0.3.1/dashboard/views/api_keys.py +38 -0
  64. agentloop_profiler-0.3.1/dashboard/views/audit_log.py +41 -0
  65. agentloop_profiler-0.3.1/dashboard/views/ci_runs.py +67 -0
  66. agentloop_profiler-0.3.1/dashboard/views/diagnosis.py +89 -0
  67. agentloop_profiler-0.3.1/dashboard/views/ingest.py +101 -0
  68. agentloop_profiler-0.3.1/dashboard/views/optimization.py +128 -0
  69. agentloop_profiler-0.3.1/dashboard/views/optimization_queue.py +225 -0
  70. agentloop_profiler-0.3.1/dashboard/views/overview.py +124 -0
  71. agentloop_profiler-0.3.1/dashboard/views/patch_plan.py +80 -0
  72. agentloop_profiler-0.3.1/dashboard/views/quality_gates.py +147 -0
  73. agentloop_profiler-0.3.1/dashboard/views/replay_proof.py +38 -0
  74. agentloop_profiler-0.3.1/dashboard/views/setup.py +41 -0
  75. agentloop_profiler-0.3.1/dashboard/views/traces.py +214 -0
  76. agentloop_profiler-0.3.1/dashboard/views/value_pricing.py +51 -0
  77. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/pyproject.toml +48 -2
  78. agentloop_profiler-0.3.1/tests/test_acceptance_gates.py +270 -0
  79. agentloop_profiler-0.3.1/tests/test_cli_long_paths.py +77 -0
  80. agentloop_profiler-0.3.1/tests/test_cli_surface.py +131 -0
  81. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_cli_trace_inputs.py +4 -2
  82. agentloop_profiler-0.3.1/tests/test_conditioned_calibration.py +146 -0
  83. agentloop_profiler-0.3.1/tests/test_content_capture.py +349 -0
  84. agentloop_profiler-0.3.1/tests/test_content_capture_eval.py +37 -0
  85. agentloop_profiler-0.3.1/tests/test_content_capture_langgraph.py +113 -0
  86. agentloop_profiler-0.3.1/tests/test_content_fingerprints.py +327 -0
  87. agentloop_profiler-0.3.1/tests/test_cross_run.py +427 -0
  88. agentloop_profiler-0.3.1/tests/test_cross_run_eval.py +58 -0
  89. agentloop_profiler-0.3.1/tests/test_dashboard_surface.py +96 -0
  90. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_docs_site.py +23 -0
  91. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_estimates.py +8 -1
  92. agentloop_profiler-0.3.1/tests/test_execution_boundary.py +330 -0
  93. agentloop_profiler-0.3.1/tests/test_execution_ir.py +278 -0
  94. agentloop_profiler-0.3.1/tests/test_finding_benchmark_docs.py +176 -0
  95. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_finding_rules.py +2 -0
  96. agentloop_profiler-0.3.1/tests/test_human_pilots.py +179 -0
  97. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_improvement.py +3 -2
  98. agentloop_profiler-0.3.1/tests/test_improvement_public_surface.py +45 -0
  99. agentloop_profiler-0.3.1/tests/test_lazy_imports.py +162 -0
  100. agentloop_profiler-0.3.1/tests/test_lowest_requirements.py +34 -0
  101. agentloop_profiler-0.3.1/tests/test_mcp_cancellation.py +462 -0
  102. agentloop_profiler-0.3.1/tests/test_mcp_server.py +439 -0
  103. agentloop_profiler-0.3.1/tests/test_optimization_benchmark.py +139 -0
  104. agentloop_profiler-0.3.1/tests/test_optimization_benchmark_v04.py +105 -0
  105. agentloop_profiler-0.3.1/tests/test_optimization_search.py +243 -0
  106. agentloop_profiler-0.3.1/tests/test_optimization_session.py +336 -0
  107. agentloop_profiler-0.3.1/tests/test_pilot_records.py +160 -0
  108. agentloop_profiler-0.3.1/tests/test_plan_passes.py +261 -0
  109. agentloop_profiler-0.3.1/tests/test_process_tree.py +109 -0
  110. agentloop_profiler-0.3.1/tests/test_request_reuse.py +337 -0
  111. agentloop_profiler-0.3.1/tests/test_retry_passes.py +242 -0
  112. agentloop_profiler-0.3.1/tests/test_routing_quality_gate.py +191 -0
  113. agentloop_profiler-0.3.1/tests/test_schedule_compiler.py +282 -0
  114. agentloop_profiler-0.3.1/tests/test_search_budgets.py +304 -0
  115. agentloop_profiler-0.3.1/tests/test_session_workflow.py +355 -0
  116. agentloop_profiler-0.3.1/tests/test_source_provenance.py +466 -0
  117. agentloop_profiler-0.3.1/tests/test_stage_passes.py +343 -0
  118. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_store_contract.py +2 -1
  119. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_store_init_cache.py +2 -1
  120. agentloop_profiler-0.3.1/tests/test_store_public_surface.py +116 -0
  121. agentloop_profiler-0.3.1/tests/test_system_telemetry.py +177 -0
  122. agentloop_profiler-0.3.1/tests/test_timing_sensitivity.py +202 -0
  123. agentloop_profiler-0.3.1/tests/test_timing_sensitivity_scale.py +105 -0
  124. agentloop_profiler-0.3.1/tests/test_transformations.py +332 -0
  125. agentloop_profiler-0.2.10/agentloop/__init__.py +0 -136
  126. agentloop_profiler-0.2.10/agentloop/cli.py +0 -1610
  127. agentloop_profiler-0.2.10/agentloop/improvement.py +0 -1262
  128. agentloop_profiler-0.2.10/agentloop/store.py +0 -1943
  129. agentloop_profiler-0.2.10/dashboard/app.py +0 -1447
  130. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/LICENSE +0 -0
  131. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/THIRD_PARTY_LICENSES.md +0 -0
  132. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/ablation_protocol.py +0 -0
  133. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/ablations.py +0 -0
  134. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/aggregate_cli.py +0 -0
  135. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/aggregate_stats.py +0 -0
  136. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/aggregates.py +0 -0
  137. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/audit.py +0 -0
  138. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/autoinstrument.py +0 -0
  139. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/batch_experiments.py +0 -0
  140. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/batching.py +0 -0
  141. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/budget_types.py +0 -0
  142. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/budgets.py +0 -0
  143. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/calibration.py +0 -0
  144. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/checkpoint_state.py +0 -0
  145. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/checkpoint_store.py +0 -0
  146. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/ci.py +0 -0
  147. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/ci_runs.py +0 -0
  148. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/cli_paths.py +0 -0
  149. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/client.py +0 -0
  150. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/completion.py +0 -0
  151. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/completion_types.py +0 -0
  152. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/config.py +0 -0
  153. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/context_controls.py +0 -0
  154. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/context_experiments.py +0 -0
  155. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/context_types.py +0 -0
  156. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/costs.py +0 -0
  157. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/cursor_validation.py +0 -0
  158. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/demo.py +0 -0
  159. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/doctor.py +0 -0
  160. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/drift.py +0 -0
  161. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/drift_cli.py +0 -0
  162. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/drift_types.py +0 -0
  163. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/drift_windows.py +0 -0
  164. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/events.py +0 -0
  165. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/experiment_artifacts.py +0 -0
  166. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/experiment_observations.py +0 -0
  167. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/experiment_reports.py +0 -0
  168. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/experiment_types.py +0 -0
  169. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/experiments.py +0 -0
  170. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/exporters.py +0 -0
  171. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/graph.py +0 -0
  172. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness.py +0 -0
  173. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness_bench/__init__.py +0 -0
  174. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness_bench/cli.py +0 -0
  175. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness_bench/drivers.py +0 -0
  176. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness_bench/offline.py +0 -0
  177. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness_evidence.py +0 -0
  178. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/harness_usage.py +0 -0
  179. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/html_report.py +0 -0
  180. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/http_security.py +0 -0
  181. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/improvement_cli.py +0 -0
  182. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/improvement_init.py +0 -0
  183. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/improvement_report.py +0 -0
  184. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/improvement_verifier.py +0 -0
  185. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/__init__.py +0 -0
  186. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/crewai.py +0 -0
  187. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/__init__.py +0 -0
  188. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/atif.py +0 -0
  189. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/atif_validation.py +0 -0
  190. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/cli.py +0 -0
  191. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/manifest.py +0 -0
  192. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/trial_evidence.py +0 -0
  193. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/trials.py +0 -0
  194. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/harbor/verifier.py +0 -0
  195. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/hermes.py +0 -0
  196. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/hermes_cli.py +0 -0
  197. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/hermes_recorder.py +0 -0
  198. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/langgraph_harness.py +0 -0
  199. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/langgraph_recovery.py +0 -0
  200. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/omnigent/__init__.py +0 -0
  201. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/omnigent/cli.py +0 -0
  202. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/omnigent/evidence.py +0 -0
  203. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/omnigent/telemetry.py +0 -0
  204. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/openai.py +0 -0
  205. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/openai_agents.py +0 -0
  206. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/sdk.py +0 -0
  207. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/integrations/vercel_ai.py +0 -0
  208. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/__init__.py +0 -0
  209. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/artifacts.py +0 -0
  210. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/cli.py +0 -0
  211. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/cohort_evidence.py +0 -0
  212. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/cohorts.py +0 -0
  213. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/contracts.py +0 -0
  214. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/coordination.py +0 -0
  215. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/evidence.py +0 -0
  216. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/otlp_jsonl.py +0 -0
  217. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/otlp_validation.py +0 -0
  218. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/registry.py +0 -0
  219. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interoperability/validation.py +0 -0
  220. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/intervention_service.py +0 -0
  221. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/intervention_store.py +0 -0
  222. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/interventions.py +0 -0
  223. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/issues.py +0 -0
  224. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/judgment_adapters.py +0 -0
  225. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/judgment_benchmark_types.py +0 -0
  226. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/judgment_benchmarks.py +0 -0
  227. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/judgment_types.py +0 -0
  228. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/judgment_views.py +0 -0
  229. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/judgments.py +0 -0
  230. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/loop_guards.py +0 -0
  231. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/loop_types.py +0 -0
  232. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/markdown.py +0 -0
  233. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/metrics.py +0 -0
  234. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/migrations.py +0 -0
  235. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/model_routing.py +0 -0
  236. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/onboarding.py +0 -0
  237. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/operations.py +0 -0
  238. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/optimizer.py +0 -0
  239. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/otel.py +0 -0
  240. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/otel_ids.py +0 -0
  241. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/otel_semantics.py +0 -0
  242. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/parallelism.py +0 -0
  243. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/plan_export.py +0 -0
  244. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/policy_promotion.py +0 -0
  245. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/promotion_evidence.py +0 -0
  246. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/promotion_types.py +0 -0
  247. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/quality.py +0 -0
  248. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/recovery_evidence.py +0 -0
  249. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/repetitions.py +0 -0
  250. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/replay.py +0 -0
  251. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/request_limits.py +0 -0
  252. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/retention.py +0 -0
  253. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/retention_types.py +0 -0
  254. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/reuse_experiments.py +0 -0
  255. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/routing_checks.py +0 -0
  256. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/routing_types.py +0 -0
  257. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/runners/__init__.py +0 -0
  258. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/runners/_common.py +0 -0
  259. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/runners/claude_code.py +0 -0
  260. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/runners/codex.py +0 -0
  261. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/runtime.py +0 -0
  262. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/savings.py +0 -0
  263. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/scheduling_plan.py +0 -0
  264. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/scheduling_types.py +0 -0
  265. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/schema.py +0 -0
  266. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/semantic_rules.py +0 -0
  267. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/semantic_waste.py +0 -0
  268. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/semantic_waste_types.py +0 -0
  269. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/server.py +0 -0
  270. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/structural_experiments.py +0 -0
  271. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/structural_types.py +0 -0
  272. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/structured_quality.py +0 -0
  273. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/studies.py +0 -0
  274. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/study_statistics.py +0 -0
  275. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/substitution_evidence.py +0 -0
  276. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/substitution_export.py +0 -0
  277. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/substitution_reports.py +0 -0
  278. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/substitution_types.py +0 -0
  279. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/substitutions.py +0 -0
  280. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/timing.py +0 -0
  281. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/tokens.py +0 -0
  282. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/tool_scheduling.py +0 -0
  283. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/trace_sources.py +0 -0
  284. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/value.py +0 -0
  285. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/workflow_types.py +0 -0
  286. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop/workflows.py +0 -0
  287. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop_profiler.egg-info/dependency_links.txt +0 -0
  288. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop_profiler.egg-info/entry_points.txt +0 -0
  289. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/agentloop_profiler.egg-info/top_level.txt +0 -0
  290. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/__init__.py +0 -0
  291. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/access.py +0 -0
  292. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/assets/agentloop-logo-dark.svg +0 -0
  293. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/assets/agentloop-logo-light.svg +0 -0
  294. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/assets/agentloop-mark.svg +0 -0
  295. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/streamlit_compat.py +0 -0
  296. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/theme.py +0 -0
  297. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/trace_upload.py +0 -0
  298. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/dashboard/value_view.py +0 -0
  299. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/setup.cfg +0 -0
  300. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_ablations.py +0 -0
  301. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_aggregates.py +0 -0
  302. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_api_versioning.py +0 -0
  303. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_batch_data_pipeline.py +0 -0
  304. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_brand_colours.py +0 -0
  305. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_budgets.py +0 -0
  306. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_bump_version.py +0 -0
  307. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_calibration.py +0 -0
  308. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_capability_registry.py +0 -0
  309. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_checkpoint_recovery.py +0 -0
  310. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_ci_command.py +0 -0
  311. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_ci_evidence.py +0 -0
  312. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_ci_runs.py +0 -0
  313. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_claude_code_runner.py +0 -0
  314. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_cli_output_paths.py +0 -0
  315. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_cli_store_commands.py +0 -0
  316. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_cli_upload.py +0 -0
  317. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_client.py +0 -0
  318. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_client_transport.py +0 -0
  319. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_codex_exec_runner.py +0 -0
  320. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_completion.py +0 -0
  321. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_context_controls.py +0 -0
  322. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_context_reuse_experiments.py +0 -0
  323. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_context_study.py +0 -0
  324. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_costs.py +0 -0
  325. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_crewai_integration.py +0 -0
  326. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_cursor_server.py +0 -0
  327. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_cursor_shape_validation.py +0 -0
  328. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_input_validation.py +0 -0
  329. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_project_access.py +0 -0
  330. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_quality.py +0 -0
  331. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_queue_cache.py +0 -0
  332. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_runs_dir.py +0 -0
  333. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_scale.py +0 -0
  334. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_semantic_waste.py +0 -0
  335. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_structured_quality.py +0 -0
  336. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_theme.py +0 -0
  337. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_trace_upload.py +0 -0
  338. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_value_view.py +0 -0
  339. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dashboard_workflows.py +0 -0
  340. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_decorators.py +0 -0
  341. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_demo_cli.py +0 -0
  342. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_dependabot_config.py +0 -0
  343. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_diagnosis_api.py +0 -0
  344. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_distribution_metadata.py +0 -0
  345. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_doctor_autoinstrument.py +0 -0
  346. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_drift.py +0 -0
  347. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_email_workflow.py +0 -0
  348. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_empirical_calibration.py +0 -0
  349. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_enforcement_conformance.py +0 -0
  350. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_evidence_workflow.py +0 -0
  351. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_experiments.py +0 -0
  352. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_exporters.py +0 -0
  353. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_external_cohorts.py +0 -0
  354. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_finding_benchmarks.py +0 -0
  355. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_finding_identity.py +0 -0
  356. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_first_use_cli.py +0 -0
  357. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_graph.py +0 -0
  358. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_guided_validation.py +0 -0
  359. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_guided_verifier.py +0 -0
  360. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_harbor_atif.py +0 -0
  361. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_harbor_trials.py +0 -0
  362. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_harness.py +0 -0
  363. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_harness_bench.py +0 -0
  364. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_harness_error_usage.py +0 -0
  365. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_harness_evidence.py +0 -0
  366. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_hermes_integration.py +0 -0
  367. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_hermes_replay_capture.py +0 -0
  368. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_hermes_repository_example.py +0 -0
  369. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_hermes_runtime_evidence.py +0 -0
  370. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_html_report.py +0 -0
  371. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_http_security.py +0 -0
  372. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_improvement_init.py +0 -0
  373. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_incident_triage.py +0 -0
  374. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_instrumentation_measurement.py +0 -0
  375. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_integration_conformance.py +0 -0
  376. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_interoperability_contracts.py +0 -0
  377. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_interventions.py +0 -0
  378. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_issues.py +0 -0
  379. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_judgment_adapters.py +0 -0
  380. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_judgment_benchmarks.py +0 -0
  381. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_judgment_evidence.py +0 -0
  382. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_judgment_provider_optional.py +0 -0
  383. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_judgments.py +0 -0
  384. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_langgraph_conformance.py +0 -0
  385. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_langgraph_harness.py +0 -0
  386. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_langgraph_integration.py +0 -0
  387. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_langgraph_recovery.py +0 -0
  388. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_loop_guards.py +0 -0
  389. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_markdown.py +0 -0
  390. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_markdown_exporters.py +0 -0
  391. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_marketplace_workflow.py +0 -0
  392. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_metrics.py +0 -0
  393. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_migrations.py +0 -0
  394. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_model_batching.py +0 -0
  395. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_model_routing.py +0 -0
  396. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_multiagent_coordination.py +0 -0
  397. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_non_agent_study.py +0 -0
  398. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_omnigent_telemetry.py +0 -0
  399. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_onboarding.py +0 -0
  400. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_openai_agents_integration.py +0 -0
  401. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_openai_integration.py +0 -0
  402. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_operations.py +0 -0
  403. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_optimizer.py +0 -0
  404. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_otel_ids.py +0 -0
  405. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_otel_interop.py +0 -0
  406. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_otlp_jsonl.py +0 -0
  407. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_parallelization_evidence.py +0 -0
  408. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_patch_plan.py +0 -0
  409. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_patch_source_scope.py +0 -0
  410. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_payment_review.py +0 -0
  411. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_policy_promotion.py +0 -0
  412. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_published_readme.py +0 -0
  413. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_python_support.py +0 -0
  414. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_quality.py +0 -0
  415. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_ranking.py +0 -0
  416. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_real_agent_study.py +0 -0
  417. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_real_calibration_study.py +0 -0
  418. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_real_harness_study.py +0 -0
  419. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_release_workflows.py +0 -0
  420. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_remote_cli_credentials.py +0 -0
  421. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_repetitions.py +0 -0
  422. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_replay.py +0 -0
  423. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_repository_policy_traversal.py +0 -0
  424. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_request_limits.py +0 -0
  425. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_research_example.py +0 -0
  426. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_retention.py +0 -0
  427. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_retry_recommendations.py +0 -0
  428. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_routing_study.py +0 -0
  429. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_rule_error_privacy.py +0 -0
  430. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_runtime.py +0 -0
  431. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_savings_aggregation.py +0 -0
  432. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_scheduling_study.py +0 -0
  433. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_semantic_findings.py +0 -0
  434. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_semantic_waste.py +0 -0
  435. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_server.py +0 -0
  436. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_standalone_notices.py +0 -0
  437. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_store.py +0 -0
  438. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_streaming_inventory.py +0 -0
  439. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_streamlit_compat.py +0 -0
  440. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_structural_experiments.py +0 -0
  441. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_structured_quality.py +0 -0
  442. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_structured_quality_evidence.py +0 -0
  443. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_studies.py +0 -0
  444. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_substitutions.py +0 -0
  445. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_telemetry_conformance.py +0 -0
  446. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_timing.py +0 -0
  447. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_token_provenance.py +0 -0
  448. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_tool_scheduling.py +0 -0
  449. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_trace_context.py +0 -0
  450. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_trace_failure_recording.py +0 -0
  451. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_trace_schema.py +0 -0
  452. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_usefulness_benchmark.py +0 -0
  453. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_value.py +0 -0
  454. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_vercel_ai_integration.py +0 -0
  455. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_workflow_storage.py +0 -0
  456. {agentloop_profiler-0.2.10 → agentloop_profiler-0.3.1}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentloop-profiler
3
- Version: 0.2.10
3
+ Version: 0.3.1
4
4
  Summary: Profiler and optimization layer for AI agent execution graphs
5
5
  Author: Dipesh Tharu Mahato
6
6
  License-Expression: Apache-2.0
@@ -28,7 +28,7 @@ Requires-Python: >=3.11
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  License-File: THIRD_PARTY_LICENSES.md
31
- Requires-Dist: typer>=0.12.0
31
+ Requires-Dist: typer>=0.16.0
32
32
  Requires-Dist: rich>=13.0.0
33
33
  Provides-Extra: dashboard
34
34
  Requires-Dist: streamlit>=1.34.0; extra == "dashboard"
@@ -534,13 +534,13 @@ where the examples show `agentloop`.
534
534
  <summary>Download and verify a standalone executable</summary>
535
535
 
536
536
  Download the executable and `SHA256SUMS` from the same release. These examples use
537
- version 0.2.10. Change the version when choosing another release.
537
+ version 0.3.1. Change the version when choosing another release.
538
538
 
539
539
  Linux (Bash):
540
540
 
541
541
  ```bash
542
542
  set -euo pipefail
543
- version=0.2.10
543
+ version=0.3.1
544
544
  asset="agentloop-v${version}-linux-x86_64"
545
545
  curl --fail --location --remote-name "https://github.com/dipeshbabu/agentloop/releases/download/v${version}/${asset}"
546
546
  curl --fail --location --remote-name "https://github.com/dipeshbabu/agentloop/releases/download/v${version}/SHA256SUMS"
@@ -557,7 +557,7 @@ chmod +x "$asset"
557
557
  Windows PowerShell:
558
558
 
559
559
  ```powershell
560
- $Version = "0.2.10"
560
+ $Version = "0.3.1"
561
561
  $Asset = "agentloop-v$Version-windows-x86_64.exe"
562
562
  Invoke-WebRequest "https://github.com/dipeshbabu/agentloop/releases/download/v$Version/$Asset" -OutFile agentloop.exe
563
563
  Invoke-WebRequest "https://github.com/dipeshbabu/agentloop/releases/download/v$Version/SHA256SUMS" -OutFile SHA256SUMS
@@ -476,13 +476,13 @@ where the examples show `agentloop`.
476
476
  <summary>Download and verify a standalone executable</summary>
477
477
 
478
478
  Download the executable and `SHA256SUMS` from the same release. These examples use
479
- version 0.2.10. Change the version when choosing another release.
479
+ version 0.3.1. Change the version when choosing another release.
480
480
 
481
481
  Linux (Bash):
482
482
 
483
483
  ```bash
484
484
  set -euo pipefail
485
- version=0.2.10
485
+ version=0.3.1
486
486
  asset="agentloop-v${version}-linux-x86_64"
487
487
  curl --fail --location --remote-name "https://github.com/dipeshbabu/agentloop/releases/download/v${version}/${asset}"
488
488
  curl --fail --location --remote-name "https://github.com/dipeshbabu/agentloop/releases/download/v${version}/SHA256SUMS"
@@ -499,7 +499,7 @@ chmod +x "$asset"
499
499
  Windows PowerShell:
500
500
 
501
501
  ```powershell
502
- $Version = "0.2.10"
502
+ $Version = "0.3.1"
503
503
  $Asset = "agentloop-v$Version-windows-x86_64.exe"
504
504
  Invoke-WebRequest "https://github.com/dipeshbabu/agentloop/releases/download/v$Version/$Asset" -OutFile agentloop.exe
505
505
  Invoke-WebRequest "https://github.com/dipeshbabu/agentloop/releases/download/v$Version/SHA256SUMS" -OutFile SHA256SUMS
@@ -0,0 +1,243 @@
1
+ """AgentLoop: trace agent execution and verify improvements.
2
+
3
+ Public names load on first use, so ``import agentloop`` and imports of
4
+ ``agentloop.tracer`` and other submodules stay cheap for applications that
5
+ only record traces.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from importlib import import_module
11
+ from typing import TYPE_CHECKING, Any
12
+
13
+ from agentloop.version import __version__
14
+
15
+ if TYPE_CHECKING:
16
+ from agentloop.autoinstrument import (
17
+ DetectionResult,
18
+ InstrumentationResult,
19
+ auto_instrument,
20
+ detect_integrations,
21
+ instrument,
22
+ )
23
+ from agentloop.client import AgentLoopClient, AgentLoopClientError
24
+ from agentloop.content_fingerprints import content_metadata, record_content
25
+ from agentloop.decorators import trace_model, trace_tool, traceable
26
+ from agentloop.doctor import run_doctor
27
+ from agentloop.findings import build_diagnosis
28
+ from agentloop.judgment_types import (
29
+ JudgeIdentity,
30
+ JudgeUsage,
31
+ JudgmentAnswer,
32
+ JudgmentBackend,
33
+ JudgmentEvidence,
34
+ JudgmentRequest,
35
+ JudgmentSpec,
36
+ JudgmentUncertainty,
37
+ )
38
+ from agentloop.judgments import (
39
+ JudgmentSession,
40
+ LocalCallbackJudge,
41
+ attach_judgment,
42
+ judgment_request,
43
+ read_judgments,
44
+ )
45
+ from agentloop.otel import trace_from_otel, trace_to_otel, traces_from_otel
46
+ from agentloop.patches import RepositoryPathError, build_patch_plan
47
+ from agentloop.replay import ReplayGates, build_replay_report
48
+ from agentloop.retention import (
49
+ RetentionContext,
50
+ RetentionPolicy,
51
+ RetentionSession,
52
+ read_retention,
53
+ )
54
+ from agentloop.runtime import (
55
+ CLEAR,
56
+ FinalizationError,
57
+ get_last_error,
58
+ get_runtime_config,
59
+ init,
60
+ reset_runtime,
61
+ )
62
+ from agentloop.semantic_waste import evaluate_semantic_waste, read_semantic_waste
63
+ from agentloop.semantic_waste_types import SemanticInvestigation
64
+ from agentloop.structured_quality import attach_quality_report
65
+ from agentloop.tracer import (
66
+ AgentTrace,
67
+ bind_trace_context,
68
+ current_trace,
69
+ record_model_call,
70
+ record_tool_call,
71
+ trace_agent,
72
+ trace_model_call,
73
+ trace_retry,
74
+ trace_tool_call,
75
+ )
76
+ from agentloop.value import build_value_report
77
+ from agentloop.workflows import (
78
+ ExecutionTrace,
79
+ StageInfo,
80
+ WorkflowInfo,
81
+ operation_metadata,
82
+ record_operation,
83
+ set_workflow_outcome,
84
+ trace_operation,
85
+ trace_workflow,
86
+ workflow_metadata,
87
+ )
88
+
89
+ # Public name -> the module that defines it.
90
+ _EXPORTS: dict[str, str] = {
91
+ "DetectionResult": "agentloop.autoinstrument",
92
+ "InstrumentationResult": "agentloop.autoinstrument",
93
+ "auto_instrument": "agentloop.autoinstrument",
94
+ "detect_integrations": "agentloop.autoinstrument",
95
+ "instrument": "agentloop.autoinstrument",
96
+ "AgentLoopClient": "agentloop.client",
97
+ "AgentLoopClientError": "agentloop.client",
98
+ "content_metadata": "agentloop.content_fingerprints",
99
+ "record_content": "agentloop.content_fingerprints",
100
+ "trace_model": "agentloop.decorators",
101
+ "trace_tool": "agentloop.decorators",
102
+ "traceable": "agentloop.decorators",
103
+ "run_doctor": "agentloop.doctor",
104
+ "build_diagnosis": "agentloop.findings",
105
+ "JudgeIdentity": "agentloop.judgment_types",
106
+ "JudgeUsage": "agentloop.judgment_types",
107
+ "JudgmentAnswer": "agentloop.judgment_types",
108
+ "JudgmentBackend": "agentloop.judgment_types",
109
+ "JudgmentEvidence": "agentloop.judgment_types",
110
+ "JudgmentRequest": "agentloop.judgment_types",
111
+ "JudgmentSpec": "agentloop.judgment_types",
112
+ "JudgmentUncertainty": "agentloop.judgment_types",
113
+ "JudgmentSession": "agentloop.judgments",
114
+ "LocalCallbackJudge": "agentloop.judgments",
115
+ "attach_judgment": "agentloop.judgments",
116
+ "judgment_request": "agentloop.judgments",
117
+ "read_judgments": "agentloop.judgments",
118
+ "trace_from_otel": "agentloop.otel",
119
+ "trace_to_otel": "agentloop.otel",
120
+ "traces_from_otel": "agentloop.otel",
121
+ "RepositoryPathError": "agentloop.patches",
122
+ "build_patch_plan": "agentloop.patches",
123
+ "ReplayGates": "agentloop.replay",
124
+ "build_replay_report": "agentloop.replay",
125
+ "RetentionContext": "agentloop.retention",
126
+ "RetentionPolicy": "agentloop.retention",
127
+ "RetentionSession": "agentloop.retention",
128
+ "read_retention": "agentloop.retention",
129
+ "CLEAR": "agentloop.runtime",
130
+ "FinalizationError": "agentloop.runtime",
131
+ "get_last_error": "agentloop.runtime",
132
+ "get_runtime_config": "agentloop.runtime",
133
+ "init": "agentloop.runtime",
134
+ "reset_runtime": "agentloop.runtime",
135
+ "evaluate_semantic_waste": "agentloop.semantic_waste",
136
+ "read_semantic_waste": "agentloop.semantic_waste",
137
+ "SemanticInvestigation": "agentloop.semantic_waste_types",
138
+ "attach_quality_report": "agentloop.structured_quality",
139
+ "AgentTrace": "agentloop.tracer",
140
+ "bind_trace_context": "agentloop.tracer",
141
+ "current_trace": "agentloop.tracer",
142
+ "record_model_call": "agentloop.tracer",
143
+ "record_tool_call": "agentloop.tracer",
144
+ "trace_agent": "agentloop.tracer",
145
+ "trace_model_call": "agentloop.tracer",
146
+ "trace_retry": "agentloop.tracer",
147
+ "trace_tool_call": "agentloop.tracer",
148
+ "build_value_report": "agentloop.value",
149
+ "ExecutionTrace": "agentloop.workflows",
150
+ "StageInfo": "agentloop.workflows",
151
+ "WorkflowInfo": "agentloop.workflows",
152
+ "operation_metadata": "agentloop.workflows",
153
+ "record_operation": "agentloop.workflows",
154
+ "set_workflow_outcome": "agentloop.workflows",
155
+ "trace_operation": "agentloop.workflows",
156
+ "trace_workflow": "agentloop.workflows",
157
+ "workflow_metadata": "agentloop.workflows",
158
+ }
159
+
160
+ __all__ = [
161
+ "SemanticInvestigation",
162
+ "evaluate_semantic_waste",
163
+ "read_semantic_waste",
164
+ "JudgeIdentity",
165
+ "JudgeUsage",
166
+ "JudgmentAnswer",
167
+ "JudgmentBackend",
168
+ "JudgmentEvidence",
169
+ "JudgmentRequest",
170
+ "JudgmentSpec",
171
+ "JudgmentUncertainty",
172
+ "JudgmentSession",
173
+ "LocalCallbackJudge",
174
+ "attach_judgment",
175
+ "judgment_request",
176
+ "read_judgments",
177
+ "AgentLoopClient",
178
+ "AgentLoopClientError",
179
+ "AgentTrace",
180
+ "attach_quality_report",
181
+ "ExecutionTrace",
182
+ "StageInfo",
183
+ "WorkflowInfo",
184
+ "operation_metadata",
185
+ "record_operation",
186
+ "set_workflow_outcome",
187
+ "trace_operation",
188
+ "trace_workflow",
189
+ "workflow_metadata",
190
+ "CLEAR",
191
+ "FinalizationError",
192
+ "DetectionResult",
193
+ "InstrumentationResult",
194
+ "ReplayGates",
195
+ "RetentionContext",
196
+ "RetentionPolicy",
197
+ "RetentionSession",
198
+ "read_retention",
199
+ "RepositoryPathError",
200
+ "auto_instrument",
201
+ "bind_trace_context",
202
+ "detect_integrations",
203
+ "instrument",
204
+ "build_value_report",
205
+ "content_metadata",
206
+ "build_diagnosis",
207
+ "build_patch_plan",
208
+ "build_replay_report",
209
+ "current_trace",
210
+ "get_last_error",
211
+ "get_runtime_config",
212
+ "init",
213
+ "record_content",
214
+ "record_model_call",
215
+ "record_tool_call",
216
+ "reset_runtime",
217
+ "run_doctor",
218
+ "trace_agent",
219
+ "trace_from_otel",
220
+ "traces_from_otel",
221
+ "trace_model",
222
+ "trace_model_call",
223
+ "trace_tool",
224
+ "trace_tool_call",
225
+ "trace_retry",
226
+ "traceable",
227
+ "trace_to_otel",
228
+ "__version__",
229
+ ]
230
+
231
+
232
+ def __getattr__(name: str) -> Any:
233
+ module = _EXPORTS.get(name)
234
+ if module is None:
235
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
236
+ value = getattr(import_module(module), name)
237
+ # Cache it so later lookups skip this function.
238
+ globals()[name] = value
239
+ return value
240
+
241
+
242
+ def __dir__() -> list[str]:
243
+ return sorted({*globals(), *__all__})
@@ -0,0 +1,310 @@
1
+ """A frozen acceptance contract for held-out optimization evidence (issue #435).
2
+
3
+ A positive mean difference is not an improvement. Timing noise between
4
+ identical runs can be large, a tiny gain may not be worth a change, and
5
+ "quality didn't drop" can approve a candidate whose baseline was already
6
+ wrong. An :class:`AcceptanceContract` is fixed before any candidate is chosen
7
+ and states what a recommendation needs:
8
+
9
+ * **Absolute quality.** Every held-out run of the candidate must reach
10
+ ``min_quality``; a baseline that fails the task too does not excuse it.
11
+ * **Relative quality.** No case may drop more than ``max_quality_drop`` below
12
+ its paired baseline.
13
+ * **Completion and side effects.** Every candidate run must complete, and
14
+ each ``required_checks`` entry must be reported ``True`` in its result's
15
+ ``checks``.
16
+ * **Practical effect with uncertainty.** Each case runs ``repetitions``
17
+ times as a counterbalanced pair. Relative gains are averaged within a case
18
+ first, so repetitions are never counted as independent tasks; a bootstrap
19
+ over cases then gives an interval. It must lie wholly at or above
20
+ ``min_improvement_pct``, from at least ``min_tasks`` cases.
21
+ * **Secondary limits.** Each metric in ``secondary_limits`` may regress by at
22
+ most that percentage (case means); the primary metric's
23
+ ``tail_quantile`` may regress by at most ``max_tail_regression_pct``.
24
+
25
+ The verdict is ``accepted``, ``rejected`` (evidence against: a quality,
26
+ completion or limit failure, or an interval wholly below the threshold) or
27
+ ``indeterminate`` (not enough evidence either way: missing values, too few
28
+ cases, or an interval that straddles the threshold). Unknown values never
29
+ count as passing. The interval describes these cases under these conditions;
30
+ it is not a guarantee about other workloads.
31
+ """
32
+
33
+ from __future__ import annotations
34
+
35
+ import math
36
+ from collections import defaultdict
37
+ from collections.abc import Mapping, Sequence
38
+ from dataclasses import dataclass, field
39
+ from typing import Any, TypeGuard
40
+
41
+ from agentloop.study_statistics import task_weighted_summary
42
+
43
+ SCHEMA = "agentloop.acceptance/v1"
44
+
45
+
46
+ class AcceptanceError(ValueError):
47
+ """An acceptance contract is invalid."""
48
+
49
+
50
+ def _finite(value: Any) -> TypeGuard[float]:
51
+ return not isinstance(value, bool) and isinstance(value, int | float) and math.isfinite(value)
52
+
53
+
54
+ @dataclass(frozen=True)
55
+ class AcceptanceContract:
56
+ min_improvement_pct: float
57
+ min_quality: float | None = None
58
+ max_quality_drop: float = 0.0
59
+ required_checks: Sequence[str] = ()
60
+ repetitions: int = 3
61
+ min_tasks: int = 5
62
+ secondary_limits: Mapping[str, float] = field(default_factory=dict)
63
+ tail_quantile: float = 0.9
64
+ max_tail_regression_pct: float | None = None
65
+ confidence: float = 0.95
66
+ bootstrap_samples: int = 2000
67
+ seed: int = 0
68
+
69
+ def __post_init__(self) -> None:
70
+ if not _finite(self.min_improvement_pct) or not 0 <= self.min_improvement_pct < 100:
71
+ raise AcceptanceError("min_improvement_pct must be from 0 up to 100")
72
+ if self.min_quality is not None and not _finite(self.min_quality):
73
+ raise AcceptanceError("min_quality must be a finite number when set")
74
+ if not _finite(self.max_quality_drop) or not 0 <= self.max_quality_drop <= 1:
75
+ raise AcceptanceError("max_quality_drop must be from 0 to 1")
76
+ checks = tuple(self.required_checks)
77
+ if (
78
+ isinstance(self.required_checks, str)
79
+ or not all(isinstance(name, str) and name for name in checks)
80
+ or len(set(checks)) != len(checks)
81
+ ):
82
+ raise AcceptanceError("required_checks must be distinct, nonempty names")
83
+ object.__setattr__(self, "required_checks", checks)
84
+ if type(self.repetitions) is not int or not 1 <= self.repetitions <= 100:
85
+ raise AcceptanceError("repetitions must be an integer from 1 to 100")
86
+ if type(self.min_tasks) is not int or not 2 <= self.min_tasks <= 10_000:
87
+ raise AcceptanceError("min_tasks must be an integer of at least 2")
88
+ limits = dict(self.secondary_limits)
89
+ for metric, allowed in limits.items():
90
+ if not isinstance(metric, str) or not metric or not _finite(allowed) or allowed < 0:
91
+ raise AcceptanceError("secondary_limits maps metric names to allowed regression %")
92
+ object.__setattr__(self, "secondary_limits", limits)
93
+ if not _finite(self.tail_quantile) or not 0.5 <= self.tail_quantile < 1:
94
+ raise AcceptanceError("tail_quantile must be from 0.5 up to 1")
95
+ tail = self.max_tail_regression_pct
96
+ if tail is not None and (not _finite(tail) or tail < 0):
97
+ raise AcceptanceError("max_tail_regression_pct must be a non-negative number")
98
+ if not _finite(self.confidence) or not 0.5 <= self.confidence < 1:
99
+ raise AcceptanceError("confidence must be from 0.5 up to 1")
100
+ if type(self.bootstrap_samples) is not int or not 200 <= self.bootstrap_samples <= 100_000:
101
+ raise AcceptanceError("bootstrap_samples must be from 200 to 100000")
102
+ if type(self.seed) is not int:
103
+ raise AcceptanceError("seed must be an integer")
104
+
105
+ def frozen(self) -> dict[str, Any]:
106
+ return {
107
+ "schema": SCHEMA,
108
+ "min_improvement_pct": self.min_improvement_pct,
109
+ "min_quality": self.min_quality,
110
+ "max_quality_drop": self.max_quality_drop,
111
+ "required_checks": list(self.required_checks),
112
+ "repetitions": self.repetitions,
113
+ "min_tasks": self.min_tasks,
114
+ "secondary_limits": dict(sorted(self.secondary_limits.items())),
115
+ "tail_quantile": self.tail_quantile,
116
+ "max_tail_regression_pct": self.max_tail_regression_pct,
117
+ "confidence": self.confidence,
118
+ "bootstrap_samples": self.bootstrap_samples,
119
+ "seed": self.seed,
120
+ }
121
+
122
+
123
+ def _quantile(values: list[float], fraction: float) -> float:
124
+ ordered = sorted(values)
125
+ position = (len(ordered) - 1) * fraction
126
+ low = int(position)
127
+ high = min(low + 1, len(ordered) - 1)
128
+ return ordered[low] + (ordered[high] - ordered[low]) * (position - low)
129
+
130
+
131
+ def _change_pct(baseline: float, candidate: float, direction: str) -> float | None:
132
+ """Relative improvement of candidate over baseline, in percent (positive is better)."""
133
+ if baseline <= 0:
134
+ return None
135
+ gain = (baseline - candidate) if direction == "min" else (candidate - baseline)
136
+ return 100.0 * gain / baseline
137
+
138
+
139
+ def evaluate_acceptance(
140
+ contract: AcceptanceContract,
141
+ pairs: Sequence[Mapping[str, Any]],
142
+ *,
143
+ primary: str,
144
+ direction: str = "min",
145
+ directions: Mapping[str, str] | None = None,
146
+ ) -> dict[str, Any]:
147
+ """Judge paired held-out evidence against a frozen contract.
148
+
149
+ Each pair is ``{"case", "repetition", "baseline", "candidate"}``, where each
150
+ side is an attempt record: ``status`` (``"ok"`` when it completed),
151
+ ``metrics`` and optionally ``checks``. Every planned pair must be passed,
152
+ including failed ones: they are part of the denominator.
153
+ """
154
+ directions = dict(directions or {})
155
+ rejected: list[str] = []
156
+ unknown: list[str] = []
157
+ gains: list[tuple[str, float | None]] = []
158
+ secondary: dict[str, list[tuple[str, float | None]]] = defaultdict(list)
159
+ tail_values: dict[str, list[float]] = {"baseline": [], "candidate": []}
160
+ baseline_below_floor = 0
161
+ for pair in pairs:
162
+ case = str(pair["case"])
163
+ base, cand = pair["baseline"], pair["candidate"]
164
+ label = f"case {case} repetition {pair.get('repetition', 0)}"
165
+ if cand.get("status") != "ok":
166
+ rejected.append(f"{label}: the candidate did not complete ({cand.get('status')})")
167
+ gains.append((case, None))
168
+ continue
169
+ if base.get("status") != "ok":
170
+ unknown.append(f"{label}: the baseline did not complete ({base.get('status')})")
171
+ gains.append((case, None))
172
+ continue
173
+ bm, cm = base.get("metrics") or {}, cand.get("metrics") or {}
174
+ bq, cq = bm.get("quality"), cm.get("quality")
175
+ if not (_finite(bq) and _finite(cq)):
176
+ unknown.append(f"{label}: quality is missing")
177
+ else:
178
+ if contract.min_quality is not None:
179
+ if cq < contract.min_quality:
180
+ rejected.append(
181
+ f"{label}: candidate quality {cq:g} is below the required {contract.min_quality:g}"
182
+ )
183
+ if bq < contract.min_quality:
184
+ baseline_below_floor += 1
185
+ if bq - cq > contract.max_quality_drop + 1e-12:
186
+ rejected.append(f"{label}: quality fell {bq - cq:g} below the paired baseline")
187
+ checks = cand.get("checks") or {}
188
+ for name in contract.required_checks:
189
+ if name not in checks:
190
+ unknown.append(f"{label}: check {name!r} was not reported")
191
+ elif checks[name] is not True:
192
+ rejected.append(f"{label}: check {name!r} failed")
193
+ b, c = bm.get(primary), cm.get(primary)
194
+ gain = None
195
+ if _finite(b) and _finite(c):
196
+ gain = _change_pct(b, c, direction)
197
+ if gain is not None:
198
+ tail_values["baseline"].append(float(b))
199
+ tail_values["candidate"].append(float(c))
200
+ if gain is None:
201
+ unknown.append(f"{label}: {primary} is missing or its baseline is not positive")
202
+ gains.append((case, gain))
203
+ for metric in contract.secondary_limits:
204
+ sb, sc = bm.get(metric), cm.get(metric)
205
+ change = (
206
+ _change_pct(sb, sc, directions.get(metric, "min"))
207
+ if _finite(sb) and _finite(sc)
208
+ else None
209
+ )
210
+ if change is None and _finite(sb) and _finite(sc) and sb == sc == 0:
211
+ change = 0.0 # zero both sides: no regression
212
+ if change is None:
213
+ unknown.append(f"{label}: {metric} is missing or its baseline is not positive")
214
+ secondary[metric].append((case, None if change is None else -change))
215
+
216
+ settings = {
217
+ "confidence": contract.confidence,
218
+ "samples": contract.bootstrap_samples,
219
+ "seed": contract.seed,
220
+ }
221
+ effect = task_weighted_summary(gains, settings)
222
+ interval = effect["interval"]
223
+ tasks = interval["task_count"]
224
+ threshold = contract.min_improvement_pct
225
+ effect_status = "unknown"
226
+ if tasks < contract.min_tasks:
227
+ unknown.append(
228
+ f"{tasks} cases have a measured {primary} change; the contract needs {contract.min_tasks}"
229
+ )
230
+ elif interval["status"] != "computed":
231
+ unknown.append("the improvement interval could not be computed")
232
+ else:
233
+ lower, upper = interval["lower"], interval["upper"]
234
+ if upper < threshold or upper <= 0:
235
+ effect_status = "below_threshold"
236
+ rejected.append(
237
+ f"the {primary} improvement interval [{lower:.2f}%, {upper:.2f}%] is below the "
238
+ f"required {threshold:g}%"
239
+ )
240
+ elif lower >= threshold and lower > 0:
241
+ effect_status = "meets_threshold"
242
+ else:
243
+ effect_status = "straddles_threshold"
244
+ unknown.append(
245
+ f"the {primary} improvement interval [{lower:.2f}%, {upper:.2f}%] overlaps the "
246
+ f"required {threshold:g}%; more paired evidence is needed"
247
+ )
248
+
249
+ limits = {}
250
+ for metric, allowed in contract.secondary_limits.items():
251
+ summary = task_weighted_summary(secondary[metric], settings)
252
+ regression = summary["task_summary"]["mean"]
253
+ complete = summary["observation_summary"]["missing_count"] == 0
254
+ limits[metric] = {
255
+ "allowed_regression_pct": allowed,
256
+ "mean_regression_pct": regression,
257
+ "complete": complete,
258
+ }
259
+ if regression is not None and regression > allowed + 1e-9:
260
+ rejected.append(
261
+ f"{metric} regressed {regression:.2f}% on average; {allowed:g}% is allowed"
262
+ )
263
+
264
+ tail = None
265
+ if contract.max_tail_regression_pct is not None:
266
+ if tail_values["baseline"] and tail_values["candidate"]:
267
+ q_base = _quantile(tail_values["baseline"], contract.tail_quantile)
268
+ q_cand = _quantile(tail_values["candidate"], contract.tail_quantile)
269
+ change = _change_pct(q_base, q_cand, direction)
270
+ regression = None if change is None else -change
271
+ tail = {
272
+ "quantile": contract.tail_quantile,
273
+ "baseline": q_base,
274
+ "candidate": q_cand,
275
+ "regression_pct": regression,
276
+ "allowed_regression_pct": contract.max_tail_regression_pct,
277
+ }
278
+ if regression is None:
279
+ unknown.append(f"the {primary} tail baseline is not positive")
280
+ elif regression > contract.max_tail_regression_pct + 1e-9:
281
+ rejected.append(
282
+ f"{primary} p{round(contract.tail_quantile * 100)} regressed "
283
+ f"{regression:.2f}%; {contract.max_tail_regression_pct:g}% is allowed"
284
+ )
285
+ else:
286
+ unknown.append(f"no paired {primary} values to judge the tail")
287
+
288
+ verdict = "rejected" if rejected else "indeterminate" if unknown else "accepted"
289
+ return {
290
+ "schema": SCHEMA,
291
+ "verdict": verdict,
292
+ "contract": contract.frozen(),
293
+ "primary": {"metric": primary, "direction": direction},
294
+ "pairs": len(pairs),
295
+ "effect": {
296
+ "status": effect_status,
297
+ "unit": "percent improvement over the paired baseline, averaged per case",
298
+ "case_summary": effect["task_summary"],
299
+ "interval": interval,
300
+ "planned_cases": effect["planned_task_count"],
301
+ },
302
+ "secondary_limits": limits,
303
+ "tail": tail,
304
+ "baseline_runs_below_quality_floor": baseline_below_floor,
305
+ "rejected_because": rejected[:50],
306
+ "indeterminate_because": unknown[:50],
307
+ }
308
+
309
+
310
+ __all__ = ["SCHEMA", "AcceptanceContract", "AcceptanceError", "evaluate_acceptance"]