O-6 md5 指纹组装单点化(S-P2-1) #277
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
排期规划 O-6(S-P2-1):指纹组装逻辑分散多处,漂移风险(同 A-20260910-004 菜单漂移)。
处理动作
验收标准
关闭凭证核验 (2026-10-09)
backend/app/services/fingerprint.py:md5_hex/complaint_dedup_hash/staff_unique_key三个函数78e4e32complaint_sync._dedup_hash、upsert/_complaints._complaint_dedup_hash、scrm_staff_service.build_staff_unique_key三处均改为from app.services.fingerprint import ...委托;grep -rn "hashlib" backend/app/services/仅剩安全用途(sha256/hmac)与 complaint_scope 明文 key(非 md5,不在范围)78e4e32backend/tests/test_fingerprint_single_source.py::test_complaint_dedup_hash_byte_identical/test_staff_unique_key_byte_identical:旧实现原样内联做基准,覆盖空值/None/空白/中文/超长/含"|"样本逐条比对test_staff_none_config_id_maps_to_zero_not_empty显式断言 None 映射为"0"而非空串tests/test_sn_backfill.py+test_dedup_dup_import.py+test_device_dim_filter.py共 52 项全部通过backend/.venv/bin/python -m pytest tests/test_fingerprint_single_source.py tests/test_sn_backfill.py tests/test_dedup_dup_import.py tests/test_device_dim_filter.py -q备注:纯重构无语义变更,已推送 origin/main(
4aff092);随下一批改动合并部署。