fix(core): validate replay operation identity - #698
Conversation
This comment has been minimized.
This comment has been minimized.
| except ExecutionError as e: | ||
| # Execution-terminal SDK errors (including nondeterminism) must | ||
| # bypass branch failure tolerance and custom completion policies. | ||
| events.put(BranchEvent.fatal(executable.index, e)) |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_dgw6ii4qxklkvjhea4ieegv2i6
[P1] Preserve fatal errors reported after early completion
Once a completion policy ends the coordinator loop, the queue is drained only once and the pool shuts down with wait=False. A running branch reaching this catch afterward leaves an unconsumed fatal event; ExecutionState.close() joins the pool without inspecting its futures, so map/parallel can checkpoint success despite nondeterministic history. Retain fatal state that is checked before the parent terminal checkpoint, and add a barrier-based early-completion regression test.
| branch_checkpoint = child_context.state.get_checkpoint_result( | ||
| operation_identifier.operation_id | ||
| ) | ||
| operation_identifier.validate_checkpoint(branch_checkpoint.operation) |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_7pptyptccbf3r2g5kacbf3pjp6
[P1] Reject NESTED branch checkpoints when replaying in FLAT mode
This validation runs only for non-virtual branches. When a STARTED or ReplayChildren parent is replayed after changing NESTED to FLAT, the old successful branch checkpoint has the same id, type, subtype, name, and parent; child_handler consumes its cached result without executing the virtual branch, so the changed inner hierarchy is never validated. In FLAT mode, reject any existing branch-container checkpoint before calling child_handler, and add a real map/parallel NESTED→FLAT replay test.
Codex AI reviewTwo P1 replay-safety gaps remain in concurrent map/parallel handling. Tests do not cover early-completion races or actual NESTED→FLAT replay. Reviewed commit |
Summary
Testing
Closes #692