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

@@ -16,8 +16,8 @@ func setupTestManager(t *testing.T) (*Manager, string) {
// Create temp directory structure
tmpDir := t.TempDir()
rigPath := filepath.Join(tmpDir, "testrig")
if err := os.MkdirAll(filepath.Join(rigPath, ".gastown"), 0755); err != nil {
t.Fatalf("mkdir .gastown: %v", err)
if err := os.MkdirAll(filepath.Join(rigPath, ".runtime"), 0755); err != nil {
t.Fatalf("mkdir .runtime: %v", err)
}
r := &rig.Rig{
@@ -146,7 +146,7 @@ func TestManager_RegisterMR(t *testing.T) {
}
// Verify it was saved to disk
stateFile := filepath.Join(rigPath, ".gastown", "refinery.json")
stateFile := filepath.Join(rigPath, ".runtime", "refinery.json")
data, err := os.ReadFile(stateFile)
if err != nil {
t.Fatalf("reading state file: %v", err)