Skip to content

Make each eval experiment a Promptfoo config: state the rule, retire widget formats, run UI review on Promptfoo's hooks - #5442

Merged
max-sixty merged 3 commits into
mainfrom
agent-af056623d6c24cc0b
Nov 5, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-af056623d6c24cc0b

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

An experiment is now a folder under evals/ holding a Promptfoo config, with no leaf-dev command of its own. This change writes that rule into dev/AGENTS.md, retires the widget-format experiment, and moves UI review detection onto Promptfoo's own setup and teardown hooks. leaf-dev goes from 30 commands to 28 (eval-widget-formats and eval-ui-review are gone), leaf-dev eval --condition loses json, adaptive and formats, and the adaptivecards dev dependency goes. Net change: +633 / −2,573 lines, of which Python code is +64 / −1,531.

The rule

dev/AGENTS.md, "Experiments": the catalog (evals/<task>/case.yaml) runs through leaf-dev eval, and any other question put to a model is an experiment, a folder under evals/ with a pnpm run eval:<name> script. Its arms are providers, its samples tests and its graders assertions. Setup and summaries for the declared tests go in beforeAll/afterAll, and setup that produces the tests runs in the script before Promptfoo. A new comparison is another provider, never a --condition value. A mechanism stays in its experiment's folder until a second experiment needs it. Code names a model only through MODELS, JUDGE_MODELS and the new COMPARED_MODELS in arms.py. Node code reads them through dev/leaf_dev/arms.mjs, which runs python -m leaf_dev.arms.

leaf-dev eval --model stays. A person running the catalog passes it, and Promptfoo's run store shows 33 runs between 23 October and 1 November that used it, 24 of them with gpt-6-sol.

Widget formats, retired

#4299 added this experiment to ask whether an agent writes a Leaf widget more reliably as HTML or as an equivalent JSON tree. All four of its runs predate its merge on 28 October, and none has run since. Removed: eval_widget_formats.py, widget_format_eval.py, evals/widget-formats/, the json/adaptive/formats conditions with preflight_formats and their branches in authoring_eval.py, its test, and its README passages. The format-valid and interaction-proven checks and the format_output/interaction metadata fields existed only for those conditions.

To restore it: bf2650b, main as this merged, is the last commit that holds it.

git checkout bf2650bcf -- dev/leaf_dev/commands/eval_widget_formats.py dev/leaf_dev/widget_format_eval.py evals/widget-formats

Then bring back its conditions in dev/leaf_dev/commands/eval.py and dev/leaf_dev/authoring_eval.py, and adaptivecards in package.json, from the same commit.

UI review as a config

evals/ui-review-detection/promptfooconfig.mjs is the whole experiment. A column is MODEL/ARM: the four reviewers the command offered (each harness's author and judge pin, plus Fable in COMPARED_MODELS) on each of four arms (no-tools, browser, discovery, code-only). Promptfoo's own --filter-providers, --filter-pattern and --repeat replace the command's --model, --condition, --mode and --repeat. A bare run takes every column; the command's default was Sol on two arms. Each test's vars are {prompt, candidate}, which stay the same from run to run, so Promptfoo's viewer and --filter-failing match rows across runs.

hooks.mjs:beforeAll copies the public fixtures and the pinned timeline bundle. It then captures each selected candidate's labelled views and source and asserts the frozen contrast on each, so a broken fixture stops the run before a model is called. Last, it seeds the judge's Codex login. afterAll retires the seed and writes and prints each column's counts. The candidate's browser answers requests from the copied site by Playwright routing, which replaces the loopback server and its private-path probe. The captures now use the same Node Playwright build as the reviewer's browser tool.

Dropped with the command:

  • Run records: the copy of every input in the run directory, frozen-hashes.json, integrity.json, environment.json, run.json and the fixture sha256 table. Git and the lockfile hold those inputs, and the run's description names its commit (git describe --dirty).
  • --prepare-only: replaced by node --test dev/tests/node/test_ui_review_setup.cjs, which runs the real setup on all ten candidates.
  • The no-tools discovery arm: no run ever used it, and it needed its own unobservable-target rule in the grader.

Other fixes in touched files

  • Control legibility: its reader and judge take their models from arms.py, its column shows the pinned model, and its config sets sharing and cache itself.
  • The plain-HTML control: it now needs an index.html to count as page-valid. Before, an empty page directory passed on the static server's 404 page.
  • Type check: the smoke test imports the config and hooks, so the tools type check (build/tsconfig.json) now reaches provider.mjs too. JSDoc names the SDK types it passes; behavior is unchanged.

What I ran

  • Command vs config, same sample. I ran the old command and the new config on the covered-controls pair: Sol on no-tools and browser, Opus on browser, and Sol on discovery and code-only for the defect. That is 8 cells each. Every cell has an identical request digest, image count and native harness on both sides, and every cell got the same detection and false-alarm grade. The no-tools and code-only arms sent the same input token counts (4,192 and 3,745), so their inputs were byte-identical. Browser arms differ only in the model's own operation count. One config sample (Opus/browser, control) had an unsupported observation: the reviewer overstated which messages it had copied.
  • Captures. The command's and the hook's ten packets: 25 of 30 screenshots byte-identical, and 5 differing by at most 19 pixels (channel delta ≤10) inside one hover region. The command's own two runs differ in the same image the same way.
  • After the final edits and the merge of main (Pi 1.5.0): pnpm run test:evals, Sol on no-tools and code-only (both graded, no login seed left behind), and the control-legibility reader and judge on one sample.
  • Tests. uv run pytest dev/tests/test_evals.py -n0, selecting the tests the removal touches, pnpm run check:tools and check:browser, and pre-commit on every changed file.
  • CI. CI's one failure, tests/model/test_receipts.py::test_ack_rearm_reports_when_its_only_page_transfers_after_selection, was a JSONDecodeError reading a session record. It passes 3 of 3 locally, and this change touches nothing under src/ or tests/.

pnpm run eval:legibility stops in its capture step on main as well. evals/control-legibility/actions.json doesn't match ACTIONS in browser/runtime/icon-paths.js: back, delete, menu and move have no line, and done has a line but no action. This change touches none of those files.

This was written by Claude Code on behalf of max-sixty

…widget formats, run UI review on Promptfoo's hooks

dev/AGENTS.md gains "Experiments": an experiment is a folder under evals/ with its own
Promptfoo config and pnpm script, a leaf-dev command exists only for a mechanism two
experiments share, and code names models only through MODELS, JUDGE_MODELS and the new
COMPARED_MODELS in arms.py, which Node code reads through dev/leaf_dev/arms.mjs.

Widget formats is retired: eval-widget-formats, widget_format_eval.py, evals/widget-formats/,
the json/adaptive/formats conditions of leaf-dev eval with their checks and metadata
fields, their test, and the adaptivecards dependency.

eval-ui-review becomes evals/ui-review-detection/promptfooconfig.mjs with a beforeAll that
stages the public fixtures, captures each candidate's views and source and asserts its
frozen contrast, and an afterAll that retires the judge's login seed and counts each
column's grades. Columns are MODEL/ARM over the four reviewers the command offered and
four arms; Promptfoo's filters replace --model, --condition and --mode. The candidate's
browser reads the copied site by Playwright routing in place of a loopback server. The
run-directory snapshot, its hash and environment records, --prepare-only (now the node
smoke test) and the unused no-tools discovery arm are gone. Test vars are stable across
runs, so Promptfoo's --filter-failing and its viewer match rows from earlier runs.

Control legibility reads its reader and judge models from arms.py, and its column names
the pinned model. The plain-HTML control now needs index.html to count as page-valid.
…est brings them under

dev/tests/node/test_ui_review_setup.cjs imports the config and its hooks, so build/tsconfig.json's checkJs now reaches provider.mjs. JSDoc names the SDK types it passes, and the page-side readiness test is a string expression. Behavior is unchanged.
@max-sixty
max-sixty merged commit 5c4d673 into main Nov 5, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the agent-af056623d6c24cc0b branch November 5, 2026 08:43
max-sixty added a commit that referenced this pull request Nov 5, 2026
…e, and make the experiment rule true (#5450)

Four things left over from #5442. This is developer tooling only, +30 /
−15 lines.

**A bare UI review run costs what the command's default did.** `pnpm run
eval:ui-review` took every column after #5442: 160 reviews and 160 judge
calls, against 20 of each for the old command's default. The script now
passes `--filter-providers 'sol/(no-tools|browser)$'`, which selects
`gpt-6.1-sol/no-tools` and `gpt-6.1-sol/browser`. A `--filter-providers`
the user adds replaces it, because commander keeps the last value, and
`--filter-providers .` takes all 16 columns. The README says so. If the
Codex pin ever stops being named `sol`, a bare run prints "No providers
matched" and spends nothing.

**`pnpm run eval:legibility` runs again.** Its capture refused because
`actions.json` had no line for `back`, `delete`, `menu` or `move` and
kept a stale `done`. Each new line comes from where the action is
offered: the floating panel's "Back to …", a rewrite's Save once its box
is emptied, the leaf press, and a board card's grip. The capture also
drew the Page menu's leaf as a bare square, because the mask that gives
it its mark is scoped to `.lf-chrome`. Each press now stands under that
scope, so the sheet shows what a user sees.

**The model rule is true as written.** `leaf-dev claude-code-session`
was the one tool picking a model outside `arms.py`, and it now reads
`MODELS["claude-code-session"]`. `dev/AGENTS.md` now says developer
tooling picks the model it runs through `arms.py`, and that a table
keyed by model id, such as `fork_eval.PRICES`, looks up what a run
already used. The only model literals left in `dev/`, `evals/` and the
skills are those pins, that table and a recorded trace's field in test
data.

**The rule says when an experiment leaves.** Its folder and script stay
while someone will run them again. Once it has answered its question
they are deleted, and the pull request names the last commit that holds
them. `evals/ui-review-detection/README.md` now says why that set is
still kept, in place of "We generally do not keep model evals of
maintainer development work".

## What I ran

- **Filter:** the script's own text through the real Promptfoo CLI, on
free `echo` providers wearing the real config's labels. Bare selected
the two Sol columns (20 reviews). `.` selected 16 columns, `/discovery$`
4, `/(no-tools|browser)$` 8 and `sol/code-only$` 1, and
`--filter-targets` overrode it the same way. Applying the filter to the
real providers' ids selected the same two columns. `pnpm run
eval:ui-review --filter-providers NOMATCH` on the real config ran no
reviews.
- **Legibility, real sample:** `pnpm run eval:legibility`, from capture
through reader and judge, with its models read from `arms.py` (provider
`control-legibility:claude-opus-5-5`). 31 of 34 controls read correctly.
The misses were Fit ("Enter fullscreen or focus mode"), Next match
("Expand a section or open a dropdown") and Page menu ("Can't tell;
feather, maybe app logo"). Readings vary from run to run, and the script
exits 100 whenever any control is misread. Back, Delete and Move all
matched. Against the capture before the scope change, only the 32×32 box
around the leaf differs.
- **Session:** `uv run leaf-dev claude-code-session` started a real
session on `claude-sonnet-5-5`, per its process arguments and banner,
and `--stop` ended it.
- **Checks:** `pnpm run check:tools`, the affected
`dev/tests/test_evals.py` tests, and pre-commit on every changed file.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants