feat(youtube): canonical sr_youtube_article tables and repository - #120
Merged
Merged
Conversation
Job tables for the derived YouTube AI article: pointers, versions, status and the eligibility result only; captions and articles stay in R2 under youtube/canonical/. sr_youtube_article is one row per (video_id, source_hash, prompt_version) shared by every bookmark of the video; sr_youtube_article_ref records which caption version each bookmark saw. Bookmarks are per user here (sr_bookmark is unique on target_url + private_user), so video_id is the canonical identity, not bookmark_id. Visibility is always decided by the bookmark. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018BfjDnY5W2Jbkh6i4atg31
DGuang21
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
为 YouTube AI 整理稿新增两张表和仓储,是整个功能的第一步(P0)。字幕和文章本身是 R2 对象,表里只放指针、版本、状态和门控结果。
sr_youtube_article:视频级,一行对应一个(video_id,source_hash,prompt_version)。字幕一变就是新行,旧文章不会盖到新字幕上。sr_youtube_article_ref:书签级,bookmark_id 唯一,记录书签抓取时看到的字幕版本。权限始终由书签决定,这张表和 R2 key 都不当权限用。YoutubeArticleRepo:recordEvaluation()(不覆盖已进入 generating/ready 的行)、linkBookmark()、findForBookmark()、unlinkBookmark()、countRefs()。prisma/migrations/20260909000000_add_youtube_article,与托管后端pg_migrations同名同内容。为什么用 video_id 而不是 bookmark_id:
sr_bookmark唯一键是(target_url,private_user),托管收藏时书签本来就是每个用户一份。验证
发布
先合这个 PR,再把托管后端 unnoo/slax_reader_backend 的
public-api指针换到 main。对应后端 PR 在同名分支feat/youtube-article-p0。细节见
20260909-youtube-article-p0.md。🤖 Generated with Claude Code
https://claude.ai/code/session_018BfjDnY5W2Jbkh6i4atg31