Tree Cleanup tool: bulk fixes with preview → approve

A new per-tree Cleanup page (and cleanup_service + endpoints), each fix
preview-first per the propose-then-approve rule:

- Mark deceased by birth year: lists people born ≤ a cutoff (default 1930) not
  already deceased; apply sets is_living=false for the ones you keep checked.
- Set sex from a source GEDCOM: upload the source .ged (it carries SEX); matches
  by name and proposes sex only where it's missing — far more accurate than
  guessing from first names. Review, then apply.
- Names that look broken: flags date-in-surname / date-in-given / no-surname /
  packed given names, with inline editable given+surname; fix the checked ones.

No migration (uses existing columns). 55 backend tests pass (preview+apply for
all three); frontend builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 10:17:01 -04:00
parent 97f7a9e0ff
commit aa62ca490e
9 changed files with 1737 additions and 0 deletions
+7
View File
@@ -9,6 +9,7 @@ import {
LogOut,
Network,
Settings,
Sparkles,
Users,
} from "lucide-react";
import Link from "next/link";
@@ -128,6 +129,12 @@ export function AppSidebar({ onNavigate }: { onNavigate?: () => void }) {
icon={ArrowDownUp}
active={pathname.startsWith(`/trees/${treeId}/gedcom`)}
/>
<Item
href={`/trees/${treeId}/cleanup`}
label="Cleanup"
icon={Sparkles}
active={pathname.startsWith(`/trees/${treeId}/cleanup`)}
/>
<Item
href={`/trees/${treeId}/recovery`}
label="Recovery"