Repository navigation
refactor(utils): split dokimi/utils.py into frontmatter, files, digest, model_names - #1190
Conversation
|
OpenCodeReview: Commit 4c36a6e was not reviewed. This PR has reached its review limit (6 reviews). CI at `4c36a6e`: 13 still running, 2 passing, 2 skipped
3 more not listed. To review this commit: re-request review from exai-bot in the Reviewers list. Last review (3ab31d8): no findingsOpen threads from the bot: 0 |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1190 +/- ##
==========================================
- Coverage 96.53% 96.53% -0.01%
==========================================
Files 550 554 +4
Lines 73183 73218 +35
Branches 12623 12623
==========================================
+ Hits 70645 70678 +33
Misses 1553 1553
- Partials 985 987 +2
🚀 New features to boost your workflow:
|
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟡 Changes needed · reviewed b5c0a1b
To fix: removing dokimi.utils outright breaks open PRs that merge without a conflict (line comment); the import-style nit is optional. The branch also needs a rebase: it conflicts with current main in repos/source.py (one import line, from #1139).
✅ make ci-local --offline: 28,236 passed, mutation and changed-line coverage pass · ✅ all 45 definitions of the old utils.py are AST-identical in the new modules, one home each · ✅ no dokimi.utils left in code or docs
The split is clean and the new module names say what each one holds.
The @exai-bot test notes on model_names.py:63 and :67 are about code moved here unchanged, so they belong to a separate test change, not to this PR.
|
Re: review by vlad-perevezentsev
|
Mutation of changed linesAt 4c36a6e: 6 caught · 0 missed · 10 inconclusive · 64 not tried in time This is not a clean result:
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.
@napetrov, could you fix the problem I found (in the line comments)? Then push and I'll take another look.
Also holding my approval:
- A check of the change fails on this head.
What I checked on 3ab31d8:
- The full test suite fails with main merged in, at
tests/test_arm_runner.py::test_a_bare_bedrock_judge_name_is_checked_as_the_judge_will_call_it,tests/test_arm_runner.py::test_cli_accepts_every_correction_stats_supports,tests/test_arm_runner.py::test_cli_defaults_stats_correction_to_holm. - When I changed the code on purpose, the tests still passed for 3 of 12 changes, and no test pins these down yet (non-blocking):
dokimi/dokimi/files.py:35(the condition is negated),dokimi/dokimi/files.py:39(the handled error is raised again) anddokimi/dokimi/files.py:63(the handled error is raised again). - The 7321 changed tests pass, and fail on main as expected.
- It merges cleanly onto main.
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
No open issues 🎉
What changed in this PR
Refactors the former monolithic dokimi/utils.py by splitting its contents into focused modules (frontmatter, files, digest, model_names) and updating internal imports across the codebase to match the new locations.
Changes:
- Added new core modules:
dokimi.frontmatter,dokimi.files,dokimi.digest(trimmed), anddokimi.model_names. - Updated package code, scripts, fuzz targets, and tests to import moved symbols from their new modules.
- Updated docs/changelog and fuzz workflow path filters to reflect the module split.
| File | Description |
|---|---|
| .github/workflows/fuzz.yml | Updates path filters to track the new split modules instead of utils.py. |
| dokimi/changelog.d/20261124_120000_napetrov_arch-c14.md | Changelog entry documenting removal of dokimi.utils and where names moved. |
| dokimi/docs/architecture.md | Updates architecture docs to replace utils with the new foundation modules. |
| dokimi/docs/judge-panel-study.md | Updates documentation references for independence warning helper. |
| dokimi/dokimi/agent_profiles/loader.py | Updates frontmatter import to dokimi.frontmatter. |
| dokimi/dokimi/artifacts.py | Moves InputError / JSON reader imports to dokimi.files. |
| dokimi/dokimi/cli.py | Updates InputError import site for CLI error handling. |
| dokimi/dokimi/cli_output.py | Updates InputError import site. |
| dokimi/dokimi/commands/answer_formats.py | Moves read_json_input/InputError to dokimi.files and self-judge warning to dokimi.model_names. |
| dokimi/dokimi/commands/answers.py | Updates InputError import. |
| dokimi/dokimi/commands/arms.py | Splits InputError/read_json_input vs question_id imports across files and records. |
| dokimi/dokimi/commands/baseline.py | Moves model identity helpers to dokimi.model_names and JSON/file helpers to dokimi.files. |
| dokimi/dokimi/commands/baseline_regression.py | Updates InputError import. |
| dokimi/dokimi/commands/benchmark.py | Routes judge-model validation and warnings via dokimi.model_names; moves file/device helpers to dokimi.files. |
| dokimi/dokimi/commands/cache_dir.py | Updates InputError import in helper functions. |
| dokimi/dokimi/commands/catalog.py | Moves InputError and JSON reading to dokimi.files. |
| dokimi/dokimi/commands/catalog_eval.py | Updates InputError import. |
| dokimi/dokimi/commands/catalog_novelty.py | Updates InputError import and tree digest import to dokimi.digest. |
| dokimi/dokimi/commands/catalog_probe.py | Moves JSON reader and InputError to dokimi.files. |
| dokimi/dokimi/commands/catalog_provenance.py | Updates InputError import. |
| dokimi/dokimi/commands/catalog_scan.py | Moves frontmatter parsing to dokimi.frontmatter and tree digest to dokimi.digest. |
| dokimi/dokimi/commands/context.py | Moves InputError/refuse_device to dokimi.files. |
| dokimi/dokimi/commands/dashboard.py | Updates InputError import. |
| dokimi/dokimi/commands/dataset.py | Updates InputError import. |
| dokimi/dokimi/commands/delivery.py | Updates InputError import. |
| dokimi/dokimi/commands/eval_coverage.py | Updates InputError import. |
| dokimi/dokimi/commands/eval_graph.py | Updates InputError import. |
| dokimi/dokimi/commands/evaluate.py | Routes independence warnings through dokimi.model_names and InputError through dokimi.files. |
| dokimi/dokimi/commands/explore.py | Updates InputError import. |
| dokimi/dokimi/commands/headroom.py | Updates InputError import. |
| dokimi/dokimi/commands/ingest.py | Updates InputError import. |
| dokimi/dokimi/commands/inputs.py | Moves file/device helpers to dokimi.files. |
| dokimi/dokimi/commands/judge_reliability.py | Moves JSON reader + InputError to dokimi.files, self-judge warning to dokimi.model_names, and question_id to dokimi.records. |
| dokimi/dokimi/commands/leak.py | Updates InputError import. |
| dokimi/dokimi/commands/library.py | Updates InputError import. |
| dokimi/dokimi/commands/llms_txt.py | Updates InputError import. |
| dokimi/dokimi/commands/memory.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_atoms_file.py | Updates InputError import and moves same_model import to dokimi.model_names. |
| dokimi/dokimi/commands/novelty_budget.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_ground.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_retest.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_routing.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_routing_inputs.py | Moves InputError/is_symlink_loop to dokimi.files. |
| dokimi/dokimi/commands/novelty_routing_report.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_run.py | Updates InputError import. |
| dokimi/dokimi/commands/novelty_view_inputs.py | Updates InputError import. |
| dokimi/dokimi/commands/opportunities.py | Updates InputError import. |
| dokimi/dokimi/commands/orchestrate.py | Routes Bedrock checks and judge-independence warnings via dokimi.model_names; moves InputError to dokimi.files. |
| dokimi/dokimi/commands/personas.py | Moves JSON reader + InputError to dokimi.files. |
| dokimi/dokimi/commands/questions.py | Splits imports across dokimi.files (Input/JSON), dokimi.digest (key_bytes), and dokimi.model_names (self-judge warning). |
| dokimi/dokimi/commands/redteam.py | Updates InputError import. |
| dokimi/dokimi/commands/repair_receipt.py | Updates InputError import. |
| dokimi/dokimi/commands/report.py | Moves JSON reader + InputError to dokimi.files. |
| dokimi/dokimi/commands/repo.py | Moves JSON reader + InputError to dokimi.files. |
| dokimi/dokimi/commands/repo_hits.py | Updates InputError import. |
| dokimi/dokimi/commands/repo_reach.py | Updates InputError import. |
| dokimi/dokimi/commands/repo_run.py | Moves tree_digest to dokimi.digest and InputError to dokimi.files. |
| dokimi/dokimi/commands/repo_scan.py | Moves JSON reader + InputError to dokimi.files. |
| dokimi/dokimi/commands/repo_security.py | Updates InputError import. |
| dokimi/dokimi/commands/repo_skill_reach.py | Updates InputError import. |
| dokimi/dokimi/commands/routing_compare.py | Updates InputError import. |
| dokimi/dokimi/commands/run.py | Updates InputError import. |
| dokimi/dokimi/commands/runs.py | Updates InputError import. |
| dokimi/dokimi/commands/skill_coverage.py | Updates InputError import. |
| dokimi/dokimi/commands/skill_sensitivity.py | Updates InputError import. |
| dokimi/dokimi/commands/subjects.py | Updates InputError import. |
| dokimi/dokimi/commands/tasks.py | Updates InputError import. |
| dokimi/dokimi/commands/tasks_generate.py | Updates InputError import. |
| dokimi/dokimi/commands/tools.py | Moves JSON reader + InputError to dokimi.files. |
| dokimi/dokimi/context/consistency.py | Moves file/device helpers to dokimi.files. |
| dokimi/dokimi/context/session_log.py | Moves file/device helpers to dokimi.files. |
| dokimi/dokimi/context/trace.py | Moves file/device helpers to dokimi.files. |
| dokimi/dokimi/digest.py | Removes unrelated utilities and narrows the module to digest-related functionality. |
| dokimi/dokimi/digest_entries.py | Updates digest helper imports to dokimi.digest. |
| dokimi/dokimi/eval/answerer.py | Moves question_id import to dokimi.records. |
| dokimi/dokimi/eval/arm_runner.py | Moves question_id import to dokimi.records. |
| dokimi/dokimi/eval/arms_adapter.py | Moves evaluator-identity helper to dokimi.model_names. |
| dokimi/dokimi/eval/arms_refusals.py | Updates InputError import. |
| dokimi/dokimi/eval/arms_run.py | Splits imports across dokimi.files, dokimi.model_names, and dokimi.records. |
| dokimi/dokimi/eval/checklist.py | Moves question_id import to dokimi.records. |
| dokimi/dokimi/eval/cross_judge.py | Splits InputError vs digest helper imports across dokimi.files and dokimi.digest. |
| dokimi/dokimi/eval/judge_context.py | Splits InputError, digest helper, and question_id across dokimi.files/dokimi.digest/dokimi.records. |
| dokimi/dokimi/eval/question_text.py | Splits InputError and question_id imports into dokimi.files and dokimi.records. |
| dokimi/dokimi/eval/session.py | Moves question_id import to dokimi.records. |
| dokimi/dokimi/external/listing.py | Moves frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/external/online_checks.py | Updates InputError import. |
| dokimi/dokimi/external/trigger_set.py | Moves question_id import to dokimi.records. |
| dokimi/dokimi/external/upstream.py | Splits InputError and frontmatter parsing across dokimi.files and dokimi.frontmatter. |
| dokimi/dokimi/external/upstream_findings.py | Moves frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/external/validate.py | Moves YAML error description and strict frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/files.py | New module holding InputError, JSON readers, device refusal, symlink-loop predicate, and rmtree retry. |
| dokimi/dokimi/frontmatter.py | New module holding YAML frontmatter parsing helpers. |
| dokimi/dokimi/harnesses/benchflow.py | Moves frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/harnesses/command.py | Moves rmtree retry helper to dokimi.files. |
| dokimi/dokimi/harnesses/delivery.py | Moves JSON reader + InputError to dokimi.files. |
| dokimi/dokimi/harnesses/network_policy.py | Moves frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/harnesses/runner.py | Moves key_bytes import to dokimi.digest. |
| dokimi/dokimi/harnesses/skill_treatment.py | Moves frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/harnesses/verifier_reward.py | Moves rmtree retry helper to dokimi.files. |
| dokimi/dokimi/ingest/docling_loader.py | Updates InputError import. |
| dokimi/dokimi/judge_rule.py | Moves same_model import to dokimi.model_names and updates module references in docs/comments. |
| dokimi/dokimi/mcp/factory.py | Updates InputError import. |
| dokimi/dokimi/mcp/url_client.py | Moves key_bytes import to dokimi.digest. |
| dokimi/dokimi/model_names.py | New module holding model identity logic, independence warnings, and Bedrock model checks. |
| dokimi/dokimi/novelty/atom_labels.py | Updates InputError import. |
| dokimi/dokimi/novelty/atom_verdicts.py | Moves digest helper import to dokimi.digest. |
| dokimi/dokimi/novelty/atoms.py | Moves JSON reader + InputError to dokimi.files and updates docstrings. |
| dokimi/dokimi/novelty/artifact.py | Updates InputError import and docstring links. |
| dokimi/dokimi/novelty/client.py | Moves same_model import to dokimi.model_names and updates related comments. |
| dokimi/dokimi/novelty/cost.py | Moves InputError to dokimi.files and same_model to dokimi.model_names. |
| dokimi/dokimi/novelty/grounding.py | Updates InputError import. |
| dokimi/dokimi/novelty/judge2.py | Updates InputError import. |
| dokimi/dokimi/novelty/measure.py | Updates InputError import. |
| dokimi/dokimi/novelty/panel_grade.py | Updates InputError import. |
| dokimi/dokimi/novelty/probes.py | Updates InputError import. |
| dokimi/dokimi/novelty/retest.py | Updates InputError import. |
| dokimi/dokimi/novelty/routing.py | Splits InputError and frontmatter parsing imports across dokimi.files and dokimi.frontmatter. |
| dokimi/dokimi/novelty/sweep.py | Updates InputError import. |
| dokimi/dokimi/novelty/symbols.py | Updates InputError import. |
| dokimi/dokimi/opportunities.py | Updates InputError import. |
| dokimi/dokimi/orchestrator/pipeline.py | Splits InputError/JSON/device handling vs key digest vs evaluator checks into files/digest/model_names; updates question_id import. |
| dokimi/dokimi/plugins.py | Moves digest helper import to dokimi.digest. |
| dokimi/dokimi/question*/artifact.py | Moves question_id to dokimi.records and JSON reader to dokimi.files; updates docstrings accordingly. |
| dokimi/dokimi/questions/normalizer.py | Moves question_id import to dokimi.records and updates docstring reference. |
| dokimi/dokimi/records.py | Adds/hosts question_id and switches file/JSON utilities to dokimi.files. |
| dokimi/dokimi/repo_config.py | Moves digest-related imports to dokimi.digest. |
| dokimi/dokimi/repo_glob.py | Moves symlink-loop helper to dokimi.files. |
| dokimi/dokimi/repo_links.py | Splits imports across dokimi.digest (_plain_path) and dokimi.files (is_symlink_loop). |
| dokimi/dokimi/report/model_compare.py | Moves JSON reader + InputError to dokimi.files and updates docstring reference. |
| dokimi/dokimi/repos/budget.py | Moves frontmatter parsing to dokimi.frontmatter. |
| dokimi/dokimi/repos/compare.py | Moves same_model import to dokimi.model_names. |
| dokimi/dokimi/repos/graph_tasks.py | Moves key_bytes import to dokimi.digest. |
| dokimi/dokimi/repos/reach.py | Splits key_bytes and retry_writable across dokimi.digest and dokimi.files; tightens docstring formatting. |
| dokimi/dokimi/repos/report.py | Moves same_model import to dokimi.model_names. |
| dokimi/dokimi/repos/skill_reach.py | Splits key_bytes and retry_writable across dokimi.digest and dokimi.files. |
| dokimi/dokimi/repos/source.py | Moves key_bytes import to dokimi.digest. |
| dokimi/dokimi/runs/rm.py | Updates InputError import. |
| dokimi/dokimi/runs/rundir.py | Updates InputError import. |
| dokimi/dokimi/runs/scan.py | Moves InputError/is_symlink_loop to dokimi.files and updates docstring reference. |
| dokimi/dokimi/runs/show.py | Updates InputError import. |
| dokimi/dokimi/subjects/scorecard.py | Moves key_bytes import to dokimi.digest and updates references in comments. |
| dokimi/dokimi/treatments/arms.py | Moves digest helper import to dokimi.digest. |
| dokimi/fuzz/targets.py | Updates fuzz target imports for frontmatter parsing. |
| dokimi/scripts/check_treatment_batch.py | Moves digest helper import to dokimi.digest. |
| dokimi/scripts/sync_skilltext_profile.py | Moves frontmatter parsing import to dokimi.frontmatter. |
| dokimi/tests/cli_refusal.py | Updates InputError import path. |
| dokimi/tests/test_687_low.py | Updates InputError import path. |
| dokimi/tests/test_agent_profiles.py | Moves digest helper import to dokimi.digest. |
| dokimi/tests/test_arm_runner.py | Moves digest helper import to dokimi.digest. |
| dokimi/tests/test_arm_runner_incremental.py | Updates InputError import path. |
| dokimi/tests/test_artifacts.py | Updates InputError import path. |
| dokimi/tests/test_atoms_partial_status.py | Updates InputError import path. |
| dokimi/tests/test_baseline_deep_nesting.py | Updates InputError import path. |
| dokimi/tests/test_bedrock_model_ids.py | Updates comment references to new module location. |
| dokimi/tests/test_bundled_skills.py | Moves parse_frontmatter import to dokimi.frontmatter. |
| dokimi/tests/test_cache_dir_label.py | Updates InputError import path. |
| dokimi/tests/test_catalog_command.py | Updates InputError import path. |
| dokimi/tests/test_catalog_ignore.py | Updates InputError import path. |
| dokimi/tests/test_catalog_jsonl.py | Updates InputError import path. |
| dokimi/tests/test_catalog_listing_budget.py | Updates InputError import path. |
| dokimi/tests/test_catalog_no_frontmatter.py | Updates InputError import path. |
| dokimi/tests/test_catalog_novelty.py | Updates InputError import and adjusts monkeypatch target from utils to digest. |
| dokimi/tests/test_catalog_online.py | Updates InputError import path. |
| dokimi/tests/test_catalog_online_edges.py | Updates InputError import path. |
| dokimi/tests/test_catalog_provenance.py | Updates InputError import path. |
| dokimi/tests/test_catalog_repair_receipt.py | Updates InputError import path. |
| dokimi/tests/test_catalog_routing_compare.py | Updates InputError import path. |
| dokimi/tests/test_catalog_scan_unlistable.py | Moves tree_digest import to dokimi.digest. |
| dokimi/tests/test_catalog_upstream_findings.py | Updates InputError import path. |
| dokimi/tests/test_catalog_validate.py | Moves frontmatter parsing imports to dokimi.frontmatter. |
| dokimi/tests/test_cli_m3_moves.py | Updates InputError import path. |
| dokimi/tests/test_cli_output.py | Updates InputError import path. |
| dokimi/tests/test_context_consistency.py | Updates InputError import path. |
| dokimi/tests/test_context_prefilter.py | Updates InputError import path. |
| dokimi/tests/test_context_prefilter_corpus.py | Updates InputError import path. |
| dokimi/tests/test_context_trace.py | Updates InputError import path. |
| dokimi/tests/test_doc_caches.py | Updates InputError import path. |
| dokimi/tests/test_doc_source_unlistable.py | Updates InputError import path. |
| dokimi/tests/test_docker_null_check.py | Updates InputError import path. |
| dokimi/tests/test_eval_coverage.py | Updates InputError import path. |
| dokimi/tests/test_eval_tasks_generate_history.py | Updates InputError import path. |
| dokimi/tests/test_evaluate_cli_inputs.py | Updates InputError import path. |
| dokimi/tests/test_explore_track.py | Updates InputError import path. |
| dokimi/tests/test_fuzz_targets.py | Moves fuzz test frontmatter imports to dokimi.frontmatter. |
| dokimi/tests/test_git_paths_windows_decode.py | Updates digest module import + avoids shadowing digest name in a test. |
| dokimi/tests/test_headroom_command.py | Updates InputError import path. |
| dokimi/tests/test_import_architecture.py | Replaces dokimi.utils with the new foundation modules in the architecture allowlist and messages. |
| dokimi/tests/test_input_devices.py | Moves InputError/read_json_input/refuse_device imports to dokimi.files. |
| dokimi/tests/test_input_refusal_exit_sites.py | Updates error guidance strings to reference dokimi.files. |
| dokimi/tests/test_judge_context_mode.py | Splits InputError and digest imports across dokimi.files and dokimi.digest. |
| dokimi/tests/test_judge_provider_default.py | Updates InputError import path. |
| dokimi/tests/test_judge_reliability.py | Moves digest helper import to dokimi.digest. |
| dokimi/tests/test_judge_temperature_entry_points.py | Updates InputError import path. |
| dokimi/tests/test_judge_validity.py | Moves digest helper import to dokimi.digest. |
| dokimi/tests/test_key_files.py | Updates InputError import path. |
| dokimi/tests/test_knowledge_run.py | Updates InputError import path. |
| dokimi/tests/test_leak_command.py | Updates InputError import path. |
| dokimi/tests/test_llm_callers.py | Splits InputError and check_bedrock_model imports across dokimi.files and dokimi.model_names. |
| dokimi/tests/test_llm_cli.py | Updates InputError import path. |
| dokimi/tests/test_llm_cli_identity.py | Moves same_model import to dokimi.model_names. |
| dokimi/tests/test_load_or_fail.py | Moves JSON reader import to dokimi.files. |
| dokimi/tests/test_lone_surrogate_cache_keys.py | Moves key_bytes import to dokimi.digest. |
| dokimi/tests/test_missing_doc_source_refused.py | Updates InputError import path. |
| dokimi/tests/test_mcp_factory.py | Updates InputError import path. |
| dokimi/tests/test_model_compare.py | Updates InputError import path. |
| dokimi/tests/test_model_compare_exit_codes.py | Updates InputError import path. |
| dokimi/tests/test_model_compare_overflow.py | Updates InputError import path. |
| dokimi/tests/test_novelty_* | Bulk updates to import InputError from dokimi.files and model identity utilities from dokimi.model_names. |
| dokimi/tests/test_opportunities.py | Updates InputError import path. |
| dokimi/tests/test_opportunities_command.py | Updates InputError import path. |
| dokimi/tests/test_question_ids.py | Moves question_id import to dokimi.records and updates module reference in the docstring. |
| dokimi/tests/test_questions_artifact.py | Updates InputError import path. |
| dokimi/tests/test_questions_generate_inputs.py | Updates InputError import path. |
| dokimi/tests/test_record_readers.py | Updates InputError import path. |
| dokimi/tests/test_records_readers.py | Splits InputError and digest helper imports across dokimi.files and dokimi.digest. |
| dokimi/tests/test_repo_choices.py | Updates InputError import path. |
| dokimi/tests/test_repo_config_git_blobs.py | Moves digest-related monkeypatch targets/imports from utils to digest. |
| dokimi/tests/test_repo_config_links.py | Moves digest helper monkeypatch targets/imports from utils to digest. |
| dokimi/tests/test_repo_config_links.py | Updates digest monkeypatch references to dokimi.digest. |
| dokimi/tests/test_repo_hits_judge_failures.py | Updates InputError import path. |
| dokimi/tests/test_repo_run.py | Moves same_model import to dokimi.model_names. |
| dokimi/tests/test_repo_scan_* | Updates InputError import path. |
| dokimi/tests/test_repo_security.py | Updates InputError import path. |
| dokimi/tests/test_repo_skill_arms.py | Updates InputError import path. |
| dokimi/tests/test_repo_source_exit_2.py | Updates InputError import path in inline imports. |
| dokimi/tests/test_repo_suite.py | Updates InputError import path. |
| dokimi/tests/test_replicates.py | Updates InputError import path. |
| dokimi/tests/test_runs_rundir.py | Updates InputError import path. |
| dokimi/tests/test_runs_rundir_claims.py | Updates InputError import path. |
| dokimi/tests/test_runs_scan.py | Updates InputError import path. |
| dokimi/tests/test_saved_self_judge_warning.py | Moves warning helper monkeypatch/imports to dokimi.model_names and updates expected module names. |
| dokimi/tests/test_same_model.py | Moves model helpers import to dokimi.model_names. |
| dokimi/tests/test_scan_gate.py | Updates InputError import path. |
| dokimi/tests/test_seed_unsupported_route.py | Updates InputError import path. |
| dokimi/tests/test_similar_skills.py | Updates InputError import path. |
| dokimi/tests/test_skill_coverage.py | Updates InputError import path. |
| dokimi/tests/test_skill_selection.py | Updates InputError import path and moves JSON reader import to dokimi.files. |
| dokimi/tests/test_skill_sensitivity.py | Updates InputError import path. |
| dokimi/tests/test_subjects.py | Updates InputError import path. |
| dokimi/tests/test_subjects_long_name.py | Updates InputError import path. |
| dokimi/tests/test_swebench_tasks.py | Updates InputError import path. |
| dokimi/tests/test_sync_skilltext_profile.py | Moves frontmatter parsing inline imports to dokimi.frontmatter. |
| dokimi/tests/test_task_format_detect.py | Updates InputError import path. |
| dokimi/tests/test_tasks_command.py | Updates InputError import path. |
| dokimi/tests/test_tool_preference.py | Updates InputError import path. |
| dokimi/tests/test_treatments.py | Moves parse_frontmatter import to dokimi.frontmatter. |
| dokimi/tests/test_tree_digest.py | Moves digest-related imports to dokimi.digest and updates module docstring. |
| dokimi/tests/test_trigger_probe.py | Updates inline imports of InputError to dokimi.files. |
| dokimi/tests/test_trigger_set_readers.py | Updates InputError import path. |
| dokimi/tests/test_unlistable_readers.py | Updates InputError import path. |
| dokimi/tests/test_unlistable_sites.py | Updates InputError import path. |
| dokimi/tests/test_windows_symlink_loop.py | Moves is_symlink_loop import to dokimi.files. |
| dokimi/tests/test_write_probe.py | Updates InputError import path. |
Review effort: Lite
…t, model_names Pure move, no logic edits. The 800-line utils module is split by concern: - dokimi.frontmatter: markdown frontmatter parsing - dokimi.files: InputError, device refusal, JSON input reads, symlink-loop and rmtree-retry helpers - dokimi.digest: text, file and git-aware tree digests - dokimi.model_names: model identity, same-model/evaluator checks and the judge-independence warnings - dokimi.records: question_id moves here beside the record helpers Importers in the package, scripts, fuzz targets and tests point at the new homes directly. dokimi.utils has no shim: it is not public API. The layer map in tests/test_import_architecture.py lists the new foundation modules. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRR_kwDOVBg7g88AAAABbZXBzQ Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟡 Changes needed · re-checked 87a5a43
To fix: without a dokimi.utils shim, open PRs still break on a clean merge (reply in its thread).
✅ make ci-local --offline: 33,315 passed · ✅ the 45 definitions of utils.py are AST-identical in the new modules · ✅ merges cleanly into current main; test_arm_runner, test_skill_sensitivity, test_mcp_factory pass on the merge (207 passed) · ❌ #1529, #1523, #1407, #1328 merge cleanly and still import dokimi.utils
The callers that reached main are all moved, including the three @vchamarthi found.
The @vchamarthi mutation notes on files.py:35, :39, :63 are about code moved here unchanged, so a test for them belongs to a separate change.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> # Conflicts: # dokimi/docs/architecture.md # dokimi/dokimi/commands/answer_formats.py # dokimi/dokimi/commands/catalog.py # dokimi/dokimi/commands/skill_coverage.py # dokimi/dokimi/harnesses/delivery.py # dokimi/tests/test_judge_temperature_entry_points.py
Thread: PRRT_kwDOVBg7g8673s4g Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> Review: PRR_kwDOVBg7g88AAAABbpu8FQ
|
Re: review by vlad-perevezentsev
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> (cherry picked from commit e249323eb321bbc70ac425c03170071d835a143c)
antonwolfy
left a comment
There was a problem hiding this comment.
The split is clean and the restored dokimi.utils shim answers the open-PR concern for public names. One risk on the private names it leaves out.
What I ran, on a Linux review host at 7989222:
make ci-local: 42 passed, 1 failed, 16 skipped. 33,948 tests passed, coverage 97%. The one failure istest_cli_fault_contract.py::test_a_bad_path_is_refused_as_the_quickstart_says[agent run](dokimi agent run: error: argument --agent: expected AGENT=MODEL). It fails the same way on the PR's base, and the PR does not touch that test or the agent-run parser.- A check of the shim against the defining modules, offline: the public names are identical objects; the private helpers below are missing.
Checked, no issues
- DCO: all six non-merge commits carry
Signed-off-by. - Fuzz path filter:
fuzz.ymllists the five new modules; changelog fragment andarchitecture.mdmatch the shim. - Shim identity test:
test_legacy_utils_exports_still_resolvepins every public export to its defining module, andtest_package_uses_the_new_moduleskeeps the package offdokimi.utils.
Thread: PRRT_kwDOVBg7g86-2GJX Thread: PRR_kwDOVBg7g88AAAABbx-mpw Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟢 LGTM · re-checked 31d997e · nothing required from @napetrov beyond the rebase below
🔀 Merge: after a rebase · conflicts with current main in commands/evaluate.py, novelty.py, repo.py, repo_run.py, repo_scan.py; six package files main added since (commands/_shared.py, gate/_numbers.py, runs/bundle.py, ...) import dokimi.utils, which test_package_uses_the_new_modules refuses · after it, 21 open PRs need a rebase, mostly import lines (#1565, #1576, #1575 and 18 more)
✅ make ci-local --offline: 33,985 passed · test_cli_fault_contract[eval score ragas] fails the same on the base (the ragas extra is installed here) · ✅ dokimi.utils exports are the defining modules' objects · ✅ the guard test fails on main's gate/_numbers.py
The earlier points are fixed; the shim keeps open PRs working and the guard keeps the package off it.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> # Conflicts: # dokimi/dokimi/report/model_compare.py
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> # Conflicts: # dokimi/dokimi/runs/baseline.py
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
* fix(runs): import InputError from dokimi.files in runs/resolve upstream/main fails test_package_uses_the_new_modules: dokimi.runs.resolve imports InputError through the legacy dokimi.utils re-export. #1190 split utils into its defining modules and added the test; #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 #1190, #1523 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com> * test(runs): import InputError from dokimi.files in test_runs_resolve #1523 added the legacy dokimi.utils import in the test too. #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 #1190, #1523 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com> --------- Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Summary
Splits the 800-line
dokimi/utils.pyby concern.dokimi.utilsre-exports the moved names for existing callers. The package, scripts, fuzz targets and tests use the defining modules directly.dokimi.frontmatterparse_frontmatter,parse_frontmatter_strict,describe_yaml_error)dokimi.filesInputError,read_json_input,read_json_input_bytes,refuse_device, symlink-loop and rmtree-retry helpersdokimi.digesttree_digest,GitDigestTree,key_bytes, ...)dokimi.model_namesdokimi.recordsquestion_idGitTreeisGitDigestTreehere, as renamed in #1239. The evaluation pipeline uses direct name imports. Its two section comments were removed to stay under the 800-line source cap (check_growth.py).Evidence
utils.pyis verbatim in its new module (GitTreerenamed); the only other node is theTYPE_CHECKINGimport block.ruff check .clean.tests/test_import_architecture.py54 passed. Fullpytest tests: 31039 passed, 49 skipped, 4 failed; the 4 (three signal/container tests under shared-box load, and a.pycI had left in a fixture dir) all pass on rerun (87 passed).ci-local --offline --jobs static,typecheck: 17 passed, 0 failed.Merge danger
dokimi.utilsimports keep working.tests/test_import_architecture.pychecks the re-exports and keeps package imports on the defining modules..github/workflows/fuzz.ymlpath filter now listsfrontmatter.py,files.py,records.py,digest.pyandmodel_names.py.yaml_unique.py(imported byfrontmatter.py) is not in the fuzz path filter.🤖 Generated with Claude Code