Commit graph

78 commits

Author SHA1 Message Date
coffeegoddd☕️✨
7e0d09cbf8 /{internal,cmd}: fix CommitPending 2026-05-01 11:15:02 -07:00
matt wilkie
a97eec9739 Add atomic ready claim (GH-3570) 2026-04-28 07:11:13 -07:00
matt wilkie
bb6b8f226b
Fix ready/list UX regressions (#3481)
* fix(ready): honor filter.ExcludeTypes in GetReadyWorkInTx (GH#3397)

The --exclude-type CLI flag was silently ignored by bd ready. The CLI
correctly populated filter.ExcludeTypes, and the type's godoc promised
that values are "Appended to the default exclusion list", but the
no-Type branch of GetReadyWorkInTx built the NOT IN clause from the
hardcoded defaults only.

Merge user-supplied ExcludeTypes into the default exclusion list (with
dedup against defaults and empties) before building the placeholders.
This matches the pattern already used by issueops/filters.go and
dolt/queries.go for bd list.

Fixes GH#3397.

* fix(ready): --parent returns transitive descendants, not direct children only (GH#3396)

The SQL clause in GetReadyWorkInTx's ParentID branch was a one-hop join
against the parent-child dependency table, so only direct children
surfaced. The --parent help text in cmd/bd/ready.go:672 and the
WorkFilter.ParentID godoc (internal/types/types.go:1295) both promise
"descendants (recursive)".

Add a BFS helper GetDescendantIDsInTx alongside GetChildrenOfIssuesInTx
in blocked.go — BFS rather than a recursive CTE because the existing
children helper already iterates across both dependencies and
wisp_dependencies tables, and composing that inside a single CTE gets
ugly. The visited set breaks cycles and a depth cap (default 100,
matching the cycle-detection CTE elsewhere in issueops) guards against
malformed data.

Rewrite the ParentID branch in GetReadyWorkInTx to resolve descendants
via the new helper and OR that with the prior dotted-ID prefix match
(for implicit-parent IDs with no explicit parent-child dep), preserving
the original semantics for dotted IDs.

MoleculeID is deliberately left as one-hop — its inline comment
explicitly scopes it to "direct children" unlike ParentID.

Fixes GH#3396.

* Improve ready and list UX regressions (bd-main-typ)

* fix(list): make --ready flag use blocker-aware GetReadyWork semantics (GH#3478)

bd list --ready previously only filtered by status=open, showing issues
that bd ready correctly excluded as blocked. Now both commands use the
same GetReadyWork path, ensuring consistent results.

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

* Add list ready blocker regression coverage (bd-qo1)

* Fix ready list review regressions

---------

Co-authored-by: Daniel Jasiński <daniel.jasinski@gmail.com>
Co-authored-by: kev <kglynn@pryoninc.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 20:29:30 -07:00
Robin Carswell
34a580c1e9
feat: add --exclude-label flag to bd ready and bd list
Co-authored-by: Robin Carswell <2803445+rjc123@users.noreply.github.com>
2026-04-24 08:17:14 -07:00
Harry
870cb83e37 fix: remove dead rig routing code and unused variable after rebase
openStoreForRig was removed by upstream refactor (d7629204). Remove
the --rig flag and rig routing from runReadyExplain. Also remove
unused 'now' variable in engine.go introduced during conflict
resolution.
2026-03-30 09:23:01 -07:00
Harry
2cd88e9426 fix: address PR review feedback
- Jira: reset body reader at top of retry loop (not just in retriable
  branch) so POST/PUT retries after network errors don't send empty bodies
- GitLab: add useServerDelay pattern matching other clients; skip jitter
  for server-mandated Retry-After delays
- Sanitize: replace custom decodeRune with stdlib utf8.DecodeRuneInString
- Ready --explain: log warnings instead of silently swallowing errors from
  GetDependencyCounts, GetDependencyRecordsForIssues, DetectCycles,
  GetIssuesByIDs
- Linear: fix pagination off-by-one; check page limit before processing
  instead of after, preventing MaxPages+1 fetches
2026-03-30 09:15:55 -07:00
Harry
11d366cf5d tests: add coverage for explain logic, cycle detection, and engine warnings
Extract BuildReadyExplanation into types package as a pure function,
enabling unit tests without Dolt dependency. Add 8 test cases covering:
empty input, ready with/without deps, resolved blockers, parent links,
blocked issues with missing blockers, cycles, and full scenario.

Add 7 Dolt integration tests for cycle detection:
- conditional-blocks cycles (prevented by AddDependency)
- mixed blocks + conditional-blocks cycles
- waits-for intentionally excluded from cycle detection
- self-dependency rejected for all dependency types
- ready work respects conditional-blocks
- blocked issues include blocker details

Add 4 engine tests:
- createDependencies with valid deps
- createDependencies with unresolvable external refs (warns)
- createDependencies with empty input
- warn() collects messages and triggers OnWarning callback

Types package coverage: 89.6% → 91.0%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:15:52 -07:00
Harry
4191643672 Add --explain flag to bd ready for dependency-aware reasoning
bd ready --explain provides a comprehensive view of the dependency graph:
- Ready items with reasoning (resolved blockers, dependency counts)
- Blocked items with detailed blocker info (ID, title, status, priority)
- Cycle detection results
- Aggregate summary stats

Works in both JSON (--json) and human-readable text modes. JSON output
gives agents structured data for graph-aware work prioritization.

No storage layer changes — all data comes from existing GetReadyWork,
GetBlockedIssues, GetDependencyRecordsForIssues, and DetectCycles APIs.

New types: ReadyExplanation, ReadyItem, BlockedItem, BlockerInfo,
ExplainSummary (all in internal/types/types.go).

Fixes: bd-7zt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:13:12 -07:00
beads/crew/emma
d7629204f9 refactor: remove multi-rig routing from beads
Remove the entire multi-rig routing engine (routes.go, route resolution,
prefix-based dispatch) and cross-rig commands (move, refile). All bd
commands now operate on the local rig only.

Deleted: internal/routing/routes.go, cmd/bd/move.go, cmd/bd/refile.go,
and 5 associated test files.

Simplified: routed.go, close.go, create.go, dep.go, gate.go, list.go,
ready.go, promote.go, show.go, show_display.go.

Retained: contributor routing (routing.go, routing_read.go) is unchanged.

Resolves: bd-8hc5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:53:13 -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
beads/crew/emma
affb31496a feat: add --exclude-type flag to bd ready and bd list
Add ExcludeTypes field to WorkFilter and wire it into GetReadyWork query.
Caller-supplied exclusions are appended to the existing hardcoded list
(merge-request, gate, molecule, etc.). When --type is set, --exclude-type
is ignored (explicit inclusion wins).

Supports comma-separated and repeatable flag forms with type alias
normalization (e.g., mr→merge-request).

Co-Authored-By: Julian Knutsen <julianknutsen@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 15:54:54 -07:00
coffeegoddd☕️✨
58915b13e7 /{cmd,internal}: update global store to be interface 2026-03-17 13:26:17 -07:00
Osamu Okano
fc03c6be0b
fix(read): apply contributor routing to list and ready 2026-03-02 20:25:52 +09:00
Joseph Turian
74ffe2303b
feat(ready): add metadata filtering to bd ready (GH#1406)
Add --metadata-field key=value and --has-metadata-key filters to bd ready.
SQL-level JSON_EXTRACT/JSON_UNQUOTE for efficient filtering. Enables agents and
teams to claim work based on metadata tags.

Co-Authored-By: Joseph Turian <turian@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:23:41 -08:00
onyx
d81badd967 fix: include labels, deps, and parent in bd ready --json output (bd-xgso)
bd ready --json was missing the labels field and other fields (dependency
counts, dependencies, parent) that bd list --json includes. This broke
tooling expecting consistent JSON shape across list commands.

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

Executed-By: beads/polecats/onyx
Rig: beads
Role: polecats
2026-02-23 12:51:35 -08:00
beads/crew/wickham
4102096666 refactor: standardize error handling with FatalError wrappers (bd-qioh)
Convert ~250 instances of direct fmt.Fprintf(os.Stderr)+os.Exit(1)
to FatalError/FatalErrorWithHint/FatalErrorRespectJSON across 54 files.

Complex multi-line messages, warnings, loop-internal errors, and
JSON-branching patterns intentionally preserved where the helpers
do not fit cleanly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:27:09 -08:00
Valeriy Pavlovich
2e9d9be5bf
ready: consider closed blockers as satisfied for ready work (#1902) 2026-02-20 09:22:40 -08:00
Adam Spiers
9fb4c65b9b style: fix gofmt alignment in locks.go and ready.go
b81da7a8 and 7eaea49b added new map/struct fields with longer names,
changing the alignment gofmt expects for surrounding entries.
2026-02-17 22:55:54 +00:00
Steve Yegge
886a6e6995
Merge pull request #1788 from sjsyrek/feat/ready-output-defaults
feat(ready): improve default output formatting and discoverability
2026-02-16 21:00:55 -08:00
emma
7eaea49b82 Fix bd ready excluding ephemeral issues, add --include-ephemeral flag
GetReadyWork hardcoded (ephemeral = 0 OR ephemeral IS NULL) which excluded
all ephemeral issues from bd ready results. This broke gastown refinery
merge queue since merge-request beads are created as ephemeral=true.

Add IncludeEphemeral field to WorkFilter and --include-ephemeral CLI flag
so callers can opt in to ephemeral results when needed.

Fixes: bd-i5k5x

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-16 15:33:08 -08:00
Steven Syrek
6155b6cd86 feat(ready): improve default output with pretty format, priority sort, truncation footer, and parent epic context
Default to pretty format (--plain to opt out), sort by priority instead of
hybrid, show "Showing N of M" when results hit the limit, and annotate
issues with their parent epic title when applicable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-16 11:08:46 +01:00
beads/crew/emma
cddddf72e3 refactor: remove all no-op stubs and dead functions (bd-h0zvj.1)
Remove 16 no-op functions and their 48 call sites across 26 files.

Deleted files:
- staleness.go: requireFreshDB(), ensureDatabaseFresh() no-ops
- dolt/dirty_issues.go: ClearDirtyIssuesByID(), SetJSONLFileHash() no-ops
- dolt/multirepo.go: ExportToMultiRepo(), HydrateFromMultiRepo() no-ops

Removed functions:
- clearAutoFlushState() from stubs.go
- checkAndAutoImport(), checkGitForIssues(), importFromGit() from autoimport_stubs.go
- installMergeDriver(), mergeDriverInstalled() from init_git_hooks.go

Removed call sites:
- requireFreshDB(): 17 callers across read commands
- checkAndAutoImport(): 4 callers in query/list/search/ready
- ClearDirtyIssuesByID/SetJSONLFileHash/clearAutoFlushState: export.go
- ExportToMultiRepo/HydrateFromMultiRepo: sync_helpers.go
- checkGitForIssues: init.go prefix auto-detection

Kept dolt/compact.go stubs (CheckEligibility, ApplyCompaction, etc.) as
intentional "not yet implemented" — compaction is a forward-looking feature.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-15 16:26:50 -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
jasper
11235f0d64 feat: resolve cross-database deps via prefix routes in bd show/graph/blocked (bd-k0pfm)
When bd show renders dependencies that reference external databases
(e.g., 'external:gastown:gt-42zaq'), it now follows the prefix routes
in routes.jsonl to locate and query the target database, displaying
the actual issue title, status, and priority instead of silently
dropping them.

The core fix adds resolveExternalDepsViaRouting() which:
1. Gets raw dependency records to find external refs
2. Extracts the issue ID from each external ref
3. Uses routing to look up the issue in the target database
4. Returns resolved IssueWithDependencyMetadata entries

Applied to: bd show (text + JSON), bd show --watch, bd graph, bd blocked.
Unresolvable external deps show as placeholders rather than being dropped.

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

Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats
2026-02-14 11:01:36 -08:00
beads/crew/emma
cee7dcacd9 fix: complete decision type aliases and help strings
Add dec/adr aliases to utils.NormalizeIssueType() so CLI commands
like `bd list --type dec` resolve correctly. Add TypeDecision to
coreWorkTypes so `bd types` lists it. Update remaining help strings
in export, ready, and claude-plugin commands. Add alias test cases.

Co-authored-by: dariye <dariye@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-11 17:23:21 -08:00
beads/crew/emma
44dc4a9fd1 feat: add --rig flag to bd list and bd ready for cross-rig queries
Extends prefix routing to list/ready commands so users can query other
rigs without cd-ing into them (e.g., `bd ready --rig gt`, `bd list --rig hq`).

Closes bd-rgdjr

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:16:07 -08:00
Steve Yegge
6a51223b6f refactor: remove 171 dead if daemonClient != nil branches from 56 files (-3,384 lines)
Since daemonClient is always nil (daemon_deprecated.go stub), every
`if daemonClient != nil` branch was dead code. This removes all 171
occurrences across 56 command files, keeping only the direct storage
(else) branches. Also cleans up unused rpc/json/types imports and
fixes variable shadowing issues left behind.

Part of Dolt transition Phase 2 (dolt-test-woho epic).

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-10 00:23:20 -08:00
beads/crew/lizzy
d182aa0ea1 hygiene: extract requireFreshDB to eliminate staleness boilerplate
The ensureDatabaseFresh + daemonClient nil check + error handling
pattern was duplicated across 16 command files with inconsistent
error handling (some used FatalErrorRespectJSON, others fmt.Fprintf).
Extracted into requireFreshDB() wrapper that standardizes on
FatalErrorRespectJSON for consistent --json support.

Closes dolt-test-7y4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:20:28 -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
matt wilkie
53c1561df1 docs: fix #1523 and #1339/#1337 - ready docs and external-ref
- #1523: Remove false equivalence claim between 'bd ready' and 'bd list --ready'
  - 'bd ready' uses GetReadyWork with blocker-aware semantics
  - 'bd list --ready' only filters by status=open

- #1339, #1337: Document --external-ref flag in CLI_REFERENCE.md
  - Added examples for create and update commands
  - Added section explaining external references
  - Added search pattern for finding by external_ref
2026-02-06 16:11:07 -07:00
beads/crew/emma
ac09cdeb26 fix: standardize JSON output across commands (bd-au0.7)
Ensure all commands use outputJSON() helper and FatalErrorRespectJSON()
for consistent machine-readable output. Fixes: comments, epic, label
list-all, blocked, and status commands.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-05 19:50:48 -08:00
paf0186
4b80094dd5
fix: bd ready now excludes in_progress issues to show only claimable work
* fix: bd ready now excludes in_progress issues

Previously `bd ready` showed both open and in_progress issues, which was
inconsistent with `bd list --ready` (which only shows open issues).

This caused confusion for agents trying to find claimable work - issues
already being worked on would appear in the "ready" list.

Changes:
- `bd ready` now passes Status="open" to GetReadyWork, matching
  `bd list --ready` behavior
- Updated command description to reflect new behavior
- Added test for Status="open" filter behavior
- Clarified GetReadyWork storage layer docstring

The storage layer still supports both behaviors via the filter.Status
field for backwards compatibility with internal callers.

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

* fix: also pass Status filter through RPC path

The initial fix only addressed the direct-mode path. This commit adds
the Status field to ReadyArgs and passes it through the daemon RPC path
so that `bd ready` works correctly in daemon mode as well.

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:23:04 -08:00
beads/crew/emma
774cc5bbd0 feat: add comment_count to issue JSON views (list, ready, search)
Add GetCommentCounts() batch query to all storage backends (SQLite, Dolt,
Memory) and wire it into bd list, bd ready, bd search JSON output and RPC
server responses. Uses single GROUP BY query to avoid N+1.

Based on PR #1354 by bjornslib - cherry-picked the Go backend changes,
fixed bugs, and skipped problematic JSONL/lockfile/MCP changes.

Co-Authored-By: bjornslib <bjornslib@users.noreply.github.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-01-30 22:51:03 -08:00
beads/crew/jane
de64d817e5 fix(storage): use factory for backend-aware storage creation (bd-m2jr)
Multiple code paths were bypassing the storage factory and creating
SQLite databases directly, ignoring sync.mode=dolt-native configuration.
This caused SQLite/JSONL files to be created inappropriately when Dolt
connections failed transiently.

Changes:
- routed.go: Use GetRoutedStorageWithOpener with factory.NewFromConfig
- ship, swarm, move, refile, ready, graph: Replace sqlite.New with factory
- show.go: Use factory + simplify by using Storage interface methods
- doctor/*: Use factory for backend-aware storage creation
- CheckCompactionCandidates: Add backend check + CompactableStorage assertion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 13:12:21 -08:00
dave
6331a9771a feat(mol): add bd ready --gated for gate-resume discovery (bd-lhalq)
Add new command to find molecules where a gate has closed and the workflow
is ready to resume:

- `bd ready --gated` - Flag on existing ready command
- `bd mol ready` - Subcommand for discoverability

The command finds molecules where:
1. A gate bead (type=gate) has been closed
2. The step blocked by that gate is now ready
3. The molecule is not currently hooked by any agent

This enables the Deacon patrol to discover and dispatch gate-ready
molecules without explicit waiter tracking, supporting async molecule
resume workflows.

Includes 5 tests verifying:
- No false positives when no gates exist
- Detection of molecules with closed gates
- Filtering out molecules with open gates
- Filtering out already-hooked molecules
- Handling multiple gate-ready molecules

Part of epic bd-ka761 (Gate-based async molecule resume).

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-08 21:22:17 -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
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
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
Steve Yegge
f3dcafca66 feat: Add mol_type schema field for molecule type classification (bd-oxgi)
Add mol_type field to beads for swarm coordination:
- Values: 'swarm' (multi-polecat), 'patrol' (recurring ops), 'work' (default)
- Nullable, defaults to empty string (treated as 'work')

Changes:
- Add mol_type column to SQLite schema and migration 031
- Add MolType type with IsValid() validation in types.go
- Update insertIssue/GetIssue to handle mol_type
- Add --mol-type flag to create command
- Add mol_type filtering to list and ready commands
- Update RPC protocol for daemon mode support
- Update test schema in migrations_test.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 19:52:51 -08:00
Steve Yegge
f46cc2e798 chore: remove issue ID references from comments and changelogs
Strip (bd-xxx), (gt-xxx) suffixes from code comments and changelog
entries. The descriptions remain meaningful without the ephemeral
issue IDs.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 10:05:16 -08:00
Steve Yegge
1611f16751 refactor: remove unused bd pin/unpin/hook commands (bd-x0zl)
Analysis found these commands are dead code:
- gt never calls `bd pin` - uses `bd update --status=pinned` instead
- Beads.Pin() wrapper exists but is never called
- bd hook functionality duplicated by gt mol status
- Code comment says "pinned field is cosmetic for bd hook visibility"

Removed:
- cmd/bd/pin.go
- cmd/bd/unpin.go
- cmd/bd/hook.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:02:15 -08:00
Steve Yegge
c8b912cbe6 bd sync: 2025-12-27 15:56:42 2025-12-27 15:56:42 -08:00
Aarya Reddy
bd5fc214c3
feat(ready,blocked): Add --parent flag for scoping by epic/bead desce… (#743)
* feat(ready,blocked): Add --parent flag for scoping by epic/bead descendants

Add --parent flag to `bd ready` and `bd blocked` CLI commands and MCP tools
to filter results to all descendants of a specific epic or bead.

## Backward Compatibility

- CLI: New optional --parent flag; existing usage unchanged
- RPC: New `blocked` operation added (was missing); existing operations unchanged
- MCP: New optional `parent` parameter; existing calls work as before
- Storage interface: GetBlockedIssues signature changed to accept WorkFilter
  - All callers updated to pass empty filter for existing behavior
  - Empty WorkFilter{} returns identical results to previous implementation

## Implementation Details

SQLite uses recursive CTE to traverse parent-child hierarchy:

    WITH RECURSIVE descendants AS (
        SELECT issue_id FROM dependencies
        WHERE type = 'parent-child' AND depends_on_id = ?
        UNION ALL
        SELECT d.issue_id FROM dependencies d
        JOIN descendants dt ON d.depends_on_id = dt.issue_id
        WHERE d.type = 'parent-child'
    )
    SELECT issue_id FROM descendants

MemoryStorage implements equivalent recursive traversal with visited-set
cycle protection via collectDescendants helper.

Parent filter composes with existing filters (priority, labels, assignee, etc.)
as an additional WHERE clause - all filters are AND'd together.

## RPC Blocked Support

MCP beads_blocked() existed but daemon client raised NotImplementedError.
Added OpBlocked and handleBlocked to enable daemon RPC path, which was
previously broken. Now both CLI and daemon clients work for blocked queries.

## Changes

- internal/types/types.go: Add ParentID *string to WorkFilter
- internal/storage/sqlite/ready.go: Add recursive CTE for parent filtering
- internal/storage/memory/memory.go: Add getAllDescendants/collectDescendants
- internal/storage/storage.go: Update GetBlockedIssues interface signature
- cmd/bd/ready.go: Add --parent flag to ready and blocked commands
- internal/rpc/protocol.go: Add OpBlocked constant and BlockedArgs type
- internal/rpc/server_issues_epics.go: Add handleBlocked RPC handler
- internal/rpc/client.go: Add Blocked client method
- integrations/beads-mcp/: Add BlockedParams model and parent parameter

## Usage

  bd ready --parent bd-abc              # All ready descendants
  bd ready --parent bd-abc --priority 1 # Combined with other filters
  bd blocked --parent bd-abc            # All blocked descendants

## Testing

Added 4 test cases for parent filtering:
- TestParentIDFilterDescendants: Verifies recursive traversal (grandchildren)
- TestParentIDWithOtherFilters: Verifies composition with priority filter
- TestParentIDWithBlockedDescendants: Verifies blocked issues excluded from ready
- TestParentIDEmptyParent: Verifies empty result for childless parent

* fix: Correct blockedCmd indentation and suppress gosec false positive

- Fix syntax error from incorrect indentation in blockedCmd Run function
- Add nolint:gosec comment for GetBlockedIssues SQL formatting (G201)
  The filterSQL variable contains only parameterized WHERE clauses with
  ? placeholders, not user input
2025-12-25 21:11:58 -08:00
Steve Yegge
8b49d8f079 fix: resolve golangci-lint errors
- Add _ = prefix for ignored Close/Remove return values
- Fix unused cmd parameter in runMoleculeReady
- Add nolint:misspell for intentional British "cancelled" spelling
- Update comments to use US spelling where not intentional

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 05:10:38 -08:00
Steve Yegge
37fd1ce614 feat: add parallel step detection for molecules (bd-xo1o.4)
Add --parallel flag to `bd mol show` that analyzes molecule structure
and identifies which steps can run in parallel. Also add --mol flag to
`bd ready` to list ready steps within a specific molecule.

Features:
- `bd mol show <id> --parallel`: Shows parallel group annotations
- `bd ready --mol <id>`: Lists ready steps with parallel opportunities
- Detects steps at same blocking depth that can parallelize
- Groups steps without mutual blocking deps into parallel groups
- JSON output includes full parallel analysis

Algorithm:
- Build dependency graph from blocking deps (blocks, conditional-blocks)
- Calculate blocking depth (distance from unblocked state)
- Group steps at same depth with no mutual blocking into parallel groups
- Mark steps as ready if open/in_progress with no open blockers

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:57:08 -08:00
Ryan Snodgrass
84b4562fda
Merge upstream/main into subtle-ux-improvements
Resolves conflicts and converts new defer/undefer commands from
fatih/color to the lipgloss semantic color system.

Key changes:
- Added StatusDeferred case in graph.go with ui.RenderAccent
- Converted status.go to use ui package for colorized output
- Converted defer.go/undefer.go to use ui package
- Merged GroupID and Aliases for status command
- Updated pre-commit hook version to 0.31.0
- Ran go mod tidy to remove fatih/color dependency
2025-12-20 17:22:43 -08:00
Ryan Snodgrass
6ca141712c
refactor(ui): standardize on lipgloss semantic color system
Replace all fatih/color usages with internal/ui package that provides:
- Semantic color tokens (Pass, Warn, Fail, Accent, Muted)
- Adaptive light/dark mode support via Lipgloss AdaptiveColor
- Ayu theme colors for consistent, accessible output
- Tufte-inspired data-ink ratio principles

Files migrated: 35 command files in cmd/bd/

Add docs/ui-philosophy.md documenting:
- Semantic token usage guidelines
- Light/dark terminal optimization rationale
- Tufte and perceptual UI/UX theory application
- When to use (and not use) color in CLI output
2025-12-20 17:09:50 -08:00
Steve Yegge
f92a741501 refactor(status): merge stats command into status (GH#644)
Consolidate `bd stats` and `bd status` into a unified command:

- Add `stats` as alias for `status` command
- Add colorized output with emoji header
- Include all Statistics fields (tombstones, pinned, epics, lead time)
- Add `--no-activity` flag to skip git activity parsing
- Remove standalone statsCmd from ready.go (~90 lines)
- Update StatusOutput to use types.Statistics directly

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:14:39 -08:00
Steve Yegge
244ba1471b feat(config): add directory-aware label scoping for monorepos (fixes #541)
Adds automatic label filtering based on current working directory:
- New config option: directory.labels (maps directory patterns to labels)
- bd ready and bd list auto-apply label filtering when in matching directory
- Uses --label-any semantics (shows issues with any of the matching labels)

Config example:
```yaml
directory:
  labels:
    packages/maverick: maverick
    packages/agency: agency
```

When running `bd ready` from `packages/maverick/`, issues labeled
"maverick" are automatically shown first, without needing --label-any.

Closes #541

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:41:09 -08:00
Steve Yegge
c84a2404b7 feat(ready): add --type flag for filtering by issue type (gt-ktf3)
Enables bd ready --type=merge-request for MQ integration.
The Engineer can now query for ready merge-requests.

Files changed:
- cmd/bd/ready.go: Add -t/--type flag
- internal/types/types.go: Add Type field to WorkFilter
- internal/rpc/protocol.go: Add Type to ReadyArgs
- internal/storage/sqlite/ready.go: Filter by issue_type column
2025-12-19 15:09:30 -08:00