fix(ready): prevent wisps from appearing in bd ready
Add multiple layers of defense against misclassified wisps: - Importer auto-detects -wisp- pattern and sets ephemeral flag - GetReadyWork excludes -wisp- IDs via SQL LIKE clause - Doctor check 26d detects misclassified wisps in JSONL This addresses recurring issue where wisps with missing ephemeral flag would pollute bd ready output after JSONL import. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
gastown/crew/dennis
parent
12c7bef159
commit
f703237c3d
@@ -99,6 +99,15 @@ func ImportIssues(ctx context.Context, dbPath string, store storage.Storage, iss
|
||||
issue.ContentHash = issue.ComputeContentHash()
|
||||
}
|
||||
|
||||
// Auto-detect wisps by ID pattern and set ephemeral flag
|
||||
// This prevents orphaned wisp entries in JSONL from polluting bd ready
|
||||
// Pattern: *-wisp-* indicates ephemeral patrol/workflow instances
|
||||
for _, issue := range issues {
|
||||
if strings.Contains(issue.ID, "-wisp-") && !issue.Ephemeral {
|
||||
issue.Ephemeral = true
|
||||
}
|
||||
}
|
||||
|
||||
// Get or create SQLite store
|
||||
sqliteStore, needCloseStore, err := getOrCreateStore(ctx, dbPath, store)
|
||||
if err != nil {
|
||||
|
||||
@@ -19,6 +19,7 @@ func (s *SQLiteStorage) GetReadyWork(ctx context.Context, filter types.WorkFilte
|
||||
whereClauses := []string{
|
||||
"i.pinned = 0", // Exclude pinned issues
|
||||
"(i.ephemeral = 0 OR i.ephemeral IS NULL)", // Exclude wisps
|
||||
"i.id NOT LIKE '%-wisp-%'", // Defense in depth: exclude wisp IDs even if ephemeral flag missing
|
||||
}
|
||||
args := []interface{}{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user