Problem Statement
Severity: High
The worktree-enter hook uses a config-file gate that is inconsistent with Trop's actual config discovery behavior.
Today, the hook only runs trop autoreserve when it finds trop.yaml or .trop.yaml, but Trop config discovery supports trop.yaml and trop.local.yaml.
As a result, repositories that validly use only trop.local.yaml are skipped on worktree entry, so pre-reservation does not happen.
Affected Files / Lines
plugins/trop/hooks/scripts/worktree-enter.sh
:3 comment says hook runs only if trop.yaml exists
:23-24 gate checks trop.yaml or .trop.yaml only
trop/src/config/loader.rs
:112 docs: discovery stops on trop.yaml or trop.local.yaml
:137 code checks trop.local.yaml
trop-cli/src/utils.rs
:194 docs: searches trop.local.yaml or trop.yaml
:206-215 code prefers trop.local.yaml, then trop.yaml
Recommended Fix
Update the hook gate to match supported project config files (trop.local.yaml + trop.yaml) and update stale comments.
diff --git a/plugins/trop/hooks/scripts/worktree-enter.sh b/plugins/trop/hooks/scripts/worktree-enter.sh
@@
-# Runs trop autoreserve if a trop.yaml exists in the worktree directory.
+# Runs trop autoreserve if a trop project config exists in the worktree directory.
@@
-# Check for trop.yaml in the worktree
-if [[ -f "${WORKTREE_PATH}/trop.yaml" ]] || [[ -f "${WORKTREE_PATH}/.trop.yaml" ]]; then
+# Check for supported project config files in the worktree
+if [[ -f "${WORKTREE_PATH}/trop.local.yaml" ]] || [[ -f "${WORKTREE_PATH}/trop.yaml" ]]; then
cd "$WORKTREE_PATH"
trop autoreserve --quiet 2>/dev/null || true
fi
Validation Strategy
Automated regression coverage
Add hook-level tests (or a small shell test harness run in CI) for these cases:
trop.local.yaml only -> trop autoreserve is invoked.
trop.yaml only -> trop autoreserve is invoked.
- No config files ->
trop autoreserve is not invoked.
Manual verification
- Create a temp repo/worktree containing only
trop.local.yaml.
- Feed hook input with that path (same JSON shape used by the hook).
- Confirm the hook executes
trop autoreserve --quiet (e.g., with a stubbed trop on PATH).
- Repeat with only
trop.yaml and with no config file to confirm expected behavior in each case.
🤖 Discovered by Codex · expanded by Codex · filed by Claude Code
Problem Statement
Severity: High
The
worktree-enterhook uses a config-file gate that is inconsistent with Trop's actual config discovery behavior.Today, the hook only runs
trop autoreservewhen it findstrop.yamlor.trop.yaml, but Trop config discovery supportstrop.yamlandtrop.local.yaml.As a result, repositories that validly use only
trop.local.yamlare skipped on worktree entry, so pre-reservation does not happen.Affected Files / Lines
plugins/trop/hooks/scripts/worktree-enter.sh:3comment says hook runs only iftrop.yamlexists:23-24gate checkstrop.yamlor.trop.yamlonlytrop/src/config/loader.rs:112docs: discovery stops ontrop.yamlortrop.local.yaml:137code checkstrop.local.yamltrop-cli/src/utils.rs:194docs: searchestrop.local.yamlortrop.yaml:206-215code preferstrop.local.yaml, thentrop.yamlRecommended Fix
Update the hook gate to match supported project config files (
trop.local.yaml+trop.yaml) and update stale comments.Validation Strategy
Automated regression coverage
Add hook-level tests (or a small shell test harness run in CI) for these cases:
trop.local.yamlonly ->trop autoreserveis invoked.trop.yamlonly ->trop autoreserveis invoked.trop autoreserveis not invoked.Manual verification
trop.local.yaml.trop autoreserve --quiet(e.g., with a stubbedtroponPATH).trop.yamland with no config file to confirm expected behavior in each case.🤖 Discovered by Codex · expanded by Codex · filed by Claude Code