beads/internal/types
Peter Chanthamynavong c11fa799be
fix(orphans): honor --db flag for cross-repo orphan detection (#1200)
* fix(orphans): honor --db flag for cross-repo orphan detection

Problem:
- `bd orphans --db /path` ignored the --db flag entirely
- FindOrphanedIssues() hardcoded local .beads/ directory

Solution:
- Introduce IssueProvider interface for abstract issue lookup
- Add StorageProvider adapter wrapping Storage instances
- Update FindOrphanedIssues to accept provider instead of path
- Wire orphans command to create provider from --db flag

Closes: steveyegge/beads#1196

* test(orphans): add cross-repo and provider tests for --db flag fix

- Add TestFindOrphanedIssues_WithMockProvider (table-driven, UT-01 through UT-09)
- Add TestFindOrphanedIssues_CrossRepo (validates --db flag honored)
- Add TestFindOrphanedIssues_LocalProvider (backward compat RT-01)
- Add TestFindOrphanedIssues_ProviderError (error handling UT-07)
- Add TestFindOrphanedIssues_IntegrationCrossRepo (IT-02 full)
- Add TestLocalProvider_* unit tests

Coverage for IssueProvider interface and cross-repo orphan detection.

* docs: add bd orphans command to CLI reference

Document the orphan detection command including the cross-repo
workflow enabled by the --db flag fix in this PR.
2026-01-21 19:52:31 -08:00
..
federation.go feat(types): add FederatedMessage type for inter-town protocol (bd-wkumz.11) 2026-01-20 23:15:14 -08:00
federation_test.go refactor(types): use strings.Contains in federation tests 2026-01-21 10:40:52 -08:00
id_generator.go fix: respect hierarchy.max-depth config setting (GH#995) (#997) 2026-01-10 13:36:52 -08:00
id_generator_test.go fix: respect hierarchy.max-depth config setting (GH#995) (#997) 2026-01-10 13:36:52 -08:00
lock.go Implement exclusive lock protocol for daemon/external tool coexistence 2025-10-25 23:32:47 -07:00
lock_check.go Address gosec security warnings (bd-102) 2025-10-26 22:48:19 -07:00
lock_check_test.go Fix gosec warnings: tighten file permissions and add exclusions (bd-b47c034e) 2025-11-02 15:39:00 -08:00
lock_test.go Implement exclusive lock protocol for daemon/external tool coexistence 2025-10-25 23:32:47 -07:00
orphans.go fix(orphans): honor --db flag for cross-repo orphan detection (#1200) 2026-01-21 19:52:31 -08:00
process.go Implement exclusive lock protocol for daemon/external tool coexistence 2025-10-25 23:32:47 -07:00
process_test.go Implement exclusive lock protocol for daemon/external tool coexistence 2025-10-25 23:32:47 -07:00
types.go fix(ready): exclude molecule steps from bd ready by default (#1246) 2026-01-21 19:30:15 -08:00
types_test.go refactor(types): remove Gas Town type constants from beads core (bd-w2zz4) 2026-01-21 10:36:59 -08:00