Repository navigation
fix(novelty): routing partial-file guard reads status "partial" alone - #764
Open
antonwolfy wants to merge 1 commit into
Open
antonwolfy wants to merge 1 commit into
antonwolfy wants to merge 1 commit into
Conversation
…intel#700) `_is_partial_file` in `novelty_routing_report.py` tested only the `partial` key, so a routing file holding `{"status": "partial"}` was taken for a finished result and a capped run wrote its partial result to a sidecar instead of replacing it. It now tests `"partial" in data or data.get("status") == "partial"`, the marker the atoms reader and `artifacts.py` use. `_refuse_partial` in `novelty/items.py` already refuses a probe file marked by status alone (landed with intel#633, pinned by `test_novelty_items_refuses_a_probe_file_marked_partial_by_status_alone`), so only the routing guard changes here. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #764 +/- ##
=======================================
Coverage 95.72% 95.72%
=======================================
Files 415 415
Lines 55363 55363
Branches 9516 9516
=======================================
Hits 52994 52994
Misses 1466 1466
Partials 903 903
🚀 New features to boost your workflow:
|
vchamarthi
approved these changes
Nov 14, 2026
vchamarthi
left a comment
Contributor
There was a problem hiding this comment.
Ready to merge at 740119e: _is_partial_file now also treats {"status": "partial"} as a partial file, matching the atoms reader and load_artifact; it does so, and nothing to fix was found.
Verified
- Status-only marker:
{"status": "partial"}is a partial file on the head and not on main; the new test passes on the head and fails on main. - Changed tests: All 51 tests in
tests/test_novelty_routing_spend_cap_partial.pypass on the head. - Test pins the clause: Dropping the
statusclause from_is_partial_filefails the new test. - Finished and odd files:
{"status": "ok"},[],nulland{}are not partial files on the head. - Merge with main: Merges onto main with no conflict and the whole local run passes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two result-file guards read a file marked only by
"status": "partial"as finished, where the same file with apartialblock is treated as partial (#700, the same cause #642/#702 fixed in the atoms reader).mainnovelty/items.py_refuse_partial{"status": "partial"}ProbeFileErrorsince #633 (items.py:271), pinned bytest_novelty_items_refuses_a_probe_file_marked_partial_by_status_alonecommands/novelty_routing_report.py_is_partial_file{"status": "partial"}False: a capped run saw a finished result and wrote its partial result torouting.partial.jsonTrue: the capped run replaces the fileload_artifactinartifacts.py:341already tests"partial" in data or data.get("status") == "partial", as does the atoms reader (atoms.py:786). The remaining reads ofpartialinnovelty_routing_report.py(:392,:477,:647) are on in-memory payloads the run built, not on files.Closes #700
Changes
_is_partial_fileindokimi/commands/novelty_routing_report.pytests"partial" in earlier or earlier.get("status") == "partial", the marker the atoms reader uses. Files with apartialblock, with neither marker, and non-dict JSON are handled as before.tests/test_novelty_routing_spend_cap_partial.py:_is_partial_fileis true for{"status": "partial"}, andsave_resultwrites a partial payload over it.Risk
A routing file holding only
{"status": "partial"}is now overwritten by a capped run instead of kept with the partial result going to a sidecar. Files written by dokimi carry both markers, so only a hand-edited or foreign file is affected.Testing
On Linux, at
740119e(onmain7137604):make ci-local: 33 passed, 0 failed, 14 skipped (steps needing micromamba, semgrep, other Python versions or a PR context). Not run: the matrix legs on other Pythons.main's code atassert _is_partial_file(marked)and passes here. The guard tests (test_docs_code_refs,test_growth_ratchet,test_audit_test_quality,test_import_architecture) pass.assert _is_partial_file(marked); droppingnot _is_partial_file(out)fromsave_resultfailsassert save_result(...) == marked.fix/cache-dir-unusableonmain7137604:pytest -n auto20449 passed, 19 skipped,mypyclean,ruff checkclean.Revert
A plain revert restores the old guard. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.md.github/.licenserc.yaml)