Skip to content

Epic: Account tiers: verified base access, one-time upload approval, identity hardening, real-name attribution #1250

Closed
9 of 9 issues completed

Description

@neuromechanist

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 maps verified to active exactly as it maps approved today. 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 of service_access=1; revoke clears it. Invariant: status='approved' if and only if service_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.

  1. Approval grants upload access; migration and admin visibility
  2. Verified is the base tier for CLI and web
  3. Request upload access and username/name onboarding endpoints
  4. Identity uniqueness hardening (ORCID, email, GitHub)
  5. Real-name DOI attribution
  6. CLI --debug diagnostic 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, verified mapped 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.

Refs: #1249, #1013, #1012, website ADR 0010.

Activity

  1. 3 remaining items

  2. neuromechanist commented on Sep 6, 2026

    @neuromechanist
    ContributorAuthor

    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_gaps and username_auto_assigned on /users/me and /auth/me, gap warnings in nemar 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-names and nemar admin backfill-usernames (dry run, then --apply) once against production.

    Follow-ups filed outside the epic: #1259, #1261, #1267.

  3. neuromechanist commented on Sep 6, 2026

    @neuromechanist
    ContributorAuthor

    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_gaps on /users/me and /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.

  4. added a commit that references this issue on Sep 7, 2026
  5. neuromechanist commented on Sep 7, 2026

    @neuromechanist
    ContributorAuthor

    Released in v0.9.16 (npm, tag v0.9.16) with website v0.2.8. All nine phases merged via #1274 into dev, promoted through #1276.

    Closing by hand: #1274 targeted dev, not the default branch, so GitHub never ran the Closes link.

    Production state after the release

    • api.nemar.org/health reports 0.9.16; nemar.org/version.json reports 0.2.8. Both deploy smokes green.
    • Migrations 0075 to 0080 applied to nemar-db on the pre-strip deploy, all six green, no index conflicts.
    • Migration 0075 landed exactly as measured beforehand: approved 32 to 14, pending 2 to 19 (+17), verified 1 to 2 (+1). The 14 CLI accounts kept approval and gained upload access; the 18 web accounts returned to verified/pending.
    • 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.
    • Docs merged: nemarOrg/docs#19.

    Found during the release

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend/API relatedcliCLI relatedepicfeatureNew feature or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions