Commit Graph

2675 Commits

Author SHA1 Message Date
Steve Yegge
b97703dbee bd sync: 2025-11-28 21:49:39 2025-11-28 21:49:39 -08:00
Steve Yegge
92b7524059 bd sync: 2025-11-28 21:46:29 2025-11-28 21:46:29 -08:00
Steve Yegge
b5d436ca39 bd sync: 2025-11-28 21:46:21 2025-11-28 21:46:21 -08:00
Steve Yegge
74aac72575 bd sync: 2025-11-28 21:46:12 2025-11-28 21:46:12 -08:00
Steve Yegge
447181e483 bd sync: 2025-11-28 21:46:03 2025-11-28 21:46:03 -08:00
Steve Yegge
8f71b5fa22 bd sync: 2025-11-28 19:50:16 2025-11-28 19:50:16 -08:00
Steve Yegge
044e2ddb57 bd sync: 2025-11-28 18:52:00 2025-11-28 18:52:00 -08:00
Jimmy Stridh
bb16f247c6 fix(init): error on invalid JSON instead of overwriting settings (#404)
Previously, setupClaudeSettings would silently create an empty settings
map when json.Unmarshal failed, then write just a prompt field to the
file - destroying all existing user settings (permissions, hooks, etc).

Now returns a clear error asking the user to fix the JSON syntax
manually, preserving their original file contents.

Also properly handles permission errors when reading existing files.

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

Co-authored-by: Jimmy Stridh <jimmystridh@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-28 18:51:27 -08:00
Steve Yegge
1ec78c0b13 bd sync: 2025-11-28 18:46:56 2025-11-28 18:46:56 -08:00
Steve Yegge
95371ea116 Export and display close reasons for issues (beads-410)
- Add CloseReason field to Issue struct in types.go
- Add GetCloseReason() and batch GetCloseReasonsForIssues()
- Update issue loading to populate close reasons
- Update scanIssues() to include close_reason in JSONL export
- Update bd show to display close reason after status

Close reasons now survive sync between repos.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:39:07 -08:00
Steve Yegge
4575087752 bd sync: 2025-11-28 18:38:41 2025-11-28 18:38:55 -08:00
Steve Yegge
c0d7f0974f bd sync: 2025-11-28 18:36:54 2025-11-28 18:36:54 -08:00
Steve Yegge
e395b45e0a bd sync: 2025-11-28 18:22:16 2025-11-28 18:22:16 -08:00
Steve Yegge
1eb2e1c7ee bd sync: 2025-11-28 18:22:06 2025-11-28 18:22:13 -08:00
Steve Yegge
6df2b44787 bd sync: 2025-11-28 17:43:30 2025-11-28 17:43:30 -08:00
Steve Yegge
fe4f851d33 Fix validatePostImport false positive for legitimate deletions (bd-pg1)
The sync validation was incorrectly triggering 'data loss detected' when
issue count decreased after import, even for legitimate deletions recorded
in deletions.jsonl.

Changes:
- Modified validatePostImport to accept jsonlPath and check deletions manifest
- When issue count decreases, check if decrease is within recorded deletions
- Updated all call sites in sync.go and daemon_sync.go
- Added comprehensive tests for deletion-aware validation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:43:25 -08:00
Steve Yegge
b33259a94e bd sync: 2025-11-28 17:43:02 2025-11-28 17:43:25 -08:00
Steve Yegge
6cd9e88472 bd sync: 2025-11-28 17:42:51 2025-11-28 17:42:51 -08:00
Steve Yegge
30197ee1ae bd-upd: Add snapshot cleanup to daemon sync function
After sync completion, orphan .base.jsonl and .left.jsonl files were
remaining in .beads/ directory. These are merge artifacts that should be
cleaned up after successful sync.

The fix adds SnapshotManager.Cleanup() call to createSyncFunc in
daemon_sync.go after successful import, matching the behavior of the CLI
sync command. Supports both single-repo and multi-repo modes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:42:47 -08:00
Steve Yegge
e7155d189e bd sync: 2025-11-28 17:42:24 2025-11-28 17:42:47 -08:00
Steve Yegge
86d6ffe57d fix(doctor): exclude merge artifacts from multiple JSONL warning
Add .base.jsonl, .left.jsonl, and .right.jsonl patterns to the skip list
in CheckLegacyJSONLFilename. These are legitimate git merge conflict
artifacts that should not trigger a warning about multiple JSONL files.

Fixes: bd-nsb

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:42:23 -08:00
Steve Yegge
2e97b4dddd Merge branch 'main' of github.com:steveyegge/beads 2025-11-28 17:42:09 -08:00
Steve Yegge
7c25cc0946 bd sync: 2025-11-28 17:41:56 2025-11-28 17:41:56 -08:00
Steve Yegge
03fa119e85 Add close reason display for closed issues
- Add CloseReason field to Issue struct
- Add GetCloseReason and GetCloseReasonsForIssues queries
- Batch-load close reasons in scanIssues for efficiency
- Display close reason in bd show output

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:36:01 -08:00
Steve Yegge
e05c7624d3 bd sync: 2025-11-28 17:28:55 2025-11-28 17:28:55 -08:00
Steve Yegge
93d08a2900 bd sync: 2025-11-28 17:28:45 2025-11-28 17:28:45 -08:00
Steve Yegge
56df5d47e2 bd sync: 2025-11-28 17:28:35 2025-11-28 17:28:35 -08:00
Steve Yegge
2c6bc58fbe bd sync: 2025-11-28 17:06:39 2025-11-28 17:06:39 -08:00
Steve Yegge
229187258b bd sync: 2025-11-28 10:51:09 2025-11-28 10:51:09 -08:00
Steve Yegge
7285fc0fe1 Save stashed work as patches (pre-reboot backup) 2025-11-28 10:50:49 -08:00
Steve Yegge
060c2b68c7 bd sync: 2025-11-27 22:57:28 2025-11-27 22:57:28 -08:00
Steve Yegge
3c5d1e06b0 bd sync: 2025-11-27 22:57:13 2025-11-27 22:57:24 -08:00
Steve Yegge
774a57684c Fix auto-import git history backfill bug (bd-4pv)
Auto-import was allowing git history backfill to run, which could
incorrectly purge issues. The fix adds NoGitHistory=true to all
auto-import code paths:
- autoimport.go (importFromGit)
- autoflush.go (autoImportIfNewer)
- daemon_sync.go (importToJSONLWithStore)

Git history backfill is designed to detect deletions that happened
after a local DB was created. During auto-import, there is no local
work to protect - we are importing from the authoritative JSONL source.

Also adds comprehensive tests for NoGitHistory behavior.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 22:51:39 -08:00
Steve Yegge
d50861f188 bd sync: 2025-11-27 22:50:54 2025-11-27 22:51:12 -08:00
Steve Yegge
8b8a662acb Fix fresh clone UX with friendly error messages (bd-dmb)
When opening a database that exists but is missing issue_prefix config
(typical in fresh clone scenarios), show a helpful error message instead
of cryptic migration invariant errors.

The new message:
- Explains the database needs initialization
- Detects if a JSONL file exists and shows the issue count
- Suggests the exact command to run: bd import -i <path>
- Falls back to suggesting bd init --prefix if no JSONL exists

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 22:40:57 -08:00
Steve Yegge
151a34be98 bd sync: 2025-11-27 22:40:24 2025-11-27 22:40:40 -08:00
Steve Yegge
498715f27f bd sync: 2025-11-27 22:39:17 2025-11-27 22:39:17 -08:00
Steve Yegge
1675275e1c Implement auto-merge functionality for duplicates command
When --auto-merge is used, performMerge now automatically:
1. Closes source issues with "Duplicate of <target>" reason
2. Links each source to target with a "related" dependency

Closes bd-hdt

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 22:39:13 -08:00
Steve Yegge
f06f282d26 bd sync: 2025-11-27 22:38:26 2025-11-27 22:38:54 -08:00
Steve Yegge
bc37afbb0e Fix bd sync staging gitignored files (bd-guc)
Changed gitCommitBeadsDir to explicitly stage only sync files
(issues.jsonl, deletions.jsonl, metadata.json) instead of the
entire .beads/ directory.

This prevents staging gitignored snapshot files (beads.*.jsonl,
*.meta.json) that may still be tracked from before they were
added to .gitignore, which could cause merge conflicts when
multiple polecats run bd sync concurrently.
2025-11-27 22:34:46 -08:00
Steve Yegge
9b6d5a5241 bd sync: 2025-11-27 22:34:34 2025-11-27 22:34:34 -08:00
Steve Yegge
22d34a22dc Fix bd migrate loop: skip prefix validation during auto-import
When auto-importing issues from JSONL, issues with different prefixes
(e.g., gt-1 vs gastown-) would fail validation and cause an infinite
loop of failed migrations.

The fix adds SkipPrefixValidation option to CreateIssuesWithFullOptions
which propagates through EnsureIDs to skip prefix validation for issues
that already have IDs during import. This allows importing issues with
any prefix while still validating new issues created interactively.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 21:45:42 -08:00
Steve Yegge
7447a5004c bd sync: 2025-11-27 20:47:47 2025-11-27 20:47:47 -08:00
Steve Yegge
76a2542122 bd sync: 2025-11-27 20:21:31 2025-11-27 20:21:31 -08:00
Steve Yegge
cb3dcae402 bd sync: 2025-11-27 18:49:27 2025-11-27 18:49:27 -08:00
Steve Yegge
83d1c01bf1 bd sync: 2025-11-27 18:22:06 2025-11-27 18:22:06 -08:00
Steve Yegge
7b1d291329 bd sync: apply DB changes after import 2025-11-27 17:01:40 -08:00
Steve Yegge
edca861d83 bd sync: apply DB changes after import 2025-11-27 17:01:21 -08:00
Steve Yegge
3a6a8abe54 bd sync: 2025-11-27 17:01:20 2025-11-27 17:01:21 -08:00
Steve Yegge
39ed52726c bd sync: 2025-11-27 15:18:08 2025-11-27 15:18:08 -08:00