Repository navigation
Phase 3: QA artifact sync from hallu + data.nemar.org/<id>/qa/* route (#511) - #517
Merged
neuromechanist merged 2 commits intoMay 16, 2026
Conversation
Companion to hallu-sync.sh that mirrors /data/qumulo/openneuro/processed/<id>/ to s3://nemar/<id>/qa/ on an hourly cron (offset 15 min from the bytes sync). Skips pipeline internals (code/, logs/, *.mat) and uses a newest-mtime fingerprint to skip unchanged datasets idempotently. Worker route exposes the tree at data.nemar.org/<id>/qa/*: 302 to a presigned S3 GET for files (whose keys are already BIDS-shaped, so no Content-Disposition override is needed), directory listings with the same JSON / HTML content negotiation as the version route, and the visibility gate that suppresses any leak for private/unknown datasets. resolveQaPath uses ListObjectsV2 with delimiter=/ to distinguish files from directories in a single round-trip and rejects path traversal via the same normalizeBidsPath contract the manifest-backed route uses.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR517Version: 🤖 Updated on each push. |
neuromechanist
merged commit May 16, 2026
b04f342
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 #511. Phase 3 of epic #514.
Summary
Two pieces in one PR — sync producer + Worker consumer:
scripts/hallu-qa-sync.shMirrors
/data/qumulo/openneuro/processed/<id>/→s3://nemar/<id>/qa/for every nm*/on* dataset present on hallu.15 * * * *(offset 15 min from the bytes sync at0 * * * *so the two jobs don't compete for the same flock).code/,logs/,*.mat, dotfiles, backup files)./data/qumulo/openneuro/.nm-qa-sync-manifest.json. Datasets with unchanged trees skip theaws s3 synccall entirely../scripts/hallu-qa-sync.sh --dataset nm000132 --verbose.Worker route:
GET data.nemar.org/<id>/qa/*New route in
backend/src/routes/data.ts, registered BEFORE/:datasetId/:version/*so Hono doesn't matchqaas a version param.Content-Dispositionoverride is needed; that fix in data.nemar.org file downloads return SHA-named files instead of BIDS-shaped filenames #513 only applies to annex-keyed dataset files).Accept/?format=. ReusesrenderIndexHtml.Cache-Control: public, max-age=300.rclone sync :http:...can size+mtime+ETag cheaply.Supporting helpers
backend/src/services/s3.ts: newlistObjectsWithDelimiter(prefix)helper for one-level S3 listing (single round-trip). Returns{ contents, commonPrefixes, truncated }.backend/src/services/data-router.ts: newresolveQaPath()async resolver + pureqaListingToDirectory()helper for shaping S3 results intoDirectoryEntry[]. The pure half is exported so the file/dir partitioning matrix is unit-testable without an S3 round-trip.normalizeBidsPath()is now exported and reused so both routes share one traversal-rejection contract.Test plan
bun test test/data-route.unit.test.ts→ 109 pass / 0 failtsc --noEmitpassesbash -n+shellcheckclean on the sync scriptaws s3 ls s3://nemar/<live-id>/qa/shows the synced treecurl https://data.nemar.org/<live-id>/qa/dataqual.json→ 302 → JSON content with BIDS-shaped filename in the responsecurl -H 'Accept: text/html' https://data.nemar.org/<live-id>/qa/returns a directory listingcurl https://data.nemar.org/<private-id>/qa/anything→ 404, no existence leakNotes
qa/<v>/sub-prefix is non-breaking.metadata.jsonalready surfaceshed_summaryvia the existing data-router path.This is Phase 3 of 4. Next: Phase 4 (#503, publisher canary for git: refs).