Skip to content

fix(runs): import InputError from dokimi.files, not dokimi.utils - #1609

Merged
vlad-perevezentsev merged 2 commits into
intel:mainfrom
vlad-perevezentsev:fix/runs-resolve-import
Dec 4, 2026
Merged

vlad-perevezentsev merged 2 commits into
intel:mainfrom
vlad-perevezentsev:fix/runs-resolve-import

Conversation

@vlad-perevezentsev

Copy link
Copy Markdown
Contributor

Summary

Makes main green again. Since 01ff2d6 tests/test_import_architecture.py::test_package_uses_the_new_modules fails on main:

AssertionError: ['dokimi.runs.resolve'] import dokimi.utils; import the names from their defining modules

A semantic race between two PRs that were each green against their own base:

The fix imports InputError from dokimi.files, where it is defined:

 from dokimi.artifacts import is_run_id, schema_errors
+from dokimi.files import InputError
 from dokimi.runs.rundir import RUN_FILE
 ...
-from dokimi.utils import InputError

dokimi.utils.InputError is the same class object (test_legacy_utils_exports_still_resolve checks the identity), so nothing changes at runtime. The same import that #1523 added in tests/test_runs_resolve.py moves to dokimi.files too, following #1190, which moved the tests as well. After this, nothing outside test_import_architecture.py imports dokimi.utils (grep of dokimi/).

Every open PR rebased on main inherits the failure until this lands.

Fixes #1608
Refs #1190, #1523

Evidence

  • tests/test_import_architecture.py on main: 1 failed (test_package_uses_the_new_modules), 55 passed; on the branch: 56 passed.
  • tests/test_runs_resolve.py with the moved import: 38 passed.
  • make ci-local --offline (quick: static, typecheck, whole pytest suite), 0 failed tests on both commits (35299 passed, 132 skipped on the first). The one FAIL is the changelog fragment check: no fragment, since the change has no user-visible effect (refactor(utils): split dokimi/utils.py into frontmatter, files, digest, model_names #1190 had none either), hence skip-changelog.

Not in this PR

  • Three docstrings still cross-reference :class:`~dokimi.utils.InputError` (gate/score_gate.py lines 9 and 37, gate/regression.py line 74). They are not imports, the test does not see them, and the re-export keeps them resolving.

Checklist

  • Tests added/updated and pytest passes: no new test; the failing test_package_uses_the_new_modules is the regression test, the whole suite passes (35299 passed)
  • ruff, mypy, and schema checks pass (make ci-local --offline, static and typecheck jobs)
  • Docs updated (or N/A): N/A, an import change
  • Self-reviewed per "Before opening a PR" in AGENTS.md: grep of dokimi/ for other dokimi.utils imports (none left)
  • Each new raise/exit and test names the doc, contract or issue it traces to: N/A, none added
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header: N/A, no new files

upstream/main fails test_package_uses_the_new_modules: dokimi.runs.resolve
imports InputError through the legacy dokimi.utils re-export. intel#1190 split
utils into its defining modules and added the test; intel#1523 added the
import. Each PR was green against its own base, so the failure appeared
only after both merged.

Import InputError from dokimi.files, where it is defined. It is the same
class object, so nothing changes at runtime.

Refs intel#1190, intel#1523

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
intel#1523 added the legacy dokimi.utils import in the test too. intel#1190 moved
the tests to the defining modules, so point this one at dokimi.files as
well. test_package_uses_the_new_modules scans only the package, so it
did not catch this one.

Refs intel#1190, intel#1523

Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
@vlad-perevezentsev
vlad-perevezentsev requested a review from a team as a code owner December 4, 2026 11:15
@vlad-perevezentsev vlad-perevezentsev added the skip-changelog No user-visible change: bypasses the changelog fragment check label Dec 4, 2026
@vlad-perevezentsev vlad-perevezentsev self-assigned this Dec 4, 2026
@exai-bot

exai-bot commented Dec 4, 2026 •

Copy link
Copy Markdown

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

CI at e8ca93c: 21 passing, 4 skipped (9 jobs of superseded runs not counted).

Review details
  • Commit reviewed: e8ca93c against merge base 01ff2d6
  • Coverage: 2 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 26k tokens (10k from cache), 5s
  • Tool calls: 5 (5 file_read)
  • small change set: 2 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.46%. Comparing base (01ff2d6) to head (e8ca93c).
⚠️ Report is 1 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1609   +/-   ##
=======================================
  Coverage   96.46%   96.46%           
=======================================
  Files         561      561           
  Lines       74345    74345           
  Branches    12840    12840           
=======================================
+ Hits        71716    71719    +3     
+ Misses       1609     1604    -5     
- Partials     1020     1022    +2     
Files with missing lines Coverage Δ
dokimi/dokimi/runs/resolve.py 98.23% <100.00%> (ø)

... and 7 files with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog No user-visible change: bypasses the changelog fragment check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_import_architecture fails on main: runs/resolve.py imports dokimi.utils

4 participants