feat(person): deactivate / reactivate / purge (#129)#144
Merged
Conversation
Two removal verbs: deactivate (soft, self-service, reversible, login not blocked, "Deactivated user" placeholder on references) and purge (admin-only cascading hard delete, git-revertable). Authz + endpoints + placeholder shape. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- API: POST /api/people/:slug/{deactivate,reactivate} (self | staff) and
/purge (administrator), via the write mutex.
- Read: people.get returns a deactivated person only to staff or self (for
reactivation); lists exclude deactivated for non-staff; serializePersonAvatar
(+ author/member serializers) emits a "Deactivated user" placeholder.
- Purge cascades: person + memberships + help-wanted-interest + person
tag-assignments + authored updates/buzz/blog-posts, in one commit.
- Web: /account self deactivate/reactivate; admin Danger Zone; placeholder
rendering.
Implements specs/behaviors/person-lifecycle.md + api/people.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
API guard + cascade tests (14) and web tests for self-deactivate and the deactivated-reference placeholder. Fixes the draft test's mintCookies helper, which ignored its level arg so staff/admin callers authenticated as plain users (spurious 403s). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #129 — the two-verb removal model we discussed.
What
deletedAt. Hidden from public lists; detail 404s for non-staff (staff and the person themselves still see it, so they can reactivate); every reference (member grids, update/buzz authors, help-wanted poster) renders a "Deactivated user" placeholder. Login is not blocked — deactivated users sign in and reactivate themselves. Surfaced at/account(self) + an admin Danger Zone.Specs:
specs/behaviors/person-lifecycle.md(new) +specs/api/people.md(endpoints + placeholder).Validation
people-lifecycle 14/14, read-api/project/blog/help-wanted/people 67/67, web 85/85, type-check + lint clean.
Provenance
Drafted by a subagent in an isolated worktree; it hit a context limit before committing/validating. Taken over and finished here — the implementation was sound; the only defect was the draft test's
mintCookiesignoring itslevelarg (staff/admin callers authenticated as plain users → spurious 403s). Fixed; all green. History re-squashed into spec / impl / tests.🤖 Generated with Claude Code