Skip to content

fix(runs): gc --keep-baselines refuses a non-object baseline copy - #1340

Merged
xaleryb merged 1 commit into
intel:mainfrom
vchamarthi:issue-1332-run-history-misdocuments-question-subjec
Nov 27, 2026
Merged

xaleryb merged 1 commit into
intel:mainfrom
vchamarthi:issue-1332-run-history-misdocuments-question-subjec

Conversation

@vchamarthi

Copy link
Copy Markdown
Contributor

Summary

Fixes #1332. runs gc --keep-baselines selected a run when its saved baseline copy held [], and docs/runs.md said a questions set from questions generate shows - as its subject although runs list shows its product.

Changes

  • baseline_runs raises InputError (not a JSON object, so the run it holds is not known) when a copy parses to something other than an object; an object without run_id still holds no run.
  • docs/runs.md drops questions generate from the no-subject list and states the new refusal.
  • Changelog fragment added.

Risk

Only a copy that parses to a non-object changes: gc now exits 2 instead of treating it as holding no run.

Testing

python -m pytest -q tests/test_runs_rm_gc.py tests/test_growth_ratchet.py passes (99 tests), and ruff check on the changed Python files is clean. New tests cover [], null, a string and a number, and read the docs page.

Open questions

Only a non-object copy is refused. A copy that is an object with a malformed run_id is still treated as holding no run; I left that as it was.

  • I chose Refuse only a copy that parses to a non-object over Also refuse an object whose run_id is missing or malformed: A copy saved before the envelope has no run_id and docs/runs.md says it holds no run; smallest change. Is that the behaviour you want?

Revert

A plain revert restores the old behaviour; nothing is stored.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

Related issues:

Checklist evidence
  • Tests added/updated and pytest passes: 1 test file(s) changed; suite: 31214 passed; 1 failing test(s) fail on the base branch too: tests/test_repo_compare_interval.py::test_the_row_p_places_zero_where_large_deltas_round_p_at_zero_apart; 2 of 2 proof(s) fail before the change
  • ruff, mypy, and schema checks pass: passed: ci.yml:static / ruff check, ci.yml:typecheck / mypy, ci.yml:static / schema-check, ci.yml:static / schema_compat vs the PR base
  • Docs updated (or N/A): updated: dokimi/docs/runs.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md: nothing left open; mutation of changed lines ran
  • Each new raise/exit and test names the doc, contract or issue it traces to: every new error path and test names a doc, contract or issue
  • No ad-hoc run artifacts committed: 1 added file(s), none a run's output
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml): no new source file

Fixes #1332.

A baseline copy holding `[]` was read as a pre-envelope copy with no run,
so its run could be selected. It now exits 2 naming the copy. docs/runs.md
also listed a generated questions set as having no subject, though
`runs list` shows its product.

Fixes intel#1332

Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
@vchamarthi
vchamarthi requested a review from a team as a code owner November 27, 2026 16:10
Copilot AI balanced review requested due to automatic review settings November 27, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the baseline-copy validation and documentation updates.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

Fixes #1332 by making run-history garbage collection refuse non-object baseline copies and correcting the documented subject for generated question sets.

Changes:

  • Makes runs gc --keep-baselines exit 2 for non-object copies before removing anything, while preserving support for legacy objects without run_id.
  • Corrects the generated-question subject documentation and documents the new refusal.
  • Adds regression tests and a changelog entry.
File Description
dokimi/​tests/​test_runs_rm_gc.py Tests non-object baseline refusal and the documentation correction.
dokimi/​dokimi/​runs/​rm.py Raises InputError when a baseline copy is not a JSON object.
dokimi/​docs/​runs.md Corrects question subjects and explains the baseline refusal.
dokimi/​changelog.d/​20261127_120000_runs-gc-baseline-not-object.md Records the behavior and documentation fixes.

Review effort: Balanced

@exai-bot

exai-bot commented Nov 27, 2026 •

Copy link
Copy Markdown

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

CI at 01c93f8: 21 passing, 4 skipped.

Review details
  • Commit reviewed: 01c93f8 against merge base 1673824
  • Coverage: 4 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 64k tokens (39k from cache), 13s
  • Tool calls: 8 (4 file_read, 3 code_search, 1 ci_status)
  • Run garbage collection baseline handling, tests, and documentation: 4 files

@codecov-commenter

Copy link
Copy Markdown

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.18%. Comparing base (1673824) to head (01c93f8).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1340      +/-   ##
==========================================
- Coverage   96.19%   96.18%   -0.01%     
==========================================
  Files         499      499              
  Lines       66465    66467       +2     
  Branches    11542    11543       +1     
==========================================
- Hits        63933    63932       -1     
  Misses       1563     1563              
- Partials      969      972       +3     
Files with missing lines Coverage Δ
dokimi/dokimi/runs/rm.py 98.91% <100.00%> (+0.02%) ⬆️

... and 6 files with indirect coverage changes

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

@xaleryb xaleryb 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.

Approved on 01c93f8. A baseline copy whose JSON is not an object now stops gc with exit 2 and names the copy before anything is removed (main exited 0 and would remove the run), and the docs fix holds; #1184 rewrites the same --keep-baselines paragraph, so whichever lands second keeps the refusal sentence. Tests and gates are green. Windows smoke had not started (the hosted Windows queue was stuck); every other check passed.

@xaleryb
xaleryb merged commit 2207f56 into intel:main Nov 27, 2026
25 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.

Run history misdocuments question subjects and garbage collection trusts invalid baselines

5 participants