Skip to content

feat(claude-md-progressive-disclosurer): hotspot-first profiling + scripted section sink + compression-fidelity audit (Case 19) - #277

Merged
daymade merged 2 commits into
mainfrom
feat/cmpd-hotspot-first-case19
Aug 7, 2026
Merged

feat(claude-md-progressive-disclosurer): hotspot-first profiling + scripted section sink + compression-fidelity audit (Case 19)#277
daymade merged 2 commits into
mainfrom
feat/cmpd-hotspot-first-case19

Conversation

@daymade

@daymade daymade commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Feeds a real 168KB-global-CLAUDE.md optimization session back into the methodology (suite daymade-claude-code 1.41.0 → 1.42.0):

  • Step 2.0 hotspot profiling (new): measure before proposing — /context share, per-section byte table (descending order = work order, same-level comparison caveat), line-length distribution, and consumer truncation caps (Codex project_doc_max_bytes silently hid 41% of the file for weeks). Instrument pitfalls encoded: fence-unaware heading regex fabricates phantom sections; chars/4 underestimates CJK >2x.
  • Step 3 scripted whole-section sink: scripts/sink_sections.py — fence-aware extraction → verbatim append with dated provenance → bottom-up splice → whole-string verification → rollback; refuses targets whose path crosses a symlink at any component (file OR parent dir) with --allow-symlinked-target escape.
  • Step 5b compression-fidelity audit: qualifier-level word diff (a live audit caught "0 stars/forks" → "0 stars") + expected-hunks-only diffing.
  • Carrier table: official ~/.claude/rules/ + paths: frontmatter (file-trigger boundary stated), <200-line target, /doctor trim check, HTML-comment maintainer notes.
  • scripts/profile_claude_md.py (new), references Case 19, CHANGELOG entry, description +2 trigger phrases (1011/1024).

Verification

  • quick_validate ✅ · regression audit compare/classify/verify ✅ (1 candidate, preserved) · security_scan ✅ · PII guard ✅ · check_marketplace ✅ · check_doc_skill_lists ✅
  • Independent fresh-context review (2 rounds recorded): round 1 found HIGH-1 — the symlink guard's file-only islink check was bypassed by a symlinked parent directory in live testing; fixed via realpath != abspath and calibrated in both directions (dir-symlink ABORT / flag allow / EOF section / duplicate-heading abort), plus 6 LOW fixes.
  • Both scripts exercised on real corpus (the 92KB CLAUDE.md this session produced).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NvNKng24noMLREHpRmpTWN

daymade and others added 2 commits August 7, 2026 09:20
…下沉脚本化 + 压缩保真审计(案例 19)

真实 168KB 全局 CLAUDE.md 优化 session 反哺:热点排序缺位被用户当场打断、
Codex project_doc_max_bytes 静默截断 41% 数周、压缩重述丢限定词(/forks)
被独立审计抓出。新增 scripts/profile_claude_md.py(分节字节表=工作顺序、
fence 假节守卫、CJK token 比率)与 scripts/sink_sections.py(verbatim 下沉
事务:提取→追加→自底向上替换→整串验证→回滚,拒写 symlink 目标)。
载体表补官方 ~/.claude/rules/ paths 机制与 <200 行目标。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvNKng24noMLREHpRmpTWN
…ard 补目录级盲区(HIGH) + 6 LOW

HIGH-1: 文件级 islink 被父目录 symlink 静默穿透(审阅实测打穿),改
realpath≠abspath 判定 + --allow-symlinked-target 显式放行;四条路径双向标定
(dir-symlink ABORT / flag 放行 / EOF 末节 / 重名标题 abort)。LOW: EOF 末节
支持、重名唯一性检查、snippet 保留标题行入文档、父节含子节提示、案例 19
size 数字加"非通过条件"注记、164/168KB 时点澄清、分隔线。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvNKng24noMLREHpRmpTWN
@daymade
daymade merged commit 1809c27 into main Aug 7, 2026
4 checks passed
@daymade
daymade deleted the feat/cmpd-hotspot-first-case19 branch August 7, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant