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.
Files changed (58) hide show
  1. pluginbench/__init__.py +3 -0
  2. pluginbench/__main__.py +3 -0
  3. pluginbench/assessment-charts.html +790 -0
  4. pluginbench/assessment.py +316 -0
  5. pluginbench/assessment_charts.py +1225 -0
  6. pluginbench/assessment_metrics.py +1956 -0
  7. pluginbench/assessment_models.py +127 -0
  8. pluginbench/baselines.py +792 -0
  9. pluginbench/claude.py +374 -0
  10. pluginbench/cli.py +672 -0
  11. pluginbench/code_diff.py +207 -0
  12. pluginbench/codex.py +451 -0
  13. pluginbench/codex_events.py +585 -0
  14. pluginbench/collectors.py +591 -0
  15. pluginbench/compare.py +927 -0
  16. pluginbench/components.py +129 -0
  17. pluginbench/coverage_report.py +610 -0
  18. pluginbench/datasets.py +207 -0
  19. pluginbench/evaluation.example.yaml +45 -0
  20. pluginbench/evaluation.py +1651 -0
  21. pluginbench/evaluation_report.py +1004 -0
  22. pluginbench/fallow_parse.mjs +101 -0
  23. pluginbench/harbor_backend.py +2946 -0
  24. pluginbench/isolation.py +314 -0
  25. pluginbench/judge.py +683 -0
  26. pluginbench/language_analysis.py +915 -0
  27. pluginbench/ledger.py +217 -0
  28. pluginbench/measurement_profiles.py +616 -0
  29. pluginbench/native_treatment_runtime.js +221 -0
  30. pluginbench/native_treatments.py +155 -0
  31. pluginbench/observer_data/go-analysis-v1/go.mod +10 -0
  32. pluginbench/observer_data/go-analysis-v1/go.sum +10 -0
  33. pluginbench/observer_data/go-analysis-v1/main.go +64 -0
  34. pluginbench/observer_data/oxc-parser-0.126.0/package-lock.json +449 -0
  35. pluginbench/observer_data/oxc-parser-0.126.0/package.json +5 -0
  36. pluginbench/parallel.py +101 -0
  37. pluginbench/processes.py +100 -0
  38. pluginbench/remeasure.py +992 -0
  39. pluginbench/run_lock.py +227 -0
  40. pluginbench/run_status.py +518 -0
  41. pluginbench/study.py +1858 -0
  42. pluginbench/study_review.py +924 -0
  43. pluginbench/submissions.py +486 -0
  44. pluginbench/task_sources.py +403 -0
  45. pluginbench/treatments.py +388 -0
  46. pluginbench/trial_containers.py +94 -0
  47. pluginbench/vendor/ECHARTS-LICENSE +222 -0
  48. pluginbench/vendor/ECHARTS-NOTICE +5 -0
  49. pluginbench/vendor/ZRENDER-LICENSE +29 -0
  50. pluginbench/vendor/echarts.min.js +48 -0
  51. pluginbench-0.5.0.dist-info/METADATA +294 -0
  52. pluginbench-0.5.0.dist-info/RECORD +58 -0
  53. pluginbench-0.5.0.dist-info/WHEEL +4 -0
  54. pluginbench-0.5.0.dist-info/entry_points.txt +2 -0
  55. pluginbench-0.5.0.dist-info/licenses/LICENSE +201 -0
  56. pluginbench-0.5.0.dist-info/licenses/src/pluginbench/vendor/ECHARTS-LICENSE +222 -0
  57. pluginbench-0.5.0.dist-info/licenses/src/pluginbench/vendor/ECHARTS-NOTICE +5 -0
  58. 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