diff --git a/cmd/bd/daemon_autostart_unit_test.go b/cmd/bd/daemon_autostart_unit_test.go index 179851b6..57f9b439 100644 --- a/cmd/bd/daemon_autostart_unit_test.go +++ b/cmd/bd/daemon_autostart_unit_test.go @@ -383,34 +383,47 @@ func TestIsWispOperation(t *testing.T) { { name: "mol burn", cmdNames: []string{"bd", "mol", "burn"}, - args: []string{"bd-eph-abc"}, + args: []string{"bd-wisp-abc"}, want: true, }, { name: "mol squash", cmdNames: []string{"bd", "mol", "squash"}, - args: []string{"bd-eph-abc"}, + args: []string{"bd-wisp-abc"}, want: true, }, - // Ephemeral issue IDs in args + // Ephemeral issue IDs in args (wisp-* pattern) { - name: "close with bd-eph ID", + name: "close with bd-wisp ID", + cmdNames: []string{"bd", "close"}, + args: []string{"bd-wisp-abc123"}, + want: true, + }, + { + name: "show with gt-wisp ID", + cmdNames: []string{"bd", "show"}, + args: []string{"gt-wisp-xyz"}, + want: true, + }, + { + name: "update with wisp- prefix", + cmdNames: []string{"bd", "update"}, + args: []string{"wisp-test", "--status=closed"}, + want: true, + }, + // Legacy eph-* pattern (backwards compatibility) + { + name: "close with legacy bd-eph ID", cmdNames: []string{"bd", "close"}, args: []string{"bd-eph-abc123"}, want: true, }, { - name: "show with gt-eph ID", + name: "show with legacy gt-eph ID", cmdNames: []string{"bd", "show"}, args: []string{"gt-eph-xyz"}, want: true, }, - { - name: "update with eph- prefix", - cmdNames: []string{"bd", "update"}, - args: []string{"eph-test", "--status=closed"}, - want: true, - }, // Non-wisp operations (should NOT bypass) { name: "regular show", @@ -438,9 +451,9 @@ func TestIsWispOperation(t *testing.T) { }, // Edge cases { - name: "flag that looks like eph ID should be ignored", + name: "flag that looks like wisp ID should be ignored", cmdNames: []string{"bd", "show"}, - args: []string{"--format=bd-eph-style", "bd-regular"}, + args: []string{"--format=bd-wisp-style", "bd-regular"}, want: false, }, } diff --git a/cmd/bd/main_errors.go b/cmd/bd/main_errors.go index 603c8870..c88fc077 100644 --- a/cmd/bd/main_errors.go +++ b/cmd/bd/main_errors.go @@ -77,7 +77,7 @@ func handleFreshCloneError(err error, beadsDir string) bool { // - mol wisp subcommands (create, list, gc, or direct proto invocation) // - mol burn (only operates on wisps) // - mol squash (condenses wisps to digests) -// - Commands with ephemeral issue IDs in args (bd-*-eph-*, eph-*) +// - Commands with ephemeral issue IDs in args (bd-*-wisp-*, wisp-*, or legacy eph-*) func isWispOperation(cmd *cobra.Command, args []string) bool { cmdName := cmd.Name() @@ -97,14 +97,16 @@ func isWispOperation(cmd *cobra.Command, args []string) bool { } // Check for ephemeral issue IDs in arguments - // Ephemeral IDs have "eph" segment: bd-eph-xxx, gt-eph-xxx, eph-xxx + // Ephemeral IDs have "wisp" segment: bd-wisp-xxx, gt-wisp-xxx, wisp-xxx + // Also detect legacy "eph" prefix for backwards compatibility for _, arg := range args { // Skip flags if strings.HasPrefix(arg, "-") { continue } - // Check for ephemeral prefix patterns - if strings.Contains(arg, "-eph-") || strings.HasPrefix(arg, "eph-") { + // Check for ephemeral prefix patterns (wisp-* or legacy eph-*) + if strings.Contains(arg, "-wisp-") || strings.HasPrefix(arg, "wisp-") || + strings.Contains(arg, "-eph-") || strings.HasPrefix(arg, "eph-") { return true } } diff --git a/cmd/bd/mol_test.go b/cmd/bd/mol_test.go index 4c84fd8a..90572939 100644 --- a/cmd/bd/mol_test.go +++ b/cmd/bd/mol_test.go @@ -2417,7 +2417,7 @@ func TestSpawnMoleculeEphemeralFlag(t *testing.T) { } // Spawn with ephemeral=true - result, err := spawnMolecule(ctx, s, subgraph, nil, "", "test", true, "eph") + result, err := spawnMolecule(ctx, s, subgraph, nil, "", "test", true, "wisp") if err != nil { t.Fatalf("spawnMolecule failed: %v", err) } @@ -2435,8 +2435,8 @@ func TestSpawnMoleculeEphemeralFlag(t *testing.T) { // Verify spawned issues have the correct prefix for _, newID := range result.IDMapping { - if !strings.HasPrefix(newID, "test-eph-") { - t.Errorf("Spawned issue ID %s should have prefix 'test-eph-'", newID) + if !strings.HasPrefix(newID, "test-wisp-") { + t.Errorf("Spawned issue ID %s should have prefix 'test-wisp-'", newID) } } } @@ -2490,7 +2490,7 @@ func TestSpawnMoleculeFromFormulaEphemeral(t *testing.T) { } // Spawn with ephemeral=true (simulating bd mol wisp ) - result, err := spawnMolecule(ctx, s, subgraph, nil, "", "test", true, "eph") + result, err := spawnMolecule(ctx, s, subgraph, nil, "", "test", true, "wisp") if err != nil { t.Fatalf("spawnMolecule failed: %v", err) } @@ -2509,8 +2509,8 @@ func TestSpawnMoleculeFromFormulaEphemeral(t *testing.T) { // Verify they have the correct prefix for _, newID := range result.IDMapping { - if !strings.HasPrefix(newID, "test-eph-") { - t.Errorf("Spawned issue ID %s should have prefix 'test-eph-'", newID) + if !strings.HasPrefix(newID, "test-wisp-") { + t.Errorf("Spawned issue ID %s should have prefix 'test-wisp-'", newID) } } diff --git a/cmd/bd/wisp.go b/cmd/bd/wisp.go index 0c9f6689..3f078fb0 100644 --- a/cmd/bd/wisp.go +++ b/cmd/bd/wisp.go @@ -257,8 +257,8 @@ func runWispCreate(cmd *cobra.Command, args []string) { } // Spawn as ephemeral in main database (Ephemeral=true, skips JSONL export) - // Use "eph" prefix for distinct visual recognition - result, err := spawnMolecule(ctx, store, subgraph, vars, "", actor, true, "eph") + // Use "wisp" prefix for distinct visual recognition + result, err := spawnMolecule(ctx, store, subgraph, vars, "", actor, true, "wisp") if err != nil { fmt.Fprintf(os.Stderr, "Error creating wisp: %v\n", err) os.Exit(1)