Raise helper coverage floor - #96
Conversation
tavateva
left a comment
There was a problem hiding this comment.
Review — Draft Promotion Criteria PASS ✅
362 additions across 15 files, closes #61. All 7 criteria hold.
-
CI & mergeability — all 3 required checks green (`coverage`, `server-image`, `test-coverage`); `mergeable: MERGEABLE`, `mergeStateStatus: CLEAN`. ✓
-
Issue Acceptance Criteria — issue #61 body is title-only ("Hit 100% Test Coverage on Helpers"), so the discriminator is the implicit goal: effectively-full helper coverage. Delivered:
- New tests covering every gap from the previously-uncovered set:
bounding_boxes(+26 lines —vol_slice/get_min/get_max, unsplittable BSP partition);files(+137 — TIFF error paths,np_convertpreset/zero-range/shifted branches,volume_from_intermediatessingle-file + chunk-dir + discrete,write_conv_volscaled + non-scaled paths with captured writer);mem(+5 —get_termed_memglobal identity);models(+21 — three generic-exception branches viamonkeypatchofmodel_validate/model_validate_jsonand a real bad-encoding file);parse(+8 —CV_FORMAT.getunknown-suffixValueError);shape(+53 —mergeretain/overwrite,bool,param_max,TFIter.__call__abstract return,IntIter/MemAddressIter/SliceIter,ContigMemItercontig_stride+ cached-value branch +IndexErrorfor break-fields-include-last);spline(+19 — z-axis initial tangent path);volume_cache(+63 —flush_local_cachedisabled path, docker localhost rewrite,get_resolution_ummip forwarding, uncached-eviction path inrequest_volume_for_slice, threeremove_volumevariants including shared+destroy_shared,get_slice_indices). # pragma: no coveron integration-only paths:mem.pyTermedNPArray/clear_queue/remove_termed/shutdown/start/connect/__enter__/__exit__/mem_monitor(IPC lifecycle);volume_cache.py:connect_shmand thedownload_volumeuse_sharedbranch (liveSharedNPManager);parse.py:170(unreachable). Each carries an inline justification comment.- Coverage config locked in
pyproject.toml:[tool.coverage.run] source=[\"ouroboros/helpers\"] branch=trueand[tool.coverage.report] fail_under=98 show_missing=true skip_covered=false exclude_also=[...]. - Workflow uses pyproject config:
python-coverage.ymldrops--source=ouroboros/helpersfromcoverage run(config-driven now). - Badge regenerated:
python/coverage.svgmoves from 91.30% → 99.30%. ✓
- New tests covering every gap from the previously-uncovered set:
-
PR Test Plan checkboxes — no checkbox section. N/A.
-
Tests run, not just present — Verification block reports concrete counts:
pytest: 168 passed, 2 warnings, 10.02s (up from the 151-passed baseline — 17 new tests all executed)coverage report --fail-under=98: 1434 statements, 0 missed, 282 branches, 12 partial, 99%- Badge regenerated at 99.30%
Voluntary test additions covered by the reported count. ✓
-
Scope — production-code touches are:
mem.py+9/-9 (pragma-only)parse.py+1/-1 (pragma-only)spline.py+2/-2 (real bug fix — see judgement calls)volume_cache.py+2/-2 (pragma-only)pyproject.toml+14 (coverage config).github/workflows/python-coverage.yml-1/+1 (drop redundant--source)coverage.svgregen
All within scope of "raise helper coverage floor" and each ≤~20 lines to a file already touched for the issue. ✓
-
Regressions & patterns — 168 passed matches the claimed pass count; existing 151 tests still pass; no pattern violations (pragmas follow standard
# pragma: no cover - <reason>form; fixture patterns match existing tests). ✓ -
Judgement calls — three, all reasoned inline in the PR body:
- 99.30% target vs. literal 100%: the pragma set (IPC lifecycle, live
SharedNPManager, one comment-flagged unreachable line) matches what a unit-only suite can honestly claim; PR Summary calls these out as "narrow integration-only paths" and "unreachable parsed image-source fallback." Reasonable. - Spline z-axis fix bundled with coverage work:
initial_normal = np.array([0, 1, 0])was integer-valued; the followinginitial_normal /= np.linalg.norm(...)did in-place division on an integer array — the bug surfaces precisely when trying to test the z-axis initial-tangent branch. Fix (change to[0.0, 1.0, 0.0]) is 2 lines and clearly explained in Summary. Legitimate scope-adjacent bug fix, well within the ≤~20 line allowance. - Known warnings out of scope:
SharedNPArray.__del__unraisableAttributeError(mem.py:76) and Pydantic v2.11model_fields-on-instance deprecation (models.py:117) are explicitly deferred. Both are pre-existing issues that predate this PR and are genuine bugs deserving their own tracking. Reasonable deferral.
✓
- 99.30% target vs. literal 100%: the pragma set (IPC lifecycle, live
All seven criteria hold. Approving. Safe to promote from draft.
One follow-up worth filing before merge: the two known warnings (SharedNPArray.__del__ and the Pydantic deprecation) as separate tracking issues — they're real bugs, and the pragmas on mem.py lifecycle mean neither is unit-covered.
Fixes #61.
Summary
# pragma: no cover: SharedMemoryManager IPC lifecycle, live shared-memory cache connections, and the unreachable parsed image-source fallback.ouroboros/helpersinpyproject.toml, setsfail_under = 98, updates the coverage workflow to use that config, and regeneratespython/coverage.svg.Verification
Known warnings remain unchanged and are out of scope for this issue:
SharedNPArray.__del__unraisableAttributeErrorwarning frommem.py:76.models.py:117.