Files
kami ff6a512630 Reconstruct repo from Claude Code + codex transcripts
Working tree (including .git) was lost to an rm. Rebuilt by replaying Write/Edit/
Read/attachment events from 25 Claude sessions and 22 successful codex apply_patch
blocks into one timestamp-ordered timeline.

Verified against ground truth recorded in the transcripts: wc -l on 10 files and
ls -l on 5 files at 2026-07-18T13:13:44Z both match exactly; 18 files are
byte-identical to their newest ~/.claude/file-history blob.

See HANDOFF.md for sources, gaps, and how to rebuild .venv.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 02:42:41 +04:00

30 lines
1.9 KiB
Markdown

# Character name recognition — open problem
The script stage writes narration that refers to characters generically ("a young man", "a woman with dark hair") because the vision describe prompt has no way to attach names to identities. Fixing this is a multi-stage problem, not a prompt tweak.
## The core loop
OCR alone doesn't help — finding "Teto" in a speech bubble gives us a string but no visual binding. The vision model needs to see the image to tie a name to an appearance. That means:
1. OCR each crop for character names/introductions (pytesseract, cpu, cheap)
2. For any crop where OCR finds a new name, re-send the same image to gemma4 with:
*"A character just spoke the name 'Teto'. Describe their distinguishing visual features."*
3. Store a name→description map: `{"Teto": "young girl, short dark hair, red scarf"}`
4. Inject known names into subsequent describe prompts:
*"Known characters in this chapter: Teto (young girl, short dark hair, red scarf). Describe this panel using their names if they appear."*
## Cost per chapter
Each named panel costs an extra gemma4 call (the identity grounding). For a typical 40-page chapter with ~200 crops and maybe 8-15 named references, that's 8-15 extra vision calls — exactly as expensive as the main describe call since it loads the same model.
## Implement hints
- Add `work_dir/characters.json` as the persistent name→description store, created/reused per chapter
- Move the identity grounding call into a helper in pipeline_worker: `srv.identify(crop_path, name)`
- Inject names into `DESCRIBE_PROMPT` at runtime (f-string or str.replace) so known names propagate forward
- `pytesseract` is zero-model-load CPU, can run on homesrv or workpc — cheap enough to run on every crop
## Not built
No code exists for this. The pipeline currently has no ocr step, no identity store, and no dynamic prompt injection. The script prompt just gets whatever `scene_text` and `tone` the vision stage produces.