feat: Add mol_type schema field for molecule type classification (bd-oxgi)

Add mol_type field to beads for swarm coordination:
- Values: 'swarm' (multi-polecat), 'patrol' (recurring ops), 'work' (default)
- Nullable, defaults to empty string (treated as 'work')

Changes:
- Add mol_type column to SQLite schema and migration 031
- Add MolType type with IsValid() validation in types.go
- Update insertIssue/GetIssue to handle mol_type
- Add --mol-type flag to create command
- Add mol_type filtering to list and ready commands
- Update RPC protocol for daemon mode support
- Update test schema in migrations_test.go

🤝 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-28 19:50:55 -08:00
parent 77ba8f3d10
commit f3dcafca66
13 changed files with 167 additions and 8 deletions

View File

@@ -196,6 +196,8 @@ func (s *Server) handleCreate(req *Request) Response {
// ID generation
IDPrefix: createArgs.IDPrefix,
CreatedBy: createArgs.CreatedBy,
// Molecule type
MolType: types.MolType(createArgs.MolType),
}
// Check if any dependencies are discovered-from type
@@ -918,6 +920,12 @@ func (s *Server) handleList(req *Request) Response {
// Ephemeral filtering
filter.Ephemeral = listArgs.Ephemeral
// Molecule type filtering
if listArgs.MolType != "" {
molType := types.MolType(listArgs.MolType)
filter.MolType = &molType
}
// Guard against excessive ID lists to avoid SQLite parameter limits
const maxIDs = 1000
if len(filter.IDs) > maxIDs {
@@ -1353,6 +1361,10 @@ func (s *Server) handleReady(req *Request) Response {
if readyArgs.ParentID != "" {
wf.ParentID = &readyArgs.ParentID
}
if readyArgs.MolType != "" {
molType := types.MolType(readyArgs.MolType)
wf.MolType = &molType
}
ctx := s.reqCtx(req)
issues, err := store.GetReadyWork(ctx, wf)