Commit graph

12 commits

Author SHA1 Message Date
matt wilkie
f03d4e7fac
feat(issues): add started_at timestamp (GH#2796) (#3206)
* fix: enable auto-export by default with canonical issues.jsonl name (GH#2973)

Users expected JSONL export to refresh automatically but export.auto
defaulted to false, requiring explicit opt-in. Also the default filename
(export.jsonl) didn't match the canonical issues.jsonl used in docs and
git hooks. Change defaults: export.auto=true, export.path=issues.jsonl,
export.git-add=true so viewers (bv) and git workflows see fresh data
without extra configuration.

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

* feat(init): add auto-export prompt and document export.* config (GH#2973)

Interactive bd init now asks whether to enable auto-export (default: yes).
Users can opt out during setup instead of discovering the setting later.

Also documents the export.* config namespace in bd config --help with
all four keys (export.auto, export.path, export.interval, export.git-add)
and adds export examples.

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

* feat(issues): add started_at timestamp (GH#2796)

Adds a `started_at` field to issues that is auto-populated when an
issue transitions to in_progress status. Preserved across subsequent
status changes.

- Migration 0027 adds started_at column to issues and wisps tables
- ManageStartedAt() in issueops mirrors ManageClosedAt() pattern
- Query filter support: `started>2026-01-01`, `started<...`
- Displayed in `bd show` between Created and Updated
- Exposed in --json output via struct tag

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

* fix: gofmt alignment in update.go and types.go

Amp-Thread-ID: https://ampcode.com/threads/T-019d887d-4eb1-7648-96be-8d906797c382
Co-authored-by: Amp <amp@ampcode.com>

* fix(claim): set started_at when claiming via --claim (GH#2796)

ClaimIssueInTx had its own bespoke UPDATE that only wrote assignee, status,
and updated_at. Since `bd update --claim` is the canonical way agents transition
issues to in_progress, started_at was left NULL in the common case. Set it on
first transition, mirroring ManageStartedAt's guard (preserve existing value on
re-claim).

Also document the `started` field in `bd query --help`.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Amp <amp@ampcode.com>
2026-04-14 09:24:08 -07:00
Joseph Turian
0af9580a35 docs: clarify --status flag vs bd blocked for dependency blocking (BUG-4)
The --status flag filters by the stored status column, but dependency-
blocked issues keep status "open" — they only appear via 'bd blocked'.
The old help text listed "blocked" without explaining this distinction,
leading users to expect 'bd list --status blocked' to find dependency-
blocked issues.

Updated help text for list, count, search, and query to say "stored
status" and point to 'bd blocked' for dependency-blocked issues.

Adds TestBUG4_BlockedStatusVsBlocked protocol test documenting the
distinction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:48:27 -05: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
obsidian
304c6846e1 fix: gofmt formatting across 24 files and 2 lint warnings (bd-i4o4e)
Run make fmt to fix all gofmt issues. Add nolint directives for:
- G204 (gosec) in cmd/bd/stubs.go: git args are internal, not user-supplied
- unparam in internal/syncbranch/worktree.go: error return kept for callers

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

Executed-By: beads/polecats/obsidian
Rig: beads
Role: polecats
2026-02-16 01:17:23 -08: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
beads/crew/emma
db1c3d773c style: fix gofmt formatting across 14 files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 18:27:40 -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
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
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
Patrick Farrell
f3874edee0 feat: add simple query language for complex filtering
Adds a new `bd query` command that enables complex filtering with a simple
query language supporting boolean operators, comparisons, and date-relative
expressions.

Features:
- Field comparisons: status=open, priority>1, updated>7d
- Boolean operators: AND, OR, NOT (case-insensitive)
- Parentheses for grouping: (status=open OR status=blocked) AND priority<2
- Date-relative expressions: 7d, 24h, 2w (interpreted as "X ago")
- Supports all IssueFilter fields: status, priority, type, assignee, label,
  title, description, notes, created, updated, closed, id, spec, pinned,
  ephemeral, template, parent, mol_type

Implementation:
- New internal/query package with lexer, parser, and evaluator
- Simple AND queries converted directly to IssueFilter for SQL efficiency
- Complex OR queries use predicate functions for in-memory filtering
- Comprehensive test coverage (62 tests)

Examples:
  bd query "status=open AND priority>1"
  bd query "(status=open OR status=blocked) AND updated>7d"
  bd query "NOT status=closed AND type=bug"
  bd query "label=urgent OR label=critical"

Closes: bd-o9g

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:57:40 +00:00