fix: ungate anonymous Video Pack v0 emit on paste-URL - #1612
Conversation
Home paste was public but POST /api/video/pack and /api/v1/video/pack were session-gated after #1609, so identity packs never emitted. Allowlist those exact paths, alias the v1 Next.js route, and show the cite/hash even when transcript fetch fails. Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
| @@ -0,0 +1 @@ | |||
| export { POST, runtime } from '../../../video/pack/route'; | |||
CoS lock: anonymous paste must emit identity Video Pack v0 even without a transcript. Verification requires source_url + source_hash; missing either is a visible failure, not an empty UI. Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Public exposure currently permits unsafe backend path inputs and unbounded anonymous cache growth.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Ungates anonymous Video Pack v0 generation and preserves its citation when transcript extraction fails.
Changes:
- Publicly allowlists exact Next.js pack routes and adds a v1 alias.
- Ungates the FastAPI pack endpoint.
- Displays and tests stable identity-pack citations.
File summaries
| File | Description |
|---|---|
tests/unit/test_api_key_auth.py |
Tests anonymous FastAPI access. |
src/youtube_extension/videopack/PLAN.md |
Updates implementation plan. |
src/youtube_extension/backend/middleware/api_key_auth.py |
Publicly allowlists pack API. |
apps/web/src/store/__tests__/dashboard-store.test.ts |
Tests pack retention after transcript failure. |
apps/web/src/lib/studio-pipeline-status.ts |
Formats citations and outcomes. |
apps/web/src/lib/auth-paths.ts |
Ungates and reclassifies pack routes. |
apps/web/src/lib/__tests__/video-pack.test.ts |
Tests speech-free identity packs. |
apps/web/src/lib/__tests__/studio-pipeline-status.test.ts |
Tests citation messaging. |
apps/web/src/lib/__tests__/auth-paths.test.ts |
Tests auth and metering policy. |
apps/web/src/components/OneLoopStudio.tsx |
Displays persisted pack details. |
apps/web/src/app/api/v1/video/pack/route.ts |
Adds the v1 route alias. |
apps/web/src/app/api/v1/video/pack/__tests__/route.test.ts |
Tests v1 pack responses. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Identity Video Pack v0: version + video_id hash. Public home paste | ||
| # must emit this without an API key and without speech evidence. | ||
| "/api/v1/video/pack", |
| '/api/video/pack', | ||
| '/api/v1/video/pack', |
| "/api/v1/health", | ||
| # Identity Video Pack v0: version + video_id hash. Public home paste | ||
| # must emit this without an API key and without speech evidence. | ||
| "/api/v1/video/pack", |
* fix(web): parse v1 video pack runtime at compile time (#1613) Next cannot statically parse re-exported `runtime` from the v1 pack alias, which failed v0-uvai `next build` after #1612. Declare a literal runtime and call the shared identity-pack POST handler instead. Co-authored-by: Hayden <groupthinking@users.noreply.github.com> * docs(videopack): record v1 pack runtime parse verification Co-authored-by: Hayden <groupthinking@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
package.json requires @ai-sdk/gateway@^4.0.55 and postcss@^8.5.26 but the lockfile pinned @ai-sdk/gateway@4.0.23 and postcss@8.5.21 (apps/web nested). npm ci --workspace=apps/web --production --legacy-peer-deps aborted at the integrity check, causing the trivy Security Scan job to fail before it could run any vulnerability scans (seen on PRs #1609, #1612, #1621, and on main). Regenerated lockfile with npm install --package-lock-only. Only package-lock.json is touched; no application code changed. Verified: - npm ci --workspace=apps/web --production --legacy-peer-deps: exit 0 - npm ci (full dev): exit 0 - apps/web test suite: 509/509 passed - google/gemini-3.8-flash model pin: unchanged Closes #1624 Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
…1625) package.json requires @ai-sdk/gateway@^4.0.55 and postcss@^8.5.26 but the lockfile pinned @ai-sdk/gateway@4.0.23 and postcss@8.5.21 (apps/web nested). npm ci --workspace=apps/web --production --legacy-peer-deps aborted at the integrity check, causing the trivy Security Scan job to fail before it could run any vulnerability scans (seen on PRs #1609, #1612, #1621, and on main). Regenerated lockfile with npm install --package-lock-only. Only package-lock.json is touched; no application code changed. Verified: - npm ci --workspace=apps/web --production --legacy-peer-deps: exit 0 - npm ci (full dev): exit 0 - apps/web test suite: 509/509 passed - google/gemini-3.8-flash model pin: unchanged Closes #1624 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
Closes #1611
#1610 was closed by #1609 (
5ccbdf7) but live uvai.io still failed: anonymousPOST /api/video/packandPOST /api/v1/video/packreturned401 {"error":"Authentication required"}. Home paste+Run then showed "No transcript yet" / "source evidence could not be verified" with no pack JSON,source_url,source_hash, orcite:youtube.CoS lock (do not skip)
source_url+source_hash.Canonical issue
Closes #1611 (open). #1610 is already closed; GitHub issue create returned 403 from this agent.
Outcome
Anonymous paste-URL emits a hashed Video Pack v0 tied to the YouTube video ID without sign-in and without waiting on speech evidence. The persisted/shown pack JSON includes
source_urlandprovenance.source_hash. Missing either field is a visible verification failure. Same URL retry reuses the same hash; a different video ID gets a different hash.Scope
/api/video/packand/api/v1/video/pack(siblings/api/videoand/api/video/generatestay gated)POST /api/v1/video/pack→ existing 1609 identity handler/api/v1/video/packverifyIdentityPackfail-closed: requiressource_url(http) + 64-charsource_hashsource_url+source_hash) even when transcript is missingRisk
Verification
Head:
b333a393ecd apps/web && npx vitest run src/lib/__tests__/auth-paths.test.ts src/lib/__tests__/video-pack.test.ts src/lib/__tests__/emit-video-pack.test.ts src/lib/__tests__/studio-pipeline-status.test.ts src/app/api/video/pack src/app/api/v1/video/pack src/store/__tests__/dashboard-store.test.ts→ 76 passedPYTHONPATH=src pytest tests/unit/test_api_key_auth.py tests/unit/test_videopack_identity.py tests/unit/test_videopack_store.py -o addopts=→ 23 passedauJzb1D-fag→2778c5fc08a1b7f19fe0a83bca959e24ecf20040c3cc1a3b6edd244d68c5e4ea;jNQXAC9IVRw→97150a5c21eef3d12a4543ce2108ca28fd6f829db1da120d7e75655ab471f97dProduction evidence
Reproduced on live uvai.io before this change (anonymous):
Production will stay 401 until this branch deploys to Vercel project
v0-uvai. Unit evidence is above.Agent handoff
Closes #1611)