Detect handler-induced early termination and populate RunResult.last_active_chain#341
Open
Detect handler-induced early termination and populate RunResult.last_active_chain#341
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RunResult.last_active_chainto the Rust VM result object and public typing surfacethrewbefore capturing the chain so caught handler failures retain the offending handler provenanceEvidence
RunResult always exposes
last_active_chainuv run pytest tests/core/test_vm_proto_004_traceback_data.py -q4 passed in 0.04suv run python - <<'PY' ... PYok_last_active_chain []caught_is_ok Truecaught_traceback_data Nonecaught_last_active_chain_len 5caught_last_effect_result ... {"kind": "threw", "handler_name": "bad_handler", ...}Existing handler failure behavior still passes with the new tracking in place
uv run pytest tests/core/test_vm_proto_004_traceback_data.py tests/test_try_finally_in_do.py::test_handler_abandon_raises_error tests/core/test_get_execution_context_effect.py::test_handler_return_protocol_error_also_enriches_execution_context tests/core/test_traceback_spec_compliance.py::test_spec_example_6_handler_return_abandons_inner_chain -q7 passed in 0.10sStub surface is type-check clean for the new RunResult attribute
uv run pyright packages/doeff-vm/doeff_vm/__init__.pyi0 errors, 0 warnings, 0 informationsRef: gh-336-early-termination-detection