Skip to content

fix(mock): gate Animate behind MOCK_PROVIDERS — the last unmocked fal entry point#187

Merged
eren23 merged 2 commits into
mainfrom
fix/mock-animate-gate
Jul 21, 2026
Merged

fix(mock): gate Animate behind MOCK_PROVIDERS — the last unmocked fal entry point#187
eren23 merged 2 commits into
mainfrom
fix/mock-animate-gate

Conversation

@eren23

@eren23 eren23 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Finding #7 from the self-play ledger, same class as #184: animate_image had no mock.on() gate, so Animate on a mock stack billed a real ltx-video call.

  • mock.mock_video_data_url() — a real 1s 64×36 H.264 parchment clip (~1.7KB) generated once with ffmpeg and embedded, so the mock stack needs no video toolchain. Valid mp4 matters: the client hands it straight to <video src>.
  • Gate sits before the FAL_KEY check; test runs under the FAL_KEY-deleted fixture (regression re-raises) and asserts the ftyp magic.
  • With this, every fal entry point (generate, edit, continue, expand, zoomout, inpaint via llm seam, animate) is gated — audited by grep over _fal_subscribe callers.

Gates: ruff, mypy, pytest 86.35% ≥ 85 floor.

🤖 Generated with Claude Code

Finding #7 from the 2026-07-20 self-play ledger — the last ungated fal
entry point, same class as the expand hole (#184): an Animate click on
a MOCK_PROVIDERS stack billed a real ltx-video call.

mock.py gains mock_video_data_url(): a real 1-second 64x36 H.264
parchment clip (~1.7KB, generated once with ffmpeg, embedded base64) so
the mock stack needs no video toolchain. A VALID mp4 matters because
the client hands the URL straight to <video src> — a fake payload would
render as a broken player and read as a product bug.

animate_image returns it before the FAL_KEY check; the test runs under
the suite's FAL_KEY-deleted fixture so a regression re-raises loudly,
and asserts the ftyp magic to prove the payload is a real mp4.
@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

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.

… paid

Audit follow-up to the animate gate: grep over _fal_subscribe callers
found one more reachable-from-live path — generate.py's extraction
refinement calls segment(), and SEGMENTER_PROVIDER=sam3_fal makes that
one paid fal call PER LABEL with no gate. Default ("vlm") was already
safe via the mocked llm seam; now the flag flip is too. Test spies
_segment_sam3 and asserts it never runs under mock.
@eren23
eren23 merged commit 25f5435 into main Jul 21, 2026
9 checks passed
@eren23
eren23 deleted the fix/mock-animate-gate branch July 21, 2026 11:42
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.

1 participant