Should Maka install local validation hooks by default? #4156
Replies: 3 comments 1 reply
|
Thanks for splitting this out — and for the recovery section, which is the part I'd have asked about first. The pre-commit half I think is worth having. Biome, ASF headers, and the protocol epoch guard are exactly the things that get missed and then cost a push-and-wait cycle to discover. Catching them locally is a real saving, and the checks are ones we already own. Whether it's installed by default shouldn't be decided by whoever happens to be in this thread. It changes every contributor's local environment, including people who have never hit the problem, and the ones who'd feel it most are the ones not reading this discussion. So let's settle that one by vote here. Please reply with one of:
PPMC votes are binding; everyone else, please vote anyway — this affects contributors more than it affects committers. I'll leave it open at least 72 hours, longer if discussion is still active, and summarize the outcome here. The commit-msg half I don't think earns its place, independently of that vote. commitlint here is just If we want a commit-message hook, the rule worth enforcing is the one CONTRIBUTING actually places on individual commits: the 简体中文感谢你把这件事单独拿出来讨论——尤其是那一节「本地控制与恢复」,那正是我首先会问的部分。 pre-commit 这一半我认为值得做。 Biome、ASF 头、协议 epoch guard,恰恰是最容易漏、又要等一轮 push 才能发现的东西。在本地拦住确实省事,而且这些检查本来就是我们自己的。 但「是否默认安装」不该由恰好在这个帖子里的人决定。 它会改变每一位贡献者的本地环境,包括那些从未遇到过这个问题的人;而受影响最大的,恰恰是不会读到这个讨论的人。 所以这一条我们在这里投票决定。请回复以下之一:
PPMC 成员的投票具有约束力;其他人也请参与投票——这件事对贡献者的影响大于对 committer 的影响。我会至少留 72 小时,若讨论仍在进行则延长,并在此汇总结果。 commit-msg 这一半,无论投票结果如何,我都认为不值得。 这里的 commitlint 就是 如果我们确实想要一个 commit-message hook,值得强制的是 CONTRIBUTING 真正施加在单个 commit 上的那条规范:当 AI 撰写了改动的实质部分时,加上 (Drafted with AI assistance; I verified the hook scripts, the commitlint config, and the CONTRIBUTING rules myself.) |
|
@Astro-Han I've already removed the commit-msg half. |
Uh oh!
There was an error while loading. Please reload this page.
Context
PR #4132 proposes installing Husky hooks during normal root dependency setup. The goal is to run existing repository checks before a branch is pushed, especially when an agent-assisted change violates a repository assumption.
Today those failures often appear only in CI, which adds an avoidable edit, push, and wait cycle.
Proposed behavior
A regular
npm installornpm ciwould install two hooks:pre-commitchecks staged changes with Biome, checks ASF headers on new files, runs the Runtime Host protocol epoch guard, and runsgit diff --cached --check.commit-msgvalidates Conventional Commit messages with commitlint.The hooks reuse existing repository checks. CI remains the authority.
Local control and recovery
This changes every local commit, including intermediate commits.
git commit --no-verify.HUSKY=0.npm ci --omit=devdoes not install Husky. The prepare script skips hook setup when Husky is absent.npm installto restore the local tools, or bypass the hooks intentionally.Questions
Implementation: #4132
All reactions