Earlier runs
Run directories of format 1, which the earlier model-calling passes wrote; the package now only reads them.
A format-1 run recorded the model's answers to the classify, premise and check passes, and replayed
them to rebuild its graph. The passes are gone: runs are now made by an agent's tool calls
(session, format 2). verify still runs a format-1 run's deterministic checks again, and reads
its manifest and files through this module. The layout of such a run::
<run>/
manifest.json format "credencegraph-extract-run", version 1
graph.json the graph the run produced
rubric.toml byte copy of the rubric used
prompts/ the template of each pass, and the rendered prompt of every call
raw/ the record of every model call
rejections.json the records the core refused, each with its error code
report.json the graph's coverage, and what each pass reported
checks/c-NNN/ for each check: its inputs, the tool's output and a log
source/ a copy of the source document, when it was stored
RunError and run ids are shared with the tool runs.
RunError
¶
Bases: Exception
A run cannot be made or replayed.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
A stable error code. |
Source code in src/credencegraph_extract/run.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
__init__(code, message)
¶
Create the error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
str
|
A stable error code. |
required |
message
|
str
|
What went wrong. |
required |
Source code in src/credencegraph_extract/run.py
47 48 49 50 51 52 53 54 55 | |
new_run_id()
¶
Return a fresh run id: the UTC time and a random suffix.
Returns:
| Type | Description |
|---|---|
str
|
The id, such as |
Source code in src/credencegraph_extract/run.py
58 59 60 61 62 63 64 | |
read_manifest(run_dir)
¶
Read and check a format-1 run's manifest: its format, its version, and every field the run recorded.
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 there is no manifest, it is not JSON, not of this format and version, or a field the run recorded is missing or of the wrong type. |
Source code in src/credencegraph_extract/run.py
96 97 98 99 100 101 102 103 104 105 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 132 133 134 135 136 137 | |
read_run_file(run_dir, name)
¶
Read a file of a run directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
Path
|
The run directory. |
required |
name
|
str
|
The file's path inside it. |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
The file's bytes. |
Raises:
| Type | Description |
|---|---|
RunError
|
If the file cannot be read. |
Source code in src/credencegraph_extract/run.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |