Commit Graph

1489 Commits

Author SHA1 Message Date
obsidian
1a0ad09e23 fix(doctor): detect status mismatches between DB and JSONL (GH#885)
When bd sync fails mid-operation, the local JSONL can become stale while
the SQLite database has the correct state. Previously, bd doctor only
checked count and timestamp differences, missing cases where counts match
but issue statuses differ.

This adds content-level comparison to CheckDatabaseJSONLSync that:
- Compares issue statuses between DB and JSONL
- Samples up to 500 issues for performance on large databases
- Reports detailed mismatches (shows up to 3 examples)
- Suggests 'bd export' to fix the stale JSONL

Example detection:
  Status mismatch: 1 issue(s) have different status in DB vs JSONL
  Status mismatches detected:
    test-1: DB=closed, JSONL=open

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 11:35:59 -08:00
onyx
5229b3e90d feat(dep): add --blocked-by and --depends-on flag aliases (bd-09kt)
Add flag-based alternatives to the positional argument for `bd dep add`:
- `--blocked-by <id>`: Specify the blocking issue via flag
- `--depends-on <id>`: Alias for --blocked-by

This reduces token waste when Claude guesses flag-based syntax, which
is a common pattern. Previously, Claude would attempt commands like:
  bd dep add issue-123 --blocked-by issue-456

This would fail with "unknown flag" and require retry. Now both:
  bd dep add issue-123 issue-456
  bd dep add issue-123 --blocked-by issue-456

work identically.

Closes GH#888

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 11:34:38 -08:00
biantaishabi2
b3d64d47b3 fix: prevent event storm when gitRefsPath is empty (#883)
When gitRefsPath is empty (not in a git repo), strings.HasPrefix(path, "")
always returns true, causing every file write in .beads/ directory
(including daemon.log) to trigger debouncer and create an event storm.

This fix adds a check to ensure gitRefsPath is not empty before the
HasPrefix comparison.

Fixes the issue where daemon.log grows rapidly (17MB+) due to the
self-triggering loop: write log -> detect change -> write log -> ...

Co-authored-by: Test User <test@example.com>
2026-01-04 11:14:36 -08:00
kustrun
28b44edd13 fix(doctor): detect missing git repo and improve daemon startup message (#890)
When not in a git repository:
- Daemon startup now shows clear message immediately instead of waiting
  5 seconds: "Note: No git repository initialized — running without
  background sync"
- Added new doctor check "Git Sync Setup" that explains the situation

Doctor check now shows three states:
1. No git repo → Warning with fix: "Run 'git init' to enable background sync"
2. Git repo, no sync-branch → OK with hint about team collaboration benefits
3. Git repo + sync-branch → OK, fully configured

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 11:13:48 -08:00
web3dev1337
661556ae62 feat: add multi-prefix support via allowed_prefixes config (#881)
feat: add multi-prefix support via allowed_prefixes config

Adds support for allowing multiple prefixes in a beads database via the
allowed_prefixes config key. This is needed for Gas Town which uses different
prefixes for different purposes (hq-, gt-, rig-specific prefixes).

Usage: bd config set allowed_prefixes "gt,hq,hmc"

PR #881 by @web3dev1337
2026-01-04 11:13:44 -08:00
kustrun
16af63dc73 fix(rename-prefix): sync JSONL before and after prefix rename (#893)
- Pull from sync-branch before rename if configured
- Import all issues from JSONL before rename to prevent data loss
- Export directly to JSONL after rename (don't rely on flushManager)
- Apply same pattern to --repair mode
- Add newSilentLogger() for production use (not test-only)
- Add comprehensive tests for JSONL update scenarios

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 10:53:31 -08:00
wolf
9880eaf734 feat(config): support daemon.auto_* settings in config.yaml (GH#871)
Allow team-wide auto-sync configuration via config.yaml instead of SQLite.
This enables teams to share auto-commit/auto-push settings through version control.

Changes:
- Add daemon.auto_commit, daemon.auto_push, daemon.auto_pull to YamlOnlyKeys
- Add daemon.* prefix to YAML-only prefixes
- Update daemon startup to read from config.yaml first, then fall back to SQLite
- Update bd init --team to write daemon settings to config.yaml

Usage:
  # In .beads/config.yaml (version controlled, shared by team)
  daemon.auto_commit: true
  daemon.auto_push: true

  # Or via bd config set
  bd config set daemon.auto_commit true

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 10:42:22 -08:00
beads/crew/grip
4021f49445 feat(prime): add PRIME.md override for workflow customization (GH#876)
Users can now place a .beads/PRIME.md file to fully customize the
workflow instructions output by `bd prime`. The --export flag outputs
the default content for use as a starting template.

Local .beads/PRIME.md is checked first, then redirected location,
allowing clone-specific customization even with shared beads.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 21:49:40 -08:00
dave
7df6004605 fix: code review improvements for GH#870
Review findings addressed:
1. Fixed HasSyncBranchGitignoreFlags() - now correctly returns (hasAnyFlag,
   hasSkipWorktree) since skip-worktree takes precedence in git ls-files -v
2. Added interactions.jsonl to list of files to hide (was only issues.jsonl)
3. Added idempotency check - skips setting flags if already set (checks for S)
4. Made output conditional - only prints when flags actually changed
5. Fixed addToGitExclude() pattern matching - now uses exact line match
   instead of substring to prevent false positives
6. Refactored to use setGitIndexFlags() helper to reduce duplication

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-03 21:19:02 -08:00
dave
6a5c289af3 fix: hide issues.jsonl from git status when sync.branch configured (GH#870)
When sync.branch is configured, issues.jsonl appears modified in git status
even though changes go to the sync branch. This is confusing for users and
risks accidental commits to the wrong branch.

Implementation:
- Added SyncBranchGitignore() to set git index flags (assume-unchanged,
  skip-worktree) on issues.jsonl when sync.branch is configured
- For untracked files, adds to .git/info/exclude instead
- Called automatically from bd sync after successful sync-branch sync
- Added bd doctor check and fix for this issue
- Added HasSyncBranchGitignoreFlags() to check current flag state
- Added ClearSyncBranchGitignore() to remove flags when sync.branch disabled

Fixes: GH#870 (duplicate of GH#797, GH#801)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-03 21:07:32 -08:00
emma
62e4eaf7c1 fix(sync): make snapshot protection timestamp-aware (GH#865)
The --protect-left-snapshot mechanism was protecting ALL local issues
by ID alone, ignoring timestamps. This caused newer remote changes to
be incorrectly skipped during cross-worktree sync.

Changes:
- Add BuildIDToTimestampMap() to SnapshotManager for timestamp-aware
  snapshot reading
- Change ProtectLocalExportIDs from map[string]bool to map[string]time.Time
- Add shouldProtectFromUpdate() helper that compares timestamps
- Only protect if local snapshot is newer than incoming; allow update
  if incoming is newer

This fixes data loss scenarios where:
1. Main worktree closes issue at 11:31
2. Test worktree syncs and incorrectly skips the update
3. Test worktree then pushes stale open state, overwriting mains changes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:27:36 -08:00
grip
a5d9793ecd fix(agent): support hyphenated rig names in parseAgentIDFields (GH#868)
Complements the validation fix from c6fe9d71 - the parseAgentIDFields
function now also scans right-to-left for known role tokens instead
of using fixed position parsing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:25:15 -08:00
dave
6c4b67f65d fix: respect sync.remote config in bd sync (GH#872, bd-ypvj)
The sync.remote config was being set via `bd config set sync.remote <name>`
but `bd sync` was still using 'origin' for git pull/push operations.

Changes:
- Updated gitPull() and gitPush() in sync_git.go to accept a configuredRemote
  parameter that takes precedence over git's branch tracking config
- Updated sync.go to read sync.remote config and pass it to gitPull/gitPush
- Updated daemon_sync.go to read sync.remote config for all daemon sync ops
- Added user-facing messages to show which remote is being used

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-03 13:24:28 -08:00
wolf
631b067c1c fix(daemon): normalize paths for case-insensitive filesystem comparison (GH#869)
On macOS and Windows, filesystems are typically case-insensitive, so
/Users/foo/Desktop and /Users/foo/desktop refer to the same directory.
The daemon registry and discovery code was doing direct string comparison,
causing path mismatches when the casing differed.

Fix:
- Add NormalizePathForComparison() and PathsEqual() to internal/utils/path.go
- These resolve symlinks and lowercase paths on darwin/windows
- Update all workspace path comparisons in registry.go, discovery.go, and
  daemons.go to use PathsEqual()

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:22:52 -08:00
wolf
f156e16da3 feat(template): propagate gate fields through template cloning
Ensures AwaitType, AwaitID, and Timeout fields are carried over when
cloning template subgraphs, enabling async coordination in instantiated
molecules.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 12:44:16 -08:00
kustrun
079b346b5d fix(agent): add routing support for cross-repo agent resolution (#864)
The bd agent state, heartbeat, and show commands now respect
routes.jsonl for cross-repo lookups, matching the behavior of
bd show.

Previously, these commands used utils.ResolvePartialID directly,
which bypassed routing. Now they use resolveAndGetIssueWithRouting
and needsRouting checks, consistent with show.go.
2026-01-03 11:53:14 -08:00
furiosa
0c7dcee3ac feat(slot): Add merge-slot gate for serialized conflict resolution
Adds a new slot bead type and merge-slot commands for serializing
conflict resolution in the merge queue. This prevents "monkey knife
fights" where multiple polecats race to resolve conflicts.

- Add TypeSlot to bead types
- Add Holder field to Issue struct
- Add bd merge-slot create/check/acquire/release commands
- Add Holder field to UpdateArgs in RPC protocol

(gt-4u49x)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:03:27 -08:00
beads/crew/emma
939f222c35 fix: pass event/mol/time fields through --rig flag (bd-xwvo)
createInRig was missing event fields (event_kind, actor, target, payload),
molecule/agent fields (mol_type, role_type, rig), and time scheduling
fields (due_at, defer_until). Now extracts these from cmd.Flags() directly.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:10:43 -08:00
jasper
d7246a1f2d feat(gate): add add-waiter and show commands for phase handoff
- Add `bd gate add-waiter <gate-id> <waiter>` command to register
  agents as waiters on a gate bead using the native Waiters field
- Add `bd gate show <gate-id>` command to display gate details
  including waiters (used by gt gate wake)
- Add Waiters field to UpdateArgs in RPC protocol
- Update server to handle waiters field in updates

This is part of the polecat phase handoff feature (bd-quw1).
The corresponding gastown changes (gt done --phase-complete) are
tracked separately.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:40:47 -08:00
onyx
a89f47cdf2 feat(gate): add bd gate discover for gh:run await_id auto-discovery (bd-z6kw)
Implements automatic discovery of GitHub workflow run IDs for gates
awaiting CI/CD completion. This enables the Refinery patrol to
auto-populate await_id for gh:run gates that were created without one.

Changes:
- Add `bd gate discover` command that:
  - Finds open gh:run gates without await_id
  - Queries recent GitHub workflow runs via gh CLI
  - Matches runs to gates using heuristics (branch, commit, time)
  - Updates gates with discovered run IDs

- Add `--await-id` flag to `bd update` for manual setting
- Add AwaitID to UpdateArgs in RPC protocol
- Add await_id to allowedUpdateFields in storage layer

Matching heuristics (scored, highest match wins):
- Commit SHA match: +100 points
- Branch match: +50 points
- Time proximity (<5min: +30, <10min: +20, <30min: +10)
- In-progress/queued status: +5 points

Usage:
  bd gate discover           # Auto-discover for all matching gates
  bd gate discover --dry-run # Preview without updating
  bd gate discover --branch main --limit 10

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:14:35 -08:00
mayor
2f96795f85 fix(daemon): propagate startup failure reason to user (GH#863)
When daemon fails to start due to legacy database or fingerprint validation,
the error was only logged to daemon.log. Users saw "Daemon took too long"
with no hint about the actual problem.

Changes:
- Write validation errors to .beads/daemon-error file before daemon exits
- Check for daemon-error file in autostart and display contents on timeout
- Elevate legacy database check in bd doctor from warning to error

Now when daemon fails due to legacy database, users see:
  "LEGACY DATABASE DETECTED!
   ...
   Run 'bd migrate --update-repo-id' to add fingerprint"

Instead of just "Daemon took too long to start".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:06:09 -08:00
Peter Chanthamynavong
fc8437ed08 fix(mol): substitute title/desc vars in root molecule bead
When pouring a formula with `title` and `desc` variables defined,
the root molecule's title and description now use {{title}} and
{{desc}} placeholders that get substituted during pour.

Previously, the root was always assigned the formula name and static
description, ignoring these common variables. Child beads correctly
substituted variables, but the root did not.

Fixes #852
2026-01-02 16:00:54 -08:00
Peter Chanthamynavong
5619dc0798 fix(doctor): skip JSONL tracking checks in sync-branch mode (GH#858) (#860)
When sync-branch is configured, JSONL files are intentionally untracked
in working branches and only committed to the dedicated sync branch.
The CheckIssuesTracking and CheckUntrackedBeadsFiles checks now detect
sync-branch mode via GetFromYAML() and return OK status instead of
false warnings.
2026-01-02 15:56:33 -08:00
beads/crew/grip
73ed489c9e refactor(mol): remove redundant guard in showCompoundBondingInfo
The caller already checks IsCompound() before calling, so the internal
guard was unnecessary. Added doc comment clarifying the precondition.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:08:22 -08:00
quartz
53790557de test(cook): add gate bead creation tests (bd-4k3c)
Add comprehensive tests for gate bead creation during formula cooking:
- TestCreateGateIssue: tests gate issue creation with various types
  (gh:run, gh:pr, timer, human)
- TestCreateGateIssue_NilGate: verifies nil return for steps without Gate
- TestCreateGateIssue_Timeout: tests timeout parsing (30m, 1h, 24h, etc.)
- TestCookFormulaToSubgraph_GateBeads: tests gate beads in subgraph
- TestCookFormulaToSubgraph_GateDependencies: tests blocking deps
- TestCookFormulaToSubgraph_GateParentChild: tests parent-child deps

The gate bead implementation already existed in cook.go (createGateIssue
and collectSteps functions). These tests verify the behavior.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:01:56 -08:00
beads/crew/grip
bb0a0ea703 feat(mol): add compound visualization in bd mol show (bd-iw4z)
Add visualization for compound molecules (those created by bonding protos):

- Detect compound molecules via IsCompound() check on root issue
- Display "Bonded from:" section showing constituent protos with bond types
- Show bond point when specified (attachment site within molecule)
- Format bond types as human-readable: sequential, parallel, on-failure, root
- Include is_compound and bonded_from in JSON output

Example output for compound molecules:
  🧪 Compound: proto-feature-with-tests
     ID: bd-abc123
     Steps: 5

  🔗 Bonded from:
     ├── proto-feature (sequential)
     └── proto-testing (sequential, at step-2)

Added unit tests for compound detection and bond type formatting.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:43:07 -08:00
onyx
3d93166b3f feat(gate): add cross-rig bead gate support (Phase 4)
Add bead gate type for cross-rig bead dependencies:
- await_type=bead with await_id=<rig>:<bead-id> format
- Add `bd gate check` command to evaluate open gates
- Support --type=bead to check only bead gates
- Support --dry-run to preview without closing
- Gate resolves when target bead is closed

Closes bd-w3rh

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:11:36 -08:00
quartz
55d3ac7cfa feat(gate): add bd gate check command for timer gate evaluation (bd-kbfn)
Implement timer gate evaluation for Witness patrol integration:
- Add `bd gate check` command to evaluate gate conditions
- Support `--type=timer` filter to check only timer gates
- Check if `now > created_at + timeout` for timer gates
- Add `--escalate` flag to trigger `gt escalate` for expired gates
- JSON output support with `--json` flag

The command integrates with Witness patrol via:
  bd gate check --type=timer --escalate

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 12:53:28 -08:00
jasper
3c5b7414ce feat(gate): add bd gate check for GitHub gate evaluation (bd-oos3)
Implement Phase 3 of gate evaluation: GitHub gates (gh:run and gh:pr).

## Changes

- Add `bd gate check` command to evaluate open gates
- Support --type=gh to check all GitHub gates
- Support --type=gh:run for GitHub Actions workflow run gates
- Support --type=gh:pr for pull request merge status gates
- Add --dry-run flag to preview gate resolution without closing
- Auto-close gates when conditions are met:
  - gh:run: workflow completed with success
  - gh:pr: PR merged
- Escalate when conditions fail:
  - gh:run: workflow failed or cancelled
  - gh:pr: PR closed without merging
- Add unit tests for shouldCheckGate filtering

Note: mol-refinery-patrol.formula.toml updated in gastown rig to include
check-github-gates step (version 4).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 12:50:42 -08:00
obsidian
f37fe949e8 fix: auto-create agent bead when bd agent state called on non-existent agent
Previously, `bd agent state <agent> <state>` would fail if the agent bead
didn't exist in the database. This caused issues when `gt sling` tried to
update agent state for newly spawned polecats.

Now when the agent doesn't exist:
1. Parse role_type and rig from the agent ID (e.g., gt-gastown-polecat-nux)
2. Auto-create the agent bead with type=agent
3. Add role_type and rig labels for filtering (bd list --label=role_type:polecat)
4. Continue with the state update

This enables:
- Work history accumulation per polecat name
- Skill/success tracking over time
- `bd list --type=agent` to see all agents

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 12:29:21 -08:00
beads/crew/dave
76359764fd fix(release): update missed version files to 0.43.0
The 0.43.0 release bump missed several files that should have been
updated by scripts/bump-version.sh:
- npm-package/package.json
- integrations/beads-mcp/pyproject.toml
- integrations/beads-mcp/src/beads_mcp/__init__.py
- .claude-plugin/plugin.json
- .claude-plugin/marketplace.json
- cmd/bd/templates/hooks/*

This caused the NPM publish to fail (could not publish 0.42.0 over itself).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-02 01:49:22 -08:00
beads/crew/dave
3e1378e122 fix(move): clean up code based on review
- Fix help text to accurately describe cross-rig dependency handling
- Remove dead same-rig code path (moves are always cross-rig)
- Simplify remapDependencies to always use external refs
- Document that comments/history are not transferred

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-02 01:35:32 -08:00
beads/crew/dave
8c7551c599 feat: add bd move command for cross-rig issue relocation (bd-v43g)
Add `bd move <id> --to <rig|prefix>` command that:
- Creates a copy of the issue in the target rig
- Remaps dependencies pointing TO the moved issue to external refs
- Removes dependencies FROM the moved issue (with user notice)
- Closes the source issue with a redirect note

Key features:
- Forgiving target spec (accepts rig name, prefix, or prefix without hyphen)
- Preserves all issue fields, labels, and dependency metadata
- Handles cross-rig moves properly using external references
- Includes --keep-open and --skip-deps flags for flexibility

Tested on real misfiled beads (hq-c21fj → bd-c0b6, hq-q3tki → gt-quf4c).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-02 01:31:19 -08:00
obsidian
8fe681a4e3 chore: bump version to 0.43.0 (bd-lejq)
- Update Version in cmd/bd/version.go: 0.42.0 → 0.43.0
- Update CHANGELOG.md with 0.43.0 section
- Fix test isolation in TestTrackBdVersion_NoBeadsDir

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 01:07:34 -08:00
beads/crew/wolf
e5f768e9f5 test: add unit tests for bd setup gemini
Covers:
- Global and project installation
- Stealth mode
- Idempotent installation
- Preserving existing settings/hooks
- Check and remove operations
- Hook detection logic

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:19:14 -08:00
beads/crew/emma
46f72ed18c test(sync): add tests for pre-sync validation hook (bd-nv4g)
Add comprehensive tests for validateOpenIssuesForSync():
- ModeNone: validation skipped when config is "none"
- ModeEmpty: validation skipped for empty config (backwards compat)
- ModeWarn: sync proceeds with warnings for invalid issues
- ModeError: sync blocked with error for invalid issues
- NoWarnings: valid issues pass validation
- SkipsClosedIssues: closed issues not validated
- ChoreHasNoRequirements: chore type has no required sections

The pre-sync validation hook was already implemented as part of bd-t7jq.
This commit adds the missing test coverage.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:05:12 -08:00
beads/crew/wolf
a06b40bd48 feat: add bd setup gemini for Gemini CLI integration (#845)
Add support for Gemini CLI hook-based integration, similar to Claude Code:
- bd setup gemini: Install SessionStart/PreCompress hooks
- bd setup gemini --check: Verify installation
- bd setup gemini --remove: Remove hooks
- bd setup gemini --project: Project-only installation
- bd setup gemini --stealth: Use bd prime --stealth

Also adds Gemini CLI integration check to bd doctor.

Gemini CLI's hook system is nearly identical to Claude Code's,
making this a clean, low-maintenance addition.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:02:38 -08:00
beads/crew/fang
6572654cdc fix: allow yaml-only config operations without database (GH#536)
Users could not run 'bd config set no-db true' without already having a
database, creating a chicken-and-egg problem. The PersistentPreRunE
would fail with 'no beads database found' before the config command
could even run.

The fix detects when a yaml-only config operation is being attempted
(config set/get with keys like no-db, no-daemon, sync.branch, etc.)
and allows it to proceed without requiring a database.

Before:
  $ bd config set no-db true
  Error: no beads database found

After:
  $ bd config set no-db true
  Set no-db = true (in config.yaml)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:02:20 -08:00
beads/crew/dave
8601ed01b6 fix: rename wisp prefix from 'eph' to 'wisp' (bd-ucj8)
New wisps now use 'wisp' segment (e.g., gt-wisp-xxx) instead of 'eph'.
Detection patterns updated to support both for backwards compatibility
with existing gt-eph-* wisps in databases.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-01 23:55:40 -08:00
Peter Chanthamynavong
d371baf2ca feat(dates): add --due and --defer timestamp options with natural language parsing (#847)
* feat(dates): add due date schema and --due flag

- Add due_at and defer_until columns to issues table via migration 035
- Implement --due flag on create command with ISO date parsing
- Extend RPC protocol and daemon to pass DueAt from CLI to storage
- Display DueAt and DeferUntil in show command output
- Update Issue type with new date fields

Users can now set due dates when creating issues, enabling deadline-based
task management.

* feat(dates): add compact duration parser (+6h, +1d, +2w)

- Create internal/timeparsing package with layered parser architecture
- Implement parseCompactDuration with regex pattern [+-]?\d+[hdwmy]
- Add comprehensive test suite (22 cases) for duration parsing
- Integrate into create.go with fallback to ISO format

Supports hours (h), days (d), weeks (w), months (m), and years (y).
Negative values allowed for past dates.

* feat(dates): add NLP parsing for natural language dates

Integrate olebedev/when library for natural language time expressions.
The layered parser now handles: compact duration → absolute formats → NLP.

Changes:
- Add olebedev/when dependency for NLP parsing
- Implement ParseNaturalLanguage and ParseRelativeTime functions
- Reorder layers: absolute formats before NLP to avoid misinterpretation
- Simplify create.go to use unified ParseRelativeTime
- Add comprehensive NLP test coverage (22 test cases)

Supports: tomorrow, next monday, in 3 days, 3 days ago

* feat(dates): add --defer flag to create/update/defer commands

Add time-based deferral support alongside existing status-based defer.
Issues can now be hidden from bd ready until a specific time.

Changes:
- Add --defer flag to bd create (sets defer_until on creation)
- Add --due and --defer flags to bd update (modify existing issues)
- Add --until flag to bd defer (combines status=deferred with defer_until)
- Add DueAt/DeferUntil fields to UpdateArgs in protocol.go

Supports: +1h, tomorrow, next monday, 2025-01-15

* feat(dates): add defer_until filtering to ready command

Add time-based deferral support to bd ready:

- Add --include-deferred flag to show issues with future defer_until
- Filter out issues where defer_until > now by default
- Update undefer to clear defer_until alongside status change
- Add IncludeDeferred to WorkFilter and RPC ReadyArgs

Part of GH#820: Relative Date Parsing (Phase 5)

* feat(dates): add polish and tests for relative date parsing

Add user-facing warnings when defer date is in the past to help catch
common mistakes. Expand help text with format examples and document
the olebedev/when September parsing quirk.

Tests:
- TestCreateSuite/WithDueAt, WithDeferUntil, WithBothDueAndDefer
- TestReadyWorkDeferUntil (ExcludesFutureDeferredByDefault, IncludeDeferredShowsAll)

Docs:
- CLAUDE.md quick reference updated with new flags
- Help text examples for --due, --defer on create/update

Closes: Phase 6 of beads-820-relative-dates spec

* feat(list): add time-based query filters for defer/due dates

Add --deferred, --defer-before, --defer-after, --due-before, --due-after,
and --overdue flags to bd list command. All date filters now support
relative time expressions (+6h, tomorrow, next monday) via the
timeparsing package.

Filters:
- --deferred: issues with defer_until set
- --defer-before/after: filter by defer_until date range
- --due-before/after: filter by due_at date range
- --overdue: due_at in past AND status != closed

Existing date filters (--created-after, etc.) now also support relative
time expressions through updated parseTimeFlag().

* build(nix): update vendorHash for olebedev/when dependency

The olebedev/when library was added for natural language date parsing
(GH#820). This changes go.sum, requiring an updated vendorHash in the
Nix flake configuration.
2026-01-01 20:06:13 -08:00
Steve Yegge
e4042e3e1a Merge pull request #846 from steveyegge/feat/type-aliases-gt-pvhsv
feat(list): Add type aliases for --type flag
2026-01-01 20:05:40 -08:00
beads/crew/wolf
050d1a4413 fix: prevent infinite loop in bd hooks run when .old is a bd shim (#843)
When bd hooks install --chain renamed an existing bd shim to .old,
subsequent bd hooks run would execute the .old shim, which would
call bd hooks run again, creating infinite recursion.

Two fixes:
1. installHooks(): Skip renaming to .old if existing hook is a bd shim
2. runChainedHook(): Skip executing .old if it is a bd shim

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:46:34 -08:00
topaz
65fb0c6d77 feat(config): add validation.on-create and validation.on-sync config options (bd-t7jq)
Add .beads/config.yaml support for template validation settings:
- validation.on-create: warn|error|none (default: none)
- validation.on-sync: warn|error|none (default: none)

When set to "warn", issues missing required sections (based on type) show
warnings but operations proceed. When set to "error", operations fail.

Implementation:
- Add validation keys to YamlOnlyKeys in yaml_config.go
- Add defaults in config.go
- Wire up bd create to check validation.on-create config
- Wire up bd sync to run validation before export
- Add tests for config loading
- Update CONFIG.md documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:31:12 -08:00
dag
171151cf98 feat(list): Add type aliases for --type flag (gt-pvhsv)
Add convenience aliases for common type names:
- mr → merge-request
- feat → feature
- mol → molecule

Applied to bd list, bd ready, and bd export commands.
Case-insensitive matching (MR, Mr, mr all work).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:17:12 -08:00
jasper
b73085962c feat: Implement Step.Gate evaluation (Phase 1: Human Gates)
This implements Phase 1 of the Step.Gate feature (bd-7zka.2):

- bd cook now creates gate issues for steps with gate fields
- Gate issues have type=gate and block the gated step via dependency
- bd list filters out gate issues by default (use --include-gates to show)
- New bd gate command with list and resolve subcommands

Gate types supported in Phase 1:
- human: Manual closure via bd close or bd gate resolve

Implementation details:
- createGateIssue() in cook.go creates gate issues with proper metadata
- collectSteps() creates gate dependencies when processing gated steps
- IssueFilter.ExcludeTypes added to storage layer for type-based filtering
- Gate command provides dedicated UX for gate management

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 16:25:59 -08:00
beads/crew/emma
09d38de6df feat(create): add --validate flag for template validation (bd-ik1b)
Add opt-in strict mode that fails creation if required sections are
missing. Uses ValidateTemplate() under the hood.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 14:20:29 -08:00
beads/crew/grip
be70972eec feat(cli): add bd lint command for template validation (bd-gn5r)
Checks issues for missing recommended sections based on type:
- bd lint              # Lint all open issues
- bd lint bd-xxx       # Lint specific issue
- bd lint --type bug   # Filter by type
- bd lint --json       # JSON output for CI

Supports both daemon and direct mode. Exit code 1 when warnings found.
Part of opt-in validation epic (bd-ou35).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 14:18:49 -08:00
beads/crew/grip
db93ba0709 feat(validation): add ValidateTemplate() function (bd-615z)
Implements template validation for bd lint and bd create --validate:
- ValidateTemplate() checks description for required sections
- LintIssue() validates an existing issue
- TemplateError provides actionable missing section details
- Case-insensitive, flexible heading matching

Also fixes: close.go missing session parameter in CloseIssue calls

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 12:42:43 -08:00
gastown/crew/gus
a9e70e3fe5 fix: Add cross-rig routing support to bd close
The close command now properly routes to different beads directories
based on issue ID prefix, matching the behavior of bd show/update.

Changes:
- Check needsRouting() for each ID in both daemon and direct mode
- Handle routed IDs via resolveAndGetIssueWithRouting()
- Close issues in the correct remote store

Fixes bd-3jrb

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:26:18 -08:00
beads/crew/wolf
33cf09ba3b feat: add --pretty flag to bd ready (bd-vjas)
Adds --pretty flag to bd ready for consistency with bd list.
Uses the same displayPrettyList() function to show issues in
a tree format with status/priority symbols.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:17:31 -08:00