From 17e1e2281481c725a5fd3701524c7a319f9f104d Mon Sep 17 00:00:00 2001 From: Christopher Tso Date: Tue, 23 Jun 2026 12:10:19 +0200 Subject: [PATCH 01/18] docs: plan experiment separation --- ...26-06-23-experiments-vs-eval-separation.md | 151 +++++++ ...6-06-23-002-experiments-separation-plan.md | 388 ++++++++++++++++++ 2 files changed, 539 insertions(+) create mode 100644 docs/adr/2026-06-23-experiments-vs-eval-separation.md create mode 100644 docs/plans/2026-06-23-002-experiments-separation-plan.md diff --git a/docs/adr/2026-06-23-experiments-vs-eval-separation.md b/docs/adr/2026-06-23-experiments-vs-eval-separation.md new file mode 100644 index 000000000..61898f85b --- /dev/null +++ b/docs/adr/2026-06-23-experiments-vs-eval-separation.md @@ -0,0 +1,151 @@ +# ADR: Separate experiments from eval definitions + +Date: 2026-06-23 + +Status: Proposed + +## Context + +AgentV currently treats an experiment as a run label. The label is threaded +through evaluation config and recorded in run artifacts, but the agent, model, +harness, repeat count, timeout, sandbox, and setup choices mostly remain in +`eval.yaml` `execution` fields or CLI flags. + +That conflates two concerns: + +- The eval definition is the task contract: prompt, dataset, workspace fixture + required by the task, and assertions or graders. +- The experiment is the run contract: which agent or target is under test, which + model and harness are used, how many runs to execute, what setup is injected, + and which evals are selected. + +The public Vercel `agent-eval` ecosystem is a useful reference point. The +`vercel/next.js` evals keep task fixtures under `evals/`, while experiments are +generated or committed separately. `vercel/next-evals-oss` commits many +`experiments/*.ts` variants and stores results under experiment-specific +directories. The useful pattern is the vocabulary and ownership split, not a +requirement that AgentV adopt Vercel's package as its core runtime. + +This decision must also preserve AgentV's existing product boundary: + +- AgentV stays repo-native and zero-infra by default. +- Portable run artifacts remain the source of truth. +- Core primitives should stay small and composable. +- Public wire formats use `snake_case`; TypeScript internals use `camelCase`. +- `project` means the run, trace, and experiment container; `benchmark` means a + curated eval suite. + +## Vocabulary + +An eval is a frozen task definition. It includes the prompt or dataset, expected +behavior, task-owned workspace fixtures, and assertions. AgentV's LLM-judge, +code-grader, deterministic assertions, and hidden or explicit evaluation +criteria belong here. + +An experiment is a committed or generated run definition. It declares which +agent, target, provider, model, harness options, setup steps, run count, timeout, +sandbox, and eval selector are used. Setup that changes the system under test, +such as installing dependencies or dropping an `AGENTS.md` or skill file, belongs +here because it is an A/B variable. + +An execution compatibility block is the legacy `eval.yaml` location for runner +selection and runtime controls. It remains supported during migration but should +stop being the canonical home for experiment-level choices. + +## Decision + +AgentV will make experiments first-class configuration units separate from +eval definitions. + +Eval files remain YAML-authored by default. They should describe what is tested: +task inputs, datasets, assertions, and task fixtures. They should not be the +canonical place for which agent, model, harness, setup injection, sandbox, or run +matrix executes the task. + +Experiment files will live under `experiments/` by convention. AgentV will +support YAML as the canonical authoring path for the abstraction story and TypeScript +as the power-user escape hatch: + +```yaml +name: copilot-gpt55-withskill +target: copilot-gpt55 +model: openai/gpt-5.5 +evals: "evals/**/*.eval.yaml" +scripts: + - build +runs: 3 +early_exit: false +timeout_seconds: 900 +sandbox: auto +setup: + - script: bun install + - script: cp skills/copilot/AGENTS.md AGENTS.md +``` + +`config.yaml` will gain a default experiment pointer so existing `agentv eval` +usage keeps working: + +```yaml +experiments: + default: experiments/default.yaml +``` + +If no default experiment is configured, AgentV keeps the current behavior and +uses the `default` experiment label. Existing `eval.yaml`-only repositories +remain valid. + +Legacy `eval.yaml execution` fields that select targets, targets matrices, +workers, cache, trials, budget, thresholds, and workspace runtime behavior will +continue to parse. The migration path is additive first: experiment config +becomes the preferred source, while legacy fields remain a compatibility shim +until docs and examples have moved. + +AgentV should adopt Vercel's structure and lowest-common-denominator contract +ideas, not depend on `@vercel/agent-eval` as core infrastructure in this phase. +The package's `ExperimentConfig` shape is a strong public reference for +experiment vocabulary: agent, model, agent options, eval filter, scripts, runs, +early exit, timeout, sandbox, and setup. A direct dependency would force AgentV +to absorb Vercel's fixture model, sandbox assumptions, result caching semantics, +and TypeScript-first authoring story before those boundaries are stable for +AgentV. + +## Consequences + +Positive: + +- Evals become portable task definitions that can be run against multiple agents + without editing the task file. +- A/B setup variants such as baseline versus skill injection become reviewable, + committed experiment files. +- Existing artifact paths already use experiment labels, so this decision extends + an established storage axis instead of introducing a parallel result concept. +- The default experiment pointer gives old repos a non-breaking migration path. +- AgentV can align with Vercel conventions while preserving YAML authoring, + LLM-judge assertions, workspace fixtures, and Git-backed artifacts. + +Negative: + +- The migration creates two valid locations for some runtime controls until + deprecation completes. +- The CLI must resolve explicit experiments, configured defaults, and legacy + label-only runs without surprising users. +- Artifact readers need a richer experiment fingerprint and provenance model + beyond the current string label. + +## Non-Goals + +- Do not replace AgentV's evaluator engine with `@vercel/agent-eval` in the + initial migration. +- Do not convert AgentV eval YAML into Vercel `PROMPT.md` plus `EVAL.ts`. +- Do not move LLM-judge assertions out of eval definitions. +- Do not make Phoenix, Harbor, Opik, Vercel Sandbox, or another external system + required for local execution. +- Do not break existing `eval.yaml` files or current result artifacts. + +## References + +- Vercel `agent-eval`: https://github.com/vercel-labs/agent-eval +- Vercel Next.js eval results: https://github.com/vercel/next-evals-oss +- Anthropic Skills schema vocabulary: https://github.com/anthropics/skills/blob/main/skills/skill-creator/references/schemas.md +- Hugging Face Datasets vocabulary: https://huggingface.co/docs/datasets/en/package_reference/main_classes +- OpenInference trace vocabulary: https://arize-ai.github.io/openinference/spec/ diff --git a/docs/plans/2026-06-23-002-experiments-separation-plan.md b/docs/plans/2026-06-23-002-experiments-separation-plan.md new file mode 100644 index 000000000..0749d1eeb --- /dev/null +++ b/docs/plans/2026-06-23-002-experiments-separation-plan.md @@ -0,0 +1,388 @@ +--- +title: "feat: Separate experiments from eval definitions" +type: feat +date: 2026-06-23 +origin: docs/adr/2026-06-23-experiments-vs-eval-separation.md +--- + +# feat: Separate experiments from eval definitions + +## Summary + +AgentV should separate eval task definitions from experiment run definitions. +Eval YAML stays the canonical authoring layer for prompts, datasets, assertions, +and task fixtures. Experiments become first-class committed files that select the +agent or target under test, model, harness options, setup injection, run knobs, +and eval filter. + +This should ship in phases. Phase 1 adds the non-breaking foundation: +experiment contract types, default experiment resolution, and artifact +attribution by resolved experiment name. Later phases move runtime controls out +of `eval.yaml execution`, teach the CLI to run experiment matrices, and record +full experiment provenance and fingerprints in run bundles. + +## Problem Frame + +Today `experiment` is a string label passed through +`packages/core/src/evaluation/evaluate.ts`, `packages/core/src/evaluation/run-artifacts.ts`, +`packages/core/src/evaluation/results-repo.ts`, and +`packages/core/src/evaluation/trace-envelope.ts`. Runtime choices are still +scattered across CLI flags, TypeScript config, `.agentv/config.yaml`, and +`eval.yaml execution`. + +That makes it hard to review A/B variants such as `baseline` versus +`agents-md`, because the variable under test can be hidden inside the eval +definition. The desired model is: + +- Eval equals what is tested. +- Experiment equals how and with what it is run. +- Setup that changes the agent's environment belongs to the experiment. +- Existing eval-only repositories keep working through a default experiment + fallback. + +## Requirements + +- R1. Existing `eval.yaml` files validate and run without modification. +- R2. Experiment wire config uses `snake_case`; TypeScript types use + `camelCase`. +- R3. `config.yaml` can point at a default experiment, with no pointer falling + back to the current `default` experiment label. +- R4. `agentv eval --experiment