fix: remove vestigial state.json files from agent directories

Agent directories (witness/, refinery/, mayor/) contained state.json files
with last_active timestamps that were never updated, making them stale and
misleading. This change removes:

- initAgentStates function that created vestigial state.json files
- AgentState type and related Load/Save functions from config package
- MayorStateValidCheck from doctor checks
- requesting_* lifecycle verification (dead code - flags were never set)
- FileStateJSON constant and MayorStatePath function

Kept intact:
- daemon/state.json (actively used for daemon runtime state)
- crew/<name>/state.json (operational CrewWorker metadata)
- Agent state tracking via beads (the ZFC-compliant approach)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
splendid
2026-01-03 21:20:11 -08:00
committed by Steve Yegge
parent 60ecf1ff76
commit acd2565a5b
13 changed files with 23 additions and 576 deletions

View File

@@ -542,17 +542,20 @@ func TestRigAddCreatesAgentDirs(t *testing.T) {
rigPath := filepath.Join(townRoot, "agenttest")
// Verify agent state files exist
expectedStateFiles := []string{
"witness/state.json",
"refinery/state.json",
"mayor/state.json",
// Verify agent directories exist (state.json files are no longer created)
expectedDirs := []string{
"witness",
"refinery",
"mayor",
}
for _, stateFile := range expectedStateFiles {
path := filepath.Join(rigPath, stateFile)
if _, err := os.Stat(path); err != nil {
t.Errorf("expected state file %s to exist: %v", stateFile, err)
for _, dir := range expectedDirs {
path := filepath.Join(rigPath, dir)
info, err := os.Stat(path)
if err != nil {
t.Errorf("expected directory %s to exist: %v", dir, err)
} else if !info.IsDir() {
t.Errorf("expected %s to be a directory", dir)
}
}
}