fix: create mayor/daemon.json during gt start and gt doctor --fix (#225)

* fix: create mayor/daemon.json during gt start and gt doctor --fix (#5)

- Add DaemonPatrolConfig type with heartbeat and patrol settings
- Add Load/Save/Ensure functions for daemon patrol config
- Create daemon.json in gt start (non-fatal if fails)
- Make PatrolHooksWiredCheck fixable with Fix() method
- Add comprehensive tests for both config and doctor checks

This fixes the issue where gt doctor expects mayor/daemon.json to exist
but it was never created by gt start or any other command.

* refactor: use constants.DirMayor instead of hardcoded string
This commit is contained in:
Subhrajit Makur
2026-01-07 02:29:41 +05:30
committed by GitHub
parent 9d7dcde1e2
commit 7fe505d673
6 changed files with 555 additions and 44 deletions

View File

@@ -145,6 +145,10 @@ func runStart(cmd *cobra.Command, args []string) error {
return fmt.Errorf("not in a Gas Town workspace: %w", err)
}
if err := config.EnsureDaemonPatrolConfig(townRoot); err != nil {
fmt.Printf(" %s Could not ensure daemon config: %v\n", style.Dim.Render("○"), err)
}
t := tmux.NewTmux()
fmt.Printf("Starting Gas Town from %s\n\n", style.Dim.Render(townRoot))