agent-tune-kit 2.2.1__tar.gz → 2.3.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.
Files changed (160) hide show
  1. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/.codex-plugin/plugin.json +8 -7
  2. agent_tune_kit-2.3.0/PKG-INFO +186 -0
  3. agent_tune_kit-2.3.0/README.en.md +172 -0
  4. agent_tune_kit-2.3.0/README.md +172 -0
  5. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/__init__.py +1 -1
  6. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/main.py +2 -2
  7. agent_tune_kit-2.3.0/agent_tune_kit/cli/trace.py +163 -0
  8. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/visualize.py +16 -2
  9. agent_tune_kit-2.3.0/agent_tune_kit/traces/__init__.py +1 -0
  10. agent_tune_kit-2.3.0/agent_tune_kit/traces/archive.py +164 -0
  11. agent_tune_kit-2.3.0/agent_tune_kit/traces/capture.py +530 -0
  12. agent_tune_kit-2.3.0/agent_tune_kit/traces/langfuse.py +252 -0
  13. agent_tune_kit-2.3.0/agent_tune_kit/traces/migrate.py +127 -0
  14. agent_tune_kit-2.3.0/agent_tune_kit/traces/query.py +260 -0
  15. agent_tune_kit-2.3.0/agent_tune_kit/traces/records.py +625 -0
  16. agent_tune_kit-2.3.0/agent_tune_kit/traces/segments.py +281 -0
  17. agent_tune_kit-2.3.0/agent_tune_kit/traces/store.py +571 -0
  18. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/dataset/styles.css +19 -12
  19. agent_tune_kit-2.3.0/agent_tune_kit/visualize/assets/trace/app.js +980 -0
  20. agent_tune_kit-2.3.0/agent_tune_kit/visualize/assets/trace/lanes.js +232 -0
  21. agent_tune_kit-2.3.0/agent_tune_kit/visualize/assets/trace/page.html +83 -0
  22. agent_tune_kit-2.3.0/agent_tune_kit/visualize/assets/trace/styles.css +276 -0
  23. agent_tune_kit-2.3.0/agent_tune_kit/visualize/timeline.py +214 -0
  24. agent_tune_kit-2.3.0/agent_tune_kit/visualize/trace.py +301 -0
  25. agent_tune_kit-2.3.0/docs/ato-atk-project-boundary-recommendation-2026-11-05.md +98 -0
  26. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/codex_agent_tuning_prd.md +2 -1
  27. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/skill-template-pack-usage.md +1 -0
  28. agent_tune_kit-2.3.0/docs/trace-swimlane-design.md +129 -0
  29. agent_tune_kit-2.3.0/docs/trace-tuning-validation.md +56 -0
  30. agent_tune_kit-2.3.0/docs/trace-tuning.md +251 -0
  31. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/pyproject.toml +1 -1
  32. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/check-release.py +63 -0
  33. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/validate_skill_pack.py +28 -2
  34. agent_tune_kit-2.3.0/skills/atk-trace-capture/SKILL.md +47 -0
  35. agent_tune_kit-2.3.0/skills/atk-trace-detect/SKILL.md +57 -0
  36. agent_tune_kit-2.3.0/skills/atk-trace-diagnose/SKILL.md +47 -0
  37. agent_tune_kit-2.3.0/skills/atk-trace-init/SKILL.md +52 -0
  38. agent_tune_kit-2.3.0/skills/atk-trace-optimize/SKILL.md +49 -0
  39. agent_tune_kit-2.3.0/skills/atk-trace-verify/SKILL.md +50 -0
  40. agent_tune_kit-2.3.0/skills/atk-visualize-trace/SKILL.md +46 -0
  41. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_install_plugin.py +10 -1
  42. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_release_scripts.py +24 -2
  43. agent_tune_kit-2.3.0/tests/test_trace_capture.py +346 -0
  44. agent_tune_kit-2.3.0/tests/test_trace_cli.py +160 -0
  45. agent_tune_kit-2.3.0/tests/test_trace_langfuse.py +160 -0
  46. agent_tune_kit-2.3.0/tests/test_trace_query.py +49 -0
  47. agent_tune_kit-2.3.0/tests/test_trace_records.py +300 -0
  48. agent_tune_kit-2.3.0/tests/test_trace_segments.py +222 -0
  49. agent_tune_kit-2.3.0/tests/test_trace_store.py +192 -0
  50. agent_tune_kit-2.3.0/tests/test_visualize_trace.py +461 -0
  51. agent_tune_kit-2.3.0/tests/trace-event-wheel.cjs +84 -0
  52. agent_tune_kit-2.3.0/tests/trace-preview-scroll.cjs +138 -0
  53. agent_tune_kit-2.2.1/PKG-INFO +0 -199
  54. agent_tune_kit-2.2.1/README.en.md +0 -185
  55. agent_tune_kit-2.2.1/README.md +0 -185
  56. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/.gitignore +0 -0
  57. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/__init__.py +0 -0
  58. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/__main__.py +0 -0
  59. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/dataset.py +0 -0
  60. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/evaluation.py +0 -0
  61. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/output.py +0 -0
  62. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/cli/results.py +0 -0
  63. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/datasets/__init__.py +0 -0
  64. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/datasets/prepare.py +0 -0
  65. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/datasets/truth.py +0 -0
  66. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/datasets/updates.py +0 -0
  67. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/datasets/validation.py +0 -0
  68. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/errors.py +0 -0
  69. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/__init__.py +0 -0
  70. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/calibration.py +0 -0
  71. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/logs.py +0 -0
  72. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/rules.py +0 -0
  73. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/runner.py +0 -0
  74. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/runtime.py +0 -0
  75. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/execution/tracing.py +0 -0
  76. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/installer.py +0 -0
  77. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/results/__init__.py +0 -0
  78. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/results/assessment.py +0 -0
  79. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/results/evidence.py +0 -0
  80. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/results/judgments.py +0 -0
  81. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/results/summary.py +0 -0
  82. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/results/versions.py +0 -0
  83. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/utils/__init__.py +0 -0
  84. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/utils/csv_io.py +0 -0
  85. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/utils/files.py +0 -0
  86. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/__init__.py +0 -0
  87. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/dataset/app.js +0 -0
  88. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/dataset/page.html +0 -0
  89. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/dataset/vendor/echarts.min.js +0 -0
  90. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/failures/app.js +0 -0
  91. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/failures/page.html +0 -0
  92. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/assets/failures/styles.css +0 -0
  93. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/dataset.py +0 -0
  94. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/failures.py +0 -0
  95. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/fields.py +0 -0
  96. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/history.py +0 -0
  97. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/visualize/render.py +0 -0
  98. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/agent_tune_kit/workspace.py +0 -0
  99. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/assets/arch-en.png +0 -0
  100. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/assets/arch.png +0 -0
  101. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/assets/architecture.en.svg +0 -0
  102. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/assets/architecture.svg +0 -0
  103. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/cli-skill-modularization-plan.md +0 -0
  104. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/execution-evidence-and-tracing-plan.md +0 -0
  105. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/ground-truth-and-grading-assessment-2026-10-25.md +0 -0
  106. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/local-context.md +0 -0
  107. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/shared-versioning-and-confirmation.md +0 -0
  108. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/surginame-atk-capability-review-2026-10-27.md +0 -0
  109. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/docs/truth-and-assessment.md +0 -0
  110. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/dev-refresh-install.sh +0 -0
  111. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/install_plugin.py +0 -0
  112. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/publish-pypi.sh +0 -0
  113. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/publish-release.py +0 -0
  114. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/release-version.py +0 -0
  115. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/scripts/release-version.sh +0 -0
  116. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-dataset/SKILL.md +0 -0
  117. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-dataset/scripts/update_dataset.py +0 -0
  118. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-diagnose/SKILL.md +0 -0
  119. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-eval/SKILL.md +0 -0
  120. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-init/SKILL.md +0 -0
  121. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-optimize/SKILL.md +0 -0
  122. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-report/SKILL.md +0 -0
  123. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-visualize-dataset/SKILL.md +0 -0
  124. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-visualize-dataset/scripts/generate_dataset_browser.py +0 -0
  125. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-visualize-failures/SKILL.md +0 -0
  126. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/skills/atk-visualize-failures/scripts/generate_failure_browser.py +0 -0
  127. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/templates/.atk/runner/eval_runner.py.md +0 -0
  128. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/templates/.atk/runner/failure_rule.py.md +0 -0
  129. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/templates/.atk/runner/import_evidence.py.md +0 -0
  130. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/templates/.gitkeep +0 -0
  131. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/__init__.py +0 -0
  132. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/conftest.py +0 -0
  133. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/fixtures/legacy_eval_runner.py.txt +0 -0
  134. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/fixtures/managed_v1.py.md +0 -0
  135. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_assessment_contract.py +0 -0
  136. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_atk_init_contract.py +0 -0
  137. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_cli_workflow.py +0 -0
  138. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_dataset_updates.py +0 -0
  139. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_diagnosis.py +0 -0
  140. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_evidence_import.py +0 -0
  141. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_evidence_judgments.py +0 -0
  142. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_evidence_packaging.py +0 -0
  143. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_evidence_versions.py +0 -0
  144. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_execution_evidence.py +0 -0
  145. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_execution_outcomes.py +0 -0
  146. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_execution_tracing.py +0 -0
  147. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_generate_dataset_browser.py +0 -0
  148. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_generate_failure_browser.py +0 -0
  149. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_judge_calibration.py +0 -0
  150. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_local_context.py +0 -0
  151. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_plugin_cache.py +0 -0
  152. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_runner_output_columns.py +0 -0
  153. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_runner_template_row_logging.py +0 -0
  154. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_runtime_contracts.py +0 -0
  155. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_snapshot_reads.py +0 -0
  156. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_truth_browser.py +0 -0
  157. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_truth_cli.py +0 -0
  158. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_truth_contract.py +0 -0
  159. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_truth_runner.py +0 -0
  160. {agent_tune_kit-2.2.1 → agent_tune_kit-2.3.0}/tests/test_v2_progress.py +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-tune-kit",
3
- "version": "2.2.1",
4
- "description": "Local Codex plugin for iterative Agent tuning with guided Skills, reusable runner templates, versioned results, and static validation.",
3
+ "version": "2.3.0",
4
+ "description": "Local Codex plugin for batch Agent evaluation and session trace tuning with evidence-backed issues, focused changes, verification and offline review.",
5
5
  "author": {
6
6
  "name": "hustyichi",
7
7
  "email": "hustyichi@163.com",
@@ -15,13 +15,14 @@
15
15
  "codex-skills",
16
16
  "evaluation",
17
17
  "reporting",
18
- "local-plugin"
18
+ "local-plugin",
19
+ "trace-tuning"
19
20
  ],
20
21
  "skills": "./skills/",
21
22
  "interface": {
22
23
  "displayName": "Agent Tune Kit",
23
- "shortDescription": "Run a guided local Agent tuning loop",
24
- "longDescription": "Agent Tune Kit provides Codex Skills for generating local test runners, finding failing cases, reporting regressions and improvements, and applying focused Agent tuning with versioned local artifacts.",
24
+ "shortDescription": "Evaluate Agents and tune session traces",
25
+ "longDescription": "Agent Tune Kit provides independent Codex Skills for batch evaluation and session trace tuning: capture traces, detect issues, investigate causes, apply focused changes, verify candidates, and review offline evidence.",
25
26
  "developerName": "hustyichi",
26
27
  "category": "Coding",
27
28
  "capabilities": [
@@ -31,9 +32,9 @@
31
32
  ],
32
33
  "websiteURL": "https://github.com/hustyichi/agent-tune-kit",
33
34
  "defaultPrompt": [
34
- "Build an Agent tuning dataset",
35
+ "Analyze an Agent session trace",
35
36
  "Find Agent failure cases",
36
- "Generate an Agent tuning report"
37
+ "Verify a focused Agent repair"
37
38
  ],
38
39
  "brandColor": "#334155",
39
40
  "screenshots": []
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.5
2
+ Name: agent-tune-kit
3
+ Version: 2.3.0
4
+ Summary: Local Codex plugin for iterative Agent tuning with guided Skills, reusable runner templates, versioned results, and static validation.
5
+ Project-URL: Homepage, https://github.com/hustyichi/agent-tune-kit
6
+ Project-URL: Repository, https://github.com/hustyichi/agent-tune-kit
7
+ Author-email: hustyichi <hustyichi@163.com>
8
+ License: UNLICENSED
9
+ Keywords: agent-tune-kit,codex-skills,evaluation,local-plugin,reporting
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Requires-Python: >=3.11
13
+ Description-Content-Type: text/markdown
14
+
15
+ # Agent Tune Kit
16
+
17
+ English | [简体中文](README.md)
18
+
19
+ [![PyPI](https://img.shields.io/pypi/v/agent-tune-kit.svg)](https://pypi.org/project/agent-tune-kit/)
20
+
21
+ Agent Tune Kit is a **local Codex plugin** for tuning an Agent's prompts, code, parameters, or tool configuration. Install it once and use either workflow independently.
22
+
23
+ - [Evaluation-based tuning](#evaluation-based-tuning) starts with a set of samples and criteria. Run the Agent in batches, compare rounds, and check for regressions.
24
+ - [Continuous tuning from session traces](#continuous-tuning-from-session-traces) starts with an existing session. Follow its execution trace to identify issues, then fix and verify them individually.
25
+
26
+ ## Install and Enable
27
+
28
+ Run these commands in your terminal to install ATK and its bundled Skills.
29
+
30
+ ```sh
31
+ uv tool install agent-tune-kit
32
+ atk install
33
+ ```
34
+
35
+ In Codex, enter `/plugins`, select and enable `Agent Tune Kit`, then restart Codex and open a new session.
36
+
37
+ <details>
38
+ <summary>Install with pipx or from local source</summary>
39
+
40
+ To install with pipx, run the following commands.
41
+
42
+ ```sh
43
+ pipx install agent-tune-kit
44
+ atk install
45
+ ```
46
+
47
+ To install from local source, update your chosen branch and run these commands from the **ATK repository root**. Rerun them after source updates, including when the version stays the same.
48
+
49
+ ```sh
50
+ uv tool install --reinstall .
51
+ atk install
52
+ ```
53
+
54
+ </details>
55
+
56
+ Finish active ATK tasks before reinstalling, and open a new session afterward to load updates. If you have installation problems, run `atk status` and confirm the plugin is enabled in Codex. [Installation and cache notes](docs/skill-template-pack-usage.md#local-plugin-install-and-smoke)
57
+
58
+ ## Evaluation-based tuning
59
+
60
+ Use a set of evaluation samples to find Agent failures and verify changes in later rounds. Prepare your Agent's entry point and a set of samples, preferably in CSV format. Five to twenty samples are enough to get started. Add expected answers, labels, or acceptance criteria where available.
61
+
62
+ Open your Agent project in Codex and send the following `$atk-…` instructions in the conversation.
63
+
64
+ ### 1. Prepare Data as Needed
65
+
66
+ If you already have suitable data, go straight to connecting your Agent. To organize data or fill gaps in the evaluation criteria, send the following instruction.
67
+
68
+ ```text
69
+ $atk-dataset Prepare data/eval.csv for evaluation. Preserve existing fields and answers. Fill gaps in the judgment criteria where the evidence supports an answer.
70
+ ```
71
+
72
+ You can also start with business examples or request a correction, such as changing the expected result for atk_id 7. Keep your existing business column names. Answers without trustworthy support stay blank.
73
+
74
+ Use `$atk-visualize-dataset` when you want a local page for browsing and reviewing data, then give feedback to `$atk-dataset`.
75
+
76
+ ### 2. Connect Your Agent
77
+
78
+ Tell Codex where to find your Agent entry point and evaluation data.
79
+
80
+ ```text
81
+ $atk-init My Agent entry point is scripts/agent.py and the evaluation dataset is data/eval.csv
82
+ ```
83
+
84
+ Codex reads the project, prepares the adapter, and organizes a runnable dataset. If your Agent is already connected through a compatible adapter, go straight to evaluation.
85
+
86
+ Evaluation appends five reserved columns called `agent_output`, `output_status`, `error_type`, `error_message`, and `log_path`. If evaluation reports a name collision, confirm a new name for the business column and update references in the adapter and judgment rules. [Reserved columns](docs/shared-versioning-and-confirmation.md#reserved-evaluation-output-columns)
87
+
88
+ ### 3. Evaluate, Diagnose, and Read the Report
89
+
90
+ Send these instructions in order.
91
+
92
+ ```text
93
+ $atk-eval
94
+ $atk-diagnose
95
+ $atk-report
96
+ ```
97
+
98
+ | Instruction | What you get |
99
+ | --- | --- |
100
+ | `$atk-eval` | Actual Agent outputs and execution records for each sample |
101
+ | `$atk-diagnose` | Passed, failed, or unknown judgments with reasons and an initial investigation of failures |
102
+ | `$atk-report` | Main issues, cause analysis, and tuning recommendations |
103
+
104
+ Use `$atk-visualize-failures` for a local offline page to search, filter, and review individual failures.
105
+
106
+ Check judgment coverage when comparing pass results. Samples with insufficient evidence are marked unknown. Reported technical failures such as timeouts are counted separately and can be reviewed with `atk results inspect`.
107
+
108
+ ### 4. Tune from the Results
109
+
110
+ ```text
111
+ $atk-optimize
112
+ ```
113
+
114
+ Codex uses the report and failures to edit your Agent. It records why it made changes and what to verify next. You can save your current code with Git before tuning so you can compare and restore it.
115
+
116
+ ### 5. Rerun the Evaluation and Verify Changes
117
+
118
+ After tuning, you can first rerun the previous round's confirmed failures.
119
+
120
+ ```text
121
+ $atk-eval --only-failures
122
+ $atk-diagnose
123
+ $atk-report
124
+ ```
125
+
126
+ A new evaluation does not overwrite existing nonempty result directories. From the second round onward, when prior tuning notes exist and conditions are comparable, the report identifies target issues as resolved, partially resolved, unresolved, or impossible to judge.
127
+
128
+ To revisit unknown samples, technical failures, or other selected samples, use `$atk-eval --ids 7 9` separately. To check the effect on the full dataset, run `$atk-eval` without selection flags, then diagnose and generate the report.
129
+
130
+ ### Where to Find Evaluation Outputs
131
+
132
+ Each round saves results under `.atk/results/vN/` in your Agent project. Files appear as you run the corresponding steps.
133
+
134
+ | File | What it shows |
135
+ | --- | --- |
136
+ | `eval_results.csv` | Actual outputs and execution status. Follow `log_path` to find a sample's log |
137
+ | `judgments.csv`, `failure_cases.csv` | Individual judgments and confirmed failures. Use `failure_cases.html` to browse failures |
138
+ | `report.md`, `tuning_plan.md` | Issues, changes, and verification targets for the round. Later reports revisit those targets when conditions are comparable |
139
+
140
+ [More batch evaluation options and outputs](docs/skill-template-pack-usage.md#manual-22--26-loop)
141
+
142
+ ![Evaluation-based tuning workflow, from preparing data and connecting an Agent through evaluation, diagnosis, reporting, tuning, and rerunning the evaluation.](docs/assets/architecture.en.svg)
143
+
144
+ ## Continuous tuning from session traces
145
+
146
+ Start with an existing session and use its execution trace to check whether the Agent completed the task. Save diagnoses, fixes, and verification results by issue. Get the native Session ID, its source, and access to the trace, then open the Agent project in Codex. You can start without an evaluation dataset or runner.
147
+
148
+ Run `atk trace --help` to check whether your CLI supports trace tuning. If the command is unavailable, follow the local source installation steps above with a version that supports trace tuning, then open a new Codex session.
149
+
150
+ ### 1. Prepare the Session Trace
151
+
152
+ - **Langfuse v4**. Use `$atk-trace-init` to record project settings and configure read-only access on first setup. Configuration references credentials by environment-variable name. Then send `$atk-trace-capture Download session <session-id> from <start time> to <end time>`.
153
+ - **Local files**. Send `$atk-trace-capture Import traces for session <session-id> from <file path>, with source <source>`. You can also provide files with verifiable ties to the session during analysis and let detection import them. Analyze an already archived session directly.
154
+
155
+ The capture step downloads or imports data. Before saving, decide which content to retain and which fields to redact. ATK adds `.atk/traces/` to the project's `.gitignore`.
156
+
157
+ ### 2. Analyze and Review Evidence
158
+
159
+ ```text
160
+ $atk-trace-detect Check whether session <session-id> completed its task correctly. List issues, evidence, and what you did not inspect.
161
+ $atk-visualize-trace Open the execution lanes for session <session-id> and jump from issues to the relevant trace segments and evidence fields.
162
+ ```
163
+
164
+ Detection lists issues, evidence, and what it inspected. Use Trace IDs to locate evidence within the session. You can generate a preview once traces are archived. Review any retained content in the HTML before sharing it.
165
+
166
+ ### 3. Investigate, Fix, and Verify an Issue as Needed
167
+
168
+ ```text
169
+ $atk-trace-diagnose Investigate ISSUE-001 in session <session-id> and propose a repair and verification plan.
170
+ $atk-trace-optimize Implement the selected plan for ISSUE-001 in session <session-id>.
171
+ $atk-trace-verify Verify the candidate for ISSUE-001 in session <session-id> and check relevant behavior that should still work.
172
+ ```
173
+
174
+ Start with diagnosis when you already have a specific issue and session evidence. Each verification records a conclusion per issue. If the evidence cannot establish which candidate loaded or whether key verification conditions were met, the outcome is `inconclusive`. As new issues surface, work through them individually or start another analysis with a new session trace.
175
+
176
+ ### Where to Find Trace Outputs
177
+
178
+ Each session archive is stored under `.atk/traces/<session_id>/` in your Agent project. Files appear as you run the corresponding steps.
179
+
180
+ | File or directory | What it shows |
181
+ | --- | --- |
182
+ | `session.json`, `raw/` | Session source, capture scope, inspection coverage, and retained traces |
183
+ | `preview.html` | Offline browse: issue rail, swimlanes, Event list; jump by Issue segments |
184
+ | `issues/<issue-id>/` | Issue evidence, diagnoses, and changes. Each verification's `result.json` records its status, conclusion, and evidence references |
185
+
186
+ [Trace tuning guide for source configuration, supported formats, and archive layout](docs/trace-tuning.md)
@@ -0,0 +1,172 @@
1
+ # Agent Tune Kit
2
+
3
+ English | [简体中文](README.md)
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/agent-tune-kit.svg)](https://pypi.org/project/agent-tune-kit/)
6
+
7
+ Agent Tune Kit is a **local Codex plugin** for tuning an Agent's prompts, code, parameters, or tool configuration. Install it once and use either workflow independently.
8
+
9
+ - [Evaluation-based tuning](#evaluation-based-tuning) starts with a set of samples and criteria. Run the Agent in batches, compare rounds, and check for regressions.
10
+ - [Continuous tuning from session traces](#continuous-tuning-from-session-traces) starts with an existing session. Follow its execution trace to identify issues, then fix and verify them individually.
11
+
12
+ ## Install and Enable
13
+
14
+ Run these commands in your terminal to install ATK and its bundled Skills.
15
+
16
+ ```sh
17
+ uv tool install agent-tune-kit
18
+ atk install
19
+ ```
20
+
21
+ In Codex, enter `/plugins`, select and enable `Agent Tune Kit`, then restart Codex and open a new session.
22
+
23
+ <details>
24
+ <summary>Install with pipx or from local source</summary>
25
+
26
+ To install with pipx, run the following commands.
27
+
28
+ ```sh
29
+ pipx install agent-tune-kit
30
+ atk install
31
+ ```
32
+
33
+ To install from local source, update your chosen branch and run these commands from the **ATK repository root**. Rerun them after source updates, including when the version stays the same.
34
+
35
+ ```sh
36
+ uv tool install --reinstall .
37
+ atk install
38
+ ```
39
+
40
+ </details>
41
+
42
+ Finish active ATK tasks before reinstalling, and open a new session afterward to load updates. If you have installation problems, run `atk status` and confirm the plugin is enabled in Codex. [Installation and cache notes](docs/skill-template-pack-usage.md#local-plugin-install-and-smoke)
43
+
44
+ ## Evaluation-based tuning
45
+
46
+ Use a set of evaluation samples to find Agent failures and verify changes in later rounds. Prepare your Agent's entry point and a set of samples, preferably in CSV format. Five to twenty samples are enough to get started. Add expected answers, labels, or acceptance criteria where available.
47
+
48
+ Open your Agent project in Codex and send the following `$atk-…` instructions in the conversation.
49
+
50
+ ### 1. Prepare Data as Needed
51
+
52
+ If you already have suitable data, go straight to connecting your Agent. To organize data or fill gaps in the evaluation criteria, send the following instruction.
53
+
54
+ ```text
55
+ $atk-dataset Prepare data/eval.csv for evaluation. Preserve existing fields and answers. Fill gaps in the judgment criteria where the evidence supports an answer.
56
+ ```
57
+
58
+ You can also start with business examples or request a correction, such as changing the expected result for atk_id 7. Keep your existing business column names. Answers without trustworthy support stay blank.
59
+
60
+ Use `$atk-visualize-dataset` when you want a local page for browsing and reviewing data, then give feedback to `$atk-dataset`.
61
+
62
+ ### 2. Connect Your Agent
63
+
64
+ Tell Codex where to find your Agent entry point and evaluation data.
65
+
66
+ ```text
67
+ $atk-init My Agent entry point is scripts/agent.py and the evaluation dataset is data/eval.csv
68
+ ```
69
+
70
+ Codex reads the project, prepares the adapter, and organizes a runnable dataset. If your Agent is already connected through a compatible adapter, go straight to evaluation.
71
+
72
+ Evaluation appends five reserved columns called `agent_output`, `output_status`, `error_type`, `error_message`, and `log_path`. If evaluation reports a name collision, confirm a new name for the business column and update references in the adapter and judgment rules. [Reserved columns](docs/shared-versioning-and-confirmation.md#reserved-evaluation-output-columns)
73
+
74
+ ### 3. Evaluate, Diagnose, and Read the Report
75
+
76
+ Send these instructions in order.
77
+
78
+ ```text
79
+ $atk-eval
80
+ $atk-diagnose
81
+ $atk-report
82
+ ```
83
+
84
+ | Instruction | What you get |
85
+ | --- | --- |
86
+ | `$atk-eval` | Actual Agent outputs and execution records for each sample |
87
+ | `$atk-diagnose` | Passed, failed, or unknown judgments with reasons and an initial investigation of failures |
88
+ | `$atk-report` | Main issues, cause analysis, and tuning recommendations |
89
+
90
+ Use `$atk-visualize-failures` for a local offline page to search, filter, and review individual failures.
91
+
92
+ Check judgment coverage when comparing pass results. Samples with insufficient evidence are marked unknown. Reported technical failures such as timeouts are counted separately and can be reviewed with `atk results inspect`.
93
+
94
+ ### 4. Tune from the Results
95
+
96
+ ```text
97
+ $atk-optimize
98
+ ```
99
+
100
+ Codex uses the report and failures to edit your Agent. It records why it made changes and what to verify next. You can save your current code with Git before tuning so you can compare and restore it.
101
+
102
+ ### 5. Rerun the Evaluation and Verify Changes
103
+
104
+ After tuning, you can first rerun the previous round's confirmed failures.
105
+
106
+ ```text
107
+ $atk-eval --only-failures
108
+ $atk-diagnose
109
+ $atk-report
110
+ ```
111
+
112
+ A new evaluation does not overwrite existing nonempty result directories. From the second round onward, when prior tuning notes exist and conditions are comparable, the report identifies target issues as resolved, partially resolved, unresolved, or impossible to judge.
113
+
114
+ To revisit unknown samples, technical failures, or other selected samples, use `$atk-eval --ids 7 9` separately. To check the effect on the full dataset, run `$atk-eval` without selection flags, then diagnose and generate the report.
115
+
116
+ ### Where to Find Evaluation Outputs
117
+
118
+ Each round saves results under `.atk/results/vN/` in your Agent project. Files appear as you run the corresponding steps.
119
+
120
+ | File | What it shows |
121
+ | --- | --- |
122
+ | `eval_results.csv` | Actual outputs and execution status. Follow `log_path` to find a sample's log |
123
+ | `judgments.csv`, `failure_cases.csv` | Individual judgments and confirmed failures. Use `failure_cases.html` to browse failures |
124
+ | `report.md`, `tuning_plan.md` | Issues, changes, and verification targets for the round. Later reports revisit those targets when conditions are comparable |
125
+
126
+ [More batch evaluation options and outputs](docs/skill-template-pack-usage.md#manual-22--26-loop)
127
+
128
+ ![Evaluation-based tuning workflow, from preparing data and connecting an Agent through evaluation, diagnosis, reporting, tuning, and rerunning the evaluation.](docs/assets/architecture.en.svg)
129
+
130
+ ## Continuous tuning from session traces
131
+
132
+ Start with an existing session and use its execution trace to check whether the Agent completed the task. Save diagnoses, fixes, and verification results by issue. Get the native Session ID, its source, and access to the trace, then open the Agent project in Codex. You can start without an evaluation dataset or runner.
133
+
134
+ Run `atk trace --help` to check whether your CLI supports trace tuning. If the command is unavailable, follow the local source installation steps above with a version that supports trace tuning, then open a new Codex session.
135
+
136
+ ### 1. Prepare the Session Trace
137
+
138
+ - **Langfuse v4**. Use `$atk-trace-init` to record project settings and configure read-only access on first setup. Configuration references credentials by environment-variable name. Then send `$atk-trace-capture Download session <session-id> from <start time> to <end time>`.
139
+ - **Local files**. Send `$atk-trace-capture Import traces for session <session-id> from <file path>, with source <source>`. You can also provide files with verifiable ties to the session during analysis and let detection import them. Analyze an already archived session directly.
140
+
141
+ The capture step downloads or imports data. Before saving, decide which content to retain and which fields to redact. ATK adds `.atk/traces/` to the project's `.gitignore`.
142
+
143
+ ### 2. Analyze and Review Evidence
144
+
145
+ ```text
146
+ $atk-trace-detect Check whether session <session-id> completed its task correctly. List issues, evidence, and what you did not inspect.
147
+ $atk-visualize-trace Open the execution lanes for session <session-id> and jump from issues to the relevant trace segments and evidence fields.
148
+ ```
149
+
150
+ Detection lists issues, evidence, and what it inspected. Use Trace IDs to locate evidence within the session. You can generate a preview once traces are archived. Review any retained content in the HTML before sharing it.
151
+
152
+ ### 3. Investigate, Fix, and Verify an Issue as Needed
153
+
154
+ ```text
155
+ $atk-trace-diagnose Investigate ISSUE-001 in session <session-id> and propose a repair and verification plan.
156
+ $atk-trace-optimize Implement the selected plan for ISSUE-001 in session <session-id>.
157
+ $atk-trace-verify Verify the candidate for ISSUE-001 in session <session-id> and check relevant behavior that should still work.
158
+ ```
159
+
160
+ Start with diagnosis when you already have a specific issue and session evidence. Each verification records a conclusion per issue. If the evidence cannot establish which candidate loaded or whether key verification conditions were met, the outcome is `inconclusive`. As new issues surface, work through them individually or start another analysis with a new session trace.
161
+
162
+ ### Where to Find Trace Outputs
163
+
164
+ Each session archive is stored under `.atk/traces/<session_id>/` in your Agent project. Files appear as you run the corresponding steps.
165
+
166
+ | File or directory | What it shows |
167
+ | --- | --- |
168
+ | `session.json`, `raw/` | Session source, capture scope, inspection coverage, and retained traces |
169
+ | `preview.html` | Offline browse: issue rail, swimlanes, Event list; jump by Issue segments |
170
+ | `issues/<issue-id>/` | Issue evidence, diagnoses, and changes. Each verification's `result.json` records its status, conclusion, and evidence references |
171
+
172
+ [Trace tuning guide for source configuration, supported formats, and archive layout](docs/trace-tuning.md)
@@ -0,0 +1,172 @@
1
+ # Agent Tune Kit
2
+
3
+ 简体中文 | [English](README.en.md)
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/agent-tune-kit.svg)](https://pypi.org/project/agent-tune-kit/)
6
+
7
+ Agent Tune Kit 是一个**本地 Codex 插件**,用于调优 Agent 的提示词、代码、参数或工具配置。两条路线共用安装,安装后可按手头的材料独立使用。
8
+
9
+ - [评测调优](#评测调优)从一组样本和评测标准出发,批量运行 Agent,比较多轮结果并做回归验证。
10
+ - [轨迹持续调优](#轨迹持续调优)从一个已有会话出发,沿执行轨迹定位问题,逐项修复和验证。
11
+
12
+ ## 安装与启用
13
+
14
+ 在终端运行以下命令安装 ATK 和配套 Skills。
15
+
16
+ ```sh
17
+ uv tool install agent-tune-kit
18
+ atk install
19
+ ```
20
+
21
+ 在 Codex 中输入 `/plugins`,选择并启用 `Agent Tune Kit`,然后重启 Codex 并新建会话。
22
+
23
+ <details>
24
+ <summary>使用 pipx 或本地源码安装</summary>
25
+
26
+ 用 pipx 安装。
27
+
28
+ ```sh
29
+ pipx install agent-tune-kit
30
+ atk install
31
+ ```
32
+
33
+ 从本地源码安装时,先更新所需分支,再在 **ATK 仓库根目录**运行以下命令。更新源码后可重新执行,包括版本号未变的情况。
34
+
35
+ ```sh
36
+ uv tool install --reinstall .
37
+ atk install
38
+ ```
39
+
40
+ </details>
41
+
42
+ 重装前先结束正在运行的 ATK 任务,安装后新建会话以加载更新。遇到安装问题时,运行 `atk status` 检查安装,并在 Codex 中确认插件已启用。[安装与缓存说明](docs/skill-template-pack-usage.md#local-plugin-install-and-smoke)
43
+
44
+ ## 评测调优
45
+
46
+ 用一组评测样本找出 Agent 的问题,并用后续评测验证改动。准备 Agent 的入口和一组样本,推荐用 CSV,5 到 20 条即可开始。每条样本可附上期望答案、标签或可验收的行为标准。
47
+
48
+ 在 Codex 中打开 Agent 项目,在对话中发送下面的 `$atk-…` 指令。
49
+
50
+ ### 1. 准备数据(按需)
51
+
52
+ 已有合适的数据可直接接入 Agent。需要整理数据或补充评测标准时,可以发送以下指令。
53
+
54
+ ```text
55
+ $atk-dataset 使用 data/eval.csv 准备评测数据,保留原字段和已有答案,只补充缺失且有依据的判断标准。
56
+ ```
57
+
58
+ 也可以从业务示例开始,或直接提出修订,例如“修改 atk_id 为 7 的预期结果”。沿用已有的业务列名。缺少可信依据的答案会留空。
59
+
60
+ 需要人工浏览和复核时,可使用 `$atk-visualize-dataset` 生成本地数据浏览页,再把反馈交给 `$atk-dataset`。
61
+
62
+ ### 2. 接入 Agent
63
+
64
+ 告诉 Codex 你的 Agent 入口和评测数据位置。
65
+
66
+ ```text
67
+ $atk-init 我的 Agent 入口是 scripts/agent.py,评测数据是 data/eval.csv
68
+ ```
69
+
70
+ Codex 会读取项目、准备接入文件并整理可运行的数据集。已经完成接入且仍兼容时,可直接开始评测。
71
+
72
+ 评测会追加五个保留列,即 `agent_output`、`output_status`、`error_type`、`error_message` 和 `log_path`。如果评测提示列名冲突,确认新的业务列名并同步适配器和判定规则中的引用。[保留列说明](docs/shared-versioning-and-confirmation.md#reserved-evaluation-output-columns)
73
+
74
+ ### 3. 评测、诊断并查看报告
75
+
76
+ 依次发送以下指令。
77
+
78
+ ```text
79
+ $atk-eval
80
+ $atk-diagnose
81
+ $atk-report
82
+ ```
83
+
84
+ | 指令 | 你会得到什么 |
85
+ | --- | --- |
86
+ | `$atk-eval` | 每条样本的 Agent 实际输出和执行记录 |
87
+ | `$atk-diagnose` | 通过、失败、未判定的结果及理由,以及失败原因的初步定位 |
88
+ | `$atk-report` | 本轮主要问题、原因分析和调优建议 |
89
+
90
+ 需要逐条搜索、筛选和复核失败样本时,使用 `$atk-visualize-failures` 生成本地离线浏览页。
91
+
92
+ 比较通过情况时,也要看判定覆盖范围。依据不足的样本会标为未判定。已记录的超时等技术失败单独统计,可用 `atk results inspect` 查看。
93
+
94
+ ### 4. 根据结果调优
95
+
96
+ ```text
97
+ $atk-optimize
98
+ ```
99
+
100
+ Codex 会根据报告和失败样本修改 Agent,并记录改动原因和下一轮需要验证的问题。调优前可用 Git 保存当前代码,方便比较和恢复。
101
+
102
+ ### 5. 重跑并验证改动
103
+
104
+ 调优后,可以先重跑上一轮已确认的失败样本。
105
+
106
+ ```text
107
+ $atk-eval --only-failures
108
+ $atk-diagnose
109
+ $atk-report
110
+ ```
111
+
112
+ 已有非空结果目录不会被下一轮评测覆盖。从第二轮开始,如果上一轮有调优记录且实验条件可比,报告会说明目标问题已解决、部分解决、未解决,还是无法判断。
113
+
114
+ 如需补测未判定、技术失败或其他指定样本,可单独使用 `$atk-eval --ids 7 9`。需要确认改动对整组样本的影响时,运行不带筛选参数的 `$atk-eval`,再诊断和生成报告。
115
+
116
+ ### 查看评测产物
117
+
118
+ 每轮结果保存在 Agent 项目的 `.atk/results/vN/` 下,文件随对应步骤生成。
119
+
120
+ | 文件 | 用途 |
121
+ | --- | --- |
122
+ | `eval_results.csv` | 查看实际输出和执行状态,按 `log_path` 查找样本日志 |
123
+ | `judgments.csv`、`failure_cases.csv` | 复核逐条判定和已确认的失败。可用 `failure_cases.html` 浏览失败样本 |
124
+ | `report.md`、`tuning_plan.md` | 查看本轮问题、改动及验证目标。后续报告会在条件可比时核对这些目标 |
125
+
126
+ [更多批量评测运行选项和产物](docs/skill-template-pack-usage.md#manual-22--26-loop)
127
+
128
+ ![评测调优流程,从准备数据和接入 Agent 到评测、诊断、报告、调优和复测。](docs/assets/architecture.svg)
129
+
130
+ ## 轨迹持续调优
131
+
132
+ 从一个已有会话出发,结合实际执行轨迹判断任务是否完成,再按问题保存诊断、修复和验证记录。准备原始 Session ID、来源和可读取的轨迹,直接在 Codex 中打开 Agent 项目开始。无需评测数据集或 runner。
133
+
134
+ 可用 `atk trace --help` 检查当前 CLI 是否支持轨迹调优。如果命令不可用,按上面的本地源码方式安装支持轨迹调优的版本,再新建 Codex 会话。
135
+
136
+ ### 1. 准备会话轨迹
137
+
138
+ - **Langfuse v4**。首次接入可用 `$atk-trace-init` 记录项目和只读来源配置。配置只引用凭据的环境变量名。然后发送 `$atk-trace-capture 下载 <session-id> 的会话,时间范围是 <开始时间> 到 <结束时间>`。
139
+ - **本地文件**。发送 `$atk-trace-capture 从 <文件路径> 导入 <session-id> 的轨迹,来源是 <来源>`。也可在分析时提供可验证会话归属的文件,由分析流程导入。已归档的会话可直接分析。
140
+
141
+ 采集步骤负责下载或导入。保存前确认哪些正文可以留存、哪些字段需要脱敏。`.atk/traces/` 会加入项目的 `.gitignore`。
142
+
143
+ ### 2. 分析并查看证据
144
+
145
+ ```text
146
+ $atk-trace-detect 分析 <session-id> 的任务结果是否正确,列出问题、证据和未检查的范围。
147
+ $atk-visualize-trace 打开 <session-id> 的执行泳道,从问题跳到相关轨迹片段和证据字段。
148
+ ```
149
+
150
+ 分析会列出问题、证据和检查范围。可用 Trace ID 定位会话内的证据。有归档轨迹即可生成预览,分享 HTML 前请核对其中留存的正文。
151
+
152
+ ### 3. 按问题调查、修复和验证(按需)
153
+
154
+ ```text
155
+ $atk-trace-diagnose 调查 <session-id> 的 ISSUE-001,给出修复和验证方案。
156
+ $atk-trace-optimize 实施 <session-id> 的 ISSUE-001 已选定的方案。
157
+ $atk-trace-verify 验证 <session-id> 的 ISSUE-001 对应候选,并检查相关正常行为。
158
+ ```
159
+
160
+ 已有明确问题和会话证据时,可以从调查开始。每次验证按问题保存结论。证据不足以确认实际加载的候选或关键验证条件时,效果记为 `inconclusive`(无法判断)。后续发现新的问题,可继续按问题处理,或用新会话的轨迹开始下一次分析。
161
+
162
+ ### 查看轨迹产物
163
+
164
+ 会话归档保存在 Agent 项目的 `.atk/traces/<session_id>/` 下,文件随对应步骤生成。
165
+
166
+ | 文件或目录 | 用途 |
167
+ | --- | --- |
168
+ | `session.json`、`raw/` | 查看来源、采集范围、分析覆盖和保留的轨迹 |
169
+ | `preview.html` | 离线浏览:左侧问题栏、上方泳道、下方 Event;按 Issue 片段定位证据 |
170
+ | `issues/<issue-id>/` | 查看问题证据、诊断和改动。各次验证的 `result.json` 记录验证状态、结论和证据引用 |
171
+
172
+ [轨迹调优指南,包含来源配置、支持格式和归档结构](docs/trace-tuning.md)
@@ -1,3 +1,3 @@
1
1
  """Agent Tune Kit package."""
2
2
 
3
- __version__ = "2.2.1"
3
+ __version__ = "2.3.0"
@@ -7,10 +7,10 @@ from agent_tune_kit import installer
7
7
  from agent_tune_kit.errors import UserActionRequired
8
8
  from agent_tune_kit.execution.runtime import ExecutionFailed
9
9
 
10
- from . import dataset, evaluation, results, visualize
10
+ from . import dataset, evaluation, results, trace, visualize
11
11
  from .output import emit
12
12
 
13
- HANDLERS = {"dataset": dataset, "eval": evaluation, "results": results, "visualize": visualize}
13
+ HANDLERS = {"dataset": dataset, "eval": evaluation, "results": results, "visualize": visualize, "trace": trace}
14
14
 
15
15
 
16
16
  def main(argv=None):