festifun/backend/tests
type-two 52e891204d M11: auto-director — top-N events -> beat-snapped camPath (backend + UI)
generate_path() fills the foundation2 stub with the deterministic v1 rules:
top-N events by confidence (ties -> earlier, then shot chronologically);
per event, the registered camera whose pose track is nearest the event
time; keyframes at t_event - lead_s (clamped >= 0) and t_event + duration;
nearest-beat snapping when beats.json exists (missing/corrupt file -> no
snapping); FOV = 2*atan(h/(2*fy)) like scene3d.snapTo. Every pose goes
through the frozen geometry.colmap_to_threejs and the camPath quaternion
is emitted in Three.js [x,y,z,w] order (pitfall #1 — locked by test).
Degradation: no events / no registered poses -> valid empty camPath with a
note; the response always round-trips through camPath.fromJSON.

frontend/src/director.js wires the pre-wired hidden 🎬 button: POST
/api/director, camPath.fromJSON(response), auto-play via the existing
#btn-path flow; empty path or fetch failure surfaces on the button and
recovers — never a crash.

Acceptance (test_director.py, 14 tests): structure-locked against the
frozen camPath shape (exact key sets, unit quats, monotone times);
top-3 grid == [1,4,8,11,14] incl. shared-keyframe dedupe; conversion
matches colmap_to_threejs + mat_to_quat exactly; snapping puts every key
on the beat grid; unregistered poses excluded; API route + CLI dispatch
real output. Suite 148 passed; frontend build clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 17:51:52 +10:00
..
conftest.py Foundation (M0 + M3 + frozen contracts): scaffold, synthetic fixtures, full API 2026-07-16 00:45:55 +10:00
test_api.py foundation2 (phase 5a): contracts, stubs, hooks & UI wiring for lanes E/F/G 2026-07-17 17:31:08 +10:00
test_audio_features.py M10: audio features — beats & onsets from the reference ingest WAV 2026-07-17 17:48:31 +10:00
test_audio_sync.py Sync solver: cache per-signal FFTs across the pairwise GCC-PHAT stage 2026-07-17 17:02:27 +10:00
test_capture.py Live capture: USB webcams, laptop cams, and phones -> data/raw 2026-07-17 15:43:51 +10:00
test_director.py M11: auto-director — top-N events -> beat-snapped camPath (backend + UI) 2026-07-17 17:51:52 +10:00
test_events_ai.py lane D (M7): audio moment detection + pluggable AI classification 2026-07-16 08:34:56 +10:00
test_geometry.py Lane B (M2 + M8 geometry): COLMAP reconstruction, geometry math, graceful degradation 2026-07-16 08:40:46 +10:00
test_ingest.py Lane A (M1): ingest + GCC-PHAT audio sync 2026-07-16 01:13:56 +10:00
test_phase5_api.py M10: audio features — beats & onsets from the reference ingest WAV 2026-07-17 17:48:31 +10:00
test_resolve.py Phase 4 polish: anchor supersede + delete, docs/ideas, field-test scaffolding 2026-07-16 12:15:35 +10:00
test_sfm.py Lane B (M2 + M8 geometry): COLMAP reconstruction, geometry math, graceful degradation 2026-07-16 08:40:46 +10:00
test_synthetic.py Foundation (M0 + M3 + frozen contracts): scaffold, synthetic fixtures, full API 2026-07-16 00:45:55 +10:00