Skip to content

Commit e42d222

Browse files
authored
Merge pull request #2526 from maphew/fix/docs-purge-stale-refs
fix(docs): purge stale command/flag refs + add CI doc validation (GH#2522)
2 parents 45fcd51 + a333dca commit e42d222

45 files changed

Lines changed: 484 additions & 384 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ jobs:
1717
- name: Check all versions match
1818
run: ./scripts/check-versions.sh
1919

20+
# Check documentation references match actual CLI flags
21+
check-doc-flags:
22+
name: Check doc flags freshness
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v6
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v6
29+
with:
30+
go-version-file: 'go.mod'
31+
32+
- name: Build bd
33+
run: CGO_ENABLED=0 go build -o bd ./cmd/bd/
34+
35+
- name: Validate docs against CLI
36+
run: ./scripts/check-doc-flags.sh ./bd
37+
2038
# Fast check to catch accidental .beads/issues.jsonl changes from contributors
2139
check-no-beads-changes:
2240
name: Check for .beads changes

AGENT_INSTRUCTIONS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ bd hooks install
9393

9494
### Git Integration
9595

96-
**Dolt sync**: Dolt handles sync natively via `bd sync`. No JSONL export/import needed.
96+
**Dolt sync**: Dolt handles sync natively via `bd dolt push` / `bd dolt pull`. No JSONL export/import needed.
9797

98-
**Protected branches**: Use `bd init --branch beads-metadata` to commit to separate branch. See [docs/PROTECTED_BRANCHES.md](docs/PROTECTED_BRANCHES.md).
98+
**Protected branches**: Dolt stores data under `refs/dolt/data`, separate from standard Git refs. See [docs/PROTECTED_BRANCHES.md](docs/PROTECTED_BRANCHES.md).
9999

100100
**Git worktrees**: Work directly with Dolt — no special flags needed. See [docs/ADVANCED.md](docs/ADVANCED.md).
101101

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ fmt-check:
160160
fi
161161
@echo "All Go files are properly formatted"
162162

163+
# Validate documentation references against actual CLI flags
164+
check-docs: build
165+
@./scripts/check-doc-flags.sh ./bd
166+
163167
# Clean build artifacts and benchmark profiles
164168
clean:
165169
@echo "Cleaning..."
@@ -181,5 +185,6 @@ help:
181185
@echo " make install-force - Install bd, skipping the origin/main update check"
182186
@echo " make fmt - Format all Go files with gofmt"
183187
@echo " make fmt-check - Check Go formatting (for CI)"
188+
@echo " make check-docs - Validate docs against CLI flags"
184189
@echo " make clean - Remove build artifacts and profile files"
185190
@echo " make help - Show this help message"

claude-plugin/commands/audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ Each line is one event. Labeling is done by appending a new `"label"` event refe
2323
## Notes
2424

2525
- Audit entries are **append-only** (no in-place edits).
26-
- `bd sync` includes `.beads/interactions.jsonl` in the commit allowlist.
26+
- `bd dolt push` includes `.beads/interactions.jsonl` in the commit allowlist.
2727

2828

claude-plugin/commands/import.md

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,18 @@
11
---
2-
description: Import issues from JSONL format
3-
argument-hint: [-i input-file]
2+
description: Import issues from JSONL format (removed)
3+
argument-hint: (removed)
44
---
55

6-
Import issues from JSON Lines format (one JSON object per line).
6+
`bd import` has been **removed**.
77

8-
## Usage
8+
## Migration
99

10-
- **From stdin**: `bd import` (reads from stdin)
11-
- **From file**: `bd import -i issues.jsonl`
12-
- **Preview**: `bd import -i issues.jsonl --dry-run`
13-
14-
## Behavior
15-
16-
- **Existing issues** (same ID): Updated with new data
17-
- **New issues**: Created
18-
- **Same-ID scenarios**: With hash-based IDs (v0.20.1+), same ID = same issue being updated (not a collision)
19-
20-
## Preview Changes
21-
22-
Use `--dry-run` to see what will change before importing:
10+
If you need to import issues from a JSONL file, use `bd init` with the `--from-jsonl` flag:
2311

2412
```bash
25-
bd import -i issues.jsonl --dry-run
26-
# Shows: new issues, updates, exact matches
13+
bd init <prefix> --from-jsonl issues.jsonl
2714
```
2815

29-
## When to Use
30-
31-
Dolt is the primary storage backend, so manual import is rarely needed. Use `bd import` when you need to load data from an external JSONL file or migrate from a legacy JSONL-based setup.
32-
33-
## Options
16+
## Note
3417

35-
- **--skip-existing**: Skip updates to existing issues
36-
- **--strict**: Fail on dependency errors instead of warnings
18+
Dolt is the primary storage backend. Manual JSONL import is no longer supported as a standalone command.

claude-plugin/commands/workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ After closing, check if other work became ready:
3939
- **Priority levels**: 0=critical, 1=high, 2=medium, 3=low, 4=backlog
4040
- **Issue types**: bug, feature, task, epic, chore
4141
- **Dependencies**: Use `blocks` for hard dependencies, `related` for soft links
42-
- **Auto-sync**: Changes are stored in Dolt and synced via `bd sync`
42+
- **Auto-sync**: Changes are stored in Dolt and synced via `bd dolt push` / `bd dolt pull`
4343

4444
## Available Commands
4545
- `/beads:ready` - Find unblocked work

claude-plugin/skills/beads/resources/CLI_REFERENCE.md

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -467,37 +467,7 @@ bd rename-prefix kw- --json # Apply rename
467467

468468
### Import/Export
469469

470-
```bash
471-
# Import issues from JSONL
472-
bd import -i .beads/issues.jsonl --dry-run # Preview changes
473-
bd import -i .beads/issues.jsonl # Import and update issues
474-
bd import -i .beads/issues.jsonl --dedupe-after # Import + detect duplicates
475-
476-
# Handle missing parents during import
477-
bd import -i issues.jsonl --orphan-handling allow # Default: import orphans without validation
478-
bd import -i issues.jsonl --orphan-handling resurrect # Auto-resurrect deleted parents as tombstones
479-
bd import -i issues.jsonl --orphan-handling skip # Skip orphans with warning
480-
bd import -i issues.jsonl --orphan-handling strict # Fail if parent is missing
481-
482-
# Configure default orphan handling behavior
483-
bd config set import.orphan_handling "resurrect"
484-
bd sync # Now uses resurrect mode by default
485-
```
486-
487-
**Orphan handling modes:**
488-
489-
- **`allow` (default)** - Import orphaned children without parent validation. Most permissive, ensures no data loss even if hierarchy is temporarily broken.
490-
- **`resurrect`** - Search history for deleted parents and recreate them as tombstones (Status=Closed, Priority=4). Preserves hierarchy with minimal data. Dependencies are also resurrected on best-effort basis.
491-
- **`skip`** - Skip orphaned children with warning. Partial import succeeds but some issues are excluded.
492-
- **`strict`** - Fail import immediately if a child's parent is missing. Use when database integrity is critical.
493-
494-
**When to use:**
495-
- Use `allow` (default) for daily imports and auto-sync
496-
- Use `resurrect` when importing from databases with deleted parents
497-
- Use `strict` for controlled imports requiring guaranteed parent existence
498-
- Use `skip` rarely - only for selective imports
499-
500-
See [CONFIG.md](CONFIG.md#example-import-orphan-handling) and [TROUBLESHOOTING.md](TROUBLESHOOTING.md#import-fails-with-missing-parent-errors) for more details.
470+
> **Note:** `bd import` has been removed. For JSONL migration, use `bd init <prefix> --from-jsonl <file>`.
501471
502472
### Migration
503473

@@ -531,16 +501,15 @@ These invariants prevent data loss and would have caught issues like GH #201 (mi
531501
### Sync Operations
532502

533503
```bash
534-
# Manual sync (force immediate export/import/commit/push)
535-
bd sync
536-
537-
# What it does:
538-
# 1. Commit pending changes to Dolt
539-
# 2. Pull from remote
540-
# 3. Merge any updates
541-
# 4. Push to remote
504+
# Sync via Dolt commands
505+
bd dolt push # Push changes to remote
506+
bd dolt pull # Pull from remote
507+
bd dolt commit # Commit pending changes
508+
bd dolt show # Check connection status
542509
```
543510

511+
> **Note:** `bd sync` is deprecated (now a no-op). Use the Dolt commands above instead.
512+
544513
## Issue Types
545514

546515
- `bug` - Something broken that needs fixing
@@ -660,10 +629,10 @@ bd update bd-42 --claim --json
660629
# ... work ...
661630

662631
# End of session (IMPORTANT!)
663-
bd sync # Force immediate sync, bypass debounce
632+
bd dolt push # Push changes to remote
664633
```
665634

666-
**ALWAYS run `bd sync` at end of agent sessions** to ensure changes are committed/pushed immediately.
635+
**ALWAYS run `bd dolt push` at end of agent sessions** to ensure changes are pushed to remote.
667636

668637
## See Also
669638

claude-plugin/skills/beads/resources/TROUBLESHOOTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ This is a **known SQLite limitation**, not a bd bug.
243243

244244
3. **Import existing issues (if you have a JSONL backup):**
245245
```bash
246-
bd import -i issues-backup.jsonl
246+
bd init myproject --from-jsonl issues-backup.jsonl
247247
```
248248

249249
**Alternative: Use global `~/.beads/` database**

docs/ADVANCED.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ bd duplicates --auto-merge
7373
# Preview what would be merged
7474
bd duplicates --dry-run
7575

76-
# Detect duplicates during import
77-
bd import -i issues.jsonl --dedupe-after
76+
# Detect duplicates after initializing from JSONL
77+
bd init --from-jsonl # then: bd duplicates
7878
```
7979

8080
**How it works:**
@@ -255,25 +255,19 @@ bd vc resolve
255255

256256
### Understanding Same-ID Scenarios
257257

258-
When you encounter the same ID during import, it's an **update operation**, not a collision:
258+
When you encounter the same ID during a Dolt pull or database bootstrap, it's an **update operation**, not a collision:
259259

260260
- Hash IDs are content-based and remain stable across updates
261261
- Same ID + different fields = normal update to existing issue
262-
- bd automatically applies updates when importing
262+
- Dolt's cell-level merge resolves updates automatically
263263

264-
**Preview changes before importing:**
264+
**Bootstrapping from an export:**
265265
```bash
266-
# Preview an import
267-
bd import -i data.jsonl --dry-run
268-
269-
# Output shows:
270-
# Exact matches (idempotent): 15
271-
# New issues: 5
272-
# Updates: 3
273-
#
274-
# Issues to be updated:
275-
# bd-a3f2: Fix authentication (changed: priority, status)
276-
# bd-b8e1: Add feature (changed: description)
266+
# Export from one database
267+
bd export -o data.jsonl
268+
269+
# Bootstrap a new database from the export
270+
bd init --from-jsonl
277271
```
278272

279273
## Custom Git Hooks

docs/ARCHITECTURE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bd's core design enables a distributed, git-backed issue tracker that feels like
4949

5050
**Dolt for distribution:** Native push/pull to Dolt remotes (DoltHub, S3, GCS). No special sync server needed. Issues travel with your code. Offline work just works.
5151

52-
**Import/export for portability:** `bd import` and `bd export` support JSONL format for data migration, bootstrapping new clones, and interoperability.
52+
**Export for portability:** `bd export` outputs JSONL format for data migration and interoperability. Use `bd init --from-jsonl` to bootstrap a new database from an export.
5353

5454
## Write Path
5555

@@ -115,18 +115,18 @@ Branch B: bd create "Add Stripe" → bd-f14c (no collision)
115115
1. **Issue creation:** Generate random UUID, derive short hash as ID
116116
2. **Progressive scaling:** IDs start at 4 chars, grow to 5-6 chars as database grows
117117
3. **Content hashing:** Each issue has a content hash for change detection
118-
4. **Import merge:** Same ID + different content = update, same ID + same content = skip
118+
4. **Merge logic:** Same ID + different content = update, same ID + same content = skip
119119

120120
```
121121
┌─────────────────────────────────────────────────────────────────┐
122-
Import Logic │
123-
(used by bd import for migration)
122+
Merge Logic
123+
│ (used by Dolt pull and init --from-jsonl)
124124
│ │
125-
│ For each issue in import data:
125+
│ For each issue in incoming data: │
126126
│ 1. Compute content hash │
127127
│ 2. Look up existing issue by ID │
128128
│ 3. Compare hashes: │
129-
│ - Same hash → skip (already imported)
129+
│ - Same hash → skip (already present)
130130
│ - Different hash → update (newer version) │
131131
│ - No match → create (new issue) │
132132
└─────────────────────────────────────────────────────────────────┘

0 commit comments

Comments
 (0)