Commit Graph

3851 Commits

Author SHA1 Message Date
Steve Yegge
f777093386 feat(rpc): add GetMoleculeProgress endpoint (bd-0oqz)
New RPC endpoint to get detailed progress for a molecule (parent issue
with child steps). Returns moleculeID, title, assignee, and list of
steps with their status (done/current/ready/blocked) and timestamps.

Used when user expands a worker in the activity feed TUI.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 18:27:35 -08:00
Steve Yegge
b889aa6edb bd sync: 2025-12-23 18:16:31 2025-12-23 18:16:31 -08:00
Steve Yegge
3a82ce2929 feat(rpc): add GetWorkerStatus RPC endpoint (bd-l13p)
New RPC endpoint to get all workers and their current molecule/step in one call.
Returns: assignee, moleculeID, moleculeTitle, currentStep, totalSteps, stepTitle,
lastActivity, status. Enables activity feed TUI to show worker state without
multiple round trips.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 17:12:58 -08:00
Steve Yegge
0d66aed954 feat(types): add omitempty to JSONL fields for smaller output
Add omitempty json tag to:
- Issue.Description: often empty for quick tasks
- Dependency.CreatedBy: often empty

This reduces JSONL file size when these fields are empty, leading to
faster syncs and smaller repository size.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 17:11:06 -08:00
Steve Yegge
3405f0c684 feat(rpc): enrich MutationEvent with Title and Assignee fields
Add Title and Assignee fields to MutationEvent struct so activity feeds
can display meaningful context without extra lookups. Updated emitMutation
signature to accept these values and modified all callers:

- Create: passes issue.Title and issue.Assignee directly
- Update/Close: moved emitMutation after GetIssue to access enriched data
- Delete: uses existing issue lookup before deletion
- Dep/Label/Comment ops: passes empty strings (would require extra lookup)

Fixes bd-gqxd

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 17:09:56 -08:00
Steve Yegge
e0f1d43c2c fix: write startup config keys to config.yaml instead of SQLite (GH#536)
`bd config set no-db true` now correctly writes to config.yaml instead of
SQLite. Previously, startup flags like no-db, no-daemon, no-auto-flush were
stored in SQLite but read from config.yaml at startup - making the command
appear to work while having no effect.

This adds:
- yaml_config.go: Defines yaml-only keys and provides SetYamlConfig/GetYamlConfig
- Updated config set/get commands to route yaml-only keys appropriately
- Comprehensive tests for yaml config handling

Startup flags affected: no-db, no-daemon, no-auto-flush, no-auto-import,
json, auto-start-daemon, flush-debounce, lock-timeout, git.*, sync.*, routing.*

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 17:03:39 -08:00
Steve Yegge
d33bd822ca bd sync: 2025-12-23 17:03:27 2025-12-23 17:03:27 -08:00
Steve Yegge
2ac190f26d bd mol run: add cross-database spawning support (gt-jsup)
Add --template-db flag and auto-discovery for wisp molecule spawning.
When --db contains .beads-wisp, auto-discover the main database to read
templates from while writing spawned instances to wisp storage.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:39:18 -08:00
Steve Yegge
c2d6b130d9 bd sync: 2025-12-23 16:32:42 2025-12-23 16:32:42 -08:00
Steve Yegge
37042a82ce bd sync: 2025-12-23 16:32:21 2025-12-23 16:32:21 -08:00
Steve Yegge
be06a68dea bd sync: 2025-12-23 16:32:00 2025-12-23 16:32:00 -08:00
Steve Yegge
4bcf2a9c22 bd sync: 2025-12-23 16:29:02 2025-12-23 16:29:15 -08:00
Steve Yegge
4c9eb700cc bd sync: 2025-12-23 15:25:28 2025-12-23 16:29:15 -08:00
Steve Yegge
a23271d497 bd sync: 2025-12-23 15:15:28 2025-12-23 16:29:15 -08:00
Steve Yegge
3d924f88f3 fix: handle multi-hyphen prefixes correctly (GH#422)
The prefix mismatch detection was using ExtractIssuePrefix() which
tries to guess the prefix by analyzing suffix patterns. This failed
for multi-hyphen prefixes like "asianops-audit-" when issue IDs had
word-like suffixes (e.g., "asianops-audit-test") - the heuristic
would fall back to the first hyphen and report "asianops-" as the
prefix.

Fixed by checking directly if the issue ID starts with the configured
prefix using strings.HasPrefix(). This is more reliable than guessing
since we know the expected prefix from the database config.

Added test case TestImportMultiHyphenPrefix to prevent regression.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:20:04 -08:00
Steve Yegge
ee3d070d08 fix(mol): respect --pour flag in bond operations (bd-l7y3)
bondProtoMol was hardcoding Wisp=true, ignoring --pour flag.
Now passes pour parameter through the call chain so --pour
correctly creates persistent (non-wisp) issues.
2025-12-23 15:25:13 -08:00
Steve Yegge
2f049dfe6b docs: add temporal trap warning to onboard section
Helps agents avoid the common mistake of inverting dependency
direction when using temporal language like 'Phase 1 blocks Phase 2'.
2025-12-23 15:10:25 -08:00
Steve Yegge
fe2ac97597 fix: Exclude workflow types from bd ready by default (gt-7xtn)
merge-request, gate, molecule, and message types are internal workflow
items processed by Refinery/Deacon, not work for polecats to claim.
These are now excluded from bd ready unless explicitly requested via
--type flag.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:05:51 -08:00
Steve Yegge
649a48d64b bd sync: 2025-12-23 14:41:28 2025-12-23 14:41:28 -08:00
Steve Yegge
f4acf5c662 bd sync: 2025-12-23 14:18:09 2025-12-23 14:39:07 -08:00
Steve Yegge
7b671662aa bd sync: 2025-12-23 13:49:07 2025-12-23 14:39:07 -08:00
Steve Yegge
37ec967619 fix(stealth): use .git/info/exclude instead of global gitignore (GH#704)
The --stealth flag was writing absolute paths to global gitignore, but
git pattern matching does not support absolute paths in gitignore files.
Patterns are interpreted relative to the gitignore location, making
absolute paths like /home/user/project/.beads/ never match.

Fix: Use .git/info/exclude which is the git-recommended location for
user-specific, per-repository ignores. Patterns here are relative to
repo root, so .beads/ works correctly.

Benefits:
- Patterns actually work (fixes the bug)
- Per-repo isolation (stealth in one repo does not affect others)
- No global gitignore pollution
- Follows git best practices for user-local ignores

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 14:18:02 -08:00
intentsolutions.io
ac1f5807a8 feat: enhance natural language activation + Anthropic 2025 compliance (#718)
Restructures SKILL.md for better Claude Code skill compliance:

- Adds trigger phrases to description for better skill activation
- Adds allowed-tools, version, author, license to frontmatter
- Reorganizes content into workflow-based structure (Session Start, Task Creation, etc.)
- Adds consolidated Command Reference Table for faster intent → command mapping
- Adds dedicated Error Handling section with 7 common failures and solutions
- Adds dedicated Examples section with complete workflow examples

The workflow-based organization and command table are material improvements for Claude's ability to route user requests to the correct bd commands.

PR #718 by @jeremylongshore
2025-12-23 14:10:10 -08:00
Steve Yegge
0d31e4209d fix: preserve pinned field during JSONL import (bd-phtv)
Fixed two code paths where pinned=false from JSONL would overwrite
existing pinned=true in database:
- importer.go: Only update pinned if explicitly true in JSONL
- multirepo.go: Use COALESCE to preserve existing pinned value

Added tests for pinned field preservation.

Note: Bug may have additional code path - investigation ongoing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:49:22 -08:00
Steve Yegge
f503a5ae43 test: improve syncbranch coverage from 27% to 67% (bd-io8c)
Add comprehensive tests for internal/syncbranch package:

syncbranch.go:
- TestGetFromYAML: env var and default behavior
- TestIsConfigured: env var presence detection
- TestIsConfiguredWithDB: database and env var checks
- TestGetConfigFromDB: direct DB value retrieval

worktree.go helper functions:
- TestIsNonFastForwardError: git push error detection
- TestHasChangesInWorktree: dirty state detection
- TestCommitInWorktree: worktree commit flow
- TestCopyJSONLToMainRepo: file sync between worktrees
- TestGetRemoteForBranch: remote name resolution
- TestGetRepoRoot: repo root detection including worktrees
- TestHasGitRemote: remote existence check
- TestGetCurrentBranch: branch name detection
- TestFormatVanishedIssues: forensic logging

worktree.go main functions:
- TestCommitToSyncBranch: basic commit flow
- TestPullFromSyncBranch: pull and fast-forward scenarios
- TestResetToRemote: remote reset error handling
- TestPushSyncBranch: push with worktree recreation
- TestPreemptiveFetchAndFastForward: pre-fetch behavior
- TestFetchAndRebaseInWorktree: rebase error handling
- TestRunCmdWithTimeoutMessage: command execution

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:48:40 -08:00
Steve Yegge
2b26de08e5 Split sync.go into modular files (bd-u2sc.3)
Split the 2203-line sync.go into 5 focused modules:
- sync.go (1238 lines) - Main command and git helpers
- sync_export.go (170 lines) - Export operations
- sync_import.go (132 lines) - Import operations + doSyncFromMain
- sync_branch.go (285 lines) - Sync branch and external beads support
- sync_check.go (395 lines) - Integrity check operations

All tests pass. Remaining files (init.go, show.go, compact.go)
still need splitting - tracked for future work.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:48:01 -08:00
Steve Yegge
a129e36054 Add daemon RPC support for gate commands (bd-likt)
- Add gate operation constants (OpGateCreate, OpGateList, OpGateShow,
  OpGateClose, OpGateWait) to protocol.go
- Add Gate*Args and Gate*Result types to protocol.go
- Add gate handler methods (handleGateCreate, handleGateList,
  handleGateShow, handleGateClose, handleGateWait) to server_issues_epics.go
- Register gate handlers in handleRequest switch
- Add gate client methods (GateCreate, GateList, GateShow, GateClose,
  GateWait) to client.go
- Update cmd/bd/gate.go to use daemon client when available, falling
  back to direct store access

Gate commands now work with the daemon, eliminating the need for
--no-daemon flag.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:47:24 -08:00
Steve Yegge
03b12e4b4b Standardize error handling: use FatalError in compact.go, sync.go, migrate.go
Replace direct fmt.Fprintf(os.Stderr, "Error:...") + os.Exit(1) patterns with
FatalError() and FatalErrorWithHint() helpers for consistent error handling.

Files updated:
- compact.go: All 48 os.Exit(1) calls converted
- sync.go: All error patterns converted (kept 1 valid summary exit)
- migrate.go: Partial conversion (4 patterns converted)

This is incremental progress on bd-qioh. Remaining work: ~326 error patterns
across other cmd/bd files.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:46:43 -08:00
Steve Yegge
05f37d2408 Introduce slog for structured daemon logging (bd-u2sc.4)
- Replace custom daemonLogger with slog-based structured logging
- Add --log-level flag (debug, info, warn, error) with default "info"
- Add --log-json flag for JSON-formatted log output
- Update log calls to use appropriate levels (Error, Warn, Info, Debug)
- Add test helper functions (newTestLogger, newTestLoggerWithWriter)

Log output examples:
  Text: time=2025-12-23T12:30:00Z level=INFO msg="daemon started" socket=/tmp/bd.sock
  JSON: {"time":"...","level":"INFO","msg":"daemon started","socket":"/tmp/bd.sock"}

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:46:26 -08:00
Steve Yegge
d834e4f4d8 bd sync: 2025-12-23 13:46:12 2025-12-23 13:46:12 -08:00
Steve Yegge
1c2e7068ad test: improve internal/compact coverage from 17% to 82% (bd-thgk)
Add comprehensive unit tests for the compact package:

- haiku.go: Mock API tests for SummarizeTier1, retry logic tests for
  callWithRetry (429/500 handling, exhaust retries, context timeout),
  expanded isRetryable tests for network timeouts and API error codes
- git.go: Tests for GetCurrentCommitHash in various git states
  (in repo, outside repo, new repo, empty repo)
- compactor.go: Unit tests for New(), CompactTier1(), CompactTier1Batch()
  with mock API server, config validation, error paths

Small production change: NewHaikuClient now accepts variadic options
for testing (option.WithBaseURL, option.WithMaxRetries).

Coverage: 17.3% → 81.8%

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:42:24 -08:00
Steve Yegge
ec0c710718 Split queries.go into focused modules (bd-rgyd)
Split internal/storage/sqlite/queries.go (1586 lines) into logical modules:

- queries.go (650 lines) - Core CRUD: CreateIssue, GetIssue, UpdateIssue, CloseIssue
- queries_search.go (429 lines) - Search/filter: SearchIssues, GetIssueByExternalRef,
  GetCloseReason, GetCloseReasonsForIssues
- queries_delete.go (464 lines) - Delete operations: CreateTombstone, DeleteIssue,
  DeleteIssues and cascade logic
- queries_rename.go (149 lines) - ID/prefix operations: UpdateIssueID,
  RenameDependencyPrefix, RenameCounterPrefix, ResetCounter
- queries_helpers.go (50 lines) - Utilities: parseNullableTimeString,
  parseJSONStringArray, formatJSONStringArray

All tests pass. No functional changes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:41:24 -08:00
Steve Yegge
7fd4c86ec3 feat: add date, priority, and content filters to bd search (bd-au0.5)
Add parity with bd list for filtering:
- Exact priority match with --priority/-p
- Pattern matching: --title-contains, --desc-contains, --notes-contains
- Empty/null checks: --empty-description, --no-assignee, --no-labels
- Allow empty query when filters are provided (e.g., bd search --no-assignee)

All filters work in both direct and daemon mode via RPC.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:40:38 -08:00
Steve Yegge
1b9660c500 bd sync: 2025-12-23 (bd-g4b4 closed)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:39:58 -08:00
Steve Yegge
c46b1a0bbb Add config-based close hooks (bd-g4b4)
Implements on_close hooks in .beads/config.yaml for automation and
notifications. Hooks receive issue data via environment variables
(BEAD_ID, BEAD_TITLE, BEAD_TYPE, BEAD_PRIORITY, BEAD_CLOSE_REASON)
and run via sh -c.

Changes:
- internal/config: Add HookEntry type and GetCloseHooks()
- internal/hooks: Add RunConfigCloseHooks() for executing config hooks
- cmd/bd: Call RunConfigCloseHooks after successful close
- docs/CONFIG.md: Document hooks configuration with examples

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:39:51 -08:00
Steve Yegge
bc0973bfa2 bd sync: close bd-4qfb 2025-12-23 13:39:03 -08:00
Steve Yegge
81181994eb Improve bd doctor output formatting for readability (bd-4qfb)
- Add --verbose/-v flag to show all checks including passed
- Show summary at top with counts (passed/warnings/errors)
- Default mode collapses passed checks with hint to use --verbose
- Group passed checks by category in verbose mode
- Errors shown first, then warnings, then passed
- Visual separators between sections

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:39:03 -08:00
Steve Yegge
ffa5de3181 Improve internal/beads test coverage from 48% to 80%
Add comprehensive tests for fingerprint.go:
- canonicalizeGitURL: URL normalization for HTTPS, SSH, SCP-style, HTTP, git protocol
- ComputeRepoID: With/without remote, not-git-repo, canonical URL consistency
- GetCloneID: Basic, different dirs, worktree, hostname inclusion

Add tests for beads.go:
- findDatabaseInBeadsDir: Direct tests for database discovery
- FindAllDatabases: Multi-database discovery, no-database, stops-at-first

Coverage: 48.4% → 80.2% (bd-tvu3)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:38:13 -08:00
Steve Yegge
7c4b0690e2 bd close bd-ykd9: doctor --fix feature already implemented
Feature verification showed full implementation:
- --fix flag for automatic repairs
- --yes/-y for non-interactive mode
- --interactive/-i for per-fix confirmation
- --dry-run for preview mode
- 20+ fixable issues supported
- Tests pass

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:36:58 -08:00
Steve Yegge
3053758db3 bd sync: 2025-12-23 13:36:29 2025-12-23 13:36:31 -08:00
Steve Yegge
68e3de92ee bd sync: 2025-12-23 13:10:23 2025-12-23 13:36:31 -08:00
Steve Yegge
bc169a70b4 bd sync: 2025-12-23 13:07:47 2025-12-23 13:36:31 -08:00
spm1001
e432fcc824 Enhance Claude Code skill with README and new reference files (#722)
Adds human-readable documentation and reference files to the beads Claude Code skill:

- README.md: Human-readable guide for installation and key concepts
- MOLECULES.md: Documents v0.34.0 molecules/wisps/protos features
- PATTERNS.md: Common usage patterns for closures, dependencies, work discovery
- TROUBLESHOOTING.md: Common issues and solutions
- INTEGRATION_PATTERNS.md: TodoWrite integration and temporal layering patterns

PR #722 by @spm1001
2025-12-23 13:33:18 -08:00
Ryan
297c696336 feat(doctor): add count-based database size check (#724)
feat(doctor): add count-based database size check

Adds CheckDatabaseSize (Check 29) that warns when closed issues exceed a configurable threshold (default: 5000). The check is informational only - no auto-fix since pruning is destructive.

Also improves fix guidance for sync-branch hook compatibility and legacy JSONL filename checks.

PR #724 by @rsnodgrass
2025-12-23 13:29:35 -08:00
Steve Yegge
c4ce191bb2 feat: add --resolution as alias for --reason on bd close (GH#721)
Jira CLIs use --resolution flag (go-jira, jira-cli). Adding this as a
hidden alias improves agent ergonomics - LLMs have a prior for this flag.

Follows same pattern as --body alias for --description (GitHub CLI).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:16:18 -08:00
Steve Yegge
235dc570b2 Update Session End Checklist to use gt handoff (gt-yt6g)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:07:48 -08:00
Steve Yegge
7e7e0fbd4c Update Session End Checklist to use gt handoff (gt-yt6g)
Also fixed crew/zoey working directory path.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:07:31 -08:00
Steve Yegge
6cf998e294 bd sync: 2025-12-23 13:07:22 2025-12-23 13:07:22 -08:00
Steve Yegge
b172fa77fc bd sync: 2025-12-23 13:06:59 2025-12-23 13:06:59 -08:00
Steve Yegge
2f7570fd93 bd sync: 2025-12-23 13:06:35 2025-12-23 13:06:35 -08:00