beads/internal/storage/memory
Erick Matsen 3f2b693bea
fix: respect hierarchy.max-depth config setting (GH#995) (#997)
* fix: respect hierarchy.max-depth config setting (GH#995)

The hierarchy.max-depth config setting was being ignored because storage
implementations had the depth limit hardcoded to 3. This fix:

- Registers hierarchy.max-depth default (3) in config initialization
- Adds hierarchy.max-depth to yaml-only keys for config.yaml storage
- Updates SQLite and Memory storage to read max depth from config
- Adds validation to reject hierarchy.max-depth values < 1
- Adds tests for configurable hierarchy depth

Users can now set deeper hierarchies:
  bd config set hierarchy.max-depth 10

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: extract shared CheckHierarchyDepth function (GH#995)

- Extract duplicated depth-checking logic to types.CheckHierarchyDepth()
- Update sqlite and memory storage backends to use shared function
- Add t.Cleanup() for proper test isolation in sqlite test
- Add equivalent test coverage for memory storage backend
- Add comprehensive unit tests for CheckHierarchyDepth function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:36:52 -08:00
..
hyphenated_test.go fix: resolve remaining hyphenated ID issues in memory store and doctor 2025-11-20 19:01:30 -05:00
memory.go fix: respect hierarchy.max-depth config setting (GH#995) (#997) 2026-01-10 13:36:52 -08:00
memory_more_coverage_test.go fix: bd --no-db dep tree now shows complete tree (GH#836) 2026-01-01 11:03:46 -08:00
memory_test.go fix: respect hierarchy.max-depth config setting (GH#995) (#997) 2026-01-10 13:36:52 -08:00
ready_blocked_nodb_test.go refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
tree_test.go fix: bd --no-db dep tree now shows complete tree (GH#836) 2026-01-01 11:03:46 -08:00