Skip to content

fix(hooks): post-commit hook renders via tree-aware seam (#160 proposal B) - #162

Merged
dreamlx merged 2 commits into
masterfrom
fix/160-hook-tree-aware
Aug 14, 2026
Merged

fix(hooks): post-commit hook renders via tree-aware seam (#160 proposal B)#162
dreamlx merged 2 commits into
masterfrom
fix/160-hook-tree-aware

Conversation

@dreamlx

@dreamlx dreamlx commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Closes #160

提案 B 实现

run_post_commit_hook 不再对每个 affected dir spawn codeindex scan <dir>(hardcode detailed、覆盖 scan-all 层级),改为进程内构建一次 DirectoryTree,全部走 _process_directory_with_smartwriter(scan-all 同一 seam)——单一 writer 单一世界观,hook 输出与 scan-all byte-consistent。

白拿的语义

端到端实证(本仓真 hook)

本 commit 触发真实 post-commit hook,src/codeindex/README_AI.md 首次被 hook 写为 (navigation) 71 行——旧路径会写 391 行 detailed dump。漂移在源头消失。

测试

评审注意

…al B)

The hook spawned a per-dir `codeindex scan` subprocess, which hardcodes
level="detailed" + child_dirs=[] — every commit touching a hub dir
overwrote scan-all's navigation README with a full-subtree dump, and the
next scan-all flipped it back. One writer, one world-view: the hook now
builds one DirectoryTree and renders affected dirs through
_process_directory_with_smartwriter, byte-consistent with scan-all.

Inherits #158's 0-symbol skip + stale-README cleanup; newly added source
dirs now get a README (old exists() guard skipped them); per-dir
subprocess spawn + 120s timeout removed.
Updated by post-commit hook.
Update level: affected
@dreamlx
dreamlx merged commit a79289b into master Aug 14, 2026
8 checks passed
@dreamlx
dreamlx deleted the fix/160-hook-tree-aware branch August 14, 2026 18:17
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.

bug: post-commit hook 单目录 scan (hardcoded detailed) 覆盖 scan-all 层级化 README —— hub 目录形态震荡

1 participant