* feat(daemon): unify auto-sync config for simpler agent workflows
## Problem
Agents running `bd sync` at session end caused delays in the Claude Code
"event loop", slowing development. The daemon was already auto-exporting
DB→JSONL instantly, but auto-commit and auto-push weren't enabled by
default when sync-branch was configured - requiring manual `bd sync`.
Additionally, having three separate config options (auto-commit, auto-push,
auto-pull) was confusing and could get out of sync.
## Solution
Simplify to two intuitive sync modes:
1. **Read/Write Mode** (`daemon.auto-sync: true` or `BEADS_AUTO_SYNC=true`)
- Enables auto-commit + auto-push + auto-pull
- Full bidirectional sync - eliminates need for manual `bd sync`
- Default when sync-branch is configured
2. **Read-Only Mode** (`daemon.auto-pull: true` or `BEADS_AUTO_PULL=true`)
- Only receives updates from team
- Does NOT auto-publish changes
- Useful for experimental work or manual review before sharing
## Benefits
- **Faster agent workflows**: No more `bd sync` delays at session end
- **Simpler config**: Two modes instead of three separate toggles
- **Backward compatible**: Legacy auto_commit/auto_push settings still work
(treated as auto-sync=true)
- **Adaptive `bd prime`**: Session close protocol adapts when daemon is
auto-syncing (shows simplified 4-step git workflow, no `bd sync`)
- **Doctor warnings**: `bd doctor` warns about deprecated legacy config
## Changes
- cmd/bd/daemon.go: Add loadDaemonAutoSettings() with unified config logic
- cmd/bd/doctor.go: Add CheckLegacyDaemonConfig call
- cmd/bd/doctor/daemon.go: Add CheckDaemonAutoSync, CheckLegacyDaemonConfig
- cmd/bd/init_team.go: Use daemon.auto-sync in team wizard
- cmd/bd/prime.go: Detect daemon auto-sync, adapt session close protocol
- cmd/bd/prime_test.go: Add stubIsDaemonAutoSyncing for testing
* docs: add comprehensive daemon technical analysis
Add daemon-summary.md documenting the beads daemon architecture,
memory analysis (explaining the 30-35MB footprint), platform support
comparison, historical problems and fixes, and architectural guidance
for other projects implementing similar daemon patterns.
Key sections:
- Architecture deep dive with component diagrams
- Memory breakdown (SQLite WASM runtime is the main contributor)
- Platform support matrix (macOS/Linux full, Windows partial)
- Historical bugs and their fixes with reusable patterns
- Analysis of daemon usefulness without database (verdict: low value)
- Expert-reviewed improvement proposals (3 recommended, 3 skipped)
- Technical design patterns for other implementations
* feat: add cross-platform CI matrix and dual-mode test framework
Cross-Platform CI:
- Add Windows, macOS, Linux matrix to catch platform-specific bugs
- Linux: full tests with race detector and coverage
- macOS: full tests with race detector
- Windows: full tests without race detector (performance)
- Catches bugs like GH#880 (macOS path casing) and GH#387 (Windows daemon)
Dual-Mode Test Framework (cmd/bd/dual_mode_test.go):
- Runs tests in both direct mode and daemon mode
- Prevents recurring bug pattern (GH#719, GH#751, bd-fu83)
- Provides DualModeTestEnv with helper methods for common operations
- Includes 5 example tests demonstrating the pattern
Documentation:
- Add dual-mode testing section to CONTRIBUTING.md
- Document RunDualModeTest API and available helpers
Test Fixes:
- Fix sync_local_only_test.go gitPull/gitPush calls
- Add gate_no_daemon_test.go for beads-70c4 investigation
* fix(test): isolate TestFindBeadsDir tests with BEADS_DIR env var
The tests were finding the real project's .beads directory instead of
the temp directory because FindBeadsDir() walks up the directory tree.
Using BEADS_DIR env var provides proper test isolation.
* fix(test): stop daemon before running test suite guard
The test suite guard checks that tests don't modify the real repo's .beads
directory. However, a background daemon running auto-sync would touch
issues.jsonl during test execution, causing false positives.
Changes:
- Set BEADS_NO_DAEMON=1 to prevent daemon auto-start from tests
- Stop any running daemon for the repo before taking the "before" snapshot
- Uses exec to call `bd daemon --stop` to avoid import cycle issues
* chore: revert .beads/issues.jsonl to upstream/main
Per CONTRIBUTING.md, .beads/issues.jsonl should not be modified in PRs.
Add config parsing for .pre-commit-config.yaml to detect if bd hooks are
configured. pre-commit is popular enough to warrant full support alongside
lefthook and husky.
Changes:
- Add CheckPrecommitBdIntegration() function to parse YAML config
- Check hooks.*.entry field for 'bd hooks run' pattern
- Handle stages field to determine which git hooks are configured
- Support legacy stage names (commit -> pre-commit, push -> pre-push)
- Add pre-commit to checkManagerBdIntegration switch statement
- Add comprehensive tests for all scenarios
Now supported managers with deep integration checks:
- lefthook (YAML, TOML, JSON)
- husky (.husky/ scripts)
- pre-commit (.pre-commit-config.yaml)
Detection-only managers (cannot verify config):
- overcommit, yorkie, simple-git-hooks
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When bd doctor detects hook managers we can't fully check (pre-commit,
overcommit, yorkie, simple-git-hooks), it now shows an informational
message instead of a warning:
✓ pre-commit detected (cannot verify bd integration)
└─ Ensure your hook config calls 'bd hooks run <hook>'
Previously it incorrectly warned that these managers were "not calling bd"
when we simply couldn't verify their config.
Changes:
- Add DetectionOnly field to HookIntegrationStatus
- Set DetectionOnly=true for unsupported managers in CheckExternalHookManagerIntegration
- Update CheckGitHooks and CheckSyncBranchHookCompatibility to show
informational message for detection-only managers
- Add test coverage for DetectionOnly behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When running from a crew directory with .beads/redirect pointing to a shared
beads directory in another repo, git status commands would fail with:
fatal: /path/to/mayor/rig/.beads: is outside repository
The fix detects when beadsDir is redirected and runs git commands from the
directory containing the actual .beads/ using git -C <targetRepoDir>.
Updated functions:
- gitHasBeadsChanges(): checks redirect and runs git from target repo
- gitHasUncommittedBeadsChanges(): same fix for pre-flight check
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add detection for external git hook managers (lefthook, husky, pre-commit,
overcommit, yorkie, simple-git-hooks) and check if they have bd hooks
integration configured.
- Detect manager config files in various locations/formats
- Parse lefthook YAML/TOML/JSON to check for `bd hooks run` commands
- Check husky hook scripts for bd integration
- Report which hooks have bd integration vs missing
- Use --chain flag in `bd doctor --fix` when external managers detected
- Detect active manager from git hooks when multiple present
Executed-By: mayor
Role: mayor
bd update now uses resolveAndGetIssueWithRouting in direct mode,
matching bd show's prefix routing behavior. This enables cross-rig
issue updates from any directory using prefix-based routing.
Changes:
- Use resolveAndGetIssueWithRouting for ID resolution with routing
- Iterate over original args instead of pre-resolved IDs
- Use routed store (issueStore) and resolved ID throughout
- Remove early ID resolution that was blocking routing in direct mode
- Add proper result.Close() calls for resource cleanup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Exclude closed issues from duplicate detection (previously only excluded tombstones)
- Use full content hash: title + description + design + acceptanceCriteria + status
- Add comprehensive test coverage for duplicate detection edge cases
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
The sync_divergence check was querying the wrong table. The sync code
writes last_import_time to the metadata table, but doctor was looking
in config. This caused spurious "No last_import_time recorded" warnings
even when sync was working correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Replace tool-specific setup commands with a generic recipe-based system.
New tools become config entries, not code changes.
Changes:
- Add internal/recipes/ package with Recipe type and built-in recipes
- Add --list flag to show available recipes
- Add --print flag to output template to stdout
- Add -o flag to write template to arbitrary path
- Add --add flag to save custom recipes to .beads/recipes.toml
- Add built-in recipes: windsurf, cody, kilocode (new)
- Legacy recipes (cursor, claude, gemini, aider, factory) continue to work
The recipe system enables:
- Adding new tool support without code changes
- User-defined recipes in .beads/recipes.toml
- Shared template across all file-based integrations
🤖 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
The external_ref field was stored correctly and visible in --json
output, but missing from the human-readable text display.
Added External Ref line after other metadata fields in both daemon
and direct mode paths. Added tests for external_ref display.
The --blocks flag handler duplicated cycle detection warning logic from
depAddCmd. Extract to a shared helper function.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The bug: initializeNoDbMode() was setting the legacy global storeActive
but not cmdCtx.StoreActive. When ensureStoreActive() checked
isStoreActive(), it used cmdCtx.StoreActive (which was false), causing
the JSONL-only mode error even when --no-db was passed.
The fix: Use accessor functions (lockStore, setStore, setStoreActive,
unlockStore) which set both the legacy globals and cmdCtx fields.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add alreadyExported flag to skip redundant export. When
gitHasUncommittedBeadsChanges() detects uncommitted changes, we export
at line 175. The flag prevents the normal flow from exporting again
at line 293.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The daemon code path was returning early after adding the dependency,
skipping the cycle detection that runs for direct mode. Restructure
so both paths share the cycle detection and output code.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Agents naturally try to use 'bd dep <blocker> --blocks <blocked>' when
establishing blocking relationships - a desire path revealing intuitive
mental model for how dependencies should work.
When AI agents set up dependency chains, they consistently attempt:
bd dep conduit-abc --blocks conduit-xyz
This reveals a desire path - the syntax users naturally reach for before
reading documentation. Instead of fighting this intuition, we embrace it.
- Add --blocks (-b) flag to the bd dep command
- Support syntax: bd dep <blocker-id> --blocks <blocked-id>
- Equivalent to: bd dep add <blocked-id> <blocker-id>
- Full daemon and direct mode support
- Cycle detection and child-parent anti-pattern checks
- JSON output support for programmatic use
This is purely additive. The existing command structure remains:
- 'bd dep add' subcommand works exactly as before
- All other dep subcommands (remove, list, tree, cycles) unchanged
- No breaking changes to existing workflows
bd dep bd-xyz --blocks bd-abc # bd-xyz blocks bd-abc
bd dep bd-xyz -b bd-abc # Same, using shorthand
bd dep add bd-abc bd-xyz # Original syntax still works
- Added TestDepBlocksFlag for flag initialization
- Added TestDepBlocksFlagFunctionality for semantic correctness
- All existing tests pass
In performExport, if git commit succeeded but push failed, the
finalizeExportMetadata() was never called because we returned early.
This meant metadata would not reflect the successful export+commit.
Now finalize is called:
- Right after syncBranchCommitAndPush succeeds
- Right after gitCommit succeeds (before push attempt)
- When no git changes exist (export still happened)
Push failure still returns early, but metadata is already updated.
🤖 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
When running bd init in a subdirectory of a hub (e.g., ~/Repos/project
where ~/Repos/.beads exists), the new database was incorrectly inheriting
issues from the parent hub.
Root cause: checkGitForIssues() computed the relative path from gitRoot
to beadsDir but did not validate that beadsDir was actually inside the
git repository. When beadsDir was outside (e.g., ../.beads), it would
still attempt to import, causing contamination.
Fix: Add a guard to reject beadsDir paths that start with .. (outside
the git repository boundary).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When setting a slot to a bead from a different beads database
(e.g., setting an hq-* role bead on a gt-* agent bead), the command
now uses prefix-based routing via routes.jsonl to resolve the bead
in the correct database.
Previously, bd slot set only looked in the local database, failing
to find cross-db references like hq-polecat-role from rig beads.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This fixes the atomicity gap where exportToJSONL would update SQLite
metadata (clear dirty flags, update content hash, last_import_time)
BEFORE the git commit. If git commit failed, SQLite would incorrectly
indicate the sync succeeded.
Changes:
- Add ExportResult struct to capture export metadata for deferred finalization
- Add exportToJSONLDeferred() that exports without updating metadata
- Add finalizeExport() to update metadata after git commit succeeds
- Update daemon_sync.go sync flows to defer metadata updates
Now the sync flow is truly atomic: metadata only updates after git commit.
🤖 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 CheckSyncDivergence doctor check that detects:
- JSONL on disk differs from git HEAD version
- SQLite last_import_time does not match JSONL mtime
- Uncommitted .beads/ changes exist
Each issue includes auto-fix suggestions (bd sync, bd export, git commit).
Multiple divergence issues result in error status.
Part of GH#885 recovery mechanism.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add pre-flight safety check to detect when a previous sync exported
but failed before commit, leaving JSONL in an inconsistent state.
- Add gitHasUncommittedBeadsChanges() helper in sync_git.go
- Call in sync pre-flight checks after merge/rebase check
- If uncommitted changes detected, force re-export to reconcile state
This catches the failure mode early before it compounds across worktrees.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
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>
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>
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>
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
- 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>
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>
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>
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
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
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>
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>
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
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>
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>
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.
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>
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>
- 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>
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>
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>
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>