Skip to content

Commit befc254

Browse files
steveyeggeclaude
andcommitted
fix: remove stale bd export/sync references from prime output (GH#2007)
Replace dead `bd export` and `bd sync --flush-only` references in stealth/local-only prime modes with `bd close`. Update test expectations to match current Dolt-native commands (bd dolt push/pull). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8569471 commit befc254

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

cmd/bd/prime.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ func outputMCPContext(w io.Writer, stealthMode bool) error {
203203

204204
var closeProtocol string
205205
if stealthMode || localOnly {
206-
// Stealth mode or local-only: only export to JSONL, no git operations
207-
closeProtocol = "Before saying \"done\": bd export"
206+
// Stealth mode or local-only: close issues, no git operations
207+
closeProtocol = "Before saying \"done\": bd close <completed-ids>"
208208
} else if ephemeral {
209209
closeProtocol = "Before saying \"done\": git status → git add → git commit (no push - ephemeral branch)"
210210
} else if noPush {
@@ -246,14 +246,13 @@ func outputCLIContext(w io.Writer, stealthMode bool) error {
246246
var gitWorkflowRule string
247247

248248
if stealthMode || localOnly {
249-
// Stealth mode or local-only: only export to JSONL, no git operations
250-
closeProtocol = `[ ] bd export (export beads to JSONL)`
249+
// Stealth mode or local-only: close issues, no git operations
250+
closeProtocol = `[ ] bd close <id1> <id2> ... (close completed issues)`
251251
syncSection = `### Sync & Collaboration
252-
- ` + "`bd export`" + ` - Export beads to JSONL`
252+
- ` + "`bd search <query>`" + ` - Search issues by keyword`
253253
completingWorkflow = `**Completing work:**
254254
` + "```bash" + `
255255
bd close <id1> <id2> ... # Close all completed issues at once
256-
bd export # Export to JSONL
257256
` + "```"
258257
// Only show local-only note if not in stealth mode (stealth is explicit user choice)
259258
if localOnly && !stealthMode {

cmd/bd/prime_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,107 +22,107 @@ func TestOutputContextFunction(t *testing.T) {
2222
stealthMode: false,
2323
ephemeralMode: false,
2424
localOnlyMode: false,
25-
expectText: []string{"Beads Workflow Context", "bd sync", "git push"},
26-
rejectText: []string{"bd sync --flush-only", "--from-main"},
25+
expectText: []string{"Beads Workflow Context", "bd dolt push", "git push"},
26+
rejectText: []string{"bd export", "--from-main"},
2727
},
2828
{
2929
name: "CLI Normal (ephemeral)",
3030
mcpMode: false,
3131
stealthMode: false,
3232
ephemeralMode: true,
3333
localOnlyMode: false,
34-
expectText: []string{"Beads Workflow Context", "bd sync", "ephemeral branch"},
35-
rejectText: []string{"bd sync --flush-only", "git push", "--from-main"},
34+
expectText: []string{"Beads Workflow Context", "bd dolt pull", "ephemeral branch"},
35+
rejectText: []string{"bd export", "git push", "--from-main"},
3636
},
3737
{
3838
name: "CLI Stealth",
3939
mcpMode: false,
4040
stealthMode: true,
4141
ephemeralMode: false, // stealth mode overrides ephemeral detection
4242
localOnlyMode: false,
43-
expectText: []string{"Beads Workflow Context", "bd sync --flush-only"},
44-
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add"},
43+
expectText: []string{"Beads Workflow Context", "bd close"},
44+
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add", "bd export"},
4545
},
4646
{
4747
name: "CLI Local-only (no git remote)",
4848
mcpMode: false,
4949
stealthMode: false,
5050
ephemeralMode: false,
5151
localOnlyMode: true,
52-
expectText: []string{"Beads Workflow Context", "bd sync --flush-only", "No git remote configured"},
53-
rejectText: []string{"git push", "git pull", "--from-main"},
52+
expectText: []string{"Beads Workflow Context", "bd close", "No git remote configured"},
53+
rejectText: []string{"git push", "git pull", "--from-main", "bd export"},
5454
},
5555
{
5656
name: "CLI Local-only overrides ephemeral",
5757
mcpMode: false,
5858
stealthMode: false,
5959
ephemeralMode: true, // ephemeral is true but local-only takes precedence
6060
localOnlyMode: true,
61-
expectText: []string{"Beads Workflow Context", "bd sync --flush-only", "No git remote configured"},
62-
rejectText: []string{"git push", "--from-main", "ephemeral branch"},
61+
expectText: []string{"Beads Workflow Context", "bd close", "No git remote configured"},
62+
rejectText: []string{"git push", "--from-main", "ephemeral branch", "bd export"},
6363
},
6464
{
6565
name: "CLI Stealth overrides local-only",
6666
mcpMode: false,
6767
stealthMode: true,
6868
ephemeralMode: false,
6969
localOnlyMode: true, // local-only is true but stealth takes precedence
70-
expectText: []string{"Beads Workflow Context", "bd sync --flush-only"},
71-
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add", "No git remote configured"},
70+
expectText: []string{"Beads Workflow Context", "bd close"},
71+
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add", "No git remote configured", "bd export"},
7272
},
7373
{
7474
name: "MCP Normal (non-ephemeral)",
7575
mcpMode: true,
7676
stealthMode: false,
7777
ephemeralMode: false,
7878
localOnlyMode: false,
79-
expectText: []string{"Beads Issue Tracker Active", "bd sync", "git push"},
80-
rejectText: []string{"bd sync --flush-only", "--from-main"},
79+
expectText: []string{"Beads Issue Tracker Active", "git push"},
80+
rejectText: []string{"bd export", "--from-main"},
8181
},
8282
{
8383
name: "MCP Normal (ephemeral)",
8484
mcpMode: true,
8585
stealthMode: false,
8686
ephemeralMode: true,
8787
localOnlyMode: false,
88-
expectText: []string{"Beads Issue Tracker Active", "bd sync", "ephemeral branch"},
89-
rejectText: []string{"bd sync --flush-only", "git push", "--from-main"},
88+
expectText: []string{"Beads Issue Tracker Active", "ephemeral branch"},
89+
rejectText: []string{"bd export", "git push", "--from-main"},
9090
},
9191
{
9292
name: "MCP Stealth",
9393
mcpMode: true,
9494
stealthMode: true,
9595
ephemeralMode: false, // stealth mode overrides ephemeral detection
9696
localOnlyMode: false,
97-
expectText: []string{"Beads Issue Tracker Active", "bd sync --flush-only"},
98-
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add"},
97+
expectText: []string{"Beads Issue Tracker Active", "bd close"},
98+
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add", "bd export"},
9999
},
100100
{
101101
name: "MCP Local-only (no git remote)",
102102
mcpMode: true,
103103
stealthMode: false,
104104
ephemeralMode: false,
105105
localOnlyMode: true,
106-
expectText: []string{"Beads Issue Tracker Active", "bd sync --flush-only"},
107-
rejectText: []string{"git push", "git pull", "--from-main"},
106+
expectText: []string{"Beads Issue Tracker Active", "bd close"},
107+
rejectText: []string{"git push", "git pull", "--from-main", "bd export"},
108108
},
109109
{
110110
name: "MCP Local-only overrides ephemeral",
111111
mcpMode: true,
112112
stealthMode: false,
113113
ephemeralMode: true, // ephemeral is true but local-only takes precedence
114114
localOnlyMode: true,
115-
expectText: []string{"Beads Issue Tracker Active", "bd sync --flush-only"},
116-
rejectText: []string{"git push", "--from-main", "ephemeral branch"},
115+
expectText: []string{"Beads Issue Tracker Active", "bd close"},
116+
rejectText: []string{"git push", "--from-main", "ephemeral branch", "bd export"},
117117
},
118118
{
119119
name: "MCP Stealth overrides local-only",
120120
mcpMode: true,
121121
stealthMode: true,
122122
ephemeralMode: false,
123123
localOnlyMode: true, // local-only is true but stealth takes precedence
124-
expectText: []string{"Beads Issue Tracker Active", "bd sync --flush-only"},
125-
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add"},
124+
expectText: []string{"Beads Issue Tracker Active", "bd close"},
125+
rejectText: []string{"git push", "git pull", "git commit", "git status", "git add", "bd export"},
126126
},
127127
}
128128

0 commit comments

Comments
 (0)