feat(points): P2 step 2.5 - generation_preview 预览生成 points gate #1942

Closed
xiaoxia wants to merge 8 commits from feat/points-gen-preview-gate into develop

8 Commits

Author SHA1 Message Date
CI Bot ae217f08be style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m59s
AI Code Review / AI Code Review (pull_request) Successful in 6m30s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 10s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 28s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m45s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 4m9s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m43s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 12m19s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 6m24s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 10m57s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 13m57s
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 12s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 43s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 11h32m7s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 11h39m6s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 11h44m49s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 11h38m23s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 11h40m14s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 11h40m14s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 11h40m15s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 11h43m37s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 11h43m37s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 11h54m36s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 11h31m14s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 11h31m21s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 11h31m23s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 11h38m20s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 11h38m20s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 11h43m37s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 11h44m17s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 11h44m17s
2026-09-15 19:20:04 +00:00
xiaoxia-agent 4938c1f996 test(points): add lipsync endpoint tests for insufficient/refund paths
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m14s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m50s
AI Code Review / AI Code Review (pull_request) Successful in 6m20s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 11s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 14s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m19s
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 12h6m58s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 12h6m11s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 12h6m12s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 12h6m12s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 12h6m23s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 12h6m23s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 12h12m32s
2026-09-16 02:55:27 +08:00
xiaoxia-agent ee428ab886 test(points): strengthen TTS/voice_clone endpoint tests for 402/refund paths to meet 40% diff coverage 2026-09-16 02:55:27 +08:00
xiaoxia-agent 66f9d58212 feat(points): P2 step 2.5 - wire generation_preview points gate (ai_video scene) 2026-09-16 02:55:27 +08:00
xiaoxia-agent fc4657d3f9 feat(points): P2 step 2.4 - wire generation_tasks points gate (ai_video scene) 2026-09-16 02:55:27 +08:00
xiaoxia-agent 6d90418a60 feat(points): P2 step 2.3 - wire scripts_ai 3 endpoints points gate
- extract_from_douyin: @points_gate("douyin_extract") 1分/次
- ai_rewrite: @points_gate("ai_rewrite") 1分/次
- ai_generate_titles: @points_gate("ai_title") 1分/次
- All gated by settings.points_enabled (default false)
- Refund on exception handled by decorator
- Renamed authenticated_user → current_user in route + tests for decorator compat
- 4 new points tests; 32+4=36 scripts_ai tests pass; 15472 total passed
2026-09-16 02:55:27 +08:00
xiaoxia-agent 5bcc969cb1 feat(points): P2 step 2.2 - wire lipsync points gate
- create_lipsync_job(): deduct ai_digital_human points (15/min), estimated from audio_duration (if provided) or script_text (chars/240), min 1 min; refund on ValueError/MediaKitError/Exception; refund on failed job
- preview_tts(): deduct ai_digital_human points by script_text length; refund on MediaKitError/Exception
- Both gated by settings.points_enabled (default false)
- Raises HTTP 402 INSUFFICIENT_POINTS on insufficient balance
- 14 new unit tests; 15468 total passed
2026-09-16 02:55:27 +08:00
xiaoxia-agent e8136b8c28 feat(points): P2 step 2.1 - wire TTS + voice_clone preview points gate
- synthesize(): deduct ai_voice points (1/min, est ceil(chars/240)), refund on workflow/Celery failure
- preview_tts(): deduct ai_voice points, refund on CosyVoiceError/ValueError
- get_voice_clone_preview(): deduct voice_clone_synth points (1/min), refund on CosyVoiceError/ValueError
- All points logic gated by settings.points_enabled (default false)
- Raises HTTP 402 INSUFFICIENT_POINTS when balance insufficient
2026-09-16 02:55:27 +08:00