Commit Graph

4362 Commits

Author SHA1 Message Date
Steve Yegge
2b90f51d0c feat: add doctor check for issues.jsonl git tracking (GH#796)
Safeguard for users with global gitignore patterns like *.jsonl that
could cause issues.jsonl to be ignored, breaking bd sync.

The check runs git check-ignore and warns if issues.jsonl would be
ignored by any gitignore rule (global, parent directory, etc).
2025-12-29 20:58:30 -08:00
Steve Yegge
61edfafe4c bd sync: 2025-12-29 20:49:22 2025-12-29 20:49:22 -08:00
Steve Yegge
447fe84bf0 bd sync: 2025-12-29 20:47:42 2025-12-29 20:47:55 -08:00
Steve Yegge
fd781cee5b bd sync: 2025-12-29 18:30:11 2025-12-29 20:47:55 -08:00
Steve Yegge
aa759c06aa fix: improve jira sync error when Python script not found (GH#803)
- Add BD_JIRA_SCRIPT env var to let users specify script location
- Improve error message with clear instructions for binary users
- Show all locations that were searched
2025-12-29 18:44:03 -08:00
Steve Yegge
34e2548c86 feat: bd list defaults to non-closed issues with 50 limit (GH#788)
Changes:
- Default to excluding closed issues (use --all to include)
- Default limit of 50 issues (use --limit 0 for unlimited)
- --all flag now overrides the closed filter

This addresses agent context blowout from seeing hundreds of closed issues.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:54:56 -08:00
Steve Yegge
a7f34d8f89 bd sync: 2025-12-29 17:54:03 2025-12-29 17:54:03 -08:00
Steve Yegge
6e9004bb94 bd sync: 2025-12-29 17:52:01 2025-12-29 17:52:18 -08:00
Steve Yegge
5c1cd2b9fa feat: add default limit of 50 to bd list (bd-v5fn, GH#788)
Changes:
- Default --limit changed from 0 (unlimited) to 50
- --limit 0 explicitly means unlimited (override default)
- Show truncation hint when results are limited:
  "Showing N issues (use --limit 0 for all)"

This protects agents and humans from overwhelming output.
Follows precedent from gh cli (30) and jira-cli (50).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-29 17:52:10 -08:00
Steve Yegge
4c16895c29 feat: add 'rm' as alias for 'dep remove' (bd-oehv) 2025-12-29 17:50:29 -08:00
Steve Yegge
a6b37796d1 bd sync: 2025-12-29 17:50:18 2025-12-29 17:50:18 -08:00
Steve Yegge
f5ec63df8f bd sync: 2025-12-29 17:49:07 2025-12-29 17:49:07 -08:00
Steve Yegge
2ca76dcae8 bd sync: 2025-12-29 17:10:34 2025-12-29 17:10:40 -08:00
Steve Yegge
7f62ae2630 feat: bd mol burn now works on mols, not just wisps (bd-l6yk)
Previously mol burn only worked on wisps (Ephemeral=true), erroring
on persistent mols. Now it works on both:
- Wisps: direct delete without tombstones (original behavior)
- Mols: cascade delete with tombstones (syncs to remotes)

This makes the 'burn' metaphor consistent: burn = destroy a molecule,
regardless of phase.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:10:26 -08:00
Steve Yegge
de239e09f9 bd sync: 2025-12-29 17:05:12 2025-12-29 17:05:12 -08:00
Steve Yegge
f312101d5d bd sync: 2025-12-29 17:02:23 2025-12-29 17:02:23 -08:00
Steve Yegge
a4035b1422 bd sync: 2025-12-29 16:40:06 2025-12-29 16:40:20 -08:00
Steve Yegge
1b15ec2765 bd sync: 2025-12-29 15:27:19 2025-12-29 16:40:20 -08:00
Steve Yegge
f19e5c65ad chore: Bump version to 0.41.0
Update version across all components:
- cmd/bd/version.go
- .claude-plugin/plugin.json, marketplace.json
- npm-package/package.json
- integrations/beads-mcp/pyproject.toml
- Git hook templates

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:34:14 -08:00
Steve Yegge
ef7c2b3076 docs: Prepare v0.41.0 release notes
Update CHANGELOG.md and info.go versionChanges with comprehensive
changelog for v0.41.0 release including:
- bd swarm commands for multi-agent batch coordination
- bd repair for orphaned reference detection
- bd compact --purge-tombstones
- Multiple bug fixes (GH#785, #786, #787, #796, #798, #799)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:33:32 -08:00
Steve Yegge
0521910503 fix: --var flag now allows commas in values (#786)
Changed all --var flags from StringSlice to StringArray.
StringSlice splits on commas, breaking values like 'desc=A, B, C'.
StringArray only splits on separate --var flags.

Affected commands: pour, cook, wisp, mol distill, mol bond, template instantiate

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:17:51 -08:00
Steve Yegge
a08dd63079 test: fix config test environment pollution
Tests were failing when BD_ACTOR or other BD_/BEADS_ environment
variables were set. Added envSnapshot helper to save, clear, and
restore environment variables for proper test isolation.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:08:43 -08:00
Steve Yegge
f150590c27 Merge PR #802: test: expand routing and compact coverage 2025-12-29 16:01:19 -08:00
Jordan Hubbard
c9fa7af04c test: expand compact and ui coverage 2025-12-29 16:01:11 -08:00
Steve Yegge
d3b6855aa9 fix: resolve lint errors blocking CI
- Add explicit error checking for fmt.Fprintf/Fprintln in claude.go
- Add gosec nolint for safe exec.CommandContext calls in sync_git.go
- Remove unused error return from findTownRoutes in routes.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:58:24 -08:00
Steve Yegge
53a63f2779 fix: edge case in normalizeBeadsRelPath for similar prefixes
Code review caught that ".beads" would incorrectly match prefixes like
".beads-backup". Changed to match ".beads/" (with trailing slash) to
ensure we only match the actual .beads directory.

Added test cases for this edge case.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:51:17 -08:00
Steve Yegge
0fa97a4c30 fix: bd sync fails in bare repo worktrees (#785)
The bug: In a bare repo + worktrees setup, jsonlRelPath was calculated
relative to the project root (which contains all worktrees), resulting in
paths like "main/.beads/issues.jsonl". But the sync branch worktree uses
sparse checkout for .beads/*, so files are at ".beads/issues.jsonl".

This caused copyJSONLToMainRepo to look in the wrong location, silently
returning when the file was not found.

Fix: Add normalizeBeadsRelPath() to strip leading path components before
".beads", ensuring correct path resolution in both directions:
- copyJSONLToMainRepo (worktree -> local)
- SyncJSONLToWorktreeWithOptions (local -> worktree)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:39:23 -08:00
Steve Yegge
1256352d49 fix: bd delete --cascade now recursively deletes dependents (#787)
The --cascade flag was documented but not working for single-issue
deletes. The bug had two causes:

1. CLI direct mode: Single-issue deletes bypassed the batch path where
   cascade expansion actually happens. Fixed by routing cascade deletes
   through deleteBatch() regardless of issue count.

2. Daemon/RPC mode: handleDelete() iterated through IDs individually
   without expanding dependents. Fixed by using DeleteIssues() with
   cascade flag when SQLite storage is available.

Now `bd delete <id> --cascade --force` correctly deletes the target
issue plus all issues that depend on it (recursively).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:10:59 -08:00
Steve Yegge
05c8bbe4f9 fix: bd doctor falsely reports pre-push hook is not a bd hook (#799)
The CheckSyncBranchHookCompatibility was checking core.hooksPath first,
while CheckGitHooks always uses .git/hooks/. This caused inconsistent
results when core.hooksPath was set globally.

Fix: Remove core.hooksPath check from CheckSyncBranchHookCompatibility
to match CheckGitHooks behavior. Both now consistently use .git/hooks/.

Note: A future improvement could make both respect core.hooksPath.
2025-12-29 14:55:42 -08:00
Steve Yegge
c2c2ef5d07 feat: Update agent ID validation for canonical naming (gt-zvte2)
Updates ValidateAgentID to accept canonical format: prefix-rig-role-name
- Rig-level: gt-<rig>-witness (was gt-witness-<rig>)
- Named: gt-<rig>-crew-<name> (was gt-crew-<rig>-<name>)

Town-level agents unchanged: gt-mayor, gt-deacon

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:55:06 -08:00
Steve Yegge
e652449634 bd sync: 2025-12-29 14:04:26 2025-12-29 14:55:06 -08:00
Steve Yegge
59bc2cd059 fix: remove gitignore negations that override fork protection (#796)
The negation patterns (!issues.jsonl, !interactions.jsonl, etc.) in
.beads/.gitignore had higher precedence than the fork protection
exclusion in .git/info/exclude, effectively defeating fork protection.

Contributors could accidentally stage and commit upstream issue
databases because:
1. Fork protection added .beads/issues.jsonl to .git/info/exclude
2. .beads/.gitignore had !issues.jsonl which overrode the exclusion
3. .gitignore files have higher precedence than .git/info/exclude

The negation patterns were unnecessary anyway since no pattern in
.beads/.gitignore matches those files. Added a comment explaining
why negations should not be added.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:52:29 -08:00
Nahum Shalman
fd5bea7ff9 fix: add illumos/solaris support for disk space check (#798)
Solaris/illumos use Statvfs (POSIX standard) rather than Statfs.
Add daemon_health_solaris.go and exclude illumos/solaris from the
generic unix build constraint.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:43:00 -08:00
Steve Yegge
71e2f22849 fix: Add nolint comments for gosec/errcheck/unparam warnings
Fixes CI lint failures by adding appropriate nolint directives for:
- G204 (subprocess with variable) - git commands with trusted inputs
- G304 (file inclusion via variable) - paths from internal helpers
- G302/G306 (file permissions) - .gitignore needs 0644
- errcheck (unchecked return values) - fmt.Fprint* to stdout/stderr
- unparam (unused parameters) - reserved for future use
2025-12-29 14:39:43 -08:00
kraitsura
e5d1e721ed Add bd human command for focused help menu
bd has 70+ commands, which can be overwhelming for human users who just
want to track issues. The new `bd human` command displays a curated list
of ~15 essential commands organized by workflow:

- Working With Issues: create, list, show, update, close, reopen, comment
- Finding Work: ready, search, status, stats
- Dependencies: dep add/remove/tree, graph, blocked
- Setup & Sync: init, sync, doctor
- Getting Help: quickstart, help, --help

Also includes quick examples showing common workflows.

Changes:
- Add cmd/bd/human.go with curated help output
- Add "human" to noDbCommands list in main.go (no database needed)
2025-12-29 14:33:19 -08:00
Jordan Hubbard
12b797781d test: expand routing and compact coverage 2025-12-29 14:18:33 -08:00
Jordan Hubbard
cb280b0fad test: improve nodb and orphans coverage 2025-12-29 14:17:44 -08:00
Jordan Hubbard
9cefa98528 test: refactor claude setup for coverage 2025-12-29 14:17:44 -08:00
Jordan Hubbard
283a275740 test: refactor claude setup for coverage 2025-12-29 14:16:44 -08:00
Jordan Hubbard
8f8a075943 test: refactor factory setup for coverage (#790)
* test: add git helper and guard annotations

* chore: align release metadata with 0.40.0

* test: refactor factory setup for coverage
2025-12-29 14:15:56 -08:00
Steve Yegge
96c7cceefc refactor: Extract IssueDetails to shared type (bd-6dnt)
Consolidated 5 duplicate IssueDetails struct definitions into a single
types.IssueDetails in internal/types/types.go:

- Removed 4 inline definitions from cmd/bd/show.go
- Removed 1 inline definition from internal/rpc/server_issues_epics.go

The shared type embeds types.Issue by value and includes:
Labels, Dependencies, Dependents, Comments, and Parent fields.

This improves maintainability and reduces risk of inconsistency.
2025-12-29 14:04:35 -08:00
Steve Yegge
2c57d41275 fix: Show warning when config.yaml overrides database config (bd-20j)
bd config list now shows a warning when config.yaml or environment
variables override database settings. This addresses the confusion when
sync.branch from config.yaml takes precedence over the database value.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:03:39 -08:00
Steve Yegge
9eb61f9dd0 bd sync: 2025-12-29 14:03:20 2025-12-29 14:03:20 -08:00
Steve Yegge
31bed17090 bd sync: 2025-12-29 13:46:54 2025-12-29 13:47:12 -08:00
Steve Yegge
64d5f20b90 fix: Add pre-migration orphan cleanup to avoid chicken-and-egg failure (bd-eko4)
When the database has orphaned foreign key references (dependencies or labels
pointing to non-existent issues), the migration invariant check would fail,
preventing the database from opening. This created a chicken-and-egg problem:

1. bd doctor --fix tries to open the database
2. Opening triggers migrations with invariant checks
3. Invariant check fails due to orphaned refs
4. Fix never runs because database won't open

The fix adds CleanOrphanedRefs() that runs BEFORE captureSnapshot() in
RunMigrations. This automatically cleans up orphaned dependencies and labels
(preserving external:* refs), allowing the database to open normally.

Added test coverage for the cleanup function.
2025-12-29 13:47:04 -08:00
Steve Yegge
819208b8c1 fix: hq- prefix routing by finding town root for routes.jsonl
The routing code now walks up from the current beads directory to find
the Gas Town root (identified by mayor/town.json), then loads routes
from <townRoot>/.beads/routes.jsonl. The '.' path is correctly resolved
to the town beads directory.

Previously, routes.jsonl was only searched in the current beads dir,
which failed when working from rig subdirectories like crew/emma.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 13:46:10 -08:00
Steve Yegge
04da559511 bd sync: 2025-12-29 13:45:51 2025-12-29 13:45:51 -08:00
Steve Yegge
6ee7be5fe9 bd sync: 2025-12-29 13:40:37 2025-12-29 13:40:37 -08:00
Steve Yegge
0183af11d5 bd sync: 2025-12-29 13:34:01 2025-12-29 13:34:14 -08:00
Steve Yegge
9e5a548339 bd sync: 2025-12-29 12:59:10 2025-12-29 13:34:14 -08:00