Repository navigation
Release v0.8.21: enrichment description fix + ds*/on* catalog dedup - #537
Merged
Merged
Conversation
…nance to README The OpenNeuro importer used to set the D1 datasets.description column to 'Imported from OpenNeuro <ds>' at import time. buildDatasetMetadata then prioritized that catalog row over the LLM-enriched v2 description, so the placeholder survived every successful enrichment cycle and the public metadata.json endpoint kept returning it forever — defeating the whole point of the enrichment pipeline that v0.8.20 unblocked. Three coordinated changes: src/lib/import-openneuro.ts: drop the description: 'Imported from OpenNeuro <ds>' arg from importDataset(). Provenance is already encoded by source: 'openneuro', source_id, and the on* dataset_id prefix; the website renders the attribution badge from those fields. Add a new appendOpenNeuroProvenance helper that writes a deterministic '## Provenance' section to README.md at import time (idempotent; re-running the importer is a no-op once the marker is present). The README is the right place for human-readable provenance — it ships with the GitHub repo, is visible without hitting any API, and stays out of the LLM enrichment write path. backend/src/services/data-router.ts: flip buildDatasetMetadata's description-priority order so the LLM-enriched v2 (or v1) description wins over row.description, with row.description as the fallback for datasets that have not been enriched yet. The existing v2 fallback test stays; new tests pin the placeholder→enrichment substitution and the no-enrichment fallback. test/import-openneuro.test.ts: new describe block for appendOpenNeuroProvenance covering creation, append-to-existing, idempotency, and the no-trailing-newline edge case. The fix is forward-looking (new on* imports never get the placeholder) and backward-compatible (existing on* datasets in D1 still have the stale placeholder, but the metadata.json endpoint now correctly serves the enrichment when present).
The list endpoint's catalog UNION used a single NOT IN clause comparing nemar_catalog.id against datasets.dataset_id. That worked for the case where a catalog row was "promoted" into the managed table under the same id, but missed the ds -> on mirror case entirely: mirrored rows have dataset_id = 'on002718' while the catalog shadow keeps id = 'ds002718', so the NOT IN never matched. Add a second NOT IN that joins on datasets.source_id where source='openneuro'. Catalog rows whose id appears as a managed mirror's source_id are now hidden. Symptom (live before this change): GET /datasets?q=ds000117 returned on000117 plus three ds* shadows (ds000117, ds002718, ds003645) all of which had on counterparts in the catalog. After this change the list returns only the canonical on* rows. Adds a regression test asserting no on* row in /datasets has its ds* counterpart alongside it. Refs nemarOrg/website#1 (redesign epic discover-page dedup).
The pr-review-toolkit code-reviewer flagged that the readReadme() helper in test/import-openneuro.test.ts used a dynamic require() call instead of the ES module import already present at the top of the file. Add readFileSync to the existing destructure and use it directly. No behavior change; consistent with .rules/javascript.md (ES modules only).
Fix #535: stop seeding OpenNeuro placeholder; route provenance to README
2 tasks done
…#538) Same anti-pattern that commit f9c22b4 fixed in appendOpenNeuroProvenance's readReadme(). seedMetadata's readMeta() helper and the config.json read in the 'metadata.json appears, config.json survives' test both still used a dynamic require() instead of the readFileSync that's already destructured at the top of the file. Flagged by the pr-review-toolkit code-reviewer during the v0.8.21 release review; pre-existing on dev so non-blocking, but bundling here keeps the file consistent and satisfies the .rules/javascript.md 'ES modules only' rule.
neuromechanist
temporarily deployed
to
development
May 18, 2026 10:37 — with
GitHub Actions
Inactive
neuromechanist
enabled auto-merge
May 18, 2026 10:38
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.
Release bundling two follow-ups to v0.8.20 (the #523 enrichment 522 fix). Both surfaced during post-release verification.
Fixes
#535 — OpenNeuro placeholder description survives enrichment (PR #536)
After v0.8.20 unblocked the enrichment pipeline,
data.nemar.org/<id>/metadata.jsonstill returned"Imported from OpenNeuro <ds>"as the top-leveldescriptionfor on* datasets. Three coordinated changes:src/lib/import-openneuro.ts: stop seedingdatasets.descriptionwith the placeholder at import time. OpenNeuro provenance is already encoded bysource: "openneuro",source_id, and theon*dataset_id prefix.src/lib/import-openneuro.ts: newappendOpenNeuroProvenance()helper writes a deterministic## Provenancesection to README.md at import time (idempotent via an HTML-comment marker). Provenance now lives on the GitHub repo where it belongs, separate from the LLM enrichment write path.backend/src/services/data-router.ts: flipbuildDatasetMetadatadescription priority tov2 ?? v1 ?? row. Protects the ~50 existing on* datasets whose D1 row still carries the legacy placeholder.#534 — ds*/on* catalog shadows visible in /datasets listing
GET /datasetsUNIONed managed + catalog rows, but the dedup join comparedc.id NOT IN (SELECT dataset_id FROM datasets). Mirrored OpenNeuro datasets stored asdataset_id=on002718, source_id=ds002718in the managed table never matched their catalog shadowid=ds002718, so both appeared in every list.Symptom on prod:
GET /datasets?q=ds000117&limit=10returnedon000117, ds000117, ds002718, ds003645— all but the first are shadows whose on* counterparts exist.Resolution: catalog-half query now also filters out rows whose
idmatches anydatasets.source_id WHERE source = 'openneuro'. One-line behavioral change to the existing query.Release flow
auto-tag.ymlwill strip-dev1frompackage.jsonon merge to main, commit as nemar-bot, tagv0.8.21.npm-publish.ymlships to npm withlatest.sync-dev.ymladvances dev to0.8.22-dev0. No manual version bumps in this PR.Test plan
data.nemar.org/on000117/metadata.jsonreturns the LLM-extracted description instead of the placeholder (the user-visible payoff from data.nemar.org metadata.json prioritizes stale row.description over LLM-enriched v2.description #535)nemar dataset list --search ds000117does not return ds-prefix shadows for on-mirrored datasets (fix(datasets): hide ds* catalog shadows when on* mirror exists #534)datasets.description = NULLand the GitHub repo's README.md has the## ProvenancesectionFollow-ups still open