agentv 0.17.0 → 0.19.0

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.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-KL3Y2C6J.js";
4
+ } from "./chunk-EJTXU5JO.js";
5
5
  import "./chunk-UE4GLFVL.js";
6
6
 
7
7
  // src/cli.ts
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createProgram,
3
3
  runCli
4
- } from "./chunk-KL3Y2C6J.js";
4
+ } from "./chunk-EJTXU5JO.js";
5
5
  import "./chunk-UE4GLFVL.js";
6
6
  export {
7
7
  createProgram,
@@ -21,41 +21,48 @@ description: Iteratively optimize prompt files against AgentV evaluation dataset
21
21
  - If not, create a new one in the parent directory of the eval files: `optimization-[timestamp].md`.
22
22
  - Read content of the identified prompt file.
23
23
 
24
- 2. **Optimization Loop** (Max 5 iterations)
25
- - **Execute (The Generator)**: Run `pnpm agentv eval <eval-path>`.
24
+ 2. **Optimization Loop** (Max 10 iterations)
25
+ - **Execute (The Generator)**: Run `agentv eval <eval-path>`.
26
+ - *Targeted Run*: If iterating on specific stubborn failures, use `--eval-id <case_id>` to run only the relevant eval cases.
26
27
  - **Analyze (The Reflector)**:
27
28
  - Locate the results file path from the console output (e.g., `.agentv/results/eval_...jsonl`).
28
- - Read the results file. Calculate pass rate.
29
- - **Root Cause Analysis**: For each failure, perform a deep dive:
30
- - **Error Identification**: What exactly went wrong? (e.g., "Predicted 'High' but expected 'Low'")
31
- - **Root Cause**: Why did it happen? (e.g., "Ambiguous definition of 'High' severity", "Hallucinated a constraint", "Incorrect test expectation")
32
- - **Correct Approach**: What *should* the model have done?
33
- - **Key Insight**: What general rule or pattern can we learn from this?
34
- - **Regression Check**: Did this change break previously passing tests? If so, mark the previous change as "Harmful".
29
+ - **Orchestrate Subagent**: Use `runSubagent` to analyze the results.
30
+ - **Task**: Read the results file, calculate pass rate, and perform root cause analysis.
31
+ - **Output**: Return a structured analysis including:
32
+ - **Score**: Current pass rate.
33
+ - **Root Cause**: Why failures occurred (e.g., "Ambiguous definition", "Hallucination").
34
+ - **Insight**: Key learning or pattern identified from the failures.
35
+ - **Strategy**: High-level plan to fix the prompt (e.g., "Clarify section X", "Add negative constraint").
35
36
  - **Decide**:
36
37
  - If **100% pass**: STOP and report success.
37
38
  - If **Score decreased**: Revert last change, try different approach.
38
39
  - If **No improvement** (2x): STOP and report stagnation.
39
- - **Log Result**:
40
- - Append the result of this iteration to the identified optimization log file.
41
- - **Format**:
42
- ```markdown
43
- ### Iteration [N]
44
- - **Change**: [Description of edit]
45
- - **Rationale**: [Root Cause / Why this fix was chosen]
46
- - **Outcome**: [Success / Failure / Harmful] (Score: X% -> Y%)
47
- - **Insight**: [Key learning or pattern identified]
48
- ```
49
40
  - **Refine (The Curator)**:
50
- - Modify the relevant `<prompt-file>` (pick the one most likely to be the root cause) to address failures.
51
- - **Strategy**: Treat the prompt as a structured set of rules and instructions.
52
- - **Clarify**: If ambiguous, make the existing instruction more specific.
53
- - **Add Rule**: If a constraint was missed, add a specific bullet point to the relevant section.
54
- - **Negative Constraint**: If hallucinating, explicitly state what NOT to do.
55
- - **Consolidate**: Check for redundant or overlapping instructions and merge them.
41
+ - **Orchestrate Subagent**: Use `runSubagent` to apply the fix.
42
+ - **Task**: Read the relevant prompt file(s), apply the **Strategy** from the Reflector, and generate the log entry.
43
+ - **Output**: The **Log Entry** describing the specific operation performed.
44
+ ```markdown
45
+ ### Iteration [N]
46
+ - **Operation**: [ADD / UPDATE / DELETE]
47
+ - **Target**: [Section Name]
48
+ - **Change**: [Specific text added/modified]
49
+ - **Trigger**: [Specific failing test case or error pattern]
50
+ - **Rationale**: [From Reflector: Root Cause]
51
+ - **Score**: [From Reflector: Current Pass Rate]
52
+ - **Insight**: [From Reflector: Key Learning]
53
+ ```
54
+ - **Strategy**: Treat the prompt as a structured set of rules. Execute atomic operations:
55
+ - **ADD**: Insert a new rule if a constraint was missed.
56
+ - **UPDATE**: Refine an existing rule to be clearer or more general.
57
+ - *Clarify*: Make ambiguous instructions specific.
58
+ - *Generalize*: Refactor specific fixes into high-level principles (First Principles).
59
+ - **DELETE**: Remove obsolete, redundant, or harmful rules.
60
+ - *Prune*: If a general rule covers specific cases, delete the specific ones.
61
+ - **Negative Constraint**: If hallucinating, explicitly state what NOT to do. Prefer generalized prohibitions over specific forbidden tokens where possible.
56
62
  - **Safety Check**: Ensure new rules don't contradict existing ones (unless intended).
57
63
  - **Constraint**: Avoid rewriting large sections. Make surgical, additive changes to preserve existing behavior.
58
- - **Apply**: Use `replace_string_in_file`.
64
+ - **Log Result**:
65
+ - Append the **Log Entry** returned by the Curator to the optimization log file.
59
66
 
60
67
  3. **Completion**
61
68
  - Report final score.
@@ -63,7 +70,8 @@ description: Iteratively optimize prompt files against AgentV evaluation dataset
63
70
  - **Finalize Optimization Log**: Add a summary header to the optimization log file indicating the session completion and final score.
64
71
 
65
72
  ## Guidelines
66
- - **Simplicity ("Less is More")**: Avoid adding specific rules for rare edge cases ("hotfixes"). Focus on universally applicable instructions.
73
+ - **Generalization First**: Prefer broad, principle-based guidelines over specific examples or "hotfixes". Only use specific rules if generalized instructions fail to achieve the desired score.
74
+ - **Simplicity ("Less is More")**: Avoid overfitting to the test set. If a specific rule doesn't significantly improve the score compared to a general one, choose the general one.
67
75
  - **Structure**: Maintain existing Markdown headers/sections.
68
76
  - **Progressive Disclosure**: If the prompt grows too large (>200 lines), consider moving specialized logic into a separate file or skill.
69
77
  - **Quality Criteria**: Ensure the prompt defines a clear persona, specific task, and measurable success criteria.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentv",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "CLI entry point for AgentV",
5
5
  "type": "module",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "test:coverage": "vitest run --coverage"
30
30
  },
31
31
  "dependencies": {
32
- "@agentv/core": "0.17.0",
32
+ "@agentv/core": "0.19.0",
33
33
  "commander": "^12.1.0",
34
34
  "fast-glob": "^3.3.3",
35
35
  "dotenv": "^16.4.5",