agent-tune-kit 2.2.0__tar.gz → 2.2.1__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.
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/.codex-plugin/plugin.json +1 -1
- agent_tune_kit-2.2.1/PKG-INFO +199 -0
- agent_tune_kit-2.2.1/README.en.md +185 -0
- agent_tune_kit-2.2.1/README.md +185 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/__init__.py +1 -1
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/evaluation.py +4 -2
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/runner.py +93 -29
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/runtime.py +2 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/results/summary.py +12 -1
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/codex_agent_tuning_prd.md +30 -57
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/shared-versioning-and-confirmation.md +37 -4
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/skill-template-pack-usage.md +5 -3
- agent_tune_kit-2.2.1/docs/surginame-atk-capability-review-2026-10-27.md +51 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/pyproject.toml +1 -1
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/validate_skill_pack.py +1 -1
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-eval/SKILL.md +6 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-init/SKILL.md +9 -5
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-report/SKILL.md +2 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/templates/.atk/runner/eval_runner.py.md +12 -1
- agent_tune_kit-2.2.1/tests/test_execution_outcomes.py +140 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_install_plugin.py +1 -1
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_release_scripts.py +1 -1
- agent_tune_kit-2.2.1/tests/test_runner_output_columns.py +115 -0
- agent_tune_kit-2.2.1/tests/test_snapshot_reads.py +63 -0
- agent_tune_kit-2.2.1/tests/test_v2_progress.py +45 -0
- agent_tune_kit-2.2.0/PKG-INFO +0 -237
- agent_tune_kit-2.2.0/README.en.md +0 -223
- agent_tune_kit-2.2.0/README.md +0 -227
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/.gitignore +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/__main__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/dataset.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/main.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/output.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/results.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/cli/visualize.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/datasets/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/datasets/prepare.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/datasets/truth.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/datasets/updates.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/datasets/validation.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/errors.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/calibration.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/logs.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/rules.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/execution/tracing.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/installer.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/results/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/results/assessment.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/results/evidence.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/results/judgments.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/results/versions.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/utils/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/utils/csv_io.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/utils/files.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/dataset/app.js +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/dataset/page.html +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/dataset/styles.css +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/dataset/vendor/echarts.min.js +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/failures/app.js +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/failures/page.html +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/assets/failures/styles.css +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/dataset.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/failures.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/fields.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/history.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/visualize/render.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/agent_tune_kit/workspace.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/assets/arch-en.png +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/assets/arch.png +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/assets/architecture.en.svg +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/assets/architecture.svg +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/cli-skill-modularization-plan.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/execution-evidence-and-tracing-plan.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/ground-truth-and-grading-assessment-2026-10-25.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/local-context.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/docs/truth-and-assessment.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/check-release.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/dev-refresh-install.sh +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/install_plugin.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/publish-pypi.sh +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/publish-release.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/release-version.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/scripts/release-version.sh +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-dataset/SKILL.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-dataset/scripts/update_dataset.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-diagnose/SKILL.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-optimize/SKILL.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-visualize-dataset/SKILL.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-visualize-dataset/scripts/generate_dataset_browser.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-visualize-failures/SKILL.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/skills/atk-visualize-failures/scripts/generate_failure_browser.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/templates/.atk/runner/failure_rule.py.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/templates/.atk/runner/import_evidence.py.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/templates/.gitkeep +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/__init__.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/conftest.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/fixtures/legacy_eval_runner.py.txt +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/fixtures/managed_v1.py.md +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_assessment_contract.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_atk_init_contract.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_cli_workflow.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_dataset_updates.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_diagnosis.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_evidence_import.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_evidence_judgments.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_evidence_packaging.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_evidence_versions.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_execution_evidence.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_execution_tracing.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_generate_dataset_browser.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_generate_failure_browser.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_judge_calibration.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_local_context.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_plugin_cache.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_runner_template_row_logging.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_runtime_contracts.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_truth_browser.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_truth_cli.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_truth_contract.py +0 -0
- {agent_tune_kit-2.2.0 → agent_tune_kit-2.2.1}/tests/test_truth_runner.py +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: agent-tune-kit
|
|
3
|
+
Version: 2.2.1
|
|
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
|
+
[](https://pypi.org/project/agent-tune-kit/)
|
|
20
|
+
|
|
21
|
+
Agent Tune Kit is a **local Codex plugin** that helps you evaluate an existing Agent, identify failures, and tune prompts, code, parameters, or tool configuration from the results.
|
|
22
|
+
|
|
23
|
+
Use it to prepare evaluation data, test your Agent in batches, review failures and reports, then check whether your changes help in the next evaluation. Each round keeps its results and tuning notes for review and comparison.
|
|
24
|
+
|
|
25
|
+
## Before You Start
|
|
26
|
+
|
|
27
|
+
- A local Agent project that Codex can read and edit, such as a chatbot, tool-using Agent, or RAG Agent.
|
|
28
|
+
- Evaluation data, preferably CSV; 5 to 20 examples are enough to start. If you have no dataset yet, start with business examples.
|
|
29
|
+
- A basis for judging results, such as expected answers, labels, or acceptance criteria.
|
|
30
|
+
|
|
31
|
+
## Install and Enable
|
|
32
|
+
|
|
33
|
+
Install ATK and its bundled Skills in your terminal:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
uv tool install agent-tune-kit
|
|
37
|
+
atk install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
In Codex, enter `/plugins`, select and enable `Agent Tune Kit`, then restart Codex and open a new session.
|
|
41
|
+
|
|
42
|
+
<details>
|
|
43
|
+
<summary>Other installation options: pipx or local source</summary>
|
|
44
|
+
|
|
45
|
+
With pipx:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
pipx install agent-tune-kit
|
|
49
|
+
atk install
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
From local source: update your chosen branch, then run these commands from the **ATK repository root**. Rerun them after source updates; changes are reinstalled even when the version is unchanged.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
uv tool install --reinstall .
|
|
56
|
+
atk install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
</details>
|
|
60
|
+
|
|
61
|
+
Finish active ATK tasks before reinstalling, and open a new session afterward to load updates. If installation fails, run `atk status` and see the [installation and cache notes](docs/skill-template-pack-usage.md#local-plugin-install-and-smoke). A successful check does not confirm that the plugin is enabled in your current session.
|
|
62
|
+
|
|
63
|
+
## Complete Your First Evaluation and Tuning Round
|
|
64
|
+
|
|
65
|
+
**Open your own Agent project in Codex**, then send the Skill instructions below. Installation commands run in a terminal; `$atk-…` instructions belong in your Codex conversation.
|
|
66
|
+
|
|
67
|
+
### 1. Prepare Data as Needed
|
|
68
|
+
|
|
69
|
+
Skip to the next step if you already have suitable data. To organize a dataset or fill gaps in evaluation criteria:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
$atk-dataset Prepare data/eval.csv for evaluation. Preserve existing fields and answers; fill only grounded gaps in the judgment criteria.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
You can also provide business examples or request a correction, such as changing the expected result for atk_id 7. Fixed column names and exported feedback files are not required. Answers without trustworthy support remain gaps rather than being invented.
|
|
76
|
+
|
|
77
|
+
Use `$atk-visualize-dataset` when you want a local page for browsing and reviewing data, then give feedback to `$atk-dataset`. Data preparation does not run the Agent.
|
|
78
|
+
|
|
79
|
+
### 2. Connect Your Agent
|
|
80
|
+
|
|
81
|
+
Tell Codex where your Agent entry point and evaluation data are:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
$atk-init My Agent entry point is scripts/agent.py and the evaluation dataset is data/eval.csv
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
Evaluation appends five reserved output columns: `agent_output`, `output_status`, `error_type`, `error_message`, and `log_path`. Managed V1/V2 adapters and `atk eval --check` reject name collisions before calling the Agent or allocating a result version; the error lists the dataset path and conflicting columns. For example, after confirming the change, rename a business `output_status` field to `review_status` and update adapter and judgment-rule references. ATK never renames fields or overwrites source values automatically; data preparation may still preserve these business columns unchanged. Old standalone runners need a separate check or migration to the shared engine.
|
|
90
|
+
|
|
91
|
+
### 3. Evaluate, Diagnose, and Read the Report
|
|
92
|
+
|
|
93
|
+
Send these instructions in order:
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
$atk-eval
|
|
97
|
+
$atk-diagnose
|
|
98
|
+
$atk-report
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| Instruction | What you get |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `$atk-eval` | Actual Agent outputs and execution records for each sample |
|
|
104
|
+
| `$atk-diagnose` | Passed, failed, or unknown judgments with reasons and an initial investigation of failures |
|
|
105
|
+
| `$atk-report` | Main issues, cause analysis, and tuning recommendations |
|
|
106
|
+
|
|
107
|
+
Use `$atk-visualize-failures` for a local offline page to search, filter, and review individual failures.
|
|
108
|
+
|
|
109
|
+
V2 shows start/completion progress by default, counting executions and scored samples separately for grouped cases. Progress goes to stderr so `--json` stdout remains valid JSON. Use `--no-progress` to suppress it; `--check` emits no execution progress.
|
|
110
|
+
|
|
111
|
+
**Unknown does not count as passed.** Missing answers, criteria, or valid judgment records cannot establish that the Agent behaved correctly.
|
|
112
|
+
|
|
113
|
+
### 4. Tune from the Results
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
$atk-optimize
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Codex uses the report and failures to edit your Agent's prompts, code, parameters, or tool configuration. It records why it made changes and what to verify next. Save your current code with Git before tuning so you can compare and restore it.
|
|
120
|
+
|
|
121
|
+
### Workflow
|
|
122
|
+
|
|
123
|
+

|
|
124
|
+
|
|
125
|
+
## Review Results and Verify Improvement
|
|
126
|
+
|
|
127
|
+
Each round saves results under `.atk/results/vN/` in your Agent project. Start with `report.md` for the main findings, use `failure_cases.html` to review individual failures, and read `tuning_plan.md` for the changes and their rationale.
|
|
128
|
+
|
|
129
|
+
After tuning, you can first rerun the previous round's confirmed failures:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
$atk-eval --only-failures
|
|
133
|
+
$atk-diagnose
|
|
134
|
+
$atk-report
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
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.
|
|
138
|
+
|
|
139
|
+
**Rerunning failures does not measure the full-dataset pass rate.** To check effects on other samples, run `$atk-eval` again, then diagnose and report for a full regression check. Changing data or evaluation criteria alone does not prove Agent improvement.
|
|
140
|
+
|
|
141
|
+
Execution summaries and `atk results inspect` expose `technical_failures` and `technical_failure_ids`, separately from business judgments. They count reported `output_status=error` rows; a V2 mapper must explicitly translate failures embedded in business outputs. ATK does not guess domain field meanings. Technical errors do not automatically become business failures or enter `--only-failures`.
|
|
142
|
+
|
|
143
|
+
Use `$atk-eval --ids 7 9` to revisit unknown or selected samples. Managed V1/V2 filter IDs in canonical dataset order before offset/limit; grouped adapters retain full case context. Missing IDs stop execution, and `--ids` is mutually exclusive with `--only-failures`. A selected rerun is not a full regression run.
|
|
144
|
+
|
|
145
|
+
### Complete Output Structure
|
|
146
|
+
|
|
147
|
+
This tree lists persistent evaluation outputs and optional files produced by the latest version. They appear as the corresponding steps and configuration require, rather than all being created at installation.
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
.atk/
|
|
151
|
+
├── context.md # Optional: agreed goals, standards, and human feedback
|
|
152
|
+
├── datasets/
|
|
153
|
+
│ ├── dataset.csv # Prepared data with sample IDs (atk_id)
|
|
154
|
+
│ ├── dataset.html # Optional dataset browser
|
|
155
|
+
│ └── dataset_review.csv # Optional: human-exported feedback placed here
|
|
156
|
+
├── runner/
|
|
157
|
+
│ ├── eval_runner.py # Agent adapter
|
|
158
|
+
│ └── failure_rule.py # Project judgment rule, generated as needed
|
|
159
|
+
└── results/
|
|
160
|
+
├── v1/
|
|
161
|
+
│ ├── eval_results.csv # Actual outputs and execution status per sample
|
|
162
|
+
│ ├── run.json # Round status and evidence index
|
|
163
|
+
│ ├── run-events.jsonl # As needed: events outside individual executions
|
|
164
|
+
│ ├── executions/
|
|
165
|
+
│ │ └── <execution-id>/ # One execution; may serve multiple samples
|
|
166
|
+
│ │ ├── execution.json
|
|
167
|
+
│ │ ├── input.json
|
|
168
|
+
│ │ ├── output.json
|
|
169
|
+
│ │ ├── context/
|
|
170
|
+
│ │ │ ├── samples.json
|
|
171
|
+
│ │ │ ├── environment.json
|
|
172
|
+
│ │ │ └── snapshot-<N>
|
|
173
|
+
│ │ ├── events.jsonl
|
|
174
|
+
│ │ ├── app.log
|
|
175
|
+
│ │ └── artifacts/ # Additional saved artifacts, as needed
|
|
176
|
+
│ ├── judgments.csv # Per-sample judgments and reasons
|
|
177
|
+
│ ├── judgment-history/ # Previous judgments saved on reassessment
|
|
178
|
+
│ │ └── <hash>.csv
|
|
179
|
+
│ ├── failure_cases.csv # Confirmed failures
|
|
180
|
+
│ ├── failure_cases.html # Optional failure browser
|
|
181
|
+
│ ├── report.md # Analysis and cross-round validation
|
|
182
|
+
│ └── tuning_plan.md # Tuning changes and verification targets
|
|
183
|
+
└── v2/
|
|
184
|
+
└── ... # Later rounds follow the applicable layout
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
| File or directory | When and why to use it |
|
|
188
|
+
| --- | --- |
|
|
189
|
+
| `datasets/dataset.csv`, `dataset.html` | Review inputs and expected results. The browser is optional; exported review CSVs can also be imported from Downloads |
|
|
190
|
+
| `context.md` | Optionally keep agreed goals, behavior standards, and feedback for future tuning; no manual run statistics are needed |
|
|
191
|
+
| `runner/` | Connect or adjust Agent invocation; Skills use these files during routine evaluation |
|
|
192
|
+
| `eval_results.csv` | Read source fields, actual `agent_output`, execution status `output_status`, and `log_path` |
|
|
193
|
+
| `judgments.csv`, `failure_cases.csv` | Read individual judgments and confirmed failures. Unknowns stay outside the failure set; reassessments preserve old records in `judgment-history/` |
|
|
194
|
+
| `report.md`, `failure_cases.html`, `tuning_plan.md` | Read analysis, review failures, inspect changes, and choose the next verification targets |
|
|
195
|
+
| `run.json`, `executions/`, `run-events.jsonl` | Investigate a run using saved status, inputs, outputs, context, events, and additional artifacts |
|
|
196
|
+
|
|
197
|
+
Within each execution, `context/` holds relevant samples, environment details, and snapshots such as the adapter file. `app.log` is a view of captured logs and may be empty. Detailed model and tool traces depend on project instrumentation; calls are not all recorded automatically.
|
|
198
|
+
|
|
199
|
+
Failed or interrupted executions may leave only partial files; a directory does not prove completion. Evidence-only imports may have no `eval_results.csv` and cannot be scored directly. Execution evidence can contain project data, so confirm retention and redaction needs during setup.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Agent Tune Kit
|
|
2
|
+
|
|
3
|
+
English | [简体中文](README.md)
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/agent-tune-kit/)
|
|
6
|
+
|
|
7
|
+
Agent Tune Kit is a **local Codex plugin** that helps you evaluate an existing Agent, identify failures, and tune prompts, code, parameters, or tool configuration from the results.
|
|
8
|
+
|
|
9
|
+
Use it to prepare evaluation data, test your Agent in batches, review failures and reports, then check whether your changes help in the next evaluation. Each round keeps its results and tuning notes for review and comparison.
|
|
10
|
+
|
|
11
|
+
## Before You Start
|
|
12
|
+
|
|
13
|
+
- A local Agent project that Codex can read and edit, such as a chatbot, tool-using Agent, or RAG Agent.
|
|
14
|
+
- Evaluation data, preferably CSV; 5 to 20 examples are enough to start. If you have no dataset yet, start with business examples.
|
|
15
|
+
- A basis for judging results, such as expected answers, labels, or acceptance criteria.
|
|
16
|
+
|
|
17
|
+
## Install and Enable
|
|
18
|
+
|
|
19
|
+
Install ATK and its bundled Skills in your terminal:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
uv tool install agent-tune-kit
|
|
23
|
+
atk install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
In Codex, enter `/plugins`, select and enable `Agent Tune Kit`, then restart Codex and open a new session.
|
|
27
|
+
|
|
28
|
+
<details>
|
|
29
|
+
<summary>Other installation options: pipx or local source</summary>
|
|
30
|
+
|
|
31
|
+
With pipx:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
pipx install agent-tune-kit
|
|
35
|
+
atk install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
From local source: update your chosen branch, then run these commands from the **ATK repository root**. Rerun them after source updates; changes are reinstalled even when the version is unchanged.
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
uv tool install --reinstall .
|
|
42
|
+
atk install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
47
|
+
Finish active ATK tasks before reinstalling, and open a new session afterward to load updates. If installation fails, run `atk status` and see the [installation and cache notes](docs/skill-template-pack-usage.md#local-plugin-install-and-smoke). A successful check does not confirm that the plugin is enabled in your current session.
|
|
48
|
+
|
|
49
|
+
## Complete Your First Evaluation and Tuning Round
|
|
50
|
+
|
|
51
|
+
**Open your own Agent project in Codex**, then send the Skill instructions below. Installation commands run in a terminal; `$atk-…` instructions belong in your Codex conversation.
|
|
52
|
+
|
|
53
|
+
### 1. Prepare Data as Needed
|
|
54
|
+
|
|
55
|
+
Skip to the next step if you already have suitable data. To organize a dataset or fill gaps in evaluation criteria:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
$atk-dataset Prepare data/eval.csv for evaluation. Preserve existing fields and answers; fill only grounded gaps in the judgment criteria.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You can also provide business examples or request a correction, such as changing the expected result for atk_id 7. Fixed column names and exported feedback files are not required. Answers without trustworthy support remain gaps rather than being invented.
|
|
62
|
+
|
|
63
|
+
Use `$atk-visualize-dataset` when you want a local page for browsing and reviewing data, then give feedback to `$atk-dataset`. Data preparation does not run the Agent.
|
|
64
|
+
|
|
65
|
+
### 2. Connect Your Agent
|
|
66
|
+
|
|
67
|
+
Tell Codex where your Agent entry point and evaluation data are:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
$atk-init My Agent entry point is scripts/agent.py and the evaluation dataset is data/eval.csv
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
Evaluation appends five reserved output columns: `agent_output`, `output_status`, `error_type`, `error_message`, and `log_path`. Managed V1/V2 adapters and `atk eval --check` reject name collisions before calling the Agent or allocating a result version; the error lists the dataset path and conflicting columns. For example, after confirming the change, rename a business `output_status` field to `review_status` and update adapter and judgment-rule references. ATK never renames fields or overwrites source values automatically; data preparation may still preserve these business columns unchanged. Old standalone runners need a separate check or migration to the shared engine.
|
|
76
|
+
|
|
77
|
+
### 3. Evaluate, Diagnose, and Read the Report
|
|
78
|
+
|
|
79
|
+
Send these instructions in order:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
$atk-eval
|
|
83
|
+
$atk-diagnose
|
|
84
|
+
$atk-report
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| Instruction | What you get |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| `$atk-eval` | Actual Agent outputs and execution records for each sample |
|
|
90
|
+
| `$atk-diagnose` | Passed, failed, or unknown judgments with reasons and an initial investigation of failures |
|
|
91
|
+
| `$atk-report` | Main issues, cause analysis, and tuning recommendations |
|
|
92
|
+
|
|
93
|
+
Use `$atk-visualize-failures` for a local offline page to search, filter, and review individual failures.
|
|
94
|
+
|
|
95
|
+
V2 shows start/completion progress by default, counting executions and scored samples separately for grouped cases. Progress goes to stderr so `--json` stdout remains valid JSON. Use `--no-progress` to suppress it; `--check` emits no execution progress.
|
|
96
|
+
|
|
97
|
+
**Unknown does not count as passed.** Missing answers, criteria, or valid judgment records cannot establish that the Agent behaved correctly.
|
|
98
|
+
|
|
99
|
+
### 4. Tune from the Results
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
$atk-optimize
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Codex uses the report and failures to edit your Agent's prompts, code, parameters, or tool configuration. It records why it made changes and what to verify next. Save your current code with Git before tuning so you can compare and restore it.
|
|
106
|
+
|
|
107
|
+
### Workflow
|
|
108
|
+
|
|
109
|
+

|
|
110
|
+
|
|
111
|
+
## Review Results and Verify Improvement
|
|
112
|
+
|
|
113
|
+
Each round saves results under `.atk/results/vN/` in your Agent project. Start with `report.md` for the main findings, use `failure_cases.html` to review individual failures, and read `tuning_plan.md` for the changes and their rationale.
|
|
114
|
+
|
|
115
|
+
After tuning, you can first rerun the previous round's confirmed failures:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
$atk-eval --only-failures
|
|
119
|
+
$atk-diagnose
|
|
120
|
+
$atk-report
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
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.
|
|
124
|
+
|
|
125
|
+
**Rerunning failures does not measure the full-dataset pass rate.** To check effects on other samples, run `$atk-eval` again, then diagnose and report for a full regression check. Changing data or evaluation criteria alone does not prove Agent improvement.
|
|
126
|
+
|
|
127
|
+
Execution summaries and `atk results inspect` expose `technical_failures` and `technical_failure_ids`, separately from business judgments. They count reported `output_status=error` rows; a V2 mapper must explicitly translate failures embedded in business outputs. ATK does not guess domain field meanings. Technical errors do not automatically become business failures or enter `--only-failures`.
|
|
128
|
+
|
|
129
|
+
Use `$atk-eval --ids 7 9` to revisit unknown or selected samples. Managed V1/V2 filter IDs in canonical dataset order before offset/limit; grouped adapters retain full case context. Missing IDs stop execution, and `--ids` is mutually exclusive with `--only-failures`. A selected rerun is not a full regression run.
|
|
130
|
+
|
|
131
|
+
### Complete Output Structure
|
|
132
|
+
|
|
133
|
+
This tree lists persistent evaluation outputs and optional files produced by the latest version. They appear as the corresponding steps and configuration require, rather than all being created at installation.
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
.atk/
|
|
137
|
+
├── context.md # Optional: agreed goals, standards, and human feedback
|
|
138
|
+
├── datasets/
|
|
139
|
+
│ ├── dataset.csv # Prepared data with sample IDs (atk_id)
|
|
140
|
+
│ ├── dataset.html # Optional dataset browser
|
|
141
|
+
│ └── dataset_review.csv # Optional: human-exported feedback placed here
|
|
142
|
+
├── runner/
|
|
143
|
+
│ ├── eval_runner.py # Agent adapter
|
|
144
|
+
│ └── failure_rule.py # Project judgment rule, generated as needed
|
|
145
|
+
└── results/
|
|
146
|
+
├── v1/
|
|
147
|
+
│ ├── eval_results.csv # Actual outputs and execution status per sample
|
|
148
|
+
│ ├── run.json # Round status and evidence index
|
|
149
|
+
│ ├── run-events.jsonl # As needed: events outside individual executions
|
|
150
|
+
│ ├── executions/
|
|
151
|
+
│ │ └── <execution-id>/ # One execution; may serve multiple samples
|
|
152
|
+
│ │ ├── execution.json
|
|
153
|
+
│ │ ├── input.json
|
|
154
|
+
│ │ ├── output.json
|
|
155
|
+
│ │ ├── context/
|
|
156
|
+
│ │ │ ├── samples.json
|
|
157
|
+
│ │ │ ├── environment.json
|
|
158
|
+
│ │ │ └── snapshot-<N>
|
|
159
|
+
│ │ ├── events.jsonl
|
|
160
|
+
│ │ ├── app.log
|
|
161
|
+
│ │ └── artifacts/ # Additional saved artifacts, as needed
|
|
162
|
+
│ ├── judgments.csv # Per-sample judgments and reasons
|
|
163
|
+
│ ├── judgment-history/ # Previous judgments saved on reassessment
|
|
164
|
+
│ │ └── <hash>.csv
|
|
165
|
+
│ ├── failure_cases.csv # Confirmed failures
|
|
166
|
+
│ ├── failure_cases.html # Optional failure browser
|
|
167
|
+
│ ├── report.md # Analysis and cross-round validation
|
|
168
|
+
│ └── tuning_plan.md # Tuning changes and verification targets
|
|
169
|
+
└── v2/
|
|
170
|
+
└── ... # Later rounds follow the applicable layout
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
| File or directory | When and why to use it |
|
|
174
|
+
| --- | --- |
|
|
175
|
+
| `datasets/dataset.csv`, `dataset.html` | Review inputs and expected results. The browser is optional; exported review CSVs can also be imported from Downloads |
|
|
176
|
+
| `context.md` | Optionally keep agreed goals, behavior standards, and feedback for future tuning; no manual run statistics are needed |
|
|
177
|
+
| `runner/` | Connect or adjust Agent invocation; Skills use these files during routine evaluation |
|
|
178
|
+
| `eval_results.csv` | Read source fields, actual `agent_output`, execution status `output_status`, and `log_path` |
|
|
179
|
+
| `judgments.csv`, `failure_cases.csv` | Read individual judgments and confirmed failures. Unknowns stay outside the failure set; reassessments preserve old records in `judgment-history/` |
|
|
180
|
+
| `report.md`, `failure_cases.html`, `tuning_plan.md` | Read analysis, review failures, inspect changes, and choose the next verification targets |
|
|
181
|
+
| `run.json`, `executions/`, `run-events.jsonl` | Investigate a run using saved status, inputs, outputs, context, events, and additional artifacts |
|
|
182
|
+
|
|
183
|
+
Within each execution, `context/` holds relevant samples, environment details, and snapshots such as the adapter file. `app.log` is a view of captured logs and may be empty. Detailed model and tool traces depend on project instrumentation; calls are not all recorded automatically.
|
|
184
|
+
|
|
185
|
+
Failed or interrupted executions may leave only partial files; a directory does not prove completion. Evidence-only imports may have no `eval_results.csv` and cannot be scored directly. Execution evidence can contain project data, so confirm retention and redaction needs during setup.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Agent Tune Kit
|
|
2
|
+
|
|
3
|
+
简体中文 | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/agent-tune-kit/)
|
|
6
|
+
|
|
7
|
+
Agent Tune Kit 是一个**本地 Codex 插件**,帮助你评测已有 Agent、找出失败原因,并根据结果调优 prompt、代码、参数或工具配置。
|
|
8
|
+
|
|
9
|
+
你可以用它整理评测数据、批量测试 Agent、查看失败样本和分析报告,再通过下一轮评测验证改动是否有效。每轮结果和调优记录都会保留,便于回看与比较。
|
|
10
|
+
|
|
11
|
+
## 开始前准备什么
|
|
12
|
+
|
|
13
|
+
- 一个 Codex 可以读取和修改的本地 Agent 项目,例如聊天机器人、工具调用 Agent 或 RAG Agent。
|
|
14
|
+
- 一份评测数据,推荐 CSV,5 到 20 条样例就能开始;没有现成数据也可以先提供业务示例。
|
|
15
|
+
- 判断结果好坏的依据,例如期望答案、标签或可验收的行为标准。
|
|
16
|
+
|
|
17
|
+
## 安装与启用
|
|
18
|
+
|
|
19
|
+
在终端安装 ATK 和配套 Skills:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
uv tool install agent-tune-kit
|
|
23
|
+
atk install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
在 Codex 中输入 `/plugins`,选择并启用 `Agent Tune Kit`,然后重启 Codex 并新建会话。
|
|
27
|
+
|
|
28
|
+
<details>
|
|
29
|
+
<summary>其他安装方式:pipx 或本地源码</summary>
|
|
30
|
+
|
|
31
|
+
使用 pipx:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
pipx install agent-tune-kit
|
|
35
|
+
atk install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
使用本地源码:更新所需分支的代码后,在 **ATK 仓库根目录**运行以下命令;后续更新源码时重新执行即可,同版本改动也会重新安装。
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
uv tool install --reinstall .
|
|
42
|
+
atk install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
47
|
+
重装前请先结束正在运行的 ATK 任务,安装后新建会话以加载更新。安装有问题时可运行 `atk status` 检查,并参考[安装与缓存说明](docs/skill-template-pack-usage.md#local-plugin-install-and-smoke);检查通过不代表插件已在当前会话启用。
|
|
48
|
+
|
|
49
|
+
## 完成第一轮评测与调优
|
|
50
|
+
|
|
51
|
+
**在 Codex 中打开你自己的 Agent 项目**,再发送下面的 Skill 指令。安装命令在终端运行,`$atk-…` 指令在 Codex 对话中使用。
|
|
52
|
+
|
|
53
|
+
### 1. 准备数据(按需)
|
|
54
|
+
|
|
55
|
+
已有合适的数据可以直接进入下一步。需要整理数据或补充评测标准时:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
$atk-dataset 使用 data/eval.csv 准备评测数据,保留原字段和已有答案,只补充缺失且有依据的判断标准。
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
也可以提供业务示例,或直接提出修订,例如“修改 atk_id 为 7 的预期结果”。无需固定列名,也无需先导出反馈文件。缺少可信依据的答案会保留为空缺,不会编造。
|
|
62
|
+
|
|
63
|
+
需要人工浏览和复核时,可使用 `$atk-visualize-dataset` 生成本地数据浏览页,再把反馈交给 `$atk-dataset`。准备数据不会运行 Agent。
|
|
64
|
+
|
|
65
|
+
### 2. 接入 Agent
|
|
66
|
+
|
|
67
|
+
告诉 Codex 你的 Agent 入口和评测数据位置:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
$atk-init 我的 Agent 入口是 scripts/agent.py,评测数据是 data/eval.csv
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Codex 会读取项目、准备接入文件并整理可运行的数据集。已经完成接入且仍兼容时,可直接开始评测。
|
|
74
|
+
|
|
75
|
+
评测会追加 `agent_output`、`output_status`、`error_type`、`error_message`、`log_path` 五个保留输出列。共享引擎的 V1/V2 接入及 `atk eval --check` 都会在调用 Agent、创建结果版本前检查重名,报错会列出数据集路径和冲突列。例如,业务中的 `output_status` 可在确认后改为 `review_status`,并同步适配器和判定规则的字段引用。ATK 不会自动改名或覆盖原值;数据准备阶段仍可原样保留这些业务字段。旧的自管 runner 需单独核对或迁移到共享引擎。
|
|
76
|
+
|
|
77
|
+
### 3. 评测、诊断并查看报告
|
|
78
|
+
|
|
79
|
+
依次发送:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
$atk-eval
|
|
83
|
+
$atk-diagnose
|
|
84
|
+
$atk-report
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| 指令 | 你会得到什么 |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| `$atk-eval` | 每条样本的 Agent 实际输出和执行记录 |
|
|
90
|
+
| `$atk-diagnose` | 通过、失败、未判定的结果及理由,以及失败原因的初步定位 |
|
|
91
|
+
| `$atk-report` | 本轮主要问题、原因分析和调优建议 |
|
|
92
|
+
|
|
93
|
+
需要逐条搜索、筛选和复核失败样本时,使用 `$atk-visualize-failures` 生成本地离线浏览页。
|
|
94
|
+
|
|
95
|
+
V2 执行时默认显示开始和完成进度,分别统计执行项与评分样本,避免把一个多样本病例算成一条。进度写到 stderr,`--json` 的 stdout 保持完整 JSON;可用 `--no-progress` 关闭进度,`--check` 不输出执行进度。
|
|
96
|
+
|
|
97
|
+
**未判定不算通过。** 缺少答案、判断依据或有效判定记录时,不能据此认为 Agent 表现正确。
|
|
98
|
+
|
|
99
|
+
### 4. 根据结果调优
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
$atk-optimize
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Codex 会根据报告和失败样本修改 Agent 的 prompt、代码、参数或工具配置,并记录改动原因和下一轮需要验证的问题。建议在调优前用 Git 保存当前代码,方便比较和恢复。
|
|
106
|
+
|
|
107
|
+
### 使用流程
|
|
108
|
+
|
|
109
|
+

|
|
110
|
+
|
|
111
|
+
## 查看结果与验证改善
|
|
112
|
+
|
|
113
|
+
每轮结果保存在 Agent 项目的 `.atk/results/vN/` 下。优先查看 `report.md` 了解主要问题,用 `failure_cases.html` 复核具体失败,用 `tuning_plan.md` 查看调优改动及其原因。
|
|
114
|
+
|
|
115
|
+
调优后,可以先重跑上一轮已确认的失败样本:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
$atk-eval --only-failures
|
|
119
|
+
$atk-diagnose
|
|
120
|
+
$atk-report
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
已有非空结果目录不会被下一轮评测覆盖。从第二轮开始,如果上一轮有调优记录且实验条件可比,报告会说明目标问题已解决、部分解决、未解决,还是无法判断。
|
|
124
|
+
|
|
125
|
+
**只重跑失败样本不能代表全量通过率。** 需要确认改动是否影响其他样本时,再运行 `$atk-eval` 并继续诊断、报告,完成全量回归。修改数据或评测标准本身,也不能证明 Agent 改善。
|
|
126
|
+
|
|
127
|
+
超时等技术失败与业务判定分开统计:运行摘要和 `atk results inspect` 提供 `technical_failures` 与 `technical_failure_ids`。它们只统计适配器已上报的 `output_status=error`;业务输出内部的失败需要 V2 mapper 显式映射,默认不会猜测字段含义。技术失败不会自动写成业务 failed,也不会自动进入 `--only-failures`。
|
|
128
|
+
|
|
129
|
+
要补测 unknown 或指定样本,可用 `$atk-eval --ids 7 9`。共享 V1/V2 按 canonical 数据集顺序筛选 ID,再应用 offset/limit;分组适配器仍保留完整病例上下文。未知 ID 会停止,`--ids` 与 `--only-failures` 不能同时使用;局部补测不代表完整回归。
|
|
130
|
+
|
|
131
|
+
### 完整输出结构
|
|
132
|
+
|
|
133
|
+
下面列出最新版本评测流程中持续保存的正式产物及可选文件。它们随对应步骤和配置生成,不会在安装后一次性出现。
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
.atk/
|
|
137
|
+
├── context.md # 可选:已确认的调优目标、标准和人工反馈
|
|
138
|
+
├── datasets/
|
|
139
|
+
│ ├── dataset.csv # 整理后的评测数据,包含样本标识 atk_id
|
|
140
|
+
│ ├── dataset.html # 可选:数据集浏览页
|
|
141
|
+
│ └── dataset_review.csv # 可选:人工导出并放回此处的复核反馈
|
|
142
|
+
├── runner/
|
|
143
|
+
│ ├── eval_runner.py # Agent 接入文件
|
|
144
|
+
│ └── failure_rule.py # 按需生成:项目判定规则
|
|
145
|
+
└── results/
|
|
146
|
+
├── v1/
|
|
147
|
+
│ ├── eval_results.csv # 每条样本的实际输出与执行状态
|
|
148
|
+
│ ├── run.json # 本轮执行状态与证据索引
|
|
149
|
+
│ ├── run-events.jsonl # 按需生成:未归属到单次执行的事件
|
|
150
|
+
│ ├── executions/
|
|
151
|
+
│ │ └── <execution-id>/ # 一次执行;可能关联多条样本
|
|
152
|
+
│ │ ├── execution.json
|
|
153
|
+
│ │ ├── input.json
|
|
154
|
+
│ │ ├── output.json
|
|
155
|
+
│ │ ├── context/
|
|
156
|
+
│ │ │ ├── samples.json
|
|
157
|
+
│ │ │ ├── environment.json
|
|
158
|
+
│ │ │ └── snapshot-<N>
|
|
159
|
+
│ │ ├── events.jsonl
|
|
160
|
+
│ │ ├── app.log
|
|
161
|
+
│ │ └── artifacts/ # 按需生成:额外保存的产物
|
|
162
|
+
│ ├── judgments.csv # 每条样本的判定及理由
|
|
163
|
+
│ ├── judgment-history/ # 重判时保留的历史判定
|
|
164
|
+
│ │ └── <hash>.csv
|
|
165
|
+
│ ├── failure_cases.csv # 已确认失败的样本
|
|
166
|
+
│ ├── failure_cases.html # 可选:失败样本浏览页
|
|
167
|
+
│ ├── report.md # 本轮分析与跨轮验证
|
|
168
|
+
│ └── tuning_plan.md # 本轮调优改动及验证目标
|
|
169
|
+
└── v2/
|
|
170
|
+
└── ... # 后续轮次沿用相应结构
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
| 文件或目录 | 什么时候看、用来做什么 |
|
|
174
|
+
| --- | --- |
|
|
175
|
+
| `datasets/dataset.csv`、`dataset.html` | 检查测试输入和期望结果;浏览页按需生成,导出的复核 CSV 也可以从下载目录导入 |
|
|
176
|
+
| `context.md` | 可选保存已经确认的目标、行为标准和反馈,供后续调优复用;不需要手工维护运行统计 |
|
|
177
|
+
| `runner/` | 接入或调整 Agent 调用方式时使用,日常评测由 Skills 调用 |
|
|
178
|
+
| `eval_results.csv` | 查看样本原始字段、实际输出 `agent_output`、执行状态 `output_status` 和日志位置 `log_path` |
|
|
179
|
+
| `judgments.csv`、`failure_cases.csv` | 查看逐条判定和确认失败的样本;未判定不进入失败集,重判时旧记录保存在 `judgment-history/` |
|
|
180
|
+
| `report.md`、`failure_cases.html`、`tuning_plan.md` | 阅读分析、复核失败、检查改动,再确定下一轮验证目标 |
|
|
181
|
+
| `run.json`、`executions/`、`run-events.jsonl` | 需要排查某次运行时查看;保存状态、输入输出、上下文、事件和额外产物 |
|
|
182
|
+
|
|
183
|
+
执行目录中的 `context/` 保存相关样本、运行环境和接入文件等快照;`app.log` 是已采集日志的浏览视图,可能为空。模型和工具调用的详细轨迹取决于项目是否接入采集,并非所有调用都会自动记录。
|
|
184
|
+
|
|
185
|
+
执行失败或中断时,可能只有部分文件;有目录不等于运行完成。仅导入证据的轮次可能没有 `eval_results.csv`,也不能直接用于评分。执行证据可能包含项目数据,接入时应确认需要保留或脱敏的内容。
|
|
@@ -7,7 +7,9 @@ def register(subparsers):
|
|
|
7
7
|
parser.add_argument("--limit", type=int)
|
|
8
8
|
parser.add_argument("--offset", type=int, default=0)
|
|
9
9
|
parser.add_argument("--concurrency", type=int, default=1)
|
|
10
|
-
parser.
|
|
10
|
+
selection = parser.add_mutually_exclusive_group()
|
|
11
|
+
selection.add_argument("--only-failures", action="store_true")
|
|
12
|
+
selection.add_argument("--ids", nargs="+", help="select canonical samples by stable atk_id before offset/limit")
|
|
11
13
|
parser.add_argument("--no-progress", action="store_true")
|
|
12
14
|
parser.add_argument("--python")
|
|
13
15
|
parser.add_argument("--json", action="store_true")
|
|
@@ -17,6 +19,6 @@ def execute(args):
|
|
|
17
19
|
return run_evaluation(
|
|
18
20
|
**{
|
|
19
21
|
key: getattr(args, key)
|
|
20
|
-
for key in ["check", "limit", "offset", "concurrency", "only_failures", "no_progress", "python"]
|
|
22
|
+
for key in ["check", "limit", "offset", "concurrency", "only_failures", "ids", "no_progress", "python"]
|
|
21
23
|
}
|
|
22
24
|
)
|