Repository navigation
hook-manager: add an overcommit adapter #1821
Copy link
Copy link
Closed
Labels
capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)Framework / 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)Tool capability: git-hook managers under the secure setup (install target, sandbox / host homes)family:ci.github workflows, prek, validators.github workflows, prek, validatorsfamily:docsDocs, MISSION.md, READMEsDocs, MISSION.md, READMEsfamily:setupsetup-* skillssetup-* skillsfamily:toolstools/*tools/*good first issueGood for newcomersGood for newcomerssubstrate:framework-devTool substrate: build / validate / eval the framework itselfTool substrate: build / validate / eval the framework itselfsubstrate:sandboxTool substrate: agent isolation, egress control, settings auditTool substrate: agent isolation, egress control, settings audit
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.
prek is the only adapter so far.
This issue adds overcommit (Ruby).
What the source says (overcommit v0.73.0)
- Install target. It reads
git config --get core.hooksPath(unscoped, so it sees the global value and anyGIT_CONFIG_*override;git_config.rb:16-21,utils.rb:62-75) and falls back to--git-common-dir/hooks only when that is empty.
It does not refuse: under the whole-user setup it installs into~/.claude/git-hooks/, andpreserve_old_hooksmoves the dispatcher's symlinks intoold-hooks/(installer.rb:32-37, 131-145).
That replaces the dispatcher for every repository on the host. - Self-update on every run. Each hook run re-checks its installation through the same path (
template-dir/hooks/overcommit-hook:66-70,installer.rb:50-58).
From reading the code (not run): behind the dispatcher,compare_filelooks for~/.claude/git-hooks/overcommit-hook, getsENOENT, and the generic rescue fails the hook. - Fix. Run both the install and the chained hook with
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0="$(git rev-parse --path-format=absolute --git-common-dir)/hooks".
Use the absolute path: git treats an emptycore.hooksPathas set, so hooks would then resolve against/.
(overcommit itself treats empty as "default", but other tools in the same process tree do not.) - Trigger.
overcommit --install; a~/.claude/bin/overcommitshim catches it unless run throughbundle exec. - Home. None of its own.
- Generated hook.
#!/usr/bin/env ruby; takes the hook type fromFile.basename($0), so it must be exec'd by its real path; reads.overcommit.ymlfrom the working directory. Skip:OVERCOMMIT_DISABLE. - Detection.
.overcommit.ymlat the root; hook markerovercommit.
What to do
- Add a
hooks-path-envinstall strategy totools/agent-isolation/hook-manager-shim.shand toSTRATEGIESintools/dev/sync-hook-managers.py.
Note the subcommand is a flag (--install), not a word; the shim'sinstall_subcommandhandling may need to allow that. - Make the dispatcher export the same override when it chains into a hook whose repository uses overcommit (the registry needs a field for "needs the override at run time too").
- Add the
overcommitadapter totools/hook-manager/registry.json, runtools/dev/sync-hook-managers.py, and add shim and dispatcher tests. - Verify the self-update behaviour by running it, and record the result in the contract.
Acceptance
overcommit --installthrough the shim writes to the common dir and leaves~/.claude/git-hooks/untouched.- A commit in an overcommit repository runs its hooks behind the dispatcher without the self-update failing.
prek run --all-files --skip workspace-pytestand the affected tests pass.
Metadata
Metadata
Assignees
Labels
capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)Framework / 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)Tool capability: git-hook managers under the secure setup (install target, sandbox / host homes)family:ci.github workflows, prek, validators.github workflows, prek, validatorsfamily:docsDocs, MISSION.md, READMEsDocs, MISSION.md, READMEsfamily:setupsetup-* skillssetup-* skillsfamily:toolstools/*tools/*good first issueGood for newcomersGood for newcomerssubstrate:framework-devTool substrate: build / validate / eval the framework itselfTool substrate: build / validate / eval the framework itselfsubstrate:sandboxTool substrate: agent isolation, egress control, settings auditTool substrate: agent isolation, egress control, settings audit
Activity
TejasS1233 commentedon Oct 28, 2026
I implemented this and opened #1893.
feat(agent-isolation): add the overcommit hook-manager adapter
feat(agent-isolation): add the overcommit hook-manager adapter
feat(agent-isolation): add the overcommit hook-manager adapter (#1893)