agentloop-profiler 0.2.2__tar.gz → 0.2.3__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.
- {agentloop_profiler-0.2.2/agentloop_profiler.egg-info → agentloop_profiler-0.2.3}/PKG-INFO +1 -1
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/cli.py +27 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/improvement.py +153 -13
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/improvement_cli.py +28 -4
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/improvement_report.py +45 -2
- agentloop_profiler-0.2.3/agentloop/repetitions.py +254 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/version.py +1 -1
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3/agentloop_profiler.egg-info}/PKG-INFO +1 -1
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop_profiler.egg-info/SOURCES.txt +2 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/pyproject.toml +1 -1
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_codex_exec_runner.py +80 -3
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_improvement.py +197 -0
- agentloop_profiler-0.2.3/tests/test_repetitions.py +220 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/LICENSE +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/README.md +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/THIRD_PARTY_LICENSES.md +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/ablation_protocol.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/ablations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/aggregate_cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/aggregate_stats.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/aggregates.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/audit.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/autoinstrument.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/batch_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/batching.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/budget_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/budgets.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/calibration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/checkpoint_state.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/checkpoint_store.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/ci.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/cli_paths.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/client.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/completion.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/completion_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/config.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/context_controls.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/context_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/context_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/costs.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/cursor_validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/decorators.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/demo.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/doctor.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/drift.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/drift_cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/drift_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/drift_windows.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/entrypoint.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/estimates.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/events.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/experiment_artifacts.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/experiment_observations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/experiment_reports.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/experiment_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/exporters.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/finding_benchmark_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/finding_benchmarks.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/findings.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/graph.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness_bench/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness_bench/cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness_bench/drivers.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness_bench/offline.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/harness_usage.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/html_report.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/improvement_init.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/crewai.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/atif.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/atif_validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/manifest.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/trial_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/trials.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/harbor/verifier.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/hermes.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/hermes_cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/hermes_recorder.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/langgraph.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/langgraph_harness.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/langgraph_recovery.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/omnigent/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/omnigent/cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/omnigent/evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/omnigent/telemetry.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/openai.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/openai_agents.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/sdk.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/integrations/vercel_ai.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/artifacts.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/cohort_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/cohorts.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/contracts.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/coordination.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/otlp_jsonl.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/otlp_validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/registry.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interoperability/validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/intervention_service.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/intervention_store.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/interventions.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/issues.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/judgment_adapters.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/judgment_benchmark_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/judgment_benchmarks.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/judgment_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/judgment_views.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/judgments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/loop_guards.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/loop_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/markdown.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/metrics.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/migrations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/model_routing.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/onboarding.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/operations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/optimizer.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/otel.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/otel_ids.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/otel_semantics.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/parallelism.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/patches.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/plan_export.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/policy_promotion.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/promotion_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/promotion_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/quality.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/ranking.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/recovery_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/replay.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/retention.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/retention_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/reuse_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/routing_checks.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/routing_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/rules.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/runtime.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/savings.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/scheduling_plan.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/scheduling_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/schema.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/semantic_rules.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/semantic_waste.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/semantic_waste_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/server.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/store.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/structural_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/structural_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/structured_quality.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/studies.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/study_statistics.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/substitution_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/substitution_export.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/substitution_reports.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/substitution_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/substitutions.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/timing.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/tokens.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/tool_scheduling.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/trace_sources.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/tracer.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/value.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/workflow_types.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop/workflows.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop_profiler.egg-info/dependency_links.txt +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop_profiler.egg-info/entry_points.txt +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop_profiler.egg-info/requires.txt +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/agentloop_profiler.egg-info/top_level.txt +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/dashboard/__init__.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/dashboard/app.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/dashboard/streamlit_compat.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/dashboard/trace_upload.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/dashboard/value_view.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/setup.cfg +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_ablations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_aggregates.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_api_versioning.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_batch_data_pipeline.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_budgets.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_bump_version.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_calibration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_capability_registry.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_checkpoint_recovery.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_ci_command.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_ci_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_cli_output_paths.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_cli_store_commands.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_cli_trace_inputs.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_client.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_client_transport.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_completion.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_context_controls.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_context_reuse_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_context_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_costs.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_crewai_integration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_cursor_server.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_cursor_shape_validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_input_validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_quality.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_semantic_waste.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_structured_quality.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_trace_upload.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_value_view.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dashboard_workflows.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_decorators.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_demo_cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_dependabot_config.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_diagnosis_api.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_distribution_metadata.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_docs_site.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_doctor_autoinstrument.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_drift.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_email_workflow.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_empirical_calibration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_enforcement_conformance.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_estimates.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_evidence_workflow.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_exporters.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_external_cohorts.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_finding_benchmarks.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_finding_identity.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_finding_rules.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_first_use_cli.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_graph.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_guided_validation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_harbor_atif.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_harbor_trials.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_harness.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_harness_bench.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_harness_error_usage.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_harness_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_hermes_integration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_hermes_replay_capture.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_hermes_repository_example.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_hermes_runtime_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_html_report.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_improvement_init.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_incident_triage.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_instrumentation_measurement.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_integration_conformance.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_interoperability_contracts.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_interventions.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_issues.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_judgment_adapters.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_judgment_benchmarks.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_judgment_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_judgment_provider_optional.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_judgments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_langgraph_conformance.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_langgraph_harness.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_langgraph_integration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_langgraph_recovery.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_loop_guards.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_markdown.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_markdown_exporters.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_marketplace_workflow.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_metrics.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_migrations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_model_batching.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_model_routing.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_multiagent_coordination.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_non_agent_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_omnigent_telemetry.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_onboarding.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_openai_agents_integration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_openai_integration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_operations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_optimizer.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_otel_ids.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_otel_interop.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_otlp_jsonl.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_parallelization_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_patch_plan.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_patch_source_scope.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_payment_review.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_policy_promotion.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_published_readme.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_python_support.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_quality.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_ranking.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_real_agent_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_real_calibration_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_real_harness_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_release_workflows.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_remote_cli_credentials.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_replay.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_repository_policy_traversal.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_research_example.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_retention.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_retry_recommendations.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_routing_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_rule_error_privacy.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_runtime.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_savings_aggregation.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_scheduling_study.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_semantic_findings.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_semantic_waste.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_server.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_standalone_notices.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_store.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_store_contract.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_streaming_inventory.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_streamlit_compat.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_structural_experiments.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_structured_quality.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_structured_quality_evidence.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_studies.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_substitutions.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_telemetry_conformance.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_timing.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_token_provenance.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_tool_scheduling.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_trace_context.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_trace_failure_recording.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_trace_schema.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_usefulness_benchmark.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_value.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_vercel_ai_integration.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_workflow_storage.py +0 -0
- {agentloop_profiler-0.2.2 → agentloop_profiler-0.2.3}/tests/test_workflows.py +0 -0
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
|
+
import sys
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
|
|
7
8
|
import typer
|
|
@@ -66,6 +67,32 @@ from agentloop.value import build_value_report
|
|
|
66
67
|
|
|
67
68
|
app = typer.Typer(help="AgentLoop profiler CLI")
|
|
68
69
|
console = Console()
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _utf8_output() -> None:
|
|
73
|
+
"""Write UTF-8 when output is redirected on a legacy code page.
|
|
74
|
+
|
|
75
|
+
On Windows, piped or redirected output uses the ANSI code page (for example
|
|
76
|
+
cp1252). Task IDs, trace names and other user text outside that code page
|
|
77
|
+
then raise UnicodeEncodeError mid-command and hide the real result.
|
|
78
|
+
Interactive consoles already use UTF-8 and are left unchanged.
|
|
79
|
+
"""
|
|
80
|
+
for stream in (sys.stdout, sys.stderr):
|
|
81
|
+
encoding = (getattr(stream, "encoding", None) or "").lower().replace("-", "")
|
|
82
|
+
if encoding in {"utf8", "utf_8"} or not hasattr(stream, "reconfigure"):
|
|
83
|
+
continue
|
|
84
|
+
try:
|
|
85
|
+
stream.reconfigure(encoding="utf-8", errors="replace")
|
|
86
|
+
except (OSError, ValueError):
|
|
87
|
+
continue
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@app.callback()
|
|
91
|
+
def _main() -> None:
|
|
92
|
+
"""AgentLoop profiler CLI"""
|
|
93
|
+
_utf8_output()
|
|
94
|
+
|
|
95
|
+
|
|
69
96
|
study_app = typer.Typer(help="Summarize offline studies and preserved intervention evidence.")
|
|
70
97
|
app.add_typer(study_app, name="study")
|
|
71
98
|
app.add_typer(aggregate_app, name="aggregate")
|
|
@@ -7,6 +7,7 @@ import json
|
|
|
7
7
|
import math
|
|
8
8
|
import os
|
|
9
9
|
import signal
|
|
10
|
+
import statistics
|
|
10
11
|
import subprocess # nosec B404 - execution requires explicit CLI argv
|
|
11
12
|
from dataclasses import asdict
|
|
12
13
|
from datetime import datetime, timezone
|
|
@@ -17,11 +18,20 @@ from agentloop.experiment_types import fingerprint
|
|
|
17
18
|
from agentloop.findings import build_diagnosis
|
|
18
19
|
from agentloop.interventions import build_intervention
|
|
19
20
|
from agentloop.quality import build_quality_report, validate_quality_fixtures
|
|
21
|
+
from agentloop.repetitions import add_repetition_findings
|
|
20
22
|
from agentloop.replay import ReplayGates, build_replay_report
|
|
21
23
|
from agentloop.replay import _summary as replay_summary
|
|
22
24
|
from agentloop.tracer import AgentTrace
|
|
23
25
|
|
|
24
26
|
VERSION = "1.0"
|
|
27
|
+
DECISIONS = {"per_pair", "aggregate"}
|
|
28
|
+
# Speed and cost gates; an aggregate decision judges these across all pairs.
|
|
29
|
+
PERFORMANCE_GATES = {
|
|
30
|
+
"latency_regression",
|
|
31
|
+
"latency_improvement",
|
|
32
|
+
"cost_regression",
|
|
33
|
+
"cost_improvement",
|
|
34
|
+
}
|
|
25
35
|
SCORERS = {"exact_match", "contains", "json_subset", "required_fields", "glob"}
|
|
26
36
|
|
|
27
37
|
|
|
@@ -364,6 +374,16 @@ def read_capture(path, workload):
|
|
|
364
374
|
return manifest, traces
|
|
365
375
|
|
|
366
376
|
|
|
377
|
+
def _completed(manifest, traces):
|
|
378
|
+
"""Traces of attempts that completed, for comparisons between repetitions."""
|
|
379
|
+
done = {
|
|
380
|
+
(row["task_id"], row["repetition"])
|
|
381
|
+
for row in manifest["runs"]
|
|
382
|
+
if row["status"] == "completed"
|
|
383
|
+
}
|
|
384
|
+
return {key: trace for key, trace in traces.items() if key in done}
|
|
385
|
+
|
|
386
|
+
|
|
367
387
|
def _quality(task, baseline, candidate):
|
|
368
388
|
return build_quality_report(
|
|
369
389
|
[
|
|
@@ -380,18 +400,30 @@ def _quality(task, baseline, candidate):
|
|
|
380
400
|
|
|
381
401
|
|
|
382
402
|
def start(
|
|
383
|
-
workload_path,
|
|
403
|
+
workload_path,
|
|
404
|
+
baseline_path,
|
|
405
|
+
root,
|
|
406
|
+
*,
|
|
407
|
+
focus=None,
|
|
408
|
+
objective="latency",
|
|
409
|
+
minimum_improvement=0,
|
|
410
|
+
decision="per_pair",
|
|
384
411
|
):
|
|
385
412
|
workload = read_workload(workload_path)
|
|
386
413
|
manifest, traces = read_capture(baseline_path, workload)
|
|
387
414
|
require(objective in {"latency", "cost"}, "Objective must be latency or cost")
|
|
415
|
+
decision = decision.replace("-", "_") if isinstance(decision, str) else decision
|
|
416
|
+
require(decision in DECISIONS, "Decision must be per-pair or aggregate")
|
|
388
417
|
require(
|
|
389
418
|
type(minimum_improvement) in (int, float)
|
|
390
419
|
and math.isfinite(minimum_improvement)
|
|
391
420
|
and minimum_improvement >= 0,
|
|
392
421
|
"Minimum improvement must be finite and nonnegative",
|
|
393
422
|
)
|
|
394
|
-
diagnoses =
|
|
423
|
+
diagnoses = add_repetition_findings(
|
|
424
|
+
{key: build_diagnosis(trace) for key, trace in traces.items()},
|
|
425
|
+
_completed(manifest, traces),
|
|
426
|
+
)
|
|
395
427
|
findings = [finding for diagnosis in diagnoses.values() for finding in diagnosis["findings"]]
|
|
396
428
|
if focus is None and findings:
|
|
397
429
|
focus = findings[0]["type"]
|
|
@@ -442,6 +474,7 @@ def start(
|
|
|
442
474
|
"workload": workload,
|
|
443
475
|
"focus": focus,
|
|
444
476
|
"objective": objective,
|
|
477
|
+
"decision": decision,
|
|
445
478
|
"gates": asdict(gates),
|
|
446
479
|
"cases": cases,
|
|
447
480
|
"baseline_capture": manifest,
|
|
@@ -473,6 +506,83 @@ def _trace_usable(trace):
|
|
|
473
506
|
return not any(event.parent_id is None and event.status == "error" for event in trace.events)
|
|
474
507
|
|
|
475
508
|
|
|
509
|
+
def _sign_test_p_value(improved, regressed):
|
|
510
|
+
"""One-sided exact sign test: chance of at least this many improvements."""
|
|
511
|
+
trials = improved + regressed
|
|
512
|
+
if trials == 0:
|
|
513
|
+
return None
|
|
514
|
+
return sum(math.comb(trials, k) for k in range(improved, trials + 1)) / 2**trials
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
def _aggregate_decision(rows, objective, gates):
|
|
518
|
+
"""Judge speed or cost across all planned pairs.
|
|
519
|
+
|
|
520
|
+
Correctness, completion and non-performance gates were already enforced on
|
|
521
|
+
every pair. Here the median paired improvement in the selected objective
|
|
522
|
+
must be positive and meet the frozen minimum, and more pairs must improve
|
|
523
|
+
than regress. The other metric's median regression must stay within its
|
|
524
|
+
allowed regression when every pair can measure it.
|
|
525
|
+
"""
|
|
526
|
+
secondary = "cost" if objective == "latency" else "latency"
|
|
527
|
+
required = (
|
|
528
|
+
gates.min_latency_improvement_pct
|
|
529
|
+
if objective == "latency"
|
|
530
|
+
else gates.min_cost_improvement_pct
|
|
531
|
+
)
|
|
532
|
+
allowed = (
|
|
533
|
+
gates.max_cost_regression_pct if secondary == "cost" else gates.max_latency_regression_pct
|
|
534
|
+
)
|
|
535
|
+
gains = [row.get("objective_gain_pct") for row in rows]
|
|
536
|
+
regressions = [
|
|
537
|
+
(row["replay"] or {}).get("deltas", {}).get(f"{secondary}_regression_pct")
|
|
538
|
+
if row.get("replay")
|
|
539
|
+
else None
|
|
540
|
+
for row in rows
|
|
541
|
+
]
|
|
542
|
+
reasons = []
|
|
543
|
+
measured = [gain for gain in gains if gain is not None]
|
|
544
|
+
improved = sum(gain > 0 for gain in measured)
|
|
545
|
+
regressed = sum(gain < 0 for gain in measured)
|
|
546
|
+
median = statistics.median(measured) if measured else None
|
|
547
|
+
if len(measured) != len(rows):
|
|
548
|
+
reasons.append(
|
|
549
|
+
f"{len(rows) - len(measured)} of {len(rows)} pairs have no measured {objective} improvement"
|
|
550
|
+
)
|
|
551
|
+
if median is None or median <= 0 or median < required:
|
|
552
|
+
detail = "unavailable" if median is None else f"{median:.2f}%"
|
|
553
|
+
reasons.append(
|
|
554
|
+
f"Median {objective} improvement {detail} must be positive and at least {required:.2f}%"
|
|
555
|
+
)
|
|
556
|
+
if improved <= regressed:
|
|
557
|
+
reasons.append(
|
|
558
|
+
f"{improved} pairs improved and {regressed} regressed; more pairs must improve than regress"
|
|
559
|
+
)
|
|
560
|
+
secondary_median = None
|
|
561
|
+
if all(value is not None for value in regressions):
|
|
562
|
+
secondary_median = statistics.median(regressions)
|
|
563
|
+
if secondary_median > allowed:
|
|
564
|
+
reasons.append(
|
|
565
|
+
f"Median {secondary} regression {secondary_median:.2f}% exceeds {allowed:.2f}% allowed"
|
|
566
|
+
)
|
|
567
|
+
return {
|
|
568
|
+
"mode": "aggregate",
|
|
569
|
+
"objective": objective,
|
|
570
|
+
"pairs": len(rows),
|
|
571
|
+
"median_improvement_pct": median,
|
|
572
|
+
"required_improvement_pct": required,
|
|
573
|
+
"improved_pairs": improved,
|
|
574
|
+
"regressed_pairs": regressed,
|
|
575
|
+
"unchanged_pairs": len(measured) - improved - regressed,
|
|
576
|
+
"sign_test_p_value": _sign_test_p_value(improved, regressed),
|
|
577
|
+
"secondary_metric": secondary,
|
|
578
|
+
"secondary_median_regression_pct": secondary_median,
|
|
579
|
+
"secondary_allowed_regression_pct": allowed,
|
|
580
|
+
"secondary_judged": secondary_median is not None,
|
|
581
|
+
"passed": not reasons,
|
|
582
|
+
"reasons": reasons,
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
|
|
476
586
|
def finish(session_path, candidate_path, root, *, change):
|
|
477
587
|
session_path = Path(session_path).resolve()
|
|
478
588
|
saved = load_json(session_path)
|
|
@@ -484,6 +594,9 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
484
594
|
require(specification.get("schema_version") == VERSION, "Unsupported frozen session version")
|
|
485
595
|
workload = validate_workload(specification["workload"])
|
|
486
596
|
require(specification.get("objective") in {"latency", "cost"}, "Unsupported frozen objective")
|
|
597
|
+
# Sessions frozen before 0.2.3 have no decision field and keep per-pair judgment.
|
|
598
|
+
decision = specification.get("decision", "per_pair")
|
|
599
|
+
require(decision in DECISIONS, "Unsupported frozen decision")
|
|
487
600
|
planned = {(task["id"], repetition) for task, repetition in slots(workload)}
|
|
488
601
|
cases = specification.get("cases")
|
|
489
602
|
require(
|
|
@@ -537,12 +650,23 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
537
650
|
fingerprint(control_manifest) == reference.get("manifest_hash"),
|
|
538
651
|
"Interleaved control capture changed",
|
|
539
652
|
)
|
|
653
|
+
require(
|
|
654
|
+
datetime.fromisoformat(control_manifest["created_at"])
|
|
655
|
+
>= datetime.fromisoformat(specification["frozen_at"]),
|
|
656
|
+
"Capture the interleaved control after freezing baseline findings",
|
|
657
|
+
)
|
|
540
658
|
require(
|
|
541
659
|
not (baseline_ids | candidate_ids).intersection(
|
|
542
660
|
trace.run_id for trace in controls.values()
|
|
543
661
|
),
|
|
544
662
|
"Control, baseline and candidate must have distinct run IDs",
|
|
545
663
|
)
|
|
664
|
+
# Diagnose controls like the original baseline, including comparisons
|
|
665
|
+
# between their repetitions, so focus findings can be linked.
|
|
666
|
+
control_diagnoses = add_repetition_findings(
|
|
667
|
+
{key: build_diagnosis(trace) for key, trace in controls.items()},
|
|
668
|
+
_completed(control_manifest, controls),
|
|
669
|
+
)
|
|
546
670
|
gates = ReplayGates(**specification["gates"])
|
|
547
671
|
root = Path(root).resolve()
|
|
548
672
|
root.mkdir(parents=True, exist_ok=False)
|
|
@@ -570,7 +694,7 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
570
694
|
)
|
|
571
695
|
baseline_status = control_row["status"]
|
|
572
696
|
baseline_diagnostic = control_row.get("diagnostic")
|
|
573
|
-
diagnosis =
|
|
697
|
+
diagnosis = control_diagnoses.get(key)
|
|
574
698
|
finding_ids = (
|
|
575
699
|
[
|
|
576
700
|
finding["finding_id"]
|
|
@@ -629,13 +753,17 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
629
753
|
row["reasons"].append(
|
|
630
754
|
f"{label if side == 'baseline' else 'Candidate'} answer failed the declared {task.get('scorer', {}).get('type', 'exact_match')} criterion: {result[side]['detail']}"
|
|
631
755
|
)
|
|
632
|
-
|
|
756
|
+
# Aggregate decisions judge speed and cost across all pairs after
|
|
757
|
+
# this loop; every other gate still applies to each pair.
|
|
758
|
+
judged = [
|
|
759
|
+
gate
|
|
760
|
+
for gate in replay["gates"]["results"]
|
|
761
|
+
if not gate["passed"]
|
|
762
|
+
and (decision == "per_pair" or gate["name"] not in PERFORMANCE_GATES)
|
|
763
|
+
]
|
|
764
|
+
if judged:
|
|
633
765
|
row["reasons"].append("Native replay gates failed")
|
|
634
|
-
row["reasons"].extend(
|
|
635
|
-
f"{gate['name']}: {gate['detail']}"
|
|
636
|
-
for gate in replay["gates"]["results"]
|
|
637
|
-
if not gate["passed"]
|
|
638
|
-
)
|
|
766
|
+
row["reasons"].extend(f"{gate['name']}: {gate['detail']}" for gate in judged)
|
|
639
767
|
if not diagnosis.get("analysis_complete", True) or not candidate.report().get(
|
|
640
768
|
"analysis_complete", True
|
|
641
769
|
):
|
|
@@ -645,14 +773,20 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
645
773
|
if specification["objective"] == "latency"
|
|
646
774
|
else "cost_improvement_pct"
|
|
647
775
|
]
|
|
648
|
-
if gain is None or gain <= 0:
|
|
776
|
+
if decision == "per_pair" and (gain is None or gain <= 0):
|
|
649
777
|
row["reasons"].append("The selected objective has no measured improvement")
|
|
650
|
-
row.update(
|
|
778
|
+
row.update(
|
|
779
|
+
quality=quality, replay=replay, passed=not row["reasons"], objective_gain_pct=gain
|
|
780
|
+
)
|
|
651
781
|
replay["gates"]["results"].append(
|
|
652
782
|
{
|
|
653
783
|
"name": "guided_evidence",
|
|
654
784
|
"passed": row["passed"],
|
|
655
|
-
"detail":
|
|
785
|
+
"detail": (
|
|
786
|
+
"All guided execution, quality and measured-objective checks passed"
|
|
787
|
+
if decision == "per_pair"
|
|
788
|
+
else "All guided execution and quality checks passed; performance is judged across all pairs"
|
|
789
|
+
)
|
|
656
790
|
if row["passed"]
|
|
657
791
|
else " ".join(row["reasons"]),
|
|
658
792
|
"indeterminate": False,
|
|
@@ -712,6 +846,11 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
712
846
|
}
|
|
713
847
|
study_file = write_once(root, "study.json", study_manifest)
|
|
714
848
|
study = summarize_study(study_file)
|
|
849
|
+
verdict = (
|
|
850
|
+
{"mode": "per_pair", "passed": True}
|
|
851
|
+
if decision == "per_pair"
|
|
852
|
+
else _aggregate_decision(rows, specification["objective"], gates)
|
|
853
|
+
)
|
|
715
854
|
report = {
|
|
716
855
|
"schema_version": VERSION,
|
|
717
856
|
"name": workload["name"],
|
|
@@ -729,7 +868,8 @@ def finish(session_path, candidate_path, root, *, change):
|
|
|
729
868
|
"control_runner_hash": None if controls is None else control_manifest.get("runner_hash"),
|
|
730
869
|
"planned_attempts": len(rows),
|
|
731
870
|
"passed_attempts": sum(row["passed"] for row in rows),
|
|
732
|
-
"
|
|
871
|
+
"decision": verdict,
|
|
872
|
+
"passed": all(row["passed"] for row in rows) and verdict["passed"],
|
|
733
873
|
"synthetic": any(
|
|
734
874
|
trace.metadata.get("synthetic") is True
|
|
735
875
|
for trace in [
|
|
@@ -101,6 +101,11 @@ def start_command(
|
|
|
101
101
|
minimum_improvement: float = typer.Option(
|
|
102
102
|
0, min=0, help="Required percentage gain in the selected objective."
|
|
103
103
|
),
|
|
104
|
+
decision: str = typer.Option(
|
|
105
|
+
"per-pair",
|
|
106
|
+
help="per-pair requires every pair to improve; aggregate judges the median "
|
|
107
|
+
"paired improvement for noisy agents. Correctness is checked per pair in both.",
|
|
108
|
+
),
|
|
104
109
|
):
|
|
105
110
|
"""Freeze task checks and original findings before editing the agent."""
|
|
106
111
|
try:
|
|
@@ -111,6 +116,7 @@ def start_command(
|
|
|
111
116
|
focus=focus,
|
|
112
117
|
objective=objective,
|
|
113
118
|
minimum_improvement=minimum_improvement,
|
|
119
|
+
decision=decision,
|
|
114
120
|
)
|
|
115
121
|
except (OSError, ValueError, TypeError, KeyError) as exc:
|
|
116
122
|
raise typer.BadParameter(str(exc)) from exc
|
|
@@ -136,10 +142,28 @@ def finish_command(
|
|
|
136
142
|
report = improvement.finish(session, candidate, out, change=change)
|
|
137
143
|
except (OSError, ValueError, TypeError, KeyError) as exc:
|
|
138
144
|
raise typer.BadParameter(str(exc)) from exc
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
verdict = report["decision"]
|
|
146
|
+
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
|
+
)
|
|
152
|
+
median = verdict["median_improvement_pct"]
|
|
153
|
+
console.print(
|
|
154
|
+
f"Aggregate {verdict['objective']} decision "
|
|
155
|
+
+ ("passed" if verdict["passed"] else "failed")
|
|
156
|
+
+ f": median improvement {'unavailable' if median is None else f'{median:.2f}%'}, "
|
|
157
|
+
f"{verdict['improved_pairs']} improved, {verdict['regressed_pairs']} regressed.",
|
|
158
|
+
markup=False,
|
|
159
|
+
)
|
|
160
|
+
for reason in verdict["reasons"]:
|
|
161
|
+
console.print(f"Aggregate check failed: {reason}", markup=False)
|
|
162
|
+
else:
|
|
163
|
+
console.print(
|
|
164
|
+
f"{report['passed_attempts']} of {report['planned_attempts']} planned comparisons passed.",
|
|
165
|
+
markup=False,
|
|
166
|
+
)
|
|
143
167
|
console.print(f"Read {out / 'report.html'}", markup=False)
|
|
144
168
|
for case in report["cases"]:
|
|
145
169
|
if not case["passed"]:
|
|
@@ -22,6 +22,9 @@ def plan_markdown(specification):
|
|
|
22
22
|
"",
|
|
23
23
|
f"Investigation focus is {markdown_text(specification['focus'] or 'unavailable')}.",
|
|
24
24
|
f"The measured objective is {specification['objective']}. Every baseline and candidate output must pass its declared quality checks.",
|
|
25
|
+
"The frozen decision judges the objective across all pairs by median paired improvement."
|
|
26
|
+
if specification.get("decision") == "aggregate"
|
|
27
|
+
else "The frozen decision requires every pair to improve the objective.",
|
|
25
28
|
"",
|
|
26
29
|
]
|
|
27
30
|
for case in specification["cases"]:
|
|
@@ -170,6 +173,15 @@ def _metric(summary, name):
|
|
|
170
173
|
return f"{value:.3f}" if isinstance(value, float) else str(value)
|
|
171
174
|
|
|
172
175
|
|
|
176
|
+
def _headline(report):
|
|
177
|
+
if (report.get("decision") or {}).get("mode") == "aggregate":
|
|
178
|
+
return (
|
|
179
|
+
f"{report['passed_attempts']} of {report['planned_attempts']} pairs passed "
|
|
180
|
+
"correctness and completion checks."
|
|
181
|
+
)
|
|
182
|
+
return f"{report['passed_attempts']} of {report['planned_attempts']} planned attempts passed."
|
|
183
|
+
|
|
184
|
+
|
|
173
185
|
def _basis(report):
|
|
174
186
|
if report.get("comparison_baseline") == "interleaved_control":
|
|
175
187
|
return (
|
|
@@ -182,6 +194,35 @@ def _basis(report):
|
|
|
182
194
|
)
|
|
183
195
|
|
|
184
196
|
|
|
197
|
+
def _decision_lines(report):
|
|
198
|
+
verdict = report.get("decision") or {"mode": "per_pair"}
|
|
199
|
+
if verdict["mode"] != "aggregate":
|
|
200
|
+
return ["Decision: every pair must pass correctness, completion and performance checks."]
|
|
201
|
+
median = verdict["median_improvement_pct"]
|
|
202
|
+
p_value = verdict["sign_test_p_value"]
|
|
203
|
+
lines = [
|
|
204
|
+
"Decision: every pair must pass correctness and completion checks; "
|
|
205
|
+
f"{verdict['objective']} is judged across all pairs.",
|
|
206
|
+
f"Aggregate {verdict['objective']} decision "
|
|
207
|
+
+ ("passed" if verdict["passed"] else "failed")
|
|
208
|
+
+ ": median paired improvement "
|
|
209
|
+
+ ("unavailable" if median is None else f"{median:.2f}%")
|
|
210
|
+
+ f" (required at least {verdict['required_improvement_pct']:.2f}%), "
|
|
211
|
+
f"{verdict['improved_pairs']} improved, {verdict['regressed_pairs']} regressed, "
|
|
212
|
+
f"{verdict['unchanged_pairs']} unchanged.",
|
|
213
|
+
]
|
|
214
|
+
if p_value is not None:
|
|
215
|
+
lines.append(
|
|
216
|
+
f"One-sided sign test p-value {p_value:.3f}. It is reported for context and does not gate the decision."
|
|
217
|
+
)
|
|
218
|
+
if not verdict["secondary_judged"]:
|
|
219
|
+
lines.append(
|
|
220
|
+
f"Median {verdict['secondary_metric']} regression was not judged because it was unavailable for some pairs."
|
|
221
|
+
)
|
|
222
|
+
lines.extend(f"Aggregate check failed: {reason}" for reason in verdict["reasons"])
|
|
223
|
+
return lines
|
|
224
|
+
|
|
225
|
+
|
|
185
226
|
def report_markdown(report):
|
|
186
227
|
lines = [
|
|
187
228
|
f"# {markdown_heading(report['name'])}",
|
|
@@ -190,7 +231,7 @@ def report_markdown(report):
|
|
|
190
231
|
if report["passed"]
|
|
191
232
|
else "The change did not pass the declared checks.",
|
|
192
233
|
"",
|
|
193
|
-
|
|
234
|
+
_headline(report),
|
|
194
235
|
"",
|
|
195
236
|
"Applied change",
|
|
196
237
|
"",
|
|
@@ -198,6 +239,7 @@ def report_markdown(report):
|
|
|
198
239
|
"",
|
|
199
240
|
_basis(report),
|
|
200
241
|
"",
|
|
242
|
+
*[item for line in _decision_lines(report) for item in (markdown_text(line), "")],
|
|
201
243
|
]
|
|
202
244
|
if report["synthetic"]:
|
|
203
245
|
lines.extend(
|
|
@@ -260,9 +302,10 @@ def export_report(root, report):
|
|
|
260
302
|
markdown = report_markdown(report)
|
|
261
303
|
(root / "report.md").write_text(markdown, encoding="utf-8")
|
|
262
304
|
sections = [
|
|
263
|
-
f"<header><h1>{_text(report['name'])}</h1><p>{report
|
|
305
|
+
f"<header><h1>{_text(report['name'])}</h1><p>{_text(_headline(report))}</p></header>",
|
|
264
306
|
f"<h2>Applied change</h2><p>{_text(report['change'])}</p>",
|
|
265
307
|
f"<p>{_text(_basis(report))}</p>",
|
|
308
|
+
*[f"<p>{_text(line)}</p>" for line in _decision_lines(report)],
|
|
266
309
|
]
|
|
267
310
|
if report["synthetic"]:
|
|
268
311
|
sections.append(
|