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
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.
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>
Add tests for parsing the Gate field in formula steps:
- TestParse_GateField: JSON parsing with all gate fields
- TestParse_GateFieldTOML: TOML parsing
- TestParse_GateFieldMinimal: minimal gate with only type
- TestParse_GateFieldWithAllTypes: all gate types (gh:run, gh:pr, timer, human, bead, mail)
- TestParse_GateInChildStep: gate in nested child steps
The Gate struct and Step.Gate field already existed. These tests
verify TOML and JSON parsing works correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
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>
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>
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>
Align beads skill with Claude Code best practices:
- Restructure SKILL.md from 3,306 to ~510 words (85% reduction)
- Use bd prime as CLI reference source of truth (DRY)
- Rename references/ to resources/ per Claude Code conventions
- Add v0.43.0 feature documentation (agents, gates, worktrees)
- Add ADR-0001 documenting the bd prime decision
- Add CLAUDE.md maintenance guide
New resources:
- agents.md - Agent bead tracking
- async-gates.md - Human-in-the-loop gates
- chemistry-patterns.md - Mol vs Wisp decision tree
- worktrees.md - Parallel development patterns
BREAKING: references/ path changed to resources/
Fixes#855
Ensure deterministic output when merging issues. Go map iteration order
is non-deterministic, causing inconsistent merge results across runs.
Sort result slice by ID before returning, matching bd export behavior.
Fixes#853
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>
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
- 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
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
- 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>
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>
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>
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>
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
* 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.
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>
* feat(build): add Windows ARM64 build support
- .goreleaser.yml
- .github/workflows/release.yml
- winget/SteveYegge.beads.installer.yaml
Add Windows ARM64 (aarch64) build target to support modern Windows devices
like Surface Pro X and Snapdragon-based laptops.
Changes:
- Added bd-windows-arm64 build configuration with CGO cross-compiler
- Installed gcc-mingw-w64-aarch64 toolchain in CI release workflow
- Added ARM64 installer entry to WinGet manifest (placeholder SHA256)
- Updated release header to mention Windows ARM64 support
The npm package already supports ARM64 in its cpu array.
Fixes: #833
* fix(build): use CGO_ENABLED=0 for Windows ARM64
- Remove non-existent gcc-mingw-w64-aarch64 package from CI
- Use CGO_ENABLED=0 since ncruces/go-sqlite3 is WASM-based
- Remove unnecessary CC/CXX cross-compiler settings
Addresses review feedback from @steveyegge on PR #834.
* style: remove inconsistent inline comment from goreleaser config
Aligns with existing style where CGO_ENABLED entries have no inline comments.
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>
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>
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>
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>
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>
The bd update command now checks needsRouting() before attempting daemon
RPC resolution. When an issue ID (like hq-eggh5) routes to a different
beads directory, the update bypasses the daemon and uses direct mode with
the routed storage.
This enables polecats in gastown to update HQ beads (hq-* prefix) and
vice versa. The fix mirrors the routing pattern already used by bd show.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The ValidateAgentID function was hardcoded to only accept 'gt-' prefix,
but beads rig uses 'bd-' prefix. Now accepts any valid prefix.
Changes:
- Extract prefix dynamically instead of hardcoding 'gt-'
- Accept IDs like bd-mayor, bd-beads-polecat-pearl
- Update error messages to be prefix-agnostic
- Add test cases for alternative prefixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
- Remove bd_new (31MB binary that should never have been tracked)
- Remove @AGENTS.md (duplicate that was already removed but still tracked)
- state.json already in .gitignore and not tracked
- history/EPHEMERAL_MOLECULES_DESIGN.md does not exist
(bd-ov1u)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The bd update command now checks needsRouting() before attempting daemon
RPC resolution. When an issue ID (like hq-eggh5) routes to a different
beads directory, the update bypasses the daemon and uses direct mode with
the routed storage.
This enables polecats in gastown to update HQ beads (hq-* prefix) and
vice versa. The fix mirrors the routing pattern already used by bd show.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The ValidateAgentID function was hardcoded to only accept 'gt-' prefix,
but beads rig uses 'bd-' prefix. Now accepts any valid prefix.
Changes:
- Extract prefix dynamically instead of hardcoding 'gt-'
- Accept IDs like bd-mayor, bd-beads-polecat-pearl
- Update error messages to be prefix-agnostic
- Add test cases for alternative prefixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two fixes for bare repo worktree setups:
1. fork_protection.go: Use git.GetGitDir() instead of hardcoding .git
In worktrees, .git is a file containing gitdir path, not a directory.
Using GetGitDir() handles this correctly.
2. sync_git.go: Simplify gitHasBeadsChanges to use absolute paths
The previous code used git -C main-repo-root status, but in bare
repo worktrees GetMainRepoRoot() returns the parent of the bare repo
which is not a valid working tree. Using absolute paths without -C
lets git find the repo from cwd, which always works.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The memory storage GetDependencyTree was missing the root node at depth 0,
causing --no-db mode to only show dependencies without the root issue.
Fixed by:
- Adding root node at depth 0 before listing dependencies
- Setting ParentID on child nodes for proper tree rendering
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The last-touched file was accidentally removed from GitignoreTemplate
in commit 310d374 (GH#814 fix). This restores it and adds it to
requiredPatterns so bd doctor will detect outdated gitignores.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --notes flag to bd create command, enabling agents to set notes
during issue creation instead of requiring a separate update command.
Motivation: AI agents repeatedly tried to use --notes with bd create.
Context is fresh at creation time - forcing a two-step process means
context loss or workflow interruption.
Changes:
- cmd/bd/flags.go: Added --notes flag to common issue flags
- cmd/bd/create.go: Read and pass notes in both RPC and direct modes
- cmd/bd/update.go: Removed duplicate --notes flag definition
- internal/rpc/protocol.go: Added Notes field to CreateArgs
- internal/rpc/server_issues_epics.go: Process Notes in handleCreate
- cmd/bd/create_notes_test.go: Comprehensive test coverage
- website/docs/cli-reference/issues.md: Documentation
Also adds gitignore entries for Augment AI and .beads/redirect.
Co-authored-by: Leon Letto <lettol@vmware.com>
The fork protection logic incorrectly treated all repos where
origin != steveyegge/beads as forks, including user's own projects
that just use beads as a tool.
Changes:
- Add isForkOfBeads() that scans ALL remotes for steveyegge/beads
- Only apply protection when a beads-related remote exists
- Add git config opt-out: `git config beads.fork-protection false`
(per-clone, never tracked, matches beads.role pattern)
Test coverage for 8 scenarios plus edge cases for config values.
Adds #nosec G204 annotations to exec.Command calls that use
hardcoded paths. Fixes pre-existing lint failure exposed by PR #832.
🤖 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
* test(daemon): Prove autoPull reads sync.branch from SQLite
- Verify daemon reads sync.branch from SQLite config source
- Show config.yaml sync-branch is ignored (YAML-only key)
- Add skipped tracer bullet test for issue #831
Coverage: daemon autoPull config resolution
* fix(daemon): Use syncbranch.IsConfigured() for autoPull
Problem:
- Daemon's periodic sync never activated when sync-branch configured in config.yaml
- autoPull check only read sync.branch from SQLite, missing YAML-only configuration
Solution:
- Replace SQLite-only check with syncbranch.IsConfigured()
- Update test to validate correct detection of YAML-configured sync branch
Impact:
- Periodic sync now activates correctly when sync-branch is configured in config.yaml
- Fixes daemon hanging issue for users with YAML-only configuration