agenttune 1.1.0__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.
- agenttune-1.1.0/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- agenttune-1.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
- agenttune-1.1.0/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
- agenttune-1.1.0/.github/PULL_REQUEST_TEMPLATE.md +29 -0
- agenttune-1.1.0/.github/workflows/ci.yml +87 -0
- agenttune-1.1.0/.github/workflows/docs.yml +53 -0
- agenttune-1.1.0/.github/workflows/patch-release.yml +351 -0
- agenttune-1.1.0/.gitignore +268 -0
- agenttune-1.1.0/.pre-commit-config.yaml +34 -0
- agenttune-1.1.0/CHANGELOG.md +107 -0
- agenttune-1.1.0/CODE_OF_CONDUCT.md +133 -0
- agenttune-1.1.0/CONTRIBUTING.md +276 -0
- agenttune-1.1.0/LICENSE +83 -0
- agenttune-1.1.0/PKG-INFO +636 -0
- agenttune-1.1.0/README.md +530 -0
- agenttune-1.1.0/SECURITY.md +165 -0
- agenttune-1.1.0/config/STAGE_WISE_TRAINING_EXAMPLE.yaml +114 -0
- agenttune-1.1.0/config/config.yaml +223 -0
- agenttune-1.1.0/config.yaml +227 -0
- agenttune-1.1.0/docs/CNAME +1 -0
- agenttune-1.1.0/docs/README.md +209 -0
- agenttune-1.1.0/docs/advanced/eventlog-schema.md +405 -0
- agenttune-1.1.0/docs/advanced/production-compositions.md +459 -0
- agenttune-1.1.0/docs/advanced/reward-hacking-defenses.md +394 -0
- agenttune-1.1.0/docs/advanced/tool-isolation.md +266 -0
- agenttune-1.1.0/docs/advanced/trajectory-metrics.md +400 -0
- agenttune-1.1.0/docs/algorithms/bco.md +112 -0
- agenttune-1.1.0/docs/algorithms/dpo.md +120 -0
- agenttune-1.1.0/docs/algorithms/grpo.md +104 -0
- agenttune-1.1.0/docs/algorithms/overview.md +86 -0
- agenttune-1.1.0/docs/algorithms/ppo.md +119 -0
- agenttune-1.1.0/docs/algorithms/rloo.md +106 -0
- agenttune-1.1.0/docs/assets/agenttune-logo-black.png +0 -0
- agenttune-1.1.0/docs/assets/agenttune-logo-white.png +0 -0
- agenttune-1.1.0/docs/assets/extra.css +352 -0
- agenttune-1.1.0/docs/assets/extra.js +14 -0
- agenttune-1.1.0/docs/assets/lexsilogowhite.png +0 -0
- agenttune-1.1.0/docs/branding/README.md +27 -0
- agenttune-1.1.0/docs/branding/agenttune-lockup-dark.png +0 -0
- agenttune-1.1.0/docs/branding/agenttune-lockup-light.png +0 -0
- agenttune-1.1.0/docs/community/CODE_OF_CONDUCT.md +6 -0
- agenttune-1.1.0/docs/community/changelog.md +6 -0
- agenttune-1.1.0/docs/community/contributing.md +6 -0
- agenttune-1.1.0/docs/community/faq.md +56 -0
- agenttune-1.1.0/docs/community/known-issues.md +43 -0
- agenttune-1.1.0/docs/community/roadmap.md +29 -0
- agenttune-1.1.0/docs/community/security.md +6 -0
- agenttune-1.1.0/docs/concepts/decide-and-closed-loop.md +120 -0
- agenttune-1.1.0/docs/features.md +69 -0
- agenttune-1.1.0/docs/getting-started/backend-selection.md +68 -0
- agenttune-1.1.0/docs/getting-started/basic-concepts.md +68 -0
- agenttune-1.1.0/docs/getting-started/installation.md +41 -0
- agenttune-1.1.0/docs/getting-started/quickstart.md +120 -0
- agenttune-1.1.0/docs/notebooks/01_agentic_spine_core_lifecycle.ipynb +4046 -0
- agenttune-1.1.0/docs/notebooks/02_agentic_distillation_real.ipynb +1540 -0
- agenttune-1.1.0/docs/notebooks/03_self_healing_and_closed_loop.ipynb +2779 -0
- agenttune-1.1.0/docs/notebooks/04_memory_and_agent_strategies.ipynb +1109 -0
- agenttune-1.1.0/docs/notebooks/05_decide_business_rules.ipynb +1007 -0
- agenttune-1.1.0/docs/notebooks/06_api_and_cli_usage.ipynb +1152 -0
- agenttune-1.1.0/docs/notebooks/07_bfsi_industry_usecases.ipynb +463 -0
- agenttune-1.1.0/docs/notebooks/08_industry_showcase_other_domains.ipynb +1207 -0
- agenttune-1.1.0/docs/notebooks/09_rl_training_rewards_and_eval.ipynb +1689 -0
- agenttune-1.1.0/docs/notebooks/10_sandboxed_execution_openenv.ipynb +375 -0
- agenttune-1.1.0/docs/notebooks/11_docs_to_training_data_generator.ipynb +331 -0
- agenttune-1.1.0/docs/notebooks/12_multiagent_orchestration_langgraph.ipynb +291 -0
- agenttune-1.1.0/docs/notebooks/13_tool_library_showcase.ipynb +233 -0
- agenttune-1.1.0/docs/notebooks/14_reward_defenses_and_groundedness.ipynb +1077 -0
- agenttune-1.1.0/docs/notebooks/15_agentic_grpo_real.ipynb +1874 -0
- agenttune-1.1.0/docs/notebooks/16_agentic_strategy_real.ipynb +870 -0
- agenttune-1.1.0/docs/notebooks/17_bco_real.ipynb +3821 -0
- agenttune-1.1.0/docs/notebooks/18_gspo_real.ipynb +1884 -0
- agenttune-1.1.0/docs/notebooks/19_kto_real.ipynb +2707 -0
- agenttune-1.1.0/docs/notebooks/20_ppo_real.ipynb +2877 -0
- agenttune-1.1.0/docs/notebooks/21_rloo_real.ipynb +1820 -0
- agenttune-1.1.0/docs/notebooks/22_self_heal_dpo_real.ipynb +1939 -0
- agenttune-1.1.0/docs/notebooks/23_self_heal_reward_real.ipynb +819 -0
- agenttune-1.1.0/docs/notebooks/24_vector_memory_real.ipynb +622 -0
- agenttune-1.1.0/docs/notebooks/25_lm_eval_real.ipynb +481 -0
- agenttune-1.1.0/docs/notebooks/26_self_heal_llm_real.ipynb +1589 -0
- agenttune-1.1.0/docs/notebooks/27_rag_synthesis_real.ipynb +1115 -0
- agenttune-1.1.0/docs/notebooks/28_hybrid_prm_real.ipynb +174 -0
- agenttune-1.1.0/docs/notebooks/_real_backends.py +184 -0
- agenttune-1.1.0/docs/notebooks/local-notebook.md +138 -0
- agenttune-1.1.0/docs/notebooks/sample-notebook.md +19 -0
- agenttune-1.1.0/docs/reference/architecture.md +163 -0
- agenttune-1.1.0/docs/reference/cli.md +113 -0
- agenttune-1.1.0/docs/reference/closed-loop.md +62 -0
- agenttune-1.1.0/docs/reference/configuration-classes.md +387 -0
- agenttune-1.1.0/docs/reference/configuration.md +64 -0
- agenttune-1.1.0/docs/reference/core-api.md +243 -0
- agenttune-1.1.0/docs/reference/data-and-utils.md +59 -0
- agenttune-1.1.0/docs/reference/decide-engine.md +95 -0
- agenttune-1.1.0/docs/reference/memory-reference.md +207 -0
- agenttune-1.1.0/docs/reference/model-management.md +299 -0
- agenttune-1.1.0/docs/reference/rewards-reference.md +264 -0
- agenttune-1.1.0/docs/reference/rollout-engines.md +348 -0
- agenttune-1.1.0/docs/reference/sample-logging.md +325 -0
- agenttune-1.1.0/docs/reference/tools-reference.md +211 -0
- agenttune-1.1.0/docs/reference/unified-sdk.md +159 -0
- agenttune-1.1.0/docs/user-guide/agentic-spine.md +1132 -0
- agenttune-1.1.0/docs/user-guide/decide-workflows.md +620 -0
- agenttune-1.1.0/docs/user-guide/distillation.md +569 -0
- agenttune-1.1.0/docs/user-guide/evaluation.md +534 -0
- agenttune-1.1.0/docs/user-guide/multi-agent-orchestration.md +509 -0
- agenttune-1.1.0/docs/user-guide/overview.md +290 -0
- agenttune-1.1.0/docs/user-guide/rag-and-synthesis.md +635 -0
- agenttune-1.1.0/docs/user-guide/rl-training.md +946 -0
- agenttune-1.1.0/docs/user-guide/self-healing.md +534 -0
- agenttune-1.1.0/docs/user-guide/tool-library.md +602 -0
- agenttune-1.1.0/docs/user-guide/troubleshooting.md +341 -0
- agenttune-1.1.0/examples/CASE_STUDIES.md +202 -0
- agenttune-1.1.0/examples/COVERAGE.md +205 -0
- agenttune-1.1.0/examples/DECIDE_EXAMPLES.md +115 -0
- agenttune-1.1.0/examples/README.md +46 -0
- agenttune-1.1.0/examples/REAL_EXAMPLES.md +568 -0
- agenttune-1.1.0/examples/USECASES/01_agentic_spine_core_lifecycle.ipynb +972 -0
- agenttune-1.1.0/examples/USECASES/02_agentic_distillation.ipynb +2063 -0
- agenttune-1.1.0/examples/USECASES/03_selfheal_closedloop_distillation.ipynb +2536 -0
- agenttune-1.1.0/examples/USECASES/04_memory_and_agent_strategies.ipynb +1418 -0
- agenttune-1.1.0/examples/USECASES/05_rag_synthesis_pipeline.ipynb +1145 -0
- agenttune-1.1.0/examples/USECASES/06_decide_business_rules.ipynb +958 -0
- agenttune-1.1.0/examples/USECASES/07_rl_training_algorithms_zoo.ipynb +6669 -0
- agenttune-1.1.0/examples/USECASES/08_lm_eval_standardized_benchmarks.ipynb +407 -0
- agenttune-1.1.0/examples/USECASES/09_sandboxed_execution_openenv.ipynb +316 -0
- agenttune-1.1.0/examples/USECASES/10_multiagent_orchestration_langgraph.ipynb +3479 -0
- agenttune-1.1.0/examples/USECASES/11_tool_library_showcase.ipynb +764 -0
- agenttune-1.1.0/examples/USECASES/12_reward_defenses_and_groundedness.ipynb +1130 -0
- agenttune-1.1.0/examples/USECASES/13_industry_domain_agents.ipynb +696 -0
- agenttune-1.1.0/examples/USECASES/14_hybrid_prm_reward_bug.ipynb +175 -0
- agenttune-1.1.0/examples/USECASES/15_financial_rag_agent.ipynb +1685 -0
- agenttune-1.1.0/examples/USECASES/README.md +76 -0
- agenttune-1.1.0/examples/USE_CASES_decide.ipynb +1774 -0
- agenttune-1.1.0/examples/agentic_distillation.py +65 -0
- agenttune-1.1.0/examples/agentic_distillation_real.py +157 -0
- agenttune-1.1.0/examples/agentic_grpo_real.py +205 -0
- agenttune-1.1.0/examples/agentic_strategy_real.py +272 -0
- agenttune-1.1.0/examples/basic_usage.py +184 -0
- agenttune-1.1.0/examples/bco_real.py +168 -0
- agenttune-1.1.0/examples/bfsi_kyc.py +202 -0
- agenttune-1.1.0/examples/bridge_quickstart.py +429 -0
- agenttune-1.1.0/examples/build_and_train.ipynb +716 -0
- agenttune-1.1.0/examples/build_and_train.py +149 -0
- agenttune-1.1.0/examples/catalog_enrichment_distillation.py +60 -0
- agenttune-1.1.0/examples/clinical_triage_end_to_end.py +122 -0
- agenttune-1.1.0/examples/closed_loop_real.py +323 -0
- agenttune-1.1.0/examples/competitor_research.py +87 -0
- agenttune-1.1.0/examples/compliance_graph_memory.py +49 -0
- agenttune-1.1.0/examples/conformance_and_replay.py +50 -0
- agenttune-1.1.0/examples/contract_review_end_to_end.py +147 -0
- agenttune-1.1.0/examples/decide_example_iterative_async.py +56 -0
- agenttune-1.1.0/examples/decide_example_iterative_sync.py +51 -0
- agenttune-1.1.0/examples/decide_example_multi_judge_async.py +63 -0
- agenttune-1.1.0/examples/decide_example_multi_judge_sync.py +58 -0
- agenttune-1.1.0/examples/decide_example_text_classify_async.py +53 -0
- agenttune-1.1.0/examples/decide_example_text_classify_sync.py +48 -0
- agenttune-1.1.0/examples/decide_feature_llm_call.yaml +59 -0
- agenttune-1.1.0/examples/decide_feature_parallel.yaml +141 -0
- agenttune-1.1.0/examples/decide_feature_rules.yaml +80 -0
- agenttune-1.1.0/examples/demo_sample_1.ipynb +1 -0
- agenttune-1.1.0/examples/dummy_sandbox.py +19 -0
- agenttune-1.1.0/examples/end_to_end_improve.py +88 -0
- agenttune-1.1.0/examples/episode_collect_eval.py +424 -0
- agenttune-1.1.0/examples/fraud_triage_end_to_end.py +137 -0
- agenttune-1.1.0/examples/grpo_with_openenv_sandbox.py +329 -0
- agenttune-1.1.0/examples/kyc_agentic_distillation.py +64 -0
- agenttune-1.1.0/examples/langgraph_orchestrator_real.py +287 -0
- agenttune-1.1.0/examples/lifecycle_and_rewards.py +80 -0
- agenttune-1.1.0/examples/lm_eval_real.py +134 -0
- agenttune-1.1.0/examples/medical_coding_distillation.py +62 -0
- agenttune-1.1.0/examples/memory_recall.py +52 -0
- agenttune-1.1.0/examples/notebooks/agent_ops.ipynb +2441 -0
- agenttune-1.1.0/examples/notebooks/bco.ipynb +579 -0
- agenttune-1.1.0/examples/notebooks/cli.ipynb +476 -0
- agenttune-1.1.0/examples/notebooks/combine_rewards.ipynb +572 -0
- agenttune-1.1.0/examples/notebooks/custom_tool.ipynb +725 -0
- agenttune-1.1.0/examples/notebooks/decide.ipynb +431 -0
- agenttune-1.1.0/examples/notebooks/distill.ipynb +540 -0
- agenttune-1.1.0/examples/notebooks/dpo.ipynb +574 -0
- agenttune-1.1.0/examples/notebooks/fast_api.ipynb +580 -0
- agenttune-1.1.0/examples/notebooks/graph_memory.ipynb +595 -0
- agenttune-1.1.0/examples/notebooks/grpo.ipynb +552 -0
- agenttune-1.1.0/examples/notebooks/incontext_memory.ipynb +586 -0
- agenttune-1.1.0/examples/notebooks/llm_judge.ipynb +399 -0
- agenttune-1.1.0/examples/notebooks/lm_eval.ipynb +296 -0
- agenttune-1.1.0/examples/notebooks/openenv.ipynb +643 -0
- agenttune-1.1.0/examples/notebooks/plan_execute.ipynb +608 -0
- agenttune-1.1.0/examples/notebooks/ppo.ipynb +552 -0
- agenttune-1.1.0/examples/notebooks/project.ipynb +624 -0
- agenttune-1.1.0/examples/notebooks/rag_train.ipynb +477 -0
- agenttune-1.1.0/examples/notebooks/reflexion.ipynb +651 -0
- agenttune-1.1.0/examples/notebooks/rl_eval.ipynb +663 -0
- agenttune-1.1.0/examples/notebooks/rloo.ipynb +574 -0
- agenttune-1.1.0/examples/notebooks/selfheal.ipynb +716 -0
- agenttune-1.1.0/examples/notebooks/synthesis.ipynb +463 -0
- agenttune-1.1.0/examples/notebooks/tree_of_thoughts.ipynb +673 -0
- agenttune-1.1.0/examples/notebooks/vector_memory.ipynb +563 -0
- agenttune-1.1.0/examples/openenv_harness_real.py +187 -0
- agenttune-1.1.0/examples/openenv_workflow_demo.py +173 -0
- agenttune-1.1.0/examples/order_issue_triage.py +63 -0
- agenttune-1.1.0/examples/path_a_failure_replay_exgen.py +187 -0
- agenttune-1.1.0/examples/ppo_real.py +216 -0
- agenttune-1.1.0/examples/precedent_graph_memory.py +46 -0
- agenttune-1.1.0/examples/presentation_demo.py +93 -0
- agenttune-1.1.0/examples/rag_datagen_real.py +313 -0
- agenttune-1.1.0/examples/rag_training_real.py +279 -0
- agenttune-1.1.0/examples/real_evaluation_demo.py +91 -0
- agenttune-1.1.0/examples/reward_model_real.py +162 -0
- agenttune-1.1.0/examples/rloo_real.py +179 -0
- agenttune-1.1.0/examples/self_heal_dpo_real.py +171 -0
- agenttune-1.1.0/examples/self_heal_llm_real.py +254 -0
- agenttune-1.1.0/examples/self_heal_reward_real.py +250 -0
- agenttune-1.1.0/examples/self_healing.py +83 -0
- agenttune-1.1.0/examples/service_real.py +217 -0
- agenttune-1.1.0/examples/stage_wise_training_example.py +196 -0
- agenttune-1.1.0/examples/strategy_comparison.py +83 -0
- agenttune-1.1.0/examples/support_ticket_triage.py +63 -0
- agenttune-1.1.0/examples/test_hybrid_prm.py +44 -0
- agenttune-1.1.0/examples/trainer_config_openenv_example.yaml +62 -0
- agenttune-1.1.0/examples/training_pipeline.py +338 -0
- agenttune-1.1.0/examples/use_case_agentic_1_sql_agent_with_decide_validation.py +143 -0
- agenttune-1.1.0/examples/use_case_agentic_2_multi_tool_routing_with_decide.py +148 -0
- agenttune-1.1.0/examples/use_case_agentic_3_agent_training_with_decide_rewards.py +200 -0
- agenttune-1.1.0/examples/vector_memory_real.py +94 -0
- agenttune-1.1.0/links.md +25 -0
- agenttune-1.1.0/mkdocs.yml +196 -0
- agenttune-1.1.0/pyproject.toml +474 -0
- agenttune-1.1.0/requirements-docs.txt +23 -0
- agenttune-1.1.0/requirements.txt +94 -0
- agenttune-1.1.0/scripts/README.md +53 -0
- agenttune-1.1.0/scripts/__init__.py +1 -0
- agenttune-1.1.0/scripts/analyze_results.py +45 -0
- agenttune-1.1.0/scripts/check_secrets.sh +66 -0
- agenttune-1.1.0/scripts/collect_teacher_rollouts.py +109 -0
- agenttune-1.1.0/scripts/dagger_correction_loop.py +206 -0
- agenttune-1.1.0/scripts/eval_agentic_distillation.py +62 -0
- agenttune-1.1.0/scripts/fastapi_app.py +73 -0
- agenttune-1.1.0/scripts/generate_bulk_experiments.py +197 -0
- agenttune-1.1.0/scripts/monitor_judge_agreement.py +162 -0
- agenttune-1.1.0/scripts/release.py +273 -0
- agenttune-1.1.0/scripts/run_end_to_end.sh +77 -0
- agenttune-1.1.0/scripts/run_path_a.py +74 -0
- agenttune-1.1.0/scripts/train_agentic_dpo.py +117 -0
- agenttune-1.1.0/scripts/train_neural_reward_model.py +120 -0
- agenttune-1.1.0/scripts/verify.sh +68 -0
- agenttune-1.1.0/setup.cfg +4 -0
- agenttune-1.1.0/setup.py +6 -0
- agenttune-1.1.0/src/agenttune/__init__.py +62 -0
- agenttune-1.1.0/src/agenttune/agentic/README.md +217 -0
- agenttune-1.1.0/src/agenttune/agentic/__init__.py +66 -0
- agenttune-1.1.0/src/agenttune/agentic/distill_trainer.py +411 -0
- agenttune-1.1.0/src/agenttune/agentic/events/judgment_hook.py +57 -0
- agenttune-1.1.0/src/agenttune/agentic/events.py +268 -0
- agenttune-1.1.0/src/agenttune/agentic/harness.py +184 -0
- agenttune-1.1.0/src/agenttune/agentic/harness_openenv.py +127 -0
- agenttune-1.1.0/src/agenttune/agentic/heal_loop.py +192 -0
- agenttune-1.1.0/src/agenttune/agentic/inference/__init__.py +6 -0
- agenttune-1.1.0/src/agenttune/agentic/inference/api_engine.py +53 -0
- agenttune-1.1.0/src/agenttune/agentic/inference/base_engine.py +20 -0
- agenttune-1.1.0/src/agenttune/agentic/inference/transformers_engine.py +72 -0
- agenttune-1.1.0/src/agenttune/agentic/inference/vllm_engine.py +108 -0
- agenttune-1.1.0/src/agenttune/agentic/langgraph_orchestrator.py +13 -0
- agenttune-1.1.0/src/agenttune/agentic/memory.py +196 -0
- agenttune-1.1.0/src/agenttune/agentic/memory_graph.py +213 -0
- agenttune-1.1.0/src/agenttune/agentic/memory_vector.py +105 -0
- agenttune-1.1.0/src/agenttune/agentic/project.py +375 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/__init__.py +4 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/builtin_rewards/__init__.py +56 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/builtin_rewards/distilled_judge.py +84 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/builtin_rewards/finqa.py +392 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/builtin_rewards/hybrid_prm.py +142 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/builtin_rewards/sql.py +258 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/builtin_rewards/use_case.py +404 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/composite.py +107 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/judges/rule_guards.py +49 -0
- agenttune-1.1.0/src/agenttune/agentic/rewards/llm_judge.py +781 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/api_engine.py +412 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/base.py +30 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/demo_engine.py +32 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/rollout_factory.py +2618 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/tool_call_parse.py +496 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/transformers_engine.py +604 -0
- agenttune-1.1.0/src/agenttune/agentic/rollout_engines/vllm_engine.py +394 -0
- agenttune-1.1.0/src/agenttune/agentic/service/__init__.py +5 -0
- agenttune-1.1.0/src/agenttune/agentic/service/app.py +372 -0
- agenttune-1.1.0/src/agenttune/agentic/service/static/index.html +351 -0
- agenttune-1.1.0/src/agenttune/agentic/strategy.py +81 -0
- agenttune-1.1.0/src/agenttune/agentic/strategy_advanced.py +127 -0
- agenttune-1.1.0/src/agenttune/agentic/strategy_memory.py +91 -0
- agenttune-1.1.0/src/agenttune/agentic/strategy_tree.py +180 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/__init__.py +5 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/base.py +57 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/api_tools.py +62 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/code_tools.py +80 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/file_ingestion.py +478 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/file_tools.py +72 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/finqa_tool.py +547 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/github.py +62 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/openenv_tool.py +388 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/playright.py +100 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/search_tools.py +32 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/slack.py +51 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/sql.py +916 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/builtin/web_search_tool.py +48 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/executor.py +54 -0
- agenttune-1.1.0/src/agenttune/agentic/tools/registry.py +79 -0
- agenttune-1.1.0/src/agenttune/agentic/trajectory/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/agentic/trajectory/dataset.py +175 -0
- agenttune-1.1.0/src/agenttune/api.py +128 -0
- agenttune-1.1.0/src/agenttune/assets/agenttune_banner.png +0 -0
- agenttune-1.1.0/src/agenttune/assets/lexsi_logo.png +0 -0
- agenttune-1.1.0/src/agenttune/backends/__init__.py +7 -0
- agenttune-1.1.0/src/agenttune/backends/_imports.py +69 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/bco/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/bco/agentic_bco.py +1042 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/dpo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/dpo/agentic_dpo.py +731 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/grpo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/grpo/agentic_grpo.py +774 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/ppo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/ppo/agentic_ppo.py +1263 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/rloo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/trl/agentic/rloo/agentic_rloo.py +523 -0
- agenttune-1.1.0/src/agenttune/backends/trl/sft/__init__.py +12 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/__init__.py +47 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/bco/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/bco/agentic_bco.py +1179 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/dpo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/dpo/agentic_dpo.py +860 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/grpo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/grpo/agentic_grpo.py +811 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/ppo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/ppo/agentic_ppo.py +1323 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/rloo/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/agentic/rloo/agentic_rloo.py +637 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/sft/__init__.py +9 -0
- agenttune-1.1.0/src/agenttune/backends/unsloth/sft/sft.py +1333 -0
- agenttune-1.1.0/src/agenttune/cli/__init__.py +57 -0
- agenttune-1.1.0/src/agenttune/cli/unified.py +119 -0
- agenttune-1.1.0/src/agenttune/core/backend_factory.py +256 -0
- agenttune-1.1.0/src/agenttune/core/callbacks/__init__.py +7 -0
- agenttune-1.1.0/src/agenttune/core/callbacks/base.py +168 -0
- agenttune-1.1.0/src/agenttune/core/sft/__init__.py +41 -0
- agenttune-1.1.0/src/agenttune/core/sft/config.py +763 -0
- agenttune-1.1.0/src/agenttune/core/sft/config_loader.py +186 -0
- agenttune-1.1.0/src/agenttune/core/sft/evaluator.py +1037 -0
- agenttune-1.1.0/src/agenttune/core/sft/logging.py +114 -0
- agenttune-1.1.0/src/agenttune/core/sft/trainer_base.py +604 -0
- agenttune-1.1.0/src/agenttune/data/README.md +123 -0
- agenttune-1.1.0/src/agenttune/data/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/data/loaders/__init__.py +0 -0
- agenttune-1.1.0/src/agenttune/data/loaders/base.py +9 -0
- agenttune-1.1.0/src/agenttune/data/loaders/csv_loader.py +22 -0
- agenttune-1.1.0/src/agenttune/data/loaders/directory_loader.py +30 -0
- agenttune-1.1.0/src/agenttune/data/loaders/hf_loader.py +40 -0
- agenttune-1.1.0/src/agenttune/data/loaders/json_loader.py +14 -0
- agenttune-1.1.0/src/agenttune/data/loaders/parquet_loader.py +11 -0
- agenttune-1.1.0/src/agenttune/data/loaders/resolver.py +35 -0
- agenttune-1.1.0/src/agenttune/data/manager.py +217 -0
- agenttune-1.1.0/src/agenttune/data/processors.py +700 -0
- agenttune-1.1.0/src/agenttune/data/schemas.py +132 -0
- agenttune-1.1.0/src/agenttune/decide/__init__.py +48 -0
- agenttune-1.1.0/src/agenttune/decide/audit.py +330 -0
- agenttune-1.1.0/src/agenttune/decide/cli.py +331 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/__init__.py +93 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/behavioral_diversity_monitor.py +60 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/closed_loop_runner.py +306 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/contracts.py +143 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/deployment_gate.py +447 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/failure_classifier.py +86 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/failure_detector.py +130 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/full_loop.py +439 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/pipeline.py +76 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/replay_validator.py +91 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/retrain_config.py +272 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/retrain_runner.py +166 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/retraining_trigger.py +491 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/tool_isolation.py +196 -0
- agenttune-1.1.0/src/agenttune/decide/closed_loop/training_example_generator.py +224 -0
- agenttune-1.1.0/src/agenttune/decide/collect_runner.py +150 -0
- agenttune-1.1.0/src/agenttune/decide/config.example.yaml +217 -0
- agenttune-1.1.0/src/agenttune/decide/config.py +293 -0
- agenttune-1.1.0/src/agenttune/decide/destinations/__init__.py +15 -0
- agenttune-1.1.0/src/agenttune/decide/destinations/base.py +25 -0
- agenttune-1.1.0/src/agenttune/decide/destinations/file_writer.py +74 -0
- agenttune-1.1.0/src/agenttune/decide/destinations/postgres_writer.py +103 -0
- agenttune-1.1.0/src/agenttune/decide/destinations/router.py +47 -0
- agenttune-1.1.0/src/agenttune/decide/destinations/webhook_sender.py +79 -0
- agenttune-1.1.0/src/agenttune/decide/eval_runner.py +196 -0
- agenttune-1.1.0/src/agenttune/decide/graph_runner.py +554 -0
- agenttune-1.1.0/src/agenttune/decide/model_deployment.py +204 -0
- agenttune-1.1.0/src/agenttune/decide/registry.py +94 -0
- agenttune-1.1.0/src/agenttune/decide/rewards.py +187 -0
- agenttune-1.1.0/src/agenttune/decide/stage_executor.py +45 -0
- agenttune-1.1.0/src/agenttune/decide/stage_wise_runner.py +70 -0
- agenttune-1.1.0/src/agenttune/decide/stages/__init__.py +35 -0
- agenttune-1.1.0/src/agenttune/decide/stages/base.py +419 -0
- agenttune-1.1.0/src/agenttune/decide/stages/human_review.py +125 -0
- agenttune-1.1.0/src/agenttune/decide/stages/llm_call.py +220 -0
- agenttune-1.1.0/src/agenttune/decide/stages/llm_judge.py +162 -0
- agenttune-1.1.0/src/agenttune/decide/stages/output.py +155 -0
- agenttune-1.1.0/src/agenttune/decide/stages/parallel.py +118 -0
- agenttune-1.1.0/src/agenttune/decide/stages/router.py +104 -0
- agenttune-1.1.0/src/agenttune/decide/stages/rules.py +218 -0
- agenttune-1.1.0/src/agenttune/decide/stages/tool_call.py +134 -0
- agenttune-1.1.0/src/agenttune/decide/state.py +127 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/account_opening.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/card_decline.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/claims_triage.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/customer_risk_rating.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/fraud_detection.yaml +262 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/kyc_triage.yaml +343 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/loan_approval.yaml +259 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/loan_prequal.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/regulatory_filing.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/sanctions_check.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/trade_finance_review.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/bfsi/transaction_monitoring.yaml +29 -0
- agenttune-1.1.0/src/agenttune/decide/templates/custom/my_classifier.yaml +48 -0
- agenttune-1.1.0/src/agenttune/decide/templates/custom/simple_classifier.yaml +34 -0
- agenttune-1.1.0/src/agenttune/decide/templates/example/conditional_routing.yaml +48 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/anomaly_flag.yaml +36 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/document_classification.yaml +157 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/entity_extract.yaml +34 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/iterative_refinement.yaml +209 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/multi_judge_score.yaml +244 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/multi_judge_score_parallel.yaml +240 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/qa_system.yaml +36 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/sentiment_analysis.yaml +35 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/summarize.yaml +36 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/synthetic_data_gen.yaml +35 -0
- agenttune-1.1.0/src/agenttune/decide/templates/generic/text_classify.yaml +35 -0
- agenttune-1.1.0/src/agenttune/decide/trainer_config_bridge.py +625 -0
- agenttune-1.1.0/src/agenttune/decide/trainer_config_example.yaml +223 -0
- agenttune-1.1.0/src/agenttune/decide/training_bridge.py +323 -0
- agenttune-1.1.0/src/agenttune/eval/README.md +150 -0
- agenttune-1.1.0/src/agenttune/eval/README_AGENT_EVAL.md +302 -0
- agenttune-1.1.0/src/agenttune/eval/__init__.py +78 -0
- agenttune-1.1.0/src/agenttune/eval/agent_eval.py +1298 -0
- agenttune-1.1.0/src/agenttune/eval/agentic/trajectory_eval.py +573 -0
- agenttune-1.1.0/src/agenttune/eval/caching.py +44 -0
- agenttune-1.1.0/src/agenttune/eval/cli.py +263 -0
- agenttune-1.1.0/src/agenttune/eval/core.py +431 -0
- agenttune-1.1.0/src/agenttune/eval/evaluator.py +517 -0
- agenttune-1.1.0/src/agenttune/eval/lm_eval_integration.py +503 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/__init__.py +23 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/base.py +46 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/code.py +266 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/dpo.py +335 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/generic.py +56 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/math.py +140 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/rl.py +66 -0
- agenttune-1.1.0/src/agenttune/eval/metrics/text.py +137 -0
- agenttune-1.1.0/src/agenttune/eval/registry.py +64 -0
- agenttune-1.1.0/src/agenttune/eval/rl_evaluator.py +652 -0
- agenttune-1.1.0/src/agenttune/eval/runner.py +776 -0
- agenttune-1.1.0/src/agenttune/eval/safe_executor.py +525 -0
- agenttune-1.1.0/src/agenttune/langgraph/__init__.py +1 -0
- agenttune-1.1.0/src/agenttune/langgraph/langgraph.py +628 -0
- agenttune-1.1.0/src/agenttune/py.typed +0 -0
- agenttune-1.1.0/src/agenttune/rag/README.md +550 -0
- agenttune-1.1.0/src/agenttune/rag/__init__.py +15 -0
- agenttune-1.1.0/src/agenttune/rag/data/__init__.py +15 -0
- agenttune-1.1.0/src/agenttune/rag/data/cuad.py +343 -0
- agenttune-1.1.0/src/agenttune/rag/data/finder.py +362 -0
- agenttune-1.1.0/src/agenttune/rag/data/hotpotqa.py +248 -0
- agenttune-1.1.0/src/agenttune/rag/datagen.py +196 -0
- agenttune-1.1.0/src/agenttune/rag/memory/__init__.py +42 -0
- agenttune-1.1.0/src/agenttune/rag/memory/m1_rewrite.py +307 -0
- agenttune-1.1.0/src/agenttune/rag/memory/m2_decisions.py +221 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/__init__.py +19 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/base.py +44 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/chroma_backend.py +77 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/chunker.py +49 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/corpus_loader.py +77 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/document_loaders.py +333 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/hybrid_backend.py +96 -0
- agenttune-1.1.0/src/agenttune/rag/retrieval/sqlite_fts.py +137 -0
- agenttune-1.1.0/src/agenttune/rag/rewards/__init__.py +47 -0
- agenttune-1.1.0/src/agenttune/rag/rewards/finder_rewards.py +408 -0
- agenttune-1.1.0/src/agenttune/rag/rewards/judge_eval.py +44 -0
- agenttune-1.1.0/src/agenttune/rag/rewards/phase1_rewards.py +186 -0
- agenttune-1.1.0/src/agenttune/rag/rewards/qa_metrics.py +116 -0
- agenttune-1.1.0/src/agenttune/rag/rewards/t3_rewards.py +550 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/__init__.py +1 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/analyze_run.py +197 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/build_cuad_dataset.py +369 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/build_index.py +72 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/build_index_finder.py +177 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/build_index_from_docs.py +115 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/build_index_mixed.py +294 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/eval_generated_dataset.py +184 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/eval_m1_zeroshot.py +378 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/evaluate.py +189 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/fetch_cuad_official.py +145 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/make_e1_graphs.py +274 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/run_controlled_eval.py +173 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/run_t1_t4_probe.py +93 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/train_grpo.py +1603 -0
- agenttune-1.1.0/src/agenttune/rag/scripts/verify_masking.py +156 -0
- agenttune-1.1.0/src/agenttune/rag/storage/__init__.py +19 -0
- agenttune-1.1.0/src/agenttune/rag/storage/trajectory_store.py +448 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/.gitignore +6 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/README.md +297 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/__init__.py +73 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/append_dataset.py +291 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/build_dataset.py +583 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/checkpoint.py +178 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/curriculum.py +240 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/difficulty.py +114 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/embeddings.py +260 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/evaluate.py +306 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/generate.py +302 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/graph.py +483 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/io_utils.py +95 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/llm_client.py +372 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/paths.py +255 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/requires_search_filter.py +96 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/schema.py +173 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/solve_difficulty.py +209 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/split.py +292 -0
- agenttune-1.1.0/src/agenttune/rag/synthesis/verify.py +568 -0
- agenttune-1.1.0/src/agenttune/rag/tools/__init__.py +12 -0
- agenttune-1.1.0/src/agenttune/rag/tools/read_document.py +60 -0
- agenttune-1.1.0/src/agenttune/rag/tools/search_corpus.py +55 -0
- agenttune-1.1.0/src/agenttune/rag/tools/xml_tool_parser.py +36 -0
- agenttune-1.1.0/src/agenttune/rag/trainer.py +210 -0
- agenttune-1.1.0/src/agenttune/rag/trajectory_utils.py +60 -0
- agenttune-1.1.0/src/agenttune/scenarios/__init__.py +54 -0
- agenttune-1.1.0/src/agenttune/scenarios/collection.py +139 -0
- agenttune-1.1.0/src/agenttune/scenarios/generator.py +585 -0
- agenttune-1.1.0/src/agenttune/scenarios/normalizer.py +273 -0
- agenttune-1.1.0/src/agenttune/scripts/__init__.py +3 -0
- agenttune-1.1.0/src/agenttune/utils/__init__.py +138 -0
- agenttune-1.1.0/src/agenttune/utils/auth.py +243 -0
- agenttune-1.1.0/src/agenttune/utils/checkpointing.py +424 -0
- agenttune-1.1.0/src/agenttune/utils/colored_logging.py +268 -0
- agenttune-1.1.0/src/agenttune/utils/config_extractor.py +336 -0
- agenttune-1.1.0/src/agenttune/utils/config_utils.py +514 -0
- agenttune-1.1.0/src/agenttune/utils/device.py +423 -0
- agenttune-1.1.0/src/agenttune/utils/diagnostics.py +462 -0
- agenttune-1.1.0/src/agenttune/utils/environment.py +357 -0
- agenttune-1.1.0/src/agenttune/utils/errors.py +482 -0
- agenttune-1.1.0/src/agenttune/utils/hf_publish.py +789 -0
- agenttune-1.1.0/src/agenttune/utils/inference_utils.py +39 -0
- agenttune-1.1.0/src/agenttune/utils/logging.py +299 -0
- agenttune-1.1.0/src/agenttune/utils/model_class_resolver.py +42 -0
- agenttune-1.1.0/src/agenttune/utils/model_loader.py +561 -0
- agenttune-1.1.0/src/agenttune/utils/optional.py +48 -0
- agenttune-1.1.0/src/agenttune/utils/provenance.py +64 -0
- agenttune-1.1.0/src/agenttune/utils/score_logger.py +104 -0
- agenttune-1.1.0/src/agenttune/utils/validation.py +551 -0
- agenttune-1.1.0/src/agenttune.egg-info/PKG-INFO +636 -0
- agenttune-1.1.0/src/agenttune.egg-info/SOURCES.txt +682 -0
- agenttune-1.1.0/src/agenttune.egg-info/dependency_links.txt +1 -0
- agenttune-1.1.0/src/agenttune.egg-info/entry_points.txt +2 -0
- agenttune-1.1.0/src/agenttune.egg-info/requires.txt +84 -0
- agenttune-1.1.0/src/agenttune.egg-info/scm_file_list.json +678 -0
- agenttune-1.1.0/src/agenttune.egg-info/scm_version.json +8 -0
- agenttune-1.1.0/src/agenttune.egg-info/top_level.txt +1 -0
- agenttune-1.1.0/tests/_real_backends.py +201 -0
- agenttune-1.1.0/tests/conftest.py +172 -0
- agenttune-1.1.0/tests/deployment_gate_audit.jsonl +13 -0
- agenttune-1.1.0/tests/drift_audit.jsonl +30 -0
- agenttune-1.1.0/tests/e2e_test_suite.py +1033 -0
- agenttune-1.1.0/tests/fixtures/chat_templates/aya_expanse.jinja +1 -0
- agenttune-1.1.0/tests/fixtures/chat_templates/command_r7b_tool_use.jinja +156 -0
- agenttune-1.1.0/tests/fixtures/chat_templates/tiny_aya_default.jinja +20 -0
- agenttune-1.1.0/tests/rag/test_checkpoint.py +201 -0
- agenttune-1.1.0/tests/rag/test_cuad.py +552 -0
- agenttune-1.1.0/tests/test_api.py +100 -0
- agenttune-1.1.0/tests/test_api_real.py +130 -0
- agenttune-1.1.0/tests/test_audit.py +139 -0
- agenttune-1.1.0/tests/test_audit_extended.py +228 -0
- agenttune-1.1.0/tests/test_auditkit_interop.py +130 -0
- agenttune-1.1.0/tests/test_bco.py +119 -0
- agenttune-1.1.0/tests/test_bridges_integration.py +423 -0
- agenttune-1.1.0/tests/test_cli.py +297 -0
- agenttune-1.1.0/tests/test_cli_unified.py +89 -0
- agenttune-1.1.0/tests/test_cli_unified_real.py +109 -0
- agenttune-1.1.0/tests/test_closed_loop_e2e_qwen.py +485 -0
- agenttune-1.1.0/tests/test_cohere_tool_calls.py +429 -0
- agenttune-1.1.0/tests/test_config.py +256 -0
- agenttune-1.1.0/tests/test_config_loader.py +75 -0
- agenttune-1.1.0/tests/test_curriculum_m2.py +251 -0
- agenttune-1.1.0/tests/test_datagen.py +90 -0
- agenttune-1.1.0/tests/test_datagen_real.py +98 -0
- agenttune-1.1.0/tests/test_decide_agenttune_bridge.py +823 -0
- agenttune-1.1.0/tests/test_deployment_gate.py +147 -0
- agenttune-1.1.0/tests/test_destinations.py +284 -0
- agenttune-1.1.0/tests/test_distill.py +119 -0
- agenttune-1.1.0/tests/test_distill_real.py +108 -0
- agenttune-1.1.0/tests/test_dpo.py +62 -0
- agenttune-1.1.0/tests/test_e2e_path_b.py +497 -0
- agenttune-1.1.0/tests/test_end_to_end_real.py +378 -0
- agenttune-1.1.0/tests/test_error_handling.py +314 -0
- agenttune-1.1.0/tests/test_eval_wiring.py +127 -0
- agenttune-1.1.0/tests/test_events.py +386 -0
- agenttune-1.1.0/tests/test_executor.py +178 -0
- agenttune-1.1.0/tests/test_failure_classifier.py +69 -0
- agenttune-1.1.0/tests/test_finder_rewards.py +236 -0
- agenttune-1.1.0/tests/test_graph_runner.py +291 -0
- agenttune-1.1.0/tests/test_grpo.py +224 -0
- agenttune-1.1.0/tests/test_harness.py +124 -0
- agenttune-1.1.0/tests/test_harness_openenv.py +267 -0
- agenttune-1.1.0/tests/test_heal.py +82 -0
- agenttune-1.1.0/tests/test_heal_loop.py +434 -0
- agenttune-1.1.0/tests/test_heal_loop_real.py +337 -0
- agenttune-1.1.0/tests/test_hotpotqa_loader.py +53 -0
- agenttune-1.1.0/tests/test_import_hygiene.py +34 -0
- agenttune-1.1.0/tests/test_integration_basic.py +378 -0
- agenttune-1.1.0/tests/test_integration_path_a_to_b.py +184 -0
- agenttune-1.1.0/tests/test_m1_rewrite.py +177 -0
- agenttune-1.1.0/tests/test_masking_verification.py +84 -0
- agenttune-1.1.0/tests/test_memory.py +126 -0
- agenttune-1.1.0/tests/test_memory_graph.py +212 -0
- agenttune-1.1.0/tests/test_memory_vector.py +116 -0
- agenttune-1.1.0/tests/test_memory_vector_real.py +121 -0
- agenttune-1.1.0/tests/test_model_class_resolver.py +52 -0
- agenttune-1.1.0/tests/test_multi_model_tool_calls.py +483 -0
- agenttune-1.1.0/tests/test_openenv_tool.py +530 -0
- agenttune-1.1.0/tests/test_pass_at_k.py +56 -0
- agenttune-1.1.0/tests/test_pass_at_k_real.py +44 -0
- agenttune-1.1.0/tests/test_performance.py +203 -0
- agenttune-1.1.0/tests/test_phase2.py +949 -0
- agenttune-1.1.0/tests/test_ppo.py +61 -0
- agenttune-1.1.0/tests/test_project.py +79 -0
- agenttune-1.1.0/tests/test_python_api_usecases.py +296 -0
- agenttune-1.1.0/tests/test_release.py +157 -0
- agenttune-1.1.0/tests/test_retrain_week2.py +295 -0
- agenttune-1.1.0/tests/test_retraining_trigger.py +300 -0
- agenttune-1.1.0/tests/test_retrieval_backends.py +123 -0
- agenttune-1.1.0/tests/test_reward_wrapping.py +47 -0
- agenttune-1.1.0/tests/test_rewards.py +176 -0
- agenttune-1.1.0/tests/test_rloo.py +77 -0
- agenttune-1.1.0/tests/test_rollout_harness.py +108 -0
- agenttune-1.1.0/tests/test_rollout_harness_real.py +96 -0
- agenttune-1.1.0/tests/test_rules.py +86 -0
- agenttune-1.1.0/tests/test_run_tools_parallel.py +35 -0
- agenttune-1.1.0/tests/test_score_logger.py +587 -0
- agenttune-1.1.0/tests/test_service.py +136 -0
- agenttune-1.1.0/tests/test_service_real.py +148 -0
- agenttune-1.1.0/tests/test_spine_e2e.py +66 -0
- agenttune-1.1.0/tests/test_spine_e2e_real.py +57 -0
- agenttune-1.1.0/tests/test_stage_llm_call.py +50 -0
- agenttune-1.1.0/tests/test_stage_llm_judge.py +68 -0
- agenttune-1.1.0/tests/test_stage_output.py +55 -0
- agenttune-1.1.0/tests/test_stage_parallel.py +63 -0
- agenttune-1.1.0/tests/test_stage_router.py +97 -0
- agenttune-1.1.0/tests/test_stage_rules.py +58 -0
- agenttune-1.1.0/tests/test_stage_tool_call.py +45 -0
- agenttune-1.1.0/tests/test_stages.py +344 -0
- agenttune-1.1.0/tests/test_stages_advanced.py +576 -0
- agenttune-1.1.0/tests/test_state.py +413 -0
- agenttune-1.1.0/tests/test_strategy.py +77 -0
- agenttune-1.1.0/tests/test_strategy_advanced.py +131 -0
- agenttune-1.1.0/tests/test_strategy_memory.py +107 -0
- agenttune-1.1.0/tests/test_strategy_tree.py +281 -0
- agenttune-1.1.0/tests/test_synthesis.py +696 -0
- agenttune-1.1.0/tests/test_t1_t4_difficulty.py +222 -0
- agenttune-1.1.0/tests/test_t3_rewards.py +423 -0
- agenttune-1.1.0/tests/test_template_validation.py +264 -0
- agenttune-1.1.0/tests/test_templates.py +203 -0
- agenttune-1.1.0/tests/test_tool_call_parse.py +237 -0
- agenttune-1.1.0/tests/test_tools.py +57 -0
- agenttune-1.1.0/tests/test_train_wiring.py +105 -0
- agenttune-1.1.0/tests/test_train_wiring_real.py +117 -0
- agenttune-1.1.0/tests/test_training_example_generator.py +134 -0
- agenttune-1.1.0/tests/test_training_example_generator_real.py +152 -0
- agenttune-1.1.0/tests/test_trajectory_eval.py +37 -0
- agenttune-1.1.0/tests/test_trajectory_store.py +310 -0
- agenttune-1.1.0/tests/test_w3_path_b.py +368 -0
- agenttune-1.1.0/tests/test_w4_full_loop.py +444 -0
- agenttune-1.1.0/tests/test_xml_tool_parser.py +88 -0
- agenttune-1.1.0/tests/trajectory_audit.jsonl +8 -0
- agenttune-1.1.0/tests/unsloth/conftest.py +39 -0
- agenttune-1.1.0/tests/unsloth/test_bco_unsloth.py +100 -0
- agenttune-1.1.0/tests/unsloth/test_dpo_unsloth.py +68 -0
- agenttune-1.1.0/tests/unsloth/test_grpo_unsloth.py +112 -0
- agenttune-1.1.0/tests/unsloth/test_ppo_unsloth.py +70 -0
- agenttune-1.1.0/tests/unsloth/test_rloo_unsloth.py +95 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a problem with AgentTune
|
|
4
|
+
title: "[Bug] "
|
|
5
|
+
labels: bug
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Describe the bug**
|
|
9
|
+
A clear, concise description of what went wrong.
|
|
10
|
+
|
|
11
|
+
**Complete error message / stack trace**
|
|
12
|
+
```
|
|
13
|
+
paste the full traceback here
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Minimal reproducible example**
|
|
17
|
+
```python
|
|
18
|
+
# the smallest snippet that reproduces the issue
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Expected behavior**
|
|
22
|
+
What you expected to happen instead.
|
|
23
|
+
|
|
24
|
+
**Environment**
|
|
25
|
+
- OS and version:
|
|
26
|
+
- Python version:
|
|
27
|
+
- AgentTune version (`agenttune version` or `pip show agenttune`):
|
|
28
|
+
- Backend / extras installed (`rag`, `service`, `dev`, etc.):
|
|
29
|
+
- GPU / CUDA version (if relevant):
|
|
30
|
+
|
|
31
|
+
**Additional context**
|
|
32
|
+
Anything else that might help (config files, logs, related issues).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Security vulnerability
|
|
4
|
+
url: https://github.com/Lexsi-Labs/AgentTune/security/policy
|
|
5
|
+
about: Please report security vulnerabilities privately per SECURITY.md — do not open a public issue.
|
|
6
|
+
- name: Questions & discussion
|
|
7
|
+
url: https://github.com/Lexsi-Labs/AgentTune/discussions
|
|
8
|
+
about: Ask usage questions or start a discussion here instead of opening an issue.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea or improvement for AgentTune
|
|
4
|
+
title: "[Feature] "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**What feature would you like?**
|
|
9
|
+
A clear, concise description of the feature.
|
|
10
|
+
|
|
11
|
+
**What problem does it solve?**
|
|
12
|
+
Why is this needed? What are you unable to do today?
|
|
13
|
+
|
|
14
|
+
**How would it be used?**
|
|
15
|
+
A sketch of the API/CLI/config you'd expect, if applicable.
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
# example usage, if applicable
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Alternatives considered**
|
|
22
|
+
Any workarounds you're using now, or other approaches you considered.
|
|
23
|
+
|
|
24
|
+
**Additional context**
|
|
25
|
+
Anything else that might help (links, references, related issues).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## What does this PR do?
|
|
2
|
+
|
|
3
|
+
<!-- Clear, concise description of the change and its motivation. -->
|
|
4
|
+
|
|
5
|
+
## Related issues
|
|
6
|
+
|
|
7
|
+
<!-- e.g. Fixes #123 -->
|
|
8
|
+
|
|
9
|
+
## Changes made
|
|
10
|
+
|
|
11
|
+
<!-- List the key changes. -->
|
|
12
|
+
|
|
13
|
+
## How was this tested?
|
|
14
|
+
|
|
15
|
+
<!-- What you ran, and the result. -->
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
- [ ] Tests pass locally (`pytest tests/`)
|
|
20
|
+
- [ ] Code formatted (`black src/agenttune tests/`)
|
|
21
|
+
- [ ] Lint clean (`ruff check src/agenttune tests/`)
|
|
22
|
+
- [ ] Added tests for new functionality
|
|
23
|
+
- [ ] Updated relevant documentation (`README.md` / `docs/`)
|
|
24
|
+
- [ ] Added docstrings to new public functions/classes
|
|
25
|
+
- [ ] No merge conflicts with `main`
|
|
26
|
+
|
|
27
|
+
## Screenshots (if UI-related)
|
|
28
|
+
|
|
29
|
+
<!-- Delete this section if not applicable. -->
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch: {}
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ci-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
# Advisory by design: ruff/black run here for signal, but style nits never block
|
|
20
|
+
# a merge. Contributors get the same checks locally via `.pre-commit-config.yaml`
|
|
21
|
+
# (`pip install -e '.[dev]' && pre-commit install`); the `test` job below is the
|
|
22
|
+
# real gate.
|
|
23
|
+
continue-on-error: true
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
# Versions pinned to match .pre-commit-config.yaml.
|
|
32
|
+
- name: Install linters
|
|
33
|
+
run: pip install "ruff==0.4.10" "black==24.4.2"
|
|
34
|
+
|
|
35
|
+
- name: ruff
|
|
36
|
+
run: ruff check .
|
|
37
|
+
|
|
38
|
+
- name: black
|
|
39
|
+
run: black --check .
|
|
40
|
+
|
|
41
|
+
test:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
timeout-minutes: 60
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
# `pip install -e '.[dev]'` below pulls in torch, vllm, and the CUDA
|
|
48
|
+
# wheel stack (~15GB+), which doesn't fit alongside the runner's
|
|
49
|
+
# preinstalled toolchains (dotnet, Android SDK, GHC, Docker images
|
|
50
|
+
# aren't needed here). Frees ~25-30GB.
|
|
51
|
+
# ponytail: fixed disk budget, move to a larger runner if the install grows further.
|
|
52
|
+
- name: Free disk space
|
|
53
|
+
run: |
|
|
54
|
+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
|
|
55
|
+
sudo docker image prune --all --force
|
|
56
|
+
df -h /
|
|
57
|
+
|
|
58
|
+
- uses: actions/setup-python@v5
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.12"
|
|
61
|
+
cache: pip
|
|
62
|
+
|
|
63
|
+
- name: Install package
|
|
64
|
+
run: |
|
|
65
|
+
python -m pip install --upgrade pip
|
|
66
|
+
pip install -e '.[dev]'
|
|
67
|
+
|
|
68
|
+
- name: Import smoke test
|
|
69
|
+
run: |
|
|
70
|
+
python -c "import agenttune; print(agenttune.__version__)"
|
|
71
|
+
python -c "import agenttune.agentic, agenttune.decide, agenttune.eval, agenttune.rag"
|
|
72
|
+
|
|
73
|
+
# The agentic spine and DECIDE are pure-Python and need no model, GPU, or
|
|
74
|
+
# network. Skip the marked slow / GPU / sandbox / model-download suites.
|
|
75
|
+
# -v and --timeout: this suite has died mid-run with only "The operation
|
|
76
|
+
# was canceled" (runner killed ~90s into a silent stretch near the 17%
|
|
77
|
+
# mark, no traceback). Per-test names plus a hard per-test timeout turn
|
|
78
|
+
# that into an attributable failure instead of a dead runner.
|
|
79
|
+
- name: Run fast tests
|
|
80
|
+
env:
|
|
81
|
+
PURE_TRL_MODE: "1"
|
|
82
|
+
run: |
|
|
83
|
+
free -h; df -h /
|
|
84
|
+
pytest -v --tb=short -o addopts="" \
|
|
85
|
+
--timeout=300 \
|
|
86
|
+
-m "not slow and not gpu and not wandb and not openenv and not qwen_e2e" \
|
|
87
|
+
-p no:cacheprovider
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- docs/**
|
|
9
|
+
- mkdocs.yml
|
|
10
|
+
- requirements-docs.txt
|
|
11
|
+
- .github/workflows/docs.yml
|
|
12
|
+
workflow_dispatch: {}
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
pages: write
|
|
17
|
+
id-token: write
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: pages
|
|
21
|
+
cancel-in-progress: false
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
build:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.12"
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: pip install -r requirements-docs.txt
|
|
35
|
+
|
|
36
|
+
- name: Build docs
|
|
37
|
+
run: mkdocs build --strict
|
|
38
|
+
|
|
39
|
+
- uses: actions/configure-pages@v5
|
|
40
|
+
|
|
41
|
+
- uses: actions/upload-pages-artifact@v3
|
|
42
|
+
with:
|
|
43
|
+
path: site
|
|
44
|
+
|
|
45
|
+
deploy:
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: github-pages
|
|
50
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
51
|
+
steps:
|
|
52
|
+
- id: deployment
|
|
53
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
name: Automated patch release
|
|
2
|
+
|
|
3
|
+
# One pipeline: plan the version, build at the tag, tag, GitHub release, PyPI,
|
|
4
|
+
# Slack. Replaces the old release.yml (push to main) + publish.yml (on release)
|
|
5
|
+
# pair. The version comes from setuptools_scm, so nothing is committed back to
|
|
6
|
+
# main: the release commit is tagged first and the build reads the tag.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
pull_request_target:
|
|
10
|
+
branches: [main]
|
|
11
|
+
types: [closed]
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
inputs:
|
|
14
|
+
version:
|
|
15
|
+
description: >-
|
|
16
|
+
Exact MAJOR.MINOR.PATCH to release or resume. Leave empty for the next
|
|
17
|
+
patch after the latest GitHub release.
|
|
18
|
+
required: false
|
|
19
|
+
default: ""
|
|
20
|
+
|
|
21
|
+
concurrency:
|
|
22
|
+
group: agenttune-patch-release
|
|
23
|
+
cancel-in-progress: false
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
env:
|
|
29
|
+
PYPI_PROJECT_NAME: agenttune
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
plan:
|
|
33
|
+
name: Inspect release state
|
|
34
|
+
# Only the public repo releases; AgentTune_mirror and forks skip every job.
|
|
35
|
+
# A PR closed without merging, or a dispatch from a branch other than main,
|
|
36
|
+
# does nothing.
|
|
37
|
+
if: >-
|
|
38
|
+
github.repository == 'Lexsi-Labs/AgentTune' &&
|
|
39
|
+
((github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') ||
|
|
40
|
+
(github.event_name == 'pull_request_target' && github.event.pull_request.merged == true))
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
outputs:
|
|
43
|
+
action: ${{ steps.plan.outputs.action }}
|
|
44
|
+
version: ${{ steps.plan.outputs.version }}
|
|
45
|
+
state: ${{ steps.plan.outputs.state }}
|
|
46
|
+
reason: ${{ steps.plan.outputs.reason }}
|
|
47
|
+
source-ref: ${{ steps.plan.outputs.source-ref }}
|
|
48
|
+
tag-exists: ${{ steps.plan.outputs.tag-exists }}
|
|
49
|
+
release-exists: ${{ steps.plan.outputs.release-exists }}
|
|
50
|
+
pypi-exists: ${{ steps.plan.outputs.pypi-exists }}
|
|
51
|
+
steps:
|
|
52
|
+
- name: Check out the trusted merged source
|
|
53
|
+
uses: actions/checkout@v6
|
|
54
|
+
with:
|
|
55
|
+
ref: ${{ github.event.pull_request.merge_commit_sha || github.ref }}
|
|
56
|
+
fetch-depth: 0
|
|
57
|
+
fetch-tags: true
|
|
58
|
+
persist-credentials: false
|
|
59
|
+
|
|
60
|
+
- uses: actions/setup-python@v6
|
|
61
|
+
with:
|
|
62
|
+
python-version: "3.12"
|
|
63
|
+
|
|
64
|
+
- name: Classify trigger and external release state
|
|
65
|
+
id: plan
|
|
66
|
+
env:
|
|
67
|
+
GH_TOKEN: ${{ github.token }}
|
|
68
|
+
EVENT_NAME: ${{ github.event_name }}
|
|
69
|
+
INPUT_VERSION: ${{ inputs.version }}
|
|
70
|
+
shell: bash
|
|
71
|
+
run: |
|
|
72
|
+
set -euo pipefail
|
|
73
|
+
source_sha=$(git rev-parse HEAD)
|
|
74
|
+
trigger=normal
|
|
75
|
+
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
|
|
76
|
+
trigger=dispatch
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
explicit=false
|
|
80
|
+
if [[ -n "${INPUT_VERSION:-}" ]]; then
|
|
81
|
+
explicit=true
|
|
82
|
+
requested_version=$(python scripts/release.py validate-version "$INPUT_VERSION")
|
|
83
|
+
else
|
|
84
|
+
latest_response=$(mktemp)
|
|
85
|
+
latest_status=$(curl --silent --show-error --location \
|
|
86
|
+
--header "Authorization: Bearer $GH_TOKEN" \
|
|
87
|
+
--header "Accept: application/vnd.github+json" \
|
|
88
|
+
--output "$latest_response" --write-out '%{http_code}' \
|
|
89
|
+
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest")
|
|
90
|
+
if [[ "$latest_status" == "200" ]]; then
|
|
91
|
+
latest_version=$(python -c \
|
|
92
|
+
'import json,sys; print(json.load(open(sys.argv[1]))["tag_name"])' \
|
|
93
|
+
"$latest_response")
|
|
94
|
+
requested_version=$(python scripts/release.py next-version "$latest_version")
|
|
95
|
+
# This commit is already the latest release (re-run, or a dispatch
|
|
96
|
+
# with nothing merged since): re-check that version instead of
|
|
97
|
+
# cutting a new patch, so the plan resolves to resume or no-op.
|
|
98
|
+
if git show-ref --verify --quiet "refs/tags/$latest_version" &&
|
|
99
|
+
[[ "$(git rev-list -n 1 "refs/tags/$latest_version")" == "$source_sha" ]]; then
|
|
100
|
+
requested_version=$latest_version
|
|
101
|
+
fi
|
|
102
|
+
elif [[ "$latest_status" == "404" ]]; then
|
|
103
|
+
# No GitHub release yet: the first release is the setuptools_scm fallback_version.
|
|
104
|
+
requested_version=$(python scripts/release.py bootstrap-version)
|
|
105
|
+
else
|
|
106
|
+
echo "::error::Latest GitHub release lookup failed with HTTP $latest_status."
|
|
107
|
+
exit 1
|
|
108
|
+
fi
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
tag_exists=false
|
|
112
|
+
tag_annotated=true
|
|
113
|
+
tag_matches_source=true
|
|
114
|
+
source_ref=$source_sha
|
|
115
|
+
if git show-ref --verify --quiet "refs/tags/$requested_version"; then
|
|
116
|
+
tag_exists=true
|
|
117
|
+
# Build from the existing tag: setuptools_scm reads the version from it.
|
|
118
|
+
source_ref="refs/tags/$requested_version"
|
|
119
|
+
if [[ "$(git cat-file -t "refs/tags/$requested_version")" != "tag" ]]; then
|
|
120
|
+
tag_annotated=false
|
|
121
|
+
fi
|
|
122
|
+
# An automatic run only resumes a tag on its own commit. A dispatch
|
|
123
|
+
# naming the version explicitly is the manual way to resume a tag
|
|
124
|
+
# left behind by an earlier, partly failed run.
|
|
125
|
+
if [[ "$explicit" == "false" &&
|
|
126
|
+
"$(git rev-list -n 1 "refs/tags/$requested_version")" != "$source_sha" ]]; then
|
|
127
|
+
tag_matches_source=false
|
|
128
|
+
fi
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
release_response=$(mktemp)
|
|
132
|
+
release_status=$(curl --silent --show-error --location \
|
|
133
|
+
--header "Authorization: Bearer $GH_TOKEN" \
|
|
134
|
+
--header "Accept: application/vnd.github+json" \
|
|
135
|
+
--output "$release_response" --write-out '%{http_code}' \
|
|
136
|
+
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$requested_version")
|
|
137
|
+
release_exists=false
|
|
138
|
+
release_matches_tag=true
|
|
139
|
+
if [[ "$release_status" == "200" ]]; then
|
|
140
|
+
release_exists=true
|
|
141
|
+
if ! python - "$release_response" "$requested_version" <<'PY'
|
|
142
|
+
import json
|
|
143
|
+
import sys
|
|
144
|
+
|
|
145
|
+
release = json.load(open(sys.argv[1], encoding="utf-8"))
|
|
146
|
+
expected = sys.argv[2]
|
|
147
|
+
valid = (
|
|
148
|
+
release.get("tag_name") == expected
|
|
149
|
+
and release.get("name") == expected
|
|
150
|
+
and isinstance(release.get("draft"), bool)
|
|
151
|
+
and release.get("prerelease") is False
|
|
152
|
+
)
|
|
153
|
+
raise SystemExit(0 if valid else 1)
|
|
154
|
+
PY
|
|
155
|
+
then
|
|
156
|
+
release_matches_tag=false
|
|
157
|
+
fi
|
|
158
|
+
elif [[ "$release_status" != "404" ]]; then
|
|
159
|
+
echo "::error::GitHub release lookup failed with HTTP $release_status."
|
|
160
|
+
exit 1
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
pypi_response=$(mktemp)
|
|
164
|
+
pypi_status=$(curl --silent --show-error --location \
|
|
165
|
+
--output "$pypi_response" --write-out '%{http_code}' \
|
|
166
|
+
"https://pypi.org/pypi/$PYPI_PROJECT_NAME/$requested_version/json")
|
|
167
|
+
pypi_exists=false
|
|
168
|
+
if [[ "$pypi_status" == "200" ]]; then
|
|
169
|
+
pypi_exists=true
|
|
170
|
+
python - "$pypi_response" "$requested_version" <<'PY'
|
|
171
|
+
import json
|
|
172
|
+
import sys
|
|
173
|
+
|
|
174
|
+
payload = json.load(open(sys.argv[1], encoding="utf-8"))
|
|
175
|
+
if payload.get("info", {}).get("version") != sys.argv[2]:
|
|
176
|
+
raise SystemExit("PyPI returned metadata for an unexpected version")
|
|
177
|
+
PY
|
|
178
|
+
elif [[ "$pypi_status" != "404" ]]; then
|
|
179
|
+
echo "::error::PyPI lookup failed with HTTP $pypi_status."
|
|
180
|
+
exit 1
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
decision=$(python scripts/release.py plan \
|
|
184
|
+
--trigger "$trigger" --version "$requested_version" \
|
|
185
|
+
--tag "$tag_exists" --release "$release_exists" --pypi "$pypi_exists" \
|
|
186
|
+
--tag-annotated "$tag_annotated" \
|
|
187
|
+
--tag-matches-source "$tag_matches_source" \
|
|
188
|
+
--release-matches-tag "$release_matches_tag")
|
|
189
|
+
|
|
190
|
+
action=$(python -c 'import json,sys; print(json.loads(sys.argv[1])["action"])' "$decision")
|
|
191
|
+
version=$(python -c 'import json,sys; print(json.loads(sys.argv[1])["version"])' "$decision")
|
|
192
|
+
state=$(python -c 'import json,sys; print(json.loads(sys.argv[1])["state"])' "$decision")
|
|
193
|
+
reason=$(python -c 'import json,sys; print(json.loads(sys.argv[1])["reason"])' "$decision")
|
|
194
|
+
{
|
|
195
|
+
echo "action=$action"
|
|
196
|
+
echo "version=$version"
|
|
197
|
+
echo "state=$state"
|
|
198
|
+
echo "reason=$reason"
|
|
199
|
+
echo "source-ref=$source_ref"
|
|
200
|
+
echo "tag-exists=$tag_exists"
|
|
201
|
+
echo "release-exists=$release_exists"
|
|
202
|
+
echo "pypi-exists=$pypi_exists"
|
|
203
|
+
} >> "$GITHUB_OUTPUT"
|
|
204
|
+
echo "Release decision: action=$action version=$version state=$state reason=$reason source=$source_ref"
|
|
205
|
+
|
|
206
|
+
release:
|
|
207
|
+
name: Build, release, and publish
|
|
208
|
+
needs: plan
|
|
209
|
+
if: github.repository == 'Lexsi-Labs/AgentTune' && needs.plan.outputs.action == 'release'
|
|
210
|
+
runs-on: ubuntu-latest
|
|
211
|
+
# GITHUB_TOKEN is enough: tag, GitHub release and PyPI upload all happen in
|
|
212
|
+
# this job, so nothing has to trigger a second workflow (the reason the old
|
|
213
|
+
# pipeline needed PERSONAL_ACCESS_TOKEN).
|
|
214
|
+
permissions:
|
|
215
|
+
contents: write
|
|
216
|
+
env:
|
|
217
|
+
RELEASE_TAG: ${{ needs.plan.outputs.version }}
|
|
218
|
+
steps:
|
|
219
|
+
- name: Check out exact release source
|
|
220
|
+
uses: actions/checkout@v6
|
|
221
|
+
with:
|
|
222
|
+
ref: ${{ needs.plan.outputs.source-ref }}
|
|
223
|
+
fetch-depth: 0
|
|
224
|
+
fetch-tags: true
|
|
225
|
+
|
|
226
|
+
- uses: actions/setup-python@v6
|
|
227
|
+
with:
|
|
228
|
+
python-version: "3.12"
|
|
229
|
+
|
|
230
|
+
- name: Create or verify the annotated tag (local)
|
|
231
|
+
shell: bash
|
|
232
|
+
run: |
|
|
233
|
+
set -euo pipefail
|
|
234
|
+
expected_sha=$(git rev-parse HEAD)
|
|
235
|
+
if git show-ref --verify --quiet "refs/tags/$RELEASE_TAG"; then
|
|
236
|
+
if [[ "$(git cat-file -t "refs/tags/$RELEASE_TAG")" != "tag" ]]; then
|
|
237
|
+
echo "::error::Existing $RELEASE_TAG is not an annotated tag."
|
|
238
|
+
exit 1
|
|
239
|
+
fi
|
|
240
|
+
if [[ "$(git rev-list -n 1 "refs/tags/$RELEASE_TAG")" != "$expected_sha" ]]; then
|
|
241
|
+
echo "::error::Existing $RELEASE_TAG points at a different commit; it will not be moved."
|
|
242
|
+
exit 1
|
|
243
|
+
fi
|
|
244
|
+
else
|
|
245
|
+
# Tag before building so setuptools_scm resolves exactly $RELEASE_TAG.
|
|
246
|
+
# Pushed only after the dists are validated.
|
|
247
|
+
git config user.name github-actions[bot]
|
|
248
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
249
|
+
git tag --annotate "$RELEASE_TAG" --message "AgentTune $RELEASE_TAG"
|
|
250
|
+
fi
|
|
251
|
+
|
|
252
|
+
# Tests are intentionally skipped here; ci.yml gates merges to main.
|
|
253
|
+
- name: Install mandatory packaging tools
|
|
254
|
+
run: python -m pip install --upgrade build twine
|
|
255
|
+
|
|
256
|
+
- name: Build and validate distributions
|
|
257
|
+
shell: bash
|
|
258
|
+
run: |
|
|
259
|
+
set -euo pipefail
|
|
260
|
+
unset SETUPTOOLS_SCM_PRETEND_VERSION
|
|
261
|
+
rm -rf dist build
|
|
262
|
+
python -m build
|
|
263
|
+
python -m twine check dist/*
|
|
264
|
+
python scripts/release.py validate-dist "$RELEASE_TAG" --project-name "$PYPI_PROJECT_NAME" dist/*
|
|
265
|
+
|
|
266
|
+
- name: Push the tag
|
|
267
|
+
if: needs.plan.outputs.tag-exists == 'false'
|
|
268
|
+
run: git push origin "refs/tags/$RELEASE_TAG"
|
|
269
|
+
|
|
270
|
+
- name: Create or verify GitHub release
|
|
271
|
+
env:
|
|
272
|
+
GH_TOKEN: ${{ github.token }}
|
|
273
|
+
shell: bash
|
|
274
|
+
run: |
|
|
275
|
+
set -euo pipefail
|
|
276
|
+
if gh release view "$RELEASE_TAG" \
|
|
277
|
+
--json databaseId,tagName,name,isDraft,isPrerelease > release.json 2>/dev/null; then
|
|
278
|
+
release_state=$(python - "$RELEASE_TAG" <<'PY'
|
|
279
|
+
import json
|
|
280
|
+
import sys
|
|
281
|
+
|
|
282
|
+
release = json.load(open("release.json", encoding="utf-8"))
|
|
283
|
+
expected = sys.argv[1]
|
|
284
|
+
valid = (
|
|
285
|
+
release.get("tagName") == expected
|
|
286
|
+
and release.get("name") == expected
|
|
287
|
+
and isinstance(release.get("isDraft"), bool)
|
|
288
|
+
and release.get("isPrerelease") is False
|
|
289
|
+
and isinstance(release.get("databaseId"), int)
|
|
290
|
+
)
|
|
291
|
+
if not valid:
|
|
292
|
+
raise SystemExit(f"Existing GitHub release conflicts with {expected}: {release}")
|
|
293
|
+
print("draft" if release["isDraft"] else "published")
|
|
294
|
+
PY
|
|
295
|
+
)
|
|
296
|
+
if [[ "$release_state" == "draft" ]]; then
|
|
297
|
+
release_id=$(python -c 'import json; print(json.load(open("release.json"))["databaseId"])')
|
|
298
|
+
gh api --method PATCH "repos/$GITHUB_REPOSITORY/releases/$release_id" \
|
|
299
|
+
--field draft=false --silent
|
|
300
|
+
echo "Published existing draft GitHub release $RELEASE_TAG."
|
|
301
|
+
fi
|
|
302
|
+
else
|
|
303
|
+
gh release create "$RELEASE_TAG" --verify-tag --generate-notes --title "$RELEASE_TAG"
|
|
304
|
+
fi
|
|
305
|
+
|
|
306
|
+
- name: Publish the exact distributions to PyPI
|
|
307
|
+
# Runs on every release/resume; --skip-existing finishes a half-done
|
|
308
|
+
# upload (e.g. wheel uploaded, sdist not) instead of failing on rerun.
|
|
309
|
+
env:
|
|
310
|
+
TWINE_USERNAME: __token__
|
|
311
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
312
|
+
shell: bash
|
|
313
|
+
run: |
|
|
314
|
+
set -euo pipefail
|
|
315
|
+
: "${TWINE_PASSWORD:?PYPI_API_TOKEN is required to publish the release}"
|
|
316
|
+
python -m twine upload --non-interactive --verbose --skip-existing dist/*
|
|
317
|
+
|
|
318
|
+
- name: Send release notes to Slack
|
|
319
|
+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
|
|
320
|
+
continue-on-error: true
|
|
321
|
+
with:
|
|
322
|
+
channel-id: "lexsi-labs-agenttune-release"
|
|
323
|
+
payload: |
|
|
324
|
+
{
|
|
325
|
+
"text": "AgentTune release",
|
|
326
|
+
"blocks": [
|
|
327
|
+
{
|
|
328
|
+
"type": "section",
|
|
329
|
+
"text": {
|
|
330
|
+
"type": "mrkdwn",
|
|
331
|
+
"text": "*Version:* ${{ env.RELEASE_TAG }}"
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"type": "section",
|
|
336
|
+
"text": {
|
|
337
|
+
"type": "mrkdwn",
|
|
338
|
+
"text": "*Release:* https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_TAG }}"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"type": "section",
|
|
343
|
+
"text": {
|
|
344
|
+
"type": "mrkdwn",
|
|
345
|
+
"text": "*PyPI:* https://pypi.org/project/agenttune/${{ env.RELEASE_TAG }}/"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
env:
|
|
351
|
+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|