Files
beads/internal/storage/sqlite/migrations/032_hooked_status_migration.go
Steve Yegge 7d1ee6d3e9 feat: Add 'hooked' status for GUPP work assignment (bd-s00m)
Separates semantics of 'pinned' (identity records) from work-on-hook:
- 'pinned' = domain table / identity record (agents, roles) - non-blocking
- 'hooked' = work on agent's hook (GUPP-driven) - blocks dependents

Changes:
- Add StatusHooked constant to types.go
- Update all blocking queries to include 'hooked' status
- Add cyan styling for 'hooked' in UI output
- Create migration 032 to convert pinned work items to hooked

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 22:37:04 -08:00

38 lines
1.1 KiB
Go

package migrations
import (
"database/sql"
"fmt"
)
// MigrateHookedStatus converts pinned work items to hooked status.
// 'pinned' now means identity/domain records (agents, roles).
// 'hooked' means work actively attached to an agent's hook (GUPP).
func MigrateHookedStatus(db *sql.DB) error {
// Migrate pinned issues that represent work (not identity records) to hooked.
// Agent/role beads stay pinned; molecules and regular issues become hooked.
result, err := db.Exec(`
UPDATE issues
SET status = 'hooked'
WHERE status = 'pinned'
AND issue_type NOT IN ('agent', 'role')
`)
if err != nil {
return fmt.Errorf("failed to migrate pinned to hooked: %w", err)
}
rowsAffected, _ := result.RowsAffected()
if rowsAffected > 0 {
// Log migration for audit trail (optional - no-op if table doesn't exist)
_, _ = db.Exec(`
INSERT INTO events (issue_id, event_type, actor, old_value, new_value, comment)
SELECT id, 'migration', 'system', 'pinned', 'hooked', 'bd-s00m: Semantic split of pinned vs hooked'
FROM issues
WHERE status = 'hooked'
AND issue_type NOT IN ('agent', 'role')
`)
}
return nil
}