Skip to content

feature/Public-execute-to-runresults-lift · L-260922-b7268d - #38

Merged
lchoquel merged 1 commit into
devfrom
feature/Public-execute-to-runresults-lift
Sep 22, 2026
Merged

lchoquel merged 1 commit into
devfrom
feature/Public-execute-to-runresults-lift

Conversation

@lchoquel

@lchoquel lchoquel commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

The mapping from a blocking execute() result onto RunResults was a private function in client.py with a single caller, the bare-runner fallback inside start_and_wait. A consumer driving execute() itself had to re-read pipe_output.model_extra and re-validate the usage records by hand before it could reach summarize_usage, collect_artifacts or any of the parity fields — 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, execute() still returns PipelexExecuteResult because 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 onto RunResults public as results_from_execute(result) in pipelex_sdk/execute_result.py.

Previously only start_and_wait used this mapping; a consumer driving execute() directly had to re-read pipe_output.model_extra and re-validate usage records by hand to reach summarize_usage, collect_artifacts or the parity fields. The new function performs the same lift, so direct callers get the same RunResults shape the durable path hands back. execute() still returns PipelexExecuteResult because 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.

Review in cubic

`_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>
@lchoquel
lchoquel merged commit 629124c into dev Sep 22, 2026
18 checks passed
@lchoquel
lchoquel deleted the feature/Public-execute-to-runresults-lift branch September 22, 2026 09:11
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant