@ggui-ai/negotiator 0.1.0-rc.1
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/LICENSE +201 -0
- package/README.md +49 -0
- package/dist/contract-hash.d.ts +54 -0
- package/dist/contract-hash.d.ts.map +1 -0
- package/dist/contract-hash.js +96 -0
- package/dist/contract-validators.d.ts +171 -0
- package/dist/contract-validators.d.ts.map +1 -0
- package/dist/contract-validators.js +478 -0
- package/dist/decision-input.d.ts +48 -0
- package/dist/decision-input.d.ts.map +1 -0
- package/dist/decision-input.js +14 -0
- package/dist/decision.d.ts +54 -0
- package/dist/decision.d.ts.map +1 -0
- package/dist/decision.js +500 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/intent.d.ts +22 -0
- package/dist/intent.d.ts.map +1 -0
- package/dist/intent.js +28 -0
- package/dist/llm-caller.d.ts +70 -0
- package/dist/llm-caller.d.ts.map +1 -0
- package/dist/llm-caller.js +38 -0
- package/dist/llm-rerank.d.ts +101 -0
- package/dist/llm-rerank.d.ts.map +1 -0
- package/dist/llm-rerank.js +178 -0
- package/dist/negotiate.d.ts +141 -0
- package/dist/negotiate.d.ts.map +1 -0
- package/dist/negotiate.js +161 -0
- package/dist/normalize-schema.d.ts +22 -0
- package/dist/normalize-schema.d.ts.map +1 -0
- package/dist/normalize-schema.js +191 -0
- package/dist/pure.d.ts +30 -0
- package/dist/pure.d.ts.map +1 -0
- package/dist/pure.js +43 -0
- package/dist/rag-search.d.ts +73 -0
- package/dist/rag-search.d.ts.map +1 -0
- package/dist/rag-search.js +192 -0
- package/dist/rerank-eval/pairs.d.ts +28 -0
- package/dist/rerank-eval/pairs.d.ts.map +1 -0
- package/dist/rerank-eval/pairs.js +531 -0
- package/dist/rerank-eval/run-probe-cli.d.ts +3 -0
- package/dist/rerank-eval/run-probe-cli.d.ts.map +1 -0
- package/dist/rerank-eval/run-probe-cli.js +146 -0
- package/dist/rerank-eval/run-probe.d.ts +68 -0
- package/dist/rerank-eval/run-probe.d.ts.map +1 -0
- package/dist/rerank-eval/run-probe.js +113 -0
- package/dist/session.d.ts +42 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +21 -0
- package/dist/suggestion.d.ts +38 -0
- package/dist/suggestion.d.ts.map +1 -0
- package/dist/suggestion.js +47 -0
- package/dist/synth-bench/corpus.d.ts +106 -0
- package/dist/synth-bench/corpus.d.ts.map +1 -0
- package/dist/synth-bench/corpus.js +994 -0
- package/dist/synth-bench/run-bench-cli.d.ts +3 -0
- package/dist/synth-bench/run-bench-cli.d.ts.map +1 -0
- package/dist/synth-bench/run-bench-cli.js +181 -0
- package/dist/synth-bench/run-bench.d.ts +101 -0
- package/dist/synth-bench/run-bench.d.ts.map +1 -0
- package/dist/synth-bench/run-bench.js +374 -0
- package/dist/synthesize-contract.d.ts +131 -0
- package/dist/synthesize-contract.d.ts.map +1 -0
- package/dist/synthesize-contract.js +948 -0
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/package.json +74 -0
- package/src/contract-hash.ts +102 -0
- package/src/contract-validators.ts +604 -0
- package/src/decision-input.ts +49 -0
- package/src/decision.ts +581 -0
- package/src/index.ts +63 -0
- package/src/intent.ts +37 -0
- package/src/llm-caller.ts +82 -0
- package/src/llm-rerank.ts +280 -0
- package/src/negotiate.ts +312 -0
- package/src/normalize-schema.ts +193 -0
- package/src/pure.ts +46 -0
- package/src/rag-search.ts +274 -0
- package/src/rerank-eval/pairs.ts +624 -0
- package/src/rerank-eval/run-probe-cli.ts +197 -0
- package/src/rerank-eval/run-probe.ts +198 -0
- package/src/session.ts +41 -0
- package/src/suggestion.ts +73 -0
- package/src/synth-bench/corpus.ts +1126 -0
- package/src/synth-bench/run-bench-cli.ts +237 -0
- package/src/synth-bench/run-bench.ts +525 -0
- package/src/synthesize-contract.ts +1161 -0
- package/src/types.ts +31 -0
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eval pairs for the rerank quality probe.
|
|
3
|
+
*
|
|
4
|
+
* 25 hand-built pairs. Each pair has:
|
|
5
|
+
* - A user query (intent + contract summary)
|
|
6
|
+
* - 3-5 candidates (one or zero of which is the gold match)
|
|
7
|
+
* - The gold-standard label: `goldMatchId` or `null` for no-match
|
|
8
|
+
* - `kind`: 'should-match' | 'no-match' | 'adversarial'
|
|
9
|
+
*
|
|
10
|
+
* Adversarial pairs (n=10) are structurally identical to a candidate
|
|
11
|
+
* but differ in load-bearing intent — the judge MUST reject them. If
|
|
12
|
+
* the judge accepts adversarials, the adversarial false-positive rate
|
|
13
|
+
* exceeds its quality gate.
|
|
14
|
+
*
|
|
15
|
+
* Eval-only — not exported from the package index.
|
|
16
|
+
*/
|
|
17
|
+
import type { RerankCandidate, RerankQuery } from '../llm-rerank.js';
|
|
18
|
+
|
|
19
|
+
export interface EvalPair {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly kind: 'should-match' | 'no-match' | 'adversarial';
|
|
22
|
+
readonly query: RerankQuery;
|
|
23
|
+
readonly candidates: readonly RerankCandidate[];
|
|
24
|
+
readonly goldMatchId: string | null;
|
|
25
|
+
readonly note?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const EVAL_PAIRS: readonly EvalPair[] = [
|
|
29
|
+
// ─── should-match: paraphrases of the same UI ───
|
|
30
|
+
{
|
|
31
|
+
id: 'sm-notepad-1',
|
|
32
|
+
kind: 'should-match',
|
|
33
|
+
query: {
|
|
34
|
+
intent: 'Build a notepad with a topic select and a note textarea',
|
|
35
|
+
contractSummary:
|
|
36
|
+
'interaction=collect; slots=noteText,topic; actions=∅; streams=∅',
|
|
37
|
+
},
|
|
38
|
+
candidates: [
|
|
39
|
+
{
|
|
40
|
+
id: 'bp-notepad',
|
|
41
|
+
cachedIntent: 'Live notepad panel — topic enum + textarea — context-mirrored',
|
|
42
|
+
cachedContractSummary:
|
|
43
|
+
'interaction=collect; slots=noteText,topic; actions=∅; streams=∅',
|
|
44
|
+
cosine: 0.92,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'bp-todo',
|
|
48
|
+
cachedIntent: 'Todo list with add/remove items',
|
|
49
|
+
cachedContractSummary:
|
|
50
|
+
'interaction=collect; slots=items; actions=add,remove; streams=∅',
|
|
51
|
+
cosine: 0.41,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
goldMatchId: 'bp-notepad',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'sm-feedback-1',
|
|
58
|
+
kind: 'should-match',
|
|
59
|
+
query: {
|
|
60
|
+
intent: 'Form to gather user feedback with a 5-star rating and a free-text comment',
|
|
61
|
+
contractSummary:
|
|
62
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=comment,rating',
|
|
63
|
+
},
|
|
64
|
+
candidates: [
|
|
65
|
+
{
|
|
66
|
+
id: 'bp-rate-comment',
|
|
67
|
+
cachedIntent: 'Rate-and-comment feedback form — five-star rating, comment box, submit button',
|
|
68
|
+
cachedContractSummary:
|
|
69
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=comment,rating',
|
|
70
|
+
cosine: 0.88,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'bp-survey',
|
|
74
|
+
cachedIntent: 'Multi-step survey with NPS + open-ended question + tags',
|
|
75
|
+
cachedContractSummary:
|
|
76
|
+
'interaction=collect; slots=∅; actions=next,prev,submit; streams=∅; props=nps,openText,tags',
|
|
77
|
+
cosine: 0.55,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'bp-login',
|
|
81
|
+
cachedIntent: 'Login form with email + password',
|
|
82
|
+
cachedContractSummary:
|
|
83
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=email,password',
|
|
84
|
+
cosine: 0.31,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
goldMatchId: 'bp-rate-comment',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'sm-weather-1',
|
|
91
|
+
kind: 'should-match',
|
|
92
|
+
query: {
|
|
93
|
+
intent: 'Weather card showing current conditions for Tokyo',
|
|
94
|
+
contractSummary:
|
|
95
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=city,conditions,temp',
|
|
96
|
+
},
|
|
97
|
+
candidates: [
|
|
98
|
+
{
|
|
99
|
+
id: 'bp-weather',
|
|
100
|
+
cachedIntent: 'Current weather widget — city name, temp, conditions',
|
|
101
|
+
cachedContractSummary:
|
|
102
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=city,conditions,temp',
|
|
103
|
+
cosine: 0.95,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'bp-stock',
|
|
107
|
+
cachedIntent: 'Stock ticker — symbol + price',
|
|
108
|
+
cachedContractSummary:
|
|
109
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=price,symbol',
|
|
110
|
+
cosine: 0.45,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
goldMatchId: 'bp-weather',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'sm-todo-1',
|
|
117
|
+
kind: 'should-match',
|
|
118
|
+
query: {
|
|
119
|
+
intent: 'Todo list — user can add items, mark them complete, remove them',
|
|
120
|
+
contractSummary:
|
|
121
|
+
'interaction=collect; slots=items; actions=add,remove,toggle; streams=∅',
|
|
122
|
+
},
|
|
123
|
+
candidates: [
|
|
124
|
+
{
|
|
125
|
+
id: 'bp-todo-mvc',
|
|
126
|
+
cachedIntent: 'Classic todo MVC — add input, items list with checkboxes, delete buttons',
|
|
127
|
+
cachedContractSummary:
|
|
128
|
+
'interaction=collect; slots=items; actions=add,remove,toggle; streams=∅',
|
|
129
|
+
cosine: 0.91,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'bp-shopping',
|
|
133
|
+
cachedIntent: 'Shopping cart with quantity + checkout',
|
|
134
|
+
cachedContractSummary:
|
|
135
|
+
'interaction=collect; slots=cart; actions=add,checkout,remove,setQty; streams=∅',
|
|
136
|
+
cosine: 0.62,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
goldMatchId: 'bp-todo-mvc',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'sm-search-1',
|
|
143
|
+
kind: 'should-match',
|
|
144
|
+
query: {
|
|
145
|
+
intent: 'Search bar with autocomplete — typing suggests options live',
|
|
146
|
+
contractSummary:
|
|
147
|
+
'interaction=collect; slots=query; actions=select; streams=suggestions',
|
|
148
|
+
},
|
|
149
|
+
candidates: [
|
|
150
|
+
{
|
|
151
|
+
id: 'bp-autocomplete',
|
|
152
|
+
cachedIntent: 'Search input with live-suggestion dropdown',
|
|
153
|
+
cachedContractSummary:
|
|
154
|
+
'interaction=collect; slots=query; actions=select; streams=suggestions',
|
|
155
|
+
cosine: 0.94,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'bp-filter',
|
|
159
|
+
cachedIntent: 'Filter panel with multi-select facets',
|
|
160
|
+
cachedContractSummary:
|
|
161
|
+
'interaction=collect; slots=filters; actions=apply,clear; streams=∅',
|
|
162
|
+
cosine: 0.48,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
goldMatchId: 'bp-autocomplete',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'sm-chat-1',
|
|
169
|
+
kind: 'should-match',
|
|
170
|
+
query: {
|
|
171
|
+
intent: 'Chat interface — message list, input box, send button',
|
|
172
|
+
contractSummary:
|
|
173
|
+
'interaction=converse; slots=draft; actions=send; streams=messages',
|
|
174
|
+
},
|
|
175
|
+
candidates: [
|
|
176
|
+
{
|
|
177
|
+
id: 'bp-chat',
|
|
178
|
+
cachedIntent: 'Chat panel — scrolling message list, composer textarea, send action',
|
|
179
|
+
cachedContractSummary:
|
|
180
|
+
'interaction=converse; slots=draft; actions=send; streams=messages',
|
|
181
|
+
cosine: 0.93,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 'bp-comments',
|
|
185
|
+
cachedIntent: 'Comments thread with replies',
|
|
186
|
+
cachedContractSummary:
|
|
187
|
+
'interaction=converse; slots=draft; actions=post,reply; streams=messages',
|
|
188
|
+
cosine: 0.7,
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
goldMatchId: 'bp-chat',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: 'sm-dashboard-1',
|
|
195
|
+
kind: 'should-match',
|
|
196
|
+
query: {
|
|
197
|
+
intent: 'Dashboard with KPI cards — revenue, users, churn',
|
|
198
|
+
contractSummary:
|
|
199
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=churn,revenue,users',
|
|
200
|
+
},
|
|
201
|
+
candidates: [
|
|
202
|
+
{
|
|
203
|
+
id: 'bp-kpi',
|
|
204
|
+
cachedIntent: 'KPI dashboard — revenue card, user count card, churn percent',
|
|
205
|
+
cachedContractSummary:
|
|
206
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=churn,revenue,users',
|
|
207
|
+
cosine: 0.93,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'bp-table',
|
|
211
|
+
cachedIntent: 'Data table with sortable columns',
|
|
212
|
+
cachedContractSummary:
|
|
213
|
+
'interaction=display; slots=∅; actions=sort; streams=∅; props=columns,rows',
|
|
214
|
+
cosine: 0.42,
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
goldMatchId: 'bp-kpi',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 'sm-settings-1',
|
|
221
|
+
kind: 'should-match',
|
|
222
|
+
query: {
|
|
223
|
+
intent: 'Settings page with toggles for notifications, dark mode, autoplay',
|
|
224
|
+
contractSummary:
|
|
225
|
+
'interaction=collect; slots=autoplay,darkMode,notifications; actions=∅; streams=∅',
|
|
226
|
+
},
|
|
227
|
+
candidates: [
|
|
228
|
+
{
|
|
229
|
+
id: 'bp-settings',
|
|
230
|
+
cachedIntent: 'User preferences panel — notification toggle, theme toggle, autoplay toggle',
|
|
231
|
+
cachedContractSummary:
|
|
232
|
+
'interaction=collect; slots=autoplay,darkMode,notifications; actions=∅; streams=∅',
|
|
233
|
+
cosine: 0.9,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: 'bp-profile',
|
|
237
|
+
cachedIntent: 'Profile edit form — name, email, avatar',
|
|
238
|
+
cachedContractSummary:
|
|
239
|
+
'interaction=collect; slots=∅; actions=save; streams=∅; props=avatar,email,name',
|
|
240
|
+
cosine: 0.5,
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
goldMatchId: 'bp-settings',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 'sm-modal-1',
|
|
247
|
+
kind: 'should-match',
|
|
248
|
+
query: {
|
|
249
|
+
intent: 'Confirmation modal — "Delete this item?" with Cancel and Delete buttons',
|
|
250
|
+
contractSummary:
|
|
251
|
+
'interaction=approve; slots=∅; actions=cancel,confirm; streams=∅; props=message,title',
|
|
252
|
+
},
|
|
253
|
+
candidates: [
|
|
254
|
+
{
|
|
255
|
+
id: 'bp-confirm',
|
|
256
|
+
cachedIntent: 'Confirmation dialog — title, message, two buttons (cancel + confirm)',
|
|
257
|
+
cachedContractSummary:
|
|
258
|
+
'interaction=approve; slots=∅; actions=cancel,confirm; streams=∅; props=message,title',
|
|
259
|
+
cosine: 0.94,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: 'bp-alert',
|
|
263
|
+
cachedIntent: 'Alert banner with single dismiss button',
|
|
264
|
+
cachedContractSummary:
|
|
265
|
+
'interaction=approve; slots=∅; actions=dismiss; streams=∅; props=message',
|
|
266
|
+
cosine: 0.6,
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
goldMatchId: 'bp-confirm',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: 'sm-onboarding-1',
|
|
273
|
+
kind: 'should-match',
|
|
274
|
+
query: {
|
|
275
|
+
intent: 'Multi-step onboarding wizard — welcome, profile, preferences, finish',
|
|
276
|
+
contractSummary:
|
|
277
|
+
'interaction=flow; slots=currentStep; actions=back,next,skip; streams=∅',
|
|
278
|
+
},
|
|
279
|
+
candidates: [
|
|
280
|
+
{
|
|
281
|
+
id: 'bp-wizard',
|
|
282
|
+
cachedIntent: 'Step-by-step wizard with progress indicator',
|
|
283
|
+
cachedContractSummary:
|
|
284
|
+
'interaction=flow; slots=currentStep; actions=back,next,skip; streams=∅',
|
|
285
|
+
cosine: 0.89,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 'bp-stepper',
|
|
289
|
+
cachedIntent: 'Linear stepper for checkout',
|
|
290
|
+
cachedContractSummary:
|
|
291
|
+
'interaction=flow; slots=step; actions=back,next; streams=∅',
|
|
292
|
+
cosine: 0.78,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
goldMatchId: 'bp-wizard',
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
// ─── no-match: queries with no good fit in candidates ───
|
|
299
|
+
{
|
|
300
|
+
id: 'nm-novel-1',
|
|
301
|
+
kind: 'no-match',
|
|
302
|
+
query: {
|
|
303
|
+
intent: 'Periodic table viewer with hoverable element details',
|
|
304
|
+
contractSummary:
|
|
305
|
+
'interaction=display; slots=∅; actions=hover; streams=∅; props=elements',
|
|
306
|
+
},
|
|
307
|
+
candidates: [
|
|
308
|
+
{
|
|
309
|
+
id: 'bp-todo',
|
|
310
|
+
cachedIntent: 'Todo list',
|
|
311
|
+
cachedContractSummary:
|
|
312
|
+
'interaction=collect; slots=items; actions=add,remove; streams=∅',
|
|
313
|
+
cosine: 0.32,
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: 'bp-form',
|
|
317
|
+
cachedIntent: 'Generic form with text inputs',
|
|
318
|
+
cachedContractSummary:
|
|
319
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=fields',
|
|
320
|
+
cosine: 0.28,
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
goldMatchId: null,
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: 'nm-novel-2',
|
|
327
|
+
kind: 'no-match',
|
|
328
|
+
query: {
|
|
329
|
+
intent: 'Code editor with syntax highlighting and line numbers',
|
|
330
|
+
contractSummary:
|
|
331
|
+
'interaction=collect; slots=code; actions=run; streams=output',
|
|
332
|
+
},
|
|
333
|
+
candidates: [
|
|
334
|
+
{
|
|
335
|
+
id: 'bp-notepad',
|
|
336
|
+
cachedIntent: 'Plain notepad — single textarea, no syntax highlighting',
|
|
337
|
+
cachedContractSummary:
|
|
338
|
+
'interaction=collect; slots=text; actions=∅; streams=∅',
|
|
339
|
+
cosine: 0.55,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: 'bp-search',
|
|
343
|
+
cachedIntent: 'Search bar with autocomplete',
|
|
344
|
+
cachedContractSummary:
|
|
345
|
+
'interaction=collect; slots=query; actions=select; streams=suggestions',
|
|
346
|
+
cosine: 0.3,
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
goldMatchId: null,
|
|
350
|
+
note: 'notepad shares "type into a textarea" but lacks syntax/run/output — should not match',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: 'nm-novel-3',
|
|
354
|
+
kind: 'no-match',
|
|
355
|
+
query: {
|
|
356
|
+
intent: 'Map view showing user location with nearby points of interest',
|
|
357
|
+
contractSummary:
|
|
358
|
+
'interaction=display; slots=∅; actions=panTo,zoom; streams=pois; props=center,zoom',
|
|
359
|
+
},
|
|
360
|
+
candidates: [
|
|
361
|
+
{
|
|
362
|
+
id: 'bp-list',
|
|
363
|
+
cachedIntent: 'Generic list view',
|
|
364
|
+
cachedContractSummary:
|
|
365
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=items',
|
|
366
|
+
cosine: 0.36,
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
goldMatchId: null,
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: 'nm-novel-4',
|
|
373
|
+
kind: 'no-match',
|
|
374
|
+
query: {
|
|
375
|
+
intent: 'File uploader with drag-and-drop and progress bars',
|
|
376
|
+
contractSummary:
|
|
377
|
+
'interaction=collect; slots=files; actions=cancel,upload; streams=progress',
|
|
378
|
+
},
|
|
379
|
+
candidates: [
|
|
380
|
+
{
|
|
381
|
+
id: 'bp-form',
|
|
382
|
+
cachedIntent: 'Login form',
|
|
383
|
+
cachedContractSummary:
|
|
384
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=email,password',
|
|
385
|
+
cosine: 0.25,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: 'bp-feedback',
|
|
389
|
+
cachedIntent: 'Feedback form',
|
|
390
|
+
cachedContractSummary:
|
|
391
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=comment,rating',
|
|
392
|
+
cosine: 0.3,
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
goldMatchId: null,
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
id: 'nm-novel-5',
|
|
399
|
+
kind: 'no-match',
|
|
400
|
+
query: {
|
|
401
|
+
intent: 'Audio player with play/pause, seek, volume',
|
|
402
|
+
contractSummary:
|
|
403
|
+
'interaction=collect; slots=position; actions=pause,play,seek,setVolume; streams=∅',
|
|
404
|
+
},
|
|
405
|
+
candidates: [
|
|
406
|
+
{
|
|
407
|
+
id: 'bp-todo',
|
|
408
|
+
cachedIntent: 'Todo list',
|
|
409
|
+
cachedContractSummary:
|
|
410
|
+
'interaction=collect; slots=items; actions=add,remove; streams=∅',
|
|
411
|
+
cosine: 0.22,
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
goldMatchId: null,
|
|
415
|
+
},
|
|
416
|
+
|
|
417
|
+
// ─── adversarial: structurally identical, intent-divergent ───
|
|
418
|
+
{
|
|
419
|
+
id: 'ad-haiku-vs-tweet',
|
|
420
|
+
kind: 'adversarial',
|
|
421
|
+
query: {
|
|
422
|
+
intent: 'Haiku composer with serif font and seasonal-mood placeholder',
|
|
423
|
+
contractSummary: 'interaction=collect; slots=text; actions=∅; streams=∅',
|
|
424
|
+
},
|
|
425
|
+
candidates: [
|
|
426
|
+
{
|
|
427
|
+
id: 'bp-tweet-draft',
|
|
428
|
+
cachedIntent: 'Tweet draft composer with character count and 280-char limit',
|
|
429
|
+
cachedContractSummary:
|
|
430
|
+
'interaction=collect; slots=text; actions=∅; streams=∅',
|
|
431
|
+
cosine: 0.82,
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
goldMatchId: null,
|
|
435
|
+
note: 'identical contract surface but the user intent is a HAIKU (visual style + framing matters)',
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: 'ad-calendar-jan-vs-mar',
|
|
439
|
+
kind: 'adversarial',
|
|
440
|
+
query: {
|
|
441
|
+
intent: 'Calendar showing March 2026 with selectable dates',
|
|
442
|
+
contractSummary:
|
|
443
|
+
'interaction=collect; slots=selectedDate; actions=∅; streams=∅; props=month,year',
|
|
444
|
+
},
|
|
445
|
+
candidates: [
|
|
446
|
+
{
|
|
447
|
+
id: 'bp-calendar-jan',
|
|
448
|
+
cachedIntent: 'Calendar showing January 2026 with selectable dates',
|
|
449
|
+
cachedContractSummary:
|
|
450
|
+
'interaction=collect; slots=selectedDate; actions=∅; streams=∅; props=month,year',
|
|
451
|
+
cosine: 0.96,
|
|
452
|
+
},
|
|
453
|
+
],
|
|
454
|
+
goldMatchId: null,
|
|
455
|
+
note: 'load-bearing parameter (month) differs — generated UI would show wrong month',
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
id: 'ad-login-vs-signup',
|
|
459
|
+
kind: 'adversarial',
|
|
460
|
+
query: {
|
|
461
|
+
intent: 'Sign-up form for new account — email, password, confirm password, terms checkbox',
|
|
462
|
+
contractSummary:
|
|
463
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=confirmPassword,email,password,termsAccepted',
|
|
464
|
+
},
|
|
465
|
+
candidates: [
|
|
466
|
+
{
|
|
467
|
+
id: 'bp-login',
|
|
468
|
+
cachedIntent: 'Login form — email + password fields, submit button',
|
|
469
|
+
cachedContractSummary:
|
|
470
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=email,password',
|
|
471
|
+
cosine: 0.85,
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
goldMatchId: null,
|
|
475
|
+
note: 'similar contract but signup needs confirmPassword + terms — login UI would miss them',
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
id: 'ad-chat-vs-comments',
|
|
479
|
+
kind: 'adversarial',
|
|
480
|
+
query: {
|
|
481
|
+
intent: 'Comments thread under a blog post — flat list, post a reply, no real-time',
|
|
482
|
+
contractSummary:
|
|
483
|
+
'interaction=converse; slots=draft; actions=post; streams=∅',
|
|
484
|
+
},
|
|
485
|
+
candidates: [
|
|
486
|
+
{
|
|
487
|
+
id: 'bp-chat',
|
|
488
|
+
cachedIntent: 'Real-time chat panel with WebSocket-driven message stream',
|
|
489
|
+
cachedContractSummary:
|
|
490
|
+
'interaction=converse; slots=draft; actions=send; streams=messages',
|
|
491
|
+
cosine: 0.79,
|
|
492
|
+
},
|
|
493
|
+
],
|
|
494
|
+
goldMatchId: null,
|
|
495
|
+
note: 'chat has streamSpec.messages — comments do not. Different liveness model.',
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: 'ad-light-vs-dark',
|
|
499
|
+
kind: 'adversarial',
|
|
500
|
+
query: {
|
|
501
|
+
intent: 'Dashboard with metrics — render in dark mode for night ops use',
|
|
502
|
+
contractSummary:
|
|
503
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=metrics',
|
|
504
|
+
},
|
|
505
|
+
candidates: [
|
|
506
|
+
{
|
|
507
|
+
id: 'bp-dashboard-light',
|
|
508
|
+
cachedIntent: 'Marketing dashboard for executive review — bright, ornate, colorful KPI cards',
|
|
509
|
+
cachedContractSummary:
|
|
510
|
+
'interaction=display; slots=∅; actions=∅; streams=∅; props=metrics',
|
|
511
|
+
cosine: 0.78,
|
|
512
|
+
},
|
|
513
|
+
],
|
|
514
|
+
goldMatchId: 'bp-dashboard-light',
|
|
515
|
+
note: 'visual style alone (dark vs light) is NOT load-bearing per spec — should match',
|
|
516
|
+
// NOTE: this is actually a should-match disguised as adversarial — verifies
|
|
517
|
+
// the judge doesn't over-reject on cosmetic style. If precision drops here,
|
|
518
|
+
// the prompt is over-strict.
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
id: 'ad-form-fields-different',
|
|
522
|
+
kind: 'adversarial',
|
|
523
|
+
query: {
|
|
524
|
+
intent: 'Contact form — name, email, message, subject',
|
|
525
|
+
contractSummary:
|
|
526
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=email,message,name,subject',
|
|
527
|
+
},
|
|
528
|
+
candidates: [
|
|
529
|
+
{
|
|
530
|
+
id: 'bp-feedback',
|
|
531
|
+
cachedIntent: 'Feedback form with rating + comment',
|
|
532
|
+
cachedContractSummary:
|
|
533
|
+
'interaction=collect; slots=∅; actions=submit; streams=∅; props=comment,rating',
|
|
534
|
+
cosine: 0.7,
|
|
535
|
+
},
|
|
536
|
+
],
|
|
537
|
+
goldMatchId: null,
|
|
538
|
+
note: 'different fields (name/email/message/subject vs rating/comment) — different UI',
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
id: 'ad-step-count',
|
|
542
|
+
kind: 'adversarial',
|
|
543
|
+
query: {
|
|
544
|
+
intent: '5-step onboarding wizard — welcome, profile, preferences, integrations, finish',
|
|
545
|
+
contractSummary:
|
|
546
|
+
'interaction=flow; slots=currentStep; actions=back,next,skip; streams=∅; props=stepCount',
|
|
547
|
+
},
|
|
548
|
+
candidates: [
|
|
549
|
+
{
|
|
550
|
+
id: 'bp-3step-wizard',
|
|
551
|
+
cachedIntent: '3-step setup wizard — name, plan, payment',
|
|
552
|
+
cachedContractSummary:
|
|
553
|
+
'interaction=flow; slots=currentStep; actions=back,next,skip; streams=∅; props=stepCount',
|
|
554
|
+
cosine: 0.86,
|
|
555
|
+
},
|
|
556
|
+
],
|
|
557
|
+
goldMatchId: null,
|
|
558
|
+
note: 'step count + step contents differ — wizard reuse forces wrong step labels',
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
id: 'ad-list-vs-grid',
|
|
562
|
+
kind: 'adversarial',
|
|
563
|
+
query: {
|
|
564
|
+
intent: 'Photo grid view — 3 columns, lightbox on click',
|
|
565
|
+
contractSummary:
|
|
566
|
+
'interaction=display; slots=∅; actions=open; streams=∅; props=items',
|
|
567
|
+
},
|
|
568
|
+
candidates: [
|
|
569
|
+
{
|
|
570
|
+
id: 'bp-list',
|
|
571
|
+
cachedIntent: 'Linear text list with one item per row',
|
|
572
|
+
cachedContractSummary:
|
|
573
|
+
'interaction=display; slots=∅; actions=open; streams=∅; props=items',
|
|
574
|
+
cosine: 0.72,
|
|
575
|
+
},
|
|
576
|
+
],
|
|
577
|
+
goldMatchId: null,
|
|
578
|
+
note: 'grid vs list is a layout/visual difference — but a photo grid + lightbox is a different UI',
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
id: 'ad-prop-types',
|
|
582
|
+
kind: 'adversarial',
|
|
583
|
+
query: {
|
|
584
|
+
intent: 'Inventory table — columns: SKU, name, quantity, price, last-restocked',
|
|
585
|
+
contractSummary:
|
|
586
|
+
'interaction=display; slots=∅; actions=sort; streams=∅; props=columns,rows',
|
|
587
|
+
},
|
|
588
|
+
candidates: [
|
|
589
|
+
{
|
|
590
|
+
id: 'bp-user-table',
|
|
591
|
+
cachedIntent: 'User directory table — columns: name, email, role, last-login',
|
|
592
|
+
cachedContractSummary:
|
|
593
|
+
'interaction=display; slots=∅; actions=sort; streams=∅; props=columns,rows',
|
|
594
|
+
cosine: 0.84,
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
goldMatchId: null,
|
|
598
|
+
note: 'same shape (sortable table) but the columns are different domain data — reuse misleads',
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
id: 'ad-default-vs-explicit',
|
|
602
|
+
kind: 'adversarial',
|
|
603
|
+
query: {
|
|
604
|
+
intent: 'Calculator with scientific functions — sin, cos, tan, log, exp, sqrt, pi',
|
|
605
|
+
contractSummary:
|
|
606
|
+
'interaction=collect; slots=display; actions=clear,evaluate,press; streams=∅',
|
|
607
|
+
},
|
|
608
|
+
candidates: [
|
|
609
|
+
{
|
|
610
|
+
id: 'bp-basic-calc',
|
|
611
|
+
cachedIntent: 'Basic calculator — digits, +, -, ×, ÷, =, clear',
|
|
612
|
+
cachedContractSummary:
|
|
613
|
+
'interaction=collect; slots=display; actions=clear,evaluate,press; streams=∅',
|
|
614
|
+
cosine: 0.9,
|
|
615
|
+
},
|
|
616
|
+
],
|
|
617
|
+
goldMatchId: null,
|
|
618
|
+
note: 'same contract but scientific calc has way more buttons — basic-calc UI insufficient',
|
|
619
|
+
},
|
|
620
|
+
];
|
|
621
|
+
|
|
622
|
+
export function pairsByKind(kind: EvalPair['kind']): readonly EvalPair[] {
|
|
623
|
+
return EVAL_PAIRS.filter((p) => p.kind === kind);
|
|
624
|
+
}
|