3 Commits

Author SHA1 Message Date
daymade 776b760c10 fix(github-sensitive-data-cleanup): 关闭 git 输出解码崩溃类 + 文档精确化(审阅轮 2) (#330)
代码(审阅 HIGH,已实跑复现):
- 全部 4 个脚本的 13 处 subprocess text=True 解码统一补 errors="replace"
  ——blob 通道(git grep, grep_all_commits)至今 strict 解码,GBK 编码
  源文件含命中行时 verify/scan 照样 UnicodeDecodeError 崩掉无报告;
  Lesson 9 的处方此前只落在 message 通道,现对该类整体闭环
- 验证:GBK 源文件含泄漏 → FAILED 且 blob+message 双通道各自定位
  commit hash(此前崩溃点);scan_repo 同仓 exit 0;GBK message 不崩

文档(审阅 LOW×2 + INFO×1):
- tooling_notes/SKILL.md/Lesson 7 的 git log 字面命令与实际
  --format=%H%x1f%B%x1e 不符,改为行为描述(hash 标注记录格式)
- tooling_notes/Lesson 9/CHANGELOG 补 commit_message_commits 前 10 截断说明
- CHANGELOG 修正 #328 的 --yes 修复面(Step 4 两块 + reference 节一块)
- Lesson 9 补记 blob 通道同类缺陷的发现与闭环 + 跨编码检测边界
  (errors=replace 防崩不让 UTF-8 pattern 命中 GBK 字节,归 Layer 4)

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-23 12:21:35 +08:00
daymade ef2a5d7775 fix(github-cleanup): address ultracode audit findings
- safe_push.py: let gh repo view infer repo from cwd; remove fallback
  defaults on forkCount/stargazerCount; abort on incomplete metadata
- rewrite_history.py: verify backup bundle with git bundle verify;
  check clean working tree before rewrite; verify git-filter-repo runs
- verify_cleanup.py: skip empty left-hand patterns from replacements
- evals.json: add refuses-no-verify-bypass eval
- SKILL.md: document .pii-patterns in .gitignore and backup verification

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-25 21:26:01 +08:00
daymade bfe3d19e5b feat(security): add github-sensitive-data-cleanup skill
Add a skill for scanning and removing sensitive data from GitHub repo
history. Includes:

- scan_repo.py: gitleaks + custom pattern scan
- rewrite_history.py: backup + git-filter-repo wrapper
- verify_cleanup.py: post-rewrite verification from replacements file
- safe_push.py: visibility check + safe force push
- references/incident-lessons.md: hard-won rules from real cleanups
- references/tooling_notes.md: git-filter-repo/BFG guidance
- evals/evals.json: test prompts

Also register the skill in .claude-plugin/marketplace.json.

All examples use safe placeholders; real private domains go in an
untracked .pii-patterns file.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-25 18:54:21 +08:00