init

Router assembly for Phase 2 segmentation routes

Router Assembly


init_segmentation_routers


def init_segmentation_routers(
    state_store:SQLiteWorkflowStateStore, # The workflow state store
    workflow_id:str, # The workflow identifier
    source_service:SourceService, # Service for fetching source blocks
    segmentation_service:SegmentationService, # Service for NLTK sentence splitting
    prefix:str, # Base prefix for segmentation routes (e.g., "/workflow/seg")
    max_history_depth:int=50, # Maximum history stack depth
    wrapped_handlers:Dict=None, # Dict with 'init', 'split', 'merge', 'undo', 'reset', 'ai_split' keys
)->Tuple: # (routers, urls, merged_routes)

Initialize and return all segmentation routers with URL bundle.

The wrapped_handlers dict should contain handlers that already have cross-domain concerns (KB system, alignment status) handled by the combined layer’s wrapper factories.