agentloop-profiler 0.2.1__tar.gz → 0.2.2__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 (329) hide show
  1. {agentloop_profiler-0.2.1/agentloop_profiler.egg-info → agentloop_profiler-0.2.2}/PKG-INFO +2 -2
  2. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/README.md +1 -1
  3. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/improvement.py +172 -67
  4. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/improvement_cli.py +16 -5
  5. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/improvement_report.py +15 -0
  6. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/version.py +1 -1
  7. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2/agentloop_profiler.egg-info}/PKG-INFO +2 -2
  8. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop_profiler.egg-info/SOURCES.txt +1 -0
  9. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/pyproject.toml +2 -2
  10. agentloop_profiler-0.2.2/tests/test_codex_exec_runner.py +163 -0
  11. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_improvement.py +100 -0
  12. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/LICENSE +0 -0
  13. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/THIRD_PARTY_LICENSES.md +0 -0
  14. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/__init__.py +0 -0
  15. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/ablation_protocol.py +0 -0
  16. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/ablations.py +0 -0
  17. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/aggregate_cli.py +0 -0
  18. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/aggregate_stats.py +0 -0
  19. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/aggregates.py +0 -0
  20. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/audit.py +0 -0
  21. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/autoinstrument.py +0 -0
  22. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/batch_experiments.py +0 -0
  23. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/batching.py +0 -0
  24. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/budget_types.py +0 -0
  25. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/budgets.py +0 -0
  26. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/calibration.py +0 -0
  27. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/checkpoint_state.py +0 -0
  28. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/checkpoint_store.py +0 -0
  29. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/ci.py +0 -0
  30. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/cli.py +0 -0
  31. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/cli_paths.py +0 -0
  32. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/client.py +0 -0
  33. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/completion.py +0 -0
  34. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/completion_types.py +0 -0
  35. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/config.py +0 -0
  36. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/context_controls.py +0 -0
  37. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/context_experiments.py +0 -0
  38. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/context_types.py +0 -0
  39. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/costs.py +0 -0
  40. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/cursor_validation.py +0 -0
  41. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/decorators.py +0 -0
  42. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/demo.py +0 -0
  43. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/doctor.py +0 -0
  44. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/drift.py +0 -0
  45. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/drift_cli.py +0 -0
  46. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/drift_types.py +0 -0
  47. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/drift_windows.py +0 -0
  48. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/entrypoint.py +0 -0
  49. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/estimates.py +0 -0
  50. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/events.py +0 -0
  51. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/experiment_artifacts.py +0 -0
  52. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/experiment_observations.py +0 -0
  53. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/experiment_reports.py +0 -0
  54. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/experiment_types.py +0 -0
  55. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/experiments.py +0 -0
  56. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/exporters.py +0 -0
  57. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/finding_benchmark_types.py +0 -0
  58. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/finding_benchmarks.py +0 -0
  59. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/findings.py +0 -0
  60. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/graph.py +0 -0
  61. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness.py +0 -0
  62. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness_bench/__init__.py +0 -0
  63. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness_bench/cli.py +0 -0
  64. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness_bench/drivers.py +0 -0
  65. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness_bench/offline.py +0 -0
  66. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness_evidence.py +0 -0
  67. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/harness_usage.py +0 -0
  68. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/html_report.py +0 -0
  69. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/improvement_init.py +0 -0
  70. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/__init__.py +0 -0
  71. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/crewai.py +0 -0
  72. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/__init__.py +0 -0
  73. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/atif.py +0 -0
  74. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/atif_validation.py +0 -0
  75. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/cli.py +0 -0
  76. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/manifest.py +0 -0
  77. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/trial_evidence.py +0 -0
  78. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/trials.py +0 -0
  79. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/harbor/verifier.py +0 -0
  80. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/hermes.py +0 -0
  81. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/hermes_cli.py +0 -0
  82. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/hermes_recorder.py +0 -0
  83. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/langgraph.py +0 -0
  84. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/langgraph_harness.py +0 -0
  85. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/langgraph_recovery.py +0 -0
  86. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/omnigent/__init__.py +0 -0
  87. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/omnigent/cli.py +0 -0
  88. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/omnigent/evidence.py +0 -0
  89. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/omnigent/telemetry.py +0 -0
  90. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/openai.py +0 -0
  91. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/openai_agents.py +0 -0
  92. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/sdk.py +0 -0
  93. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/integrations/vercel_ai.py +0 -0
  94. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/__init__.py +0 -0
  95. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/artifacts.py +0 -0
  96. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/cli.py +0 -0
  97. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/cohort_evidence.py +0 -0
  98. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/cohorts.py +0 -0
  99. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/contracts.py +0 -0
  100. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/coordination.py +0 -0
  101. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/evidence.py +0 -0
  102. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/otlp_jsonl.py +0 -0
  103. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/otlp_validation.py +0 -0
  104. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/registry.py +0 -0
  105. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interoperability/validation.py +0 -0
  106. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/intervention_service.py +0 -0
  107. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/intervention_store.py +0 -0
  108. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/interventions.py +0 -0
  109. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/issues.py +0 -0
  110. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/judgment_adapters.py +0 -0
  111. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/judgment_benchmark_types.py +0 -0
  112. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/judgment_benchmarks.py +0 -0
  113. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/judgment_types.py +0 -0
  114. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/judgment_views.py +0 -0
  115. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/judgments.py +0 -0
  116. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/loop_guards.py +0 -0
  117. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/loop_types.py +0 -0
  118. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/markdown.py +0 -0
  119. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/metrics.py +0 -0
  120. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/migrations.py +0 -0
  121. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/model_routing.py +0 -0
  122. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/onboarding.py +0 -0
  123. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/operations.py +0 -0
  124. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/optimizer.py +0 -0
  125. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/otel.py +0 -0
  126. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/otel_ids.py +0 -0
  127. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/otel_semantics.py +0 -0
  128. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/parallelism.py +0 -0
  129. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/patches.py +0 -0
  130. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/plan_export.py +0 -0
  131. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/policy_promotion.py +0 -0
  132. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/promotion_evidence.py +0 -0
  133. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/promotion_types.py +0 -0
  134. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/quality.py +0 -0
  135. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/ranking.py +0 -0
  136. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/recovery_evidence.py +0 -0
  137. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/replay.py +0 -0
  138. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/retention.py +0 -0
  139. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/retention_types.py +0 -0
  140. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/reuse_experiments.py +0 -0
  141. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/routing_checks.py +0 -0
  142. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/routing_types.py +0 -0
  143. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/rules.py +0 -0
  144. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/runtime.py +0 -0
  145. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/savings.py +0 -0
  146. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/scheduling_plan.py +0 -0
  147. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/scheduling_types.py +0 -0
  148. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/schema.py +0 -0
  149. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/semantic_rules.py +0 -0
  150. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/semantic_waste.py +0 -0
  151. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/semantic_waste_types.py +0 -0
  152. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/server.py +0 -0
  153. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/store.py +0 -0
  154. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/structural_experiments.py +0 -0
  155. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/structural_types.py +0 -0
  156. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/structured_quality.py +0 -0
  157. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/studies.py +0 -0
  158. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/study_statistics.py +0 -0
  159. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/substitution_evidence.py +0 -0
  160. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/substitution_export.py +0 -0
  161. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/substitution_reports.py +0 -0
  162. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/substitution_types.py +0 -0
  163. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/substitutions.py +0 -0
  164. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/timing.py +0 -0
  165. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/tokens.py +0 -0
  166. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/tool_scheduling.py +0 -0
  167. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/trace_sources.py +0 -0
  168. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/tracer.py +0 -0
  169. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/value.py +0 -0
  170. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/workflow_types.py +0 -0
  171. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop/workflows.py +0 -0
  172. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop_profiler.egg-info/dependency_links.txt +0 -0
  173. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop_profiler.egg-info/entry_points.txt +0 -0
  174. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop_profiler.egg-info/requires.txt +0 -0
  175. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/agentloop_profiler.egg-info/top_level.txt +0 -0
  176. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/dashboard/__init__.py +0 -0
  177. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/dashboard/app.py +0 -0
  178. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/dashboard/streamlit_compat.py +0 -0
  179. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/dashboard/trace_upload.py +0 -0
  180. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/dashboard/value_view.py +0 -0
  181. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/setup.cfg +0 -0
  182. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_ablations.py +0 -0
  183. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_aggregates.py +0 -0
  184. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_api_versioning.py +0 -0
  185. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_batch_data_pipeline.py +0 -0
  186. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_budgets.py +0 -0
  187. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_bump_version.py +0 -0
  188. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_calibration.py +0 -0
  189. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_capability_registry.py +0 -0
  190. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_checkpoint_recovery.py +0 -0
  191. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_ci_command.py +0 -0
  192. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_ci_evidence.py +0 -0
  193. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_cli_output_paths.py +0 -0
  194. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_cli_store_commands.py +0 -0
  195. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_cli_trace_inputs.py +0 -0
  196. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_client.py +0 -0
  197. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_client_transport.py +0 -0
  198. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_completion.py +0 -0
  199. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_context_controls.py +0 -0
  200. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_context_reuse_experiments.py +0 -0
  201. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_context_study.py +0 -0
  202. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_costs.py +0 -0
  203. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_crewai_integration.py +0 -0
  204. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_cursor_server.py +0 -0
  205. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_cursor_shape_validation.py +0 -0
  206. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_input_validation.py +0 -0
  207. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_quality.py +0 -0
  208. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_semantic_waste.py +0 -0
  209. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_structured_quality.py +0 -0
  210. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_trace_upload.py +0 -0
  211. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_value_view.py +0 -0
  212. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dashboard_workflows.py +0 -0
  213. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_decorators.py +0 -0
  214. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_demo_cli.py +0 -0
  215. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_dependabot_config.py +0 -0
  216. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_diagnosis_api.py +0 -0
  217. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_distribution_metadata.py +0 -0
  218. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_docs_site.py +0 -0
  219. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_doctor_autoinstrument.py +0 -0
  220. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_drift.py +0 -0
  221. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_email_workflow.py +0 -0
  222. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_empirical_calibration.py +0 -0
  223. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_enforcement_conformance.py +0 -0
  224. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_estimates.py +0 -0
  225. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_evidence_workflow.py +0 -0
  226. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_experiments.py +0 -0
  227. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_exporters.py +0 -0
  228. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_external_cohorts.py +0 -0
  229. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_finding_benchmarks.py +0 -0
  230. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_finding_identity.py +0 -0
  231. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_finding_rules.py +0 -0
  232. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_first_use_cli.py +0 -0
  233. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_graph.py +0 -0
  234. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_guided_validation.py +0 -0
  235. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_harbor_atif.py +0 -0
  236. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_harbor_trials.py +0 -0
  237. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_harness.py +0 -0
  238. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_harness_bench.py +0 -0
  239. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_harness_error_usage.py +0 -0
  240. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_harness_evidence.py +0 -0
  241. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_hermes_integration.py +0 -0
  242. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_hermes_replay_capture.py +0 -0
  243. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_hermes_repository_example.py +0 -0
  244. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_hermes_runtime_evidence.py +0 -0
  245. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_html_report.py +0 -0
  246. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_improvement_init.py +0 -0
  247. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_incident_triage.py +0 -0
  248. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_instrumentation_measurement.py +0 -0
  249. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_integration_conformance.py +0 -0
  250. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_interoperability_contracts.py +0 -0
  251. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_interventions.py +0 -0
  252. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_issues.py +0 -0
  253. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_judgment_adapters.py +0 -0
  254. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_judgment_benchmarks.py +0 -0
  255. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_judgment_evidence.py +0 -0
  256. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_judgment_provider_optional.py +0 -0
  257. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_judgments.py +0 -0
  258. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_langgraph_conformance.py +0 -0
  259. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_langgraph_harness.py +0 -0
  260. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_langgraph_integration.py +0 -0
  261. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_langgraph_recovery.py +0 -0
  262. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_loop_guards.py +0 -0
  263. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_markdown.py +0 -0
  264. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_markdown_exporters.py +0 -0
  265. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_marketplace_workflow.py +0 -0
  266. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_metrics.py +0 -0
  267. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_migrations.py +0 -0
  268. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_model_batching.py +0 -0
  269. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_model_routing.py +0 -0
  270. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_multiagent_coordination.py +0 -0
  271. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_non_agent_study.py +0 -0
  272. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_omnigent_telemetry.py +0 -0
  273. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_onboarding.py +0 -0
  274. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_openai_agents_integration.py +0 -0
  275. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_openai_integration.py +0 -0
  276. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_operations.py +0 -0
  277. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_optimizer.py +0 -0
  278. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_otel_ids.py +0 -0
  279. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_otel_interop.py +0 -0
  280. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_otlp_jsonl.py +0 -0
  281. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_parallelization_evidence.py +0 -0
  282. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_patch_plan.py +0 -0
  283. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_patch_source_scope.py +0 -0
  284. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_payment_review.py +0 -0
  285. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_policy_promotion.py +0 -0
  286. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_published_readme.py +0 -0
  287. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_python_support.py +0 -0
  288. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_quality.py +0 -0
  289. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_ranking.py +0 -0
  290. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_real_agent_study.py +0 -0
  291. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_real_calibration_study.py +0 -0
  292. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_real_harness_study.py +0 -0
  293. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_release_workflows.py +0 -0
  294. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_remote_cli_credentials.py +0 -0
  295. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_replay.py +0 -0
  296. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_repository_policy_traversal.py +0 -0
  297. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_research_example.py +0 -0
  298. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_retention.py +0 -0
  299. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_retry_recommendations.py +0 -0
  300. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_routing_study.py +0 -0
  301. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_rule_error_privacy.py +0 -0
  302. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_runtime.py +0 -0
  303. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_savings_aggregation.py +0 -0
  304. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_scheduling_study.py +0 -0
  305. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_semantic_findings.py +0 -0
  306. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_semantic_waste.py +0 -0
  307. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_server.py +0 -0
  308. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_standalone_notices.py +0 -0
  309. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_store.py +0 -0
  310. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_store_contract.py +0 -0
  311. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_streaming_inventory.py +0 -0
  312. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_streamlit_compat.py +0 -0
  313. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_structural_experiments.py +0 -0
  314. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_structured_quality.py +0 -0
  315. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_structured_quality_evidence.py +0 -0
  316. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_studies.py +0 -0
  317. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_substitutions.py +0 -0
  318. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_telemetry_conformance.py +0 -0
  319. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_timing.py +0 -0
  320. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_token_provenance.py +0 -0
  321. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_tool_scheduling.py +0 -0
  322. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_trace_context.py +0 -0
  323. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_trace_failure_recording.py +0 -0
  324. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_trace_schema.py +0 -0
  325. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_usefulness_benchmark.py +0 -0
  326. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_value.py +0 -0
  327. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_vercel_ai_integration.py +0 -0
  328. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/tests/test_workflow_storage.py +0 -0
  329. {agentloop_profiler-0.2.1 → agentloop_profiler-0.2.2}/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.1
3
+ Version: 0.2.2
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
@@ -97,7 +97,7 @@ storage are available as optional components.
97
97
 
98
98
  For Node.js and browser applications, the source checkout includes a
99
99
  [TypeScript SDK](https://github.com/dipeshbabu/agentloop/blob/main/sdk/typescript/README.md) with native tracing and an API v1 client.
100
- It has no runtime dependencies and has not yet been published to npm.
100
+ It has no runtime dependencies and installs with `npm install agentloop-profiler`.
101
101
 
102
102
  ## Quickstart
103
103
 
@@ -39,7 +39,7 @@ storage are available as optional components.
39
39
 
40
40
  For Node.js and browser applications, the source checkout includes a
41
41
  [TypeScript SDK](https://github.com/dipeshbabu/agentloop/blob/main/sdk/typescript/README.md) with native tracing and an API v1 client.
42
- It has no runtime dependencies and has not yet been published to npm.
42
+ It has no runtime dependencies and installs with `npm install agentloop-profiler`.
43
43
 
44
44
  ## Quickstart
45
45
 
@@ -185,33 +185,21 @@ def _invoke(command, request, timeout, *, show_output=False):
185
185
  raise
186
186
 
187
187
 
188
- def capture(workload_path, root, command, *, timeout=180, show_output=False):
189
- workload = read_workload(workload_path)
190
- require(
191
- command and all(isinstance(arg, str) and arg for arg in command),
192
- "Supply an explicit runner command after --",
193
- )
194
- require(
195
- type(timeout) in (int, float) and math.isfinite(timeout) and 0 < timeout <= 3600,
196
- "Task timeout must be positive and at most 3600 seconds",
197
- )
198
- root = Path(root).resolve()
199
- root.mkdir(parents=True, exist_ok=False)
200
- write_once(root, "workload.json", workload)
188
+ CONTROL_CAPTURE = "control/capture.json"
189
+
190
+
191
+ def _new_manifest(workload, command):
201
192
  scripts = [
202
193
  {"argument_index": index, "sha256": hashlib.sha256(Path(argument).read_bytes()).hexdigest()}
203
194
  for index, argument in enumerate(command)
204
195
  if Path(argument).suffix in {".py", ".js", ".mjs", ".ts"} and Path(argument).is_file()
205
196
  ]
206
- manifest = {
197
+ return {
207
198
  "schema_version": VERSION,
208
199
  "created_at": now(),
209
200
  "workload_hash": fingerprint(workload),
210
201
  "runner_hash": fingerprint({"argv": command, "scripts": scripts}),
211
- "runs": [],
212
- }
213
- for index, (task, repetition) in enumerate(slots(workload)):
214
- manifest["runs"].append(
202
+ "runs": [
215
203
  {
216
204
  "task_id": task["id"],
217
205
  "repetition": repetition,
@@ -220,46 +208,104 @@ def capture(workload_path, root, command, *, timeout=180, show_output=False):
220
208
  "trace": None,
221
209
  "trace_sha256": None,
222
210
  }
223
- )
211
+ for task, repetition in slots(workload)
212
+ ],
213
+ }
214
+
215
+
216
+ def _attempt(root, index, row, task, command, timeout, show_output):
217
+ relative = f"traces/{index:04d}.json"
218
+ path = local_path(root, relative)
219
+ path.parent.mkdir(exist_ok=True)
220
+ request = {
221
+ "task_id": row["task_id"],
222
+ "repetition": row["repetition"],
223
+ "input": task["input"],
224
+ "trace_path": str(path),
225
+ }
226
+ row["started_at"] = now()
227
+ try:
228
+ row.update(_invoke(command, request, timeout, show_output=show_output))
229
+ except KeyboardInterrupt:
230
+ row["status"] = "cancelled"
231
+ raise
232
+ finally:
233
+ row["ended_at"] = now()
234
+ if path.exists():
235
+ try:
236
+ _, digest = trace_receipt(root, relative)
237
+ row.update(trace=relative, trace_sha256=digest)
238
+ except (ValueError, OSError, TypeError, KeyError, AttributeError) as error:
239
+ # Keep the more specific failed, timed-out or cancelled outcome.
240
+ if row["status"] == "completed":
241
+ row["status"] = "invalid_trace"
242
+ row["diagnostic"] = (
243
+ (row.get("diagnostic") or "")
244
+ + f" Trace {relative} is invalid: {error}. Export a finalized native trace to request['trace_path']."
245
+ )
246
+ elif row["status"] == "completed":
247
+ row["status"] = "missing_trace"
248
+ row["diagnostic"] = (
249
+ "Runner exited successfully without a trace. Export the finalized trace to request['trace_path']."
250
+ )
251
+ write_once(root, f"receipts/{index:04d}.json", row)
252
+
253
+
254
+ def capture(workload_path, root, command, *, timeout=180, show_output=False, control=None):
255
+ """Run every planned attempt, optionally alternating with an unchanged control.
256
+
257
+ With ``control``, each task attempt runs both the control and the candidate
258
+ back to back, and the condition that goes first alternates between attempts.
259
+ Cache warm-up, host load and other drift then affect both conditions instead
260
+ of favouring whichever condition ran later.
261
+ """
262
+ workload = read_workload(workload_path)
263
+ require(
264
+ command and all(isinstance(arg, str) and arg for arg in command),
265
+ "Supply an explicit runner command after --",
266
+ )
267
+ require(
268
+ control is None or (control and all(isinstance(arg, str) and arg for arg in control)),
269
+ "Supply the unchanged control runner as repeated --control-arg values",
270
+ )
271
+ require(
272
+ type(timeout) in (int, float) and math.isfinite(timeout) and 0 < timeout <= 3600,
273
+ "Task timeout must be positive and at most 3600 seconds",
274
+ )
275
+ root = Path(root).resolve()
276
+ root.mkdir(parents=True, exist_ok=False)
277
+ write_once(root, "workload.json", workload)
278
+ manifest = _new_manifest(workload, command)
279
+ conditions = [(root, manifest, command)]
280
+ control_manifest = None
281
+ if control is not None:
282
+ control_root = local_path(root, "control")
283
+ control_root.mkdir()
284
+ write_once(control_root, "workload.json", workload)
285
+ control_manifest = _new_manifest(workload, control)
286
+ control_manifest["schedule"] = {"mode": "interleaved", "role": "control"}
287
+ manifest["schedule"] = {
288
+ "mode": "interleaved",
289
+ "role": "candidate",
290
+ "pattern": "Control runs first on even attempt indexes and second on odd ones",
291
+ }
292
+ conditions.append((control_root, control_manifest, control))
224
293
  try:
225
294
  for index, row in enumerate(manifest["runs"]):
226
295
  task = next(task for task in workload["tasks"] if task["id"] == row["task_id"])
227
- relative = f"traces/{index:04d}.json"
228
- path = local_path(root, relative)
229
- path.parent.mkdir(exist_ok=True)
230
- request = {
231
- "task_id": row["task_id"],
232
- "repetition": row["repetition"],
233
- "input": task["input"],
234
- "trace_path": str(path),
235
- }
236
- row["started_at"] = now()
237
- try:
238
- row.update(_invoke(command, request, timeout, show_output=show_output))
239
- except KeyboardInterrupt:
240
- row["status"] = "cancelled"
241
- raise
242
- finally:
243
- row["ended_at"] = now()
244
- if path.exists():
245
- try:
246
- _, digest = trace_receipt(root, relative)
247
- row.update(trace=relative, trace_sha256=digest)
248
- except (ValueError, OSError, TypeError, KeyError, AttributeError) as error:
249
- # Keep the more specific failed, timed-out or cancelled outcome.
250
- if row["status"] == "completed":
251
- row["status"] = "invalid_trace"
252
- row["diagnostic"] = (
253
- (row.get("diagnostic") or "")
254
- + f" Trace {relative} is invalid: {error}. Export a finalized native trace to request['trace_path']."
255
- )
256
- elif row["status"] == "completed":
257
- row["status"] = "missing_trace"
258
- row["diagnostic"] = (
259
- "Runner exited successfully without a trace. Export the finalized trace to request['trace_path']."
260
- )
261
- write_once(root, f"receipts/{index:04d}.json", row)
296
+ order = conditions if index % 2 else conditions[::-1]
297
+ for position, (condition_root, condition, argv) in enumerate(order):
298
+ attempt = condition["runs"][index]
299
+ if control is not None:
300
+ attempt["order"] = position
301
+ _attempt(condition_root, index, attempt, task, argv, timeout, show_output)
262
302
  finally:
303
+ if control_manifest is not None:
304
+ write_once(root, CONTROL_CAPTURE, control_manifest)
305
+ manifest["control"] = {
306
+ "capture": CONTROL_CAPTURE,
307
+ "manifest_hash": fingerprint(control_manifest),
308
+ }
263
309
  write_once(root, "capture.json", manifest)
264
310
  return manifest
265
311
 
@@ -472,10 +518,31 @@ def finish(session_path, candidate_path, root, *, change):
472
518
  )
473
519
  baseline_ids.add(trace.run_id)
474
520
  baselines[key] = trace
521
+ candidate_ids = {trace.run_id for trace in candidates.values()}
475
522
  require(
476
- not baseline_ids.intersection(trace.run_id for trace in candidates.values()),
523
+ not baseline_ids.intersection(candidate_ids),
477
524
  "Baseline and candidate must have distinct run IDs",
478
525
  )
526
+ controls = control_manifest = None
527
+ if "control" in candidate_manifest:
528
+ reference = candidate_manifest["control"]
529
+ require(
530
+ isinstance(reference, dict) and reference.get("capture") == CONTROL_CAPTURE,
531
+ "Invalid interleaved control reference",
532
+ )
533
+ control_manifest, controls = read_capture(
534
+ Path(candidate_path).resolve().parent / CONTROL_CAPTURE, workload
535
+ )
536
+ require(
537
+ fingerprint(control_manifest) == reference.get("manifest_hash"),
538
+ "Interleaved control capture changed",
539
+ )
540
+ require(
541
+ not (baseline_ids | candidate_ids).intersection(
542
+ trace.run_id for trace in controls.values()
543
+ ),
544
+ "Control, baseline and candidate must have distinct run IDs",
545
+ )
479
546
  gates = ReplayGates(**specification["gates"])
480
547
  root = Path(root).resolve()
481
548
  root.mkdir(parents=True, exist_ok=False)
@@ -483,14 +550,40 @@ def finish(session_path, candidate_path, root, *, change):
483
550
  for index, case in enumerate(specification["cases"]):
484
551
  key = (case["task_id"], case["repetition"])
485
552
  task = next(task for task in workload["tasks"] if task["id"] == key[0])
486
- baseline, candidate = baselines.get(key), candidates.get(key)
553
+ candidate = candidates.get(key)
487
554
  candidate_row = next(
488
555
  row for row in candidate_manifest["runs"] if (row["task_id"], row["repetition"]) == key
489
556
  )
557
+ if controls is None:
558
+ label, baseline = "Baseline", baselines.get(key)
559
+ baseline_status = case["capture_status"]
560
+ baseline_diagnostic = case.get("capture_diagnostic")
561
+ diagnosis, finding_ids = case["diagnosis"], case["finding_ids"]
562
+ else:
563
+ # Findings stay frozen from the original baseline. Measurements compare
564
+ # the candidate with the unchanged control run alongside it.
565
+ label, baseline = "Control", controls.get(key)
566
+ control_row = next(
567
+ row
568
+ for row in control_manifest["runs"]
569
+ if (row["task_id"], row["repetition"]) == key
570
+ )
571
+ baseline_status = control_row["status"]
572
+ baseline_diagnostic = control_row.get("diagnostic")
573
+ diagnosis = build_diagnosis(baseline) if baseline is not None else None
574
+ finding_ids = (
575
+ [
576
+ finding["finding_id"]
577
+ for finding in diagnosis["findings"]
578
+ if finding["type"] == specification["focus"]
579
+ ]
580
+ if diagnosis and case["finding_ids"]
581
+ else []
582
+ )
490
583
  row = {
491
584
  "task_id": key[0],
492
585
  "repetition": key[1],
493
- "baseline_status": case["capture_status"],
586
+ "baseline_status": baseline_status,
494
587
  "candidate_status": candidate_row["status"],
495
588
  "passed": False,
496
589
  "reasons": [],
@@ -498,10 +591,15 @@ def finish(session_path, candidate_path, root, *, change):
498
591
  "replay": None,
499
592
  "intervention": None,
500
593
  }
594
+ if controls is not None:
595
+ row.update(
596
+ frozen_baseline_status=case["capture_status"],
597
+ control_ran_first=control_row.get("order") == 0,
598
+ )
501
599
  if baseline is None or candidate is None:
502
- row["reasons"].append("A planned baseline or candidate trace is unavailable")
600
+ row["reasons"].append(f"A planned {label.lower()} or candidate trace is unavailable")
503
601
  for side, status, diagnostic in (
504
- ("Baseline", case["capture_status"], case.get("capture_diagnostic")),
602
+ (label, baseline_status, baseline_diagnostic),
505
603
  ("Candidate", candidate_row["status"], candidate_row.get("diagnostic")),
506
604
  ):
507
605
  if status != "completed":
@@ -512,7 +610,7 @@ def finish(session_path, candidate_path, root, *, change):
512
610
  quality = _quality(task, baseline, candidate)
513
611
  replay = build_replay_report(baseline, candidate, gates=gates, quality_report=quality)
514
612
  if (
515
- case["capture_status"] != "completed"
613
+ baseline_status != "completed"
516
614
  or candidate_row["status"] != "completed"
517
615
  or not all(_trace_usable(trace) for trace in (baseline, candidate))
518
616
  ):
@@ -523,13 +621,13 @@ def finish(session_path, candidate_path, root, *, change):
523
621
  for side in ("baseline", "candidate")
524
622
  ):
525
623
  row["reasons"].append(
526
- "Baseline and candidate must both pass the declared quality checks"
624
+ f"{label} and candidate must both pass the declared quality checks"
527
625
  )
528
626
  for result in quality["cases"]:
529
627
  for side in ("baseline", "candidate"):
530
628
  if not result[side]["passed"]:
531
629
  row["reasons"].append(
532
- f"{side.title()} answer failed the declared {task.get('scorer', {}).get('type', 'exact_match')} criterion: {result[side]['detail']}"
630
+ f"{label if side == 'baseline' else 'Candidate'} answer failed the declared {task.get('scorer', {}).get('type', 'exact_match')} criterion: {result[side]['detail']}"
533
631
  )
534
632
  if not replay["gates"]["passed"]:
535
633
  row["reasons"].append("Native replay gates failed")
@@ -538,7 +636,7 @@ def finish(session_path, candidate_path, root, *, change):
538
636
  for gate in replay["gates"]["results"]
539
637
  if not gate["passed"]
540
638
  )
541
- if not case["diagnosis"].get("analysis_complete", True) or not candidate.report().get(
639
+ if not diagnosis.get("analysis_complete", True) or not candidate.report().get(
542
640
  "analysis_complete", True
543
641
  ):
544
642
  row["reasons"].append("Finding analysis is incomplete")
@@ -567,14 +665,14 @@ def finish(session_path, candidate_path, root, *, change):
567
665
  cost_evaluable=replay["gates"]["cost_evaluable"],
568
666
  pricing_known=replay["gates"]["pricing_known"],
569
667
  )
570
- if case["finding_ids"]:
668
+ if finding_ids:
571
669
  record = build_intervention(
572
670
  baseline,
573
671
  candidate,
574
- target_finding_ids=case["finding_ids"],
672
+ target_finding_ids=finding_ids,
575
673
  intervention_type=specification["focus"],
576
674
  configuration={"change": change},
577
- diagnosis=case["diagnosis"],
675
+ diagnosis=diagnosis,
578
676
  gates=gates,
579
677
  quality_report=quality,
580
678
  replay_report=replay,
@@ -626,12 +724,19 @@ def finish(session_path, candidate_path, root, *, change):
626
724
  "candidate_capture_hash": fingerprint(candidate_manifest),
627
725
  "baseline_runner_hash": specification["baseline_capture"].get("runner_hash"),
628
726
  "candidate_runner_hash": candidate_manifest.get("runner_hash"),
727
+ "comparison_baseline": "frozen_baseline" if controls is None else "interleaved_control",
728
+ "control_capture_hash": None if controls is None else fingerprint(control_manifest),
729
+ "control_runner_hash": None if controls is None else control_manifest.get("runner_hash"),
629
730
  "planned_attempts": len(rows),
630
731
  "passed_attempts": sum(row["passed"] for row in rows),
631
732
  "passed": all(row["passed"] for row in rows),
632
733
  "synthetic": any(
633
734
  trace.metadata.get("synthetic") is True
634
- for trace in [*baselines.values(), *candidates.values()]
735
+ for trace in [
736
+ *baselines.values(),
737
+ *candidates.values(),
738
+ *(controls or {}).values(),
739
+ ]
635
740
  ),
636
741
  "cases": rows,
637
742
  "study": study,
@@ -49,6 +49,12 @@ def capture_command(
49
49
  show_runner_output: bool = typer.Option(
50
50
  False, help="Stream the runner's stdout and stderr for diagnosis."
51
51
  ),
52
+ control_arg: list[str] | None = typer.Option(
53
+ None,
54
+ "--control-arg",
55
+ help="One argument of the unchanged control runner; repeat for each argument. "
56
+ "Alternates control and candidate attempts so drift affects both.",
57
+ ),
52
58
  command: list[str] = typer.Argument(
53
59
  ..., help="Explicit runner argv after --. Receives a JSON request on stdin."
54
60
  ),
@@ -61,19 +67,24 @@ def capture_command(
61
67
  command,
62
68
  timeout=timeout,
63
69
  show_output=show_runner_output,
70
+ control=control_arg or None,
64
71
  )
65
72
  except (OSError, ValueError, TypeError, KeyError) as exc:
66
73
  raise typer.BadParameter(str(exc)) from exc
67
- complete = sum(row["status"] == "completed" for row in manifest["runs"])
68
- console.print(f"Captured {complete} of {len(manifest['runs'])} planned attempts.", markup=False)
74
+ attempts = [("", row) for row in manifest["runs"]]
75
+ if control_arg:
76
+ control = improvement.load_json(out.resolve() / improvement.CONTROL_CAPTURE)
77
+ attempts += [("Control: ", row) for row in control["runs"]]
78
+ complete = sum(row["status"] == "completed" for _, row in attempts)
79
+ console.print(f"Captured {complete} of {len(attempts)} planned attempts.", markup=False)
69
80
  console.print(f"Capture manifest written to {out / 'capture.json'}", markup=False)
70
- for attempt in manifest["runs"]:
81
+ for prefix, attempt in attempts:
71
82
  if attempt["status"] != "completed":
72
83
  console.print(
73
- f"{attempt['task_id']} repetition {attempt['repetition']} — {attempt['status']}. {attempt.get('diagnostic') or 'Inspect the runner with --show-runner-output.'}",
84
+ f"{prefix}{attempt['task_id']} repetition {attempt['repetition']} — {attempt['status']}. {attempt.get('diagnostic') or 'Inspect the runner with --show-runner-output.'}",
74
85
  markup=False,
75
86
  )
76
- if complete != len(manifest["runs"]):
87
+ if complete != len(attempts):
77
88
  raise typer.Exit(1)
78
89
 
79
90
 
@@ -170,6 +170,18 @@ def _metric(summary, name):
170
170
  return f"{value:.3f}" if isinstance(value, float) else str(value)
171
171
 
172
172
 
173
+ def _basis(report):
174
+ if report.get("comparison_baseline") == "interleaved_control":
175
+ return (
176
+ "Measurements compare the candidate with an unchanged control captured in "
177
+ "alternating order. Findings remain frozen from the original baseline."
178
+ )
179
+ return (
180
+ "Measurements compare the candidate with the frozen baseline captured before "
181
+ "the change. Run order is not counterbalanced."
182
+ )
183
+
184
+
173
185
  def report_markdown(report):
174
186
  lines = [
175
187
  f"# {markdown_heading(report['name'])}",
@@ -184,6 +196,8 @@ def report_markdown(report):
184
196
  "",
185
197
  markdown_text(report["change"]),
186
198
  "",
199
+ _basis(report),
200
+ "",
187
201
  ]
188
202
  if report["synthetic"]:
189
203
  lines.extend(
@@ -248,6 +262,7 @@ def export_report(root, report):
248
262
  sections = [
249
263
  f"<header><h1>{_text(report['name'])}</h1><p>{report['passed_attempts']} of {report['planned_attempts']} planned attempts passed.</p></header>",
250
264
  f"<h2>Applied change</h2><p>{_text(report['change'])}</p>",
265
+ f"<p>{_text(_basis(report))}</p>",
251
266
  ]
252
267
  if report["synthetic"]:
253
268
  sections.append(
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.2.1"
3
+ __version__ = "0.2.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentloop-profiler
3
- Version: 0.2.1
3
+ Version: 0.2.2
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
@@ -97,7 +97,7 @@ storage are available as optional components.
97
97
 
98
98
  For Node.js and browser applications, the source checkout includes a
99
99
  [TypeScript SDK](https://github.com/dipeshbabu/agentloop/blob/main/sdk/typescript/README.md) with native tracing and an API v1 client.
100
- It has no runtime dependencies and has not yet been published to npm.
100
+ It has no runtime dependencies and installs with `npm install agentloop-profiler`.
101
101
 
102
102
  ## Quickstart
103
103
 
@@ -191,6 +191,7 @@ tests/test_cli_store_commands.py
191
191
  tests/test_cli_trace_inputs.py
192
192
  tests/test_client.py
193
193
  tests/test_client_transport.py
194
+ tests/test_codex_exec_runner.py
194
195
  tests/test_completion.py
195
196
  tests/test_context_controls.py
196
197
  tests/test_context_reuse_experiments.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agentloop-profiler"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "Profiler and optimization layer for AI agent execution graphs"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -118,7 +118,7 @@ norecursedirs = [
118
118
  ]
119
119
 
120
120
  [tool.uv]
121
- required-version = ">=0.11.8,<0.12"
121
+ required-version = ">=0.11.8,<0.14"
122
122
  # Security floors and Python-specific binary compatibility requirements.
123
123
  constraint-dependencies = [
124
124
  "urllib3>=2.8.0",
@@ -0,0 +1,163 @@
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ from datetime import datetime, timezone
5
+
6
+ import pytest
7
+
8
+ from agentloop.events import AgentEvent
9
+ from agentloop.findings import build_diagnosis
10
+ from agentloop.tracer import AgentTrace
11
+ from examples.codex_exec_runner import convert, task_prompt
12
+
13
+ # Shape recorded from `codex exec --json` (Codex CLI 0.167.1), shortened.
14
+ STREAM = [
15
+ (0.0, {"type": "thread.started", "thread_id": "thread"}),
16
+ (0.5, {"type": "turn.started"}),
17
+ (
18
+ 2.0,
19
+ {
20
+ "type": "item.started",
21
+ "item": {"id": "item_1", "type": "command_execution", "command": "cat pyproject.toml"},
22
+ },
23
+ ),
24
+ (
25
+ 2.4,
26
+ {
27
+ "type": "item.completed",
28
+ "item": {
29
+ "id": "item_1",
30
+ "type": "command_execution",
31
+ "command": "cat pyproject.toml",
32
+ "aggregated_output": 'requires-python = ">=3.11"',
33
+ "exit_code": 0,
34
+ "status": "completed",
35
+ },
36
+ },
37
+ ),
38
+ (
39
+ 3.0,
40
+ {
41
+ "type": "item.completed",
42
+ "item": {"id": "item_2", "type": "agent_message", "text": ">=3.11"},
43
+ },
44
+ ),
45
+ (
46
+ 3.1,
47
+ {
48
+ "type": "turn.completed",
49
+ "usage": {
50
+ "input_tokens": 40000,
51
+ "cached_input_tokens": 32000,
52
+ "output_tokens": 60,
53
+ "reasoning_output_tokens": 20,
54
+ },
55
+ },
56
+ ),
57
+ ]
58
+
59
+
60
+ def lines(stream):
61
+ return [(moment, json.dumps(event) + "\n") for moment, event in stream]
62
+
63
+
64
+ def run_convert(stream):
65
+ return convert(
66
+ lines(stream),
67
+ run_id="run_test",
68
+ root_id="evt_root",
69
+ origin=datetime(2026, 11, 14, tzinfo=timezone.utc),
70
+ clock=0.0,
71
+ model="test-model",
72
+ )
73
+
74
+
75
+ def test_stream_becomes_tool_and_model_spans_with_turn_usage():
76
+ events, output, usage_seen, failure = run_convert(STREAM)
77
+ assert output == ">=3.11"
78
+ assert usage_seen is True
79
+ assert failure is None
80
+ assert [(event.event_type, event.name) for event in events] == [
81
+ ("model_call", "codex_tool_decision"),
82
+ ("tool_call", "shell"),
83
+ ("model_call", "codex_agent_message"),
84
+ ]
85
+ decision, tool, answer = events
86
+ assert decision.duration_ms == pytest.approx(1500)
87
+ assert tool.duration_ms == pytest.approx(400)
88
+ assert tool.input_text == "cat pyproject.toml"
89
+ assert answer.duration_ms == pytest.approx(600)
90
+ assert decision.input_tokens == 0 and decision.token_provenance == "unavailable"
91
+ assert (answer.input_tokens, answer.output_tokens, answer.token_provenance) == (
92
+ 40000,
93
+ 60,
94
+ "provider",
95
+ )
96
+ assert answer.metadata["usage_scope"] == "turn_total"
97
+ assert answer.metadata["cached_input_tokens"] == 32000
98
+
99
+
100
+ def test_failed_commands_and_turns_are_retained_as_errors():
101
+ stream = [
102
+ *STREAM[:3],
103
+ (
104
+ 2.4,
105
+ {
106
+ "type": "item.completed",
107
+ "item": {"id": "item_1", "type": "command_execution", "exit_code": 2},
108
+ },
109
+ ),
110
+ (3.0, {"type": "turn.failed", "error": {"message": "usage limit reached"}}),
111
+ ]
112
+ events, output, usage_seen, failure = run_convert(stream)
113
+ tool = next(event for event in events if event.event_type == "tool_call")
114
+ assert tool.status == "error" and tool.error == "exit code 2"
115
+ assert output is None
116
+ assert usage_seen is False
117
+ assert failure == "usage limit reached"
118
+
119
+
120
+ def test_usage_without_model_items_gets_its_own_model_span():
121
+ events, _, usage_seen, _ = run_convert([STREAM[1], STREAM[-1]])
122
+ assert usage_seen is True
123
+ assert [(event.name, event.input_tokens) for event in events] == [("codex_turn", 40000)]
124
+
125
+
126
+ def test_converted_events_form_an_analyzable_trace():
127
+ events, output, _, _ = run_convert(STREAM)
128
+ trace = AgentTrace("codex test", metadata={"output": output})
129
+ trace.add_event(
130
+ AgentEvent(
131
+ event_id="evt_root",
132
+ run_id=trace.run_id,
133
+ event_type="agent_step",
134
+ name="codex_exec",
135
+ started_at=events[0].started_at,
136
+ ended_at=events[-1].ended_at,
137
+ duration_ms=3100,
138
+ metadata={"operation_kind": "agent"},
139
+ )
140
+ )
141
+ for event in events:
142
+ event.run_id = trace.run_id
143
+ trace.add_event(event)
144
+ trace.finish()
145
+ restored = AgentTrace.from_dict(json.loads(json.dumps(trace.to_dict())))
146
+ assert build_diagnosis(restored)["run_id"] == trace.run_id
147
+
148
+
149
+ @pytest.mark.parametrize(
150
+ ("value", "instructions", "expected"),
151
+ [
152
+ ("plain", "", "plain"),
153
+ ({"prompt": "object"}, "", "object"),
154
+ ({"question": "legacy"}, "Be brief.", "Be brief.\n\nlegacy"),
155
+ ],
156
+ )
157
+ def test_task_prompt_accepts_strings_and_prompt_objects(value, instructions, expected):
158
+ assert task_prompt(value, instructions) == expected
159
+
160
+
161
+ def test_task_prompt_rejects_missing_prompts():
162
+ with pytest.raises(ValueError, match="prompt"):
163
+ task_prompt({"other": 1}, "")