Commit Graph

1472 Commits

Author SHA1 Message Date
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
gastown/polecats/nux
628ab911a0 fix: bd update supports cross-rig bead updates via prefix routing (gt-wq1wb)
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>
2026-01-01 11:14:20 -08:00
beads/crew/emma
363c5a3819 fix: bd sync fails with exit 128 in bare repo worktrees (GH#827)
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>
2026-01-01 11:05:05 -08:00
beads/crew/emma
edc0fea02f fix: restore last-touched to gitignore template (GH#838)
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>
2026-01-01 10:58:16 -08:00
cbarber
7a9db35c79 Fix shebang env (#817)
* fix: use /usr/bin/env to PATH search sh (nixos compatiblity)

* fix: reconcile repo hooks with template /usr/bin/env change
2026-01-01 10:54:22 -08:00
beads/crew/emma
829c8d1caf feat: add --notes flag to bd create command (GH#830)
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>
2026-01-01 10:53:59 -08:00
Jordan Hubbard
aa2ea48bf2 feat: add FreeBSD release builds (#832)
* feat: add FreeBSD release builds

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* chore: allow manual release dispatch

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: stabilize release workflow on fork

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: clean zig download artifact

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: use valid zig target for freebsd arm

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: disable freebsd arm release build

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: switch freebsd build to pure go

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: skip release publishing on forks

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

* fix: satisfy golangci-lint for release PR

---------

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-01-01 10:51:51 -08:00
Peter Chanthamynavong
f3f713d77a fix(fork-protection): only apply protection to actual beads forks (#823) (#828)
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.
2026-01-01 10:51:22 -08:00
beads/crew/dave
00d0eb0192 fix: add gosec annotations to doctor/gitignore.go (GH#832)
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
2026-01-01 10:49:47 -08:00
Peter Chanthamynavong
9801102aa2 fix(daemon): Use syncbranch.IsConfigured() for autoPull (#837)
* 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
2026-01-01 10:48:14 -08:00
Gero Hillebrandt
a1f706d17a fix: prevent nil context panic in multi-repo hydration (#840) 2026-01-01 10:46:56 -08:00
beads/crew/fang
5e8a834b38 fix: bd sync now follows .beads/redirect for worktree path (bd-e2q9, bd-kvus)
When .beads/redirect exists, bd sync was using GetRepoRoot(cwd) to find
the git worktree location. This failed because the worktree should be
in the same repo as the beads directory, not the current working directory.

Fix: Use getRepoRootFromPath(beadsDir) to derive the repo root from
the actual beads location after following the redirect.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:32:17 -08:00
beads/crew/dave
b362b36824 feat: add session_id field to issue close/update mutations (bd-tksk)
Adds closed_by_session tracking for entity CV building per Gas Town
decision 009-session-events-architecture.md.

Changes:
- Add ClosedBySession field to Issue struct
- Add closed_by_session column to issues table (migration 034)
- Add --session flag to bd close command
- Support CLAUDE_SESSION_ID env var as fallback
- Add --session flag to bd update for status=closed
- Display closed_by_session in bd show output
- Update Storage interface to include session parameter in CloseIssue

🤖 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
2025-12-31 13:14:15 -08:00
beads/crew/fang
7c9b975436 feat: add display guards for large molecules in bd mol current (bd-vln0)
For molecules with >100 steps, shows summary instead of full step list:
- Counts children first using efficient GetMoleculeProgress query
- Shows progress summary with pointer to bd mol progress
- Add --limit flag to cap output (e.g., --limit 50)
- Add --range flag for specific ranges (e.g., --range 1-50)

Also closes epic bd-5nu1 (mega-molecule progress support).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:08:41 -08:00
beads/crew/fang
f3224278a8 fix: use lightweight molecule discovery in bd mol progress
Replace findInProgressMolecules (which loads full subgraphs) with
findInProgressMoleculeIDs (which only returns IDs). This ensures
auto-discovery is efficient for mega-molecules.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:04:19 -08:00
beads/crew/emma
21de43538d fix: eliminate 5+ second delays from stale daemon.lock files (bd-htwx)
Root cause: When a bd daemon crashes, its daemon.lock file remains with
the old PID. If that PID gets reused by an unrelated process, the code
would wait 5 seconds for a socket that will never appear.

Fix: Use flock-based check as authoritative source for daemon liveness.
The OS releases flocks when a process dies, so this is immune to PID reuse.

Changes:
- handleExistingSocket: Check daemon flock before waiting for socket
- acquireStartLock: Verify daemon lock is held before waiting
- handleStaleLock: Use flock check to detect stale startlocks
- lockfile/process_*.go: Add pid <= 0 check to prevent false positives
  (PID 0 signals process group on Unix, not a specific process)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:03:49 -08:00
beads/crew/grip
e2121a2e07 fix(refile): address code review feedback
- Warn if source issue is already closed
- Copy all issue fields (SourceRepo, Ephemeral, MolType, RoleType, Rig)
- Log warnings on label copy failures instead of silently ignoring
- Schedule auto-flush when source is local store
- Remove stale comment

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:01:20 -08:00
beads/crew/wolf
54d15252fa Add BEADS_NO_AUTO_STAGE opt-out for pre-commit auto-staging (GH#826)
Users with conflicting git hooks (e.g., hooks that read the staging
area like GGA) can now set BEADS_NO_AUTO_STAGE=1 to disable auto-staging
and get check-and-block behavior instead.

Default behavior unchanged - auto-staging still works for most users.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 12:58:54 -08:00