feat(types): add custom type support to beads config (bd-649s)

Add types.custom config key mirroring the status.custom pattern:
- Add CustomTypeConfigKey constant and GetCustomTypes() to storage interface
- Add IssueType.IsValidWithCustom() method for validation
- Add ValidateWithCustom() to Issue for combined status/type validation
- Update all validation call sites to use GetCustomTypes()
- Rename parseCustomStatuses to parseCommaSeparated for reuse

This enables Gas Town to register custom types like agent/role/rig/convoy
without hardcoding them in beads core, supporting the type extraction epic.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
This commit is contained in:
beads/crew/dave
2026-01-06 21:30:58 -08:00
committed by Steve Yegge
parent 3287340678
commit b7358f17bf
10 changed files with 128 additions and 31 deletions

View File

@@ -98,6 +98,9 @@ func (s *SQLiteStorage) GetMetadata(ctx context.Context, key string) (string, er
// CustomStatusConfigKey is the config key for custom status states
const CustomStatusConfigKey = "status.custom"
// CustomTypeConfigKey is the config key for custom issue types
const CustomTypeConfigKey = "types.custom"
// GetCustomStatuses retrieves the list of custom status states from config.
// Custom statuses are stored as comma-separated values in the "status.custom" config key.
// Returns an empty slice if no custom statuses are configured.
@@ -109,12 +112,12 @@ func (s *SQLiteStorage) GetCustomStatuses(ctx context.Context) ([]string, error)
if value == "" {
return nil, nil
}
return parseCustomStatuses(value), nil
return parseCommaSeparated(value), nil
}
// parseCustomStatuses splits a comma-separated string into a slice of trimmed status names.
// parseCommaSeparated splits a comma-separated string into a slice of trimmed values.
// Empty entries are filtered out.
func parseCustomStatuses(value string) []string {
func parseCommaSeparated(value string) []string {
if value == "" {
return nil
}
@@ -128,3 +131,17 @@ func parseCustomStatuses(value string) []string {
}
return result
}
// GetCustomTypes retrieves the list of custom issue types from config.
// Custom types are stored as comma-separated values in the "types.custom" config key.
// Returns an empty slice if no custom types are configured.
func (s *SQLiteStorage) GetCustomTypes(ctx context.Context) ([]string, error) {
value, err := s.GetConfig(ctx, CustomTypeConfigKey)
if err != nil {
return nil, err
}
if value == "" {
return nil, nil
}
return parseCommaSeparated(value), nil
}