put rest and sse to acceptance criteria. revise components. add system flows diagram

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-11-30 01:02:07 +02:00
parent ef75cc5877
commit 1082316660
17 changed files with 1906 additions and 434 deletions
@@ -113,6 +113,31 @@ class IFlightProcessor(ABC):
- System initialization and resource management
- Flight state machine management
- **Chunk-aware frame processing (Atlas multi-map architecture)**
- **Background task management for each flight**
- **Event subscription for F11 recovery events**
### Event-Based Communication
F02 subscribes to events from F11 Failure Recovery Coordinator instead of F11 directly calling F02's status update methods. This decouples recovery logic from flight state management.
**Events Subscribed (from F11)**:
- `RecoveryStarted`: Update flight status to "recovering"
- `RecoverySucceeded`: Update flight status to "processing", resume processing loop
- `RecoveryFailed`: Update flight status to "blocked", blocked=True
- `UserInputNeeded`: Update flight status to "blocked", blocked=True, await user fix
- `UserFixApplied`: Update flight status to "processing", resume processing loop
- `ChunkCreated`: Log chunk creation, update internal tracking
- `ChunkAnchored`: Log chunk anchor, update statistics
- `ChunkMerged`: Trigger result updates via F14
### Background Task Management
F02 is responsible for managing background tasks per flight:
- **Chunk matching task**: Background task for matching unanchored chunks (delegated to F11)
- **Asynchronous refinement task**: Background optimization and result publishing (via F10, F14)
- **Task lifecycle**: Tasks created on flight start, cancelled on flight completion/deletion
Background tasks are coordinated via Python `asyncio` or `ThreadPoolExecutor`, with F02 as the owner. F11 executes chunk matching logic but F02 schedules and monitors the tasks.
---