P1: fail-closed spectrum cache (source-blind + verify exit code)#1
Draft
lfu46 wants to merge 2 commits into
Draft
P1: fail-closed spectrum cache (source-blind + verify exit code)#1lfu46 wants to merge 2 commits into
lfu46 wants to merge 2 commits into
Conversation
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>
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.
Fixes the cache-safety hole surfaced in the skill-review round.
is_stale()and theinfoCLI are source-blind by default — they refuse to stat a/Volumessource unless--check-source/allow_network, so a wedged SMB share can't hang the process (it froze two procs on 2026-07-09).verify_cacherefuses a network source without an explicit local--source, and the CLI now exits nonzero on mismatch. Thelossless=Truemeta flag ->peak_dtype=float32, bit_exact=Falsewith corrected docstrings (float32 is near-lossless, not bit-exact). Addstest_source_blind_safety. Onlyspectrum_cache.py+ its test; other working-tree changes are unrelated WIP.