Commit Graph

527 Commits

Author SHA1 Message Date
Steve Yegge
8fa680a880 docs: update beads refinery CLAUDE.md with new terminology
Replace Imperator→Refinery, polecat→roughneck terminology.

Closes: gt-supz.5

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 14:22:38 -08:00
Steve Yegge
a71155028d fix: restore bd-2e0 lost in sync corruption
bd-2e0 'Add TTL to deletions manifest entries' was accidentally removed
when commit d5a3963 reduced issues.jsonl from 384 to 130 issues.

Root cause analysis:
- metadata.json pointed to 'issues.jsonl' which was deleted
- Database had 65 'open' issues vs 12 in JSONL (zombie resurrection)
- Rebuilt database from correct JSONL
- Recreated the one legitimate open issue (bd-2e0)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 17:41:29 -08:00
Steve Yegge
b54616e2ee bd sync: add bd-6rf (doctor check for stale beads-sync)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 23:46:10 -08:00
Steve Yegge
28a661a320 feat: add --readonly flag for worker sandboxes (gt-ymo)
Add a --readonly flag that blocks all write operations, allowing workers
to read beads state without modifying it. Workers can use:
- bd show, bd list, bd ready (read operations)

Workers cannot use:
- bd create, bd update, bd close, bd sync, etc. (write operations)

The flag can be set via:
- --readonly flag on command line
- BD_READONLY=true environment variable
- readonly: true in config file

This enables swarm workers to see their assigned work from a static
snapshot of the beads database without accidentally modifying it.

Commands protected by readonly mode:
- create, update, close, delete, edit
- sync, import, reopen
- comment add, dep add/remove, label add/remove
- repair-deps, compact, migrate, migrate-hash-ids, migrate-issues
- rename-prefix, validate --fix-all, duplicates --auto-merge
- epic close-eligible, jira sync

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 23:44:22 -08:00
Steve Yegge
cead713b9f bd sync: update issues after bd-gmf and bd-tok fixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 23:41:03 -08:00
Shaun Cutts
d541ff48e3 fix: accept 3-char all-letter base36 hashes in ExtractIssuePrefix (#446)
isLikelyHash() required at least one digit to distinguish hashes from
English words, but base36 hashes can be all-letters by chance.

This caused ExtractIssuePrefix("xa-adt-bat") to return "xa" instead
of "xa-adt", breaking import for 20 issues in xa-adapt.

Fix: Accept all-letter suffixes for 3-char only, keep digit requirement
for 4+ chars where word collision probability is low enough (~0.2%).

Rationale:
- 3-char: 36³ = 46K hashes, ~1000 common words = ~2% collision
- 4-char: 36⁴ = 1.6M hashes, ~3000 words = ~0.2% collision
- 5+ char: collision rate negligible
2025-12-02 23:00:24 -08:00
Steve Yegge
7f13623683 feat(merge): auto-resolve all field conflicts deterministically (bd-6l8)
Implement deterministic auto-resolve rules for all merge conflicts:
- Title/Description: side with latest updated_at wins
- Notes: concatenate both sides with separator
- Priority: higher priority wins (lower number)
- IssueType: local (left) wins
- Status: closed wins (existing)

Also fixed bug in isTimeAfter where invalid t1 incorrectly beat valid t2.

Removed unused conflict generation code (hasConflict, makeConflict,
makeConflictWithBase, issuesEqual, cmp import).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 20:52:07 -08:00
Steve Yegge
e90577a5ab chore(beads): add bd-3s8 follow-up issues
Created issues for remaining multi-clone sync work:
- bd-6l8: Auto-resolve field conflicts in merge.go
- bd-7ch: Auto-push after merge with safety check
- bd-lsa: Mass deletion logging for forensics
- bd-4u8: Config option for mass delete confirmation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 19:35:13 -08:00
Steve Yegge
096e51a8b8 bd sync: 2025-12-01 21:24:52 2025-12-01 21:25:06 -08:00
Steve Yegge
a2d1edd865 fix(multi-repo): filter issues by prefix when flushing from non-primary repos (GH #437)
In multi-repo mode, non-primary repos incorrectly wrote ALL issues to their
local issues.jsonl, including foreign issues from other repos. This caused
prefix mismatch errors on subsequent imports.

The fix adds prefix filtering in flushToJSONLWithState() when:
1. Multi-repo mode is configured (repos.primary set)
2. Current repo is not the primary repo
3. The repo has a configured issue_prefix

Issues not matching the local prefix are filtered out before writing to JSONL.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:17:56 -08:00
Steve Yegge
64ef220dee feat(cli): add --estimate flag to bd create and bd update commands
Add CLI support for the estimated_minutes field that was already in the
Issue schema but had no way to be set from the command line.

Changes:
- Add --estimate flag to bd create (set estimated time on new issues)
- Add --estimate flag to bd update (modify estimated time on existing issues)
- Add EstimatedMinutes field to RPC CreateArgs and UpdateArgs
- Add handling in daemon RPC handlers for the new field

Example usage:
  bd create --title "Task" --estimate 60    # 60 minutes estimate
  bd update bd-abc --estimate 120           # update to 2 hours

Fixes GH #443

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:13:51 -08:00
Steve Yegge
7ea8555bc8 bd sync: update bd-3s8 with description and move to open 2025-12-01 21:12:10 -08:00
Steve Yegge
2d12a080d7 Refactor daemon sync functions to reduce duplication (bd-73u)
Extract shared performSync implementation with skipGit parameter:
- createSyncFunc and createLocalSyncFunc now delegate to performSync
- Follows same pattern as performExport and performAutoImport
- Reduces ~80 lines of duplicated code

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:10:56 -08:00
Steve Yegge
d90936116d docs: add go install fallback for Claude Code web (GH #439)
Add documentation for users experiencing npm postinstall failures in Claude Code web environments due to network restrictions.

Closes: bd-8q0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:10:03 -08:00
Steve Yegge
6ebf7d9538 bd sync: 2025-12-01 21:07:46 2025-12-01 21:08:05 -08:00
Steve Yegge
0456e784f4 fix(deps): improve parent-child dependency UX (GH #440)
- Fix DEPENDENCIES.md: correct parent-child syntax (child depends on parent)
- Update bd show: display Children instead of Blocks for parent-child deps
- Group dependents by type with distinct labels

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:07:23 -08:00
Steve Yegge
4c5d90cf46 bd sync: track issue bd-hm8 completion 2025-12-01 21:05:44 -08:00
Steve Yegge
3de3b60b45 Add uninstall documentation (GH #445)
- Create docs/UNINSTALLING.md with comprehensive uninstall steps
- Add link to UNINSTALLING.md from INSTALLING.md
- Cover: daemon, hooks, merge driver, .beads dir, worktree cleanup

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:05:19 -08:00
Steve Yegge
2300514424 bd sync: 2025-12-01 21:00:26 2025-12-01 21:00:26 -08:00
Steve Yegge
f84684e314 refactor(daemon): consolidate local-only sync functions to reduce duplication (bd-73u)
Extract performExport() and performAutoImport() shared implementations:
- createExportFunc() and createLocalExportFunc() now use performExport()
  with skipGit parameter
- createAutoImportFunc() and createLocalAutoImportFunc() now use performAutoImport()
  with skipGit parameter
- createLocalSyncFunc() kept as-is (different flow from createSyncFunc)

Reduces daemon_sync.go by 89 lines (1003 -> 914) while maintaining
identical behavior and test coverage.

All existing tests pass. New shared functions use conditional logic
to skip git operations when skipGit=true, eliminating the need for
separate implementations.
2025-12-01 17:39:43 -08:00
Steve Yegge
34799a001d bd sync: close Jira integration epic bd-qvj 2025-12-01 10:45:11 -08:00
Steve Yegge
4a8e01f4d2 bd sync: 2025-11-30 22:11:35 2025-11-30 22:11:35 -08:00
Steve Yegge
40ab349c0a bd sync: 2025-11-30 21:31:13 2025-11-30 21:31:13 -08:00
Steve Yegge
8d19e75431 fix: add safety guard to prevent git-history-backfill mass deletion (bd-t5m)
When a clone gets reset (git reset --hard origin/main), the
git-history-backfill logic was incorrectly marking ALL issues as
deleted since they appeared in git history but not in the current
JSONL. This caused the entire database to be purged.

Fix:
- Add 50% threshold check: abort if git-history-backfill would delete
  more than 50% of issues (likely a reset scenario, not deletions)
- Add warning when >10 issues would be deleted via backfill
- Print helpful message about manual deletion if needed

Test:
- Added TestMassDeletionSafetyGuard that simulates JSONL reset and
  verifies the safety guard prevents mass deletion

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:26:16 -08:00
Steve Yegge
da38f8becf bd sync: close bd-4zy (import deletions warning) 2025-11-30 21:23:22 -08:00
Steve Yegge
f7dea354d8 fix(import): add warning when issues are skipped due to deletions manifest
When importing JSONL that contains issues in the deletions manifest,
import now:
- Filters out deleted issues before import
- Prints per-issue warning with deletion details (date, actor)
- Shows count of skipped issues in summary
- Suggests --ignore-deletions flag to force import

The new --ignore-deletions flag allows importing issues that are in the
deletions manifest, useful for recovering accidentally deleted issues.

Fixes bd-4zy

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:23:04 -08:00
Steve Yegge
d3dafcf76e bd sync: update beads files 2025-11-30 21:14:10 -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
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
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
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
9aada0fd89 bd sync: 2025-11-30 15:12:22 2025-11-30 15:12:22 -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