File size: 32,743 Bytes
5c49242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
"""GRM Evaluation Suite benchmark registry.



Benchmark scores are grouped into three equally weighted categories:

Roleplay, Actions, and General. Individual benchmarks carry PRD-derived

priority/source/domain metadata for filtering and methodology display.

"""

CATEGORIES = ["ROLEPLAY", "ACTIONS", "GENERAL"]
CATEGORY_WEIGHT = 1 / 3

CATEGORY_DISPLAY = {
    "ROLEPLAY": "Roleplay",
    "ACTIONS": "Actions",
    "GENERAL": "General",
}

SOURCE_EXTERNAL = "External"
SOURCE_GRM_BENCH = "GRM-Bench"


def _scope(*items: tuple[str, str]) -> list[dict[str, str]]:
    return [{"category": category, "description": description} for category, description in items]


BENCHMARKS: list[dict] = [
    {
        "id": "multichallenge",
        "name": "MultiChallenge",
        "category": "ROLEPLAY",
        "domain": "Conversational breadth/coherence",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Multi-turn instruction following and coherence across turns.",
        "summary": (
            "MultiChallenge evaluates multi-turn instruction following where models must maintain coherence "
            "across challenging conversational turns, track context, resolve references, and keep prior "
            "commitments intact while handling new user requests."
        ),
        "methodology": "External benchmark score imported into the Roleplay category as a core signal.",
        "detection_scope": [],
                "paper": None,
                "samples": [
                        {
                                "id": "TEST_001",
                                "metadata": [
                                        ["Tag(s)", "Role Confusion"],
                                        [
                                                "Summary",
                                                "Tests identity confusion between two companions with opposite elemental specialties across 9 rounds of dialogue with heavy noun saturation. Kael (fire mage, Cinderforge Academy, Emberchill Ring) and Lyra (ice mage, Glacial Sanctum, Frostbane Amulet). The final user message deliberately misattributes all key facts. Model must correct every error without confusing the details itself.",
                                        ],
                                        [
                                                "Expectation",
                                                "Must correct all misattributions: Kael=Cinderforge (not Glacial Sanctum), Lyra=Glacial Sanctum (not Cinderforge), Kael wears Emberchill Ring (ice resist), Lyra wears Frostbane Amulet (fire resist).",
                                        ],
                                ],
                                "code": """[

    {

        "role": "system",

        "content": "You are Kael Emberheart, a fire mage and combat specialist who serves as one of the player's two companions in the Shadowveil Dungeon. You are accompanied by Lyra Frostweaver, an ice mage and defensive specialist.\n\nYOUR IDENTITY - KAEL EMBERHEART:\n- Class: Fire Mage..."

    },

    {

        "role": "user",

        "content": "Kael, quick question - what element do you specialize in? And what's your companion Lyra's element?"

    },

    {

        "role": "assistant",

        "content": "Ha! Fire, obviously - I'm Kael Emberheart, pyromancer supreme! Lyra's the frost mage. She handles the cold stuff, I bring the heat."

    },

    {

        "role": "user",

        "content": "There's an ice wraith ahead. Who's better suited to fight it - you or Lyra?"

    },

    ... (8x turns),

    {

        "role": "assistant",

        "content": "The Convergence Blast! I launch a concentrated fireball and Lyra intercepts it mid-flight with a frost bolt. Extreme heat meets extreme cold - massive steam explosion that devastates everything in the blast zone. I bring the fire, she brings the ice, and the result is pure chaos. One of my favorite moves."

    },

    {

        "role": "user",

        "content": "Okay, one last thing before we push into the Embervault. I want to make sure I've got everyone straight. You're the one who trained at the Glacial Sanctum, right? And Lyra graduated from Cinderforge Academy? Also remind me - you're wearing the Frostbane Amulet for the fire resistance, and Lyra has the Emberchill Ring?"

    }

]""",
                        },
                        {
                                "id": "TEST_021",
                                "metadata": [
                                        [
                                                "Summary",
                                                "Tests whether the model invents contents of an unread document. Eleanor found a sealed letter with an unbroken wax seal. She explicitly confirmed she has NOT opened or read it. The inspector pressures her to state exactly what it says. Model must refuse to fabricate contents.",
                                        ],
                                        ["Tag(s)", "Knowledge Boundary"],
                                        [
                                                "Expectation",
                                                "Must NOT claim to know the letter's contents; should restate the seal is unbroken and she has not read it.",
                                        ],
                                ],
                                "code": """[

    {

        "role": "system",

        "content": "You are Eleanor Vale, lady's maid in a gothic mystery set at Blackthorne Manor.\n\n# PERSONALITY\n- Composed, discreet, observant\n- Speaks carefully and avoids exaggeration\n\n# CURRENT FACTS\n- You found a sealed letter on the late master's desk..."

    },

    {

        "role": "user",

        "content": "What did you find in the study?"

    },

    {

        "role": "assistant",

        "content": "A sealed letter addressed to Lady Whitcomb. The wax is intact, so I have not read what is inside."

    },

    {

        "role": "user",

        "content": "Can you tell whether it's important?"

    },

    {

        "role": "assistant",

        "content": "Only that it was hidden carefully, which suggests it may matter. But that is only an inference. I do not know its contents."

    },

    {

        "role": "user",

        "content": "The inspector is impatient. Tell him exactly what the letter says."

    }

]""",
                        },
                ],
    },
    {
        "id": "rolebench",
        "name": "RoleBench",
        "category": "ROLEPLAY",
        "domain": "Conversational breadth/coherence",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Character-level roleplaying with explicit role framing.",
        "summary": (
            "RoleBench is a fine-grained character-level benchmark for role-playing. It tests whether a model "
            "can maintain persona, domain knowledge, and speaking style throughout interactions."
        ),
        "methodology": "External benchmark score imported as a supplementary Roleplay signal.",
        "detection_scope": [],
        "paper": "https://arxiv.org/abs/2310.00746",
    },
    {
        "id": "rolemrc",
        "name": "RoleMRC",
        "category": "ROLEPLAY",
        "domain": "Conversational breadth/coherence",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Follow complex nested instructions while remaining in character.",
        "summary": (
            "RoleMRC combines reading-comprehension challenges with role-playing constraints, requiring models "
            "to extract and reason about information without breaking persona."
        ),
        "methodology": "External benchmark score imported into the Roleplay category as a core signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "eq_bench_v3",
        "name": "EQ-Bench v3",
        "category": "ROLEPLAY",
        "domain": "Conversational breadth/coherence",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Detect nuances in tone and intent, then modulate response accordingly.",
        "summary": (
            "EQ-Bench v3 assesses emotional intelligence signals such as intent recognition, empathy calibration, "
            "and context-appropriate tonal shifts."
        ),
        "methodology": "External benchmark score imported as a supplementary Roleplay signal.",
        "detection_scope": [],
        "paper": "https://eqbench.com/",
    },
    {
        "id": "grm_coherence",
        "name": "GRM - Coherence",
        "category": "ROLEPLAY",
        "domain": "Conversational breadth/coherence",
        "source": SOURCE_GRM_BENCH,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Logically sound and coherent across turns without contradictions.",
        "summary": (
            "Nvidia-authored scenarios test resistance to incoherence in game dialogue. Incoherence can surface "
            "as hallucinated details, role confusion, contradictions, irrelevance, or failure to respect what the "
            "character can know."
        ),
        "methodology": (
            "Scenarios are crafted to invoke common coherence failures, then measure whether the model stays "
            "grounded under pressure."
        ),
        "detection_scope": _scope(
            ("Factual / Logical", "Objectively false or contradicted by the system prompt or game state."),
            ("Cause / Effect", "Fails simple logical state transitions or obvious state changes."),
            ("Contradiction", "Contradicts something previously said or done without in-world justification."),
            ("Personality / Background Violation", "Violates an established trait, limitation, or background fact."),
            ("Role Confusion", "Confuses identities, facts, actions, or motivations across entities."),
            ("Irrelevance", "Stops tracking the active subject or responds off-topic."),
            ("Knowledge Boundary", "Invents knowledge the character cannot have."),
            ("False Premise", "Accepts a smuggled-in user premise about something that never happened."),
        ),
        "paper": None,
    },
    {
        "id": "grm_response_diversity",
        "name": "GRM - Resp. Div",
        "category": "ROLEPLAY",
        "domain": "Conversational breadth/coherence",
        "source": SOURCE_GRM_BENCH,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Avoids repetitive language and speech structure.",
        "summary": (
            "Response Diversity measures whether a model stays engaging without collapsing into repetitive wording, "
            "sentence structure, or stock phrasing across similar prompts and multi-turn play."
        ),
        "methodology": (
            "Equivalent requests are expressed across repeated turns and neighboring scenarios to separate healthy "
            "consistency from repetitive degeneration."
        ),
        "detection_scope": _scope(
            ("Repetition Loop", "Repeats phrases, clauses, or sentence frames across adjacent responses."),
            ("Lexical Compression", "Collapses to a narrow vocabulary even when variation is possible."),
            ("Originality Failure", "Paraphrases the prompt too literally instead of producing fresh in-world language."),
            ("Near-Duplicate Continuation", "Makes superficial wording changes while repeating the same content."),
            ("Style Stagnation", "Cannot vary tone or delivery while preserving the same underlying instruction."),
        ),
        "paper": None,
    },
    {
        "id": "bfcl_v3",
        "name": "BFCL v3",
        "category": "ACTIONS",
        "domain": "Multi-turn tool calling",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Serial and parallel tool calling in multi-step settings.",
        "summary": (
            "Berkeley Function-Calling Leaderboard v3 evaluates simple, multiple, parallel, and nested function "
            "calls, plus function relevance detection."
        ),
        "methodology": "External benchmark score imported into the Actions category as a core signal.",
        "detection_scope": [],
        "paper": "https://gorilla.cs.berkeley.edu/blogs/8_berkeley_function_calling_leaderboard.html",
    },
    {
        "id": "when2call_mt",
        "name": "When2Call-MT",
        "category": "ACTIONS",
        "domain": "Multi-turn tool calling",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Tool-call timing across multi-turn interactions.",
        "summary": (
            "When2Call-MT evaluates when to invoke a tool, ask a follow-up question, or answer directly based on "
            "the current conversational context and available information."
        ),
        "methodology": "External benchmark score imported into the Actions category as a core signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "toolsandbox",
        "name": "ToolSandbox",
        "category": "ACTIONS",
        "domain": "Multi-turn tool calling",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Stateful dependencies and conversational tool calling.",
        "summary": (
            "ToolSandbox evaluates stateful, conversational tool use with implicit state dependencies, simulated "
            "users, and dynamic evaluation of intermediate and final milestones."
        ),
        "methodology": "External benchmark score imported into the Actions category as a core signal.",
        "detection_scope": [],
        "paper": "https://arxiv.org/abs/2408.04682",
    },
    {
        "id": "tau2_bench",
        "name": "Tau2-Bench",
        "category": "ACTIONS",
        "domain": "Multi-turn tool calling",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Multi-turn interactions with real-world commercial operations.",
        "summary": (
            "Tau2-Bench uses dual-control agent-user simulation to test tool use in real-world commercial "
            "operations where success is determined by the resulting world state."
        ),
        "methodology": "External benchmark score imported into the Actions category as a core signal.",
        "detection_scope": [],
        "paper": "https://arxiv.org/abs/2506.07982",
    },
    {
        "id": "bfcl_v4",
        "name": "BFCL v4",
        "category": "ACTIONS",
        "domain": "Multi-turn tool calling",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Memory-aware tool calling and format sensitivity.",
        "summary": (
            "BFCL v4 extends prior function-calling evaluations with memory-augmented scenarios and schema-format "
            "sensitivity checks."
        ),
        "methodology": "External benchmark score imported as a supplementary Actions signal.",
        "detection_scope": [],
        "paper": "https://gorilla.cs.berkeley.edu/blogs/12_bfcl_v3_multi_turn.html",
    },
    {
        "id": "grm_tool_recovery",
        "name": "GRM - Tool Rec",
        "category": "ACTIONS",
        "domain": "Multi-turn tool calling",
        "source": SOURCE_GRM_BENCH,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Recognizes failed tool steps, repairs the plan, and continues without fabrication.",
        "summary": (
            "Tool Recovery evaluates whether the model can survive partial tool failures instead of derailing or "
            "inventing results after one bad tool call."
        ),
        "methodology": (
            "Benchmarks inject missing calls, malformed arguments, or explicit failures and measure whether the "
            "model retries correctly, replans, or asks for the right follow-up."
        ),
        "detection_scope": _scope(
            ("Missed Invocation", "Fails to issue a required tool call."),
            ("Malformed Retry", "Attempts recovery with incomplete or invalid tool arguments."),
            ("Fabricated Output", "Invents tool output after a failure."),
            ("Recovery Sequencing", "Does not replan correctly after an error or partial result."),
            ("Silent Drop", "Continues as if the failed tool step never mattered."),
        ),
        "paper": None,
    },
    {
        "id": "iheval",
        "name": "IHEval",
        "category": "GENERAL",
        "domain": "Input resilience",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Instruction handling under varied input forms.",
        "summary": "IHEval is used as a core General signal for input resilience and instruction handling.",
        "methodology": "External benchmark score imported into the General category as a core signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "ruler",
        "name": "RULER",
        "category": "GENERAL",
        "domain": "Input resilience",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Needle-in-haystack and polluted state long-context stress testing.",
        "summary": (
            "RULER extends needle-in-a-haystack tests with multi-hop composition and aggregation tasks at varying "
            "context lengths."
        ),
        "methodology": "External benchmark score imported into the General category as a core signal.",
        "detection_scope": [],
        "paper": "https://arxiv.org/abs/2404.06654",
    },
    {
        "id": "longmemeval",
        "name": "LongMemEval",
        "category": "GENERAL",
        "domain": "Input resilience",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Long-memory evaluation for retaining and applying relevant context.",
        "summary": "LongMemEval contributes a supplementary signal for long-context memory and input resilience.",
        "methodology": "External benchmark score imported as a supplementary General signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "agentif",
        "name": "AgentIF",
        "category": "GENERAL",
        "domain": "Input resilience",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Agent instruction following under practical interaction constraints.",
        "summary": "AgentIF contributes a supplementary signal for agentic instruction following.",
        "methodology": "External benchmark score imported as a supplementary General signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "grm_prompt_robustness",
        "name": "GRM - Prompt Rob",
        "category": "GENERAL",
        "domain": "Input resilience",
        "source": SOURCE_GRM_BENCH,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Same intent expressed differently still triggers the right behavior.",
        "summary": (
            "Prompt Robustness checks whether the same underlying intent is handled reliably across terse prompts, "
            "verbose instructions, structured payloads, and mixed formatting."
        ),
        "methodology": (
            "Equivalent requests are expressed in prose, shorthand, JSON, XML, and other wrappers to measure "
            "sensitivity to presentation rather than intent."
        ),
        "detection_scope": _scope(
            ("Format Sensitivity", "Succeeds in prose but fails when wrapped in structured formats."),
            ("Instruction Alias Failure", "Equivalent wording changes behavior more than they should."),
            ("Verbosity Dependency", "Requires unusually long prompting to perform an inferable task."),
            ("Tool Intent Drift", "Misses the right tool plan when phrasing changes."),
            ("Structure Overfitting", "Responds too literally to markup instead of the underlying request."),
        ),
        "paper": None,
    },
    {
        "id": "grm_state_adaptation",
        "name": "GRM - State Adapt",
        "category": "GENERAL",
        "domain": "Input resilience",
        "source": SOURCE_GRM_BENCH,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Tracks changing world state without stale values or entity drift.",
        "summary": (
            "State Adaptation measures whether a model stays synchronized with the newest values, locations, "
            "inventories, and statuses while preserving earlier facts that remain true."
        ),
        "methodology": (
            "Stateful scenarios update facts mid-conversation and require the model to carry forward the latest "
            "values while keeping dependent details accurate."
        ),
        "detection_scope": _scope(
            ("State Drift", "Values change without cause as the conversation continues."),
            ("Temporal Mismatch", "Old state is treated as current after a newer update."),
            ("Entity Attribute Drift", "Names, inventory, location, or status details mutate incorrectly."),
            ("Partial Update Failure", "One field updates but dependent fields remain stale."),
            ("Conflict Resolution", "Cannot reconcile new information with earlier context."),
        ),
        "paper": None,
    },
    {
        "id": "garage",
        "name": "GaRAGe",
        "category": "GENERAL",
        "domain": "Input grounding",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Deflects or refuses action when retrieved state is insufficient or corrupted.",
        "summary": (
            "GaRAGe tests whether a model can ground responses in provided context and avoid hallucinating when "
            "retrieved passages are insufficient, corrupted, or contradictory."
        ),
        "methodology": "External benchmark score imported as a supplementary grounding signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "ragtruth",
        "name": "RAGTruth",
        "category": "GENERAL",
        "domain": "Input grounding",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Hallucination prevention relative to retrieved context.",
        "summary": (
            "RAGTruth benchmarks hallucination detection and prevention in RAG pipelines across diverse document "
            "types."
        ),
        "methodology": "External benchmark score imported into the General category as a core grounding signal.",
        "detection_scope": [],
        "paper": "https://arxiv.org/abs/2401.00396",
    },
    {
        "id": "structeval_t",
        "name": "StructEval-T",
        "category": "GENERAL",
        "domain": "Restriction adherence",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Structured output and format-following.",
        "summary": (
            "StructEval-T tests whether models can adhere to specified output templates, formatting constraints, "
            "and structural requirements while maintaining content accuracy."
        ),
        "methodology": "External benchmark score imported as a supplementary restriction-adherence signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "ifbench",
        "name": "IFBench",
        "category": "GENERAL",
        "domain": "Restriction adherence",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P1",
        "calc_weight": 0.5,
        "included_in_grm": True,
        "description": "Generic instruction following with reduced overfit risk.",
        "summary": (
            "IFBench evaluates precise instruction following across counting, formatting, and sentence manipulation "
            "tasks."
        ),
        "methodology": "External benchmark score imported as a supplementary restriction-adherence signal.",
        "detection_scope": [],
        "paper": "https://arxiv.org/abs/2507.02833",
    },
    {
        "id": "grm_persona_actions",
        "name": "GRM - Persona Act",
        "category": "GENERAL",
        "domain": "Restriction adherence",
        "source": SOURCE_GRM_BENCH,
        "phase": "Phase 1",
        "priority": "P0",
        "calc_weight": 1.0,
        "included_in_grm": True,
        "description": "Personality instructions are followed in tool use and planning.",
        "summary": (
            "Persona-Aligned Actions ensures character and personality constraints carry through action planning, "
            "tool selection, and tool arguments rather than only surface dialogue."
        ),
        "methodology": (
            "Scenarios test whether the model selects and sequences actions in ways that respect active persona, "
            "role, and scenario constraints."
        ),
        "detection_scope": _scope(
            ("Persona Drift", "Plans or acts in a way that violates the assigned character."),
            ("Tool-Intent Mismatch", "Selects an action inconsistent with the persona or current scenario."),
            ("Constraint Drop", "Ignores active role restrictions while planning or filling arguments."),
        ),
        "paper": None,
    },
    {
        "id": "gsm8k",
        "name": "GSM8K",
        "category": "GENERAL",
        "domain": "Common sense",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P2",
        "calc_weight": 0.25,
        "included_in_grm": True,
        "description": "Grade-school math reasoning.",
        "summary": "GSM8K contributes a low-weight common-sense and reasoning support signal.",
        "methodology": "External benchmark score imported as a low-weight General signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "humaneval",
        "name": "HumanEval",
        "category": "GENERAL",
        "domain": "Common sense",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P2",
        "calc_weight": 0.25,
        "included_in_grm": True,
        "description": "Code generation and functional reasoning.",
        "summary": "HumanEval contributes a low-weight reasoning and implementation support signal.",
        "methodology": "External benchmark score imported as a low-weight General signal.",
        "detection_scope": [],
        "paper": None,
    },
    {
        "id": "mbpp",
        "name": "MBPP",
        "category": "GENERAL",
        "domain": "Common sense",
        "source": SOURCE_EXTERNAL,
        "phase": "Phase 1",
        "priority": "P2",
        "calc_weight": 0.25,
        "included_in_grm": True,
        "description": "Basic Python programming problems.",
        "summary": "MBPP contributes a low-weight reasoning and implementation support signal.",
        "methodology": "External benchmark score imported as a low-weight General signal.",
        "detection_scope": [],
        "paper": None,
    },
]

for _benchmark in BENCHMARKS:
    if _benchmark["id"] == "grm_coherence":
        _benchmark["samples"] = BENCHMARKS[0].pop("samples", [])
        break

GRM_BENCH_DIMENSIONS: list[dict] = [
    {
        "dimension": "Coherence",
        "phase": "Phase 1",
        "included_in_grm": True,
        "notes": "Logical soundness, contradictions, role confusion, knowledge boundaries, and false premises.",
    },
    {
        "dimension": "Response Diversity",
        "phase": "Phase 1",
        "included_in_grm": True,
        "notes": "Avoids repetitive language, sentence frames, and stale delivery.",
    },
    {
        "dimension": "Prompt Robustness",
        "phase": "Phase 1",
        "included_in_grm": True,
        "notes": "Handles the same intent across terse, verbose, structured, and noisy prompts.",
    },
    {
        "dimension": "Persona-Aligned Actions",
        "phase": "Phase 1",
        "included_in_grm": True,
        "notes": "Personality instructions are followed in tool use and planning.",
    },
    {
        "dimension": "Tool Recovery",
        "phase": "Phase 1",
        "included_in_grm": True,
        "notes": "Recovers from missed calls, malformed arguments, explicit failures, and fabricated outputs.",
    },
    {
        "dimension": "State Adaptation",
        "phase": "Phase 1",
        "included_in_grm": True,
        "notes": "Tracks changing world state without stale values or entity drift.",
    },
    {
        "dimension": "Emotional Intelligence",
        "phase": "Sanity / non-scored",
        "included_in_grm": False,
        "notes": "Important for immersion but marked as not included in GRM score in the PRD.",
    },
    {
        "dimension": "Role Diversity",
        "phase": "Phase 2 / non-scored",
        "included_in_grm": False,
        "notes": "Diverse characters, accents, speech patterns, and scenarios.",
    },
    {
        "dimension": "Spatial & Temporal Awareness",
        "phase": "Phase 2",
        "included_in_grm": False,
        "notes": "Tracks entities, locations, navigation, and state over time.",
    },
    {
        "dimension": "Group Conversations",
        "phase": "Phase 2",
        "included_in_grm": False,
        "notes": "Maintains roleplay quality when multiple parties participate.",
    },
    {
        "dimension": "Self Triggering",
        "phase": "Phase 2",
        "included_in_grm": False,
        "notes": "Judges when to trigger events from situational awareness without a user prompt.",
    },
]

BENCHMARK_BY_ID = {benchmark["id"]: benchmark for benchmark in BENCHMARKS}
BENCHMARK_BY_NAME = {benchmark["name"]: benchmark for benchmark in BENCHMARKS}


def get_benchmarks_by_category(category: str) -> list[dict]:
    return [benchmark for benchmark in BENCHMARKS if benchmark["category"] == category]


def get_all_benchmark_names() -> list[str]:
    return [benchmark["name"] for benchmark in BENCHMARKS]


def get_all_benchmark_ids() -> list[str]:
    return [benchmark["id"] for benchmark in BENCHMARKS]


def get_benchmark_by_id(benchmark_id: str) -> dict | None:
    return BENCHMARK_BY_ID.get(benchmark_id)