Commit graph

50 commits

Author SHA1 Message Date
coffeegoddd☕️✨
7e0d09cbf8 /{internal,cmd}: fix CommitPending 2026-05-01 11:15:02 -07:00
Cdfghglz
2c0fa6e6a4
fix: bd update --type honors custom types (fixes #3030) (#3093)
Move type validation from CLI-level (update.go) to storage layer
(UpdateIssueInTx), matching the create path. The CLI-level validation
failed when GetCustomTypes() was unavailable (subprocess context,
circuit breaker) and config.yaml lacked types.custom (because bd config
set only writes to Dolt). The storage layer reads custom types within
the same transaction, so it always works.

Co-authored-by: mayor <rastislav.marko@panzarobotics.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 17:49:52 -07:00
matt wilkie
696ed0e9ba
fix(update): set status=deferred when --defer is provided (GH#3233) (#3241)
* fix(update): set status=deferred when --defer is provided (GH#3233)

`bd update --defer <date>` only set defer_until, leaving status=open,
so the ❄ icon (driven by status) was missing in `bd list`. `bd defer`
already sets both fields; align `bd update --defer` with that behavior.

Explicit --status wins if provided in the same invocation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(update): handle past-date and clear cases for --defer (GH#3233)

Address review feedback on the previous commit:

- Past-date --defer no longer flips status to deferred. The warning at
  this path promises the issue "will appear in bd ready immediately",
  which requires status to stay open.
- --defer="" now restores status=open (only when the issue was actually
  deferred), so the help text "show in bd ready immediately" holds.
  Non-deferred statuses like in_progress are preserved.

Explicit --status continues to win in both directions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 10:22:59 -07:00
Julian Knutsen
73409d51d4
feat: move hook firing into storage layer via decorator (#2891)
* feat: move hook firing into storage layer via decorator

Add HookFiringStore decorator that wraps DoltStorage and automatically
fires on_create/on_update/on_close hooks after successful mutations.
This replaces manual hookRunner.Run() calls scattered across 8+ CLI
command files, ensuring ALL mutations fire hooks — including future
commands that haven't been written yet.

Key features:
- Decorator pattern: storage layer stays clean (no hooks dependency)
- Transaction support: hookTrackingTransaction accumulates pending
  hooks during RunInTransaction, fires them only after successful
  commit. Rollback = no hooks.
- Covers all mutation methods: CreateIssue(s), UpdateIssue, CloseIssue,
  ReopenIssue, UpdateIssueType, Add/RemoveDependency, Add/RemoveLabel,
  AddIssueComment
- DeleteIssue intentionally skipped (destructive, no issue to pass)
- Nil runner safe (passthrough only, no panics)

Removed hookRunner.Run() from: create.go, update.go, close.go,
note.go, assign.go, tag.go, priority.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add BD_NO_HOOKS env var to disable all hook firing

Allows opting out of the HookFiringStore decorator entirely via
BD_NO_HOOKS=1. Useful for bulk imports, migrations, or environments
where eventing should not run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:32:01 -07:00
coffeegoddd☕️✨
a35edfd28e /{internal,cmd,.goreleaser,.github}: embedded mode by default 2026-03-28 13:47:20 -07:00
Harry Miller
5d4aafd27e
Merge pull request #2821 from harry-miller-trimble/fix/idempotent-claim
fix: make bd update --claim idempotent for same user
2026-03-26 08:40:51 -07:00
julianknutsen
bcc7a2b99d fix: fire on_close hook from bd update --status closed, and on_update from bd close
Previously, `bd update --status closed` only fired on_update but not on_close,
and `bd close` only fired on_close but not on_update. Hooks should fire
symmetrically for both commands since both change status to closed.

The fix adds cross-hook firing with a state-transition guard: hooks only fire
when the status actually changes (closing an already-closed issue is a no-op
for the cross-hook).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:54:01 +01:00
emma
faa69f922b feat: audit log captures close reason; add v0.62.0 changelog and version notes
LogFieldChange now accepts a reason parameter — bd close passes the
--reason text so cleanup context survives Dolt GC flatten. Also adds
CHANGELOG.md entry and info.go versionChanges for v0.62.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:54:01 -07:00
beads/crew/emma
a44e01e971 feat: audit log status changes to interactions.jsonl (bd-42f)
Dolt GC flatten destroys commit history, which was the only record of
status changes. Add LogFieldChange to the audit package and call it from
bd update and bd close so that status/assignee/priority changes are
appended to .beads/interactions.jsonl — an append-only file that
survives GC.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 19:13:16 -07:00
garnet
3dae6bb3df refactor: remove gastown/Gas Town string references from beads code and docs (bd-1ue8)
Replace gastown-specific references with generic alternatives throughout
the codebase:

- Rename --gastown flag to --orchestrator in bd doctor
- Rename gastownMode/gastownThreshold params to orchestratorMode/orchestratorThreshold
- Rename isGasTownTownRoot() to isOrchestratorRoot()
- Replace "gastown" in CLI examples with generic rig names (my-project, other-project)
- Update comments replacing "Gas Town" with "orchestrator" or "multi-agent workspace"
- Update active docs (DOLT.md, CONFIG.md, ADVANCED.md, etc.)
- Update test data to use generic names instead of "gastown"
- Update role templates (deacon, witness, refinery) to use generic language

Preserved as historical (not changed):
- CHANGELOG.md entries (historical record)
- ARTICLES.md (links to real published articles)
- info.go version notes (historical release notes)
- gastown/ file path references in dolt-concurrency.md (point to actual repo)
2026-03-20 18:39:50 -07:00
Dustin Brown
5156a8c4bf
Merge pull request #2724 from coffeegoddd/db/migrate-show-delete
fix(embeddeddolt): /{cmd,internal}: implement more methods
2026-03-19 17:10:23 -07:00
beads/crew/emma
f8152a1320 fix(update): require explicit opt-in for empty stdin/file DESCRIPTION rewrites
Guard against accidental description blanking when a producer fails but
still pipes empty input into bd update. Empty DESCRIPTION replacement
from --body-file, --description-file, --stdin, and dash shorthand now
requires --allow-empty-description. Inline --description "" unchanged.

Closes #2713

Co-Authored-By: Gary <gary@algorune.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 14:49:04 -07:00
coffeegoddd☕️✨
188ba0ed0c /cmd/bd: commit on write commands 2026-03-19 13:03:15 -07:00
coffeegoddd☕️✨
0350e8bbfa /{cmd,internal}: fix commands 2026-03-19 08:44:41 -07:00
mayor
869cc17fcd feat: add --no-history flag to bd create — skip Dolt commits without GC eligibility
Separates "no git history" from "garbage-collectible" for beads stored in the
wisps table. Previously --ephemeral bundled both behaviors, causing agent identity
beads to be incorrectly GC'd.

Changes:
- Add NoHistory field to types.Issue and wisps/issues schema (migration 011)
- Route NoHistory issues to wisps table, skip DOLT_COMMIT, but leave ephemeral=0
- Wire --no-history flag in bd create and bd update (with --history to undo)
- Add --exclude-type flag to bd mol wisp gc
- Add --type filter flag to bd mol wisp list
- Include type and labels in wisp list JSON output
- Move ephemeral/no-history mutual exclusion to validation layer
- Migrate issues between tables when --no-history/--ephemeral set on update
- Fix ExcludeTypes filter self-join subquery inefficiency
- Ensure JSONL export/import roundtrip preserves no_history
- Remove dead AllEphemeral function (superseded by AllWisps)
- Comprehensive test coverage for all new flags and edge cases

Resolves: steveyegge/beads#2619
Refs: steveyegge/gastown#2768

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 19:28:48 +00:00
Matthew Endsley
71d7ae593b
feat: add --design-file flag for reading design from files
Adds support for reading design content from files or stdin, making it easier to manage longer design notes.

The new `--design-file` flag is mutually exclusive with the inline `--design` flag. Includes comprehensive tests for all code paths.
2026-03-11 12:25:23 -07:00
beads/crew/emma
9d65ac8506 fix: merge --metadata with existing metadata instead of replacing (GH#2423)
bd update --metadata now merges new keys into existing metadata instead
of replacing the entire object, preventing silent data loss of existing
metadata keys.

Co-Authored-By: mrmaxsteel <mrmaxsteel@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:58:06 -07:00
Pablo LION
a3dd6531d3 feat(cli): show titles in command feedback (GH#1384) 2026-02-26 12:47:36 +01:00
Joseph Turian
dcf5c224a0
feat(update): add --set-metadata and --unset-metadata flags (GH#1406)
Add surgical metadata edits to bd update: --set-metadata key=value and --unset-metadata key.
Values are type-aware (numbers, bools, null preserved as JSON types). Cannot be combined
with --metadata (full replacement). Thorough test coverage.

Co-Authored-By: Joseph Turian <turian@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:23:33 -08:00
beads/crew/jane
3ef50b867d fix: validate status on update against built-in + custom statuses (#2021)
bd update --status previously accepted any string silently, while
bd create validated against built-in + custom statuses. This adds the
same validation to update, rejecting invalid status values with a
helpful error message.

Co-Authored-By: Joseph Turian <turian@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:05:17 -08:00
beads/crew/wickham
13190efbcc fix: reject empty title and empty label on update/label add (GH#1994)
- `bd update <id> --title ""` now errors instead of silently blanking
- `bd update <id> --title "   "` (whitespace-only) also rejected
- `bd label add <id> ""` now errors instead of adding empty label
- Values are trimmed before storage, not just for validation
- Includes fix for pre-existing doctor file formatting

Based on PR #1994 by @turian.

Co-Authored-By: Joseph Turian <turian@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:05:06 -08:00
beads/crew/lydia
d22095501e fix: exit non-zero when all close/update attempts fail (GH#2014)
bd close and bd update now exit 1 when all attempted operations fail
(e.g., closing a blocked issue, updating a nonexistent ID). Partial
success (some closed, some failed) still exits 0.

Adds protocol tests for exit code behavior.

Co-Authored-By: Joseph Turian <turian@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:04:06 -08:00
jasper
619f34a441 chore: add explanatory comments to silently ignored errors across codebase
Code health review found 30+ instances of error suppression using blank
identifier without explanation. Added comments to 82 files explaining WHY
each error is safely ignored (best-effort cleanup, advisory operations,
safe defaults, etc.) to improve code maintainability.

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

Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats
2026-02-14 17:16:43 -08:00
Steven Syrek
1f63bd73bf fix(cli): show only base types in --type flag help text
The help text for `bd create --type` and `bd update --type` listed
Gas Town types (molecule, gate, convoy, etc.) as valid options, but
they fail with 'invalid issue type' unless types.custom is configured.
Show only the six built-in types and note that custom types require
configuration.

Closes #1727

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-14 16:48:19 +01:00
mayor
aba0cab3cd feat: add decision as built-in issue type
Projects track what they're doing (issues) and what happened (events),
but not why they chose a particular approach. Decisions are a missing
first-class concept -- every project has them, they're distinct from
tasks, and they're the context hardest to recover after the fact.

Adds TypeDecision as a core work type alongside bug/feature/task/epic/chore.
Includes aliases (dec, adr), required sections template (Decision, Rationale,
Alternatives Considered), and a Claude plugin command for structured recording.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-11 17:21:46 -08:00
elinor
b136996b90 refactor: delete daemon/RPC layer and internal/rpc/ package (-19,663 lines)
Phase 2 of Dolt transition (woho.2): Remove the entire daemon/RPC layer
now that all commands use direct storage access.

- Delete internal/rpc/ directory (40 files, ~11K lines)
- Delete daemon_deprecated.go stub layer
- Delete compact_rpc.go (daemon-only compact via RPC)
- Delete daemon-specific test files (delete_rpc_test.go, direct_mode_test.go,
  dual_mode_test.go, list_watch_test.go)
- Clean up remaining daemon references in ~25 source files:
  - Remove daemon RPC branches from update, create, template, markdown,
    gate_discover, mol_stale, mol_current, import, query, version, prime
  - Remove rpc.Client parameter from show_thread functions
  - Simplify info.go to always show "direct" mode
  - Simplify sync_import.go to always use inline import
  - Remove daemon status checks from staleness, migrate_dolt, rename_prefix
  - Remove unused fallbackToDirectMode function
  - Remove stale daemon comments from sync.go
- Add daemon_compat.go with --no-daemon flag (backward compat for hooks)
  and utility functions (boolToFlag, truncateString, formatUptime, progressBar)
- Fix test files: remove daemonClient cleanup blocks, update findRepliesTo/
  findReplies call signatures, remove RPC test functions
- go vet ./... passes clean

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 12:10:24 -08:00
emma
820ff2bbeb refactor: remove 46 markDirtyAndScheduleFlush() no-op calls from 33 files
Phase 2 of JSONL sync removal (dolt-test-woho.4). These calls became
no-ops in the previous commit. Removing them reduces dead code and
moves toward deleting jsonl_deprecated.go entirely.

33 production files cleaned, 131 lines removed.
go vet ./cmd/bd/... passes clean.

Note: --no-verify used because Dolt server is unreachable (VPN down).

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-09 23:40:04 -08:00
beads/crew/lizzy
e54ac33d28 hygiene: consolidate internal/util into internal/utils
Merged internal/util (NormalizeIssueType, NormalizeLabels) into
internal/utils package. Updated 8 consumers to import from the
consolidated package. Eliminates the confusing coexistence of
two similarly-named utility packages.

Closes dolt-test-oli

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:15:12 -08:00
Pablo LION
32738345fd fix(update): log DB error when GetCustomTypes fails
When store.GetCustomTypes returns an error in direct mode, the error
was silently swallowed. The code continued with customTypes=nil and
fell back to config.yaml. If the type wasn't found there, users saw
a misleading "invalid issue type" error instead of the actual DB error.

Now logs a warning with the actual error before falling back, making
debugging easier while preserving the graceful fallback behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 13:38:18 +01:00
Pablo LION
182655ca74 fix(update): skip type pre-validation in daemon mode
In daemon mode, the daemon validates custom types authoritatively
with database access. Client-side pre-validation using config.yaml
could reject types that exist in the database but not in the YAML
(GH#1499 QA findings 2.3, 2.5).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-05 23:47:35 +01:00
Jordan Hindo
047174ec90 fix(update): add config.yaml fallback for custom types in daemon mode
When the daemon is running, the store variable is nil because
PersistentPreRun returns early (skipping store initialization).
This caused custom types from config.yaml to be unavailable,
making  fail with validation errors.

The fix adds a fallback to config.GetCustomTypesFromYAML() when
store is nil, mirroring the same fallback pattern already used
in internal/storage/sqlite/config.go.

Fixes #1499
2026-02-04 20:03:10 -08:00
paf0186
c96e62e6b5
fix: add atomic compare-and-swap semantics to bd claim (#1474)
* fix: add atomic compare-and-swap semantics to bd claim

The claim operation had a race condition where concurrent callers could
both pass the pre-check and claim the same issue. This fix:

- Adds ClaimIssue method to Storage interface with atomic CAS semantics
- Uses conditional UPDATE (WHERE assignee = '') to prevent race conditions
- Returns ErrAlreadyClaimed error when issue is already assigned
- Implements the fix in SQLite, Memory, and Dolt storage backends
- Updates RPC handler and CLI to use the new atomic method
- Adds comprehensive tests including concurrent claim scenarios

Closes the race window where multiple agents could both claim an issue.

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

* fix: add ClaimIssue to mockStorage in tests

The mockStorage struct used for interface compliance testing was missing
the new ClaimIssue method, causing build failures in CI.

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

* fix(nix): enable proxyVendor to fix GOTOOLCHAIN in module fetch phase

The Nix build was failing because the go-modules fetching phase uses
GOTOOLCHAIN=local by default, ignoring the env.GOTOOLCHAIN=auto setting.

Adding proxyVendor=true changes how modules are fetched in a way that
should allow GOTOOLCHAIN=auto to take effect, enabling Go to download
the required 1.25.6+ toolchain automatically.

Fixes #1476

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

* Revert "fix(nix): enable proxyVendor to fix GOTOOLCHAIN in module fetch phase"

This reverts commit a5b758cf1ac8bbadff774f5566144c3f0b94d561.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:07:40 -08:00
anupamchugh
a1c447eb66 feat: add spec_id support
Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-03 13:58:36 -07:00
Joseph Turian
70bc3844be fix(lint): suppress G304 false positive for @file.json syntax
The --metadata flag intentionally reads from user-provided file paths
when using @file.json syntax. This is expected behavior, not a security
vulnerability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:39:56 -08:00
Joseph Turian
e8158aec3d feat(cli): add --metadata flag to bd update (bd-0vud2)
Add support for setting custom JSON metadata on issues via the bd update command:
- Inline JSON: bd update <id> --metadata '{"key":"value"}'
- File reference: bd update <id> --metadata @file.json

Implementation details:
- Add Metadata field to UpdateArgs in RPC protocol
- Validate JSON with json.Valid() before passing to storage
- Parse @file.json syntax to read metadata from files
- Add tests for both inline and file-based metadata input

The metadata field is already included in bd show --json output via the
Issue struct's Metadata field (from PR #1407).

Closes #1413

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:27:10 -08:00
aleiby
c1565805b8
fix(update): use IsValidWithCustom for --type validation (#1356)
bd update --type rejected custom types (agent, role, etc.) because it
called IsValid() which only checks built-in types. Now loads custom
types from config and calls IsValidWithCustom(), matching the pattern
used in the storage layer (PR #1322).

Also fixes the error message to dynamically list valid types from
config instead of hardcoding them.
2026-01-27 11:25:02 -08:00
aleiby
702f686fc0
feat(update): add --append-notes flag (#1304)
* feat(update): add --append-notes flag (bd-b5qu)

Add --append-notes flag that appends to existing notes with a newline
separator instead of overwriting. This prevents data loss in workflows
where multiple steps need to add info to notes (e.g., tackle workflows).

- Errors if both --notes and --append-notes specified
- Handles both daemon and direct mode paths
- Combines existing notes + newline + new content

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

* test(update): add tests for --append-notes flag

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 17:11:25 -08:00
aleiby
16749e6731
feat(bd): add --ephemeral and --persistent flags to bd update (#1263)
Adds --ephemeral and --persistent flags to bd update command.

Author: aleiby
2026-01-22 15:54:04 -08:00
gastown/crew/george
aee86dfae2 fix(types): consolidate enhancement alias and fix update command
- Add "enhancement" to util.issueTypeAliases for consistency
- Make types.IssueType.Normalize() case-insensitive and include all aliases
- Fix update.go to normalize type before validation
- Remove duplicate type validation block in update.go

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:02:51 -08:00
Bob Cotton
025cdac962
feat(completion): add dynamic shell completions for issue IDs (#935)
Add intelligent shell completions that query the database to provide
issue ID suggestions with titles for commands that take IDs as arguments.

Changes:
- Add issueIDCompletion function that queries storage for all issues
- Register completion for show, update, close, edit, defer, undefer, reopen
- Add comprehensive test suite with 3 test cases
- Completions display ID with title as description (ID\tTitle format)

The completion function opens the database (read-only) and filters issues
based on the partially typed prefix, providing a better UX for commands
that require issue IDs.

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

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 18:59:25 -08:00
furiosa
bf378650f4 feat(types): add rig identity bead type (gt-zmznh)
- Add TypeRig constant to IssueType enum
- Update IsValid() method to include TypeRig
- Add UI color (orange) and style for rig type
- Update CLI flag descriptions in create and update commands
- Add Obsidian export tag for rig type
- Add comprehensive test cases for rig and other newer types

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 18:55:45 -08:00
greghughespdx
e212683103
fix(update): add prefix routing like bd show (bd-618f) (#905)
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>
2026-01-05 19:12:02 -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
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
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
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
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
Steve Yegge
9cc385debc feat: Add --claim flag to bd update for work queue semantics (gt-il2p7)
Adds atomic claim operation for work queue messages:

- New --claim flag on bd update command
- Sets assignee to claimer and status to in_progress
- Fails with clear error if already claimed by someone else
- Works in both daemon and direct modes
- Includes comprehensive tests for claim functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:09:34 -08:00
Steve Yegge
a34f189153 Add 'last touched' issue tracking for update/close without ID
When no issue ID is provided to `bd update` or `bd close`, use the last
touched issue from the most recent create, update, show, or close operation.

This addresses the common workflow where you create an issue and then
immediately want to add more details (like changing priority from P2 to P4)
without re-typing the issue ID.

Implementation:
- New file last_touched.go with Get/Set/Clear functions
- Store last touched ID in .beads/last-touched (gitignored)
- Track on create, update, show, and close operations
- Allow update/close with zero args to use last touched

(bd-s2t)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:58:10 -08:00
Steve Yegge
6c14fd2225 refactor: Split large cmd/bd files to meet 800-line limit (bd-xtf5)
Split 6 files exceeding 800 lines by extracting cohesive function groups:

- show.go (1592→578): extracted show_thread.go, close.go, edit.go, update.go
- doctor.go (1295→690): extracted doctor_fix.go, doctor_health.go, doctor_pollution.go
- sync.go (1201→749): extracted sync_git.go
- compact.go (1199→775): extracted compact_tombstone.go, compact_rpc.go
- linear.go (1190→641): extracted linear_sync.go, linear_conflict.go
- main.go (1148→800): extracted main_help.go, main_errors.go, main_daemon.go

All files now under 800-line acceptance criteria.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 18:43:09 -08:00