evaldenom 0.1.0__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.
- evaldenom-0.1.0/LICENSE +21 -0
- evaldenom-0.1.0/PKG-INFO +242 -0
- evaldenom-0.1.0/README.md +227 -0
- evaldenom-0.1.0/pyproject.toml +24 -0
- evaldenom-0.1.0/setup.cfg +4 -0
- evaldenom-0.1.0/src/evaldenom/__init__.py +3 -0
- evaldenom-0.1.0/src/evaldenom/__main__.py +2 -0
- evaldenom-0.1.0/src/evaldenom/cli.py +145 -0
- evaldenom-0.1.0/src/evaldenom/core.py +265 -0
- evaldenom-0.1.0/src/evaldenom/manifestdiff.py +71 -0
- evaldenom-0.1.0/src/evaldenom/promptfoo.py +161 -0
- evaldenom-0.1.0/src/evaldenom.egg-info/PKG-INFO +242 -0
- evaldenom-0.1.0/src/evaldenom.egg-info/SOURCES.txt +24 -0
- evaldenom-0.1.0/src/evaldenom.egg-info/dependency_links.txt +1 -0
- evaldenom-0.1.0/src/evaldenom.egg-info/entry_points.txt +2 -0
- evaldenom-0.1.0/src/evaldenom.egg-info/top_level.txt +1 -0
- evaldenom-0.1.0/tests/test_cli.py +89 -0
- evaldenom-0.1.0/tests/test_contract.py +156 -0
- evaldenom-0.1.0/tests/test_examples.py +17 -0
- evaldenom-0.1.0/tests/test_invariants.py +82 -0
- evaldenom-0.1.0/tests/test_manifestdiff.py +211 -0
- evaldenom-0.1.0/tests/test_manifestdiff_installed.py +32 -0
- evaldenom-0.1.0/tests/test_output_delivery.py +157 -0
- evaldenom-0.1.0/tests/test_promptfoo.py +373 -0
- evaldenom-0.1.0/tests/test_promptfoo_cli.py +132 -0
- evaldenom-0.1.0/tests/test_promptfoo_row_score.py +98 -0
evaldenom-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anish Pentyala
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
evaldenom-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: evaldenom
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Offline intended-coverage and identity preflight for evaluation exports
|
|
5
|
+
Author: Anish Pentyala
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/anishpentyala/evaldenom
|
|
8
|
+
Project-URL: Repository, https://github.com/anishpentyala/evaldenom
|
|
9
|
+
Project-URL: Issues, https://github.com/anishpentyala/evaldenom/issues
|
|
10
|
+
Keywords: evaluation,data-validation,machine-learning
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# evaldenom
|
|
17
|
+
|
|
18
|
+
[](https://github.com/anishpentyala/evaldenom/actions)
|
|
19
|
+
|
|
20
|
+
Check that evaluation exports cover the cases you intended to measure before
|
|
21
|
+
comparing their scores. Offline, Python standard library only.
|
|
22
|
+
|
|
23
|
+
A paired comparison can look better because a hard case errored, disappeared,
|
|
24
|
+
changed its input under the same ID, used a different grader, or lost a repeated
|
|
25
|
+
trial. Statistical comparison tools often report their matched subset. This tool
|
|
26
|
+
asks a prior question: do both supplied exports satisfy the same intended contract?
|
|
27
|
+
|
|
28
|
+
It does not run models, compute significance, pick a best run, average repeated
|
|
29
|
+
trials, fill missing scores, retry requests, or change your dataset. A READY
|
|
30
|
+
report is a coverage/identity check on supplied claims, not proof that the model
|
|
31
|
+
saw those inputs or that an evaluator was implemented correctly.
|
|
32
|
+
|
|
33
|
+
## Try the missing-case check
|
|
34
|
+
|
|
35
|
+
Python 3.9 or newer, no runtime dependencies. The repository includes an invented
|
|
36
|
+
four-observation fixture: two cases with two trials each. The candidate drops
|
|
37
|
+
both hard-case trials.
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
git clone https://github.com/anishpentyala/evaldenom.git
|
|
41
|
+
cd evaldenom
|
|
42
|
+
python -m pip install .
|
|
43
|
+
evaldenom freeze examples/cases.jsonl --metrics examples/metrics.json --output manifest.json
|
|
44
|
+
evaldenom audit manifest.json --run baseline=examples/baseline.jsonl --run candidate=examples/candidate-missing.jsonl
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The audit exits 1 with `BLOCKED`, rather than approving comparison on only the
|
|
48
|
+
easy cases. Replace `candidate-missing.jsonl` with `candidate-complete.jsonl` for
|
|
49
|
+
an exit-0 `READY` report. Neither verdict establishes a score gain or verifies
|
|
50
|
+
that the claimed inputs and graders were actually used.
|
|
51
|
+
|
|
52
|
+
A PyPI release is being prepared. Until its package page is linked here, use the
|
|
53
|
+
source-install commands above.
|
|
54
|
+
|
|
55
|
+
## Check a changed evaluation plan before running it
|
|
56
|
+
|
|
57
|
+
An audit checks exports against one intended manifest. Before executing a changed
|
|
58
|
+
plan, compare its frozen contract with the earlier one:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
evaldenom manifest-diff previous-manifest.json proposed-manifest.json --output drift.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Exit 0 means `MATCH`: declared cases, input digests, trials, cluster labels and
|
|
65
|
+
metric contracts agree. Exit 1 means `CHANGED`: the report names added/removed
|
|
66
|
+
cases, changed inputs or clusters, added/removed trials, and changes to metric
|
|
67
|
+
names, graders, directions or bounds. Exit 2 means unusable input or an output
|
|
68
|
+
error, with no new comparison verdict. Standard output must accept the complete report
|
|
69
|
+
and flush successfully before exit 0 or 1; failed help/diagnostic delivery also
|
|
70
|
+
exits 2. A broken destination can retain a partial JSON prefix, so a report is
|
|
71
|
+
usable only with its successful delivery and expected exit status. Both manifests are fully validated first;
|
|
72
|
+
an old output is left untouched on input errors, so check the exit status.
|
|
73
|
+
|
|
74
|
+
Case/metric list order and trial order do not matter. A missing bound differs
|
|
75
|
+
from an explicit bound. Numeric bounds such as `0` and `0.0` are equivalent,
|
|
76
|
+
matching the core audit's numeric comparisons. Nothing aligns cases by position,
|
|
77
|
+
selects a common subset or approves dropping a difficult case. Source-manifest
|
|
78
|
+
hashes identify the supplied files' JSON values, including list order, so these
|
|
79
|
+
hashes may differ even when the declared contracts match.
|
|
80
|
+
|
|
81
|
+
This command reads only prospective manifests, not run exports or scores. It
|
|
82
|
+
helps inspect denominator/rubric drift before spending on an experiment. It does
|
|
83
|
+
not approve the new plan or establish actual model inputs, grader implementation
|
|
84
|
+
or statistical comparability. Reports contain case and metric identifiers; review
|
|
85
|
+
them before sharing. Per-case input hashes, raw inputs and score values are not
|
|
86
|
+
copied into the change list. The existing `audit` command still decides export
|
|
87
|
+
coverage against the chosen manifest; `MATCH` is never an audit `READY` verdict.
|
|
88
|
+
|
|
89
|
+
Python callers can use `evaldenom.manifestdiff.compare_manifests(previous, current)`
|
|
90
|
+
with parsed manifests. File callers should use the CLI's strict JSON boundary,
|
|
91
|
+
which rejects repeated object members and non-JSON numeric constants.
|
|
92
|
+
|
|
93
|
+
## Install from source
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
git clone https://github.com/anishpentyala/evaldenom.git
|
|
97
|
+
cd evaldenom
|
|
98
|
+
python -m pip install .
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Python 3.9 or newer. Runtime dependencies: none.
|
|
102
|
+
|
|
103
|
+
## Workflow
|
|
104
|
+
|
|
105
|
+
1. Declare intended cases before running the experiment. Each JSONL record:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{"id":"case-1","input":{"question":"Example?"},"trials":[1,2],"cluster":"source-document-1"}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
IDs and cluster labels are exact nonempty strings. Trials are explicit positive
|
|
112
|
+
integers, never inferred from the largest observed trial. Cluster is optional;
|
|
113
|
+
when declared, every export must match it exactly. It is metadata, not an
|
|
114
|
+
independence test. Numeric `1`, string `"1"`, and boolean `true` do not alias.
|
|
115
|
+
|
|
116
|
+
2. Declare metric contracts in a JSON array:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
[{"name":"accuracy","grader":"exact-match-v1","direction":"higher","min":0,"max":1}]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`grader` is a caller-chosen version label. Use a version/digest that actually
|
|
123
|
+
identifies your scoring implementation. Bounds are optional finite numbers.
|
|
124
|
+
Direction is `higher` or `lower`. Every intended case/trial must report every
|
|
125
|
+
metric; subsets, extra metrics and silent grader/direction changes block READY.
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
python -m evaldenom freeze examples/cases.jsonl --metrics examples/metrics.json --output manifest.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The manifest keeps input digests, not raw inputs. `pyjson-v1` uses Python JSON
|
|
132
|
+
serialization with sorted object keys, compact separators and ASCII escaping,
|
|
133
|
+
then SHA-256. Array order and JSON value types matter; `1` and `1.0` differ.
|
|
134
|
+
Object order, whitespace and escape spelling do not. This is not RFC8785 JCS,
|
|
135
|
+
a cross-language canonicalization promise, anonymization, or signing. Low-entropy
|
|
136
|
+
inputs can be guessed by hashing candidates. Keep your raw inputs privately.
|
|
137
|
+
|
|
138
|
+
3. Export each run to this explicit format. No framework-specific parser guesses:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{"id":"case-1","trial":1,"input_digest":"pyjson-v1:...64-lowercase-hex...","cluster":"source-document-1","metrics":{"accuracy":{"status":"ok","grader":"exact-match-v1","direction":"higher","value":1}}}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Use `input_digest(actual_input)` in your exporter, not a copied manifest digest,
|
|
145
|
+
to catch accidental input changes. A copied label cannot prove input identity.
|
|
146
|
+
`status` is `ok`, `error` or `missing`. `ok` needs a finite non-boolean real score
|
|
147
|
+
within any declared bounds. Error/missing remains blocking even if a stale value
|
|
148
|
+
is also present; the tool never treats it as success or zero. Scores are checked,
|
|
149
|
+
not copied into the report.
|
|
150
|
+
|
|
151
|
+
```sh
|
|
152
|
+
python -m evaldenom audit manifest.json --run baseline=examples/baseline.jsonl --run candidate=examples/candidate-missing.jsonl
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Exit 0: READY, supplied exports satisfy coverage and identity contracts.
|
|
156
|
+
Exit 1: BLOCKED, report lists missing/duplicate/unexpected observations, metric
|
|
157
|
+
errors and contract mismatches. Exit 2: unusable input or output error, no new
|
|
158
|
+
verdict. Duplicate observations block even if identical: no last-row-wins or
|
|
159
|
+
implicit attempt selection. Change the intended trial plan explicitly instead.
|
|
160
|
+
|
|
161
|
+
At least two separately named runs are required, but they need not represent
|
|
162
|
+
independent experiments. Blank JSONL lines are ignored; findings retain physical
|
|
163
|
+
line numbers. Repeated JSON object members and non-JSON NaN/Infinity are input
|
|
164
|
+
errors, including nested objects. Unknown envelope fields are errors, not silently
|
|
165
|
+
ignored. IDs remain case-sensitive, with no Unicode/whitespace normalization.
|
|
166
|
+
|
|
167
|
+
`--output report.json` replaces a report only after parsing and auditing finish,
|
|
168
|
+
via a temporary file in that directory. A blocking audit still writes its complete
|
|
169
|
+
report. Input errors preserve the previous report. An output path resolving to
|
|
170
|
+
an input path is rejected. This is not a concurrency-safe file transaction against
|
|
171
|
+
hostile path replacement or a hard-link alias defense.
|
|
172
|
+
|
|
173
|
+
## Experimental native export API
|
|
174
|
+
|
|
175
|
+
A narrow [Promptfoo JSON API](docs/promptfoo-api.md) supports explicit repeat>=2,
|
|
176
|
+
scalar inline vars and literal equals/contains assertions for current summary-v3
|
|
177
|
+
JSON exports. Python API and explicit CLI, not a general config resolver or default single-trial
|
|
178
|
+
integration. Use its strict JSON-text boundary and read the limits first.
|
|
179
|
+
|
|
180
|
+
## Example that catches selection bias
|
|
181
|
+
|
|
182
|
+
The synthetic fixture has `easy` and `hard`, each with two intended trials.
|
|
183
|
+
The baseline scores the hard cases at zero. A candidate export containing only
|
|
184
|
+
the easy cases could show 100% on its paired-complete subset. This audit reports
|
|
185
|
+
both missing hard trials and refuses READY. The fixture is invented, not observed
|
|
186
|
+
model performance. Fixing coverage might reveal no gain; coverage alone cannot
|
|
187
|
+
establish a gain either way.
|
|
188
|
+
|
|
189
|
+
## Scope and existing alternatives
|
|
190
|
+
|
|
191
|
+
This is a small preflight contract, not a new statistical method or an all-purpose
|
|
192
|
+
evaluation platform. Related tools and the behavior their descriptions document
|
|
193
|
+
(checked2026-11-06):
|
|
194
|
+
|
|
195
|
+
- [evaldiff](https://toolkitlabs.org/tools/evaldiff/README.md) computes paired
|
|
196
|
+
statistics, excludes unmatched rows with counts, and warns while keeping the
|
|
197
|
+
last duplicate. Use it for inference after resolving your intended coverage.
|
|
198
|
+
- [abeval](https://github.com/mohammadi-hadi/abeval) offers paired comparisons,
|
|
199
|
+
intervals, power and judge-noise analysis; unmatched items are dropped/reported.
|
|
200
|
+
- [MLflow](https://mlflow.org/docs/latest/genai/eval-monitor/comparing-evaluation-runs/)
|
|
201
|
+
pairs rows, reports unmatched/duplicate rows and skips scorer-error pairs.
|
|
202
|
+
- [errorbars](https://github.com/antonsoo/errorbars) already validates identity,
|
|
203
|
+
cluster assignments and repeated observations, and provides statistical
|
|
204
|
+
inference. It is a stronger alternative when its data model fits your workflow.
|
|
205
|
+
- [eval-run-manifest](https://pypi.org/project/eval-run-manifest/) records run
|
|
206
|
+
provenance and directory digests. This tool instead checks intended
|
|
207
|
+
case/trial/metric closure across supplied exports; neither is execution attestation.
|
|
208
|
+
- [EVALSIG](https://github.com/vtensor/evalsig/blob/main/docs/concepts/paired-vs-unpaired.md)
|
|
209
|
+
explains paired versus unpaired inference. This tool does not choose either test.
|
|
210
|
+
|
|
211
|
+
No claim that these tools hide their exclusions, that this project is unique,
|
|
212
|
+
or that a blocked strict contract invalidates every possible subset analysis.
|
|
213
|
+
A justified subset analysis needs an explicit separate plan, not a silent change
|
|
214
|
+
in denominator.
|
|
215
|
+
|
|
216
|
+
## Limits
|
|
217
|
+
|
|
218
|
+
- General harness export integration is not provided. A narrow experimental
|
|
219
|
+
Promptfoo JSON API and CLI are available for their documented subset only.
|
|
220
|
+
- A manifest created after seeing results can encode selective inclusion.
|
|
221
|
+
- Input digests, grader versions and cluster labels are supplied claims, not
|
|
222
|
+
authenticated execution evidence. No code/model/dataset attestation.
|
|
223
|
+
- READY does not check uncertainty, statistical dependence, rubric validity,
|
|
224
|
+
sample representativeness, model provenance, leakage or multiple comparisons.
|
|
225
|
+
- Every case has the same declared metric set; sparse metric plans are not supported.
|
|
226
|
+
- Data is retained in memory, including the intended identity set and findings.
|
|
227
|
+
This is not bounded-memory processing for arbitrarily large logs.
|
|
228
|
+
- Finite numbers within Python float range are accepted as scores/bounds.
|
|
229
|
+
No numeric string, bool or extreme integer coercion. No score arithmetic occurs.
|
|
230
|
+
- Reports include case/metric identifiers and run labels; review before sharing.
|
|
231
|
+
Input files and manifests can contain private metadata.
|
|
232
|
+
|
|
233
|
+
## Development
|
|
234
|
+
|
|
235
|
+
```sh
|
|
236
|
+
pip install -e . pytest
|
|
237
|
+
python -m pytest -q
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Authorship: implementation, documentation and synthetic tests were produced by
|
|
241
|
+
an AI assistant working on Anish's behalf. Anish has not personally reviewed or
|
|
242
|
+
executed them. Early source release, not a published PyPI package. No adoption claim.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# evaldenom
|
|
2
|
+
|
|
3
|
+
[](https://github.com/anishpentyala/evaldenom/actions)
|
|
4
|
+
|
|
5
|
+
Check that evaluation exports cover the cases you intended to measure before
|
|
6
|
+
comparing their scores. Offline, Python standard library only.
|
|
7
|
+
|
|
8
|
+
A paired comparison can look better because a hard case errored, disappeared,
|
|
9
|
+
changed its input under the same ID, used a different grader, or lost a repeated
|
|
10
|
+
trial. Statistical comparison tools often report their matched subset. This tool
|
|
11
|
+
asks a prior question: do both supplied exports satisfy the same intended contract?
|
|
12
|
+
|
|
13
|
+
It does not run models, compute significance, pick a best run, average repeated
|
|
14
|
+
trials, fill missing scores, retry requests, or change your dataset. A READY
|
|
15
|
+
report is a coverage/identity check on supplied claims, not proof that the model
|
|
16
|
+
saw those inputs or that an evaluator was implemented correctly.
|
|
17
|
+
|
|
18
|
+
## Try the missing-case check
|
|
19
|
+
|
|
20
|
+
Python 3.9 or newer, no runtime dependencies. The repository includes an invented
|
|
21
|
+
four-observation fixture: two cases with two trials each. The candidate drops
|
|
22
|
+
both hard-case trials.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
git clone https://github.com/anishpentyala/evaldenom.git
|
|
26
|
+
cd evaldenom
|
|
27
|
+
python -m pip install .
|
|
28
|
+
evaldenom freeze examples/cases.jsonl --metrics examples/metrics.json --output manifest.json
|
|
29
|
+
evaldenom audit manifest.json --run baseline=examples/baseline.jsonl --run candidate=examples/candidate-missing.jsonl
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The audit exits 1 with `BLOCKED`, rather than approving comparison on only the
|
|
33
|
+
easy cases. Replace `candidate-missing.jsonl` with `candidate-complete.jsonl` for
|
|
34
|
+
an exit-0 `READY` report. Neither verdict establishes a score gain or verifies
|
|
35
|
+
that the claimed inputs and graders were actually used.
|
|
36
|
+
|
|
37
|
+
A PyPI release is being prepared. Until its package page is linked here, use the
|
|
38
|
+
source-install commands above.
|
|
39
|
+
|
|
40
|
+
## Check a changed evaluation plan before running it
|
|
41
|
+
|
|
42
|
+
An audit checks exports against one intended manifest. Before executing a changed
|
|
43
|
+
plan, compare its frozen contract with the earlier one:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
evaldenom manifest-diff previous-manifest.json proposed-manifest.json --output drift.json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Exit 0 means `MATCH`: declared cases, input digests, trials, cluster labels and
|
|
50
|
+
metric contracts agree. Exit 1 means `CHANGED`: the report names added/removed
|
|
51
|
+
cases, changed inputs or clusters, added/removed trials, and changes to metric
|
|
52
|
+
names, graders, directions or bounds. Exit 2 means unusable input or an output
|
|
53
|
+
error, with no new comparison verdict. Standard output must accept the complete report
|
|
54
|
+
and flush successfully before exit 0 or 1; failed help/diagnostic delivery also
|
|
55
|
+
exits 2. A broken destination can retain a partial JSON prefix, so a report is
|
|
56
|
+
usable only with its successful delivery and expected exit status. Both manifests are fully validated first;
|
|
57
|
+
an old output is left untouched on input errors, so check the exit status.
|
|
58
|
+
|
|
59
|
+
Case/metric list order and trial order do not matter. A missing bound differs
|
|
60
|
+
from an explicit bound. Numeric bounds such as `0` and `0.0` are equivalent,
|
|
61
|
+
matching the core audit's numeric comparisons. Nothing aligns cases by position,
|
|
62
|
+
selects a common subset or approves dropping a difficult case. Source-manifest
|
|
63
|
+
hashes identify the supplied files' JSON values, including list order, so these
|
|
64
|
+
hashes may differ even when the declared contracts match.
|
|
65
|
+
|
|
66
|
+
This command reads only prospective manifests, not run exports or scores. It
|
|
67
|
+
helps inspect denominator/rubric drift before spending on an experiment. It does
|
|
68
|
+
not approve the new plan or establish actual model inputs, grader implementation
|
|
69
|
+
or statistical comparability. Reports contain case and metric identifiers; review
|
|
70
|
+
them before sharing. Per-case input hashes, raw inputs and score values are not
|
|
71
|
+
copied into the change list. The existing `audit` command still decides export
|
|
72
|
+
coverage against the chosen manifest; `MATCH` is never an audit `READY` verdict.
|
|
73
|
+
|
|
74
|
+
Python callers can use `evaldenom.manifestdiff.compare_manifests(previous, current)`
|
|
75
|
+
with parsed manifests. File callers should use the CLI's strict JSON boundary,
|
|
76
|
+
which rejects repeated object members and non-JSON numeric constants.
|
|
77
|
+
|
|
78
|
+
## Install from source
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
git clone https://github.com/anishpentyala/evaldenom.git
|
|
82
|
+
cd evaldenom
|
|
83
|
+
python -m pip install .
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Python 3.9 or newer. Runtime dependencies: none.
|
|
87
|
+
|
|
88
|
+
## Workflow
|
|
89
|
+
|
|
90
|
+
1. Declare intended cases before running the experiment. Each JSONL record:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{"id":"case-1","input":{"question":"Example?"},"trials":[1,2],"cluster":"source-document-1"}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
IDs and cluster labels are exact nonempty strings. Trials are explicit positive
|
|
97
|
+
integers, never inferred from the largest observed trial. Cluster is optional;
|
|
98
|
+
when declared, every export must match it exactly. It is metadata, not an
|
|
99
|
+
independence test. Numeric `1`, string `"1"`, and boolean `true` do not alias.
|
|
100
|
+
|
|
101
|
+
2. Declare metric contracts in a JSON array:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
[{"name":"accuracy","grader":"exact-match-v1","direction":"higher","min":0,"max":1}]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`grader` is a caller-chosen version label. Use a version/digest that actually
|
|
108
|
+
identifies your scoring implementation. Bounds are optional finite numbers.
|
|
109
|
+
Direction is `higher` or `lower`. Every intended case/trial must report every
|
|
110
|
+
metric; subsets, extra metrics and silent grader/direction changes block READY.
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
python -m evaldenom freeze examples/cases.jsonl --metrics examples/metrics.json --output manifest.json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The manifest keeps input digests, not raw inputs. `pyjson-v1` uses Python JSON
|
|
117
|
+
serialization with sorted object keys, compact separators and ASCII escaping,
|
|
118
|
+
then SHA-256. Array order and JSON value types matter; `1` and `1.0` differ.
|
|
119
|
+
Object order, whitespace and escape spelling do not. This is not RFC8785 JCS,
|
|
120
|
+
a cross-language canonicalization promise, anonymization, or signing. Low-entropy
|
|
121
|
+
inputs can be guessed by hashing candidates. Keep your raw inputs privately.
|
|
122
|
+
|
|
123
|
+
3. Export each run to this explicit format. No framework-specific parser guesses:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{"id":"case-1","trial":1,"input_digest":"pyjson-v1:...64-lowercase-hex...","cluster":"source-document-1","metrics":{"accuracy":{"status":"ok","grader":"exact-match-v1","direction":"higher","value":1}}}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use `input_digest(actual_input)` in your exporter, not a copied manifest digest,
|
|
130
|
+
to catch accidental input changes. A copied label cannot prove input identity.
|
|
131
|
+
`status` is `ok`, `error` or `missing`. `ok` needs a finite non-boolean real score
|
|
132
|
+
within any declared bounds. Error/missing remains blocking even if a stale value
|
|
133
|
+
is also present; the tool never treats it as success or zero. Scores are checked,
|
|
134
|
+
not copied into the report.
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
python -m evaldenom audit manifest.json --run baseline=examples/baseline.jsonl --run candidate=examples/candidate-missing.jsonl
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Exit 0: READY, supplied exports satisfy coverage and identity contracts.
|
|
141
|
+
Exit 1: BLOCKED, report lists missing/duplicate/unexpected observations, metric
|
|
142
|
+
errors and contract mismatches. Exit 2: unusable input or output error, no new
|
|
143
|
+
verdict. Duplicate observations block even if identical: no last-row-wins or
|
|
144
|
+
implicit attempt selection. Change the intended trial plan explicitly instead.
|
|
145
|
+
|
|
146
|
+
At least two separately named runs are required, but they need not represent
|
|
147
|
+
independent experiments. Blank JSONL lines are ignored; findings retain physical
|
|
148
|
+
line numbers. Repeated JSON object members and non-JSON NaN/Infinity are input
|
|
149
|
+
errors, including nested objects. Unknown envelope fields are errors, not silently
|
|
150
|
+
ignored. IDs remain case-sensitive, with no Unicode/whitespace normalization.
|
|
151
|
+
|
|
152
|
+
`--output report.json` replaces a report only after parsing and auditing finish,
|
|
153
|
+
via a temporary file in that directory. A blocking audit still writes its complete
|
|
154
|
+
report. Input errors preserve the previous report. An output path resolving to
|
|
155
|
+
an input path is rejected. This is not a concurrency-safe file transaction against
|
|
156
|
+
hostile path replacement or a hard-link alias defense.
|
|
157
|
+
|
|
158
|
+
## Experimental native export API
|
|
159
|
+
|
|
160
|
+
A narrow [Promptfoo JSON API](docs/promptfoo-api.md) supports explicit repeat>=2,
|
|
161
|
+
scalar inline vars and literal equals/contains assertions for current summary-v3
|
|
162
|
+
JSON exports. Python API and explicit CLI, not a general config resolver or default single-trial
|
|
163
|
+
integration. Use its strict JSON-text boundary and read the limits first.
|
|
164
|
+
|
|
165
|
+
## Example that catches selection bias
|
|
166
|
+
|
|
167
|
+
The synthetic fixture has `easy` and `hard`, each with two intended trials.
|
|
168
|
+
The baseline scores the hard cases at zero. A candidate export containing only
|
|
169
|
+
the easy cases could show 100% on its paired-complete subset. This audit reports
|
|
170
|
+
both missing hard trials and refuses READY. The fixture is invented, not observed
|
|
171
|
+
model performance. Fixing coverage might reveal no gain; coverage alone cannot
|
|
172
|
+
establish a gain either way.
|
|
173
|
+
|
|
174
|
+
## Scope and existing alternatives
|
|
175
|
+
|
|
176
|
+
This is a small preflight contract, not a new statistical method or an all-purpose
|
|
177
|
+
evaluation platform. Related tools and the behavior their descriptions document
|
|
178
|
+
(checked2026-11-06):
|
|
179
|
+
|
|
180
|
+
- [evaldiff](https://toolkitlabs.org/tools/evaldiff/README.md) computes paired
|
|
181
|
+
statistics, excludes unmatched rows with counts, and warns while keeping the
|
|
182
|
+
last duplicate. Use it for inference after resolving your intended coverage.
|
|
183
|
+
- [abeval](https://github.com/mohammadi-hadi/abeval) offers paired comparisons,
|
|
184
|
+
intervals, power and judge-noise analysis; unmatched items are dropped/reported.
|
|
185
|
+
- [MLflow](https://mlflow.org/docs/latest/genai/eval-monitor/comparing-evaluation-runs/)
|
|
186
|
+
pairs rows, reports unmatched/duplicate rows and skips scorer-error pairs.
|
|
187
|
+
- [errorbars](https://github.com/antonsoo/errorbars) already validates identity,
|
|
188
|
+
cluster assignments and repeated observations, and provides statistical
|
|
189
|
+
inference. It is a stronger alternative when its data model fits your workflow.
|
|
190
|
+
- [eval-run-manifest](https://pypi.org/project/eval-run-manifest/) records run
|
|
191
|
+
provenance and directory digests. This tool instead checks intended
|
|
192
|
+
case/trial/metric closure across supplied exports; neither is execution attestation.
|
|
193
|
+
- [EVALSIG](https://github.com/vtensor/evalsig/blob/main/docs/concepts/paired-vs-unpaired.md)
|
|
194
|
+
explains paired versus unpaired inference. This tool does not choose either test.
|
|
195
|
+
|
|
196
|
+
No claim that these tools hide their exclusions, that this project is unique,
|
|
197
|
+
or that a blocked strict contract invalidates every possible subset analysis.
|
|
198
|
+
A justified subset analysis needs an explicit separate plan, not a silent change
|
|
199
|
+
in denominator.
|
|
200
|
+
|
|
201
|
+
## Limits
|
|
202
|
+
|
|
203
|
+
- General harness export integration is not provided. A narrow experimental
|
|
204
|
+
Promptfoo JSON API and CLI are available for their documented subset only.
|
|
205
|
+
- A manifest created after seeing results can encode selective inclusion.
|
|
206
|
+
- Input digests, grader versions and cluster labels are supplied claims, not
|
|
207
|
+
authenticated execution evidence. No code/model/dataset attestation.
|
|
208
|
+
- READY does not check uncertainty, statistical dependence, rubric validity,
|
|
209
|
+
sample representativeness, model provenance, leakage or multiple comparisons.
|
|
210
|
+
- Every case has the same declared metric set; sparse metric plans are not supported.
|
|
211
|
+
- Data is retained in memory, including the intended identity set and findings.
|
|
212
|
+
This is not bounded-memory processing for arbitrarily large logs.
|
|
213
|
+
- Finite numbers within Python float range are accepted as scores/bounds.
|
|
214
|
+
No numeric string, bool or extreme integer coercion. No score arithmetic occurs.
|
|
215
|
+
- Reports include case/metric identifiers and run labels; review before sharing.
|
|
216
|
+
Input files and manifests can contain private metadata.
|
|
217
|
+
|
|
218
|
+
## Development
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
pip install -e . pytest
|
|
222
|
+
python -m pytest -q
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Authorship: implementation, documentation and synthetic tests were produced by
|
|
226
|
+
an AI assistant working on Anish's behalf. Anish has not personally reviewed or
|
|
227
|
+
executed them. Early source release, not a published PyPI package. No adoption claim.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
[project]
|
|
5
|
+
name = "evaldenom"
|
|
6
|
+
version = "0.1.0"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
authors = [{name = "Anish Pentyala"}]
|
|
9
|
+
keywords = ["evaluation", "data-validation", "machine-learning"]
|
|
10
|
+
description = "Offline intended-coverage and identity preflight for evaluation exports"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
license = {text = "MIT"}
|
|
13
|
+
dependencies = []
|
|
14
|
+
[project.urls]
|
|
15
|
+
Homepage = "https://github.com/anishpentyala/evaldenom"
|
|
16
|
+
Repository = "https://github.com/anishpentyala/evaldenom"
|
|
17
|
+
Issues = "https://github.com/anishpentyala/evaldenom/issues"
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
evaldenom = "evaldenom.cli:cli"
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
where = ["src"]
|
|
23
|
+
[tool.pytest.ini_options]
|
|
24
|
+
testpaths = ["tests"]
|