Skip to content

feat: Support BEP044 stimulus organization in /stimuli - #445

Draft
neuromechanist wants to merge 5 commits into
bids-standard:mainfrom
neuromechanist:bep044-stimuli
Draft

feat: Support BEP044 stimulus organization in /stimuli#445
neuromechanist wants to merge 5 commits into
bids-standard:mainfrom
neuromechanist:bep044-stimuli

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Companion to bids-standard/bids-specification#2022 (BEP044, Stim-BIDS). Draft until the BEP settles.

  • Stop ignoring /stimuli; legacy free-form stimuli directories stay exempt (rules only apply when a stimuli.tsv catalog exists anywhere under /stimuli)
  • Allow subdirectories of schema directories marked opaque: false
  • Make UNUSED_STIMULUS recognize catalog-tracked stimuli
  • Guard evalInitialColumns against unknown column keys (previously an uncaught TypeError silently skipped all rule evaluation for the file)

Tested with deno test -A src plus end-to-end validation of a new BEP044 example, legacy eeg_matchingpennies, and synthetic good/bad datasets against the BEP044 schema.

The stimuli directory was unconditionally skipped, so no schema rules
for BEP044 stimulus files could run. Eventually this should key on the
schema directories rule (opaque flag) or stimuli.tsv presence rather
than being unconditional.
- Allow subdirectories of directories marked opaque: false in the schema
  (e.g. /stimuli) instead of flagging them NOT_INCLUDED.
- Only enforce stimulus naming rules in catalog mode (stimuli.tsv present
  at the /stimuli root); legacy free-form stimuli directories stay valid.
- Make unusedStimulus catalog-aware: stim-* and catalog files are tracked
  through stimuli.tsv rather than stim_file path references.
- Guard evalInitialColumns against unknown column keys, which silently
  aborted all rule evaluation for a file via an uncaught TypeError.

Tested against beh_stimuli (new example), eeg_matchingpennies (legacy),
and synthetic good/bad datasets; filenameIdentify '2 matches' test failure
is pre-existing on main.
A stimuli.tsv anywhere under /stimuli (not only at the root) now
switches the directory from legacy free-form handling to BEP044 rule
enforcement, so self-describing stimulus packs without a root catalog
are validated. Shared hasStimuliCatalog helper used by both the
NOT_INCLUDED gate and unusedStimulus.
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.62%. Comparing base (4b83dc9) to head (786c543).

Files with missing lines Patch % Lines
src/validators/filenameIdentify.ts 10.00% 7 Missing and 2 partials ⚠️
src/schema/tables.ts 0.00% 0 Missing and 1 partial ⚠️
src/validators/internal/unusedFile.ts 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
- Coverage   87.73%   87.62%   -0.11%     
==========================================
  Files          65       66       +1     
  Lines        4843     4865      +22     
  Branches      789      798       +9     
==========================================
+ Hits         4249     4263      +14     
- Misses        502      507       +5     
- Partials       92       95       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The BEP044 stimulus rules apply inside /stimuli, so the default-ignores
contract changes: top-level /stimuli content is now visible to the
validator (legacy free-form directories are exempted in hasMatch).
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