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:
@@ -356,6 +356,18 @@ var listCmd = &cobra.Command{
|
||||
// Parent filtering
|
||||
parentID, _ := cmd.Flags().GetString("parent")
|
||||
|
||||
// Molecule type filtering
|
||||
molTypeStr, _ := cmd.Flags().GetString("mol-type")
|
||||
var molType *types.MolType
|
||||
if molTypeStr != "" {
|
||||
mt := types.MolType(molTypeStr)
|
||||
if !mt.IsValid() {
|
||||
fmt.Fprintf(os.Stderr, "Error: invalid mol-type %q (must be swarm, patrol, or work)\n", molTypeStr)
|
||||
os.Exit(1)
|
||||
}
|
||||
molType = &mt
|
||||
}
|
||||
|
||||
// Pretty and watch flags (GH#654)
|
||||
prettyFormat, _ := cmd.Flags().GetBool("pretty")
|
||||
watchMode, _ := cmd.Flags().GetBool("watch")
|
||||
@@ -533,6 +545,11 @@ var listCmd = &cobra.Command{
|
||||
filter.ParentID = &parentID
|
||||
}
|
||||
|
||||
// Molecule type filtering
|
||||
if molType != nil {
|
||||
filter.MolType = molType
|
||||
}
|
||||
|
||||
// Check database freshness before reading
|
||||
// Skip check when using daemon (daemon auto-imports on staleness)
|
||||
ctx := rootCtx
|
||||
@@ -906,6 +923,9 @@ func init() {
|
||||
// Parent filtering: filter children by parent issue
|
||||
listCmd.Flags().String("parent", "", "Filter by parent issue ID (shows children of specified issue)")
|
||||
|
||||
// Molecule type filtering
|
||||
listCmd.Flags().String("mol-type", "", "Filter by molecule type: swarm, patrol, or work")
|
||||
|
||||
// Pretty and watch flags (GH#654)
|
||||
listCmd.Flags().Bool("pretty", false, "Display issues in a tree format with status/priority symbols")
|
||||
listCmd.Flags().BoolP("watch", "w", false, "Watch for changes and auto-update display (implies --pretty)")
|
||||
|
||||
Reference in New Issue
Block a user