Skip to content

Phase P2: users group - #2321

Merged
neuromechanist merged 18 commits into
feature/issue-2307-epic-admin-treefrom
feature/issue-2310-phase2-users-group
Nov 22, 2026
Merged

neuromechanist merged 18 commits into
feature/issue-2307-epic-admin-treefrom
feature/issue-2310-phase2-users-group

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase P2 of the admin command tree restructure (ADR 0135): the account commands move under nemar admin users, admin doctor kinds becomes admin users kind-check, which empties admin doctor (now a dissolved group with its own stub row), and admin backfill-names is retired. Every old path is a row of the moved-command table: it runs nothing, prints one line naming the new path, and exits 1.

Moves are their own commits with no behavior change; the retirement and the changed name hint are separate commits.

Closes #2310

Part of epic #2307

Old path to new path

  • admin approve, revoke, role, verify, kind -> admin users approve|revoke|role|verify|kind
  • admin keys {create, list, revoke} -> admin users keys ...
  • admin email-preferences {show, update} -> admin users email-preferences ...
  • admin duplicates -> admin users duplicates
  • admin backfill-usernames -> admin users backfill-usernames (unchanged; its mail side effect is backfill-usernames --apply re-sends verification mail #2315)
  • admin doctor kinds -> admin users kind-check
  • admin doctor (dissolved) -> admin dataset doctor; the P1 rows doctor scan and doctor fix now sit under this gone group
  • admin backfill-names -> retired; the stub says names now come from ORCID at sign-up and the backfill has nothing left to fill (the backend route stays)

The collision the plan named

nemar admin users is a listing with value-taking options (--search, --role, --kind) and now also the parent of approve, revoke, kind and the rest. Commander dispatches a first operand that names a subcommand and leaves an option's value as a value, so admin users approve bob reaches the approval and admin users --search approve and admin users --kind test stay the listing. test/admin-users-group.unit.test.ts asserts each case on what reached a recording stand-in.

Behavior and text changes

  • admin backfill-names and its backfillUserNames client function are removed.
  • The owner_name_missing hint (src/lib/admin-command.ts), the enrichment and DOI-refresh skip messages, the backfill-usernames no-name line and the backfill-names retirement line no longer tell admins to run backfill-names. They read one shared sentence, cli.admin.owner_name_missing.fix in shared/contract/account-copy.ts: an ORCID-linked owner makes the name public on their ORCID record and signs in again; only an owner with no verified ORCID link types it into Settings on nemar.org, because PATCH /auth/profile refuses the edit (name_is_orcid_canonical) for an ORCID-linked owner.
  • Backend and shared text names the users paths: the approval and upload-access request mails (nemar admin users approve <username> or --id <id>), user-edit.ts, routes/users.ts, ticket-notify.ts, shared/contract/admin-user.ts, shared/contract/device-auth.ts, and the CLI hints.
  • help-groups.ts: the admin lead block is now users, dataset, pr-reviews, mail, notify. The users description is one sentence, and the admin --help User Management block lists all twelve users subcommands.
  • Text change: the users kind-check failure spinner says "Account kind check failed" (it said "Doctor kinds check failed" as doctor kinds).

Outside this repository (not in this PR)

docs.nemar.org pages that name the moved paths, the website's mail-prefs-api.test.ts fixture and an account-tier.ts comment, and the nemar-observability alert from P1 change in the same release.

Test plan

  • bun run lint, bun run typecheck, biome check on every changed test file
  • New test/admin-users-group.unit.test.ts (23 pass): listing, --search approve, -s revoke, --role admin, --kind test, users show approve, and each subcommand reached with nothing written when declined
  • New backend/test/approval-mail-command.test.ts (3 pass): the rendered text of both approval mails reads nemar admin users approve <username> or --id <id>
  • Every other changed test file, plus moved-commands.unit, help-tiers.unit, admin-restructure, the P1 dataset and probe tests: 31 files, 1107 pass, 13 skip (live tier, no keys), 0 fail
  • test/admin-backfill-usernames-cli.test.ts: 9 pass; its 5 tests that pass --apply (to a local stand-in) were filtered out and not run, by the rule that backfill-usernames --apply is never run in this epic
  • Mutations: making --kind a boolean fails the --kind test case; registering approve back on admin fails 3 tests; restoring nemar admin approve in the upload-access mail fails the mail test
  • Full bun test not run (runs at epic to dev)

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2321

Version: 0.10.39-PR2321.1c5a349
Commit: 1c5a349


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 8670892 into feature/issue-2307-epic-admin-tree Nov 22, 2026
31 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2310-phase2-users-group branch November 22, 2026 19:42

This branch was previously deployed

1 inactive deployment
npm — 1c5a3490 Deployed Nov 22, 2026 by neuromechanist via publish #4775
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant