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:
beads/crew/emma
2026-01-17 05:07:11 -08:00
committed by Steve Yegge
parent 88a6438c80
commit 4f0f5744a6
14 changed files with 189 additions and 67 deletions

View File

@@ -190,8 +190,17 @@ func (m *MemoryStorage) CreateIssue(ctx context.Context, issue *types.Issue, act
m.mu.Lock()
defer m.mu.Unlock()
// Validate
if err := issue.Validate(); err != nil {
// Get custom types and statuses for validation
var customTypes, customStatuses []string
if typeStr := m.config["types.custom"]; typeStr != "" {
customTypes = parseCustomStatuses(typeStr)
}
if statusStr := m.config["status.custom"]; statusStr != "" {
customStatuses = parseCustomStatuses(statusStr)
}
// Validate with custom types
if err := issue.ValidateWithCustom(customStatuses, customTypes); err != nil {
return fmt.Errorf("validation failed: %w", err)
}
@@ -243,9 +252,18 @@ func (m *MemoryStorage) CreateIssues(ctx context.Context, issues []*types.Issue,
m.mu.Lock()
defer m.mu.Unlock()
// Get custom types and statuses for validation
var customTypes, customStatuses []string
if typeStr := m.config["types.custom"]; typeStr != "" {
customTypes = parseCustomStatuses(typeStr)
}
if statusStr := m.config["status.custom"]; statusStr != "" {
customStatuses = parseCustomStatuses(statusStr)
}
// Validate all first
for i, issue := range issues {
if err := issue.Validate(); err != nil {
if err := issue.ValidateWithCustom(customStatuses, customTypes); err != nil {
return fmt.Errorf("validation failed for issue %d: %w", i, err)
}
}

View File

@@ -21,6 +21,12 @@ func setupTestMemory(t *testing.T) *MemoryStorage {
t.Fatalf("failed to set issue_prefix: %v", err)
}
// Configure Gas Town custom types for test compatibility (bd-find4)
// These types are no longer built-in but many tests use them
if err := store.SetConfig(ctx, "types.custom", "message,merge-request,molecule,gate,agent,role,rig,convoy,event,slot"); err != nil {
t.Fatalf("failed to set types.custom: %v", err)
}
return store
}