Skip to content

feat(runs): --baseline baseline:NAME reads the run a runs baseline points to - #1522

Merged
napetrov merged 16 commits into
intel:mainfrom
vlad-perevezentsev:feat/baseline-name-refs
Dec 3, 2026
Merged

napetrov merged 16 commits into
intel:mainfrom
vlad-perevezentsev:feat/baseline-name-refs

Conversation

@vlad-perevezentsev

@vlad-perevezentsev vlad-perevezentsev commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #94 R3 (§2.3: "runs baseline save NAME RUN creates one, and compare RUN baseline:NAME resolves it"). #1184 added the pointers; this PR lets the commands that already read a baseline file read a pointer instead.

  • --baseline baseline:NAME on four commands reads the artifact of the command's kind in the run the baseline points to, under the runs root (DOKIMI_RUNS_DIR, else results/):

    Command Reads from the run
    arms plugin-delta --baseline the arms.v1 artifact
    docs compare --baseline the docs_run.v1 snapshot
    repo scan --baseline the repo_readiness.v1 report; baseline.source is its path, with /
    baseline compare --baseline the eval.v1 artifact, instead of a baselines/eval/manifest.json entry; saved is when the pointer was saved. A manifest entry saved under that very name (baseline save --name baseline:main works on POSIX) is still read by it, as before
    $ python cli.py runs baseline save main 20261028T093512Z-77c2e0b4
    $ python cli.py arms plugin-delta --baseline baseline:main --plugin-json results/arms/plugin.json
    
  • One resolver in dokimi/runs/baseline.py: resolve_ref(ref, kind) -> Path (a value without the prefix is the path it spells, as before), built on resolve_pointer(ref, kind) -> (Pointer, Path), which baseline compare uses for saved, and is_ref(value). The task card had resolve_ref(ref); it takes the kind because a run holds artifacts of several kinds and each reader needs one file. The --from RUN resolver (in progress separately) can call resolve_pointer/pointed for baseline:NAME.

  • Refusals, all exit 2 (docs/runs.md, "Reading a baseline"): a name that is not a baseline name (checked before the runs root); no runs root; no baseline of that name, naming one that differs only in case as runs baseline rm does (the check is now shared with rm); a pointer that cannot be read or holds no run id; a run with no artifact of the kind (removed since the save, say), counting the files under the root that could not be read; a run with several, naming up to three by the path --baseline takes (results/a/c1.json) and picking none.

  • The flag registry already spells the concept --baseline RUN|baseline:NAME|FILE; the three registered leaves now show baseline:NAME|FILE, and their MEANING_EXCEPTIONS rows in tests/test_cli_flags.py say they take a named baseline but not a run yet. The CLI snapshot does not record metavars, so it is unchanged.

Changed output

Only help text and metavars change (--baseline FILE -> --baseline baseline:NAME|FILE on arms plugin-delta, docs compare, repo scan; new help on baseline compare --baseline). A value without the baseline: prefix is read exactly as before; a file whose name starts with baseline: is now given as ./baseline:....

Evidence

  • tests/test_baseline_refs.py (29 tests), all failing on main (resolve_ref missing, or the command reading baseline:main as a missing file), all passing on the branch:
    • the resolver: a path passes through (a Windows path too); the kind's artifact of the pointed run; a moved pointer; DOKIMI_RUNS_DIR; each refusal above with its message; the ambiguous case's listed path opens as given.
    • per command: arms plugin-delta, docs compare and repo scan give the same output for baseline:main as for the path of the same file; baseline compare gates (exit 1) and checks models (--strict exit 4) against the pointed eval, prints the pointer's save time, does not read or create the manifest, refuses baseline:main when only a manifest entry main exists, still reads a manifest name, and reads a manifest entry named baseline:main over the runs baseline main.
  • Mutations by hand, each caught: no exact-name check; no kind filter; first of several taken; the "N more" count; an unreadable pointer accepted; each of the four commands not resolving; the pointer's save time dropped; the no-store message; the unreadable-files note; the name check after the root lookup.
  • make ci-local --offline on be7d1ed6: 0 failed, 27 passed, 22 skipped; pytest 32665 passed, 132 skipped. Mutate changed lines: 70 mutants, 63 killed, 7 survived (warn only): the required=True of docs compare --baseline and the add_argument of repo scan --baseline (no parser test of them here), check_name inside pointed (its callers check first), the path-as-given branch of repo scan, the >/>= boundary and the take-branch of the "N more" suffix, and entry/entries; review round 1 added tests for the last three (exactly three artifacts, two unreadable entries). The fix commits after it were checked with slot ci --quick (0 failed).
  • An independent review found four points, each fixed in its own commit: the ambiguous error listed root-relative paths that --baseline could not open; baseline compare repeated the resolver's steps; docs/runs.md promised baseline:NAME to every baseline reader; baseline.source used native separators.
  • Run by hand: baseline:main with no results/, baseline: and baseline:a/../b exit 2 with a message. Not run: Windows (the / in baseline.source is from as_posix()).

Not in this PR

  • --baseline RUN (a run id), the registry's RUN form: the --from RUN resolver, a separate PR.
  • skill novelty retest --baseline: it reads a directory of novelty.json files, not one artifact of a run; docs/runs.md says it does not take baseline:NAME yet.
  • repo compare --baseline and repo security --baseline take an arm (ARM, BATCH/ARM), not a run, so baseline:NAME does not apply there.
  • baseline:FILE|URL (§2.3) and runs export|import.
  • test_blank_inline.py::test_the_opener_of_each_link_of_one_row_is_found_without_reading_the_brackets_before_it (a growth-timing test) failed once under load here and fails the same way on main; unrelated.

Open questions

None.

Revert

A plain revert. Nothing is stored: pointers and artifacts are only read.

Checklist

  • Tests added/updated and pytest passes — tests/test_baseline_refs.py; the full suite in make ci-local
  • ruff, mypy, and schema checks pass — make ci-local --offline, static and typecheck jobs
  • Docs updated (or N/A) — docs/runs.md "Reading a baseline", and a line each in evaluating-treatments.md, benchmarking-and-comparison.md, repo-evaluation-contract.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md — mutations above, bad inputs run, check_growth.py clean
  • Each new raise/exit and test names the doc, contract or issue it traces to — docs/runs.md "Reading a baseline" (CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 §2.3); the test module cites it
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…ints to

runs.baseline.resolve_ref(ref, kind) is the one resolver for a
--baseline value: baseline:NAME is the kind's artifact of the run the
pointer holds under the runs root, anything else the path it spells.
It is used where a command reads a baseline file today:

- arms plugin-delta --baseline (arms.v1)
- docs compare --baseline (docs_run.v1)
- repo scan --baseline (repo_readiness.v1)
- baseline compare --baseline (eval.v1, instead of a manifest name)

No such baseline (one differing only in case is named), a pointer
that holds no run id, and a run with no or several artifacts of the
kind exit 2. repo compare and repo security take an arm as
--baseline, not a run, so they are left as they are.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…ine takes

The error for a run with several artifacts of the kind listed them
relative to the runs root (a/c1.json), so giving one of them as it
advises failed; it lists results/a/c1.json now and names the root.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…ed resolver

resolve_pointer(ref, kind) returns the pointer with the artifact's path,
and resolve_ref is its path; baseline compare calls it for saved_at
instead of repeating the steps. is_ref is the one prefix test, used by
baseline compare and repo scan.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…latform

baseline.source took the native separators of the resolved path, so a
committed report differed between Windows and Linux; it is as_posix()
now, as the runs commands print paths.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
… retest

The section said any command that reads a baseline file takes it;
skill novelty retest --baseline reads a directory of novelty.json
files and does not.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
@vlad-perevezentsev
vlad-perevezentsev requested a review from a team as a code owner December 1, 2026 20:53
@vlad-perevezentsev vlad-perevezentsev self-assigned this Dec 1, 2026
@codecov-commenter

codecov-commenter commented Dec 1, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.59036% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.49%. Comparing base (599fcad) to head (0ad2f0b).

Files with missing lines Patch % Lines
dokimi/dokimi/commands/baseline.py 91.66% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1522      +/-   ##
==========================================
- Coverage   96.51%   96.49%   -0.02%     
==========================================
  Files         540      540              
  Lines       72237    72297      +60     
  Branches    12451    12456       +5     
==========================================
+ Hits        69717    69764      +47     
- Misses       1544     1552       +8     
- Partials      976      981       +5     
Files with missing lines Coverage Δ
dokimi/dokimi/commands/arms.py 97.79% <100.00%> (+0.01%) ⬆️
dokimi/dokimi/commands/repo.py 100.00% <100.00%> (ø)
dokimi/dokimi/commands/repo_scan.py 88.81% <100.00%> (+0.22%) ⬆️
dokimi/dokimi/commands/run.py 97.24% <100.00%> (+0.01%) ⬆️
dokimi/dokimi/runs/baseline.py 92.69% <100.00%> (+1.02%) ⬆️
dokimi/dokimi/commands/baseline.py 95.08% <91.66%> (-0.44%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@exai-bot

exai-bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 14 selected item(s).

CI at 0ad2f0b: 26 passing, 4 skipped.

Review details
  • Commit reviewed: 0ad2f0b against merge base 599fcad
  • Coverage: 14 files in 2 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 261k tokens (143k from cache), 41s
  • Tool calls: 27 (20 file_read, 2 code_search, 2 local_check_results, 1 ci_status, 1 file_read_diff, 1 linked_items)
  • Named baseline references: implementation, tests, and documentation: 6 files
  • Baseline reference integration across evaluation commands and CLI contracts: 8 files

Comment thread dokimi/tests/test_baseline_refs.py Resolved

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 72 focused tests passed. I also compared an existing manifest entry through the CLI on the merge base and this head. A previously saved manifest baseline whose name starts with baseline: cannot be selected.

Comment thread dokimi/dokimi/commands/baseline.py Resolved
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 2 of 39 small breaks of the lines this PR changes, and the check was not complete

At 0ad2f0b: 36 caught · 2 missed · 1 inconclusive · 38 not tried in time

Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put # mutation-ok[<operator>]: <reason> at the end of the line or alone on the line above.

Where Operator Change no test notices Tests reaching the line
dokimi/dokimi/commands/repo.py:401 delete-statement scan_p.add_argument("--baseline", default=None, metavar="baseline:NAME|FILE", → pass 628
dokimi/dokimi/runs/baseline.py:440 delete-statement check_name(name) → pass 20

Not the whole picture:

  • 38 breaks were not tried before the time budget ran out
  • 3 candidate test files were not run
  • 17 changed lines were not mutated

Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary.

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vlad-perevezentsev, could you fix the problem I found and the small thing I've marked fix before merge (in the line comments) and fix what the bot's thread on dokimi/tests/test_baseline_refs.py:240 still points out? Then push and I'll take another look.

What I checked on a5e7026: the 72 changed tests pass, and fail on main as expected; the full test suite passes with main merged in (34,287 tests), apart from failures main has too; it merges cleanly onto main; when I changed the code on purpose, the tests caught all 12 changes.

Comment thread dokimi/tests/test_baseline_refs.py Resolved
Comment thread dokimi/tests/test_baseline_refs.py Resolved
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…NAME

On POSIX `baseline save --name baseline:main` succeeds, and before
baseline:NAME named a runs baseline, `baseline compare --baseline
baseline:main` read that entry. An entry of the manifest saved under
the very name given is now read first, as before; the runs baseline
of that name is then read under another name.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
… with no count

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
… Windows

baseline_from keeps a file --baseline as given, so str(report) has
backslashes on Windows while baseline:NAME records the path with /.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…ry takes

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
212de1a picked up the parallel-coverage leftovers of a local CI run.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change class: CONTRACT (head 129b3aa)

  • Contract: changed. errors dokimi/dokimi/commands/baseline.py:329; errors dokimi/dokimi/commands/repo_scan.py:288
  • Responsibility: none
  • Dependency: none
  • Review depth: check the changed surface: callers, docs, tests pin new behaviour
  • Coverage gaps: none

Nothing to fix in this pass. The baseline reference tests cover missing and ambiguous artifacts, exact-name handling, and precedence for existing manifest entries.

Checked the diff, input edges, prior feedback, and focused offline tests on Linux/Python 3.11 (74 passed, 1 skipped in 3.70s).

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
The bad-path contract from main (intel#1492) finds a path parameter by its
metavar, among other cues. This branch writes the --baseline metavar
`baseline:NAME|FILE`, so `arms plugin-delta --baseline` stopped being a
path, got a non-path filler and was refused before --plugin-json was
reached. Check each `|` alternative of the metavar.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Comment thread dokimi/tests/test_baseline_refs.py Resolved

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change class: CONTRACT (head b586228)

  • Contract: changed. errors dokimi/dokimi/commands/baseline.py:329; errors dokimi/dokimi/commands/repo_scan.py:288
  • Responsibility: none
  • Dependency: none
  • Review depth: check the changed surface: callers, docs, tests pin new behaviour
  • Coverage gaps: none

0 new must-fix findings. The earlier items below remain open. The updated CLI fault harness recognizes the baseline-reference metavar. The Windows test issue raised on this head remains open.

Checked the diff, input edges, and focused offline Linux tests (focused: 75 passed, 1 skipped in 7.88s). Checked the baseline and CLI paths on Linux. Windows filesystem behavior was not run. The agent-run fault-harness failure reproduces on the base.

  • Still open. The existing Windows test report concerns the literal colon in a filename. Linux focused tests exercise the CLI path. Earlier thread

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
… file

The precedence test saved its manifest copy as baseline:main.json, a
name Windows reads as an alternate data stream, so the save failed
there before the test reached its assertion. Save the copy under a
portable name and name only the manifest entry baseline:main: that is
what compare matches on.

Refs intel#94

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change class: CONTRACT (head 0ad2f0b)

  • Contract: changed. errors dokimi/dokimi/commands/baseline.py:329; errors dokimi/dokimi/commands/repo_scan.py:207
  • Responsibility: none
  • Dependency: none
  • Review depth: check the changed surface: callers, docs, tests pin new behaviour
  • Coverage gaps: none

No merge-blocking findings.

Checked named baseline resolution, plain files and CLI compatibility with current main. Required CI passed. The runs documentation overlaps #1523.

@napetrov
napetrov merged commit 2723240 into intel:main Dec 3, 2026
30 checks passed
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.

5 participants