Parent: #17171
Extract behavior-preserving, pure domain logic for identifying and ordering Helix work across attempts and resubmissions.
Scope
- Introduce explicit types for stage attempt, logical work-stream identity, and job incarnation.
- Move chain-key construction, lineage traversal, latest-incarnation selection, and old-to-new ordering out of mutable monitor state.
- Preserve queue-sensitive identity and higher-stage-attempt precedence.
- Add table-driven tests for malformed, incomplete, linked, and unlinked lineage.
Acceptance criteria
- Identity and lineage decisions require no service calls or mutable global state.
- Existing attempt-scoped and multi-attempt scenarios retain their behavior.
MonitorState no longer owns lineage algorithms.
Parent: #17171
Extract behavior-preserving, pure domain logic for identifying and ordering Helix work across attempts and resubmissions.
Scope
Acceptance criteria
MonitorStateno longer owns lineage algorithms.