Stu Mason · Folkestone, Kent
One entryMerged PR· crunch.stumason.dev· PHP

PR #31 merged: Roll pack cruncher v1: POST /pack -> joined crunch.json

additions
+1396
deletions
-1
files changed
22

Builds the pack processor (POST /pack) so a recorded roll take can be crunched into the lean, queryable crunch.json an editing agent reads — the join of event × on-screen-text × words-said on the take's shared clock.

Slices (each tested)

  1. Ingest + clock math — parse manifest.json + metadata.jsonl into typed DTOs pinned to the real capture-swift v0.0.14 shape; per-source seek math (screen at t0, mic/camera shifted by their sync offsets).
  2. Frame sampling + ffmpeg — sample at interactions + a coarse baseline (not dense), extract downscaled frames from screen.mp4.
  3. Join + moments + lean crunch.json — ax.label-first event join, transcript windows, on-screen-text deduped into time-spans, cheap moments (click_on/app_switch). No embeddings, no cursor rows, no cut decisions.
  4. Async endpoint — Controller→Job→Action (mirrors /ocr/batch): upload a take archive, poll /jobs/{id} for the crunch.json.

Scope (roll-mac-reviewed v1)

IN: screen OCR (tesseract) × transcript × event join + moments. OUT (Phase 2): embeddings/CLIP/RAG, camera/MediaPipe signals, box-level OCR.

Validated on a real pack fixture (rec-1782821238979 — it even captured clicks on roll's own Rec/Stop buttons via their ax labels). 16 pack/roll tests + full suite (104) green; phpstan level 7 clean.