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

1.1 KiB

Composite Nesting Support

Phase 1: Store — Cycle & Depth Validation

  • Add get_transitive_dependencies() to ColorStripStore
  • Add validate_nesting() with cycle detection + depth limit (MAX_DEPTH=4)

Phase 2: API — Validation in Create/Update

  • Call validate_nesting() in create handler for composite sources
  • Call validate_nesting() in update handler for composite sources

Phase 3: Runtime — Depth Guard in Stream

  • Add depth parameter to CompositeColorStripStream
  • Pass depth through ColorStripStreamManager.acquire()
  • Cap depth at runtime to prevent runaway nesting

Phase 4: Frontend — Allow Composites in Layer Dropdown

  • Remove source_type !== 'composite' filter (keep self-exclusion)
  • Update docstring in composite_stream.py

Phase 5: Tests

  • Cycle detection tests (A→B→A, self-reference)
  • Depth limit tests (chain exceeding MAX_DEPTH)
  • Valid nesting tests (A→B both composite, no cycle)

Phase 6: Lint & Build

  • Ruff check passes
  • TypeScript build passes
  • All existing tests pass (715/715)