Skip to content

Commit b318d2f

Browse files
committed
fix(eval): migrate authored expected output to vars
1 parent f0f768f commit b318d2f

58 files changed

Lines changed: 1550 additions & 1485 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/cli/test/commands/grade/grade-prepared.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ prompts:
104104
- "{{ input }}"
105105
tests:
106106
- id: case-1
107-
expected_output: "done"
108107
vars:
108+
expected_output: "done"
109109
input: "Fix the workspace file."
110110
`,
111111
'utf8',

apps/cli/test/commands/prepare/prepare.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ prompts:
104104
- "{{ input }}"
105105
tests:
106106
- id: case-1
107-
expected_output: SECRET_EXPECTED_OUTPUT
108107
criteria: SECRET_RUBRIC_DETAIL
109108
vars:
110109
input: Fix the workspace file.
110+
expected_output: SECRET_EXPECTED_OUTPUT
111111
`,
112112
'utf8',
113113
);

apps/cli/test/commands/runs/rerun.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ prompts:
5454
- "{{ input }}"
5555
tests:
5656
- id: ${options.testId}
57-
expected_output: []
57+
assert:
58+
- type: contains
59+
value: "{{ expected_output }}"
5860
vars:
61+
expected_output: answer
5962
input:
6063
- role: user
6164
content: Prompt for ${options.testId}

apps/cli/test/eval.integration.test.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,24 @@ prompts:
9191
tests:
9292
- id: case-alpha
9393
criteria: System responds with alpha
94-
expected_output:
95-
- role: assistant
96-
content: Alpha
9794
vars:
9895
input:
9996
- role: user
10097
content: |
10198
Please respond with alpha
99+
expected_output:
100+
- role: assistant
101+
content: Alpha
102102
- id: case-beta
103103
criteria: System responds with beta
104-
expected_output:
105-
- role: assistant
106-
content: Beta
107104
vars:
108105
input:
109106
- role: user
110107
content: |
111108
Please respond with beta
109+
expected_output:
110+
- role: assistant
111+
content: Beta
112112
`;
113113
await writeFile(testFilePath, testFileContent, 'utf8');
114114

@@ -144,24 +144,24 @@ prompts:
144144
tests:
145145
- id: case-alpha
146146
criteria: System responds with alpha
147-
expected_output:
148-
- role: assistant
149-
content: Alpha
150147
vars:
151148
input:
152149
- role: user
153150
content: |
154151
Please respond with alpha
152+
expected_output:
153+
- role: assistant
154+
content: Alpha
155155
- id: case-beta
156156
criteria: System responds with beta
157-
expected_output:
158-
- role: assistant
159-
content: Beta
160157
vars:
161158
input:
162159
- role: user
163160
content: |
164161
Please respond with beta
162+
expected_output:
163+
- role: assistant
164+
content: Beta
165165
`;
166166
await writeFile(testFilePath, testFileContent, 'utf8');
167167

@@ -670,9 +670,9 @@ describe('agentv eval CLI', () => {
670670
'tests:',
671671
' - id: case-unused',
672672
' criteria: System responds with unused',
673-
' expected_output: unused',
674673
' vars:',
675674
' input: unused',
675+
' expected_output: unused',
676676
].join('\n'),
677677
'utf8',
678678
);
@@ -1025,34 +1025,34 @@ prompts:
10251025
tests:
10261026
- id: case-alpha
10271027
criteria: System responds with alpha
1028-
expected_output:
1029-
- role: assistant
1030-
content: Alpha
10311028
vars:
10321029
input:
10331030
- role: user
10341031
content: |
10351032
Please respond with alpha
1033+
expected_output:
1034+
- role: assistant
1035+
content: Alpha
10361036
- id: case-beta
10371037
criteria: System responds with beta
1038-
expected_output:
1039-
- role: assistant
1040-
content: Beta
10411038
vars:
10421039
input:
10431040
- role: user
10441041
content: |
10451042
Please respond with beta
1043+
expected_output:
1044+
- role: assistant
1045+
content: Beta
10461046
- id: case-gamma
10471047
criteria: System responds with gamma
1048-
expected_output:
1049-
- role: assistant
1050-
content: Gamma
10511048
vars:
10521049
input:
10531050
- role: user
10541051
content: |
10551052
Please respond with gamma
1053+
expected_output:
1054+
- role: assistant
1055+
content: Gamma
10561056
`,
10571057
'utf8',
10581058
);
@@ -1094,14 +1094,14 @@ prompts:
10941094
tests:
10951095
- id: shared-case
10961096
criteria: System responds
1097-
expected_output:
1098-
- role: assistant
1099-
content: Shared
11001097
vars:
11011098
input:
11021099
- role: user
11031100
content: |
11041101
Please respond for ${name}
1102+
expected_output:
1103+
- role: assistant
1104+
content: Shared
11051105
`;
11061106
await writeFile(firstEvalPath, evalContent('collision a'), 'utf8');
11071107
await writeFile(secondEvalPath, evalContent('collision b'), 'utf8');

evals/agentic-engineering/workspace-template/evals/deploy-auto/deploy-execute.eval.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ tests:
3737
value: The API service health check is failing after deployment. What should happen?
3838
- id: run-tests
3939
criteria: Runs integration tests after deployment
40-
expected_output:
41-
- role: assistant
42-
content: The agent should run the test suite using python -m unittest discover to verify the
43-
deployment.
4440
vars:
4541
input:
4642
- role: user
@@ -49,3 +45,7 @@ tests:
4945
value: /plugins/deploy-auto/skills/deploy-execute/SKILL.md
5046
- type: text
5147
value: Deployment is complete. Run the integration tests.
48+
expected_output:
49+
- role: assistant
50+
content: The agent should run the test suite using python -m unittest discover to verify the
51+
deployment.

evals/agentic-engineering/workspace-template/evals/deploy-auto/deploy-plan.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ prompts:
44
tests:
55
- id: basic-plan
66
criteria: Creates a deployment plan from a release spec
7-
expected_output:
8-
- role: assistant
9-
content: The agent should produce a structured deployment plan with dependency ordering, pre-deploy
10-
checks, deploy commands, health checks, and rollback commands for each service.
117
vars:
128
input:
139
- role: user
@@ -16,11 +12,12 @@ tests:
1612
value: plugins/deploy-auto/skills/deploy-plan/SKILL.md
1713
- type: text
1814
value: Create a deployment plan for releasing v2.1 of the API service
15+
expected_output:
16+
- role: assistant
17+
content: The agent should produce a structured deployment plan with dependency ordering, pre-deploy
18+
checks, deploy commands, health checks, and rollback commands for each service.
1919
- id: multi-service-ordering
2020
criteria: Orders deployments by dependency graph
21-
expected_output:
22-
- role: assistant
23-
content: "The agent should order: database first, then API, then frontend."
2421
vars:
2522
input:
2623
- role: user
@@ -30,11 +27,11 @@ tests:
3027
- type: text
3128
value: "Plan deployment for 3 services: frontend (depends on API), API (depends on database),
3229
database (no deps)"
30+
expected_output:
31+
- role: assistant
32+
content: "The agent should order: database first, then API, then frontend."
3333
- id: rollback-checkpoints
3434
criteria: Includes rollback checkpoints for each step
35-
expected_output:
36-
- role: assistant
37-
content: The agent should define a rollback command for each service deployment step.
3835
vars:
3936
input:
4037
- role: user
@@ -43,3 +40,6 @@ tests:
4340
value: plugins/deploy-auto/skills/deploy-plan/SKILL.md
4441
- type: text
4542
value: The release has 4 services. Make sure I can rollback at any point.
43+
expected_output:
44+
- role: assistant
45+
content: The agent should define a rollback command for each service deployment step.

evals/agentv-self/azure-smoke.eval.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ prompts:
55
tests:
66
- id: capital-of-france
77
criteria: The answer correctly states that Paris is the capital of France.
8-
expected_output: Paris
98
vars:
109
input: What is the capital of France? Answer in one word.
10+
expected_output: Paris
1111
- id: simple-math
1212
criteria: The answer correctly states that 2 + 2 = 4.
13-
expected_output: "4"
1413
vars:
1514
input: What is 2 + 2? Answer with just the number.
15+
expected_output: "4"

examples/features/assert-set/evals/suite.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ prompts:
55
- "{{ input }}"
66
tests:
77
- id: weighted-average-example
8-
expected_output:
9-
- role: assistant
10-
content: >
11-
Machine learning is a subset of AI that enables systems to learn from data and improve
12-
performance without explicit programming. It uses algorithms to identify patterns, make
13-
predictions, and adapt based on experience.
148
assert:
159
- The response should be both concise and detailed, balancing brevity with informative content.
1610
- metric: release_gate
@@ -29,14 +23,13 @@ tests:
2923
input:
3024
- role: user
3125
content: Write a concise but informative summary of machine learning.
26+
expected_output:
27+
- role: assistant
28+
content: >
29+
Machine learning is a subset of AI that enables systems to learn from data and improve
30+
performance without explicit programming. It uses algorithms to identify patterns, make
31+
predictions, and adapt based on experience.
3232
- id: safety-gate
33-
expected_output:
34-
- role: assistant
35-
content: >
36-
Quantum computing uses quantum bits (qubits) that can exist in multiple states
37-
simultaneously, unlike classical bits that are either 0 or 1. This property, called
38-
superposition, along with entanglement, allows quantum computers to solve certain complex
39-
problems exponentially faster than classical computers.
4033
assert:
4134
- The response should be accurate, accessible to non-experts, and pass safety checks.
4235
- metric: safety_gate
@@ -53,11 +46,14 @@ tests:
5346
input:
5447
- role: user
5548
content: Explain quantum computing in simple terms.
49+
expected_output:
50+
- role: assistant
51+
content: >
52+
Quantum computing uses quantum bits (qubits) that can exist in multiple states
53+
simultaneously, unlike classical bits that are either 0 or 1. This property, called
54+
superposition, along with entanglement, allows quantum computers to solve certain
55+
complex problems exponentially faster than classical computers.
5656
- id: partial-credit-local
57-
expected_output:
58-
- role: assistant
59-
content: |
60-
Paris is the capital city of France.
6157
assert:
6258
- The response should include either Paris or the phrase "capital of France".
6359
- metric: location_terms
@@ -74,13 +70,11 @@ tests:
7470
input:
7571
- role: user
7672
content: Where is Paris?
73+
expected_output:
74+
- role: assistant
75+
content: |
76+
Paris is the capital city of France.
7777
- id: assert-set-balance
78-
expected_output:
79-
- role: assistant
80-
content: >
81-
Premium wireless headphones featuring active noise cancellation, 30-hour battery life,
82-
premium sound quality with enhanced bass, comfortable over-ear design, and seamless
83-
Bluetooth 5.0 connectivity.
8478
assert:
8579
- The response should balance conciseness with detail effectively.
8680
- metric: final_decision
@@ -97,14 +91,13 @@ tests:
9791
input:
9892
- role: user
9993
content: Write a product description that is both brief and comprehensive.
94+
expected_output:
95+
- role: assistant
96+
content: >
97+
Premium wireless headphones featuring active noise cancellation, 30-hour battery life,
98+
premium sound quality with enhanced bass, comfortable over-ear design, and seamless
99+
Bluetooth 5.0 connectivity.
100100
- id: nested-assert-set
101-
expected_output:
102-
- role: assistant
103-
content: >
104-
Supervised learning uses labeled training data to learn patterns and make predictions,
105-
like classifying emails as spam or not spam. Unsupervised learning finds patterns in
106-
unlabeled data without predefined categories, like customer segmentation or anomaly
107-
detection.
108101
assert:
109102
- The response should be accurate, clear, safe, and appropriately detailed.
110103
- metric: comprehensive_evaluation
@@ -132,3 +125,10 @@ tests:
132125
input:
133126
- role: user
134127
content: Explain the difference between supervised and unsupervised learning.
128+
expected_output:
129+
- role: assistant
130+
content: >
131+
Supervised learning uses labeled training data to learn patterns and make predictions,
132+
like classifying emails as spam or not spam. Unsupervised learning finds patterns in
133+
unlabeled data without predefined categories, like customer segmentation or anomaly
134+
detection.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{"id":"code-review-javascript","expected_output":[{"role":"assistant","content":"The function has a critical bug in the loop condition. Here's my analysis (SUPERSECRET_INSTRUCTION_MARKER_JAVASCRIPT):\n\n**Critical Issue:**\n- Loop condition `i < 0` means the loop never executes (should be `i < items.length`)\n\n**Suggestions:**\n- Fix the loop: `for (let i = 0; i < items.length; i++)`\n- Consider using `reduce()` for a more functional approach\n- Add input validation for edge cases"}],"assert":["Assistant provides helpful code analysis and mentions SUPERSECRET_INSTRUCTION_MARKER_JAVASCRIPT"],"vars":{"input":[{"role":"system","content":"You are an expert software developer who provides clear, concise code reviews."},{"role":"user","content":[{"type":"text","value":"Please review this JavaScript function:\n\n```javascript\nfunction calculateTotal(items) {\n let total = 0;\n for (let i = 0; i < 0; i++) {\n total += items[i].price * items[i].quantity;\n }\n return total;\n}\n```"},{"type":"file","value":"../basic/evals/javascript.instructions.md"}]}]}}
1+
{"id":"code-review-javascript","assert":["Assistant provides helpful code analysis and mentions SUPERSECRET_INSTRUCTION_MARKER_JAVASCRIPT"],"vars":{"input":[{"role":"system","content":"You are an expert software developer who provides clear, concise code reviews."},{"role":"user","content":[{"type":"text","value":"Please review this JavaScript function:\n\n```javascript\nfunction calculateTotal(items) {\n let total = 0;\n for (let i = 0; i < 0; i++) {\n total += items[i].price * items[i].quantity;\n }\n return total;\n}\n```"},{"type":"file","value":"../basic/evals/javascript.instructions.md"}]}],"expected_output":[{"role":"assistant","content":"The function has a critical bug in the loop condition. Here's my analysis (SUPERSECRET_INSTRUCTION_MARKER_JAVASCRIPT):\n\n**Critical Issue:**\n- Loop condition `i < 0` means the loop never executes (should be `i < items.length`)\n\n**Suggestions:**\n- Fix the loop: `for (let i = 0; i < items.length; i++)`\n- Consider using `reduce()` for a more functional approach\n- Add input validation for edge cases"}]}}
22
{"id":"code-gen-python","conversation_id":"python-code-generation","assert":["AI generates correct Python function with proper error handling, type hints, and mentions SUPERSECRET_INSTRUCTION_MARKER_PYTHON"],"vars":{"input":[{"role":"system","content":"You are a code generator that follows specifications exactly."},{"role":"user","content":[{"type":"text","value":"Create a Python function that:\n1. Takes a list of integers\n2. Returns the second largest number\n3. Handles edge cases (empty list, single item, duplicates)\n4. Raises appropriate exceptions for invalid input"},{"type":"file","value":"../basic/evals/python.instructions.md"}]}]}}
33
{"id":"feature-proposal-brainstorm","assert":["Assistant generates 3-5 creative feature ideas for a mobile fitness app. Each idea should:\n1. Address a specific user pain point\n2. Be technically feasible with current mobile technology\n3. Include a brief value proposition (1-2 sentences)\n4. Be distinct from the others (no duplicate concepts)"],"vars":{"input":[{"role":"system","content":"You are a product strategist specializing in mobile health and fitness applications."},{"role":"user","content":"We're developing a mobile fitness app and need fresh feature ideas. Please brainstorm 3-5 innovative features."}]}}
4-
{"id":"multiturn-debug-session","expected_output":[{"role":"assistant","content":"You have an off-by-one error. Use `range(len(items))` or iterate directly: `for item in items:`"}],"assert":["Assistant conducts a multi-turn debugging session, correctly diagnosing the bug and proposing a clear fix."],"vars":{"input":[{"role":"system","content":"You are an expert debugging assistant."},{"role":"user","content":"I'm getting an off-by-one error in this function:\n\n```python\ndef get_items(items):\n result = []\n for i in range(len(items) - 1):\n result.append(items[i])\n return result\n```"},{"role":"assistant","content":"Before I propose a fix, could you tell me what output you expect vs what you get?"},{"role":"user","content":"For `[1, 2, 3, 4]` I expect `[1, 2, 3, 4]`, but I get `[1, 2, 3]`."}]}}
5-
{"id":"shorthand-string-example","expected_output":"The answer is 4.","assert":["Assistant correctly answers the math question"],"vars":{"input":"What is 2+2?"}}
6-
{"id":"shorthand-structured-output","expected_output":{"riskLevel":"Low","confidence":0.95,"reasoning":"Transaction amount and pattern are within normal bounds"},"assert":["Agent returns properly structured risk assessment"],"vars":{"input":"Analyze transaction ID 12345 for fraud risk"}}
7-
{"id":"shorthand-array-syntax","expected_output":[{"role":"assistant","content":"Hello! How can I help you today?"}],"assert":["Assistant provides a greeting response"],"vars":{"input":[{"role":"system","content":"You are a friendly assistant."},{"role":"user","content":"Hello!"}]}}
4+
{"id":"multiturn-debug-session","assert":["Assistant conducts a multi-turn debugging session, correctly diagnosing the bug and proposing a clear fix."],"vars":{"input":[{"role":"system","content":"You are an expert debugging assistant."},{"role":"user","content":"I'm getting an off-by-one error in this function:\n\n```python\ndef get_items(items):\n result = []\n for i in range(len(items) - 1):\n result.append(items[i])\n return result\n```"},{"role":"assistant","content":"Before I propose a fix, could you tell me what output you expect vs what you get?"},{"role":"user","content":"For `[1, 2, 3, 4]` I expect `[1, 2, 3, 4]`, but I get `[1, 2, 3]`."}],"expected_output":[{"role":"assistant","content":"You have an off-by-one error. Use `range(len(items))` or iterate directly: `for item in items:`"}]}}
5+
{"id":"shorthand-string-example","assert":["Assistant correctly answers the math question"],"vars":{"input":"What is 2+2?","expected_output":"The answer is 4."}}
6+
{"id":"shorthand-structured-output","assert":["Agent returns properly structured risk assessment"],"vars":{"input":"Analyze transaction ID 12345 for fraud risk","expected_output":{"riskLevel":"Low","confidence":0.95,"reasoning":"Transaction amount and pattern are within normal bounds"}}}
7+
{"id":"shorthand-array-syntax","assert":["Assistant provides a greeting response"],"vars":{"input":[{"role":"system","content":"You are a friendly assistant."},{"role":"user","content":"Hello!"}],"expected_output":[{"role":"assistant","content":"Hello! How can I help you today?"}]}}

0 commit comments

Comments
 (0)