Repository navigation
feat(runs): --baseline baseline:NAME reads the run a runs baseline points to - #1522
Conversation
…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>
|
Codecov Report❌ Patch coverage is
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
🚀 New features to boost your workflow:
|
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 14 selected item(s). CI at Review details
|
napetrov
left a comment
There was a problem hiding this comment.
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.
Mutation of changed linesAt 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
Not the whole picture:
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
vchamarthi
left a comment
There was a problem hiding this comment.
@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.
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>
napetrov
left a comment
There was a problem hiding this comment.
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>
napetrov
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Summary
Refs #94 R3 (§2.3: "
runs baseline save NAME RUNcreates one, andcompare RUN baseline:NAMEresolves it"). #1184 added the pointers; this PR lets the commands that already read a baseline file read a pointer instead.--baseline baseline:NAMEon four commands reads the artifact of the command's kind in the run the baseline points to, under the runs root (DOKIMI_RUNS_DIR, elseresults/):arms plugin-delta --baselinearms.v1artifactdocs compare --baselinedocs_run.v1snapshotrepo scan --baselinerepo_readiness.v1report;baseline.sourceis its path, with/baseline compare --baselineeval.v1artifact, instead of abaselines/eval/manifest.jsonentry;savedis when the pointer was saved. A manifest entry saved under that very name (baseline save --name baseline:mainworks on POSIX) is still read by it, as beforeOne resolver in
dokimi/runs/baseline.py:resolve_ref(ref, kind) -> Path(a value without the prefix is the path it spells, as before), built onresolve_pointer(ref, kind) -> (Pointer, Path), whichbaseline compareuses forsaved, andis_ref(value). The task card hadresolve_ref(ref); it takes the kind because a run holds artifacts of several kinds and each reader needs one file. The--from RUNresolver (in progress separately) can callresolve_pointer/pointedforbaseline: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 asruns baseline rmdoes (the check is now shared withrm); 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--baselinetakes (results/a/c1.json) and picking none.The flag registry already spells the concept
--baseline RUN|baseline:NAME|FILE; the three registered leaves now showbaseline:NAME|FILE, and theirMEANING_EXCEPTIONSrows intests/test_cli_flags.pysay 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|FILEonarms plugin-delta,docs compare,repo scan; new help onbaseline compare --baseline). A value without thebaseline:prefix is read exactly as before; a file whose name starts withbaseline:is now given as./baseline:....Evidence
tests/test_baseline_refs.py(29 tests), all failing on main (resolve_refmissing, or the command readingbaseline:mainas a missing file), all passing on the branch:DOKIMI_RUNS_DIR; each refusal above with its message; the ambiguous case's listed path opens as given.arms plugin-delta,docs compareandrepo scangive the same output forbaseline:mainas for the path of the same file;baseline comparegates (exit 1) and checks models (--strictexit 4) against the pointed eval, prints the pointer's save time, does not read or create the manifest, refusesbaseline:mainwhen only a manifest entrymainexists, still reads a manifest name, and reads a manifest entry namedbaseline:mainover the runs baselinemain.make ci-local --offlineon be7d1ed6: 0 failed, 27 passed, 22 skipped; pytest 32665 passed, 132 skipped.Mutate changed lines: 70 mutants, 63 killed, 7 survived (warn only): therequired=Trueofdocs compare --baselineand theadd_argumentofrepo scan --baseline(no parser test of them here),check_nameinsidepointed(its callers check first), the path-as-given branch ofrepo scan, the>/>=boundary and the take-branch of the "N more" suffix, andentry/entries; review round 1 added tests for the last three (exactly three artifacts, two unreadable entries). The fix commits after it were checked withslot ci --quick(0 failed).--baselinecould not open;baseline comparerepeated the resolver's steps;docs/runs.mdpromisedbaseline:NAMEto every baseline reader;baseline.sourceused native separators.baseline:mainwith noresults/,baseline:andbaseline:a/../bexit 2 with a message. Not run: Windows (the/inbaseline.sourceis fromas_posix()).Not in this PR
--baseline RUN(a run id), the registry'sRUNform: the--from RUNresolver, a separate PR.skill novelty retest --baseline: it reads a directory ofnovelty.jsonfiles, not one artifact of a run;docs/runs.mdsays it does not takebaseline:NAMEyet.repo compare --baselineandrepo security --baselinetake an arm (ARM,BATCH/ARM), not a run, sobaseline:NAMEdoes not apply there.baseline:FILE|URL(§2.3) andruns 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
pytestpasses —tests/test_baseline_refs.py; the full suite inmake ci-localruff,mypy, and schema checks pass —make ci-local --offline, static and typecheck jobsdocs/runs.md"Reading a baseline", and a line each inevaluating-treatments.md,benchmarking-and-comparison.md,repo-evaluation-contract.mdAGENTS.md— mutations above, bad inputs run,check_growth.pycleanraise/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.github/.licenserc.yaml)