feat(internal-dev): per-repo daemon auto-reload post-commit hook - #210
Open
alex-mextner wants to merge 1 commit into
Open
feat(internal-dev): per-repo daemon auto-reload post-commit hook#210alex-mextner wants to merge 1 commit into
alex-mextner wants to merge 1 commit into
Conversation
Adds internal_dev.auto_reload_on_commit (opt-in, default off): a committed, per-repo post-commit git hook that gracefully reloads a live-symlink/daemon rig-ecosystem tool (tg-ctl restart by default) when a commit touches its configured daemon-source paths, plus the global core.hooksPath composer trampoline needed when a dispatcher composer shadows repo-local hooks. The config/schema/plan wiring and the pure hook-rendering module already existed uncommitted in this worktree; this commit adds the missing runner action handler and drift checker the tests exercise, regenerates schema/rig.schema.json, and adds the docs section + registry-test updates the new area requires. Four rounds of `review diff --staged` (Opus/Fable/k3; Codex hit its usage cap every round) caught and this commit fixes: shell pathname expansion silently broke `case` glob matching for nested daemon-source paths (`set -f`); the hooks path resolved via --absolute-git-dir, which points at a linked worktree's private admin dir instead of the shared common dir git actually reads hooks from (--git-common-dir); a composer write's status/backup was dropped from the ActionResult; enabling with empty or whitespace-only daemon_source_paths installed a hook that could never match; a repo's root/parentless commit never triggered a reload (--root); internal_dev could leak into the GLOBAL config layer despite being documented repo-only (guard mirroring the existing `mode` global-only check, keyed on content not mere key presence); and the new tests' dry-run-disabled cases read real GLOBAL/system git config for core.hooksPath with no isolation of their own (GIT_CONFIG_GLOBAL/SYSTEM=/dev/null, not the `core.hooksPath ""` first attempt — which broke the hook by giving git a literal, unresolvable empty path instead of "unset"). Lower-severity findings — opt-out cleanup, composer-drift visibility, exec-bit drift, merge-commit coverage, reload_command shell-quoting semantics, relative core.hooksPath resolution, cross-worktree over-firing, and a wizard gap (no daemon_source_paths input) — are tracked in rig-cli#209 rather than expanding this change further. Closes #208
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal_dev.auto_reload_on_commit(opt-in, default off): a committed, per-repopost-commitgit hook that gracefully reloads a live-symlink/daemon rig-ecosystem tool (tg-ctl restartby default) when a commit touches configured daemon-source paths.core.hooksPathcomposer trampoline needed when the rig global-hook dispatcher shadows repo-local hooks.schema/rig.schema.json, and adds the docs section + registry-test updates.Review history
Four rounds of
review diff --staged(Opus/Fable/k3 — Codex hit its usage cap every round) found and this PR fixes:caseglob matching for nested daemon-source paths (set -f)--absolute-git-dir, which points at a linked worktree's private admin dir instead of the shared common dir git actually reads hooks from (--git-common-dir)ActionResultdaemon_source_pathsinstalled a hook that could never match--root)internal_devcould leak into the GLOBAL config layer despite being documented repo-only (guard mirroring the existingmodeglobal-only check, keyed on content not mere key presence)core.hooksPathwith no isolation of their own (GIT_CONFIG_GLOBAL/SYSTEM=/dev/null— notcore.hooksPath "", which broke the hook by giving git a literal unresolvable empty path instead of "unset")Lower-severity findings (opt-out cleanup, composer-drift visibility, exec-bit drift, merge-commit coverage,
reload_commandshell-quoting semantics, relativecore.hooksPathresolution, cross-worktree over-firing, and a wizard gap with nodaemon_source_pathsinput) are tracked in rig-cli#209 rather than expanding this PR further.Closes #208
Test plan
python3 -m pytest tests/test_internal_dev.py -q— 32 passedpython3 -m pytest -q(full suite) — 1899 passed, 16 skipped, 2 pre-existing unrelated failures (test_codex_update_cli_missing_updater_returns_127,test_tmux_e2e_gating_granularity_is_pinned— confirmed unaffected by this change, neither test file touched)review diff --staged— all findings addressed or tracked in rig-cli#209🤖 Generated with Claude Code