Skip to content

P1: fail-closed spectrum cache (source-blind + verify exit code)#1

Draft
lfu46 wants to merge 2 commits into
mainfrom
p1-cache-safety
Draft

P1: fail-closed spectrum cache (source-blind + verify exit code)#1
lfu46 wants to merge 2 commits into
mainfrom
p1-cache-safety

Conversation

@lfu46

@lfu46 lfu46 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Fixes the cache-safety hole surfaced in the skill-review round. is_stale() and the info CLI are source-blind by default — they refuse to stat a /Volumes source unless --check-source/allow_network, so a wedged SMB share can't hang the process (it froze two procs on 2026-07-09). verify_cache refuses a network source without an explicit local --source, and the CLI now exits nonzero on mismatch. The lossless=True meta flag -> peak_dtype=float32, bit_exact=False with corrected docstrings (float32 is near-lossless, not bit-exact). Adds test_source_blind_safety. Only spectrum_cache.py + its test; other working-tree changes are unrelated WIP.

lfu46 and others added 2 commits July 5, 2026 20:23
Move the spectrum cache into mzml_utils.spectrum_cache and export open_spectra / SpectrumCache / build_cache / verify_cache / cache_path_for at the package top level. open_spectra(path) returns a local SpectrumCache when a co-located spectra_cache/ exists, else MzMLReader (identical Spectrum API), so it is a drop-in single reader. Add SpectrumCache.find_best_ms1 for full MzMLReader parity. Unit test in tests/test_spectrum_cache.py (21 checks).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fusal + exit code)

is_stale()/the info CLI are source-blind by default -- they refuse a /Volumes source unless --check-source/allow_network, so a wedged SMB share can no longer hang the process in uninterruptible I/O. verify_cache refuses a network source without an explicit local --source and the CLI now exits nonzero on mismatch. lossless=True meta -> peak_dtype=float32,bit_exact=False + corrected docstrings (float32 near-lossless, not bit-exact). Added test_source_blind_safety. Commits only these 2 files; other working-tree changes are unrelated WIP.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant