agentloop-profiler 0.2.3__tar.gz → 0.2.4__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 (333) hide show
  1. {agentloop_profiler-0.2.3/agentloop_profiler.egg-info → agentloop_profiler-0.2.4}/PKG-INFO +1 -1
  2. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/estimates.py +13 -1
  3. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/findings.py +8 -1
  4. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/graph.py +2 -1
  5. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/improvement.py +215 -40
  6. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/improvement_cli.py +46 -7
  7. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/improvement_report.py +170 -40
  8. agentloop_profiler-0.2.4/agentloop/improvement_verifier.py +95 -0
  9. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/parallelism.py +60 -3
  10. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/patches.py +16 -2
  11. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/rules.py +11 -5
  12. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/version.py +1 -1
  13. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4/agentloop_profiler.egg-info}/PKG-INFO +1 -1
  14. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop_profiler.egg-info/SOURCES.txt +2 -0
  15. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/pyproject.toml +1 -1
  16. agentloop_profiler-0.2.4/tests/test_guided_verifier.py +169 -0
  17. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_improvement.py +159 -1
  18. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_improvement_init.py +1 -1
  19. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_parallelization_evidence.py +43 -0
  20. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_patch_plan.py +1 -1
  21. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/LICENSE +0 -0
  22. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/README.md +0 -0
  23. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/THIRD_PARTY_LICENSES.md +0 -0
  24. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/__init__.py +0 -0
  25. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/ablation_protocol.py +0 -0
  26. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/ablations.py +0 -0
  27. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/aggregate_cli.py +0 -0
  28. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/aggregate_stats.py +0 -0
  29. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/aggregates.py +0 -0
  30. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/audit.py +0 -0
  31. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/autoinstrument.py +0 -0
  32. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/batch_experiments.py +0 -0
  33. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/batching.py +0 -0
  34. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/budget_types.py +0 -0
  35. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/budgets.py +0 -0
  36. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/calibration.py +0 -0
  37. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/checkpoint_state.py +0 -0
  38. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/checkpoint_store.py +0 -0
  39. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/ci.py +0 -0
  40. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/cli.py +0 -0
  41. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/cli_paths.py +0 -0
  42. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/client.py +0 -0
  43. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/completion.py +0 -0
  44. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/completion_types.py +0 -0
  45. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/config.py +0 -0
  46. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/context_controls.py +0 -0
  47. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/context_experiments.py +0 -0
  48. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/context_types.py +0 -0
  49. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/costs.py +0 -0
  50. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/cursor_validation.py +0 -0
  51. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/decorators.py +0 -0
  52. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/demo.py +0 -0
  53. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/doctor.py +0 -0
  54. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/drift.py +0 -0
  55. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/drift_cli.py +0 -0
  56. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/drift_types.py +0 -0
  57. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/drift_windows.py +0 -0
  58. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/entrypoint.py +0 -0
  59. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/events.py +0 -0
  60. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/experiment_artifacts.py +0 -0
  61. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/experiment_observations.py +0 -0
  62. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/experiment_reports.py +0 -0
  63. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/experiment_types.py +0 -0
  64. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/experiments.py +0 -0
  65. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/exporters.py +0 -0
  66. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/finding_benchmark_types.py +0 -0
  67. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/finding_benchmarks.py +0 -0
  68. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness.py +0 -0
  69. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness_bench/__init__.py +0 -0
  70. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness_bench/cli.py +0 -0
  71. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness_bench/drivers.py +0 -0
  72. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness_bench/offline.py +0 -0
  73. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness_evidence.py +0 -0
  74. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/harness_usage.py +0 -0
  75. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/html_report.py +0 -0
  76. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/improvement_init.py +0 -0
  77. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/__init__.py +0 -0
  78. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/crewai.py +0 -0
  79. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/__init__.py +0 -0
  80. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/atif.py +0 -0
  81. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/atif_validation.py +0 -0
  82. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/cli.py +0 -0
  83. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/manifest.py +0 -0
  84. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/trial_evidence.py +0 -0
  85. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/trials.py +0 -0
  86. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/harbor/verifier.py +0 -0
  87. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/hermes.py +0 -0
  88. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/hermes_cli.py +0 -0
  89. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/hermes_recorder.py +0 -0
  90. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/langgraph.py +0 -0
  91. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/langgraph_harness.py +0 -0
  92. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/langgraph_recovery.py +0 -0
  93. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/omnigent/__init__.py +0 -0
  94. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/omnigent/cli.py +0 -0
  95. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/omnigent/evidence.py +0 -0
  96. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/omnigent/telemetry.py +0 -0
  97. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/openai.py +0 -0
  98. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/openai_agents.py +0 -0
  99. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/sdk.py +0 -0
  100. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/integrations/vercel_ai.py +0 -0
  101. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/__init__.py +0 -0
  102. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/artifacts.py +0 -0
  103. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/cli.py +0 -0
  104. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/cohort_evidence.py +0 -0
  105. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/cohorts.py +0 -0
  106. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/contracts.py +0 -0
  107. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/coordination.py +0 -0
  108. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/evidence.py +0 -0
  109. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/otlp_jsonl.py +0 -0
  110. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/otlp_validation.py +0 -0
  111. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/registry.py +0 -0
  112. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interoperability/validation.py +0 -0
  113. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/intervention_service.py +0 -0
  114. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/intervention_store.py +0 -0
  115. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/interventions.py +0 -0
  116. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/issues.py +0 -0
  117. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/judgment_adapters.py +0 -0
  118. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/judgment_benchmark_types.py +0 -0
  119. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/judgment_benchmarks.py +0 -0
  120. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/judgment_types.py +0 -0
  121. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/judgment_views.py +0 -0
  122. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/judgments.py +0 -0
  123. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/loop_guards.py +0 -0
  124. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/loop_types.py +0 -0
  125. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/markdown.py +0 -0
  126. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/metrics.py +0 -0
  127. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/migrations.py +0 -0
  128. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/model_routing.py +0 -0
  129. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/onboarding.py +0 -0
  130. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/operations.py +0 -0
  131. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/optimizer.py +0 -0
  132. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/otel.py +0 -0
  133. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/otel_ids.py +0 -0
  134. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/otel_semantics.py +0 -0
  135. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/plan_export.py +0 -0
  136. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/policy_promotion.py +0 -0
  137. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/promotion_evidence.py +0 -0
  138. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/promotion_types.py +0 -0
  139. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/quality.py +0 -0
  140. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/ranking.py +0 -0
  141. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/recovery_evidence.py +0 -0
  142. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/repetitions.py +0 -0
  143. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/replay.py +0 -0
  144. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/retention.py +0 -0
  145. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/retention_types.py +0 -0
  146. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/reuse_experiments.py +0 -0
  147. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/routing_checks.py +0 -0
  148. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/routing_types.py +0 -0
  149. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/runtime.py +0 -0
  150. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/savings.py +0 -0
  151. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/scheduling_plan.py +0 -0
  152. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/scheduling_types.py +0 -0
  153. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/schema.py +0 -0
  154. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/semantic_rules.py +0 -0
  155. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/semantic_waste.py +0 -0
  156. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/semantic_waste_types.py +0 -0
  157. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/server.py +0 -0
  158. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/store.py +0 -0
  159. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/structural_experiments.py +0 -0
  160. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/structural_types.py +0 -0
  161. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/structured_quality.py +0 -0
  162. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/studies.py +0 -0
  163. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/study_statistics.py +0 -0
  164. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/substitution_evidence.py +0 -0
  165. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/substitution_export.py +0 -0
  166. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/substitution_reports.py +0 -0
  167. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/substitution_types.py +0 -0
  168. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/substitutions.py +0 -0
  169. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/timing.py +0 -0
  170. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/tokens.py +0 -0
  171. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/tool_scheduling.py +0 -0
  172. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/trace_sources.py +0 -0
  173. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/tracer.py +0 -0
  174. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/value.py +0 -0
  175. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/workflow_types.py +0 -0
  176. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop/workflows.py +0 -0
  177. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop_profiler.egg-info/dependency_links.txt +0 -0
  178. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop_profiler.egg-info/entry_points.txt +0 -0
  179. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop_profiler.egg-info/requires.txt +0 -0
  180. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/agentloop_profiler.egg-info/top_level.txt +0 -0
  181. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/dashboard/__init__.py +0 -0
  182. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/dashboard/app.py +0 -0
  183. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/dashboard/streamlit_compat.py +0 -0
  184. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/dashboard/trace_upload.py +0 -0
  185. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/dashboard/value_view.py +0 -0
  186. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/setup.cfg +0 -0
  187. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_ablations.py +0 -0
  188. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_aggregates.py +0 -0
  189. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_api_versioning.py +0 -0
  190. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_batch_data_pipeline.py +0 -0
  191. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_budgets.py +0 -0
  192. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_bump_version.py +0 -0
  193. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_calibration.py +0 -0
  194. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_capability_registry.py +0 -0
  195. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_checkpoint_recovery.py +0 -0
  196. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_ci_command.py +0 -0
  197. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_ci_evidence.py +0 -0
  198. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_cli_output_paths.py +0 -0
  199. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_cli_store_commands.py +0 -0
  200. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_cli_trace_inputs.py +0 -0
  201. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_client.py +0 -0
  202. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_client_transport.py +0 -0
  203. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_codex_exec_runner.py +0 -0
  204. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_completion.py +0 -0
  205. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_context_controls.py +0 -0
  206. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_context_reuse_experiments.py +0 -0
  207. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_context_study.py +0 -0
  208. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_costs.py +0 -0
  209. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_crewai_integration.py +0 -0
  210. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_cursor_server.py +0 -0
  211. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_cursor_shape_validation.py +0 -0
  212. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_input_validation.py +0 -0
  213. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_quality.py +0 -0
  214. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_semantic_waste.py +0 -0
  215. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_structured_quality.py +0 -0
  216. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_trace_upload.py +0 -0
  217. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_value_view.py +0 -0
  218. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dashboard_workflows.py +0 -0
  219. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_decorators.py +0 -0
  220. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_demo_cli.py +0 -0
  221. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_dependabot_config.py +0 -0
  222. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_diagnosis_api.py +0 -0
  223. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_distribution_metadata.py +0 -0
  224. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_docs_site.py +0 -0
  225. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_doctor_autoinstrument.py +0 -0
  226. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_drift.py +0 -0
  227. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_email_workflow.py +0 -0
  228. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_empirical_calibration.py +0 -0
  229. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_enforcement_conformance.py +0 -0
  230. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_estimates.py +0 -0
  231. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_evidence_workflow.py +0 -0
  232. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_experiments.py +0 -0
  233. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_exporters.py +0 -0
  234. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_external_cohorts.py +0 -0
  235. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_finding_benchmarks.py +0 -0
  236. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_finding_identity.py +0 -0
  237. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_finding_rules.py +0 -0
  238. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_first_use_cli.py +0 -0
  239. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_graph.py +0 -0
  240. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_guided_validation.py +0 -0
  241. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_harbor_atif.py +0 -0
  242. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_harbor_trials.py +0 -0
  243. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_harness.py +0 -0
  244. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_harness_bench.py +0 -0
  245. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_harness_error_usage.py +0 -0
  246. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_harness_evidence.py +0 -0
  247. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_hermes_integration.py +0 -0
  248. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_hermes_replay_capture.py +0 -0
  249. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_hermes_repository_example.py +0 -0
  250. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_hermes_runtime_evidence.py +0 -0
  251. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_html_report.py +0 -0
  252. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_incident_triage.py +0 -0
  253. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_instrumentation_measurement.py +0 -0
  254. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_integration_conformance.py +0 -0
  255. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_interoperability_contracts.py +0 -0
  256. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_interventions.py +0 -0
  257. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_issues.py +0 -0
  258. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_judgment_adapters.py +0 -0
  259. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_judgment_benchmarks.py +0 -0
  260. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_judgment_evidence.py +0 -0
  261. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_judgment_provider_optional.py +0 -0
  262. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_judgments.py +0 -0
  263. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_langgraph_conformance.py +0 -0
  264. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_langgraph_harness.py +0 -0
  265. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_langgraph_integration.py +0 -0
  266. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_langgraph_recovery.py +0 -0
  267. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_loop_guards.py +0 -0
  268. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_markdown.py +0 -0
  269. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_markdown_exporters.py +0 -0
  270. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_marketplace_workflow.py +0 -0
  271. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_metrics.py +0 -0
  272. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_migrations.py +0 -0
  273. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_model_batching.py +0 -0
  274. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_model_routing.py +0 -0
  275. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_multiagent_coordination.py +0 -0
  276. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_non_agent_study.py +0 -0
  277. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_omnigent_telemetry.py +0 -0
  278. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_onboarding.py +0 -0
  279. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_openai_agents_integration.py +0 -0
  280. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_openai_integration.py +0 -0
  281. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_operations.py +0 -0
  282. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_optimizer.py +0 -0
  283. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_otel_ids.py +0 -0
  284. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_otel_interop.py +0 -0
  285. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_otlp_jsonl.py +0 -0
  286. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_patch_source_scope.py +0 -0
  287. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_payment_review.py +0 -0
  288. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_policy_promotion.py +0 -0
  289. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_published_readme.py +0 -0
  290. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_python_support.py +0 -0
  291. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_quality.py +0 -0
  292. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_ranking.py +0 -0
  293. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_real_agent_study.py +0 -0
  294. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_real_calibration_study.py +0 -0
  295. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_real_harness_study.py +0 -0
  296. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_release_workflows.py +0 -0
  297. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_remote_cli_credentials.py +0 -0
  298. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_repetitions.py +0 -0
  299. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_replay.py +0 -0
  300. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_repository_policy_traversal.py +0 -0
  301. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_research_example.py +0 -0
  302. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_retention.py +0 -0
  303. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_retry_recommendations.py +0 -0
  304. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_routing_study.py +0 -0
  305. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_rule_error_privacy.py +0 -0
  306. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_runtime.py +0 -0
  307. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_savings_aggregation.py +0 -0
  308. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_scheduling_study.py +0 -0
  309. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_semantic_findings.py +0 -0
  310. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_semantic_waste.py +0 -0
  311. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_server.py +0 -0
  312. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_standalone_notices.py +0 -0
  313. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_store.py +0 -0
  314. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_store_contract.py +0 -0
  315. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_streaming_inventory.py +0 -0
  316. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_streamlit_compat.py +0 -0
  317. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_structural_experiments.py +0 -0
  318. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_structured_quality.py +0 -0
  319. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_structured_quality_evidence.py +0 -0
  320. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_studies.py +0 -0
  321. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_substitutions.py +0 -0
  322. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_telemetry_conformance.py +0 -0
  323. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_timing.py +0 -0
  324. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_token_provenance.py +0 -0
  325. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_tool_scheduling.py +0 -0
  326. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_trace_context.py +0 -0
  327. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_trace_failure_recording.py +0 -0
  328. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_trace_schema.py +0 -0
  329. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_usefulness_benchmark.py +0 -0
  330. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_value.py +0 -0
  331. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_vercel_ai_integration.py +0 -0
  332. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/tests/test_workflow_storage.py +0 -0
  333. {agentloop_profiler-0.2.3 → agentloop_profiler-0.2.4}/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.3
3
+ Version: 0.2.4
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
@@ -8,6 +8,7 @@ from typing import Any
8
8
 
9
9
  from agentloop.costs import is_cost_evaluable
10
10
  from agentloop.markdown import markdown_code_span, markdown_text
11
+ from agentloop.parallelism import REUSE_FORMULA
11
12
 
12
13
 
13
14
  @dataclass(frozen=True)
@@ -92,8 +93,18 @@ def estimate_snapshot(candidate: Any, report: dict[str, Any], nodes: list[Any])
92
93
  affected = set(candidate.affected_nodes or [])
93
94
  durations = [node.duration_ms for node in nodes if node.node_id in affected]
94
95
  cost_status = report.get("cost_status", "complete")
96
+ estimator_id = candidate.rule_id
97
+ extra_inputs = {}
98
+ if candidate.rule_id == "parallelize_tools":
99
+ retained = (candidate.observations or {}).get("retained_span_id")
100
+ if retained is not None:
101
+ estimator_id = "request_local_tool_reuse"
102
+ spec = Estimator(REUSE_FORMULA, ())
103
+ extra_inputs["retained_duration_ms"] = next(
104
+ node.duration_ms for node in nodes if node.node_id == retained
105
+ )
95
106
  return {
96
- "estimator_id": candidate.rule_id,
107
+ "estimator_id": estimator_id,
97
108
  "estimator_version": spec.version,
98
109
  "method": "heuristic",
99
110
  "confidence": candidate.confidence,
@@ -110,6 +121,7 @@ def estimate_snapshot(candidate: Any, report: dict[str, Any], nodes: list[Any])
110
121
  "repeated_context_ratio": report.get("repeated_context_ratio", 0.0),
111
122
  "cost_status": cost_status,
112
123
  "token_status": report.get("token_status", "unspecified"),
124
+ **extra_inputs,
113
125
  },
114
126
  "assumptions": list(dict.fromkeys([*(candidate.assumptions or []), *spec.assumptions])),
115
127
  "unmodeled_metrics": (["latency"] if candidate.rule_id == "cache_context" else ["cost"]),
@@ -256,6 +256,13 @@ def _finding_from_card(
256
256
  ]
257
257
  semantic = (card.get("estimate") or {}).get("estimator_id") == "semantic_leaf_removal"
258
258
  observations = dict(card.get("observations", {}))
259
+ identity_title = title
260
+ if (
261
+ finding_type == "parallelize_tools"
262
+ and observations.get("recommended_action") == "inspect_repetition"
263
+ ):
264
+ # The wording change preserves existing reviewed finding IDs.
265
+ identity_title = f"Parallelize repeated `{observations['tool_name']}` tool calls"
259
266
  if semantic:
260
267
  severity = "medium" if card.get("confidence") == "medium" else "low"
261
268
  evidence.extend(
@@ -265,7 +272,7 @@ def _finding_from_card(
265
272
  return OptimizationFinding(
266
273
  finding_id=_stable_finding_id(
267
274
  finding_type,
268
- title,
275
+ identity_title,
269
276
  affected_spans,
270
277
  context={
271
278
  "investigation_id": observations.get("investigation_id"),
@@ -290,9 +290,10 @@ class ExecutionGraph:
290
290
  and len(identities) == len(self.nodes),
291
291
  }
292
292
 
293
- def parallelizable_groups(self) -> list[dict[str, Any]]:
293
+ def parallelizable_groups(self, *, consider_reuse: bool = False) -> list[dict[str, Any]]:
294
294
  return parallelization_candidates(
295
295
  self.nodes,
296
+ consider_reuse=consider_reuse,
296
297
  dependency_edges=(
297
298
  (edge.source, edge.target)
298
299
  for edge in self.edges
@@ -12,15 +12,18 @@ import subprocess # nosec B404 - execution requires explicit CLI argv
12
12
  from dataclasses import asdict
13
13
  from datetime import datetime, timezone
14
14
  from pathlib import Path
15
+ from time import perf_counter_ns
15
16
 
16
17
  from agentloop.experiment_artifacts import local_path, read_json, write_once
17
18
  from agentloop.experiment_types import fingerprint
18
19
  from agentloop.findings import build_diagnosis
20
+ from agentloop.improvement_verifier import DEFAULT_TIMEOUT, LocalVerifier, resume_verifier
19
21
  from agentloop.interventions import build_intervention
20
22
  from agentloop.quality import build_quality_report, validate_quality_fixtures
21
23
  from agentloop.repetitions import add_repetition_findings
22
24
  from agentloop.replay import ReplayGates, build_replay_report
23
25
  from agentloop.replay import _summary as replay_summary
26
+ from agentloop.schema import TraceValidationError, validate_elapsed_ms
24
27
  from agentloop.tracer import AgentTrace
25
28
 
26
29
  VERSION = "1.0"
@@ -234,12 +237,15 @@ def _attempt(root, index, row, task, command, timeout, show_output):
234
237
  "trace_path": str(path),
235
238
  }
236
239
  row["started_at"] = now()
240
+ started = perf_counter_ns()
237
241
  try:
238
242
  row.update(_invoke(command, request, timeout, show_output=show_output))
239
243
  except KeyboardInterrupt:
240
244
  row["status"] = "cancelled"
241
245
  raise
242
246
  finally:
247
+ if row["status"] != "runner_error":
248
+ row["runner_elapsed_ms"] = (perf_counter_ns() - started) / 1_000_000
243
249
  row["ended_at"] = now()
244
250
  if path.exists():
245
251
  try:
@@ -384,21 +390,40 @@ def _completed(manifest, traces):
384
390
  return {key: trace for key, trace in traces.items() if key in done}
385
391
 
386
392
 
387
- def _quality(task, baseline, candidate):
388
- return build_quality_report(
389
- [
393
+ def _quality(task, baseline, candidate, verification=None):
394
+ fixtures = [
395
+ {
396
+ "id": task["id"],
397
+ "expected": task["expected"],
398
+ "scorer": task.get("scorer", {"type": "exact_match"}),
399
+ }
400
+ ]
401
+ if verification is not None:
402
+ fixtures.append(
390
403
  {
391
- "id": task["id"],
392
- "expected": task["expected"],
393
- "scorer": task.get("scorer", {"type": "exact_match"}),
404
+ "id": f"{task['id']}:local-verifier",
405
+ "expected": True,
406
+ "baseline_output": verification["baseline"]["passed"],
407
+ "candidate_output": verification["candidate"]["passed"],
394
408
  }
395
- ],
409
+ )
410
+ return build_quality_report(
411
+ fixtures,
396
412
  baseline_trace=baseline,
397
413
  candidate_trace=candidate,
398
414
  min_score=1.0,
399
415
  )
400
416
 
401
417
 
418
+ def _runner_budget(value):
419
+ try:
420
+ return validate_elapsed_ms(value)
421
+ except TraceValidationError as error:
422
+ raise ValueError(
423
+ "Runner regression budget must be a finite nonnegative number in ms"
424
+ ) from error
425
+
426
+
402
427
  def start(
403
428
  workload_path,
404
429
  baseline_path,
@@ -408,12 +433,17 @@ def start(
408
433
  objective="latency",
409
434
  minimum_improvement=0,
410
435
  decision="per_pair",
436
+ verifier=None,
437
+ verifier_timeout=DEFAULT_TIMEOUT,
438
+ max_runner_regression_ms=None,
411
439
  ):
412
440
  workload = read_workload(workload_path)
413
441
  manifest, traces = read_capture(baseline_path, workload)
442
+ verifier = LocalVerifier.read(verifier, verifier_timeout) if verifier is not None else None
414
443
  require(objective in {"latency", "cost"}, "Objective must be latency or cost")
415
444
  decision = decision.replace("-", "_") if isinstance(decision, str) else decision
416
445
  require(decision in DECISIONS, "Decision must be per-pair or aggregate")
446
+ runner_budget = _runner_budget(max_runner_regression_ms)
417
447
  require(
418
448
  type(minimum_improvement) in (int, float)
419
449
  and math.isfinite(minimum_improvement)
@@ -468,6 +498,13 @@ def start(
468
498
  else [],
469
499
  }
470
500
  )
501
+ if verifier is not None:
502
+ cases[-1]["baseline_verifier"] = verifier.check(
503
+ task,
504
+ repetition,
505
+ trace,
506
+ usable=row["status"] == "completed" and trace is not None and _trace_usable(trace),
507
+ )
471
508
  specification = {
472
509
  "schema_version": VERSION,
473
510
  "frozen_at": now(),
@@ -479,6 +516,10 @@ def start(
479
516
  "cases": cases,
480
517
  "baseline_capture": manifest,
481
518
  }
519
+ if verifier is not None:
520
+ specification["verifier"] = verifier.declaration()
521
+ if runner_budget is not None:
522
+ specification["max_runner_regression_ms"] = runner_budget
482
523
  write_once(
483
524
  root,
484
525
  "session.json",
@@ -506,6 +547,85 @@ def _trace_usable(trace):
506
547
  return not any(event.parent_id is None and event.status == "error" for event in trace.events)
507
548
 
508
549
 
550
+ def _attempt_timing(row, trace):
551
+ """Describe the trace boundary and the capture process boundary independently."""
552
+ timing = {
553
+ "trace_elapsed_ms": trace.elapsed_ms if trace is not None else None,
554
+ "runner_elapsed_ms": None,
555
+ "runner_clock": None,
556
+ }
557
+ if row.get("status") in {"runner_error", "not_started"}:
558
+ return timing
559
+ if "runner_elapsed_ms" in row:
560
+ try:
561
+ elapsed = validate_elapsed_ms(row["runner_elapsed_ms"])
562
+ except TraceValidationError:
563
+ return timing
564
+ clock = "monotonic"
565
+ else:
566
+ # Capture 1.0 manifests predating runner timing retain UTC boundaries.
567
+ try:
568
+ started = datetime.fromisoformat(row.get("started_at"))
569
+ ended = datetime.fromisoformat(row.get("ended_at"))
570
+ if started.utcoffset() is None or ended.utcoffset() is None:
571
+ return timing
572
+ elapsed = (ended - started).total_seconds() * 1000
573
+ except (TypeError, ValueError, OverflowError):
574
+ return timing
575
+ clock = "capture_timestamps"
576
+ if elapsed is not None and elapsed >= 0:
577
+ timing.update(runner_elapsed_ms=elapsed, runner_clock=clock)
578
+ return timing
579
+
580
+
581
+ def _runner_wall_gate(row, limit_ms, comparison):
582
+ before, after = (row["timing"][side] for side in ("baseline", "candidate"))
583
+ complete = row["baseline_status"] == row["candidate_status"] == "completed"
584
+ if complete and before["runner_clock"] == after["runner_clock"] == "monotonic":
585
+ delta = after["runner_elapsed_ms"] - before["runner_elapsed_ms"]
586
+ passed = delta <= limit_ms
587
+ detail = f"Candidate minus {comparison.lower()} runner time was {delta:+.3f} ms. Limit {limit_ms:g} ms."
588
+ else:
589
+ delta, passed = None, False
590
+ detail = "Both completed attempts need monotonic runner times. Recapture the missing side, or capture a fresh interleaved control and candidate."
591
+ return {
592
+ "name": "runner_wall_time_regression",
593
+ "passed": passed,
594
+ "detail": detail,
595
+ "indeterminate": False,
596
+ "delta_ms": delta,
597
+ "limit_ms": limit_ms,
598
+ }
599
+
600
+
601
+ def _median_duration(values):
602
+ if not values:
603
+ return None
604
+ ordered = sorted(values)
605
+ low, high = ordered[(len(ordered) - 1) // 2], ordered[len(ordered) // 2]
606
+ # Preserve the usual median and guard against overflow from adding two values.
607
+ middle = low + high
608
+ return middle / 2 if math.isfinite(middle) else low / 2 + high / 2
609
+
610
+
611
+ def _timing_summary(rows):
612
+ eligible = [row["timing"] for row in rows if row["timing"]["eligible"]]
613
+ summary = {"eligible_pairs": len(eligible)}
614
+ for metric in ("trace_elapsed_ms", "runner_elapsed_ms"):
615
+ pairs = [
616
+ (timing["baseline"][metric], timing["candidate"][metric])
617
+ for timing in eligible
618
+ if all(timing[side][metric] is not None for side in ("baseline", "candidate"))
619
+ ]
620
+ summary[metric] = {
621
+ "paired_count": len(pairs),
622
+ "baseline_median_ms": _median_duration([before for before, _ in pairs]),
623
+ "candidate_median_ms": _median_duration([after for _, after in pairs]),
624
+ "median_paired_delta_ms": _median_duration([after - before for before, after in pairs]),
625
+ }
626
+ return summary
627
+
628
+
509
629
  def _sign_test_p_value(improved, regressed):
510
630
  """One-sided exact sign test: chance of at least this many improvements."""
511
631
  trials = improved + regressed
@@ -583,7 +703,7 @@ def _aggregate_decision(rows, objective, gates):
583
703
  }
584
704
 
585
705
 
586
- def finish(session_path, candidate_path, root, *, change):
706
+ def finish(session_path, candidate_path, root, *, change, verifier=None):
587
707
  session_path = Path(session_path).resolve()
588
708
  saved = load_json(session_path)
589
709
  specification = saved["specification"]
@@ -593,6 +713,8 @@ def finish(session_path, candidate_path, root, *, change):
593
713
  )
594
714
  require(specification.get("schema_version") == VERSION, "Unsupported frozen session version")
595
715
  workload = validate_workload(specification["workload"])
716
+ verifier = resume_verifier(specification.get("verifier"), verifier)
717
+ runner_budget = _runner_budget(specification.get("max_runner_regression_ms"))
596
718
  require(specification.get("objective") in {"latency", "cost"}, "Unsupported frozen objective")
597
719
  # Sessions frozen before 0.2.3 have no decision field and keep per-pair judgment.
598
720
  decision = specification.get("decision", "per_pair")
@@ -668,6 +790,15 @@ def finish(session_path, candidate_path, root, *, change):
668
790
  _completed(control_manifest, controls),
669
791
  )
670
792
  gates = ReplayGates(**specification["gates"])
793
+ comparison_manifest = (
794
+ specification["baseline_capture"] if controls is None else control_manifest
795
+ )
796
+ baseline_rows = {
797
+ (row["task_id"], row["repetition"]): row for row in comparison_manifest["runs"]
798
+ }
799
+ candidate_rows = {
800
+ (row["task_id"], row["repetition"]): row for row in candidate_manifest["runs"]
801
+ }
671
802
  root = Path(root).resolve()
672
803
  root.mkdir(parents=True, exist_ok=False)
673
804
  rows, study_paths = [], {"baseline": [], "candidate": []}
@@ -675,9 +806,7 @@ def finish(session_path, candidate_path, root, *, change):
675
806
  key = (case["task_id"], case["repetition"])
676
807
  task = next(task for task in workload["tasks"] if task["id"] == key[0])
677
808
  candidate = candidates.get(key)
678
- candidate_row = next(
679
- row for row in candidate_manifest["runs"] if (row["task_id"], row["repetition"]) == key
680
- )
809
+ baseline_row, candidate_row = baseline_rows.get(key, {}), candidate_rows[key]
681
810
  if controls is None:
682
811
  label, baseline = "Baseline", baselines.get(key)
683
812
  baseline_status = case["capture_status"]
@@ -687,13 +816,8 @@ def finish(session_path, candidate_path, root, *, change):
687
816
  # Findings stay frozen from the original baseline. Measurements compare
688
817
  # the candidate with the unchanged control run alongside it.
689
818
  label, baseline = "Control", controls.get(key)
690
- control_row = next(
691
- row
692
- for row in control_manifest["runs"]
693
- if (row["task_id"], row["repetition"]) == key
694
- )
695
- baseline_status = control_row["status"]
696
- baseline_diagnostic = control_row.get("diagnostic")
819
+ baseline_status = baseline_row["status"]
820
+ baseline_diagnostic = baseline_row.get("diagnostic")
697
821
  diagnosis = control_diagnoses.get(key)
698
822
  finding_ids = (
699
823
  [
@@ -714,12 +838,44 @@ def finish(session_path, candidate_path, root, *, change):
714
838
  "quality": None,
715
839
  "replay": None,
716
840
  "intervention": None,
841
+ "timing": {
842
+ "baseline": _attempt_timing(baseline_row, baseline),
843
+ "candidate": _attempt_timing(candidate_row, candidate),
844
+ "eligible": False,
845
+ },
717
846
  }
718
847
  if controls is not None:
719
848
  row.update(
720
849
  frozen_baseline_status=case["capture_status"],
721
- control_ran_first=control_row.get("order") == 0,
850
+ control_ran_first=baseline_row.get("order") == 0,
722
851
  )
852
+ if runner_budget is not None:
853
+ gate = _runner_wall_gate(row, runner_budget, label)
854
+ row["runner_gate"] = gate
855
+ if not gate["passed"]:
856
+ row["reasons"].append(f"Runner wall-time gate failed. {gate['detail']}")
857
+ verification = None
858
+ if verifier is not None:
859
+ verification = {
860
+ side: verifier.check(
861
+ task,
862
+ key[1],
863
+ trace,
864
+ usable=(
865
+ trace is not None
866
+ and row[f"{side}_status"] == "completed"
867
+ and _trace_usable(trace)
868
+ ),
869
+ )
870
+ for side, trace in (("baseline", baseline), ("candidate", candidate))
871
+ }
872
+ row["verifier"] = verification
873
+ for side, result in verification.items():
874
+ if not result["passed"]:
875
+ side_label = label if side == "baseline" else "Candidate"
876
+ row["reasons"].append(
877
+ f"{side_label} local verification failed: {result['detail']}"
878
+ )
723
879
  if baseline is None or candidate is None:
724
880
  row["reasons"].append(f"A planned {label.lower()} or candidate trace is unavailable")
725
881
  for side, status, diagnostic in (
@@ -731,28 +887,29 @@ def finish(session_path, candidate_path, root, *, change):
731
887
  f"{side} attempt is {status}. {diagnostic or 'Recapture this task with --show-runner-output to inspect the failure.'}"
732
888
  )
733
889
  else:
734
- quality = _quality(task, baseline, candidate)
890
+ quality = _quality(task, baseline, candidate, verification)
735
891
  replay = build_replay_report(baseline, candidate, gates=gates, quality_report=quality)
736
- if (
737
- baseline_status != "completed"
738
- or candidate_row["status"] != "completed"
739
- or not all(_trace_usable(trace) for trace in (baseline, candidate))
740
- ):
741
- row["reasons"].append("An attempt failed, was interrupted or did not complete")
742
- if not quality["passed"] or any(
743
- not result[side]["passed"]
892
+ completed = baseline_status == candidate_row["status"] == "completed" and all(
893
+ _trace_usable(trace) for trace in (baseline, candidate)
894
+ )
895
+ quality_passed = quality["passed"] and all(
896
+ result[side]["passed"]
744
897
  for result in quality["cases"]
745
898
  for side in ("baseline", "candidate")
746
- ):
899
+ )
900
+ row["timing"]["eligible"] = completed and quality_passed
901
+ if not completed:
902
+ row["reasons"].append("An attempt failed, was interrupted or did not complete")
903
+ if not quality_passed:
747
904
  row["reasons"].append(
748
905
  f"{label} and candidate must both pass the declared quality checks"
749
906
  )
750
- for result in quality["cases"]:
751
- for side in ("baseline", "candidate"):
752
- if not result[side]["passed"]:
753
- row["reasons"].append(
754
- f"{label if side == 'baseline' else 'Candidate'} answer failed the declared {task.get('scorer', {}).get('type', 'exact_match')} criterion: {result[side]['detail']}"
755
- )
907
+ fixture_result = quality["cases"][0]
908
+ for side in ("baseline", "candidate"):
909
+ if not fixture_result[side]["passed"]:
910
+ row["reasons"].append(
911
+ f"{label if side == 'baseline' else 'Candidate'} answer failed the declared {task.get('scorer', {}).get('type', 'exact_match')} criterion: {fixture_result[side]['detail']}"
912
+ )
756
913
  # Aggregate decisions judge speed and cost across all pairs after
757
914
  # this loop; every other gate still applies to each pair.
758
915
  judged = [
@@ -778,6 +935,8 @@ def finish(session_path, candidate_path, root, *, change):
778
935
  row.update(
779
936
  quality=quality, replay=replay, passed=not row["reasons"], objective_gain_pct=gain
780
937
  )
938
+ if runner_budget is not None:
939
+ replay["gates"]["results"].append(row["runner_gate"])
781
940
  replay["gates"]["results"].append(
782
941
  {
783
942
  "name": "guided_evidence",
@@ -785,7 +944,7 @@ def finish(session_path, candidate_path, root, *, change):
785
944
  "detail": (
786
945
  "All guided execution, quality and measured-objective checks passed"
787
946
  if decision == "per_pair"
788
- else "All guided execution and quality checks passed; performance is judged across all pairs"
947
+ else "All guided per-pair checks passed. The selected objective is judged across all pairs"
789
948
  )
790
949
  if row["passed"]
791
950
  else " ".join(row["reasons"]),
@@ -805,7 +964,14 @@ def finish(session_path, candidate_path, root, *, change):
805
964
  candidate,
806
965
  target_finding_ids=finding_ids,
807
966
  intervention_type=specification["focus"],
808
- configuration={"change": change},
967
+ configuration={
968
+ "change": change,
969
+ **(
970
+ {"max_runner_regression_ms": runner_budget}
971
+ if runner_budget is not None
972
+ else {}
973
+ ),
974
+ },
809
975
  diagnosis=diagnosis,
810
976
  gates=gates,
811
977
  quality_report=quality,
@@ -822,10 +988,10 @@ def finish(session_path, candidate_path, root, *, change):
822
988
  source_trace_hash=fingerprint(trace.to_dict()),
823
989
  )
824
990
  if row["quality"]:
825
- result = row["quality"]["cases"][0][side]
991
+ quality_cases = row["quality"]["cases"]
826
992
  viewed["metadata"].update(
827
- quality_score=result["score"],
828
- success=result["passed"]
993
+ quality_score=row["quality"][f"{side}_score"],
994
+ success=all(result[side]["passed"] for result in quality_cases)
829
995
  and _trace_usable(trace)
830
996
  and row[f"{side}_status"] == "completed",
831
997
  )
@@ -879,8 +1045,17 @@ def finish(session_path, candidate_path, root, *, change):
879
1045
  ]
880
1046
  ),
881
1047
  "cases": rows,
1048
+ "timing_summary": _timing_summary(rows),
882
1049
  "study": study,
883
1050
  }
1051
+ if verifier is not None:
1052
+ report["verifier"] = verifier.declaration()
1053
+ if runner_budget is not None:
1054
+ report["runner_gate"] = {
1055
+ "limit_ms": runner_budget,
1056
+ "passed_pairs": sum(row["runner_gate"]["passed"] for row in rows),
1057
+ "unavailable_pairs": sum(row["runner_gate"]["delta_ms"] is None for row in rows),
1058
+ }
884
1059
  from agentloop.improvement_report import export_report
885
1060
 
886
1061
  export_report(root, report)
@@ -6,9 +6,18 @@ from pathlib import Path
6
6
 
7
7
  import typer
8
8
  from rich.console import Console
9
+ from rich.table import Table
9
10
 
10
11
  from agentloop import improvement
11
12
  from agentloop.improvement_init import initialize, project_tasks
13
+ from agentloop.improvement_report import (
14
+ _headline,
15
+ comparison_label,
16
+ decision_objective,
17
+ runner_gate_summary,
18
+ timing_summary_rows,
19
+ )
20
+ from agentloop.improvement_verifier import DEFAULT_TIMEOUT
12
21
 
13
22
  improve_app = typer.Typer(
14
23
  help="Capture fixed tasks, review baseline findings, and verify an applied change."
@@ -101,11 +110,21 @@ def start_command(
101
110
  minimum_improvement: float = typer.Option(
102
111
  0, min=0, help="Required percentage gain in the selected objective."
103
112
  ),
113
+ max_runner_regression_ms: float | None = typer.Option(
114
+ None, min=0, help="Optional maximum runner wall-time increase in ms for each pair."
115
+ ),
104
116
  decision: str = typer.Option(
105
117
  "per-pair",
106
118
  help="per-pair requires every pair to improve; aggregate judges the median "
107
119
  "paired improvement for noisy agents. Correctness is checked per pair in both.",
108
120
  ),
121
+ verifier: Path | None = typer.Option(None, help="Explicit trusted local Python verifier file."),
122
+ verifier_timeout: float = typer.Option(
123
+ DEFAULT_TIMEOUT,
124
+ min=0.01,
125
+ max=3600,
126
+ help="Seconds per verifier execution, frozen in the session.",
127
+ ),
109
128
  ):
110
129
  """Freeze task checks and original findings before editing the agent."""
111
130
  try:
@@ -116,7 +135,10 @@ def start_command(
116
135
  focus=focus,
117
136
  objective=objective,
118
137
  minimum_improvement=minimum_improvement,
138
+ max_runner_regression_ms=max_runner_regression_ms,
119
139
  decision=decision,
140
+ verifier=verifier,
141
+ verifier_timeout=verifier_timeout,
120
142
  )
121
143
  except (OSError, ValueError, TypeError, KeyError) as exc:
122
144
  raise typer.BadParameter(str(exc)) from exc
@@ -128,6 +150,12 @@ def start_command(
128
150
  markup=False,
129
151
  )
130
152
  console.print(f"Frozen session written to {out / 'session.json'}", markup=False)
153
+ if verifier is not None:
154
+ passed = sum(case["baseline_verifier"]["passed"] for case in specification["cases"])
155
+ total = len(specification["cases"])
156
+ console.print(
157
+ f"Local verifier passed on {passed} of {total} baseline attempts.", markup=False
158
+ )
131
159
 
132
160
 
133
161
  @improve_app.command("finish")
@@ -136,22 +164,21 @@ def finish_command(
136
164
  candidate: Path = typer.Option(..., help="Candidate capture.json recorded after start."),
137
165
  change: str = typer.Option(..., help="Describe the change you applied."),
138
166
  out: Path = typer.Option(..., help="Fresh report directory."),
167
+ verifier: Path | None = typer.Option(
168
+ None, help="Explicit trusted Python verifier matching the frozen session."
169
+ ),
139
170
  ):
140
171
  """Compare every planned attempt and write JSON, Markdown and HTML results."""
141
172
  try:
142
- report = improvement.finish(session, candidate, out, change=change)
173
+ report = improvement.finish(session, candidate, out, change=change, verifier=verifier)
143
174
  except (OSError, ValueError, TypeError, KeyError) as exc:
144
175
  raise typer.BadParameter(str(exc)) from exc
145
176
  verdict = report["decision"]
146
177
  if verdict["mode"] == "aggregate":
147
- console.print(
148
- f"{report['passed_attempts']} of {report['planned_attempts']} pairs passed "
149
- "correctness and completion checks.",
150
- markup=False,
151
- )
178
+ console.print(_headline(report), markup=False)
152
179
  median = verdict["median_improvement_pct"]
153
180
  console.print(
154
- f"Aggregate {verdict['objective']} decision "
181
+ f"Aggregate {decision_objective(verdict)} check "
155
182
  + ("passed" if verdict["passed"] else "failed")
156
183
  + f": median improvement {'unavailable' if median is None else f'{median:.2f}%'}, "
157
184
  f"{verdict['improved_pairs']} improved, {verdict['regressed_pairs']} regressed.",
@@ -164,6 +191,18 @@ def finish_command(
164
191
  f"{report['passed_attempts']} of {report['planned_attempts']} planned comparisons passed.",
165
192
  markup=False,
166
193
  )
194
+ if summary := runner_gate_summary(report):
195
+ console.print(summary, markup=False)
196
+ timing = Table(
197
+ "Timing",
198
+ f"{comparison_label(report)} median",
199
+ "Candidate median",
200
+ "Measured pairs",
201
+ caption="Completed, correct pairs. The latency objective uses trace time.",
202
+ )
203
+ for label, before, after, _, pairs in timing_summary_rows(report):
204
+ timing.add_row(label, before, after, pairs)
205
+ console.print(timing)
167
206
  console.print(f"Read {out / 'report.html'}", markup=False)
168
207
  for case in report["cases"]:
169
208
  if not case["passed"]: