feature/Public-execute-to-runresults-lift · L-260922-b7268d - #38
Merged
Merged
Conversation
`_map_run_result_to_run_results` was a private function in `client.py` with one caller, the blocking fallback inside `start_and_wait`. A consumer driving `execute()` itself and wanting `summarize_usage`, `collect_artifacts` or any run-results parity field had to re-read `pipe_output.model_extra` and re-validate the records by hand, which is what the Python starter does today. It moves to `pipelex_sdk/execute_result.py` as `results_from_execute(result)`, beside the `PipelexExecuteResult` it takes and on the side of the import edge that already depends on `runs`. The mapping itself is unchanged, the fallback calls the public name, and `execute()` still returns `PipelexExecuteResult` because that model carries the runner's whole typed envelope. Documented in the blocking-path opener of `docs/run-results.md`, in the bare-runner bullet of `docs/run-usage.md` and in `docs/architecture.md`; `tests/unit/test_results_from_execute.py` pins the function called on its own, including that its result feeds `summarize_usage`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The mapping from a blocking
execute()result ontoRunResultswas a private function inclient.pywith a single caller, the bare-runner fallback insidestart_and_wait. A consumer drivingexecute()itself had to re-readpipe_output.model_extraand re-validate the usage records by hand before it could reachsummarize_usage,collect_artifactsor any of the parity fields — which is what the Python starter does today.It moves to
pipelex_sdk/execute_result.pyasresults_from_execute(result), beside thePipelexExecuteResultit takes and on the side of the import edge that already depends onruns. The mapping itself is unchanged,execute()still returnsPipelexExecuteResultbecause that model carries the runner's whole typed envelope, and the docs now say how a direct caller gets from one to the other.Closes L-260922-b7268d
🤖 Generated with Claude Code
Summary by cubic
Makes the mapping from a blocking
execute()result ontoRunResultspublic asresults_from_execute(result)inpipelex_sdk/execute_result.py.Previously only
start_and_waitused this mapping; a consumer drivingexecute()directly had to re-readpipe_output.model_extraand re-validate usage records by hand to reachsummarize_usage,collect_artifactsor the parity fields. The new function performs the same lift, so direct callers get the sameRunResultsshape the durable path hands back.execute()still returnsPipelexExecuteResultbecause that model carries the runner's whole typed envelope. Adds unit tests and doc updates. Closes L-260922-b7268d.Written for commit 4b5fb1a. Summary will update on new commits.