feat(identity): web metadata enrichment for titles missing on TMDB (META-1)

- metadata.enrich (propose, low, replay safe): normalized-title cache (kv_cache
  region enrich, 7 days) -> daily budget -> web.search (title + 短剧 / 电视剧 平台,
  second query limited to whitelist via site:) -> web.fetch of up to 3 relevant
  whitelisted pages (registered site domains never read, redirects out of the
  whitelist dropped) -> upstream model extraction with rule fallback -> server-side
  evidence check (rule_confirmed / multi_evidence / needs_review). Suggestion only.
- POST /identity-pool/{id}/enrich (suggest) and /enrich/apply (console session):
  provisional entity or same-title merge, season/episode units, field-level
  metadata with source web/agent + evidence, aliases, release assignment.
  Poster proxy GET /img/enrich/{id} (og:image from whitelisted pages only).
- Auto-enrich once per pool entry when subscription/rule lookups find nothing on
  TMDB (identity.autoEnrich, off by default); identity.enrichDailyBudget,
  identity.enrichDomains settings; web.fetch now returns og:image.
- Pool sheet "元数据补全" section; entity detail shows evidence links.
- Migration 0049_enrichment (metadata_enrichment, metadata_field.evidence, source
  web). Requires image rebuild / api + worker restart to take effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 15:57:48 +08:00
1 parent 18a5cf1de7
commit f4666a4671
36 files changed
+2514 -25

No files matched your search

+27
View File
@@ -228,6 +228,7 @@ export const METADATA_SOURCE: Record<string, string> = {
nfo: "NFO",
site: "站点",
import: "导入",
web: "网页",
};
/** 可覆盖/锁定的作品字段(contracts EntityMetadataField) */
@@ -240,6 +241,32 @@ export const ENTITY_FIELD_LABEL: Record<string, string> = {
originalLanguage: "原始语言",
originCountry: "出品地区",
posterPath: "海报",
backdropPath: "背景图",
platform: "播出平台",
episodeCount: "集数",
genres: "类型",
posterUrl: "网页海报",
};
/** 补全字段(contracts EnrichFieldName) */
export const ENRICH_FIELD_LABEL: Record<string, string> = {
title: "标题",
aliases: "别名",
year: "年份",
platform: "播出平台",
episodeCount: "集数",
synopsis: "简介",
posterUrl: "海报",
genre: "类型",
};
/** 补全来源链接被跳过的原因 */
export const ENRICH_SKIPPED: Record<string, string> = {
not_allowed: "不在白名单",
site: "已登记站点",
irrelevant: "标题对不上",
limit: "超出读取条数",
error: "读取失败",
};
export const UNIT_KIND: Record<string, string> = { season: "季", episode: "集", special: "特别篇", part: "分段" };