pluginbench 0.5.0__py3-none-any.whl
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.
- pluginbench/__init__.py +3 -0
- pluginbench/__main__.py +3 -0
- pluginbench/assessment-charts.html +790 -0
- pluginbench/assessment.py +316 -0
- pluginbench/assessment_charts.py +1225 -0
- pluginbench/assessment_metrics.py +1956 -0
- pluginbench/assessment_models.py +127 -0
- pluginbench/baselines.py +792 -0
- pluginbench/claude.py +374 -0
- pluginbench/cli.py +672 -0
- pluginbench/code_diff.py +207 -0
- pluginbench/codex.py +451 -0
- pluginbench/codex_events.py +585 -0
- pluginbench/collectors.py +591 -0
- pluginbench/compare.py +927 -0
- pluginbench/components.py +129 -0
- pluginbench/coverage_report.py +610 -0
- pluginbench/datasets.py +207 -0
- pluginbench/evaluation.example.yaml +45 -0
- pluginbench/evaluation.py +1651 -0
- pluginbench/evaluation_report.py +1004 -0
- pluginbench/fallow_parse.mjs +101 -0
- pluginbench/harbor_backend.py +2946 -0
- pluginbench/isolation.py +314 -0
- pluginbench/judge.py +683 -0
- pluginbench/language_analysis.py +915 -0
- pluginbench/ledger.py +217 -0
- pluginbench/measurement_profiles.py +616 -0
- pluginbench/native_treatment_runtime.js +221 -0
- pluginbench/native_treatments.py +155 -0
- pluginbench/observer_data/go-analysis-v1/go.mod +10 -0
- pluginbench/observer_data/go-analysis-v1/go.sum +10 -0
- pluginbench/observer_data/go-analysis-v1/main.go +64 -0
- pluginbench/observer_data/oxc-parser-0.126.0/package-lock.json +449 -0
- pluginbench/observer_data/oxc-parser-0.126.0/package.json +5 -0
- pluginbench/parallel.py +101 -0
- pluginbench/processes.py +100 -0
- pluginbench/remeasure.py +992 -0
- pluginbench/run_lock.py +227 -0
- pluginbench/run_status.py +518 -0
- pluginbench/study.py +1858 -0
- pluginbench/study_review.py +924 -0
- pluginbench/submissions.py +486 -0
- pluginbench/task_sources.py +403 -0
- pluginbench/treatments.py +388 -0
- pluginbench/trial_containers.py +94 -0
- pluginbench/vendor/ECHARTS-LICENSE +222 -0
- pluginbench/vendor/ECHARTS-NOTICE +5 -0
- pluginbench/vendor/ZRENDER-LICENSE +29 -0
- pluginbench/vendor/echarts.min.js +48 -0
- pluginbench-0.5.0.dist-info/METADATA +294 -0
- pluginbench-0.5.0.dist-info/RECORD +58 -0
- pluginbench-0.5.0.dist-info/WHEEL +4 -0
- pluginbench-0.5.0.dist-info/entry_points.txt +2 -0
- pluginbench-0.5.0.dist-info/licenses/LICENSE +201 -0
- pluginbench-0.5.0.dist-info/licenses/src/pluginbench/vendor/ECHARTS-LICENSE +222 -0
- pluginbench-0.5.0.dist-info/licenses/src/pluginbench/vendor/ECHARTS-NOTICE +5 -0
- pluginbench-0.5.0.dist-info/licenses/src/pluginbench/vendor/ZRENDER-LICENSE +29 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""The offline assessment input contract; paths are relative to its owning document."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
from pydantic import (
|
|
10
|
+
BaseModel,
|
|
11
|
+
ConfigDict,
|
|
12
|
+
Field,
|
|
13
|
+
StrictBool,
|
|
14
|
+
StrictStr,
|
|
15
|
+
field_validator,
|
|
16
|
+
model_validator,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
Digest = str
|
|
20
|
+
MetricKind = Literal["fallow", "analysis", "coverage"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class InputModel(BaseModel):
|
|
24
|
+
model_config = ConfigDict(extra="forbid", allow_inf_nan=False)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ArtifactRef(InputModel):
|
|
28
|
+
path: Path
|
|
29
|
+
sha256: Digest = Field(pattern=r"^sha256:[a-f0-9]{64}$")
|
|
30
|
+
|
|
31
|
+
@field_validator("path")
|
|
32
|
+
@classmethod
|
|
33
|
+
def relative_path(cls, value: Path) -> Path:
|
|
34
|
+
if value.is_absolute():
|
|
35
|
+
raise ValueError("assessment paths must be relative to the manifest")
|
|
36
|
+
return value
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Work(InputModel):
|
|
40
|
+
elapsed_seconds: float | None = Field(default=None, strict=True, ge=0)
|
|
41
|
+
tokens: dict[str, object] | None = None
|
|
42
|
+
dollars: float | None = Field(default=None, strict=True, ge=0)
|
|
43
|
+
token_format: str | None = None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class Runtime(InputModel):
|
|
47
|
+
"""Declared harness metadata; requested effort is never observed evidence."""
|
|
48
|
+
|
|
49
|
+
harness: StrictStr | None = None
|
|
50
|
+
harness_version: StrictStr | None = None
|
|
51
|
+
requested_reasoning_effort: StrictStr | None = None
|
|
52
|
+
reasoning_effort: StrictStr | None = None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class CorrectnessReceipt(InputModel):
|
|
56
|
+
schema_version: Literal[1]
|
|
57
|
+
snapshot_digest: Digest = Field(pattern=r"^sha256:[a-f0-9]{64}$")
|
|
58
|
+
checks: dict[str, StrictBool | None]
|
|
59
|
+
command: list[str] = Field(min_length=1)
|
|
60
|
+
tool: str = Field(min_length=1)
|
|
61
|
+
tool_version: str | None = None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class StageInput(InputModel):
|
|
65
|
+
id: Literal["handoff"]
|
|
66
|
+
snapshot: ArtifactRef | None = None
|
|
67
|
+
correctness: ArtifactRef | None = None
|
|
68
|
+
evidence: dict[MetricKind, ArtifactRef] | None = None
|
|
69
|
+
work: Work | None = None
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class AttemptInput(InputModel):
|
|
73
|
+
id: str = Field(min_length=1)
|
|
74
|
+
task_id: str = Field(min_length=1)
|
|
75
|
+
attempt: int = Field(default=1, strict=True, ge=1)
|
|
76
|
+
arm: str | None = None
|
|
77
|
+
model: str | None = None
|
|
78
|
+
runtime: Runtime | None = None
|
|
79
|
+
before: ArtifactRef | None = None
|
|
80
|
+
before_evidence: dict[MetricKind, ArtifactRef] | None = None
|
|
81
|
+
stages: list[StageInput] = Field(min_length=1, max_length=1)
|
|
82
|
+
|
|
83
|
+
@model_validator(mode="after")
|
|
84
|
+
def bound_before(self) -> AttemptInput:
|
|
85
|
+
if self.before is None and self.before_evidence:
|
|
86
|
+
raise ValueError("before evidence requires a source snapshot")
|
|
87
|
+
return self
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class AssessmentInput(InputModel):
|
|
91
|
+
schema_version: Literal[1]
|
|
92
|
+
name: str = Field(min_length=1)
|
|
93
|
+
records: list[AttemptInput] = Field(min_length=1)
|
|
94
|
+
|
|
95
|
+
@model_validator(mode="after")
|
|
96
|
+
def unique_records(self) -> AssessmentInput:
|
|
97
|
+
if len({record.id for record in self.records}) != len(self.records):
|
|
98
|
+
raise ValueError("assessment record IDs must be unique")
|
|
99
|
+
return self
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
@dataclass(frozen=True)
|
|
103
|
+
class Snapshot:
|
|
104
|
+
root: Path
|
|
105
|
+
digest: str
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@dataclass(frozen=True)
|
|
109
|
+
class Stage:
|
|
110
|
+
id: str
|
|
111
|
+
snapshot: Snapshot | None
|
|
112
|
+
correctness: CorrectnessReceipt | None
|
|
113
|
+
evidence: dict[str, str] | None
|
|
114
|
+
work: Work | None
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@dataclass(frozen=True)
|
|
118
|
+
class Attempt:
|
|
119
|
+
id: str
|
|
120
|
+
task_id: str
|
|
121
|
+
attempt: int
|
|
122
|
+
arm: str | None
|
|
123
|
+
model: str | None
|
|
124
|
+
before: Snapshot | None
|
|
125
|
+
stages: tuple[Stage, ...]
|
|
126
|
+
provenance: dict[str, object]
|
|
127
|
+
before_evidence: dict[str, str] | None = None
|