Implement three-tier config architecture (gt-k1lr tasks 1-5)

**Architecture changes:**
- Renamed `.gastown/` → `.runtime/` for runtime state (gitignored)
- Added `settings/` directory for rig behavioral config (git-tracked)
- Added `mayor/config.json` for town-level config (MayorConfig type)
- Separated RigConfig (identity) from RigSettings (behavioral)

**File location changes:**
- Town runtime: `~/.gastown/*` → `~/.runtime/*`
- Rig runtime: `<rig>/.gastown/*` → `<rig>/.runtime/*`
- Rig config: `<rig>/.gastown/config.json` → `<rig>/settings/config.json`
- Namepool state: `namepool.json` → `namepool-state.json`

**New types:**
- MayorConfig: town-level behavioral config
- RigSettings: rig behavioral config (merge_queue, theme, namepool)
- RigConfig now identity-only (name, git_url, beads, created_at)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-22 01:22:27 -08:00
parent f16ce2d634
commit 97e0535bfe
20 changed files with 449 additions and 201 deletions

View File

@@ -25,8 +25,11 @@ const (
// DirBeads is the beads database directory.
DirBeads = ".beads"
// DirGastown is the per-rig runtime state directory.
DirGastown = ".gastown"
// DirRuntime is the runtime state directory (gitignored).
DirRuntime = ".runtime"
// DirSettings is the rig settings directory (git-tracked).
DirSettings = "settings"
)
// File names for configuration and state.
@@ -132,7 +135,22 @@ func RigCrewPath(rigPath string) string {
return rigPath + "/" + DirCrew
}
// GastownPath returns the path to .gastown/ within a rig.
func GastownPath(rigPath string) string {
return rigPath + "/" + DirGastown
// MayorConfigPath returns the path to mayor/config.json within a town root.
func MayorConfigPath(townRoot string) string {
return townRoot + "/" + DirMayor + "/" + FileConfigJSON
}
// TownRuntimePath returns the path to .runtime/ at the town root.
func TownRuntimePath(townRoot string) string {
return townRoot + "/" + DirRuntime
}
// RigRuntimePath returns the path to .runtime/ within a rig.
func RigRuntimePath(rigPath string) string {
return rigPath + "/" + DirRuntime
}
// RigSettingsPath returns the path to settings/ within a rig.
func RigSettingsPath(rigPath string) string {
return rigPath + "/" + DirSettings
}