Commit Graph

2331 Commits

Author SHA1 Message Date
Steve Yegge
e5ace6cf6e chore: Bump version to 0.24.3
Updated all component versions:
- bd CLI: 0.24.2 → 0.24.3
- Plugin: 0.24.2 → 0.24.3
- MCP server: 0.24.2 → 0.24.3
- npm package: 0.24.2 → 0.24.3
- Documentation: 0.24.2 → 0.24.3

Generated by scripts/bump-version.sh
2025-11-23 23:42:48 -08:00
Steve Yegge
bc5d3690ce bd sync: 2025-11-23 23:41:14 2025-11-23 23:41:14 -08:00
Steve Yegge
d45cff5085 feat: Handle FOREIGN KEY constraint violations gracefully during import (bd-koab)
When importing JSONL after merges that include deletions, FK constraint
violations can occur if an issue references a deleted issue. Previously,
import would fail completely. Now it continues and reports skipped dependencies.

Changes:
- Add SkippedDependencies field to Result/ImportResult structs
- Update importDependencies() to detect FK violations using IsForeignKeyConstraintError()
- Log warnings for each skipped dependency with issue IDs and type
- Continue importing remaining dependencies instead of failing
- Display summary of all skipped dependencies at end of import

Example output:
  Warning: Skipping dependency due to missing reference: bd-b → bd-a (blocks)

  ⚠️  Warning: Skipped 2 dependencies due to missing references:
    - bd-b → bd-a (blocks)
    - bd-c → bd-a (parent-child)

  This can happen after merges that delete issues referenced by other issues.
  The import continued successfully - you may want to review the skipped dependencies.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 23:32:34 -08:00
Steve Yegge
e2e04c011a bd sync: 2025-11-23 23:11:21 2025-11-23 23:11:21 -08:00
Steve Yegge
d1641c7d2e Fix bd-afd: Auto-fix metadata.json jsonl_export mismatch
## Summary

When metadata.json gets deleted (git clean, merge conflict, rebase), the
version tracking code auto-recreates it using DefaultConfig() which hardcoded
jsonl_export to 'issues.jsonl'. But many repos (including beads itself) use
'beads.jsonl', causing a mismatch between config and actual JSONL file.

## Changes

1. **bd doctor --fix auto-detection** (cmd/bd/doctor/fix/database_config.go)
   - New DatabaseConfig() fix function that auto-detects actual JSONL file
   - Prefers beads.jsonl over issues.jsonl (canonical name)
   - Skips backup files and merge artifacts
   - Wired into doctor.go applyFixes()

2. **Version tracking auto-detection** (cmd/bd/version_tracking.go)
   - trackBdVersion() now scans for existing JSONL files before defaulting
   - Prevents mismatches when metadata.json gets recreated
   - Added findActualJSONLFile() helper function

3. **Canonical default name** (internal/configfile/configfile.go)
   - DefaultConfig() changed from issues.jsonl to beads.jsonl
   - Aligns with canonical naming convention

4. **FindJSONLPath preference** (internal/beads/beads.go)
   - Now prefers beads.jsonl over issues.jsonl when scanning
   - Default changed from issues.jsonl to beads.jsonl

5. **Test coverage**
   - Added comprehensive tests for DatabaseConfig fix
   - Updated configfile tests for new default
   - Verified backup file skipping logic

## Testing

- All existing tests pass
- New tests verify auto-fix behavior
- Integration tested with simulated mismatches

Closes: bd-afd
2025-11-23 23:11:08 -08:00
Steve Yegge
bee0e44187 bd sync: apply DB changes after import 2025-11-23 23:05:29 -08:00
Steve Yegge
2f7f77055f Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 23:05:29 -08:00
Steve Yegge
3006e67eef bd sync: 2025-11-23 23:05:28 2025-11-23 23:05:28 -08:00
Steve Yegge
153f724e95 Fix Windows CI test failures
Two Windows-specific test failures:

1. TestNewSQLiteStorage - File locking on temp cleanup
   - Windows couldn't delete temp database file because connection was still open
   - Added defer store.Close() to properly cleanup the database connection
   - Without this, Windows file locking prevents TempDir cleanup

2. TestFindAllDatabases - Unexpected nil slice return
   - FindAllDatabases could return nil instead of empty slice when os.Getwd() fails
   - Changed from var databases to explicit empty slice initialization
   - Ensures function always returns non-nil slice, matching test expectations

Both issues are more pronounced on Windows due to stricter file locking
and different filesystem behavior.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 23:01:55 -08:00
Steve Yegge
e5bb6ed6dc bd sync: 2025-11-23 22:55:37 2025-11-23 22:55:37 -08:00
Steve Yegge
21d246f502 bd sync: apply DB changes after import 2025-11-23 22:54:16 -08:00
Steve Yegge
0e956d733b Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 22:54:16 -08:00
Steve Yegge
7e41f2b4a5 bd sync: 2025-11-23 22:54:08 2025-11-23 22:54:08 -08:00
Steve Yegge
dfcbb7d3af Optimize sync_test.go: eliminate redundant git init calls
- Add setupGitRepo(), setupGitRepoWithBranch(), and setupMinimalGitRepo() helpers
- Refactor 19 test functions to use shared git repo setup
- Reduces duplicate git initialization boilerplate by ~300 lines
- All tests pass with improved maintainability

Related to bd-ktng
2025-11-23 22:54:05 -08:00
Steve Yegge
c9a2e7a8b2 Fix bd-v0y: Remove mtime fast-path in hasJSONLChanged
Git doesn't preserve mtime on checkout, causing false negatives where
hasJSONLChanged() incorrectly returns false after git pull updates JSONL.
This caused bd sync to overwrite pulled JSONL instead of importing it,
resurrecting deleted issues.

Solution: Always compute content hash for comparison (Option 1).
Performance impact is minimal (~10-50ms for sync operations).

Changes:
- cmd/bd/integrity.go: Remove mtime fast-path, always compute hash
- cmd/bd/sync.go: Remove mtime storage after import
- cmd/bd/import.go: Remove mtime storage after import
- cmd/bd/daemon_sync.go: Remove mtime storage and update comments
- cmd/bd/daemon_sync_test.go: Remove mtime assertions from tests

All tests pass. Existing test 'mtime changed but content same - git
operation scenario' verifies the fix works correctly.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 22:53:54 -08:00
Steve Yegge
7491c142d4 bd sync: 2025-11-23 22:47:28 2025-11-23 22:47:28 -08:00
Steve Yegge
e4cd9a896d bd sync: 2025-11-23 22:47:12 2025-11-23 22:47:12 -08:00
Steve Yegge
f5e96f9a7b Update bd JSONL after rebase 2025-11-23 22:39:58 -08:00
Steve Yegge
949ab4294c Fix ZFC: only force import when DB >> JSONL (stale DB)
Reverted 'always import' - that would overwrite local DB changes.
Now: only import first if DB has >50% more issues than JSONL (stale DB).
Preserves local uncommitted changes while catching sora scenario.
2025-11-23 22:39:51 -08:00
Steve Yegge
e7dfe284b5 bd sync: 2025-11-23 22:38:58 2025-11-23 22:38:58 -08:00
Steve Yegge
2e4171a5f8 Properly enforce ZFC: always import JSONL before export in sync
- Removed arbitrary 50% divergence check
- bd sync now unconditionally imports JSONL first (source of truth)
- Simpler, more correct: JSONL -> DB -> JSONL flow
2025-11-23 22:38:13 -08:00
Steve Yegge
1ba068fabd Fix bd-l0r: Enforce ZFC (JSONL First Consistency) - refuse export when DB >> JSONL 2025-11-23 22:34:19 -08:00
Steve Yegge
f5cc3ff85a bd sync: apply DB changes after import 2025-11-23 22:33:05 -08:00
Steve Yegge
fee336e4ff Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 22:33:05 -08:00
Steve Yegge
839292657a bd sync: 2025-11-23 22:33:04 2025-11-23 22:33:04 -08:00
Steve Yegge
133c30d0d5 bd sync: apply DB changes after import 2025-11-23 22:32:42 -08:00
Steve Yegge
e594596835 bd sync: 2025-11-23 22:32:29 2025-11-23 22:32:29 -08:00
Steve Yegge
3192c26709 bd sync: apply DB changes after import 2025-11-23 22:32:13 -08:00
Steve Yegge
26615721e9 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 22:32:12 -08:00
Steve Yegge
ca46d550a4 bd sync: 2025-11-23 22:32:11 2025-11-23 22:32:11 -08:00
Steve Yegge
ed11a13f1b bd sync: 2025-11-23 22:28:15 2025-11-23 22:28:15 -08:00
Steve Yegge
3009b42e06 bd sync: 2025-11-23 22:27:52 2025-11-23 22:27:52 -08:00
Steve Yegge
8b530ff809 bd sync: 2025-11-23 22:26:56 2025-11-23 22:26:57 -08:00
Steve Yegge
94c3471d42 bd sync: apply DB changes after import 2025-11-23 22:26:02 -08:00
Steve Yegge
8f465df351 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 22:26:01 -08:00
Steve Yegge
ed9b46d163 bd sync: 2025-11-23 22:26:00 2025-11-23 22:26:00 -08:00
Steve Yegge
054700456c Add --upgrade-mcp flag to bump-version.sh
- Adds automatic beads-mcp upgrade during version bumps
- Tries pip first, falls back to uv tool
- Warns if version mismatch (normal before PyPI publish)
- Updates RELEASING.md Post-Release section with usage
- Adds reminders in 'Next steps' output if not used
2025-11-23 22:25:37 -08:00
Steve Yegge
19e25f1aeb Update README: Mark FastMCP outputSchema issue as resolved 2025-11-23 22:13:44 -08:00
Steve Yegge
1f27256525 bd sync: 2025-11-23 22:09:36 2025-11-23 22:13:24 -08:00
Steve Yegge
5703f38858 bd sync: 2025-11-23 22:12:49 2025-11-23 22:12:49 -08:00
Steve Yegge
07e2e89657 bd sync: 2025-11-23 22:12:32 2025-11-23 22:12:32 -08:00
Steve Yegge
8bc8611918 bd sync: 2025-11-23 22:06:45 2025-11-23 22:06:45 -08:00
Steve Yegge
971cb45f1c Merge: keep local cleanup 2025-11-23 22:06:08 -08:00
Steve Yegge
06864a7813 Merge remote changes, keeping local cleanup (removed 628 issues) 2025-11-23 22:05:38 -08:00
Steve Yegge
e9b87f0899 bd sync: 2025-11-23 22:05:34 2025-11-23 22:05:34 -08:00
Steve Yegge
0e6ed91f2e Add explicit cache validation tests for blocked_issues_cache
Implements bd-13gm with 8 comprehensive tests that verify cache
invalidation behavior:

- Cache updates when blocking dependencies added/removed
- Cache updates when issue status changes (close/reopen)
- Cache consistency across multiple operations
- Parent-child transitive blocking propagates to cache
- Related dependencies don't affect cache
- Deep hierarchies handled correctly
- Multiple blockers handled correctly

Tests directly query blocked_issues_cache table to verify implementation
correctness, complementing existing behavior tests in ready_test.go.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 22:05:23 -08:00
Steve Yegge
31d9de0ac4 bd sync: 2025-11-23 22:04:05 2025-11-23 22:04:05 -08:00
Steve Yegge
10d3a1cba8 Merge remote changes and close bd-b0c8 research task 2025-11-23 22:03:44 -08:00
Steve Yegge
f5898528ee bd sync: 2025-11-23 22:02:40 2025-11-23 22:02:40 -08:00
Steve Yegge
ebf6e36b31 bd sync: apply DB changes after import 2025-11-23 21:59:16 -08:00