Commit Graph

2410 Commits

Author SHA1 Message Date
Steve Yegge
724db3f1b6 Merge pull request #374 from steveyegge/dependabot/go_modules/github.com/tetratelabs/wazero-1.10.1
Bump github.com/tetratelabs/wazero from 1.10.0 to 1.10.1
2025-11-24 16:11:00 -08:00
Steve Yegge
256ae5dae7 Merge pull request #373 from steveyegge/dependabot/go_modules/github.com/anthropics/anthropic-sdk-go-1.18.1
Bump github.com/anthropics/anthropic-sdk-go from 1.18.0 to 1.18.1
2025-11-24 16:10:56 -08:00
Steve Yegge
3ca7062954 Merge pull request #372 from steveyegge/dependabot/github_actions/actions/checkout-6
Bump actions/checkout from 4 to 6
2025-11-24 16:10:51 -08:00
Steve Yegge
95f68f7cf6 bd sync: 2025-11-24 15:46:47 2025-11-24 15:46:47 -08:00
Steve Yegge
fe4603a7a1 bd sync: 2025-11-24 14:03:20 2025-11-24 14:03:20 -08:00
Steve Yegge
a8d7d6575c Fix blocked cache invalidation in transaction operations (bd-1c4h)
Transaction operations weren't invalidating the blocked_issues_cache,
causing GetReadyWork to return stale results after transactional changes.

Changes:
- Refactor invalidateBlockedCache to accept execer interface (supports
  both *sql.Tx and *sql.Conn)
- Add cache invalidation in transaction.go for:
  - UpdateIssue (when status changes)
  - CloseIssue (always - closed issues don't block
  - AddDependency (for DepBlocks/DepParentChild types)
  - RemoveDependency (queries type before deletion)

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

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)
2025-11-24 14:03:11 -08:00
dependabot[bot]
8fdb49349f Bump github.com/tetratelabs/wazero from 1.10.0 to 1.10.1
Bumps [github.com/tetratelabs/wazero](https://github.com/tetratelabs/wazero) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/tetratelabs/wazero/releases)
- [Commits](https://github.com/tetratelabs/wazero/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: github.com/tetratelabs/wazero
  dependency-version: 1.10.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 20:52:30 +00:00
dependabot[bot]
0a379728ff Bump github.com/anthropics/anthropic-sdk-go from 1.18.0 to 1.18.1
Bumps [github.com/anthropics/anthropic-sdk-go](https://github.com/anthropics/anthropic-sdk-go) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/anthropics/anthropic-sdk-go/releases)
- [Changelog](https://github.com/anthropics/anthropic-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/anthropics/anthropic-sdk-go/compare/v1.18.0...v1.18.1)

---
updated-dependencies:
- dependency-name: github.com/anthropics/anthropic-sdk-go
  dependency-version: 1.18.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 20:52:24 +00:00
dependabot[bot]
f6934ca68f Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 20:51:18 +00:00
Steve Yegge
0acd9d0a5d bd sync: 2025-11-24 12:25:34 2025-11-24 12:25:35 -08:00
Steve Yegge
d66593f8a5 bd sync: 2025-11-24 11:38:13 2025-11-24 11:38:13 -08:00
Steve Yegge
e9da1a420b bd sync: 2025-11-24 11:28:32 2025-11-24 11:28:32 -08:00
Steve Yegge
63f096c3d1 bd sync: 2025-11-24 10:56:35 2025-11-24 10:56:35 -08:00
Steve Yegge
4b2bd9f6d3 bd sync: apply DB changes after import 2025-11-24 10:56:21 -08:00
Steve Yegge
9733faa833 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 10:56:21 -08:00
Steve Yegge
5f310bc7c2 Add tip system infrastructure (bd-d4i)
Implements a smart contextual hint system that shows helpful messages
to users after successful commands. Tips are filtered by conditions,
priority, frequency limits, and probability rolls to provide useful
information without being annoying.

Core Features:
- Tip struct with condition, message, frequency, priority, probability
- selectNextTip() filters eligible tips and applies probability
- Metadata storage tracks when tips were last shown
- Respects --json and --quiet flags
- Deterministic testing via BEADS_TIP_SEED env var

Integration Points:
- bd list: Shows tip after listing issues
- bd ready: Shows tip after showing ready work (or no work)
- bd create: Shows tip after creating issue
- bd show: Shows tip after showing issue details

Testing:
- Unit tests for tip selection logic
- Tests for frequency limits and probability
- Tests for metadata tracking
- Example tip definitions for documentation

Next Steps:
- bd-81a: Add programmatic tip injection API
- bd-tne: Add Claude setup tip with dynamic priority

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 10:56:14 -08:00
Steve Yegge
ea4b7e94c7 bd sync: apply DB changes after import 2025-11-24 10:39:30 -08:00
Steve Yegge
a2e2c87cfd Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 10:39:29 -08:00
Steve Yegge
4a2ee066f8 bd sync: 2025-11-24 10:39:28 2025-11-24 10:39:28 -08:00
Steve Yegge
22ba6ae4a7 bd sync: apply DB changes after import 2025-11-24 10:38:11 -08:00
Steve Yegge
92958d0b93 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 10:38:11 -08:00
Steve Yegge
d3face3f86 bd sync: 2025-11-24 10:38:10 2025-11-24 10:38:10 -08:00
Steve Yegge
d05953df14 bd sync: 2025-11-24 10:33:02 2025-11-24 10:33:02 -08:00
Steve Yegge
30dfb247dc Fix bd-l0r: Skip export after ZFC import to preserve JSONL source of truth
## Problem
When bd sync detected stale DB (>50% divergence), it would import JSONL to fix the DB,
but then immediately export the DB back to JSONL. This caused the stale DB to overwrite
the JSONL after a git pull, undoing cleanup work.

Example scenario:
1. Clone has 688 stale issues in DB (628 closed)
2. git pull brings JSONL with 62 issues (cleanup applied)
3. bd sync detects 1009.7% divergence and imports JSONL (DB → 62 issues) ✓
4. bd sync exports DB to JSONL (JSONL still 62 issues) ✓
5. But this marks JSONL as "changed" and commits/pushes it ✗

## Solution
After ZFC (JSONL First Consistency) import, set skipExport flag to prevent the export step.
JSONL is the source of truth after import - DB should sync to match, not export back.

## Changes
- cmd/bd/sync.go: Add skipExport flag, set it after ZFC import
- cmd/bd/sync.go: Wrap export logic in `if !skipExport` block
- CHANGELOG.md: Update ZFC entry with accurate description
- cmd/bd/sync_test.go: Add TestZFCSkipsExportAfterImport

Fixes #bd-l0r

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 10:32:56 -08:00
Steve Yegge
d1eb9f4e06 bd sync: apply DB changes after import 2025-11-24 01:40:52 -08:00
Steve Yegge
b6f37169c9 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 01:40:51 -08:00
Steve Yegge
6986cd4ab0 bd sync: 2025-11-24 01:40:51 2025-11-24 01:40:51 -08:00
Steve Yegge
515a31f270 bd sync: apply DB changes after import 2025-11-24 01:37:03 -08:00
Steve Yegge
31e3a41942 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 01:37:03 -08:00
Steve Yegge
2cea04500c bd sync: 2025-11-24 01:37:02 2025-11-24 01:37:02 -08:00
Steve Yegge
a1191f0b4c bd sync: 2025-11-24 01:31:04 2025-11-24 01:31:04 -08:00
Steve Yegge
dcd7877d77 Close bd-9cdc: Documentation already complete
Documentation for import.orphan_handling was completed in commit e0e6dff.
All files (AGENTS.md, README.md, TROUBLESHOOTING.md, CLI_REFERENCE.md)
have comprehensive coverage of:
- Resurrection behavior and tombstones
- All 4 config modes (allow, resurrect, skip, strict)
- Troubleshooting guidance for missing parent errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 01:30:53 -08:00
Steve Yegge
d4205648ce bd sync: apply DB changes after import 2025-11-24 01:25:22 -08:00
Steve Yegge
0d86e2e2cf Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 01:25:22 -08:00
Steve Yegge
a833ba751e bd sync: 2025-11-24 01:25:21 2025-11-24 01:25:21 -08:00
Steve Yegge
196ce3a6f9 Fix bd-77gm: bd import silently ignores positional arguments
When users forget the -i flag and run 'bd import file.jsonl', the command
would silently read from stdin instead of the file, resulting in '0 created,
0 updated' output that was misleading.

Root cause: The import command doesn't validate positional arguments, so
'bd import file.jsonl' would be interpreted as 'bd import' with an ignored
argument, reading empty stdin.

Fix: Add validation at the start of the import command to detect positional
arguments and show a helpful error message with the correct syntax.

Closes bd-77gm
2025-11-24 01:25:09 -08:00
Steve Yegge
e21c7b1a25 bd sync: 2025-11-24 01:19:15 2025-11-24 01:19:15 -08:00
Steve Yegge
21954cf590 bd sync: apply DB changes after import 2025-11-24 01:17:35 -08:00
Steve Yegge
965a873558 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 01:17:35 -08:00
Steve Yegge
7abb870a57 bd sync: 2025-11-24 01:17:34 2025-11-24 01:17:34 -08:00
Steve Yegge
3c7aac1778 bd sync: apply DB changes after import 2025-11-24 01:14:33 -08:00
Steve Yegge
f4e5c17cea Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 01:14:33 -08:00
Steve Yegge
9a4487b0bc bd sync: 2025-11-24 01:14:32 2025-11-24 01:14:32 -08:00
Steve Yegge
fcd6ca694e Document blocked_issues_cache architecture and behavior
Add comprehensive documentation for the blocked_issues_cache optimization
that improved GetReadyWork performance from 752ms to 29ms (25x speedup).

Documentation locations:
- blocked_cache.go: Detailed package comment covering architecture,
  invalidation strategy, transaction safety, edge cases, and future
  optimizations
- ready.go: Enhanced comment at query site explaining the optimization
  and maintenance triggers
- ARCHITECTURE.md: New section with diagrams, blocking semantics,
  performance characteristics, and testing instructions

Closes bd-1w6i

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 01:14:21 -08:00
Steve Yegge
a02995bae1 bd sync: 2025-11-24 01:12:43 2025-11-24 01:12:43 -08:00
Steve Yegge
78847147e1 Support --reason flag in daemon mode for reopen command (bd-r46)
The reopen command now properly adds the reason as a comment when
using daemon mode, matching the behavior of direct mode. Uses the
existing RPC AddComment operation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 01:12:33 -08:00
Steve Yegge
88009830ee bd sync: 2025-11-24 01:10:27 2025-11-24 01:10:27 -08:00
Steve Yegge
125d02860c Implement transaction retry logic for SQLITE_BUSY (bd-ola6)
Add exponential backoff retry for BEGIN IMMEDIATE transactions to handle
concurrent write load without spurious failures.

Changes:
- Add IsBusyError() helper to detect database locked errors
- Add beginImmediateWithRetry() with exponential backoff (10ms, 20ms, 40ms, 80ms, 160ms)
- Update CreateIssue and CreateIssuesInBatch to use retry logic
- Add comprehensive tests for error detection and retry behavior
- Handles context cancellation between retry attempts
- Fails fast on non-busy errors

This eliminates spurious SQLITE_BUSY failures under normal concurrent usage
while maintaining proper error handling for other failure modes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 01:10:16 -08:00
Steve Yegge
a8919fde9f bd sync: apply DB changes after import 2025-11-24 01:08:26 -08:00
Steve Yegge
ab27064d28 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-24 01:08:25 -08:00