Verify
Verifying runs: the deterministic checks run again, and rubric versions compared across runs.
replay shows that a run's graph follows from its recorded calls; verify looks at the checks
one by one, from the run directory alone, without the source. Each recompute-numbers,
rederive-maths and rederive-maths-numeric check of the graph is run again from the inputs its
record holds, and any field of the record the re-run does not reproduce is reported: a result, a
detail, the digest of the check's files. The files in checks/c-NNN/ are compared with the digest
the record holds, and every check record, citation checks included, with the inputs.json and
output.json its check wrote; a check of a type the runner does not have is reported. Citation
checks rest on an agent's judgement, so they are not run again; for an agent-tool run, replay
reads each one's source again from its bytes. verify reads runs of either format: those the
agent tools make, and those the earlier model-calling passes made.
A rubric's version names its values, so two runs that record one rubric name and version with
different file digests used values that changed without a new version. rubric_reuse reports
each such name and version.
Difference
dataclass
¶
A field of a check record that differs from what verifying it gives.
Attributes:
| Name | Type | Description |
|---|---|---|
check |
str
|
The check node's id. |
field |
str
|
The record's field, or |
recorded |
Any
|
The recorded value; for |
found |
Any
|
The value the re-run gives; for |
Source code in src/credencegraph_extract/verify.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
Verification
dataclass
¶
What verifying a run found.
Attributes:
| Name | Type | Description |
|---|---|---|
rerun |
tuple[str, ...]
|
The ids of the checks run again, in graph order. |
not_rerun |
tuple[str, ...]
|
The ids of the checks judged by a model, which are not run again. |
differences |
tuple[Difference, ...]
|
Every difference found, in graph order. |
Source code in src/credencegraph_extract/verify.py
63 64 65 66 67 68 69 70 71 72 73 74 75 | |
rubric_reuse(manifests)
¶
Report each rubric name and version that runs record with more than one file digest.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifests
|
Sequence[tuple[str, Mapping[str, Any]]]
|
Each run's name, as the report should give it, and its manifest. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
One warning per such name and version, naming each digest and the runs that record it. |
Source code in src/credencegraph_extract/verify.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
run_manifest(run_dir)
¶
Read the manifest of a run of either format: a model-calling run (1) or an agent-tool run (2).
An agent-tool run is first reconciled with its call log, which rewrites any derived file a crash left behind; it has a graph only while it is finished, so an unfinished one is refused.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
Path
|
The run directory. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The manifest. |
Raises:
| Type | Description |
|---|---|
RunError
|
If the directory is not a run, or is an unfinished agent-tool run. |
Source code in src/credencegraph_extract/verify.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
verify_run(run_dir)
¶
Run a run's deterministic checks again and compare each with its record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
Path
|
The run directory. |
required |
Returns:
| Type | Description |
|---|---|
Verification
|
The checks run again, those not, and every difference found. |
Raises:
| Type | Description |
|---|---|
RunError
|
If the run directory is malformed or incomplete, or its |
Source code in src/credencegraph_extract/verify.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |