Repository navigation
Closed
Labels
capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)contract:hook-managerTool capability: git-hook managers under the secure setup (install target, sandbox / host homes)family:ci.github workflows, prek, validatorsfamily:docsDocs, MISSION.md, READMEsfamily:setupsetup-* skillsfamily:toolstools/*good first issueGood for newcomerssubstrate:framework-devTool substrate: build / validate / eval the framework itself
Description
The hook-manager contract (#1819) defines how the secure agent setup integrates a git-hook manager: where its install puts the hook, how its home is split between sandboxed and host runs, and how the setup detects that a repository uses it.
Several managers already install into the repository's own hooks dir whatever the global core.hooksPath says, so they need no install fix, only a registry entry (install.strategy: none, which the contract lists as planned) and documentation.
This issue covers them.
What the source says
- simple-git-hooks 2.14.0 (JavaScript). Reads only
git config --local core.hooksPath, else<common dir>/hooks, with worktreecommondirresolution (simple-git-hooks.js:60-96, 246-266). It ignores the global value, so it already lands where the dispatcher chains.
Runs from the packagepostinstall. It overwrites an existing hook without a backup (:292-303). Skip install:SKIP_INSTALL_SIMPLE_GIT_HOOKS; skip hooks:SKIP_SIMPLE_GIT_HOOKS=1. No home. Config: asimple-git-hookskey inpackage.json, or.simple-git-hooks.{js,cjs,json}/simple-git-hooks.{js,cjs,json}(confirm the list). - cargo-husky v1.0.1 (Rust). A
build.rsin a dev-dependency walks up fromOUT_DIRto.gitand writes<gitdir>/hooks(build.rs:49-73, 154-164), ignoringcore.hooksPath.
It does not handle a.gitfile, so it fails withGitDirNotFoundin a linked worktree, and aCARGO_TARGET_DIRoutside the repository breaks it too. Never touches a foreign hook. No home of its own. - Maven: git-build-hook 3.6.0 and git-code-format-maven-plugin 1.25 (Java). Both write JGit's
getGitDir()/hooksand ignorecore.hooksPath.
git-build-hook'sconfiguregoal can write any repository config key (GitConfigMojo.java),core.hooksPathincluded, which bypasses the dispatcher the same way husky does.
Not yet checked: JGit's behaviour in a linked worktree, and the generated hook scripts. - Not yet researched: Gradle hook plugins, and Go hook tools other than lefthook.
What to do
- Implement
install.strategy: noneintools/dev/sync-hook-managers.py(no shim case; the install skill installs no shim for it). - Add registry entries for simple-git-hooks, cargo-husky and the two Maven plugins, with their detection rules, and run
tools/dev/sync-hook-managers.py. - Check the open points above (JGit in a worktree, the Maven hook scripts), and add Gradle plugins and Go tools if any need an adapter.
- Document the cargo-husky worktree limitation and the git-build-hook
configurecaveat in the contract's adapter table and indocs/setup/secure-agent-setup.md.
Acceptance
- Each manager's behaviour under the whole-user dispatcher is confirmed by running it once (install, then a commit that runs its hook), and recorded in the contract.
prek run --all-files --skip workspace-pytestand the dev tests pass.
Metadata
Metadata
Assignees
Labels
capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)contract:hook-managerTool capability: git-hook managers under the secure setup (install target, sandbox / host homes)family:ci.github workflows, prek, validatorsfamily:docsDocs, MISSION.md, READMEsfamily:setupsetup-* skillsfamily:toolstools/*good first issueGood for newcomerssubstrate:framework-devTool substrate: build / validate / eval the framework itself
Activity
feat(hook-manager): register managers that need no install fix (#1825) (