Skip to content

Clock-safe dwell and richer diagram motion - #68

Merged
jmjava merged 3 commits into
mainfrom
cursor/scene-motion-dwell-base-75a9
Aug 15, 2026
Merged

Clock-safe dwell and richer diagram motion#68
jmjava merged 3 commits into
mainfrom
cursor/scene-motion-dwell-base-75a9

Conversation

@jmjava

@jmjava jmjava commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Why

Diagram timing was already fail-closed (wait_word, FadeIn clamp, issue #66), but compiled boards still looked thin: rounded boxes, center-to-center arrows, and a freeze during the long holds that subject-beat coverage wants. Adding raw Manim animations without a dwell slot would race _clock again.

We have also burned renders on stuck boards, overlapping stacks, and Pango font drift. Those need to fail before docgen manim, not after a long compose.

What

Motion base

  • Dwell budget in simulate_reveal_timeline: after each reveal, if the gap to the next wait_word is long enough, allocate a clamped Indicate (pulse) or Circumscribe (ring). Tight cascades still get zero dwell.
  • Box fields: shape (rounded | pill | diamond), reveal (fade | grow | slide), emphasis (none | pulse | ring). layout.dwell_emphasis: auto|none and layout.dwell_run_time.
  • Edges compile as mobject-to-mobject _arrow(...) (edge-to-edge). Legacy .get_center() calls still work.
  • refresh_bootstrap_helpers: scene-compile rewrites stale _box / _arrow / _TimedScene bodies when they lack shape, get_critical_point, not_past, or MANIM_FONT. Generated scene classes are left alone.
  • LLM prompt + hint describe the new fields so scene-spec-generate can use them without inventing labels.

Pre-render validation (scene_assets)

New check in docgen validate (hard fail in --pre-push) and a generate-all gate before Manim:

  • Stuck: reveal_cadence_violations + dwell-overshoot (fade+dwell cannot pass the next wait_word)
  • Overlap: re-run layout_budget_violations on the spec (frame stack / row width)
  • Font: every compiled Text() sets font=MANIM_FONT; lint fails if font= is missing; _box subtitles no longer drop below 14
  • Compile sync: scenes.py motion plan must match a fresh compile_scene_class (missing Indicate, center-arrows, absent class → fail with scene-compile --retime)
  • Helpers: stale _box / _arrow / _TimedScene / missing MANIM_FONT

Disable with validation.scene_assets.enabled: false if needed.

Consumers pick this up by bumping the docgen pin and re-running scene-spec-generate / scene-compile --retime. No hand-edits of generated YAML or marker blocks.

Tests

  • tests/test_scene_motion.py — dwell math, tight vs wide holds, compile emission
  • tests/test_scene_asset_validate.py — overshoot, motion plan, helper API, compile sync, layout-as-overlap, pre-push hard fail, pipeline-facing bundle preflight
  • Helper refresh + missing-font= lint cases

ruff check src/ tests/ clean; pytest tests/ 377 passed.

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 15, 2026 02:44
Add a dwell slot to the reveal timeline so long subject-beat holds can
play Indicate/Circumscribe without racing the next wait_word. Boxes may
declare shape, reveal, and emphasis; edges compile as mobject-to-mobject
connectors instead of center-to-center points.

Co-authored-by: jmjava <jmjava@gmail.com>
…lary

Upgrade _box (pill/diamond) and _arrow (edge-to-edge, still accepts
legacy points). scene-compile refreshes stale helper bodies in
scenes.py without touching generated classes. The scene-spec LLM
prompt and dogfood hint now describe shape, reveal, emphasis, and
clock-safe dwell.

Co-authored-by: jmjava <jmjava@gmail.com>
Add scene_assets so we fail before Manim when a spec would dump-and-freeze,
overflow the frame, use a machine-default Pango font, or when scenes.py is
stale vs compile. generate-all runs the same check as a preflight. Compiled
Text() now sets font=MANIM_FONT; helpers refresh if that constant is missing.

Co-authored-by: jmjava <jmjava@gmail.com>
@jmjava
jmjava marked this pull request as ready for review August 15, 2026 03:18
@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@jmjava
jmjava merged commit c99b11f into main Aug 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants