Commit Graph

1556 Commits

Author SHA1 Message Date
Steve Yegge
75dcb0da1c bd sync: 2025-11-05 19:27:33 2025-11-05 19:27:33 -08:00
Steve Yegge
fceecaf329 Merge branch 'main' of github.com:steveyegge/beads
Amp-Thread-ID: https://ampcode.com/threads/T-62a3b45b-f924-4017-ba5a-b5f64a1f31cb
Co-authored-by: Amp <amp@ampcode.com>

# Conflicts:
#	.beads/beads.jsonl
2025-11-05 19:27:33 -08:00
Steve Yegge
9820e788a4 bd sync: 2025-11-05 19:27:24 2025-11-05 19:27:24 -08:00
Steve Yegge
91bad1585d bd sync: 2025-11-05 19:22:12 2025-11-05 19:22:12 -08:00
Steve Yegge
e90e485e5b Fix bd-5ots: Eliminate N+1 query in scanIssues with batch label loading 2025-11-05 19:22:03 -08:00
Steve Yegge
5fdb555cd3 bd sync: 2025-11-05 19:17:14 2025-11-05 19:17:14 -08:00
Steve Yegge
fc9aa9bdae Merge remote-tracking branch 'origin/main'
Amp-Thread-ID: https://ampcode.com/threads/T-810952b1-e2a2-4913-97cb-90b12287ff40
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 19:17:07 -08:00
Steve Yegge
52c505956f feat: Add bd merge command for git 3-way JSONL merging (bd-omx1)
- Implemented bd merge command with dual-mode operation:
  1. Git 3-way merge: bd merge <output> <base> <left> <right>
  2. Duplicate issue merge: bd merge <sources...> --into <target> (placeholder)
- Added MergeFiles wrapper to internal/merge package
- Command works without database when used as git merge driver
- Supports --debug flag for verbose output
- Exit code 0 for clean merge, 1 for conflicts
- Handles deletions intelligently (delete-modify conflicts)
- Added proper MIT license attribution for @neongreen's beads-merge code
- Tests pass for git merge functionality

This enables git merge driver setup for .beads/beads.jsonl files.
2025-11-05 19:16:50 -08:00
Steve Yegge
3ecc16e0e3 Add workflow examples: multi-phase development and multiple personas (bd-p68x)
Amp-Thread-ID: https://ampcode.com/threads/T-b0f16435-48af-40ee-be66-ba0636fdd0fb
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 19:12:58 -08:00
Steve Yegge
7b60fa0ba9 bd sync: 2025-11-05 19:12:54 2025-11-05 19:12:54 -08:00
Steve Yegge
8bf6f20387 File bd-5ots: SearchIssues N+1 query bug 2025-11-05 19:12:08 -08:00
Steve Yegge
235f4e7cfa chore: Final beads sync 2025-11-05 19:04:39 -08:00
Steve Yegge
236d4e56b6 chore: Update beads issue tracker
Amp-Thread-ID: https://ampcode.com/threads/T-b4d124a2-447e-47d1-8124-d7c5dab9a97b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 19:04:31 -08:00
Steve Yegge
b230a2270d feat: Add bd init --contributor and --team wizards
- Implement OSS contributor workflow wizard
  - Auto-detects fork relationships (upstream remote)
  - Checks push access (SSH vs HTTPS)
  - Creates separate planning repository
  - Configures auto-routing to keep planning out of PRs

- Implement team workflow wizard
  - Detects protected main branches
  - Creates sync branch if needed
  - Configures auto-commit/auto-push
  - Supports both direct and PR-based workflows

- Add comprehensive documentation
  - examples/contributor-workflow/README.md
  - examples/team-workflow/README.md
  - Updated AGENTS.md, README.md, QUICKSTART.md
  - Updated docs/MULTI_REPO_MIGRATION.md

Closes: bd-kla1, bd-twlr, bd-6z7l
Amp-Thread-ID: https://ampcode.com/threads/T-b4d124a2-447e-47d1-8124-d7c5dab9a97b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 19:04:14 -08:00
Steve Yegge
c20aabe263 bd sync: 2025-11-05 19:03:47 2025-11-05 19:04:14 -08:00
Steve Yegge
9297cf118e Merge remote changes 2025-11-05 18:53:14 -08:00
Steve Yegge
3a28d7e6c8 bd sync: 2025-11-05 18:53:04 2025-11-05 18:53:04 -08:00
Steve Yegge
3c6f83470c feat: Vendor beads-merge 3-way merge algorithm (bd-oif6)
- Integrated @neongreen's beads-merge into internal/merge/
- Adapted to use bd's internal/types.Issue instead of custom types
- Added comprehensive tests covering merge scenarios
- Created ATTRIBUTION.md crediting @neongreen
- All tests pass

This solves:
- Multi-workspace deletion sync (bd-hv01)
- Git JSONL merge conflicts
- Field-level intelligent merging

Original: https://github.com/neongreen/mono/tree/main/beads-merge
2025-11-05 18:53:00 -08:00
Steve Yegge
349817afc9 Add multi-repo migration guide and bd migrate-issues command
- Created comprehensive migration guide at docs/MULTI_REPO_MIGRATION.md
  - Covers OSS contributor, team, multi-phase, and persona workflows
  - Step-by-step setup instructions with examples
  - Configuration reference and troubleshooting
- Implemented bd migrate-issues command
  - Move issues between repos with filtering (status/priority/labels/type)
  - Dependency preservation with upstream/downstream/closure options
  - Dry-run mode and strict validation
  - Interactive confirmation with --yes override
- Updated README.md and AGENTS.md with migration guide links

Completes: bd-c3ei, bd-mlcz
Part of epic: bd-8rd (Migration and onboarding for multi-repo)

Amp-Thread-ID: https://ampcode.com/threads/T-c5a7a780-b05e-4cc3-a7c1-5de107821b7e
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 18:44:02 -08:00
Steve Yegge
a1583a1b24 bd sync: 2025-11-05 18:43:51 2025-11-05 18:43:51 -08:00
Steve Yegge
fa38a69fcb bd sync: 2025-11-05 18:28:45 2025-11-05 18:28:45 -08:00
Steve Yegge
5438485fb8 Fix bd-9bsx: Add sync validation to prevent infinite dirty loop
- Added dbNeedsExport() to check if DB and JSONL are in sync
- Only re-export after import if DB has changes that differ from JSONL
- Prevents unconditional re-export that caused infinite dirty state
- Added comprehensive tests for sync validation

Fixes recurring dirty state after merge conflicts that plagued users for weeks.

Amp-Thread-ID: https://ampcode.com/threads/T-f4f8c8c6-07bc-4334-9109-4626b4fd7a24
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 18:10:06 -08:00
Steve Yegge
b6fad0e618 bd sync: 2025-11-05 18:09:54 2025-11-05 18:09:54 -08:00
Steve Yegge
5854bbfef7 Sync database state to JSONL 2025-11-05 17:51:46 -08:00
Steve Yegge
4f1bbdb837 Merge branch 'main' of github.com:steveyegge/beads
# Conflicts:
#	.beads/beads.jsonl
2025-11-05 17:50:59 -08:00
Steve Yegge
4b59167683 bd sync: 2025-11-05 17:50:54 2025-11-05 17:50:54 -08:00
Steve Yegge
082f5ce6f9 Update issue timestamps 2025-11-05 17:50:36 -08:00
Steve Yegge
d1e57d4388 Merge branch 'main' of github.com:steveyegge/beads
# Conflicts:
#	.beads/beads.jsonl
2025-11-05 17:47:46 -08:00
Steve Yegge
cf76fa390c bd sync: 2025-11-05 17:47:40 2025-11-05 17:47:40 -08:00
Steve Yegge
369a0fb7a9 bd sync: 2025-11-05 17:38:17 2025-11-05 17:38:18 -08:00
Steve Yegge
34ba064dcc Add support for bd --version flag
- Add -v, --version flag to root command
- Both bd --version and bd -v now print version info
- bd version subcommand continues to work as before
- Add tests for both flag variants

Amp-Thread-ID: https://ampcode.com/threads/T-583f9ef8-c358-48c5-91cf-c23a91bab9d7
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 17:37:53 -08:00
Steve Yegge
07d2c0ccc6 Fix devcontainer init check - look for DB file not directory 2025-11-05 17:31:30 -08:00
Steve Yegge
93a3ef85f4 Fix bd version command in setup script 2025-11-05 17:28:27 -08:00
Steve Yegge
8ce157b10c Fix devcontainer Go version to 1.24
Amp-Thread-ID: https://ampcode.com/threads/T-77c38402-ea95-4b09-8844-0c415b1ee7d2
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 17:17:11 -08:00
Steve Yegge
f7a45dd0ba bd sync: 2025-11-05 15:27:36 2025-11-05 15:27:36 -08:00
Steve Yegge
8e41df301f Update beads issue tracker (landing the plane) 2025-11-05 15:26:27 -08:00
Steve Yegge
279a1c48f6 Update beads issue tracker
Amp-Thread-ID: https://ampcode.com/threads/T-1844b7c3-fd46-49c0-95fe-86fe341485e9
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 15:26:19 -08:00
Steve Yegge
8f90b1f890 Less prescriptive landing protocol + recommend AGENTS.md session-ending hygiene
- AGENTS.md: Updated 'landing the plane' section to encourage creative,
  methodical conflict resolution instead of rigid step-by-step commands
- README.md: Added 'Configuring Your Own AGENTS.md' section recommending
  that project maintainers add session-ending protocols to their own
  AGENTS.md files to ensure proper database hygiene
2025-11-05 15:21:02 -08:00
Steve Yegge
6e8b4b8f19 Add devcontainer configuration for automatic bd setup
- Create .devcontainer/devcontainer.json with Go 1.23 environment
- Add setup.sh to build bd from source and install git hooks
- Add devcontainer README with documentation
- Update main README to mention devcontainer support
- Resolves bd-ry1u and GitHub issue #229
2025-11-05 15:09:48 -08:00
Steve Yegge
247e659642 bd sync: 2025-11-05 15:09:35 2025-11-05 15:09:35 -08:00
Steve Yegge
095e40de7d Docs: add 'Landing the Plane' protocol to AGENTS.md 2025-11-05 14:47:38 -08:00
Steve Yegge
d4c73c3469 Fix GH #227: Force bd edit to always use direct mode
- bd edit now bypasses daemon to prevent broken pipe errors
- Editing in /usr/local/bin/emacsclient can take minutes, causing daemon timeout
- Added check in PersistentPreRun to set noDaemon=true for edit command
- Human-only interactive command doesn't benefit from daemon anyway

Fixes #227
2025-11-05 14:36:52 -08:00
Steve Yegge
e805019dc4 Merge branch 'main' of github.com:steveyegge/beads 2025-11-05 14:36:45 -08:00
Steve Yegge
1814803b96 bd sync: 2025-11-05 14:36:44 2025-11-05 14:36:44 -08:00
Steve Yegge
4826080da8 bd sync: 2025-11-05 14:36:03 2025-11-05 14:36:03 -08:00
Steve Yegge
0076d4b4e4 bd sync: 2025-11-05 14:32:47 2025-11-05 14:32:36 -08:00
Steve Yegge
0d07346a11 bd sync: 2025-11-05 14:31:39 2025-11-05 14:31:41 -08:00
Steve Yegge
92b10b0806 Implement bd-zbq2: Export JSONL line count verification
After atomic rename during export, verify that the JSONL file contains
exactly the same number of lines as issues exported. This catches silent
export failures where the operation appears to succeed but doesn't
actually write all issues.

Real-world scenario that motivated this:
- SQL DELETE removed 240 issues
- 'bd export' appeared to succeed
- But JSONL was never updated
- Later session found all 240 deleted issues 'came back'

Changes:
- Add verification after os.Rename in exportCmd
- Reuse existing countIssuesInJSONL() helper
- Exit with clear error if mismatch detected
- Add test case that verifies detection works

Error message shown on mismatch:
  Error: Export verification failed
    Expected: 276 issues
    JSONL file: 516 lines
    Mismatch indicates export failed to write all issues

Tests:
✓ All existing export tests pass
✓ New test verifies line counting works correctly
✓ Test simulates corruption by truncating file

Performance: Verification is fast (just counts lines), minimal overhead
2025-11-05 14:31:41 -08:00
Steve Yegge
d91cc56e91 Update beads issues 2025-11-05 14:30:12 -08:00
Steve Yegge
f9771cddd1 Fix SQLite driver missing on arm64 macOS builds
Enable CGO_ENABLED=1 in goreleaser config to ensure SQLite driver
is properly compiled and linked in all builds.

Fixes #230

Amp-Thread-ID: https://ampcode.com/threads/T-06ef71cb-d3e8-42bf-8876-b09814c2c09c
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 14:30:12 -08:00