Repository navigation
LOU-D7, LOU-D8: trajectory evals and the loushy eval command - #63
Merged
Merged
Conversation
Trajectory evals: defineEval() gains a test(t, c) form (agent or per-case factory, tags, cases dataset, gate vs soft assertions, t.judge with an explicit judge provider only) producing a structured EvalResult per case with diagnostic failure messages. The classic score/threshold form is unchanged and also reports a result. loushy eval: spawns the project's vitest with a generated config, collects results through a JSON-lines file (LOUSHY_EVAL_RESULTS), prints a summary table, writes JUnit XML and JSON, and exits 1 on gate failures (soft with --strict), 2 when it cannot run. docs/evals.md added; README, api-overview and llms files updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # .fallowrc.json # tsup.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
defineEval()gains a trajectory form:{ name, agent | () => agent, tags, cases, judge?, test(t, c) }.tofferssend,reply,completed,calledTool(name, { args, times })(partial deep arg match),notCalledTool,toolOrder(subsequence),maxSteps,maxTokens,maxCostUsd(skipped cleanly: main reports no cost),check(gate),soft(reported only),judge. New checks:includes,matches,equals,atLeast,atMost. Every case yields a structuredEvalResult. The classicscore/thresholdform is unchanged and also reports a result.loushy eval [globs...] [--tag] [--junit] [--json] [--strict] [--judge] [--config]. Wired throughsrc/cli/eval.ts,bin/loushy.js, tsup entry, fallow entry glob.docs/evals.md(authoring, assertions table, datasets, mockModel default, judge evals, CLI, CI + JUnit upload), linked from README; README evals section and api-overview updated; llms files regenerated.Why
Audit: "one score per eval, no datasets". Parity with eve's
defineEval({ test(t) })plus CI ergonomics (JUnit/JSON, tags, strict).How verified
npx tsc --noEmit: cleannpm run lint: 0 errors (433 warnings, none new in touched files)npm run build+ create-loushy-agent build: OKnpm run test:coverage: Test Files 120 passed (120), Tests 1710 passed | 4 skippednpm run fallow: exit 0npm run test:types: no errorsnpm run docs:verify-snippets: all 60 snippets type-check, 6 run cleanlynpm run docs:llms:check: OKorigin/main(995f649) into the branch; diff-filter=D vs origin/main is empty.Notes for reviewer
$LOUSHY_EVAL_RESULTS, instead of a custom vitest reporter. It works across vitest versions and pools, needs no module resolved from the user's project, and short appends are safe across workers. Tag filter travels the other way viaLOUSHY_EVAL_TAGS.loushy evalgenerates a plain-object config in a temp dir (globs,*.judge.eval.*excluded unless--judge, which setsLOUSHY_ALLOW_LLM_JUDGE).--configuses the user's own.t.judge()requiresjudge: { provider, model }on the eval (throws a clear error otherwise); it sets a newallowOutsideJudgeRunneroption onllmJudge()because the provider was configured explicitly.--strict/ vitest failing without a recorded failure; 2 cannot run (bad args, vitest missing, install hint printed).src/cli/__fixtures__/eval/, excluded from the default run invitest.config.ts.NodeWorkspace.test.ts(env leak) andhttp.test.ts(timeout).🤖 Generated with Claude Code