Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
3747bfd
Keep the report's repair list from being overwritten
Nanboy-Ronan Nov 13, 2026
b72c9cb
Declare analyzer parameters and mixin host attributes for type checking
Nanboy-Ronan Nov 13, 2026
cb91102
Type the report UI's last loose values and forbid any
Nanboy-Ronan Nov 13, 2026
0c089e1
Check that the docs' evalrx imports resolve
Nanboy-Ronan Nov 13, 2026
1298a40
Give unlabelled cases in the Docker runner Label.UNKNOWN
Nanboy-Ronan Nov 13, 2026
037c682
Make the package type-check and run mypy in CI
Nanboy-Ronan Nov 13, 2026
a98541b
Test that the natural-language scaffold still imports cleanly
Nanboy-Ronan Nov 13, 2026
6852c5d
Count the report's repair from the same M5 result as its tile
Nanboy-Ronan Nov 13, 2026
bc8b4e9
Render explore outputs in the React report and drop the legacy page
Nanboy-Ronan Nov 13, 2026
860343d
Show the explore agent's analysis in M2, and find explore outputs by …
Nanboy-Ronan Nov 13, 2026
7667241
Build the report renderer in the images that run an explore step
Nanboy-Ronan Nov 13, 2026
47dcb67
Log report data versions 19 and 20 beside the version constant
Nanboy-Ronan Nov 13, 2026
9f801ab
Split the report compiler into the pieces build_report_data reads
Nanboy-Ronan Nov 13, 2026
779fe80
Move the experiment writer's code helpers into experiment_code
Nanboy-Ronan Nov 13, 2026
d77c757
List experiment_code in the architecture tree
Nanboy-Ronan Nov 13, 2026
5f194f6
Name the steps of confirming an EXPLORE repair on CONFIRM
Nanboy-Ronan Nov 13, 2026
87da91b
Test that serve opens an explore output and serves its figures
Nanboy-Ronan Nov 13, 2026
4155aa3
Compare two runs side by side in the served report
Nanboy-Ronan Nov 13, 2026
76dadd4
Log the end of a run: run_end, log schema 7
Nanboy-Ronan Nov 13, 2026
f70a288
Follow a run in the served report while it is written
Nanboy-Ronan Nov 13, 2026
a1e2a20
Follow a run by its log files, not its highest event number
Nanboy-Ronan Nov 13, 2026
9028eb4
Close the run logger where a producer did not
Nanboy-Ronan Nov 13, 2026
70ae528
Check explore and fused report shapes against the stage_detail contract
Nanboy-Ronan Nov 13, 2026
1f55b58
Drop a stale html_report note and say serve needs the ui extra
Nanboy-Ronan Nov 13, 2026
73c919f
Let deco_hallu_explore's image copy the case manifests it needs
Nanboy-Ronan Nov 13, 2026
8854ef1
Release 0.2.0
Nanboy-Ronan Nov 13, 2026
c3a0af9
Type the count-banner font and CLAP model for newer Pillow and transf…
Nanboy-Ronan Nov 14, 2026
206abd6
Test extract_run_data on results kept in files beside the log
Nanboy-Ronan Nov 14, 2026
ee2abb5
Split extract_run_data into one reader per stage
Nanboy-Ronan Nov 14, 2026
340be53
Test that every evalrx command reaches the function behind it
Nanboy-Ronan Nov 14, 2026
5ec354c
Give each evalrx command its own parser and handler functions
Nanboy-Ronan Nov 14, 2026
beb062c
Test runner.run end to end with the model, judge and stage calls faked
Nanboy-Ronan Nov 14, 2026
0293328
Split runner.run into the steps of one benchmark cell
Nanboy-Ronan Nov 14, 2026
fe0f2bf
Remove deprecated model, dataset, stats and registry aliases
Nanboy-Ronan Nov 14, 2026
8f57371
Use AutoDiagnoseReport and final_hypotheses under their one name
Nanboy-Ronan Nov 14, 2026
e02abb1
Remove the langfuse_exporter facade and the dead serve wrapper
Nanboy-Ronan Nov 14, 2026
06ac772
Read a run from its log alone
Nanboy-Ronan Nov 14, 2026
7a7e46a
Stop inferring what the current log records, and read two fields from it
Nanboy-Ronan Nov 14, 2026
1e57bbe
Read events, stage views and the case study from the current log only
Nanboy-Ronan Nov 14, 2026
e4d99fc
Remove module-path aliases, mirrored report fields and uncalled methods
Nanboy-Ronan Nov 14, 2026
f678fe6
Remove the first M2 tool layer and bump the run log schema to 8
Nanboy-Ronan Nov 14, 2026
38e4e29
Drop the flat logger's leftovers from the published log schema
Nanboy-Ronan Nov 14, 2026
4d071af
Rename RunLoggerV2 and its readers to unversioned names
Nanboy-Ronan Nov 14, 2026
80d3073
Move the run logger's file and media helpers to run_log_files
Nanboy-Ronan Nov 14, 2026
62eb192
Move the run logger's Langfuse mirroring to run_log_tracing
Nanboy-Ronan Nov 14, 2026
8c27122
Build each log entry in run_log_entries, outside RunLogger
Nanboy-Ronan Nov 14, 2026
3c73c37
Call the logger RunLogger in the demo storyboard's help text
Nanboy-Ronan Nov 14, 2026
120058f
Say run log, not run_log.jsonl, in the package-data comment
Nanboy-Ronan Nov 14, 2026
5896c20
Refuse a log without event_seq by name, and fix a changelog line
Nanboy-Ronan Nov 14, 2026
caf8f81
Fold the unreleased notes into 0.2.0
Nanboy-Ronan Nov 14, 2026
ef4ca37
Pair case media by file name, and read choices and task from the case…
Nanboy-Ronan Nov 14, 2026
33a1123
Remove the dashboard's report compiler and the modules only it used
Nanboy-Ronan Nov 14, 2026
6662bfa
Keep the text analyzers in _SLOT_PRIORITY and drop the per-kind copy
Nanboy-Ronan Nov 14, 2026
c9685bc
Plan M2 tests with plan_stats_input and remove default_plan
Nanboy-Ronan Nov 14, 2026
3a09f4c
Report FDR survivors by result key only, not by tool name
Nanboy-Ronan Nov 14, 2026
0f7c86e
Remove the logger capability flags and the branches for a logger with…
Nanboy-Ronan Nov 14, 2026
08279ac
Give DiagnosisAgent.diagnose the M2 report only
Nanboy-Ronan Nov 14, 2026
d8fa7d9
Call the fix agent's interface directly from run_fix
Nanboy-Ronan Nov 14, 2026
2edb299
Serve case media from the run's own copy only
Nanboy-Ronan Nov 14, 2026
d0e870e
Show the repair ref the run assigned, and drop the stageCode identity
Nanboy-Ronan Nov 14, 2026
d80efbe
Describe the current run log in comments that named earlier layouts
Nanboy-Ronan Nov 14, 2026
a955d29
Pin the examples' M1 analyzers for audio model kinds too
Nanboy-Ronan Nov 14, 2026
7dad62e
Give the pinned-example fix its own changelog entry
Nanboy-Ronan Nov 14, 2026
27cb84c
Log model exchanges without asking whether the logger can
Nanboy-Ronan Nov 14, 2026
d9507ab
Bring the docs and earlier 0.2.0 notes in line with the removed toler…
Nanboy-Ronan Nov 14, 2026
055fa04
Ask judges for typed answers through pydantic-ai, starting with the a…
Nanboy-Ronan Nov 19, 2026
ae41f7a
Ask M3 for typed hypotheses and a typed review
Nanboy-Ronan Nov 19, 2026
5f3a452
Route fix proposals, cluster naming and held-out grading through ask_…
Nanboy-Ronan Nov 19, 2026
cf60414
Run every CLI judge through the providers' SubprocessRunner
Nanboy-Ronan Nov 19, 2026
0608de0
Make the judge-decided mode a policy of the one diagnosis loop
Nanboy-Ronan Nov 19, 2026
eca6756
Lock pydantic-ai for Colab and pin the frontend CI job to Ubuntu 24.04
Nanboy-Ronan Nov 19, 2026
f48a93e
Take the first JSON value in a judge reply that fits the output model
Nanboy-Ronan Nov 19, 2026
e0b5086
Ask M2 and case labeling for typed answers
Nanboy-Ronan Nov 19, 2026
11db236
Type the dynamic tool Literals as Any so mypy 2.4 accepts create_model
Nanboy-Ronan Nov 20, 2026
e5c61b1
Merge main (probe tools, weight edits) into ruinan
Nanboy-Ronan Nov 20, 2026
3484b77
Type-check main's probe tools, weight edits and analyzers
Nanboy-Ronan Nov 20, 2026
2d98d6b
Ask explore's HypothesisAgent for a typed answer; CLI agents answer i…
Nanboy-Ronan Nov 20, 2026
3a75206
Make the fixed M1-M4 cycle the default policy of the loop
Nanboy-Ronan Nov 20, 2026
4979a8c
Report a limit notice from a coding agent as an error
Nanboy-Ronan Nov 20, 2026
9ad0d8f
Mark M3 as failed in the report when the run stopped on it
Nanboy-Ronan Nov 20, 2026
9498bae
Give the synthetic yield explore example a 900 s agent timeout
Nanboy-Ronan Nov 20, 2026
471b6fe
Say when M3's last attempt failed after earlier hypotheses
Nanboy-Ronan Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
**/__pycache__
**/*.pyc
examples/**/data
# deco_hallu_explore copies these frozen case manifests (276 KB) into its image.
!examples/m1_m5/deco_hallu/data/cases
examples/**/outputs
examples/**/outputs.*
examples/**/*.zip
**/.env
**/node_modules
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -89,6 +89,15 @@ jobs:
# is a field the frontend cannot see, which is the drift the contract
# exists to catch -- so catch it on the commit that causes it.
run: python -m evalrx.contract.export --out docs/contract --check
- name: Type-check
# Once is enough: [tool.mypy] pins the target to Python 3.11. It runs
# here, not in the lint job, because it needs the installed extras to
# see the real types of torch, pydantic, fastapi, ...
# Pinned so a new mypy release cannot turn CI red on unchanged code.
if: matrix.python-version == '3.11'
run: |
pip install "mypy==2.4.1"
mypy evalrx
- name: Run fast unit tests
run: pytest -m "not gpu and not network" --cov=evalrx --cov-report=xml -q
- name: Upload coverage
Expand Down
423 changes: 396 additions & 27 deletions CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ provides an inventory command. Generated files are preserved locally.

```bash
ruff check .
mypy evalrx --ignore-missing-imports
mypy evalrx # settings in pyproject.toml; CI runs it too
```

## Adding a model
Expand Down Expand Up @@ -77,8 +77,7 @@ The new analyzer is instantly discoverable via `registry.analyzers.names_compati
## Pull requests

- Keep PRs focused: one analyzer, one model, or one infrastructure change per PR.
- All configured CI checks must pass: Ruff, the frontend format/lint/tests/build, contract export,
documentation build, and the non-GPU/non-network test suite. Mypy is an
additional local check, not currently a CI gate.
- All configured CI checks must pass: Ruff, mypy, the frontend format/lint/tests/build,
contract export, documentation build, and the non-GPU/non-network test suite.
- Add or update the relevant entry in `CHANGELOG.md` under `[Unreleased]`.
- Include paper citations (arXiv link + BibTeX key) for any method from the literature.
47 changes: 25 additions & 22 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ VLDiagnoseLoop (loop.py — protocol-guided, stops on verified hypothesis)
│
M5 · SurgeryAgent called once post-loop on the best verified hypothesis

AgenticDiagnoseLoop (agentic/loop.py — judge-decided, same M1-M4 stages)
The cycle above is the default policy, FixedOrderPolicy (policy.py).

VLDiagnoseLoop(policy=JudgePolicy(judge)) (agentic/policy.py — judge-decided, same M1-M4 stages)
A CLI judge picks the next tool (run_probe / run_stats / explore_data /
cluster_failures / search_probes / propose_hypotheses / test_hypothesis /
run_surgery / run_fix / stop) each turn from an EvidenceBoard, instead of a
Expand All @@ -207,8 +209,7 @@ The agent touches models only through the `Model` protocol and stores all
evidence in a `Store`.

`.run()` on both loops returns the same class, `AutoDiagnoseReport`
(`loop_reports.py`; `VLDiagnoseReport` is a back-compat alias for the
identical class). Each loop populates only the fields relevant to what it
(`loop_reports.py`). Each loop populates only the fields relevant to what it
ran — see [Stage Input/Output Reference](stage_io.md#loop-level-output) for
the full field table.

Expand All @@ -218,13 +219,16 @@ the full field table.
eval_agent/
├── loop.py VLDiagnoseLoop (current)
├── loop_fix.py run_fix orchestration: fix targets, tier ladder, EXPLORE→CONFIRM
├── loop_reports.py AutoDiagnoseReport (VLDiagnoseReport is an alias — all
│ both loops return this one unified report class)
├── loop_reports.py AutoDiagnoseReport — the one report class both policies return
├── policy.py FixedOrderPolicy (default M1→M4 cycles) + RunState, shared by both policies
├── run_metadata.py shared run-provenance + logging-wiring helpers
├── agentic/ AgenticDiagnoseLoop — judge-decided M1-M4 (see below)
├── agentic/ JudgePolicy — judge-decided M1-M4 (see below)
├── run_context.py RunContext, Trial — single owner of a run's output directory
├── run_logger_v2.py RunLoggerV2 — run.json + per-stage M<n>/log.json event log
├── log_schema.py published event JSON Schema
├── run_logger.py RunLogger — run.json + per-stage M<n>/log.json event log
├── run_log_entries.py what each logged event records, one pure function per event
├── run_log_files.py atomic JSON writes, inlined sandbox workspaces, saved artifacts
├── run_log_tracing.py each logged event mirrored into Langfuse
├── log_schema.py published event JSON Schema
├── hypothesis.py Hypothesis, HypothesisStatus — shared across M3/M4/M5
├── store.py Store / InMemoryStore / JsonlStore
└── stages/ ← M1, M3, M4, M5 stage implementations (M2 lives in evalrx.analysis)
Expand All @@ -234,6 +238,7 @@ eval_agent/
├── diagnosis.py M3 DiagnosisAgent, DiagnosisResult
├── surgery.py M5 SurgeryAgent, InterventionResult
├── experiment_writer.py M5 ExperimentWriter
├── experiment_code.py M5 reading + static checks of the code it writes
├── fix/ M5 (post-loop) tiered repair
│ ├── agent.py FixAgent — orchestrates the modules below
│ ├── types.py FixCandidate, FixValidation, FixOutcome, FixContext
Expand Down Expand Up @@ -421,8 +426,7 @@ Key properties:
not timed out), preserving failure artefacts for debugging.

`SandboxProtocol` is a structural type allowing transparent substitution of subprocess,
Docker, SSH, or other backends. `create_sandbox(SandboxFactoryConfig, workdir)` selects
the backend from a `mode` string (`"subprocess"` default, `"docker"` with graceful fallback).
Docker, SSH, or other backends; `ExperimentSandbox` is the one implementation shipped.

### Persistent store — `JsonlStore`

Expand Down Expand Up @@ -470,7 +474,7 @@ result.image_overlays(fig_dir, stem_prefix) # -> list[Path]
lazy `Inputs.image` paths/URLs the same way the model's forward pass did
(`transformers.image_utils.load_image`), so the overlay matches what was
actually fed to the model. `image_overlays()` is a duck-typed hook:
`RunLoggerV2` calls it on any `Result` that defines it and saves the PNGs
`RunLogger` calls it on any `Result` that defines it and saves the PNGs
into `M1/artifacts/` alongside the bare heatmaps, so overlays flow into the
same artifact list a multimodal judge already receives — no per-analyzer
wiring required.
Expand All @@ -481,7 +485,7 @@ wiring required.
files, a logger buried under a `logs/` subdir, hand-built figure-dir paths,
and M5 sandboxes living in ephemeral temp dirs deleted on success. One
`RunContext` owns the whole run root and hands every producer its
subdirectory, always through `RunLoggerV2` (`evalrx/eval_agent/RUN_LOGGER_V2.md`) —
subdirectory, always through `RunLogger` (`evalrx/eval_agent/RUN_LOGGER.md`) —
there is no other logger to select:

```text
Expand Down Expand Up @@ -512,19 +516,18 @@ run provenance — `model`, `judge`, `git_commit` (falls back to the
the example Docker images), `data_fingerprint` (an order-independent hash of
the case batch, so two runs can be confirmed to use the same data) and
`label_distribution` (the base PASS/FAIL/UNKNOWN counts the diagnosis is
conditioned on). Nothing is externalized the way V1's `{"path", "n_items",
"bytes"}` payload placeholder was — `stats_results`, `findings`, and every
other per-event field are inlined verbatim in the stage's JSON document.
`evalrx/reporting/run_events.py`'s `read_v2_events(root)` flattens `run.json`
conditioned on). Nothing is externalized — `stats_results`, `findings`, and
every other per-event field are inlined verbatim in the stage's JSON document.
`evalrx/reporting/run_events.py`'s `read_run_events(root)` flattens `run.json`
+ every `M<n>/log.json` back into one ordered, flat event list (the same
shape every downstream reader — dynamic report, HTML export, dashboard,
Langfuse backfill — consumes), so most code never has to know about the
per-stage bucketing directly:

```python
from evalrx.reporting.run_events import read_v2_events
from evalrx.reporting.run_events import read_run_events

events = read_v2_events("run_dir") # run_dir or run_dir/logs
events = read_run_events("run_dir") # run_dir or run_dir/logs
diagnoses = [e for e in events if e["event"] == "diagnosis"] # all judge outputs
probes = [e for e in events if e["event"] == "probe"] # M1 findings
```
Expand All @@ -551,7 +554,7 @@ from evalrx.eval_agent import validate_event
validate_event(event) # raises jsonschema.ValidationError on a violation
```

Set `EVALRX_VALIDATE_LOG=1` to have `RunLoggerV2` self-check every event it
Set `EVALRX_VALIDATE_LOG=1` to have `RunLogger` self-check every event it
writes against the schema and warn (never raise) on a violation — a CI/dev aid
to catch a producer drifting from the contract. Both paths need the optional
`jsonschema` dependency (`pip install evalrx[dev]`).
Expand Down Expand Up @@ -584,8 +587,8 @@ on first write, so a candidate discarded before producing anything (e.g. a
deduped proposal) leaves no empty folder — a gap in the numbering honestly
means "proposed, then discarded," not a missing record. `ctx.new_workdir(label)`
is the non-trial equivalent for sandboxes that don't belong to a numbered
attempt (e.g. M1/M2 tool codegen). Under V2 there are no persisted trial
folders at all — a trial's generated code/output is inlined into its stage's
attempt (e.g. M1/M2 tool codegen). There are no persisted trial
folders — a trial's generated code/output is inlined into its stage's
JSON, and the sandbox it ran in lives under an ephemeral `ctx.runtime_root`
tempdir that's deleted at `finalize()`, not `fixes/`/`experiments/`.

Expand Down Expand Up @@ -661,7 +664,7 @@ evalrx.FailureCase
evalrx.Result

# Diagnosis stages and logging
from evalrx.eval_agent import DiagnosisAgent, RunLoggerV2, StrategyProbe, SurgeryAgent
from evalrx.eval_agent import DiagnosisAgent, RunLogger, StrategyProbe, SurgeryAgent

# Protocol-guided diagnosis — VLDiagnoseLoop (M1→M2→M3→M4, M5 post-loop)
from evalrx.eval_agent import (
Expand Down
29 changes: 22 additions & 7 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ set.
| `--model` (`--coder-model`) | backend default | Model name passed to the coding agent. |
| `--max-rows` / `--max-files` | `2000` / `200` | Sampling caps for large inputs. |
| `--timeout-sec` / `--max-attempts` | `120` / `2` | Per-attempt timeout and repair-retry budget. |
| `--serve-report` | off | Open the run's static `report.html` in a browser when it finishes. |
| `--serve-report` | off | Open the run's `report.html` in a browser when it finishes. |
| `--skill DIR` (repeatable) | — | Agent-Skill directory to style agent-authored figures. Implies `--allow-skills`. |
| `--no-skills` | off | Skip the package's bundled skills (e.g. `nature-figure`). |
| `--no-hypotheses` | off | Skip M3 — stop after M2's takeaways. |
Expand All @@ -124,9 +124,11 @@ set.
| `--no-narrate` | off | Don't print live per-stage terminal narration (see above). |
| `--progress-path PATH` | — | Also append durable JSONL progress events to `PATH`, for a separate workbench UI — independent of narration; both can run together. |

An explore output is not an M1–M5 run, so `serve` has nothing to show for it;
its report is the static `report.html` (`evalrx/reporting/html_report.py`)
written into `--out`, which opens from disk.
An explore output renders in the same report as a full run, with M2 and M3
filled in and the other stages marked not run: `--out` gets a portable
`report.html` that opens from disk, and `evalrx serve <out>` shows it live.
A source checkout writes that file only once the renderer is built
(`npm run build` in `evalrx/reporting/web`); an installed package carries it.

## `evalrx run-codebase`

Expand Down Expand Up @@ -171,6 +173,20 @@ evalrx serve --runs-root outputs/ # runs panel over every run under outputs/
| `--trace-id` | — | Langfuse trace id (required with `--source langfuse`). |
| `--runs-root` | `run_dir`'s parent | Where the in-page runs panel looks for other experiments. |

A run still being written is followed live: the top bar reads "run in
progress", and the page swaps in the new report each time the run logs
something, on whatever view is open, until the run logs its end (`run_end`).
A run that stops logging without ending reads as unfinished, with how long it
has been quiet. Such a run is compiled in memory and published into its
directory only once it ends.

**Compare** in the top bar puts the run on screen beside another the runs
panel lists (`#/compare/<id>`): their metrics and stage outcomes in one table,
and the cases both evaluated that passed in one run and failed in the other,
each a link into the case studio. Runs are joined by case id, and the page
says when they used different datasets or one is an explore output. A portable
`report.html` holds a single run, so it has no Compare.

## `evalrx report`

Exports the same UI `serve` shows, as one portable HTML file — no server
Expand All @@ -183,7 +199,6 @@ evalrx report outputs/qwen3.5-2b/chartqa --out chartqa_report.html
| Flag | Default | Purpose |
|---|---|---|
| `run_dir` (positional) | `outputs` | Run directory holding `run.json`/`M1..M5`, or a `logs/` folder. |
| `--example-dir` | — | Root holding a benchmark/example's `data/` manifest, for legacy runs. |
| `--out, -o` | `<run_dir>/report.html` | Output HTML path. |
| `--embed-media` | `representative` | `representative` \| `all` \| `none` — how much image/audio to inline. |
| `--audio-bitrate` | `48k` | Transcodes inlined lossless audio to mono MP3 via `ffmpeg` (needs `ffmpeg` on `PATH`); `none` inlines the original bytes. |
Expand All @@ -200,8 +215,8 @@ HTML file. Useful for pre-warming a run's cache, or in CI.
evalrx publish-report outputs/qwen3.5-2b/chartqa
```

Takes `run_dir` (positional, default `outputs`), `--example-dir`,
`--source`, `--trace-id` — same meanings as `report`.
Takes `run_dir` (positional, default `outputs`), `--source`, `--trace-id` —
same meanings as `report`.

## `evalrx export-langfuse`

Expand Down
4 changes: 2 additions & 2 deletions docs/contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ changes — adding a field is additive and does not bump it, so a reader must
└── artifacts/ M1 heavy numeric data (.npy/.json) outside any stage
```

`run.json` + `M1/log.json`..`M5/log.json` are RunLoggerV2's layout (see
`evalrx/eval_agent/RUN_LOGGER_V2.md`): no flat event stream, no separate
`run.json` + `M1/log.json`..`M5/log.json` are RunLogger's layout (see
`evalrx/eval_agent/RUN_LOGGER.md`): no flat event stream, no separate
`report/`/`figures/` — generated text/code is inlined into the owning
stage's JSON and media is copied into that stage's own `artifacts/`.
`contract/` sits alongside it, independently typed and validated.
Expand Down
34 changes: 18 additions & 16 deletions docs/contract/contract.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ export interface CorrectedRejections {
*/
export type EvidenceGrade = "intervention" | "observational" | "none";

/**
* What the explore coding agent left: the analysis it wrote and ran.
*
* ``transcript`` is its CLI trajectory, cut to the report's budget; the run
* directory keeps the whole file.
*/
export interface ExploreAgentView {
code: string | null;
stdout: string | null;
stderr: string | null;
transcript: string | null;
transcript_truncated: boolean;
audit: unknown;
}

/**
* Descriptive EDA notes from the optional explore side-path.
*
Expand Down Expand Up @@ -212,7 +227,7 @@ export interface FixAttemptWire {
/**
* The reader-facing identifier, e.g. `R3`. Assigned by the producer over the whole run and STABLE across `selection` and `attempted`, so a reader who sees R3 in the sweep can find R3's card and know it is the same repair.
*
* This exists because `name` cannot do the job. Consumers that numbered rows by list position gave the same repair two different numbers in the two lists, which is worse than no number at all. Empty means the producer assigned none; a consumer may then number by position, but only within one list and never as a cross-list identity.
* This exists because `name` cannot do the job. Consumers that numbered rows by list position gave the same repair two different numbers in the two lists, which is worse than no number at all.
*/
ref?: string;
/**
Expand Down Expand Up @@ -415,13 +430,13 @@ export interface M2StageDetail {
caveats: (unknown)[];
candidate_signals: (CandidateSignalView)[];
recommended_tests: (unknown)[];
agent: ExploreAgentView | null;
}

export interface M3StageDetail {
mode: string;
hypotheses: (HypothesisView)[];
unparsed_proposals: (UnparsedProposal)[];
agent_response: string;
error?: string | null;
candidate_signals: (CandidateSignalView)[];
recommended_tests: (unknown)[];
evidence_figures: (FigureView)[];
Expand Down Expand Up @@ -899,19 +914,6 @@ export interface TestEvidence {
details?: { [key: string]: unknown };
}

/**
* A proposal recovered from the judge's raw reply after the parser
* rejected it. Shown for audit only; it never reached M4.
*/
export interface UnparsedProposal {
statement: string;
plain_statement: string;
failure_mode: string;
test_design: string;
expected_association: string;
accepted_by_pipeline: boolean;
}

/**
* M4's raw log record. Verdict cards fall back to it when a result
* lacks a field.
Expand Down
2 changes: 1 addition & 1 deletion docs/contract/m5_fix.FixOutput.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"ref": {
"default": "",
"description": "The reader-facing identifier, e.g. `R3`. Assigned by the producer over the whole run and STABLE across `selection` and `attempted`, so a reader who sees R3 in the sweep can find R3's card and know it is the same repair.\n\nThis exists because `name` cannot do the job. Consumers that numbered rows by list position gave the same repair two different numbers in the two lists, which is worse than no number at all. Empty means the producer assigned none; a consumer may then number by position, but only within one list and never as a cross-list identity.",
"description": "The reader-facing identifier, e.g. `R3`. Assigned by the producer over the whole run and STABLE across `selection` and `attempted`, so a reader who sees R3 in the sweep can find R3's card and know it is the same repair.\n\nThis exists because `name` cannot do the job. Consumers that numbered rows by list position gave the same repair two different numbers in the two lists, which is worse than no number at all.",
"title": "Ref",
"type": "string"
},
Expand Down
Loading
Loading