feat: add experiment registry and flight experiment verbs#9
Merged
lewisnsmith merged 1 commit intomainfrom Apr 18, 2026
Merged
Conversation
Hard rename of the `log` command group to `logs` (plural) — no deprecation shim per user decision. Bare `flight logs` now lists sessions. Adds `flight run` as the happy-path entry point (human-friendly output: "Started run <id> session <id>") and `flight show <session>` as a one-liner delegating to viewSession. Both mirror the existing session start machinery.
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.
Summary
src/experiments.tsregistry module with race-safe file-per-experiment storage at~/.flight/experiments/<name>.jsonflight experiment {new,list,show,diff,export}command group for managing experiments and cross-run analysisflight run --experimentwith a one-line stderr hintWhat this PR adds
src/experiments.tsExperimentEntrytype withname,created_at,tags, optionaldescription,baseline_run_id,model_config,notesensureExperimentRegistered— race-safe via{ flag: "wx" }(O_EXCL); exactly one concurrent caller winscreated: truecreateOrUpdateExperiment— merges patch (arrays replace, not append); preservescreated_atgetExperiment,listExperiments— graceful reads; invalid files skipped with a log warningexperimentsDir— configurable viaopts.dirfor test isolationsrc/cli.tsadditionsexperiment new <name>— registers/updates an experimentexperiment list— table with run counts from SQLiteexperiment show <name>— metadata + recent runsexperiment diff <a> <b>— delegates tocompareCommandwith sessions from both experimentsexperiment export <name>— streams research JSONL per run to stdout (unbuffered)flight run --experimentnow callsensureExperimentRegisteredand prints a hint on first useTests
test/experiments.test.ts— 16 unit tests covering race safety, idempotency, merge semantics, invalid-file skippingtest/cli-rename.test.ts— extended with 3 CLI-spawn tests (self-skip when tsx unavailable in worktrees)Docs
Note on pre-existing test failures
test/integration.test.tsandtest/benchmark.test.tsfail in this worktree withENOENT: spawn tsx— the worktree has no localnode_modules. These failures pre-exist on main (verified). All 23 tests introduced in this PR pass.Dependencies
This branch includes the PR 1 changes (feat/cli-logs-rename) bundled together. Should be rebased/merged after the
feat/cli-logs-renamePR lands (or this can be rebased onto it).Test plan
npm run typecheckpasses (exit 0)npm run lintpasses (exit 0)npx vitest run test/experiments.test.ts— 16 tests passflight experiment new smoke --description "hi" --tags a,bcreates~/.flight/experiments/smoke.jsonflight experiment listshows registryflight run --agent x --experiment new-oneauto-creates + prints hintflight experiment diff a bexits 0 with a "no runs" message for zero-run case