feat(types): remove Gas Town types from core built-in types
Core beads built-in types now only include work types: - bug, feature, task, epic, chore Gas Town types (molecule, gate, convoy, merge-request, slot, agent, role, rig, event, message) are now "well-known custom types": - Constants still exist for code convenience - Require types.custom configuration for validation - bd types command shows core types and configured custom types Changes: - types.go: Separate core work types from well-known custom types - IsValid(): Only accepts core work types - bd types: Updated to show core types and custom types from config - memory.go: Use ValidateWithCustom for custom type support - multirepo.go: Only check core types as built-in - Updated all tests to configure custom types This allows Gas Town (and other projects) to define their own types via config while keeping beads core focused on work tracking. Closes: bd-find4 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
88a6438c80
commit
4f0f5744a6
@@ -84,26 +84,32 @@ func failIfProductionDatabase(t *testing.T, dbPath string) {
|
||||
// This prevents "database not initialized" errors in tests
|
||||
func newTestStore(t *testing.T, dbPath string) *sqlite.SQLiteStorage {
|
||||
t.Helper()
|
||||
|
||||
|
||||
// CRITICAL (bd-2c5a): Ensure we're not polluting production database
|
||||
failIfProductionDatabase(t, dbPath)
|
||||
|
||||
|
||||
if err := os.MkdirAll(filepath.Dir(dbPath), 0755); err != nil {
|
||||
t.Fatalf("Failed to create database directory: %v", err)
|
||||
}
|
||||
|
||||
|
||||
store, err := sqlite.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create test database: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// CRITICAL (bd-166): Set issue_prefix to prevent "database not initialized" errors
|
||||
ctx := context.Background()
|
||||
if err := store.SetConfig(ctx, "issue_prefix", "test"); err != nil {
|
||||
store.Close()
|
||||
t.Fatalf("Failed to set issue_prefix: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// Configure Gas Town custom types for test compatibility (bd-find4)
|
||||
if err := store.SetConfig(ctx, "types.custom", "molecule,gate,convoy,merge-request,slot,agent,role,rig,event,message"); err != nil {
|
||||
store.Close()
|
||||
t.Fatalf("Failed to set types.custom: %v", err)
|
||||
}
|
||||
|
||||
t.Cleanup(func() { store.Close() })
|
||||
return store
|
||||
}
|
||||
@@ -130,7 +136,13 @@ func newTestStoreWithPrefix(t *testing.T, dbPath string, prefix string) *sqlite.
|
||||
store.Close()
|
||||
t.Fatalf("Failed to set issue_prefix: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// Configure Gas Town custom types for test compatibility (bd-find4)
|
||||
if err := store.SetConfig(ctx, "types.custom", "molecule,gate,convoy,merge-request,slot,agent,role,rig,event,message"); err != nil {
|
||||
store.Close()
|
||||
t.Fatalf("Failed to set types.custom: %v", err)
|
||||
}
|
||||
|
||||
t.Cleanup(func() { store.Close() })
|
||||
return store
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user