Commit graph

346 commits

Author SHA1 Message Date
juancarlos.cavero
2900047b78 feat(legal): full legal corpus — Terms, Privacy, Legal Notice in EN+ES
Replaces the single thin Terms & Privacy SPA view with six indexed static
pages (/terms /privacy /legal-notice + /terminos /privacidad /aviso-legal)
built like the SEO pages, in the sitemap and llms.txt but out of the
marketing interlinking ring. The #legal SPA route becomes a hub linking to
them, so the text lives in exactly one place. Footer and the rights-
attestation checkbox now link to the real documents.

Drafted from a clause inventory of OpusClip/Klap/Vizard/Submagic legals
plus a 2026 Spanish/EU compliance review. Notable substance:
- LSSI art. 10 identity (TONVI TECH SL, Málaga) — was missing entirely.
- Rights warranty covers URL-instructed downloads explicitly and declares
  the attestation record (IP+UA+date) as evidence; DSA arts. 11-17
  notice-and-action with repeat-infringer policy.
- Explicit output ownership (clips are the user's; free-tier watermark as
  a written licence condition) and a no-AI-training commitment naming
  Gemini/ElevenLabs/Whisper — clauses none of the competitors have.
- EU withdrawal per CJEU C-234/25: SaaS is a digital service, the 14-day
  right survives with pro-rata payment (not the digital-content forfeit
  the old page used); renewals do not reopen it. 15-day renewal reminder
  duty (Ley 10/2025) stated.
- AI Act art. 50: dubbed clips declared as labelled/marked; users must
  not strip marks.
- Privacy: per-purpose legal bases, named processors, DPF+SCC transfers,
  real retention (7-day free clips, sub+7 days paid — matching
  cloud/config.py), AEPD analytics exemption documented, no cookie
  banner rationale.
- Spanish versions with prevalence clause (art. 60.1 TRLGDCU; AEPD has
  fined foreign-language-only policies). renderPage supports page.lang.
2026-08-19 22:06:11 +02:00
Tulio Vianna
83c45916a2 feat(editor): rebuild the clip editor around a source monitor and a working timeline
Turns the clip editor into a three-point editing surface: mark in/out on
the source, send the range to the clip, and scrub the result — with the
timeline honest about which parts of the edit the last render can already
show.

- Chrome: the source track ignored drags entirely. Without preventDefault
  the gesture became a text selection and then a native drag, which
  swallows every later pointer event and shows the not-allowed cursor.
- The source track's block is draggable (body moves, edges trim) and every
  gesture on it scrubs the source monitor, so a cut is chosen against the
  picture rather than against numbers.
- Three-point editing: mark in / mark out (i / o) off the monitor's
  playhead, then "replace #N" (.) or "insert after #N" (,). Dragging empty
  track marks a range instead of silently appending a segment.
- /edl ships the whole source transcript instead of a ±45s window: a cut
  can only be extended into words the editor was sent. The panel shows all
  of it, follows playback, and seeks the monitor on click.
- Layout: source monitor + its track + transcript | clip preview + its
  track | controls. Each track sits under the video it drives.
- The clip timeline works while edited. A cut that only removes material
  keeps nothing but frames the last render already produced, so it stays
  scrubbable and playable; only material the render never saw is marked
  red, and the playhead — now a solid handle — stops at its edge.

Transcript words render in memoised 50-word slices: repainting a couple of
thousand of them costs ~66ms, and timeupdate fires four times a second.
2026-08-19 15:23:30 -03:00
juancarlos.cavero
dfa31241ca feat(download): flat-rate static ISP proxies before the per-GB proxy
New STATIC_PROXY_URLS env (comma-separated): dedicated ISP IPs with
unlimited traffic, tried after the direct attempt and before the per-GB
paid proxy. With it unset the chain is byte-identical to before.

- plan_download_attempts: pure, unit-tested attempt ordering. Cheapest
  bandwidth first: direct -> statics (rotated per job, uncapped 1080p,
  free bytes) -> paid HD (720p cost cap) -> fallback via paid.
- The 720p cap and the PROXY_BYTES monthly counter now apply ONLY to
  attempts that actually bill per GB — static downloads come in at 1080p
  and don't count toward the cost alert.
- alerts.py watcher generalized to multiple targets: the static pool
  (down = ingest silently moves to per-GB billing, nag with a cost hint)
  and the paid proxy (down = ingest at risk), each with its own
  down/nag/recovered incident state.

Context: the server's IPv4 is hard-banned by YouTube (19-aug-2026), so
DIRECT_FIRST serves nothing and every download was going through
DataImpulse at $1/GB capped to 720p. Verified from prod: all 3 Decodo
dedicated IPs pass the bot-check with cookies+bgutil at 1080p.
2026-08-19 19:28:52 +02:00
juancarlos.cavero
72288bba82 fix(alerts): probe the proxy over plain HTTP
HTTPS through DataImpulse fails in httpx with an SSL record-layer error
even when the proxy is healthy (verified against a working proxy right
after the top-up; yt-dlp's stack tunnels the same proxy fine), so an
HTTPS probe would report a permanent false outage. An exhausted balance
rejects the request at the proxy before forwarding, so plain HTTP still
catches the 407.
2026-08-19 17:11:10 +02:00
juancarlos.cavero
5e84e6486a feat(alerts): proxy balance watcher — nag on Telegram until topped up
The residential proxy ran out of traffic (407 TRAFFIC_EXHAUSTED,
19-aug-2026) and every YouTube-URL job failed with only easy-to-miss
one-shot alerts. Now:

- cloud/alerts.py: a background watcher probes the proxy every 30 min
  (generate_204, a few bytes of paid traffic). On failure it alerts
  immediately, re-alerts every 2 h while the proxy stays down, and sends
  a recovery confirmation when it answers again — so exhaustion is caught
  even before the next user job fails.
- record_job_outcome: a proxy-classified job failure also opens the
  incident, so job-driven detection and the probe share one state.
- app.py: the watcher starts from the lifespan in managed mode.
- tests/test_proxy_watch.py: state machine (first alert, renotify window,
  recovery + reset, job-error trigger).
2026-08-19 17:07:09 +02:00
juancarlos.cavero
f8535b2584 test(hook): styles contract, bitmap-emoji scaling, layer walk-back
- test_hooks.py: the 6-style contract the frontend mirrors (boxed vs
  outline), fixed-bitmap emoji rescaling (_emoji_scale/_measure_width),
  and create_hook_image rendering every style (emoji included) with the
  unknown-style fallback.
- test_hook_layers.py: _strip_burned_hook walk-back (hooked_/legacy hook_,
  missing-file stop), the two-step subtitled->hooked->clean strip /api/hook
  replaces through, and _canonical_clip_file resolving hook chains with
  newest-derivation-wins.
2026-08-19 16:22:38 +02:00
juancarlos.cavero
2b2e287a9b feat(hook): replace semantics — a new hook swaps the burned one, plus remove
The auto-hook was burned into the canonical clip in place, so editing the
hook stacked a second overlay on top of the first. Hooks now follow the
exact derivation pattern captions use:

- main.py: auto_hook_clip writes hooked_<ts>_<clean>.mp4 next to the clean
  canonical instead of mutating it; captions burn on top of the hooked file
  (subtitled_<ts>_hooked_<ts>_<clean>). Watermark moves BEFORE the hook so
  the branding lives in the canonical and survives hook replacement.
- app.py: _strip_burned_hook walks hooked_/legacy hook_ prefixes back like
  _strip_burned_captions; /api/hook strips captions AND the old hook before
  burning, so a new hook always REPLACES the previous one. New remove flag
  strips the hook entirely (captions re-applied, no metering). Burned hook
  recorded/cleared in clip metadata (auto_hook key) and returned as
  burned_hook. _canonical_clip_file resolves hooked_*/hook_* derivations.
- cloud/videos.py: archive the hooked_ intermediate of a captioned hook so
  restored projects keep the walk-back chain editable.
- ResultCard: stripBurns knows hooked_<ts>_ (the Remotion preview now
  composes over the truly clean clip — no more stacked preview), burned
  hook tracked in state, remove handler wired to the modal.
- HookModal: warning now says replace, plus a 'remove hook from clip'
  action when one is burned.
2026-08-19 16:01:53 +02:00
juancarlos.cavero
ac0138269d feat(hook): auto-burn AI hooks on generated clips + working emoji + editor polish
Auto-hook (opt-in per job, dashboard default ON):
- /api/process accepts auto_hook + auto_hook_style; absent means off, so
  API/MCP/webhook callers keep byte-identical output.
- main.py auto_hook_clip burns each clip's viral_hook_text (Gemini already
  produced it, it was only used to pre-fill the modal) into the canonical
  clip in place — after reframe, under watermark and captions — so every
  derived-name convention (subtitled_/recut_ walk-backs, R2 archive,
  restore) keeps working untouched. Fail-open like auto_caption_clip.
- Burned hook recorded as clip.auto_hook in metadata; the hook modal warns
  before stacking a second one.
- MediaInput: 'auto hook titles' toggle + style select in advanced options,
  persisted in localStorage.

Emoji that actually render:
- Gemini prompt now asks for 1-2 emojis in viral_hook_text.
- Dockerfile installs fonts-noto-color-emoji — without it prod silently
  stripped every emoji (no candidate font existed in the image).
- hooks.py supports fixed-bitmap color fonts (NotoColorEmoji only loads at
  its 109px strike; Apple Color Emoji at 160): glyphs render at native size
  and are Lanczos-rescaled to the text size instead of being treated as
  unavailable. macOS system font added for local dev.

Editor polish:
- HookModal persists last style/position/size/entrance (always reset to
  classic before, which read as the picker being broken).
- Remotion preview positions aligned to hooks.py (top 20%, bottom 70%).
- Warning when a bottom hook will overlap burned/preview captions.
- Entrance-animation control greyed out with a note when the clip
  re-renders on the server, where the hook is static.
2026-08-19 14:28:19 +02:00
juancarlos.cavero
8dbc6ce9bd fix(hook): Remotion overlay ignored the style picker, always rendered classic
d94e126 added the 6 hook styles to hooks.py (server FFmpeg path) and to the
HookModal picker, but never to the Remotion composition — which is what
renders both the modal preview and the final clip on the primary in-browser
render path. Picking dark/yellow/red/outline still produced the white
classic card.

- HookOverlay.tsx: HOOK_LOOKS map mirroring hooks.py HOOK_STYLES (box color,
  text color, outline stroke, shadow), applied via config.style.
- types.ts: HookStyle type on HookConfig and hookConfigSchema (default
  "classic" so older payloads keep validating).
2026-08-19 14:12:10 +02:00
mutonby
3e8798f271
Merge pull request #70 from tuliovianna-lab/pr/manual-reframing
feat: manual reframing, per scene
2026-08-19 12:57:03 +01:00
juancarlos.cavero
602f87674b fix(recut): virtual_transcript must keep Whisper's word-boundary spaces
transcript_words() strips each word, so the remapped transcript handed to
the caption generators lost the leading-space convention the block
collector uses as its word-boundary signal — every recut/reframe with
re-applied captions burned the whole line glued together
("...creesycambiatodo"). Latent since the clip-editor merge; surfaced by
the first caption burn over a recut with real words.
2026-08-19 12:22:39 +02:00
juancarlos.cavero
03da5651c0 fix(recut): virtual_transcript must keep Whisper's word-boundary spaces
transcript_words() strips each word, so the remapped transcript handed to
the caption generators lost the leading-space convention the block
collector uses as its word-boundary signal — every recut/reframe with
re-applied captions burned the whole line glued together
("...creesycambiatodo"). Latent since the clip-editor merge; surfaced by
the first caption burn over a recut with real words.
2026-08-19 12:22:39 +02:00
juancarlos.cavero
0d9e04f333 fix(reframe): harden PR #70's manual reframing after review
- Meter the re-render: /api/clip/reframe now reserves/commits/releases
  minutes exactly like a source-path /rerender — it is the same GPU work,
  and it was free and uncapped.
- Re-apply captions by default (reapply_captions param to opt out): every
  default clip ships with burned captions, and the reframe silently
  returned caption-less files.
- Read metadata.json INSIDE the per-job lock (same _reframe_locked shape
  as /rerender): the read-outside/write-inside window let a concurrent
  rerender's recipe get clobbered by a stale write.
- Interplay with whole-clip framing: recipe.framing keeps forcing its
  layout on the scenes the user did not hand-position (apply_crop_overrides
  runs after force_strategy, so per-scene wins where named), and the
  recipe is preserved through the reframe instead of being rebuilt bare.
- /rerender clears stale crop_overrides: scene indices only mean anything
  against the cut they were made for, and the trim render does not apply
  them — leaving them made /scenes reopen showing overrides that would
  land on the wrong shots.
- /scenes: entitlement-gated (it cuts, scene-detects and encodes on every
  open), serialized per job (stable output names tore under concurrent
  opens), 400 on horizontal jobs, real aspect for square jobs, temp_
  prefix on preview/thumbnails (kept out of the self-host S3 backup),
  faststart + timeout on the preview encode.
- Tests for all of it plus the apply_crop_overrides math the PR described
  but did not include (12 new, suite at 502).
2026-08-19 12:09:02 +02:00
juancarlos.cavero
0bfe27561d Merge PR #70 (manual per-scene reframing) onto current main
Conflicts were the parallel override parameters: render_clip /
process_video_to_vertical / reframe_v2.render / perform_recut now carry
BOTH force_strategy (whole-clip framing, main) and crop_overrides
(per-scene manual framing, PR #70). The v1-fallback safety net now also
raises for force_strategy, which had the same silent-revert hole the PR
fixed for crop_overrides.
2026-08-19 12:01:02 +02:00
juancarlos.cavero
3cff7e8cd6 fix(editor): explain why cuts are limited when the source is gone
Addresses the UX half of #67: with no retained source the editor clamps
cuts to the original clip range but never said why, reading as a bug. A
note in the segments panel now names the reason and that newly processed
videos keep their source.
2026-08-19 10:50:22 +02:00
juancarlos.cavero
3790c65851 fix(subtitles): honor user-edited caption text on the server render path
Fixes #69. The subtitle modal lets the user edit the caption text, but the
edits only traveled through the in-browser Remotion path; the FFmpeg path
(taken by every karaoke style and by any clip with server burns, i.e. all
clips with default captions) sent style params only, so the server
regenerated from the stored transcript and silently discarded the edits.

/api/subtitle now accepts an optional 'words' list (clip-relative ms, the
same shape the /transcript endpoint serves) and builds a synthetic
transcript from it, so both the SRT and karaoke ASS generators burn the
edited words verbatim. Words get Whisper's leading-space convention so the
block collector keeps their boundaries. The modal sends them only when the
text actually differs, and never on bulk apply-to-all (edits are per-clip).

Verified live: an edited 5-word line burned exactly as typed, correctly
grouped into blocks.
2026-08-19 10:50:22 +02:00
Tulio Vianna
b92012d824 feat: manual reframing, per scene
The reframe engine picks the crop automatically and is right most of the
time. When it is wrong it is badly wrong, and there was no way to say
"no, frame it here".

The unit is the SCENE, not the clip. A podcast cuts between a fixed close
camera and a fixed wide one, and the right crop differs per camera; scene
boundaries already are those camera changes. Scenes the user never touches
keep the automatic camera, so correcting one bad shot cannot spoil the
shots the tracker got right.

Backend:
- reframe_v2.apply_crop_overrides() replaces a scene's slice of the camera
  trajectory with a constant and forces it to TRACK, so a scene the
  classifier had sent to GENERAL comes back to a vertical crop. It runs
  after every automatic pass, including the ALTERNATE writes, so a manual
  choice always wins.
- A scene can also be split by hand: the override writes straight into
  `splits`, which means the user can stack a scene the detector never
  proposed, with no dependency on SPLIT_LAYOUT being enabled.
- GET /api/clip/{job}/{i}/scenes returns the scenes with a frame from the
  UNCROPPED cut plus a light preview with audio, and suggests a centre from
  the largest face in each shot.
- POST /api/clip/reframe re-renders with the clip's cut untouched. It is
  deliberately separate from /api/clip/rerender: a scene index only means
  something against a given cut, so letting framing ride along with a trim
  save would move every override onto the wrong shot.
- render_clip raises instead of falling back to the v1 engine when manual
  framing is present, since v1 ignores it and would silently return an
  automatically framed clip.

Frontend:
- ReframeEditor lists the scenes, each with the source frame, a draggable
  9:16 window, and a play button that plays that scene from the preview so
  the user can hear who is talking before choosing.
- Saved overrides are loaded when the editor reopens. Without that the next
  save would discard every earlier adjustment, because a re-render rebuilds
  from source using only what it receives.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 22:33:52 -03:00
juancarlos.cavero
9c220efddb feat(editor): manual framing override (auto / full frame / track subject)
The scene classifier only counts faces, so a screencast-style video with a
presenter in frame gets TRACK and the crop eats the slide (the SCREENCAST/
WIDE detectors sit behind the opt-in layouts=auto flag). The clip editor now
has a framing selector that pins every scene's layout: 'full' renders the
whole source frame (WIDE: no side-crop, blurred bands), 'track' forces the
subject-tracking crop, 'auto' returns to the classifier.

Plumbed as force_strategy through reframe_v2.render -> render_clip ->
perform_recut -> /api/clip/rerender (and the recut_clip MCP tool). A
non-auto choice always re-reframes from the retained source (409 without
it) and persists in the clip's recipe, so later plain trims inherit the
look instead of silently reverting; an explicit 'auto' resets it.

Verified live: framing=full on a TRACK-cropped clip re-rendered with the
full frame visible edge to edge (125s source path), and the editor reopens
with the persisted choice preselected.
2026-08-19 01:06:48 +02:00
juancarlos.cavero
4611ca119b fix(generate): scale scoring windows with the requested clip band
The detail prompt keeps clips inside their candidate window, so the default
90s scoring windows silently capped user-requested long clips (a 60-90s band
barely fit, anything above did not). Windows now grow to 1.5x the requested
max length; the default band keeps the exact old behavior.
2026-08-18 19:41:15 +02:00
juancarlos.cavero
100fa583a1 Merge feat/clip-editor: per-clip EDL editor + manual generation controls (PR #62, discussion #65) 2026-08-18 19:27:49 +02:00
juancarlos.cavero
b81125c572 feat(generate): manual clip count and duration controls (discussion #65)
/api/process (and the process_video MCP tool) now accept optional
target_clips (1-15) and clip_min_seconds / clip_max_seconds (5-180),
surfaced in the dashboard as a collapsed 'advanced options' section.
Blank means the AI decides, keeping the default request byte-identical.

Plumbed through the same env overrides the A/B harness already reads:
CLIP_TARGET_MIN/MAX (existing) and a new clip_duration_bounds() in
clip_selection.py backing CLIP_MIN_SECONDS/MAX_SECONDS. The detail and
visual prompts take the band as template placeholders instead of the
hardcoded 15-60, and word-snapping enforces the same bounds. All three
knobs are honest targets, not guarantees: the model still returns fewer
clips when the material doesn't hold them, and the UI copy says so.

Verified live: target_clips=2 + band 8-15s on the demo video returned
exactly 2 clips of 13.3s and 13.7s (the uncontrolled run gave one 41.7s
clip); out-of-range values 400 with a named reason.
2026-08-18 19:21:42 +02:00
juancarlos.cavero
d1bf36c666 fix(dashboard): recut duration display and stale durable URL
- A recut clip's start/end are the covering source range, so end - start
  showed a 20s two-segment clip as minutes long; duration now sums the
  recipe segments when present.
- Drop the clip's durable R2 URL after a rerender: archive_clip_edit
  deletes the superseded object, so the stale URL would 404 as the
  playback fallback.
2026-08-18 15:26:45 +02:00
juancarlos.cavero
a0e25828fd fix(cloud): archive clean canonical clips so restored projects stay editable
The clip editor's fast path (and /api/subtitle re-styles) cut from the
clean canonical file, but archive_job only uploaded the served derivative,
so every project restored from R2 after a redeploy 409'd on rerender even
for in-range segments. Archive the clean canonical alongside the served
file; restore already downloads everything under the job prefix. The
free-retention purge now deletes the whole job prefix so these extra keys
(and previously leaked derivatives) can't become orphans.
2026-08-18 15:26:45 +02:00
juancarlos.cavero
e381d21b54 fix(editor): serialize rerenders per job and re-validate after snapping
- Per-job asyncio lock around /api/clip/rerender (same pattern as
  _restore_locks): concurrent saves raced on the metadata.json
  read-modify-write, with the last writer silently reverting the other
  clip's recipe and video_url.
- Re-run normalize_segments after snap_to_words + clamp: a segment fully
  outside the canonical range used to clamp to an inverted (end < start)
  window that passed within_range and died in ffmpeg as a 500; it is now a
  clean 400.
2026-08-18 15:26:45 +02:00
juancarlos.cavero
18654eabf6 fix(editor): harden the recut engine
- Add METADATA_SCRUB + '-movflags +faststart' to the cut and concat
  commands: a fast-path recut IS the delivered file, and without a fronted
  moov atom the browser preview hangs (same invariant as every other
  final-artifact producer in the repo).
- Unique per-invocation temp names (uuid token) for part/list files and a
  uuid suffix on the output name: two concurrent recuts in one job dir no
  longer overwrite or delete each other's intermediates, and same-second
  saves of one clip no longer collide on the output filename.
- 1800s timeout on ffmpeg runs (matching apply_watermark) so a hung render
  can't pin an executor thread and its quota reservation until restart.
2026-08-18 15:26:44 +02:00
juancarlos.cavero
5b4f5b2891 fix(digest): harden daily digest after code review
- Retry the 06:00 send in place (6x / 5 min) instead of silently skipping
  the day when a DB blip or Telegram outage lands on the send minute; the
  digest path now uses send_telegram(raise_errors=True) so failures are
  visible to that retry, and send_telegram checks the HTTP status.
- Filter Stripe lines by processed_at, not the Stripe-side created stamp
  that survives delivery retries and could land inside an already-digested
  window.
- Drop invoice.payment_succeeded (near-alias of invoice.paid; counting both
  double-reports payments) and the Subscription.created_at count (upserts
  hide re-subscribing churned users) — customer.subscription.created events
  cover new subs correctly.
- Keep a strong reference to the digest task so it can't be GC'd mid-sleep.
2026-08-18 14:53:31 +02:00
juancarlos.cavero
9a4439af48 feat(alerts): daily Telegram ops digest
One message per day at 06:00 UTC with signups, processing activity (users,
jobs, minutes, refunds), clips created, new subscriptions and notable Stripe
events, all computed from the DB at send time so redeploys lose nothing.
Replaces the per-event free-tier pings removed in the previous commit.
2026-08-18 14:40:55 +02:00
juancarlos.cavero
cf08a9671b chore(alerts): drop free-tier 'First clips!' Telegram notifications
Every new free user's first job fired a Telegram message, which at current
signup volume is pure noise. Clip-activity notifications now fire only for
paid users' jobs; the activation signal lives in analytics, not the ops chat.
2026-08-18 14:32:24 +02:00
juancarlos.cavero
e4331467e5 fix(auth): harden MX verification after code review
Review findings on the MX-gate commit, addressed:

- Rate limits now run BEFORE the DNS work, and the attempt row is
  inserted before the MX gate, so rejected junk-domain floods count
  toward both limits instead of getting unlimited free DNS lookups.
- Existing accounts bypass the MX gate: it protects sign-up only, so a
  domain whose MX later matches the disposable list can't lock an owner
  out of their account.
- RFC 5321 implicit MX now also checks AAAA (IPv6-only mail domains
  were falsely rejected).
- Error-derived verdicts cache for 60s instead of 1h: a transient
  NXDOMAIN no longer pins a lockout, a resolver blip no longer
  whitelists a domain for an hour.
- One shared resolver with an LRU record cache (was: new resolver +
  resolv.conf read per lookup); verdict cache evicts FIFO instead of
  full clear.
- MX blocklist moved to disposable_mx.txt, same loader and ops workflow
  as disposable_domains.txt (the two lists were already drifting).
- Both rate-limit counts merged into one FILTER query; distinct 429
  message for the per-IP limit (shared-NAT lockouts diagnosable).
- Index on (request_ip, created_at) + 30-day token purge in the
  retention sweeper. NOTE: schema is create_all-only, prod needs:
  CREATE INDEX IF NOT EXISTS ix_magic_ip_created
    ON magic_link_tokens (request_ip, created_at);
2026-08-13 10:07:20 +02:00
juancarlos.cavero
a76decd56f feat(auth): verify email domain MX before sending magic links
Bot sign-ups with rotating temp-mail domains (onldm.net -> 10minutemail's
SMTP) and nonexistent addresses were bouncing every magic link back into
the support inbox and hurting sender reputation.

- email_policy.mx_verdict(): resolve the domain's MX (A fallback per RFC
  5321) and reject when nothing can receive mail or when the MX target
  belongs to known disposable-mail infrastructure - catches the rotating
  front domains the static blocklist can't keep up with. Cached per
  domain, fails open on resolver trouble.
- auth: per-IP rate limit on magic-link requests (bots rotate addresses,
  not IPs).
- blocklist: add onldm.net; pin dnspython (already transitive via
  email-validator).
2026-08-13 01:03:05 +02:00
juancarlos.cavero
ab86e41846 feat(skills): cross-agent metadata for the Agent Skills ecosystems
The skill already follows the open standard; this adds the OpenClaw
block (emoji, primaryEnv) and the Hermes block (category, tags) plus
version and homepage, all ignored by agents that don't read them.
README gains the per-agent install commands: copy for Claude Code,
GitHub-direct for Hermes, ClawHub for OpenClaw.
2026-08-06 09:34:07 +02:00
juancarlos.cavero
46c61e407b feat(mcp): list_clips renders as an MCP App clip picker in UI-capable clients
New mcp_ui module holds the template: preview each 9:16 clip inline,
select the keepers and publish them via publish_clip from inside the
conversation. One template, three data paths, because the ecosystem has
not converged: baked-in JSON on the per-call embedded resource, the
ChatGPT Apps window.openai bridge, and the MCP Apps ready/render-data
postMessage handshake. Titles are JSON-escaped so a clip name cannot
break out of the script tag, and the template is fully inline because
host CSPs block external fetches.

The server grows resources/list, resources/read and the resources
capability; list_clips declares the template under both _meta.ui
.resourceUri and openai/outputTemplate. Non-UI clients see the same
text and structured content as before; the extra content entry is
spec-tolerated. The unknown-method protocol test moves off
resources/list, which is now a real method.
2026-08-05 23:59:02 +02:00
juancarlos.cavero
40f530f9aa feat(landing): surface the CLI wherever the agent surface is described
Feature card, FAQ answer, crawler fallback, /mcp and the automation
page all name pip install openshorts alongside MCP and the REST API.
2026-08-05 15:04:39 +02:00
juancarlos.cavero
78deea2b15 feat(agents): zero-dependency CLI and agent skill over the same API
pip install openshorts / uvx openshorts: process, status --watch, clips,
quota and publish, all against the REST surface the dashboard and MCP
already use, so nothing can drift. Auth and target via env vars; the
self-hosted case is the same binary pointed at localhost with no key.

skills/openshorts/SKILL.md teaches skill-capable agents the async loop
(quota, submit, signed webhook, publish) including the self-host 401/404
convention and the rights acknowledgement. The skills/ ignore narrows to
third-party installs so the published skill is versioned. README wires
up CLI, skill and the n8n example under the automation section.
2026-08-05 14:52:44 +02:00
victorcavero14
b884131639 feat(editor): clip editor frontend — ClipEditor overlay wired into results
- ClipEditor.jsx: per-clip edit overlay driving the /edl + /rerender backend
- App.jsx: editingClip state, handleClipRerendered syncs results, reopened
  project state and per-clip edit state after a recut (burned layers reset)
- ResultCard.jsx: "edit clip" entry button (Scissors), layout tweak
- recut.py: write absolute paths in the concat list — the demuxer resolves
  relative entries against the list file's dir, not the process cwd

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 12:03:15 +02:00
victorcavero14
d9b15b4328 feat(editor): per-clip EDL backend — recut engine, /edl + /rerender endpoints, MCP tool
Every clip now exposes its recipe (which source segments it was cut from)
via GET /api/clip/{job}/{i}/edl, and POST /api/clip/rerender re-renders it
from an edited segment list: fast path recuts from the already-reframed
canonical file, source path re-reframes from the retained source
(--keep-original now passed for URL jobs). Captions/subtitles/transcript
remap piecewise through recut.virtual_transcript for multi-segment clips.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 11:03:15 +02:00
juancarlos.cavero
d566b1a9b7 docs(examples): importable n8n workflow for the API + webhook loop
Form in, signed webhook out, one item per finished clip. The existing
community template (203 views) wires Whisper and Gemini directly and
never calls the OpenShorts API; this is the version worth publishing on
creators.n8n.io, kept in-repo so the template and the API cannot drift.
2026-08-04 18:58:47 +02:00
juancarlos.cavero
9f3bedecde feat(seo): five demand-backed pages + honest agent-access comparison on /mcp
New static pages, each re-housing demand GSC already shows landing on the
homepage: no-watermark clip generator (the AI-answer gap: unwatermarked
free clipping only exists self-hosted), open-source AI video generator
(splits the text-to-video intent honestly), podcast-to-shorts (the SPLIT
layout as the capability no competitor page can show), YouTube-to-Shorts
converter (link import is free here, paid at Opus Clip), and an
automation recipe page (API + signed webhooks + n8n shape).

/mcp gains a checked comparison table: Opus Clip shipped MCP in July
2026, so the claim that survives is flat-minute billing and self-hosted
agent access with no meter, not MCP existence. All competitor claims
carry checked dates.
2026-08-04 17:58:25 +02:00
juancarlos.cavero
4c94c29964 feat(seo): close the internal-link gaps around the static cluster
The rendered React landing had zero links to the static SEO pages, so
Googlebot's rendered homepage dropped the whole cluster; the static
pages' nav and footer missed /mcp and the /alternatives hub; and the
crawler fallback missed both too. Every surface now links the full set
with descriptive anchors.
2026-08-04 14:19:28 +02:00
juancarlos.cavero
cc8fa54ffa feat(pricing): MCP + API access named where buyers compare plans
A bullet on every plan card, the always-on framing in 'included in
every plan', and a billing FAQ answering the question that actually
blocks a purchase: API calls draw from the same minutes, nothing extra
to buy, free plan included.
2026-08-04 00:24:50 +02:00
juancarlos.cavero
626d4b1917 fix(test): pin a dummy Gemini key so the webhook SSRF test runs the SSRF branch in CI 2026-08-04 00:09:03 +02:00
juancarlos.cavero
c200cf787c fix(ci): collect every test again — gate-first imports + the deps tests actually need
CI has been red since the July layout work: the workflow installed five
light packages while the suite grew tests importing numpy, and the MCP
endpoint tests added fastapi on top. Two fixes:

- panel_layout/screencast_layout imported main (torch, mediapipe) BEFORE
  their ENABLED gate, so even the disabled path paid the heavy import.
  Move the import below the gate: the default path now imports nothing,
  which is what the gate was for.
- The workflow installs exactly what the collected tests import at
  module level, still excluding the ML stack the lazy imports protect.
  List validated against a clean venv: 382 passed, 3 skipped, 0 import
  errors.
2026-08-04 00:07:29 +02:00
juancarlos.cavero
7eab5649a6 feat(landing): surface the agent API as a hosted-first benefit
The MCP server existed everywhere except the one page most visitors
see. Feature card + FAQ on the landing (mirrored in the SEO fallback,
which must stay in sync with Landing.jsx), and a new row in the README
edition table framing it honestly: both editions serve /mcp, but an
agent needs an endpoint that is always on, and only the hosted one is.
2026-08-04 00:02:16 +02:00
juancarlos.cavero
7d0b243545 chore(mcp): registry caps description at 100 chars 2026-08-03 23:53:34 +02:00
juancarlos.cavero
f10e5ba65a chore(mcp): server.json for the official MCP registry
Describes the remote server (io.github.mutonby/openshorts namespace,
streamable-http at mcp.openshorts.app/mcp, Bearer key header) so
mcp-publisher can publish and republish from the repo root.
2026-08-03 23:36:04 +02:00
juancarlos.cavero
a69f595aa7 feat(seo): /mcp page — the agent surface as citable content
The MCP server documents itself over the protocol, but nothing on the
site existed for a human or an answer engine to cite when asked 'how do
I automate shorts with Claude/ChatGPT'. One page in the established
shape (TL;DR, one question per H2, FAQ schema): connect command, the
six tools, REST + webhooks, self-host parity, and pricing stated next
to every 'free'. Lands in sitemap.xml and llms.txt automatically via
the shared page list.
2026-08-03 23:22:57 +02:00
juancarlos.cavero
8a6ad06c8c fix(subtitles): name the filter option so ffmpeg 8 can parse the burn
ffmpeg 8's filtergraph parser rejects a quoted positional value followed
by more :name=value options — ass='x.ass':fontsdir='…' now fails with
"No option name near …", so every caption burn breaks on ffmpeg >= 8
(found live-testing the MCP add_subtitles tool on a Homebrew 8.1.1).
The named form (ass=filename='…') parses identically on 4.x through 8.
2026-08-03 22:33:16 +02:00
juancarlos.cavero
f10655fd1c feat(agents): the pipeline as a platform — API keys, MCP server, webhooks
Agents don't forget to come back; humans do. Make the whole pipeline
drivable without the dashboard:

- API keys (osk_...): sha256-stored tokens minted from the account page.
  get_current_user_optional resolves them like a session, so metering,
  entitlement, priority and job ownership apply to agents with zero
  endpoint changes. Key management refuses API-key auth (a leaked key
  cannot mint replacements).
- MCP server at /mcp: stateless Streamable-HTTP JSON-RPC, no SDK
  dependency. Six tools (process_video, get_job_status, list_clips,
  get_quota, add_subtitles, publish_clip) that call back into this same
  app in-process via ASGITransport with the caller's auth headers, so
  MCP can never drift from REST behavior. Cloud requires a key;
  self-host stays BYOK-open.
- Completion webhooks: webhook_url (+ optional HMAC webhook_secret) on
  /api/process, SSRF-checked at submit AND delivery, fired once after
  the R2 archive so payloads carry durable links, survives redeploys
  via the resume manifest.
- Dashboard: API keys card in the account page (create once-shown key,
  list, revoke).
- Tests pin BILLING_ENABLED=0 in conftest so the suite no longer
  depends on the developer's personal .env.
2026-08-03 22:33:16 +02:00
juancarlos.cavero
18f2cf4dbd feat(selection): put a floor under the clip count
Prod measurement, 3-ago-2026: 408 of 429 jobs (95%) delivered three clips or
fewer, the mode being ONE. Cross-referenced against retention on the cohort
that signed up 3-7 days ago (old enough to have returned, recent enough that
the 7-day purge has not deleted their user_videos rows):

    clips delivered   users   came back a 2nd day
    1-3                 251   0.4%
    4-9                  31   16.1%

Forty times the retention on the far side of a boundary that 95% of jobs never
crossed. That is the mechanism behind the 96.7% of users who only ever use the
product on a single day.

The shortlist was not the constraint — a 5-minute video already shortlists 5
windows. The detail prompt was: it asked to "prefer one great clip per
candidate window", and both the 2-second rule and STANDS ALONE end in "or skip
it" with no lower bound, as does DIVERSITY's "drop the other". Three rules
pushing down and nothing holding the count up collapses to one clip.

clip_count_targets() now derives a floor and a ceiling from the shortlist size
(3 windows -> 3-6, 5 -> 4-10, 10+ -> 6-12) and the prompt states it. Every
quality rule is untouched — they are validated at 82% against random windows
and this change does not spend that.

A/B on 8 real prod transcripts (3.5-18 min, all of which delivered 1-3 clips in
production), sharing the score pass between variants so only the detail prompt
differs:

    OLD  mean 2.75  median 2.5  <=3 clips: 6/8
    NEW  mean 4.00  median 4.0  <=3 clips: 3/8
    better on 7 of 8, worse on none, one tie (sign test p = 0.016)

The ceiling never bound: the most any video produced was 5 against a ceiling of
8-12, so the model is not padding to hit a number — the floor and the removal
of the one-per-window bias are doing the work. That is the outcome to want.

Read the limits honestly. Three of eight still land at three or fewer, and the
sample under-represents the sub-5-minute videos that are 54% of real jobs and
the hardest case here: both short videos in the set shortlisted only 2 windows
out of the 3-4 that existed, because the SCORE pass returned fewer usable
windows than it was given. That is the next thing to look at, and it caps this
change on exactly the videos that matter most.

CLIP_TARGET_MIN / CLIP_TARGET_MAX override both bounds for further A/B runs
without a deploy.
2026-08-03 11:17:33 +02:00
juancarlos.cavero
db3e7849af feat(billing): measure the click-to-Stripe gap, and sell the outcome
Between 25-jul and 1-ago the upgrade modals logged 35 checkout clicks and
Stripe recorded one new subscription. Nothing in between was measured:
TopUpModal fired only QuotaWallCheckout/UpsellModalCheckout, and
CheckoutStarted lived exclusively in PricingSection, so the funnel could
not tell "never reached Stripe" from "reached Stripe and abandoned".

Both surfaces now emit the same chain — CheckoutStarted (click) ->
CheckoutRedirected (we hold a Stripe URL) -> CheckoutFailed (we don't,
with the reason) — segmented by a `source` prop of wall | upsell |
pricing. The modal also writes the os_pending_checkout stash that
PricingSection already wrote, so a plan bought from a modal stops losing
its revenue attribution on the Subscribed goal.

The modal copy now leads with what the user gets (clips ready to post, a
library that stays) and states the free-plan limit second. Leading with
the watermark and the 7-day deletion framed the paid tier as "pay to undo
restrictions we added", which is the losing side of an argument against
our own MIT repo, whose headline is "no watermarks, no limits".

GPU rendering and the bundled Gemini key stay out of the modal on
purpose: they are the real reasons the cloud beats self-hosting, but the
free plan already gets both, so they belong on the pricing surface facing
repo visitors rather than in a modal shown to someone already using them.
2026-08-02 01:27:35 +02:00