Repository navigation
Closed
Labels
featureNew feature or enhancement
Description
Goal
When a user requests publication, automatically pre-screen the dataset (publisher minimum, not peer review) before it reaches an admin. Block + notify on hard gaps so the requester can self-correct.
Screen (Recommended gate)
BLOCK if any:
- No real data (annex/S3 targets missing or implausibly small for the subject count)
- README empty / missing / citations-only (must say what the data is and how to use it)
- dataset_description.json missing Name or Authors
Non-blocking note: missing data paper / primary citation -> recommend adding.
Architecture (mirrors run-enrichment)
POST /datasets/:id/publish/request(after BIDS readiness passes): dispatchrepository_dispatch[run-prescreen]tonemarDatasets/.githubwith an HMAC callback token; setprescreen_status='pending'. Non-blocking (dispatch failure logs, does not 500).run-prescreen.yml(nemarDatasets/.github): mint per-repo App token, checkout dataset metadata, compute declared-data size from annex pointers, runclaude -p --model haiku(auth viaCLAUDE_CODE_OAUTH_TOKEN) -> structured verdict JSON. On block: open/refresh a GitHub issue on the dataset repo (NEMAR_ADMIN_TOKEN). POST verdict to callback.POST /webhooks/prescreen-result: verify HMAC (one-shot, gated onprescreen_status='pending'). Independently verify S3 presence server-side (getDatasetS3Stats, Worker has creds). If claude says block OR S3 check fails ->status='blocked',block_reason='prescreen_failed', storeprescreen_issue_url, email requester (sendPublicationBlockedEmail). Elseprescreen_status='passed'.
Work items
- migration
0028_prescreen.sql(+prescreen_status,prescreen_issue_url,prescreen_aton publication_requests) -
email.ts:sendPublicationBlockedEmail -
github.ts: sign/verify prescreen callback token +triggerPrescreenRun -
webhooks.ts:/webhooks/prescreen-result+ puredecidePrescreenOutcome -
datasets.ts:prescreen_failedblock message + dispatch in publish-request -
nemarDatasets/.github:run-prescreen.yml - tests (token roundtrip, dispatch payload, decision fn, block message)
- secrets to add on nemarDatasets/.github:
CLAUDE_CODE_OAUTH_TOKEN,NEMAR_ADMIN_TOKEN
Context
Motivated by a 99-dataset bulk import (EEGDash) where 8 had missing READMEs / metadata / data. Backfill review done manually 2026-06-01; this automates it going forward.
Metadata
Metadata
Assignees
Labels
featureNew feature or enhancement
Activity
feat: automated publication pre-screen (#666) (#667)
test: fix stale .blocked in root prescreen-decision test (#756)