Repository navigation
Phase 2: backfill OpenNeuro import metadata + lift on* reindex block (#512) - #516
Merged
neuromechanist merged 3 commits intoMay 16, 2026
Conversation
Three coordinated changes so freshly imported on* datasets get the same right-rail / catalog data as nm* datasets: - runDatasetSync no longer throws hard for on*; it skips only the nemar.org push (which still needs alternate_id mapping) and keeps writing D1 metadata columns + sync status. Surfaced via new result.nemar_sync_skipped flag and a 'skipped' status in the admin reindex response. - buildReindexFilterQuery includes on* in 'all', 'missing-metadata', and 'stale' filters. Sandbox (xx*) stays excluded. - import-openneuro CLI seedMetadata expands the .nemar/metadata.json payload: bids_version, recording_modality + datatypes from a sub-*/datatype/ filesystem scan, funding_references from Funding, acknowledgements when present. After publication-approve the orchestrator now calls reindexDataset() so D1 metadata columns + LLM enrichment populate for the new dataset. Existing on* datasets backfill via 'nemar admin reindex --all' once deployed.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR516Version: 🤖 Updated on each push. |
neuromechanist
merged commit May 16, 2026
443d287
into
feature/issue-514-epic-website-followups
1 check passed
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.
Closes #512. Phase 2 of epic #514.
Summary
Three coordinated changes so on* datasets get the same right-rail / catalog data as nm* datasets:
dataset-reindex.ts) —runDatasetSyncno longer throws for on*; it skips only the nemar.org push (which still needsalternate_idmapping) and keeps refreshing D1 metadata columns + sync status. The result now carriesnemar_sync_skipped: trueand the admin/reindexroute maps that tosync.status = "skipped"instead of"failed".buildReindexFilterQuery) — on* prefix removed from the exclusion list.--all,--missing-metadata, and--stalefilters now sweep up OpenNeuro datasets. Sandbox xx* still excluded.import-openneuro.ts) —seedMetadata()writes a richer.nemar/metadata.json:bids_versionfrom BIDSVersion,recording_modality+datatypesfrom asub-*/datatype/filesystem scan (mirrors the backend'sdetectModalitiesFromTree),funding_referencesfrom Funding array,acknowledgementswhen present. After publication-approve the orchestrator now callsreindexDataset()so D1 metadata columns + LLM enrichment populate for the new dataset (non-fatal — the operator gets a clear retry hint if it fails).Why the import path was the bug
Tracing the actual flow:
runDatasetSyncwould normally populate columns, but it was throwing400 "OpenNeuro datasets require alternate_id mapping..."for any on* dataset — blocking the metadata-columns block too, not just the nemar.org push.participants.tsvand the tree.Test plan
bun test test/import-openneuro.test.ts test/dataset-reindex.test.ts→ 44 pass / 0 failtsc --noEmitpassestsc --noEmitpassesnemar admin reindex on005262returnssync.status = "skipped"(not "failed") andmetadata_columns_written: truecurl https://api.nemar.org/datasets/on005262 | jq '.dataset.modalities, .dataset.subject_count, .dataset.tasks'returns non-nullnemar admin reindex --allincludes on* datasets in the sweepnemar admin import-openneuroend with the reindex spinner showing "Refreshed enrichment + metadata columns"Backfill plan
Once this lands and deploys, run
nemar admin reindex --all(or--missing-metadata) to backfill the existing 30+ on* datasets. The bulk endpoint processes sequentially to respect rate limits.Notes
seedMetadata()now emits optional fields ONLY when there's content for them. Empty arrays are suppressed so downstream diffs make it obvious which fields came from seeding vs LLM enrichment.IsIdenticalTorelation is preserved (was already correct for a 1:1 mirror; the issue text suggestedIsDerivedFrombutIsIdenticalTois the right DataCite vocabulary for a mirror with no transformation).nemar_sync_skippedis plumbed through both/admin/datasets/:id/syncand/admin/datasets/:id/reindexresponses so the CLI can render the skip clearly.This is Phase 2 of 4. Next: Phase 3 (#511, QA sync +
/qa/*route).