festifun/plan/status/foundation.md
m3ultra cf6a6fb2c8 Foundation (M0 + M3 + frozen contracts): scaffold, synthetic fixtures, full API
What now works:
- M0 scaffold: pyproject (all spec deps), uv/py3.12 env, `python -m festival4d`
  CLI registering synthetic|ingest|sync|reconstruct|events|serve. Vite hello page.
- Synthetic fixture (synthetic.py): 3 shifted-audio videos (offsets 0/+1370/-842 ms),
  camera-arc poses, stage point cloud -> points.ply, seeded events + anchors,
  ground_truth.json. `python -m festival4d synthetic` populates data/ + DB.
- DB schema exactly per spec §2 (db.py) + CRUD helpers all lanes use.
- M3 API (api.py) full against synthetic data: manifest/poses/pointcloud/anchors/
  events/detect/annotations; Range-capable video serving (206 verified); CORS for any
  localhost origin.
- Frozen geometry contract: geometry.colmap_to_threejs (M5 math) + unit test (3 known
  vectors, random round-trip, scipy oracle); mirrored frontend/src/lib/pose.js with
  identical POSE_TEST_VECTORS. Lane-B stubs: slerp_pose, ray_from_pixel, triangulate_rays,
  nearest_point_on_ray.
- Classifier contract (events_ai.py): MomentClassification model + MomentClassifier
  protocol + Gemini/Claude/Local provider stubs.
- Lane-owned modules stubbed with final signatures (ingest, audio_sync, frames, sfm,
  events_ai); cli/api catch NotImplementedError and degrade gracefully.
- plan/CHANGE_REQUESTS.md created; plan/status/foundation.md updated.

Acceptance: pytest 24 passed; serve endpoints verified via curl + browser (video seek,
manifest fetch cross-origin, pose.js self-test, 0 console errors).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 00:45:55 +10:00

2.5 KiB

Status — foundation

Round 0 — 2026-07-16 — STATUS: ready_to_merge

Directives acknowledged: round 0 of plan/DIRECTIVES.md (run foundation only; contracts correctness beats speed; lanes hard-depend on API shapes, schema, pose math, synthetic fixtures).

Acceptance checklist (plan/00-foundation.md + spec M0/M3) — all pass:

  • python -m festival4d synthetic → 3 fixture videos + populated DB + points.ply (3106 pts) + ground_truth.json. Evidence: CLI run logs "3 videos, 3106 points, 7 events, 4 anchors".
  • python -m festival4d serve → every M3 endpoint returns synthetic data; videos seekable. Evidence: curl of manifest/poses/anchors/events/pointcloud; curl -H "Range: bytes=0-100" /media/cam0.mp4206 with content-range; browser <video> seeked to 15s, seekable=[0,20], readyState 4.
  • pytest green — 24 passed (test_geometry, test_synthetic, test_api).
  • npm run dev serves the hello page; browser fetched /api/manifest cross-origin (CORS ok), pose.js self-test passed, 0 console errors. (Vite fell back to :5174 — an unrelated dev server holds :5173; CORS now allows any localhost port.)
  • All lane-owned modules stubbed with frozen signatures; cli.py registers all 6 subcommands (dispatch + graceful NotImplementedError → exit 2).
  • Frozen geometry contract: colmap_to_threejs + test_geometry.py (3 known vectors, random round-trip, scipy oracle) + mirrored frontend/src/lib/pose.js with identical POSE_TEST_VECTORS (node self-test passes).
  • Classifier contract: MomentClassification (Pydantic) + MomentClassifier (runtime Protocol) + Gemini/Claude/Local provider stubs.
  • plan/CHANGE_REQUESTS.md created.

Done this round: full M0 + M3 + all frozen contracts. Env: Python 3.12 venv via uv, all spec deps installed. DB schema per spec §2 with CRUD helpers. Timebase helpers in config.py. API is Range-capable and CORS-enabled. Frontend scaffolds every layout file (lane-C modules are stubs; lib/pose.js is the live frozen contract).

Frozen-contract note for lanes: CORS was widened from a single :5173 origin to any http://localhost|127.0.0.1:<port> (local single-user tool; robust to Vite port fallback). Explicit :5173 still included. If a lane needs a different API shape/schema/pose math, file a CR in plan/CHANGE_REQUESTS.md — do not edit db.py/api.py/cli.py/config.py/ synthetic.py/pyproject.toml.

Blockers / questions for coordinator: none.

Next: merge foundationmain; lanes may start (per directive: C, then A, D, B).