Commit graph

150 commits

Author SHA1 Message Date
91a5465f81 chore: drop watermark feature, CLI, docs, design.md; consolidate requirements (#6)
All checks were successful
CI / unit (push) Successful in 45s
CI / backend-e2e (push) Successful in 1m16s
CI / dashboard-e2e (push) Successful in 2m29s
- Remove the watermark feature end to end (watermarked.py, apply_watermark/
  mark_delivery/watermark_filter, WATERMARK env, assets/) and its tests; self-host
  delivery is now unconditionally clean.
- Delete the unused cli/ package and .github/workflows/publish-cli.yml.
- Delete docs/ (compliance) and design.md; drop the dangling references in the
  legal page and the design-token/ui comments.
- Consolidate requirements: requirements.txt (runtime) + requirements-test.txt
  (unit + E2E); remove requirements-e2e.txt and requirements-ml-e2e.txt and
  point both CI jobs at the single test file. Add libgl1 to the unit job
  (scenedetect -> opencv-python links libGL).

Verified in the CI container: unit 701 passed; API E2E 209; pipeline E2E 127;
Playwright 19 passed / 1 skipped.

Reviewed-on: #6
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-05 11:11:37 +01:00
1dec0dd1af chore/dead-code-removal (#4)
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-build (push) Successful in 20s
Reviewed-on: #4
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:11:11 +01:00
719946b3cd refactor/package-layout (#3)
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-build (push) Successful in 9m48s
Reviewed-on: #3
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:47:12 +01:00
d56455e555 fix(publish): channel-by-id selection, DD/MM/YYYY scheduling, app-first boot (#1)
All checks were successful
CI / backend-tests (push) Successful in 32s
CI / frontend-build (push) Successful in 31s
- Postiz publishing now selects exact channels by integration id; identifier
  mapping fixes instagram-standalone (was 'not connected') and multiple channels
  per network (was first-only); settings.__type uses the real identifier
- Publish modal lists all channels, DD/MM/YYYY + HH:MM scheduling with validation,
  surfaces backend errors and a success confirmation
- Remove AWS/S3 clip backup and ElevenLabs voice dubbing (server, UI, tests, docs)
- Boot straight into the app; remove the landing/launch screen
- CI backend-tests runs in a python:3.11-slim container (Forgejo has no 3.11 cache)

Reviewed-on: #1
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:07:42 +01:00
ace54c6e77 chore: rename OpenShorts to Clipwright
Some checks are pending
CI / backend-tests (push) Waiting to run
CI / frontend-build (push) Waiting to run
- Rebrand all text, package/CLI (clipwright_cli), env vars (CLIPWRIGHT_*),
  localStorage keys, Docker container names and webhook header
- Rename/relocate assets, skills/, n8n examples, font map; delete dead MCP
  metadata (server.json, glama.json) and generated egg-info
- Canonical site URL -> https://git.pbento.pt/pedro-bento/clipwright
- Preserve fork provenance (upstream OpenShorts attribution in README/NOTICE/LICENSE)
2026-10-04 18:07:07 +01:00
4e82d60cbc fix: harden Postiz integration and align docs/CLI/n8n after review
- Postiz URL is now required (no built-in host); a key can never be sent to a default instance
- /api/postiz/scheduled normalizes scheduled_date and widens the default window
- Disabled channels are refused for posting; frontend excludes them from connected platforms
- 4xx instead of 500 on missing clip URL / bad schedule date; Postiz error bodies truncated
- Add tests/test_postiz.py (24 tests); fix remaining cloud-removal test drift
- CLI defaults to localhost:8000; n8n workflows fixed against the real routes
- Remove dead media-token auth code, stale copy (download_url/402) and doc drift
2026-10-04 17:25:17 +01:00
edcfeaf9d5 refactor: remove cloud/ billing mode and flatten to self-hosted-only
- Delete the entire cloud/ package (Stripe billing, auth/OAuth, metering, API keys,
  account erasure, lifecycle/digest emails, R2 archive, autopilot, MCP OAuth,
  proxy ledger, managed keys) and all BILLING_ENABLED branches in app.py
- Keep self-host behavior via no-op shims; /api/config now returns
  {youtubeUrlEnabled, jobRetentionSeconds, localLlm}
- Remove cloud tests (31 files), alembic/, log_view.py, requirements-billing.txt,
  docker-compose.cloud.yml; update CLI to Postiz + /api/config; clean docs/skills
- Flatten dashboard: remove auth/billing/pricing/history chrome, inert config-only AuthContext
- Fix residual test drift; lint + build + compile all green
2026-10-04 17:02:55 +01:00
fbabb4ec5d refactor: self-hosted fork — Postiz publishing, drop AI Shorts/UGC/agent/autopilot/MCP, fix Studio image API, remove upload cap
- Replace Upload-Post with a self-hosted Postiz client (postiz.py) and /api/postiz/* endpoints
- Remove AI Shorts, UGC gallery, AI Agent tab, Autopilot, MCP/agent layer, and their UIs
- Fix YouTube Studio thumbnail generation (google-genai >=2 Interactions API) and blocking download
- Make the video upload size cap configurable/unlimited (MAX_FILE_SIZE_MB, default 0)
- Update SEO/marketing/docs to the single-product self-hosted reality; lint+build green
2026-10-04 16:30:44 +01:00
juancarlos.cavero
9cc0a0feb0 feat(captions): size control and trending caption presets
The subtitle modal had no size control: the font size was pinned at 24
while clips ship at 44, so re-applying captions from the modal halved them.
It now opens on the shipped look and offers S/M/L/XL, with fewer characters
per line as the text grows so a line still fits the 9:16 frame.

New in generate_ass: a "highlight" effect (opaque box behind the active
word via a second BorderStyle 3 style, black text on light boxes), "reveal"
(words appear as they are spoken), a drop shadow, and an outline of 0 when
a shadow carries the contrast. /api/subtitle takes reveal, shadow,
max_chars (1 = one word at a time) and max_duration.

Presets added: Default, Hormozi, Pill, Lime box, One word, Clean. Anton and
Montserrat are selectable, and the preview uses the burn's scale and line
budget so what plays in the modal is what gets burned.
2026-10-01 17:48:42 +02:00
juancarlos.cavero
cb37ae3aec feat(watermark): serve the free-plan mark as a copy, so paying removes it from existing clips
Every file the pipeline and the clip editor write is now clean. On the free
plan the served file is a wm_<final> copy with the mark burned in
(main.mark_delivery, last step after captions; app._deliver for the editor
endpoints, decided from the caller's plan), and both twins go to R2. An
upgrade re-points the user's library at the clean twins from the Stripe
webhook (cloud.videos.unmark_user_library): no render, no source video,
and the dashboard chases the job result until no served URL carries wm_.

Before, the mark rode the reframe encode, so every derivative inherited it
and the upgrade modal's "upgrade to remove the watermark" was false for the
clips already made. The first cancellation for "clip quality" (29-sep) was a
user who paid 15 minutes after their first job and kept the mark on every
download and restyle.

- /videos guard refuses a marked job's clean deliverables (.marked dotfile),
  so the twin cannot be fetched by stripping the prefix off a URL; editor
  scratch files stay servable. Re-checked after an R2 restore.
- Walk-backs treat wm_ as the outermost layer; _canonical_clip_file globs it.
- Jobs from before this scheme (mark burned into the canonical) never get a
  second copy; a failed mark still serves under the wm_ name.
- Watermark notice once per job when the clips land on a free account, and
  before the first download if skipped; tracked with source=results|download.
  Upsell/banner/win-back copy now promise the instant removal.
2026-10-01 09:35:53 +02:00
victorcavero14
29c54fa04c feat(cancel): retention offer as the last step, resume from the account page
The Stripe portal stops cancelling (its config, 2026-09-28), so the dashboard
flow is the only way out and carries the portal's retention coupon:
- GET /api/billing/retention-offer: live monthly plan, no discount on it, never
  offered before (retention_offer in the Stripe sub metadata). Any Stripe error
  means no offer, never a stuck flow. Coupon id from RETENTION_COUPON_ID.
- POST /api/billing/retention-offer/accept: applies the coupon, stores the
  feedback with outcome=retained, alerts "Cancel saved".
- POST /api/billing/resume + "Keep my subscription": undo a scheduled cancel,
  which the portal did with the cancel feature now off.
- cancellation_feedback.outcome (additive column).
2026-09-28 19:03:38 +02:00
juancarlos.cavero
42942aecfe feat(feedback): in-app cancel flow with reason + review, and a sign-up survey
- POST /api/billing/cancel: closed-list reason, optional detail, 1-5 rating and
  review; cancels at period end in Stripe with cancellation_details, then stores
  cancellation_feedback. Account page opens CancelPlanModal (3 steps).
- Portal cancellations: churn alert now carries Stripe's feedback value.
- POST /api/onboarding/survey + /api/me onboarding_survey_pending: accounts under
  7 days get one skippable screen before the clip tutorial (what they want to
  make, where they heard of us, who they are). Stored in onboarding_surveys and
  tracked as SignupSurveyAnswered with per-goal props.
- Both new tables are user-owned and erased with the account.
2026-09-28 18:27:00 +02:00
victorcavero14
c7dab3dbf4 feat(landing): say the first video is free up to 60 min, then 20 min a month
Hero trust line, cloud card, pricing header, final CTA, pricing page, tool
gate, the crawler fallback, the default SEO CTA and the Cloud summary in
seo/data.js.
2026-09-28 13:29:14 +02:00
victorcavero14
77d3a1143e feat(hooks): "edit hook" with a typeface picker; a preview that matches
- The clip button and modal are "edit hook" (was "viral hook"), and the
  submit says "update hook" when the clip already has one.
- Typeface picker: Montserrat, Anton, Serif, all bundled so the server
  render (hooks.HOOK_FONTS, /api/hook `font`) and the Remotion preview
  (HOOK_FONTS in remotion/lib/fonts.ts) use the same file and size.
  Unset keeps each style's own typeface, so existing styles render as
  before.
- The preview box is a true 9:16 (it was taller than the video, so the
  hook sat off where it lands); style swatches are larger, drawn in the
  real typeface, and "Pills" shows pills.
- Entrance options are hidden when they cannot apply (server re-render)
  instead of shown greyed out.
- Autopilot: skipped videos can be clipped again by hand (private videos
  used to be misread as Shorts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:57:30 +02:00
victorcavero14
a9818832b3 fix(autopilot): no ownership checkbox; private videos said as such
- The connected channel (YouTube's own OAuth) is the proof the content is
  the user's: the "I own the content" checkbox is gone, and switching
  Autopilot on records rights_ack_at by itself. "Clip it" no longer
  requires it either.
- Private videos read as "already a short": /shorts/<id> answers 200 for
  them too. is_youtube_private (oEmbed 401/403) runs first; a manual clip
  says "private on YouTube, set it to Unlisted", and the automatic poll
  leaves the video unclaimed so it is picked up once it goes public
  (scheduled uploads are private until then). They cannot be clipped:
  the YouTube Data API lists the owner's uploads but never serves the file.
- A pasted private video stops downloading as soon as yt-dlp says so
  (before the per-GB proxy) and tells the user why, instead of "YouTube
  blocked the request".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:51:08 +02:00
victorcavero14
c26178776f fix(autopilot): "clip it" tells you what happened, next to the button
Without the rights confirmation the button only set the page notice,
which renders at the top of the tab, far above the video list: the click
looked like it did nothing. The confirmation checkbox and the button's
feedback (started, not clipped and why, errors) now sit right above the
list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:37:04 +02:00
victorcavero14
a8509249da feat(hooks): "pill" hook style, the new default
Every line of the hook gets its own white rounded box with black bold
sans (Montserrat ExtraBold, SIL OFL, bundled in fonts/ with its license),
the look short-form viewers know from TikTok. It replaces the serif
white card as the default for auto hooks, the editor's hook modal and
the /api/hook default; the other six styles stay selectable.

- hooks.py: _draw_pills renders the stack for the FFmpeg path.
- Remotion HookOverlay mirrors it (box-decoration-break: clone), so the
  editor preview matches the burned result.
- The generate form says the hook text, style, position and size can be
  changed per clip afterwards; the saved style preference moves to a v2
  key so the old stored default does not pin people to the serif card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:34:54 +02:00
victorcavero14
0ef20db988 fix(dashboard): real log times, stage progress, cards that use the width
Logs
- Each job log line records when it arrived (app._TimedLog) and
  /api/status returns log_times; the dashboard showed new Date() on every
  render, so every line had the same, moving clock.
- The cloud log view shows every stage: download %, early audio,
  transcription %, finding moments, layout, clips found, and per clip
  creating / framed / ready. Progress updates its own line instead of
  adding one per step. Lines glued to yt-dlp's \r progress bar (the
  parallel transcription prints onto it) are split, so its % shows again.
  "Found N clips" matched the old "viral clips" wording only.

Result cards
- The results grid only goes to two columns when each card gets ~600px
  (auto-fill) instead of at the xl breakpoint, where the side panel was
  squeezed and the copy buttons spilled out of the card.
- Card actions take as many per row as fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:25:57 +02:00
victorcavero14
d585b93ea2 feat(dashboard): say a video is too short the moment it is picked
Uploads under 45 s (MIN_SOURCE_SECONDS) were only rejected by the server after
the whole file went up. The browser now reads the file's duration on select,
explains why it cannot be clipped, keeps Generate disabled, and the drop zone
states the minimum. A file the browser cannot read is left to the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 08:38:52 +02:00
victorcavero14
681bfb5719 fix(dashboard): show why a job was rejected instead of a generic failure
A new user in the first-clips tutorial who submitted a 30 s video saw only
'That run failed. Try another video'; the server's actual reason ('this video
is only 30s long, clip generation needs at least 45s') was hidden, and outside
the tutorial it landed in the log panel as raw JSON. The FastAPI detail is now
read into plain text and shown in the tutorial card and the logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 08:34:27 +02:00
victorcavero14
4bcdc36a6f fix(security): block tailnet SSRF, gate the quality probe, strip job secrets
- security_utils: accept only is_global addresses (100.64.0.0/10, the
  Tailscale range, went through is_private), judging IPv4-mapped / 6to4 /
  Teredo / NAT64 IPv6 by the IPv4 inside.
- /api/process validates the URL (public host, one YouTube video) before
  anything fetches it, and the quality probe now runs after the metering
  step (balance, job limit, hourly probe cap); a low-quality confirm or a
  too-short source hands the reservation back. quality_probe.py checks the
  same itself, passes noplaylist and no longer disables TLS verification.
- Metered whole-video URL jobs carry SOURCE_CAP_MINUTES = reserved minutes
  (job env + resume manifest); main.py cuts a download clearly longer than
  that, so a server cannot answer the probe short and the download long.
- main.py / quality_probe.py get child_env(): the server secrets (Stripe,
  JWT, DB, SMTP, Telegram, R2, AgentLedger, managed keys) are dropped; a
  test fails if the pipeline ever reads one.
- /api/social/user no longer logs the whole Upload-Post profile list.
- Owner checks on /api/thumbnail/generate, /api/thumbnail/publish/status
  (dashboard now polls with apiFetch) and /api/render/{id}; /video/{id}
  and /gallery escape every interpolated value and drop non-http URLs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 01:03:05 +02:00
victorcavero14
8f57560fa5 feat(autopilot): clip every new video on the connected YouTube channel
Most subscribers use OpenShorts on one day and cancel. Autopilot makes the
value recur: once switched on, every new upload on the user's YouTube channel
(listed through the existing Upload-Post connection, no scraping) is sent
through the normal /api/process pipeline, the user gets an email when the
clips are ready, and with autopublish on the best clips are scheduled on
their socials, one a day.

- cloud/autopilot.py: poller, in-process job submission as the user,
  completion hook, autopublish, and /api/autopilot{,/videos,/run}
- guard rails: only videos published after switching on, max 3 days old,
  1 automatic job per user per day, first N minutes per video, Shorts skipped,
  paid plans only, dedupe by (user, video) across the deploy handover
- dashboard: new Autopilot tab (sidebar + mobile menu, #app?tab=autopilot)
- connect page can return to the Autopilot tab
- analytics: ClipsDelivered/JobFailed now report source=url and the plan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 21:36:19 +02:00
juancarlos.cavero
4b2cf58922 dashboard: show the full clip 'why' in a popover when it is clamped
The line is clamped to two lines so cards in a row stay level; a long
sentence then reads as '...how easily audiences...' with the rest only in
the native title tooltip. When the text actually overflows, hovering
(desktop) or tapping (touch) now floats the whole sentence over the card,
so nothing grows and the grid stays aligned.
2026-09-21 23:28:03 +02:00
juancarlos.cavero
36dba9b3b1 feat(selection): say why each clip was picked, drop clips that overlap a better one
The detail pass now returns a one-sentence `why` per clip (what makes this
moment a clip, not the topic), stored in the metadata and shown under the
title in the dashboard card: the score said how much, nothing said why.
Defaulted in the schema so a small local model that skips it keeps the clip.

After the word snap, clips overlapping an already-kept clip by half the
shorter one are dropped in favour of the higher predicted_score. The prompt's
DIVERSITY rule was the only thing preventing the same moment twice; in ~330
clips over 8 talks it never fired, so this is a guard, not a fix.

Each clip also keeps the model's raw `proposed` boundaries before the snap,
which is what made boundary accuracy measurable: p90 0.4-0.5 s from a word
on 8 talks (21-sep-2026), inside snap_clip_to_words' 1.5 s reach.

Two ideas borrowed from AutoClip were measured with a blind judge on the
same corpus and NOT adopted: quoting per-sentence timestamps in the detail
pass lost 24%/23% (p<0.001, two seeds — it shortens clips and drops the
payoff), and an "end on the reaction, not the line" rule was inert
(47%/53%, p=0.71).
2026-09-21 22:47:55 +02:00
Víctor Cavero
27d4916ca7
SEO: medir las páginas SEO, convertirlas y ampliar el cluster de comparativas (#86)
* feat(seo): measure the SEO pages, convert from them, and widen the cluster

The audit of 17-sep-2026 found the static SEO surface ranking at positions
1.8-4 with a 0.2-1.6% CTR while leaking every click it earned: the pages
carried no analytics at all (~424 clicks/month invisible, confirmed with
curl), the only link into the app was the fixed nav button, ten internal
links pointed at /cdn-cgi/l/email-protection, thirteen titles and
twenty-one descriptions were past the length Google renders, and every URL
in the sitemap claimed the same lastmod.

What changes, and how it is verified:

- Analytics (render.js). The shim, the %VITE_OPENPANEL_*% gate and
  ANALYTICS_HOSTS are ported verbatim from index.html, plus the init call
  the SPA makes from lib/consent.js — first-party measurement is exempt
  from prior consent and always on, so there is nothing to ask here. Vite
  only rewrites index.html and these files are emitted assets, so the
  plugin substitutes the placeholders itself; unset still yields an inert
  page. Verified by building with and without the variables.

- Body CTA (render.js, per-page copy in pages.js). Rendered between the
  TL;DR and the body, with the text that fits each page's argument, and
  never on legal pages or the 404. The link carries utm_* so
  lib/attribution.js can post the click with the signup, and fires a
  SeoCtaClick event so the CTA can be told apart from the nav button.

- Broken mailto links (legal.js). 46 plain-text addresses rewritten as
  <a href="mailto:...">. Cloudflare Scrape Shield turns the bare address
  into a /cdn-cgi/l/email-protection link, which is a 404 for crawlers.

- Titles and descriptions. Every title is now <=60 characters and every
  description <=160, measured across all 35 emitted pages rather than
  eyeballed (/gta-5-clips, merged the same week, was over on both). The
  check is part of the verification, not a one-off.

- Resume the job after sign-in (App.jsx). Pressing "get free clips" with no
  session opened the login modal and dropped the request: the magic link
  lands on a fresh document, so the pasted URL was gone. The request is now
  written down before the redirect and replayed after it, through the same
  handleProcess, so the isSignedIn -> isManaged -> keysMissing gate that
  decides billing is untouched: an unentitled account still lands on
  #/pricing, with the request parked until it pays. Files cannot be
  serialised, so those resume only within the same document.

- Gallery surface (app.py). The gallery head had no canonical; the JSON-LD
  was built from html.escape() output, producing &amp;amp;/&amp;quot; and
  valid-JSON-but-wrong names; the video page's nav and CTAs were relative
  hrefs on the api host, where "/" is a 404 (the app is on www). JSON-LD is
  now serialised as JSON with <> and & escaped as unicode, both pages carry
  their canonical, and cross-host links are absolute. Verified by rendering
  both routes with a monkeypatched gallery: the JSON parses and a title
  with quotes, an ampersand and markup survives round-trip.

- New comparison pages (pages.js): /opus-clip-pricing, /opus-clip-free-
  alternative, /opus-ai, /opus-pro, /vizard-ai-video-to-text,
  /submagic-reviews and a Spanish index at /alternativas. They target
  buying-intent variants (opus clips pricing, opus clip free trial, opus ai,
  opus pro, is vizard ai free) that the existing pages do not answer, read
  every price from data.js, and join the related-page ring, the footer and
  the landing links. /alternatives/vizard also gained the brand Q&A ("Is
  Vizard AI free?"), since "vizard ai" is how its volume is spelled.

Build: npm run build green (35 HTML files, all metadata in range, all
JSON-LD parseable). Tests: pytest tests/ -q, 777 passed, 19 skipped.

* fix(seo): CTA sin UTM interno, tutorial no pisa el job reanudado, mailto en el agente DMCA

- El CTA de las paginas SEO enlazaba al mismo origen con utm_*, lo que
  sobrescribia la atribucion real del visitante en lib/attribution.js y
  partia la sesion en OpenPanel. El evento SeoCtaClick sigue midiendo el clic.
- Alta nueva con un enlace aparcado: no abrir el tutorial intro encima del
  job que se reanuda solo.
- LoginModal solo promete 'tu video esta guardado' cuando el payload es una
  URL; un File no sobrevive al magic link en otra pestana.
- Los dos info@upload-post.com del agente DMCA tambien en mailto.

---------

Co-authored-by: victormanuel.caverogracia <>
2026-09-17 19:26:04 +02:00
juancarlos.cavero
03c8a1f887 feat(quota): offer the first N minutes of a long video instead of a bare wall
93 of the 99 quota walls sampled on 16-sep-2026 were shown to accounts with
their 20 free minutes untouched that had pasted a 21-90 min video: asked to
pay before seeing one clip, most left Stripe without paying.

The 402 now carries partial_minutes (the floored balance, at least
PARTIAL_MIN_MINUTES and shorter than the source). The wall shows 'clip the
first N min' next to the plans and resubmits with max_minutes; the server
reserves min(asked, balance) and sets MAX_SOURCE_MINUTES, and main.py cuts
the source in place before anything reads it, so every later stage and the
editor see a short video. The cut travels in the resume manifest so a
redeploy cannot re-run the whole video on a partial reservation. Status and
the results view say which part of the video the clips came from.
2026-09-16 21:02:38 +02:00
Victor Cavero
96f0139861 feat(rgpd): legales, cookies, baja de marketing, marcado AI Act y alertas sin PII
Claude-Session: https://claude.ai/code/session_01UNZxBnD6dnMGEdbvBVwoS7
2026-09-07 19:22:52 +02:00
victormanuel.caverogracia
2876878237 fix(dashboard): refresh the header minute meter after usage
Minutes are reserved when a job starts, not when it finishes. Re-fetch
/api/me on start, complete, fail, quota, bulk subtitles and clip re-render
so the pill in the header moves without a reload.
2026-09-01 14:26:45 +02:00
victormanuel.caverogracia
8a22fa7b9e fix(dashboard): replace cramped tutorial card with a Next tour
The coach chip stacked three step labels on top of each other. Walk Clip
Generator control by control instead, and park the tooltip inside the
viewport on small screens.
2026-09-01 14:11:44 +02:00
victormanuel.caverogracia
016267f204 feat(dashboard): first-login Clip Generator tutorial
New accounts land on Clip Generator with other tools locked. A modal
walks paste → generate → clips and celebrates the first successful job.
2026-09-01 13:55:37 +02:00
victormanuel.caverogracia
b4000ac9bc feat(billing): legal invoices from AgentLedger on the account page
GET /api/billing/invoices lists the AgentLedger-issued Spanish invoices for
the signed-in user's Stripe customer (public View/PDF links), backfilling the
customer's history on demand when AgentLedger has nothing yet. New env:
AGENTLEDGER_API_KEY (+ optional AGENTLEDGER_API_URL / AGENTLEDGER_TREASURY_ID).
InvoicesCard renders under the plan card for accounts with a billing relationship.

Claude-Session: https://claude.ai/code/session_01Chec1RKALL2v8V4GsDfPCW
2026-09-01 12:36:59 +02:00
victormanuel.caverogracia
2b2a58202e fix(dashboard): drop the public gallery link from UGC gallery
The in-app grid already is the gallery; the extra tab to /gallery was redundant.
2026-09-01 10:35:19 +02:00
victormanuel.caverogracia
9d69bea940 fix(dashboard): play UGC gallery clips in a modal
Cards were mounting every mp4 with preload=metadata, so the grid stalled,
and click did nothing except a hidden View link that opened another tab.
Posters only until click; playback stays on the same screen.
2026-09-01 10:27:34 +02:00
victormanuel.caverogracia
0c65520e2f fix(dashboard): bind Icon in pricing and legal maps
The hosted-vs-self table on #/pricing and the legal docs list rendered
<Icon> without destructuring icon from the row, which crashed the page.
2026-08-31 18:08:08 +02:00
juancarlos.cavero
87adf88daa fix(source): stop serving the untouched original without a credential
GET /api/source streams the file we downloaded, not a derived clip, and it was
open on the reasoning that the UUID job id is the capability. That makes the
product a public YouTube downloader wearing a UUID, which is the characterisation
worth avoiding, and one leaked id in a log or a referer opens someone else's
video.

A <video src> cannot carry an Authorization header, which is why it was open in
the first place, so the owner mints a short-lived signed URL from
/api/source-url and hands the player that. The endpoint takes the signature or
falls back to the owner check. Self-host and ownerless BYOK jobs are untouched:
no owner to check, no secret to sign with. The owner lookup is gated on
BILLING_ENABLED because it falls through to a full rescan of the output
directory, which off billing would run on every preview and buy nothing.

Both minters go through _signed_source_url. The EDL feeds ClipEditor's source
monitor the same way and was built as a bare path, which works in self-host and
in every test and 404s in cloud. The regression test asserts the endpoint calls
the minter rather than comparing strings: off billing the helper returns that
same bare path, so a string comparison passes just as happily with the bug in.
Verified by putting the bug back and watching it fail.

The frontend mints at render, not when the session is persisted, or localStorage
would hold a token that expired overnight.

SOURCE_RETENTION_SECONDS can age the retained download out ahead of the clips it
produced, and defaults to the job clock, so nothing changes until someone sets
it. Lowering it is not free: the EDL, rerender, scenes and reframe endpoints all
read that file and answer 409 once it is gone.

Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
2026-08-29 17:19:39 +02:00
juancarlos.cavero
8c91403f22 feat(ai-act): mark dubbed and ai-actor output as machine-readable ai content
Art. 50(2) asks a provider whose system generates synthetic audio or video to
mark the output in a machine-readable way, and the terms already promised we
"label and mark" dubbed clips while nothing did either.

mark_ai_generated stamps the disclosure by stream copy, so it is a remux and
never a re-encode. The tag is `comment` because mp4 keeps only the standard
tags and ffmpeg drops a custom key without warning, which a test pins. It is
best effort by design: a missing tag must not lose someone the video they just
paid minutes for.

Deliberately narrow, on dubbing and AI actors, not on an ordinary clip whose
pixels and audio are the user's own footage. Marking everything would make the
tag mean nothing. TranslateModal says the file is tagged and that the person
publishing it owes their audience the disclosure, which is the art. 50(4) duty
and falls on them, not on us.

Still missing, and a product decision rather than an oversight: the visible
burned-in label.

Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
2026-08-29 17:19:24 +02:00
juancarlos.cavero
e21cab22fb feat(legal): dmca agent, california rights, refunds and a notice-and-action page
Five gaps in the published package, all of them things the texts either
promised or needed:

- DMCA. Section 9 implemented the DSA notice-and-action mechanism, which does
  not grant the US safe harbor. Adds the designated agent under 512(c)(2), what
  a notification must contain, the counter-notification of 512(g) and the
  misrepresentation liability of 512(f). Publishing this is only half of it:
  the designation still has to be filed at dmca.copyright.gov.
- California. The privacy policy had no CCPA/CPRA section at all. Says plainly
  that we do not sell or share, and that the reframing detects faces to know
  where to crop but never to identify anyone, which is the question a CPRA
  reader asks next.
- Refunds. New /refunds and /reembolsos: 14 days from any charge, refunded in
  full, no usage deducted. Section 12 now says the commercial policy is more
  generous than the statutory withdrawal right and is the one that applies,
  because two clauses answering differently about the same 14 days is what a
  dispute is made of.
- Notice and action. The art. 16 mechanism lived inside a terms clause, which
  reads poorly against "easy to access". Now its own page in both languages,
  linked from the footer, the hub and section 9.
- Signup. LoginModal created the account without linking the terms or the
  privacy policy: a magic-link signup never passes the footer.

docs/dsa-notice-and-action.md is the half nobody outside sees: acknowledge the
same working day, decide in 72 hours, the art. 17 statement of reasons, and a
written three-strike rule, since "reasonably implemented" is the test and an
unwritten policy fails it. It also records why arts. 15 and 20-28 do not apply
to us (hosting service, micro enterprise), so nobody builds them by mistake.

Claude-Session: https://claude.ai/code/session_01WyFE2wXi8quZR6nLRRLDgE
2026-08-29 17:19:11 +02:00
juancarlos.cavero
ad8ab59086 fix(dashboard): the score badge has to say what it is
It shipped as a bare coloured number next to "Clip 4", which on a video
thumbnail reads as a duration, a rank, a position — anything. The user's
reaction to the deployed version was "sale el número pero no se entiende qué
es", which is the whole feature failing to land.

Now it names itself and carries its scale: a trend icon, the word "viral", the
number, "/100". Only the number takes the traffic-light colour, so the label
stays quiet and the value is what the eye lands on.

Claude-Session: https://claude.ai/code/session_01KeQYCfUX2E9Q2fDgZMKEaJ
2026-08-29 03:00:13 +02:00
juancarlos.cavero
6f9c01e2c6 feat(dashboard): show each clip's score and lead with the best one
The detail pass has always returned a predicted_score per clip and the
dashboard threw it away, rendering the clips in transcript order. That buries
the strongest clip wherever it happens to fall in the video, and the first card
is the one people actually watch, publish and judge the product by.

The cards are now ordered by score, and each one carries its number. The
ORIGINAL array position is what still travels down as `index`: it is the clip's
identity in clip_index on /api/subtitle, /api/edit and publishing, in the
clip-N.mp4 download name and in the saved per-clip project state. Sorting the
array itself would have repointed all of that at the wrong clip, silently.

So the badge keeps saying "Clip 4" at the top of the list rather than "Clip 1" —
the number identifies the file you download, the position tells you what to post
first. Ties and clips with no score keep transcript order.

Claude-Session: https://claude.ai/code/session_01KeQYCfUX2E9Q2fDgZMKEaJ
2026-08-29 02:53:32 +02:00
juancarlos.cavero
9c7cae2173 fix(social): say that a tiktok draft carries no caption, and say it when scheduling a week
ResultCard warned that tiktok arrives as a draft; ScheduleWeekModal, which
queues a whole week at once and has tiktok on by default, said nothing. That
is the worse of the two: a silent drawer of drafts and a profile that stays
empty for seven days reads as a broken integration.

Both notices were also missing the actionable half. TikTok's upload-to-inbox
endpoint takes only source_info — there is no post_info anywhere in the
request — so the title and description we send are dropped for a video draft,
whether the user typed them in ResultCard or the AI wrote them for the weekly
queue. The user has to write them in the app, and neither screen said so.

Extracted to one component so the two copies cannot drift.

Claude-Session: https://claude.ai/code/session_01KeQYCfUX2E9Q2fDgZMKEaJ
2026-08-29 01:42:45 +02:00
juancarlos.cavero
0a21de29a2 feat(mcp): create_upload for local files, captions switch per job
process_video now takes captions:false for sources that already carry
burned-in subtitles (maps to AUTO_CAPTIONS=0 for that job only) and
accepts upload_id as an alternative to source_url. create_upload reserves
a slot (POST /api/uploads) and returns a PUT URL the agent streams the raw
bytes to (curl -T works from any runtime); the owner recorded at reserve
time is checked at process time, files sit in UPLOAD_DIR under the usual
sweep, slots expire after 24 h. Tool count is 8 everywhere it is quoted.
2026-08-27 16:32:05 +02:00
juancarlos.cavero
ecf9b0bfec feat(thumbnail): topic-first concepts, likeness-preserving references, refine follows the requested language
Feedback from a real run: thumbnails were 'face + two words' and the
person did not look like the presenter. The concept planner now has to
show the subject (product, number, result) with props and depth, and may
use the plain face only once. Frames are kept at native resolution so the
face crop sent as reference is ~800px instead of ~500px, and the image
prompt demands the exact same real person (no idealizing, no caricature).
Refining titles in another language now updates the session language and
returns paired thumbnail texts, so the thumbnail follows the title.
2026-08-27 15:52:34 +02:00
juancarlos.cavero
fe4e256cc4 fix(thumbnail): byte-part references, public-figure fallback, frames effect race
Browser run on a real video surfaced three defects:
- references were one PIL Image shared by the worker threads; the SDK's
  encoder raced and every generation died. Now each reference is an
  immutable JPEG byte part.
- Gemini's image model refuses recognisable public figures, by reference
  photo and by name alike (IMAGE_OTHER). The concept planner no longer
  writes real names or brands into scene prompts, and a blocked render is
  retried once without the person; the card says so.
- the frames effect listed its own state as a dependency, so setting it
  re-ran the effect and the cleanup discarded the response in flight.
2026-08-27 12:21:01 +02:00
juancarlos.cavero
eb6ef13bba feat(thumbnail): concept-driven thumbnails, crisp burned text, face frames from the video, scored titles
Titles: transcript + 10 frames instead of uploading the whole video (an hour
was ~1M tokens), a brainstorm across fixed styles then a critic that scores,
dedupes by angle and pairs each title with a 1-4 word thumbnail hook. Mobile
rules: payoff inside 50 chars, keyword first. Text model moves to
GEMINI_MODEL_THUMBNAIL (default gemini-3.5-flash); flash-lite is the weakest
tier and this is the one creative step.

Thumbnails: a text call designs N different concepts, one image call each in
parallel. Default burns the hook text with PIL (Anton, black stroke) over
negative space the image model is told to leave, so accents are never wrong;
'AI painted' toggle keeps the old behaviour. Outputs cover-cropped to
1280x720 under YouTube's 2 MB. GET /api/thumbnail/frames/{session} picks
frames with a large, sharp face spread across the runtime and the dashboard
offers them as the person reference. Phone-size preview row in the UI.
JSON parsing now uses raw_decode: flash appended a stray ]} once.
2026-08-27 10:57:34 +02:00
juancarlos.cavero
83ad817a31 feat(mcp): OAuth 2.1 for claude.ai/ChatGPT, and a "connect an agent" panel
claude.ai and ChatGPT connect to a remote MCP server by URL and expect the
server to run the login: RFC 9728/8414 discovery under /.well-known/,
dynamic client registration (public clients, PKCE S256 mandatory), an
authorization endpoint and a token endpoint. The consent screen is the
dashboard (#/oauth/authorize) because the session JWT lives in localStorage
on the frontend host; the API bounces there and mints the code on a
session-authenticated POST. Redeeming the code mints an ordinary osk_ API
key named after the client and returns it as the access token, so every
existing auth, quota and ownership rule applies unchanged and the user
disconnects an app by revoking that key. The /mcp 401 now carries
WWW-Authenticate: Bearer resource_metadata=... so clients find the flow.

Dashboard: a "Connect an agent" card (Account in cloud, Settings when
self-hosted) with copy-ready setup for claude.ai, ChatGPT, Claude Code,
Claude Desktop, Cursor, n8n and curl; the clip generator links to it. The
/mcp page, README and CLAUDE.md describe the URL-only connection.
2026-08-27 01:17:49 +02:00
juancarlos.cavero
d9152221fd docs(dashboard): name Gemini 3.1 Flash-Lite in landing, pricing and SEO copy 2026-08-26 00:30:51 +02:00
juancarlos.cavero
08e0eca92d chore(dashboard): make npm run lint work again
eslint.config.js was written for ESLint 9's flat config but package.json
pinned ESLint 8 and the script still passed --ext, so lint had not run in
months. Upgrade to ESLint 9 with @eslint/js and globals, keep
eslint-plugin-react-hooks on v5 (v7 ships the React Compiler rules, which
flag 21 places that would be a refactor, not a lint fix), drop the unused
eslint-plugin-react, and tune the rules to the house style: ignored catch
bindings, constant exports next to components, node globals for the build
scripts, and the entry point exempt from fast-refresh checks.

The findings that remained were fixed at the source: two unused Icon
destructures, an unused footer argument, two dead state pairs, one
useCallback dependency memoised, and six run-once effects marked as such.
2026-08-25 19:24:46 +02:00
juancarlos.cavero
fd0e39862c feat(layouts): dashboard layout selector, layouts=none, ranges survive a fast recut
- Advanced options gain "vertical layout": auto (server default, AI picks
  per video), two speakers stacked, screen over presenter, or single crop
  only. Only a deliberate choice travels as `layouts`; remembered in
  localStorage like the hook settings.
- `layouts=none` switches the picker off for one job even though the
  deployment runs AUTO_LAYOUT=1.
- The fast rerender (cut without reframe) wrote no layout sidecar, so a
  stacked clip fell back to bottom captions after a trim. It now carries the
  canonical clip's ranges through the new cut (layout_ranges.remap).
2026-08-25 15:45:19 +02:00
juancarlos.cavero
b4bf211b7b fix(cloud): close the gaps the account-deletion review turned up
Eight findings from re-reading the erasure path, each one something that would
have shown up in production rather than in a test:

- The local purge missed two stores. SaaSShorts outputs (output/saas_<id>) and
  generated thumbnails record ownership in their own in-memory dicts, not in
  the .owner file, so neither was erased. Thumbnails are the serious half: the
  hourly sweep deliberately skips their directory, so a deleted user's
  generated images stayed on disk forever, publicly served at /thumbnails/.
- The purge ran on the event loop. rmtree over gigabytes of video stalled every
  other request on the process; it goes through asyncio.to_thread now.
- Paths from those dicts are now resolved through _safe_under, so a session id
  or output_dir containing ".." deletes nothing.
- Deleting a user made a webhook path reachable that never was: _apply_topup
  takes the user id from Stripe metadata, so a top-up completing around the
  deletion inserted a row pointing at a user that no longer exists. The FK
  violation 500s the webhook, and since the event is only recorded after
  handle_event returns, Stripe retries the same doomed insert for three days.
  It confirms the row exists first.
- The "why are you leaving" box was free text stored in a record that
  deliberately outlives the account, which is how personal data ends up in one
  by accident. It is a closed list now, which also makes twenty deletions a
  month countable instead of readable.
- Two concurrent deletes wrote two erasure records and sent two goodbye emails.
  The DELETE's rowcount now decides which call is the real one; the UI holds a
  ref so a double click doesn't fire a second Stripe cancel and R2 purge.
- The delete button armed itself when the confirm box was empty, if the page
  ever rendered before /api/me resolved.
- The goodbye email claimed we keep "a one-way hash of your email and nothing
  else", which was not true of the Stripe reference beside it. Fixed in the
  email and in the privacy policy, EN and ES.

Also: skip the Upload-Post call when no managed key is configured, and say
plainly in the in-flight comment that it covers metered work only.

tests/test_account_local_purge.py covers tenant isolation across all three
stores and both traversal attempts; test_account_erasure.py gains the
confirmation gate, the API-key refusal, and the already-cancelled-at-Stripe
case that would otherwise trap a user forever.
2026-08-24 19:26:12 +02:00
juancarlos.cavero
1d9fef7445 feat(cloud): self-service account deletion (GDPR art. 17)
The privacy policy already told users that "deleting your account from the
dashboard removes your content" — there was no way to do it. This adds one:
Account -> Delete account in the dashboard, DELETE /api/account on the server.

The endpoint refuses API-key auth (a leaked osk_ must not destroy the account
it was issued from) and requires the caller to retype the account email; the UI
does the same, collapsed behind a danger zone that itemises what actually goes.
Erasure is immediate and irreversible, because after it there is nothing left
to authenticate a recovery request against.

The order of the steps is the design, each one a failure mode:

- Stripe cancel first, aborting everything if it fails, so we never erase a
  user we are still billing. An InvalidRequestError is treated as already
  cancelled: a portal cancellation whose webhook never landed leaves our row
  reading "active" forever, and the one account that could not be deleted
  would be the one Stripe already stopped charging.
- R2 before the database, because those rows are the only index of which
  objects belong to the user; dropping them first turns a failed purge into
  permanent orphans.
- The DB delete is one transaction over an explicit table list, not the
  declared ON DELETE CASCADEs: create_all never ALTERs an existing table, so a
  constraint added after a table shipped lives in the models and not in
  production. tests/test_account_erasure.py fails if a new table references
  users.id without joining that list.
- A reserved usage_ledger row blocks the delete: erasing under a running job
  would pull the output from beneath it and leave the reservation unsettled.

What survives, and why: the Stripe customer and its invoices (six years,
Spanish commercial law) and one account_deletions row holding a sha256 of the
email as proof the erasure happened, itself purged after five years by the
retention sweeper. app.py registers a callback so the working files in output/
and uploads/ go too instead of waiting for the hourly sweep.

Privacy policy sections 6 (EN + ES) now point at the button and name both
survivors; the Legal hub summary says the same in one line.
2026-08-24 19:12:05 +02:00