Repository navigation
Description
Why
Since the tiered-access rollout (website ADR 0010, #1013 Phase 1, shipped in v0.9.5 on 2026-07-24) status='approved' no longer implies upload. Uploading requires users.service_access=1, and the only thing that has ever set it is the one-time grandfather step in migration 0062. Phase 2 of #1013 (admin grant endpoint, request flow, admin UI, signup notifications) was never built, so nemar admin approve approves a user without unlocking upload (#1249), ORCID web sign-ups land directly at approved with no admin email, no audit row, and no username (19 of 38 accounts today), and the admin listing cannot tell an uploader from a browser-only account. Separately, the same person can hold two accounts (two ORCID sign-ups with different emails), and DOIs attribute the uploader by username rather than real name.
Decision (new ADR in this repo; supersedes the auto-approve-to-approved part of website ADR 0010)
Keep the two tiers, fix the names, and make approval the thing that grants upload:
pending: account exists, email not verified. CLI signups and ORCID web sign-ups alike. A pending web user sees only a verify-your-email step.verified: email verified. The base tier. Browse, dashboard, settings, CLI API key, sandbox training, request upload access. No admin action. The website mapsverifiedtoactiveexactly as it mapsapprovedtoday. The account also carries ORCID and a username at this point (web users choose one at onboarding; default is first initial plus family name, uniqueness-checked).approved: an admin approved the one-time upload request. Approval is the single writer ofservice_access=1; revoke clears it. Invariant:status='approved'if and only ifservice_access=1.- Sandbox training is CLI-only. Browser uploads are gated on approval alone.
- Admins are not asked to act at account creation. They are notified when someone requests upload access (or, for CLI signups, when the email is verified, as today) and approve with
nemar admin approve <username>, by id, or from the website admin page. - Real names (
given_name/family_name, ORCID-canonical when linked) are what DOIs attribute; the username is never emitted into DataCite metadata.
Phases
Phase issues are linked as sub-issues. Phases 5 and 6 are independent of 1-4 and run in parallel from the start; 2 follows 1; 3 and 4 follow 2.
- Approval grants upload access; migration and admin visibility
- Verified is the base tier for CLI and web
- Request upload access and username/name onboarding endpoints
- Identity uniqueness hardening (ORCID, email, GitHub)
- Real-name DOI attribution
- CLI
--debugdiagnostic bundle and bug-report issue form
Companion work in other repos
- nemarOrg/website: sign-in page states that an account is only needed to upload (and later for compute); the dataset page "How to use the data" block becomes a small expandable endnote; onboarding (username, name), verify-email step, Request upload access, admin approve button,
verifiedmapped to active, ADR 0010 marked superseded. - nemarOrg/docs: account settings (email, GitHub, ORCID, username), upload access,
--debug.
Interim
Until Phase 1 ships, upload access for already-approved CLI signups is granted by the same rule the migration will encode: UPDATE users SET service_access=1 ... WHERE status='approved' AND signup_source='cli' AND service_access=0 AND deleted_at IS NULL.
Activity
docs: record ADR 0040 phasing and citations
fix: never 500 a completed approve or revoke
test: pin rule (b) against a soft-deleted row
feat: report an unreported upload tier as unknown
Phase 1: approval grants upload access (#1258)
3 remaining items
fix: bound the ORCID link intent three ways
fix: type every route-level refusal code
fix: CLI config, 404s, poll exits, --timeout
test: cover the review's gaps
docs: ADR 0044 records the three bounds
test: cover the rename collision, and warn on it
Phase 7: CLI self-service for identity fields (#1269)
neuromechanist commentedon Sep 6, 2026
Status 2026-09-06 (evening). On the epic branch: Phases 1, 2, 3, 4, 5, 6, and 7 (#1258, #1262, #1265, #1264, #1260, #1257, #1269) plus the test pin #1263; epic tip 92ae5db. Each phase went through a four-lens review (code, tests, silent failures, comments), a fix round, and a focused re-review before its squash merge; migrations 0075 to 0078 replay cleanly on real local D1 via
bun run migrations:d1-check.In progress: Phase 8 (#1268), CLI and web parity: one field matrix, one copy module (shared/contract/account-copy.ts mirroring the website's 81 keys),
profile_gapsandusername_auto_assignedon /users/me and /auth/me, gap warnings innemar auth status,auth profile, and the upload preflight, and automatic username assignment at web sign-in alongside the Phase 3 sweep.Website: everything for this epic is on staging (#302, #303, #306, #307, #308, #310); promotion to main is timed with the release order below. Docs: nemarOrg/docs#19 is complete and held until the release.
Also done today: the orphan duplicate account (row 42) was soft-deleted by the owner; the interim production grant for approved CLI signups was applied on 2026-09-05.
Release order once Phase 8 lands: final verification on the epic branch, epic to dev PR (deploys the dev worker and applies 0075 to 0079 to nemar-db-dev), end-to-end check of test.nemar.org against api-test, then promote the website staging to main FIRST, release dev to main right after, merge docs#19, and run
nemar admin backfill-namesandnemar admin backfill-usernames(dry run, then --apply) once against production.Follow-ups filed outside the epic: #1259, #1261, #1267.
neuromechanist commentedon Sep 6, 2026
Checkpoint 2026-09-06 (evening).
Phase 8 (#1268) merged into the epic branch via #1270 as 6bd0e75: shared account copy and profile-gap matrix,
profile_gapson/users/meand/auth/me, username auto-assignment at web sign-in (migration 0079), the case-insensitive username index ADR 0042 promised (migration 0080), CLI profile and upload preflight guidance, and the account-copy parity test now enforced in CI through a sparse checkout of the website's copy file. Five review lenses, a sixteen-item fix round, and a two-lens re-review plus three residuals, all closed.Phase 9 (#1271) started from 6bd0e75: an unverified ORCID iD blocks the upload access request, admin and owner roles exempt until the service-account kind lands. The website half is already on staging (website#312, 19f93e3e) and the three copy keys are mirrored here ahead of the matrix row.
Website#311 (drift test enforced in CI) is reviewed and held until this epic reaches dev. Follow-up epic #1272 (ORCID-first CLI sign-in with the device flow, service and test account kinds) carries the agreed design, the headless and paste-key fallback, the 90-10 coverage list, and the ORCID-free testing strategy.
Merge pull request #1274 from nemarOrg/feature/issue-1250-epic-accoun…
neuromechanist commentedon Sep 7, 2026
Released in v0.9.16 (npm, tag
v0.9.16) with website v0.2.8. All nine phases merged via #1274 intodev, promoted through #1276.Closing by hand: #1274 targeted
dev, not the default branch, so GitHub never ran theCloseslink.Production state after the release
api.nemar.org/healthreports0.9.16;nemar.org/version.jsonreports0.2.8. Both deploy smokes green.nemar-dbon the pre-strip deploy, all six green, no index conflicts.nemar admin backfill-names: 4 scanned, 0 fillable. All four ORCID records withhold a full name, so there is nothing to write; those accounts have to publish a name on ORCID and sign in again (ADR 0042).nemar admin backfill-usernames --apply: 15 assigned, 14 verification codes sent, 1 already verified, 0 conflicts, 0 write failures, 0 rate-limited. Three single-name accounts (ids 57, 61, 62) were correctly left for a human to name rather than guessed at.Found during the release
main. Not a bootstrap problem; it would have recurred on every release touching the copy. Both sides now pair to the pre-release branches. ADR 0046.api-test's GitHub-conflict signup case reused the shared fixture ORCID, so once any dev row held that iD the new ORCID gate (ADR 0043) answered first and the case stopped covering what it names. Given its own iD.@nemar.orgmailboxes (DEV_EMAIL_ALLOWLIST) and burns the shared Resend quota;passwordless-auth-testwas failing on 429 exhaustion rather than on anything real. Open.Follow-ups
#1272 (ORCID-first CLI sign-in, device flow, account kinds) is the next epic and takes precedence. #1261, #1259, #1267, #1280 and website#313 are tracked as standalone work.
fix: passwordless live test premises (#1317)