Commit graph

29 commits

Author SHA1 Message Date
Vadym Samoilenko
2f4925353a feat(pause-insert): adaptive buffer, forward-snap, timeline drag + share link fix
Backend (Phase A):
- A1: Adaptive silence buffer — natural_gap_ms persisted per cue; renderer computes
  per-cue silence_before/silence_after instead of fixed 500ms; per-cue silence files
- A2: Forward-preferred snap — snap_pause_point prefers boundaries up to 4s ahead
  over boundaries within 1.5s behind, reducing mid-scene cuts
- A3: Min-gap validation — pause points with < 200ms gap trigger forward search
  to the next acceptable gap
- natural_gap_ms added to PausePointData model and api.ts type
- New config fields: whisper_snap_forward_window, whisper_snap_backward_window,
  ad_silence_buffer_default, ad_silence_buffer_min_after, ad_min_acceptable_gap
- Tests: test_whisper_snap.py (13 tests), test_video_renderer_buffers.py

Frontend (Phase B):
- B1: Drag pause-point markers — pointer state machine with 3px move threshold,
  clamp to min/max bounds, click-without-move still opens PausePointEditor
- B2: Drag freeze blocks — orange blocks translate with linked pause point
- B3: Time tooltip visible during drag, hidden on release
- Tests: TimelinePreview.drag.test.tsx (10 tests)

Fixes:
- Share link pointed to ai-sandbox.oliver.solutions — added app_url to Settings
  with correct optical-dev.oliver.solutions default; share_url now configurable
  via APP_URL env var
- Removed all ai-sandbox.oliver.solutions references from docker-compose,
  apache config, docs, and scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:09:09 +01:00
Vadym Samoilenko
46477b7b32 fix(deploy): target sites-enabled instead of sites-available for Apache Include injection
On optical-dev the Apache vhost is a standalone file in sites-enabled (not
a symlink to sites-available), so injecting the Include into sites-available
had no effect and the ProxyPassMatch rules were never loaded by Apache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 16:32:23 +01:00
Vadym Samoilenko
31199f8705 chore: push all session changes — backend hardening, tests, apache config, deploy scripts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 15:52:14 +01:00
Vadym Samoilenko
90cbf23f0d chore: remove obsolete deploy scripts (ai-sandbox era)
Some checks failed
Deploy Backend / Deploy API to Cloud Run (push) Has been cancelled
Deploy Frontend / Build and Deploy Frontend (push) Has been cancelled
CI / Backend Lint & Test (push) Has been cancelled
CI / Frontend Lint & Test (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Dependency Check (push) Has been cancelled
Deploy Backend / Deploy Worker to Cloud Run (push) Has been cancelled
Deploy Backend / Run Smoke Tests (push) Has been cancelled
Deploy Backend / Notify Deployment Status (push) Has been cancelled
Deploy Frontend / Notify Deployment Status (push) Has been cancelled
CI / Integration Tests (push) Has been cancelled
CI / Build Backend Docker Image (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
deploy.sh and full-deploy.sh predate the optical-dev setup and reference
old URLs/compose files. deploy-dev.sh is the single source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 12:10:57 +01:00
Vadym Samoilenko
d5e63129dd feat(upload): PR-3 GCS resumable chunked upload for large videos
Files >100 MB bypass the load balancer via browser→GCS direct upload:
- POST /jobs/upload/init — creates GCS resumable session, returns job_id + session URI
- POST /jobs/upload/complete — verifies GCS object, creates job, dispatches ingestion
- Frontend sends 8 MB chunks with Content-Range directly to GCS session URI
- infra/gcs-cors.json + deploy-dev.sh ensure_gcs_cors() enable browser CORS on bucket

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 11:35:13 +01:00
Vadym Samoilenko
4edd4da0b2 fix(deploy): optical-dev deploy script and Apache config ready for production
deploy-dev.sh:
- BUILD_SERVICES now includes tts-worker, ffmpeg-worker, whisper-worker (enabled
  in docker-compose.optical-dev.yml via USE_CELERY_FALLBACK=true)
- ensure_apache_modules(): enables proxy, proxy_http, proxy_wstunnel, rewrite
- Apache fragment: WS proxy (ws://) placed BEFORE HTTP /api/ proxy (required
  for correct longest-match precedence in Apache)
- Added ProxyTimeout 600 (10 min) and LimitRequestBody 2147483648 (2 GB) for
  large video uploads; disablereuse=on for WS pool correctness
- Fragment always regenerated on deploy (picks up PORT/WEBROOT changes)
- Logs command uses full $COMPOSE variable instead of hardcoded partial flags

deploy/apache-video-accessibility.conf:
- Static reference copy of the Apache fragment with inline comments explaining
  each directive

.env.production:
- Updated remaining ai-sandbox.oliver.solutions URLs to optical-dev.oliver.solutions
  (API_BASE_URL, COOKIE_DOMAIN, CLIENT_BASE_URL, AZURE_REDIRECT_URI, CORS_ORIGINS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 11:24:40 +01:00
Vadym Samoilenko
1e5a07b06e fix(deploy): change API host port to 8012 (8010 also occupied)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 22:02:44 +01:00
Vadym Samoilenko
582f8ad2e8 fix(deploy): change API host port 8003→8010, move image to video-accessibility repo
Port 8003 is occupied by infra-api-1 on optical-dev server.
Artifact Registry repo renamed from nexus to video-accessibility.
cloudbuild.yaml defaults _TAG to 'latest' for manual runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 22:02:14 +01:00
Vadym Samoilenko
b3ace22009 feat(infra): move heavy workers to Cloud Run Jobs
Heavy pipeline tasks (ingest, translate, render, rerender) now dispatch
to a Cloud Run Job (va-worker) instead of local Celery workers. optical-dev
runs only api + lightweight worker (notify/embed) within its 2-CPU budget.

- backend/app/tasks/runner.py — Cloud Run Job entrypoint
- backend/app/services/cloud_run_dispatch.py — replaces .delay() for heavy tasks
- backend/Dockerfile.cloudrun — Cloud Run worker image (ffmpeg included)
- docker-compose.optical-dev.yml — 2-CPU safe overrides, disables heavy workers
- cloudbuild.yaml — builds va-worker image and updates Cloud Run Job
- deploy-dev.sh — uses 3-file compose, builds only api+worker locally
- routes_jobs, routes_admin_production, ingest_and_ai, translate_and_synthesize
  — all dispatch sites updated to use cloud_run_dispatch.dispatch()

USE_CELERY_FALLBACK=true in .env.local to use Celery locally during dev.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 21:47:10 +01:00
Vadym Samoilenko
f723e3f0bc chore(deploy): add whisper-worker, --redeploy flag, usage hints
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 21:36:45 +01:00
Vadym Samoilenko
c7eaa7a952 chore: add deploy-dev.sh for optical-dev deployment
Sequential image builds (one at a time to avoid OOM), auto Apache
fragment, migrations, frontend rsync, smoke test. Flags:
  --skip-build / --skip-frontend / --skip-migrations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 21:35:19 +01:00
Vadym Samoilenko
723bbbc695 fix: add project_manager migration + add migration step to full-deploy.sh
- New migration updates MongoDB users collection validator to accept
  project_manager role and pm_client_ids field
- full-deploy.sh was missing the run_migrations step entirely; added it
  after rebuild_containers so new role/field validators apply on every deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 16:05:17 +01:00
Vadym Samoilenko
b5e5ad7e42 fix: deploy.sh pull_code now works with monorepo structure
Some checks are pending
CI / Backend Lint & Test (push) Waiting to run
CI / Frontend Lint & Test (push) Waiting to run
CI / Integration Tests (push) Blocked by required conditions
CI / Build Backend Docker Image (push) Blocked by required conditions
CI / Build Frontend (push) Blocked by required conditions
CI / Security Scan (push) Waiting to run
CI / Dependency Check (push) Waiting to run
Was checking backend/.git and frontend/.git (submodule pattern) which
never exists — git pull silently skipped, deploying stale code.
Now pulls root repo first, falls back to submodule pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 11:50:20 +01:00
Vadym Samoilenko
31b7be0a2f chore: update check_job.py to dump full outputs structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:23:46 +00:00
Vadym Samoilenko
c32302ad2f chore: add debug script to check job placements and render order
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:22:59 +00:00
Vadym Samoilenko
64a3fa2bef chore: add one-off script to regenerate AD cue TTS with different voice
For replacing a single cue's voice (e.g., French Canadian → France French female)
without re-running the full pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:58:18 +00:00
michael
3ca70a7c03 fix: add rendering_video status to MongoDB schema validator
The rendering_video status was defined in job.py and frontend types but
was missing from the MongoDB schema validator, causing document update
failures when jobs transitioned to the rendering_video state.

Changes:
- Add migration script to update existing databases
- Update mongodb-init.js for new database setups

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 08:40:23 -06:00
michael
82c26bbc3a add script to mark old migrations as applied
For databases set up before migration tracking existed, this script
marks old migrations as "applied" in migration_history collection
so only new migrations will run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 13:26:51 -06:00
michael
e6578e0ccf add approved_source and qc_feedback job statuses to MongoDB schema
- Add migration to update jobs collection validator with new statuses
- Update mongodb-init.js for fresh deployments
- Fix deploy.sh to properly run migrations with 'python migrate.py up'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 13:12:14 -06:00
michael
9c9de7053c fix deploy script to install dev dependencies for build
The npm ci --only=production flag was skipping dev dependencies,
but TypeScript is needed to compile the frontend build.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 11:00:05 -06:00
michael
9fe193b4af adjusted deploy scripts to NOT make a backup of front end when deploying new one 2025-10-10 12:27:21 -05:00
michael
5e87a6fd94 adjust deploy scripts to include env vars 2025-10-10 11:34:28 -05:00
michael
d4b3efce3f adjusted deploy script to fix env vars being passed to containers 2025-10-10 10:48:25 -05:00
michael
665b49c3f1 added MSAL microsoft authentication 2025-10-10 09:19:39 -05:00
michael
67ceca2777 fixed auth token refresh again and added --frontend-only mode to full deploy script 2025-10-08 22:43:23 -05:00
michael
34fa64916c adjusted full deploy script 2025-10-08 22:33:46 -05:00
michael
990f6f6fa1 fixed session refresh and added full deploy script - and added documentation including videos 2025-10-08 22:29:08 -05:00
michael
aafc4078ae bug fixes for frontend when trying to npm run build 2025-10-08 16:47:14 -05:00
michael
1a1ed3048d wrote docker files and deployment instructions 2025-10-08 16:00:12 -05:00