Skip to content

QA artifacts sync from hallu + data.nemar.org/<id>/qa/* route #511

Closed

Description

@neuromechanist

Goal

Move the data-quality artifacts that live on hallu (/data/qumulo/openneuro/processed/<id>/) into S3 and expose them via the same data.nemar.org Worker that serves dataset bytes. The new web frontend (nemarOrg/website#4) needs them.

Sibling to: nemarOrg/website#4 (Phase 3 of the redesign epic, nemarOrg/website#1).

What's on hallu today

For each of the 269 processed datasets at /data/qumulo/openneuro/processed/<id>/:

<id>/
  dataqual.json                                 aggregate stats for the dataset
  <id>_histogram.png / .svg                     dataset-level distribution figure
  code/                                         MATLAB pipeline scripts (skip)
  logs/                                         per-step logs + status csvs (skip)
  sub-XXX/
    eeg/
      sub-XXX_task-Y_eeg_dataqual.json          per-file QA summary
      sub-XXX_task-Y_eeg_eegplot_mid-sample.svg
      sub-XXX_task-Y_eeg_icaact.svg
      sub-XXX_task-Y_eeg_icahist.svg
      sub-XXX_task-Y_eeg_icamaps.svg
      sub-XXX_task-Y_eeg_spectopo.svg

There's also a citation_dashboard/ and badges/ at the root of processed/ — those are Phase 4 territory, NOT this issue.

Deliverables

1. scripts/hallu-qa-sync.sh

Companion to the existing hallu-sync.sh that syncs annexed dataset bytes. This one mirrors the QA tree to S3.

  • Source: /data/qumulo/openneuro/processed/<id>/
  • Target: s3://nemar/<id>/qa/
  • Mirror semantics, not transform: file paths stay the same as on hallu. dataqual.json → qa/dataqual.json, sub-001/eeg/foo_dataqual.json → qa/sub-001/eeg/foo_dataqual.json.
  • Skip code/, logs/, *.mat — those are pipeline internals.
  • Manifest: append-only log at /data/qumulo/openneuro/.nm-qa-sync-manifest.json (mirror the existing .nm-sync-manifest.json pattern) recording last-synced timestamp per dataset.
  • Cron: 15 * * * * (offset 15 minutes from the bytes-sync at 0 * * * *).
  • Manual run: ssh hallu /data/qumulo/openneuro/nemar-cli/scripts/hallu-qa-sync.sh --dataset ds002718 --verbose

2. New Worker route: GET data.nemar.org/<id>/qa/*path

Add to backend/src/routes/data.ts alongside the existing /<id>/<ver>/<path> route.

  • 302 to a presigned S3 URL for the requested path under s3://nemar/<id>/qa/
  • Same visibility gate as the rest of the data route: public datasets only, private/unknown 404 with no leak
  • Same content-negotiation pattern: Accept: application/json returns JSON; Accept: text/html returns a directory index (reuse renderIndexHtml)
  • Cache-Control public, max-age=300 (QA artifacts are stable per dataset version)

Notes:

  • The QA tree is NOT version-locked — it reflects whichever version the hallu pipeline most recently processed. That's OK for Phase 3; the website expects /<id>/qa/... not /<id>/<v>/qa/.... If we ever need per-version QA, add a qa/<v>/... sub-prefix later without breaking the contract.

3. Optional: HED summary endpoint

If enrichment_json.hed_summary in D1 isn't already exposed in data.nemar.org/<id>/metadata.json, surface it OR write a separate data.nemar.org/<id>/qa/hed-summary.json that the website's wordcloud renderer can consume directly.

Check existing data-router.ts first — metadata.json may already include this.

Acceptance

  • aws s3 ls s3://nemar/ds002718/qa/ shows the synced tree
  • curl https://data.nemar.org/ds002718/qa/dataqual.json → 302 → presigned S3 GET → original JSON content
  • curl -H 'Accept: text/html' https://data.nemar.org/ds002718/qa/ returns a directory listing
  • curl https://data.nemar.org/<private-id>/qa/anything → 404, no leak
  • Cron runs hourly, manifest updates, only diff-syncs (idempotent)
  • New sync logged to the existing structured logs

Out of scope

  • Generating NEW QA artifacts. This is a sync + serve issue, the pipeline that produces them stays where it is.
  • The website's chart + HED-wordcloud + per-file modal rendering — that's in nemarOrg/website#4.

Related

  • nemarOrg/website#1 (redesign epic) and nemarOrg/website#4 (Phase 3 website side — blocked on this issue)
  • nemarOrg/nemar-cli#449 (the data.nemar.org epic that introduced the routing pattern)
  • Existing scripts/hallu-sync.sh as the reference for the cron + manifest shape

Activity

  1. added
    feature
    on May 15, 2026
  2. neuromechanist commented on May 16, 2026

    @neuromechanist
    ContributorAuthor

    Shipped via PR #519 (epic→dev). Code is on dev and will flow to main in the next dev→main cycle.

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

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions