fix(stale): enable stale binary warning and fix source detection

- Add checkStaleBinaryWarning() call to persistentPreRun (was only in
  deprecated function)
- Fix GetRepoRoot() to look in correct location ($GT_ROOT/gastown/mayor/rig)
- Use hasGtSource() with os.Stat instead of shell test command

Agents will now see warnings when running gt with a stale binary.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/emma
2026-01-24 20:52:27 -08:00
parent d9f1fe9e48
commit 889c5863fa
2 changed files with 21 additions and 16 deletions

View File

@@ -69,6 +69,11 @@ func persistentPreRun(cmd *cobra.Command, args []string) error {
// Get the root command name being run
cmdName := cmd.Name()
// Check for stale binary (warning only, doesn't block)
if !beadsExemptCommands[cmdName] {
checkStaleBinaryWarning()
}
// Check town root branch (warning only, non-blocking)
if !branchCheckExemptCommands[cmdName] {
warnIfTownRootOffMain()