Repository navigation
Release: detail-endpoint parity + channel/montage classification - #864
Merged
Merged
Conversation
The DOI re-target, legacy-DB purge, and ds-row deletion have all run on prod (epic #837), so remove the guarded run-once scripts (retarget-dois, purge-legacy-datapipeline, delete-ds-rows + their tests) and the slim legacy-purge.ts delete client they used. Also drop the stale NEMAR_USERNAME/ PASSWORD entries from the wrangler-sccn.toml secrets doc (the worker no longer reads them; the legacy datapipeline sync was retired in Phase 3).
GET /datasets/:id did SELECT d.*, exposing the raw subject_count column but not the participants alias, and no latest_version (that is a computed subquery, not a table column). The list + search endpoints both return participants + latest_version, so search-card hydration that rehydrates via the detail endpoint lost the subject count. Add both alongside d.* (additive; raw columns untouched, so no contract regression). Closes #853.
Phase 1 of epic #854. Additive only: - migration 0054 adds n_channels (INTEGER) + electrode_system (TEXT) to datasets, with indexes for filterability. - expose both in the public list + ?mine list SELECTs. The detail endpoint already returns them via SELECT d.*. Values stay NULL until phase 2 (#858) computes them and phase 3 (#859) backfills; the website channel/montage filter reads NULL as "not classified yet". No existing column or alias changes, so no contract regression. Closes #857. Part of #854.
Phase 2 of epic #854. Populate the migration-0054 columns during enrichment: - channel-montage.ts (pure, unit-tested): parseChannelsTsv, parseEegChannelCount, resolveNChannels (measured channels.tsv EEG count wins over a disagreeing sidecar), classifyElectrodeSystem (egi-geodesic / biosemi / 10-20 / 10-10 / 10-05 / other), grounded in MNE-derived label sets (montage-label-sets.ts). - getBidsTreeStats samples an exemplar eeg channels.tsv + eeg.json from the subjects it already walks and runs the classifiers (best-effort: a probe failure leaves the columns NULL, never breaks the modality/subject walk). - writeDatasetMetadataColumns COALESCE-writes n_channels + electrode_system; the reindex caller threads them through. EEG-only for now; populated via the reindex/walk path (the LLM-enrich path omits them, COALESCE-safe). Backfill of existing rows is phase 3 (#859). Closes #858. Part of #854.
fix(api): detail endpoint returns participants + latest_version (#853)
Phase 1: channel/montage schema + projection (#857)
Phase 2: channel count + electrode-system compute (#858)
Phase 3 of epic #854. One-time backfill for the columns added in phase 1/2 across existing EEG datasets: - migration 0055 adds channel_montage_checked_at (resumability marker, mirrors archive_checked_at). - POST /admin/datasets/channel-montage-sweep?limit=N: candidates are repo-backed (nm*/on*), EEG, non-sandbox, unchecked rows. Runs the phase-2 getBidsTreeStats probe and writes n_channels + electrode_system DIRECTLY (no updated_at bump, so the backfill doesn't re-sort every EEG dataset to "newest"). Idempotent; bounded per call (<=30) under the Worker subrequest cap. - scripts/backfill-channel-montage.sh drives it until remaining=0. Real-SQLite test applies migrations 0054+0055 and pins the candidate scoping + the no-updated_at-bump write. Closes #859. Part of #854.
Phase 3: channel/montage backfill sweep (#859)
…montage Epic #854: catalog channel count + electrode-system classification
This was referenced Jul 2, 2026
neuromechanist
added a commit
that referenced
this pull request
Jul 6, 2026
…939) * Fix contract drift: getCurrentUser + version prefix Epic #896 Phase 4 (#899). Applies the #898 contract to the known drift. - getCurrentUser() unwraps the {user, token} envelope (.user) and validates against userMeResponseSchema. It previously declared flat UserInfo and read the envelope top level, so every field was undefined at runtime -- silently writing undefined over stored account config on 'auth status --refresh' and disabling the upload ORCID auto-match. Consumers coerce nullable username/ github_username -> undefined for config. - Catalog latest_version is emitted in the canonical vX.Y.Z tag form (withCanonicalLatestVersion) at the list/fallback/detail responses, matching the data plane + what hallu-sync's archives/<v>.zip URLs need. Fixes the website vv1.0.0 double-prefix (website PR nemarOrg/website#145 coerces too). - file_size (#895): the compute is already annex-aware (getDatasetS3Stats sums real S3 object sizes); the ~36B symptom is stale legacy folded rows -> fixed by an operational reindex backfill at finalize, no code change. - /datasets/:id parity (#864) is backend-complete (#853); website backfillSearchHit removal tracked separately. * Address #899 review: strict version test + cleanup - Live contract test now asserts the RAW catalog latest_version is the canonical tag via the non-coercing strictVersionTagSchema, so a dropped withCanonicalLatestVersion call site fails CI (the coercing envelope schema couldn't catch that). - Added a getCurrentUser() live-integration test that calls the function and asserts flat access (config dir is isolated by setup.ts). - Removed the now-dead UserInfo interface and a redundant cast at the detail return. - Cross-repo: nemarDatasets/.github#61 normalizes the Hallu zarr-queue version comparison so #899's tagged latest_version doesn't re-drain the queue.
This branch was previously deployed
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.
Promotes
dev→main(auto-tag strips the-devNsuffix and tags on merge; no manual bump).Headline changes
GET /datasets/:idnow returnsparticipants+latest_version(wasSELECT d.*, exposing rawsubject_countand no computed version). Restores subject counts on the website's search-result cards. Additive.n_channels,electrode_system) + list/detail projection (Phase 1: channel/montage schema + projection (#854) #857)egi-geodesic/biosemi/10-20/10-10/10-05/other),n_channelsfromEEGChannelCountcross-checked vs measuredchannels.tsv, via a best-effortgetBidsTreeStatsprobe (Phase 2: channel/montage enrichment compute (#854) #858)POST /admin/datasets/channel-montage-sweepone-time backfill (writes the two columns directly, noupdated_atbump) + driver script (Phase 3: channel/montage backfill of existing datasets (#854) #859)Also carries the previously-merged epic #837 legacy-separation cleanup (#850) already on
dev.Post-merge ops
nemar-db) on deploy.scripts/backfill-channel-montage.shagainstapi.nemar.orgto populate existing EEG rows (idempotent; going-forward datasets populate via the reindex walk).Verified on dev
nemar-api-dev: detail endpoint returnsparticipants; list projection carriesn_channels/electrode_system(null pre-backfill). CI green on the epic→dev PR (#863).