Joel Stevick

Eval harness

Reading a run

Each run writes a folder under evals/runs/, named by its start time and label. The folder holds results.json and results.md. results.json has every case's status, the facts met, how far each expected passage got (the pool, the context, the citations) and the cost, plus metadata naming the commit, the hashes of the cases and the corpus, and the models. results.md has a tally, medians, a table row per case and every answer of a case that ran. evals/runs/ledger.json holds every run's spend against the $7.50 cap on all runs. evals/JOURNAL.md is the narrative: each round's hypothesis, the runs that tested it and what was kept.

Runs in: Your machine, the developer's machine: npm test (vitest, demo/tests/), npm run eval (Node and wrangler dev, evals/) and npm run search (Node, examples/). New to Cloudflare? How these fit together
The same idea, shown in the course's code: Naming the failed stage: retrieval, answer, citation, fallback From Prove it works, Ep 6: Diagnosing a failure
Explained in Ep 1: Reading repeat runs: the bigger pool fixed two cases and broke one From RAG deep dive, Ep 1: RAG Debugging: Retrieval, Reranking or Generation?
In the browser
runs in the visitor's browser, on the demo page
Ingestion
runs when a PDF's text is uploaded
Query time
runs when the Worker answers a question or a search_documents call from the MCP server, and in the request handling every route shares, in the Worker and in the site's functions, which uploads and removals pass through too
MCP request
runs on a request to the MCP server or its OAuth endpoints
Site request
runs on a site request that is not a question, an upload, an MCP call or the cron: a page load, a session read, the demo page's /api/grants calls, an admin read, a file's removal
Scheduled
runs in the Worker's daily cron job
Eval run
runs when the eval harness runs on a developer's machine
MCP host
runs in an MCP host outside the Worker: the search loop example, on a developer's machine (npm run search) or in its test
Module load
runs once, when the module is loaded
Type only
erased by the TypeScript compiler; never runs
Never runs
a comment, a licence or markup with no behaviour of its own

Pinned to joelstevick-demo-rag-pipeline at 6a9c6c7.