Skip to content

feat(hooks): align PostRunPayload with InvocationContext (ITL-531)#237

Merged
eywalker merged 9 commits into
mainfrom
eywalker/itl-531-align-postrunpayload-with-sideeffectpod-invocationcontext
Jul 21, 2026
Merged

feat(hooks): align PostRunPayload with InvocationContext (ITL-531)#237
eywalker merged 9 commits into
mainfrom
eywalker/itl-531-align-postrunpayload-with-sideeffectpod-invocationcontext

Conversation

@kurodo3

@kurodo3 kurodo3 Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extracts InvocationContext and InvocationHashConfig from side_effects.py into a new stdlib-only leaf module src/orcapod/invocation.py, breaking a potential circular-import path
  • Adds invocation_context: InvocationContext | None = None to PostRunPayload, giving post-run hook authors access to the same deterministic invocation hash, format_id(), and pipeline_run_id that SideEffectPod user functions already receive
  • Threads run_id through _build_post_run_payload in both _FunctionPodBase and CachedFunctionPod so InvocationContext is always built and populated for every function pod invocation (not just ctx-aware ones)
  • Exports InvocationContext and InvocationHashConfig from the orcapod public API

Test plan

  • 7 new tests in TestInvocationContextOnPayload (always present, deterministic hash, format_id encoding, pipeline_run_id is None standalone, error payload has context)
  • test_public_api_imports extended to assert InvocationContext and InvocationHashConfig
  • Full test suite: 4575 passed, 93 skipped, 6 xfailed

Closes ITL-531

🤖 Generated with Claude Code

@kurodo3
kurodo3 Bot force-pushed the eywalker/itl-531-align-postrunpayload-with-sideeffectpod-invocationcontext branch from 8a0317c to 5cf597d Compare July 21, 2026 07:02
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/orcapod/invocation.py 97.05% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

kurodo3 Bot and others added 9 commits July 21, 2026 09:39
…to leaf module (ITL-531)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove unused _serialize_component import from side_effects.py, update
the module docstring to omit re-exported types, and add internal
constructor parameters to InvocationContext.Args section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(ITL-531)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Thread run_id into _build_post_run_payload and call _build_invocation_context
so every PostRunPayload carries a fully-populated InvocationContext with
pipeline_run_id, invocation hash, and format_id support.
…ding

Update _invoke_with_hooks and _async_invoke_with_hooks docstrings in
function_pod.py and cached_function_pod.py to accurately reflect that
run_id is now forwarded to PostRunPayload.invocation_context, not
just process_data / unused.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lic API

Extend test_public_api_imports to cover the two new exports added by ITL-531.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kurodo3
kurodo3 Bot force-pushed the eywalker/itl-531-align-postrunpayload-with-sideeffectpod-invocationcontext branch from 5cf597d to 2fda992 Compare July 21, 2026 09:46
@eywalker
eywalker merged commit ec05f2f into main Jul 21, 2026
11 checks passed
@eywalker
eywalker deleted the eywalker/itl-531-align-postrunpayload-with-sideeffectpod-invocationcontext branch July 21, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant