Spaces:
Running
Running
Commit History
-
Third-pass audit fixes: migration setdefaults, robust JS mark builderβ
ClaudeP1 β migrate_v1_to_v2 didn't setdefault the new learner-feature fields (summary, self_check_questions). Pydantic still supplied defaults on model_validate so no data was lost at load time, but the migration's raw-dict output was asymmetric β any consumer of the migrated dict pre-validation would see undefined keys for those two fields and not for the others. Adds the two setdefaults so the migration's contract stays "every SegmentMetadata field has a defined key after migration". P2 β JS highlightTerms built its <mark> open tag via template-string interpolation: `<mark class="kt" title="${escapeHtml(definition)}">`. The contemporaneous escapeHtml correctly entity-encodes quotes, so no XSS materialized β but the .replace() second argument treats $&, $', $`, $n as special replacement patterns. Any `$` surviving escapeHtml (it doesn't escape `$`) would get mangled in the output title. Switch to building the mark via document.createElement + setAttribute, then serializing with outerHTML tβ¦7562488
-
Live progress bar (web SSE + CLI rich) and rename images dir to 'static'β
ClaudePipeline progress ----------------- orchestrator.run_pipeline now accepts an optional ProgressCallback and emits ProgressEvent(percent, stage, message) at each major phase: scene_detect, filter, transcript, ocr (per-frame), render, done. Errors emit a final 'error' event so consumers always see a terminal state. Web UI ------ New POST /jobs spawns the pipeline in a background thread, returns {job_id, events_url, result_url} (HTTP 202). GET /events/{job_id} streams Server-Sent Events with progress payloads. GET /result/{job_id} hands back the prepared HTML or zip. The upload page (templates/index.html) now intercepts the form submit, hides the form, shows a <progress> element with stage chip + message, subscribes via EventSource, and on 'done' either navigates to the review HTML (review mode) or kicks off a download (single/zip). The original synchronous /process endpoint is kept for non-browser clients. CLI --- `vgm build` and `vgm export-metadata` now display a rich progress bar (β¦4b79268 -
Phase A: unified metadata schema + vgm CLIβ
ClaudeAdd a pydantic-backed PageMetadata schema (app/pipeline/metadata.py) with KeyTerm and MathEquation models, plus dump/load/migrate helpers. Existing browser-editor `.edits.json` is upgraded to schema v2 by migrate_v1_to_v2 β old saves still load. Extract the FastAPI handler body into a shared run_pipeline helper in app/pipeline/orchestrator.py so the same orchestration is reused by the new vgm CLI (typer-based). Subcommands: build, export-metadata, render-from-metadata; the last one re-renders HTML from the JSON exported by either the editor or the CLI. Segment now carries optional key_terms / math_equations / include fields and a new render_from_metadata function turns a PageMetadata back into renderable Segments. render_guide / render_review accept subtitle, module, mathjax, and mathjax_src so subsequent phases (math equations, key terms) just need template + UI work. Verified: all 30 pytest tests pass, including a round-trip test that runs the full pipeline on smaller.m4v + M14_L3β¦2636772