Files
ledgrab/TODO.md
T
alexei.dolgolyov cc9900d801
Lint & Test / test (push) Successful in 2m17s
feat: support nesting for composite color strip sources
Allow composite sources to reference other composite/mapped sources as
layers. Adds cycle detection (via transitive dependency graph walk),
depth limiting (MAX_COMPOSITE_DEPTH=4), and a runtime safety net in the
stream manager. Frontend layer dropdown now shows all source types
except the source being edited.

17 new tests covering cycles, depth limits, and valid nesting — all
715 tests passing.
2026-04-12 20:41:15 +03:00

35 lines
1.1 KiB
Markdown

# Composite Nesting Support
## Phase 1: Store — Cycle & Depth Validation
- [x] Add `get_transitive_dependencies()` to ColorStripStore
- [x] Add `validate_nesting()` with cycle detection + depth limit (MAX_DEPTH=4)
## Phase 2: API — Validation in Create/Update
- [x] Call `validate_nesting()` in create handler for composite sources
- [x] Call `validate_nesting()` in update handler for composite sources
## Phase 3: Runtime — Depth Guard in Stream
- [x] Add `depth` parameter to CompositeColorStripStream
- [x] Pass depth through ColorStripStreamManager.acquire()
- [x] Cap depth at runtime to prevent runaway nesting
## Phase 4: Frontend — Allow Composites in Layer Dropdown
- [x] Remove `source_type !== 'composite'` filter (keep self-exclusion)
- [x] Update docstring in composite_stream.py
## Phase 5: Tests
- [x] Cycle detection tests (A→B→A, self-reference)
- [x] Depth limit tests (chain exceeding MAX_DEPTH)
- [x] Valid nesting tests (A→B both composite, no cycle)
## Phase 6: Lint & Build
- [x] Ruff check passes
- [x] TypeScript build passes
- [x] All existing tests pass (715/715)