Skip to content

Pass the recording's subject and task, and re-pin staging - #356

Merged
neuromechanist merged 4 commits into
stagingfrom
feature/osa-dataset-facts
Sep 24, 2026
Merged

neuromechanist merged 4 commits into
stagingfrom
feature/osa-dataset-facts

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The website half of OpenScience-Collective/osa#477 (osa PR #478): a dataset page with a Zarr copy now tells the widget the subject and task of the first recording in its Zarr index, so the widget's dataset questions can name a real recording ("Plot 10 seconds of sub-001's MMN recording from nm000132").

Changes

  • osaDatasetFacts(index) in src/lib/osa-dataset.ts: the BIDS sub- and task- entities of the first store's file name. The facts come from the index, not the dataset's metadata, so they always name a recording with a Zarr copy. An entity the name does not carry, or one that is not a plain label, is left out rather than guessed.
  • announceOsaDataset accepts subject and task (^[A-Za-z0-9]{1,64}$, no prefix), the same rule as the widget's setDataset; an invalid one is dropped alone with a warning, as the widget does.
  • src/pages/dataset/[id].astro adds them to the announcement once the index shows a Zarr copy.

The widget pinned on staging today (osa 1a79aa8) ignores the two fields, so this is safe to merge first; they take effect when staging is re-pinned to the build with #478.

Testing

  • bun run test: 2414 pass. bun run lint, bun run typecheck: clean.
  • osa-dataset.test.ts: forwarding, refusal of prefixed, spaced, empty and non-string labels, and the facts from the real on008083 and v3 sample indexes; 7 single-line mutations of the new code each fail it.
  • After the re-pin: the questions on /dataset/xx099904 on test.nemar.org name its first recording.

With a Zarr copy, the dataset page now announces the first recording in
its Zarr index by subject and task (OSA #477), which fill the widget's
questions about the dataset. An entity the file name does not carry, or
one that is not a plain label, is left out; the pinned widget ignores
both fields until it is re-pinned to a build that reads them.

Tested: bun run test (2414 pass), lint, typecheck; 7 single-line
mutations of the new code each fail osa-dataset.test.ts.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: f88a89a
Status: ✅  Deploy successful!
Preview URL: https://130d74c8.nemar-website.pages.dev
Branch Preview URL: https://feature-osa-dataset-facts.nemar-website.pages.dev

View logs

Review of #356, matching osa #478: a subject or task that is not a
plain label is dropped with a warning and the rest is announced, since
refusing the whole value would leave the notebook button waiting on
zarr. A bad id or zarr still refuses it. Long comment lines rewrapped.

Tested: bun run test (2415 pass), lint, typecheck; removing the drop, or
skipping the cleaning step, fails osa-dataset.test.ts.
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review response

One Sonnet review, no correctness findings. It checked that the website's label rule and the widget's agree exactly, and that osaDatasetFacts parses real file names: nm000132 (v3), on007663 (MEG, with a split- entity) and on007353 (EEG and MEG, with sessions). Directory recordings and derived stores keep ordinary BIDS names. The index is sorted by path, so its first store is the first viewable recording in the tree. Nothing between the index resolving and the announcement can throw.

  • Long comment lines in osa-dataset.ts and the page's announcement call: rewrapped under the configured 100 columns.
  • Consistency with the widget, from the review of osa Drive the mirror chip from the API's mirror flag #478: the widget now drops an invalid subject or task alone rather than refusing the call, and announceOsaDataset does the same. Refusing the whole value would leave the notebook button waiting on zarr. A bad id or zarr still refuses it, as before. Tests cover both.

Moves test.nemar.org's widget to osa 7092864 (osa PR #478), which reads
the subject and task this branch passes, and records it in ADR 0018.

Tested: SRI hash computed from the commit's file and matched against
jsDelivr's bytes.
@neuromechanist neuromechanist changed the title Pass the first recording's subject and task to the widget Pass the recording's subject and task, and re-pin staging Sep 24, 2026
@neuromechanist

Copy link
Copy Markdown
Contributor Author

osa PR #478 is merged (7092864), so this PR now also moves staging's widget pin to it, with its SRI hash computed from the commit's file and matched against jsDelivr's bytes, and adds an ADR 0018 update. The facts and the widget that reads them land together.

@neuromechanist
neuromechanist merged commit e1219b3 into staging Sep 24, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feature/osa-dataset-facts branch September 24, 2026 16:16
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