Commit Graph

2904 Commits

Author SHA1 Message Date
Steve Yegge
3df138445a fix(init): allow fresh clones with JSONL to run bd init (bd-4h9)
Previously, bd init blocked when JSONL existed with issues but no database,
telling users to run 'bd doctor --fix'. But doctor --fix just ran bd migrate
which requires an existing database - creating a circular dependency.

Now:
- bd init allows fresh clones (JSONL exists, no database) to proceed
- bd init creates the database and imports from JSONL automatically
- bd doctor --fix runs bd init (not migrate) when there's no database

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:18:23 -08:00
Steve Yegge
d3dafcf76e bd sync: update beads files 2025-11-30 21:14:10 -08:00
Steve Yegge
e4de6f8af4 bd sync: 2025-11-30 21:13:33 2025-11-30 21:13:33 -08:00
Steve Yegge
5413536d5c bd sync: 2025-11-30 20:59:33 2025-11-30 20:59:33 -08:00
Steve Yegge
4616b20127 bd sync: 2025-11-30 20:51:02 2025-11-30 20:51:02 -08:00
Steve Yegge
2320a1c2ef fix: ExtractIssuePrefix now handles 3-char base36 hashes (#425)
- Lower minimum hash length from 4 to 3 characters
- Update hash validation to support base36 (0-9, a-z) instead of just hex
- Require at least one digit to distinguish hashes from English words
- Fixes prefix extraction for hyphenated prefixes with 3-char hashes
  e.g., 'document-intelligence-0sa' now correctly extracts 'document-intelligence'
- Add test cases for 3-char hashes with multi-part prefixes
- Resolves bd sync failures with 'prefix mismatch detected' errors
2025-11-30 20:50:56 -08:00
Steve Yegge
af78e7b10c bd sync: 2025-11-30 20:37:45 2025-11-30 20:37:45 -08:00
Steve Yegge
0b914d545a bd sync: update issues.jsonl 2025-11-30 19:24:31 -08:00
Steve Yegge
8a6fd9c0ff feat: add .beads/redirect file support for workspace redirection
Adds a lightweight redirect mechanism that allows a stub .beads directory
to point to the actual beads location. This solves the workspace problem
where an AI agent runs in one directory but needs to operate on beads
stored elsewhere.

The redirect file is a simple text file containing a path (relative or
absolute) to the target .beads directory. Comments (lines starting with #)
are supported. Redirect chains are prevented - only one level is followed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 19:23:30 -08:00
Steve Yegge
3deed3606d Merge pull request #435 from jzillmann/fix/wal-checkpoint-on-close
fix: checkpoint WAL on Close() to persist writes
2025-11-30 17:19:12 -08:00
Steve Yegge
e6ddacf0be bd sync: 2025-11-30 17:18:21 2025-11-30 17:18:21 -08:00
Steve Yegge
e452a60627 bd sync: 2025-11-30 17:17:57 2025-11-30 17:18:08 -08:00
Steve Yegge
534772cf3c test: add unit tests for Jira integration
- Test isJiraExternalRef helper with various URL patterns
- Test stats struct initialization
- Test result struct fields

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 15:35:30 -08:00
Steve Yegge
ac07d034f9 fix: address code review issues in jira.go
- Add ensureStoreActive() check in jiraSyncCmd
- Improve external_ref validation with isJiraExternalRef helper
- Add error logging for UpdateIssue failures
- Make stub conflict resolution functions more honest about limitations
- Fix external_ref counting to not count non-Jira refs as pending

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 15:31:27 -08:00
Johannes Zillmann
b267395d8c fix: checkpoint WAL on Close() to persist writes
SQLite WAL mode writes go to the -wal file, not the main database.
Without an explicit checkpoint before Close(), writes can be stranded
and lost between CLI invocations.

This was causing `bd migrate` to report success but not actually
persist the version update to the database.

Fixes #434

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 17:28:02 -06:00
Steve Yegge
ac6d4b9f44 feat: add bd jira sync command (bd-clg)
Implements Jira synchronization with the following features:
- bd jira sync --pull - Import issues from Jira
- bd jira sync --push - Export issues to Jira
- bd jira sync - Bidirectional sync (pull then push)
- bd jira status - Show sync status and configuration

Conflict resolution options:
- --prefer-local - Always prefer local beads version
- --prefer-jira - Always prefer Jira version
- Default: newer timestamp wins

Additional options:
- --dry-run - Preview sync without making changes
- --create-only - Only create new issues, don't update
- --update-refs - Update external_ref after creating Jira issues
- --state - Filter by issue state (open, closed, all)

Uses Python scripts in examples/jira-import/ for API calls.
Stores jira.last_sync timestamp in config.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 15:26:17 -08:00
Steve Yegge
ae939798bd bd sync: 2025-11-30 15:25:51 2025-11-30 15:25:51 -08:00
Steve Yegge
d7294486b0 bd sync: 2025-11-30 15:20:00 2025-11-30 15:20:00 -08:00
Steve Yegge
cbf6545b95 feat: add Jira export script (jsonl2jira.py)
Add a Python script to push bd issues to Jira.

Features:
- Create new Jira issues from bd issues without external_ref
- Update existing Jira issues matched by external_ref
- Handle Jira workflow transitions for status changes
- Reverse field mappings (bd -> Jira) via config
- Dry-run mode for previewing changes
- Auto-update external_ref after creation (--update-refs)

Also updates README to document bidirectional sync workflow.

Closes bd-93d

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 15:19:51 -08:00
Steve Yegge
9aada0fd89 bd sync: 2025-11-30 15:12:22 2025-11-30 15:12:22 -08:00
Steve Yegge
3f9c9bdfd4 feat: add Jira import script (jira2jsonl.py)
Add a Python script to import Jira issues into beads JSONL format.

Features:
- Fetch issues from Jira Cloud or Server/Data Center REST API
- JQL query support for flexible filtering
- Configurable field mappings via bd config
- Hash-based or sequential ID generation
- Issue links converted to dependencies
- external_ref set for re-sync capability

Configuration options:
- jira.url, jira.project, jira.api_token
- jira.status_map.*, jira.type_map.*, jira.priority_map.*

Closes bd-tjn

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 15:12:14 -08:00
Steve Yegge
59befda847 docs: add dependency direction guidance for AI agents
Add section explaining the cognitive trap where temporal language
("Phase 1", "Step 1", "before") causes inverted dependency direction.
Includes examples of correct vs incorrect dependency setup and
verification using bd blocked.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 12:57:58 -08:00
Steve Yegge
3357dfc632 bd sync: apply DB changes after import 2025-11-30 12:57:45 -08:00
Steve Yegge
71beffdd12 bd sync: 2025-11-30 12:57:44 2025-11-30 12:57:44 -08:00
Steve Yegge
77bb8e65a4 bd sync: update deletions manifest 2025-11-30 12:40:44 -08:00
Steve Yegge
79379a259e bd sync: 2025-11-30 12:38:06 2025-11-30 12:38:06 -08:00
Steve Yegge
f60c1e1463 bd sync: 2025-11-30 12:37:19 2025-11-30 12:37:39 -08:00
Steve Yegge
56153c19a8 bd sync: 2025-11-30 12:36:34 2025-11-30 12:37:39 -08:00
Steve Yegge
68b2a6dff4 bd sync: 2025-11-30 12:37:22 2025-11-30 12:37:22 -08:00
Steve Yegge
590fc1db60 bd sync: 2025-11-30 12:36:59 2025-11-30 12:37:17 -08:00
Steve Yegge
6095383360 bd sync: 2025-11-30 12:36:42 2025-11-30 12:37:17 -08:00
Steve Yegge
0b989d7e05 bd sync: 2025-11-30 12:36:23 2025-11-30 12:37:17 -08:00
Steve Yegge
3f7a967a47 bd sync: apply DB changes after import 2025-11-30 12:36:59 -08:00
Steve Yegge
e8ed88bf5d bd sync: apply DB changes after import 2025-11-30 12:36:59 -08:00
Steve Yegge
026f17d1f6 bd sync: 2025-11-30 12:36:29 2025-11-30 12:36:59 -08:00
Steve Yegge
73a899d772 bd sync: apply DB changes after import 2025-11-30 12:36:44 -08:00
Steve Yegge
70f5d6e158 Merge branch 'main' of github.com:steveyegge/beads 2025-11-30 12:36:39 -08:00
Steve Yegge
54928b78a1 fix: validate BEADS_DIR env var for project files (bd-420)
Extends the fix from PR #424 to also validate the BEADS_DIR environment
variable. Previously, only the directory tree search was validated, but
BEADS_DIR could still point to a daemon-only directory.

Changes:
- Add validation to BEADS_DIR path using hasBeadsProjectFiles()
- Add comprehensive test for BEADS_DIR validation
- Test verifies both rejection of daemon-only dirs and acceptance of valid dirs

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 12:36:27 -08:00
Steve Yegge
b8679fe3c6 bd sync: 2025-11-30 12:36:12 2025-11-30 12:36:12 -08:00
Serhii
95fe36fb53 fix: validate project files in FindBeadsDir (bd-420) (#424)
FindBeadsDir() now checks for actual beads project files before returning
a .beads directory. This prevents false positives when ~/.beads/ exists
only for daemon registry (registry.json).

Changes:
- Add hasBeadsProjectFiles() helper that checks for:
  - metadata.json or config.yaml (project config)
  - *.db files (excluding backups and vc.db)
  - *.jsonl files (JSONL-only mode)
- Update FindBeadsDir() to validate directories during tree search
- Add comprehensive tests for project file detection
- Update version_tracking_test.go to create project files

Fixes #420

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-30 12:35:18 -08:00
Steve Yegge
7128524db9 bd sync: 2025-11-30 12:11:44 2025-11-30 12:11:44 -08:00
Kasper Zutterman
c4dd8e57c7 fix: broken Claude Code plugin link (#431) 2025-11-30 12:10:19 -08:00
Steve Yegge
6242373cca bd sync: apply DB changes after import 2025-11-30 11:31:47 -08:00
Steve Yegge
2febf7fb61 bd sync: 2025-11-30 11:31:40 2025-11-30 11:31:46 -08:00
Steve Yegge
0c9b03c1a0 bd sync: 2025-11-30 11:31:43 2025-11-30 11:31:43 -08:00
Steve Yegge
3e579d3bc7 bd sync: 2025-11-30 11:31:29 2025-11-30 11:31:29 -08:00
Steve Yegge
33265af58a bd sync: 2025-11-30 11:30:59 2025-11-30 11:30:59 -08:00
Steve Yegge
5fa21a5e63 bd sync: 2025-11-30 11:30:01 2025-11-30 11:30:47 -08:00
Steve Yegge
7eac26a086 bd sync: 2025-11-30 11:30:02 2025-11-30 11:30:02 -08:00
Steve Yegge
62bab53f38 bd sync: 2025-11-30 11:29:39 2025-11-30 11:29:57 -08:00