Repository navigation
feat: automated publication pre-screen (#666) - #667
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR667Version: 🤖 Updated on each push. |
PR review (pr-review-toolkit, Sonnet) — findings + resolutionsRan code-reviewer, silent-failure-hunter, and pr-test-analyzer in parallel. All real findings addressed in Critical (fixed)
High (fixed)
Medium (fixed)
Tests (added)
Assessed, not changed
Separate incident fixed here
|
CI status (for whoever merges)Green: Red:
This PR touches no IAM/collaborator/credential code; no prescreen or publish-progress test fails. Held for manual merge per owner decision. Merge target: #667 → |
…ication-prescreen
Closes #666.
What
Adds an automated, feature-flagged publication pre-screen. When a user requests publication and the dataset passes BIDS-validation readiness, the Worker dispatches
repository_dispatch[run-prescreen]tonemarDatasets/.github, which runsclaude -p --model haikuagainst the dataset and POSTs a verdict back. NEMAR stays a publisher, not a peer reviewer — the screen only checks the publisher minimum.Block criteria (Recommended gate)
dataset_description.jsonmissingNameorAuthorsMissing data paper = non-blocking note.
Backend changes
0028_prescreen.sql:prescreen_status,prescreen_nonce,prescreen_issue_url,prescreen_atonpublication_requests.github.ts:triggerPrescreenRundispatch +sign/verifyPrescreenCallbackToken(same one-shot HMAC handshake as the manifest callback).webhooks.ts:POST /webhooks/prescreen-result+ puredecidePrescreenOutcome/validatePrescreenCallbackBody. The handler runs an independent server-side S3 presence check (getDatasetS3Stats, Worker has creds) and combines it with the claude verdict.datasets.ts:prescreen_failedblock message + dispatch on publish request (non-blocking, logged on failure).email.ts:sendPublicationBlockedEmail.bindings.ts:PRESCREEN_ENABLEDflag +PRESCREEN_CALLBACK_SECRET.Companion workflow
run-prescreen.ymlis a separate PR onnemarDatasets/.github.Safety / rollout
PRESCREEN_ENABLED="true"ANDPRESCREEN_CALLBACK_SECRETis set, so this deploy changes nothing until explicitly enabled. No prod deploy in this PR.prescreen_status='pending').s3=null-> never a false block.Secrets to add before enabling
PRESCREEN_CALLBACK_SECRET(prod + dev)nemarDatasets/.github:CLAUDE_CODE_OAUTH_TOKEN,NEMAR_ADMIN_TOKENTests
163 related tests pass; 28 new (token round-trip + tamper, dispatch payload, decision/validator). Typecheck clean.
Context
Backfill of a 99-dataset EEGDash bulk import (2026-06-01) surfaced 8 with missing README/metadata/data; this automates that screen going forward.