Skip to content

feat(person): deactivate / reactivate / purge (#129)#144

Merged
themightychris merged 4 commits into
developfrom
fix/person-lifecycle
Jun 28, 2026
Merged

feat(person): deactivate / reactivate / purge (#129)#144
themightychris merged 4 commits into
developfrom
fix/person-lifecycle

Conversation

@themightychris

Copy link
Copy Markdown
Member

Implements #129 — the two-verb removal model we discussed.

What

  • Deactivate (soft, self-service): self or staff/admin sets 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.
  • Purge (admin only): cascading hard delete — person + memberships + help-wanted-interest + person tag-assignments + their authored updates/buzz/blog-posts — in one commit, so it's git-revertable. The runtime sibling of the offline spam-prune (feat(spam): prune confident-spam from published #133).

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 mintCookies ignoring its level arg (staff/admin callers authenticated as plain users → spurious 403s). Fixed; all green. History re-squashed into spec / impl / tests.

🤖 Generated with Claude Code

themightychris and others added 4 commits June 27, 2026 18:43
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>
@themightychris themightychris merged commit b8df4a6 into develop Jun 28, 2026
1 check passed
@themightychris themightychris deleted the fix/person-lifecycle branch June 28, 2026 04:15
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