Skip to content

People staging — confirm, merge, or dismiss inferred speakers#3

Merged
yoaquim merged 1 commit into
mainfrom
feature/people-staging
Apr 25, 2026
Merged

People staging — confirm, merge, or dismiss inferred speakers#3
yoaquim merged 1 commit into
mainfrom
feature/people-staging

Conversation

@yoaquim
Copy link
Copy Markdown
Owner

@yoaquim yoaquim commented Apr 25, 2026

Summary

Instead of auto-adding inferred speakers to people.json, they now land in people-pending.json for user review. This prevents false positives (e.g., "Ethan" being added when "Ethan Johnson" already exists) and gives users control over their people list.

How it works

  1. After syncstage-people.py scans all analysis.json files for speaker_map entries
  2. Filters — skips generic labels (GENERIC_LABELS: ~15 universal terms like "speaker", "unknown", "host") + user-defined exclusions in .seam/generic-speakers.txt + already-dismissed names
  3. Stages — new names land in .seam/people-pending.json with metadata (mention count, which recordings)
  4. People page — shows "N new speakers detected" section at the top with three actions per entry:
    • Confirm — creates a new person in people.json with source: "inferred"
    • Merge — adds as alias to an existing person (click to pick which person)
    • Dismiss — adds to .seam/dismissed-speakers.txt so it won't resurface

Files changed

  • scripts/stage-people.py — new script, scans analyses and stages speakers
  • scripts/pocket-run.sh — runs stage-people.py after analysis phase
  • server/index.ts — new endpoints: GET /api/people/pending, POST .../confirm, POST .../merge, POST .../dismiss
  • src/hooks/usePendingPeople.ts — React hook for pending people API
  • src/pages/PeoplePage.tsx — pending speakers UI section

Context

This is a follow-up to the discussion on PR #2 about GENERIC_TOKENS. That PR's seed-people.py auto-added inferred speakers directly — this PR replaces that approach with a human-in-the-loop staging flow.

Test plan

  • npm test — 52 tests pass (27 vitest + 25 pytest)
  • Run sync with existing analyses → verify pending speakers appear on People page
  • Confirm a pending speaker → verify it appears in people list
  • Merge a pending speaker → verify alias added to target person
  • Dismiss a pending speaker → verify it doesn't resurface on next run

Instead of auto-adding inferred speakers to people.json, they land in
people-pending.json for user review. The People page shows a "new speakers
detected" section with three actions:

- Confirm — creates a new person
- Merge — adds as alias to an existing person (click to pick who)
- Dismiss — adds to dismissed-speakers.txt exclusion list

Pipeline:
- stage-people.py scans analysis speaker_maps, filters generic labels,
  stages new names (skips existing people, pending, and dismissed)
- pocket-run.sh runs stage-people.py after analysis phase
- Server endpoints: GET/POST pending confirm/merge/dismiss
- GENERIC_LABELS trimmed to ~15 universal terms
- User-configurable .seam/generic-speakers.txt for domain-specific exclusions
@yoaquim yoaquim merged commit 111ea8a into main Apr 25, 2026
yoaquim added a commit that referenced this pull request Apr 25, 2026
## Summary

- **CLAUDE.md** — added mandatory TDD (red-green-refactor), React,
Tailwind, and Git practices
- **Pre-commit hook** — runs `npm run build` + `npm test` before every
commit. Committed to `.githooks/` and enabled via `git config
core.hooksPath`
- **23 new tests** for people staging (the feature merged in PR #3 had
no tests):
- `server/__tests__/pending-people.test.ts` — confirm, merge (with alias
dedup), dismiss, 404s, file cleanup
- `scripts/tests/test_stage_people.py` — generic label filtering,
canonical name merging, skip existing/dismissed/pending, alias matching
- **Branch protection** on main: PRs required, no force pushes,
auto-delete merged branches

## Test plan

- [x] `npm test` — 79 tests pass (38 vitest + 41 pytest)
- [x] Pre-commit hook runs and blocks on failure
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