Repository navigation
Description
Problem
After upload, there's no process for users to request publication or for admins to approve it. The gap between "private dataset uploaded" and "public dataset with DOI" has no CLI support.
Proposed Command Tree
Admin Commands (new/restructured)
nemar admin s3
regenerate-iam <user> # Existing, moved from top-level
lock <dataset> # Apply S3 Object Lock to tagged version (#56)
nemar admin ci
check <dataset> # Verify BIDS CI is present + passing
add <dataset> # Add BIDS CI workflow to dataset repo
nemar admin repo
public <dataset> # Make dataset repo public on GitHub
private <dataset> # Make dataset repo private
nemar admin publish
list # List pending publication requests
approve <dataset> [--resume] # Run full orchestration (or resume from failure)
deny <dataset> --reason "..." # Deny with feedback to userUser Commands (new)
nemar dataset publish
request # Signal dataset is ready for publication
status # Check publication pipeline status
resend # Re-notify adminState Machine (D1)
┌──────────┐ ┌───────────┐ ┌──────────────┐ ┌───────────┐
│ PRIVATE │───▶│ REQUESTED │───▶│ APPROVING │───▶│ PUBLISHED │
│ │ │ │ │ (in progress) │ │ │
└──────────┘ └───────────┘ └──────────────┘ └───────────┘
│ │
▼ ▼
┌──────────┐ (--resume from
│ DENIED │ failed step)
└──────────┘
D1 table: publication_requests
dataset_id,status,requested_at,approved_at,denied_reasonsteps_completed(JSON array for resume tracking)
Orchestration: nemar admin publish approve
Runs sub-commands in sequence, each tracked in D1:
Step 1: nemar admin ci check <id> → Verify BIDS CI present + passing (add if missing)
Step 2: nemar admin repo public <id> → Make repo public on GitHub
Step 3: nemar admin doi create <id> → Concept DOI + v1.0.0 tag
Step 4: nemar admin s3 lock <id> → S3 Object Lock on tagged annex keys
Step 5: Notify user (email) → "Your dataset is public with DOI: ..."
Recovery options when a step fails:
nemar admin publish approve <id> --resume- skips completed steps, retries from failure- Or call the specific sub-command directly, then resume
Each sub-command is idempotent (safe to re-run).
BIDS CI Strategy
When: Added at upload time (not publish time)
Users get immediate BIDS validation feedback on PRs while iterating on their dataset. The publish step just verifies CI is present and passing.
How: GitHub Actions workflow using Bun
The BIDS validator is Deno-based but should run via bunx for fast cold starts:
# .github/workflows/bids-validate.yml
name: BIDS Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bunx bids-validator .If bunx doesn't work with the Deno-based validator, fallback to npx or direct Deno install. Key requirement: fast CI startup.
nemar admin ci check behavior:
- Check if
.github/workflows/bids-validate.ymlexists in repo - If missing: add it (same as
ci add) - If present: check latest CI run status via GitHub API
- Return pass/fail/missing
Email Notifications
| Event | Recipient | Content |
|---|---|---|
publish request |
Admin | "Dataset nm000151 requests publication" |
publish approve (complete) |
User | "Your dataset is now public with DOI: ..." |
publish deny |
User | "Publication denied: " |
publish resend |
Admin | Re-sends request notification |
Migration: regenerate-iam
Move existing nemar admin regenerate-iam under nemar admin s3 regenerate-iam. Keep the old command as a hidden alias for backwards compatibility during transition.
Implementation Phases
Phase 1: Sub-commands
-
nemar admin ci add- generate and push BIDS CI workflow -
nemar admin ci check- verify CI presence + status via GitHub API -
nemar admin repo public/private- toggle repo visibility - Move
regenerate-iamundernemar admin s3
Phase 2: Publication request flow
- D1 schema for
publication_requeststable -
nemar dataset publish request/status/resend -
nemar admin publish list/deny - Email notifications (mechanism TBD: SES, Cloudflare Email Workers, etc.)
Phase 3: Orchestrator
-
nemar admin publish approvewith step tracking -
--resumeflag with D1 state lookup - Integration with
doi createands3 lock(from Design: Versioning architecture for DOI protection and data immutability #56)
Phase 4: Upload-time CI
- Auto-add BIDS CI workflow during
nemar dataset upload - Validate bunx/bun compatibility with Deno-based bids-validator
Related Issues
- Design dataset push/commit workflow for ongoing updates #51 - PR-based workflow (staging S3, BIDS CI on PRs)
- Design: Versioning architecture for DOI protection and data immutability #56 - Versioning architecture (DOI, tags, S3 Object Lock)
- Epic: DataLad-like CLI experience with pure git-annex #58 - DataLad-like CLI commands (clone, get, save, push)
- Improve upload workflow: auto-accept invitations, commit authorship, resume support #41 - Upload workflow improvements (parent)
Open Questions
- Email mechanism: SES? Cloudflare Email Workers? Simple SMTP via existing infra?
- Re-request after deny: Should denied datasets be able to re-request? (Likely yes, after addressing feedback)
- bunx + bids-validator: Need to verify the Deno-based validator runs under bunx/bun. If not, use npx or deno directly in CI.
- CI added at upload vs first PR: Adding at upload means the initial commit triggers CI. Could be noisy if dataset isn't ready yet. Alternative: add on first PR only.
Activity
neuromechanist commentedon Jan 24, 2026
Implemented in PRs #72, #74: admin restructuring (s3/ci/repo subgroups), publication request/approve pipeline with resumable orchestrator, email notifications.
docs: record the apply-half rules in ADR 0050