Repository navigation
Description
Surfaced during v0.8.20 release verification for #523. After successful reindex against on000117, the enrichment_json column in D1 has `pipeline_stage: validated` with rich LLM-extracted description, but `https://data.nemar.org/on000117/metadata.json\` returns the generic `"Imported from OpenNeuro ds000117"` string at the root `description`.
Location
`backend/src/services/data-router.ts:805` inside `buildDatasetMetadata`:
```ts
const description = row.description ?? v2?.description ?? v1?.description ?? null;
```
The `??` chain gives priority to whichever value is non-null first. For on* datasets, the catalog `row.description` is set to a placeholder string at import time (e.g., `"Imported from OpenNeuro ds000117"`), which is non-null, so the LLM-extracted `v2.description` is never surfaced.
Verification
```
nemar admin reindex on000117 # produces enrich:ok cols:written
```
In D1 (verified):
```json
{
"pipeline_stage": "validated",
"title": "Multisubject, multimodal face processing",
"description": "A multimodal neuroimaging dataset comprising structural MRI, functional..."
}
```
But the public endpoint returns:
```
$ curl https://data.nemar.org/on000117/metadata.json | jq '.description'
"Imported from OpenNeuro ds000117"
```
Other LLM-extracted fields (keywords, related_identifiers, funding, authors, pipeline_stage under `extensions.nemar`) all surface correctly. Only the top-level `description` is wrong.
Suggested fix
The priority order should put the LLM enrichment first for on* datasets, or unconditionally:
```ts
const description = v2?.description ?? row.description ?? v1?.description ?? null;
```
If there's a real use case for user-curated row.description (a curator manually overriding the LLM), introduce an explicit field like `description_override` rather than reusing `row.description` for both placeholder and override.
Impact
This is the headline finding for OpenNeuro mirror datasets on NEMAR. The enrichment provides the actual value proposition (real description, methods, keywords) but the most-visible field on the public endpoint still shows the placeholder. 49 of 51 on* datasets are affected; on* placeholders all use the same template string.
Related
- Global enrichment failure: /admin/reindex returns HTTP 522 from Worker self-call #523 (P1, now closed by v0.8.20): unblocked the enrichment pipeline.
- ORCID-recovery regex in enrich-dataset.ts silently drops authors when corrupt metadata.json has nested affiliations #530: pre-existing ORCID-recovery regex bug.
Both this and #530 were surfaced during the #523 work but are independent.
Activity
Merge pull request #536 from nemarOrg/fix/issue-535-description-priority
Release v0.8.21: enrichment description fix + ds*/on* catalog dedup (#…