Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

test(seed): 核验仅本机导入人物不进入公开种子

longmeidao79d565fd1065
diff --git a/docs/adr/0106-seed-correction-history-and-explicit-withdrawals.md b/docs/adr/0106-seed-correction-history-and-explicit-withdrawals.md
index 63d8b6c60..74cc02188 100644
--- a/docs/adr/0106-seed-correction-history-and-explicit-withdrawals.md
+++ b/docs/adr/0106-seed-correction-history-and-explicit-withdrawals.md
@@ -33,6 +33,8 @@
种子更新仍通过只读导出、差异复核与独立数据提交。来源链接、编号和文字资料可进入包;图片与真实媒体不在范围内。导出不写真实账本。新迁移只建立种子导入历史表,真实环境应用仍按项目迁移授权、备份和核验流程执行。
+国内个人成人内容创作者的资料只有在公开身份依据可核对、艺名与账号或平台档案的对应关系明确时才进入种子。只有本机 Stash 导入、文件名、转载称呼或未经复核的别名关系时,不纳入分发;来源置信度分数不能代替身份依据。发版复核保留可核对的来源与对应关系,未取得依据的条目留在本机。v2 导出过滤 Stash 来源别名与编号,没有其他可分发事实的实体不进入包。停止收录不等于证明旧断言错误,不据此删除本机资料或生成撤销。
+
## 验证
临时账本覆盖精确撤销、接收端手工资料保护、更正编号补入、相同抓取时间的资料纠错、重复与跳版本导入、旧包回放、历史撤销遗漏、损坏包拒绝及运行时回滚。真实资料的具体撤销另有复核产物;不能以这些机制测试代替事实核验。
diff --git a/tests/test_seed_corrections.py b/tests/test_seed_corrections.py
index 44322b350..77b7d840b 100644
--- a/tests/test_seed_corrections.py
+++ b/tests/test_seed_corrections.py
@@ -280,3 +280,22 @@ class CorrectionTests(SeedPackCase):
self.assertEqual(pack["entities"][0]["aliases"], [])
self.assertEqual(pack["withdrawals"], [])
+ def test_local_import_only_people_remain_local(self):
+ local_people = (("古河君", "古河X沐沐", "61"),
+ ("小芽芽不乖", "91社区21442644", "63"))
+ with self.source:
+ for name, other_name, external_id in local_people:
+ person = entity(self.source, "performer", name)
+ alias(self.source, person, other_name, "stash:performer")
+ ref(self.source, person, "stash", external_id)
+ snapshot = {
+ table: [tuple(row) for row in self.source.execute(f"SELECT * FROM {table} ORDER BY 1")]
+ for table in ("entity", "entity_alias", "entity_external_ref")}
+ pack = self.pack(1)
+ self.assertEqual([item["name"] for item in pack["entities"]], ["天川そら"])
+ self.assertEqual(pack["counts"]["entities"], 1)
+ self.assertEqual(pack["withdrawals"], [])
+ self.assertEqual(snapshot, {
+ table: [tuple(row) for row in self.source.execute(f"SELECT * FROM {table} ORDER BY 1")]
+ for table in snapshot})
+