-
Notifications
You must be signed in to change notification settings - Fork 783
feat(cli): add bd decision commands #1330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
groblegark
wants to merge
262
commits into
steveyegge:main
Choose a base branch
from
groblegark:decision-pr4-cli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+23,543
−10,652
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Two fixes for Dolt backend stability: 1. **Dolt connection handling** (store.go): Use single connection with USE instead of creating two connections where closing the first affects the second. The Dolt embedded driver shares internal state between connections to the same path. 2. **Create command store lifecycle** (create.go): Remove defer that closes targetStore after assigning it to global store. When routing to a different repo, the global store was being closed before PersistentPostRun's auto-flush, causing "sql: database is closed". 3. **Daemon event-driven mode** (daemon.go, bd-dli): Allow event-driven mode for Dolt backends without JSONL. Dolt uses RPC mutation events and native change tracking instead of JSONL file watching. Additional changes: - autoflush.go: Add debug logging for store state - concurrent_test.go: Fix Merge() return value signature Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement native Dolt sync functions that bypass JSONL entirely: - Add DoltSyncer interface (Commit/Push/Pull methods) - Add createDoltExportFunc for native Dolt commit/push - Add createDoltAutoImportFunc for native Dolt pull - Add createDoltSyncFunc for full Dolt sync cycle - Update daemon to detect Dolt backend and use native sync - Add unit tests for DoltSyncer interface When daemon detects Dolt backend: - Polling mode: uses createDoltSyncFunc instead of JSONL-based sync - Event-driven mode: uses createDoltExportFunc/createDoltAutoImportFunc Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Skip JSONL file watcher setup for Dolt (uses RPC mutations) - Skip import debouncer for Dolt (uses periodic remote sync) - Add Dolt-specific log messages for clarity - Add nil checks for importDebouncer safety Dolt backend now uses a cleaner event loop: - RPC mutation events trigger Dolt commits - Periodic ticker triggers Dolt pull from remote - No wasteful file watcher or fallback ticker Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- feat(formula): add upgrade-beads formula for CLI updates - feat(daemon): add native Dolt sync support (bd-z6d.2) - feat(daemon): optimize event loop for Dolt backend (bd-z6d.3) MR: bd-82ld6 Co-Authored-By: quartz <matthew.baker@pihealth.ai>
Implement Dolt-native mode by detecting the backend type and skipping auto-import and staleness checks when using Dolt as the database backend. Changes: - Add getBackendType() helper to detect backend from metadata.json - Skip auto-import in AutoImportIfNewer() for Dolt backend - Skip staleness check in CheckStaleness() for Dolt (always return false) - Add documentation noting Dolt is source of truth, not JSONL Dolt is a persistent database that doesn't need JSONL import like SQLite. This eliminates false "Database out of sync" errors when using Dolt. Fixes: rig-ebcddd Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
GetRoutedStorageForID was hardcoded to use SQLite for routed storage, which broke bd show for Dolt-backed beads directories. Now uses factory.NewFromConfig to respect the backend type from metadata.json, with SQLite fallback for backwards compatibility. Fixes: bd show failing on gastown9 hq- and rig- prefixed issues Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… auto-detection - Modified defaultSearchPaths() in internal/formula/parser.go to auto-detect town root when GT_ROOT is not set - Modified getFormulaSearchPaths() in cmd/bd/formula.go with same logic - Exported routing.FindTownRoot() for use by formula package - Formula resolution now works from any rig directory without GT_ROOT This fixes issues where witness/refinery/crew agents couldn't find town-level formulas when GT_ROOT was not set in their environment. Fixes: hq-ec1067, hq-8d2d01, hq-3d07b9, hq-bd2c80 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add extensive test coverage for lock and timeout behavior in Dolt storage backend: Bootstrap Lock Tests: - Lock acquisition and release - Blocking behavior with concurrent access - Sequential lock operations - Double release safety - Nil file handling Context Timeout Tests: - Query timeout with context cancellation - Transaction timeout behavior - Commit operation timeout - Context cancellation during operations Transaction Lock Tests: - Transaction serializability - Rollback on error - Long-running transaction behavior - Short transaction contention RWMutex Tests: - Concurrent read operations - Read/write locking behavior File-Based Lock Tests: - Low-level flock operations All 15 tests pass successfully, providing robust validation of lock and timeout handling in the Dolt backend. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Git uses atomic writes with rename() to update config files, so making just the config file read-only doesn't prevent writes. The fix changes the test to make the .git directory read-only instead, which properly causes git config to fail with a permission error. Closes: bd-6qgj Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, ValidateAgentID accepted deduplicated format for witness and refinery roles (e.g., "gt-witness"), but TestValidateAgentID expected these roles to always require an explicit rig name. This change removes the deduplicated format support for rig-level roles, ensuring witness and refinery agent IDs must include an explicit rig: <prefix>-<rig>-witness or <prefix>-<rig>-refinery. Fixes: bd-sp1t Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, ValidateAgentID accepted deduplicated format for witness and refinery roles (e.g., "gt-witness"), but TestValidateAgentID expected these roles to always require an explicit rig name. This change removes the deduplicated format support for rig-level roles, ensuring witness and refinery agent IDs must include an explicit rig: <prefix>-<rig>-witness or <prefix>-<rig>-refinery. Fixes: bd-sp1t Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
fix(validation): require explicit rig for witness and refinery agents
TestFindBeadsRepoRoot was failing in the 'not_in_repo' case because /tmp contained a .beads directory, causing findBeadsRepoRoot to return "/tmp" instead of an empty string. Added isTemporaryDir() check to skip /tmp and /var/tmp as valid repo roots since beads repos should never be rooted there. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements automatic retry for Dolt lock contention to prevent 'database is read only' errors when lock acquisition fails. Changes: - Add LockRetries and LockRetryDelay to Config struct - Implement exponential backoff retry loop in dolt.New() - Add isLockError() helper to detect lock-related errors - Log lock contention for debugging - Pass LockTimeout from factory Options to Dolt Config - Add comprehensive tests for retry behavior Default configuration: - 30 retries with 100ms initial delay - Exponential backoff (doubles each retry) - Total timeout of ~6 seconds Resolves: rig-358fc7 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The three agent routing tests (TestAgentStateWithRouting, TestAgentHeartbeatWithRouting, TestAgentShowWithRouting) were failing because findTownRootFromCWD() was finding the real Gas Town directory instead of the test's temporary directory. Fixed by: 1. Creating mayor/town.json in the test's tmpDir to mark it as a town root 2. Changing working directory to tmpDir before routing operations This ensures routing code correctly resolves routes within the test environment. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Work completed in gastown repository: polecat/pearl/bd-hdzi@mklra1ie Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…teveyegge#1139) The RecordSyncFailure and ResetBackoffOnDaemonStart functions had a TOCTOU (time-of-check-time-of-use) race condition. They called LoadSyncState (which locks, reads, unlocks) then modified the state, then called SaveSyncState (which locks, writes, unlocks). Between LoadSyncState returning and SaveSyncState being called, another goroutine could load the old state, modify it, and save it - then this goroutine's save would overwrite those changes. Fix: Create internal unlocked helper functions (loadSyncStateUnlocked, saveSyncStateUnlocked) and have RecordSyncFailure and ResetBackoffOnDaemonStart hold the lock for the entire load-modify-save operation. Co-authored-by: Steven Syrek <steven.syrek@deepl.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…veyegge#1140) The debouncer's timer callback used a pattern that could cause a double-unlock panic if the action function panicked: d.mu.Lock() defer d.mu.Unlock() if d.seq == currentSeq { d.mu.Unlock() // Manual unlock d.action() // If this panics... d.mu.Lock() // ...this never runs } // ...but defer still tries to unlock Fix: Remove the defer and manually manage lock state. Now if the action panics, the lock is already released, preventing a double-unlock panic that would mask the original panic. Co-authored-by: Steven Syrek <steven.syrek@deepl.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…rts-with matching (steveyegge#1137) When creating issues with explicit IDs like `bd create --id hq-cv-test`, the prefix validation was failing even when `hq-cv` was in `allowed_prefixes`. Root cause: `ExtractIssuePrefix("hq-cv-test")` returns `"hq"` (not `"hq-cv"`) because "test" looks like an English word, causing the algorithm to fall back to the first hyphen. The validation then checked if `"hq"` was in the allowed list containing `"hq-cv"` - which failed. The fix adds `ValidateIDPrefixAllowed()` which validates the full ID using "starts with" matching (the same approach the importer uses successfully). This correctly handles multi-hyphen prefixes like `hq-cv-` regardless of what the suffix looks like. Fixes steveyegge#1135 Co-authored-by: Steven Syrek <steven.syrek@deepl.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Problem: - Diagnostic fix messages were restricted to single lines - Inconsistent file path formatting in database sync issues - Outdated cleanup command suggested in maintenance fixes Solution: - Implement multiline support for doctor fix messages - Standardize issue file paths across database diagnostics - Update maintenance fix instructions to use 'bd admin cleanup' Impact: - Clearer and more accurate recovery instructions for users - Better readability of complex diagnostic output Fixes: GH#1170, GH#1171, GH#1172
…egge#1185) When no git remote is configured, DetectUserRole() now defaults to Maintainer instead of Contributor. This fixes issue routing for: 1. New personal projects (no remote configured yet) 2. Intentionally local-only repositories Previously, issues would silently route to ~/.beads-planning instead of the local .beads/ directory. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…es (steveyegge#1176) The scanIssues() function and multiple SQL queries were not selecting or scanning agent-related fields (hook_bead, role_bead, agent_state, last_activity, role_type, rig, mol_type) and time-based scheduling fields (due_at, defer_until). This caused bd list --json to return null for last_activity even when the database contained valid timestamps, preventing proper agent health monitoring. Updated files: - dependencies.go: scanIssues() variable declarations, scan calls, assignments - queries.go: SearchIssues query - labels.go: GetIssuesByLabel query - ready.go: GetReadyWork and GetNewlyUnblockedByClose queries - transaction.go: GetIssue query, SearchIssues query, scanIssueRow() Fixes steveyegge#1175
…ge#1166) (steveyegge#1168) * fix(config): validate sync-branch at config time Add sync-branch validation to validateYamlConfigValue() to reject main/master at config time, preventing the validation bypass in GH#1166. - Add case for sync-branch and sync.branch keys - Inline validation logic to avoid import cycle (config <-> syncbranch) - Add unit tests for rejection (main/master) and acceptance (valid names) Part of: steveyegge#1166 * fix(sync): add runtime guard for sync-branch == current-branch Add dynamic runtime check before worktree operations to catch cases where sync-branch matches the current branch. This provides defense in depth for manual YAML edits, pre-fix configs, or non-main/master branch names (trunk, develop, production, etc.). - Check IsSyncBranchSameAsCurrent() after hasSyncBranchConfig is set - Position check BEFORE worktree entry (CWD changes inside worktree) - Add integration test TestSync_FailsWhenOnSyncBranch Part of: steveyegge#1166 * docs: note main/master restriction in sync-branch FAQ Clarifies that git worktrees cannot checkout the same branch in multiple locations, so main/master cannot be used as sync branch.
…veyegge#1160) * fix(config): remove duplicate declarations between config.go and sync.go Commit e82e15a created sync.go with typed constants (SyncMode, ConflictStrategy, Sovereignty) but didn't remove the original untyped constants from config.go that were added in 16f8c3d. This caused redeclaration errors preventing the project from building. Changes: - Remove duplicate SyncMode, ConflictStrategy, Sovereignty constants from config.go (keep typed versions in sync.go) - Remove duplicate GetSyncMode, GetConflictStrategy, GetSovereignty functions from config.go (keep sync.go versions with warnings) - Update SyncConfig, ConflictConfig, FederationConfig structs to use typed fields instead of string - Add IsSyncModeValid, IsConflictStrategyValid, IsSovereigntyValid wrapper functions that use sync.go's validation maps - Update cmd/bd/sync.go to use typed ConflictStrategy parameter - Update tests to work with typed constants * fix(dolt): handle Merge return values in concurrent test * fix(test): add --repo flag to show_test.go to bypass auto-routing The tests were failing because the create command was routing issues to ~/.beads-planning instead of the test's temp directory. Adding --repo . overrides auto-routing and creates issues in the test dir.
…eyegge#1158) Fresh clones with sync-branch configured in .beads/config.yaml would show .beads/issues.jsonl as modified in git status because the git index flags (skip-worktree, assume-unchanged) are local-only and don't transfer via clone. This fix ensures bd init sets these flags in two scenarios: 1. `bd init --branch <name>` - when user explicitly sets sync branch 2. `bd init` on cloned repo - when sync-branch already exists in config.yaml Added SetSyncBranchGitignoreFlags() helper and two tests for coverage.
…#1146) The config.yaml file uses "issue-prefix" (with hyphen) but this setting was only read during bd init. After initialization, all code read from the database's "issue_prefix" key, so subsequent changes to config.yaml were silently ignored. This fix adds a fallback to config.yaml's "issue-prefix" in the key locations where the prefix is retrieved from the database: 1. autoflush.go: Auto-import now checks config.yaml before falling back to auto-detection from JSONL or directory name 2. autoflush.go: filterByMultiRepoPrefix now checks config.yaml as fallback 3. create.go: Direct mode prefix validation now checks config.yaml as fallback Priority order is preserved: 1. Database issue_prefix (if set) 2. Config.yaml issue-prefix (new fallback) 3. Auto-detection from JSONL/directory (existing fallback) Fixes steveyegge#1145 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add routing_enabled field to Config (default: true for backwards compat). When set to false: - ResolveBeadsDirForID returns local store without prefix lookup - ResolveBeadsDirForRig returns error (cross-rig requires routing) This allows disabling the multi-database routing infrastructure when using a single consolidated central database. Updated gt11 metadata.json to set routing_enabled: false. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When bd init is run without --backend flag, check the parent config.yaml for storage-backend setting before defaulting to SQLite. This enables new rigs to automatically use dolt when town's config.yaml has storage-backend: dolt. - Move config.Initialize() earlier to enable inheritance check - Add info message when backend is inherited (unless --quiet) Fixes hq-be3912 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Labels are stored in a separate table, so CreateIssue alone doesn't persist them. After creating the gate issue, explicitly add labels using tx.AddLabel within the transaction. This completes the fix from hq-3q571 - labels are now properly persisted when creating decisions via bd decision create. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add documentation for the new routing_enabled config option that allows disabling prefix-based routing for single-database deployments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Dolt implementation of AddLabel and RemoveLabel was not using transactions, causing label changes to not persist. This fix: 1. Wraps label operations in proper transactions with commit 2. Records events when labels change (matching SQLite behavior) 3. Marks issues as dirty for incremental export 4. Adds error logging in decision_respond.go instead of silently discarding errors from label operations Fixes label updates not persisting when responding to decisions (decision:pending → decision:resolved). Part of hq-946577.36 (E2E review of decision implementation). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Dolt implementation of CreateDecisionPoint and UpdateDecisionPoint was not using transactions, causing decision point changes to not persist. This was discovered when iterative refinement created new decision iterations but the decision_point record wasn't being saved. This fix wraps both operations in proper transactions with commit, consistent with how CloseIssue and other write operations work in the Dolt storage layer. Part of hq-946577.36 (E2E review of decision implementation). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When multiple writers access the Dolt database concurrently, serialization conflicts can occur (Error 1213, Error 1105). These errors indicate the transaction should be retried. Changes: - Add isSerializationError() to detect Error 1213 and 1105 - Add retry logic to RunInTransaction with exponential backoff - Max 5 retries with initial 50ms delay, capped at 2s - Add test cases for serialization error detection Fixes: hq-a0ef40 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Systematic audit of Dolt storage layer found additional write operations that were not using proper transaction handling: - dependencies.go: AddDependency, RemoveDependency - events.go: AddComment, ImportIssueComment - config.go: SetConfig, DeleteConfig, SetMetadata All now use BeginTx/Commit pattern, consistent with other Dolt operations. Also added markDirty calls where appropriate for incremental export. Part of hq-946577.36 (E2E review of decision implementation). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test expected routes to be imported during bootstrap, but route importing was intentionally disabled to avoid an import cycle (routing -> factory -> dolt -> routing). Updated TestBootstrapWithRoutesAndInteractions to expect 0 routes, matching the actual implementation behavior documented at bootstrap.go:246-248. Fixes: hq-f4fdd5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When GetNextChildID is called with a non-existent parent ID, the FK constraint on child_counters fails with a confusing error (Error 1452). Now we explicitly check if the parent issue exists before attempting to insert into child_counters, providing a clear error message. Added TestGetNextChildID_ParentNotExists to verify the behavior. Fixes: hq-e6988b Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
External dependencies (e.g., external:project:capability) don't exist in the local issues table. This caused FK violations when: 1. The depends_on_id FK constraint tried to reference a non-existent row 2. markDirty tried to insert the external ref into dirty_issues Changes: - Remove FK constraint on depends_on_id in schema - Add migration to drop existing FK constraint - Skip markDirty for external references (prefix: external:) - Add test for external dependency creation Fixes: bd-3q6.6-1 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate test function declarations in config_test.go (TestGetCustomTypesFromYAML, TestGetFieldStrategies, etc. were duplicated) - Add explicit string() casts for SyncMode, ConflictStrategy, and Sovereignty constants used in test structs - Add missing GetEpicProgress method to mockStorage in storage_test.go Note: Some config tests fail due to local .beads/config.yaml setting sync.mode=dolt-native, overriding the expected default. This is a pre-existing test isolation issue, not introduced by this fix. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests checking default values were failing when run in directories with .beads/config.yaml files that override defaults. Fixes: - TestSyncConfigDefaults: add t.Chdir(t.TempDir()) for isolation - TestGetSyncMode: add t.Chdir(t.TempDir()) for isolation - TestGetSovereigntyInvalid: add isolation + fix expectation (invalid sovereignty should return T1, not empty string) Closes: hq-ff52bd Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add proper BeginTx/Commit transaction handling to: - dirty.go: ClearDirtyIssuesByID, SetExportHash, ClearAllExportHashes - credentials.go: AddFederationPeer, RemoveFederationPeer, UpdatePeerLastSync - federation.go: setLastSyncTime These functions were using s.db.ExecContext() without transactions, which can cause changes to not persist in Dolt's MySQL-compatible mode. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bd decision create now requires the --options flag with at least one option. Previously, decisions could be created without options, which resulted in malformed decisions that couldn't be resolved through the TUI or gt decision commands. Validation added: - Error if --options flag is missing - Error if options array is empty after parsing - Helpful example shown in error messages Closes: hq-5f80e6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Upstream changes: - gitignore export-state directory - formula dev build handling in local-install - Go 1.24 in CI release workflow - Version bump to 0.49.1 - Various Dolt and daemon fixes - bd list --json optimization - activity --details flag - import custom issue types support - list watch mode nil pointer fix Conflicts resolved: - .gitignore: kept Gas Town paths (.beads/, .logs/) - version.go: kept our 0.50.0 version - transaction.go: kept our ID generation fix (hq-8af330.10), added PrefixOverride support from upstream Test fixes: - direct_mode_test.go: fixed metadata.json database name mismatch - validators_test.go: adjusted test for Gas Town built-in types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix 42 lint issues to pass CI: - errcheck: Add explicit error handling for json.Unmarshal, conn.Write, SetDeadline, server.Shutdown, gateway.close, json.Encoder.Encode, etc. - misspell: Use American spelling "canceled" instead of "cancelled" (keep "cancelled" in JSON tags for API compatibility with nolint) - gosec G304: Add nolint comments for trusted file path operations - gosec G204: Add nolint comments for intentional subprocess commands - gosec G202: Add nolint comments for safe SQL placeholder concatenation - gosec G306: Add nolint comments for skill files that need to be readable - unparam: Add nolint comments for interface consistency and future use Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates bd decision check --inject to use injection queue instead of direct stdout. This prevents API 400 concurrency errors when the UserPromptSubmit hook runs while Claude is mid-tool-use. The inject queue is shared with gastown's gt inject command: - bd decision check --inject queues content to .runtime/inject-queue/ - gt inject drain outputs the queued content from PostToolUse hook Fixes: gt-ukf Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Dolt commit operation can fail with "optimistic lock failed on database Root update" errors when multiple writers try to commit simultaneously. This is a transient error that can be resolved by retrying with exponential backoff. Changes: - Add isSerializationError() to detect Dolt optimistic lock failures (Error 1105, Error 1213, "optimistic lock failed") - Update isTransientDoltError() to include serialization errors - Add retry logic to DoltStore.Commit() with exponential backoff - Store lockRetries and lockRetryDelay in DoltStore struct - Add comprehensive tests for serialization error detection This fix resolves intermittent failures in commands like `gt decision request` and `gt sling` that depend on reliable Dolt commits. Fixes: hq-jkr56x Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The isSerializationError function was incorrectly matching "Error 1105: nothing to commit" as a serialization error, causing infinite retries when there was genuinely nothing to commit. Changes: - Add explicit check to exclude "nothing to commit" and "no changes" from serialization error detection - Add comprehensive tests for commit retry behavior - Add TestConcurrentCommits integration test - Add TestCommitRetryConfig and TestCommitRetryDefaults tests - Add test cases for "nothing to commit" error exclusion This fix ensures that the retry logic only triggers for actual optimistic lock failures, not for benign "nothing to commit" situations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add text utilities for smart truncation of long text content: - TruncateLines: show beginning and end with "..." in middle - TruncateChars: smart word-boundary truncation - TruncateSimple: basic end truncation with "..." - WrapText: word-wrap aware line wrapping Update bd show command: - Add --full/-f flag to show complete text without truncation - Default to smart truncation for description, design, notes, and acceptance criteria fields when they exceed 15 lines Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 47e9adb.
Previously, RenderMarkdown returned raw text without word wrapping when running in agent mode (CLAUDE_CODE env set). This caused long lines to go off the edge of the screen. Now text is always wrapped at terminal width (max 100 chars), even in agent mode - just without glamour styling. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The inline post-merge hook created by `bd init` was using `bd import -i` which can fail in various scenarios. Changed to use the more robust `bd sync --import-only --no-git-history --no-daemon` which: - Forces direct mode properly - Handles store initialization - Has more robust error handling Also removed duplicate Dolt backend check. Fixes: hq-bokgaz Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
FindJSONLInDir was incorrectly picking routes.jsonl as the JSONL target when issues.jsonl didn't exist. This caused the bd export to write issue data to routes.jsonl, corrupting the route definitions. The bug manifested when: 1. A .beads directory had only routes.jsonl (no issues.jsonl) 2. FindJSONLInDir glob matched routes.jsonl 3. The fallback logic returned routes.jsonl as the export target 4. Issue data was written over route definitions Fix: Add routes.jsonl to the skip list alongside deletions.jsonl, interactions.jsonl, and merge artifacts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: gastown/crew/upstream_merger Rig: gastown Role: crew
Add comprehensive documentation for the decision points feature: - Create docs/DECISIONS.md with full feature documentation - Add feature bullet to README.md - Add Decision Points section to CLI_REFERENCE.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: gastown/crew/upstream_merger Rig: gastown Role: crew
Add foundation types and storage support for decision points - human-in-the-loop gates that enable structured input during agent workflows. Types: - DecisionPoint: human-in-the-loop decision gate with iteration support - DecisionOption: structured option with ID, short label, and description Storage interface: - CreateDecisionPoint, GetDecisionPoint, UpdateDecisionPoint, ListPendingDecisions - Added to both Storage and Transaction interfaces SQLite implementation: - decision_points table with FK to issues, iteration chain via prior_id - Migration 041 creates table, 046 adds requested_by column - Full CRUD support in both storage.go and transaction.go Dolt/Memory stubs: - Added placeholder implementations returning "not implemented" errors - Full Dolt support planned for separate PR Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: gastown/crew/upstream_merger Rig: gastown Role: crew
Add RPC protocol and handlers for decision point operations: - OpDecisionCreate, OpDecisionGet, OpDecisionResolve, OpDecisionList - Request/response types for all operations - Handler implementations in server_issues_epics.go - Routing registration in server_routing_validation_diagnostics.go This enables the daemon to handle decision point CRUD operations for human-in-the-loop gates in agent workflows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: gastown/crew/upstream_merger Rig: gastown Role: crew
d0d0504 to
a63983e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Depends on: #1327 (Types & Storage), #1328 (RPC & Protocol), #1329 (Config & Hooks)
Details
This PR adds the CLI interface for decision points.
CLI Commands (cmd/bd/):
Iteration Logic (internal/decision/):
Hook Updates (internal/hooks/hooks.go):
Documentation:
Test plan