feat(claude-code-history-files-finder): extract-user-messages script (Core Operation 5, v1.39.0) - #274
Merged
Merged
Conversation
…(Core Operation 5, v1.39.0) New scripts/extract_user_messages.py: verbatim user-message extraction across all homes + archives, operationalizing the v1.38.0 contamination taxonomy — command envelopes, frequency-detected injected boilerplate (both shapes), image placeholders, document pastes, agent-voiced re-injection (earlier-texts only) — plus attachment.queued_command recovery with delivered-record dedupe. 10 unit tests; real-corpus run matches the hand-built reference extraction. Excluded from this commit: analyze_sessions.py + session_file_format.md carry a parallel session's uncommitted triage work-in-progress. Co-Authored-By: Claude <noreply@anthropic.com>
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.
把 v1.38.0 写进 references 的污染分类法变成可执行能力:
scripts/extract_user_messages.py一条命令产出「用户原话」阅读页(HTML+MD)。过滤栈(全部经过真实 7 天多 profile 语料验证):命令信封(XML + 裸
/cmd,保留 args)→ 附录;hook/loop 注入 boilerplate 频率泛化检测(同文长文本 ≥ min-dup,零硬编码模式,独立成条 + 尾部混排两种形态都收)→ 附录;[Image #N]剥除;长文粘贴(≥2000 字符且 ASCII≥60%,实测不误伤中文语音长输入)→ 附录;agent 腔回灌只对更早的 assistant 语料做同文/包含减法(后来的复述不吃用户原话);attachment.queued_command中途输入回收 + 与正式投递记录 120s 去重。验证:10 个新单测(含 agent 减法的时间方向双向标定、boilerplate 两种形态、queued list 变种);skill 全量 78 测试绿;回归审计 0 候选/613 保留;quick_validate ✅;security_scan ✅;真实语料跑出 1100 条主区,与手工基准逐条对账,全部差异可归因(窗口滑动 + 一条只有用户能确认的 agent 腔条目)。
显式排除:
analyze_sessions.py+session_file_format.md当前工作区改动是另一 session 未提交的 triage WIP,不在本 PR。🤖 Generated with Claude Code