Repository navigation
Epic: data.nemar.org follow-ups from website integration (#514) - #519
Merged
Merged
Conversation
* Force BIDS filenames on data.nemar.org downloads (#513) Annex-keyed presigned URLs now carry response-content-disposition with the BIDS basename so browsers, rclone, aria2c and curl save SHA256E-...bdf as sub-XX_task-Y_emg.bdf. RFC 6266 attachment value carries both an ASCII filename= (sanitised for the quoted-string) and an RFC 5987 filename*=UTF-8'' extension for non-ASCII names. Disposition emits with no inter-token whitespace so the value survives aws4fetch's URLSearchParams round-trip (form-encoded + vs %20) intact. * Phase 1 review: clarify encoder + pin invariants Apply Phase 1 code-reviewer feedback on PR #515: explain why response-content-disposition must be URL-encoded before signing (escape ;=&# from breaking URL parsing), add a regression test for top-level annex bidsPath, and pin that response-content-disposition appears before X-Amz-Signature so a future refactor that appends after signing fails loudly. * Phase 1 review: harden basename derivation against trailing-slash bidsPath
…512) (#516) * Backfill OpenNeuro import metadata + lift on* reindex block (#512) Three coordinated changes so freshly imported on* datasets get the same right-rail / catalog data as nm* datasets: - runDatasetSync no longer throws hard for on*; it skips only the nemar.org push (which still needs alternate_id mapping) and keeps writing D1 metadata columns + sync status. Surfaced via new result.nemar_sync_skipped flag and a 'skipped' status in the admin reindex response. - buildReindexFilterQuery includes on* in 'all', 'missing-metadata', and 'stale' filters. Sandbox (xx*) stays excluded. - import-openneuro CLI seedMetadata expands the .nemar/metadata.json payload: bids_version, recording_modality + datatypes from a sub-*/datatype/ filesystem scan, funding_references from Funding, acknowledgements when present. After publication-approve the orchestrator now calls reindexDataset() so D1 metadata columns + LLM enrichment populate for the new dataset. Existing on* datasets backfill via 'nemar admin reindex --all' once deployed. * Phase 2: update runDatasetSync docstring for on* skip * Phase 2 review: defer NEMAR creds check to non-skip branch
…#511) (#517) * Add QA artifact sync + data.nemar.org/<id>/qa/* route (#511) 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. * Phase 3 review: gate /<id>/qa 308 on visibility check
Option 1 from the issue. After generateManifest builds the file map, HEAD-check a small sample of the git:-keyed URLs on raw.githubusercontent.com pinned to the version tag. If any return non-200, throw GitBackedFileMissingError so the publication workflow fails LOUDLY instead of writing a manifest that would later 302->404 on data.nemar.org. Sampling: dataset_description.json (always when present) + up to 4 additional git: paths in deterministic sorted order. Caps the Worker subrequest cost at 5 HEADs in the happy path. A single 2-second retry per failing canary absorbs raw.githubusercontent.com CDN propagation lag after a fresh tag push; real missing-blob failures stay failed across both attempts. selectGitBackedCanaries is exported and pinned by unit tests so the sampling matrix is legible.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR519Version: 🤖 Updated on each push. |
The Phase 4 canary in generateManifest HEADs raw.githubusercontent.com for git:-keyed paths, which broke the pre-existing manifest-small-root-files.test.ts: that test mocks getTreeAtRef + getBlobContent with synthetic data, so the canary 404s against the real internet for fake repo/tag/blob combinations. Add an optional GenerateManifestOptions.skipGitBackedVerification that suppresses the canary when set. Production callers (webhooks + admin publish) never set it; the 4 affected tests now pass true. Caught by unit-test-all on the epic→dev PR before merge.
This was referenced May 16, 2026
Closed
Closed
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 #514. Bundles the four phase PRs (#513, #512, #511, #503) that surfaced while integrating with the website redesign (
nemarOrg/website#1,#4).What ships
response-content-dispositionon presigned URLs..nemar/metadata.jsonpopulated.runDatasetSyncskips only the nemar.org push for on*; metadata columns + LLM enrichment still run. Bulk reindex (--all) now includes on*.scripts/hallu-qa-sync.shmirrors/data/qumulo/openneuro/processed/<id>/→s3://nemar/<id>/qa/hourly. Newdata.nemar.org/<id>/qa/*Worker route with the same visibility / content-negotiation contract as the version route.generateManifest: HEAD-checks up to 5git:-keyed paths againstraw.githubusercontent.comafter building the manifest. Throws if any blob is missing, so a broken manifest never reaches S3.Diff stat
New files:
scripts/hallu-qa-sync.sh.Modified: 4 backend services, 2 routes, the CLI import-openneuro orchestrator, 4 test files.
Test plan
tsc --noEmitclean on each phase/<id>/qa308 redirectnemar admin reindex --allto backfill existing on* datasets with metadata columns (Phase 2 follow-through)Operational follow-ups (non-blocking)
nemar admin reindex --allonce deployed (touches ~30 datasets).15 * * * * /path/to/nemar-cli/scripts/hallu-qa-sync.sh >> /data/qumulo/openneuro/.nm-qa-sync-cron.log 2>&1.Related
nemarOrg/website#1(redesign) and#4(Phase 3 site) — the consuming side.