Public: anyone can read this; the crew can change it.

The terminal's People screen marks a person's email verified with `v` and a confirm, as MCP `account_verify` does #7328

opened this

Merged 37d 14h ago, live in production

The People screen now has a cursor, and v on a row asks verify 's email? y/n. y calls verifyAccount, the same action MCP accountverify uses, and toasts the result.

Notes

opened this

The People screen now has a cursor, and v on a row asks verify <name>'s email? y/n. y calls verifyAccount, the same action MCP account_verify uses, and toasts the result. n or esc cancels.

The new test/tui-people-verify.test.ts and test/mcp-size.test.ts pass, as do tsc and design-lint. I did not run the full suite; the forge's check does that on the push.

  • Rows: the list is now a scrolling list (j/k, g/G, ctrl-d/u). A row shows unverified at the right when the email is not verified, and the key bar lists v verify. r still asks for an account name, so the two keys stay separate.
  • Non-admin: a viewer who is not a forge admin gets "No such account." and nothing changes. That is the action's refusal, which is not_found for a non-admin.
  • Agent or removed account: the toast uses the MCP tool's words, "An agent or a removed account has no email to verify." The People list leaves agents and removed accounts out, so this path can't be reached from a row.
  • Already verified: verifyAccount doesn't refuse this case; it re-stamps and audits again. The screen refuses it itself with "<name>'s email is already verified." I left the action alone, because changing it would change MCP behaviour.
  • Tests: an admin verifies an unverified person and the row loses unverified; n changes nothing; a second v toasts "already verified". The non-admin case demotes the session's user after opening the screen, since the palette only offers People to admins.

I added no new tool and no dependency, and left the MCP untouched.

I did not add a verified field to listPeople in core/roles.ts, to keep the change to people.ts. The screen looks verification up per row instead, which is fine at forge scale.

To try it, open the palette, choose People, move to an unverified person, and press v, then y.

🤖 Generated with Claude Code

Closes #7317

3 earlier comments
commented

The People screen now has a cursor, and v on a row asks verify <name>'s email? y/n. y calls verifyAccount, the same action MCP account_verify uses, and toasts the result. n or esc cancels.

The new test/tui-people-verify.test.ts and test/mcp-size.test.ts pass, as do tsc and design-lint. I did not run the full suite; the forge's check does that on the push.

  • Rows: the list is now a scrolling list (j/k, g/G, ctrl-d/u). A row shows unverified at the right when the email is not verified, and the key bar lists v verify. r still asks for an account name, so the two keys stay separate.
  • Non-admin: a viewer who is not a forge admin gets "No such account." and nothing changes. That is the action's refusal, which is not_found for a non-admin.
  • Agent or removed account: the toast uses the MCP tool's words, "An agent or a removed account has no email to verify." The People list leaves agents and removed accounts out, so this path can't be reached from a row.
  • Already verified: verifyAccount doesn't refuse this case; it re-stamps and audits again. The screen refuses it itself with "<name>'s email is already verified." I left the action alone, because changing it would change MCP behaviour.
  • Tests: an admin verifies an unverified person and the row loses unverified; n changes nothing; a second v toasts "already verified". The non-admin case demotes the session's user after opening the screen, since the palette only offers People to admins.

I added no new tool and no dependency, and left the MCP untouched.

I did not add a verified field to listPeople in core/roles.ts, to keep the change to people.ts. The screen looks verification up per row instead, which is fine at forge scale.

To try it, open the palette, choose People, move to an unverified person, and press v, then y.

🤖 Generated with Claude Code

commented

All seven points are addressed and pushed to the same branch. tsc, design-lint, test/tui-people-verify.test.ts and test/mcp-size.test.ts pass, as do test/roles.test.ts and test/tui-app.test.ts. I have not run the full suite; the forge's check does.

  1. Docs: the People paragraph in docs/CREW.md now says v marks the email under the cursor verified after a y/n, with account_verify as the MCP twin.
  2. y/n: confirmScreen takes an opt-in yesNo flag, so y chooses the first action and n dismisses. The monkey-patch is gone, and the y path and the button path now share one onChoose that calls verify. No other confirm changes.
  3. Admin gate: v checks up front that the viewer is a forge admin who is a person. Otherwise it toasts "Only a forge admin can verify an email." The test asserts that wording now.
  4. One query: listPeople in core/roles.ts now returns verified, from a join on email_check. The per-row lookups are gone, and the screen runs one query per render and per key.
  5. Missing user: the "missing user counts as verified" default went away with the lookup. A person with no verification row, or with it unproven, shows as unverified.
  6. Tests: the suite now covers four more things.
    • The account.email_verified event is emitted with by: owner.
    • n and esc both cancel.
    • r still changes a role after the list change.
    • listPeople reports verified for verified and unverified people.
  7. Header: re-wrapped.

I handled "already verified" in the screen from the row's verified flag, since verifyAccount itself doesn't refuse it.

commented

I merged main into the branch and pushed. The three conflicts are resolved, keeping both the s suspend work and my v verify work.

  • src/core/roles.ts: Person now carries both suspendedAt and verified, and listPeople still reads them in a single query.
  • src/tui/screens/people.ts: the s prompt-by-name and its confirm are unchanged. The v key, the cursor list and the unverified marker sit beside them. A suspended row reads suspended <date> as before, and an unverified row also shows unverified at the right. The key bar lists r, s and v.
  • docs/CREW.md: the People paragraph mentions both v and s.

tsc and design-lint pass, as do test/tui-people-verify.test.ts, test/tui-people-suspend.test.ts, test/people-role-limits.test.ts, test/people-timing.test.ts and test/mcp-size.test.ts. I did not run the full suite; the forge's check does that on the push.

commented

I merged main into the branch and pushed it; the branch should merge cleanly again.

The only conflict was in docs/CREW.md, the Roles paragraph. I kept this pull's People-screen wording, including v marking an email verified. I also kept the sentence main added after "What I can do": an unverified email is said on that screen, and v sends a new verification email. I dropped "read only", since that screen now has v.

src/tui/screens/common.ts merged without a conflict. bun x tsc --noEmit passed. I ran the 714 tests (113 files) that match "people" or the terminal; all passed. I did not run the whole suite. scripts/fast.ts reported the diff as too broad to name tests, so I picked those files myself.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs