You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 AI 代码审查声明:本 issue 由 AI 模型 Claude Fable 5(Anthropic,运行于 Claude Code)在一次完整代码审查中发现并撰写,经 @josephmqiu 授权提交。审查基于当前 main 分支 HEAD(commit c5ece53),逐行阅读了全部源码(tools/、prompts/、SKILL.md、README、示例)。
English TL;DR: umbrella issue for the remaining high/medium findings from a full AI-assisted code review at commit c5ece53 (critical items filed separately as #25-#28): iMessage direct mode matches nothing (handle.id is phone/email only + NULL-text/attributedBody), all parsers drop the user's side of conversations (defeating the interaction-pattern analysis the prompts require), the WeChat HTML parser truncates on nested tags, HEIC photos silently fall back to file mtime (and Pillow is suggested but never imported; no GPS code despite README), UTC vs local timezone inconsistency corrupts time-of-day signals, Instagram ingestion analyzes the account owner's own posts as the ex's voice, plus medium items (unreachable correction counter, stale rollback artifacts, overbroad triggers, correction routing mismatch, hardcoded gender). Happy to split any item out and submit PRs.
Important
🤖 AI 代码审查声明:本 issue 由 AI 模型 Claude Fable 5(Anthropic,运行于 Claude Code)在一次完整代码审查中发现并撰写,经 @josephmqiu 授权提交。审查基于当前 main 分支 HEAD(commit
c5ece53),逐行阅读了全部源码(tools/、prompts/、SKILL.md、README、示例)。背景
我们对本仓库做了一次端到端的代码审查。4 个最严重的问题已单独提交,每个都附了复现和修复建议:
--action backup,存档步骤必然失败"ex",第二个前任静默覆盖第一个(数据丢失)/delete-ex裸拼rm -rf exes/{slug},存在路径穿越风险另外两个已有 issue 我们也定位到了根因,已在对应帖子里补充:#12 / #24(生成的 skill 无法通过
/{slug}调用)、#5 / #6(管理命令无效)本质上是同一族问题——详见 #24 下的评论。本 issue 汇总其余的高/中优先级发现,都附了具体行号。维护者可以按需勾选,任何一条需要拆成独立 issue 或直接提 PR,请告知,我们乐意跟进。
高优先级(影响解析质量/正确性)
iMessage
--direct模式基本查不到消息(tools/imessage_parser.py:43-59)h.id LIKE '%target%'匹配,但handle.id只会是手机号或邮箱——文件自己的 docstring 示例--target "小美"必然返回 0 条;WHERE m.text IS NOT NULL会过滤掉新版 macOS 中存储在attributedBodyblob 里的大部分消息(近几年 macOS 上text字段大量为 NULL),即使手机号正确也几乎查不到;所有解析器只保留对方的消息,丢弃了用户这一侧(
imessage_parser.py的is_from_me = 0、sms_parser.py的type != "1"跳过、各文本解析器的target not in sender跳过)prompts/persona_analyzer.md要求提取「冲突模式」「她如何回应'你这样让我不舒服'」「吵架升级/修复循环」——这些是互动模式,只存在于一来一回的消息对里。只有单侧语料,分析器所需的数据在结构上就不可能提取出来。微信 HTML 解析器在真实导出文件上会截断/丢失消息(
tools/wechat_parser.py:37-70)handle_endtag不检查标签名:消息 div 内部只要出现任何嵌套标签(span/a/img,WechatExporter 的真实导出里很常见),第一个结束标签就会提前终止内容捕获,消息被截断;handle_data对 sender 是覆盖而非追加,嵌套标签会导致 sender 只剩最后一段;"content" in cls会误匹配message-content-box之类的 wrapper 类名,造成重复触发。iPhone 照片(HEIC)的时间线是错的(
tools/photo_analyzer.py:21-74)extract_exif_date只解析 JPEG;HEIC(iPhone 默认格式)会静默 fallback 到文件 mtime——导出/拷贝过的照片,mtime 是拷贝日期而不是拍摄日期,整条时间线失真且无任何警告;requirements.txt提示安装 Pillow 可获得「更好的 EXIF 支持(HEIC、TIFF)」,但photo_analyzer.py从未 import Pillow,装了也没有任何效果;时间戳时区不一致:iMessage/SMS 用 UTC 输出(
imessage_parser.py:72、sms_parser.py:58)——对中国用户所有时间偏移 8 小时,直接破坏「深夜消息」「回复间隔」这类分析器明确要挖掘的信号;而 Instagram 解析用的是本地时区(social_media_parser.py:161),各来源互相矛盾。建议统一用本地时区(或显式参数)。Instagram 数据导入的是"错误的人"(
tools/social_media_parser.py:141-176)parse_instagram完全忽略--target参数(代码注释也承认了这点),结果是把用户自己的帖子文案当作前任的语料喂给 persona 分析。中优先级
corrections_count永远不会增长:update_skill()的correction参数从 CLI 不可达(main()没有--correction参数,skill_writer.py:304-374),而 SKILL.md 的纠正流程用Edit直接改文件、绕过了该工具——meta 里的纠正计数和版本号都不会更新。tools/version_manager.py:50-87):只恢复 SKILL.md/memories.md/persona.md,memories_skill.md/persona_skill.md不在存档范围,回滚后与主文件脱节;{v}_before_rollback备份目录在重复回滚时被静默覆盖;版本号被改成v2_restored污染排序;MAX_VERSIONS清理逻辑存在但没有任何流程会自动调用。/update-ex)或限定在 ex-skill 会话上下文内。prompts/correction_handler.md规定记忆类纠正写入memories.md的「Correction 记录」节,但memories_builder.md模板和示例文件里都没有这个章节(只有 persona.md 有),Edit 追加时会产生结构不一致。"gender": "女"(SKILL.md:243,限制了项目适用范围);消息分类里超过 50 字的情感消息只会进「长消息」桶(*parser.py的extract_key_content);[表情]等占位符被整条过滤(wechat_parser.py:115-126),把 persona 明确依赖的表情包使用习惯信号也一并丢掉了。说明
c5ece53的源码阅读;[AI审查][Bug] SKILL.md 进化流程调用了不存在的 version_manager.py --action backup,存档步骤必然失败 #25/[AI审查][Bug] 未安装 pypinyin 时中文昵称 slug 全部退化为 "ex",创建第二个前任会静默覆盖第一个(数据丢失) #26 中的关键结论已在本地实际运行复现。English TL;DR: umbrella issue for the remaining high/medium findings from a full AI-assisted code review at commit c5ece53 (critical items filed separately as #25-#28): iMessage direct mode matches nothing (handle.id is phone/email only + NULL-text/attributedBody), all parsers drop the user's side of conversations (defeating the interaction-pattern analysis the prompts require), the WeChat HTML parser truncates on nested tags, HEIC photos silently fall back to file mtime (and Pillow is suggested but never imported; no GPS code despite README), UTC vs local timezone inconsistency corrupts time-of-day signals, Instagram ingestion analyzes the account owner's own posts as the ex's voice, plus medium items (unreachable correction counter, stale rollback artifacts, overbroad triggers, correction routing mismatch, hardcoded gender). Happy to split any item out and submit PRs.