Repository navigation
[core] Fix correctness bugs, silent failures & misleading contracts (Fable 5 Phase 3) - #203
Conversation
Part of the Fable 5 Findings epic (#193); addresses issue #196. Replace silent fallbacks with real dispatch, make ignored options take effect or fail loudly, and fix index/boundary errors — each with a test that reproduces the bug first. - Loading: pop_loadset dispatches HDF5 vs scipy by the actual file instead of swallowing every error into an HDF5 retry; pop_fileio dispatches .mat by content instead of silently importing a broken .set as a raw array; pop_loadset_h5 drops the hard-coded emoji fixture and decodes by one rule. - Indexing/events: pop_select chantype selection no longer crashes (eeg_decodechan return unpacked) and the console zero-bases pop_select numeric channels so 1-based history replays correctly; eeg_eegrej no longer drops first/last events by latency; pop_editeventvals epoched latency display/edit is symmetric (ms<->points) and no longer raises. - sigproc: epoch() boundary check fixed (no negative-index slice); eegrej() shifts boundary latencies by base region spans; runamica() cleans its temp dir on failure without swallowing the error. - Session: console CURRENTSET reassignment guarded by a regression test; IMPLEMENTED_ACTIONS now has a test enforcing it matches dispatch routing; GUI dataset commit applies history only after the abort check; the headplot menu action commits its spline edit through the session. - CLI: pipeline gains the negative-edge filter guard the subcommand has; --quiet/--verbose/--no-progress are wired; the self-describing schema covers all required params and stops marking --output required under --overwrite; bids dispatches by format and propagates exit codes. - ASR/clean: clean_flatlines walrus precedence fixed; asr_calibrate raises on unsupported sample rates; clean_artifacts/clean_asr/asr_process no longer swallow failures and re-insert ignored channels per EEGLAB. - Other: newtimef _is_on uses correct whitelist semantics and its dead params fail loudly; compute_pac passes through title/vert/newfig; std_precomp recompute and std_makedesign delfiles take effect; EEGobj raises on unknown attributes; gen_derived_fpath honors ${root}; ICLabel validates icawinv before dereferencing it.
|
🤖 Specification (PR >500 LOC; full per-finding detail in #196, epic #193) Problem. 38 confirmed findings where the running program produced a wrong result, crashed, silently did the wrong thing, or silently ignored input: Approach. For silent fallbacks: dispatch on the real condition (file format / content) or narrow the except so genuine failures surface. For ignored options: implement the documented effect, or fail loudly when set to a non-default. For schema/contract mismatches: make the self-describing contract match behavior. For index bugs: make the MATLAB-1-based / Python-0-based boundary explicit and correct (the console converter now zero-bases Scope discipline. Work was split across 9 file-clusters with hard per-cluster allowlists; both reviewers confirmed zero out-of-allowlist source edits and no weakened/deleted tests. Three findings were correctly deferred as out-of-allowlist and are noted below. Tests. Full affected suite (28 source files + new/updated tests, incl. 3 new test modules): 645 passed, MATLAB-gated skips only, 0 failures; ruff and pre-commit clean. Deferred to follow-ups (out of this phase's allowlist; flagged in-code):
|
|
Claude finished @suraj-ranganath's task in 3m 36s —— View job Code Review — PR #203
Code review
I verified the changes that can't be judged from the diff alone against their surrounding context. The fixes are sound and each lands with a reproducing test:
BlockingNone. ImportantNone. Nits
Test gapsNone. Coverage is appropriately scoped: tuple-unpacking fixes ( EEGLAB parity notes
Checked for correctness bugs, EEGLAB parity, data-structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. |
Replace silent fallbacks with real dispatch, make validated-but-ignored options take effect or fail loudly, and fix index/boundary errors across loading, event/channel selection, sigproc, the GUI/console session, the CLI, and the ASR/clean pipeline. Each fix lands with a test that reproduces the bug first. Notable: pop_loadset/pop_fileio stop swallowing load errors, the console now zero-bases pop_select numeric channels so 1-based history replays correctly, epoch()/eegrej() boundary math is corrected, asr_calibrate/clean_artifacts/asr_process stop silently degrading, and CLI schema/exit-code contracts match behavior.
Fixes #196