Coverage for src/objectstate/collection_containers.py: 0%

5 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-17 07:22 +0000

1""" 

2Collection containers for ObjectState hierarchy tracking. 

3 

4These dataclasses define the minimal schema for tracking parent-child relationships 

5in the ObjectState hierarchy. They are pure data containers with no logic. 

6 

7Why these exist: 

8- RootState: Tracks which plates (orchestrators) exist in the application 

9- Pipeline class already exists - no PipelineState needed 

10- No PlateState - orchestrator already has plate_path, everything else derives 

11""" 

12from dataclasses import dataclass, field 

13from typing import List 

14 

15 

16@dataclass 

17class RootState: 

18 """Root container tracking all plates in the application. 

19 

20 ObjectState wraps this to make orchestrator_scope_ids a tracked parameter. 

21 No methods - pure data container. 

22 

23 The orchestrator_scope_ids list contains plate_paths (strings). 

24 Each plate_path is both: 

25 - The unique identifier for the plate 

26 - The scope_id for the orchestrator's PipelineConfig ObjectState 

27 

28 Everything else derives from these path strings: 

29 - Display name: Path(plate_path).name (or config.display_name if added later) 

30 - Pipeline scope: f"{plate_path}::pipeline" 

31 - Orchestrator: Created on Init Plate, ephemeral 

32 

33 Why just strings, not wrapper objects: 

34 - PlateState would wrap a string with derived fields (unnecessary indirection) 

35 - Single source of truth: if custom names needed, add to PipelineConfig 

36 - Orchestrator already has plate_path - no duplication 

37 """ 

38 orchestrator_scope_ids: List[str] = field(default_factory=list)