Skip to content

data.nemar.org metadata.json prioritizes stale row.description over LLM-enriched v2.description #535

Closed

Description

@neuromechanist

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

Both this and #530 were surfaced during the #523 work but are independent.

Activity

  1. added
    bug
    on May 18, 2026
  2. added a commit that references this issue on May 18, 2026
    d9c12a9
  3. added a commit that references this issue on May 18, 2026
    48ceec4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions