evalrouter 0.4.2__tar.gz → 0.4.3__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 (95) hide show
  1. {evalrouter-0.4.2 → evalrouter-0.4.3}/PKG-INFO +1 -1
  2. {evalrouter-0.4.2 → evalrouter-0.4.3}/pyproject.toml +1 -1
  3. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/__init__.py +1 -1
  4. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/__init__.py +1 -1
  5. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_evaluation_jobs_cli.py +93 -10
  6. evalrouter-0.4.3/src/kimpton_evalrouter/_result_groups.py +196 -0
  7. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_tui_session.py +1 -1
  8. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/cli.py +126 -0
  9. evalrouter-0.4.2/src/kimpton_evalrouter/_result_groups.py +0 -42
  10. {evalrouter-0.4.2 → evalrouter-0.4.3}/LICENSE +0 -0
  11. {evalrouter-0.4.2 → evalrouter-0.4.3}/README.md +0 -0
  12. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/__init__.py +0 -0
  13. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/__main__.py +0 -0
  14. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/agents.py +0 -0
  15. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/langsmith.py +0 -0
  16. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/py.typed +0 -0
  17. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/tracing.py +0 -0
  18. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter/types.py +0 -0
  19. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/bundle.py +0 -0
  20. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/components.py +0 -0
  21. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/models.py +0 -0
  22. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/protocol.py +0 -0
  23. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/py.typed +0 -0
  24. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/templates.py +0 -0
  25. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/evalrouter_contracts/validation.py +0 -0
  26. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/__main__.py +0 -0
  27. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_account.py +0 -0
  28. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_acp_agents.py +0 -0
  29. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_acp_controller.py +0 -0
  30. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_acp_launch.py +0 -0
  31. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_acp_registry/LICENSE +0 -0
  32. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_acp_registry/registry-2026-10-06.json +0 -0
  33. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_artifacts.py +0 -0
  34. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_boundary.py +0 -0
  35. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_chain_prefetch.py +0 -0
  36. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_chart_format.py +0 -0
  37. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_chart_select.py +0 -0
  38. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_chart_specs.py +0 -0
  39. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_client_run.py +0 -0
  40. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_comparison.py +0 -0
  41. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_comparison_checkpoint.py +0 -0
  42. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_comparison_html.py +0 -0
  43. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_environment_publishing.py +0 -0
  44. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_failure_guidance.py +0 -0
  45. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_forecasts.py +0 -0
  46. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_group_results.py +0 -0
  47. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_group_review.py +0 -0
  48. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_group_summary_prefetch.py +0 -0
  49. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_groups.py +0 -0
  50. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_guided.py +0 -0
  51. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_helpers.py +0 -0
  52. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_history_labels.py +0 -0
  53. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_in_code.py +0 -0
  54. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_listing.py +0 -0
  55. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_progress.py +0 -0
  56. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_read_cache.py +0 -0
  57. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_reasoning_controls.py +0 -0
  58. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_release_cli.py +0 -0
  59. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_brand.py +0 -0
  60. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_chart_data.py +0 -0
  61. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_charts.py +0 -0
  62. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_document.py +0 -0
  63. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_document_html.py +0 -0
  64. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_pareto.py +0 -0
  65. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_report_theme.py +0 -0
  66. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_repository_checkout.py +0 -0
  67. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_resources.py +0 -0
  68. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_task_adapters/__init__.py +0 -0
  69. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_task_adapters/a1_prompt_answer.py +0 -0
  70. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_task_adapters/a2_environment.py +0 -0
  71. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_task_adapters/a3_file_task.py +0 -0
  72. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_task_adapters/a4_repository.py +0 -0
  73. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_task_mcp.py +0 -0
  74. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_transport.py +0 -0
  75. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_tui.py +0 -0
  76. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_tui_port.py +0 -0
  77. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_tui_table.py +0 -0
  78. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_tui_views.py +0 -0
  79. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_tune.py +0 -0
  80. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_update_notice.py +0 -0
  81. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_web_routes.py +0 -0
  82. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/_workload_cli.py +0 -0
  83. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/agents.py +0 -0
  84. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/langsmith.py +0 -0
  85. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/py.typed +0 -0
  86. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/__init__.py +0 -0
  87. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/_console.py +0 -0
  88. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/_theme.py +0 -0
  89. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/_widgets.py +0 -0
  90. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/live.py +0 -0
  91. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/picker.py +0 -0
  92. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/screens.py +0 -0
  93. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/render/tables.py +0 -0
  94. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/tracing.py +0 -0
  95. {evalrouter-0.4.2 → evalrouter-0.4.3}/src/kimpton_evalrouter/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalrouter
3
- Version: 0.4.2
3
+ Version: 0.4.3
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.4.2"
7
+ version = "0.4.3"
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.4.2"
11
+ __version__ = "0.4.3"
@@ -48,7 +48,7 @@ __all__ = [
48
48
  "WaitCancelled",
49
49
  "types",
50
50
  ]
51
- __version__ = "0.4.2"
51
+ __version__ = "0.4.3"
52
52
 
53
53
 
54
54
  class Client(_Transport):
@@ -6,7 +6,7 @@ import time
6
6
  import uuid
7
7
 
8
8
  from . import _guided, _tui_port
9
- from ._transport import ClientError
9
+ from ._transport import ClientError, segment
10
10
 
11
11
  ENDPOINT = "/evaluation-jobs"
12
12
  TERMINAL = {"completed", "partial", "failed", "cancelled"}
@@ -131,23 +131,106 @@ def recover(client, request, entry):
131
131
  return job
132
132
 
133
133
 
134
- def lines(job):
134
+ def _money(value):
135
+ from .render._widgets import format_money
136
+
137
+ return format_money(value)
138
+
139
+
140
+ def _count(value):
141
+ return f"{value:,}" if type(value) is int and value >= 0 else "?"
142
+
143
+
144
+ def _micro(value):
145
+ if type(value) is int and value >= 0:
146
+ return value
147
+ if isinstance(value, str) and value.isascii() and value.isdecimal():
148
+ return int(value)
149
+ return None
150
+
151
+
152
+ def lines(job, *, client=None):
153
+ """Project native result metrics and actual/pending costs without score inference."""
135
154
  summary = job.get("summary") or {}
136
- result = [f"Evaluation job {job['id']}: {job.get('status') or 'unknown'}"]
155
+ name = job.get("name") or job.get("id") or "unknown"
156
+ result = [f"Evaluation job {name}: {job.get('status') or 'unknown'}"]
157
+ if client is not None:
158
+ origin = _guided.web_origin(client)
159
+ job_id = job.get("id")
160
+ if origin and isinstance(job_id, str):
161
+ result.append(f"Web report: {origin}/evaluations/jobs/{segment(job_id)}")
137
162
  if summary:
138
163
  result.append(
139
- f" {summary.get('graded', '?')}/{summary.get('planned', '?')} graded; {summary.get('errors', '?')} errors"
164
+ f" {_count(summary.get('graded'))}/{_count(summary.get('planned'))} graded; "
165
+ f"{_count(summary.get('errors'))} errors; recorded spend "
166
+ f"{_money(summary.get('spend_microusd'))}"
167
+ )
168
+ pending_by_run = {}
169
+ cells = job.get("results") or []
170
+ for cell in cells:
171
+ if not isinstance(cell, dict):
172
+ continue
173
+ chain = [row for row in cell.get("chain") or [] if isinstance(row, dict)]
174
+ latest = chain[-1] if chain else {}
175
+ result.append(
176
+ f" Candidate {cell.get('candidate_index')}, benchmark "
177
+ f"{cell.get('evaluation_index')}: {cell.get('status') or 'unknown'}"
140
178
  )
141
- for child in job.get("children") or []:
179
+ for run in chain:
180
+ run_id = run.get("run_id")
181
+ if isinstance(run_id, str):
182
+ reserve = _micro(run.get("reserved_microusd"))
183
+ if run.get("billing_state") != "settled" and reserve:
184
+ pending_by_run[run_id] = reserve
185
+ run_id = latest.get("run_id") or cell.get("run_id")
186
+ if isinstance(run_id, str) and run_id:
187
+ report_url = _guided.report_url(client, run_id) if client is not None else None
188
+ result.append(f" Native report: {report_url or f'evalrouter open {run_id}'}")
189
+ result.append(f" Native task results: evalrouter results {run_id}")
190
+ if cell.get("complete_chain_head") is False and len(chain) > 1:
191
+ result.append(
192
+ " Continuation chain is not a complete result; inspect each native run."
193
+ )
194
+ if pending_by_run:
142
195
  result.append(
143
- f" Candidate {child.get('candidate_index')}, benchmark {child.get('evaluation_index')}: "
144
- f"{child.get('status') or 'unknown'} | run {child.get('run_id') or 'not admitted'}"
196
+ f" Pending holds: {_money(str(sum(pending_by_run.values())))}; not included as spend."
145
197
  )
198
+ if not cells:
199
+ for child in job.get("children") or []:
200
+ if not isinstance(child, dict):
201
+ continue
202
+ run_id = child.get("run_id")
203
+ result.append(
204
+ f" Candidate {child.get('candidate_index')}, benchmark "
205
+ f"{child.get('evaluation_index')}: {child.get('status') or 'unknown'}"
206
+ + (f" | run {run_id}" if run_id else " | not admitted")
207
+ )
146
208
  for item in job.get("board") or []:
209
+ if not isinstance(item, dict):
210
+ continue
147
211
  result.append(
148
- f" {item.get('benchmark_name') or item.get('profile_id') or item.get('evaluation_index')}: "
149
- f"{item.get('graded', '?')}/{item.get('planned', '?')} graded"
212
+ f" {item.get('benchmark_name') or item.get('benchmark_id') or item.get('evaluation_index')}"
150
213
  )
214
+ for candidate in item.get("candidates") or []:
215
+ if not isinstance(candidate, dict):
216
+ continue
217
+ coverage = (
218
+ candidate.get("coverage") if isinstance(candidate.get("coverage"), dict) else {}
219
+ )
220
+ result.append(
221
+ f" Candidate {candidate.get('candidate_index')}: {candidate.get('status') or 'unknown'} | "
222
+ f"{_count(coverage.get('graded'))}/{_count(coverage.get('planned'))} graded | "
223
+ f"{_count(coverage.get('errors'))} errors"
224
+ )
225
+ headline = candidate.get("headline")
226
+ if isinstance(headline, dict):
227
+ result.append(f" Native metric {headline.get('key')}: {headline.get('value')}")
228
+ comparison = candidate.get("comparison")
229
+ if isinstance(comparison, dict):
230
+ if comparison.get("comparable") is True and comparison.get("delta") is not None:
231
+ result.append(f" Paired delta {comparison.get('delta')}")
232
+ elif comparison.get("reason"):
233
+ result.append(f" Comparison inconclusive: {comparison.get('reason')}")
151
234
  return result
152
235
 
153
236
 
@@ -177,5 +260,5 @@ def follow(client, job, args, *, clock=time):
177
260
  terminal = job.get("status") in TERMINAL
178
261
  if terminal:
179
262
  job = client.evaluation_jobs.results(identifier)
180
- args.guided_render = lines
263
+ args.guided_render = lambda result: lines(result, client=client)
181
264
  return job, (0 if not terminal or job.get("status") == "completed" else 1)
@@ -0,0 +1,196 @@
1
+ """Attach existing evaluation runs to a private, reusable results parent."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ from . import _artifacts, _guided, render
11
+ from ._transport import ClientError, segment
12
+ from .render._widgets import _plain
13
+
14
+
15
+ def _label(value: object) -> str:
16
+ return _plain(value) if isinstance(value, (str, int)) else "unknown"
17
+
18
+
19
+ def _count(value: object) -> str:
20
+ return f"{value:,}" if type(value) is int and value >= 0 else "unknown"
21
+
22
+
23
+ def _summary_lines(title: str, summary: object) -> list[str]:
24
+ if not isinstance(summary, dict):
25
+ return [f"{title}: summary unavailable"]
26
+ full_passes = summary.get("full_pass_count")
27
+ planned = summary.get("planned_count")
28
+ success = summary.get("success_rate")
29
+ rate = (
30
+ f"{success * 100:.1f}%"
31
+ if type(success) in {float, int} and 0 <= success <= 1
32
+ else "unavailable"
33
+ )
34
+ lines = [
35
+ f"{title}: {_count(full_passes)} / {_count(planned)} full passes ({rate})",
36
+ f" Graded {_count(summary.get('graded_count'))} / {_count(planned)}; "
37
+ f"errors {_count(summary.get('error_count'))}; "
38
+ f"cancelled {_count(summary.get('cancelled_count'))}; "
39
+ f"skipped {_count(summary.get('skipped_count'))}",
40
+ f" Customer charges: {render.format_money(summary.get('charged_microusd'))}; "
41
+ f"total cost: {render.format_money(summary.get('total_cost_microusd'))}",
42
+ ]
43
+ per_pass = summary.get("cost_per_success_microusd")
44
+ if isinstance(per_pass, str):
45
+ cost = render.format_money(per_pass)
46
+ elif type(full_passes) is int and full_passes == 0:
47
+ cost = "unavailable (no full passes)"
48
+ elif type(summary.get("pending_operations")) is int and summary["pending_operations"] > 0:
49
+ cost = f"unavailable ({summary['pending_operations']} pending operations)"
50
+ elif summary.get("costs_complete") is not True:
51
+ cost = "unavailable (billing incomplete or external cost unknown)"
52
+ else:
53
+ cost = "unavailable (full-pass score not interpretable)"
54
+ lines.append(f" Cost per full pass: {cost}")
55
+ return lines
56
+
57
+
58
+ def detail_lines(group: dict, client=None) -> list[str]:
59
+ """Readable parent summary followed by independent native child results."""
60
+ lines = [f"Result group: {_label(group.get('name'))}", f"ID: {_label(group.get('id'))}"]
61
+ group_id = group.get("id")
62
+ origin = _guided.web_origin(client) if client is not None else None
63
+ if origin and isinstance(group_id, str):
64
+ lines.append(f"Web report: {origin}/evaluations/result-groups/{segment(group_id)}")
65
+ lines.extend(_summary_lines("Overall", group.get("summary")))
66
+ if group.get("costs_as_of"):
67
+ lines.append(f"Current billing read: {_label(group['costs_as_of'])}")
68
+ compatibility = group.get("compatibility")
69
+ if isinstance(compatibility, dict):
70
+ lines.append(
71
+ "Comparability: "
72
+ + (
73
+ "supported by frozen evidence"
74
+ if compatibility.get("comparable") is True
75
+ else "not established across this group"
76
+ )
77
+ )
78
+ models = [model for model in group.get("models") or [] if isinstance(model, dict)]
79
+ if models:
80
+ model_rows = []
81
+ for model in models:
82
+ summary = model.get("summary") if isinstance(model.get("summary"), dict) else {}
83
+ passes, planned, success = (
84
+ summary.get("full_pass_count"),
85
+ summary.get("planned_count"),
86
+ summary.get("success_rate"),
87
+ )
88
+ rate = (
89
+ f"{success * 100:.1f}%"
90
+ if type(success) in {float, int} and 0 <= success <= 1
91
+ else "unknown"
92
+ )
93
+ pending = summary.get("pending_operations")
94
+ per_pass = summary.get("cost_per_success_microusd")
95
+ cost_per_pass = (
96
+ render.format_money(per_pass)
97
+ if isinstance(per_pass, str)
98
+ else "none"
99
+ if type(passes) is int and passes == 0
100
+ else "pending"
101
+ if type(pending) is int and pending > 0
102
+ else "unknown"
103
+ )
104
+ billing = (
105
+ f"pending {_count(pending)}"
106
+ if type(pending) is int and pending > 0
107
+ else "complete"
108
+ if summary.get("costs_complete") is True
109
+ and summary.get("total_cost_microusd") is not None
110
+ else "unknown"
111
+ )
112
+ model_rows.append(
113
+ [
114
+ _label(model.get("model_label")),
115
+ f"{_count(passes)} / {_count(planned)}",
116
+ rate,
117
+ _count(summary.get("error_count")),
118
+ render.format_money(summary.get("charged_microusd")),
119
+ cost_per_pass,
120
+ billing,
121
+ ]
122
+ )
123
+ lines.extend(
124
+ [
125
+ "",
126
+ "Model summary",
127
+ *render.screens.to_lines(
128
+ [
129
+ render.screens._grid(
130
+ [
131
+ ("Model", "left", 0),
132
+ ("Full passes / tasks", "right", 0),
133
+ ("Success", "right", 0),
134
+ ("Errors", "right", 1),
135
+ ("Charges", "right", 0),
136
+ ("Cost / pass", "right", 0),
137
+ ("Billing", "left", 2),
138
+ ],
139
+ model_rows,
140
+ )
141
+ ],
142
+ sys.stdout,
143
+ ),
144
+ ]
145
+ )
146
+ for model in models:
147
+ lines.extend(["", f"Model: {_label(model.get('model_label'))}"])
148
+ for child in model.get("children") or []:
149
+ if not isinstance(child, dict):
150
+ continue
151
+ lines.append(
152
+ f" Environment: {_label(child.get('environment_label'))} | "
153
+ f"{_label(child.get('status'))} | billing {_label(child.get('billing_state'))}"
154
+ )
155
+ child_summary = child.get("summary")
156
+ if isinstance(child_summary, dict):
157
+ lines.extend(_summary_lines(" Environment summary", child_summary))
158
+ run_id = child.get("run_id")
159
+ if isinstance(run_id, str) and run_id:
160
+ report_url = _guided.report_url(client, run_id) if client is not None else None
161
+ lines.append(f" Native report: {report_url or f'evalrouter open {run_id}'}")
162
+ lines.append(f" Native task results: evalrouter results {run_id}")
163
+ lines.extend(["", "Each child keeps its own tasks, grader, result version and receipts."])
164
+ return lines
165
+
166
+
167
+ def command(client, args):
168
+ """Create or read result groups. No operation here starts or changes a run."""
169
+ if args.action == "create":
170
+ if len(args.run_ids) < 2:
171
+ raise ClientError("invalid_input", "Choose at least two existing run IDs.")
172
+ if len(args.run_ids) > 64:
173
+ raise ClientError("invalid_input", "A result group accepts at most 64 existing run IDs.")
174
+ value = client.result_groups.create({"name": args.name, "run_ids": args.run_ids})
175
+ elif args.action == "list":
176
+ value = client.result_groups.list(params={"limit": args.limit, "cursor": args.cursor})
177
+ elif args.action == "get":
178
+ value = client.result_groups.get(args.group_id)
179
+ else:
180
+ value = client.result_groups.export(args.group_id)
181
+ path = Path(args.output)
182
+ if path.exists() or path.is_symlink():
183
+ raise ClientError("destination_exists", f"Destination already exists: {path}")
184
+ if not path.parent.is_dir():
185
+ raise ClientError("invalid_output", f"Output directory does not exist: {path.parent}")
186
+ data = value if isinstance(value, bytes) else json.dumps(
187
+ value, ensure_ascii=False, indent=2
188
+ ).encode("utf-8") + b"\n"
189
+ try:
190
+ with os.fdopen(os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600), "wb") as stream:
191
+ stream.write(data)
192
+ except FileExistsError:
193
+ raise ClientError("destination_exists", f"Destination already exists: {path}") from None
194
+ _artifacts.saved(args, "result group export", path)
195
+ return {"path": str(path.resolve())}, 0
196
+ return value, 0
@@ -506,7 +506,7 @@ class Session:
506
506
  self.ui(
507
507
  self.app.show_watch,
508
508
  "Evaluation job status",
509
- "\n".join(_evaluation_jobs_cli.lines(job)),
509
+ "\n".join(_evaluation_jobs_cli.lines(job, client=client)),
510
510
  )
511
511
  if job.get("status") in _evaluation_jobs_cli.TERMINAL:
512
512
  return job
@@ -3459,6 +3459,10 @@ def human_result(command, value, **options):
3459
3459
  colour = not render.is_plain(sys.stdout)
3460
3460
  if command == "evaluation-jobs":
3461
3461
  action = options.get("action")
3462
+ if action == "results":
3463
+ from . import _evaluation_jobs_cli
3464
+
3465
+ return _evaluation_jobs_cli.lines(value, client=options.get("client"))
3462
3466
  if action == "preflight" or isinstance(value.get("preflight"), dict):
3463
3467
  preview = value.get("preflight") if isinstance(value.get("preflight"), dict) else value
3464
3468
  lines.append(
@@ -3496,6 +3500,29 @@ def human_result(command, value, **options):
3496
3500
  f" {scalar(item.get('benchmark_name') or item.get('profile_id') or item.get('evaluation_index'))}: "
3497
3501
  f"{scalar(item.get('graded'))}/{scalar(item.get('planned'))} graded"
3498
3502
  )
3503
+ elif command == "result-group":
3504
+ if options.get("action") == "get":
3505
+ return _result_groups.detail_lines(value, options.get("client"))
3506
+ if options.get("action") == "export":
3507
+ return []
3508
+ if options.get("action") == "create":
3509
+ group_id = scalar(value.get("id"))
3510
+ return [
3511
+ f"Saved result group {group_id}",
3512
+ f"Read it with: evalrouter result-group get {group_id}",
3513
+ ]
3514
+ rows = value.get("data") if isinstance(value.get("data"), list) else [value]
3515
+ lines.append("Saved result groups")
3516
+ for row in rows:
3517
+ if isinstance(row, dict):
3518
+ lines.append(
3519
+ f" {scalar(row.get('name') or row.get('id'))} | "
3520
+ f"{scalar(row.get('model_count'))} models | "
3521
+ f"{scalar(row.get('environment_count'))} environments | "
3522
+ f"{scalar(row.get('member_count'))} runs | ID {scalar(row.get('id'))}"
3523
+ )
3524
+ if not rows:
3525
+ lines.append(" No saved result groups.")
3499
3526
  elif command in {"campaigns", "campaign-templates"}:
3500
3527
  rows = value.get("data") if isinstance(value.get("data"), list) else [value]
3501
3528
  lines.append("Evaluation campaigns" if command == "campaigns" else "Recurring campaign authority")
@@ -4442,6 +4469,8 @@ def browse_reports(client, args):
4442
4469
  "Results",
4443
4470
  [
4444
4471
  ("Single run", "single"),
4472
+ ("Saved result group", "saved-group"),
4473
+ ("One-time evaluation job", "evaluation-job"),
4445
4474
  ("Group run", "group"),
4446
4475
  ("Compare runs", "compare"),
4447
4476
  ],
@@ -4455,6 +4484,10 @@ def browse_reports(client, args):
4455
4484
  args.guided_render = follow.guided_render
4456
4485
  args.home_group_status_page = getattr(follow, "home_group_status_page", False)
4457
4486
  return value, code
4487
+ if mode == "saved-group":
4488
+ return browse_saved_result_groups(client, args)
4489
+ if mode == "evaluation-job":
4490
+ return browse_evaluation_jobs(client, args)
4458
4491
  return select_report_runs(client, args, mode)
4459
4492
  except _guided.Back:
4460
4493
  if args.run_ids:
@@ -4462,6 +4495,98 @@ def browse_reports(client, args):
4462
4495
  _guided.erase_to(start)
4463
4496
 
4464
4497
 
4498
+ def browse_saved_result_groups(client, args):
4499
+ """Select a saved private parent and show its independent native results."""
4500
+ rows, cursor = [], None
4501
+ while True:
4502
+ with _guided.loading("Loading saved result groups..."):
4503
+ page = client.result_groups.list(params={"limit": 50, "cursor": cursor})
4504
+ rows.extend(row for row in page.get("data", []) if isinstance(row, dict))
4505
+ next_cursor = page.get("next_cursor")
4506
+ if not rows:
4507
+ args.guided_render = lambda _: ["No saved result groups in this workspace yet."]
4508
+ return {"data": []}, 0
4509
+ options = [
4510
+ (
4511
+ f"{display_scalar(row.get('name') or 'Result group')} · "
4512
+ f"{display_scalar(row.get('model_count'))} models · "
4513
+ f"{display_scalar(row.get('environment_count'))} environments · "
4514
+ f"{display_scalar(row.get('member_count'))} runs · "
4515
+ f"{display_scalar(row.get('created_at'))}",
4516
+ index,
4517
+ )
4518
+ for index, row in enumerate(rows)
4519
+ ]
4520
+ if next_cursor:
4521
+ options.append(("Load older result groups…", "more"))
4522
+ table = (
4523
+ ["Name", "Models", "Environments", "Runs", "Created"],
4524
+ [
4525
+ [
4526
+ display_scalar(row.get("name")),
4527
+ display_scalar(row.get("model_count")),
4528
+ display_scalar(row.get("environment_count")),
4529
+ display_scalar(row.get("member_count")),
4530
+ display_scalar(row.get("created_at")),
4531
+ ]
4532
+ for row in rows
4533
+ ],
4534
+ )
4535
+ selected = _guided.choose("Saved result groups", options, table=table)
4536
+ if selected == "more":
4537
+ cursor = next_cursor
4538
+ continue
4539
+ with _guided.loading("Loading the saved result group..."):
4540
+ group = client.result_groups.get(rows[selected]["id"])
4541
+ args.guided_render = lambda _, group=group: _result_groups.detail_lines(group, client)
4542
+ return group, 0
4543
+
4544
+
4545
+ def browse_evaluation_jobs(client, args):
4546
+ """Select a one-time job and show its native result board."""
4547
+ rows, cursor = [], None
4548
+ while True:
4549
+ with _guided.loading("Loading one-time evaluation jobs..."):
4550
+ page = client.evaluation_jobs.list(params={"limit": 50, "cursor": cursor})
4551
+ rows.extend(row for row in page.get("data", []) if isinstance(row, dict))
4552
+ next_cursor = page.get("next_cursor")
4553
+ if not rows:
4554
+ args.guided_render = lambda _: ["No one-time evaluation jobs in this workspace yet."]
4555
+ return {"data": []}, 0
4556
+ options = [
4557
+ (
4558
+ f"{display_scalar(row.get('name') or 'Evaluation job')} · "
4559
+ f"{display_scalar(row.get('status'))} · {display_scalar(row.get('created_at'))}",
4560
+ index,
4561
+ )
4562
+ for index, row in enumerate(rows)
4563
+ ]
4564
+ if next_cursor:
4565
+ options.append(("Load older evaluation jobs…", "more"))
4566
+ table = (
4567
+ ["Name", "Status", "Created", "ID"],
4568
+ [
4569
+ [
4570
+ display_scalar(row.get("name")),
4571
+ display_scalar(row.get("status")),
4572
+ display_scalar(row.get("created_at")),
4573
+ display_scalar(row.get("id")),
4574
+ ]
4575
+ for row in rows
4576
+ ],
4577
+ )
4578
+ selected = _guided.choose("One-time evaluation jobs", options, table=table)
4579
+ if selected == "more":
4580
+ cursor = next_cursor
4581
+ continue
4582
+ with _guided.loading("Loading the job results..."):
4583
+ job = client.evaluation_jobs.results(rows[selected]["id"])
4584
+ from . import _evaluation_jobs_cli
4585
+
4586
+ args.guided_render = lambda _, job=job: _evaluation_jobs_cli.lines(job, client=client)
4587
+ return job, 0
4588
+
4589
+
4465
4590
  def check_report_runs(client, picked: list[str]) -> list[str] | None:
4466
4591
  """Runs to compare, checked in one full-screen list; None where it cannot be shown.
4467
4592
 
@@ -5391,6 +5516,7 @@ def main(argv=None, *, _home=False):
5391
5516
  all_metrics=getattr(args, "all_metrics", False),
5392
5517
  failures=getattr(args, "failures", None),
5393
5518
  base=_account.base_url(args),
5519
+ client=client,
5394
5520
  action=getattr(args, "action", None),
5395
5521
  )
5396
5522
  )
@@ -1,42 +0,0 @@
1
- """Attach existing evaluation runs to a private, reusable results parent."""
2
-
3
- from __future__ import annotations
4
-
5
- import json
6
- import os
7
- from pathlib import Path
8
-
9
- from . import _artifacts
10
- from ._transport import ClientError
11
-
12
-
13
- def command(client, args):
14
- """Create or read result groups. No operation here starts or changes a run."""
15
- if args.action == "create":
16
- if len(args.run_ids) < 2:
17
- raise ClientError("invalid_input", "Choose at least two existing run IDs.")
18
- if len(args.run_ids) > 64:
19
- raise ClientError("invalid_input", "A result group accepts at most 64 existing run IDs.")
20
- value = client.result_groups.create({"name": args.name, "run_ids": args.run_ids})
21
- elif args.action == "list":
22
- value = client.result_groups.list(params={"limit": args.limit, "cursor": args.cursor})
23
- elif args.action == "get":
24
- value = client.result_groups.get(args.group_id)
25
- else:
26
- value = client.result_groups.export(args.group_id)
27
- path = Path(args.output)
28
- if path.exists() or path.is_symlink():
29
- raise ClientError("destination_exists", f"Destination already exists: {path}")
30
- if not path.parent.is_dir():
31
- raise ClientError("invalid_output", f"Output directory does not exist: {path.parent}")
32
- data = value if isinstance(value, bytes) else json.dumps(
33
- value, ensure_ascii=False, indent=2
34
- ).encode("utf-8") + b"\n"
35
- try:
36
- with os.fdopen(os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600), "wb") as stream:
37
- stream.write(data)
38
- except FileExistsError:
39
- raise ClientError("destination_exists", f"Destination already exists: {path}") from None
40
- _artifacts.saved(args, "result group export", path)
41
- return {"path": str(path.resolve())}, 0
42
- return value, 0
File without changes
File without changes