Skip to content

feat(internal-dev): per-repo daemon auto-reload post-commit hook - #210

Open
alex-mextner wants to merge 1 commit into
mainfrom
feat/internal-dev-auto-reload
Open

feat(internal-dev): per-repo daemon auto-reload post-commit hook#210
alex-mextner wants to merge 1 commit into
mainfrom
feat/internal-dev-auto-reload

Conversation

@alex-mextner

Copy link
Copy Markdown
Owner

Summary

  • 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 configured daemon-source paths.
  • Handles the core.hooksPath composer trampoline needed when the rig global-hook dispatcher shadows repo-local hooks.
  • Config/schema/plan wiring + the pure hook-rendering module were already uncommitted in this worktree; this PR adds the missing runner action handler + drift checker the tests exercise, regenerates 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:

  • Shell pathname expansion silently broke case glob matching for nested daemon-source paths (set -f)
  • 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)
  • 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 core.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_command shell-quoting semantics, relative core.hooksPath resolution, cross-worktree over-firing, and a wizard gap with no daemon_source_paths input) 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 passed
  • python3 -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)
  • 4x review diff --staged — all findings addressed or tracked in rig-cli#209

🤖 Generated with Claude Code

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
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(internal-dev): per-repo daemon auto-reload post-commit hook

1 participant