Commit Graph

2102 Commits

Author SHA1 Message Date
Steve Yegge
012bed1068 Fix GH#367: bd import defaulting to stdin is confusing
Changes:
1. Add TTY detection to bd import - prevents silent hang when run
   interactively without arguments. Shows helpful usage message instead.
2. Fix misleading error messages - change "Run 'bd import'" to
   "Run 'bd sync --import-only'" or explicit file path throughout.

Technical details:
- Added golang.org/x/term dependency for IsTerminal()
- When stdin is a TTY and no -i flag: show usage and exit
- When stdin is piped: works as before (supports script pipelines)
- Preserved all legitimate stdin uses:
  * python gh2jsonl.py --repo owner/repo | bd import
  * python md2jsonl.py feature.md | bd import
  * git show HEAD:.beads/beads.jsonl | bd import -i /dev/stdin

Updated error messages in:
- cmd/bd/staleness.go - main "out of sync" error
- cmd/bd/sync.go - merge completion suggestions
- internal/rpc/server_export_import_auto.go - daemon warnings

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 11:15:34 -08:00
Steve Yegge
5b77ddb215 Fix TestAddCommentUpdatesTimestamp timing flake on Windows
The test was failing on Windows CI because of insufficient time resolution
between creating an issue and adding a comment. Both operations could
complete within the same time unit, causing identical timestamps.

Added a 2ms sleep between operations to ensure updated_at is strictly
after the original timestamp, even on systems with lower time resolution.

Fixes: bd-pi7u

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:57:29 -08:00
matt wilkie
c50695b3d4 Monitor Web UI fixes and updates
Fixes status filter bug, adds multi-select priority filter, find-as-you-type search, and interactive stats cards. Includes visual improvements for hover effects and alignment.

Co-authored-by: maphew <matt.wilkie@yukon.ca>
2025-11-23 10:32:22 -08:00
Steve Yegge
12f839369c bd sync: 2025-11-22 18:34:53 2025-11-22 18:34:53 -08:00
Steve Yegge
031bd96a52 Merge fix/sync-branch-env-var: Respect BEADS_SYNC_BRANCH env var 2025-11-22 18:17:32 -08:00
Steve Yegge
0dc8452c56 feat: Respect BEADS_SYNC_BRANCH environment variable
Fixes daemon and bd sync to honor BEADS_SYNC_BRANCH environment variable
as documented in PROTECTED_BRANCHES.md for CI/CD temporary overrides.

Changes:
- Updated internal/syncbranch.Get() to prioritize env var over DB config
- Both daemon sync and bd sync CLI now use syncbranch.Get()
- Added comprehensive tests for env var override behavior
- Validates branch names using git-style rules

This enables CI/CD workflows to override sync branch per-job without
mutating database config.

Based on PR #364 by Charles P. Cross <cpdata@users.noreply.github.com>
Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
2025-11-22 18:17:19 -08:00
Steve Yegge
72aa0d1097 bd sync: 2025-11-22 17:48:56 2025-11-22 17:48:57 -08:00
Charles P. Cross
ea7b39e40b Fix: Use dynamic JSONL path in daemon sync branch operations (#361)
Fixes #359

The daemon's sync branch logic was hardcoding the JSONL path to .beads/beads.jsonl, ignoring the dynamic discovery logic used elsewhere. This caused sync failures in repositories where the JSONL file has a different name (e.g., beads.base.jsonl, issues.jsonl).

Changes:
- Updated cmd/bd/daemon_sync_branch.go to use findJSONLPath() instead of hardcoded path
- Implemented relative path calculation for correct worktree placement
- Applied fix to both push (sync to worktree) and pull (sync from worktree) operations

This works together with PR #360 to fix team/protected branch sync issues.

Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
2025-11-22 16:57:39 -08:00
Charles P. Cross
9a2345f706 Fix: Daemon respects auto-commit/auto-push DB config (#360)
Fixes #358

The daemon was ignoring daemon.auto_commit and daemon.auto_push configuration values stored in the database unless the corresponding CLI flags were explicitly provided. This prevented bd init --team configuration from working as expected.

Changes:
- Modified cmd/bd/daemon.go to check database config when flags are not explicitly set
- Uses beads.FindDatabasePath() to locate the database and sqlite.New() to read config
- Only applies when starting daemon (skips for --stop, --status, --health, etc.)

Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
2025-11-22 16:57:23 -08:00
Steve Yegge
9209725c82 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-22 16:49:54 -08:00
Steve Yegge
3effab3714 bd sync: 2025-11-22 16:49:53 2025-11-22 16:49:53 -08:00
cerebustech-dev
3aeca3413a fix: skip /etc/passwd check on Windows in security test (#363)
Fixes #362

The test TestCleanupMergeArtifacts_CommandInjectionPrevention was failing on Windows because it checks for /etc/passwd, which is a Unix-specific file that doesn't exist on Windows.

Added runtime.GOOS check to skip the /etc/passwd verification on Windows while maintaining the security check on Unix systems.
2025-11-22 16:49:29 -08:00
Steve Yegge
599c40c703 Fix Windows and Nix test failures
Windows test fixes (bd-web8):
- Add sanitizeMetadataKey() to replace colons with underscores
- Windows absolute paths (e.g., C:\...) contain colons that conflict with
  metadata key separator ':'
- Update tests to use sanitized keys when checking metadata
- Tests now pass on Windows by auto-sanitizing path-based keys

Nix flake fixes (bd-8y1a):
- Update vendorHash in default.nix to match current Go module dependencies
- Hash mismatch was causing Nix build failures in CI

Test improvements:
- Rename TestUpdateExportMetadataInvalidKeySuffix to reflect new behavior
- Test now verifies sanitization instead of rejection
- All tests pass locally

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 10:59:40 -08:00
Steve Yegge
b409870ce5 Fix linter issues and test failures
- Fix spelling: cancelled → canceled, cancelling → canceling
- Remove unused error return from performFlush() function
- Check cmd.Help() error return in search.go
- Fix file permissions in gitignore.go (0644 → 0600)
- Update tests to match performFlush signature change
- Remove unused os import from flush_manager.go
2025-11-22 00:11:45 -08:00
Steve Yegge
7009acb169 chore: Bump version to 0.24.2
Updated all component versions:
- bd CLI: 0.24.1 → 0.24.2
- Plugin: 0.24.1 → 0.24.2
- MCP server: 0.24.1 → 0.24.2
- npm package: 0.24.1 → 0.24.2
- Documentation: 0.24.1 → 0.24.2

Generated by scripts/bump-version.sh
2025-11-22 00:06:13 -08:00
Steve Yegge
a6fb23596b docs: Add v0.24.2 changelog entry
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 00:06:10 -08:00
Steve Yegge
09e094ab52 bd sync: 2025-11-22 00:02:18 2025-11-22 00:02:18 -08:00
Steve Yegge
84097185f1 bd sync: 2025-11-21 23:58:45 2025-11-21 23:58:45 -08:00
Steve Yegge
d918e479b7 Remove stale issues.jsonl (repo configured to use beads.jsonl)
This repo explicitly configures beads.jsonl in metadata.json due to git
history reasons. The issues.jsonl file was stale (102 issues vs 622 in
beads.jsonl) and not being used.

bd doctor correctly detected this as a problem - having multiple JSONL
files can cause sync and merge conflicts.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 23:47:22 -08:00
Steve Yegge
87ee3a674e Improve bd doctor JSONL checks to focus on real problems
Previously bd doctor warned about using beads.jsonl vs issues.jsonl, but
users should be free to configure any name they want. The real problems are:
1. Having multiple JSONL files (sync/merge conflicts)
2. Configuration not matching reality

Changes:
- Rewrote CheckLegacyJSONLFilename to scan for ALL .jsonl files
- Now filters out merge artifacts (backup, .orig, .bak, etc.)
- Warns only when multiple real JSONL files exist
- Added CheckDatabaseConfig to detect when configured paths do not match
  what actually exists on disk
- Updated tests to verify backup files are ignored
- Added test cases for custom JSONL filenames

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 23:44:26 -08:00
Steve Yegge
c4c5c8063a Fix: Change default JSONL filename from beads.jsonl to issues.jsonl
The canonical beads database name is issues.jsonl. Tens of thousands of users
have issues.jsonl, and beads.jsonl was only used by the Beads project itself
due to git history pollution.

Changes:
- Updated bd doctor to warn about beads.jsonl instead of issues.jsonl
- Changed default config from beads.jsonl to issues.jsonl
- Reversed precedence in checkGitForIssues to prefer issues.jsonl
- Updated git merge driver config to use issues.jsonl
- Updated all tests to expect issues.jsonl as the default

issues.jsonl is now the canonical default; beads.jsonl is legacy

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 23:34:22 -08:00
Steve Yegge
3573470d6b bd sync: 2025-11-21 23:34:10 2025-11-21 23:34:10 -08:00
Steve Yegge
a517ec98aa Fix: TestGetAssignedStatus - Missing rootCtx initialization
Failure Type: Real
Root Cause: Test was not initializing the global rootCtx variable that getAssignedStatus depends on, causing it to return nil
Fix Applied: Added rootCtx initialization with proper cleanup using defer, matching the pattern used in other tests
Verification: All tests now pass (go test ./...)

Fixes bd-9f86-baseline-test

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 23:22:12 -08:00
Steve Yegge
31eb257911 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-21 23:09:48 -08:00
Steve Yegge
b8db5ab6fc fix(test): Complete rootCtx initialization fix for all hanging tests (issue #355)
Problem:
- TestFallbackToDirectModeEnablesFlush hung with database deadlock
- TestIdempotentImportNoTimestampChurn and TestImportMultipleUnchangedIssues also hung
- All three tests call flushToJSONL() or autoImportIfNewer() which require rootCtx

Solution:
Applied the same rootCtx initialization pattern from v0.24.1 (commit 822baa0)
to the remaining hanging tests:
- TestFallbackToDirectModeEnablesFlush in direct_mode_test.go
- TestIdempotentImportNoTimestampChurn in import_idempotent_test.go
- TestImportMultipleUnchangedIssues in import_idempotent_test.go

Results:
- Before: Tests hung for 5+ minutes with database deadlock
- After: All tests pass in ~0.1s each

Fixes #355

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 23:09:47 -08:00
Steve Yegge
a40f17c9a5 Update bd JSONL 2025-11-21 23:06:20 -08:00
Steve Yegge
5eefec7eae Fix TestFindJSONLPathDefault to expect beads.jsonl
Updates test and documentation to reflect the intentional change from
issues.jsonl to beads.jsonl (commit 7b865eb from Nov 20, 2025).

Fixes GH #356

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 23:05:41 -08:00
Steve Yegge
89aa83a8d9 docs: Add v0.24.1 changelog entry 2025-11-21 22:13:00 -08:00
Steve Yegge
7dc8c15acb chore: Bump version to 0.24.1 2025-11-21 22:06:07 -08:00
Steve Yegge
d6959d8f8c bd sync: 2025-11-21 22:49:21 2025-11-21 22:49:21 -05:00
Steve Yegge
caf89c7899 bd sync: 2025-11-21 22:48:49 2025-11-21 22:48:49 -05:00
Steve Yegge
787fb4e56f feat: Add date and priority filters to bd search (bd-au0.5)
Adds missing date range and priority filtering to bd search for feature
parity with bd list. Part of command standardization epic (bd-au0).

Changes:
- Add date range flags: --created-after/before, --updated-after/before,
  --closed-after/before
- Add priority range flags: --priority-min, --priority-max
- Support multiple date formats (RFC3339, YYYY-MM-DD, etc.)
- Apply filters in both direct mode and daemon RPC mode
- Add comprehensive tests for new filters

Examples:
  bd search "security" --priority-min 0 --priority-max 2
  bd search "bug" --created-after 2025-01-01
  bd search "refactor" --updated-after 2025-01-01 --priority-min 1

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 22:46:12 -05:00
Steve Yegge
0040e8029b feat: Add test infrastructure with automatic skip list
Overview: Added comprehensive test infrastructure to handle the large
test suite (41K LOC, 313 tests in cmd/bd alone) with automatic skipping
of known broken tests.

Changes:
- .test-skip: List of broken tests to skip (with GH issue references)
- scripts/test.sh: Smart test runner that auto-skips broken tests
- docs/TESTING.md: Comprehensive testing guide
- .claude/test-strategy.md: Quick reference for AI agents
- Updated Makefile to use new test script

Known Issues Filed:
- GH #355: TestFallbackToDirectModeEnablesFlush (database deadlock)
- GH #356: TestFindJSONLPathDefault (wrong JSONL filename)

Performance: 3min total (180s compilation, 3.8s execution)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 22:43:04 -05:00
Steve Yegge
3065db261e feat: Add label operations to bd update command
Implements bd-au0.2, completing all P0 tasks in the command standardization epic.

Changes:
- Add --add-label, --remove-label, --set-labels flags to bd update
- Support multiple labels via repeatable flags
- Implement in both daemon and direct modes
- Add comprehensive tests for all label operations

The bd update command now supports:
  bd update <id> --add-label <label>       # Add one or more labels
  bd update <id> --remove-label <label>    # Remove one or more labels
  bd update <id> --set-labels <labels>     # Replace all labels

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 22:17:26 -05:00
Steve Yegge
ae4cd00e52 bd sync: 2025-11-21 21:59:27 2025-11-21 21:59:27 -05:00
Steve Yegge
99e3d21f35 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-21 21:57:26 -05:00
Steve Yegge
2e2b8d7c2c feat: Accept both integer and P-format for priority flags in bd list
Implements bd-au0.4: Standardize priority flag parsing across all commands.

Changes:
- Use registerPriorityFlag() for main priority flag (was IntP)
- Change priority-min/max from Int to String flags
- Add validation import and use ValidatePriority() for all priority parsing
- Update both direct mode and daemon RPC code paths

Now supports both formats consistently:
- Numeric: --priority 0, --priority-min 1, --priority-max 2
- P-format: --priority P0, --priority-min P1, --priority-max P2

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 21:57:23 -05:00
Steve Yegge
fa727c7d73 refactor: Delete 7 redundant tests from main_test.go (3x speedup)
Problem: main_test.go was testing deprecated legacy path after FlushManager
refactoring (bd-52), duplicating coverage from flush_manager_test.go.

Solution: Delete redundant tests, keep only unique integration tests.

Changes:
- Deleted 7 tests (407 lines) covered by flush_manager_test.go:
  * TestAutoFlushDirtyMarking → TestFlushManagerMarkDirtyTriggersFlush
  * TestAutoFlushDisabled → TestFlushManagerDisabledDoesNotFlush
  * TestAutoFlushDebounce (already skipped, obsolete)
  * TestAutoFlushClearState (tested implicitly in export/sync)
  * TestAutoFlushConcurrency → TestFlushManagerConcurrentMarkDirty
  * TestAutoFlushStoreInactive → TestPerformFlushStoreInactive
  * TestAutoFlushErrorHandling → TestPerformFlushErrorHandling

- Kept 2 unique integration tests:
  * TestAutoFlushOnExit (tests PersistentPostRun)
  * TestAutoFlushJSONLContent (tests actual JSONL output)

- Updated clearAutoFlushState() to no-op when FlushManager exists

Results:
- Before: 18 tests, 1079 lines, ~15-20s
- After: 11 tests, 672 lines, ~5-7s
- Speedup: ~3x faster
- All tests passing 

Files:
- cmd/bd/main_test.go: Deleted 7 tests, removed unused imports
- cmd/bd/autoflush.go: Updated clearAutoFlushState()
- docs/MAIN_TEST_REFACTOR_NOTES.md: Documented solution
- docs/MAIN_TEST_CLEANUP_PLAN.md: Created detailed plan

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 21:29:43 -05:00
Steve Yegge
76ebb2a7b9 chore: Update bd JSONL (todo list from GH #298 work) 2025-11-21 20:52:54 -05:00
Steve Yegge
605fff151e feat: Add GitHub Copilot support with .github/copilot-instructions.md
Addresses GH #298 - GitHub Copilot inconsistently interpreting AGENTS.md

Changes:
- Create .github/copilot-instructions.md (132 lines, Copilot-optimized)
- Update AGENTS.md with prominent Copilot callout
- Enhance bd onboard command to generate copilot-instructions.md

Architecture: Two-file approach for different AI agents
- AGENTS.md (626 lines): Comprehensive guide for all AI agents
- .github/copilot-instructions.md (132 lines): Concise, auto-loaded for Copilot

Note: Untested with GitHub Copilot yet. Feedback from Copilot users welcome!

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-21 20:52:18 -05:00
Steve Yegge
6e702d3ecd Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-21 20:40:23 -05:00
Steve Yegge
ddd209e26a fix: Correct git merge driver placeholders from %L/%R to %A/%B
Git merge drivers only support three placeholders:
- %O (ancestor/base)
- %A (current version)
- %B (other branch's version)

The code was incorrectly using %L and %R, which don't exist in git,
causing them to be passed through literally and breaking JSONL merges.

Changes:
- Fixed merge driver config in init.go, merge.go, README.md, docs
- Added detection in bd doctor with clear error messages
- Added auto-fix in bd doctor --fix
- Added proactive warning in bd sync before git pull
- Added reactive error detection after merge failures
- Updated all tests to use correct placeholders

Now users get helpful guidance at every step:
1. bd doctor detects the issue
2. bd doctor --fix auto-corrects it
3. bd sync warns before pulling if misconfigured
4. Error messages suggest bd doctor --fix when merge fails

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 20:40:18 -05:00
Steve Yegge
8efab3df87 chore: Move design/audit docs from cmd/bd to docs/
Relocate documentation files to centralize all .md files in docs/ directory
(except those with historical precedent in specific locations like commands/,
examples/, integrations/, etc.).

Files moved:
- cmd/bd/doctor/claude.md -> docs/CLAUDE_INTEGRATION.md
- cmd/bd/MAIN_TEST_REFACTOR_NOTES.md -> docs/MAIN_TEST_REFACTOR_NOTES.md
- cmd/bd/TEST_SUITE_AUDIT.md -> docs/TEST_SUITE_AUDIT.md

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 20:31:47 -05:00
Steve Yegge
ce433bb2e8 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-21 20:26:42 -05:00
Steve Yegge
c8bf6a6590 bd sync: 2025-11-21 20:22:28 2025-11-21 20:22:28 -05:00
Steve Yegge
bb5a480445 feat: Add --body flag as alias for --description
Adds --body as a hidden alias for --description in create/update commands,
following GitHub CLI convention for better agent ergonomics.

The --body flag:
- Works alongside existing --description and -d flags
- Hidden from help output to avoid clutter
- Validates conflicts when both flags used with different values
- Available in both 'bd create' and 'bd update' commands

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 20:08:55 -05:00
Steve Yegge
364cedee5d bug: File bd-7yg for merge driver placeholder issue
Documents critical bug affecting all users where git merge driver
uses invalid %L/%R placeholders instead of standard %A/%B.

Discovered while resolving merge conflict - automatic JSONL merge
fails with 'open 7: no such file or directory' error.
2025-11-21 19:52:18 -05:00
Steve Yegge
821880419a Merge branch 'main' of https://github.com/steveyegge/beads
# Conflicts:
#	.beads/beads.jsonl
2025-11-21 19:42:35 -05:00
Steve Yegge
5ae76d24d4 chore: Close 4 test coverage issues (bd-yxy, bd-nbc, bd-lln, bd-gra)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 19:33:12 -05:00
Steve Yegge
58fe00057c feat: Complete GH #353 follow-up phases (bd-9nw, bd-u3t, bd-e0o)
Implements all three follow-up phases for sandbox environment support:

**Phase 1 (bd-9nw): Documentation** 
- Comprehensive sandbox troubleshooting section in TROUBLESHOOTING.md
  - Detailed symptoms, root causes, and escape hatches
  - Step-by-step troubleshooting workflow
  - Comparison table for --sandbox, --force, and --allow-stale flags
- Global flags section added to CLI_REFERENCE.md
  - Documents --sandbox, --allow-stale, and --force flags
  - Usage examples and when to use each flag
- GitHub issue #353 comment with immediate workarounds

**Phase 2 (bd-u3t): Sandbox Auto-Detection** 
- Automatic sandbox detection using syscall.Kill permission checks
  - cmd/bd/sandbox_unix.go: Unix/Linux/macOS implementation
  - cmd/bd/sandbox_windows.go: Windows stub (conservative approach)
  - cmd/bd/sandbox_test.go: Comprehensive test coverage
- Auto-enables sandbox mode when detected
  - Shows: "ℹ️  Sandbox detected, using direct mode"
  - Respects explicit --sandbox or --no-daemon flags
- Updated documentation to reflect auto-detection (v0.21.1+)

**Phase 3 (bd-e0o): Enhanced Daemon Robustness** 
- Permission-aware process checks in cmd/bd/daemon_unix.go
  - Correctly handles EPERM (operation not permitted) from syscall.Kill
  - Treats EPERM as "process exists but not signable" = running
  - Prevents false negatives in sandboxed environments
- Metadata health check in cmd/bd/daemon_event_loop.go
  - Periodic verification that metadata is accessible
  - Helps detect external import operations (bd import --force)
  - Non-fatal logging for diagnostics
- Comprehensive test suite in cmd/bd/daemon_unix_test.go
  - Self-check, init process, nonexistent process, parent process tests

**Impact:**
- Codex users: No manual intervention needed, auto-detected
- Stuck states: Three escape hatches (--sandbox, --force, --allow-stale)
- Daemon robustness: Handles permission-restricted environments gracefully
- All three follow-up issues (bd-9nw, bd-u3t, bd-e0o) closed

**Files changed:**
- cmd/bd/main.go: Auto-detection logic in PersistentPreRun
- cmd/bd/sandbox_unix.go: Unix sandbox detection (new)
- cmd/bd/sandbox_windows.go: Windows sandbox detection stub (new)
- cmd/bd/sandbox_test.go: Sandbox detection tests (new)
- cmd/bd/daemon_unix.go: Permission-aware isProcessRunning()
- cmd/bd/daemon_unix_test.go: Process check tests (new)
- cmd/bd/daemon_event_loop.go: Metadata health check
- docs/TROUBLESHOOTING.md: Comprehensive sandbox section
- docs/CLI_REFERENCE.md: Global flags documentation

Closes bd-9nw, bd-u3t, bd-e0o
Related: GH #353

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 19:32:45 -05:00