oh-my-promptfoo 1.15.0 → 1.16.0-next.78

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/README.md CHANGED
@@ -9,6 +9,7 @@ independent assertion for named semantic criteria.
9
9
  | Isolated workspace with pinned Git, OCI artifact, or trusted local-directory sources | `package:oh-my-promptfoo:Provider` |
10
10
  | Copilot in a directory managed by the caller | `package:oh-my-promptfoo:CopilotSdkProvider` |
11
11
  | One judge request for named rubric criteria | `package:oh-my-promptfoo/assertions:llmAssert` |
12
+ | Inspect the candidate workspace with an agent judge | `package:oh-my-promptfoo/assertions:agentAssert` |
12
13
 
13
14
  ## Install
14
15
 
@@ -100,6 +101,62 @@ It reports the judge call's token usage back to Promptfoo, which records it unde
100
101
  grader that returns no usage reports nothing rather than zero, so an unmeasured
101
102
  call is never summed into a run total as a free one.
102
103
 
104
+ ### Grade workspace changes with an agent
105
+
106
+ `agentAssert` uses the same named components, weights, scoring, threshold and
107
+ `rubricPrompt` contract, but verifies claims against the live case workspace.
108
+ Choose any supported delegate, including Copilot:
109
+
110
+ ```yaml
111
+ assert:
112
+ - type: javascript
113
+ value: package:oh-my-promptfoo/assertions:agentAssert
114
+ metric: workspace-change
115
+ config:
116
+ scoring: binary
117
+ grader:
118
+ id: copilot-sdk
119
+ config:
120
+ model: '{{env.GRADER_MODEL}}'
121
+ permissions: { filesystem: read, shell: deny, network: deny }
122
+ env:
123
+ GH_TOKEN: '{{env.GH_TOKEN}}'
124
+ components:
125
+ - metric: parser-fix-present
126
+ value: The workspace contains a focused fix in src/parser.ts for the reported bug.
127
+ - metric: no-unrelated-edits
128
+ value: No files outside src/parser.ts and its test were modified.
129
+ ```
130
+
131
+ Use this with the workspace `Provider`; a missing or released
132
+ `metadata.workspace.path` fails instead of falling back to the answer text.
133
+ Enable provider `fileChanges: true` to give the judge changed-file paths and
134
+ metadata plus the diff, not captured base64 contents. Files and the answer remain untrusted;
135
+ claims earn credit only when verified. Graders cannot write, run shell commands
136
+ or access the network through agent tools. They therefore cannot execute tests.
137
+ Model-service requests still require the delegate's credentials and network.
138
+
139
+ `maxPromptBytes` bounds the full assembled grader prompt in UTF-8 bytes,
140
+ including rules, criteria and evidence. The default is 131,072 bytes (128 KiB);
141
+ it accepts integers from 1 to 16,777,216. If the prompt is too large, the diff
142
+ is omitted with an explicit notice recording the omitted byte count. If the
143
+ remaining prompt still exceeds the budget, grading fails before a delegate
144
+ starts, naming both the measured size and budget. Files remain available for
145
+ on-demand inspection; increasing the budget never sends captured base64 bytes.
146
+
147
+ The grader has a 120-second execution timeout, configurable with assertion
148
+ `timeoutMs`, including one retry for a malformed verdict. It starts after the
149
+ grader session slot is acquired. A separate `queueTimeoutMs` bounds waiting
150
+ for that slot (default 15 minutes); both settings accept 1–3,600,000 ms.
151
+ Sessions serialize per process, independently of provider workers. Tokens are
152
+ accounted as assertion usage even when a billed attempt fails; reported cost is
153
+ preserved in `tokensUsed.cost`, although Promptfoo versions may not aggregate it.
154
+
155
+ Codex graders require API-key auth via `grader.config.apiKey` or explicit
156
+ `grader.env.OPENAI_API_KEY`. They do not load or copy ChatGPT `auth.json`, avoiding
157
+ single-use refresh-token corruption. See [ADR 0008](docs/adr/0008-agent-assert-workspace-grading.md)
158
+ for the live-workspace and resource-bound tradeoffs.
159
+
103
160
  ## Author and run an eval
104
161
 
105
162
  Start with the [agent-facing usage skill](https://github.com/allagentsdev/oh-my-promptfoo/blob/main/skills/oh-my-promptfoo/SKILL.md)