evalrouter 0.3.22__tar.gz → 0.3.24__tar.gz

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.
Files changed (62) hide show
  1. {evalrouter-0.3.22 → evalrouter-0.3.24}/PKG-INFO +1 -1
  2. {evalrouter-0.3.22 → evalrouter-0.3.24}/pyproject.toml +1 -1
  3. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/__init__.py +1 -1
  4. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/__init__.py +1 -1
  5. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_comparison_html.py +46 -10
  6. evalrouter-0.3.24/src/kimpton_evalrouter/_report_document_html.py +317 -0
  7. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_report_theme.py +1 -1
  8. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/types.py +3 -1
  9. evalrouter-0.3.22/src/kimpton_evalrouter/_report_document_html.py +0 -100
  10. {evalrouter-0.3.22 → evalrouter-0.3.24}/LICENSE +0 -0
  11. {evalrouter-0.3.22 → evalrouter-0.3.24}/README.md +0 -0
  12. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/bundle.py +0 -0
  13. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/components.py +0 -0
  14. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/models.py +0 -0
  15. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/protocol.py +0 -0
  16. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/py.typed +0 -0
  17. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/templates.py +0 -0
  18. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/evalrouter_contracts/validation.py +0 -0
  19. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/__main__.py +0 -0
  20. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_account.py +0 -0
  21. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_artifacts.py +0 -0
  22. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_boundary.py +0 -0
  23. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_chain_prefetch.py +0 -0
  24. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_comparison.py +0 -0
  25. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_comparison_checkpoint.py +0 -0
  26. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_forecasts.py +0 -0
  27. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_group_results.py +0 -0
  28. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_group_review.py +0 -0
  29. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_group_summary_prefetch.py +0 -0
  30. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_groups.py +0 -0
  31. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_guided.py +0 -0
  32. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_helpers.py +0 -0
  33. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_history_labels.py +0 -0
  34. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_listing.py +0 -0
  35. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_progress.py +0 -0
  36. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_read_cache.py +0 -0
  37. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_reasoning_controls.py +0 -0
  38. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_report_brand.py +0 -0
  39. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_report_chart_data.py +0 -0
  40. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_report_charts.py +0 -0
  41. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_report_document.py +0 -0
  42. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_report_pareto.py +0 -0
  43. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_resources.py +0 -0
  44. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_transport.py +0 -0
  45. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_tui.py +0 -0
  46. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_tui_port.py +0 -0
  47. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_tui_session.py +0 -0
  48. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_tui_table.py +0 -0
  49. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_tui_views.py +0 -0
  50. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/_update_notice.py +0 -0
  51. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/cli.py +0 -0
  52. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/langsmith.py +0 -0
  53. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/py.typed +0 -0
  54. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/__init__.py +0 -0
  55. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/_console.py +0 -0
  56. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/_theme.py +0 -0
  57. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/_widgets.py +0 -0
  58. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/live.py +0 -0
  59. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/picker.py +0 -0
  60. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/screens.py +0 -0
  61. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/render/tables.py +0 -0
  62. {evalrouter-0.3.22 → evalrouter-0.3.24}/src/kimpton_evalrouter/tracing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalrouter
3
- Version: 0.3.22
3
+ Version: 0.3.24
4
4
  Summary: Interactive evaluation workspace, command-line tools, and Python client for EvalRouter
5
5
  Project-URL: Homepage, https://evalrouter.ai
6
6
  Project-URL: Documentation, https://evalrouter.ai/developers/docs/cli
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "evalrouter"
7
- version = "0.3.22"
7
+ version = "0.3.24"
8
8
  description = "Interactive evaluation workspace, command-line tools, and Python client for EvalRouter"
9
9
  readme = "README.md"
10
10
  license = "LicenseRef-Kimpton-EvalRouter-SDK"
@@ -8,4 +8,4 @@ computes digests and refuses invalid packages; it never imports contributed
8
8
  code, opens a network connection, signs anything or carries operator state.
9
9
  """
10
10
 
11
- __version__ = "0.3.22"
11
+ __version__ = "0.3.24"
@@ -35,7 +35,7 @@ __all__ = [
35
35
  "WaitCancelled",
36
36
  "types",
37
37
  ]
38
- __version__ = "0.3.22"
38
+ __version__ = "0.3.24"
39
39
 
40
40
 
41
41
  class Client(_Transport):
@@ -427,9 +427,17 @@ def quality_charts(entries, profiles):
427
427
 
428
428
 
429
429
  COMPARISON_STYLE = """
430
+ #charts>[data-report-charts]{padding-top:16px}
430
431
  small,.caption{display:block;font-size:12px;font-weight:400;color:var(--muted-foreground)}
431
432
  .caption{margin:10px 0 16px}.numeric{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
432
- .numeric small{white-space:normal;max-width:260px;margin-left:auto}.numeric small:empty{display:none}
433
+ .numeric small{white-space:normal;max-width:260px;margin-left:auto}
434
+ #metrics .metrics table{width:100%;table-layout:fixed;min-width:900px}
435
+ #metrics .metrics th{white-space:normal}#metrics .metrics th:first-child{width:210px}
436
+ #metrics .metrics th:not(:first-child){text-align:right}#metrics .metrics td,#metrics .metrics th{padding:12px 8px}
437
+ #metrics .mk-model{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
438
+ #metrics .mk-model__name{white-space:normal;overflow-wrap:anywhere;font-size:12px}
439
+ #metrics h3 small{display:inline;margin-left:12px}
440
+ .numeric small:empty{display:none}
433
441
  th[scope=row]{color:var(--foreground);font-size:14px;white-space:normal;min-width:145px}
434
442
  .table-scroll{overflow:auto;margin-top:12px}.panel.table-wrap{padding:12px}
435
443
  .callout{margin-top:24px}.callout p{margin:8px 0}.callout details{border:0;background:transparent}
@@ -526,7 +534,11 @@ def render(document: dict, sources: Mapping[str, dict]) -> bytes:
526
534
  coverage_label = "Full benchmark" if full else "Sample only · not the full benchmark"
527
535
  if not complete:
528
536
  coverage_label += " · incomplete results"
529
- warning_items = [f"<li>{esc(w.get('detail'))}</li>" for w in document.get("differences") or []]
537
+ warning_items = [
538
+ f"<li>{esc(detail)}</li>"
539
+ for detail in dict.fromkeys(w.get("detail") for w in document.get("differences") or [])
540
+ if detail and detail != document["statistics"]["reason"]
541
+ ]
530
542
  protocol_note = (
531
543
  "SOB @6 includes 5,000 text, 209 OCR and 115 audio transcript records. "
532
544
  "Native means below are pooled row diagnostics. "
@@ -646,8 +658,17 @@ def render(document: dict, sources: Mapping[str, dict]) -> bytes:
646
658
  for e in entries
647
659
  ]
648
660
  sets = [native_metrics(p) for p in per_model]
649
- keys = sorted(set().union(*(set(x) for x in sets)))
661
+ keys = sorted(
662
+ set().union(*(set(x) for x in sets)),
663
+ key=lambda key: (
664
+ key[2].startswith("weighted/"),
665
+ theme.metric_info(metric_key(key))["role"] != "headline",
666
+ theme.metric_label(metric_key(key)),
667
+ key,
668
+ ),
669
+ )
650
670
  metric_rows = []
671
+ names = report_html.metric_names([metric_key(key) for key in keys])
651
672
  for scorer, reducer, metric in keys:
652
673
  cells = ""
653
674
  for profile, values in zip(per_model, sets, strict=True):
@@ -660,16 +681,22 @@ def render(document: dict, sources: Mapping[str, dict]) -> bytes:
660
681
  )
661
682
  cells += f'<td class="numeric">{score(values.get(key), metric_key(key))}{ci}</td>'
662
683
  metric_rows.append(
663
- f'<tr><th scope="row">{esc(metric)}<small>{esc(scorer)}{esc(" · " + reducer) if reducer else ""}</small></th>{cells}</tr>'
684
+ f'<tr><th scope="row">{names[metric_key((scorer, reducer, metric))]}</th>{cells}</tr>'
664
685
  )
665
- header = "".join(f'<th scope="col">{named(e, 18)}</th>' for e in entries)
686
+ short_names = [label(e).rsplit("/", 1)[-1] for e in entries]
687
+ header = "".join(
688
+ f'<th scope="col" title="{esc(label(e))}">{theme.model_label(short_names[i] if short_names.count(short_names[i]) == 1 else label(e), lab_for(e), 18)}</th>'
689
+ for i, e in enumerate(entries)
690
+ )
666
691
  metric_sections.append(
667
- f'<details class="metrics"><summary>All native metrics · {esc(pid)}</summary>'
692
+ f'<div class="metrics"><h3>{esc(pid)} <small>{len(keys)} recorded metrics</small></h3>'
668
693
  '<div class="table-scroll"><table><thead><tr><th scope="col">Metric</th>'
669
694
  + header
670
695
  + "</tr></thead><tbody>"
671
696
  + "".join(metric_rows)
672
- + "</tbody></table></div></details>"
697
+ + "</tbody></table></div>"
698
+ + report_html.metric_glossary([metric_key(k) for k in keys])
699
+ + "</div>"
673
700
  )
674
701
  notices, seen = [], set()
675
702
  for entry in entries:
@@ -820,16 +847,24 @@ def render(document: dict, sources: Mapping[str, dict]) -> bytes:
820
847
  f'<a href="#{ident}">{text}</a>'
821
848
  for ident, text in (
822
849
  ("overview", "Results"),
850
+ ("source-metrics", "Sources"),
823
851
  ("charts", "Charts"),
852
+ ("metrics", "All metrics"),
824
853
  ("supporting-details", "Details"),
825
854
  ("notices", "Notices"),
826
855
  )
827
856
  )
857
+ if not any(
858
+ (p.get("source_coverage") or {}).get("subsets")
859
+ for e in entries
860
+ for p in e.get("profiles") or []
861
+ ):
862
+ nav = nav.replace('<a href="#source-metrics">Sources</a>', "")
828
863
  body = f"""<!doctype html>
829
864
  <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
830
865
  <meta http-equiv="Content-Security-Policy" content="{theme.csp(pareto.SCRIPT + report_charts.SCRIPT)}">
831
866
  <meta name="color-scheme" content="light">
832
- <title>{esc(title)} | EvalRouter</title><style>{theme.STYLE}{pareto.STYLE}{report_charts.STYLE}{COMPARISON_STYLE}{theme.series_style(theme.series_colors([lab_for(e) for e in entries]))}</style></head><body>
867
+ <title>{esc(title)} | EvalRouter</title><style>{theme.STYLE}{pareto.STYLE}{report_charts.STYLE}{COMPARISON_STYLE}{report_html.METRIC_STYLE}{theme.series_style(theme.series_colors([lab_for(e) for e in entries]))}</style></head><body>
833
868
  <div class="banner">{esc(coverage_label)} <span>· Descriptive comparison</span></div>
834
869
  <main class="page">{theme.BRAND}
835
870
  <header class="masthead"><h1>{esc(title)}</h1>
@@ -842,10 +877,11 @@ def render(document: dict, sources: Mapping[str, dict]) -> bytes:
842
877
  <p class="caption">Charges shown are settled EvalRouter totals recorded in these saved results, not provider token prices. Missing final costs are not shown as zero. For multiple profiles, the overview shows the first profile’s headline; all profiles follow below.</p></section>
843
878
  <aside class="callout"><strong>How to read this comparison</strong><p>{esc(document["statistics"]["reason"])}</p><ul>{"".join(warning_items)}</ul></aside>
844
879
  {report_html.findings(authored)}{report_html.examples(authored)}{report_html.next_steps(authored)}
880
+ {report_html.source_breakdown([(label(e), p) for e in entries for p in e.get("profiles") or []])}
845
881
  <div id="charts">{chart_library or chart or '<section class="major"><h2>Charts</h2><p class="caption">No metric and sample chart met its data eligibility rules. Recorded values remain in the native metric tables.</p></section>'}{"" if chart_library else quality_charts(entries, profiles)}</div>
846
882
  {"" if chart_library else tradeoffs}
847
- <details class="fold" id="supporting-details"><summary><h2>Supporting details</h2><span class="sum">Native metrics, coverage, setup, provenance and files</span></summary><div class="fold-body">
848
- <details class="fold" id="metrics"><summary><h2>Native metric details</h2><span class="sum">Original values and recorded intervals</span></summary><div class="fold-body"><p class="caption">Weighted and unweighted metrics stay separate. Recorded 95% intervals describe each model’s graded subset; they are not a paired significance test. No new grading was performed.</p>{"".join(metric_sections)}</div></details>
883
+ <section class="major" id="metrics"><h2>All benchmark metrics</h2><p class="caption">Every metric retained in these results, in its native units. Weighted and unweighted metrics stay separate. Recorded 95% intervals describe each model’s graded subset; they are not a paired significance test. Hover a metric name for its definition and exact key.</p>{"".join(metric_sections)}</section>
884
+ <details class="fold" id="supporting-details"><summary><h2>Supporting details</h2><span class="sum">Coverage, setup, provenance and files</span></summary><div class="fold-body">
849
885
  {diagnostic_sections(entries, summary_scope=summary_scope, chain_summary=chain_summary)}
850
886
  <details class="fold" id="reproduce"><summary><h2>Make this report again</h2><span class="sum">Recreate from saved run IDs</span></summary><div class="fold-body"><p>Use the saved run IDs with the EvalRouter CLI. This reads results; it does not run the models again.</p><pre>evalrouter compare{chain_flag} {esc(run_args)} --format html --output {output_name}{raw_flag}</pre>{chain_caption}
851
887
  <p class="caption">{esc(archive_caption)}</p></div></details>
@@ -0,0 +1,317 @@
1
+ """Offline HTML presentation of the shared, deterministic report document."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import html
6
+ import math
7
+ from collections import Counter
8
+ from urllib.parse import urlsplit
9
+
10
+ from . import _report_theme as theme
11
+
12
+ METRIC_STYLE = """
13
+ #metrics dd{margin:4px 0 16px;color:var(--muted-foreground)}#metrics dt{font-weight:600}
14
+ #metrics .metric-identity{display:block;font-size:12px;font-weight:400;color:var(--muted-foreground);overflow-wrap:anywhere}
15
+ #source-metrics .numeric{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;min-width:150px}
16
+ #source-metrics small{display:block;font-size:12px;font-weight:400;color:var(--muted-foreground)}
17
+ #source-metrics strong{font-size:16px}#source-metrics .caption{font-size:12px;color:var(--muted-foreground);margin:10px 0 16px}
18
+ #source-metrics th[scope=row]{white-space:normal;min-width:145px}
19
+ @media print{#source-metrics .numeric{min-width:0;white-space:normal}}
20
+ """
21
+
22
+
23
+ def esc(value: object) -> str:
24
+ return html.escape(str(value), quote=True)
25
+
26
+
27
+ def metric_name(key: str, *, show_key: bool = False) -> str:
28
+ """Human labels first; exact metric identity and definition stay accessible."""
29
+ info = theme.metric_info(key)
30
+ definition = info.get("definition") or "Definition not supplied by this benchmark."
31
+ scorer = key.split("/", 1)[0]
32
+ reducer = scorer.partition(" [")[2].removesuffix("]")
33
+ label = info["label"] + (f" ({reducer})" if reducer else "")
34
+ return f'<span title="{esc(key + ": " + definition)}">{esc(label)}</span>' + (
35
+ f'<small class="metric-identity">{esc(key)}</small>' if show_key else ""
36
+ )
37
+
38
+
39
+ def metric_names(keys: list[str]) -> dict[str, str]:
40
+ """Expose exact identities only when readable labels collide within a table."""
41
+ keys = list(dict.fromkeys(keys))
42
+ labels = {
43
+ key: (theme.metric_label(key), key.split("/", 1)[0].partition(" [")[2]) for key in keys
44
+ }
45
+ counts = Counter(labels.values())
46
+ return {key: metric_name(key, show_key=counts[labels[key]] > 1) for key in keys}
47
+
48
+
49
+ def metric_glossary(keys: list[str]) -> str:
50
+ items = []
51
+ groups: dict[str, list[str]] = {}
52
+ for key in keys:
53
+ base = key.replace("/weighted/", "/")
54
+ if key not in groups.setdefault(base, []):
55
+ groups[base].append(key)
56
+ for base, identities in groups.items():
57
+ info = theme.metric_info(base if base in identities else identities[0])
58
+ definition = info.get("definition") or "Definition not supplied by this benchmark."
59
+ exact_keys = " · ".join(f"<code>{esc(key)}</code>" for key in identities)
60
+ items.append(f"<dt>{esc(info['label'])}</dt><dd>{esc(definition)} {exact_keys}</dd>")
61
+ return (
62
+ '<details class="fold"><summary>Metric definitions and exact keys</summary><div class="fold-body"><dl>'
63
+ + "".join(items)
64
+ + "</dl></div></details>"
65
+ )
66
+
67
+
68
+ def _source_rows(subset: dict) -> dict:
69
+ rows = {}
70
+ conflicts = set()
71
+ for row in subset.get("metrics") or []:
72
+ if not isinstance(row, dict) or not isinstance(row.get("key"), str):
73
+ continue
74
+ value, count = row.get("value"), row.get("sample_count")
75
+ if (
76
+ type(value) not in (int, float)
77
+ or not math.isfinite(value)
78
+ or type(count) is not int
79
+ or count <= 0
80
+ or count != subset.get("graded")
81
+ ):
82
+ continue
83
+ if row["key"] in rows and rows[row["key"]] != row:
84
+ conflicts.add(row["key"])
85
+ rows[row["key"]] = row
86
+ return {key: row for key, row in rows.items() if key not in conflicts}
87
+
88
+
89
+ def combined_source_metrics(records: list[tuple[str, dict]]) -> str:
90
+ """The retained author formula is distinct from pooled row diagnostics."""
91
+ combined = [
92
+ (p.get("source_coverage") or {}).get("combined_leaderboard")
93
+ if (p.get("source_coverage") or {}).get("population_complete") is True
94
+ else None
95
+ for _, p in records
96
+ ]
97
+ if not any(combined):
98
+ return ""
99
+ metrics = [
100
+ ("overall_adj", "Overall score"),
101
+ ("overall_raw", "Overall score, before coverage adjustment"),
102
+ ("leaf_value_em", "Value accuracy"),
103
+ ("value_token_f1", "Value token F1"),
104
+ ("schema_compliance", "Schema compliance"),
105
+ ("hier_path_recall", "Path recall"),
106
+ ("path_set_f1", "Path set F1"),
107
+ ("type_precision", "Type precision"),
108
+ ("perfect", "Exact response match (text + OCR)"),
109
+ ]
110
+ rows = []
111
+ for key, label in metrics:
112
+ cells = []
113
+ for value in combined:
114
+ metric = (
115
+ (value or {}).get(key)
116
+ if key.startswith("overall_")
117
+ else ((value or {}).get("metrics") or {}).get(key)
118
+ )
119
+ valid = type(metric) in (int, float) and math.isfinite(metric) and 0 <= metric <= 1
120
+ cells.append(
121
+ f'<td class="numeric">{metric * 100:.1f}%' + "</td>"
122
+ if valid
123
+ else '<td class="numeric">Unavailable</td>'
124
+ )
125
+ rows.append(f'<tr><th scope="row">{esc(label)}</th>{"".join(cells)}</tr>')
126
+ short_names = Counter(name.rsplit("/", 1)[-1] for name, _ in records)
127
+ headers = "".join(
128
+ f'<th scope="col" title="{esc(name)}">{esc(name.rsplit("/", 1)[-1] if short_names[name.rsplit("/", 1)[-1]] == 1 else name)}</th>'
129
+ for name, _ in records
130
+ )
131
+ return (
132
+ '<details class="fold"><summary>Author combined formula · all recorded scores</summary><div class="fold-body">'
133
+ '<p class="caption">Recorded SOB @6 configuration; not a reproduction of the published leaderboard. '
134
+ "The author formula combines complexity-weighted source scores and requires all 5,324 rows graded. "
135
+ "Exact response match combines text and OCR only. These values are separate from the pooled metrics below; incomplete models remain unavailable.</p>"
136
+ f'<div class="table-wrap"><table><thead><tr><th>Metric</th>{headers}</tr></thead><tbody>{"".join(rows)}</tbody></table></div></div></details>'
137
+ )
138
+
139
+
140
+ def source_breakdown(records: list[tuple[str, dict]]) -> str:
141
+ """Display retained source aggregates, without deriving them from pooled scores."""
142
+ records = [(name, p) for name, p in records if (p.get("source_coverage") or {}).get("subsets")]
143
+ if not records:
144
+ return ""
145
+ source_names = {"text": "Text", "image": "OCR", "audio": "Audio transcripts"}
146
+ sources = list(
147
+ dict.fromkeys(source for _, p in records for source in p["source_coverage"]["subsets"])
148
+ )
149
+ sources.sort(key=lambda s: (list(source_names).index(s) if s in source_names else 3, s))
150
+ tables, overview = [], []
151
+ available = any(
152
+ _source_rows(subset)
153
+ for _, profile in records
154
+ for subset in profile["source_coverage"]["subsets"].values()
155
+ )
156
+ for name, profile in records:
157
+ cells = []
158
+ for source in sources:
159
+ subset = profile["source_coverage"]["subsets"].get(source) or {}
160
+ rows = _source_rows(subset)
161
+ key = "sob_text_v6_score/leaf_value_em"
162
+ row = rows.get(key)
163
+ value = theme.format_metric_value(key, row["value"]) if row else "Not in this export"
164
+ graded, selected = subset.get("graded"), subset.get("selected")
165
+ count = (
166
+ f"{graded:,} / {selected:,} graded"
167
+ if type(graded) is int and type(selected) is int
168
+ else "Coverage not recorded"
169
+ )
170
+ cells.append(
171
+ f'<td class="numeric"><strong>{esc(value)}</strong><small>{esc(count)}</small></td>'
172
+ if available
173
+ else f'<td class="numeric">{esc(count)}</td>'
174
+ )
175
+ overview.append(f'<tr><th scope="row">{esc(name)}</th>{"".join(cells)}</tr>')
176
+ for source in sources:
177
+ rowsets = [
178
+ _source_rows(p["source_coverage"]["subsets"].get(source) or {}) for _, p in records
179
+ ]
180
+ keys = list(dict.fromkeys(key for rows in rowsets for key in rows))
181
+ if not keys:
182
+ continue
183
+ body = []
184
+ for key in keys:
185
+ cells = []
186
+ for rows in rowsets:
187
+ row = rows.get(key) or {}
188
+ value = theme.format_metric_value(key, row.get("value"))
189
+ low, high = row.get("ci95_low"), row.get("ci95_high")
190
+ ci = ""
191
+ if (
192
+ type(low) in (int, float)
193
+ and type(high) in (int, float)
194
+ and math.isfinite(low)
195
+ and math.isfinite(high)
196
+ and low <= high
197
+ ):
198
+ ci = f"<small>95% CI {theme.format_metric_value(key, low)}–{theme.format_metric_value(key, high)}</small>"
199
+ cells.append(f'<td class="numeric">{esc(value)}{ci}</td>')
200
+ body.append(f'<tr><th scope="row">{metric_name(key)}</th>{"".join(cells)}</tr>')
201
+ header = "".join(f'<th scope="col">{esc(name)}</th>' for name, _ in records)
202
+ tables.append(
203
+ f'<h3>{esc(source_names.get(source, source))}</h3><div class="table-wrap"><table><thead><tr><th>Metric</th>{header}</tr></thead><tbody>{"".join(body)}</tbody></table></div>'
204
+ )
205
+ header = "".join(
206
+ f'<th scope="col" class="numeric">{esc(source_names.get(source, source))}</th>'
207
+ for source in sources
208
+ )
209
+ explanation = (
210
+ "Value accuracy is shown below; all exported source metrics follow. Each score uses that model’s graded rows for that source."
211
+ if available
212
+ else "This saved export retains source coverage but not source-level scores. Those values cannot be reconstructed from the pooled averages."
213
+ )
214
+ details = (
215
+ '<details class="fold"><summary>All recorded source metrics</summary><div class="fold-body">'
216
+ '<p class="caption">Weighted and unweighted values remain separate. Recorded intervals describe each graded subset, not paired model differences.</p>'
217
+ + "".join(tables)
218
+ + "</div></details>"
219
+ if tables
220
+ else ""
221
+ )
222
+ return (
223
+ '<section class="major" id="source-metrics">'
224
+ f"<h2>{'Scores by source' if available else 'Source coverage'}</h2>"
225
+ f'<p class="caption">{esc(explanation)} OCR and audio sources are supplied as text, not raw images or audio.</p>'
226
+ f'<div class="panel table-wrap"><table><thead><tr><th>Model</th>{header}</tr></thead><tbody>{"".join(overview)}</tbody></table></div>{details}{combined_source_metrics(records)}</section>'
227
+ )
228
+
229
+
230
+ def intro(document: dict) -> str:
231
+ scope = " ".join(document.get("scope") or [])
232
+ return f'<p class="finding">{esc(document.get("conclusion") or "")}</p>' + (
233
+ f'<p class="scope">{esc(scope)}</p>' if scope else ""
234
+ )
235
+
236
+
237
+ def findings(document: dict) -> str:
238
+ rows = document.get("findings") or []
239
+ if not rows:
240
+ return ""
241
+ return (
242
+ '<section class="major" id="findings"><h2>What the results show</h2><ul>'
243
+ + "".join(f"<li>{esc(row['text'])}</li>" for row in rows)
244
+ + "</ul></section>"
245
+ )
246
+
247
+
248
+ def examples(document: dict) -> str:
249
+ rows = document.get("examples") or []
250
+ if not rows:
251
+ return ""
252
+ failed = any(row.get("failed_checks") for row in rows)
253
+ title = "Failure examples" if failed else "Task evidence"
254
+
255
+ def task_label(row: dict) -> str:
256
+ value = str(row.get("task_id") or row.get("id"))
257
+ parts = value.split("/")
258
+ label = f"SOB task {parts[1]}" if len(parts) == 3 and parts[0] == "sob-text" else value
259
+ return f'<span title="{esc(value)}">{esc(label)}</span>'
260
+
261
+ body = (
262
+ '<div class="table-wrap"><table><thead><tr>'
263
+ "<th>Task</th><th>Outcome</th><th>Recorded checks</th></tr></thead><tbody>"
264
+ + "".join(
265
+ f"<tr><td>{task_label(row)}</td>"
266
+ f"<td>{esc(row.get('outcome') or 'Recorded')}</td>"
267
+ f"<td>{esc(', '.join(row.get('failed_checks') or []) or 'No failed check recorded')}</td></tr>"
268
+ for row in rows
269
+ )
270
+ + "</tbody></table></div>"
271
+ )
272
+ if failed:
273
+ return f'<section class="major" id="examples"><h2>{title}</h2>{body}</section>'
274
+ return (
275
+ f'<details class="fold" id="examples"><summary><h2>{title}</h2></summary>'
276
+ f'<div class="fold-body">{body}</div></details>'
277
+ )
278
+
279
+
280
+ def next_steps(document: dict, *, links: bool = False) -> str:
281
+ rows = document.get("next_steps") or []
282
+ if not rows:
283
+ return ""
284
+ rendered = []
285
+ for row in rows:
286
+ title = esc(row.get("title") or "Next evaluation")
287
+ href = row.get("setup_href")
288
+ # Offline exports show the action as text. Web links are opt-in and local only.
289
+ if (
290
+ links
291
+ and isinstance(href, str)
292
+ and href.startswith("/")
293
+ and not href.startswith("//")
294
+ and "\\" not in href
295
+ and not urlsplit(href).netloc
296
+ ):
297
+ title = f'<a href="{esc(href)}">{title}</a>'
298
+ rendered.append(
299
+ f"<li><strong>{title}</strong><p>{esc(row.get('reason') or '')}</p>"
300
+ f'<p class="caption">{esc(row.get("what_it_tests") or "")}</p></li>'
301
+ )
302
+ return (
303
+ '<section class="major" id="next-steps"><h2>Next steps</h2><ul>'
304
+ + "".join(rendered)
305
+ + "</ul></section>"
306
+ )
307
+
308
+
309
+ def methodology(document: dict) -> str:
310
+ return (
311
+ '<details class="fold" id="report-methodology"><summary><h2>Report method</h2></summary>'
312
+ '<div class="fold-body"><ul>'
313
+ + "".join(f"<li>{esc(item)}</li>" for item in document.get("methodology") or [])
314
+ + '</ul><p class="caption">Template '
315
+ + esc(document.get("template_version", "1"))
316
+ + ". Report generation is free and makes no model calls. Evaluation charges are separate.</p></div></details>"
317
+ )
@@ -132,7 +132,7 @@ def metric_info(key: str) -> dict:
132
132
  weighted = "weighted" in parts
133
133
  last = parts[-1]
134
134
  name, _, filt = last.partition(",")
135
- scorer = parts[0]
135
+ scorer = parts[0].partition(" [")[0]
136
136
  entry = next(
137
137
  (e for e in brand.METRICS if e["name"] == name and scorer in e.get("scorers", ())), None
138
138
  ) or next((e for e in brand.METRICS if e["name"] == name and not e.get("scorers")), None)
@@ -1,4 +1,4 @@
1
- """Generated by scripts/generate_clients.py; OpenAPI SHA256 e9c81e43c156ddff13056237d8fd9bc3105717031814877c19463394e3cc869a."""
1
+ """Generated by scripts/generate_clients.py; OpenAPI SHA256 648f8d939b78ff836c2bcf41ae181415e46ec9bac95077d039881227fbcccf10."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -899,6 +899,8 @@ class EvalRecord(TypedDict):
899
899
  availability_reason: NotRequired[str]
900
900
  behaviors: NotRequired[list[str]]
901
901
  category: NotRequired[str]
902
+ created_at: NotRequired[str | None]
903
+ created_by: NotRequired[str | None]
902
904
  description: str
903
905
  detail_href: NotRequired[str | None]
904
906
  display_name: str
@@ -1,100 +0,0 @@
1
- """Offline HTML presentation of the shared, deterministic report document."""
2
-
3
- from __future__ import annotations
4
-
5
- import html
6
- from urllib.parse import urlsplit
7
-
8
-
9
- def esc(value: object) -> str:
10
- return html.escape(str(value), quote=True)
11
-
12
-
13
- def intro(document: dict) -> str:
14
- scope = " ".join(document.get("scope") or [])
15
- return f'<p class="finding">{esc(document.get("conclusion") or "")}</p>' + (
16
- f'<p class="scope">{esc(scope)}</p>' if scope else ""
17
- )
18
-
19
-
20
- def findings(document: dict) -> str:
21
- rows = document.get("findings") or []
22
- if not rows:
23
- return ""
24
- return (
25
- '<section class="major" id="findings"><h2>What the results show</h2><ul>'
26
- + "".join(f"<li>{esc(row['text'])}</li>" for row in rows)
27
- + "</ul></section>"
28
- )
29
-
30
-
31
- def examples(document: dict) -> str:
32
- rows = document.get("examples") or []
33
- if not rows:
34
- return ""
35
- failed = any(row.get("failed_checks") for row in rows)
36
- title = "Failure examples" if failed else "Task evidence"
37
-
38
- def task_label(row: dict) -> str:
39
- value = str(row.get("task_id") or row.get("id"))
40
- parts = value.split("/")
41
- label = f"SOB task {parts[1]}" if len(parts) == 3 and parts[0] == "sob-text" else value
42
- return f'<span title="{esc(value)}">{esc(label)}</span>'
43
-
44
- body = (
45
- '<div class="table-wrap"><table><thead><tr>'
46
- "<th>Task</th><th>Outcome</th><th>Recorded checks</th></tr></thead><tbody>"
47
- + "".join(
48
- f"<tr><td>{task_label(row)}</td>"
49
- f"<td>{esc(row.get('outcome') or 'Recorded')}</td>"
50
- f"<td>{esc(', '.join(row.get('failed_checks') or []) or 'No failed check recorded')}</td></tr>"
51
- for row in rows
52
- )
53
- + "</tbody></table></div>"
54
- )
55
- if failed:
56
- return f'<section class="major" id="examples"><h2>{title}</h2>{body}</section>'
57
- return (
58
- f'<details class="fold" id="examples"><summary><h2>{title}</h2></summary>'
59
- f'<div class="fold-body">{body}</div></details>'
60
- )
61
-
62
-
63
- def next_steps(document: dict, *, links: bool = False) -> str:
64
- rows = document.get("next_steps") or []
65
- if not rows:
66
- return ""
67
- rendered = []
68
- for row in rows:
69
- title = esc(row.get("title") or "Next evaluation")
70
- href = row.get("setup_href")
71
- # Offline exports show the action as text. Web links are opt-in and local only.
72
- if (
73
- links
74
- and isinstance(href, str)
75
- and href.startswith("/")
76
- and not href.startswith("//")
77
- and "\\" not in href
78
- and not urlsplit(href).netloc
79
- ):
80
- title = f'<a href="{esc(href)}">{title}</a>'
81
- rendered.append(
82
- f"<li><strong>{title}</strong><p>{esc(row.get('reason') or '')}</p>"
83
- f'<p class="caption">{esc(row.get("what_it_tests") or "")}</p></li>'
84
- )
85
- return (
86
- '<section class="major" id="next-steps"><h2>Next steps</h2><ul>'
87
- + "".join(rendered)
88
- + "</ul></section>"
89
- )
90
-
91
-
92
- def methodology(document: dict) -> str:
93
- return (
94
- '<details class="fold" id="report-methodology"><summary><h2>Report method</h2></summary>'
95
- '<div class="fold-body"><ul>'
96
- + "".join(f"<li>{esc(item)}</li>" for item in document.get("methodology") or [])
97
- + '</ul><p class="caption">Template '
98
- + esc(document.get("template_version", "1"))
99
- + ". Report generation is free and makes no model calls. Evaluation charges are separate.</p></div></details>"
100
- )
File without changes
File without changes