Commit Graph

1162 Commits

Author SHA1 Message Date
Steve Yegge 318709414e Update metadata 2025-11-04 13:18:55 -08:00
Steve Yegge 9cad8581d2 bd sync: 2025-11-04 13:18:13 2025-11-04 13:18:13 -08:00
Steve Yegge b41d65d833 feat(import): implement parent resurrection (bd-cc4f, bd-d76d, bd-02a4)
Phase 2 of fixing import failure on missing parent issues (bd-d19a).

Implemented:
- TryResurrectParent: searches JSONL history for deleted parents
- TryResurrectParentChain: recursively resurrects entire parent chains
- Creates tombstones (status=closed) to preserve hierarchical structure
- Modified EnsureIDs and CreateIssue to call resurrection before validation

When importing a child issue with missing parent:
1. Searches .beads/issues.jsonl for parent in git history
2. If found, creates tombstone with status=closed
3. Preserves original title and metadata
4. Appends original description to tombstone
5. Copies dependencies if targets exist

This allows imports to proceed even when parents were deleted,
enabling multi-repo workflows and normal database hygiene operations.

Part of bd-d19a (fix import failure on missing parents).

Amp-Thread-ID: https://ampcode.com/threads/T-a1c9e824-885e-40ce-a179-148cf39c7e64
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 13:16:17 -08:00
Steve Yegge b55359d7db bd sync: 2025-11-04 13:08:01 2025-11-04 13:08:01 -08:00
Steve Yegge 0df9144a2f Delete WASM zombie issues - switched to npm package 2025-11-04 13:07:34 -08:00
Steve Yegge f58605f26f bd sync: 2025-11-04 13:06:31 2025-11-04 13:06:31 -08:00
Steve Yegge 7b3f762e81 bd sync: 2025-11-04 12:55:23 2025-11-04 12:55:23 -08:00
Steve Yegge 2618bee57f bd sync: 2025-11-04 12:46:20 2025-11-04 12:46:20 -08:00
Steve Yegge f3f5c142ce bd sync: 2025-11-04 12:36:59 2025-11-04 12:36:59 -08:00
Steve Yegge eae4fcbec7 bd sync: 2025-11-04 11:29:29 2025-11-04 11:29:29 -08:00
Steve Yegge e0e15400a1 bd sync: 2025-11-04 11:26:20 2025-11-04 11:26:31 -08:00
Steve Yegge ba325a2931 Remove spurious test issues from issues.jsonl
These test issues (Frontend task, Backend task, Test Epic, etc.) were
accidentally committed during template feature development and kept
getting re-imported by auto-sync.

Restores issues.jsonl to the state before commit eb434dd.

Amp-Thread-ID: https://ampcode.com/threads/T-29a525fd-6b2d-4601-99ea-fce8c5cf6b13
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 11:26:21 -08:00
Steve Yegge 040e06dfad bd sync: 2025-11-04 11:25:42 2025-11-04 11:25:42 -08:00
Steve Yegge 568c565e8c bd sync: 2025-11-04 10:38:13 2025-11-04 10:38:13 -08:00
Steve Yegge 47214ddfe2 bd sync: 2025-11-04 10:26:37 2025-11-04 10:26:37 -08:00
Steve Yegge 919da0da2c bd sync: 2025-11-04 10:25:11 2025-11-04 10:25:11 -08:00
Steve Yegge ff914b2a2f bd sync: 2025-11-04 09:52:32 2025-11-04 09:52:32 -08:00
Steve Yegge 85e1cc13de test: add waitFor helper for event-driven testing
- Add test_wait_helper.go with waitFor() function for polling-based test assertions
- Used by daemon watcher platform tests for non-blocking event verification
- Sync beads.jsonl

Amp-Thread-ID: https://ampcode.com/threads/T-80e427aa-40e0-48a6-82e0-e29a93edd444
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 01:10:18 -08:00
Steve Yegge b1aec38b46 Fix :memory: database connection pool issue (bd-b121)
- Add db.SetMaxOpenConns(1) for :memory: databases
- SQLite shared cache mode requires single connection
- Fixes 'no such table' errors in VC and other consumers
- See bd-b121 for full details

Amp-Thread-ID: https://ampcode.com/threads/T-bbbb8f17-5ac0-4125-9035-e5488d3ebab1
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 00:59:22 -08:00
Steve Yegge 6e4a1589f4 Auto-sync issues 2025-11-04 00:38:23 -08:00
Steve Yegge 1009f0b263 Sync issues to JSONL
Amp-Thread-ID: https://ampcode.com/threads/T-c3fa2879-21ad-4918-b539-8f299e13f706
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 00:38:15 -08:00
Steve Yegge efed596124 bd sync: 2025-11-04 00:37:56 2025-11-04 00:37:56 -08:00
Steve Yegge abbdbf487a fix: Update dep_add test to match current show output format 2025-11-04 00:23:25 -08:00
Steve Yegge 7caab7aa9a bd sync: 2025-11-03 22:40:18 2025-11-03 22:40:18 -08:00
Steve Yegge 4e1e1f361c bd sync: 2025-11-03 22:23:29 2025-11-03 22:23:29 -08:00
Steve Yegge 21797db780 bd sync: 2025-11-03 21:31:40 2025-11-03 21:31:40 -08:00
Steve Yegge 0ad8a0ef01 bd sync: 2025-11-03 20:54:29 2025-11-03 20:54:30 -08:00
Steve Yegge eb434dd08c Add template support for issue creation (bd-164b)
- Built-in templates: epic, bug, feature (embedded in binary)
- Custom templates in .beads/templates/ (override built-ins)
- Commands: bd template list/show/create
- Flag: bd create --from-template <name> "Title"
- Template fields: description, type, priority, labels, design, acceptance
- Security: sanitize template names to prevent path traversal
- Flag precedence: explicit flags override template defaults
- Tests: template loading, security, flag precedence
- Docs: commands/template.md and README.md updated

Closes bd-164b

Amp-Thread-ID: https://ampcode.com/threads/T-118fe54f-b112-4f99-a3d9-b7df53fb7284
Co-authored-by: Amp <amp@ampcode.com>
2025-11-03 20:31:11 -08:00
Steve Yegge d2328f23bf bd sync: 2025-11-03 19:56:41 2025-11-03 19:56:41 -08:00
Steve Yegge 99c03ddc1a bd sync: 2025-11-03 19:14:00 2025-11-03 19:14:00 -08:00
Steve Yegge 07668e7346 chore: Update Beads issue tracker and ignore malformed DB files
- Export latest issue state to beads.jsonl
- Add gitignore entries for malformed SQLite DB files created by old buggy code
- Ignore bd-original backup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 18:03:07 -08:00
Steve Yegge a0eb19066a Fix SQLite file:// URI scheme to prevent query params in filename (bd-c54b) 2025-11-03 16:08:34 -08:00
Steve Yegge 30eccde11f Update beads.jsonl with bd-c54b (SQLite filename bug) 2025-11-03 15:05:49 -08:00
Steve Yegge 60bdccf508 Update beads.jsonl auto-sync
Amp-Thread-ID: https://ampcode.com/threads/T-43f6c7bf-9d4f-4475-8266-69e0a35a5909
Co-authored-by: Amp <amp@ampcode.com>
2025-11-03 14:55:37 -08:00
Steve Yegge e07e3a7833 bd sync: 2025-11-03 12:30:28 2025-11-03 12:30:28 -08:00
Steve Yegge a58f5b4509 Merge wasm-port-bd-44d0: Add npm package with native binaries
Merges complete npm package implementation for @beads/bd.

Features:
- npm package wrapping native bd binaries
- Automatic platform-specific binary download
- Claude Code for Web integration via SessionStart hooks
- Comprehensive integration test suite (5 tests, all passing)
- Complete documentation (6 guides)
- Release process documentation

Published to npm: https://www.npmjs.com/package/@beads/bd

Benefits over WASM:
- Full SQLite support (native vs custom VFS)
- Better performance
- Simpler implementation and maintenance
- 100% feature parity with standalone bd

Closes bd-febc
2025-11-03 12:08:39 -08:00
Steve Yegge 3335cde33a bd sync: 2025-11-03 12:07:56 2025-11-03 12:07:56 -08:00
Steve Yegge f2baecf249 bd sync: 2025-11-03 10:49:27
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 12:04:17 -08:00
Steve Yegge b10293533f bd sync: 2025-11-03 12:04:01 2025-11-03 12:04:01 -08:00
Steve Yegge fc71d4e192 Add integration tests and release documentation for npm package
Integration Tests:
- Comprehensive test suite covering all major functionality
- 5 test scenarios: installation, binary functionality, workflow,
  Claude Code for Web simulation, platform detection
- Tests JSONL import/export across sessions
- Tests all major commands (init, create, list, show, update, close, ready)
- All tests passing 

Testing Documentation:
- TESTING.md with complete test documentation
- Describes unit vs integration tests
- Manual testing scenarios
- CI/CD recommendations
- Troubleshooting guide

Release Documentation:
- RELEASING.md with comprehensive release process
- Covers all distribution channels: GitHub, Homebrew, PyPI, npm
- Step-by-step instructions for each channel
- Version numbering and release cadence
- Hotfix and rollback procedures
- Automation opportunities with GitHub Actions

npm Package Updates:
- Added test:integration and test:all scripts
- Integration tests validate real-world usage patterns
- Tests simulate Claude Code for Web SessionStart hooks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 11:54:37 -08:00
Steve Yegge da921e1829 Add npm package for bd with native binaries (bd-febc)
Implements @beads/bd npm package for easy installation in Node.js
environments, especially Claude Code for Web.

Features:
- Automatic platform-specific binary download during postinstall
- CLI wrapper that invokes native bd binary
- Full feature parity with standalone bd
- Works with SessionStart hooks for auto-installation

Package structure:
- bin/bd.js: Node.js CLI wrapper
- scripts/postinstall.js: Downloads correct binary from GitHub releases
- scripts/test.js: Verification tests
- Comprehensive documentation (6 guides)

Published to npm: https://www.npmjs.com/package/@beads/bd

Benefits vs WASM:
- Full SQLite support (no custom VFS)
- Better performance (native vs WASM)
- Simpler implementation and maintenance
- All commands work identically

Closes bd-febc, bd-be7a, bd-e2e6, bd-f282, bd-87a0, bd-b54c

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 11:41:18 -08:00
Steve Yegge add5599d7e bd sync: 2025-11-03 10:35:27 2025-11-03 10:35:27 -08:00
Steve Yegge 39840f6b67 Fix GH #210: bd init --no-db now creates metadata.json and config.yaml
Problem: bd init --no-db returned early (line 131) before creating config files,
causing 'no beads database found' errors on subsequent commands.

Solution:
- Extracted createConfigYaml() helper function
- Call it in both --no-db and normal paths
- Create metadata.json in --no-db path before early return

Fixes bd-c66a
2025-11-03 10:35:21 -08:00
Steve Yegge e7be0a2869 bd sync: 2025-11-02 23:40:51 2025-11-02 23:40:51 -08:00
Steve Yegge fc9ad21e4b bd sync: 2025-11-02 23:36:47 2025-11-02 23:36:47 -08:00
Steve Yegge 481649a605 Fix widespread double JSON encoding bug in daemon RPC calls (bd-1048, bd-4ec8)
Multiple CLI commands had a systematic bug where ResolveID responses were
incorrectly converted using string(resp.Data) instead of json.Unmarshal.
Since resp.Data is json.RawMessage (already JSON-encoded), this preserved
the JSON quotes, causing IDs to become "bd-1048" instead of bd-1048.
When re-marshaled for subsequent RPC calls, these became double-quoted
("\"bd-1048\""), causing database lookups to fail.

Bugs fixed:
1. Nil pointer dereference in handleShow - added nil check after GetIssue
2. Double JSON encoding in 12 locations across 4 commands:
   - bd show (3 instances in show.go)
   - bd dep add/remove/tree (5 instances in dep.go)
   - bd label add/remove/list (3 instances in label.go)
   - bd reopen (1 instance in reopen.go)

All instances replaced string(resp.Data) with proper json.Unmarshal.
Removed debug logging added during investigation.

Tested: All affected commands now work correctly with daemon mode.
2025-11-02 22:34:24 -08:00
Steve Yegge 3e193f25d1 bd sync: 2025-11-02 22:23:58 2025-11-02 22:23:58 -08:00
Steve Yegge 9ce1d6c7a5 WIP: WASM port - switch to ncruces/go-sqlite3, add WASM stubs
- Switched from modernc.org/sqlite to ncruces/go-sqlite3 for WASM support
- Added WASM-specific stubs for daemon process management
- Created wasm/ directory with build.sh and Node.js runner
- WASM build succeeds (32MB bd.wasm)
- Node.js can load and execute the WASM module
- Next: Need to bridge Go file I/O to Node.js fs module

Related: bd-44d0, bd-8534, bd-c7eb
2025-11-02 22:17:08 -08:00
Steve Yegge 7fe7d4d50a bd sync: 2025-11-02 22:12:17 2025-11-02 22:12:17 -08:00
Steve Yegge d5dde7c753 bd sync: 2025-11-02 21:58:16 2025-11-02 21:58:16 -08:00