refactor: remove legacy .beads-wisp infrastructure (gt-5klh)

Wisps are now just a flag on regular beads issues (Wisp=true).
No separate directory needed - hooks stored in .beads/.

Changes:
- wisp package: WispDir now points to .beads/, removed PatrolCycle
- manager.go: removed initWispBeads() - no separate dir to create
- mrqueue.go: MRs stored in .beads/mq/ instead of .beads-wisp/mq/
- doctor: removed obsolete wisp directory checks
- docs: updated wisp-architecture.md to reflect simplified model

🤖 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-24 21:34:14 -08:00
parent d30cf5e48c
commit 7e568770de
12 changed files with 148 additions and 964 deletions

View File

@@ -281,11 +281,6 @@ func (m *Manager) AddRig(opts AddRigOptions) (*Rig, error) {
return nil, fmt.Errorf("initializing beads: %w", err)
}
// Initialize wisp beads for wisp/molecule tracking
if err := m.initWispBeads(rigPath); err != nil {
return nil, fmt.Errorf("initializing wisp beads: %w", err)
}
// Seed patrol molecules for this rig
if err := m.seedPatrolMolecules(rigPath); err != nil {
// Non-fatal: log warning but continue
@@ -371,34 +366,6 @@ func (m *Manager) initBeads(rigPath, prefix string) error {
return nil
}
// initWispBeads initializes the wisp beads database at rig level.
// Wisp beads are local-only (no sync-branch) and used for runtime tracking
// of wisps and molecules.
func (m *Manager) initWispBeads(rigPath string) error {
beadsDir := filepath.Join(rigPath, ".beads-wisp")
if err := os.MkdirAll(beadsDir, 0755); err != nil {
return err
}
// Initialize as a git repo (for local versioning, not for sync)
cmd := exec.Command("git", "init")
cmd.Dir = beadsDir
if err := cmd.Run(); err != nil {
return fmt.Errorf("git init: %w", err)
}
// Create wisp config (no sync-branch needed)
configPath := filepath.Join(beadsDir, "config.yaml")
configContent := "wisp: true\n# No sync-branch - wisp is local only\n"
if err := os.WriteFile(configPath, []byte(configContent), 0644); err != nil {
return err
}
// Add .beads-wisp/ to .gitignore if not already present
gitignorePath := filepath.Join(rigPath, ".gitignore")
return m.ensureGitignoreEntry(gitignorePath, ".beads-wisp/")
}
// ensureGitignoreEntry adds an entry to .gitignore if it doesn't already exist.
func (m *Manager) ensureGitignoreEntry(gitignorePath, entry string) error {
// Read existing content

View File

@@ -193,52 +193,6 @@ func TestRigSummary(t *testing.T) {
}
}
func TestInitWispBeads(t *testing.T) {
root, rigsConfig := setupTestTown(t)
manager := NewManager(root, rigsConfig, git.NewGit(root))
rigPath := filepath.Join(root, "test-rig")
if err := os.MkdirAll(rigPath, 0755); err != nil {
t.Fatalf("mkdir: %v", err)
}
if err := manager.initWispBeads(rigPath); err != nil {
t.Fatalf("initWispBeads: %v", err)
}
// Verify directory was created
wispPath := filepath.Join(rigPath, ".beads-wisp")
if _, err := os.Stat(wispPath); os.IsNotExist(err) {
t.Error(".beads-wisp/ was not created")
}
// Verify it's a git repo
gitPath := filepath.Join(wispPath, ".git")
if _, err := os.Stat(gitPath); os.IsNotExist(err) {
t.Error(".beads-wisp/ was not initialized as git repo")
}
// Verify config.yaml was created with wisp: true
configPath := filepath.Join(wispPath, "config.yaml")
content, err := os.ReadFile(configPath)
if err != nil {
t.Fatalf("reading config.yaml: %v", err)
}
if string(content) != "wisp: true\n# No sync-branch - wisp is local only\n" {
t.Errorf("config.yaml content = %q, want wisp: true with comment", string(content))
}
// Verify .gitignore was updated
gitignorePath := filepath.Join(rigPath, ".gitignore")
ignoreContent, err := os.ReadFile(gitignorePath)
if err != nil {
t.Fatalf("reading .gitignore: %v", err)
}
if string(ignoreContent) != ".beads-wisp/\n" {
t.Errorf(".gitignore content = %q, want .beads-wisp/", string(ignoreContent))
}
}
func TestEnsureGitignoreEntry_AddsEntry(t *testing.T) {
root, rigsConfig := setupTestTown(t)
manager := NewManager(root, rigsConfig, git.NewGit(root))