Skip to content

git hook 集成不感知 core.hooksPath(husky)——post-commit README_AI 再生静默全量失效 #176

Description

@dreamlx

Dogfood 实证(BlueHawkLock,husky v9 项目,后果已实际发生)

core.hooksPath = .husky/_(husky v9 标准),.git/hooks/* 整体被旁路。结果:post-commit 的 README_AI 再生从未在跑——

  • 最近 7+ 个代码 commit 无一再生(含新增纯函数 interpretDownloadB1Verify,全库 README_AI.md 零命中)
  • apps/mobile/src/services/ble/utils/README_AI.md mtime 停留在最后一次手动 scan,早于其后所有代码提交
  • CLAUDE.md(codeindex 生成段)把「post-commit hook 没触发」当例外场景列出三种情况(纯文档 commit / 刚启用 hook / 历史 stale),但在 husky 项目里是常态静默失效——用户以为索引在自动维护,实际全靠手动

附带诊断盲区:codeindex hooks status 只显示 pre-commit / pre-push 两行,post-commit 的在位状态不可见,无法诊断。

建议

  1. hooks install/statusgit config core.hooksPath
  2. 检测到 husky(.husky/ 存在)时写 .husky/<hook>(husky v9 shim 会执行),否则警告 + 手动指引
  3. hooks status 覆盖 post-commit 并做旁路检测

(同类问题已在 LoomGraph 开 issue:dreamlx/LoomGraph#164——两个项目的 hook 集成可以共用一套 hooksPath 探测逻辑。)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions