Commit Graph

2 Commits

Author SHA1 Message Date
Steve Yegge
74f384444b test: Add security and error handling tests for lint warnings
Added comprehensive tests to address gosec and errcheck linter warnings:

1. bd-yxy (P0): Command injection prevention tests for git rm in merge command
   - Added merge_security_test.go with tests for shell metacharacters
   - Verified exec.Command safely passes arguments (no shell interpretation)
   - Added #nosec G204 comment explaining why code is safe

2. bd-nbc (P1): Security tests for file path validation in clean command
   - Added clean_security_test.go with path traversal tests
   - Verified filepath.Join safely constructs paths within .beads directory
   - Added #nosec G304 comment documenting safety guarantees

3. bd-lln (P2): Tests for performFlush error handling in FlushManager
   - Added tests documenting that performFlush intentionally returns nil
   - Errors are handled internally by flushToJSONLWithState
   - Tests verify graceful degradation when store is inactive

4. bd-gra (P2): Error handling test for cmd.Help() in search command
   - Added search_test.go documenting Help() error handling
   - Help() errors intentionally ignored (already in error path, will exit anyway)
   - Added #nosec G104 comment explaining rationale

All new tests pass. The linter warnings are false positives or intentional
design decisions, now documented with tests and #nosec comments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 19:30:48 -05:00
Steve Yegge
1806183d5f feat: Add bd search command for efficient text queries (#347)
Adds a new `bd search` command optimized for quick text searches,
addressing the issue where Claude using MCP bd list consumes 30k tokens.

Features:
- Searches across title, description, and ID with OR logic
- Default limit of 50 results (vs unlimited for bd list)
- Supports key filters: --status, --assignee, --type, --label
- Works in both daemon and direct modes
- Provides --json and --long output formats

Examples:
  bd search "performance" --status open
  bd search "database" --label backend --limit 10
  bd search "bd-5q"  # Search by partial ID

This provides a more efficient alternative to bd list when users
just want to find issues quickly without loading all results.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 22:44:19 -05:00